Skip to content

Comments

chore: ci uses pnpm@10#2992

Merged
oasis-cloud merged 1 commit intojdf2e:feat_v3.xfrom
oasis-cloud:chore_ci_pnpm_version
Feb 14, 2025
Merged

chore: ci uses pnpm@10#2992
oasis-cloud merged 1 commit intojdf2e:feat_v3.xfrom
oasis-cloud:chore_ci_pnpm_version

Conversation

@oasis-cloud
Copy link
Collaborator

@oasis-cloud oasis-cloud commented Feb 14, 2025

Summary by CodeRabbit

  • Chores

    • 调整了内部流程,所有任务现统一使用特定版本的包管理器(pnpm 10版),以确保依赖安装和构建过程的稳定性。
    • 更新了依赖安装策略,采用严格的锁文件规则,提升整体构建一致性。
  • New Features

    • 新增项目配置要求,明确规定使用 pnpm 10.0.0 及以上版本,保证工具兼容和最佳使用体验。

@coderabbitai
Copy link

coderabbitai bot commented Feb 14, 2025

Walkthrough

这个拉取请求统一更新了多个 GitHub Actions 工作流文件和 package.json 中关于 pnpm 的安装配置。所有涉及 pnpm 安装的命令均由原先的不指定版本或版本 9 修改为安装特定版本 pnpm@10。同时,部分 release 工作流还调整了依赖安装参数(由 --no-frozen-lockfile 改为 --frozen-lockfile),以确保依赖安装时严格遵循锁文件约束。

Changes

文件路径 变更概要
.github/workflows/ci.yml, .github/workflows/cypress.yml,
.github/workflows/realease-tag.yml, .github/workflows/sync-h5.yml,
.github/workflows/sync-migrate.yml, .github/workflows/sync-taro.yml
将安装 pnpm 命令由 npm i -g pnpm 修改为 npm i -g pnpm@10
.github/workflows/release-beta.yml, .github/workflows/release.yml 将安装 pnpm 命令从版本 9 更新为 pnpm@10,并将依赖安装参数由 --no-frozen-lockfile 改为 --frozen-lockfile
package.json 添加 "engines": { "pnpm": ">=10.0.0" } 属性以指定 pnpm 的版本要求。

Possibly related PRs

Suggested reviewers

  • xiaoyatong
  • Alex-huxiyang

Poem

我是一只快乐的小兔子,
代码林中跳跃自如。
pnpm 版本定在十号,
工作流整装待发奔波。
锁定依赖稳如磐石,
CI 的田野闪着光芒。
欢庆更新,笑意满仓!


📜 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 6c89ee9 and 3dca1cb.

📒 Files selected for processing (9)
  • .github/workflows/ci.yml (3 hunks)
  • .github/workflows/cypress.yml (1 hunks)
  • .github/workflows/realease-tag.yml (1 hunks)
  • .github/workflows/release-beta.yml (2 hunks)
  • .github/workflows/release.yml (1 hunks)
  • .github/workflows/sync-h5.yml (1 hunks)
  • .github/workflows/sync-migrate.yml (1 hunks)
  • .github/workflows/sync-taro.yml (1 hunks)
  • package.json (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: build
  • GitHub Check: test
🔇 Additional comments (10)
.github/workflows/realease-tag.yml (1)

17-17: 更新已确认!

将 pnpm 版本固定为 10 可以提高构建的可重现性和稳定性。

.github/workflows/cypress.yml (1)

19-19: 更新已确认!

在 E2E 测试工作流中统一使用 pnpm@10 有助于确保测试环境的一致性。

.github/workflows/sync-h5.yml (1)

20-20: 更新已确认!

在文档同步工作流中使用 pnpm@10,保持了与其他工作流的版本一致性。

.github/workflows/sync-taro.yml (1)

20-20: 更新已确认!

在 Taro 文档同步工作流中使用 pnpm@10,确保了所有文档生成过程使用相同的包管理器版本。

.github/workflows/sync-migrate.yml (1)

21-21:

Details

❓ Verification inconclusive

更新已确认!建议验证 pnpm 版本兼容性

在迁移文档同步工作流中使用 pnpm@10 保持了版本一致性。建议验证 pnpm@10 与项目的其他依赖是否完全兼容。


🌐 Web query:

pnpm 10.0.0 与 9.x 版本有哪些重大变更?

💡 Result:

pnpm 10.0.0 引入了多项重大变更以提升安全性和功能效率,以下是主要更新内容:

核心安全改进

  1. 默认阻止依赖生命周期脚本执行

    • 安装时不再自动执行 preinstall/postinstall 等脚本
    • 需在 package.jsonpnpm.onlyBuiltDependencies 字段显式允许特定依赖构建(例如:{ "pnpm": { "onlyBuiltDependencies": ["fsevents"] } })[1][4][10]
  2. SHA256 哈希算法全面应用

    • 替换 MD5 用于目录哈希和锁文件校验
    • 提升安全性和哈希冲突防护能力[1][7]

命令行为变更

命令/功能 v9.x 行为 v10.x 新行为
pnpm link 需加 -g 全局链接 自动添加覆盖到根 package.json [1][7]
pnpm deploy 无限制 仅支持 inject-workspace-packages=true 的工作区 [1][7][10]
pnpm add --global pnpm 允许安装 禁止并提示改用 pnpm self-update [1][7]

存储结构优化

全局存储 v10 结构变化:
├── index/         (新增索引目录)
├── files/        → content-v2/
└── content-v2/    (采用差异文件记录机制)
  • 支持同一内容多包名/版本存储[1][10]
  • # 字符在 .pnpm 目录名中被转义[7]

其他重要更新

  • 新配置选项

    • verify-deps-before-run: 控制运行脚本前的依赖检查策略(install/warn/prompt/error)[1]
    • inject-workspace-packages: 硬链接替代符号链接本地依赖[1]
  • 性能优化

    • repeat installs 执行前快速检查机制[1]
    • side-effects 索引采用差异记录方式减少存储占用[1][10]

升级时需特别注意生命周期脚本白名单配置和全局存储迁移问题。建议通过 pnpm self-update 命令完成版本升级[3][6]。

Citations:


更新已确认!请进一步验证 pnpm@10 升级带来的兼容性风险

工作流中已将 pnpm 更新为 10 版,以保持版本一致性。请注意,pnpm 10.0.0 引入了如下重大变更,可能会影响依赖管理及构建流程:

  • 默认阻止依赖生命周期脚本(如 preinstall/postinstall)的自动执行,需要在 package.json 中通过 pnpm.onlyBuiltDependencies 显式允许部分依赖的构建。
  • 使用 SHA256 替换 MD5 进行目录哈希和锁文件校验,提升了安全性。
  • 命令行为发生改变,例如 pnpm link 和全局安装行为(pnpm add --global pnpm)与往常不同。
  • 全局存储结构的优化调整可能会对现有的缓存及依赖解析产生影响。

建议进一步确认这些变更是否与项目其他依赖及构建配置完全兼容,以确保升级不会引发潜在问题。

.github/workflows/release.yml (2)

19-19: 更新 pnpm 版本至 10.x

将 pnpm 版本固定为 10,有助于确保构建环境的一致性。


27-27: 使用 --frozen-lockfile 标志提高依赖安装的安全性

使用 --frozen-lockfile 确保了依赖版本的严格控制,防止意外的依赖更新。

.github/workflows/ci.yml (1)

19-19: CI 工作流中统一使用 pnpm@10

在所有 CI 作业(lint、test、build)中统一使用 pnpm 10 版本,确保了构建环境的一致性。

Also applies to: 38-38, 63-63

.github/workflows/release-beta.yml (1)

43-43: Beta 发布工作流采用相同的 pnpm 配置

与主发布工作流保持一致:

  • 使用 pnpm 10 版本
  • 采用 --frozen-lockfile 确保依赖版本锁定

Also applies to: 52-52

package.json (1)

47-49: 添加 pnpm 版本要求

在 package.json 中添加 engines 字段,明确指定需要 pnpm 10.0.0 或更高版本,这与 CI/CD 工作流的更改保持一致。


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ 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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @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.

@github-actions github-actions bot added 3.x Target branch 3.x action:review This PR needs more reviews (less than 2 approvals) and removed 3.x Target branch 3.x labels Feb 14, 2025
@codecov
Copy link

codecov bot commented Feb 14, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.79%. Comparing base (6c89ee9) to head (3dca1cb).
Report is 1 commits behind head on feat_v3.x.

Additional details and impacted files
@@            Coverage Diff             @@
##           feat_v3.x    #2992   +/-   ##
==========================================
  Coverage      85.79%   85.79%           
==========================================
  Files            281      281           
  Lines          18527    18527           
  Branches        2810     2810           
==========================================
  Hits           15896    15896           
  Misses          2626     2626           
  Partials           5        5           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@oasis-cloud oasis-cloud merged commit 0f5bac6 into jdf2e:feat_v3.x Feb 14, 2025
8 checks passed
oasis-cloud added a commit to oasis-cloud/nutui-react that referenced this pull request Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action:review This PR needs more reviews (less than 2 approvals) size/S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant