Commits
Click on a commit to change the comparison range[autofix.ci] apply automated fixes15 days ago
by autofix-ci[bot] feat: enable file:// protocol support on all platforms
Enable ESM file:// protocol URL resolution on macOS and Linux, not just Windows.
Changes:
- Move `url` crate dependency from Windows-only to all platforms in Cargo.toml
- Remove `#[cfg(target_os = "windows")]` from `resolve_file_protocol` function
- Remove platform-specific `cfg_if` wrapper at call site
- Preserve URL query strings and fragments when converting file:// URLs to paths
All file-protocol tests now pass on macOS/Linux.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com> fix: add wasm32 support for file:// protocol code
Add conditional compilation to support wasm32 targets where `to_file_path()`
is not available. On wasm32, the file:// protocol resolver is a no-op that
returns the specifier unchanged, since WebAssembly has no filesystem access.
This fixes the build error:
```
error[E0599]: no method named `to_file_path` found for struct `Url`
```
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com> refactor: use cfg_if at call site for file:// protocol
Refactor to use cfg_if::cfg_if! macro at the call site instead of having
two separate function definitions. This matches the original pattern and
is more consistent with the rest of the codebase.
Changes:
- Wrap resolve_file_protocol call in cfg_if block
- Only compile/call on non-wasm32 targets
- Remove wasm32 stub function (no longer needed)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com> fix: address clippy warnings in resolve_file_protocol
Fix clippy warnings:
- Remove unnecessary reference in url::Url::parse call
- Use () instead of _ for explicit unit type in map_err
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com> test: skip file:// protocol tests for WASI/wasm32
Skip all file:// protocol tests when running with WASI_TEST=1 since the
file:// protocol code is excluded on wasm32 targets (no filesystem access).
Uses vitest's `test.skipIf(process.env.WASI_TEST)` to conditionally skip
all 9 tests in the file when running on WASI.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com> refactor: use describe.skipIf block for WASI tests
Refactor file:// protocol tests to use a single `describe.skipIf` block
instead of repeating `test.skipIf` on each individual test. This is
cleaner and groups all file:// protocol tests together.
Changes:
- Import `describe` from vitest
- Wrap all tests in `describe.skipIf(process.env.WASI_TEST)` block
- Simplify test names (remove "file:// protocol" prefix)
- Proper indentation for nested tests
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>