Skip to content

chore: publish oxc_napi_resolver #496

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

Merged
merged 1 commit into from
May 5, 2025
Merged

chore: publish oxc_napi_resolver #496

merged 1 commit into from
May 5, 2025

Conversation

Boshen
Copy link
Member

@Boshen Boshen commented May 5, 2025

closes #494

Summary by CodeRabbit

  • Chores
    • Updated the package version to 8.0.0.
    • Enabled publishing for the package.
    • Centralized package metadata configuration to streamline management across the workspace.

Copy link

coderabbitai bot commented May 5, 2025

Walkthrough

The changes restructure the Cargo.toml metadata by centralizing common package information under a [workspace.package] section and making individual package sections inherit these values using the .workspace = true syntax. Specifically, the napi/Cargo.toml file updates the package version from "0.0.0" to "8.0.0" and changes the publish flag from false to true, enabling the package for publication. No changes were made to dependencies, features, or exported Rust entities.

Changes

Files Change Summary
Cargo.toml Moved most package metadata fields into [workspace.package] and updated individual [package] sections to inherit metadata from workspace.
napi/Cargo.toml Updated version from "0.0.0" to "8.0.0", set publish = true, and configured metadata fields to inherit from workspace.

Assessment against linked issues

Objective Addressed Explanation
Enable publishing of oxc_resolver_napi (#494)

Poem

The version hops, the publish flag flips,
Now our crate is ready for registry trips!
With a twitch of my nose and a hop so spry,
"8.0.0" waves the old "0.0.0" goodbye.
🐇✨
Onward to crates.io, let’s give it a try!


📜 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 8ca31ee and 5f28703.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (2)
  • Cargo.toml (2 hunks)
  • napi/Cargo.toml (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • Cargo.toml
🚧 Files skipped from review as they are similar to previous changes (1)
  • napi/Cargo.toml

🪧 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.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in 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 generate unit testing code.
    • @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 pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file 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.

@Boshen Boshen changed the title chore: publish oxc_napi_resolver chore: publish oxc_napi_resolver May 5, 2025
Copy link

codspeed-hq bot commented May 5, 2025

CodSpeed Performance Report

Merging #496 will not alter performance

Comparing release (8ca31ee) with main (06b0636)

Summary

✅ 3 untouched benchmarks

Copy link

codecov bot commented May 5, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.85%. Comparing base (06b0636) to head (8ca31ee).
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #496   +/-   ##
=======================================
  Coverage   93.85%   93.85%           
=======================================
  Files          13       13           
  Lines        2797     2797           
=======================================
  Hits         2625     2625           
  Misses        172      172           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Boshen Boshen marked this pull request as ready for review May 5, 2025 03:29
napi/index.js Outdated
Comment on lines 374 to 380
if (!nativeBinding && globalThis.process?.versions?.["webcontainer"]) {
try {
nativeBinding = require('./webcontainer-fallback.js');
} catch (err) {
loadErrors.push(err)
}
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There appears to be a duplicate WebContainer detection block in the code. The same conditional check and fallback loading logic appears twice:

if (!nativeBinding && globalThis.process?.versions?.["webcontainer"]) {
  try {
    nativeBinding = require('./webcontainer-fallback.js');
  } catch (err) {
    loadErrors.push(err)
  }
}

This duplication will cause the code to attempt loading the same fallback module twice and potentially add the same error to loadErrors twice if loading fails. One of these blocks should be removed to prevent unintended behavior.

Spotted by Diamond

Is this helpful? React 👍 or 👎 to let us know.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6667579 and 0229ad3.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (2)
  • napi/Cargo.toml (1 hunks)
  • napi/index.js (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Test (windows-latest)
  • GitHub Check: Benchmark

@@ -1,8 +1,8 @@
[package]
name = "oxc_napi_resolver"
version = "0.0.0"
version = "8.0.0"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Confirm semantic version bump alignment.

Ensure that the version bump from "0.0.0" to "8.0.0" is reflected consistently across CHANGELOG, workspace manifests, CI configs, and documentation.

To verify no lingering references to the old version, you can run:


🏁 Script executed:

#!/bin/bash
# Check for any occurrences of the previous version in Cargo.toml files
rg -n 'version = "0\.0\.0"' -g '**/Cargo.toml'

Length of output: 84


Ensure consistent version bump across all Cargo.toml files

The fuzz/Cargo.toml still has:

  • fuzz/Cargo.toml:3
    - version = "0.0.0"
    + version = "8.0.0"

Please update that entry and double-check that the new version is reflected in:

  • CHANGELOG.md
  • Workspace manifest(s)
  • CI/CD configuration
  • Any documentation or examples

Committable suggestion skipped: line range outside the PR's diff.

edition = "2024"
publish = false
publish = true
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

❓ Verification inconclusive

Ensure crate metadata completeness before publishing.

Crates.io requires mandatory fields such as license, repository, and description. Verify that these are present in Cargo.toml to avoid publish failures or warnings.

You can check for the required metadata with:

If any are missing, add entries like:

license     = "MIT OR Apache-2.0"
repository  = "https://github.com/your-org/oxc_napi_resolver"
description = "N-API resolver bindings for OXC"

🏁 Script executed:

#!/bin/bash
# Check for required fields in Cargo.toml
rg -n '^license\s*=' napi/Cargo.toml
rg -n '^repository\s*=' napi/Cargo.toml
rg -n '^description\s*=' napi/Cargo.toml

Length of output: 123


Add missing crate metadata fields in napi/Cargo.toml before publishing

The license, repository, and description fields are currently absent, which will cause publish failures or warnings on crates.io. Please add them to ensure compliance with crates.io requirements.

Affected file:

  • napi/Cargo.toml

Suggested additions:

 [package]
 name        = "oxc_napi_resolver"
 version     = "0.1.0"
 publish     = true
+license     = "MIT OR Apache-2.0"
+repository  = "https://github.com/your-org/oxc_napi_resolver"
+description = "N-API resolver bindings for OXC"

Locations to verify/update:

  • Lines following publish = true in napi/Cargo.toml

napi/index.js Outdated
Comment on lines 374 to 380
if (!nativeBinding && globalThis.process?.versions?.["webcontainer"]) {
try {
nativeBinding = require('./webcontainer-fallback.js');
} catch (err) {
loadErrors.push(err)
}
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Remove redundant webcontainer fallback block.

The block at lines 374–380 is an exact duplicate of the fallback at lines 366–372. Keeping both causes unnecessary repetition and may push duplicate errors into loadErrors.

Apply this diff to remove the duplicate:

- if (!nativeBinding && globalThis.process?.versions?.["webcontainer"]) {
-   try {
-     nativeBinding = require('./webcontainer-fallback.js');
-   } catch (err) {
-     loadErrors.push(err)
-   }
- }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if (!nativeBinding && globalThis.process?.versions?.["webcontainer"]) {
try {
nativeBinding = require('./webcontainer-fallback.js');
} catch (err) {
loadErrors.push(err)
}
}

@Boshen Boshen merged commit cae2beb into main May 5, 2025
5 checks passed
@Boshen Boshen deleted the release branch May 5, 2025 14:55
This was referenced May 5, 2025
Boshen pushed a commit that referenced this pull request May 9, 2025
## 🤖 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_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](#501))

### <!-- 7 -->Chore

- add `--tsconfig` to example
([#505](#505))
- publish `oxc_napi_resolver`
([#496](#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](#423))
- [**breaking**] Rust Edition 2024
([#402](#402))
- expose `package_json_path`
([#376](#376))
- *(napi)* expose module type info in ResolveResult
([#223](#223))
- *(napi)* add tracing via `OXC_LOG:DEBUG`
([#202](#202))
- *(napi)* add async API
([#191](#191))
- add `imports_fields` option
([#138](#138))
- add more builder functions for options
([#110](#110))
- *(napi)* support wasi target
([#31](#31))
- add file_dependencies and missing_dependencies API
([#50](#50))
- *(napi)* expose cloneWithOptions and clearCache methods
([#40](#40))
- *(napi)* update the doc and type for tsconfig references
([#24](#24))
- *(napi)* add options
([#19](#19))
- *(resolver)* add tracing-subscriber feature
([#904](https://github.com/oxc-project/oxc-resolver/pull/904))
- *(resolver)* tsconfig project references
([#862](https://github.com/oxc-project/oxc-resolver/pull/862))
- *(resolver)* add thiserror
([#847](https://github.com/oxc-project/oxc-resolver/pull/847))
- *(resolver)* implement nested alias field
([#795](https://github.com/oxc-project/oxc-resolver/pull/795))
- *(resolver)* implement tsconfig-paths
([#750](https://github.com/oxc-project/oxc-resolver/pull/750))
- *(resolver)* implement configurable `exports_fields` option
([#733](https://github.com/oxc-project/oxc-resolver/pull/733))
- *(resolver)* implement `main_fields`
- *(resolver)* implement resolveToContext
([#694](https://github.com/oxc-project/oxc-resolver/pull/694))
- *(resolver)* implement restrictions (path only)
([#693](https://github.com/oxc-project/oxc-resolver/pull/693))
- *(resolver)* implement fully specified
([#687](https://github.com/oxc-project/oxc-resolver/pull/687))
- *(resolver)* imports field
([#681](https://github.com/oxc-project/oxc-resolver/pull/681))
- *(resolver)* finish most of exports field
([#674](https://github.com/oxc-project/oxc-resolver/pull/674))
- *(resolver)* port the rest of the exports field tests
([#659](https://github.com/oxc-project/oxc-resolver/pull/659))
- *(resolver)* implement symlinks
([#582](#582))
- *(resolver)* complete query and fragment parsing
([#579](#579))
- *(resolver)* add preferRelative and preferAbsolute
([#577](#577))
- *(resolver)* implement roots
([#576](#576))
- *(resolver)* implement fallback
([#572](#572))
- *(resolver)* implement enforceExtension
([#566](#566))
- *(resolver)* implement descriptionFiles option
([#565](#565))
- *(resolver)* implement the basics of path alias
([#564](#564))
- *(resolver)* accept different file system implementations
([#562](#562))
- *(resolver)* implement browser field
([#561](#561))
- *(resolver)* implement scoped packages
([#558](#558))
- *(resolver)* port incorrect description file test
([#557](#557))
- *(resolver)* implement extension_alias
([#556](#556))
- *(resolver)* port resolve tests
([#555](#555))
- *(resolver)* resolve extensions
([#549](#549))
- *(resolver)* add resolver test fixtures
([#542](#542))

### <!-- 1 -->Bug Fixes

- hash import does not need to load from node_modules
([#501](#501))
- *(napi)* `new ResolverFactory()` options should be optional
([#256](#256))
- *(napi)* update buggy NAPI-RS versions
([#225](#225))
- canonicalize is not supported on wasi target
([#124](#124))
- resolve "browser" field when "exports" is present
([#59](#59))

### <!-- 4 -->Refactor

- [**breaking**] remove `description_files` option
([#488](#488))
- [**breaking**] remove `modules` options
([#484](#484))
- vitest ([#380](#380))
- apply latest `cargo +nightly fmt`
([#281](#281))
- selectively parse package_json fields instead of parsing everything
([#103](#103))
- *(resolver)* clean up some code and tests
- *(resolver)* change internal funcs to non-pub by moving to unit tests
([#682](https://github.com/oxc-project/oxc-resolver/pull/682))

### <!-- 7 -->Chore

- publish `oxc_napi_resolver`
([#496](#496))
- *(napi)* make mimalloc optional to build
([#495](#495))
- *(README)* add wasm usage example
- *(README)* crates.io badge use recent downloads
- *(napi)* auto download wasm binding on webcontainer
([#471](#471))
- use root package.json for napi build
([#469](#469))
- *(deps)* update github-actions
([#444](#444))
- *(deps)* lock file maintenance npm packages
([#436](#436))
- bump napi
([#404](#404))
- *(deps)* lock file maintenance npm packages
([#391](#391))
- *(deps)* lock file maintenance rust crates
([#390](#390))
- *(README)* clarify Rust and node.js usages
- add dprint
([#326](#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](#213))
- *(napi)* remove tokio
([#212](#212))
- document directory is an absolute path for `resolve(directory,
specifier)`
([#206](#206))
- re-enable the wasi build
([#193](#193))
- use pnpm workspace
([#182](#182))
- *(deps)* update rust crates
([#176](#176))
- *(napi)* update NAPI-RS cli version and binding template
([#111](#111))
- update project github url
- *(deps)* update pnpm to v8.14.1
([#52](#52))
- *(deps)* update pnpm to v8.14.0
([#48](#48))
- *(deps)* update pnpm to v8.13.1
([#42](#42))
- remove FIXME comments
- *(napi)* align `*Fields` user options with enhanced-resolve
([#35](#35))
- *(deps)* update pnpm to v8.12.1
([#21](#21))
- add some doc for napi TsconfigOptions
([#20](#20))
- *(deps)* update pnpm to v8.12.0
([#18](#18))
- *(README)* adding debugging command from Rspack
- *(deps)* update pnpm to v8.11.0
([#9](#9))
- *(resolver)* remove tracing_subscriber
([#1362](https://github.com/oxc-project/oxc-resolver/pull/1362))
- *(resolver)* improve documentation
([#591](#591))

### <!-- 8 -->CI

- check for napi .d.index changes
([#491](#491))
- *(release-napi)* support `riscv64gc-unknown-linux-gnu` and
`s390x-unknown-linux-gnu`
([#451](#451))
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/release-plz/release-plz/).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

publish oxc_resolver_napi
1 participant
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy