bump-deps

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Bump 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.
/bump-deps react typescript
), scope all taze commands to only those packages using
--include
.
使用taze CLI结合智能提示更新Node.js依赖:自动应用MINOR/PATCH版本更新,针对MAJOR版本更新逐个提示用户,跳过固定版本的包。
当提供包名作为参数时(例如
/bump-deps react typescript
),使用
--include
参数将所有taze命令的作用范围限定为这些指定包。

Prerequisites

前置条件

Before starting, verify taze is installed by running:
bash
scripts/run-taze.sh
If 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 (
workspaces
in package.json or
pnpm-workspace.yaml
) and enables recursive mode automatically.
bash
scripts/run-taze.sh
运行taze脚本检测可用更新。该脚本会自动识别单仓库项目(package.json中的
workspaces
pnpm-workspace.yaml
文件)并自动启用递归模式。
bash
scripts/run-taze.sh

Step 2: Parse and Categorize Updates

步骤2:解析并分类更新

From the taze output, categorize each package update:
CategoryVersion ChangeAction
FixedNo
^
or
~
prefix (e.g.,
"1.0.0"
)
Skip entirely
PATCH
x.y.z
x.y.Z
(e.g.,
1.0.0
1.0.1
)
Auto-apply
MINOR
x.y.z
x.Y.0
(e.g.,
1.0.0
1.1.0
)
Auto-apply
MAJOR
x.y.z
X.0.0
(e.g.,
1.0.0
2.0.0
)
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:
    "lodash": "4.17.21"
    → skip
  • Ranged:
    "lodash": "^4.17.21"
    → process
从taze的输出中,将每个包的更新分类:
分类版本变更示例操作方式
固定版本
^
~
前缀(例如
"1.0.0"
完全跳过
PATCH
x.y.z
x.y.Z
(例如
1.0.0
1.0.1
自动应用
MINOR
x.y.z
x.Y.0
(例如
1.0.0
1.1.0
自动应用
MAJOR
x.y.z
X.0.0
(例如
1.0.0
2.0.0
提示用户确认
如果提供了包参数,则仅筛选这些指定包的更新。
识别固定版本: 在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
undefined

All 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:
  • lucide-react
    (icon library with frequent major bumps, backward-compatible in practice)
For each remaining package with a major update available, use
AskUserQuestion
to ask the user individually:
Package: <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
-r
if monorepo was detected.
收集用户的确认后,应用已批准的MAJOR版本更新:
bash
taze major --write --include <pkg1>,<pkg2>,<pkg3>
如果检测到单仓库模式,添加
-r
参数。

Step 6: Update Bun Catalogs

步骤6:更新Bun版本目录

After applying all updates, check the root
package.json
for Bun workspace catalogs. Bun monorepos can centralize dependency versions using
catalog
and
catalogs
fields inside the
workspaces
object:
json
{
  "workspaces": {
    "packages": ["packages/*"],
    "catalog": {
      "react": "^19.0.0"
    },
    "catalogs": {
      "testing": {
        "jest": "^30.0.0"
      }
    }
  }
}
Workspace packages reference these with
"react": "catalog:"
(default catalog) or
"jest": "catalog:testing"
(named catalog).
Skip this step if neither
workspaces.catalog
nor
workspaces.catalogs
exists in the root
package.json
.
For each package that was updated in Steps 3/5:
  1. Check if it appears in
    workspaces.catalog
    — if so, update the version there
  2. Check each named catalog in
    workspaces.catalogs
    — if the package appears, update the version there
Preserve the existing range prefix (
^
,
~
, or none) from the catalog entry. For example, if the catalog has
"react": "^19.0.0"
and taze bumped react to
19.1.0
, update the catalog to
"react": "^19.1.0"
.
Use
Edit
to apply the version changes directly to the root
package.json
.
应用所有更新后,检查根目录下的
package.json
中的Bun工作区目录。Bun单仓库可通过
workspaces
对象内的
catalog
catalogs
字段集中管理依赖版本:
json
{
  "workspaces": {
    "packages": ["packages/*"],
    "catalog": {
      "react": "^19.0.0"
    },
    "catalogs": {
      "testing": {
        "jest": "^30.0.0"
      }
    }
  }
}
工作区包通过
"react": "catalog:"
(默认目录)或
"jest": "catalog:testing"
(命名目录)引用这些版本。
如果根目录
package.json
中不存在
workspaces.catalog
workspaces.catalogs
,则跳过此步骤。
对于步骤3/5中已更新的每个包:
  1. 检查是否存在于
    workspaces.catalog
    中——如果存在,更新其版本
  2. 检查每个命名目录
    workspaces.catalogs
    ——如果包存在,更新其版本
保留目录条目中现有的范围前缀(
^
~
或无)。例如,如果目录中有
"react": "^19.0.0"
,而taze将react升级到
19.1.0
,则将目录更新为
"react": "^19.1.0"
使用
Edit
直接修改根目录
package.json
中的版本。

Step 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 install

or

pnpm install
pnpm install

or

bun install
bun install

or

yarn install
undefined
yarn install
undefined

Taze 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
--include-locked
that have no
^
or
~
are fixed versions—skip these entirely.
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

脚本参考

ScriptPurpose
scripts/run-taze.sh
Run taze in non-interactive mode, check installation
脚本用途
scripts/run-taze.sh
以非交互模式运行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
    --include
    flag accepts comma-separated package names or regex patterns
  • Monorepo detection is automatic—no flag needed
  • Bun catalogs (
    workspaces.catalog
    /
    workspaces.catalogs
    ) are the source of truth for workspace packages using the
    catalog:
    protocol—always update catalog entries alongside regular deps
  • 固定版本依赖(无
    ^
    ~
    前缀)表示有意固定版本——切勿修改这些依赖
  • MAJOR版本更新可能包含破坏性变更——务必提示用户确认
  • 根据语义化版本规范,MINOR/PATCH版本更新向后兼容——可安全自动应用
  • --include
    标志接受逗号分隔的包名或正则表达式
  • 单仓库检测自动进行——无需添加标志
  • Bun目录(
    workspaces.catalog
    /
    workspaces.catalogs
    )是使用
    catalog:
    协议的工作区包的版本来源——更新常规依赖时务必同步更新目录条目