mirror of
https://github.com/hanzoai/unrs-resolver.git
synced 2026-09-24 17:03:52 +00:00
This PR contains the following updates: | Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Adoption](https://docs.renovatebot.com/merge-confidence/) | [Passing](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) | Type | Update | |---|---|---|---|---|---|---|---| | [@napi-rs/cli](https://napi.rs/) ([source](https://redirect.github.com/napi-rs/napi-rs)) | [`3.5.1` → `3.6.1`](https://renovatebot.com/diffs/npm/@napi-rs%2fcli/3.5.1/3.6.1) |  |  |  |  | devDependencies | minor | | [napi](https://redirect.github.com/napi-rs/napi-rs) | `3.8.3` → `3.8.4` |  |  |  |  | dependencies | patch | | [napi-derive](https://redirect.github.com/napi-rs/napi-rs) | `3.5.2` → `3.5.3` |  |  |  |  | dependencies | patch | --- ### Release Notes <details> <summary>napi-rs/napi-rs (@​napi-rs/cli)</summary> ### [`v3.6.1`](https://redirect.github.com/napi-rs/napi-rs/compare/@napi-rs/[email protected]...@napi-rs/[email protected]) [Compare Source](https://redirect.github.com/napi-rs/napi-rs/compare/@napi-rs/[email protected]...@napi-rs/[email protected]) ### [`v3.6.0`](https://redirect.github.com/napi-rs/napi-rs/compare/@napi-rs/[email protected]...@napi-rs/[email protected]) [Compare Source](https://redirect.github.com/napi-rs/napi-rs/compare/@napi-rs/[email protected]...@napi-rs/[email protected]) </details> --- ### Configuration 📅 **Schedule**: (in timezone Asia/Shanghai) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://redirect.github.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/oxc-project/oxc-resolver). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My45NC4xIiwidXBkYXRlZEluVmVyIjoiNDMuMTEwLjIiLCJ0YXJnZXRCcmFuY2giOiJtYWluIiwibGFiZWxzIjpbXX0=--> --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Boshen <[email protected]> Co-authored-by: Hanzo Dev <[email protected]>
44 lines
1.0 KiB
JavaScript
44 lines
1.0 KiB
JavaScript
import { instantiateNapiModuleSync, MessageHandler, WASI, createFsProxy } from '@napi-rs/wasm-runtime'
|
|
import { memfsExported as __memfsExported } from '@napi-rs/wasm-runtime/fs'
|
|
|
|
const fs = createFsProxy(__memfsExported)
|
|
|
|
const errorOutputs = []
|
|
|
|
const handler = new MessageHandler({
|
|
onLoad({ wasmModule, wasmMemory }) {
|
|
const wasi = new WASI({
|
|
fs,
|
|
preopens: {
|
|
'/': '/',
|
|
},
|
|
print: function () {
|
|
// eslint-disable-next-line no-console
|
|
console.log.apply(console, arguments)
|
|
},
|
|
printErr: function() {
|
|
// eslint-disable-next-line no-console
|
|
console.error.apply(console, arguments)
|
|
|
|
},
|
|
})
|
|
return instantiateNapiModuleSync(wasmModule, {
|
|
childThread: true,
|
|
wasi,
|
|
overwriteImports(importObject) {
|
|
importObject.env = {
|
|
...importObject.env,
|
|
...importObject.napi,
|
|
...importObject.emnapi,
|
|
memory: wasmMemory,
|
|
}
|
|
},
|
|
})
|
|
},
|
|
|
|
})
|
|
|
|
globalThis.onmessage = function (e) {
|
|
handler.handle(e)
|
|
}
|