generated from NaverPayDev/ts-monorepo-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
배경
현재 @naverpay/commithelper-go는 설치 시 postinstall 스크립트를 통해 Go 바이너리를 셋업합니다.
이 때문에 설치하는 프로젝트에서 다음과 같은 workaround가 필요합니다.
- pnpm
onlyBuiltDependencies에 명시적으로 등록해야 합니다 - CI에서는 빌드 스크립트 실행을 막기 위해
pnpm install --ignore-scripts를 써야 합니다
이는 모든 설치 프로젝트에서 반복되는 설정이며, CI 파이프라인을 더 복잡하게 만듭니다.
또한 postinstall 스크립트가 바이너리를 외부에서 수동으로 다운로드하는 방식이기 때문에, 사내 Nexus 환경에서는 해당 다운로드가 정상적으로 동작하지 않는 문제도 있습니다.
제안
esbuild, SWC, Rollup 등 현대 Node.js 도구들이 채택한 패턴처럼, 플랫폼별 바이너리를 별도 패키지로 분리합니다.
패키지 구조
@naverpay/commithelper-go # 메인 패키지 (optionalDependencies로 플랫폼 패키지 참조)
@naverpay/commithelper-go-linux-x64 # Linux x64 바이너리
@naverpay/commithelper-go-darwin-arm64 # macOS ARM64 바이너리 (Apple Silicon)
@naverpay/commithelper-go-darwin-x64 # macOS x64 바이너리 (Intel)
메인 패키지가 각 플랫폼 패키지를 optionalDependencies로 선언하면, pnpm/npm이 현재 환경에 맞는 패키지만 자동으로 선택해서 설치합니다.
기대 효과
- postinstall 스크립트 불필요 → 설치 프로젝트에서
onlyBuiltDependencies등록이 필요 없습니다 - CI 단순화 →
--ignore-scripts없이pnpm install --frozen-lockfile만으로 동작합니다 - Nexus 환경 지원 → 바이너리가 npm 패키지에 포함되어 있으므로 별도 다운로드 없이 Nexus를 통해 정상 설치됩니다
- 설치 속도 향상 → 바이너리가 패키지에 포함되어 있으므로 빌드/다운로드 과정이 없습니다
- 재현성 향상 → 패키지 버전만으로 바이너리 버전이 결정됩니다
참고
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels