Skip to content

fix(): use node 22 #4567

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: v3
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:

strategy:
matrix:
node-version: [20.x]
node-version: [22.x]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

建议调整 Node.js 版本要求并进行分阶段迁移

根据代码库分析,所有包的 engines 字段都指定了 Node.js 版本要求为 ">=16"。直接升级到 Node.js 22.x 可能过于激进,建议:

  • 先将 engines 字段中的 Node.js 版本要求更新为与 CI 一致
  • 在 CI 配置中采用矩阵策略同时测试多个 Node.js 版本(如 20.x 和 22.x)
  • 待所有依赖包完全兼容 Node.js 22.x 后再完全迁移

示例配置:

strategy:
  matrix:
    node-version: [20.x, 22.x]
🔗 Analysis chain

建议验证 Node.js 22.x 的兼容性和稳定性

Node.js 22.x 版本较新,建议:

  1. 确认所有依赖包和构建工具与 Node.js 22.x 的兼容性
  2. 考虑在过渡期间同时支持 20.x 和 22.x,以确保平稳迁移
  3. 验证在新版本下所有 CI 任务的稳定性
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# 检查项目依赖对 Node.js 22 的支持情况

# 检查 package.json 中的 engines 字段
rg '"engines"' -A 5

# 检查是否有明确指定 Node.js 版本要求的依赖
rg '"node":' package.json packages/*/package.json

Length of output: 3457


steps:
- name: Setup timezone
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lerna-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:

strategy:
matrix:
node-version: [20.x]
node-version: [22.x]

steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-docs-etc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:

strategy:
matrix:
node-version: [20.x]
node-version: [22.x]

# Only if it contains a certain label.
if: "contains( github.event.pull_request.labels.*.name, 'eve: update docs etc')"
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20
22
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"@types/klaw-sync": "^6.0.5",
"@types/lodash": "^4.17.7",
"@types/meow": "^5.0.0",
"@types/node": "^20.16.2",
"@types/node": "^22.9.0",
"@types/react": "^18.3.4",
"@types/react-dom": "^18.3.0",
"@typescript-eslint/eslint-plugin": "^7.18.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/brick-container/build.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { createRequire } from "node:module";
import HtmlWebpackPlugin from "html-webpack-plugin";
import CopyPlugin from "copy-webpack-plugin";
import webpack from "webpack";
import packageJson from "./package.json" assert { type: "json" };
import packageJson from "./package.json" with { type: "json" };
Copy link
Preview

Copilot AI Nov 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The import assertion syntax is incorrect. It should be 'assert { type: "json" }' instead of 'with { type: "json" }'.

Copilot uses AI. Check for mistakes.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import assert is deprecated, now we should use import with.


const require = createRequire(import.meta.url);

Expand Down
2 changes: 1 addition & 1 deletion packages/inject/src/__snapshots__/syntax.spec.ts.snap
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`parseInjectableString should throw when parsing "\${a=[{}}{]}" 1`] = `"Expected ',' or ']' after array element in JSON at position 3"`;
exports[`parseInjectableString should throw when parsing "\${a=[{}}{]}" 1`] = `"Expected ',' or ']' after array element in JSON at position 3 (line 1 column 4)"`;

exports[`parseInjectableString should throw when parsing "\${a=[}" 1`] = `"Failed to match a JSON value at index 4 near: "[}""`;

Expand Down
18 changes: 9 additions & 9 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2986,12 +2986,12 @@
dependencies:
"@types/node" "*"

"@types/node@*", "@types/node@^20.16.2":
version "20.16.2"
resolved "https://registry.npmjs.org/@types/node/-/node-20.16.2.tgz#9e388f503a5af306e8c63319334887390966a11e"
integrity sha512-91s/n4qUPV/wg8eE9KHYW1kouTfDk2FPGjXbBMfRWP/2vg1rCXNQL1OCabwGs0XSdukuK+MwCDXE30QpSeMUhQ==
"@types/node@*", "@types/node@^22.9.0":
version "22.9.0"
resolved "https://registry.npmjs.org/@types/node/-/node-22.9.0.tgz#b7f16e5c3384788542c72dc3d561a7ceae2c0365"
integrity sha512-vuyHg81vvWA1Z1ELfvLko2c8f34gyA0zaic0+Rllc5lbCnbSyuvb2Oxpm6TAUAC/2xZN3QGqxBNggD1nNR2AfQ==
dependencies:
undici-types "~6.19.2"
undici-types "~6.19.8"

"@types/node@^18.11.9":
version "18.19.45"
Expand Down Expand Up @@ -13251,10 +13251,10 @@ undici-types@~5.26.4:
resolved "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617"
integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==

undici-types@~6.19.2:
version "6.19.6"
resolved "https://registry.npmjs.org/undici-types/-/undici-types-6.19.6.tgz#e218c3df0987f4c0e0008ca00d6b6472d9b89b36"
integrity sha512-e/vggGopEfTKSvj4ihnOLTsqhrKRN3LeO6qSN/GxohhuRv8qH9bNQ4B8W7e/vFL+0XTnmHPB4/kegunZGA4Org==
undici-types@~6.19.8:
version "6.19.8"
resolved "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz#35111c9d1437ab83a7cdc0abae2f26d88eda0a02"
integrity sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==

unicode-canonical-property-names-ecmascript@^2.0.0:
version "2.0.0"
Expand Down
Loading