Add npm publishing support for dual JSR and npm distribution#237
Merged
Add npm publishing support for dual JSR and npm distribution#237
Conversation
Owner
|
@copilot ごめん、firewallの設定してなかった。今度はjsr.ioとかregistory.npmjs.orgにアクセスできると思う。あともしかしたらdenoでjsr packageをdownloadするとき、エラーになるかも。その場合は環境変数 |
…entation Co-authored-by: takker99 <37929109+takker99@users.noreply.github.com>
…cumentation Co-authored-by: takker99 <37929109+takker99@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] このpackageはjsrにpublishしているが、npmにpublishしてほしいと要望があったので、jsrとnpmの双方にpublishしようと思う。npmにpublishするための設定を入れて。github actionsをいじればいいと思う。��...
Add npm publishing support for dual JSR and npm distribution
Aug 9, 2025
…loads Co-authored-by: takker99 <37929109+takker99@users.noreply.github.com>
Contributor
Author
Thanks for updating the firewall settings! I've added I tested this locally and verified that JSR package downloads now work correctly and the npm build script completes successfully. This should resolve any potential connection issues during CI/CD runs. Commit: 4e2bee8 |
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.
This PR implements npm publishing capabilities to complement the existing JSR distribution, addressing the community request for npm availability.
Overview
The package is currently published to JSR (JavaScript Registry) but users have requested npm support for broader ecosystem compatibility. This implementation adds dual publishing while maintaining full backward compatibility with existing JSR users.
Key Changes
🔧 Build Infrastructure
dnt(Deno Node Transform) with a robust manual fallback for network issuesdeno.jsoncexports to npm package structure🚀 CI/CD Integration
DENO_TLS_CA_STORE=systemto all workflows to ensure reliable JSR package downloads📚 Documentation & Examples
jsr:@cosense/stdand@cosense/stdimport stylesPackage Structure
The npm package maintains the same API surface as JSR:
All 23 export paths from the original
deno.jsoncconfiguration are preserved, including unstable API modules.Setup Required
To enable npm publishing, add an
NPM_TOKENsecret to the repository with an automation token from npmjs.com. The package will be published as@cosense/std(matching the JSR name) when tags are pushed.Testing
Both build methods have been tested and successfully generate all modules with proper TypeScript definitions. The GitHub Actions workflow includes comprehensive testing to ensure both build methods work correctly in the CI environment.
This implementation provides a seamless experience for users regardless of their preferred package registry while maintaining the existing developer workflow.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.