-
Notifications
You must be signed in to change notification settings - Fork 101
Publish to JSR alongside NPM #1841
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
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1841 +/- ##
=======================================
Coverage 99.01% 99.01%
=======================================
Files 18 18
Lines 1418 1418
Branches 299 299
=======================================
Hits 1404 1404
Misses 14 14 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
WalkthroughThe changes introduce support for publishing the package to JSR in addition to npm. This includes workflow adjustments for permissions and commands, a new npm script for JSR publishing, a script to generate Changes
Sequence Diagram(s)sequenceDiagram
participant Developer
participant GitHub Actions
participant npm Registry
participant JSR Registry
Developer->>GitHub Actions: Push release
GitHub Actions->>GitHub Actions: Install dependencies
GitHub Actions->>npm Registry: Publish package (npm publish)
GitHub Actions->>GitHub Actions: Run publish:jsr script
GitHub Actions->>GitHub Actions: Generate jsr.json
GitHub Actions->>JSR Registry: Publish package (jsr publish)
Assessment against linked issues
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (3)
package.json (1)
43-43: Ensure JSR CLI availability and version stability.The new
publish:jsrscript usesnpx jsr publish, but the project doesn't pin the JSR CLI version. To avoid unexpected breakage if the JSR tool updates, consider addingjsras a devDependency (with a fixed version) or specifying the version in thenpxinvocation (e.g.,npx [email protected] publish)..github/workflows/publish.yml (1)
31-33: Publish to JSR only on stable releases.You’re running
npm publish && yarn publish:jsronly whenprereleaseis false, which prevents beta tags from hitting JSR. If you intend to publish pre-releases to JSR as well, replicate the JSR step under the beta branch. Otherwise, this setup is correct.scripts/make-jsr-json.js (1)
18-18: Exclude unnecessary artifacts from JSR package.Filtering out
"dist"frompublish.includeis correct, but ensure that all required source files (e.g.,srcand any config/README) are present. If additional files (likeREADME.mdor LICENSE) are needed by JSR, add them to the include array.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting
📒 Files selected for processing (4)
.github/workflows/publish.yml(3 hunks).gitignore(1 hunks)package.json(1 hunks)scripts/make-jsr-json.js(1 hunks)
🔇 Additional comments (4)
.gitignore (1)
68-69: Correctly ignore the generated JSR manifest.Adding
jsr.jsonto.gitignoreprevents committing the generated configuration file. This aligns with the intended workflow and avoids repository clutter..github/workflows/publish.yml (2)
12-14: Set minimum permissions for JSR OIDC authentication.Granting
contents: readandid-token: writeis required for the JSR publication step to fetch the OIDC token. This properly scopes the job’s permissions.
27-27: Simplify dependency installation.Switching from
yarn installtoyarnis functionally identical and slightly more idiomatic for Yarn v1.scripts/make-jsr-json.js (1)
12-17: Verify export path transformation logic.Currently only the
"import"entry is mapped, dropping"require"and"default". Confirm that JSR accepts this minimal mapping, or extend the transformation to include other entrypoints if needed.
Pull Request
Let's try and publish to JSR as well.
jsr.jsonfrompackage.jsonpublish.yamlworkflow according to https://jsr.io/docs/publishing-packages#publishing-from-github-actionsTo do for @curquiza:
@meilisearch) and package (meilisearch) according to https://jsr.io/docs/publishing-packages#creating-a-scope-and-packageAnd that should be it. If any issues arise we can discuss it, or maybe I could get some access to this JSR scope and package, see what else we can properly set up there.
Related issue
Fixes #1792
PR checklist
Please check if your PR fulfills the following requirements:
Thank you so much for contributing to Meilisearch!
Summary by CodeRabbit
New Features
Chores