Skip to content

Latest commit

ย 

History

History
172 lines (117 loc) ยท 4.62 KB

File metadata and controls

172 lines (117 loc) ยท 4.62 KB

Releasing

How we version, tag, and publish packages in the claude-code-hooks monorepo.

Versioning

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.

Package Names

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.

Publishing a Package

  1. Bump the version in the target package's package.json:
cd packages/sound
npm version patch   # or minor / major
  1. 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
  1. Publish from the package directory:
cd packages/sound
npm publish --access public

For scoped packages:

cd packages/security
npm publish --access public
  1. Push tags:
git push && git push --tags

Tag Format

Tags 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

Pre-publish Checklist

  • npm install succeeds from root
  • npm audit --audit-level=low passes
  • Package files array in package.json only includes what's needed
  • README.md is up to date in the package directory
  • Version bump is correct (check semver)
  • All changes are committed

Internal Dependencies

@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.

Notes

  • We do not use a publish-all script โ€” each package is published independently.
  • The root package.json is private: true and is never published.
  • Prefer npm version over hand-editing package.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๋ฅผ ๋”ฐ๋ฆ…๋‹ˆ๋‹ค.

ํŒจํ‚ค์ง€ ๋ฐฐํฌ ๋ฐฉ๋ฒ•

  1. ๋Œ€์ƒ ํŒจํ‚ค์ง€์˜ package.json์—์„œ ๋ฒ„์ „์„ ์˜ฌ๋ฆฝ๋‹ˆ๋‹ค:
cd packages/sound
npm version patch   # ๋˜๋Š” minor / major
  1. ์ปค๋ฐ‹ํ•˜๊ณ  ํƒœ๊ทธํ•ฉ๋‹ˆ๋‹ค:
git add .
git commit -m "release: @claude-code-hooks/sound@0.2.6"
git tag @claude-code-hooks/sound@0.2.6
  1. ํŒจํ‚ค์ง€ ๋””๋ ‰ํ† ๋ฆฌ์—์„œ ๋ฐฐํฌํ•ฉ๋‹ˆ๋‹ค:
cd packages/sound
npm publish --access public

์Šค์ฝ”ํ”„ ํŒจํ‚ค์ง€์˜ ๊ฒฝ์šฐ:

cd packages/security
npm publish --access public
  1. ํƒœ๊ทธ๋ฅผ ํ‘ธ์‹œํ•ฉ๋‹ˆ๋‹ค:
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 ํƒœ๊ทธ๋„ ์ฒ˜๋ฆฌํ•ฉ๋‹ˆ๋‹ค.