feat: add npm distribution with platform-specific packages#7
Open
feat: add npm distribution with platform-specific packages#7
Conversation
Distribute the CoinGecko CLI via npm using the industry-standard platform-specific optional dependencies pattern (like esbuild/turbo). - @coingecko/cg umbrella package with JS bin wrapper - 6 platform packages: darwin/linux/win32 × arm64/x64 - Publish script with checksum verification, retry safety, and provenance - Smoke test runs npm pack + install + cg version before publishing - Release workflow updated with setup-node + npm publish step Users install with: npm install -g @coingecko/cg Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The npm/cg/ directory was excluded by the overly broad `cg` gitignore pattern. Changed to `/cg` to only match the root-level binary. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
jasonjul
reviewed
Mar 9, 2026
Collaborator
jasonjul
left a comment
There was a problem hiding this comment.
Its a public release so I'll try to be stricter.
-
Is the smoke-test supposed to only test for one arch? Github actions runner using runs-on: ubuntu-latest runs on x64 arch. I don't see any workflow matrix call over here.
-
Check with @czhc on the MIT license. We probably want a little bit of attribution.
Collaborator
Author
|
- Bump node engine requirement from >=16 to >=20 (LTS) - Remove shasum fallback, require sha256sum only - Add comment that provenance requires GitHub-hosted public runners Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
jasonjul
approved these changes
Mar 9, 2026
Collaborator
jasonjul
left a comment
There was a problem hiding this comment.
Ah alright, I totally missed that! I was only looking at the deltas.
So goreleaser will publish to the release page in this repo, and after that we will publish to npm, alright cool.
Just pending license discussion.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@coingecko/cgumbrella package + 6 platform packages (darwin/linux/win32×arm64/x64)checksums.txt, retry safety for partial failures, and--provenancefor supply-chain verificationnpm pack→ install →cg version) runs before publishing to catch packaging issues earlynpm install -g @coingecko/cgFork rehearsal results
End-to-end release flow verified in a personal fork under
@khooihongzhescope:0.0.1-test.3)npm install -g @khooihongzhe/cginstalls correct platform binarycg versionexecutes correctly through the npm wrapperKey findings:
--provenancerequires a public repo +id-token: writeworkflow permissionSetup required
NPM_TOKENsecret to GitHub repo (Classic Automation token from npmjs.com)@coingeckonpm org/scope existsTest plan
NPM_TOKENsecret is configured in production repo settingsnpm install -g @coingecko/cgworks on macOS, Linux, and Windowscg versionoutputs the correct version after npm install🤖 Generated with Claude Code