Skip to content

Commit 1e8d5fc

Browse files
authored
Update to Node v22 (#13857)
1 parent d8044b2 commit 1e8d5fc

File tree

13 files changed

+496
-413
lines changed

13 files changed

+496
-413
lines changed

.nvmrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20
1+
22

babel.config.cjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ module.exports = function (api) {
3232
shippedProposals: true,
3333
targets,
3434
useBuiltIns: 'usage',
35-
corejs: '3.35.1',
35+
corejs: '3.39.0',
3636
},
3737
],
3838
[

package-lock.json

+443-370
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+20-20
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"url": "https://github.com/googleforcreators/web-stories-wp/issues"
2323
},
2424
"engines": {
25-
"node": ">= 20",
25+
"node": ">= 22",
2626
"npm": ">= 10"
2727
},
2828
"type": "module",
@@ -39,7 +39,7 @@
3939
"@babel/preset-env": "^7.26.0",
4040
"@babel/preset-react": "^7.25.9",
4141
"@babel/preset-typescript": "^7.26.0",
42-
"@eslint-community/eslint-plugin-eslint-comments": "^4.4.0",
42+
"@eslint-community/eslint-plugin-eslint-comments": "^4.4.1",
4343
"@googleforcreators/dashboard": "*",
4444
"@googleforcreators/design-system": "*",
4545
"@googleforcreators/fonts": "*",
@@ -53,9 +53,9 @@
5353
"@prettier/plugin-xml": "^3.4.1",
5454
"@rollup/plugin-babel": "^6.0.4",
5555
"@rollup/plugin-commonjs": "^25.0.7",
56-
"@rollup/plugin-dynamic-import-vars": "^2.1.3",
56+
"@rollup/plugin-dynamic-import-vars": "^2.1.5",
5757
"@rollup/plugin-json": "^6.1.0",
58-
"@rollup/plugin-node-resolve": "^15.2.3",
58+
"@rollup/plugin-node-resolve": "^15.3.0",
5959
"@rollup/plugin-terser": "^0.4.4",
6060
"@rollup/plugin-url": "^8.0.2",
6161
"@storybook/addon-a11y": "^8.4.5",
@@ -75,13 +75,13 @@
7575
"@svgr/rollup": "^8.0.1",
7676
"@svgr/webpack": "^8.0.1",
7777
"@testing-library/dom": "^10.4.0",
78-
"@testing-library/jest-dom": "^6.6.2",
78+
"@testing-library/jest-dom": "^6.6.3",
7979
"@testing-library/react": "^12.1.5",
8080
"@testing-library/react-hooks": "^8.0.1",
8181
"@testing-library/user-event": "^14.5.2",
8282
"@types/jest": "^29.5.14",
8383
"@types/jsdom": "^21.1.7",
84-
"@types/node": "^22.8.6",
84+
"@types/node": "^22.9.3",
8585
"@types/styled-components": "^5.1.26",
8686
"@types/uuid": "^10.0.0",
8787
"@typescript-eslint/eslint-plugin": "^6.19.1",
@@ -104,7 +104,7 @@
104104
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
105105
"browserslist": "^4.24.2",
106106
"circular-dependency-plugin": "^5.2.2",
107-
"core-js": "^3.38.1",
107+
"core-js": "^3.39.0",
108108
"cross-env": "^7.0.3",
109109
"css-loader": "^7.1.2",
110110
"css-minimizer-webpack-plugin": "^7.0.0",
@@ -114,22 +114,22 @@
114114
"eslint-plugin-header": "^3.1.0",
115115
"eslint-plugin-import": "^2.31.0",
116116
"eslint-plugin-jasmine": "^4.2.2",
117-
"eslint-plugin-jest": "^28.8.3",
118-
"eslint-plugin-jest-dom": "^5.4.0",
117+
"eslint-plugin-jest": "^28.9.0",
118+
"eslint-plugin-jest-dom": "^5.5.0",
119119
"eslint-plugin-jest-extended": "^2.4.0",
120-
"eslint-plugin-jsdoc": "^50.4.3",
121-
"eslint-plugin-jsx-a11y": "^6.10.1",
120+
"eslint-plugin-jsdoc": "^50.5.0",
121+
"eslint-plugin-jsx-a11y": "^6.10.2",
122122
"eslint-plugin-markdown": "^5.1.0",
123123
"eslint-plugin-node": "^11.1.0",
124124
"eslint-plugin-oxlint": "^0.13.1",
125125
"eslint-plugin-prettier": "^5.2.1",
126126
"eslint-plugin-react": "^7.37.2",
127127
"eslint-plugin-react-hooks": "^5.0.0",
128128
"eslint-plugin-security": "^3.0.1",
129-
"eslint-plugin-styled-components-a11y": "^2.1.35",
130-
"eslint-plugin-testing-library": "^6.4.0",
131-
"html-webpack-plugin": "^5.6.0",
132-
"husky": "^9.1.6",
129+
"eslint-plugin-styled-components-a11y": "^2.1.36",
130+
"eslint-plugin-testing-library": "^7.0.0",
131+
"html-webpack-plugin": "^5.6.3",
132+
"husky": "^9.1.7",
133133
"jest": "^29.7.0",
134134
"jest-axe": "^9.0.0",
135135
"jest-canvas-mock": "^2.5.2",
@@ -147,15 +147,15 @@
147147
"karma-sourcemap-loader": "^0.4.0",
148148
"karma-webpack": "^5.0.1",
149149
"lint-staged": "^15.2.10",
150-
"markdownlint-cli": "^0.42.0",
150+
"markdownlint-cli": "^0.43.0",
151151
"mini-css-extract-plugin": "^2.9.2",
152152
"mockdate": "^3.0.5",
153153
"npm-package-json-lint": "^8.0.0",
154154
"npm-run-all": "^4.1.5",
155155
"oxlint": "^0.13.1",
156156
"patch-package": "^8.0.0",
157157
"postcss-jsx": "^0.36.4",
158-
"postcss-styled-syntax": "^0.6.4",
158+
"postcss-styled-syntax": "^0.7.0",
159159
"postcss-syntax": "^0.36.2",
160160
"prettier": "^3.3.3",
161161
"puppeteer": "^21.9.0",
@@ -174,12 +174,12 @@
174174
"stylelint-prettier": "^5.0.2",
175175
"stylis-plugin-rtl": "^1.0.0",
176176
"terser-webpack-plugin": "^5.3.10",
177-
"typescript": "^5.6.3",
178-
"webpack": "^5.95.0",
177+
"typescript": "^5.7.2",
178+
"webpack": "^5.96.1",
179179
"webpack-bundle-analyzer": "^4.10.2",
180180
"webpack-cli": "^5.1.4",
181181
"webpack-dev-server": "^5.1.0",
182-
"webpackbar": "^6.0.1",
182+
"webpackbar": "^7.0.0",
183183
"worker-loader": "^3.0.8",
184184
"workspaces-run": "^1.0.2"
185185
},

packages/commander/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"semver": "^7.6.3"
3232
},
3333
"devDependencies": {
34-
"@types/node": "^22.8.6",
34+
"@types/node": "^22.9.3",
3535
"@types/semver": "^7.5.8"
3636
},
3737
"bin": {

packages/design-system/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
"@googleforcreators/react": "*",
4444
"@googleforcreators/tracking": "*",
4545
"@types/react-modal": "^3.16.3",
46-
"big.js": "^6.2.1",
46+
"big.js": "^6.2.2",
4747
"mousetrap": "^1.6.5",
4848
"polished": "^4.3.1",
4949
"prop-types": "^15.8.1",

packages/media/src/test/isAnimatedGif.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ describe('isAnimatedGif', () => {
3232
buffer.byteOffset,
3333
buffer.byteOffset + buffer.byteLength
3434
);
35-
const result = isAnimatedGif(arrayBuffer);
35+
const result = isAnimatedGif(arrayBuffer as unknown as ArrayBuffer);
3636

3737
expect(result).toBeTrue();
3838
});
@@ -43,7 +43,7 @@ describe('isAnimatedGif', () => {
4343
buffer.byteOffset,
4444
buffer.byteOffset + buffer.byteLength
4545
);
46-
const result = isAnimatedGif(arrayBuffer);
46+
const result = isAnimatedGif(arrayBuffer as unknown as ArrayBuffer);
4747

4848
expect(result).toBeFalse();
4949
});

packages/migration/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
},
4545
"devDependencies": {
4646
"@rollup/plugin-babel": "^6.0.4",
47-
"@rollup/plugin-node-resolve": "^15.2.3",
47+
"@rollup/plugin-node-resolve": "^15.3.0",
4848
"rollup": "^2.79.2"
4949
},
5050
"scripts": {

packages/rich-text/src/utils/getCaretCharacterOffsetWithin.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,11 @@ interface CaretPosition {
4444
}
4545

4646
interface SelectionDocument extends Document {
47-
caretPositionFromPoint?: (x: number, y: number) => CaretPosition | null;
47+
caretPositionFromPoint: (
48+
x: number,
49+
y: number,
50+
options?: CaretPositionFromPointOptions
51+
) => CaretPosition | null;
4852
}
4953

5054
// Extend for wider browser support.

packages/story-editor/src/app/canvas/useCanvasKeys.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ function useCanvasKeys(ref: RefObject<Node>) {
179179
// Position (x/y) key handler.
180180
useGlobalKeyDownEffect(
181181
{ key: ['up', 'down', 'left', 'right'], shift: true },
182-
({ key, shiftKey }) => {
182+
({ key, shiftKey }: KeyboardEvent) => {
183183
if (isEditing || !selectedElements?.length) {
184184
return;
185185
}
@@ -204,7 +204,7 @@ function useCanvasKeys(ref: RefObject<Node>) {
204204
// Layer up/down.
205205
useGlobalKeyDownEffect(
206206
{ key: ['mod+up', 'mod+down', 'mod+left', 'mod+right'], shift: true },
207-
(evt) => {
207+
(evt: KeyboardEvent) => {
208208
const { key, shiftKey } = evt;
209209

210210
// Cancel the default behavior of the event: it's very jarring to run
@@ -293,7 +293,7 @@ function useCanvasKeys(ref: RefObject<Node>) {
293293
].includes(animationState);
294294
useGlobalKeyDownEffect(
295295
{ key: ['mod+enter'] },
296-
(evt) => {
296+
(evt: KeyboardEvent) => {
297297
evt.preventDefault();
298298
if (currentPageNumber === 1) {
299299
return;
@@ -313,7 +313,7 @@ function useCanvasKeys(ref: RefObject<Node>) {
313313

314314
useGlobalKeyDownEffect(
315315
{ key: ['mod+k'] },
316-
(evt) => {
316+
(evt: KeyboardEvent) => {
317317
evt.preventDefault();
318318
if (
319319
!selectedElements.length ||

packages/story-editor/src/app/media/utils/heif/utils.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export async function decodeImage(image: DecodeResult) {
6060
if (!result) {
6161
reject(new Error('HEIF processing error'));
6262
} else {
63-
resolve(result.data.buffer);
63+
resolve(result.data.buffer as ArrayBuffer);
6464
}
6565
}
6666
);

packages/story-editor/src/app/media/utils/useFFmpeg.ts

+14-8
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,9 @@ function useFFmpeg() {
205205
const data = ffmpeg.FS('readFile', tempFileName);
206206

207207
return blobToFile(
208-
new Blob([data.buffer], { type: MEDIA_POSTER_IMAGE_MIME_TYPE }),
208+
new Blob([data.buffer as BlobPart], {
209+
type: MEDIA_POSTER_IMAGE_MIME_TYPE,
210+
}),
209211
outputFileName,
210212
MEDIA_POSTER_IMAGE_MIME_TYPE
211213
);
@@ -263,7 +265,9 @@ function useFFmpeg() {
263265
const data = ffmpeg.FS('readFile', tempFileName);
264266

265267
return blobToFile(
266-
new Blob([data.buffer], { type: MEDIA_TRANSCODED_MIME_TYPE }),
268+
new Blob([data.buffer as BlobPart], {
269+
type: MEDIA_TRANSCODED_MIME_TYPE,
270+
}),
267271
outputFileName,
268272
MEDIA_TRANSCODED_MIME_TYPE
269273
);
@@ -348,7 +352,7 @@ function useFFmpeg() {
348352
.map((outputFile) => {
349353
const data = (ffmpeg as FFmpeg).FS('readFile', outputFile);
350354
return blobToFile(
351-
new Blob([data.buffer], { type }),
355+
new Blob([data.buffer as BlobPart], { type }),
352356
outputFile,
353357
type
354358
);
@@ -417,7 +421,7 @@ function useFFmpeg() {
417421
const data = ffmpeg.FS('readFile', tempFileName);
418422

419423
return blobToFile(
420-
new Blob([data.buffer], { type }),
424+
new Blob([data.buffer as BlobPart], { type }),
421425
outputFileName,
422426
type
423427
);
@@ -478,7 +482,7 @@ function useFFmpeg() {
478482
const data = ffmpeg.FS('readFile', tempFileName);
479483

480484
return blobToFile(
481-
new Blob([data.buffer], { type }),
485+
new Blob([data.buffer as BlobPart], { type }),
482486
outputFileName,
483487
type
484488
);
@@ -538,7 +542,7 @@ function useFFmpeg() {
538542
const data = ffmpeg.FS('readFile', tempFileName);
539543

540544
return blobToFile(
541-
new Blob([data.buffer], { type }),
545+
new Blob([data.buffer as BlobPart], { type }),
542546
outputFileName,
543547
type
544548
);
@@ -596,7 +600,9 @@ function useFFmpeg() {
596600
const data = ffmpeg.FS('readFile', tempFileName);
597601

598602
return blobToFile(
599-
new Blob([data.buffer], { type: MEDIA_TRANSCODED_MIME_TYPE }),
603+
new Blob([data.buffer as BlobPart], {
604+
type: MEDIA_TRANSCODED_MIME_TYPE,
605+
}),
600606
outputFileName,
601607
MEDIA_TRANSCODED_MIME_TYPE
602608
);
@@ -651,7 +657,7 @@ function useFFmpeg() {
651657
const data = ffmpeg.FS('readFile', tempFileName);
652658

653659
return blobToFile(
654-
new Blob([data.buffer], { type: 'audio/mpeg' }),
660+
new Blob([data.buffer as BlobPart], { type: 'audio/mpeg' }),
655661
outputFileName,
656662
'audio/mpeg'
657663
);

packages/story-editor/src/components/footer/carousel/carouselContext/useCarouselKeys.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ function useCarouselKeys({
7070
useKeyDownEffect(
7171
listElement,
7272
{ key: ['up', 'down', 'left', 'right'] },
73-
({ key }) => {
73+
({ key }: KeyboardEvent) => {
7474
// Intercept all keys, but only handle left and right.
7575
const dir = getArrowDir(key, 'ArrowRight', 'ArrowLeft', isRTL);
7676
if (dir === 0) {
@@ -103,7 +103,7 @@ function useCarouselKeys({
103103
useKeyDownEffect(
104104
listElement,
105105
{ key: ['mod+up', 'mod+down', 'mod+left', 'mod+right'], shift: true },
106-
(evt) => {
106+
(evt: KeyboardEvent) => {
107107
const { key, shiftKey } = evt;
108108

109109
// Cancel the default behavior of the event: it's very jarring to run

0 commit comments

Comments
 (0)