Skip to content

Conversation

@ianzone
Copy link
Contributor

@ianzone ianzone commented Jun 10, 2025

这个 PR 做了什么? (简要描述所做更改)
利用 nx 缓存加快本地构建及测试过程

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

  • 构建优化 (Chore)

Summary by CodeRabbit

  • 新功能

    • 新增 Nx 工作区配置与缓存管理脚本,提升构建与测试的效率与一致性。
    • 新增合并后自动上传 Nx 缓存的 GitHub Actions 工作流。
  • 功能优化

    • 构建、测试及快照更新脚本切换为 Nx 工具,支持更高效的并行执行。
    • 持续集成流程优化,合并构建与测试步骤,并增强缓存机制,提升执行速度和稳定性。
    • Harmony 平台 "cover-view" 组件新增 "marker-id" 和 "slot" 属性。
    • H5 平台 "scroll-view" 组件新增 "enhanced" 和 "showScrollbar" 属性。
  • 依赖调整

    • 添加 Nx 相关依赖,移除部分无用依赖。
  • 其他

    • 更新和优化配置文件,增强开发体验与环境兼容性。
    • 新增 VSCode Nx Console 扩展配置,支持 AI 规则生成。
    • GitHub Actions 工作流增加并发控制与超时设置,改进缓存恢复策略。
    • 新增 .gitignore 忽略规则,完善项目文件管理。

@coderabbitai
Copy link

coderabbitai bot commented Jun 10, 2025

Walkthrough

本次变更主要围绕引入和配置 Nx 构建系统,包括新增 nx.json、调整 package.json 脚本、添加 nx 依赖、完善 .gitignore 及 VSCode 配置,并对 GitHub Actions 工作流进行优化,增加缓存机制和合并后自动上传缓存的流程。同时引入了用于修复 Nx 缓存的脚本,并对部分平台定义和依赖进行了细微调整。

Changes

Cohort / File(s) Change Summary
Nx 配置与脚本支持
nx.json, package.json, .gitignore, .vscode/settings.json, scripts/fix-nx-cache.mjs
新增 Nx 配置文件 nx.json,package.json 脚本切换为 nx run-many,增加 nx 依赖;.gitignore 增加 Nx 相关缓存目录;VSCode 增加 nxConsole 配置;新增 fix-nx-cache.mjs 脚本用于修复 Nx 缓存数据库。
GitHub Actions 工作流优化
.github/workflows/nodejs.yml, .github/workflows/build-rust-binding.yml, .github/workflows/merged.yml
nodejs.yml 增加并发控制、缓存处理、合并构建测试步骤,移除 lint;build-rust-binding.yml Node 版本号格式调整;新增 merged.yml,合并 PR 后上传 Nx 缓存。
平台定义文件调整
packages/taro-platform-harmony-hybrid/build/config/harmony-definition.json, packages/babel-plugin-transform-taroapi/__tests__/__mocks__/h5-definition.json
Harmony hybrid 平台 cover-view 组件新增 marker-id 和 slot 属性;Taro H5 平台 scroll-view 组件 mock 定义新增 enhanced 和 showScrollbar 属性。
依赖调整
packages/taro-runtime/package.json
移除 rollup-plugin-ts 开发依赖。

Sequence Diagram(s)

sequenceDiagram
    participant Developer
    participant Nx CLI
    participant fix-nx-cache.mjs
    participant Nx Daemon
    participant FileSystem

    Developer->>Nx CLI: 运行 build/test/updateSnapshot 脚本
    Nx CLI->>FileSystem: 读取 nx.json 配置
    Nx CLI->>Nx Daemon: 启动/停止 Daemon
    Nx CLI->>FileSystem: 读写 .nx 缓存

    Developer->>fix-nx-cache.mjs: 执行缓存修复脚本
    fix-nx-cache.mjs->>Nx Daemon: 停止 Daemon
    fix-nx-cache.mjs->>FileSystem: 备份 .db 文件
    fix-nx-cache.mjs->>Nx CLI: 执行 clean 生成新 db
    fix-nx-cache.mjs->>Nx Daemon: 再次停止 Daemon
    fix-nx-cache.mjs->>FileSystem: 删除新 .db,恢复旧 .db
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~15-25 minutes

Suggested reviewers

  • yoyo837
  • tutuxxx

Poem

🐇
Nx 新舞台,缓存巧安排,
工作流并发,缓存随风来。
脚本轻轻修,依赖悄悄裁,
配置更精细,构建效率快。
代码小兔笑,协作步步高!

Note

🔌 MCP (Model Context Protocol) integration is now available in Early Access!

Pro users can now connect to remote MCP servers under the Integrations page to get reviews and chat conversations that understand additional development context.


📜 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 03d26f0 and 4e642e4.

📒 Files selected for processing (1)
  • .github/workflows/merged.yml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/merged.yml
✨ 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.
  • 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.

Support

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

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 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.

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: 0

🧹 Nitpick comments (4)
.gitignore (1)

87-89: 建议明确忽略目录
当前对 .nx/cache.nx/workspace-data 的忽略模式已生效,但推荐在行末添加斜杠以示意要忽略目录(例如 .nx/cache/.nx/workspace-data/),或者简化为忽略整个 .nx/ 目录:

-.nx/cache
-.nx/workspace-data
+.nx/
.vscode/settings.json (1)

24-25: 补充插件依赖及文档说明
引入 "nxConsole.generateAiAgentRules": true 依赖于 Nx Console 扩展,请在项目文档(README 或 CONTRIBUTING)中说明该依赖,并提供如何安装和启用此插件的使用指南。

nx.json (1)

8-23: 建议集中管理可缓存操作
当前在每个 targetDefaults 中都配置了 cache: true。可考虑在 nx.json 中通过 tasksRunnerOptions.default.options.cacheableOperations 全局声明要缓存的任务列表,从而简化维护并提升可读性。

.github/instructions/nx.instructions.md (1)

5-6: 使用 Markdown 注释语法
文件中出现了 // This file is automatically generated by Nx Console,建议改用 Markdown 内置的 HTML 注释形式:

<!-- This file is automatically generated by Nx Console -->

以保持文档一致性。

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 77886ae and 9c2c2bf.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (6)
  • .github/instructions/nx.instructions.md (1 hunks)
  • .gitignore (1 hunks)
  • .vscode/mcp.json (1 hunks)
  • .vscode/settings.json (1 hunks)
  • nx.json (1 hunks)
  • package.json (4 hunks)
🧰 Additional context used
🪛 LanguageTool
.github/instructions/nx.instructions.md

[misspelling] ~7-~7: Use “a” instead of ‘an’ if the following word doesn’t start with a vowel sound, e.g. ‘a sentence’, ‘a university’.
Context: ...lly generated by Nx Console You are in an nx workspace using Nx 21.1.3 and pnpm a...

(EN_A_VS_AN)


[misspelling] ~14-~14: Use “a” instead of ‘an’ if the following word doesn’t start with a vowel sound, e.g. ‘a sentence’, ‘a university’.
Context: ...iguration - If the user needs help with an Nx configuration or project graph error...

(EN_A_VS_AN)


[style] ~35-~35: Consider using a different verb for a more formal wording.
Context: ...' to see what's wrong and help the user fix their problem. Use the appropriate tool...

(FIX_RESOLVE)


[uncategorized] ~37-~37: Use a comma before “and” if it connects two independent clauses (unless they are closely connected and short).
Context: ...n the task. This task is already running and the user can see the output in the term...

(COMMA_COMPOUND_SENTENCE_2)

⏰ Context from checks skipped due to timeout of 90000ms (6)
  • GitHub Check: Build Rust Binding / stable - aarch64-apple-darwin
  • GitHub Check: Build Rust Binding / stable - x86_64-apple-darwin
  • GitHub Check: Build Rust WASM / stable - wasm32-wasi
  • GitHub Check: Build Rust Binding / stable - x86_64-pc-windows-msvc
  • GitHub Check: Build Rust Binding / stable - x86_64-unknown-linux-gnu
  • GitHub Check: Testing on Rust
🔇 Additional comments (7)
.vscode/mcp.json (1)

1-8: 确认 VSCode 扩展配置生效
该文件定义了名为 “nx-mcp” 的 HTTP 服务器配置,请确保团队在 VSCode 中已安装并启用对应的插件(如 REST Client、Nx Console 等),以便正确加载此自定义服务器。

nx.json (1)

1-7: 评估跨平台运行时检查兼容性
namedInputs.sharedGlobals 中使用 node --versionpnpm --version 作为运行时输入,建议确认这些命令在 Windows、macOS 和 Linux 环境下一致可用,或考虑统一调用方式。

.github/instructions/nx.instructions.md (1)

1-3: 检查 YAML Frontmatter 语法
第一行使用了三个短横线和 applyTo: '**',请确认该 Frontmatter 格式可被目标工具正确解析。

package.json (4)

23-23: 确认 build 脚本与 Nx 配置一致
请确保在 nx.json 或各项目配置中已声明 prod 目标,否则执行 nx run-many -t prod 时会失败。


33-33: 验证 test:ci 任务在 Nx 中定义
请检查 nx.json 或工作区项目是否包含名为 test:ci 的任务,以免 nx run-many -t test:ci 找不到目标。


35-35: 确认 updateSnapshot 任务配置完备
nx run-many -t updateSnapshot 应对应相应的目标,请核实工作区中已正确声明并配置此任务。


145-145: 新增 nx 依赖版本审查
已将 nx 添加为 devDependency,版本号 ^21.1.3 是否与当前工作区和插件兼容?请验证并确认无后向兼容性问题。

@coderabbitai coderabbitai bot requested a review from yoyo837 June 11, 2025 12:05
@codecov
Copy link

codecov bot commented Jun 11, 2025

Codecov Report

Attention: Patch coverage is 85.71429% with 1 line in your changes missing coverage. Please review.

Project coverage is 56.72%. Comparing base (d93fa03) to head (e2e9010).
Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
packages/taro-cli/src/presets/commands/build.ts 0.00% 1 Missing ⚠️

❌ Your project check has failed because the head coverage (56.72%) is below the target coverage (75.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #17842      +/-   ##
==========================================
+ Coverage   55.90%   56.72%   +0.82%     
==========================================
  Files         417      197     -220     
  Lines       21693     5682   -16011     
  Branches     5376     1236    -4140     
==========================================
- Hits        12127     3223    -8904     
+ Misses       7935     2270    -5665     
+ Partials     1631      189    -1442     
Flag Coverage Δ
taro-runner ?

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

Files with missing lines Coverage Δ
...-cli/src/__tests__/fixtures/default/config/prod.js 100.00% <ø> (ø)
packages/taro-cli/src/presets/commands/info.ts 85.71% <100.00%> (ø)
packages/taro-cli/src/presets/commands/inspect.ts 100.00% <100.00%> (ø)
packages/taro-cli/src/presets/commands/update.ts 90.24% <100.00%> (+2.43%) ⬆️
packages/taro-cli/src/presets/commands/build.ts 39.72% <0.00%> (ø)

... and 220 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.

@ianzone
Copy link
Contributor Author

ianzone commented Jun 11, 2025

@tutuxxx hi,距离 #17390 已经过去三个多月了,不知是否可以确认至少采纳 NX?lefthook 和 biome 的引入我会分开提PR。

@Ryan-CW-Code
Copy link

Taro的大佬们都去弄鸿蒙了😂
您提的PR质量都好高啊

@ianzone
Copy link
Contributor Author

ianzone commented Jun 12, 2025

npmjs 居然宕机了。

@coderabbitai coderabbitai bot requested a review from tutuxxx June 13, 2025 04:57
@ianzone
Copy link
Contributor Author

ianzone commented Jun 13, 2025

这个日志就比 pnpm 整洁多了
image

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

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between b5f6692 and 59022cd.

📒 Files selected for processing (4)
  • .github/workflows/nodejs.yml (3 hunks)
  • nx.json (1 hunks)
  • packages/taro-platform-harmony-hybrid/build/config/harmony-definition.json (2 hunks)
  • packages/taro-rn/src/lib/index.ts (1 hunks)
✅ Files skipped from review due to trivial changes (2)
  • packages/taro-platform-harmony-hybrid/build/config/harmony-definition.json
  • packages/taro-rn/src/lib/index.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/nodejs.yml
🧰 Additional context used
🪛 Biome (1.9.4)
nx.json

[error] 2-2: Expected a property but instead found '// https://nx.dev/reference/nx-json'.

Expected a property here.

(parse)


[error] 3-3: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 3-3: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 3-3: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 3-4: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 5-5: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 5-5: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 5-9: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 9-9: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 10-10: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 10-10: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 10-25: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 25-26: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)

⏰ Context from checks skipped due to timeout of 90000ms (5)
  • GitHub Check: Build Rust Binding / stable - aarch64-apple-darwin
  • GitHub Check: Build Rust Binding / stable - x86_64-unknown-linux-gnu
  • GitHub Check: Build Rust Binding / stable - x86_64-pc-windows-msvc
  • GitHub Check: Build Rust Binding / stable - x86_64-apple-darwin
  • GitHub Check: Build Rust WASM / stable - wasm32-wasi
🔇 Additional comments (3)
nx.json (3)

10-25: 验证目标(target)名称与项目脚本匹配
已为 prodtest:ciupdateSnapshot 定义默认输入、依赖和缓存策略,需确保各个子项目(project.json 或 workspace.json)中存在对应的 target,并且 package.json 中调用 nx run-many --target=XXX 的脚本名称一致,否则缓存与依赖关系配置将不会生效。

🧰 Tools
🪛 Biome (1.9.4)

[error] 10-10: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 10-10: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 10-25: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


26-27: 文件尾的闭合括号和空行无需额外评论。


1-4:

❓ Verification inconclusive

留意 JSON 注释与工具解析错误
当前文件使用了 // 注释,纯 JSON 格式并不支持,这会导致 Biome 等静态分析工具报错。请确认仓库是否将 nx.json 当作 JSONC 解析,或将其重命名为 .jsonc;否则需移除注释或在工具配置中忽略该文件。


确认 nx.json 注释兼容性
nx.json 默认使用 JSONC 解析器,支持保留 // 注释,无需重命名;

  • 请核实 Biome 等静态分析/格式化工具对 .json 注释的兼容性
  • 若工具不支持,可在其配置中将 nx.json 识别为 JSONC,或移除/迁移注释以避免错误
🧰 Tools
🪛 Biome (1.9.4)

[error] 2-2: Expected a property but instead found '// https://nx.dev/reference/nx-json'.

Expected a property here.

(parse)


[error] 3-3: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 3-3: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 3-3: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 3-4: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)

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: 0

🧹 Nitpick comments (1)
packages/taro-runtime/jest.config.js (1)

16-18: 硬编码文件路径易增加维护成本,可考虑使用 rootDir 或统一别名
将映射改为 .../dist/runtime.js 虽能精确定位,但直接在各包的 Jest 配置里写死长路径会带来两点隐患:

  1. 项目目录层级变动或包名调整时需要逐一修改。
  2. 多处配置散落,难以统一变更,且 Nx 缓存规则对路径十分敏感,稍有不一致就可能导致缓存失效。

建议:

- '@tarojs/plugin-framework-vue3/dist/runtime': path.resolve(__dirname, '..', '..', 'packages/taro-framework-vue3/dist/runtime.js'),
+ '^@tarojs/plugin-framework-vue3/dist/runtime$': '<rootDir>/../taro-framework-vue3/dist/runtime.js',
  • 使用 <rootDir>(Jest 内置,等价于当前包根)避免 path.resolve
  • 为保持一致性,可将所有包的 moduleNameMapper 抽到 monorepo 根部的共享 Jest 基础配置,再通过 extends 引用,降低重复。
  • runtime.js 为 ES 模块,需确认 transformIgnorePatterns 不会跳过该文件,否则请在根配置里为其添加转译规则。
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 0e27dfa and dd25cdb.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (1)
  • packages/taro-runtime/jest.config.js (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (5)
  • GitHub Check: Build Rust Binding / stable - x86_64-unknown-linux-gnu
  • GitHub Check: Build Rust Binding / stable - aarch64-apple-darwin
  • GitHub Check: Build Rust Binding / stable - x86_64-pc-windows-msvc
  • GitHub Check: Build Rust Binding / stable - x86_64-apple-darwin
  • GitHub Check: Build Rust WASM / stable - wasm32-wasi

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: 0

🧹 Nitpick comments (1)
packages/babel-plugin-transform-taroapi/jest.config.ts (1)

14-16: 建议将键名改为完整正则,避免误匹配
目前键名包含 ./,Jest 会按正则处理,若后续有更长路径前缀,可能被错误命中。

-  '@tarojs/plugin-platform-h5/dist/definition.json': resolve(__dirname, '..', 'taro-platform-h5/dist/definition.json')
+  '^@tarojs/plugin-platform-h5/dist/definition\\.json$': resolve(__dirname, '..', 'taro-platform-h5', 'dist', 'definition.json')

顺带把 resolve 的第三个参数拆分为多段,保持跨平台一致性。

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between dd25cdb and d0c957d.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (1)
  • packages/babel-plugin-transform-taroapi/jest.config.ts (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (6)
  • GitHub Check: Build Rust Binding / stable - aarch64-apple-darwin
  • GitHub Check: Build Rust Binding / stable - x86_64-apple-darwin
  • GitHub Check: Build Rust Binding / stable - x86_64-pc-windows-msvc
  • GitHub Check: Build Rust Binding / stable - x86_64-unknown-linux-gnu
  • GitHub Check: Build Rust Binding / stable - x86_64-unknown-linux-musl
  • GitHub Check: Build Rust WASM / stable - wasm32-wasi
🔇 Additional comments (1)
packages/babel-plugin-transform-taroapi/jest.config.ts (1)

1-1: 引入 node:path 的做法正确且符合 Node 18+ 规范
直接从 node: 命名空间导入可避免路径被打包工具错误解析,👍

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: 0

🧹 Nitpick comments (2)
nx.json (2)

2-4: 配置文件建议重命名为 nx.jsonc 以支持注释
当前文件中使用了 JSON 注释(//),这会导致一些严格的 JSON 校验工具(如 Biome)报错。因为 Nx 支持 JSONC,可以考虑将文件重命名为 nx.jsonc 并在需要的地方更新引用,或在 Biome 配置中排除此文件以消除噪音。

🧰 Tools
🪛 Biome (1.9.4)

[error] 2-2: Expected a property but instead found '// https://nx.dev/reference/nx-json'.

Expected a property here.

(parse)


[error] 3-3: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 3-3: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 3-3: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 3-4: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


22-25: 考虑为 updateSnapshot 添加 outputs
当前 updateSnapshot 未指定 outputs,可能导致缓存策略捕获不到更新的快照文件或导致缓存命中不准确。建议根据项目实际快照输出路径(如 __snapshots__)补充 outputs

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between d0c957d and b5f358e.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (6)
  • .github/workflows/nodejs.yml (3 hunks)
  • nx.json (1 hunks)
  • package.json (4 hunks)
  • packages/taro-components/package.json (1 hunks)
  • packages/taro-runtime/jest.config.js (1 hunks)
  • packages/taro-runtime/src/__tests__/vue.spec.js (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • packages/taro-runtime/src/tests/vue.spec.js
🚧 Files skipped from review as they are similar to previous changes (4)
  • .github/workflows/nodejs.yml
  • packages/taro-components/package.json
  • packages/taro-runtime/jest.config.js
  • package.json
🧰 Additional context used
🧠 Learnings (1)
nx.json (1)
Learnt from: ianzone
PR: NervJS/taro#17842
File: nx.json:5-9
Timestamp: 2025-06-13T09:59:26.432Z
Learning: 在 Nx 的 nx.json 中,命名输入组之间的引用可以直接写字符串(如 "sharedGlobals"、"default"),不需要使用 "#" 等前缀。
🪛 Biome (1.9.4)
nx.json

[error] 2-2: Expected a property but instead found '// https://nx.dev/reference/nx-json'.

Expected a property here.

(parse)


[error] 3-3: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 3-3: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 3-3: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 3-4: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 5-5: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 5-5: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 5-9: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 9-9: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 10-10: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 10-10: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 10-26: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 26-27: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)

⏰ Context from checks skipped due to timeout of 90000ms (6)
  • GitHub Check: Build Rust Binding / stable - aarch64-apple-darwin
  • GitHub Check: Build Rust Binding / stable - x86_64-unknown-linux-musl
  • GitHub Check: Build Rust Binding / stable - x86_64-unknown-linux-gnu
  • GitHub Check: Build Rust Binding / stable - x86_64-apple-darwin
  • GitHub Check: Build Rust Binding / stable - x86_64-pc-windows-msvc
  • GitHub Check: Build Rust WASM / stable - wasm32-wasi
🔇 Additional comments (3)
nx.json (3)

5-9: 确认 namedInputs 引用语法正确
根据 Nx 官方文档(v21+),在 namedInputs 中直接使用命名组(如 "sharedGlobals""default")即可正确引用,无需前缀 "#"。已符合规范,无需更改。

🧰 Tools
🪛 Biome (1.9.4)

[error] 5-5: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 5-5: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 5-9: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 9-9: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


10-16: prod 目标缓存配置合理
prod 目标配置了输入、依赖、缓存和输出,符合最佳实践。outputs 指定了 dist 目录,确保构建产物可被缓存与恢复。

🧰 Tools
🪛 Biome (1.9.4)

[error] 10-10: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 10-10: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 10-26: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


17-21: 请确认 dependsOn 配置
test:ci 依赖项使用了 "dependsOn": ["prod"],请验证是否应使用 ["^prod"](含依赖项目的 prod 任务)来保证跨项目依赖生效,或确实只需当前项目的 prod

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: 0

♻️ Duplicate comments (3)
tests/__tests__/config.spec.ts (3)

119-119: 同上 – 参见行 105 的建议。


192-192: 同上 – 参见行 175 的建议。


225-225: 同上 – 参见行 208 的建议。

🧹 Nitpick comments (3)
tests/__tests__/config.spec.ts (3)

105-105: 使用 toHaveBeenCalledWith 替换别名是正确做法,但可加次数断言

toHaveBeenCalledWith(true) 更直观且官方推荐。不过为了避免误把多次调用也视为通过,可考虑同时断言调用次数:

 expect(fn).toHaveBeenCalledWith(true)
+expect(fn).toHaveBeenCalledTimes(1)

175-175: 校验 include 回调时建议断言参数以提高覆盖率

目前只检查“被调用”,但未验证传入的 filename 是否符合预期,测试价值有限。可考虑:

-expect(include).toHaveBeenCalled()
+expect(include).toHaveBeenCalled()
+expect(include.mock.calls[0][0]).toContain(sourceRoot)  // 示例断言

208-208: 对 exclude 回调同样可断言参数

建议和 include 部分保持一致,确认排除逻辑针对正确文件:

-expect(exclude).toHaveBeenCalled()
+expect(exclude).toHaveBeenCalled()
+expect(exclude.mock.calls[0][0]).toContain(sourceRoot)
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between b5f358e and 1ee0f56.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (3)
  • .github/workflows/nodejs.yml (3 hunks)
  • package.json (4 hunks)
  • tests/__tests__/config.spec.ts (7 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • .github/workflows/nodejs.yml
  • package.json
⏰ Context from checks skipped due to timeout of 90000ms (6)
  • GitHub Check: Build Rust Binding / stable - aarch64-apple-darwin
  • GitHub Check: Build Rust Binding / stable - x86_64-pc-windows-msvc
  • GitHub Check: Build Rust Binding / stable - x86_64-unknown-linux-musl
  • GitHub Check: Build Rust Binding / stable - x86_64-apple-darwin
  • GitHub Check: Build Rust Binding / stable - x86_64-unknown-linux-gnu
  • GitHub Check: Build Rust WASM / stable - wasm32-wasi
🔇 Additional comments (1)
tests/__tests__/config.spec.ts (1)

2-2: 无需额外动作

仅增加空行用于分隔导入,符合常规代码风格。

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: 0

🧹 Nitpick comments (1)
nx.json (1)

2-4: 考虑将文件重命名为 JSONC 以消除 Biome 报错
当前 nx.json 使用了 // 注释,Nx 会把它当作 JSONC 正确解析,但 Biome 把它当作纯 JSON 校验并报错。建议可选方案:

  1. 将文件重命名为 nx.jsonc 并同步更新引用;
  2. 在 Biome 配置中排除 nx.json
🧰 Tools
🪛 Biome (1.9.4)

[error] 2-2: Expected a property but instead found '// https://nx.dev/reference/nx-json'.

Expected a property here.

(parse)


[error] 3-3: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 3-3: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 3-3: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 3-4: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 1ecb1b5 and a6bfdea.

📒 Files selected for processing (1)
  • nx.json (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
nx.json (1)
Learnt from: ianzone
PR: NervJS/taro#17842
File: nx.json:5-9
Timestamp: 2025-06-13T09:59:26.456Z
Learning: 在 Nx 的 nx.json 中,命名输入组之间的引用可以直接写字符串(如 "sharedGlobals"、"default"),不需要使用 "#" 等前缀。
🪛 Biome (1.9.4)
nx.json

[error] 2-2: Expected a property but instead found '// https://nx.dev/reference/nx-json'.

Expected a property here.

(parse)


[error] 3-3: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 3-3: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 3-3: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 3-4: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 5-5: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 5-5: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 5-9: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 9-9: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 10-10: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 10-10: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 10-27: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 27-28: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)

⏰ Context from checks skipped due to timeout of 90000ms (7)
  • GitHub Check: Build Rust Binding / stable - x86_64-unknown-linux-gnu
  • GitHub Check: Build Rust Binding / stable - x86_64-apple-darwin
  • GitHub Check: Build Rust Binding / stable - aarch64-apple-darwin
  • GitHub Check: Build Rust Binding / stable - x86_64-pc-windows-msvc
  • GitHub Check: Build Rust Binding / stable - x86_64-unknown-linux-musl
  • GitHub Check: Build Rust WASM / stable - wasm32-wasi
  • GitHub Check: Testing on Rust
🔇 Additional comments (2)
nx.json (2)

5-9: 确认命名输入引用符合官方文档
namedInputs 中直接使用 "sharedGlobals""default" 即可,按 Nx v21 官方文档,无需加 # 前缀,配置正确。

🧰 Tools
🪛 Biome (1.9.4)

[error] 5-5: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 5-5: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 5-9: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 9-9: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


10-27: 目标默认配置合理
prodtest:ciupdateSnapshotinputsdependsOn、缓存及输出路径配置符合预期,能正确驱动 NX 缓存和依赖链。

🧰 Tools
🪛 Biome (1.9.4)

[error] 10-10: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 10-10: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 10-27: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)

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: 0

🧹 Nitpick comments (2)
nx.json (1)

2-4: 改进建议:将 nx.json 重命名为 nx.jsonc 或在 Biome 中排除该文件
当前文件使用了 // 注释以 JSONC 格式编写,Biome 工具将其当作纯 JSON 校验导致大量误报。建议将文件重命名为 nx.jsonc 并在相关引用或脚本中更新路径,或在 Biome 配置中排除该文件以消除噪音。

🧰 Tools
🪛 Biome (1.9.4)

[error] 2-2: Expected a property but instead found '// https://nx.dev/reference/nx-json'.

Expected a property here.

(parse)


[error] 3-3: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 3-3: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 3-3: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 3-4: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)

.github/instructions/nx.instructions.md (1)

5-41: 建议在静态分析工具中排除该目录
.github/instructions 目录下的文件为 AI agent 使用的指导文档,包含多种指令和自然语言描述,静态分析工具(如 Biome、LanguageTool)对其中的注释或段落误报较多。建议在相关配置中将该目录排除,以免影响整体 lint 报告。

🧰 Tools
🪛 LanguageTool

[misspelling] ~7-~7: Use “a” instead of ‘an’ if the following word doesn’t start with a vowel sound, e.g. ‘a sentence’, ‘a university’.
Context: ...lly generated by Nx Console You are in an nx workspace using Nx 21.1.3 and pnpm a...

(EN_A_VS_AN)


[misspelling] ~14-~14: Use “a” instead of ‘an’ if the following word doesn’t start with a vowel sound, e.g. ‘a sentence’, ‘a university’.
Context: ...iguration - If the user needs help with an Nx configuration or project graph error...

(EN_A_VS_AN)


[style] ~35-~35: Consider using a different verb for a more formal wording.
Context: ...' to see what's wrong and help the user fix their problem. Use the appropriate tool...

(FIX_RESOLVE)


[uncategorized] ~37-~37: Use a comma before “and” if it connects two independent clauses (unless they are closely connected and short).
Context: ...n the task. This task is already running and the user can see the output in the term...

(COMMA_COMPOUND_SENTENCE_2)

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between a6bfdea and 8352002.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (17)
  • .github/instructions/nx.instructions.md (1 hunks)
  • .github/workflows/build-rust-binding.yml (1 hunks)
  • .github/workflows/nodejs.yml (4 hunks)
  • .github/workflows/publish.yml (1 hunks)
  • .github/workflows/sync-components-types.yml (1 hunks)
  • .gitignore (1 hunks)
  • .vscode/mcp.json (1 hunks)
  • .vscode/settings.json (1 hunks)
  • nx.json (1 hunks)
  • package.json (3 hunks)
  • packages/taro-components/package.json (1 hunks)
  • packages/taro-components/virtual-list/index.d.ts (0 hunks)
  • packages/taro-components/virtual-list/index.js (0 hunks)
  • packages/taro-platform-harmony-hybrid/build/config/harmony-definition.json (2 hunks)
  • packages/taro-rn/src/lib/index.ts (1 hunks)
  • packages/taro-transformer-wx/jest.config.ts (0 hunks)
  • tests/jest.config.ts (0 hunks)
💤 Files with no reviewable changes (4)
  • packages/taro-transformer-wx/jest.config.ts
  • tests/jest.config.ts
  • packages/taro-components/virtual-list/index.js
  • packages/taro-components/virtual-list/index.d.ts
✅ Files skipped from review due to trivial changes (1)
  • packages/taro-rn/src/lib/index.ts
🚧 Files skipped from review as they are similar to previous changes (10)
  • .github/workflows/build-rust-binding.yml
  • .vscode/mcp.json
  • .gitignore
  • .github/workflows/sync-components-types.yml
  • .github/workflows/publish.yml
  • .vscode/settings.json
  • packages/taro-platform-harmony-hybrid/build/config/harmony-definition.json
  • .github/workflows/nodejs.yml
  • packages/taro-components/package.json
  • package.json
🧰 Additional context used
🧠 Learnings (1)
nx.json (1)
Learnt from: ianzone
PR: NervJS/taro#17842
File: nx.json:5-9
Timestamp: 2025-06-13T09:59:26.456Z
Learning: 在 Nx 的 nx.json 中,命名输入组之间的引用可以直接写字符串(如 "sharedGlobals"、"default"),不需要使用 "#" 等前缀。
🪛 LanguageTool
.github/instructions/nx.instructions.md

[misspelling] ~7-~7: Use “a” instead of ‘an’ if the following word doesn’t start with a vowel sound, e.g. ‘a sentence’, ‘a university’.
Context: ...lly generated by Nx Console You are in an nx workspace using Nx 21.1.3 and pnpm a...

(EN_A_VS_AN)


[misspelling] ~14-~14: Use “a” instead of ‘an’ if the following word doesn’t start with a vowel sound, e.g. ‘a sentence’, ‘a university’.
Context: ...iguration - If the user needs help with an Nx configuration or project graph error...

(EN_A_VS_AN)


[style] ~35-~35: Consider using a different verb for a more formal wording.
Context: ...' to see what's wrong and help the user fix their problem. Use the appropriate tool...

(FIX_RESOLVE)


[uncategorized] ~37-~37: Use a comma before “and” if it connects two independent clauses (unless they are closely connected and short).
Context: ...n the task. This task is already running and the user can see the output in the term...

(COMMA_COMPOUND_SENTENCE_2)

🪛 Biome (1.9.4)
nx.json

[error] 2-2: Expected a property but instead found '// https://nx.dev/reference/nx-json'.

Expected a property here.

(parse)


[error] 3-3: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 3-3: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 3-3: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 3-4: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 5-5: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 5-5: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 5-9: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 9-9: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 10-10: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 10-10: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 10-27: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 27-28: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)

⏰ Context from checks skipped due to timeout of 90000ms (6)
  • GitHub Check: Build Rust Binding / stable - x86_64-pc-windows-msvc
  • GitHub Check: Build Rust Binding / stable - x86_64-unknown-linux-gnu
  • GitHub Check: Build Rust Binding / stable - aarch64-apple-darwin
  • GitHub Check: Build Rust Binding / stable - x86_64-unknown-linux-musl
  • GitHub Check: Build Rust Binding / stable - x86_64-apple-darwin
  • GitHub Check: Build Rust WASM / stable - wasm32-wasi
🔇 Additional comments (4)
nx.json (3)

5-9: 命名输入组引用符合官方文档,无需 # 前缀
namedInputs 中直接引用 "sharedGlobals""default" 等组名遵循 Nx v21 官方约定,无需添加 # 前缀,请忽略相关的历史误导性建议。

🧰 Tools
🪛 Biome (1.9.4)

[error] 5-5: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 5-5: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 5-9: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 9-9: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


10-16: prod 目标默认配置合理
prodinputsdependsOncacheoutputs 设置符合最佳实践,可正确缓存和复用构建产物。

🧰 Tools
🪛 Biome (1.9.4)

[error] 10-10: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 10-10: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 10-27: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


17-21: 校验 test:ci 任务的依赖与输入配置
当前 test:ci 目标使用 ["default","^production"] 输入并依赖 ["prod","^prod"]。请确认这是否匹配预期:测试任务是否需先完成 prod 构建,或是否应该依赖 ^test:ci 以触发依赖项目的测试?

.github/instructions/nx.instructions.md (1)

1-4: 文件头部 Frontmatter 配置正确
当前的 frontmatter (applyTo: '**') 用于指定作用范围,符合 Nx Console AI agent 指令文件的规范,无需修改。

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: 0

🧹 Nitpick comments (1)
packages/taroize/package.json (1)

9-10: 发布文件清单需涵盖所有必需文件(包括类型声明)
当前 files 仅包含 dist 目录,需确认该目录下包含编译后的 JS、.d.ts 类型声明及其它运行时资源;若未输出声明文件,建议在 tsconfig.json 中启用 declaration 并在 package.json 中添加 typings 字段指向生成的声明文件。

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 187dbe6 and 07aed2a.

📒 Files selected for processing (6)
  • packages/rollup-plugin-copy/index.js (0 hunks)
  • packages/rollup-plugin-copy/package.json (1 hunks)
  • packages/rollup-plugin-copy/tsconfig.json (1 hunks)
  • packages/taroize/index.js (0 hunks)
  • packages/taroize/package.json (1 hunks)
  • packages/taroize/tsconfig.json (1 hunks)
💤 Files with no reviewable changes (2)
  • packages/taroize/index.js
  • packages/rollup-plugin-copy/index.js
✅ Files skipped from review due to trivial changes (3)
  • packages/rollup-plugin-copy/tsconfig.json
  • packages/taroize/tsconfig.json
  • packages/rollup-plugin-copy/package.json
⏰ Context from checks skipped due to timeout of 90000ms (7)
  • GitHub Check: Build Rust Binding / stable - x86_64-unknown-linux-gnu
  • GitHub Check: Build Rust Binding / stable - aarch64-apple-darwin
  • GitHub Check: Build Rust Binding / stable - x86_64-unknown-linux-musl
  • GitHub Check: Build Rust Binding / stable - x86_64-pc-windows-msvc
  • GitHub Check: Build Rust Binding / stable - x86_64-apple-darwin
  • GitHub Check: Build Rust WASM / stable - wasm32-wasi
  • GitHub Check: Testing on Rust
🔇 Additional comments (1)
packages/taroize/package.json (1)

7-7: 更新主入口路径,请验证构建产物
已将 main 从根目录的 index.js 调整为 ./dist/src/index.js,请确认执行 pnpm run build 后该文件确实生成,并且包发布时消费者侧的导入路径保持一致。

@coderabbitai coderabbitai bot requested a review from luckyadam June 16, 2025 07:58
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: 0

🧹 Nitpick comments (1)
packages/taro-platform-harmony-cpp/package.json (1)

33-33: 移除 --bundleConfigAsCjs 需验证打包输出格式

将命令改为 rollup --config rollup.config.ts --configPlugin @rollup/plugin-typescript 后,默认输出格式可能与之前有所不同,建议在 rollup.config.ts 中显式指定输出格式或插件配置,确保产物兼容预期环境。

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between d7a00f8 and 32f5d14.

📒 Files selected for processing (4)
  • packages/taro-platform-harmony-cpp/package.json (1 hunks)
  • packages/taro-platform-harmony-cpp/rollup.config.ts (2 hunks)
  • packages/taro-platform-harmony-cpp/src/index.ts (1 hunks)
  • packages/taro-platform-harmony-cpp/tsconfig.json (2 hunks)
✅ Files skipped from review due to trivial changes (2)
  • packages/taro-platform-harmony-cpp/src/index.ts
  • packages/taro-platform-harmony-cpp/rollup.config.ts
⏰ Context from checks skipped due to timeout of 90000ms (6)
  • GitHub Check: Build Rust Binding / stable - x86_64-unknown-linux-gnu
  • GitHub Check: Build Rust Binding / stable - x86_64-unknown-linux-musl
  • GitHub Check: Build Rust WASM / stable - wasm32-wasi
  • GitHub Check: Build Rust Binding / stable - x86_64-pc-windows-msvc
  • GitHub Check: Build Rust Binding / stable - aarch64-apple-darwin
  • GitHub Check: Build Rust Binding / stable - x86_64-apple-darwin
🔇 Additional comments (2)
packages/taro-platform-harmony-cpp/tsconfig.json (2)

10-10: 确认 TypeScript 支持 moduleResolution "bundler"

该选项仅在 TS 5.0+ 中可用,请验证项目中安装的 TypeScript 版本,并确保更改不会影响对 CJS/ESM 模块的正确解析。


21-21: 更新 include 数组,确保 rollup.config.ts 文件路径正确

已将 "rollup.config.mts" 改为 "rollup.config.ts",请确认该文件存在于相对路径下,并且 ts-node/构建脚本能正确加载此配置。

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: 0

🧹 Nitpick comments (1)
packages/taro-platform-harmony/src/program/harmony.ts (1)

15-18: 移除无意义的构造函数
该构造函数仅调用 super(ctx, config),并无其他逻辑,建议删除并移除对应的 eslint-disable no-useless-constructor 注释以减少冗余。

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 32f5d14 and bec178f.

📒 Files selected for processing (1)
  • packages/taro-platform-harmony/src/program/harmony.ts (2 hunks)
🧰 Additional context used
🪛 Biome (1.9.4)
packages/taro-platform-harmony/src/program/harmony.ts

[error] 16-18: This constructor is unnecessary.

Unsafe fix: Remove the unnecessary constructor.

(lint/complexity/noUselessConstructor)

⏰ Context from checks skipped due to timeout of 90000ms (6)
  • GitHub Check: Build Rust Binding / stable - x86_64-unknown-linux-musl
  • GitHub Check: Build Rust Binding / stable - x86_64-pc-windows-msvc
  • GitHub Check: Build Rust Binding / stable - x86_64-unknown-linux-gnu
  • GitHub Check: Build Rust Binding / stable - aarch64-apple-darwin
  • GitHub Check: Build Rust Binding / stable - x86_64-apple-darwin
  • GitHub Check: Build Rust WASM / stable - wasm32-wasi
🔇 Additional comments (1)
packages/taro-platform-harmony/src/program/harmony.ts (1)

2-2: 导入类型符合 TS type-only 规范
新增对 IPluginContextTConfigtype 导入符合当前项目的类型导入策略,无需调整。

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: 0

🧹 Nitpick comments (1)
packages/taro-platform-harmony-cpp/src/program/vite/inject-env.ts (1)

12-12: 增强健壮性但仍需确保类型安全

可选链避免了 thisdefineConstants 为空时的异常,但 .replace 仍假设 LOCATION_APIKEY 一定是字符串。若用户配置成数字或其他类型,仍会在运行时抛错。建议先做类型判断或显式转换后再调用 replace

-  const businessId = this?.config?.defineConstants?.LOCATION_APIKEY?.replace(/^['"]|['"]$/g, '')
+  const rawKey = this?.config?.defineConstants?.LOCATION_APIKEY
+  const businessId = typeof rawKey === 'string'
+    ? rawKey.replace(/^['"]|['"]$/g, '')
+    : undefined

这样既保证了空值安全,也避免了非字符串类型导致的意外异常。

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between bec178f and 928092e.

📒 Files selected for processing (1)
  • packages/taro-platform-harmony-cpp/src/program/vite/inject-env.ts (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (5)
  • GitHub Check: Build Rust Binding / stable - x86_64-pc-windows-msvc
  • GitHub Check: Build Rust Binding / stable - aarch64-apple-darwin
  • GitHub Check: Build Rust Binding / stable - x86_64-apple-darwin
  • GitHub Check: Build Rust Binding / stable - x86_64-unknown-linux-gnu
  • GitHub Check: Build Rust WASM / stable - wasm32-wasi

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

♻️ Duplicate comments (2)
packages/taro-cli/src/__tests__/inspect2.spec.ts (1)

51-58: inspect3 同样的问题:捕获所有异常导致误报
此处同样存在无差别吞掉异常的问题,建议限制捕获范围或改用 expect(...).rejects 方式,参考上一文件的修正方案。

packages/taro-cli/src/__tests__/inspect1.spec.ts (1)

51-57: 同样的异常吞掉问题
此段逻辑与另两份测试一致,建议统一修正以避免误报。

🧹 Nitpick comments (4)
packages/taro-cli/src/__tests__/inspect3.spec.ts (2)

36-38: beforeEach 中同时 resetModules 与顶层 jest.mock 的组合存在可读性隐患
jest.resetModules() 会清空模块缓存,而顶层 jest.mock 依赖于 hoist 行为重新生效。虽然逻辑上能够工作,但后续维护者需要理解 Jest 的执行顺序才能确信 mock 仍有效,增加了心智负担。可考虑去掉 resetModules(改用 jest.clearAllMocks())或将 mock 移至 beforeEach 里,降低耦合。


57-58: 建议断言调用次数以避免漏测
目前只断言了参数值,未校验调用次数;若 process.exit 被多次调用测试也会通过。补充调用次数可提升健壮性。

 expect(exitSpy).toHaveBeenCalledWith(0)
+expect(exitSpy).toHaveBeenCalledTimes(1)
packages/taro-cli/src/__tests__/inspect2.spec.ts (1)

60-63: 缺少对 console.error 的断言
已对 console.error 设置 spy,但未断言其调用情况,导致测试无法保证无错误输出。

 expect(logSpy).toHaveBeenCalledTimes(1)
 expect(logSpy).toHaveBeenCalledWith('\'main:h5\'')
+expect(errorSpy).not.toHaveBeenCalled()
packages/taro-cli/src/__tests__/inspect1.spec.ts (1)

18-29: 提前 import { chalk } 可能拿到未 mock 实例
jest.mock('@tarojs/helper') 被 hoist 后能覆盖大部分导出,但 chalk 已在文件头引用实际包;若将来需要覆写 chalk 行为(如禁用颜色)会失效。可改为在 mock 返回值中显式提供 chalk,并移除顶层 import:

-import { chalk } from '@tarojs/helper'
+// const { chalk } = require('@tarojs/helper') // 在需要处按需获取

这样 mock 与实际使用保持一致。

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 61bfc49 and 9338ae8.

📒 Files selected for processing (3)
  • packages/taro-cli/src/__tests__/inspect1.spec.ts (1 hunks)
  • packages/taro-cli/src/__tests__/inspect2.spec.ts (1 hunks)
  • packages/taro-cli/src/__tests__/inspect3.spec.ts (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (5)
  • GitHub Check: Build Rust Binding / stable - x86_64-unknown-linux-gnu
  • GitHub Check: Build Rust Binding / stable - aarch64-apple-darwin
  • GitHub Check: Build Rust Binding / stable - x86_64-apple-darwin
  • GitHub Check: Build Rust Binding / stable - x86_64-pc-windows-msvc
  • GitHub Check: Build Rust WASM / stable - wasm32-wasi
🔇 Additional comments (1)
packages/taro-cli/src/__tests__/inspect1.spec.ts (1)

75-77: 断言结果依赖终端颜色环境
chalk.red() 会根据 FORCE_COLOR 等环境变量输出带或不带 ANSI 码,CI 环境差异可能导致断言失败。可对 chalk 进行 stub,如返回纯字符串,或使用 strip-ansi 处理。

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 (1)
packages/taro-webpack5-runner/src/webpack/MiniCombination.ts (1)

95-99: 去掉 ESLint 抑制并显式标记未使用变量

当前通过 // eslint-disable-line @typescript-eslint/no-unused-vars 抑制未使用的 clean
可改为重命名占位符以消除规则抑制,代码更简洁:

- const { clean, ...filteredOutput } = output || {} // eslint-disable-line @typescript-eslint/no-unused-vars
+ const { clean: _unusedClean, ...filteredOutput } = output || {}

同时可以去掉整行 ESLint 注释。

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 9338ae8 and d2ad9f4.

📒 Files selected for processing (5)
  • packages/taro-cli/src/__tests__/inspect1.spec.ts (1 hunks)
  • packages/taro-cli/src/__tests__/inspect2.spec.ts (1 hunks)
  • packages/taro-cli/src/__tests__/inspect3.spec.ts (1 hunks)
  • packages/taro-webpack5-runner/src/webpack/MiniBaseConfig.ts (1 hunks)
  • packages/taro-webpack5-runner/src/webpack/MiniCombination.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • packages/taro-cli/src/tests/inspect3.spec.ts
  • packages/taro-cli/src/tests/inspect2.spec.ts
  • packages/taro-cli/src/tests/inspect1.spec.ts
⏰ Context from checks skipped due to timeout of 90000ms (6)
  • GitHub Check: Build Rust Binding / stable - x86_64-unknown-linux-gnu
  • GitHub Check: Build Rust Binding / stable - x86_64-unknown-linux-musl
  • GitHub Check: Build Rust Binding / stable - aarch64-apple-darwin
  • GitHub Check: Build Rust Binding / stable - x86_64-pc-windows-msvc
  • GitHub Check: Build Rust WASM / stable - wasm32-wasi
  • GitHub Check: Build Rust Binding / stable - x86_64-apple-darwin
🔇 Additional comments (1)
packages/taro-webpack5-runner/src/webpack/MiniCombination.ts (1)

107-108: 扩展运算符位置合理,允许用户覆盖默认 path

...filteredOutput 放在最后,可让外部配置覆盖默认输出路径等字段,符合预期,无需调整。

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: 0

🧹 Nitpick comments (3)
.github/instructions/nx.instructions.md (3)

7-7: 修正语法以提高可读性

建议修正一些小的语法问题以提高文档质量:

-You are in an nx workspace using Nx 21.2.1 and pnpm as the package manager.
+You are in a nx workspace using Nx 21.2.1 and pnpm as the package manager.

14-14: 修正语法一致性

-If the user needs help with an Nx configuration or project graph error, use the 'nx_workspace' tool to get any errors
+If the user needs help with a Nx configuration or project graph error, use the 'nx_workspace' tool to get any errors

35-35: 使用更正式的表达

考虑使用更正式的动词表达:

-Use the terminal output from 'nx_current_running_task_output' to see what's wrong and help the user fix their problem.
+Use the terminal output from 'nx_current_running_task_output' to see what's wrong and help the user resolve their problem.
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between d2ad9f4 and 88ccc46.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (6)
  • .github/instructions/nx.instructions.md (1 hunks)
  • .pnpmfile.cjs (1 hunks)
  • nx.json (1 hunks)
  • package.json (3 hunks)
  • packages/taro-framework-vue3/package.json (1 hunks)
  • packages/taro-platform-h5/src/program.ts (1 hunks)
✅ Files skipped from review due to trivial changes (2)
  • packages/taro-framework-vue3/package.json
  • .pnpmfile.cjs
🚧 Files skipped from review as they are similar to previous changes (1)
  • package.json
🧰 Additional context used
🧠 Learnings (1)
nx.json (1)
Learnt from: ianzone
PR: NervJS/taro#17842
File: nx.json:5-9
Timestamp: 2025-06-13T09:59:26.456Z
Learning: 在 Nx 的 nx.json 中,命名输入组之间的引用可以直接写字符串(如 "sharedGlobals"、"default"),不需要使用 "#" 等前缀。
🪛 LanguageTool
.github/instructions/nx.instructions.md

[misspelling] ~7-~7: Use “a” instead of ‘an’ if the following word doesn’t start with a vowel sound, e.g. ‘a sentence’, ‘a university’.
Context: ...lly generated by Nx Console You are in an nx workspace using Nx 21.2.1 and pnpm a...

(EN_A_VS_AN)


[misspelling] ~14-~14: Use “a” instead of ‘an’ if the following word doesn’t start with a vowel sound, e.g. ‘a sentence’, ‘a university’.
Context: ...iguration - If the user needs help with an Nx configuration or project graph error...

(EN_A_VS_AN)


[style] ~35-~35: Consider using a different verb for a more formal wording.
Context: ...' to see what's wrong and help the user fix their problem. Use the appropriate tool...

(FIX_RESOLVE)


[uncategorized] ~37-~37: Use a comma before “and” if it connects two independent clauses (unless they are closely connected and short).
Context: ...n the task. This task is already running and the user can see the output in the term...

(COMMA_COMPOUND_SENTENCE_2)

🪛 Biome (1.9.4)
nx.json

[error] 2-2: Expected a property but instead found '// https://nx.dev/reference/nx-json'.

Expected a property here.

(parse)


[error] 3-3: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 3-3: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 3-3: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 3-4: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 5-5: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 5-5: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 5-9: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 9-9: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 10-10: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 10-10: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 10-28: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 28-29: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)

⏰ Context from checks skipped due to timeout of 90000ms (5)
  • GitHub Check: Build Rust Binding / stable - aarch64-apple-darwin
  • GitHub Check: Build Rust Binding / stable - x86_64-apple-darwin
  • GitHub Check: Build Rust Binding / stable - x86_64-pc-windows-msvc
  • GitHub Check: Build Rust Binding / stable - x86_64-unknown-linux-gnu
  • GitHub Check: Build Rust WASM / stable - wasm32-wasi
🔇 Additional comments (3)
packages/taro-platform-h5/src/program.ts (1)

59-61: 显式路径解析改进很好

这些更改通过显式添加 /index.js 后缀来改进模块解析,避免依赖隐式目录解析。这样可以确保更可靠的模块解析行为,是一个很好的改进。

nx.json (1)

1-29: Nx 工作区配置正确

这个 Nx 配置文件设置合理:

  • 命名输入组定义了 sharedGlobalsdefaultproduction 的正确范围
  • 目标默认配置为 prodtest:ciupdateSnapshot 提供了适当的输入、依赖、缓存和输出设置
  • 引用命名输入组的语法正确(直接使用字符串名称,无需前缀)

注意:Biome 的解析错误是误报,因为它将此文件视为纯 JSON,但 Nx 支持 JSONC 格式(允许注释)。

.github/instructions/nx.instructions.md (1)

1-41: 全面的 Nx 工作区指导文档

这个指导文档为 Nx 工作区的使用提供了全面的指导方针,包括:

  • 通用准则和工具使用建议
  • 代码生成的详细流程
  • 任务运行的指导原则

文档结构清晰,内容详细,很好地支持了这次 PR 中 Nx 工具链的集成。

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: 0

🧹 Nitpick comments (2)
.github/workflows/nodejs.yml (2)

92-100: 优化 NX 缓存路径粒度以减少体积
当前缓存整个 .nx 目录会包含临时文件和无关数据,建议只缓存核心子目录:

- path: .nx
+ path:
+   .nx/cache
+   .nx/workspace-data

124-129: 考虑后续使用 nx affected 以提速
目前使用 nx run-many 会每次全量构建和测试,待解决 moduleNameMapper 循环依赖和 fetch-depth 问题后,可切换到仅针对变更项目的 nx affected,进一步优化 CI 性能。

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 88ccc46 and abe5899.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (2)
  • .github/workflows/nodejs.yml (4 hunks)
  • packages/taro-cli/package.json (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • packages/taro-cli/package.json
⏰ Context from checks skipped due to timeout of 90000ms (6)
  • GitHub Check: Build Rust Binding / stable - aarch64-apple-darwin
  • GitHub Check: Build Rust Binding / stable - x86_64-unknown-linux-gnu
  • GitHub Check: Build Rust Binding / stable - x86_64-pc-windows-msvc
  • GitHub Check: Build Rust Binding / stable - x86_64-apple-darwin
  • GitHub Check: Build Rust WASM / stable - wasm32-wasi
  • GitHub Check: Build Rust Binding / stable - x86_64-unknown-linux-musl
🔇 Additional comments (5)
.github/workflows/nodejs.yml (5)

23-25: 新增并发控制,避免重复运行
使用 concurrency 按 workflow 名称和 ref 进行分组,能在同一分支推送新提交时自动取消旧的流水线,符合预期。


65-66: 确认超时时间是否足够
将整个测试 Job 限制在 20 分钟内可提高反馈速度,但需校验在最慢的 macos-13 和 windows-latest 环境下不会因超时而中断。


69-71: 验证 pnpm/action-setup@v4 兼容性
确保 CI Runner 上已支持 v4 版本 action,且与之前 v3 行为一致,避免因版本差异导致安装或缓存异常。


121-122: 验证 pnpm artifacts 跨平台执行
默认 Windows CI 使用 PowerShell,需确认该脚本在所有矩阵环境下都可正常运行,或在必要时添加 shell: bash


130-136: NX 缓存保存步骤完善
使用 if: ${{ always() }} 确保无论前面流程成败都能保存缓存,逻辑合理,无需调整。

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

♻️ Duplicate comments (1)
.github/workflows/merged.yml (1)

27-33: 提升命中率:为 restore 增加前缀回退,并保留“精确复原 PR 头部提交”的特性

当前仅按 PR head 的分支与 SHA 精确恢复,若相应缓存不存在将直接 miss。为提高成功率且兼顾“公共缓存预热”,建议增加 restore-keys,并保留你现有的精确 key:

       - name: 获取最新 NX 缓存
         id: latest-nx-cache
         uses: actions/cache/restore@v4
         with:
           path: .nx
-          key: ${{ github.event.pull_request.head.ref }}-NX-${{ runner.os }}-${{ matrix.node-version }}-${{ github.event.pull_request.head.sha }}
+          key: ${{ github.event.pull_request.head.ref }}-NX-${{ runner.os }}-${{ matrix.node-version }}-${{ github.event.pull_request.head.sha }}
+          restore-keys: |
+            ${{ github.event.pull_request.head.ref }}-NX-${{ runner.os }}-${{ matrix.node-version }}-
+            NX-${{ runner.os }}-${{ matrix.node-version }}-

这样在精确键未命中时,仍可回退到同分支最近公共缓存,或任意分支的最新公共缓存。

🧹 Nitpick comments (2)
.github/workflows/merged.yml (2)

12-23: 矩阵可简化:已排除全部 macOS/Windows,等价于仅跑 Ubuntu

当前 exclude 将所有 macOS 与 Windows 组合都排除了,实际只在 ubuntu-latest 上运行。可简化为直配 Ubuntu,降低认知成本:

     strategy:
       matrix:
-        node-version: [18, 20]
-        host: [macos-13, windows-latest, ubuntu-latest]
-        exclude:
-          - node-version: 18
-            host: macos-13
-          - node-version: 18
-            host: windows-latest
-          - node-version: 20
-            host: macos-13
-          - node-version: 20
-            host: windows-latest
+        node-version: [18, 20]
+        host: [ubuntu-latest]

若你是为后续逐步放开平台做准备,也可保留现状,但建议加注释说明原因。


41-41: 文件末尾缺少换行符

YAMLlint 报告了 “no new line character at the end of file”。请在文件末尾补一个换行,避免 lint 噪音。

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 90cb774 and 03d26f0.

📒 Files selected for processing (1)
  • .github/workflows/merged.yml (1 hunks)
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: ianzone
PR: NervJS/taro#18146
File: packages/babel-plugin-transform-react-jsx-to-rn-stylesheet/package.json:12-14
Timestamp: 2025-08-08T02:32:58.207Z
Learning: 在 Taro 项目的 pnpm 工作区中,Vitest 相关依赖(vitest 和 vitest/coverage-istanbul)被管理在根目录的 package.json 中,而不是各个子包的 devDependencies 中。这是 monorepo 中依赖提升的标准做法。
📚 Learning: 2025-06-21T19:40:42.482Z
Learnt from: ianzone
PR: NervJS/taro#17842
File: .github/workflows/merged.yml:26-37
Timestamp: 2025-06-21T19:40:42.482Z
Learning: 跨 PR 缓存策略:merge 后的 workflow 可以使用具体缓存键恢复,然后用通用键保存,为后续 PR 构建提供预热缓存。

Applied to files:

  • .github/workflows/merged.yml
📚 Learning: 2025-07-01T15:46:08.457Z
Learnt from: ianzone
PR: NervJS/taro#17937
File: .github/workflows/issue-labeler.yml:31-31
Timestamp: 2025-07-01T15:46:08.457Z
Learning: stefanbuck/github-issue-parserv3 GitHub Action 的输出字段名称是 `jsonString`,不是 `json`。在工作流中应该使用 `${{ steps.issue-parser.outputs.jsonString }}` 来引用解析后的 JSON 数据。

Applied to files:

  • .github/workflows/merged.yml
📚 Learning: 2025-06-22T19:04:52.870Z
Learnt from: ianzone
PR: NervJS/taro#17842
File: scripts/fix-nx-cache.mjs:95-109
Timestamp: 2025-06-22T19:04:52.870Z
Learning: 在 Nx workspace cache 的 .nx/workspace-data 目录中,确定只有一个 .db 文件存在,不需要处理多个数据库文件的情况。

Applied to files:

  • .github/workflows/merged.yml
🪛 YAMLlint (1.37.1)
.github/workflows/merged.yml

[error] 41-41: no new line character at the end of file

(new-line-at-end-of-file)

@yoyo837
Copy link
Contributor

yoyo837 commented Aug 11, 2025

还是先确定一下,NX 这个东西是必须的吗?

@ianzone
Copy link
Contributor Author

ianzone commented Aug 11, 2025

还是先确定一下,NX 这个东西是必须的吗?

对于一个大型单仓,我认为NX是必须的

  1. NX可以大幅缩短构建和测试时间,缓存命中时可从20多分钟缩短至3分钟以内
  2. NX提供了清晰的依赖视图,有助于项目重构
  3. NX提供了MCP服务,有助于AI辅助
  4. NX提供了更清晰且容易交互的日志,参阅之前的截图

This was referenced Aug 16, 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.

3 participants