@napi-rs/cli 3.9.0 → 3.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -4
- package/dist/cli.js +10359 -8729
- package/dist/index.cjs +10381 -8751
- package/dist/index.d.cts +83 -16
- package/dist/index.d.ts +83 -16
- package/dist/index.js +10359 -8729
- package/docs/wasi.md +318 -4
- package/package.json +5 -6
- package/src/api/__tests__/__snapshots__/templates.spec.ts.md +4003 -53
- package/src/api/__tests__/__snapshots__/templates.spec.ts.snap +0 -0
- package/src/api/__tests__/build-regressions.spec.ts +210 -3
- package/src/api/__tests__/build.spec.ts +2333 -3
- package/src/api/__tests__/create-npm-dirs.spec.ts +105 -3
- package/src/api/__tests__/pre-publish.spec.ts +153 -1
- package/src/api/__tests__/templates.spec.ts +1309 -1
- package/src/api/build.ts +756 -30
- package/src/api/create-npm-dirs.ts +23 -10
- package/src/api/new.ts +13 -18
- package/src/api/pre-publish.ts +34 -11
- package/src/api/rename.ts +10 -21
- package/src/api/templates/binding-target.ts +176 -0
- package/src/api/templates/index.ts +1 -0
- package/src/api/templates/js-binding.ts +54 -10
- package/src/api/templates/load-wasi-template.ts +661 -58
- package/src/api/templates/wasi-worker-template.ts +36 -31
- package/src/commands/build.ts +1 -1
- package/src/utils/__tests__/__snapshots__/typegen.spec.ts.md +18 -28
- package/src/utils/__tests__/__snapshots__/typegen.spec.ts.snap +0 -0
- package/src/utils/__tests__/misc.spec.ts +4 -0
- package/src/utils/__tests__/reconciliation.spec.ts +676 -0
- package/src/utils/__tests__/serialize.spec.ts +55 -0
- package/src/utils/__tests__/target.spec.ts +221 -0
- package/src/utils/__tests__/typegen.spec.ts +115 -0
- package/src/utils/config.ts +50 -0
- package/src/utils/index.ts +1 -0
- package/src/utils/misc.ts +351 -79
- package/src/utils/serialize.ts +47 -0
- package/src/utils/target.ts +150 -1
- package/src/utils/typegen.ts +608 -42
package/README.md
CHANGED
|
@@ -56,10 +56,23 @@ runtime down while the environment can still call into JavaScript. A registered
|
|
|
56
56
|
`AsyncRuntime` backend quiesces there and its cancelled tasks reject their
|
|
57
57
|
promises; the built-in Tokio runtime only _starts_ draining, so with it a
|
|
58
58
|
promise whose task is still running can still be left pending. Settle in-flight
|
|
59
|
-
work before disposing if that matters.
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
59
|
+
work before disposing if that matters.
|
|
60
|
+
|
|
61
|
+
The same preparation runs on a direct `Context.destroy()`. `destroy()` disables
|
|
62
|
+
JavaScript calls before it runs its cleanup hooks, and the threadsafe function's
|
|
63
|
+
hook then drops whatever is still queued, so every generated loader shadows
|
|
64
|
+
`destroy` on the emnapi context it creates: an embedder, a test harness, or
|
|
65
|
+
emnapi's own `beforeExit` auto-destroy gets the barrier too, instead of silently
|
|
66
|
+
discarding the settlements. Prefer the dispose symbol when you can yield — only
|
|
67
|
+
`dispose()` waits for settlements queued from another thread. A `destroy()` that
|
|
68
|
+
re-enters from a promise hook while the barrier is still running is a no-op,
|
|
69
|
+
because the frame that started the barrier destroys the moment it returns; a
|
|
70
|
+
`dispose()` that re-enters the same way joins the disposal already running,
|
|
71
|
+
since its frame yields for the settlement drain before it destroys.
|
|
72
|
+
|
|
73
|
+
Concurrent calls share one promise, successful disposal is idempotent, and a
|
|
74
|
+
failed cleanup phase can be retried by calling the same function again. Do not
|
|
75
|
+
call addon exports after disposal completes.
|
|
63
76
|
|
|
64
77
|
See [WASI targets and loaders](./docs/wasi.md) for threaded, threadless,
|
|
65
78
|
browser, and workerd packaging behavior.
|