Conversation
Add four platform packages that each contain the Go binary for their target OS/CPU combination: - @naverpay/commithelper-go-darwin-arm64 - @naverpay/commithelper-go-darwin-x64 - @naverpay/commithelper-go-linux-x64 - @naverpay/commithelper-go-win32-x64 Each package declares os/cpu fields so pnpm/npm installs only the matching package on each platform. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…endencies pattern - Remove postinstall script (no more curl download at install time) - Add optionalDependencies for each platform binary package - Update build scripts to output binaries into platform package dirs - Update bin/cli.js to resolve binary path via installed platform package - Remove scripts/ from published files Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Ensures @naverpay/commithelper-go and all platform binary packages always receive the same version bump together. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Binaries are now bundled inside platform npm packages, so there is no longer a need to upload assets to GitHub Releases after publish. - Remove release-asset.yaml workflow entirely - Remove upload-assets job and checkCommitHelperGo step from release.yaml - Remove SKIP_COMMIT_HELPER_POSTINSTALL env var from all workflows Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
✅ Changeset detectedLatest commit: 980fbc5
If no version change is needed, please add The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 packages
|
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
/canary-publish |
3 similar comments
|
/canary-publish |
|
/canary-publish |
|
/canary-publish |
Published Canary Packages |
|
/canary-publish |
Published Canary Packages |
npm publish does not preserve file permissions, so the Go binary may be installed without execute permission. chmod +x before spawn. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
/canary-publish |
Published Canary Packages |
Tests binary build and CLI execution on Linux, macOS, and Windows via GitHub Actions matrix strategy. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
스크립트는 따로 삭제안하시나염? 그 바이너리 다운받는거요! |
commithelper-go 성능 벤치마크 리포트TL;DR — 최적 구성lefthook + commithelper-go + # lefthook.yml (권장)
commit-msg:
commands:
commithelper:
run: node node_modules/@naverpay/commithelper-go/bin/cli.js {1}
npx/npm exec는 hook 안에서 쓰지 말고, 사용자가 수동 실행할 때만 쓰면 된다. 환경
1. CLI 단독 실행 비교hook runner를 제외하고, commithelper 자체의 실행 시간만 비교한다. 1-1. 바이너리 직접 실행 (Go vs Node.js)
1-2. 호출 방식별 오버헤드
핵심 발견:
1-3. 호출 방식 선택 가이드2. Hook Runner 비교 (husky vs lefthook)
3. End-to-End 비교 (실제 git commit)실제 git 저장소에서 커밋 시, hook이 commithelper를 실행하여 3-1. 4개 조합 비교
3-2. 시간 분해
4. 왜 lefthook + commithelper-go + node cli.js 직접 호출인가commit-helper(JS)는 실행될 때마다 V8 엔진 초기화, ESM 모듈 resolve, cosmiconfig + meow 등 의존성 로드까지 ~230ms가 소비된다. commithelper-go는 단일 Go 바이너리로 ~15ms에 동일한 작업을 수행한다. PR#67 구조에서는 4-2. husky → lefthookhusky는 4-3. npx/npm exec를 hook에서 쓰면 안 되는 이유
husky 방식에서는 hook script 안에서 lefthook에서 4-4. 플랫폼 바이너리 패키지 분리 (PR #67)기존에는
PR #67에서 플랫폼별 npm 패키지(
5. 수치 요약기존 방식 (husky + npx @latest + JS) vs 권장 방식 (lefthook + node cli.js → Go)
기존 방식 (husky + direct node JS) vs 권장 방식 비교
|
요렇게 하면 더 빠르다는거져?! devDeps로 들고 있어야곘넹 |
|
대추라잇,, 했는데 별 속도 차이가 안났다고 슬퍼하셨던 유정님이 생각나서 분석해보았습니다...! |
|
흑흑 npx 가 범인이구나 감사합니다 ㅠ_ㅠ (물론 gh release도..) |
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
기록용. 신규 패키지 릴리스 시, 첫 배포는 ENEEDAUTH를 받음 (토큰 기반이 아니라서)
해결방법이 두 가지 떠올랐는데
나중에 2번을 추가할지 검토 요망합니다. (저는 1번으로 해둠) |

Related Issue
Describe your changes
@naverpay/commithelper-go의 Go 바이너리 배포 방식을 postinstall + curl에서 optionalDependencies 기반 플랫폼별 npm 패키지로 전환합니다.선택한 방식:
optionalDependencies+ 플랫폼별 패키지esbuild, SWC, Rollup 등 주요 네이티브 바이너리 도구들이 채택한 패턴을 적용했습니다.
os/cpu필드를 통해 pnpm/npm이 현재 환경에 맞는 패키지만 자동 선택하여 설치합니다.cli.js가 런타임에require.resolve로 설치된 플랫폼 패키지를 찾아 바이너리를 실행합니다.fixed그룹으로 5개 패키지가 항상 동일 버전으로 릴리스됩니다.고려했던 대안: postinstall + curl (기존 방식)
기존에는
postinstall스크립트에서 GitHub Releases로부터 바이너리를curl로 다운로드하는 방식이었습니다.아래와 같은 이유로
optionalDependencies방식을 선택하게 되었습니다.onlyBuiltDependencies--ignore-scriptsCI알려진 한계
644로 설치되어 실행 권한이 없는 문제가 있었습니다.cli.js에서fs.chmodSync(binaryPath, 0o755)를 호출하여 실행 전 권한을 부여하는 방식으로 해결했습니다.주요 변경 파일
packages/commithelper-go/bin/cli.jsrequire.resolve로 플랫폼 패키지 탐색 + chmod 처리packages/commithelper-go/package.jsonpostinstall제거,optionalDependencies추가,private제거packages/commithelper-go-{platform}/.changeset/config.jsonfixed그룹 추가 (5개 패키지가 동일 버전으로 관리).github/workflows/test-commithelper-go.yamlTest plan
Request
os/cpu필드 적절성을 확인해 주시면 감사하겠습니다.cli.js의 바이너리 탐색 로직 (require.resolve→chmod→spawnSync) 리뷰 부탁드립니다.fixed그룹 설정이 릴리스 워크플로우와 잘 맞는지도 함께 확인 부탁드립니다.🤖 Generated with Claude Code