-
Notifications
You must be signed in to change notification settings - Fork 5
Add npm publishing support for dual JSR and npm distribution #237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add npm publishing support for dual JSR and npm distribution #237
Conversation
@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>
…loads Co-authored-by: takker99 <37929109+takker99@users.noreply.github.com>
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 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.jsonc
exports to npm package structure🚀 CI/CD Integration
DENO_TLS_CA_STORE=system
to all workflows to ensure reliable JSR package downloads📚 Documentation & Examples
jsr:@cosense/std
and@cosense/std
import stylesPackage Structure
The npm package maintains the same API surface as JSR:
All 23 export paths from the original
deno.jsonc
configuration are preserved, including unstable API modules.Setup Required
To enable npm publishing, add an
NPM_TOKEN
secret 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.