Skip to content

Commit 2ed0454

Browse files
chore(deps): update dev dependencies and refresh snapshots (#681)
1 parent 5207f94 commit 2ed0454

18 files changed

Lines changed: 10887 additions & 9630 deletions

.cspell.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@
4646
"lightningcss",
4747
"sourcefile",
4848
"stringifier",
49-
"sourcesContent"
49+
"sourcesContent",
50+
"esac"
5051
],
5152
"ignorePaths": [
5253
"CHANGELOG.md",

.github/workflows/nodejs.yml

Lines changed: 47 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,24 @@ jobs:
100100
architecture: ${{ steps.calculate_architecture.outputs.result }}
101101
cache: "npm"
102102

103+
- name: Pin older jest in package.json (Node 10/12)
104+
if: matrix.node-version == '10.x' || matrix.node-version == '12.x'
105+
shell: bash
106+
# Rewrite the jest devDependency before installing so npm resolves a
107+
# consistent @jest/* tree. jest@30 only supports Node >=18.14.
108+
run: |
109+
node -e "const fs=require('fs');const p=require('./package.json');p.devDependencies.jest='^27.5.1';fs.writeFileSync('./package.json',JSON.stringify(p,null,2)+'\n');"
110+
111+
- name: Pin older jest in package.json (Node 14/16)
112+
if: matrix.node-version == '14.x' || matrix.node-version == '16.x'
113+
shell: bash
114+
run: |
115+
node -e "const fs=require('fs');const p=require('./package.json');p.devDependencies.jest='^29.7.0';fs.writeFileSync('./package.json',JSON.stringify(p,null,2)+'\n');"
116+
103117
- name: Install dependencies (old)
104118
run: |
105119
npm install -D typescript@4 --force
106-
npm install --ignore-scripts
120+
npm install --ignore-scripts --force
107121
if: matrix.node-version == '10.x' || matrix.node-version == '12.x' || matrix.node-version == '14.x' || matrix.node-version == '16.x' || matrix.node-version == '18.x'
108122

109123
- name: Install dependencies
@@ -118,6 +132,14 @@ jobs:
118132
if: matrix.node-version == '14.x' || matrix.node-version == '16.x'
119133
run: npm install -D --no-save cssnano@^6 --force
120134

135+
- name: Install older memfs (Node 10/12)
136+
# memfs@4 uses optional chaining / nullish coalescing and isn't
137+
# transpiled by babel-jest (node_modules is ignored), so it can't be
138+
# parsed on Node 10/12. v3 still supports legacy Node and produces the
139+
# same in-memory output, so it doesn't affect snapshots.
140+
if: matrix.node-version == '10.x' || matrix.node-version == '12.x'
141+
run: npm install -D --no-save memfs@^3.6.0 --force
142+
121143
- name: Pin terser to the locked version (Node 10/12/14)
122144
# npm 6 (bundled with Node <= 14) can't read the lockfileVersion 3
123145
# package-lock.json, so the install step re-resolves `terser` to the
@@ -139,7 +161,30 @@ jobs:
139161
run: npm i webpack@${{ matrix.webpack-version }}
140162

141163
- name: Run tests for webpack version ${{ matrix.webpack-version }}
142-
run: npm run test:coverage -- --ci
164+
# Skip tests whose minimizers can't run on the current Node version
165+
# (`-t` is a Jest test-name pattern with a negative lookahead).
166+
# `swcMinify`/`swcMinifyHtml`/`swcMinifyCss` need @swc/* binaries that
167+
# aren't available on Node 10/12; `htmlMinifierTerser` requires Node
168+
# 14.13+; `esbuildMinify`/`esbuildMinifyCss` require Node 18+.
169+
#
170+
# `-u` is passed alongside the filter so Jest doesn't fail the CI run
171+
# over the snapshots whose owning tests are skipped by `-t` (Jest
172+
# treats them as obsolete when stdin isn't a TTY). The change is local
173+
# to the runner and never committed, so strict snapshot validation
174+
# still happens on the Node 18+ rows that run the full suite.
175+
shell: bash
176+
run: |
177+
case "${{ matrix.node-version }}" in
178+
10.x|12.x)
179+
npm run test:coverage -- --ci -u -t '^(?!.*(swcMinify|esbuildMinify|htmlMinifierTerser)).*$'
180+
;;
181+
14.x|16.x)
182+
npm run test:coverage -- --ci -u -t '^(?!.*esbuildMinify).*$'
183+
;;
184+
*)
185+
npm run test:coverage -- --ci
186+
;;
187+
esac
143188
144189
- name: Submit coverage data to codecov
145190
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0

.husky/pre-commit

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

43
npx --no-install lint-staged

0 commit comments

Comments
 (0)