How we version, tag, and publish packages in the claude-code-hooks monorepo.
We follow Semantic Versioning (semver):
- MAJOR (
1.0.0โ2.0.0): breaking changes - MINOR (
0.1.0โ0.2.0): new features, backward-compatible - PATCH (
0.2.0โ0.2.1): bug fixes, backward-compatible
While packages are pre-1.0, minor bumps may include breaking changes. After 1.0, we follow strict semver.
| Directory | npm name | Published? |
|---|---|---|
packages/core |
@claude-code-hooks/core |
No (internal) |
packages/security |
@claude-code-hooks/security |
Yes |
packages/secrets |
@claude-code-hooks/secrets |
Yes |
packages/sound |
@claude-code-hooks/sound |
Yes |
@claude-code-hooks/core is a workspace dependency only โ not published to npm.
- Bump the version in the target package's
package.json:
cd packages/sound
npm version patch # or minor / major- Commit and tag:
git add .
git commit -m "release: @claude-code-hooks/sound@0.2.6"
git tag @claude-code-hooks/sound@0.2.6- Publish from the package directory:
cd packages/sound
npm publish --access publicFor scoped packages:
cd packages/security
npm publish --access public- Push tags:
git push && git push --tagsTags follow the pattern <package-name>@<version>:
@claude-code-hooks/sound@0.2.5
@claude-code-hooks/security@0.1.0
@claude-code-hooks/secrets@0.1.0
-
npm installsucceeds from root -
npm audit --audit-level=lowpasses - Package
filesarray inpackage.jsononly includes what's needed -
README.mdis up to date in the package directory - Version bump is correct (check semver)
- All changes are committed
@claude-code-hooks/core is referenced by exact version in consumer packages. When bumping core, also bump the dependency version in packages/security and packages/secrets.
- We do not use a publish-all script โ each package is published independently.
- The root
package.jsonisprivate: trueand is never published. - Prefer
npm versionover hand-editingpackage.jsonโ it handles the git tag too if you pass--git-tag-version.
claude-code-hooks ๋ชจ๋ ธ๋ ํฌ์์ ๋ฒ์ ๊ด๋ฆฌ, ํ๊ทธ, ํจํค์ง ๋ฐฐํฌ ๋ฐฉ๋ฒ์ ์ค๋ช ํฉ๋๋ค.
Semantic Versioning (semver)์ ๋ฐ๋ฆ ๋๋ค:
- MAJOR (
1.0.0โ2.0.0): ํธํ์ฑ์ ๊นจ๋ ๋ณ๊ฒฝ - MINOR (
0.1.0โ0.2.0): ์ ๊ธฐ๋ฅ, ํ์ ํธํ - PATCH (
0.2.0โ0.2.1): ๋ฒ๊ทธ ์์ , ํ์ ํธํ
1.0 ์ด์ ํจํค์ง์์๋ ๋ง์ด๋ ๋ฒํ์ ํธํ์ฑ์ ๊นจ๋ ๋ณ๊ฒฝ์ด ํฌํจ๋ ์ ์์ต๋๋ค. 1.0 ์ดํ์๋ ์๊ฒฉํ semver๋ฅผ ๋ฐ๋ฆ ๋๋ค.
- ๋์ ํจํค์ง์
package.json์์ ๋ฒ์ ์ ์ฌ๋ฆฝ๋๋ค:
cd packages/sound
npm version patch # ๋๋ minor / major- ์ปค๋ฐํ๊ณ ํ๊ทธํฉ๋๋ค:
git add .
git commit -m "release: @claude-code-hooks/sound@0.2.6"
git tag @claude-code-hooks/sound@0.2.6- ํจํค์ง ๋๋ ํ ๋ฆฌ์์ ๋ฐฐํฌํฉ๋๋ค:
cd packages/sound
npm publish --access public์ค์ฝํ ํจํค์ง์ ๊ฒฝ์ฐ:
cd packages/security
npm publish --access public- ํ๊ทธ๋ฅผ ํธ์ํฉ๋๋ค:
git push && git push --tagsํ๊ทธ๋ <ํจํค์ง์ด๋ฆ>@<๋ฒ์ > ํ์์ ๋ฐ๋ฆ
๋๋ค:
@claude-code-hooks/sound@0.2.5
@claude-code-hooks/security@0.1.0
@claude-code-hooks/secrets@0.1.0
- ๋ฃจํธ์์
npm install์ฑ๊ณต -
npm audit --audit-level=lowํต๊ณผ -
package.json์files๋ฐฐ์ด์ ํ์ํ ๊ฒ๋ง ํฌํจ - ํจํค์ง ๋๋ ํ ๋ฆฌ์
README.md๊ฐ ์ต์ ์ํ - ๋ฒ์ ๋ฒํ๊ฐ ์ฌ๋ฐ๋ฅธ์ง ํ์ธ (semver)
- ๋ชจ๋ ๋ณ๊ฒฝ ์ฌํญ์ด ์ปค๋ฐ๋จ
@claude-code-hooks/core๋ ์๋น์ ํจํค์ง์์ ์ ํํ ๋ฒ์ ์ผ๋ก ์ฐธ์กฐ๋ฉ๋๋ค. core๋ฅผ ๋ฒํํ ๋ packages/security์ packages/secrets์ ์์กด์ฑ ๋ฒ์ ๋ ํจ๊ป ์ฌ๋ ค์ผ ํฉ๋๋ค.
- "๋ชจ๋ ๋ฐฐํฌ" ์คํฌ๋ฆฝํธ๋ฅผ ์ฌ์ฉํ์ง ์์ต๋๋ค โ ๊ฐ ํจํค์ง๋ฅผ ๋ ๋ฆฝ์ ์ผ๋ก ๋ฐฐํฌํฉ๋๋ค.
- ๋ฃจํธ
package.json์private: true์ด๋ฉฐ ์ ๋ ๋ฐฐํฌ๋์ง ์์ต๋๋ค. package.json์ ์ง์ ํธ์งํ๋ ๊ฒ๋ณด๋คnpm version์ ์ ํธํฉ๋๋ค โ--git-tag-version์ ์ ๋ฌํ๋ฉด git ํ๊ทธ๋ ์ฒ๋ฆฌํฉ๋๋ค.