@napi-rs/cli 3.10.0 → 3.10.2

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/docs/wasi.md CHANGED
@@ -336,6 +336,23 @@ Consumers that need deterministic cleanup before process exit should use the
336
336
  deferred loader and call its `dispose()` function, or the `dispose` returned by
337
337
  `createInstance()`.
338
338
 
339
+ Every termination goes through the emnapi thread manager
340
+ (`PThread.terminateWorker`) rather than a bare `worker.terminate()`. The manager
341
+ counts a worker exit as expected only for terminations it performed itself and
342
+ reports any other one as a worker failure — a throw that lands inside Node.js's
343
+ `exit` emit and strands the promise the termination depends on. The manager is
344
+ captured while the emnapi module is being created, before the wasm is loaded, so
345
+ it is reachable even from the initialization rollback — the one path where
346
+ instantiation never returned.
347
+
348
+ Disposal holds the event loop open with a timer of its own until the
349
+ terminations settle, so `await dispose()` resolves even as the last statement of
350
+ a script. The pool workers cannot do that themselves: they are unreferenced so
351
+ an idle binding never keeps a process alive, and emnapi unreferences them again
352
+ whenever one reports that its thread is ready. The timer is released the moment
353
+ the terminations settle, and a binding that is never disposed still does not
354
+ hold an idle process open.
355
+
339
356
  When type generation is disabled, the generated browser root exposes the
340
357
  binding as its default export. `napi new` also removes the template's
341
358
  `index.d.ts` and declaration metadata instead of publishing stale template
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@napi-rs/cli",
3
- "version": "3.10.0",
3
+ "version": "3.10.2",
4
4
  "description": "Cli tools for napi-rs",
5
5
  "author": "LongYinan <lynweklm@gmail.com>",
6
6
  "homepage": "https://napi.rs/",