Repository navigation
chore: 包管理迁移到 pnpm - #32
Merged
Merged
Conversation
- 删除 package-lock.json,改用 pnpm-lock.yaml + pnpm-workspace.yaml - package.json 声明 packageManager: pnpm@12.3.4 - Rakefile 的 rake size 走 pnpm exec esbuild(原用 npx) - CI/release 加 pnpm/action-setup@v4,npm ci 改 pnpm install --frozen-lockfile - dependabot 补 npm ecosystem(否则 pnpm-lock 无人升级) - CONTRIBUTING 与 Rakefile 降级提示改为 pnpm install
同时指定 action 的 version: 12 与 package.json 的 packageManager: pnpm@12.3.4
会直接失败:
Error: Multiple versions of pnpm specified:
- version 12 in the GitHub Action config with the key "version"
- version pnpm@12.3.4 in the package.json with the key "packageManager"
删掉 version 输入,让 action 读 packageManager 字段取版本,单一来源。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
仓库根原用 npm(package-lock.json),仅 esbuild 一个 dev 依赖供
rake size体积守卫使用。按全仓统一策略迁移到 pnpm。改动
package-lock.json,改用pnpm-lock.yaml+pnpm-workspace.yamlpackage.json声明packageManager: pnpm@12.3.4Rakefile的rake size由npx --no-install esbuild改pnpm exec esbuild,降级提示文案同步改pnpm installci.ymlquality job)与release.yml加pnpm/action-setup@v4,npm ci改pnpm install --frozen-lockfiledependabot.yml补npmecosystem(此前缺失,否则 pnpm-lock 无人升级)CONTRIBUTING.md的开发环境步骤改pnpm installpnpm-workspace.yaml放行 esbuild 构建脚本(pnpm 12 默认不执行依赖构建脚本)验证
pnpm install --frozen-lockfile通过bundle exec rake size实测走通:pnpm exec esbuild正确调用,产物 gzip 123218 bytes(预算 300_000)