bump-deps
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseBump Dependencies Skill
依赖版本更新Skill
Update Node.js dependencies using taze CLI with smart prompting: auto-apply MINOR/PATCH updates, prompt for MAJOR updates individually, skip fixed-version packages.
When package names are provided as arguments (e.g. ), scope all taze commands to only those packages using .
/bump-deps react typescript--include使用taze CLI结合智能提示更新Node.js依赖:自动应用MINOR/PATCH版本更新,针对MAJOR版本更新逐个提示用户,跳过固定版本的包。
当提供包名作为参数时(例如 ),使用参数将所有taze命令的作用范围限定为这些指定包。
/bump-deps react typescript--includePrerequisites
前置条件
Before starting, verify taze is installed by running:
bash
scripts/run-taze.shIf exit code is 1, stop and inform the user that taze must be installed:
- Global install:
npm install -g taze - One-time:
npx taze
开始操作前,运行以下命令验证taze是否已安装:
bash
scripts/run-taze.sh如果退出码为1,请停止操作并告知用户必须先安装taze:
- 全局安装:
npm install -g taze - 一次性使用:
npx taze
Update Workflow
更新流程
Step 1: Scan for Updates
步骤1:扫描可用更新
Run the taze script to discover available updates. The script auto-detects monorepo projects ( in package.json or ) and enables recursive mode automatically.
workspacespnpm-workspace.yamlbash
scripts/run-taze.sh运行taze脚本检测可用更新。该脚本会自动识别单仓库项目(package.json中的或文件)并自动启用递归模式。
workspacespnpm-workspace.yamlbash
scripts/run-taze.shStep 2: Parse and Categorize Updates
步骤2:解析并分类更新
From the taze output, categorize each package update:
| Category | Version Change | Action |
|---|---|---|
| Fixed | No | Skip entirely |
| PATCH | | Auto-apply |
| MINOR | | Auto-apply |
| MAJOR | | Prompt user |
If package arguments were provided, filter to only those packages.
Identifying fixed versions: In package.json, fixed versions have no range prefix:
- Fixed: → skip
"lodash": "4.17.21" - Ranged: → process
"lodash": "^4.17.21"
从taze的输出中,将每个包的更新分类:
| 分类 | 版本变更示例 | 操作方式 |
|---|---|---|
| 固定版本 | 无 | 完全跳过 |
| PATCH | | 自动应用 |
| MINOR | | 自动应用 |
| MAJOR | | 提示用户确认 |
如果提供了包参数,则仅筛选这些指定包的更新。
识别固定版本: 在package.json中,固定版本没有范围前缀:
- 固定版本:→ 跳过
"lodash": "4.17.21" - 范围版本:→ 处理更新
"lodash": "^4.17.21"
Step 3: Apply MINOR/PATCH Updates
步骤3:应用MINOR/PATCH版本更新
Apply all non-major updates automatically without prompting:
bash
undefined自动应用所有非主要版本更新,无需提示:
bash
undefinedAll packages
所有包
taze minor --write
taze minor --write
Specific packages only (when args provided)
仅指定包(当提供参数时)
taze minor --write --include react,typescript
The script auto-detects monorepo mode, but when running taze directly, detect it yourself: check for `workspaces` in package.json or `pnpm-workspace.yaml` and add `-r` if present.
Report the packages that were updated.taze minor --write --include react,typescript
脚本会自动检测单仓库模式,但直接运行taze时,需要自行检测:检查package.json中的`workspaces`或`pnpm-workspace.yaml`文件,如果存在则添加`-r`参数。
报告已更新的包。Step 4: Prompt for MAJOR Updates
步骤4:提示MAJOR版本更新
Auto-skip packages: Never prompt for these packages—auto-apply their major updates:
- (icon library with frequent major bumps, backward-compatible in practice)
lucide-react
For each remaining package with a major update available, use to ask the user individually:
AskUserQuestionPackage: <package-name>
Current: <current-version>
Available: <new-version>
Update to major version?Question format:
- header: Package name (max 12 chars, truncate if needed)
- options: "Yes, update" / "No, skip"
- multiSelect: false
Collect all approved major updates.
自动跳过的包: 以下包无需提示用户,直接应用其MAJOR版本更新:
- (图标库,频繁发布主要版本,但实际使用中向后兼容)
lucide-react
对于其余存在MAJOR版本更新的包,使用逐个询问用户:
AskUserQuestion包名:<package-name>
当前版本:<current-version>
可用版本:<new-version>
是否升级到主要版本?问题格式:
- 标题:包名(最多12个字符,过长则截断)
- 选项:“是,更新” / “否,跳过”
- 多选:否
收集所有用户确认的MAJOR版本更新。
Step 5: Apply Approved MAJOR Updates
步骤5:应用已确认的MAJOR版本更新
After collecting user approvals, apply the approved major updates:
bash
taze major --write --include <pkg1>,<pkg2>,<pkg3>Add if monorepo was detected.
-r收集用户的确认后,应用已批准的MAJOR版本更新:
bash
taze major --write --include <pkg1>,<pkg2>,<pkg3>如果检测到单仓库模式,添加参数。
-rStep 6: Update Bun Catalogs
步骤6:更新Bun版本目录
After applying all updates, check the root for Bun workspace catalogs. Bun monorepos can centralize dependency versions using and fields inside the object:
package.jsoncatalogcatalogsworkspacesjson
{
"workspaces": {
"packages": ["packages/*"],
"catalog": {
"react": "^19.0.0"
},
"catalogs": {
"testing": {
"jest": "^30.0.0"
}
}
}
}Workspace packages reference these with (default catalog) or (named catalog).
"react": "catalog:""jest": "catalog:testing"Skip this step if neither nor exists in the root .
workspaces.catalogworkspaces.catalogspackage.jsonFor each package that was updated in Steps 3/5:
- Check if it appears in — if so, update the version there
workspaces.catalog - Check each named catalog in — if the package appears, update the version there
workspaces.catalogs
Preserve the existing range prefix (, , or none) from the catalog entry. For example, if the catalog has and taze bumped react to , update the catalog to .
^~"react": "^19.0.0"19.1.0"react": "^19.1.0"Use to apply the version changes directly to the root .
Editpackage.json应用所有更新后,检查根目录下的中的Bun工作区目录。Bun单仓库可通过对象内的和字段集中管理依赖版本:
package.jsonworkspacescatalogcatalogsjson
{
"workspaces": {
"packages": ["packages/*"],
"catalog": {
"react": "^19.0.0"
},
"catalogs": {
"testing": {
"jest": "^30.0.0"
}
}
}
}工作区包通过(默认目录)或(命名目录)引用这些版本。
"react": "catalog:""jest": "catalog:testing"如果根目录中不存在或,则跳过此步骤。
package.jsonworkspaces.catalogworkspaces.catalogs对于步骤3/5中已更新的每个包:
- 检查是否存在于中——如果存在,更新其版本
workspaces.catalog - 检查每个命名目录——如果包存在,更新其版本
workspaces.catalogs
保留目录条目中现有的范围前缀(、或无)。例如,如果目录中有,而taze将react升级到,则将目录更新为。
^~"react": "^19.0.0"19.1.0"react": "^19.1.0"使用直接修改根目录中的版本。
Editpackage.jsonStep 7: Install Dependencies
步骤7:安装依赖
After all updates are applied, remind the user to run their package manager's install command:
bash
npm install应用所有更新后,提醒用户运行包管理器的安装命令:
bash
npm installor
或
pnpm install
pnpm install
or
或
bun install
bun install
or
或
yarn install
undefinedyarn install
undefinedTaze Output Interpretation
Taze输出解析
Taze displays updates grouped by type. Example output:
@types/node ^20.0.0 → ^22.0.0 (major)
typescript ^5.3.0 → ^5.4.0 (minor)
eslint ^8.56.0 → ^8.57.0 (patch)The rightmost column indicates update type (major/minor/patch).
Packages shown with that have no or are fixed versions—skip these entirely.
--include-locked^~Taze按更新类型分组显示更新。示例输出:
@types/node ^20.0.0 → ^22.0.0 (major)
typescript ^5.3.0 → ^5.4.0 (minor)
eslint ^8.56.0 → ^8.57.0 (patch)最右侧列表示更新类型(major/minor/patch)。
使用显示的无或前缀的包为固定版本——完全跳过这些包。
--include-locked^~Script Reference
脚本参考
| Script | Purpose |
|---|---|
| Run taze in non-interactive mode, check installation |
| 脚本 | 用途 |
|---|---|
| 以非交互模式运行taze,检查是否已安装 |
Important Notes
重要注意事项
- Fixed-version dependencies (no or
^) indicate intentional pinning—never modify these~ - MAJOR updates may contain breaking changes—always prompt the user
- MINOR/PATCH updates are backward-compatible by semver convention—safe to auto-apply
- The flag accepts comma-separated package names or regex patterns
--include - Monorepo detection is automatic—no flag needed
- Bun catalogs (/
workspaces.catalog) are the source of truth for workspace packages using theworkspaces.catalogsprotocol—always update catalog entries alongside regular depscatalog:
- 固定版本依赖(无或
^前缀)表示有意固定版本——切勿修改这些依赖~ - MAJOR版本更新可能包含破坏性变更——务必提示用户确认
- 根据语义化版本规范,MINOR/PATCH版本更新向后兼容——可安全自动应用
- 标志接受逗号分隔的包名或正则表达式
--include - 单仓库检测自动进行——无需添加标志
- Bun目录(/
workspaces.catalog)是使用workspaces.catalogs协议的工作区包的版本来源——更新常规依赖时务必同步更新目录条目catalog: