release

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Release

发布

End-to-end release workflow for vercel-plugin.
vercel-plugin的端到端发布工作流。

Workflow

工作流

1. Pre-flight checks

1. 发布前检查

Run all gates in parallel:
bash
bun run typecheck          # tsc --noEmit on hooks/src
bun test                   # all test files
bun run validate           # skill frontmatter + manifest integrity
Stop if any gate fails. Fix issues before proceeding.
并行运行所有门禁检查:
bash
bun run typecheck          # tsc --noEmit on hooks/src
bun test                   # all test files
bun run validate           # skill frontmatter + manifest integrity
任意门禁检查不通过则停止流程。 先修复问题再继续。

2. Determine version bump

2. 确定版本升级幅度

Read the current version from
.plugin/plugin.json
. Ask the user which semver component to bump if not specified:
BumpWhen
patchBug fixes, test/fixture updates, docs
minorNew skills, new hooks, new features
majorBreaking changes to hook API or skill map
Default to patch if the user says "release" without specifying.
.plugin/plugin.json
读取当前版本。如果未指定升级类型,询问用户需要升级semver的哪个部分:
升级类型适用场景
patchBug修复、测试/用例更新、文档优化
minor新增skill、新增hook、新增功能
majorHook API或skill映射出现不兼容变更
如果用户只说"release"没有指定版本类型,默认升级patch版本。

3. Bump version

3. 升级版本

Update the
version
field in
.plugin/plugin.json
. This is the only version source of truth.
更新
.plugin/plugin.json
中的
version
字段,这是唯一的版本可信来源。

4. Rebuild generated artifacts

4. 重新构建生成产物

bash
bun run build              # hooks (tsup) + manifest
This compiles
hooks/src/*.mts
hooks/*.mjs
and regenerates
generated/skill-manifest.json
.
bash
bun run build              # hooks (tsup) + manifest
该命令会将
hooks/src/*.mts
编译为
hooks/*.mjs
,并重新生成
generated/skill-manifest.json

5. Stage, commit, and push

5. 暂存、提交并推送

bash
git add -A
git commit -m "<summary>; bump to <new-version>"
git push
Commit message style: match existing convention — descriptive summary followed by
; bump to X.Y.Z
(see git log for examples).
The pre-commit hook will re-run typecheck and recompile hooks automatically. If it fails, fix the issue and create a new commit (never amend).
bash
git add -A
git commit -m "<summary>; bump to <new-version>"
git push
提交信息格式:遵循现有规范 — 描述性摘要后跟上
; bump to X.Y.Z
(可参考git日志中的示例)。
pre-commit钩子会自动重新执行类型检查和hook编译。如果执行失败,修复问题后创建新的提交(不要执行amend操作)。

Version source of truth

版本可信来源

.plugin/plugin.json
— the
version
field. There is no
package.json
version to sync.
.plugin/plugin.json
version
字段。不需要同步
package.json
中的版本。

Checklist (copy into your reasoning)

检查清单(可复制到你的推理过程中)

  • typecheck passes
  • tests pass
  • validate passes
  • .plugin/plugin.json
    version bumped
  • bun run build
    succeeded
  • commit includes all changes
  • pushed to main
  • 类型检查通过
  • 测试通过
  • 验证通过
  • .plugin/plugin.json
    版本已升级
  • bun run build
    执行成功
  • 提交包含所有变更
  • 已推送到main分支