Skip to content

Commit 3b775f3

Browse files
chore(deps): update dependencies (#696)
* chore(deps): update dependencies Bump runtime and dev dependencies to their latest compatible versions and refresh the affected snapshots and generated types. Notable follow-on changes: - `cssnano` >= 8.0.3 and `@changesets/get-github-info` v1 are exports-only, which neither `moduleResolution: "node"` nor the `import` plugin's node resolver can read, so their import sites are annotated. - the `import` plugin cannot parse `copy-webpack-plugin` v14's dist bundle. - refresh the vendored `serialize-javascript` copy for v7.1.0. - resolve transitive `fast-uri`, `brace-expansion`, `js-yaml` and `shell-quote` advisories; `npm audit` is now clean. Two packages raised their own Node requirements, so the rows that can no longer run them skip the affected tests, as the matrix already does for `@swc/*`, `html-minifier-terser` and `esbuild`: - `cssnano@8` declares `engines.node` as `^22.11.0 || ^24.11.0 || >=26.0` and calls `Array.prototype.difference`, which only lands in V8 13.x, so Node 18 and 20 throw `trustedFunctions.difference is not a function` at minify time. The `RUN_CSS_TESTS` gate in `jest.config.js` moves from Node 18 to Node 22. - `copy-webpack-plugin@14` declares `engines.node` as `>= 20.9.0` and calls `Array.prototype.toSorted`, so Node 10-18 throw `toSorted is not a function`. Only `should work with ES modules` uses the plugin, so it is filtered by name through the workflow's existing `-t` pattern rather than skipping all of `TerserPlugin.test.js`, and an `18.x` case is added for the row that previously ran the suite unfiltered. Held back deliberately: - `@babel/*` v8 requires Node >= 20 and would fail `api.assertVersion(7)`, breaking the Node 10-18 CI legs. - `typescript` v7 removes `moduleResolution: node10` and needs a tsconfig and source migration. - `del` v7+ is ESM-only and drops its default export. - `jest-worker` v30 requires Node >= 18.14, but this package supports Node >= 10.13.0. - `prettier-2` is an intentional pin for testing against Prettier 2. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XzZ6pmcJEquRDbKy4gKA8R * fix: load `copy-webpack-plugin` lazily so old Node can run the suite `copy-webpack-plugin@14` reaches for `require("node:path")`, a specifier Node 10 and 12 cannot resolve, so importing it at the top of the file threw before any test ran and took all 58 tests in `TerserPlugin.test.js` with it. Filtering the one test that uses the plugin out by name does not help: `-t` skips test execution, not module loading. Move the import into the body of `should work with ES modules`, the only test that uses it, so the rows that filter that test never load the module. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XzZ6pmcJEquRDbKy4gKA8R --------- Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
1 parent f950afb commit 3b775f3

20 files changed

Lines changed: 4025 additions & 4445 deletions

‎.changeset/changelog-generator.mjs‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// `@changesets/get-github-info` is exports-only, which the `import` plugin's
2+
// node resolver does not read
3+
// eslint-disable-next-line import/no-unresolved
14
import { getInfo, getInfoFromPullRequest } from "@changesets/get-github-info";
25

36
/** @typedef {import("@changesets/types").ChangelogFunctions} ChangelogFunctions */

‎.github/workflows/nodejs.yml‎

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,19 +167,28 @@ jobs:
167167
# aren't available on Node 10/12; `htmlMinifierTerser` requires Node
168168
# 14.13+; `esbuildMinify`/`esbuildMinifyCss` require Node 18+.
169169
#
170+
# `should work with ES modules` drives `copy-webpack-plugin`, which
171+
# declares `engines.node` as `>= 20.9.0` from v14 on and calls
172+
# `Array.prototype.toSorted`, so it throws `toSorted is not a
173+
# function` on anything older. Only that one test uses the plugin, so
174+
# it is filtered by name rather than skipping the whole file.
175+
#
170176
# `-u` is passed alongside the filter so Jest doesn't fail the CI run
171177
# over the snapshots whose owning tests are skipped by `-t` (Jest
172178
# treats them as obsolete when stdin isn't a TTY). The change is local
173179
# to the runner and never committed, so strict snapshot validation
174-
# still happens on the Node 18+ rows that run the full suite.
180+
# still happens on the Node 20+ rows that run the full suite.
175181
shell: bash
176182
run: |
177183
case "${{ matrix.node-version }}" in
178184
10.x|12.x)
179-
npm run test:coverage -- --ci -u -t '^(?!.*(swcMinify|esbuildMinify|htmlMinifierTerser)).*$'
185+
npm run test:coverage -- --ci -u -t '^(?!.*(swcMinify|esbuildMinify|htmlMinifierTerser|should work with ES modules)).*$'
180186
;;
181187
14.x|16.x)
182-
npm run test:coverage -- --ci -u -t '^(?!.*esbuildMinify).*$'
188+
npm run test:coverage -- --ci -u -t '^(?!.*(esbuildMinify|should work with ES modules)).*$'
189+
;;
190+
18.x)
191+
npm run test:coverage -- --ci -u -t '^(?!.*should work with ES modules).*$'
183192
;;
184193
*)
185194
npm run test:coverage -- --ci

‎README.md‎

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -298,10 +298,7 @@ type minifyFn = (
298298
| undefined;
299299
filename?: string | ((fileData: any) => string) | undefined;
300300
banner?:
301-
| string
302-
| boolean
303-
| ((commentsFile: string) => string)
304-
| undefined;
301+
string | boolean | ((commentsFile: string) => string) | undefined;
305302
}
306303
| undefined,
307304
) => Promise<{
@@ -368,9 +365,7 @@ const minify = (input, sourceMap, minimizerOptions, extractsComments) => {
368365

369366
// Custom logic for extract comments
370367
const { map, code } = require("uglify-module") // Or require('./path/to/uglify-module')
371-
.minify(input, {
372-
/* Your options for minification */
373-
});
368+
.minify(input, {/* Your options for minification */});
374369

375370
return { map, code, warnings: [], errors: [], extractedComments: [] };
376371
};
@@ -580,10 +575,7 @@ type extractComments =
580575
| undefined;
581576
filename?: string | ((fileData: any) => string) | undefined;
582577
banner?:
583-
| string
584-
| boolean
585-
| ((commentsFile: string) => string)
586-
| undefined;
578+
string | boolean | ((commentsFile: string) => string) | undefined;
587579
};
588580
```
589581

@@ -1399,9 +1391,7 @@ module.exports = {
13991391
new MinimizerPlugin({
14001392
minify: (file, sourceMap) => {
14011393
// https://github.com/mishoo/UglifyJS2#minify-options
1402-
const uglifyJsOptions = {
1403-
/* your `uglify-js` package options */
1404-
};
1394+
const uglifyJsOptions = {/* your `uglify-js` package options */};
14051395

14061396
if (sourceMap) {
14071397
uglifyJsOptions.sourceMap = {

‎jest.config.js‎

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
1-
// The bundled CSS minimizers (`cssnano@7`, `@swc/css`, `lightningcss`,
2-
// `esbuild@0.27`) require modern Node and don't reliably install on the
1+
// The bundled CSS minimizers (`cssnano@8`, `@swc/css`, `lightningcss`,
2+
// `esbuild@0.28`) require modern Node and don't reliably install on the
33
// Windows agents. Skip the dedicated CSS test file outright on rows that
4-
// can't run them so we don't end up with stale or missing snapshots. The
5-
// `@swc/html` minimizers require Node >= 14, so the dedicated swc-html file
6-
// is skipped on older Node for the same reason.
4+
// can't run them so we don't end up with stale or missing snapshots.
5+
// `cssnano@8` declares `engines.node` as `^22.11.0 || ^24.11.0 || >=26.0`
6+
// and reaches for `Array.prototype.difference`, which only lands in V8 13.x,
7+
// so anything older throws `trustedFunctions.difference is not a function`
8+
// at minify time rather than failing to install. The `@swc/html` minimizers
9+
// require Node >= 14, so the dedicated swc-html file is skipped on older
10+
// Node for the same reason.
711
const NODE_MAJOR = Number(process.versions.node.split(".")[0]);
812
const IS_WINDOWS = process.platform === "win32";
9-
const RUN_CSS_TESTS = NODE_MAJOR >= 18 && !IS_WINDOWS;
13+
const RUN_CSS_TESTS = NODE_MAJOR >= 22 && !IS_WINDOWS;
1014
const RUN_SWC_HTML_TESTS = NODE_MAJOR >= 14;
1115
// `renderEmbeddedSource` and the `collectEmbeddedSource` / `embeddedSources`
1216
// passes landed in webpack 5.110; the plugin degrades to doing nothing without

0 commit comments

Comments
 (0)