一键导入
version-bump
Bump the package version across all versioned filenames, imports, READMEs, HTML files, and package.json exports in the Cahir project.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Bump the package version across all versioned filenames, imports, READMEs, HTML files, and package.json exports in the Cahir project.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | version-bump |
| description | Bump the package version across all versioned filenames, imports, READMEs, HTML files, and package.json exports in the Cahir project. |
This skill handles version bumping across the Cahir project — a task that involves renaming ~19 versioned files, updating ~18 files with version strings in their content, rebuilding dist/, and syncing static/js/ copies.
Use this skill when:
npm publishThe project uses version-stamped filenames for better CDN UX (e.g., simple-chat.0.0.10.es.js). On each version bump, all these filenames and internal references must be updated consistently.
A companion bash script handles this automatically:
scripts/version-bump.sh
Always preview what will happen before making changes:
bash scripts/version-bump.sh <NEW_VERSION> --dry-run
This walks through ALL phases showing exactly what would happen — backup targets, npm version changes, mini-diffs for every content change (line-by-line before→after), file renames, build, and static sync — without modifying anything.
bash scripts/version-bump.sh <NEW_VERSION>
The script will:
package.jsonfind and grep)olderVersions/ (skip with --no-backup)npm version <NEW> --no-git-tag-version to update package.json version field + package-lock.jsonsed -i replace old version → new version in file contents (export paths, imports, READMEs, etc.) + git add. package-lock.json is never touched by sed.git mv all versioned filenames to new version (or mv + git add for untracked)npm run build to regenerate dist/ files (aborts on failure)static/js/ + clean up old copiesgit diff --staged
git commit -m "chore: bump version to <NEW_VERSION>"
git tag v<NEW_VERSION> # optional
npm publish
dist/ — 6 files (also regenerated by npm run build):
cahir.<VERSION>.evergreen.es.jscahir.<VERSION>.evergreen.es.min.jscahir.<VERSION>.evergreen.umd.cjscahir.<VERSION>.evergreen.umd.jscahir.<VERSION>.evergreen.umd.min.cjscahir.<VERSION>.evergreen.umd.min.jscollections/DOM/ — 3 files:
ch.<VERSION>.cjsch.<VERSION>.es.jsch.<VERSION>.jscomponents/*/ — 2 files per component (.es.js + .js):
<component-name>.<VERSION>.es.js<component-name>.<VERSION>.jsstatic/js/ — 2 files (copies for GitHub Pages):
cahir.<VERSION>.evergreen.umd.jsch.<VERSION>.jspackage.json — version field (via npm version) + exports paths (via sed)README.md — CDN URLs and file referencesindex.html — script src tagscomponents/examples/index.html — script src tagscomponents/*/README.md — CDN URLs in each component's docscollections/DOM/ch.es.js + ch.<VERSION>.es.js — import pathscomponents/*/*.es.js + *.<VERSION>.es.js — import paths.cjs files — no version strings inside.js component files (e.g., simple-chat.js) — no version strings insiderollup.config.evergreen.js — reads version from env dynamicallyCHANGELOG.md — excluded from automated replacement (update manually)package-lock.json — managed by npm version, never touched by sedsrc/ — source files rebuilt via npm run build using npm_package_version env vardebug/ — not committed (in .gitignore)When a new component is added under components/:
Follow the existing naming convention:
components/<componentName>/<component-name>.<VERSION>.es.jscomponents/<componentName>/<component-name>.<VERSION>.jscomponents/<componentName>/<component-name>.es.js (versionless copy)components/<componentName>/<component-name>.js (versionless copy)The .es.js files should import from ../../collections/DOM/ch.<VERSION>.es.js
Add the component to package.json exports:
"./components/<componentName>": {
"browser": "./components/<componentName>/<component-name>.<VERSION>.js",
"import": "./components/<componentName>/<component-name>.<VERSION>.es.js"
}
Add the component script tag to components/examples/index.html
The bash script will automatically discover the new component on the next version bump — no script changes needed, as it uses find and grep to dynamically locate versioned files.
| Flag | Description |
|---|---|
--dry-run | Walk through all phases showing exactly what would change (mini-diffs, renames, etc.) without modifying anything |
--yes or -y | Skip confirmation prompt (for CI/automation) |
--no-backup | Skip the pre-change backup to olderVersions/ |
olderVersions/backup-{VERSION}-{TIMESTAMP}/ before changesgit mv for better rename tracking (smaller diffs)git add) for commitnpm run build failsCHANGELOG.md from automated replacement and content discovery (update manually)src/, debug/, olderVersions/ from scanninggit check-ignore (second pass on top of manual exclusions)grep calls use -F (fixed-string mode) so dots in version strings are literal, not regex wildcardssed escapes dots in version strings for regex safety (0.0.10 → 0\.0\.10)