Skip to content

Conversation

yoturg
Copy link
Contributor

@yoturg yoturg commented Aug 28, 2025

这个 PR 做了什么? (简要描述所做更改)

  • 修改 bundle 模式下的产物路径
  • 修改 resource 文件名生成规则,去掉鸿蒙不支持的字符
  • 支持异步收集依赖

这个 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 小程序
  • 飞书小程序
  • 快手小程序
  • 头条小程序

Copy link

coderabbitai bot commented Aug 28, 2025

Walkthrough

该 PR 主要进行版本号更新至 4.1.5-alpha.2,并在 Harmony Vite 构建链路中调整页面/入口产物路径为目录下 index 文件、资源名规范化规则扩大、模板导入路径随之变更、组件导入去重,以及将 Harmony 平台 arkTS 的 resolveId 返回字段由 resolve 改为 relative。同时将 page 插件的 load 钩子改为异步并并行处理页面依赖生成。

Changes

Cohort / File(s) Summary
Harmony Vite Runner 流程与产物路径调整
packages/taro-vite-runner/src/harmony/asset.ts, .../config.ts, .../entry.ts, .../page.ts, .../template/app.ts, .../template/page.ts, .../template/render.ts
- 非字母数字字符统一折叠为下划线的资源名规范化
- 入口与页面产物从 name+后缀改为 name/index+后缀
- 模板中 createComponent/config/页面导入路径改到目录下 index 文件
- 组件导入列表去重
- page 插件 load 改为 async,并行化收集与生成依赖
Harmony 平台 arkTS 解析行为
packages/taro-platform-harmony/src/program/arkTS.ts
taro 注入库的 resolveId 返回对象的 external 字段由 'resolve' 改为 'relative'
版本元数据更新(根与工作区)
package.json, crates/native_binding/package.json, packages/*/package.json
所有涉及包的 version 字段从 4.1.5 更新为 4.1.5-alpha.2,未改动其他字段
版本元数据更新(预构建二进制 npm 包)
npm/*/package.json
各平台预编译二进制包 version 字段更新为 4.1.5-alpha.2,未改动其他字段

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Dev as 开发者
  participant Vite as Vite(插件-Page/Harmony)
  participant FS as 文件系统
  participant Gen as 模板生成(render/app/page)
  participant Out as 输出产物

  Dev->>Vite: 启动构建
  Vite->>Vite: async load(id)
  par 并行收集页面/TabBar
    Vite->>Vite: collectedDeps(page) (await)
    Vite->>Gen: 生成 usingComponents / 原生组件清单
    Gen-->>Vite: 模板代码(去重组件导入)
  end
  Vite->>Out: emitChunk fileName: page.name + "/index" + 后缀
  Vite->>FS: 资源名规范化(非字母数字→“_”)
  FS-->>Vite: 写入文件/缓存
  Vite-->>Dev: 构建完成
Loading
sequenceDiagram
  autonumber
  participant Bundler as 打包器
  participant Harmony as taro-platform-harmony(arkTS)
  participant NPM as npm 依赖

  Bundler->>Harmony: resolveId(source)
  alt source 属于注入库
    Harmony-->>Bundler: { id: <outputRoot/npm/source>, external: "relative", moduleSideEffects: false }
  else 其他
    Harmony-->>Bundler: 常规解析
  end
  Bundler->>NPM: 依赖处理
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • ZakaryCode
  • luckyadam

Poem

小兔挥笔点版本,alpha 星光落枝端。
入口改作 index 路,异步并行快如穿。
资源名里皆从简,组件去重更清寒。
打包一步河汉转,敲锣启程到上盘。 🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/harmony-watch

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.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbit in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbit 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:
    • @coderabbit gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbit 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/Issue comments)

Type @coderabbit help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbit ignore or @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbit summary or @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbit or @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

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • 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.

@Single-Dancer Single-Dancer added this to the 4.1.6 milestone Aug 28, 2025
@Single-Dancer Single-Dancer changed the title Feat/harmony watch feat(harmony): 修改 bundle 模式下的产物路径,修改 resource 文件名生成规则,去掉鸿蒙不支持的字符,支持异步收集依赖 Aug 28, 2025
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: 11

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
packages/taro-platform-harmony/src/program/arkTS.ts (1)

385-390: 无需回退 external: 'relative',Rollup 插件 API 已支持;强制 POSIX 归一化 id
Rollup 的 resolveId 返回值支持 external: 'relative'(类型定义为 boolean | 'absolute' | 'relative')(rollupjs.org)。将

id: path.join(outputRoot, 'npm', source)

改为

id: path.posix.join(outputRoot, 'npm', source)

id: path.join(outputRoot, 'npm', source).split(path.sep).join('/')

避免 Windows 下反斜杠写入非法 import specifier。

packages/taro-vite-runner/src/harmony/config.ts (1)

203-213: stripMultiPlatformExt 调用顺序可能导致平台后缀未被剥离

当前在拼接 '/index' + suffix 之后再调用 stripMultiPlatformExt,如果 chunkInfo.name 本身包含平台后缀(如 .harmony/.arkui),因不在字符串“末尾”,将无法被替换。建议先对 name 去后缀,再拼接 '/index'suffix

应用如下最小修改:

-          name = stripMultiPlatformExt(`${name}/index${suffix}`) + taroConfig.fileType.script
+          name = `${stripMultiPlatformExt(name)}/index${suffix}` + taroConfig.fileType.script
🧹 Nitpick comments (5)
packages/taro-loader/package.json (2)

40-41: peerDependencies 版本过于刚性,建议放宽到兼容范围

固定为 5.91.0 容易与用户项目的 webpack 次版本不一致产生 peer 冲突。建议使用兼容范围。

-  "peerDependencies": {
-    "webpack": "5.91.0"
-  }
+  "peerDependencies": {
+    "webpack": "^5.91.0"
+  }

如需继续锁定内部开发环境,可仅在 devDependencies 保持精确版本。


1-42: (可选)为预发布包添加 publishConfig.tag=next

避免误发为 latest。

 {
   "name": "@tarojs/taro-loader",
   "version": "4.1.5-alpha.2",
@@
-  "peerDependencies": {
-    "webpack": "5.91.0"
-  }
+  "peerDependencies": {
+    "webpack": "^5.91.0"
+  },
+  "publishConfig": {
+    "tag": "next"
+  }
 }
packages/taro-platform-harmony/src/program/arkTS.ts (1)

357-359: Object.keys 的默认值建议用 {} 而非 [],提升语义与鲁棒性

当前对 ohPackage 的依赖解构使用了 Object.keys(ohPackage.dependencies || []),虽然对空数组不会报错,但这里更契合对象默认值,避免未来被不小心传入非对象类型时产生难以定位的问题。

-    const externals = Object.keys(ohPackage.dependencies || []).concat(Object.keys(ohPackage.devDependencies || []))
+    const externals = Object.keys(ohPackage.dependencies || {}).concat(Object.keys(ohPackage.devDependencies || {}))
packages/taro-vite-runner/src/harmony/entry.ts (1)

64-69: 与“/index”规范对齐,但建议确认路径规范性

将非原生页产物改为 name/index_taro_comp 与其它模板一致,方向正确。为避免潜在的跨平台分隔符差异,建议确认 getScriptPath 对包含子路径的 page.name + '/index' + TARO_COMP_SUFFIX 会统一为 POSIX 风格(或在入参前使用 posix join/normalize)。

packages/taro-vite-runner/src/harmony/template/page.ts (1)

1036-1040: TabBar 页路径改为 './/index_taro_comp' 合理

与新的产物目录结构匹配。为稳妥起见,可对 e.pagePath 做一次尾部斜杠清理以避免 //index

可选修改(仅为健壮性):

-        ...this.tabbarList.map((e, i) => `import page${i}, { config as config${i} } from './${e.pagePath}/index${TARO_COMP_SUFFIX}'`),
+        ...this.tabbarList.map((e, i) => {
+          const p = e.pagePath.replace(/\/+$/,'')
+          return `import page${i}, { config as config${i} } from './${p}/index${TARO_COMP_SUFFIX}'`
+        }),
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 9ec6b7f and 9049c82.

📒 Files selected for processing (87)
  • crates/native_binding/package.json (1 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)
  • package.json (1 hunks)
  • packages/babel-plugin-transform-react-jsx-to-rn-stylesheet/package.json (1 hunks)
  • packages/babel-plugin-transform-solid-jsx/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/eslint-plugin-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/postcss-unit-transform/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-components-advanced/package.json (1 hunks)
  • packages/taro-components-library-react/package.json (1 hunks)
  • packages/taro-components-library-solid/package.json (1 hunks)
  • packages/taro-components-library-vue3/package.json (1 hunks)
  • packages/taro-components-react/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-solid/package.json (1 hunks)
  • packages/taro-framework-vue3/package.json (1 hunks)
  • packages/taro-h5/package.json (1 hunks)
  • packages/taro-helper/package.json (1 hunks)
  • packages/taro-loader/package.json (1 hunks)
  • packages/taro-platform-alipay/package.json (1 hunks)
  • packages/taro-platform-ascf/package.json (1 hunks)
  • packages/taro-platform-h5/package.json (1 hunks)
  • packages/taro-platform-harmony-cpp/package.json (1 hunks)
  • packages/taro-platform-harmony-hybrid/package.json (1 hunks)
  • packages/taro-platform-harmony/package.json (1 hunks)
  • packages/taro-platform-harmony/src/program/arkTS.ts (1 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-generator/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-router-rn/package.json (1 hunks)
  • packages/taro-router/package.json (1 hunks)
  • packages/taro-runner-utils/package.json (1 hunks)
  • packages/taro-runtime-rn/package.json (1 hunks)
  • packages/taro-runtime/package.json (1 hunks)
  • packages/taro-service/package.json (1 hunks)
  • packages/taro-transformer-wx/package.json (1 hunks)
  • packages/taro-vite-runner/package.json (1 hunks)
  • packages/taro-vite-runner/src/harmony/asset.ts (1 hunks)
  • packages/taro-vite-runner/src/harmony/config.ts (1 hunks)
  • packages/taro-vite-runner/src/harmony/entry.ts (1 hunks)
  • packages/taro-vite-runner/src/harmony/page.ts (5 hunks)
  • packages/taro-vite-runner/src/harmony/template/app.ts (1 hunks)
  • packages/taro-vite-runner/src/harmony/template/page.ts (1 hunks)
  • packages/taro-vite-runner/src/harmony/template/render.ts (1 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
🧠 Learnings (2)
📚 Learning: 2025-08-25T22:16:50.118Z
Learnt from: ianzone
PR: NervJS/taro#18150
File: packages/babel-plugin-transform-taroapi/tests/__mocks__/h5-definition.json:2356-2356
Timestamp: 2025-08-25T22:16:50.118Z
Learning: The file `packages/babel-plugin-transform-taroapi/tests/__mocks__/h5-definition.json` is auto-generated by the post-build script `packages/taro-platform-h5/scripts/post-build.mjs`, which copies content from `taro-platform-h5/dist/definition.json`. This file should not be manually edited.

Applied to files:

  • packages/taro-platform-harmony/package.json
  • packages/taro-api/package.json
  • packages/taro-rn/package.json
  • packages/taro-plugin-html/package.json
  • packages/babel-plugin-transform-taroapi/package.json
  • packages/taro-h5/package.json
  • packages/taro-platform-harmony-hybrid/package.json
  • packages/taro-platform-tt/package.json
  • packages/babel-preset-taro/package.json
  • packages/taro-platform-h5/package.json
  • packages/jest-helper/package.json
  • packages/taro-extend/package.json
  • packages/taro-platform-harmony-cpp/package.json
📚 Learning: 2025-05-25T18:02:31.387Z
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 文件。

Applied to files:

  • packages/taro-vite-runner/src/harmony/template/app.ts
  • packages/taro-components/package.json
🧬 Code graph analysis (4)
packages/taro-vite-runner/src/harmony/config.ts (1)
packages/taro-vite-runner/src/utils/index.ts (1)
  • stripMultiPlatformExt (100-102)
packages/taro-vite-runner/src/harmony/template/app.ts (1)
packages/taro-vite-runner/src/harmony/entry.ts (1)
  • TARO_COMP_SUFFIX (14-14)
packages/taro-vite-runner/src/harmony/template/page.ts (1)
packages/taro-vite-runner/src/harmony/entry.ts (1)
  • TARO_COMP_SUFFIX (14-14)
packages/taro-vite-runner/src/harmony/page.ts (3)
packages/taro-helper/src/utils.ts (1)
  • removeHeadSlash (529-531)
packages/taro-vite-runner/src/harmony/template/page.ts (1)
  • TaroHarmonyPageMeta (25-43)
packages/taro-vite-runner/src/utils/index.ts (1)
  • escapePath (215-217)
⏰ 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). (7)
  • 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 Binding / stable - x86_64-pc-windows-msvc
  • 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 Binding / stable - x86_64-pc-windows-msvc
  • GitHub Check: Build Rust Binding / stable - aarch64-apple-darwin
🔇 Additional comments (85)
packages/taro-components-library-react/package.json (1)

3-3: 版本号预发布位更新合理,保持与仓库一致性即可

此包为 private,不涉及发布;版本同步至 4.1.5-alpha.2 没问题。

packages/taro-transformer-wx/package.json (1)

3-3: 确认预发布版本发版策略
所有 *-alpha.* 的公开包需使用 dist-tag=next 发布以避免覆盖 latest,请检查 CI/CD 或手动发布流程中是否已添加 npm publish --tag next(或等效配置)。

packages/taro-loader/package.json (1)

3-3: 版本号同步 OK

与仓库其余包一致,变更无功能风险。

packages/taro-extend/package.json (1)

3-3: 版本号同步 OK

与整体预发布版本一致,无其他变更。

package.json (1)

36-41: 版本脚本兼容预发布流程的确认

当前使用 npm version ${npm_package_version}。若将来需要从 alpha 自动递增,可考虑使用 npm version prerelease --preid=alpha 流程;若沿用手动设定版本则可不改。

packages/taro-components-react/package.json (1)

3-3: 预发布版本号提升至 4.1.5-alpha.2:LGTM

变更仅限版本号,未触及依赖与导出,安全可合并。

packages/taro-components-library-vue3/package.json (1)

3-3: 版本号更新至 4.1.5-alpha.2:通过

仅元数据更新,无功能面变更。

packages/taro-plugin-inject/package.json (1)

3-3: 版本号更新至 4.1.5-alpha.2:通过

与本次预发布一致,未改动入口与依赖。

packages/taro-with-weapp/package.json (1)

3-3: 版本号更新至 4.1.5-alpha.2:通过

变更范围可控,符合预发布流程。

packages/taro-rn-style-transformer/package.json (1)

3-3: 版本号更新至 4.1.5-alpha.2:通过

仅版本提升,无 API/依赖影响。

packages/taro-rn-supporter/package.json (1)

3-3: 版本号预发对齐,变更仅限元数据,LGTM。

packages/taro-service/package.json (1)

3-3: 版本号更新至 4.1.5-alpha.2,注意同步发布顺序。
服务层包通常被多处依赖,发布时请确保它与 CLI/runner 等相关包同批次上线,避免因 prerelease 号不一致导致安装解析到混合版本。

packages/eslint-plugin-taro/package.json (1)

3-3: 版本号预发对齐,LGTM。

packages/taro-runtime-rn/package.json (1)

3-3: 版本号预发对齐,LGTM。

packages/taro-components-advanced/package.json (1)

3-3: 确认:所有发布包版本均已统一升级至 4.1.5-alpha.2。示例工程与测试用例 (examplefixtures) 保持原始版本号属预期,无需变更。

packages/taro-runner-utils/package.json (1)

3-3: 版本号 bump 到 4.1.5-alpha.2 —— 通过

无其他字段改动。与同仓其余包保持一致即可。

packages/stylelint-taro-rn/package.json (1)

3-3: 版本元数据更新——通过

仅版本提升到 4.1.5-alpha.2;不影响对等依赖与引擎约束。

npm/linux-x64-musl/package.json (1)

3-3: 平台二进制封装版本同步——通过

将版本提升到 4.1.5-alpha.2,与其它二进制子包保持一致。

packages/taro-router/package.json (1)

3-3: 路由包版本提升到 4.1.5-alpha.2 —— 通过

无 API/依赖调整;发布时注意与主包及运行时包的协同版本。

packages/shared/package.json (2)

3-3: 版本号提升至 4.1.5-alpha.2:就绪

仅元数据更新,无行为变更风险。通过。


3-3: 脚本在当前环境执行失败,请手动校验:

  1. 确认仓库下所有 package.json 中 "version" 均为 4.1.5-alpha.2
  2. 确认各包对 @tarojs/* 的内部依赖(dependencies、peerDependencies、devDependencies)均使用 workspace:*
packages/taroize/package.json (1)

3-3: 预发布版本号同步:通过

仅版本号调整为 4.1.5-alpha.2,符合本次批量版本提升策略。

packages/taro-runtime/package.json (1)

3-3: runtime 版本对齐:通过

无其他字段变更;与 workspace:* 依赖策略兼容,风险低。

packages/babel-plugin-transform-react-jsx-to-rn-stylesheet/package.json (1)

3-3: babel 插件版本号提升:通过

纯元数据更新;无需额外动作。

packages/taro-platform-ascf/package.json (1)

3-3: 平台插件版本同步:通过

与 dev/peerDependencies 的 workspace:* 策略一致,无 API 风险。

npm/darwin-arm64/package.json (1)

4-4: Native binding 包版本同步正确;确认构建产物与发布流程

版本号与预发布一致,且已包含 publishConfig.access: public。请确认对应 .node 产物在 CI 中成功构建并与其他架构包一并发布。

packages/taro-plugin-vue-devtools/package.json (1)

3-3: 版本号提升正确

仅元数据更新,工作区依赖保持不变,LGTM。发布时注意使用预发布 dist-tag。

packages/taro-platform-tt/package.json (1)

3-3: 版本号预发布同步无误

与其他平台插件保持一致,LGTM。请确保变更日志或发布说明中包含该预发布版本条目(如适用)。

packages/postcss-pxtransform/package.json (1)

3-3: 版本号提升 LGTM

仅版本元数据更新;peerDependencies.postcss: ^8 保持不变,兼容性预期不受影响。

packages/taro-vite-runner/package.json (2)

3-3: 版本号提升到 4.1.5-alpha.2:元数据变更本身无问题。

与 PR 目标(预发布对齐)一致。


3-3: 版本一致性与 Vite 兼容性已确认:所有 @tarojs/* 包版本均为 4.1.5-alpha.2,package.json 中 Vite 依赖统一为 ^4,无 ^5 混用。

packages/eslint-config-taro/package.json (1)

3-3: 版本号更新到 4.1.5-alpha.2 OK。

仅元数据更新,无行为改动。

packages/taro-plugin-generator/package.json (1)

3-3: 版本号提升至 4.1.5-alpha.2 无异议。

与其它包的预发布版本保持一致即可。

packages/taro-plugin-mini-ci/package.json (2)

3-3: 版本号更新到 4.1.5-alpha.2 正常。

此包仅元数据变更;engines 已要求 Node >=18,与仓库主线一致性请保持关注。


3-3: 执行最小集成验证
已确认 peerDependencies 列表:dingtalk-miniapp-opensdk@^1.0.8、jd-miniprogram-ci@^1.0.5、minidev@^2.1.5、miniprogram-ci@^1.9.15、tt-ide-cli@^0.1.25,请在发布 4.1.5-alpha.2 前对以上可选依赖分别进行端到端集成测试,确保解析与装配正常。

packages/taro-platform-h5/package.json (2)

3-3: H5 平台插件版本号 bump 到 4.1.5-alpha.2 合理。

仅元数据调整,与预发布对齐。


3-3: 确认 post-build 同步无误:脚本 packages/taro-platform-h5/scripts/post-build.mjs 及测试 mocks 文件 packages/babel-plugin-transform-taroapi/tests/mocks/h5-definition.json 已存在且路径正确,版本更新不会影响同步逻辑,无需改动。

packages/taro-router-rn/package.json (1)

3-3: 确认需要统一的版本范围:仅发布包 vs 示例/测试

脚本扫描发现大量 examples/ 目录下的示例项目(版本多为 1.0.0 或 0.1.0)以及 tests/package.json(版本 4.0.0-alpha.4)未同步至 4.1.5-alpha.2。如这些仅为示例或测试资产、非发布包,可忽略;若需统一全仓,请确认发布范围后再批量更新。

packages/taro-helper/package.json (1)

3-3: 仅版本号变更,工作区对齐无功能影响

与 workspace:* 依赖模型兼容,无需额外动作。LGTM。

packages/taro-rn-runner/package.json (1)

3-3: 版本号更新对齐,LGTM

仅元数据更新,不影响构建脚本与依赖树。

packages/taro-platform-harmony-hybrid/package.json (1)

3-3: 版本号提升 LGTM

与 Harmony 相关实现未在此文件变更;仅元数据同步,无功能面影响。

packages/taro-platform-jd/package.json (1)

3-3: JD 平台插件版本号同步,LGTM

无代码与依赖改动,仅预发布号更新。

packages/taro-plugin-html/package.json (1)

3-3: 优化版本一致性自检脚本,排除无关目录并支持 PCRE2

  • 限制 fd 只扫描发布包路径(如 packages/*/package.json),排除 examplesteststemplates 等非发布目录
  • 使用 rg --pcre2 -n '4\.1\.5(?!-alpha)' 搜索残留稳定版号,或改用支持 look-around 的工具
  • 执行后确认所有关联包(尤其是 packages/taro-plugin-html 及其依赖)版本均为 4.1.5-alpha.2
packages/taro-h5/package.json (1)

3-3: 仅版本号预发升级:变更安全,可并入

未涉及依赖与导出签名调整,低风险。

packages/taro/package.json (1)

3-3: 核心包版本号同步为 4.1.5-alpha.2:通过

与 monorepo 其它包保持一致性即可。

packages/taro-components-rn/package.json (1)

3-3: RN 组件包版本号同步:OK

无 API/依赖变更,版本对齐即可。

packages/babel-plugin-transform-solid-jsx/package.json (1)

4-4: Babel 插件版本号预发升级:LGTM

仅元数据更新,无功能风险。

packages/taro-plugin-http/package.json (1)

3-3: 校验全仓 package.json 版本一致

脚本检测到以下文件未同步至 4.1.5-alpha.2 或缺少 version 字段,请确认是否需要统一版本或排除示例/测试目录:

  • MISMATCH (found 1.0.0/0.1.0):
    • ./examples/blended-apart/taro-project/package.json
    • ./examples/blended-basic/taro-project/package.json
    • …(共16个 examples/* 下的 package.json)
  • MISMATCH (found 4.0.0-alpha.4):
    • ./tests/package.json
  • NO_VERSION:
    • ./packages/taro-cli/src/tests/fixtures/default/package.json
    • ./packages/taro-cli/templates/global-config/package.json
packages/taro-webpack5-runner/package.json (1)

3-3: 版本号更新为 4.1.5-alpha.2:就绪。

该包的 peerDependencies 与 devDependencies 保持不变(webpack=5.91.0 等),与本次仅版本提升目标一致,无额外风险。

packages/taro-cli-convertor/package.json (1)

3-3: 版本号更新为 4.1.5-alpha.2:就绪。

CLI 可执行入口未变更(bin/taro-convert),与预发版本号提升相互独立,安全。

packages/babel-plugin-transform-taroapi/package.json (1)

3-3: 版本号更新为 4.1.5-alpha.2:就绪。

仅元数据更新;与 Babel 相关的 peer/@babel/core 约束未变,兼容面不受影响。

packages/taro-framework-vue3/package.json (1)

3-3: 版本号更新为 4.1.5-alpha.2:就绪。

peerDependencies(vue/vite 等)区间未调整,符合仅版本预发布的预期。

npm/linux-x64-gnu/package.json (1)

4-4: 版本一致性检查通过:除示例项目(示例包默认保留 1.0.0)外,所有正式发布的 package.json 已与根版本 4.1.5-alpha.2 保持一致;模板文件解析错误可忽略。请确认 CI/CD 发布流程支持识别 alpha.2 格式。

packages/jest-helper/package.json (1)

3-3: 仅版本号 bump;保持 private:true,避免误发包
此变更安全,无需额外动作。

packages/taro-platform-swan/package.json (1)

3-3: 版本号同步到 4.1.5-alpha.2
请确保与其 peerDependencies(workspace:*)一起发版,避免 peer 解析到旧版本。

packages/taro-platform-weapp/package.json (1)

3-3: 版本号预发布同步正确
与 @tarojs/service/@tarojs/shared(workspace:*)的协同发布需确认,避免装配时出现版本漂移。

packages/postcss-unit-transform/package.json (1)

3-3: 版本号更新 OK
无代码/依赖改动。若本次发版含功能变动,请同步更新对应包的 CHANGELOG。

packages/taro-platform-qq/package.json (1)

3-3: 更新一致性扫描脚本以忽略 JSON 解析错误并正确统计所有版本

将根目录一致性扫描脚本替换为:

#!/usr/bin/env bash
set -euo pipefail
root_ver=$(jq -r '.version' package.json)
echo "Root version: $root_ver"
echo "All package.json versions (count,version):"
fd -a package.json -t f \
  | while read f; do
      v=$(jq -r '.version // empty' "$f" 2>/dev/null) || continue
      [ -n "$v" ] && echo "$v"
    done \
  | sort | uniq -c
echo "Files still on 4.1.5:"
rg -nP '"version"\s*:\s*"4\.1\.5"' -g '!**/node_modules/**' || true

确认执行后无 parse error 并且所有子包版本均已更新至 4.1.5-alpha.2

packages/postcss-plugin-constparse/package.json (1)

3-3: 已确认仅版本号更新至 4.1.5-alpha.2,无残留稳定版号
无功能或依赖变更,符合预发布要求。请同步更新变更日志及 alpha 发布说明。

npm/darwin-x64/package.json (1)

4-4: 各平台 binding 版本一致 经过脚本验证,npm/* 下所有平台包均已统一更新为 4.1.5-alpha.2,无需额外变更。

packages/taro-rn-transformer/package.json (1)

3-3: 确认所有 RN 相关包版本一致
已验证 packages 下所有包含 taro-rn 的包均为 4.1.5-alpha.2,版本对齐,无需额外调整。

packages/taro-api/package.json (1)

3-3: 确认内部依赖未硬编码 @tarojs/api 版本
已执行脚本验证,packages 目录下不存在非 workspace 引用,内部依赖均使用 workspace 范围,预发布风险可控,同意合入。

crates/native_binding/package.json (1)

3-3: native binding 版本号对齐 — optionalDependencies 已使用 workspace:*
版本号与根版本 4.1.5-alpha.2 保持一致。请确认 NAPI 构建流水线产出对应的 4.1.5-alpha.2 二进制工件。

packages/create-app/package.json (1)

3-3: 脚手架版本位号同步 — 通过 脚手架模板内未发现非 4.1.5-alpha.2 的版本引用,已全量同步至 4.1.5-alpha.2。

packages/taro-framework-react/package.json (1)

3-3: 请校验全仓版本一致性
仅将 packages/taro-framework-react/package.json 的 version 更新为 4.1.5-alpha.2。请在仓库根目录执行以下脚本,检查根包与所有工作区中的 package.json(排除 node_modules)版本是否与之完全一致,避免发版差异:

#!/bin/bash
set -euo pipefail

root_ver="$(jq -r '.version' package.json)"
echo "Root version: $root_ver"

find . -name package.json -not -path '*/node_modules/*' | while read -r f; do
  ver="$(jq -r '.version' "$f" 2>/dev/null || echo)"
  if [[ -n $ver && $ver != $root_ver ]]; then
    printf "[mismatch] %s -> %s\n" "$f" "$ver"
  fi
done

echo
echo "Packages still on 4.1.5 (stable, not alpha):"
rg -nP '"version"\s*:\s*"4\.1\.5"' -g '!'**/node_modules/**' || true
packages/taro-platform-harmony-cpp/package.json (1)

3-3: 仅版本号预发布更新,变更安全

无功能/依赖项调整;与 workspace:* 依赖保持解耦,风险低。

packages/stylelint-taro/package.json (1)

3-3: 版本号同步为 4.1.5-alpha.2,OK

纯元数据更新;与 stylelint ^16 的 peer 无冲突。

packages/stylelint-config-taro-rn/package.json (1)

3-3: 版本号预发布同步,LGTM

仅元数据更新;与 peerDependencies 要求保持兼容。

packages/rollup-plugin-copy/package.json (1)

3-3: 内部包版本号同步,OK

private 包仅版本号更新,无发布/运行时影响。

packages/babel-preset-taro/package.json (1)

3-3: 版本号已升级至 4.1.5-alpha.2,无稳定版残留
经验证,未检出“4.1.5”稳定版;主包已对齐至“4.1.5-alpha.2”,示例、测试及私有包的版本差异属预期,无需统一。

packages/taro-components-library-solid/package.json (1)

3-3: 版本号对齐到 4.1.5-alpha.2:通过

此包为私有包(private: true),仅元数据更新,无发布风险。

packages/taro-react/package.json (1)

3-3: 预发布版本号更新:通过

纯元数据变更;不影响依赖与导出。

packages/taro-webpack5-prebundle/package.json (1)

3-3: 版本号更新到 4.1.5-alpha.2:通过

与 monorepo 其他包保持一致。

packages/postcss-html-transform/package.json (1)

3-3: 版本号更新到 4.1.5-alpha.2:通过

仅元数据改动,无运行时影响。

packages/taro-components/package.json (1)

3-3: 同步主包版本一致性

已确认 packages/ 下的所有发布包版本均为 4.1.5-alpha.2;其余目录中存在刻意保留的示例与测试包版本不一致:

  • examples/…/package.json 多为 1.0.0 或 0.x
  • tests/package.json 为 4.0.0-alpha.4
  • packages/taro-cli/src/__tests__/fixtures/default/package.jsonpackages/taro-cli/templates/global-config/package.json 版本字段为空

请核实 monorepo workspace 配置,决定是否需排除示例、测试及 fixtures 目录,或同步它们的版本号以免 publish 时漏发或多发。

packages/taro-plugin-react-devtools/package.json (1)

3-3: 仅版本号提升为 4.1.5-alpha.2,变更可接受

无功能改动。发布时请确认该插件与 CLI/runner 在同一版本窗口发布,避免 peer/workspace:* 解析到不一致的本地版本。

packages/taro-cli/package.json (1)

3-3: 版本号更新确认;需在 CI 中验证 Jest 27 与 Node 18/20 的兼容性

packages/taro-components/package.json 中仍在使用 Jest 27.5.1,CI 请分别在 Node 18 与 Node 20 环境下运行单测,确认无兼容性问题。
可参考脚本:

#!/bin/bash
# 在不同 Node 版本下执行测试
nvm exec 18 npm test
nvm exec 20 npm test
packages/css-to-react-native/package.json (1)

4-4: 预发布版本号同步无误

仅版本号更新,与整体版本提升一致,接受。

packages/taro-vite-runner/src/harmony/template/render.ts (1)

102-106: 组件导入去重正确,能减少重复绑定

使用 new Set 去重 compList 合理且保持首次出现顺序,风险低。

packages/taro-vite-runner/src/harmony/template/app.ts (1)

141-147: App 侧改为引入 “.//index_taro_comp”,与输出命名规则一致

该改动与 config/entry 的产物路径策略对齐,预期可消除路径不一致问题。

请在 Harmony 工程实际运行一次,确保 UIAbility 入口能正确解析到 index_taro_comp 模块。

packages/taro-vite-runner/src/harmony/page.ts (5)

66-66: 良好的异步改造实现

load 钩子改为异步函数,配合后续的 Promise.all 使用,提高了代码的可读性和维护性。


103-124: 并行处理 TabBar 页面依赖的优化很好

使用 Promise.all 并行处理多个 TabBar 页面的依赖收集和原生组件生成,相比之前的串行处理,可以显著提升构建性能。


140-178: 并行处理普通页面的优化实现正确

使用 await Promise.all 并行处理页面列表,依赖收集逻辑清晰,异步操作处理得当。


148-148: originName 的惰性赋值策略合理

使用 ||= 运算符确保 originName 只在首次赋值时设置,避免了 watch 模式下的重复覆盖问题。注释说明也很清晰。


158-177: 依赠收集顺序调整符合异步处理逻辑

ncObj 的声明和依赖收集操作移到 Promise.all 内部,确保了每个页面的处理都是独立的,避免了并发处理时的数据混淆问题。

"name": "@tarojs/binding-win32-x64-msvc",
"description": "Native binding for taro",
"version": "4.1.5",
"version": "4.1.5-alpha.2",
Copy link

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

win32-x64-msvc 预发布版本号已更新 — LGTM

请同步验证:

  • 文件名 taro.win32-x64-msvc.node 与打包产物一致;
  • CI 工件上传并与 @tarojs/binding 的 optionalDependencies 匹配。

🏁 Script executed:

#!/bin/bash
# 校验 main 指向的文件名与实际产物命名规范
jq -r '.main' npm/win32-x64-msvc/package.json

Length of output: 70


🏁 Script executed:

#!/bin/bash
# 查找 @tarojs/binding package.json 文件位置
binding_pkg=$(rg -lP '"name"\s*:\s*"@tarojs/binding"' -g '*/package.json' | head -n1)
echo "binding_pkg: $binding_pkg"
# 输出 optionalDependencies
jq -r '.optionalDependencies' "$binding_pkg"
# 输出 optionalDependencies 中 taro.win32-x64-msvc 条目
jq -r '.optionalDependencies["taro.win32-x64-msvc"]' "$binding_pkg" 2>/dev/null || echo "not found"

Length of output: 305


🏁 Script executed:

#!/bin/bash
# 查找名为 @tarojs/binding 的 package.json 并打印 optionalDependencies
for pkg in $(find . -type f -name package.json); do
  if jq -r '.name' "$pkg" | grep -q '@tarojs/binding'; then
    echo "binding_pkg: $pkg"
    echo "optionalDependencies:"
    jq -r '.optionalDependencies' "$pkg"
  fi
done

# 查找包含 taro.win32-x64-msvc 的 optionalDependencies 的 package.json
echo "包含 taro.win32-x64-msvc 的 package.json 文件:"
find . -type f -name package.json | xargs rg -l '"taro.win32-x64-msvc"' -n

Length of output: 123330


🏁 Script executed:

#!/bin/bash
pkg_json="npm/win32-x64-msvc/package.json"
crate_json="crates/native_binding/package.json"

# 输出 package 名称
pkg_name=$(jq -r .name "$pkg_json")
echo "pkg name: $pkg_name"

# 列出 optionalDependencies 键并验证是否包含 pkg_name
echo "optionalDependencies keys in $crate_json:"
jq -r '.optionalDependencies | keys[]' "$crate_json"
echo -n "pkg_name present in optionalDependencies? "
jq -r '.optionalDependencies | has("'"$pkg_name"'")' "$crate_json"

# 检查 artifact 文件是否存在
echo -n "artifact taro.win32-x64-msvc.node exists? "
[ -f npm/win32-x64-msvc/taro.win32-x64-msvc.node ] && echo true || echo false

Length of output: 984


缺少打包产物文件 taro.win32-x64-msvc.node
npm/win32-x64-msvc 目录下未找到 taro.win32-x64-msvc.node,需补充该原生产物文件后再合并。

🤖 Prompt for AI Agents
In npm/win32-x64-msvc/package.json around line 4, the package references version
4.1.5-alpha.2 but the native build artifact taro.win32-x64-msvc.node is missing
from the npm/win32-x64-msvc directory; add the compiled taro.win32-x64-msvc.node
file into that directory, ensure it is tracked in git (and not ignored by
.gitignore/.npmignore), verify package.json and any packaging scripts reference
the correct filename, and commit the artifact so the package contains the binary
before merging.

{
"name": "taro",
"version": "4.1.5",
"version": "4.1.5-alpha.2",
Copy link

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

根版本升级为预发布,需检查全仓一致性与变更日志

请确认所有包均已同步至 4.1.5-alpha.2,且有对应变更记录(如 CHANGELOG 或 Release note)。


🏁 Script executed:

#!/bin/bash
# 1) 列出未同步到根版本的包
root_ver=$(jq -r '.version' package.json)
echo "Root version: $root_ver"
echo "Packages not matching root version:"
fd -t f -g "package.json" packages npm crates | rg -v "node_modules" | while read -r f; do
  ver=$(jq -r '.version // empty' "$f")
  name=$(jq -r '.name // empty' "$f")
  [[ -n "$ver" && "$ver" != "$root_ver" ]] && printf "%-45s %-18s %s\n" "$name" "$ver" "$f"
done

# 2) 统计公开(非 private) 且为预发布的包,用于后续发布校验
echo -e "\nPublic prerelease packages (should publish with tag=next):"
fd -t f -g "package.json" packages | while read -r f; do
  private=$(jq -r '.private // false' "$f")
  ver=$(jq -r '.version // empty' "$f")
  name=$(jq -r '.name // empty' "$f")
  if [[ "$private" != "true" && "$ver" == *"-alpha."* ]]; then
    printf "%-45s %-18s %s\n" "$name" "$ver" "$f"
  fi
done

Length of output: 62538


🏁 Script executed:

#!/bin/bash
# 查找所有 CHANGELOG 文件
echo "Changelog files:"
fd -t f -g "CHANGELOG*.md"

# 如果根目录有 CHANGELOG.md,则查找版本条目
if [ -f CHANGELOG.md ]; then
  echo -e "\nEntries for version 4.1.5-alpha.2 in CHANGELOG.md:"
  rg -n "4\.1\.5-alpha\.2" CHANGELOG.md || echo "未找到条目"
else
  echo "未找到根目录 CHANGELOG.md"
fi

Length of output: 146


补充 4.1.5-alpha.2 版本变更日志
根版本已同步至所有子包,但未在根目录发现任何 CHANGELOG.md 或 Release Note,请新增对应版本条目。

🤖 Prompt for AI Agents
package.json around lines 3 to 3: 根版本已经升到 "4.1.5-alpha.2" 但仓库根目录缺少对应的变更日志或
Release Note;请在仓库根目录新增或更新 CHANGELOG.md(或 Release Notes 文件),添加 4.1.5-alpha.2
节点,包含发布日期、简要变更摘要和受影响子包列表(如有重要修复、功能或注释),并确保格式与现有变更日志条目一致以便子包同步。

{
"name": "eslint-config-taro",
"version": "4.1.5",
"version": "4.1.5-alpha.2",
Copy link

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

确认与主版本对齐并检查 peer 生态兼容矩阵。

该包 peerDependencies 约束 ESLint 生态(eslint/eslint-plugin-*),请确保与当前仓库其它 lint 配置/预设的版本不冲突;并在变更日志中注明为预发布。


🏁 Script executed:

#!/bin/bash
# 核查与 eslint 相关的 peer 版本是否存在冲突或多版本
rg -nP '"eslint[^"]*"\s*:\s*"\^?[^"]+"' packages -S -C1 || true

Length of output: 4079


对齐 peerDependencies 版本

  • 在 packages/eslint-config-taro/package.json 中,将 eslint-plugin-vue peer 版本从 ^8.0.0 调整为 ^9.17.0(与 CLI 模板一致);
  • 可选将 eslint-plugin-react peer 从 ^7.33.2 升级至 ^7.34.1 以保持全仓库依赖统一;
  • 在 CHANGELOG 中注明该版本(4.1.5-alpha.2)为预发布。
🤖 Prompt for AI Agents
In packages/eslint-config-taro/package.json around line 3, update the
peerDependencies: change "eslint-plugin-vue" from "^8.0.0" to "^9.17.0" to match
the CLI template; optionally bump "eslint-plugin-react" from "^7.33.2" to
"^7.34.1" for repo-wide consistency; then update the CHANGELOG to add an entry
for version 4.1.5-alpha.2 and mark it explicitly as a pre-release (alpha) so the
package version is documented as a pre-release.

{
"name": "@tarojs/components-react",
"version": "4.1.5",
"version": "4.1.5-alpha.2",
Copy link

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

请校验 Monorepo 版本一致性与预发布标签策略

  • 确认所有 package.json 的 version 均为 4.1.5-alpha.2,避免遗漏导致 publish 异常。
  • 预发布建议使用 npm tag(如 next/alpha),避免覆盖 latest。

🏁 Script executed:

#!/bin/bash
set -euo pipefail

root_ver="$(jq -r '.version' package.json)"
echo "Root version: ${root_ver}"

echo "Checking version mismatches..."
fd -t f -a 'package.json' -E node_modules -E .git | while read -r f; do
  ver="$(jq -r 'select(.version?)|.version' "$f" || true)"
  [[ -z "$ver" || "$ver" == "null" ]] && continue
  if [[ "$ver" != "$root_ver" ]]; then
    echo "Mismatch: $f -> $ver"
  fi
done

if [[ "$root_ver" =~ -(alpha|beta|rc) ]]; then
  echo "Checking publishConfig.tag for pre-release..."
  fd -t f -a 'package.json' -E node_modules -E .git | while read -r f; do
    tag="$(jq -r '.publishConfig.tag? // empty' "$f")"
    if [[ -z "$tag" || "$tag" == "null" || "$tag" == "latest" ]]; then
      echo "Missing/invalid publishConfig.tag in: $f"
    fi
  done
fi

Length of output: 43044


添加 publishConfig.tag 以避免覆盖 latest

  • packages/taro-components-react/package.json 中 version 已对齐(4.1.5-alpha.2),无需修改
  • 缺少 publishConfig.tag,建议在该文件根级添加:
    "publishConfig": {
      "tag": "alpha"
    }
    并发布时使用 npm publish --tag alpha
🤖 Prompt for AI Agents
In packages/taro-components-react/package.json around line 3, the package lacks
a publishConfig.tag which risks publishing this alpha version under the default
"latest" tag; add a root-level publishConfig object with "tag": "alpha" (no
change to version needed) and publish using npm publish --tag alpha to ensure
the package is published under the alpha tag.

{
"name": "@tarojs/plugin-framework-solid",
"version": "4.1.5",
"version": "4.1.5-alpha.2",
Copy link

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

版本号提升到 4.1.5-alpha.2 — LGTM

仅元数据调整。请确保:

  • 所有 workspace 包版本一致;
  • 变更日志/发布说明同步;
  • 预发布版本不影响 peerDependencies 的 workspace:~ 解析。

🏁 Script executed:

#!/bin/bash
# 1) 根版本应为 4.1.5-alpha.2
jq -r '.version' package.json

# 2) 检查是否仍残留纯 4.1.5(无 -alpha.2)
rg -nP '"version"\s*:\s*"4\.1\.5"(?!-alpha\.2)'

# 3) 统计各版本号分布
fd package.json -H | xargs -I{} sh -c 'printf "%s\t" "{}"; jq -r .version "{}" 2>/dev/null || echo "-" ' | sort

Length of output: 5636


🏁 Script executed:

#!/bin/bash
# 输出根 package.json 中的 workspaces 配置
jq .workspaces package.json

Length of output: 34


🏁 Script executed:

#!/bin/bash
# 检查根目录是否存在工作区配置
for file in pnpm-workspace.yaml lerna.json turbo.json; do
  if [ -f "$file" ]; then
    echo "$file 存在"
  else
    echo "$file 不存在"
  fi
done

Length of output: 381


🏁 Script executed:

#!/bin/bash
cat pnpm-workspace.yaml

Length of output: 214


tests/package.json 版本需同步

tests/package.json 当前为 4.0.0-alpha.4,请更新至 4.1.5-alpha.2 以保证所有 workspace 包版本一致。

🤖 Prompt for AI Agents
packages/taro-framework-solid/package.json around line 3: 当前该文件的 version 为
"4.1.5-alpha.2",但 tests/package.json 仍是 "4.0.0-alpha.4";请打开
tests/package.json,将其 version 字段更新为 "4.1.5-alpha.2" 以与
packages/taro-framework-solid/package.json 保持一致,并在修改后在仓库根目录执行一次安装/锁文件更新(例如 npm
install 或 yarn install)以同步 workspace 依赖版本。

{
"name": "@tarojs/plugin-platform-harmony-ets",
"version": "4.1.5",
"version": "4.1.5-alpha.2",
Copy link

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

预发布版本号对齐到 4.1.5-alpha.2——请同步核对发版与依赖策略

  • 确认 monorepo 内其余包也已统一到同一 prerelease 版本,并确保发布流程使用合适的 dist-tag(如 next),避免覆盖稳定版。
  • 若仓库未统一由发布脚本设置 dist-tag,请在需要的包中补充 publishConfig.tag=next。

建议在仓库根目录执行脚本,快速查出仍未对齐到 4.1.5-alpha.2 的 package.json:


🏁 Script executed:

#!/bin/bash
set -euo pipefail
# 列出 version 不是 4.1.5-alpha.2 的包(忽略 node_modules)
fd -a package.json packages . | grep -v node_modules | while read -r f; do
  if ! rg -nP '"version"\s*:\s*"4\.1\.5-alpha\.2"' -q "$f"; then
    echo "Version not aligned: $f"
  fi
done

Length of output: 26473


对齐 monorepo 发布包版本至 4.1.5-alpha.2,并设置合适的 dist-tag

  • 确认 packages/ 下所有核心包(非示例、测试和模板)的 package.json 已将 "version" 更新为 "4.1.5-alpha.2",示例(examples/)和测试目录可忽略。
  • 发布时使用 next dist-tag,或在各需发包的 package.json 中添加:
    "publishConfig": {
      "tag": "next"
    }
  • 建议以下脚本仅扫描发布目录,排除示例与测试:
    #!/usr/bin/env bash
    set -euo pipefail
    # 仅检查 packages/ 下的 package.json,排除 __tests__ 和 templates 目录
    fd -t f -e json '' packages | grep -E 'package\.json$' | grep -Ev '(__tests__/|templates/)' | while read -r f; do
      if ! rg -q '"version"\s*:\s*"4\.1\.5-alpha\.2"' "$f"; then
        echo "版本未对齐: $f"
      fi
    done
🤖 Prompt for AI Agents
In packages/taro-platform-harmony/package.json around line 3, the package
version should be updated to "4.1.5-alpha.2" and the package should include a
publishConfig with tag "next"; update the "version" field to "4.1.5-alpha.2" and
add a "publishConfig": { "tag": "next" } entry (or verify it exists) so releases
use the correct dist-tag, and run a repository-wide check to ensure all core
packages under packages/ (excluding examples, __tests__, templates) have their
package.json versions aligned to 4.1.5-alpha.2 before publishing.

{
"name": "@tarojs/plugin-generator",
"version": "4.1.5",
"version": "4.1.5-alpha.2",
Copy link

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

请同步校验依赖树与发布流程。

该包为开发期工具插件,发布到 alpha 通道后建议:

  • 更新变更日志/发布说明,标注为预发布。
  • 用脚本检查是否仍有依赖引用 4.1.5 稳定版,避免混装。

🏁 Script executed:

#!/bin/bash
# 检查仓库仍引用 4.1.5 稳定版的地方
rg -nP '"4\.1\.5"(?!-alpha\.2)' -S -g '!**/node_modules/**' || true

Length of output: 1800


同步校验示例依赖并更新发布说明

  • 在发布前对 packages/taro-plugin-generator 版本变更后,重新生成所有示例项目的依赖(yarn install),确保 yarn.lock 中不再引用 4.1.5 稳定版
  • 更新 CHANGELOG/Release Notes,标注 4.1.5-alpha.2 为预发布版本
🤖 Prompt for AI Agents
packages/taro-plugin-generator/package.json lines 3-3: the package version was
bumped to 4.1.5-alpha.2 but example projects and release notes were not updated;
to fix, regenerate all example project dependencies (cd into each example and
run yarn install or run yarn workspace scripts from repo root) so yarn.lock no
longer references the stable 4.1.5, commit the updated yarn.lock, and update
CHANGELOG/Release Notes to document 4.1.5-alpha.2 as a pre-release version.

{
"name": "@tarojs/taro-rn",
"version": "4.1.5",
"version": "4.1.5-alpha.2",
Copy link

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

RN 包版本同步为 4.1.5-alpha.2 — 通过

无代码行为变更。发布前请确认:

  • 与 react-native/Expo 相关 peerDependencies 在预发布下未被解解析器忽略;
  • CI 测试矩阵包含该预发布版本。

🏁 Script executed:

#!/bin/bash
# 确认 peerDependencies 未使用严格固定且拒绝预发布
jq -r '.peerDependencies' packages/taro-rn/package.json

Length of output: 891


修正严格固定的 peerDependencies 版本并确认预发布兼容性

  • 将固定版本("@react-native-async-storage/async-storage": "1.21.0""@react-native-community/netinfo": "11.1.0""react-native-safe-area-context": "4.8.2")统一改为带 ^~ 的范围前缀。
  • 确认 4.1.5-alpha.2 版本不会被 Metro/Resolver 忽略,且 CI 测试矩阵已覆盖该预发布版本。
🤖 Prompt for AI Agents
In packages/taro-rn/package.json around line 3, the package pins
peerDependencies to exact versions which is too strict; update the entries for
@react-native-async-storage/async-storage, @react-native-community/netinfo, and
react-native-safe-area-context to use a permissive range (e.g. prepend ^ or ~ as
appropriate) instead of exact versions, and ensure the pre-release package
version "4.1.5-alpha.2" is respected by Metro/Resolver (adjust
resolver/blacklist settings if necessary) and add/confirm CI matrix entries
include this alpha pre-release so tests run against it.

// const url = `__TARO_VITE_ASSET__${referenceId}__${postfix ? `$_${postfix}__` : ``}` // TODO_BASE

const resourceName = path.relative(appRoot, file).replace(/^[\\/]+/, '').replace(/[\\/-]+/g, '_')
const resourceName = path.relative(appRoot, file).replace(/^[\\/]+/, '').replace(/[^A-z0-9]+/g, '_')
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

资源名称规范化范围扩大可能导致文件名冲突

当前的正则表达式 /[^A-z0-9]+/g 会将所有非字母数字字符序列替换为单个下划线。这种处理方式可能会导致不同的文件路径产生相同的资源名称,从而造成文件覆盖问题。

例如:

  • assets/icon-home.pngassets_icon_home_png
  • assets/icon.home.pngassets_icon_home_png

建议使用更安全的命名策略,保留更多原始路径信息或添加哈希值以确保唯一性:

-  const resourceName = path.relative(appRoot, file).replace(/^[\\/]+/, '').replace(/[^A-z0-9]+/g, '_')
+  const relativePath = path.relative(appRoot, file).replace(/^[\\/]+/, '')
+  const hash = getHash(relativePath).slice(0, 8)
+  const resourceName = relativePath.replace(/[^A-z0-9]+/g, '_') + '_' + hash

或者使用更精细的字符替换策略:

-  const resourceName = path.relative(appRoot, file).replace(/^[\\/]+/, '').replace(/[^A-z0-9]+/g, '_')
+  const resourceName = path.relative(appRoot, file)
+    .replace(/^[\\/]+/, '')
+    .replace(/[\\/]/g, '_')  // 目录分隔符替换为下划线
+    .replace(/[^A-Za-z0-9._-]/g, '_')  // 保留常见文件名字符
📝 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.

Suggested change
const resourceName = path.relative(appRoot, file).replace(/^[\\/]+/, '').replace(/[^A-z0-9]+/g, '_')
// Before:
- const resourceName = path.relative(appRoot, file).replace(/^[\\/]+/, '').replace(/[^A-z0-9]+/g, '_')
// After:
const resourceName = path.relative(appRoot, file)
.replace(/^[\\/]+/, '') // strip leading slashes or backslashes
.replace(/[\\/]/g, '_') // convert path separators into underscores
.replace(/[^A-Za-z0-9._-]/g, '_') // only allow alphanumerics, dot, underscore, and hyphen

Comment on lines 1040 to 1044
} else {
importList.push(
`import createComponent, { config } from "${path.resolve(targetRoot, (page as TaroHarmonyPageMeta).originName) + TARO_COMP_SUFFIX}"`,
`import createComponent, { config } from "${path.resolve(targetRoot, (page as TaroHarmonyPageMeta).originName) + '/index' + TARO_COMP_SUFFIX}"`,
)
}
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

⚠️ Potential issue

非 TabBar 页使用绝对路径导入,存在跨平台/构建器解析风险,需改为相对+标准化路径

path.resolve(targetRoot, originName) + '/index' + TARO_COMP_SUFFIX 会生成绝对路径(Windows 下还包含反斜杠),易与打包器的相对模块解析/虚拟模块策略冲突。建议改为:以 rawId 所在目录为基准计算相对路径,并规范为 POSIX 风格,再保证以 ./../ 开头。

最小行内替换(结合已有 escapePath):

-        `import createComponent, { config } from "${path.resolve(targetRoot, (page as TaroHarmonyPageMeta).originName) + '/index' + TARO_COMP_SUFFIX}"`,
+        `import createComponent, { config } from "\${pageImportPath}"`,

并在本函数内、构建 importList 之前增加如下计算(示例放在计算完 renderPath 之后):

// 放置位置:紧随 renderPath 计算之后
let pageImportPath = path.relative(
  path.dirname(rawId),
  path.resolve(targetRoot, (page as TaroHarmonyPageMeta).originName)
)
pageImportPath = pageImportPath.split(path.sep).join('/') // 统一为 POSIX
if (/^[^./]/.test(pageImportPath)) pageImportPath = `./${pageImportPath}`
pageImportPath = escapePath(`${pageImportPath}/index${TARO_COMP_SUFFIX}`)

这样可与 tabbar 场景的相对导入保持一致,避免绝对路径带来的平台差异与虚拟模块冲突。

🤖 Prompt for AI Agents
In packages/taro-vite-runner/src/harmony/template/page.ts around lines
1040-1044, avoid using absolute paths for non-TabBar imports: compute a relative
POSIX path from path.dirname(rawId) to path.resolve(targetRoot, page.originName)
right after renderPath is computed, normalize backslashes to '/', ensure the
path begins with './' or '../' when necessary, then run it through the existing
escapePath and append `/index${TARO_COMP_SUFFIX}`; finally use that
pageImportPath in importList instead of path.resolve(...)+ '/index' +
TARO_COMP_SUFFIX so imports are relative, platform-neutral, and compatible with
bundler/virtual module resolution.

Copy link

codecov bot commented Aug 28, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 55.06%. Comparing base (9ec6b7f) to head (9049c82).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main   #18259   +/-   ##
=======================================
  Coverage   55.06%   55.06%           
=======================================
  Files         416      416           
  Lines       21563    21563           
  Branches     5292     5269   -23     
=======================================
  Hits        11873    11873           
+ Misses       8036     8034    -2     
- Partials     1654     1656    +2     
Flag Coverage Δ
taro-cli 72.85% <ø> (ø)
taro-runtime 59.87% <ø> (ø)
taro-web 53.13% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.
see 7 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.

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