meilisearch-js
meilisearch-js copied to clipboard
Publish to JSR alongside NPM
Pull Request
Let's try and publish to JSR as well.
- add script that creates
jsr.jsonfrompackage.json - add necessary entries to
publish.yamlworkflow according to https://jsr.io/docs/publishing-packages#publishing-from-github-actions
To do for @curquiza:
- create a JSR account, then scope (
@meilisearch) and package (meilisearch) according to https://jsr.io/docs/publishing-packages#creating-a-scope-and-package - link package to GitHub repository from package settings in JSR, detailed here: https://jsr.io/docs/publishing-packages#publishing-from-github-actions
And 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:
- [x] Does this PR fix an existing issue, or have you listed the changes applied in the PR description (and why they are needed)?
- [x] Have you read the contributing guidelines?
- [x] Have you made sure that the title is accurate and descriptive of the changes?
Thank you so much for contributing to Meilisearch!
Summary by CodeRabbit
-
New Features
- Added support for publishing packages to JSR in addition to npm.
-
Chores
- Updated workflow and scripts to streamline the publishing process and permissions.
- Adjusted .gitignore to exclude JSR configuration files.
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 99.01%. Comparing base (
d8d2abe) to head (4137323).
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
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
- :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
Walkthrough
The 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 jsr.json, and an update to .gitignore to exclude the generated config file.
Changes
| File(s) | Change Summary |
|---|---|
| .github/workflows/publish.yml | Updated workflow: renamed, adjusted permissions, simplified install, added JSR publish step, and tweaked npm publish commands. |
| package.json | Added a publish:jsr script to generate jsr.json and run jsr publish via npx. |
| scripts/make-jsr-json.js | New script to generate jsr.json from package.json with transformed exports and included files. |
| .gitignore | Added jsr.json to ignored files. |
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
| Objective | Addressed | Explanation |
|---|---|---|
| Add support for publishing to JSR alongside npm (#1792) | ✅ | |
| Generate and ignore JSR-specific config files (#1792) | ✅ |
Poem
A hop and a skip, we publish anew,
Now npm and JSR both get their due!
With scripts and configs, the work is all done,
Our package can shine for everyone.
The burrow is tidy,.gitignorein place—
On multiple registries, we’ve set the pace!
🐇✨
📜 Recent review details
Configuration used: CodeRabbit UI Review profile: CHILL Plan: Pro
📥 Commits
Reviewing files that changed from the base of the PR and between 9f850fa69989fcfd2e246a06e45f913b9e5088de and 41373238d66cfa5a2d220d603d5d85d8099890cb.
📒 Files selected for processing (1)
package.json(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- package.json
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: integration-tests (Node.js 22)
- GitHub Check: integration-tests (Node.js 20)
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.
🪧 Tips
Chat
There are 3 ways to chat with CodeRabbit:
- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
I pushed a fix in commit <commit_id>, please review it.Explain this complex logic.Open a follow-up GitHub issue for this discussion.
- Files and specific lines of code (under the "Files changed" tab): Tag
@coderabbitaiin a new review comment at the desired location with your query. Examples:@coderabbitai explain this code block.@coderabbitai modularize this function.
- PR comments: Tag
@coderabbitaiin a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.@coderabbitai read src/utils.ts and explain its main purpose.@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.@coderabbitai help me debug CodeRabbit configuration file.
Support
Need 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)
@coderabbitai pauseto pause the reviews on a PR.@coderabbitai resumeto resume the paused reviews.@coderabbitai reviewto trigger an incremental review. This is useful when automatic reviews are disabled for the repository.@coderabbitai full reviewto do a full review from scratch and review all the files again.@coderabbitai summaryto regenerate the summary of the PR.@coderabbitai generate docstringsto generate docstrings for this PR.@coderabbitai generate sequence diagramto generate a sequence diagram of the changes in this PR.@coderabbitai resolveresolve all the CodeRabbit review comments.@coderabbitai configurationto show the current CodeRabbit configuration for the repository.@coderabbitai helpto get help.
Other keywords and placeholders
- Add
@coderabbitai ignoreanywhere in the PR description to prevent this PR from being reviewed. - Add
@coderabbitai summaryto generate the high-level summary at a specific location in the PR description. - Add
@coderabbitaianywhere in the PR title to generate the title automatically.
CodeRabbit Configuration File (.coderabbit.yaml)
- You can programmatically configure CodeRabbit by adding a
.coderabbit.yamlfile to the root of your repository. - Please see the configuration documentation for more information.
- If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation:
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
Documentation and Community
- Visit our Documentation for detailed information on how to use CodeRabbit.
- Join our Discord Community to get help, request features, and share feedback.
- Follow us on X/Twitter for updates and announcements.
@coderabbitai review
✅ Actions performed
Review triggered.
Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.