-
Notifications
You must be signed in to change notification settings - Fork 4.8k
chore: drop node 18 and pnpm 9, support node 22 and pnpm 10 #17582
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
base: main
Are you sure you want to change the base?
Conversation
This reverts commit b8f0e34.
Walkthrough本次变更主要集中在将 Node.js 的最低要求版本从 18 升级到 20,并将 pnpm 升级到 10,涉及所有相关的 package.json、CI 工作流和文档说明。此外,构建系统(如 Rollup 配置)从第三方 TypeScript 插件切换为官方插件,部分包的 TypeScript 配置也做了相应调整。Harmony 平台组件定义新增了 list 和 list-item 相关声明。部分构建脚本和测试命令进行了小幅优化,整体未涉及核心业务逻辑变更。 Changes
Sequence Diagram(s)sequenceDiagram
participant CI as GitHub Actions
participant Node as Node.js
participant pnpm as pnpm
participant Build as 构建脚本
CI->>Node: 安装 Node.js 22
CI->>pnpm: 安装 pnpm 10
CI->>Build: 运行构建/测试/发布流程
Build-->>CI: 输出构建产物/测试结果
Suggested reviewers
Poem
Tip ⚡💬 Agentic Chat (Pro Plan, General Availability)
📜 Recent review detailsConfiguration used: CodeRabbit UI ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (70)
✅ Files skipped from review due to trivial changes (30)
🚧 Files skipped from review as they are similar to previous changes (40)
⏰ Context from checks skipped due to timeout of 90000ms (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 6
♻️ Duplicate comments (8)
packages/postcss-plugin-constparse/package.json (1)
8-10
: 更新 Node.js 引擎版本到 >= 20
此处仅为引擎元数据变更,已将engines.node
升级至>= 20
,请确保文档和 CI 同步。packages/taro-plugin-react-devtools/package.json (1)
29-31
: 更新 Node.js 引擎版本到 >= 20
此变更同步升级了engines.node
至>= 20
,符合仓库整体版本策略。packages/taro-rn-runner/package.json (1)
30-32
: 更新 Node.js 引擎版本到 >= 20
已将engines.node
从>= 18
提升至>= 20
,请确认文档和 CI 已覆盖所有相关位置。packages/taro-cli-convertor/package.json (1)
37-39
: 更新 Node.js 引擎版本到 >= 20
将engines.node
升级为>= 20
,请检查 CONTRIBUTING.md、文档及 CI 脚本中的版本要求是否一致。packages/taro-webpack5-runner/package.json (1)
33-33
: 与 packages/taro-rn 同步:确认 Node.js 引擎版本
此处同样更新为>=20
,请复核是否符合「支持 Node.js 22」的目标,必要时调整为>=22
。packages/stylelint-config-taro-rn/package.json (1)
26-26
: 与 packages/taro-rn 同步:确认 Node.js 引擎版本
engines.node
已提升至>=20
,请确认是否需改为>=22
以满足 PR 中声明的 Node.js 22 支持。packages/babel-preset-taro/package.json (1)
27-27
: 与 packages/taro-rn 同步:确认 Node.js 引擎版本
该包也将engines.node
设置为>=20
,请核实是否应统一提高到>=22
。packages/taro-loader/package.json (1)
29-29
: 与 packages/taro-rn 同步:确认 Node.js 引擎版本
此处同样为>=20
,建议检查是否需要使用>=22
以真正支持目标版本。
🧹 Nitpick comments (12)
packages/taro-extend/package.json (1)
23-25
: 建议:补充 pnpm 引擎版本声明既然此 PR 还升级了 pnpm 至 v10,可考虑在
engines
中添加"pnpm": ">=10"
,以显式声明项目对 pnpm 版本的要求。packages/taro-rn-supporter/package.json (1)
28-30
: 建议在 engines 字段中指定 pnpm 版本
本次 PR 同时升级了 pnpm 到 10,建议在engines
中加入"pnpm": ">= 10"
,以便 CI 和开发者明确定义 pnpm 版本要求。packages/taro-rn/src/lib/index.ts (1)
18-18
: 提醒:该文件为自动生成,请勿手动修改此文件由
getLibList.js
脚本生成,手动修改会在下一次生成时被覆盖。如需调整导出顺序,请在getLibList.js
中进行修改。packages/taro-transformer-wx/package.json (1)
4-4
: 拼写修复生效 & 建议品牌名称统一描述字段中的 “Transfrom” 已正确修复为 “Transform”。另外,建议将 “Wechat” 统一改为官方大小写 “WeChat” 以保持一致性。
packages/taro-with-weapp/package.json (1)
33-33
: Node.js 引擎版本限制更新正确
已将最低 Node.js 版本从>=18
提升到>=20
,与项目中其他包的版本策略保持一致,成功移除了对 Node 18 的支持。
建议(可选):在engines
字段中追加pnpm: ">=10"
,以显式声明对 pnpm 版本的依赖。packages/shared/package.json (1)
33-33
: Node.js 引擎版本限制更新正确
已将最低 Node.js 版本从>=18
提升到>=20
,与整体版本策略保持一致,移除了对 Node 18 的支持。
建议(可选):在engines
中添加pnpm: ">=10"
,以明确项目对 pnpm 10 的支持需求。packages/postcss-pxtransform/package.json (1)
34-34
: Node.js 引擎版本限制更新正确
已将最低 Node.js 版本从>=18
提升到>=20
,与其他包同步。此更改纯元数据更新,不影响功能。
建议(可选):同样可在engines
中声明pnpm: ">=10"
,以便团队一目了然地了解 pnpm 版本要求。packages/taro-plugin-html/package.json (1)
29-29
: Node.js 引擎版本限制更新正确
已将最低 Node.js 版本从>=18
升级至>=20
,统一了项目内各插件的运行环境要求。
建议(可选):在engines
内同级添加pnpm: ">=10"
,以强制指定开发和 CI 使用 pnpm 10 及以上版本。packages/taro-plugin-http/package.json (1)
33-33
: Node.js 引擎版本限制更新正确
已将最低 Node.js 版本要求从>=18
调整为>=20
,与仓库中其他包保持一致,成功移除对 Node 18 的依赖。
建议(可选):在engines
字段中加入pnpm: ">=10"
,以便明确 pnpm 版本兼容性。CONTRIBUTING.md (1)
212-212
: 清理多余的格式符号
行####
似乎是多余的格式标记,可能影响文档可读性,建议删除或调整为正确的标题语法。packages/taro-router/rollup.config-1745118866046.mjs (2)
7-28
: 配置存在代码风格问题基础配置的逻辑合理,包括输入文件、输出选项和插件配置,但存在缩进不一致问题。根据静态分析工具提示,整个文件的缩进风格与项目规范不符。
建议统一使用 2 空格缩进,符合项目其他文件的风格:
-const baseConfig = { - input: 'src/index.ts', - output: { - sourcemap: true, - exports: 'named' - }, - plugins: [ - externals({ - deps: true, - devDeps: false, - include: [/^@tarojs\//] - }), +const baseConfig = { + input: 'src/index.ts', + output: { + sourcemap: true, + exports: 'named' + }, + plugins: [ + externals({ + deps: true, + devDeps: false, + include: [/^@tarojs\//] + }),🧰 Tools
🪛 ESLint
[error] 8-8: Expected indentation of 2 spaces but found 4.
(@typescript-eslint/indent)
[error] 9-9: Expected indentation of 2 spaces but found 4.
(@typescript-eslint/indent)
[error] 10-10: Expected indentation of 4 spaces but found 8.
(@typescript-eslint/indent)
[error] 11-11: Expected indentation of 4 spaces but found 8.
(@typescript-eslint/indent)
[error] 12-12: Expected indentation of 2 spaces but found 4.
(@typescript-eslint/indent)
[error] 13-13: Expected indentation of 2 spaces but found 4.
(@typescript-eslint/indent)
[error] 14-14: Expected indentation of 4 spaces but found 8.
(@typescript-eslint/indent)
[error] 15-15: Expected indentation of 6 spaces but found 12.
(@typescript-eslint/indent)
[error] 16-16: Expected indentation of 6 spaces but found 12.
(@typescript-eslint/indent)
[error] 17-17: Expected indentation of 6 spaces but found 12.
(@typescript-eslint/indent)
[error] 18-18: Expected indentation of 4 spaces but found 8.
(@typescript-eslint/indent)
[error] 19-19: Expected indentation of 4 spaces but found 8.
(@typescript-eslint/indent)
[error] 20-20: Expected indentation of 6 spaces but found 12.
(@typescript-eslint/indent)
[error] 21-21: Expected indentation of 6 spaces but found 12.
(@typescript-eslint/indent)
[error] 22-22: Expected indentation of 4 spaces but found 8.
(@typescript-eslint/indent)
[error] 23-23: Expected indentation of 4 spaces but found 8.
(@typescript-eslint/indent)
[error] 24-24: Expected indentation of 6 spaces but found 12.
(@typescript-eslint/indent)
[error] 25-25: Expected indentation of 4 spaces but found 8.
(@typescript-eslint/indent)
[error] 26-26: Expected indentation of 4 spaces but found 8.
(@typescript-eslint/indent)
[error] 27-27: Expected indentation of 2 spaces but found 4.
(@typescript-eslint/indent)
[error] 28-28: Extra semicolon.
(semi)
29-46
: 输出配置定义了多种格式配置了三种输出格式:
- 保留模块结构的输出到
dist
目录- CommonJS 格式打包到
dist/index.cjs.js
- ES 模块格式打包到
dist/index.esm.js
这符合现代 JavaScript 库的最佳实践,但同样存在缩进问题。
🧰 Tools
🪛 ESLint
[error] 30-30: Expected indentation of 2 spaces but found 8.
(@typescript-eslint/indent)
[error] 31-31: Expected indentation of 4 spaces but found 12.
(@typescript-eslint/indent)
[error] 32-32: Expected indentation of 4 spaces but found 12.
(@typescript-eslint/indent)
[error] 33-33: Expected indentation of 4 spaces but found 12.
(@typescript-eslint/indent)
[error] 34-34: Expected indentation of 2 spaces but found 8.
(@typescript-eslint/indent)
[error] 35-35: Expected indentation of 0 spaces but found 4.
(@typescript-eslint/indent)
[error] 36-36: Expected indentation of 2 spaces but found 8.
(@typescript-eslint/indent)
[error] 37-37: Expected indentation of 4 spaces but found 12.
(@typescript-eslint/indent)
[error] 38-38: Expected indentation of 4 spaces but found 12.
(@typescript-eslint/indent)
[error] 39-39: Expected indentation of 2 spaces but found 8.
(@typescript-eslint/indent)
[error] 40-40: Expected indentation of 0 spaces but found 4.
(@typescript-eslint/indent)
[error] 41-41: Expected indentation of 0 spaces but found 4.
(@typescript-eslint/indent)
[error] 42-42: Expected indentation of 2 spaces but found 8.
(@typescript-eslint/indent)
[error] 43-43: Expected indentation of 4 spaces but found 12.
(@typescript-eslint/indent)
[error] 44-44: Expected indentation of 4 spaces but found 12.
(@typescript-eslint/indent)
[error] 45-45: Expected indentation of 2 spaces but found 8.
(@typescript-eslint/indent)
[error] 46-46: Expected indentation of 0 spaces but found 4.
(@typescript-eslint/indent)
[error] 46-46: Extra semicolon.
(semi)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yaml
is excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (82)
.github/workflows/build-rust-binding.yml
(2 hunks).github/workflows/nodejs.yml
(3 hunks).github/workflows/publish.yml
(1 hunks).github/workflows/sync-components-types.yml
(1 hunks)CONTRIBUTING.md
(2 hunks)npm/darwin-arm64/package.json
(1 hunks)npm/darwin-x64/package.json
(1 hunks)npm/linux-x64-gnu/package.json
(1 hunks)npm/linux-x64-musl/package.json
(1 hunks)npm/win32-x64-msvc/package.json
(1 hunks)packages/babel-plugin-transform-react-jsx-to-rn-stylesheet/package.json
(1 hunks)packages/babel-plugin-transform-taroapi/package.json
(1 hunks)packages/babel-preset-taro/package.json
(1 hunks)packages/create-app/package.json
(1 hunks)packages/css-to-react-native/package.json
(1 hunks)packages/eslint-config-taro/package.json
(1 hunks)packages/jest-helper/package.json
(1 hunks)packages/postcss-html-transform/package.json
(1 hunks)packages/postcss-plugin-constparse/package.json
(1 hunks)packages/postcss-pxtransform/package.json
(1 hunks)packages/rollup-plugin-copy/package.json
(1 hunks)packages/shared/package.json
(1 hunks)packages/stylelint-config-taro-rn/package.json
(1 hunks)packages/stylelint-taro-rn/package.json
(1 hunks)packages/stylelint-taro/package.json
(1 hunks)packages/taro-api/package.json
(1 hunks)packages/taro-cli-convertor/package.json
(1 hunks)packages/taro-cli/package.json
(1 hunks)packages/taro-cli/tsconfig.json
(1 hunks)packages/taro-components-library-react/package.json
(1 hunks)packages/taro-components-library-vue3/package.json
(1 hunks)packages/taro-components-rn/package.json
(1 hunks)packages/taro-components/package.json
(1 hunks)packages/taro-extend/package.json
(1 hunks)packages/taro-framework-react/package.json
(1 hunks)packages/taro-framework-vue3/package.json
(1 hunks)packages/taro-h5/package.json
(3 hunks)packages/taro-h5/rollup.config.ts
(3 hunks)packages/taro-h5/tsconfig.json
(1 hunks)packages/taro-helper/package.json
(1 hunks)packages/taro-helper/tsconfig.json
(1 hunks)packages/taro-loader/package.json
(1 hunks)packages/taro-platform-alipay/package.json
(1 hunks)packages/taro-platform-harmony-hybrid/build/config/harmony-definition.json
(2 hunks)packages/taro-platform-harmony-hybrid/package.json
(1 hunks)packages/taro-platform-harmony-hybrid/rollup.config.ts
(4 hunks)packages/taro-platform-harmony-hybrid/tsconfig.json
(1 hunks)packages/taro-platform-harmony/package.json
(1 hunks)packages/taro-platform-harmony/rollup.config.ts
(6 hunks)packages/taro-platform-jd/package.json
(1 hunks)packages/taro-platform-qq/package.json
(1 hunks)packages/taro-platform-swan/package.json
(1 hunks)packages/taro-platform-tt/package.json
(1 hunks)packages/taro-platform-weapp/package.json
(1 hunks)packages/taro-plugin-html/package.json
(1 hunks)packages/taro-plugin-http/package.json
(1 hunks)packages/taro-plugin-inject/package.json
(1 hunks)packages/taro-plugin-mini-ci/package.json
(1 hunks)packages/taro-plugin-react-devtools/package.json
(1 hunks)packages/taro-plugin-vue-devtools/package.json
(1 hunks)packages/taro-react/package.json
(1 hunks)packages/taro-rn-runner/package.json
(1 hunks)packages/taro-rn-style-transformer/package.json
(1 hunks)packages/taro-rn-supporter/package.json
(1 hunks)packages/taro-rn-transformer/package.json
(1 hunks)packages/taro-rn/package.json
(1 hunks)packages/taro-rn/src/lib/index.ts
(1 hunks)packages/taro-router-rn/package.json
(1 hunks)packages/taro-router/package.json
(2 hunks)packages/taro-router/rollup.config-1745118866046.mjs
(1 hunks)packages/taro-runner-utils/package.json
(1 hunks)packages/taro-runtime-rn/package.json
(1 hunks)packages/taro-runtime/package.json
(3 hunks)packages/taro-runtime/rollup.config.ts
(2 hunks)packages/taro-service/package.json
(1 hunks)packages/taro-transformer-wx/package.json
(2 hunks)packages/taro-transformer-wx/src/render.ts
(2 hunks)packages/taro-webpack5-prebundle/package.json
(1 hunks)packages/taro-webpack5-runner/package.json
(1 hunks)packages/taro-with-weapp/package.json
(1 hunks)packages/taro/package.json
(1 hunks)packages/taroize/package.json
(1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
packages/taro-transformer-wx/src/render.ts (1)
packages/taro-transformer-wx/src/utils.ts (1)
isArrayMapCallExpression
(351-358)
🪛 GitHub Actions: Node CI
packages/taro-helper/package.json
[error] 1-1: pnpm install failed with exit code 1 due to outdated lockfile. The pnpm-lock.yaml is not up to date with package.json dependencies, causing a mismatch in specifiers.
🪛 ESLint
packages/taro-router/rollup.config-1745118866046.mjs
[error] 1-1: Extra semicolon.
(semi)
[error] 2-2: Extra semicolon.
(semi)
[error] 3-3: Extra semicolon.
(semi)
[error] 4-4: Extra semicolon.
(semi)
[error] 5-5: Extra semicolon.
(semi)
[error] 8-8: Expected indentation of 2 spaces but found 4.
(@typescript-eslint/indent)
[error] 9-9: Expected indentation of 2 spaces but found 4.
(@typescript-eslint/indent)
[error] 10-10: Expected indentation of 4 spaces but found 8.
(@typescript-eslint/indent)
[error] 11-11: Expected indentation of 4 spaces but found 8.
(@typescript-eslint/indent)
[error] 12-12: Expected indentation of 2 spaces but found 4.
(@typescript-eslint/indent)
[error] 13-13: Expected indentation of 2 spaces but found 4.
(@typescript-eslint/indent)
[error] 14-14: Expected indentation of 4 spaces but found 8.
(@typescript-eslint/indent)
[error] 15-15: Expected indentation of 6 spaces but found 12.
(@typescript-eslint/indent)
[error] 16-16: Expected indentation of 6 spaces but found 12.
(@typescript-eslint/indent)
[error] 17-17: Expected indentation of 6 spaces but found 12.
(@typescript-eslint/indent)
[error] 18-18: Expected indentation of 4 spaces but found 8.
(@typescript-eslint/indent)
[error] 19-19: Expected indentation of 4 spaces but found 8.
(@typescript-eslint/indent)
[error] 20-20: Expected indentation of 6 spaces but found 12.
(@typescript-eslint/indent)
[error] 21-21: Expected indentation of 6 spaces but found 12.
(@typescript-eslint/indent)
[error] 22-22: Expected indentation of 4 spaces but found 8.
(@typescript-eslint/indent)
[error] 23-23: Expected indentation of 4 spaces but found 8.
(@typescript-eslint/indent)
[error] 24-24: Expected indentation of 6 spaces but found 12.
(@typescript-eslint/indent)
[error] 25-25: Expected indentation of 4 spaces but found 8.
(@typescript-eslint/indent)
[error] 26-26: Expected indentation of 4 spaces but found 8.
(@typescript-eslint/indent)
[error] 27-27: Expected indentation of 2 spaces but found 4.
(@typescript-eslint/indent)
[error] 28-28: Extra semicolon.
(semi)
[error] 30-30: Expected indentation of 2 spaces but found 8.
(@typescript-eslint/indent)
[error] 31-31: Expected indentation of 4 spaces but found 12.
(@typescript-eslint/indent)
[error] 32-32: Expected indentation of 4 spaces but found 12.
(@typescript-eslint/indent)
[error] 33-33: Expected indentation of 4 spaces but found 12.
(@typescript-eslint/indent)
[error] 34-34: Expected indentation of 2 spaces but found 8.
(@typescript-eslint/indent)
[error] 35-35: Expected indentation of 0 spaces but found 4.
(@typescript-eslint/indent)
[error] 36-36: Expected indentation of 2 spaces but found 8.
(@typescript-eslint/indent)
[error] 37-37: Expected indentation of 4 spaces but found 12.
(@typescript-eslint/indent)
[error] 38-38: Expected indentation of 4 spaces but found 12.
(@typescript-eslint/indent)
[error] 39-39: Expected indentation of 2 spaces but found 8.
(@typescript-eslint/indent)
[error] 40-40: Expected indentation of 0 spaces but found 4.
(@typescript-eslint/indent)
[error] 41-41: Expected indentation of 0 spaces but found 4.
(@typescript-eslint/indent)
[error] 42-42: Expected indentation of 2 spaces but found 8.
(@typescript-eslint/indent)
[error] 43-43: Expected indentation of 4 spaces but found 12.
(@typescript-eslint/indent)
[error] 44-44: Expected indentation of 4 spaces but found 12.
(@typescript-eslint/indent)
[error] 45-45: Expected indentation of 2 spaces but found 8.
(@typescript-eslint/indent)
[error] 46-46: Expected indentation of 0 spaces but found 4.
(@typescript-eslint/indent)
[error] 46-46: Extra semicolon.
(semi)
[error] 48-48: Expected indentation of 2 spaces but found 4.
(@typescript-eslint/indent)
[error] 48-48: Extra semicolon.
(semi)
[error] 49-49: Extra semicolon.
(semi)
[error] 51-51: Extra semicolon.
(semi)
🔇 Additional comments (93)
packages/taro-plugin-inject/package.json (1)
28-30
: 确认 Node.js 引擎版本一致性
已将engines.node
从>=18
更新为>=20
,这能兼容最新的 Node.js 22。请检视仓库中所有 CI 配置、文档以及其他package.json
的engines.node
字段,确保它们也已同步调整。packages/taro-platform-qq/package.json (1)
29-31
: 同步升级 Node.js 引擎要求至 >=20
已将最低 Node.js 版本从 18 升级到 20,与仓库中其他 package.json 保持一致。请确认以下几点:
- CI 流水线(.github/workflows)中已使用 Node.js 22 或者对应的 >=20 版本进行测试与发布。
- 文档(如 README、贡献指南)中关于 Node.js 版本的说明也已同步更新。
- 依赖此插件的其他平台或插件是否仍兼容 Node.js >=20。
packages/taro-extend/package.json (1)
23-25
: 确认:Node.js 引擎版本升级到>=20
此处将
engines.node
从>=18
升级到>=20
与仓库中其他包保持一致,已成功弃用 Node 18 并兼容 Node 22。packages/css-to-react-native/package.json (1)
53-55
: 请确认 Node.js 引擎版本定义是否符合 PR 目标
PR 目标中提到要从 Node.js 18 升级到支持 Node.js 22,但此处将"node"
版本要求设为">= 20"
。请确认是否应直接更改为">= 22"
以与 PR 目标保持一致,或保留>= 20
的广泛兼容性。packages/taro-rn-supporter/package.json (1)
29-29
: 请确认 Node.js 引擎版本要求是否正确
目前将"engines.node"
设为">= 20"
,但 PR 目标中提到要支持 Node.js 22。如确实只需支持 20+,请确认是否有理由不直接指定">= 22"
。packages/taro-components-rn/package.json (1)
31-33
: 确认 Node 引擎版本兼容性
已将engines.node
从>=18
升级至>=20
,与仓库中其他package.json
保持一致,也能兼容即将发布的 Node 22。请确认 CI 工作流中的测试矩阵是否包含 Node 20 和 Node 22,以确保实际运行环境与此处的引擎约束相匹配。packages/taro-platform-swan/package.json (1)
29-31
: 检查 Node.js 引擎版本与 PR 目标是否一致
PR 目标为“支持 Node 22”,但此处仅将engines.node
提升到>= 20
。请确认最低支持版本是 Node 20(LTS)还是应直接调整为 Node 22,并确保与库中其他package.json
保持一致。packages/taro-runtime-rn/package.json (1)
33-33
: 引擎版本更新:从 Node.js >=18 升级到 >=20
移除了对 Node.js 18 的支持,要求 Node.js 20 及以上版本,符合维护策略。请确认此处与仓库中其他相关包的
engines.node
配置保持一致(部分包已更新为 >=22),或讨论是否统一为 >=22。packages/taro-platform-harmony-hybrid/build/config/harmony-definition.json (2)
2331-2334
: 新增 list 组件及属性声明
在components
中插入了"list"
节点,并声明了两个属性"upper-threshold-count"
和"lower-threshold-count"
,类型与其他平台保持一致。
2345-2345
: 新增 list-item 组件声明
已添加"list-item": false
,表示该组件当前不接受任何属性。请确认这是否符合设计需求,或是否需要补充子节点属性。packages/rollup-plugin-copy/package.json (1)
21-22
: 请确认 Node 引擎版本一致性PR 目标为「支持 Node.js 22」,但此处将
engines.node
设置为>=20
。请确认是否应统一为>=22
,或保留>=20
并在 CI 测试矩阵中增加对 Node.js 22 的验证。packages/taro-router-rn/package.json (1)
29-31
:✅ Verification successful
将 Node.js 引擎版本升级至 20+:此处已将
engines.node
从>=18
调整为>=20
,符合 PR 目标并与仓库内其他包保持一致。请确保 CI 工作流、文档或脚本中对 Node 版本的要求也已同步更新。可运行以下脚本验证:
🏁 Script executed:
#!/bin/bash # 检查仓库中是否仍存在旧的 Node.js 要求 rg '"node":\s*">=\s*18"' -lLength of output: 29
🏁 Script executed:
#!/bin/bash echo "=== Checking GitHub workflows for node-version:18 ===" rg -n 'node-version:.*18' -g '.github/workflows/*.yml' || true echo echo "=== Checking .nvmrc ===" if [ -f .nvmrc ]; then cat .nvmrc else echo "No .nvmrc file present" fi echo echo "=== Checking all package.json for engines.node >=18 ===" rg -n '"node":\s*">=\s*18"' -g '*.json' || true echo echo "=== Checking markdown files for nvm install 18 ===" rg -n 'nvm install.*18' -g '*.md' || true echo echo "=== Checking Dockerfiles for FROM node:18 ===" rg -n 'FROM node:18' -g 'Dockerfile*' || trueLength of output: 1114
已同步升级 Node.js 引擎至 20+,未发现旧版 18 的残留引用
- CI 工作流(.github/workflows)中无
node-version: 18
- 仓库根目录无
.nvmrc
文件- 所有
package.json
中engines.node
均未找到>=18
的配置- 文档(*.md)中无
nvm install ...18
- Dockerfile 中无
FROM node:18
无需额外更新,可安全合并。
packages/taro-transformer-wx/src/render.ts (2)
792-797
: 类型安全性改进通过将
renderScope
变量的类型从Scope
改为Scope | undefined
,并使用可选链操作符来访问父级循环的作用域,增强了代码的健壮性。这样可以防止在找不到父级循环作用域时出现运行时错误。
927-928
: 类型安全调用使用可选链操作符确保了在
renderScope
为 undefined 时不会触发运行时错误,这是一个良好的防御性编程实践。packages/taro-transformer-wx/package.json (1)
32-33
:✅ Verification successful
引擎版本范围已更新
engines.node
已从>= 18
提升至>= 20
,确保支持 Node.js 20 及以上版本(包括即将发布的 Node.js 22),符合本次移除对 Node 18 支持的目标。请确认仓库中所有子包的engines
配置也已同步更改。
🏁 Script executed:
#!/bin/bash # 在 packages 目录下查找所有 package.json,并检查 engines.node 是否已更新至 >= 20 fd -e json -g package.json packages | xargs rg -n '"node": ">= 20"'Length of output: 3670
所有子包
engines.node
已同步更新至 ≥ 20脚本验证了
packages/
目录下所有package.json
文件中的engines.node
均已从>= 18
提升至>= 20
,覆盖了所有子包,无需进一步操作。packages/taro-service/package.json (1)
31-33
:❓ Verification inconclusive
确认 Node.js 引擎版本一致性
将engines.node
从>= 18
升级至>= 20
,请确保所有相关文档、CI 工作流及其他package.json
文件均已同步更新,以免出现版本不一致的问题。
🏁 Script executed:
#!/bin/bash # 查找仓库中仍使用 Node.js >=18 的 package.json 文件 rg '"node": ">= 18"' -lLength of output: 25
确认 Node.js 引擎版本一致性
仓库中所有
package.json
已检查,未发现仍使用">= 18"
的engines.node
配置。但请手动确认以下位置已同步更新为>= 20
,以免遗漏:
- CI 工作流:
.github/workflows/*.yml
中的node-version
或setup-node
配置- 项目文档:
README.md
、docs/
目录等说明文件- 其他任何引用 Node.js 版本的配置文件
packages/taro-plugin-mini-ci/package.json (1)
32-32
: 确认文档与 CI 中的 Node.js 版本一致性
此处已将engines.node
从>=18
升级到>=20
,请检查.github/workflows
中的 Node 版本及项目文档(如 CONTRIBUTING.md、README.md)是否已同步更新,以确保对目标“支持 Node.js 22”的完整兼容。packages/taro-webpack5-prebundle/package.json (1)
33-33
: 确认文档与 CI 中的 Node.js 版本一致性
此处已将engines.node
从>=18
升级到>=20
,请检查.github/workflows
中的 Node 版本及项目文档(如 CONTRIBUTING.md、README.md)是否已同步更新,以确保对目标“支持 Node.js 22”的完整兼容。packages/taro-plugin-vue-devtools/package.json (1)
30-30
: 确认文档与 CI 中的 Node.js 版本一致性
此处已将engines.node
从>=18
升级到>=20
,请检查.github/workflows
中的 Node 版本及项目文档(如 CONTRIBUTING.md、README.md)是否已同步更新,以确保对目标“支持 Node.js 22”的完整兼容。packages/taro-components-library-vue3/package.json (1)
18-18
: 确认文档与 CI 中的 Node.js 版本一致性
此处已将engines.node
从>=18
升级到>=20
,请检查.github/workflows
中的 Node 版本及项目文档(如 CONTRIBUTING.md、README.md)是否已同步更新,以确保对目标“支持 Node.js 22”的完整兼容。packages/create-app/package.json (1)
30-30
: 确认文档与 CI 中的 Node.js 版本一致性
此处已将engines.node
从>=18
升级到>=20
,请检查.github/workflows
中的 Node 版本及项目文档(如 CONTRIBUTING.md、README.md)是否已同步更新,以确保对目标“支持 Node.js 22”的完整兼容。packages/taro-react/package.json (1)
28-28
: 确认 Node.js 引擎版本要求更新
已将最低 Node.js 版本要求从 ">= 18" 升级至 ">= 20"。该范围向后兼容 Node 22,满足本次 PR“支持 Node 22”目标。packages/taro-api/package.json (1)
38-38
: 确认 Node.js 引擎版本要求更新
已将最低 Node.js 版本要求从 ">= 18" 升级至 ">= 20"。该范围向后兼容 Node 22,符合 PR 目标。npm/darwin-x64/package.json (1)
17-17
: 确认 Node.js 引擎版本要求更新
已将最低 Node.js 版本要求从 ">= 18" 升级至 ">= 20",确保原生绑定包兼容 Node 22。packages/taro/package.json (1)
23-23
: 确认 Node.js 引擎版本要求更新
已将最低 Node.js 版本要求从 ">= 18" 升级至 ">= 20",满足对 Node 22 的支持需求。packages/taro-components-library-react/package.json (1)
18-18
: 确认 Node.js 引擎版本要求更新
已将最低 Node.js 版本要求从 ">= 18" 升级至 ">= 20",兼容并支持 Node 22 及更高版本。packages/taro-rn/package.json (1)
38-38
: 确认 Node.js 引擎版本要求与 PR 目标一致
PR 目标是「支持 Node.js 22」,但此处将engines.node
设置为>=20
,建议核实是否应更新为>=22
,或说明选择>=20
的原因。packages/taro-runner-utils/package.json (1)
26-26
: 更新 Node.js 引擎最低版本
将 engines.node 从 18 升级到 >=20,符合对 Node 18 退役后的环境要求,并可兼容 Node 22。packages/taroize/package.json (1)
55-55
: 更新 Node.js 引擎最低版本
将 engines.node 从 18 升级到 >=20,与 monorepo 中其它包保持一致,并支持 Node 22 运行时环境。packages/taro-rn-transformer/package.json (1)
31-31
: 更新 Node.js 引擎最低版本
同步将 engines.node 升级至 >=20,满足整体升级规划,同时可兼容 Node 22。packages/postcss-html-transform/package.json (1)
27-27
: 更新 Node.js 引擎最低版本
将 engines.node 从 18 升级到 >=20,与其他包一致并覆盖后续 Node 22 平台。npm/win32-x64-msvc/package.json (1)
17-17
: 更新 Node.js 引擎最低版本
同步将 engines.node 升级到 >=20,统一项目 Engine 要求并支持 Node 22。packages/taro-platform-tt/package.json (1)
30-30
: 更新 Node.js 最低版本至 >=20
此变更与仓库统一升级策略保持一致,可确保在支持 Node.js 22.x 的 CI/CD 环境中正常运行。packages/taro-rn-style-transformer/package.json (1)
30-30
: 更新 Node.js 最低版本至 >=20
此变更与其它包的引擎版本同步,符合整体升级方向。packages/babel-plugin-transform-taroapi/package.json (1)
19-19
: 更新 Node.js 最低版本至 >=20
此变更符合仓库的统一升级策略,无其他元数据变更。packages/taro-framework-react/package.json (1)
33-33
: 更新 Node.js 最低版本至 >=20
与整体框架插件和 CI 工作流的版本要求保持一致。packages/taro-framework-vue3/package.json (1)
29-29
: 更新 Node.js 最低版本至 >=20
符合 Vue3 框架插件及全局升级策略,无需额外调整。npm/linux-x64-gnu/package.json (1)
17-17
: 确认 engines.node 范围与 PR 目标一致。PR 描述中提到支持 Node.js 22 及以上,但此处只将最低版本更新到
>=20
。请核实是否应进一步升级到>=22
,以保持与 CI 配置和 CONTRIBUTING.md 中的推荐版本一致。packages/taro-components/package.json (1)
56-56
: 确认 engines.node 范围与 PR 目标一致。PR 描述中要求支持 Node.js 22+,但此处仅将最低版本设为
>=20
。建议检查并确定是否需要将其更新为>=22
,以避免与文档及 CI 流程中的版本推荐不符。npm/linux-x64-musl/package.json (1)
16-16
: 确认 engines.node 范围与 PR 目标一致。仓库 CONTRIBUTING.md 推荐使用 Node.js 22,而这里仅升级到
>=20
。请验证是否应该将此处也改为>=22
,以保证所有包的版本要求保持一致。packages/taro-platform-jd/package.json (1)
30-30
: 确认 engines.node 范围与 PR 目标一致。当前将版本要求设为
>=20
,但 PR 目标中已提出支持 Node.js 22。请审查并确认是否需要将此处也调整到>=22
。packages/taro-platform-weapp/package.json (1)
29-29
: 确认 engines.node 范围与 PR 目标一致。此处更新为
>=20
,但 PR 目标及 CONTRIBUTING.md 均推荐 Node.js 22+。建议核实是否应将版本要求同步升级到>=22
。packages/taro-platform-alipay/package.json (1)
30-30
: 更新 Node.js 引擎版本至 >=20
已将"engines.node"
从>=18
升级为>=20
,与仓库中其他包保持一致,并与 CI 工作流中对 Node 22 的支持相匹配,完成弃用 Node 18 的目标。packages/babel-plugin-transform-react-jsx-to-rn-stylesheet/package.json (1)
26-26
: 更新 Node.js 引擎版本至 >=20
已将"engines.node"
从>=18
升级为>=20
,保持与整体仓库版本要求的一致性,符合弃用 Node 18 的 PR 目标。packages/stylelint-taro/package.json (1)
38-38
: 更新 Node.js 引擎版本至 >=20
已将"engines.node"
从>=18
升级为>=20
,与其他相关包同步,确保 CI 环境与文档中推荐的 Node 22 兼容。packages/stylelint-taro-rn/package.json (1)
42-42
: 更新 Node.js 引擎版本至 >=20
已将"engines.node"
从>=18
升级为>=20
,与仓库中其他插件包对齐,满足弃用旧版本 Node.js 的需求。packages/eslint-config-taro/package.json (1)
26-26
: 更新 Node.js 引擎版本至 >=20
已将"engines.node"
从>=18
升级为>=20
,与整个项目的 Node.js 版本策略保持一致,无需额外调整。npm/darwin-arm64/package.json (1)
17-18
: 引擎版本更新: 将 Node.js 引擎要求从>=18
升级到>=20
,与其他绑定包保持一致。packages/taro-runtime/package.json (3)
22-22
: 验证 Rollup CLI 参数:--configPlugin @rollup/plugin-typescript
需确保在当前 Rollup 版本中受支持,否则建议将插件直接在rollup.config.ts
中导入并移除该 CLI 参数。
31-32
: 引擎版本一致性: 将 Node.js 引擎要求从>=18
升级到>=20
,与项目其他包同步。
43-43
: 替换 TypeScript 插件: 已将弃用的rollup-plugin-ts
替换为官方@rollup/plugin-typescript
,推荐的升级方向。.github/workflows/build-rust-binding.yml (2)
17-17
: Node.js 版本升级: 将矩阵中的 Node.js 版本从18.x
升级至22.x
,符合弃用 Node 18 的目标。
50-53
: PNPM 版本升级: 将pnpm/action-setup
从v3
升级至v4
并将version
从9
升至10
,确保使用最新 pnpm。.github/workflows/sync-components-types.yml (2)
37-43
: PNPM 初始化更新: 将pnpm/action-setup
升级至v4
并设置version: 10
,并利用run_install
选项执行安装。请确认run_install
配置符合官方文档,确保参数生效。
47-49
: Node.js 版本升级: 将actions/setup-node
的node-version
从18
更改为22
,保持 CI 环境最新。.github/workflows/publish.yml (2)
89-92
: PNPM 设置升级: 在发布流程中将pnpm/action-setup
从v3
升级到v4
并设置version: 10
,与其他工作流保持一致。
93-98
: Node.js 版本升级: 将actions/setup-node
的node-version
从18
升至22
,并保留cache: 'pnpm'
和registry-url
。.github/workflows/nodejs.yml (4)
31-31
: 校正作业名称以修复拼写错误
已将 job 名称从nodejs-tesing
更正为nodejs-testing
,确保 CI 能正确识别并执行该步骤。
39-40
: 更新测试矩阵中的 Node.js 版本
已将测试矩阵中的 Node.js 版本列表由18.x
更新为22.x
和20.x
,以覆盖新的支持范围。
51-58
: 请验证矩阵排除逻辑
当前配置通过exclude
排除了 macOS 和 Windows 系统上的所有 Node.js 版本,这可能导致仅在ubuntu-latest
上运行测试,并且include
与exclude
组合存在重复或冲突。请确认此行为是否符合预期,或者重新调整include
/exclude
规则以确保所需的组合正确执行。
65-68
: 升级 pnpm 配置
已将pnpm/action-setup
升级至v4
并将 pnpm 版本从9
提升至10
,与仓库中其他 CI 工作流保持一致。packages/taro-cli/package.json (1)
43-43
: 更新 Node.js 引擎版本
已将engines.node
从>=18
更新为>=20
,与 CI 测试矩阵保持一致,覆盖现代 Node.js 版本。packages/taro-cli/tsconfig.json (1)
9-12
: 添加声明文件输出与路径映射
新增"declaration": true
用于生成.d.ts
类型声明,并对@babel/types
添加paths
映射,以确保模块能够正确解析,与其他子包配置保持一致。packages/taro-helper/tsconfig.json (1)
12-15
: 启用 sourceMap 并添加路径映射
新增"sourceMap": true
以便调试时生成映射文件,并对@babel/types
添加paths
映射,确保模块解析与taro-cli
保持一致。packages/taro-platform-harmony-hybrid/package.json (1)
63-63
: 更新了Rollup TypeScript插件使用官方的
@rollup/plugin-typescript
替换了之前的rollup-plugin-ts
,与PR的目标一致,支持Node 22。这是一个良好的更改,因为它使用了更标准、更维护良好的官方插件。packages/taro-h5/tsconfig.json (2)
8-8
: 启用了源映射生成启用了源代码映射(sourceMap)功能,这对开发和调试非常有帮助,可以更容易地定位到编译前的源代码位置。
10-10
: 更新了Rollup配置文件引用将
rollup.config.mts
更改为rollup.config.ts
,保持了配置文件命名的一致性,这有助于简化构建过程并避免混淆。packages/taro-platform-harmony-hybrid/tsconfig.json (1)
9-11
: 增强了TypeScript编译选项添加了
declaration: true
和outDir: "dist"
选项,使编译器生成声明文件(.d.ts)并将输出文件存放到dist目录,这是一个良好的改进,有助于类型推断和模块导入。packages/taro-runtime/rollup.config.ts (2)
1-1
: 更新了TypeScript插件导入从
rollup-plugin-ts
切换到官方的@rollup/plugin-typescript
,这与PR的目标一致,提高了与Node 22的兼容性。
16-18
: 简化了TypeScript插件配置配置更简洁,仅排除了
rollup.config.ts
文件,避免了循环依赖问题。相比之前可能复杂的配置,这种简化可以提高可维护性和可读性。packages/taro-router/package.json (2)
11-11
: 更新了 TypeScript 声明文件的引用方式将类型声明引用从
"typings"
更改为"types"
并修改了路径,这符合 TypeScript 的最新建议。这种变更有助于更好地支持现代构建工具和类型检查器。
34-34
: 提高了 Node.js 引擎版本要求将 Node.js 的最低版本要求从 18 提升到 20,这与 PR 的主要目标一致,因为 Node.js 18 将在 2025 年 4 月结束维护。这个更改可以确保项目利用更新版本的 Node.js 提供的性能和安全改进。
packages/taro-h5/package.json (3)
26-27
: 更新了构建和测试脚本配置脚本更改包括:
- 从
rollup.config.mts
更改为rollup.config.ts
,并添加了--configPlugin @rollup/plugin-typescript --bundleConfigAsCjs
选项- 简化了测试命令,使用更简洁的
jest
而不是直接指定路径这些更改有助于使构建过程与新版本的 Node.js 和构建工具兼容。
43-43
: 重新排序了依赖项将
@tarojs/components
在依赖列表中提前排序。虽然这不影响功能,但有助于保持依赖项的组织结构更加一致。
73-75
: 更新了 Rollup 相关依赖
- 添加了
@rollup/plugin-typescript
以替换已弃用的rollup-plugin-ts
- 调整了
@rollup/plugin-node-resolve
的位置- 添加了
rollup-plugin-dts
用于生成 TypeScript 声明文件这些更改符合 PR 的目标,确保与 Node 22 的兼容性。官方的 TypeScript 插件通常有更好的维护和兼容性。
packages/taro-platform-harmony-hybrid/rollup.config.ts (4)
4-4
: 替换了 TypeScript 插件依赖将
rollup-plugin-ts
替换为官方的@rollup/plugin-typescript
,这是一个良好的变更,因为官方插件通常有更好的维护和兼容性支持。
33-35
: 简化了 TypeScript 插件配置配置从之前可能较复杂的自定义
tsconfig
函数简化为只排除rollup.config.ts
文件。这使得配置更加简洁,同时保持了相同的功能。
72-73
: 简化了文件路径引用移除了使用
path.join(cwd, ...)
的复杂路径引用,改为直接使用字符串字面量。这种变更使代码更简洁,减少了不必要的依赖。
83-84
: 简化了构建插件配置文件路径同样移除了复杂的路径引用方式,使配置更加清晰。
packages/taro-platform-harmony/rollup.config.ts (7)
3-3
: 替换了 TypeScript 插件依赖将
rollup-plugin-ts
替换为官方的@rollup/plugin-typescript
,这符合整个项目的升级方向,确保与 Node 22 的兼容性。
19-21
: 简化了 TypeScript 插件配置移除了复杂的
tsconfig
函数配置,改为更简单的排除选项。这种简化使配置更加清晰,减少了潜在的问题。
29-31
: 简化了文件路径引用不再使用
path.join(cwd, ...)
来构建路径,而是直接使用字符串字面量。这减少了对 Node.js path 模块的依赖,使配置更加简洁。
54-57
: 简化了 runtime 配置中的文件路径引用同样采用了直接字符串路径而非 path.join 方法,保持了整个配置文件风格的一致性。
65-68
: 简化了 runtime-utils 配置中的文件路径引用采用相同的简化方式处理文件路径,与整个文件的重构风格保持一致。
76-79
: 简化了 components-react 配置中的文件路径引用继续保持了路径引用的一致性简化。
83-86
: 简化了 otherConfig 的 TypeScript 配置从之前可能的复杂配置简化为直接设置
declaration: false
和排除 rollup 配置文件。这种变更使配置更加清晰,同时保持功能一致。packages/taro-h5/rollup.config.ts (4)
3-3
: 更新了 TypeScript 编译插件从非官方的
rollup-plugin-ts
切换到官方的@rollup/plugin-typescript
,这符合 PR 目标,提高与 Node 22 的兼容性。
6-6
: 添加了声明文件生成插件引入
rollup-plugin-dts
用于生成 TypeScript 声明文件,这是一个很好的改进,可以更好地支持 TypeScript 类型定义。
28-28
: 简化了 TypeScript 配置移除了自定义 tsconfig 配置,改为直接排除
rollup.config.ts
文件,这样配置更加清晰简洁。
50-62
: 增强了构建输出配置新增了两个关键构建配置:
- 生成带有内联动态导入的 ESM 输出文件
- 使用
dts()
插件生成对应的声明文件,用于 API 配置生成这些变更提高了包的可用性和类型支持,特别是注释中提到的用于
taro-platform-h5\build\definition-json\parser.ts
生成 APIs 配置的功能。packages/taro-router/rollup.config-1745118866046.mjs (2)
1-6
: 导入了必要的 Rollup 插件和依赖导入了基本的 Rollup 插件用于支持 CommonJS、Node 模块解析、TypeScript 编译等功能,与其他包的配置保持一致。
🧰 Tools
🪛 ESLint
[error] 1-1: Extra semicolon.
(semi)
[error] 2-2: Extra semicolon.
(semi)
[error] 3-3: Extra semicolon.
(semi)
[error] 4-4: Extra semicolon.
(semi)
[error] 5-5: Extra semicolon.
(semi)
23-25
: TypeScript 配置包含必要的说明TypeScript 插件配置中明确包含了源代码和类型定义目录,并添加了注释说明这样做的必要性。这是一个很好的做法,避免了生成不必要的声明文件。
🧰 Tools
🪛 ESLint
[error] 23-23: Expected indentation of 4 spaces but found 8.
(@typescript-eslint/indent)
[error] 24-24: Expected indentation of 6 spaces but found 12.
(@typescript-eslint/indent)
[error] 25-25: Expected indentation of 4 spaces but found 8.
(@typescript-eslint/indent)
packages/jest-helper/package.json (1)
21-22
:✅ Verification successful
确认 Node.js 引擎版本要求一致性
当前将
engines.node
从>=18
升级至>=20
,请验证此修改是否符合本 PR 目标(支持 Node 22 及以上),并确保仓库中所有其他package.json
和 CI 工作流中的 Node 版本要求保持一致。以下脚本可用于检查所有
package.json
中的 Node 引擎声明:
🏁 Script executed:
#!/bin/bash # 检查 packages 目录下所有 package.json 的 engines.node 字段 rg -n '"node":' --glob 'packages/**/*.json'Length of output: 3897
🏁 Script executed:
#!/bin/bash # 检查 CI 工作流中的 node-version 和 actions/setup-node 配置 rg -n 'node-version:' --glob '.github/workflows/**/*.yml' rg -n 'setup-node' --glob '.github/workflows/**/*.yml' -A 3Length of output: 415
🏁 Script executed:
#!/bin/bash # 检查 .github/workflows 目录下所有 YAML 文件中的 Node 版本配置 rg -n 'node-version:' --glob '.github/workflows/*.{yml,yaml}' rg -n 'actions/setup-node' --glob '.github/workflows/*.{yml,yaml}' -A3Length of output: 430
🏁 Script executed:
#!/bin/bash # 列出并搜索 .github/workflows 目录下的 CI 配置文件中的 Node 版本 if [ -d .github/workflows ]; then for file in .github/workflows/*.{yml,yaml}; do [ -e "$file" ] || continue echo "=== 检查 $file ===" rg -n 'node-version:' "$file" rg -n 'actions/setup-node' "$file" -A3 done else echo ".github/workflows 目录不存在" fiLength of output: 3338
确认 Node.js 引擎版本一致性
- 已检查所有
packages/**/package.json
中的engines.node
,均已统一为>=20
- CI 工作流(
.github/workflows
)中通过 matrix 测试了20.x
与22.x
,且actions/setup-node@v4
已正确配置支持这些版本- 当前
>=20
的要求已覆盖并支持 Node 22 及以上,并与仓库中其他配置保持一致无需进一步调整。
packages/taro-helper/package.json
Outdated
"engines": { | ||
"node": ">= 18" | ||
"node": ">= 20" | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
请同步更新 pnpm 锁文件以修复 CI 失败
已将 engines.node
从 >=18
升级到 >=20
,此更改是合理的,但当前未重新生成 pnpm-lock.yaml
,导致 GitHub Actions 中的 pnpm install
因锁文件与依赖不匹配而失败。请在仓库根目录运行:
pnpm install -P
或使用等效命令重新生成并提交更新后的 pnpm-lock.yaml
。同时,建议检查其他子包的 package.json
中该字段一致性,以保持全项目对 Node.js 版本的统一要求。
? jsxElementPath | ||
.findParent((p) => isArrayMapCallExpression(p as any)) | ||
?.get('arguments')[0] | ||
.get('body').scope | ||
: this.renderScope | ||
const bindingNode = renderScope.getOwnBinding(assignmentName)!.path.node as any | ||
const bindingNode = renderScope?.getOwnBinding(assignmentName)!.path.node as any |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
潜在的空值安全问题
虽然使用了可选链操作符 ?.
处理 renderScope
可能为 undefined 的情况,但随后立即使用了非空断言操作符 !
,这可能导致运行时错误。
建议调整如下:
-const bindingNode = renderScope?.getOwnBinding(assignmentName)!.path.node as any
+const binding = renderScope?.getOwnBinding(assignmentName)
+const bindingNode = binding?.path.node as any
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
const bindingNode = renderScope?.getOwnBinding(assignmentName)!.path.node as any | |
const binding = renderScope?.getOwnBinding(assignmentName) | |
const bindingNode = binding?.path.node as any |
@@ -10,7 +10,7 @@ | |||
|
|||
### 1. 环境准备 | |||
|
|||
> 需要安装 [Node.js 16](https://nodejs.org/en/)(建议安装 `16.20.0` 及以上版本)及 [pnpm 7](https://pnpm.io/zh/installation) | |||
> 需要安装 [Node.js 22](https://nodejs.org/en/)(建议安装 `v22.14.0` 及以上版本)及 [pnpm 10](https://pnpm.io/zh/installation) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
文档 Node.js 最低版本不一致
文档中建议使用 Node.js v22.14.0+
,但 CI 测试矩阵和各包 package.json
中的 engines.node
均支持 >=20
。请统一最低版本要求:要么将文档改为 >=20
,要么在 CI 和引擎声明中仅保留 >=22
。
@@ -47,7 +47,7 @@ | |||
"rollup": "^3.29.4", | |||
"rollup-plugin-copy": "workspace:*", | |||
"rollup-plugin-node-externals": "^5.0.0", | |||
"rollup-plugin-ts": "^3.4.5", | |||
"@rollup/plugin-typescript": "^12.1.2", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
升级到了更新版本的TypeScript插件
引入了@rollup/plugin-typescript
的^12.1.2
版本,相比于harmony-hybrid
包中使用的^11.1.6
版本更新。这种不一致可能会导致构建行为略有差异。
建议考虑在所有包中统一插件版本,以确保构建行为的一致性。
🏁 Script executed:
#!/bin/bash
# 检查所有package.json中@rollup/plugin-typescript的版本是否一致
find . -name "package.json" -exec grep -l "@rollup/plugin-typescript" {} \; | xargs grep "@rollup/plugin-typescript"
Length of output: 2231
统一 @rollup/plugin‑typescript 插件版本
目前在各包中发现两种版本共存,可能导致构建差异:
^11.1.6
:- 根目录 package.json
- packages/taro-platform-harmony-hybrid/package.json
^12.1.2
:- packages/taro-h5/package.json
- packages/taro-platform-harmony/package.json
- packages/taro-runtime/package.json
建议将所有包中的 @rollup/plugin‑typescript
版本统一为同一版本(例如升级到 ^12.1.2
),以确保构建行为一致。
var rollup_config = defineConfig(variesConfig.map(v => { | ||
return Object.assign({}, baseConfig, v); | ||
})); | ||
|
||
export { rollup_config as default }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
导出配置与命名不符合项目规范
- 变量命名使用了下划线命名法
rollup_config
,而不是驼峰命名法 - 使用了分号,而项目其他部分看起来不使用分号
- 文件名带有时间戳
rollup.config-1745118866046.mjs
,不够规范
建议修改为更规范的形式:
-var rollup_config = defineConfig(variesConfig.map(v => {
- return Object.assign({}, baseConfig, v);
-}));
-
-export { rollup_config as default };
+export default defineConfig(variesConfig.map(v => {
+ return Object.assign({}, baseConfig, v)
+}))
另外,建议将文件重命名为标准的 rollup.config.mjs
,移除时间戳。
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
var rollup_config = defineConfig(variesConfig.map(v => { | |
return Object.assign({}, baseConfig, v); | |
})); | |
export { rollup_config as default }; | |
export default defineConfig(variesConfig.map(v => { | |
return Object.assign({}, baseConfig, v) | |
})) |
🧰 Tools
🪛 ESLint
[error] 48-48: Expected indentation of 2 spaces but found 4.
(@typescript-eslint/indent)
[error] 48-48: Extra semicolon.
(semi)
[error] 49-49: Extra semicolon.
(semi)
[error] 51-51: Extra semicolon.
(semi)
这个 PR 做了什么? (简要描述所做更改)
node 18
的维护4月底到期,此次变更将node 18
替换成了node 22
rollup-plugin-ts
替换为@rollup/plugin-typescript
以支持node 22
pnpm 10
重新生成pnpm-lock.yaml
这个 PR 是什么类型? (至少选择一个)
这个 PR 涉及以下平台:
Summary by CodeRabbit
新功能
文档
构建/工具链
修复