@nubjs/nub-win32-arm64 0.0.14 → 0.0.16

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.
Files changed (76) hide show
  1. package/bin/nub.exe +0 -0
  2. package/package.json +1 -1
  3. package/runtime/addons/nub-native.node +0 -0
  4. package/runtime/preload-async-hooks.mjs +5 -6
  5. package/runtime/preload.cjs +10 -6
  6. package/runtime/preload.mjs +22 -11
  7. package/runtime/transform-core.mjs +183 -521
  8. package/runtime/version.mjs +1 -1
  9. package/runtime/worker-polyfill.mjs +15 -2
  10. package/runtime/node_modules/@oxc-parser/binding-win32-arm64-msvc/README.md +0 -3
  11. package/runtime/node_modules/@oxc-parser/binding-win32-arm64-msvc/package.json +0 -39
  12. package/runtime/node_modules/@oxc-parser/binding-win32-arm64-msvc/parser.win32-arm64-msvc.node +0 -0
  13. package/runtime/node_modules/@oxc-parser/binding-win32-x64-msvc/README.md +0 -3
  14. package/runtime/node_modules/@oxc-parser/binding-win32-x64-msvc/package.json +0 -39
  15. package/runtime/node_modules/@oxc-parser/binding-win32-x64-msvc/parser.win32-x64-msvc.node +0 -0
  16. package/runtime/node_modules/@oxc-project/types/LICENSE +0 -22
  17. package/runtime/node_modules/@oxc-project/types/README.md +0 -3
  18. package/runtime/node_modules/@oxc-project/types/package.json +0 -26
  19. package/runtime/node_modules/@oxc-project/types/types.d.ts +0 -1912
  20. package/runtime/node_modules/@oxc-transform/binding-win32-arm64-msvc/README.md +0 -3
  21. package/runtime/node_modules/@oxc-transform/binding-win32-arm64-msvc/package.json +0 -41
  22. package/runtime/node_modules/@oxc-transform/binding-win32-arm64-msvc/transform.win32-arm64-msvc.node +0 -0
  23. package/runtime/node_modules/@oxc-transform/binding-win32-x64-msvc/README.md +0 -3
  24. package/runtime/node_modules/@oxc-transform/binding-win32-x64-msvc/package.json +0 -41
  25. package/runtime/node_modules/@oxc-transform/binding-win32-x64-msvc/transform.win32-x64-msvc.node +0 -0
  26. package/runtime/node_modules/get-tsconfig/LICENSE +0 -21
  27. package/runtime/node_modules/get-tsconfig/README.md +0 -268
  28. package/runtime/node_modules/get-tsconfig/dist/index.cjs +0 -7
  29. package/runtime/node_modules/get-tsconfig/dist/index.d.cts +0 -2116
  30. package/runtime/node_modules/get-tsconfig/dist/index.d.mts +0 -2116
  31. package/runtime/node_modules/get-tsconfig/dist/index.mjs +0 -7
  32. package/runtime/node_modules/get-tsconfig/package.json +0 -46
  33. package/runtime/node_modules/oxc-parser/LICENSE +0 -22
  34. package/runtime/node_modules/oxc-parser/README.md +0 -167
  35. package/runtime/node_modules/oxc-parser/package.json +0 -153
  36. package/runtime/node_modules/oxc-parser/src-js/bindings.js +0 -601
  37. package/runtime/node_modules/oxc-parser/src-js/generated/constants.js +0 -105
  38. package/runtime/node_modules/oxc-parser/src-js/generated/deserialize/js.js +0 -5862
  39. package/runtime/node_modules/oxc-parser/src-js/generated/deserialize/js_range.js +0 -6403
  40. package/runtime/node_modules/oxc-parser/src-js/generated/deserialize/ts.js +0 -6154
  41. package/runtime/node_modules/oxc-parser/src-js/generated/deserialize/ts_range.js +0 -6723
  42. package/runtime/node_modules/oxc-parser/src-js/generated/lazy/constructors.js +0 -13875
  43. package/runtime/node_modules/oxc-parser/src-js/generated/lazy/type_ids.js +0 -191
  44. package/runtime/node_modules/oxc-parser/src-js/generated/lazy/walk.js +0 -5810
  45. package/runtime/node_modules/oxc-parser/src-js/generated/visit/keys.js +0 -220
  46. package/runtime/node_modules/oxc-parser/src-js/generated/visit/type_ids.js +0 -177
  47. package/runtime/node_modules/oxc-parser/src-js/generated/visit/visitor.d.ts +0 -387
  48. package/runtime/node_modules/oxc-parser/src-js/generated/visit/walk.js +0 -2455
  49. package/runtime/node_modules/oxc-parser/src-js/index.d.ts +0 -312
  50. package/runtime/node_modules/oxc-parser/src-js/index.js +0 -108
  51. package/runtime/node_modules/oxc-parser/src-js/raw-transfer/common.js +0 -301
  52. package/runtime/node_modules/oxc-parser/src-js/raw-transfer/eager.js +0 -255
  53. package/runtime/node_modules/oxc-parser/src-js/raw-transfer/lazy-common.js +0 -11
  54. package/runtime/node_modules/oxc-parser/src-js/raw-transfer/lazy.js +0 -162
  55. package/runtime/node_modules/oxc-parser/src-js/raw-transfer/node-array.js +0 -365
  56. package/runtime/node_modules/oxc-parser/src-js/raw-transfer/supported.js +0 -52
  57. package/runtime/node_modules/oxc-parser/src-js/raw-transfer/visitor.js +0 -127
  58. package/runtime/node_modules/oxc-parser/src-js/visit/index.js +0 -41
  59. package/runtime/node_modules/oxc-parser/src-js/visit/visitor.js +0 -405
  60. package/runtime/node_modules/oxc-parser/src-js/wasm.js +0 -13
  61. package/runtime/node_modules/oxc-parser/src-js/webcontainer-fallback.cjs +0 -21
  62. package/runtime/node_modules/oxc-parser/src-js/wrap.js +0 -57
  63. package/runtime/node_modules/oxc-transform/LICENSE +0 -22
  64. package/runtime/node_modules/oxc-transform/README.md +0 -84
  65. package/runtime/node_modules/oxc-transform/browser.js +0 -1
  66. package/runtime/node_modules/oxc-transform/index.d.ts +0 -658
  67. package/runtime/node_modules/oxc-transform/index.js +0 -598
  68. package/runtime/node_modules/oxc-transform/package.json +0 -114
  69. package/runtime/node_modules/oxc-transform/webcontainer-fallback.cjs +0 -21
  70. package/runtime/node_modules/resolve-pkg-maps/LICENSE +0 -21
  71. package/runtime/node_modules/resolve-pkg-maps/README.md +0 -216
  72. package/runtime/node_modules/resolve-pkg-maps/dist/index.cjs +0 -1
  73. package/runtime/node_modules/resolve-pkg-maps/dist/index.d.cts +0 -11
  74. package/runtime/node_modules/resolve-pkg-maps/dist/index.d.mts +0 -11
  75. package/runtime/node_modules/resolve-pkg-maps/dist/index.mjs +0 -1
  76. package/runtime/node_modules/resolve-pkg-maps/package.json +0 -42
package/bin/nub.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.14",
3
+ "version": "0.0.16",
4
4
  "description": "Nub binary for win32-arm64",
5
5
  "license": "MIT",
6
6
  "repository": "https://github.com/nub-js/nub",
Binary file
@@ -19,7 +19,7 @@
19
19
 
20
20
  import {
21
21
  TRANSPILE_EXTS, DATA_EXTS,
22
- extname, resolveSpec, loadTranspile, loadData, ensureParser,
22
+ extname, resolveSpec, loadTranspile, loadData,
23
23
  } from "./transform-core.mjs";
24
24
 
25
25
  // Node calls this once per worker when the main thread invokes
@@ -38,11 +38,10 @@ export async function resolve(specifier, context, nextResolve) {
38
38
  export async function load(url, context, nextLoad) {
39
39
  const ext = extname(url);
40
40
  if (TRANSPILE_EXTS.has(ext)) {
41
- // Ensure oxc-parser is loaded (via dynamic import `require` of this
42
- // ESM-only package fails below require(esm) on Node 18.19 / 20.x). The async
43
- // load hook can await; the synchronous module-format + decorator detection
44
- // inside loadTranspile then has the parser.
45
- await ensureParser();
41
+ // Module-format + decorator detection inside loadTranspile is a synchronous
42
+ // native call (nub's addon), available on every supported Node no parser
43
+ // warm-up needed (the old `await ensureParser()` for the ESM-only oxc-parser
44
+ // is gone with the package).
46
45
  return loadTranspile(url, ext);
47
46
  }
48
47
  if (ext in DATA_EXTS) return loadData(url, ext);
@@ -102,14 +102,18 @@ if (!requireEsmDisabled) {
102
102
  // ── Hook registration (fast tier: sync, in-thread) ────────────────
103
103
  // Same realm as user code; covers `import` and (Node 24+) `require`.
104
104
  // registerHooks' require RESOLUTION is incomplete on 22.15–24, so also install
105
- // the main-thread CJS resolve shim. Install the classic require.extensions
106
- // transpile shim only on 22.15–22.17 (no native `.ts`); on 22.18+/24+ skip it so
107
- // Node's native require() of `.ts` incl. ES modules — isn't shadowed (see
108
- // installCjsRequireHooks).
109
- const __hasNativeTs = !!process.features?.typescript;
105
+ // the main-thread CJS resolve shim (its _resolveFilename half, always on). We do
106
+ // NOT install the classic require.extensions transpile shim on the fast tier: the
107
+ // sync registerHooks LOAD hook already transpiles require()'d `.ts` (CJS content,
108
+ // tsconfig paths, .tsx, extensionless — all verified), and native require(esm)
109
+ // (>= 22.12, always present at the 22.15+ fast floor) loads ES-module `.ts`. The
110
+ // classic require.extensions['.ts'] hook would SHADOW that native require(esm) and
111
+ // throw a bogus ERR_REQUIRE_ESM on every ESM `.ts` entry on 22.15–22.17 (where
112
+ // process.features.typescript is still false) — so it must stay off here. On
113
+ // 22.18+/24+ this was already the behavior (native-TS → false); now it's uniform.
110
114
  const { resolve, load } = common.makeHooks(core, watchReporting);
111
115
  module_.registerHooks({ resolve, load });
112
- common.installCjsRequireHooks(core, !__hasNativeTs);
116
+ common.installCjsRequireHooks(core, false);
113
117
 
114
118
  // ── Sync polyfills + lazy ESM-side-effect polyfills ───────────────
115
119
  installSyncPolyfills(__preloadedPolyfills);
@@ -9,10 +9,11 @@
9
9
  //
10
10
  // THIS file stays the compat path: on 18.19–22.14, `module.registerHooks` does not
11
11
  // exist and `require(esm)` is unreliable, so hooks run async in a dedicated loader
12
- // worker via `module.register`, and the parser is preloaded via dynamic `import()`
13
- // while we can still `await`. That async machinery is exactly why the compat tier
14
- // keeps `--import` its top-level `await` is accepted here (an `--import` ESM
15
- // module may be async), and the < 22.15 floor has no equivalent sync surface.
12
+ // worker via `module.register`. That async machinery is why the compat tier keeps
13
+ // `--import` its top-level `await` is accepted here (an `--import` ESM module may
14
+ // be async), and the < 22.15 floor has no equivalent sync surface. (Module-format
15
+ // + decorator detection no longer needs a preloaded JS parser: it is a synchronous
16
+ // native addon call, so there is nothing to `await`-warm-up before hooks run.)
16
17
  //
17
18
  // Resolution + transpile primitives come from runtime/transform-core.mjs; the
18
19
  // non-tier-specific wiring (watch IPC, the CJS require() shim, clobbered-polyfill
@@ -56,19 +57,29 @@ common.installWatchReporting(core);
56
57
  if (__isFastTier) {
57
58
  // Defensive only — the Rust path uses preload.cjs for 22.15+. If reached, the
58
59
  // sync registerHooks API is available; register synchronously to stay correct.
60
+ // Match preload.cjs: NO classic require.extensions shim on the fast tier — the
61
+ // sync registerHooks load hook + native require(esm) cover require()'d `.ts`
62
+ // (incl. ES modules); the classic shim would shadow require(esm) and throw a
63
+ // bogus ERR_REQUIRE_ESM on 22.15–22.17.
59
64
  const { resolve, load } = common.makeHooks(core, process.env.WATCH_REPORT_DEPENDENCIES === "1");
60
65
  module.registerHooks({ resolve, load });
61
- common.installCjsRequireHooks(core, !__hasNativeTs);
66
+ common.installCjsRequireHooks(core, false);
62
67
  } else if (__isCompatTier) {
63
68
  // Compat path: ESM `import` hooks run in a dedicated loader worker thread.
64
69
  module.register("./preload-async-hooks.mjs", import.meta.url);
65
- // The main-thread CommonJS require() shim's format detection is synchronous and
66
- // reaches down to Node 18.19, where `require("oxc-parser")` (ESM-only) fails — so
67
- // preload the parser via dynamic import now, while we can still await.
68
- await core.ensureParser();
70
+ // (The main-thread require() shim's module-format + decorator detection is a
71
+ // synchronous native addon call now no parser warm-up; the old
72
+ // `await core.ensureParser()` for the ESM-only oxc-parser is gone.)
69
73
  // module.register() is ESM-loader-only; augment CommonJS require() on the main
70
- // thread too. The compat tier never has native `.ts`, so it always installs the
71
- // classic transpile shim (CJS transpile + clean error for ES-module require()).
74
+ // thread too. The compat tier has no sync registerHooks, so require()'d `.ts`
75
+ // MUST be transpiled by the classic require.extensions shim hence it always
76
+ // installs (true). KNOWN LIMITATION: on the require(esm)-capable slice of the
77
+ // compat tier (22.12–22.14) an explicit `require('./esm-module.ts')` still
78
+ // surfaces ERR_REQUIRE_ESM, because the classic shim shadows native require(esm)
79
+ // and can't delegate to it from inside `_compile`. ESM `.ts` ENTRIES and `import`
80
+ // of ESM `.ts` both work (they ride the ESM loader); only require()-of-ESM-`.ts`
81
+ // is affected — an uncommon pattern. Below 22.12 the error is fully correct
82
+ // (no require(esm) at all). Fast tier (22.15+) has none of this — see preload.cjs.
72
83
  common.installCjsRequireHooks(core, !__hasNativeTs);
73
84
  } else {
74
85
  process.stderr.write(