fix(napi): replace panics with error returns to prevent WASM traps
Convert `panic!()` and `unwrap()` calls in the NAPI binding layer to
proper `napi::Result` error returns. This prevents unrecoverable WASM
`unreachable` traps when invalid options are provided, particularly in
WebContainer/WASI environments where `panic = "abort"`.
- Change `From` impls to `TryFrom` for `Restriction` and `TsconfigOptions`
- Update `ResolverFactory::new` and `clone_with_options` to return `napi::Result`
- Replace `unwrap()` with `unwrap_or_default()` in tracing init
- Bump minimum napi version from 3 to 3.8
Closes #635
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
fix(dts): add .json fallback for json extension substitution
Match TypeScript's `tryAddingExtensions` behavior for `.json` imports:
after trying `.d.json.ts`, also try the `.json` extension itself. Without
this, `import "./data.json"` would only find `./data.d.json.ts` and miss
the actual `./data.json` file.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>