@nubjs/nub-win32-arm64 0.0.42 → 0.0.44

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/bin/nub.exe CHANGED
Binary file
package/bin/nubx.exe CHANGED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nubjs/nub-win32-arm64",
3
- "version": "0.0.42",
3
+ "version": "0.0.44",
4
4
  "description": "Nub binary for win32-arm64",
5
5
  "license": "MIT",
6
6
  "repository": "https://github.com/nubjs/nub",
Binary file
@@ -159,6 +159,44 @@ function installUserHookDetector() {
159
159
  try { module_.registerHooks = wrapped; } catch {}
160
160
  }
161
161
 
162
+ // ── Internal `module.register()` without the DEP0205 leak ────────────
163
+ // `module.register()` is the loader-WORKER registration surface (async ESM hooks in
164
+ // a dedicated thread). nub uses it for the compat tier (18.19–22.14, where the sync
165
+ // `module.registerHooks` doesn't exist) and for the fast tier's
166
+ // `--no-experimental-require-module` fallback (where `require(esm)` is off, so the
167
+ // in-thread sync hooks can't load transform-core.mjs synchronously). On Node 26+,
168
+ // `module.register()` emits a one-shot `[DEP0205]` DeprecationWarning steering callers
169
+ // to `module.registerHooks()` — but nub CANNOT use `registerHooks` on these paths
170
+ // (no sync surface on compat; no sync core load when require(esm) is disabled), and
171
+ // the deprecation is for nub's OWN internal call, not anything the user wrote: the
172
+ // user has no action to take, so the warning is pure noise on their stderr. Suppress
173
+ // exactly that DEP0205 emission for the duration of nub's own register() call, then
174
+ // restore `process.emitWarning` untouched, so a user's later `module.register()` (or
175
+ // any other deprecation) still warns normally. Default-preserving: only nub's
176
+ // internal call is silenced, only for DEP0205, only on the versions that emit it.
177
+ function registerLoaderWorker(specifier, parentURL, options) {
178
+ const realEmitWarning = process.emitWarning;
179
+ let restored = false;
180
+ const restore = () => {
181
+ if (restored) return;
182
+ restored = true;
183
+ try { process.emitWarning = realEmitWarning; } catch {}
184
+ };
185
+ try {
186
+ process.emitWarning = function (warning, ...rest) {
187
+ // Node calls emitWarning(msg, 'DeprecationWarning', 'DEP0205', ...) for the
188
+ // module.register() deprecation. Swallow only that exact code; pass everything
189
+ // else (including any non-DEP0205 deprecation) straight through.
190
+ const code = typeof rest[0] === "object" && rest[0] !== null ? rest[0].code : rest[1];
191
+ if (code === "DEP0205") return;
192
+ return realEmitWarning.call(this, warning, ...rest);
193
+ };
194
+ return module_.register(specifier, parentURL, options);
195
+ } finally {
196
+ restore();
197
+ }
198
+ }
199
+
162
200
  function makeHooks(core, watchReporting) {
163
201
  installUserHookDetector();
164
202
 
@@ -763,6 +801,7 @@ function reenableUserCompileCache() {
763
801
 
764
802
  module.exports = {
765
803
  installWatchReporting,
804
+ registerLoaderWorker,
766
805
  makeHooks,
767
806
  installCjsRequireHooks,
768
807
  preloadPolyfillPackages,
@@ -143,7 +143,11 @@ if (!requireEsmDisabled) {
143
143
  // through the registered loader-worker hooks. User require(esm) of THEIR own ES
144
144
  // modules still gets Node's native ERR_REQUIRE_ESM, exactly as the flag promises.
145
145
  const { pathToFileURL } = require("node:url");
146
- module_.register("./preload-async-hooks.mjs", pathToFileURL(__filename).href);
146
+ // Via the shared helper so Node 26+'s DEP0205 (steering to module.registerHooks) is
147
+ // not leaked onto the user's stderr — nub is forced onto module.register here
148
+ // because require(esm) is off, so registerHooks' in-thread sync core load is
149
+ // impossible; the user has no action to take. See registerLoaderWorker.
150
+ common.registerLoaderWorker("./preload-async-hooks.mjs", pathToFileURL(__filename).href);
147
151
 
148
152
  // Sync, non-require(esm) polyfills still install (none of them require(esm)).
149
153
  // Clobbered-polyfill packages are CJS requires, unaffected by the flag.
@@ -80,7 +80,11 @@ if (__isFastTier) {
80
80
  // Compat path: ESM `import` hooks run in a dedicated loader worker thread. That
81
81
  // worker resolves PnP deps via pnpapi.resolveRequest itself (preload-async-
82
82
  // hooks.mjs), so no Yarn `.pnp.loader.mjs` registration is needed here either.
83
- module.register("./preload-async-hooks.mjs", import.meta.url);
83
+ // Via the shared helper so any DEP0205 from nub's own register() call (Node 26+,
84
+ // if this compat path is ever reached there) is not leaked onto the user's stderr.
85
+ // On the compat tier proper (18.19–22.14) registerHooks doesn't exist, so the
86
+ // loader-worker is the only hook surface; the user has no action to take.
87
+ common.registerLoaderWorker("./preload-async-hooks.mjs", import.meta.url);
84
88
  // (The main-thread require() shim's module-format + decorator detection is a
85
89
  // synchronous native addon call now — no parser warm-up; the old
86
90
  // `await core.ensureParser()` for the ESM-only oxc-parser is gone.)
@@ -9,4 +9,4 @@
9
9
  // previously lived as a literal inside preload.mjs, which `make version` patched,
10
10
  // while the worker carried a hand-maintained "…-compat" copy that `make version`
11
11
  // never touched — a latent staleness bug this module closes.)
12
- export const NUB_VERSION = "0.0.42";
12
+ export const NUB_VERSION = "0.0.44";