@nativescript/vite 8.0.0-alpha.2 → 8.0.0-alpha.21

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 (209) hide show
  1. package/configuration/angular.d.ts +34 -1
  2. package/configuration/angular.js +380 -34
  3. package/configuration/angular.js.map +1 -1
  4. package/configuration/base.js +171 -7
  5. package/configuration/base.js.map +1 -1
  6. package/configuration/solid.js +27 -1
  7. package/configuration/solid.js.map +1 -1
  8. package/configuration/typescript.js +1 -1
  9. package/configuration/typescript.js.map +1 -1
  10. package/helpers/angular/angular-linker.js +3 -12
  11. package/helpers/angular/angular-linker.js.map +1 -1
  12. package/helpers/angular/inject-component-hmr-registration.d.ts +112 -0
  13. package/helpers/angular/inject-component-hmr-registration.js +359 -0
  14. package/helpers/angular/inject-component-hmr-registration.js.map +1 -0
  15. package/helpers/angular/inject-hmr-vite-ignore.d.ts +75 -0
  16. package/helpers/angular/inject-hmr-vite-ignore.js +288 -0
  17. package/helpers/angular/inject-hmr-vite-ignore.js.map +1 -0
  18. package/helpers/angular/util.d.ts +1 -0
  19. package/helpers/angular/util.js +88 -0
  20. package/helpers/angular/util.js.map +1 -1
  21. package/helpers/commonjs-plugins.d.ts +5 -2
  22. package/helpers/commonjs-plugins.js +126 -0
  23. package/helpers/commonjs-plugins.js.map +1 -1
  24. package/helpers/config-as-json.js +10 -0
  25. package/helpers/config-as-json.js.map +1 -1
  26. package/helpers/dev-host.d.ts +274 -0
  27. package/helpers/dev-host.js +491 -0
  28. package/helpers/dev-host.js.map +1 -0
  29. package/helpers/global-defines.d.ts +51 -0
  30. package/helpers/global-defines.js +77 -0
  31. package/helpers/global-defines.js.map +1 -1
  32. package/helpers/logging.d.ts +1 -0
  33. package/helpers/logging.js +63 -3
  34. package/helpers/logging.js.map +1 -1
  35. package/helpers/main-entry.d.ts +3 -1
  36. package/helpers/main-entry.js +450 -125
  37. package/helpers/main-entry.js.map +1 -1
  38. package/helpers/nativeclass-transformer-plugin.d.ts +9 -2
  39. package/helpers/nativeclass-transformer-plugin.js +157 -14
  40. package/helpers/nativeclass-transformer-plugin.js.map +1 -1
  41. package/helpers/ns-core-url.d.ts +88 -0
  42. package/helpers/ns-core-url.js +191 -0
  43. package/helpers/ns-core-url.js.map +1 -0
  44. package/helpers/prelink-angular.js +1 -4
  45. package/helpers/prelink-angular.js.map +1 -1
  46. package/helpers/project.d.ts +35 -0
  47. package/helpers/project.js +120 -2
  48. package/helpers/project.js.map +1 -1
  49. package/helpers/resolver.js +9 -1
  50. package/helpers/resolver.js.map +1 -1
  51. package/helpers/solid-jsx-deps.d.ts +15 -0
  52. package/helpers/solid-jsx-deps.js +178 -0
  53. package/helpers/solid-jsx-deps.js.map +1 -0
  54. package/helpers/ts-config-paths.js +50 -2
  55. package/helpers/ts-config-paths.js.map +1 -1
  56. package/helpers/workers.d.ts +20 -19
  57. package/helpers/workers.js +620 -3
  58. package/helpers/workers.js.map +1 -1
  59. package/hmr/client/css-handler.d.ts +1 -0
  60. package/hmr/client/css-handler.js +34 -5
  61. package/hmr/client/css-handler.js.map +1 -1
  62. package/hmr/client/css-update-overlay.d.ts +18 -0
  63. package/hmr/client/css-update-overlay.js +27 -0
  64. package/hmr/client/css-update-overlay.js.map +1 -0
  65. package/hmr/client/hmr-pending-overlay.d.ts +27 -0
  66. package/hmr/client/hmr-pending-overlay.js +50 -0
  67. package/hmr/client/hmr-pending-overlay.js.map +1 -0
  68. package/hmr/client/index.js +491 -34
  69. package/hmr/client/index.js.map +1 -1
  70. package/hmr/client/utils.d.ts +5 -0
  71. package/hmr/client/utils.js +283 -12
  72. package/hmr/client/utils.js.map +1 -1
  73. package/hmr/client/vue-sfc-update-overlay.d.ts +82 -0
  74. package/hmr/client/vue-sfc-update-overlay.js +133 -0
  75. package/hmr/client/vue-sfc-update-overlay.js.map +1 -0
  76. package/hmr/entry-runtime.d.ts +2 -1
  77. package/hmr/entry-runtime.js +253 -66
  78. package/hmr/entry-runtime.js.map +1 -1
  79. package/hmr/frameworks/angular/client/index.d.ts +3 -1
  80. package/hmr/frameworks/angular/client/index.js +802 -10
  81. package/hmr/frameworks/angular/client/index.js.map +1 -1
  82. package/hmr/frameworks/angular/server/linker.js +1 -4
  83. package/hmr/frameworks/angular/server/linker.js.map +1 -1
  84. package/hmr/frameworks/angular/server/strategy.js +30 -6
  85. package/hmr/frameworks/angular/server/strategy.js.map +1 -1
  86. package/hmr/frameworks/typescript/server/strategy.js +8 -2
  87. package/hmr/frameworks/typescript/server/strategy.js.map +1 -1
  88. package/hmr/frameworks/vue/client/index.js +30 -45
  89. package/hmr/frameworks/vue/client/index.js.map +1 -1
  90. package/hmr/helpers/ast-normalizer.js +52 -5
  91. package/hmr/helpers/ast-normalizer.js.map +1 -1
  92. package/hmr/helpers/cjs-named-exports.d.ts +23 -0
  93. package/hmr/helpers/cjs-named-exports.js +152 -0
  94. package/hmr/helpers/cjs-named-exports.js.map +1 -0
  95. package/hmr/helpers/package-exports.d.ts +16 -0
  96. package/hmr/helpers/package-exports.js +396 -0
  97. package/hmr/helpers/package-exports.js.map +1 -0
  98. package/hmr/server/constants.js +13 -4
  99. package/hmr/server/constants.js.map +1 -1
  100. package/hmr/server/core-sanitize.d.ts +93 -8
  101. package/hmr/server/core-sanitize.js +222 -49
  102. package/hmr/server/core-sanitize.js.map +1 -1
  103. package/hmr/server/import-map.js +80 -22
  104. package/hmr/server/import-map.js.map +1 -1
  105. package/hmr/server/index.d.ts +2 -1
  106. package/hmr/server/index.js.map +1 -1
  107. package/hmr/server/ns-core-cjs-shape.d.ts +204 -0
  108. package/hmr/server/ns-core-cjs-shape.js +271 -0
  109. package/hmr/server/ns-core-cjs-shape.js.map +1 -0
  110. package/hmr/server/ns-rt-bridge.d.ts +51 -0
  111. package/hmr/server/ns-rt-bridge.js +131 -0
  112. package/hmr/server/ns-rt-bridge.js.map +1 -0
  113. package/hmr/server/perf-instrumentation.d.ts +114 -0
  114. package/hmr/server/perf-instrumentation.js +195 -0
  115. package/hmr/server/perf-instrumentation.js.map +1 -0
  116. package/hmr/server/runtime-graph-filter.d.ts +5 -0
  117. package/hmr/server/runtime-graph-filter.js +21 -0
  118. package/hmr/server/runtime-graph-filter.js.map +1 -0
  119. package/hmr/server/shared-transform-request.d.ts +12 -0
  120. package/hmr/server/shared-transform-request.js +144 -0
  121. package/hmr/server/shared-transform-request.js.map +1 -0
  122. package/hmr/server/vite-plugin.d.ts +21 -1
  123. package/hmr/server/vite-plugin.js +497 -58
  124. package/hmr/server/vite-plugin.js.map +1 -1
  125. package/hmr/server/websocket-angular-entry.d.ts +2 -0
  126. package/hmr/server/websocket-angular-entry.js +68 -0
  127. package/hmr/server/websocket-angular-entry.js.map +1 -0
  128. package/hmr/server/websocket-angular-hot-update.d.ts +78 -0
  129. package/hmr/server/websocket-angular-hot-update.js +413 -0
  130. package/hmr/server/websocket-angular-hot-update.js.map +1 -0
  131. package/hmr/server/websocket-core-bridge.d.ts +58 -0
  132. package/hmr/server/websocket-core-bridge.js +368 -0
  133. package/hmr/server/websocket-core-bridge.js.map +1 -0
  134. package/hmr/server/websocket-css-hot-update.d.ts +33 -0
  135. package/hmr/server/websocket-css-hot-update.js +65 -0
  136. package/hmr/server/websocket-css-hot-update.js.map +1 -0
  137. package/hmr/server/websocket-graph-upsert.d.ts +21 -0
  138. package/hmr/server/websocket-graph-upsert.js +33 -0
  139. package/hmr/server/websocket-graph-upsert.js.map +1 -0
  140. package/hmr/server/websocket-hmr-pending.d.ts +43 -0
  141. package/hmr/server/websocket-hmr-pending.js +55 -0
  142. package/hmr/server/websocket-hmr-pending.js.map +1 -0
  143. package/hmr/server/websocket-module-bindings.d.ts +6 -0
  144. package/hmr/server/websocket-module-bindings.js +471 -0
  145. package/hmr/server/websocket-module-bindings.js.map +1 -0
  146. package/hmr/server/websocket-module-specifiers.d.ts +101 -0
  147. package/hmr/server/websocket-module-specifiers.js +820 -0
  148. package/hmr/server/websocket-module-specifiers.js.map +1 -0
  149. package/hmr/server/websocket-ns-m-finalize.d.ts +22 -0
  150. package/hmr/server/websocket-ns-m-finalize.js +88 -0
  151. package/hmr/server/websocket-ns-m-finalize.js.map +1 -0
  152. package/hmr/server/websocket-ns-m-paths.d.ts +3 -0
  153. package/hmr/server/websocket-ns-m-paths.js +92 -0
  154. package/hmr/server/websocket-ns-m-paths.js.map +1 -0
  155. package/hmr/server/websocket-ns-m-request.d.ts +45 -0
  156. package/hmr/server/websocket-ns-m-request.js +196 -0
  157. package/hmr/server/websocket-ns-m-request.js.map +1 -0
  158. package/hmr/server/websocket-served-module-helpers.d.ts +36 -0
  159. package/hmr/server/websocket-served-module-helpers.js +644 -0
  160. package/hmr/server/websocket-served-module-helpers.js.map +1 -0
  161. package/hmr/server/websocket-txn.d.ts +6 -0
  162. package/hmr/server/websocket-txn.js +45 -0
  163. package/hmr/server/websocket-txn.js.map +1 -0
  164. package/hmr/server/websocket-vendor-unifier.d.ts +10 -0
  165. package/hmr/server/websocket-vendor-unifier.js +51 -0
  166. package/hmr/server/websocket-vendor-unifier.js.map +1 -0
  167. package/hmr/server/websocket-vue-sfc.d.ts +26 -0
  168. package/hmr/server/websocket-vue-sfc.js +1053 -0
  169. package/hmr/server/websocket-vue-sfc.js.map +1 -0
  170. package/hmr/server/websocket.d.ts +58 -75
  171. package/hmr/server/websocket.js +2232 -1802
  172. package/hmr/server/websocket.js.map +1 -1
  173. package/hmr/shared/package-classifier.d.ts +9 -0
  174. package/hmr/shared/package-classifier.js +58 -0
  175. package/hmr/shared/package-classifier.js.map +1 -0
  176. package/hmr/shared/runtime/boot-placeholder-ui.d.ts +69 -0
  177. package/hmr/shared/runtime/boot-placeholder-ui.js +101 -0
  178. package/hmr/shared/runtime/boot-placeholder-ui.js.map +1 -0
  179. package/hmr/shared/runtime/boot-progress.d.ts +40 -0
  180. package/hmr/shared/runtime/boot-progress.js +128 -0
  181. package/hmr/shared/runtime/boot-progress.js.map +1 -0
  182. package/hmr/shared/runtime/boot-timeline.d.ts +18 -0
  183. package/hmr/shared/runtime/boot-timeline.js +52 -0
  184. package/hmr/shared/runtime/boot-timeline.js.map +1 -0
  185. package/hmr/shared/runtime/browser-runtime-contract.d.ts +64 -0
  186. package/hmr/shared/runtime/browser-runtime-contract.js +54 -0
  187. package/hmr/shared/runtime/browser-runtime-contract.js.map +1 -0
  188. package/hmr/shared/runtime/dev-overlay.d.ts +78 -3
  189. package/hmr/shared/runtime/dev-overlay.js +1094 -26
  190. package/hmr/shared/runtime/dev-overlay.js.map +1 -1
  191. package/hmr/shared/runtime/module-provenance.js +1 -4
  192. package/hmr/shared/runtime/module-provenance.js.map +1 -1
  193. package/hmr/shared/runtime/root-placeholder.d.ts +1 -0
  194. package/hmr/shared/runtime/root-placeholder.js +1019 -151
  195. package/hmr/shared/runtime/root-placeholder.js.map +1 -1
  196. package/hmr/shared/runtime/session-bootstrap.d.ts +1 -0
  197. package/hmr/shared/runtime/session-bootstrap.js +309 -0
  198. package/hmr/shared/runtime/session-bootstrap.js.map +1 -0
  199. package/hmr/shared/runtime/vendor-bootstrap.js +1 -9
  200. package/hmr/shared/runtime/vendor-bootstrap.js.map +1 -1
  201. package/hmr/shared/vendor/manifest.d.ts +32 -0
  202. package/hmr/shared/vendor/manifest.js +411 -46
  203. package/hmr/shared/vendor/manifest.js.map +1 -1
  204. package/index.d.ts +1 -0
  205. package/index.js +5 -0
  206. package/index.js.map +1 -1
  207. package/package.json +9 -1
  208. package/runtime/core-aliases-early.js +94 -67
  209. package/runtime/core-aliases-early.js.map +1 -1
@@ -0,0 +1,152 @@
1
+ // Runtime-enumerated CommonJS named exports for the HMR `/ns/m` pipeline.
2
+ //
3
+ // Why this exists:
4
+ // V8's HTTP-imported ES module loader (the device's `http-esm` mode) requires
5
+ // named exports to be declared statically at parse time. Many real-world npm
6
+ // packages do not declare their public surface statically — the canonical
7
+ // example is lodash:
8
+ //
9
+ // (freeModule.exports = _)._ = _;
10
+ //
11
+ // At parse time there are zero `exports.foo = ...` or
12
+ // `Object.defineProperty(exports, 'foo', ...)` patterns. Lodash builds its
13
+ // public surface dynamically inside an IIFE and attaches every method to a
14
+ // function object that is then assigned to `module.exports`. Neither a
15
+ // regex nor an AST can statically determine that lodash exposes
16
+ // `capitalize`, `chunk`, `debounce`, etc.
17
+ //
18
+ // The only correct way to enumerate this kind of CJS module's public
19
+ // surface is to actually load it in the dev server's Node context and ask
20
+ // `Object.keys(...)`. This is exactly what esbuild and Vite do at build
21
+ // time when they pre-bundle CJS deps for an ESM consumer; this helper
22
+ // brings the same strategy to the HMR served-module pipeline so that
23
+ // `import { capitalize } from 'lodash'` succeeds even when lodash is not
24
+ // pre-bundled by Vite.
25
+ //
26
+ // Safety:
27
+ // - Only call this for modules under `node_modules` (we never execute user
28
+ // source code via this path).
29
+ // - Wrap in try/catch — some npm packages throw at load time (missing peer
30
+ // deps, browser-only globals, side effects). On any failure we return an
31
+ // empty list and the caller falls back to whatever it could detect
32
+ // statically.
33
+ // - Cache by absolute path so a second HMR request for the same module is
34
+ // free.
35
+ import { createRequire } from 'node:module';
36
+ import * as path from 'node:path';
37
+ import * as fs from 'node:fs';
38
+ const cache = new Map();
39
+ const RESERVED = new Set(['default', '__esModule']);
40
+ // `Object.getOwnPropertyNames` on a function exposes these implementation
41
+ // details — they are not real exports.
42
+ const FUNCTION_INTERNAL = new Set(['length', 'name', 'prototype', 'arguments', 'caller']);
43
+ const VALID_IDENT = /^[A-Za-z_$][\w$]*$/;
44
+ export function clearCjsNamedExportsCache(filePath) {
45
+ if (!filePath) {
46
+ cache.clear();
47
+ }
48
+ else {
49
+ cache.delete(filePath);
50
+ }
51
+ }
52
+ export function getCjsNamedExportsCacheSize() {
53
+ return cache.size;
54
+ }
55
+ /**
56
+ * Normalize a path that may have come from a Vite-resolved id (e.g.
57
+ * `/@fs/Users/.../node_modules/foo/index.js?import`) into a plain
58
+ * absolute filesystem path that `createRequire` can load.
59
+ *
60
+ * Returns null if the path does not look like an absolute filesystem
61
+ * path that exists on disk.
62
+ */
63
+ export function normalizeAbsolutePathForRequire(input) {
64
+ if (!input)
65
+ return null;
66
+ let s = String(input).replace(/[?#].*$/, '');
67
+ // Vite serves absolute paths as `/@fs/<absolute>`; strip the prefix.
68
+ if (s.startsWith('/@fs/')) {
69
+ s = s.slice('/@fs'.length);
70
+ }
71
+ if (!path.isAbsolute(s))
72
+ return null;
73
+ try {
74
+ if (!fs.statSync(s).isFile())
75
+ return null;
76
+ }
77
+ catch {
78
+ return null;
79
+ }
80
+ return s;
81
+ }
82
+ /**
83
+ * Enumerate the named exports of a CommonJS module by loading it in the
84
+ * dev server's Node context.
85
+ *
86
+ * Returns an empty array if the module can't be loaded, isn't in
87
+ * node_modules, or doesn't expose any enumerable string-keyed properties
88
+ * that look like JS identifiers.
89
+ *
90
+ * Results are cached by absolute path. Pass `clearCjsNamedExportsCache()`
91
+ * if you need to invalidate (e.g. between tests).
92
+ */
93
+ export function getCjsNamedExports(absolutePath) {
94
+ const normalized = normalizeAbsolutePathForRequire(absolutePath);
95
+ if (!normalized)
96
+ return [];
97
+ // Only enumerate node_modules paths — never execute user source via this code path.
98
+ if (!/(?:^|\/)node_modules\//.test(normalized))
99
+ return [];
100
+ const cached = cache.get(normalized);
101
+ if (cached !== undefined)
102
+ return cached || [];
103
+ let names = null;
104
+ try {
105
+ // `createRequire` needs a path that itself exists; the file we are
106
+ // enumerating is a fine anchor. The cwd of the require base is its
107
+ // parent directory, which matters for nested workspace resolution.
108
+ const req = createRequire(normalized);
109
+ const mod = req(normalized);
110
+ const collected = new Set();
111
+ const isFn = typeof mod === 'function';
112
+ if (mod && (typeof mod === 'object' || isFn)) {
113
+ // `Object.keys` returns enumerable own props — covers most CJS modules
114
+ // where named exports are real properties on the exports object.
115
+ try {
116
+ for (const k of Object.keys(mod)) {
117
+ if (!RESERVED.has(k) && VALID_IDENT.test(k))
118
+ collected.add(k);
119
+ }
120
+ }
121
+ catch {
122
+ /* exotic proxy etc. */
123
+ }
124
+ // `Object.getOwnPropertyNames` covers non-enumerable own props too.
125
+ // Lodash attaches a few methods that aren't enumerable; more importantly
126
+ // some packages mark exports non-enumerable on purpose.
127
+ try {
128
+ for (const k of Object.getOwnPropertyNames(mod)) {
129
+ if (RESERVED.has(k) || !VALID_IDENT.test(k))
130
+ continue;
131
+ if (isFn && FUNCTION_INTERNAL.has(k))
132
+ continue;
133
+ collected.add(k);
134
+ }
135
+ }
136
+ catch {
137
+ /* exotic */
138
+ }
139
+ names = Array.from(collected);
140
+ }
141
+ else {
142
+ // Primitive default export (e.g. `module.exports = 'hello'`). No named exports possible.
143
+ names = [];
144
+ }
145
+ }
146
+ catch {
147
+ names = null;
148
+ }
149
+ cache.set(normalized, names);
150
+ return names || [];
151
+ }
152
+ //# sourceMappingURL=cjs-named-exports.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cjs-named-exports.js","sourceRoot":"","sources":["../../../../../packages/vite/hmr/helpers/cjs-named-exports.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,EAAE;AACF,mBAAmB;AACnB,8EAA8E;AAC9E,6EAA6E;AAC7E,0EAA0E;AAC1E,qBAAqB;AACrB,EAAE;AACF,oCAAoC;AACpC,EAAE;AACF,sDAAsD;AACtD,2EAA2E;AAC3E,2EAA2E;AAC3E,uEAAuE;AACvE,gEAAgE;AAChE,0CAA0C;AAC1C,EAAE;AACF,qEAAqE;AACrE,0EAA0E;AAC1E,wEAAwE;AACxE,sEAAsE;AACtE,qEAAqE;AACrE,yEAAyE;AACzE,uBAAuB;AACvB,EAAE;AACF,UAAU;AACV,2EAA2E;AAC3E,gCAAgC;AAChC,2EAA2E;AAC3E,2EAA2E;AAC3E,qEAAqE;AACrE,gBAAgB;AAChB,0EAA0E;AAC1E,UAAU;AAEV,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAE9B,MAAM,KAAK,GAAG,IAAI,GAAG,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MAAM,CAAC,mBAAmB,CAAC,GAAG,CAAC,EAAE,CAAC;oBACjD,IAAI,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;wBAAE,SAAS;oBACtD,IAAI,IAAI,IAAI,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC;wBAAE,SAAS;oBAC/C,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;gBAClB,CAAC;YACF,CAAC;YAAC,MAAM,CAAC;gBACR,YAAY;YACb,CAAC;YACD,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAC/B,CAAC;aAAM,CAAC;YACP,yFAAyF;YACzF,KAAK,GAAG,EAAE,CAAC;QACZ,CAAC;IACF,CAAC;IAAC,MAAM,CAAC;QACR,KAAK,GAAG,IAAI,CAAC;IACd,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;IAC7B,OAAO,KAAK,IAAI,EAAE,CAAC;AACpB,CAAC"}
@@ -0,0 +1,16 @@
1
+ export interface PackageExportShape {
2
+ /** Union of every named export reachable from the package entry, minus `default`. */
3
+ names: Set<string>;
4
+ /** True if any visited file emits a `default` export. */
5
+ hasDefault: boolean;
6
+ /** Absolute path to the resolved entry file (empty string when the package could not be resolved). */
7
+ entry: string;
8
+ /** Files visited during the walk — useful for diagnostics and cache invalidation. */
9
+ visitedFiles: string[];
10
+ }
11
+ /**
12
+ * Clear the cache. Tests use this to assert determinism; production code
13
+ * never needs it (the cache is intentionally process-lifetime).
14
+ */
15
+ export declare function __clearPackageExportsCache(): void;
16
+ export declare function enumeratePackageExports(packageId: string, projectRoot: string): PackageExportShape;
@@ -0,0 +1,396 @@
1
+ // Static export-surface enumerator for the single-realm HTTP-ESM bridge.
2
+ //
3
+ // The HMR runtime serves canonical bridge specifiers (e.g. `/ns/rt` for
4
+ // `nativescript-vue`) that fan out to the device's vendor registry so that
5
+ // app code, plugins, and the vendor bundle itself share one module record
6
+ // per package. The bridge module must therefore re-export every public
7
+ // symbol the underlying package offers — otherwise consumers fall back to
8
+ // `undefined` for any export the bridge author forgot to enumerate, and the
9
+ // failure only surfaces at the call site (often deep inside a UI event
10
+ // handler) as `TypeError: <name> is not a function`.
11
+ //
12
+ // Hand-curated re-export lists are the source of that bug class. This
13
+ // helper replaces them with a deterministic walk of the package's static
14
+ // ESM export graph:
15
+ //
16
+ // 1. Resolve the package's `main` entry from the project's `node_modules`.
17
+ // 2. Parse with Babel and collect every named export — both inline
18
+ // (`export const x = …`, `export function y() {}`, `export { z }`) and
19
+ // re-exported (`export { a, b as c } from './foo'`).
20
+ // 3. Recurse into `export * from <spec>`, following both relative paths
21
+ // and bare package specifiers (so `export * from '@vue/runtime-core'`
22
+ // contributes the full Vue runtime API too).
23
+ // 4. Cache the result by `${projectRoot}::${packageId}` — the walk
24
+ // touches dozens of files for `nativescript-vue` and we want one walk
25
+ // per dev session, not per request.
26
+ //
27
+ // The walker is intentionally permissive: parse errors and unresolvable
28
+ // specifiers are swallowed (continue with what we have). The caller decides
29
+ // what to do if the surface comes back empty (typically: fall back to a
30
+ // known-good baseline list rather than emit a stub bridge).
31
+ import { parse as babelParse } from '@babel/parser';
32
+ import { readFileSync, existsSync, realpathSync } from 'fs';
33
+ import path from 'path';
34
+ import { createRequire } from 'node:module';
35
+ const cache = new Map();
36
+ /**
37
+ * Clear the cache. Tests use this to assert determinism; production code
38
+ * never needs it (the cache is intentionally process-lifetime).
39
+ */
40
+ export function __clearPackageExportsCache() {
41
+ cache.clear();
42
+ }
43
+ export function enumeratePackageExports(packageId, projectRoot) {
44
+ const root = path.resolve(projectRoot || process.cwd());
45
+ const cacheKey = `${root}::${packageId}`;
46
+ const cached = cache.get(cacheKey);
47
+ if (cached)
48
+ return cached;
49
+ const result = {
50
+ names: new Set(),
51
+ hasDefault: false,
52
+ entry: '',
53
+ visitedFiles: [],
54
+ };
55
+ const rootRequire = createRequireFromDir(root);
56
+ const entry = resolvePackageEsmEntry(packageId, rootRequire);
57
+ if (!entry) {
58
+ cache.set(cacheKey, result);
59
+ return result;
60
+ }
61
+ result.entry = entry;
62
+ const visited = new Set();
63
+ const queue = [entry];
64
+ while (queue.length) {
65
+ const file = queue.shift();
66
+ const real = safeRealpath(file);
67
+ if (visited.has(real))
68
+ continue;
69
+ visited.add(real);
70
+ result.visitedFiles.push(real);
71
+ const source = readFileSafe(real);
72
+ if (source === null)
73
+ continue;
74
+ const program = parseModule(source);
75
+ if (!program)
76
+ continue;
77
+ const dir = path.dirname(real);
78
+ const localRequire = createRequireFromFile(real);
79
+ for (const node of program.body) {
80
+ collectExportsFromNode(node, result, (spec) => {
81
+ const next = resolveSpec(spec, dir, localRequire);
82
+ if (next)
83
+ queue.push(next);
84
+ });
85
+ }
86
+ }
87
+ cache.set(cacheKey, result);
88
+ return result;
89
+ }
90
+ function collectExportsFromNode(node, out, queueReExportSource) {
91
+ if (node.type === 'ExportNamedDeclaration') {
92
+ // `export const x = …`, `export function y() {}`, `export class Z {}`
93
+ const decl = node.declaration;
94
+ if (decl) {
95
+ if (decl.declarations) {
96
+ for (const d of decl.declarations) {
97
+ addId(out.names, d?.id);
98
+ }
99
+ }
100
+ else if (decl.id?.name) {
101
+ out.names.add(decl.id.name);
102
+ }
103
+ }
104
+ // `export { a, b as c }` and `export { a } from './foo'`
105
+ for (const spec of (node.specifiers || [])) {
106
+ const exportedName = spec?.exported?.name ?? spec?.exported?.value;
107
+ if (exportedName === 'default') {
108
+ out.hasDefault = true;
109
+ }
110
+ else if (exportedName) {
111
+ out.names.add(String(exportedName));
112
+ }
113
+ }
114
+ // `export … from <source>` — we already captured the explicit names above,
115
+ // but we still need to recurse if there's a `*` re-export hiding inside
116
+ // (Babel models that as `ExportAllDeclaration`, handled below). Nothing to do here.
117
+ }
118
+ else if (node.type === 'ExportAllDeclaration') {
119
+ // `export * from <source>` — recurse.
120
+ // `export * as ns from <source>` adds a named binding `ns` instead of fanning out.
121
+ const src = node.source?.value;
122
+ const asName = node.exported?.name;
123
+ if (asName) {
124
+ if (asName !== 'default')
125
+ out.names.add(String(asName));
126
+ }
127
+ else if (src) {
128
+ queueReExportSource(src);
129
+ }
130
+ }
131
+ else if (node.type === 'ExportDefaultDeclaration') {
132
+ out.hasDefault = true;
133
+ }
134
+ }
135
+ function addId(names, idNode) {
136
+ if (!idNode)
137
+ return;
138
+ if (idNode.type === 'Identifier' && idNode.name) {
139
+ names.add(idNode.name);
140
+ return;
141
+ }
142
+ if (idNode.type === 'ObjectPattern') {
143
+ for (const prop of idNode.properties || []) {
144
+ if (prop.type === 'ObjectProperty')
145
+ addId(names, prop.value);
146
+ else if (prop.type === 'RestElement')
147
+ addId(names, prop.argument);
148
+ }
149
+ return;
150
+ }
151
+ if (idNode.type === 'ArrayPattern') {
152
+ for (const el of idNode.elements || [])
153
+ addId(names, el);
154
+ return;
155
+ }
156
+ if (idNode.type === 'AssignmentPattern') {
157
+ addId(names, idNode.left);
158
+ }
159
+ }
160
+ function parseModule(source) {
161
+ try {
162
+ const ast = babelParse(source, {
163
+ sourceType: 'module',
164
+ plugins: ['typescript', 'jsx', 'importMeta', 'topLevelAwait', 'decorators-legacy', 'classProperties', 'classPrivateProperties', 'classPrivateMethods'],
165
+ errorRecovery: true,
166
+ allowReturnOutsideFunction: true,
167
+ allowUndeclaredExports: true,
168
+ });
169
+ return ast.program;
170
+ }
171
+ catch {
172
+ return null;
173
+ }
174
+ }
175
+ function resolveSpec(spec, dir, localRequire) {
176
+ if (!spec)
177
+ return null;
178
+ if (spec.startsWith('.')) {
179
+ return resolveRelative(dir, spec);
180
+ }
181
+ if (spec.startsWith('/')) {
182
+ return existsSync(spec) ? spec : null;
183
+ }
184
+ // Bare specifier (e.g. `@vue/runtime-core` from inside `nativescript-vue`).
185
+ // `createRequire.resolve()` is CJS-first and follows the package's `main`
186
+ // field, which for dual-format packages like `@vue/runtime-core` points at
187
+ // a CommonJS shim (`module.exports = require('./dist/…cjs.js')`) — parsing
188
+ // that as ESM yields zero exports and we silently drop the entire
189
+ // re-export chain. Use the ESM-aware resolver instead so we land on the
190
+ // actual `dist/…esm-bundler.js` advertised by `exports[".module"]` /
191
+ // `module`, where `export { ref, computed, … }` lives.
192
+ if (localRequire) {
193
+ return resolvePackageEsmEntry(spec, localRequire);
194
+ }
195
+ return null;
196
+ }
197
+ /**
198
+ * Resolve a bare specifier to its ESM entry file by consulting the package's
199
+ * own `package.json` ESM hints — in priority order:
200
+ *
201
+ * 1. `exports[<sub>].module` (Vue, modern dual-format packages)
202
+ * 2. `exports[<sub>].import`
203
+ * 3. `exports[<sub>]` shorthand (string form)
204
+ * 4. top-level `module` field (older dual-format convention)
205
+ * 5. top-level `main` (last resort; may be CJS — we'll parse what we get)
206
+ *
207
+ * `<sub>` is either `"."` (root entry) or `"./relative/subpath"`. Anything not
208
+ * declared in `exports` falls back to plain CJS resolution.
209
+ *
210
+ * Returns the absolute file path, or `null` if the package can't be located.
211
+ */
212
+ function resolvePackageEsmEntry(spec, localRequire) {
213
+ const { packageName, subpath } = splitBareSpec(spec);
214
+ if (!packageName)
215
+ return null;
216
+ // Locate the package's `package.json` from the calling file's vantage point.
217
+ // Node ≥ 18.6 has `require.resolve('<pkg>/package.json')` working for almost
218
+ // every layout (including pnpm hoisted/nested), provided the package
219
+ // declares `package.json` reachable (it is, by default). If the package
220
+ // opts out of exposing it via `exports`, fall back to walking up from any
221
+ // resolvable entry.
222
+ let pkgJsonPath = safeResolve(localRequire, `${packageName}/package.json`);
223
+ if (!pkgJsonPath) {
224
+ const someEntry = safeResolve(localRequire, spec);
225
+ if (someEntry)
226
+ pkgJsonPath = findPackageJsonUpward(someEntry, packageName);
227
+ }
228
+ if (!pkgJsonPath)
229
+ return null;
230
+ const pkgDir = path.dirname(pkgJsonPath);
231
+ const pkg = readJsonSafe(pkgJsonPath);
232
+ if (!pkg)
233
+ return null;
234
+ const subKey = subpath ? `./${subpath}` : '.';
235
+ const esmRelative = pickEsmEntryFromManifest(pkg, subKey);
236
+ if (esmRelative) {
237
+ const resolved = resolveRelativeInsidePackage(pkgDir, esmRelative);
238
+ if (resolved)
239
+ return resolved;
240
+ }
241
+ // Last-resort fallback: ordinary CJS resolution. Parsing may yield zero
242
+ // exports (the file is genuinely CJS) — that's acceptable; the caller
243
+ // treats an empty contribution as "this package adds nothing" rather than
244
+ // erroring out.
245
+ return safeResolve(localRequire, spec);
246
+ }
247
+ function splitBareSpec(spec) {
248
+ if (spec.startsWith('@')) {
249
+ const parts = spec.split('/');
250
+ if (parts.length < 2)
251
+ return { packageName: '', subpath: '' };
252
+ return { packageName: `${parts[0]}/${parts[1]}`, subpath: parts.slice(2).join('/') };
253
+ }
254
+ const slash = spec.indexOf('/');
255
+ if (slash === -1)
256
+ return { packageName: spec, subpath: '' };
257
+ return { packageName: spec.slice(0, slash), subpath: spec.slice(slash + 1) };
258
+ }
259
+ function readJsonSafe(file) {
260
+ try {
261
+ return JSON.parse(readFileSync(file, 'utf-8'));
262
+ }
263
+ catch {
264
+ return null;
265
+ }
266
+ }
267
+ function pickEsmEntryFromManifest(pkg, subKey) {
268
+ const exportsField = pkg?.exports;
269
+ if (exportsField && typeof exportsField === 'object') {
270
+ const entry = exportsField[subKey];
271
+ const fromConditional = pickEsmFromConditionalExports(entry);
272
+ if (fromConditional)
273
+ return fromConditional;
274
+ }
275
+ // `exports` as a bare string only applies to the `.` subpath.
276
+ if (typeof exportsField === 'string' && subKey === '.')
277
+ return exportsField;
278
+ if (subKey === '.') {
279
+ if (typeof pkg?.module === 'string')
280
+ return pkg.module;
281
+ if (typeof pkg?.main === 'string')
282
+ return pkg.main;
283
+ // CommonJS-only packages frequently omit `main`; Node defaults to `index.js`.
284
+ return 'index.js';
285
+ }
286
+ // Subpath without an `exports` mapping: caller falls through to CJS resolution.
287
+ return null;
288
+ }
289
+ function pickEsmFromConditionalExports(entry) {
290
+ if (!entry)
291
+ return null;
292
+ if (typeof entry === 'string')
293
+ return entry;
294
+ if (typeof entry !== 'object')
295
+ return null;
296
+ // Prefer `module` (the de-facto "ESM bundler" condition that Vue, lit,
297
+ // preact etc. ship), then `import`, then `default`. Skip `node`/`require`
298
+ // because those usually point at the CJS shim we're explicitly avoiding.
299
+ for (const key of ['module', 'import', 'default']) {
300
+ const value = entry[key];
301
+ if (typeof value === 'string')
302
+ return value;
303
+ if (value && typeof value === 'object') {
304
+ const nested = pickEsmFromConditionalExports(value);
305
+ if (nested)
306
+ return nested;
307
+ }
308
+ }
309
+ return null;
310
+ }
311
+ function resolveRelativeInsidePackage(pkgDir, rel) {
312
+ const trimmed = rel.replace(/^\.\//, '');
313
+ const candidates = [trimmed, `${trimmed}.js`, `${trimmed}.mjs`, `${trimmed}.cjs`, `${trimmed}/index.js`, `${trimmed}/index.mjs`];
314
+ for (const c of candidates) {
315
+ const p = path.join(pkgDir, c);
316
+ if (existsSync(p))
317
+ return safeRealpath(p);
318
+ }
319
+ return null;
320
+ }
321
+ function findPackageJsonUpward(startFile, expectedName) {
322
+ let dir = path.dirname(startFile);
323
+ const root = path.parse(dir).root;
324
+ while (dir && dir !== root) {
325
+ const candidate = path.join(dir, 'package.json');
326
+ if (existsSync(candidate)) {
327
+ const pkg = readJsonSafe(candidate);
328
+ if (pkg?.name === expectedName)
329
+ return candidate;
330
+ }
331
+ const next = path.dirname(dir);
332
+ if (next === dir)
333
+ break;
334
+ dir = next;
335
+ }
336
+ return null;
337
+ }
338
+ function resolveRelative(dir, spec) {
339
+ const base = path.resolve(dir, spec);
340
+ const candidates = ['', '.js', '.mjs', '.cjs', '/index.js', '/index.mjs', '/index.cjs'];
341
+ for (const ext of candidates) {
342
+ const p = base + ext;
343
+ try {
344
+ if (existsSync(p)) {
345
+ const real = safeRealpath(p);
346
+ // Skip directories returned by `existsSync` without an index file fallback.
347
+ try {
348
+ const stat = readFileSafe(real);
349
+ if (stat !== null)
350
+ return real;
351
+ }
352
+ catch { }
353
+ }
354
+ }
355
+ catch { }
356
+ }
357
+ return null;
358
+ }
359
+ function safeResolve(req, spec) {
360
+ try {
361
+ return req.resolve(spec);
362
+ }
363
+ catch {
364
+ return null;
365
+ }
366
+ }
367
+ function createRequireFromDir(dir) {
368
+ // `createRequire` wants a file path; we pass a synthetic file under the
369
+ // dir so resolution starts there.
370
+ return createRequire(path.join(dir, 'package.json'));
371
+ }
372
+ function createRequireFromFile(file) {
373
+ try {
374
+ return createRequire(file);
375
+ }
376
+ catch {
377
+ return null;
378
+ }
379
+ }
380
+ function safeRealpath(file) {
381
+ try {
382
+ return realpathSync(file);
383
+ }
384
+ catch {
385
+ return file;
386
+ }
387
+ }
388
+ function readFileSafe(file) {
389
+ try {
390
+ return readFileSync(file, 'utf-8');
391
+ }
392
+ catch {
393
+ return null;
394
+ }
395
+ }
396
+ //# sourceMappingURL=package-exports.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"package-exports.js","sourceRoot":"","sources":["../../../../../packages/vite/hmr/helpers/package-exports.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,EAAE;AACF,wEAAwE;AACxE,2EAA2E;AAC3E,0EAA0E;AAC1E,uEAAuE;AACvE,0EAA0E;AAC1E,4EAA4E;AAC5E,uEAAuE;AACvE,qDAAqD;AACrD,EAAE;AACF,sEAAsE;AACtE,yEAAyE;AACzE,oBAAoB;AACpB,EAAE;AACF,6EAA6E;AAC7E,qEAAqE;AACrE,4EAA4E;AAC5E,0DAA0D;AAC1D,0EAA0E;AAC1E,2EAA2E;AAC3E,kDAAkD;AAClD,qEAAqE;AACrE,2EAA2E;AAC3E,yCAAyC;AACzC,EAAE;AACF,wEAAwE;AACxE,4EAA4E;AAC5E,wEAAwE;AACxE,4DAA4D;AAE5D,OAAO,EAAE,KAAK,IAAI,UAAU,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAC5D,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE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;
5
5
  // Detect whether Vite's variable dynamic import helper is already inlined
6
6
  export const VARIABLE_DYNAMIC_IMPORT_HELPER_PATTERN = /__variableDynamicImportRuntimeHelper\s*=/;
7
7
  // Import/export matchers (static and dynamic)
8
- export const IMPORT_PATTERN_1 = /(?:^|\n)(\s*import\s+[^'";]*?\s+from\s+["'])([^"']+)(["'];?)/g;
9
- export const IMPORT_PATTERN_2 = /(?:^|\n)(\s*export\s+[^'";]*?\s+from\s+["'])([^"']+)(["'];?)/g;
8
+ //
9
+ // Each pattern's first capture group includes the optional leading anchor
10
+ // (`^|\n`) so the replacement function preserves the line break that would
11
+ // otherwise be silently consumed by the regex engine. Without this, two
12
+ // concatenated patterns like:
13
+ // `})();\nexport * from "a"\nexport * from "b"`
14
+ // would collapse to:
15
+ // `})();export * from "a"export * from "b"`
16
+ // because each `(?:^|\n)` ate a newline that no replacement string put back.
17
+ export const IMPORT_PATTERN_1 = /((?:^|\n)\s*import\s+[^'";]*?\s+from\s+["'])([^"']+)(["'];?)/g;
18
+ export const IMPORT_PATTERN_2 = /((?:^|\n)\s*export\s+[^'";]*?\s+from\s+["'])([^"']+)(["'];?)/g;
10
19
  export const EXPORT_PATTERN = IMPORT_PATTERN_2;
11
20
  export const IMPORT_PATTERN_3 = /(import\(\s*["'])([^"']+)(["']\s*\))/g;
12
21
  // Side-effect imports: import "spec" / import 'spec' (no `from`, no bindings)
13
- export const IMPORT_PATTERN_SIDE_EFFECT = /(?:^|\n)(\s*import\s+["'])([^"']+)(["'];?)/g;
22
+ export const IMPORT_PATTERN_SIDE_EFFECT = /((?:^|\n)\s*import\s+["'])([^"']+)(["'];?)/g;
14
23
  // Vue-specific patterns
15
24
  export const VUE_FILE_PATTERN = /\.vue(?:\?[^"']*)?$/;
16
- export const VUE_FILE_IMPORT = /(?:^|\n)(\s*import\s+[^'";]*?\s+from\s+["'])([^"']+\.vue(?:\?[^"']*)?)(["'];?)/g;
25
+ export const VUE_FILE_IMPORT = /((?:^|\n)\s*import\s+[^'";]*?\s+from\s+["'])([^"']+\.vue(?:\?[^"']*)?)(["'];?)/g;
17
26
  // Vite/HMR noise cleanup
18
27
  export const VITE_CLIENT_IMPORT = /(?:^|\n)\s*import\s+['"](?:\/@vite\/client|@vite\/client)['"];?/g;
19
28
  // Strip Vite's injected `import.meta.hot = __vite__createHotContext(...)` assignment.
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../packages/vite/hmr/server/constants.ts"],"names":[],"mappings":"AAAA,oEAAoE;AACpE,qGAAqG;AAErG,uBAAuB;AACvB,MAAM,CAAC,MAAM,aAAa,GAAG,OAAO,CAAC;AAErC,0EAA0E;AAC1E,MAAM,CAAC,MAAM,sCAAsC,GAAG,0CAA0C,CAAC;AAEjG,8CAA8C;AAC9C,MAAM,CAAC,MAAM,gBAAgB,GAAG,+DAA+D,CAAC;AAChG,MAAM,CAAC,MAAM,gBAAgB,GAAG,+DAA+D,CAAC;AAChG,MAAM,CAAC,MAAM,cAAc,GAAG,gBAAgB,CAAC;AAC/C,MAAM,CAAC,MAAM,gBAAgB,GAAG,uCAAuC,CAAC;AACxE,8EAA8E;AAC9E,MAAM,CAAC,MAAM,0BAA0B,GAAG,6CAA6C,CAAC;AAExF,wBAAwB;AACxB,MAAM,CAAC,MAAM,gBAAgB,GAAG,qBAAqB,CAAC;AACtD,MAAM,CAAC,MAAM,eAAe,GAAG,iFAAiF,CAAC;AAEjH,yBAAyB;AACzB,MAAM,CAAC,MAAM,kBAAkB,GAAG,kEAAkE,CAAC;AACrG,sFAAsF;AACtF,wFAAwF;AACxF,2CAA2C;AAC3C,MAAM,CAAC,MAAM,0BAA0B,GAAG,sCAAsC,CAAC;AACjF,MAAM,CAAC,MAAM,qBAAqB,GAAG,+DAA+D,CAAC;AAErG,uEAAuE;AACvE,MAAM,CAAC,MAAM,iBAAiB,GAAG,kEAAkE,CAAC;AACpG,MAAM,CAAC,MAAM,qBAAqB,GAAG,sEAAsE,CAAC;AAC5G,M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