Skip to content

fix(npm): add npm to cg update methods, normalize repository.url#29

Merged
khooihzhz merged 1 commit into
mainfrom
hz-fix-npm-update-repo-url
May 14, 2026
Merged

fix(npm): add npm to cg update methods, normalize repository.url#29
khooihzhz merged 1 commit into
mainfrom
hz-fix-npm-update-repo-url

Conversation

@khooihzhz
Copy link
Copy Markdown
Collaborator

Summary

  • cg update now detects npm installs (executable path under node_modules/@coingecko/cg-) and runs npm install -g @coingecko/cg@latest. Previously it fell through to the script branch and curl-installed a second cg binary to /usr/local/bin/, shadowing the npm copy.
  • Reordered detection so npm runs before homebrew: Homebrew-installed Node puts npm globals under /opt/homebrew/lib/node_modules/, which would otherwise match the homebrew rule.
  • Added git+ prefix to repository.url in all 7 npm/*/package.json templates. Silences the npm warn publish "repository.url" was normalized to ... warning seen on every release (e.g. run 25838686514).
  • Documented npm distribution + cg update method ordering in CLAUDE.md and the npm method override in README.

Test plan

  • make test (added TestClassifyInstallPath_Npm covering macOS/Linux/Homebrew-Node/Windows paths; updated TestDetectInstallMethod_ReturnsValidMethod to include npm)
  • make lint
  • After merge, tag a new release and verify the npm publish step no longer prints repository.url was normalized warnings
  • Verify cg update on a node_modules-installed binary runs npm install -g @coingecko/cg@latest instead of install.sh

- cg update now detects npm installs (path contains node_modules/@coingecko/cg-) and runs `npm install -g @coingecko/cg@latest`. npm check runs before homebrew so Homebrew-installed Node doesn't misclassify.
- Add git+ prefix to repository.url in all 7 npm/*/package.json templates so npm stops auto-correcting on publish.
- Document npm distribution + cg update method ordering in CLAUDE.md.
@khooihzhz khooihzhz requested a review from a team May 14, 2026 03:00
@khooihzhz khooihzhz merged commit bb54714 into main May 14, 2026
3 checks passed
@khooihzhz khooihzhz deleted the hz-fix-npm-update-repo-url branch May 14, 2026 03:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants