Skip to content

Commit 53b80b5

Browse files
authored
build!: minimum supported Node.js version is 18.12.0
1 parent a893046 commit 53b80b5

File tree

13 files changed

+7920
-16096
lines changed

13 files changed

+7920
-16096
lines changed

.github/workflows/nodejs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666
strategy:
6767
matrix:
6868
os: [ubuntu-latest, windows-latest, macos-latest]
69-
node-version: [14.x, 16.x, 18.x, 20.x]
69+
node-version: [18.x, 20.x, 21.x]
7070
webpack-version: [latest]
7171

7272
runs-on: ${{ matrix.os }}

babel.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ module.exports = (api) => {
1010
"@babel/preset-env",
1111
{
1212
targets: {
13-
node: "14.15.0",
13+
node: "18.12.0",
1414
},
1515
},
1616
],

package-lock.json

Lines changed: 7869 additions & 16045 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"main": "dist/index.js",
1515
"types": "types/index.d.ts",
1616
"engines": {
17-
"node": ">= 14.15.0"
17+
"node": ">= 18.12.0"
1818
},
1919
"scripts": {
2020
"start": "npm run build -- -w",
@@ -54,28 +54,28 @@
5454
"devDependencies": {
5555
"@babel/cli": "^7.23.4",
5656
"@babel/core": "^7.23.7",
57-
"@babel/preset-env": "^7.23.7",
58-
"@commitlint/cli": "^17.7.2",
59-
"@commitlint/config-conventional": "^17.7.0",
60-
"@types/node": "^18.15.11",
57+
"@babel/preset-env": "^7.23.8",
58+
"@commitlint/cli": "^18.4.4",
59+
"@commitlint/config-conventional": "^18.4.4",
60+
"@types/node": "^20.11.2",
6161
"@webpack-contrib/eslint-config-webpack": "^3.0.0",
6262
"babel-jest": "^29.7.0",
6363
"copy-webpack-plugin": "^9.1.0",
6464
"cross-env": "^7.0.3",
65-
"cspell": "^6.31.2",
66-
"del": "^6.1.1",
67-
"del-cli": "^4.0.1",
65+
"cspell": "^8.3.2",
66+
"del": "^7.1.0",
67+
"del-cli": "^5.1.0",
6868
"eslint": "^8.56.0",
69-
"eslint-config-prettier": "^8.9.0",
69+
"eslint-config-prettier": "^9.1.0",
7070
"eslint-plugin-import": "^2.29.1",
7171
"husky": "^8.0.3",
7272
"jest": "^29.7.0",
73-
"lint-staged": "^12.5.0",
74-
"memfs": "^3.5.1",
73+
"lint-staged": "^15.2.0",
74+
"memfs": "^4.6.0",
7575
"npm-run-all": "^4.1.5",
76-
"prettier": "^2.8.8",
77-
"standard-version": "^9.3.1",
78-
"typescript": "^4.9.5",
76+
"prettier": "^3.2.2",
77+
"standard-version": "^9.5.0",
78+
"typescript": "^5.3.3",
7979
"webpack": "^5.89.0"
8080
},
8181
"keywords": [

src/index.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ class JsonMinimizerPlugin {
7878
*/
7979
static buildError(error, file, context) {
8080
return new Error(
81-
`"${file}" in "${context}" from Json Minimizer:\n${error}`
81+
`"${file}" in "${context}" from Json Minimizer:\n${error}`,
8282
);
8383
}
8484

@@ -105,7 +105,7 @@ class JsonMinimizerPlugin {
105105
!compiler.webpack.ModuleFilenameHelpers.matchObject.bind(
106106
// eslint-disable-next-line no-undefined
107107
undefined,
108-
this.options
108+
this.options,
109109
)(name)
110110
) {
111111
return false;
@@ -123,7 +123,7 @@ class JsonMinimizerPlugin {
123123
const output = await cacheItem.getPromise();
124124

125125
return { name, info, inputSource: source, output, cacheItem };
126-
})
126+
}),
127127
);
128128

129129
const { RawSource } = compiler.webpack.sources;
@@ -160,7 +160,7 @@ class JsonMinimizerPlugin {
160160
compilation.errors.push(
161161
/** @type {WebpackError} */ (
162162
JsonMinimizerPlugin.buildError(error, name, compiler.context)
163-
)
163+
),
164164
);
165165

166166
return;
@@ -177,7 +177,7 @@ class JsonMinimizerPlugin {
177177
const { source } = output;
178178

179179
compilation.updateAsset(name, source, newInfo);
180-
})()
180+
})(),
181181
);
182182
}
183183

@@ -199,7 +199,7 @@ class JsonMinimizerPlugin {
199199
compiler.webpack.Compilation.PROCESS_ASSETS_STAGE_OPTIMIZE_SIZE,
200200
additionalAssets: true,
201201
},
202-
(assets) => this.optimize(compiler, compilation, assets)
202+
(assets) => this.optimize(compiler, compilation, assets),
203203
);
204204

205205
compilation.hooks.statsPrinter.tap(pluginName, (stats) => {
@@ -210,9 +210,9 @@ class JsonMinimizerPlugin {
210210
(minimized, { green, formatFlag }) =>
211211
minimized
212212
? /** @type {Function} */ (green)(
213-
/** @type {Function} */ (formatFlag)("minimized")
213+
/** @type {Function} */ (formatFlag)("minimized"),
214214
)
215-
: ""
215+
: "",
216216
);
217217
});
218218
});

test/JsonMinimizerPlugin.test.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ describe("JsonMinimizerPlugin", () => {
7777
{
7878
loader: path.resolve(
7979
__dirname,
80-
"./helpers/emitAssetInChildCompilationLoader"
80+
"./helpers/emitAssetInChildCompilationLoader",
8181
),
8282
},
8383
],
@@ -105,19 +105,19 @@ describe("JsonMinimizerPlugin", () => {
105105
const statsErrors = getErrors(stats);
106106

107107
expect(statsErrors[0]).toContain(
108-
`Error: "broken-json-syntax.json" in "/test/fixtures" from Json Minimizer:`
108+
`Error: "broken-json-syntax.json" in "/test/fixtures" from Json Minimizer:`,
109109
);
110110

111111
if (
112-
process.version.startsWith("v19") ||
113-
process.version.startsWith("v20")
112+
process.version.startsWith("v20") ||
113+
process.version.startsWith("v21")
114114
) {
115115
expect(statsErrors[0]).toContain(
116-
`SyntaxError: Expected property name or '}' in JSON at position 4`
116+
`SyntaxError: Expected property name or '}' in JSON at position 4`,
117117
);
118118
} else {
119119
expect(statsErrors[0]).toContain(
120-
`SyntaxError: Unexpected token s in JSON at position 4`
120+
`SyntaxError: Unexpected token s in JSON at position 4`,
121121
);
122122
}
123123

@@ -149,7 +149,7 @@ describe("JsonMinimizerPlugin", () => {
149149
expect(newStats.compilation.emittedAssets.size).toBe(0);
150150

151151
expect(readAssets(compiler, newStats, /\.json$/i)).toMatchSnapshot(
152-
"assets"
152+
"assets",
153153
);
154154
expect(getWarnings(newStats)).toMatchSnapshot("errors");
155155
expect(getErrors(newStats)).toMatchSnapshot("warnings");
@@ -183,7 +183,7 @@ describe("JsonMinimizerPlugin", () => {
183183
expect(newStats.compilation.emittedAssets.size).toBe(0);
184184

185185
expect(readAssets(compiler, newStats, /\.json$/i)).toMatchSnapshot(
186-
"assets"
186+
"assets",
187187
);
188188
expect(getWarnings(newStats)).toMatchSnapshot("errors");
189189
expect(getErrors(newStats)).toMatchSnapshot("warnings");
@@ -217,7 +217,7 @@ describe("JsonMinimizerPlugin", () => {
217217
expect(newStats.compilation.emittedAssets.size).toBe(0);
218218

219219
expect(readAssets(compiler, newStats, /\.json$/i)).toMatchSnapshot(
220-
"assets"
220+
"assets",
221221
);
222222
expect(getWarnings(newStats)).toMatchSnapshot("errors");
223223
expect(getErrors(newStats)).toMatchSnapshot("warnings");
@@ -254,7 +254,7 @@ describe("JsonMinimizerPlugin", () => {
254254
expect(newStats.compilation.emittedAssets.size).toBe(2);
255255

256256
expect(readAssets(compiler, newStats, /\.json$/i)).toMatchSnapshot(
257-
"assets"
257+
"assets",
258258
);
259259
expect(getWarnings(newStats)).toMatchSnapshot("errors");
260260
expect(getErrors(newStats)).toMatchSnapshot("warnings");
@@ -288,7 +288,7 @@ describe("JsonMinimizerPlugin", () => {
288288
expect(newStats.compilation.emittedAssets.size).toBe(6);
289289

290290
expect(readAssets(compiler, newStats, /\.json$/i)).toMatchSnapshot(
291-
"assets"
291+
"assets",
292292
);
293293
expect(getWarnings(newStats)).toMatchSnapshot("errors");
294294
expect(getErrors(newStats)).toMatchSnapshot("warnings");

test/helpers/EmitNewAsset.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ export default class EmitNewAsset {
2626
"secretBase": "Super tower",
2727
"active": true
2828
}
29-
`)
29+
`),
3030
);
31-
}
31+
},
3232
);
3333
});
3434
}

test/helpers/ModifyExistingAsset.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export default class ExistingCommentsFile {
1111
compilation.hooks.additionalAssets.tap(plugin, () => {
1212
// eslint-disable-next-line no-param-reassign
1313
compilation.assets[this.options.name] = new RawSource(
14-
JSON.stringify({ modified: true })
14+
JSON.stringify({ modified: true }),
1515
);
1616
});
1717
});

test/helpers/emitAssetInChildCompilationLoader.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export default function loader() {
2323

2424
const childCompiler = this._compilation.createChildCompiler(
2525
`preloader`,
26-
this.options
26+
this.options,
2727
);
2828

2929
new PreCopyPlugin().apply(childCompiler);

test/helpers/getCompiler.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export default function getCompiler(jsonFixture, config = {}) {
3535
],
3636
}),
3737
]
38-
: []
38+
: [],
3939
),
4040
module: {
4141
rules: [].concat(
@@ -49,11 +49,11 @@ export default function getCompiler(jsonFixture, config = {}) {
4949
},
5050
},
5151
]
52-
: []
52+
: [],
5353
),
5454
},
5555
...config,
56-
}
56+
},
5757
);
5858

5959
if (!config.outputFileSystem) {

0 commit comments

Comments
 (0)