Skip to content

Commit 4073291

Browse files
authored
fix: update micromatch to v4 (#199)
BREAKING CHANGE: Drops support for Node v6, v8, v10 and v15
1 parent 8387886 commit 4073291

File tree

14 files changed

+12486
-8310
lines changed

14 files changed

+12486
-8310
lines changed

.babelrc

Lines changed: 0 additions & 17 deletions
This file was deleted.

.eslintrc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66
"files": ["test.js", "puppeteer.test.js"],
77
"env": {
88
"jest": true
9-
},
10-
"rules": {
11-
"no-console": "off"
129
}
1310
},
1411
{
@@ -27,6 +24,7 @@
2724
}
2825
],
2926
"rules": {
30-
"prettier/prettier": ["error", { "trailingComma": "all" }]
27+
"prettier/prettier": ["error", { "trailingComma": "all" }],
28+
"no-await-in-loop": "off"
3129
}
3230
}

.github/workflows/node.js.yml

Lines changed: 8 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
strategy:
1919
fail-fast: false
2020
matrix:
21-
node-version: [6.x, 8.x, 10.x, 12.x, 14.x, 15.x, 16.x, 17.x]
21+
node-version: [12.x, 14.x, 16.x, 17.x]
2222
html-plugin-version: [3, 4, 5]
2323
webpack-version: [4, 5]
2424
exclude:
@@ -28,26 +28,9 @@ jobs:
2828
# plugin@3 only supports webpack@4
2929
- html-plugin-version: 3
3030
webpack-version: 5
31-
# webpack@5 and plugin@5 does not support node 6 or 8
32-
- node-version: 6.x
33-
webpack-version: 5
34-
- node-version: 6.x
35-
html-plugin-version: 5
36-
- node-version: 8.x
37-
webpack-version: 5
38-
- node-version: 8.x
39-
html-plugin-version: 5
40-
- node-version: 10.x
41-
html-plugin-version: 5
42-
include:
43-
- node-version: 10.x
44-
install-puppeteer: true
45-
- node-version: 12.x
46-
install-puppeteer: true
47-
- node-version: 14.x
48-
install-puppeteer: true
49-
- node-version: 15.x
50-
install-puppeteer: true
31+
# webpack@4 does not support node@17: https://github.com/webpack/webpack/issues/14532
32+
- node-version: 17.x
33+
webpack-version: 4
5134
runs-on: ubuntu-latest
5235

5336
steps:
@@ -63,11 +46,6 @@ jobs:
6346
run: |
6447
yarn
6548
yarn add --dev html-webpack-plugin@${{matrix.html-plugin-version }} webpack@${{ matrix.webpack-version }}
66-
git checkout yarn.lock
67-
- name: install puppeteer
68-
if: ${{ matrix.install-puppeteer }}
69-
run: |
70-
yarn add --dev puppeteer
7149
yarn example
7250
git checkout yarn.lock
7351
- name: run tests
@@ -89,9 +67,8 @@ jobs:
8967
node-version: 'lts/*'
9068
cache: yarn
9169
- run: yarn
92-
- name: install puppeteer
70+
- name: build example
9371
run: |
94-
yarn add --dev puppeteer
9572
yarn example
9673
git checkout yarn.lock
9774
- name: run tests
@@ -101,20 +78,11 @@ jobs:
10178
runs-on: ubuntu-latest
10279

10380
steps:
104-
- uses: actions/checkout@v2
105-
- name: Get yarn cache directory path
106-
id: yarn-cache-dir-path
107-
run: echo "::set-output name=dir::$(yarn cache dir)"
108-
- uses: actions/cache@v2
109-
id: yarn-cache
110-
with:
111-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
112-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
113-
restore-keys: |
114-
${{ runner.os }}-yarn-
81+
- uses: actions/checkout@v3
11582
- uses: actions/setup-node@v3
11683
with:
11784
node-version: 'lts/*'
85+
cache: yarn
11886
- run: yarn
11987
- run: yarn lint
12088

@@ -133,7 +101,7 @@ jobs:
133101
cache: yarn
134102
- name: install
135103
run: yarn
136-
- run: npx semantic-release@17
104+
- run: yarn semantic-release
137105
env:
138106
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
139107
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,11 @@ coverage/
88
build/
99
dist/
1010
.eslintcache
11+
12+
# https://yarnpkg.com/advanced/qa#which-files-should-be-gitignored but nested for e2e directories
13+
**/.yarn/*
14+
!**/.yarn/releases
15+
!**/.yarn/plugins
16+
!**/.yarn/sdks
17+
!**/.yarn/versions
18+
**/.pnp.*

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
yarn lint-staged

.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

Lines changed: 546 additions & 0 deletions
Large diffs are not rendered by default.

.yarn/releases/yarn-3.2.0.cjs

Lines changed: 785 additions & 0 deletions
Large diffs are not rendered by default.

.yarnrc.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
enableGlobalCache: true
2+
3+
nodeLinker: node-modules
4+
5+
plugins:
6+
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
7+
spec: "@yarnpkg/plugin-interactive-tools"
8+
9+
yarnPath: .yarn/releases/yarn-3.2.0.cjs

package.json

Lines changed: 35 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,20 @@
66
"lib/",
77
"index.d.ts"
88
],
9-
"main": "lib/index.js",
9+
"main": "src/index.js",
1010
"scripts": {
11-
"clean": "del-cli lib/ coverage/ example/*/build example/*/dist",
12-
"prebuild": "npm run clean",
13-
"build": "babel src/ --out-dir lib/",
14-
"postbuild": "prettier lib/* --write",
15-
"cover": "jest --coverage",
16-
"preexample": "npm run clean && npm run build",
17-
"example": "npm run example:dll && npm run example:polyfill",
11+
"clean": "del-cli lib/ coverage/ \"example/*/build\" \"example/*/dist\"",
12+
"cover": "yarn run test --coverage",
13+
"example": "yarn run clean && yarn run example:dll && yarn run example:polyfill",
1814
"example:dll": "webpack --config example/dll/webpack.config.dll.js && webpack --config example/dll/webpack.config.js",
1915
"example:polyfill": "webpack --config example/polyfill/webpack.config.js",
2016
"lint": "eslint --cache .",
2117
"update-license": "licensor --width 72",
22-
"build-and-update-license": "npm run build && npm run update-license",
23-
"prepare": "npm run build",
24-
"pretest": "npm run example",
25-
"test": "jest"
18+
"build-and-update-license": "yarn run update-license",
19+
"test": "jest",
20+
"postinstall": "husky install",
21+
"prepack": "pinst --disable",
22+
"postpack": "pinst --enable"
2623
},
2724
"repository": "SimenB/add-asset-html-webpack-plugin",
2825
"keywords": [
@@ -37,41 +34,36 @@
3734
},
3835
"homepage": "https://github.com/SimenB/add-asset-html-webpack-plugin#readme",
3936
"dependencies": {
40-
"globby": "^9.0.0",
41-
"micromatch": "^3.1.3",
42-
"p-each-series": "^1.0.0"
37+
"globby": "^9.2.0",
38+
"micromatch": "^4.0.4"
4339
},
4440
"devDependencies": {
45-
"@babel/cli": "^7.0.0",
46-
"@babel/core": "^7.0.1",
47-
"@babel/plugin-transform-modules-commonjs": "^7.0.0",
48-
"@babel/preset-env": "^7.0.0",
49-
"babel-jest": "^24.0.0",
50-
"babel-plugin-add-module-exports": "^1.0.0",
5141
"classnames": "^2.2.5",
52-
"del-cli": "^1.1.0",
53-
"eslint": "^5.6.0",
42+
"del-cli": "^4.0.1",
43+
"eslint": "^8.10.0",
5444
"eslint-config-simenb-base": "^15.0.1",
55-
"eslint_d": "^7.1.0",
5645
"express": "^4.17.1",
57-
"html-webpack-plugin": "^4.0.0",
58-
"husky": "^1.0.1",
59-
"jest": "^24.0.0",
60-
"jest-watch-typeahead": "^0.2.0",
46+
"html-webpack-plugin": "^5.2.0",
47+
"husky": "^7.0.0",
48+
"jest": "^27.0.0",
49+
"jest-watch-typeahead": "^1.0.0",
6150
"licensor": "^4.0.0",
62-
"lint-staged": "^7.0.0",
63-
"prettier": "^1.8.2",
64-
"slash": "^2.0.0",
51+
"lint-staged": "^12.3.5",
52+
"pinst": "^3.0.0",
53+
"prettier": "^2.2.1",
54+
"puppeteer": "^13.5.0",
55+
"semantic-release": "^19.0.2",
56+
"slash": "^3.0.0",
6557
"stoppable": "^1.1.0",
66-
"webpack": "^4.0.0",
67-
"webpack-cli": "^3.1.0"
58+
"webpack": "^5.23.0",
59+
"webpack-cli": "^4.5.0"
6860
},
6961
"peerDependencies": {
7062
"html-webpack-plugin": "^3.0.4 || ^4.0.0-0 || ^5.0.0",
7163
"webpack": "^4.0.0 || ^5.0.0"
7264
},
7365
"engines": {
74-
"node": ">=6"
66+
"node": "^12.13.0 || ^14.15.0 || >=16.0.0"
7567
},
7668
"jest": {
7769
"testEnvironment": "node",
@@ -83,35 +75,25 @@
8375
"statements": 100
8476
}
8577
},
78+
"transform": {},
8679
"watchPlugins": [
8780
"jest-watch-typeahead/filename",
8881
"jest-watch-typeahead/testname"
8982
]
9083
},
9184
"lint-staged": {
92-
"*.js": [
93-
"eslint --fix --cache",
94-
"git add"
95-
],
96-
"*.{md,json,ts}": [
97-
"prettier --write",
98-
"git add"
99-
],
100-
".{eslintrc,babelrc}": [
101-
"prettier --write",
102-
"git add"
103-
]
85+
"*.{js,ts}": "eslint --fix --cache",
86+
"*.{md,json}": "prettier --write",
87+
".eslintrc": "prettier --write"
10488
},
10589
"prettier": {
10690
"singleQuote": true,
91+
"arrowParens": "avoid",
10792
"trailingComma": "all",
10893
"proseWrap": "always",
10994
"overrides": [
11095
{
111-
"files": [
112-
".eslintrc",
113-
".babelrc"
114-
],
96+
"files": ".eslintrc",
11597
"options": {
11698
"parser": "json"
11799
}
@@ -130,20 +112,13 @@
130112
}
131113
]
132114
},
133-
"husky": {
134-
"hooks": {
135-
"pre-commit": "lint-staged"
136-
}
137-
},
138115
"release": {
139116
"branches": [
140117
"main"
141118
]
142119
},
143120
"resolutions": {
144-
"**/@types/webpack-sources/source-map": "0.6.1",
145-
"anymatch": "^2.0.0",
146-
"merge2": "~1.2.3",
147-
"stack-utils": "1.0.2"
148-
}
121+
"@semantic-release/npm/npm": "7.20.6"
122+
},
123+
"packageManager": "yarn@3.2.0"
149124
}

puppeteer.test.js

Lines changed: 8 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,15 @@
1-
import path from 'path';
2-
import fs from 'fs';
3-
import { promisify } from 'util';
4-
import express from 'express';
5-
import stoppable from 'stoppable';
1+
const path = require('path');
2+
const fs = require('fs');
3+
const { promisify } = require('util');
4+
const express = require('express');
5+
const stoppable = require('stoppable');
6+
const puppeteer = require('puppeteer');
67

7-
let puppeteer;
88
let browser;
99

10-
(() => {
11-
try {
12-
// eslint-disable-next-line global-require,import/no-unresolved,import/no-extraneous-dependencies
13-
puppeteer = require('puppeteer');
14-
} catch (error) {
15-
if (error.code !== 'MODULE_NOT_FOUND') {
16-
throw error;
17-
}
18-
}
19-
})();
20-
21-
if (!puppeteer) {
22-
test.only('Unable to load puppeteer, skipping tests', () => {
23-
console.warn('Unable to load puppeteer, skipping tests');
24-
});
25-
}
26-
2710
beforeAll(async () => {
28-
if (puppeteer) {
29-
browser = await puppeteer.launch();
30-
}
31-
}, 10000);
11+
browser = await puppeteer.launch();
12+
}, 30000);
3213

3314
afterAll(async () => {
3415
if (browser) {

0 commit comments

Comments
 (0)