chore: bump napi-postinstall to support yarn/pnpm on webcontainer#103
chore: bump napi-postinstall to support yarn/pnpm on webcontainer#103
napi-postinstall to support yarn/pnpm on webcontainer#103Conversation
WalkthroughThe changes update the release workflow and package manifests for a Node.js package. The release workflow now amends the Changes
Sequence Diagram(s)sequenceDiagram
participant ReleaseWorkflow
participant PackageJson
ReleaseWorkflow->>PackageJson: Update version field
ReleaseWorkflow->>PackageJson: Set scripts.postinstall to "napi-postinstall unrs-resolver <version> check"
PackageJson-->>ReleaseWorkflow: Updated package.json ready for release
Assessment against linked issues
Possibly related PRs
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
⏰ 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:
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 (
|
There was a problem hiding this comment.
Pull Request Overview
This PR updates the workflow to bump napi-postinstall, enabling support for yarn/pnpm on webcontainer environments.
- Updated the jq command in the release workflow to set a new postinstall script in npm/package.json.
Files not reviewed (3)
- npm/package.json: Language not supported
- package.json: Language not supported
- pnpm-lock.yaml: Language not supported
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
There was a problem hiding this comment.
Important
Looks good to me! 👍
Reviewed everything up to 724f0f7 in 1 minute and 13 seconds. Click for details.
- Reviewed
77lines of code in3files - Skipped
1files when reviewing. - Skipped posting
6draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. .github/workflows/release-plz.yml:50
- Draft comment:
Confirm jq string interpolation is correct. The filter uses "($version)" to inject the dynamic version; ensure it works as expected with numeric semver strings. - Reason this comment was not posted:
Confidence changes required:33%<= threshold50%None
2. npm/package.json:18
- Draft comment:
The static 'postinstall' script now embeds a specific version. Ensure that the workflow update (jq) synchronizes this with package.json version to avoid inconsistencies. - Reason this comment was not posted:
Confidence changes required:33%<= threshold50%None
3. package.json:16
- Draft comment:
Updated @types/node version looks fine. Verify all dependency bumps align with the webcontainer support requirements. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
4. .github/workflows/release-plz.yml:50
- Draft comment:
Consider verifying the jq string interpolation syntax; ensure that ($version) is properly quoted to avoid shell expansion issues. - Reason this comment was not posted:
Comment looked like it was already resolved.
5. npm/package.json:19
- Draft comment:
The postinstall script now embeds the version dynamically. Confirm that this update remains in sync with the release workflow updates. - Reason this comment was not posted:
Confidence changes required:20%<= threshold50%None
6. package.json:16
- Draft comment:
Minor bump of '@types/node' to ^22.15.2 appears safe; ensure all dependent packages maintain compatibility. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
Workflow ID: wflow_d9ZJe1O9JuWYxzXh
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
.github/workflows/release-plz.yml (1)
50-56: Limit staged changes to only npm/package.json
Usinggit add .may inadvertently stage unrelated files. To ensure only the intended manifest is amended, replace it with:git add npm/package.jsonThis change minimizes the risk of unintended side effects.
npm/package.json (1)
2-10: Consider specifying Node engine compatibility
Adding an"engines"field (for example,"engines": { "node": ">=14" }) can help consumers avoid installing on unsupported Node.js versions.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (3)
.github/workflows/release-plz.yml(1 hunks)npm/package.json(2 hunks)package.json(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: Codacy Static Code Analysis
- GitHub Check: zizmor
🔇 Additional comments (5)
package.json (1)
16-16: Approve bump of @types/node
The@types/nodedevDependency has been updated from^22.14.1to^22.15.2, keeping your type definitions in sync with upstream Node.js changes.npm/package.json (4)
4-10: Approve metadata reorganization andtypeaddition
Introducing"type": "commonjs"and promoting metadata fields (repository,homepage,author,funding,license) to the top enhances clarity and ensures correct module loading behavior.
18-20: Approvepostinstallscript update
The newpostinstallentry ("napi-postinstall unrs-resolver 1.7.0 check") aligns perfectly with your release workflow’s dynamic version injection.
21-23: Approvenapi-postinstalldependency bump
Upgrading to^0.2.0provides the necessary support for Yarn and PNPM in webcontainer environments, addressing the linked issue.
52-55: ApprovepublishConfig.registrynormalization
Removing the trailing slash from"https://registry.npmjs.org"is a non-breaking cleanup that matches npm’s standard URL format.
|
There was a problem hiding this comment.
Important
Looks good to me! 👍
Reviewed efee46e in 1 minute and 17 seconds. Click for details.
- Reviewed
77lines of code in3files - Skipped
1files when reviewing. - Skipped posting
6draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. .github/workflows/release-plz.yml:50
- Draft comment:
Check the jq interpolation: ensure that escaping ($version) inside the double quotes produces the correct script string. Consider testing edge cases. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 10% vs. threshold = 50% The comment suggests testing edge cases for jq interpolation, but this is a standard jq syntax pattern. The ($version) syntax is the correct way to interpolate variables in jq. The command is using --arg to safely pass the version variable. This is actually a well-formed jq command following best practices. Maybe there could be edge cases with version strings containing special characters that could cause issues with the script string? The version string comes from release-plz which generates standard semver versions, and jq's --arg handles escaping automatically. There's no real risk here. Delete the comment. The jq command is using correct syntax and best practices for variable interpolation.
2. npm/package.json:19
- Draft comment:
The postinstall script is hard-coded to a specific version. Verify that the workflow update effectively syncs the version to avoid mismatches in different environments. - Reason this comment was not posted:
Comment did not seem useful. Confidence is useful =0%<= threshold50%The comment is asking the PR author to verify that the workflow update syncs the version effectively, which is against the rules. It doesn't provide a specific suggestion or point out a clear issue with the code.
3. package.json:16
- Draft comment:
The bump for @types/node is fine; please ensure all dependent packages are compatible with the new version. - Reason this comment was not posted:
Confidence changes required:33%<= threshold50%None
4. .github/workflows/release-plz.yml:50
- Draft comment:
Verify jq interpolation syntax for dynamic version substitution. The string 'napi-postinstall unrs-resolver ($version) check' should correctly embed the version even if it contains special characters. - Reason this comment was not posted:
Comment did not seem useful. Confidence is useful =0%<= threshold50%This comment is asking the PR author to verify the jq interpolation syntax, which falls under asking the author to double-check or ensure something. This violates the rule against asking the author to confirm or verify their intention or correctness of the code.
5. npm/package.json:19
- Draft comment:
The postinstall script now hardcodes '1.7.0'. Consider using a dynamic reference (if supported) so it automatically matches the package version, reducing manual updates. - Reason this comment was not posted:
Confidence changes required:33%<= threshold50%None
6. package.json:16
- Draft comment:
The bump of '@types/node' to '^22.15.2' is appropriate. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
Workflow ID: wflow_T16HK6an9wPLjrZU
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
## 🤖 New release
* `oxc_resolver`: 8.0.0 -> 9.0.0 (⚠ API breaking changes)
* `oxc_napi_resolver`: 8.0.0
### ⚠ `oxc_resolver` breaking changes
```text
--- failure constructible_struct_adds_field: externally-constructible struct adds field ---
Description:
A pub struct constructible with a struct literal has a new pub field. Existing struct literals must be updated to include the new field.
ref: https://doc.rust-lang.org/reference/expressions/struct-expr.html
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.40.0/src/lints/constructible_struct_adds_field.ron
Failed in:
field ResolveOptions.modules in /tmp/.tmpTBvVad/oxc-resolver/src/options.rs:114
--- failure trait_method_added: pub trait method added ---
Description:
A non-sealed public trait added a new method without a default implementation, which breaks downstream implementations of the trait
ref: https://doc.rust-lang.org/cargo/reference/semver.html#trait-new-item-no-default
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.40.0/src/lints/trait_method_added.ron
Failed in:
trait method oxc_resolver::CachedPath::module_directory in file /tmp/.tmpTBvVad/oxc-resolver/src/cache.rs:69
trait method oxc_resolver::CachedPath::cached_node_modules in file /tmp/.tmpTBvVad/oxc-resolver/src/cache.rs:76
```
<details><summary><i><b>Changelog</b></i></summary><p>
## `oxc_resolver`
<blockquote>
##
[9.0.0](oxc-project/oxc-resolver@oxc_resolver-v8.0.0...oxc_resolver-v9.0.0)
- 2025-05-09
### <!-- 1 -->Bug Fixes
- hash import does not need to load from node_modules
([#501](oxc-project/oxc-resolver#501))
### <!-- 7 -->Chore
- add `--tsconfig` to example
([#505](oxc-project/oxc-resolver#505))
- publish `oxc_napi_resolver`
([#496](oxc-project/oxc-resolver#496))
</blockquote>
## `oxc_napi_resolver`
<blockquote>
##
[8.0.0](https://github.com/oxc-project/oxc-resolver/releases/tag/oxc_napi_resolver-v8.0.0)
- 2025-05-09
### <!-- 0 -->Features
- *(napi)* add mimalloc
([#423](oxc-project/oxc-resolver#423))
- [**breaking**] Rust Edition 2024
([#402](oxc-project/oxc-resolver#402))
- expose `package_json_path`
([#376](oxc-project/oxc-resolver#376))
- *(napi)* expose module type info in ResolveResult
([#223](oxc-project/oxc-resolver#223))
- *(napi)* add tracing via `OXC_LOG:DEBUG`
([#202](oxc-project/oxc-resolver#202))
- *(napi)* add async API
([#191](oxc-project/oxc-resolver#191))
- add `imports_fields` option
([#138](oxc-project/oxc-resolver#138))
- add more builder functions for options
([#110](oxc-project/oxc-resolver#110))
- *(napi)* support wasi target
([#31](oxc-project/oxc-resolver#31))
- add file_dependencies and missing_dependencies API
([#50](oxc-project/oxc-resolver#50))
- *(napi)* expose cloneWithOptions and clearCache methods
([#40](oxc-project/oxc-resolver#40))
- *(napi)* update the doc and type for tsconfig references
([#24](oxc-project/oxc-resolver#24))
- *(napi)* add options
([#19](oxc-project/oxc-resolver#19))
- *(resolver)* add tracing-subscriber feature
([#904](oxc-project/oxc-resolver#904))
- *(resolver)* tsconfig project references
([#862](oxc-project/oxc-resolver#862))
- *(resolver)* add thiserror
([#847](oxc-project/oxc-resolver#847))
- *(resolver)* implement nested alias field
([#795](oxc-project/oxc-resolver#795))
- *(resolver)* implement tsconfig-paths
([#750](oxc-project/oxc-resolver#750))
- *(resolver)* implement configurable `exports_fields` option
([#733](oxc-project/oxc-resolver#733))
- *(resolver)* implement `main_fields`
- *(resolver)* implement resolveToContext
([#694](oxc-project/oxc-resolver#694))
- *(resolver)* implement restrictions (path only)
([#693](oxc-project/oxc-resolver#693))
- *(resolver)* implement fully specified
([#687](oxc-project/oxc-resolver#687))
- *(resolver)* imports field
([#681](oxc-project/oxc-resolver#681))
- *(resolver)* finish most of exports field
([#674](oxc-project/oxc-resolver#674))
- *(resolver)* port the rest of the exports field tests
([#659](oxc-project/oxc-resolver#659))
- *(resolver)* implement symlinks
([#582](oxc-project/oxc-resolver#582))
- *(resolver)* complete query and fragment parsing
([#579](oxc-project/oxc-resolver#579))
- *(resolver)* add preferRelative and preferAbsolute
([#577](oxc-project/oxc-resolver#577))
- *(resolver)* implement roots
([#576](oxc-project/oxc-resolver#576))
- *(resolver)* implement fallback
([#572](oxc-project/oxc-resolver#572))
- *(resolver)* implement enforceExtension
([#566](oxc-project/oxc-resolver#566))
- *(resolver)* implement descriptionFiles option
([#565](oxc-project/oxc-resolver#565))
- *(resolver)* implement the basics of path alias
([#564](oxc-project/oxc-resolver#564))
- *(resolver)* accept different file system implementations
([#562](oxc-project/oxc-resolver#562))
- *(resolver)* implement browser field
([#561](oxc-project/oxc-resolver#561))
- *(resolver)* implement scoped packages
([#558](oxc-project/oxc-resolver#558))
- *(resolver)* port incorrect description file test
([#557](oxc-project/oxc-resolver#557))
- *(resolver)* implement extension_alias
([#556](oxc-project/oxc-resolver#556))
- *(resolver)* port resolve tests
([#555](oxc-project/oxc-resolver#555))
- *(resolver)* resolve extensions
([#549](oxc-project/oxc-resolver#549))
- *(resolver)* add resolver test fixtures
([#542](oxc-project/oxc-resolver#542))
### <!-- 1 -->Bug Fixes
- hash import does not need to load from node_modules
([#501](oxc-project/oxc-resolver#501))
- *(napi)* `new ResolverFactory()` options should be optional
([#256](oxc-project/oxc-resolver#256))
- *(napi)* update buggy NAPI-RS versions
([#225](oxc-project/oxc-resolver#225))
- canonicalize is not supported on wasi target
([#124](oxc-project/oxc-resolver#124))
- resolve "browser" field when "exports" is present
([#59](oxc-project/oxc-resolver#59))
### <!-- 4 -->Refactor
- [**breaking**] remove `description_files` option
([#488](oxc-project/oxc-resolver#488))
- [**breaking**] remove `modules` options
([#484](oxc-project/oxc-resolver#484))
- vitest ([#380](oxc-project/oxc-resolver#380))
- apply latest `cargo +nightly fmt`
([#281](oxc-project/oxc-resolver#281))
- selectively parse package_json fields instead of parsing everything
([#103](oxc-project/oxc-resolver#103))
- *(resolver)* clean up some code and tests
- *(resolver)* change internal funcs to non-pub by moving to unit tests
([#682](oxc-project/oxc-resolver#682))
### <!-- 7 -->Chore
- publish `oxc_napi_resolver`
([#496](oxc-project/oxc-resolver#496))
- *(napi)* make mimalloc optional to build
([#495](oxc-project/oxc-resolver#495))
- *(README)* add wasm usage example
- *(README)* crates.io badge use recent downloads
- *(napi)* auto download wasm binding on webcontainer
([#471](oxc-project/oxc-resolver#471))
- use root package.json for napi build
([#469](oxc-project/oxc-resolver#469))
- *(deps)* update github-actions
([#444](oxc-project/oxc-resolver#444))
- *(deps)* lock file maintenance npm packages
([#436](oxc-project/oxc-resolver#436))
- bump napi
([#404](oxc-project/oxc-resolver#404))
- *(deps)* lock file maintenance npm packages
([#391](oxc-project/oxc-resolver#391))
- *(deps)* lock file maintenance rust crates
([#390](oxc-project/oxc-resolver#390))
- *(README)* clarify Rust and node.js usages
- add dprint
([#326](oxc-project/oxc-resolver#326))
- *(deps)* update napi-rs to 3.0.0-alpha
- `cargo upgrade` && `pnpm upgrade`
- *(deps)* update napi-rs to 3.0.0-alpha
- update napi changes
- *(deps)* update rust crate napi-derive to 3.0.0-alpha
- *(deps)* update rust crate napi to 3.0.0-alpha
- *(deps)* update napi-rs to 2.16.8
- *(napi)* make napi binary smaller with minimal tracing features
([#213](oxc-project/oxc-resolver#213))
- *(napi)* remove tokio
([#212](oxc-project/oxc-resolver#212))
- document directory is an absolute path for `resolve(directory,
specifier)`
([#206](oxc-project/oxc-resolver#206))
- re-enable the wasi build
([#193](oxc-project/oxc-resolver#193))
- use pnpm workspace
([#182](oxc-project/oxc-resolver#182))
- *(deps)* update rust crates
([#176](oxc-project/oxc-resolver#176))
- *(napi)* update NAPI-RS cli version and binding template
([#111](oxc-project/oxc-resolver#111))
- update project github url
- *(deps)* update pnpm to v8.14.1
([#52](oxc-project/oxc-resolver#52))
- *(deps)* update pnpm to v8.14.0
([#48](oxc-project/oxc-resolver#48))
- *(deps)* update pnpm to v8.13.1
([#42](oxc-project/oxc-resolver#42))
- remove FIXME comments
- *(napi)* align `*Fields` user options with enhanced-resolve
([#35](oxc-project/oxc-resolver#35))
- *(deps)* update pnpm to v8.12.1
([#21](oxc-project/oxc-resolver#21))
- add some doc for napi TsconfigOptions
([#20](oxc-project/oxc-resolver#20))
- *(deps)* update pnpm to v8.12.0
([#18](oxc-project/oxc-resolver#18))
- *(README)* adding debugging command from Rspack
- *(deps)* update pnpm to v8.11.0
([#9](oxc-project/oxc-resolver#9))
- *(resolver)* remove tracing_subscriber
([#1362](https://github.com/oxc-project/oxc-resolver/pull/1362))
- *(resolver)* improve documentation
([#591](oxc-project/oxc-resolver#591))
### <!-- 8 -->CI
- check for napi .d.index changes
([#491](oxc-project/oxc-resolver#491))
- *(release-napi)* support `riscv64gc-unknown-linux-gnu` and
`s390x-unknown-linux-gnu`
([#451](oxc-project/oxc-resolver#451))
</blockquote>
</p></details>
---
This PR was generated with
[release-plz](https://github.com/release-plz/release-plz/).



close #101
Important
Upgrade
napi-postinstalland updatepostinstallscript for dynamic versioning, with metadata and workflow improvements.napi-postinstallto^0.2.1innpm/package.json.@types/nodeto^22.15.2inpackage.json.postinstallscript innpm/package.jsonto dynamically reference the current version.commonjsinnpm/package.json.repository,homepage,author, andfundingfields tonpm/package.json.release-plz.ymlto updatepostinstallscript with the current version during release.This description was created by
for efee46e. You can customize this summary. It will automatically update as commits are pushed.
Summary by CodeRabbit
napi-postinstalland@types/node.