Skip to content

Conversation

@ianzone
Copy link
Contributor

@ianzone ianzone commented Jul 11, 2025

这个 PR 做了什么? (简要描述所做更改)
保留 #17895 除了 node 版本之外的其他更改

这个 PR 是什么类型? (至少选择一个)

  • 错误修复 (Bugfix) issue: fix #
  • 新功能 (Feature)
  • 代码重构 (Refactor)
  • TypeScript 类型定义修改 (Types)
  • 文档修改 (Docs)
  • 代码风格更新 (Code style update)
  • 构建优化 (Chore)
  • 其他,请描述 (Other, please describe):

这个 PR 涉及以下平台:

  • 所有平台
  • Web 端(H5)
  • 移动端(React-Native)
  • 鸿蒙(Harmony)
  • 鸿蒙容器(Harmony Hybrid)
  • ASCF 元服务
  • 快应用(QuickApp)
  • 所有小程序
  • 微信小程序
  • 企业微信小程序
  • 京东小程序
  • 百度小程序
  • 支付宝小程序
  • 支付宝 IOT 小程序
  • 钉钉小程序
  • QQ 小程序
  • 飞书小程序
  • 快手小程序
  • 头条小程序

Summary by CodeRabbit

  • 新功能

    • Harmony Hybrid 平台新增了 list 组件,支持 upper-threshold-count 和 lower-threshold-count 属性。
    • 新增 list-item 组件。
  • 优化

    • 构建配置和依赖项进行了优化,提升了开发体验和依赖管理效率。
    • TypeScript 类型声明文件的生成流程得到完善。
    • CLI 现在支持可选的 appPath 参数,并增加了对 Node.js 版本的兼容性警告,提示用户升级至 Node.js 20 及以上版本。
  • 依赖升级

    • 部分开发依赖(如 @vitest/coverage-istanbul、vitest、rollup-plugin-dts)升级至新版本。
    • 调整和移除部分 @types/node 相关依赖,统一依赖范围。

@coderabbitai
Copy link

coderabbitai bot commented Jul 11, 2025

Walkthrough

本次变更主要集中于依赖管理和构建配置优化。多个 package.json 文件中的 @types/node 依赖被放宽版本限制或移除,Rollup 构建脚本与插件依赖被调整为开发依赖,并对 Harmony 相关平台的构建配置、声明文件生成流程及组件定义进行了补充和优化。CLI 构造函数调整为可选路径参数,并增加 Node.js 版本兼容性警告。

Changes

文件/路径分组 变更简述
examples/blended-taro-component-vue3/taro-project/package.json
examples/mini-program-example/package.json
examples/taro-list/package.json
@types/node 依赖版本由精确 patch 版本放宽为 ^18,允许更广泛的 18.x 版本。
packages/taro-cli/templates/plugin-compile/package.json.tmpl @types/node 依赖版本由精确版本放宽为 ^18
packages/taro-platform-harmony-hybrid/package.json
packages/taro-plugin-generator/package.json
移除了 @types/node devDependencies 依赖。
package.json @vitest/coverage-istanbulvitest 版本由 ^3.2.3 升级为 ^3.2.4
packages/taro-platform-harmony-cpp/package.json Rollup 相关插件和工具移至 devDependencies,部分依赖版本升级或移除,构建脚本调整。
packages/taro-platform-harmony-cpp/rollup.config.ts 构建配置改用官方 @rollup/plugin-typescript,简化路径,新增 dts 声明文件生成配置并导出。
packages/taro-platform-harmony-cpp/tsconfig.json include 路径由 rollup.config.mts 改为 rollup.config.ts
packages/taro-platform-harmony-hybrid/build/config/harmony-definition.json 新增 list 组件及其属性,新增 list-item 组件声明。
packages/taro-cli/src/cli.ts CLI 构造函数参数改为可选,增加 Node.js 版本检测,版本低于 20 时输出升级警告。

Sequence Diagram(s)

sequenceDiagram
    participant 用户
    participant CLI
    participant NodeJS

    用户->>CLI: 创建 CLI 实例(可选 appPath)
    CLI->>NodeJS: 获取 Node.js 版本
    alt 版本 < 20
        CLI-->>用户: 输出版本不支持警告
    else 版本 >= 20
        CLI-->>用户: 正常初始化
    end
Loading
sequenceDiagram
    participant 开发者
    participant Rollup
    participant TypeScript插件
    participant DTS插件

    开发者->>Rollup: 启动构建
    Rollup->>TypeScript插件: 编译 TypeScript 源码
    TypeScript插件-->>Rollup: 输出 JS 文件
    Rollup->>DTS插件: 生成声明文件(.d.ts)
    DTS插件-->>Rollup: 输出 d.ts 文件
    Rollup-->>开发者: 构建产物(JS + d.ts)
Loading

Possibly related PRs

  • Chore/node18 #17988: 该 PR 主要将多个 package.json 中的 @types/node 版本限制从 18 降回 18.x,且调整了 Node.js 版本要求,与本次变更中对 Node.js 版本和依赖版本的调整有较强关联。

Suggested reviewers

  • tutuxxx
  • yoyo837

Poem

🐇
依赖轻装换新衣,
构建脚本更整齐。
类型声明添新翼,
组件家族又壮丽。
版本警告暖心意,
兔子欢跳庆升级!
🌿✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between db344a8 and 4cc7952.

📒 Files selected for processing (1)
  • packages/taro-platform-harmony-cpp/tsconfig.json (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/taro-platform-harmony-cpp/tsconfig.json
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Build Rust Binding / stable - x86_64-pc-windows-msvc
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai auto-generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@ianzone
Copy link
Contributor Author

ianzone commented Jul 11, 2025

@Single-Dancer 可否审下这个,谢谢

@coderabbitai coderabbitai bot requested review from tutuxxx and yoyo837 July 11, 2025 13:18
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (4)
.github/workflows/build-rust-wasm.yml (1)

19-28: 缓存 Key 修正 👍,可再增补 restore-keys 提升命中率

更正了 ubuntu 拼写后现有缓存会失效,需要重新构建一次 target。为避免将来类似的小修改再次失效,可增加一个前缀级的 restore-keys

       with:
...
-        key: wasm32-wasi-cargo-ubuntu-latest
+        key: wasm32-wasi-cargo-ubuntu-latest
+        restore-keys: |
+          wasm32-wasi-cargo-

这样即便后缀改动,也能回退到较粗粒度的旧缓存。

.github/workflows/nodejs.yml (2)

163-171: 统一 actions/cache@v4 与 Key,建议同样补充 restore-keys

同 build-rust-wasm,加入前缀级 restore-keys 可减少缓存失效带来的编译时间。


36-39: fail-fast: false 可考虑移除

升级后矩阵规模较大,而 fail-fast: false 会导致任一任务失败仍继续跑完全部,无助于节省 CI 额度。如果无并行失败调试需求,可删除该选项,让失败快速返回。

.github/workflows/build-rust-binding.yml (1)

66-74: 缓存步骤同样建议增加 restore-keys

          key: ${{ matrix.settings.target }}-cargo-${{ matrix.settings.host }}
+         restore-keys: |
+           ${{ matrix.settings.target }}-cargo-

可提升后续微调 key 时的缓存命中率。

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9c58e28 and ffa1314.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (18)
  • .github/dependabot.yml (1 hunks)
  • .github/workflows/auto-review.yml (1 hunks)
  • .github/workflows/build-rust-binding.yml (2 hunks)
  • .github/workflows/build-rust-wasm.yml (1 hunks)
  • .github/workflows/nodejs.yml (2 hunks)
  • .github/workflows/publish.yml (2 hunks)
  • .github/workflows/sync-components-types.yml (1 hunks)
  • examples/blended-taro-component-vue3/taro-project/package.json (1 hunks)
  • examples/mini-program-example/package.json (1 hunks)
  • examples/taro-list/package.json (1 hunks)
  • package.json (2 hunks)
  • packages/taro-cli/templates/plugin-compile/package.json.tmpl (1 hunks)
  • packages/taro-platform-harmony-cpp/package.json (2 hunks)
  • packages/taro-platform-harmony-cpp/rollup.config.ts (3 hunks)
  • packages/taro-platform-harmony-cpp/tsconfig.json (1 hunks)
  • packages/taro-platform-harmony-hybrid/build/config/harmony-definition.json (2 hunks)
  • packages/taro-platform-harmony-hybrid/package.json (0 hunks)
  • packages/taro-plugin-generator/package.json (0 hunks)
💤 Files with no reviewable changes (2)
  • packages/taro-plugin-generator/package.json
  • packages/taro-platform-harmony-hybrid/package.json
🧰 Additional context used
🧠 Learnings (8)
📓 Common learnings
Learnt from: ianzone
PR: NervJS/taro#17746
File: packages/taro-runtime/tsdown.config.ts:10-16
Timestamp: 2025-05-25T18:02:31.387Z
Learning: 在 taro-runtime 包的 tsdown 配置中,必须禁用 treeshake 来保留 dom-external/index.js 文件。
packages/taro-platform-harmony-cpp/tsconfig.json (1)
Learnt from: ianzone
PR: NervJS/taro#17746
File: packages/taro-runtime/tsdown.config.ts:10-16
Timestamp: 2025-05-25T18:02:31.387Z
Learning: 在 taro-runtime 包的 tsdown 配置中,必须禁用 treeshake 来保留 dom-external/index.js 文件。
packages/taro-cli/templates/plugin-compile/package.json.tmpl (1)
Learnt from: ianzone
PR: NervJS/taro#17746
File: packages/taro-runtime/tsdown.config.ts:10-16
Timestamp: 2025-05-25T18:02:31.387Z
Learning: 在 taro-runtime 包的 tsdown 配置中,必须禁用 treeshake 来保留 dom-external/index.js 文件。
package.json (1)
Learnt from: ianzone
PR: NervJS/taro#17842
File: packages/jest-helper/tsconfig.json:9-9
Timestamp: 2025-06-23T00:09:31.233Z
Learning: 在 jest-helper 包中,src 目录下没有 __tests__ 测试目录,只包含 resolver.ts、sequencer.ts 和 snapshot 目录。不要假设包中存在测试目录结构。
examples/blended-taro-component-vue3/taro-project/package.json (1)
Learnt from: ianzone
PR: NervJS/taro#17746
File: packages/taro-runtime/tsdown.config.ts:10-16
Timestamp: 2025-05-25T18:02:31.387Z
Learning: 在 taro-runtime 包的 tsdown 配置中,必须禁用 treeshake 来保留 dom-external/index.js 文件。
examples/taro-list/package.json (2)
Learnt from: ianzone
PR: NervJS/taro#17746
File: packages/taro-runtime/tsdown.config.ts:10-16
Timestamp: 2025-05-25T18:02:31.387Z
Learning: 在 taro-runtime 包的 tsdown 配置中,必须禁用 treeshake 来保留 dom-external/index.js 文件。
Learnt from: ianzone
PR: NervJS/taro#17842
File: packages/jest-helper/tsconfig.json:9-9
Timestamp: 2025-06-23T00:09:31.233Z
Learning: 在 jest-helper 包中,src 目录下没有 __tests__ 测试目录,只包含 resolver.ts、sequencer.ts 和 snapshot 目录。不要假设包中存在测试目录结构。
packages/taro-platform-harmony-cpp/rollup.config.ts (2)
Learnt from: ianzone
PR: NervJS/taro#17746
File: packages/taro-runtime/tsdown.config.ts:10-16
Timestamp: 2025-05-25T18:02:31.387Z
Learning: 在 taro-runtime 包的 tsdown 配置中,必须禁用 treeshake 来保留 dom-external/index.js 文件。
Learnt from: ianzone
PR: NervJS/taro#17842
File: packages/jest-helper/tsconfig.json:9-9
Timestamp: 2025-06-23T00:09:31.233Z
Learning: 在 jest-helper 包中,src 目录下没有 __tests__ 测试目录,只包含 resolver.ts、sequencer.ts 和 snapshot 目录。不要假设包中存在测试目录结构。
packages/taro-platform-harmony-cpp/package.json (1)
Learnt from: ianzone
PR: NervJS/taro#17746
File: packages/taro-runtime/tsdown.config.ts:10-16
Timestamp: 2025-05-25T18:02:31.387Z
Learning: 在 taro-runtime 包的 tsdown 配置中,必须禁用 treeshake 来保留 dom-external/index.js 文件。
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Testing on Node.js 18.x (ubuntu-latest)
  • GitHub Check: Testing on Node.js 20.x (ubuntu-latest)
  • GitHub Check: Testing on Node.js (macos-13)
  • GitHub Check: Testing on Node.js (windows-latest)
🔇 Additional comments (20)
package.json (1)

111-112: 确认 Vitest 依赖版本一致,无需后续操作

  • 根目录 package.json
    • "@vitest/coverage-istanbul": "^3.2.4"
    • "vitest": "^3.2.4"

脚本检查未发现其他 package.json 中存在旧版本引用,依赖版本已全部统一为 ^3.2.4,可忽略先前关于版本一致性检查的建议。

packages/taro-cli/templates/plugin-compile/package.json.tmpl (1)

38-38: 放宽 @types/node 版本符合统一策略
已与主仓 package.json 保持一致,无功能性风险。

examples/mini-program-example/package.json (1)

84-84: 示例项目同步放宽 @types/node 版本
更宽的范围可减少 dependabot 噪音,变更合理。

examples/blended-taro-component-vue3/taro-project/package.json (1)

51-51: 示例项目同步放宽 @types/node 版本
与其它示例保持一致,👍

examples/taro-list/package.json (1)

85-85: 示例项目同步放宽 @types/node 版本
一致性良好,无其他问题。

.github/dependabot.yml (1)

3-76: LGTM! Dependabot 配置优化得当

YAML 格式重构提高了可读性,关键的 @types/node 版本忽略范围从 < 13.14 扩展到 < 18 与仓库范围内的版本标准化保持一致。

packages/taro-platform-harmony-hybrid/build/config/harmony-definition.json (1)

2331-2345: LGTM! 新增列表组件定义

为 Harmony 平台添加了 listlist-item 组件的定义,包含相关的阈值计数属性,扩展了平台的组件支持能力。

packages/taro-platform-harmony-cpp/package.json (2)

33-33: LGTM! 构建脚本配置更新

构建脚本正确地从 rollup.config.mts 更新为 rollup.config.ts,移除了 --bundleConfigAsCjs 标志,与新的 Rollup 配置文件保持一致。


50-55: LGTM! 依赖项重构合理

将 Rollup 相关包从 dependencies 移至 devDependencies 是正确的分类,这些包只在构建时需要。rollup-plugin-dts 升级到 6.2.1 版本,与新的类型声明生成配置相匹配。

packages/taro-platform-harmony-cpp/tsconfig.json (1)

21-21: LGTM! TypeScript 配置同步更新

include 数组正确地将 "./rollup.config.mts" 更新为 "rollup.config.ts",与构建脚本和配置文件的变更保持一致。

packages/taro-platform-harmony-cpp/rollup.config.ts (5)

4-4: LGTM! 插件替换符合 PR 目标

rollup-plugin-ts 更换为 @rollup/plugin-typescript 符合 PR 的移除目标,这是推荐的标准 TypeScript 插件。


8-8: LGTM! 添加类型声明生成支持

引入 rollup-plugin-dts 用于生成 TypeScript 声明文件,这将提高包的类型支持和开发体验。


16-18: LGTM! 简化路径定义

将输入和输出路径定义简化为字符串形式,提高了配置的可读性和维护性。


76-90: LGTM! 新增类型声明文件配置

添加了 dtsConfigCjsdtsConfigEsm 两个配置,分别为主入口和 API 块生成 TypeScript 声明文件(.d.ts),这将大大提高包的类型安全性和开发体验。


92-92: LGTM! 配置导出完整

默认导出包含了所有四个配置(编译配置、API 配置和两个类型声明配置),确保了构建过程的完整性。

.github/workflows/sync-components-types.yml (2)

29-33: 升级到 actions/cache@v4 时请确认 Runner 侧 Node 版本

actions/cache@v4 运行于 Node 20。GitHub 托管的 ubuntu-latest runner 已符合要求,但如果后续迁移到自建 runner,需要保证 Node ≥ 20,否则所有缓存步骤会直接失败。


37-43: pnpm/action-setup@v4run_install 配置需再次核对

v4 版本对 run_install 的解析逻辑有调整(参数结构体校验更严格)。当前多行 YAML 字符串写法在 v3 可以正常解析,但在 v4 下如果字段顺序 / 缩进不符将导致 run_install 被忽略。建议在本分支跑一次完整 CI 以确认不会出现 “pnpm not found” 或缺依赖错误。

.github/workflows/nodejs.yml (1)

65-68: pnpm/action-setup 升级到 v4 ✔️

与其它工作流保持一致,没发现兼容性问题。

.github/workflows/build-rust-binding.yml (1)

50-53: pnpm Setup 升级一致性 OK

升级到 v4 与其它 workflow 对齐,无其他问题。

.github/workflows/publish.yml (1)

102-105: 升级到 pnpm/action-setup@v4 ✔️

与其他工作流保持一致,确认 CI 跑通即可。

@codecov
Copy link

codecov bot commented Jul 11, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 54.99%. Comparing base (bd2e191) to head (4cc7952).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##             main   #17992    +/-   ##
========================================
  Coverage   54.98%   54.99%            
========================================
  Files         417      417            
  Lines       21693    21696     +3     
  Branches     5349     5348     -1     
========================================
+ Hits        11928    11931     +3     
- Misses       8088     8212   +124     
+ Partials     1677     1553   -124     
Flag Coverage Δ
taro-cli 72.56% <100.00%> (+0.13%) ⬆️
taro-runtime 59.87% <ø> (ø)
taro-web 53.19% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
packages/taro-cli/src/cli.ts 86.55% <100.00%> (+0.34%) ⬆️

... and 41 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@coderabbitai coderabbitai bot requested a review from Single-Dancer July 11, 2025 13:35
@ianzone
Copy link
Contributor Author

ianzone commented Jul 11, 2025

@yoyo837 这个没问题了吧?

@ianzone
Copy link
Contributor Author

ianzone commented Jul 12, 2025

@yoyo837 这个也合一下?

@yoyo837 yoyo837 merged commit 7642ca8 into NervJS:main Jul 17, 2025
24 checks passed
@ianzone ianzone deleted the rollup branch July 17, 2025 13:41
This was referenced Jul 19, 2025
@coderabbitai coderabbitai bot mentioned this pull request Aug 9, 2025
1 task
@coderabbitai coderabbitai bot mentioned this pull request Aug 26, 2025
27 tasks
This was referenced Nov 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants