-
Notifications
You must be signed in to change notification settings - Fork 4.9k
chore: rm rollup-plugin-ts #17992
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: rm rollup-plugin-ts #17992
Conversation
Walkthrough本次变更主要集中于依赖管理和构建配置优化。多个 package.json 文件中的 Changes
Sequence Diagram(s)sequenceDiagram
participant 用户
participant CLI
participant NodeJS
用户->>CLI: 创建 CLI 实例(可选 appPath)
CLI->>NodeJS: 获取 Node.js 版本
alt 版本 < 20
CLI-->>用户: 输出版本不支持警告
else 版本 >= 20
CLI-->>用户: 正常初始化
end
sequenceDiagram
participant 开发者
participant Rollup
participant TypeScript插件
participant DTS插件
开发者->>Rollup: 启动构建
Rollup->>TypeScript插件: 编译 TypeScript 源码
TypeScript插件-->>Rollup: 输出 JS 文件
Rollup->>DTS插件: 生成声明文件(.d.ts)
DTS插件-->>Rollup: 输出 d.ts 文件
Rollup-->>开发者: 构建产物(JS + d.ts)
Possibly related PRs
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
@Single-Dancer 可否审下这个,谢谢 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (4)
.github/workflows/build-rust-wasm.yml (1)
19-28: 缓存 Key 修正 👍,可再增补restore-keys提升命中率更正了
ubuntu拼写后现有缓存会失效,需要重新构建一次 target。为避免将来类似的小修改再次失效,可增加一个前缀级的restore-keys:with: ... - key: wasm32-wasi-cargo-ubuntu-latest + key: wasm32-wasi-cargo-ubuntu-latest + restore-keys: | + wasm32-wasi-cargo-这样即便后缀改动,也能回退到较粗粒度的旧缓存。
.github/workflows/nodejs.yml (2)
163-171: 统一actions/cache@v4与 Key,建议同样补充restore-keys同 build-rust-wasm,加入前缀级
restore-keys可减少缓存失效带来的编译时间。
36-39:fail-fast: false可考虑移除升级后矩阵规模较大,而
fail-fast: false会导致任一任务失败仍继续跑完全部,无助于节省 CI 额度。如果无并行失败调试需求,可删除该选项,让失败快速返回。.github/workflows/build-rust-binding.yml (1)
66-74: 缓存步骤同样建议增加restore-keyskey: ${{ matrix.settings.target }}-cargo-${{ matrix.settings.host }} + restore-keys: | + ${{ matrix.settings.target }}-cargo-可提升后续微调 key 时的缓存命中率。
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (18)
.github/dependabot.yml(1 hunks).github/workflows/auto-review.yml(1 hunks).github/workflows/build-rust-binding.yml(2 hunks).github/workflows/build-rust-wasm.yml(1 hunks).github/workflows/nodejs.yml(2 hunks).github/workflows/publish.yml(2 hunks).github/workflows/sync-components-types.yml(1 hunks)examples/blended-taro-component-vue3/taro-project/package.json(1 hunks)examples/mini-program-example/package.json(1 hunks)examples/taro-list/package.json(1 hunks)package.json(2 hunks)packages/taro-cli/templates/plugin-compile/package.json.tmpl(1 hunks)packages/taro-platform-harmony-cpp/package.json(2 hunks)packages/taro-platform-harmony-cpp/rollup.config.ts(3 hunks)packages/taro-platform-harmony-cpp/tsconfig.json(1 hunks)packages/taro-platform-harmony-hybrid/build/config/harmony-definition.json(2 hunks)packages/taro-platform-harmony-hybrid/package.json(0 hunks)packages/taro-plugin-generator/package.json(0 hunks)
💤 Files with no reviewable changes (2)
- packages/taro-plugin-generator/package.json
- packages/taro-platform-harmony-hybrid/package.json
🧰 Additional context used
🧠 Learnings (8)
📓 Common learnings
Learnt from: ianzone
PR: NervJS/taro#17746
File: packages/taro-runtime/tsdown.config.ts:10-16
Timestamp: 2025-05-25T18:02:31.387Z
Learning: 在 taro-runtime 包的 tsdown 配置中,必须禁用 treeshake 来保留 dom-external/index.js 文件。
packages/taro-platform-harmony-cpp/tsconfig.json (1)
Learnt from: ianzone
PR: NervJS/taro#17746
File: packages/taro-runtime/tsdown.config.ts:10-16
Timestamp: 2025-05-25T18:02:31.387Z
Learning: 在 taro-runtime 包的 tsdown 配置中,必须禁用 treeshake 来保留 dom-external/index.js 文件。
packages/taro-cli/templates/plugin-compile/package.json.tmpl (1)
Learnt from: ianzone
PR: NervJS/taro#17746
File: packages/taro-runtime/tsdown.config.ts:10-16
Timestamp: 2025-05-25T18:02:31.387Z
Learning: 在 taro-runtime 包的 tsdown 配置中,必须禁用 treeshake 来保留 dom-external/index.js 文件。
package.json (1)
Learnt from: ianzone
PR: NervJS/taro#17842
File: packages/jest-helper/tsconfig.json:9-9
Timestamp: 2025-06-23T00:09:31.233Z
Learning: 在 jest-helper 包中,src 目录下没有 __tests__ 测试目录,只包含 resolver.ts、sequencer.ts 和 snapshot 目录。不要假设包中存在测试目录结构。
examples/blended-taro-component-vue3/taro-project/package.json (1)
Learnt from: ianzone
PR: NervJS/taro#17746
File: packages/taro-runtime/tsdown.config.ts:10-16
Timestamp: 2025-05-25T18:02:31.387Z
Learning: 在 taro-runtime 包的 tsdown 配置中,必须禁用 treeshake 来保留 dom-external/index.js 文件。
examples/taro-list/package.json (2)
Learnt from: ianzone
PR: NervJS/taro#17746
File: packages/taro-runtime/tsdown.config.ts:10-16
Timestamp: 2025-05-25T18:02:31.387Z
Learning: 在 taro-runtime 包的 tsdown 配置中,必须禁用 treeshake 来保留 dom-external/index.js 文件。
Learnt from: ianzone
PR: NervJS/taro#17842
File: packages/jest-helper/tsconfig.json:9-9
Timestamp: 2025-06-23T00:09:31.233Z
Learning: 在 jest-helper 包中,src 目录下没有 __tests__ 测试目录,只包含 resolver.ts、sequencer.ts 和 snapshot 目录。不要假设包中存在测试目录结构。
packages/taro-platform-harmony-cpp/rollup.config.ts (2)
Learnt from: ianzone
PR: NervJS/taro#17746
File: packages/taro-runtime/tsdown.config.ts:10-16
Timestamp: 2025-05-25T18:02:31.387Z
Learning: 在 taro-runtime 包的 tsdown 配置中,必须禁用 treeshake 来保留 dom-external/index.js 文件。
Learnt from: ianzone
PR: NervJS/taro#17842
File: packages/jest-helper/tsconfig.json:9-9
Timestamp: 2025-06-23T00:09:31.233Z
Learning: 在 jest-helper 包中,src 目录下没有 __tests__ 测试目录,只包含 resolver.ts、sequencer.ts 和 snapshot 目录。不要假设包中存在测试目录结构。
packages/taro-platform-harmony-cpp/package.json (1)
Learnt from: ianzone
PR: NervJS/taro#17746
File: packages/taro-runtime/tsdown.config.ts:10-16
Timestamp: 2025-05-25T18:02:31.387Z
Learning: 在 taro-runtime 包的 tsdown 配置中,必须禁用 treeshake 来保留 dom-external/index.js 文件。
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: Testing on Node.js 18.x (ubuntu-latest)
- GitHub Check: Testing on Node.js 20.x (ubuntu-latest)
- GitHub Check: Testing on Node.js (macos-13)
- GitHub Check: Testing on Node.js (windows-latest)
🔇 Additional comments (20)
package.json (1)
111-112: 确认 Vitest 依赖版本一致,无需后续操作
- 根目录 package.json
- "@vitest/coverage-istanbul": "^3.2.4"
- "vitest": "^3.2.4"
脚本检查未发现其他 package.json 中存在旧版本引用,依赖版本已全部统一为 ^3.2.4,可忽略先前关于版本一致性检查的建议。
packages/taro-cli/templates/plugin-compile/package.json.tmpl (1)
38-38: 放宽 @types/node 版本符合统一策略
已与主仓package.json保持一致,无功能性风险。examples/mini-program-example/package.json (1)
84-84: 示例项目同步放宽 @types/node 版本
更宽的范围可减少 dependabot 噪音,变更合理。examples/blended-taro-component-vue3/taro-project/package.json (1)
51-51: 示例项目同步放宽 @types/node 版本
与其它示例保持一致,👍examples/taro-list/package.json (1)
85-85: 示例项目同步放宽 @types/node 版本
一致性良好,无其他问题。.github/dependabot.yml (1)
3-76: LGTM! Dependabot 配置优化得当YAML 格式重构提高了可读性,关键的
@types/node版本忽略范围从< 13.14扩展到< 18与仓库范围内的版本标准化保持一致。packages/taro-platform-harmony-hybrid/build/config/harmony-definition.json (1)
2331-2345: LGTM! 新增列表组件定义为 Harmony 平台添加了
list和list-item组件的定义,包含相关的阈值计数属性,扩展了平台的组件支持能力。packages/taro-platform-harmony-cpp/package.json (2)
33-33: LGTM! 构建脚本配置更新构建脚本正确地从
rollup.config.mts更新为rollup.config.ts,移除了--bundleConfigAsCjs标志,与新的 Rollup 配置文件保持一致。
50-55: LGTM! 依赖项重构合理将 Rollup 相关包从
dependencies移至devDependencies是正确的分类,这些包只在构建时需要。rollup-plugin-dts升级到6.2.1版本,与新的类型声明生成配置相匹配。packages/taro-platform-harmony-cpp/tsconfig.json (1)
21-21: LGTM! TypeScript 配置同步更新
include数组正确地将"./rollup.config.mts"更新为"rollup.config.ts",与构建脚本和配置文件的变更保持一致。packages/taro-platform-harmony-cpp/rollup.config.ts (5)
4-4: LGTM! 插件替换符合 PR 目标从
rollup-plugin-ts更换为@rollup/plugin-typescript符合 PR 的移除目标,这是推荐的标准 TypeScript 插件。
8-8: LGTM! 添加类型声明生成支持引入
rollup-plugin-dts用于生成 TypeScript 声明文件,这将提高包的类型支持和开发体验。
16-18: LGTM! 简化路径定义将输入和输出路径定义简化为字符串形式,提高了配置的可读性和维护性。
76-90: LGTM! 新增类型声明文件配置添加了
dtsConfigCjs和dtsConfigEsm两个配置,分别为主入口和 API 块生成 TypeScript 声明文件(.d.ts),这将大大提高包的类型安全性和开发体验。
92-92: LGTM! 配置导出完整默认导出包含了所有四个配置(编译配置、API 配置和两个类型声明配置),确保了构建过程的完整性。
.github/workflows/sync-components-types.yml (2)
29-33: 升级到actions/cache@v4时请确认 Runner 侧 Node 版本
actions/cache@v4运行于 Node 20。GitHub 托管的ubuntu-latestrunner 已符合要求,但如果后续迁移到自建 runner,需要保证 Node ≥ 20,否则所有缓存步骤会直接失败。
37-43:pnpm/action-setup@v4的run_install配置需再次核对v4 版本对
run_install的解析逻辑有调整(参数结构体校验更严格)。当前多行 YAML 字符串写法在 v3 可以正常解析,但在 v4 下如果字段顺序 / 缩进不符将导致run_install被忽略。建议在本分支跑一次完整 CI 以确认不会出现 “pnpm not found” 或缺依赖错误。.github/workflows/nodejs.yml (1)
65-68:pnpm/action-setup升级到 v4 ✔️与其它工作流保持一致,没发现兼容性问题。
.github/workflows/build-rust-binding.yml (1)
50-53: pnpm Setup 升级一致性 OK升级到 v4 与其它 workflow 对齐,无其他问题。
.github/workflows/publish.yml (1)
102-105: 升级到pnpm/action-setup@v4✔️与其他工作流保持一致,确认 CI 跑通即可。
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #17992 +/- ##
========================================
Coverage 54.98% 54.99%
========================================
Files 417 417
Lines 21693 21696 +3
Branches 5349 5348 -1
========================================
+ Hits 11928 11931 +3
- Misses 8088 8212 +124
+ Partials 1677 1553 -124
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
@yoyo837 这个没问题了吧? |
|
@yoyo837 这个也合一下? |
这个 PR 做了什么? (简要描述所做更改)
保留 #17895 除了 node 版本之外的其他更改
这个 PR 是什么类型? (至少选择一个)
这个 PR 涉及以下平台:
Summary by CodeRabbit
新功能
优化
依赖升级