Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ const resolver = new ResolverFactory();
assert(resolver.sync(process.cwd(), './index.js').path, path.resolve('index.js'));
```

### Supports WASM

See https://stackblitz.com/edit/unrs-resolver for usage example.

### Rust

See [docs.rs/unrs_resolver](https://docs.rs/unrs_resolver/latest/unrs_resolver/).
Expand Down Expand Up @@ -220,14 +224,14 @@ See [index.d.ts](https://github.com/unrs/unrs-resolver/blob/main/napi/index.d.ts

## Debugging

The following environment variable emits tracing information for the `oxc_resolver::resolve` function.
The following environment variable emits tracing information for the `unrs_resolver::resolve` function.

e.g.

```
2024-06-11T07:12:20.003537Z DEBUG oxc_resolver: options: ResolveOptions { ... }, path: "...", specifier: "...", ret: "..."
at /path/to/oxc_resolver-1.8.1/src/lib.rs:212
in oxc_resolver::resolve with path: "...", specifier: "..."
2024-06-11T07:12:20.003537Z DEBUG unrs_resolver: options: ResolveOptions { ... }, path: "...", specifier: "...", ret: "..."
at /path/to/unrs_resolver-1.8.1/src/lib.rs:212
in unrs_resolver::resolve with path: "...", specifier: "..."
```

The input values are `options`, `path` and `specifier`, the returned value is `ret`.
Expand Down Expand Up @@ -255,11 +259,11 @@ Test cases are located in `./src/tests`, fixtures are located in `./tests`
- [x] extensions.test.js
- [x] fallback.test.js
- [x] fullSpecified.test.js
- [x] identifier.test.js (see unit test in `crates/oxc_resolver/src/request.rs`)
- [x] identifier.test.js (see unit test in `crates/unrs_resolver/src/request.rs`)
- [x] importsField.test.js
- [x] incorrect-description-file.test.js (need to add ctx.fileDependencies)
- [x] missing.test.js
- [x] path.test.js (see unit test in `crates/oxc_resolver/src/path.rs`)
- [x] path.test.js (see unit test in `crates/unrs_resolver/src/path.rs`)
- [ ] plugins.test.js
- [ ] pnp.test.js
- [x] resolve.test.js
Expand Down
4 changes: 2 additions & 2 deletions fuzz/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "resolver_fuzz"
version = "0.0.0"
edition = "2021"
edition = "2024"
publish = false

# Use independent workspace for fuzzers
Expand All @@ -20,4 +20,4 @@ bench = false

[dependencies]
libfuzzer-sys = "0.4.7"
oxc_resolver = { path = ".." }
unrs_resolver = { path = ".." }
2 changes: 1 addition & 1 deletion fuzz/fuzz_targets/resolver.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#![no_main]

use libfuzzer_sys::fuzz_target;
use oxc_resolver::Resolver;
use unrs_resolver::Resolver;

fuzz_target!(|data: &[u8]| {
if let Ok(s) = std::str::from_utf8(data) {
Expand Down
Loading