@nativescript/vite 8.0.0-alpha.1 → 8.0.0-alpha.3

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 (145) hide show
  1. package/configuration/angular.d.ts +1 -1
  2. package/configuration/angular.js +323 -119
  3. package/configuration/angular.js.map +1 -1
  4. package/configuration/base.js +41 -24
  5. package/configuration/base.js.map +1 -1
  6. package/configuration/javascript.js +3 -3
  7. package/configuration/javascript.js.map +1 -1
  8. package/configuration/solid.js +7 -0
  9. package/configuration/solid.js.map +1 -1
  10. package/configuration/typescript.js +3 -3
  11. package/configuration/typescript.js.map +1 -1
  12. package/helpers/angular/angular-linker.js +39 -34
  13. package/helpers/angular/angular-linker.js.map +1 -1
  14. package/helpers/angular/inline-decorator-component-templates.d.ts +3 -0
  15. package/helpers/angular/inline-decorator-component-templates.js +400 -0
  16. package/helpers/angular/inline-decorator-component-templates.js.map +1 -0
  17. package/helpers/angular/shared-linker.d.ts +7 -0
  18. package/helpers/angular/shared-linker.js +37 -1
  19. package/helpers/angular/shared-linker.js.map +1 -1
  20. package/helpers/angular/synthesize-decorator-ctor-parameters.d.ts +1 -0
  21. package/helpers/angular/synthesize-decorator-ctor-parameters.js +256 -0
  22. package/helpers/angular/synthesize-decorator-ctor-parameters.js.map +1 -0
  23. package/helpers/angular/synthesize-injectable-factories.d.ts +3 -0
  24. package/helpers/angular/synthesize-injectable-factories.js +414 -0
  25. package/helpers/angular/synthesize-injectable-factories.js.map +1 -0
  26. package/helpers/commonjs-plugins.d.ts +5 -2
  27. package/helpers/commonjs-plugins.js +126 -0
  28. package/helpers/commonjs-plugins.js.map +1 -1
  29. package/helpers/esbuild-platform-resolver.js +5 -5
  30. package/helpers/esbuild-platform-resolver.js.map +1 -1
  31. package/helpers/external-configs.d.ts +9 -1
  32. package/helpers/external-configs.js +31 -6
  33. package/helpers/external-configs.js.map +1 -1
  34. package/helpers/import-meta-path.d.ts +4 -0
  35. package/helpers/import-meta-path.js +5 -0
  36. package/helpers/import-meta-path.js.map +1 -0
  37. package/helpers/import-specifier.d.ts +1 -0
  38. package/helpers/import-specifier.js +18 -0
  39. package/helpers/import-specifier.js.map +1 -0
  40. package/helpers/main-entry.d.ts +5 -2
  41. package/helpers/main-entry.js +112 -95
  42. package/helpers/main-entry.js.map +1 -1
  43. package/helpers/nativeclass-transform.js +8 -127
  44. package/helpers/nativeclass-transform.js.map +1 -1
  45. package/helpers/nativeclass-transformer-plugin.d.ts +12 -1
  46. package/helpers/nativeclass-transformer-plugin.js +175 -36
  47. package/helpers/nativeclass-transformer-plugin.js.map +1 -1
  48. package/hmr/client/css-handler.js +60 -20
  49. package/hmr/client/css-handler.js.map +1 -1
  50. package/hmr/client/index.js +524 -23
  51. package/hmr/client/index.js.map +1 -1
  52. package/hmr/client/utils.js +57 -6
  53. package/hmr/client/utils.js.map +1 -1
  54. package/hmr/entry-runtime.d.ts +10 -0
  55. package/hmr/entry-runtime.js +263 -21
  56. package/hmr/entry-runtime.js.map +1 -1
  57. package/hmr/frameworks/angular/client/index.d.ts +2 -1
  58. package/hmr/frameworks/angular/client/index.js +72 -19
  59. package/hmr/frameworks/angular/client/index.js.map +1 -1
  60. package/hmr/frameworks/angular/server/linker.js +36 -2
  61. package/hmr/frameworks/angular/server/linker.js.map +1 -1
  62. package/hmr/frameworks/angular/server/strategy.js +20 -5
  63. package/hmr/frameworks/angular/server/strategy.js.map +1 -1
  64. package/hmr/frameworks/typescript/server/strategy.js +8 -2
  65. package/hmr/frameworks/typescript/server/strategy.js.map +1 -1
  66. package/hmr/helpers/ast-normalizer.js +22 -10
  67. package/hmr/helpers/ast-normalizer.js.map +1 -1
  68. package/hmr/server/constants.d.ts +1 -0
  69. package/hmr/server/constants.js +2 -0
  70. package/hmr/server/constants.js.map +1 -1
  71. package/hmr/server/core-sanitize.d.ts +43 -0
  72. package/hmr/server/core-sanitize.js +219 -13
  73. package/hmr/server/core-sanitize.js.map +1 -1
  74. package/hmr/server/import-map.d.ts +65 -0
  75. package/hmr/server/import-map.js +219 -0
  76. package/hmr/server/import-map.js.map +1 -0
  77. package/hmr/server/index.d.ts +2 -1
  78. package/hmr/server/index.js.map +1 -1
  79. package/hmr/server/runtime-graph-filter.d.ts +5 -0
  80. package/hmr/server/runtime-graph-filter.js +21 -0
  81. package/hmr/server/runtime-graph-filter.js.map +1 -0
  82. package/hmr/server/shared-transform-request.d.ts +12 -0
  83. package/hmr/server/shared-transform-request.js +137 -0
  84. package/hmr/server/shared-transform-request.js.map +1 -0
  85. package/hmr/server/vite-plugin.d.ts +21 -1
  86. package/hmr/server/vite-plugin.js +443 -22
  87. package/hmr/server/vite-plugin.js.map +1 -1
  88. package/hmr/server/websocket-angular-entry.d.ts +2 -0
  89. package/hmr/server/websocket-angular-entry.js +68 -0
  90. package/hmr/server/websocket-angular-entry.js.map +1 -0
  91. package/hmr/server/websocket-angular-hot-update.d.ts +61 -0
  92. package/hmr/server/websocket-angular-hot-update.js +239 -0
  93. package/hmr/server/websocket-angular-hot-update.js.map +1 -0
  94. package/hmr/server/websocket-core-bridge.d.ts +23 -0
  95. package/hmr/server/websocket-core-bridge.js +360 -0
  96. package/hmr/server/websocket-core-bridge.js.map +1 -0
  97. package/hmr/server/websocket-graph-upsert.d.ts +6 -0
  98. package/hmr/server/websocket-graph-upsert.js +13 -0
  99. package/hmr/server/websocket-graph-upsert.js.map +1 -0
  100. package/hmr/server/websocket-module-bindings.d.ts +6 -0
  101. package/hmr/server/websocket-module-bindings.js +471 -0
  102. package/hmr/server/websocket-module-bindings.js.map +1 -0
  103. package/hmr/server/websocket-module-specifiers.d.ts +37 -0
  104. package/hmr/server/websocket-module-specifiers.js +637 -0
  105. package/hmr/server/websocket-module-specifiers.js.map +1 -0
  106. package/hmr/server/websocket.d.ts +26 -3
  107. package/hmr/server/websocket.js +1402 -678
  108. package/hmr/server/websocket.js.map +1 -1
  109. package/hmr/shared/package-classifier.d.ts +9 -0
  110. package/hmr/shared/package-classifier.js +58 -0
  111. package/hmr/shared/package-classifier.js.map +1 -0
  112. package/hmr/shared/runtime/browser-runtime-contract.d.ts +64 -0
  113. package/hmr/shared/runtime/browser-runtime-contract.js +54 -0
  114. package/hmr/shared/runtime/browser-runtime-contract.js.map +1 -0
  115. package/hmr/shared/runtime/dev-overlay.d.ts +38 -0
  116. package/hmr/shared/runtime/dev-overlay.js +675 -0
  117. package/hmr/shared/runtime/dev-overlay.js.map +1 -0
  118. package/hmr/shared/runtime/http-only-boot.d.ts +1 -0
  119. package/hmr/shared/runtime/http-only-boot.js +53 -6
  120. package/hmr/shared/runtime/http-only-boot.js.map +1 -1
  121. package/hmr/shared/runtime/module-provenance.d.ts +1 -0
  122. package/hmr/shared/runtime/module-provenance.js +66 -0
  123. package/hmr/shared/runtime/module-provenance.js.map +1 -0
  124. package/hmr/shared/runtime/platform-polyfills.d.ts +26 -0
  125. package/hmr/shared/runtime/platform-polyfills.js +122 -0
  126. package/hmr/shared/runtime/platform-polyfills.js.map +1 -0
  127. package/hmr/shared/runtime/root-placeholder.d.ts +1 -0
  128. package/hmr/shared/runtime/root-placeholder.js +576 -76
  129. package/hmr/shared/runtime/root-placeholder.js.map +1 -1
  130. package/hmr/shared/runtime/session-bootstrap.d.ts +1 -0
  131. package/hmr/shared/runtime/session-bootstrap.js +146 -0
  132. package/hmr/shared/runtime/session-bootstrap.js.map +1 -0
  133. package/hmr/shared/runtime/vendor-bootstrap.js +51 -6
  134. package/hmr/shared/runtime/vendor-bootstrap.js.map +1 -1
  135. package/hmr/shared/vendor/manifest.d.ts +7 -0
  136. package/hmr/shared/vendor/manifest.js +363 -23
  137. package/hmr/shared/vendor/manifest.js.map +1 -1
  138. package/hmr/shared/vendor/registry.js +104 -7
  139. package/hmr/shared/vendor/registry.js.map +1 -1
  140. package/package.json +12 -2
  141. package/runtime/core-aliases-early.js +83 -32
  142. package/runtime/core-aliases-early.js.map +1 -1
  143. package/shims/solid-jsx-runtime.d.ts +7 -0
  144. package/shims/solid-jsx-runtime.js +17 -0
  145. package/shims/solid-jsx-runtime.js.map +1 -0
@@ -18,26 +18,29 @@ export function normalizeStrayCoreStringLiterals(code) {
18
18
  return code;
19
19
  try {
20
20
  let out = code;
21
+ const toCoreBridgeUrl = (sub) => {
22
+ const normalized = String(sub || '')
23
+ .trim()
24
+ .replace(/^\//, '');
25
+ if (!normalized || normalized === 'index' || normalized === 'index.js') {
26
+ return '/ns/core';
27
+ }
28
+ return `/ns/core?p=${normalized}`;
29
+ };
21
30
  // Normalize any concatenated imports on the same line to start on a new line
22
31
  // e.g. `...;import x from` -> `...;\nimport x from`
23
32
  out = out.replace(/;\s*import\s+/g, ';\nimport ');
24
33
  // Case 1: inline literal followed by another import on SAME line
25
34
  // Example: "@nativescript/core/index.js";import { x } from "...";
26
35
  out = out.replace(/(["']@nativescript\/core([^"']*)["'];)(\s*import\s+)/g, (_m, _lit, sub, after) => {
27
- const qp = String(sub || '')
28
- .trim()
29
- .replace(/^\//, '');
30
- const url = qp ? `/ns/core?p=${qp}` : '/ns/core';
36
+ const url = toCoreBridgeUrl(sub);
31
37
  return `import "${url}";${after}`;
32
38
  });
33
39
  // Case 2: standalone literal on its own line (not a JSON key) — must be end-of-line
34
40
  // Guard with EOL so we don't rewrite JSON keys like "@nativescript/core": "alpha"
35
41
  const reLine = /(^|\n)([\t ]*)["']@nativescript\/core([^"']*)["']\s*;?\s*(?=$|\n)/g;
36
42
  out = out.replace(reLine, (_full, prefix, indent, sub) => {
37
- const qp = String(sub || '')
38
- .trim()
39
- .replace(/^\//, '');
40
- const url = qp ? `/ns/core?p=${qp}` : '/ns/core';
43
+ const url = toCoreBridgeUrl(sub);
41
44
  return `${prefix}${indent}import "${url}";`;
42
45
  });
43
46
  return out;
@@ -109,19 +112,22 @@ export function normalizeAnyCoreSpecToBridge(code) {
109
112
  return code;
110
113
  try {
111
114
  let out = code;
112
- const toQp = (sub) => {
115
+ const toCoreBridgeUrl = (sub) => {
113
116
  const s = String(sub || '')
114
117
  .split('?')[0]
115
118
  .trim()
116
119
  .replace(/^\//, '');
117
- return s ? `?p=${s}` : '';
120
+ if (!s || s === 'index' || s === 'index.js') {
121
+ return '/ns/core';
122
+ }
123
+ return `/ns/core?p=${s}`;
118
124
  };
119
125
  // Static: import ... from "...@nativescript/core[/sub]..."
120
- out = out.replace(/from\s+["'][^"']*@nativescript[\/_-]core([^"']*)["']/g, (_m, sub) => `from "/ns/core${toQp(sub)}"`);
126
+ out = out.replace(/from\s+["'][^"']*@nativescript[\/_-]core([^"']*)["']/g, (_m, sub) => `from "${toCoreBridgeUrl(sub)}"`);
121
127
  // Side-effect: import "...@nativescript/core[/sub]..."
122
- out = out.replace(/(^|\n)\s*import\s+["'][^"']*@nativescript[\/_-]core([^"']*)["'];?/gm, (full, pfx, sub) => `${pfx}import "/ns/core${toQp(sub)}";`);
128
+ out = out.replace(/(^|\n)\s*import\s+["'][^"']*@nativescript[\/_-]core([^"']*)["'];?/gm, (full, pfx, sub) => `${pfx}import "${toCoreBridgeUrl(sub)}";`);
123
129
  // Dynamic: import("...@nativescript/core[/sub]...")
124
- out = out.replace(/import\(\s*["'][^"']*@nativescript[\/_-]core([^"']*)["']\s*\)/g, (_m, sub) => `import("/ns/core${toQp(sub)}")`);
130
+ out = out.replace(/import\(\s*["'][^"']*@nativescript[\/_-]core([^"']*)["']\s*\)/g, (_m, sub) => `import("${toCoreBridgeUrl(sub)}")`);
125
131
  // Repair glitch where a previous pass split/merged lines into: "from import '/ns/core...'"
126
132
  // Normalize to a valid specifier: "from '/ns/core...'"
127
133
  out = out.replace(/from\s+import\s+["']((?:https?:\/\/[^"']+)?\/ns\/core(?:\/[0-9]+)?(?:\?p=[^"']+)?)['"]/g, (_m, url) => `from "${url}"`);
@@ -131,4 +137,204 @@ export function normalizeAnyCoreSpecToBridge(code) {
131
137
  return code;
132
138
  }
133
139
  }
140
+ /**
141
+ * Rewrite a single import/export specifier for device consumption.
142
+ *
143
+ * Converts Vite-resolved root-relative paths to URLs the device can fetch:
144
+ * /node_modules/@nativescript/core/x/y → /ns/core/{ver}?p=x/y
145
+ * /node_modules/other-pkg/x.js → {origin}/ns/m/node_modules/other-pkg/x.js
146
+ * /src/app/foo.ts → {origin}/ns/m/src/app/foo.ts
147
+ * already /ns/... or http://... → unchanged
148
+ */
149
+ function rewriteSpec(spec, origin, ver) {
150
+ // Strip Vite cache-busting query params for bridge URLs
151
+ const cleanSpec = spec.split('?')[0];
152
+ // @nativescript/core anywhere in the path → core bridge
153
+ const coreIdx = cleanSpec.indexOf('@nativescript/core');
154
+ if (coreIdx !== -1) {
155
+ const after = cleanSpec.substring(coreIdx + '@nativescript/core'.length);
156
+ const sub = after.replace(/^\//, '').trim();
157
+ if (!sub || sub === 'index' || sub === 'index.js') {
158
+ return `/ns/core/${ver}`;
159
+ }
160
+ return `/ns/core/${ver}?p=${sub}`;
161
+ }
162
+ // Already a bridge, vendor, or HTTP URL → leave unchanged
163
+ if (spec.startsWith('/ns/') || spec.startsWith('http://') || spec.startsWith('https://') || spec.startsWith('ns-vendor://')) {
164
+ return spec;
165
+ }
166
+ // Root-relative paths → HTTP URL through /ns/m/ handler
167
+ if (spec.startsWith('/')) {
168
+ return `${origin}/ns/m${spec}`;
169
+ }
170
+ return spec;
171
+ }
172
+ /**
173
+ * Minimal specifier rewriter for deep subpath core modules.
174
+ *
175
+ * Takes Vite's correctly-transformed ESM output and ONLY rewrites the
176
+ * specifier strings inside import/export clauses. Does NOT:
177
+ * - Inject global defines
178
+ * - Run AST normalization
179
+ * - Convert named imports to default + destructure
180
+ * - Mangle newlines or code structure
181
+ *
182
+ * This replaces the heavy 5-pass pipeline (processCodeForDevice →
183
+ * rewriteImports → deduplicateLinkerImports → CJS wrapping → etc.)
184
+ * for deep subpath core modules where Vite already produces correct ESM.
185
+ */
186
+ export function rewriteSpecifiersForDevice(code, origin, ver) {
187
+ if (!code)
188
+ return code;
189
+ let result = code;
190
+ // Pattern 1: from "specifier" — covers all static import/export forms
191
+ // import { X } from "spec"
192
+ // import X from "spec"
193
+ // import * as X from "spec"
194
+ // export { X } from "spec"
195
+ // export * from "spec"
196
+ result = result.replace(/(from\s*)(["'])([^"']+)\2/g, (_m, pre, q, spec) => {
197
+ return `${pre}${q}${rewriteSpec(spec, origin, ver)}${q}`;
198
+ });
199
+ // Pattern 2: import("specifier") — dynamic imports
200
+ result = result.replace(/(import\s*\(\s*)(["'])([^"']+)\2(\s*\))/g, (_m, pre, q, spec, post) => {
201
+ return `${pre}${q}${rewriteSpec(spec, origin, ver)}${q}${post}`;
202
+ });
203
+ // Pattern 3: import "specifier" — side-effect imports (no from clause)
204
+ // Anchored after line start, newline, or semicolon to avoid false matches
205
+ result = result.replace(/([;\n]\s*import\s+)(["'])([^"']+)\2/g, (_m, pre, q, spec) => {
206
+ // Skip if it looks like an identifier rather than a path
207
+ if (!/[/.@]/.test(spec))
208
+ return _m;
209
+ return `${pre}${q}${rewriteSpec(spec, origin, ver)}${q}`;
210
+ });
211
+ return result;
212
+ }
213
+ /**
214
+ * Determine whether a `/ns/core` bridge URL points to a real subpath module.
215
+ *
216
+ * Any `/ns/core?p=...` module now serves real ESM content with real named
217
+ * exports via Vite's transform pipeline, except for package-main aliases like
218
+ * `/ns/core?p=index.js`, which should be treated like the main `/ns/core`
219
+ * bridge and destructured from its default export.
220
+ * The main proxy bridge (`/ns/core`) still only exports a default Proxy and
221
+ * requires named imports to be destructured from it.
222
+ *
223
+ * This check is used in all named-import-to-default destructuring passes to
224
+ * skip rewriting for real subpath modules — they have named exports that work
225
+ * natively without conversion.
226
+ */
227
+ export function isDeepCoreSubpath(url) {
228
+ const match = url.match(/\?p=([^&'"#]+)/);
229
+ if (!match)
230
+ return false;
231
+ const sub = String(match[1] || '').replace(/^\/+/, '');
232
+ if (!sub || sub === 'index' || sub === 'index.js') {
233
+ return false;
234
+ }
235
+ return true;
236
+ }
237
+ /**
238
+ * Synthesize a `default` export for an ESM module that only has named/star
239
+ * exports. Utility function — not currently called from the core bridge
240
+ * handler since `ensureDestructureCoreImports` now skips deep subpaths.
241
+ *
242
+ * Handles all three @nativescript/core patterns:
243
+ * 1. Direct declarations: export class X, export function Y, export const Z
244
+ * 2. Named re-exports: export { A, B } from '/path'
245
+ * 3. Star re-exports: export * from '/path'
246
+ *
247
+ * Returns the code unchanged if it already has a default export or CJS exports.
248
+ */
249
+ export function synthesizeDefaultExport(moduleCode) {
250
+ if (!moduleCode || typeof moduleCode !== 'string')
251
+ return moduleCode;
252
+ const hasExportDefault = /\bexport\s+default\b/.test(moduleCode) || /export\s*\{\s*default\s*(?:as\s*default)?\s*\}/.test(moduleCode);
253
+ if (hasExportDefault)
254
+ return moduleCode;
255
+ const hasCjsExports = /\bmodule\s*\.\s*exports\b/.test(moduleCode) || /\bexports\s*\.\s*\w/.test(moduleCode);
256
+ if (hasCjsExports)
257
+ return moduleCode;
258
+ try {
259
+ const bindings = []; // [localName, exportedName]
260
+ const extraImports = [];
261
+ const starSpreads = [];
262
+ let sIdx = 0;
263
+ let m;
264
+ // export { A, b as B } [from 'src'] — handles both local and re-exports
265
+ const reBraces = /\bexport\s*\{([^}]+)\}\s*(?:from\s*["']([^"']+)["'])?/g;
266
+ while ((m = reBraces.exec(moduleCode)) !== null) {
267
+ const specList = m[1];
268
+ const fromSrc = m[2]; // undefined for local exports
269
+ const specs = specList
270
+ .split(',')
271
+ .map((s) => s.trim())
272
+ .filter(Boolean);
273
+ for (const spec of specs) {
274
+ const parts = spec.split(/\s+as\s+/);
275
+ const srcName = parts[0].trim();
276
+ const expName = parts.length > 1 ? parts[1].trim() : srcName;
277
+ if (!expName || expName === 'default')
278
+ continue;
279
+ // For re-exports, the local name is the exported name (from the import we add below)
280
+ // For local exports, the local name is srcName (already in scope)
281
+ bindings.push(fromSrc ? [expName, expName] : [srcName, expName]);
282
+ }
283
+ if (fromSrc) {
284
+ const importSpecs = specs
285
+ .map((spec) => {
286
+ const parts = spec.split(/\s+as\s+/);
287
+ const srcName = parts[0].trim();
288
+ const expName = parts.length > 1 ? parts[1].trim() : srcName;
289
+ if (!expName || expName === 'default')
290
+ return '';
291
+ return parts.length > 1 ? `${srcName} as ${expName}` : expName;
292
+ })
293
+ .filter(Boolean);
294
+ if (importSpecs.length) {
295
+ extraImports.push(`import { ${importSpecs.join(', ')} } from ${JSON.stringify(fromSrc)};`);
296
+ }
297
+ }
298
+ }
299
+ // export const/let/var X
300
+ const reDecl = /\bexport\s+(?:const|let|var)\s+([A-Za-z_$][\w$]*)/g;
301
+ while ((m = reDecl.exec(moduleCode)) !== null) {
302
+ bindings.push([m[1], m[1]]);
303
+ }
304
+ // export [async] function[*]/class X
305
+ const reFunc = /\bexport\s+(?:async\s+)?(?:function\s*\*?|class)\s+([A-Za-z_$][\w$]*)/g;
306
+ while ((m = reFunc.exec(moduleCode)) !== null) {
307
+ bindings.push([m[1], m[1]]);
308
+ }
309
+ // export * as X from 'src' (namespace re-export)
310
+ const reStarAs = /\bexport\s*\*\s*as\s+([A-Za-z_$][\w$]*)\s+from\s*["']([^"']+)["']/g;
311
+ while ((m = reStarAs.exec(moduleCode)) !== null) {
312
+ extraImports.push(`import * as ${m[1]} from ${JSON.stringify(m[2])};`);
313
+ bindings.push([m[1], m[1]]);
314
+ }
315
+ // export * from 'src' (bare star re-export, NOT 'export * as')
316
+ const reStarBare = /\bexport\s*\*\s*(?!as\s)from\s*["']([^"']+)["']/g;
317
+ while ((m = reStarBare.exec(moduleCode)) !== null) {
318
+ const v = `__ns_star_${sIdx++}`;
319
+ extraImports.push(`import * as ${v} from ${JSON.stringify(m[1])};`);
320
+ starSpreads.push(`...${v}`);
321
+ }
322
+ if (bindings.length > 0 || starSpreads.length > 0) {
323
+ const entries = [...starSpreads];
324
+ const seen = new Set();
325
+ for (const [local, exported] of bindings) {
326
+ if (seen.has(exported))
327
+ continue;
328
+ seen.add(exported);
329
+ entries.push(local === exported ? exported : `${JSON.stringify(exported)}: ${local}`);
330
+ }
331
+ const prefix = extraImports.length ? extraImports.join('\n') + '\n' : '';
332
+ return prefix + moduleCode + `\nvar __ns_default_export = { ${entries.join(', ')} };\nexport { __ns_default_export as default };\n`;
333
+ }
334
+ return moduleCode;
335
+ }
336
+ catch {
337
+ return moduleCode;
338
+ }
339
+ }
134
340
  //# sourceMappingURL=core-sanitize.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"core-sanitize.js","sourceRoot":"","sources":["../../../../../packages/vite/hmr/server/core-sanitize.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,gCAAgC,CAAC,IAAY;IAC5D,IAAI,CAAC,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC;IACnD,IAAI,CAAC;QACJ,IAAI,GAAG,GAAG,IAAI,CAAC;QACf,6EAA6E;QAC7E,oDAAoD;QACpD,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,gBAAgB,EAAE,YAAY,CAAC,CAAC;QAClD,iEAAiE;QACjE,kEAAkE;QAClE,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,uDAAuD,EAAE,CAAC,EAAE,EAAE,IAAY,EAAE,GAAW,EAAE,KAAa,EAAE,EAAE;YAC3H,MAAM,EAAE,GAAG,MAAM,CAAC,GAAG,IAAI,EAAE,CAAC;iBAC1B,IAAI,EAAE;iBACN,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;YACrB,MAAM,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC;YACjD,OAAO,WAAW,GAAG,KAAK,KAAK,EAAE,CAAC;QACnC,CAAC,CAAC,CAAC;QAEH,oFAAoF;QACpF,kFAAkF;QAClF,MAAM,MAAM,GAAG,oEAAoE,CAAC;QACpF,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,MAAc,EAAE,MAAc,EAAE,GAAW,EAAE,EAAE;YAChF,MAAM,EAAE,GAAG,MAAM,CAAC,GAAG,IA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AQ,CAAC,CAAC;gBACnB,OAAO,CAAC,IAAI,CAAC,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,KAAK,KAAK,EAAE,CAAC,CAAC;YACvF,CAAC;YACD,MAAM,MAAM,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;YACzE,OAAO,MAAM,GAAG,UAAU,GAAG,iCAAiC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,mDAAmD,CAAC;QACrI,CAAC;QAED,OAAO,UAAU,CAAC;IACnB,CAAC;IAAC,MAAM,CAAC;QACR,OAAO,UAAU,CAAC;IACnB,CAAC;AACF,CAAC"}
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Import Map Generator for NativeScript HMR
3
+ *
4
+ * Generates an import map that the iOS/Android runtime consumes via
5
+ * __nsConfigureRuntime(). This is the single source of truth for module
6
+ * resolution on the device.
7
+ *
8
+ * Resolution strategy:
9
+ * Vendor modules (direct project deps bundled by esbuild) → ns-vendor://
10
+ * Only EXACT specifier entries — no trailing-slash prefixes.
11
+ * Subpaths of vendor packages (e.g., solid-js/store) are NOT vendor-
12
+ * resolved; they fall through to HTTP trailing-slash prefixes below.
13
+ * @nativescript/core → HTTP bridge URL (/ns/core)
14
+ * All other npm packages (transitive deps, etc.) → HTTP URL (/ns/m/)
15
+ * Both exact AND trailing-slash prefix entries, so subpath imports
16
+ * like @nativescript/tanstack-router/solid resolve correctly via HTTP.
17
+ *
18
+ * The runtime's NormalizeViteSpecifier() extracts bare package names from
19
+ * Vite-rewritten paths (e.g. /node_modules/.vite/deps/solid-js.js → solid-js),
20
+ * then looks them up in this map. This ensures ALL imports — regardless of
21
+ * how Vite rewrites them — resolve through a single deterministic path.
22
+ */
23
+ export interface ImportMap {
24
+ imports: Record<string, string>;
25
+ }
26
+ export interface ImportMapOptions {
27
+ /** Origin of the Vite dev server (e.g. "http://192.168.1.5:5173") */
28
+ origin: string;
29
+ /** Framework flavor (vue, angular, solid, typescript) */
30
+ flavor: string;
31
+ /** Additional entries to add to the import map */
32
+ extraEntries?: Record<string, string>;
33
+ }
34
+ /**
35
+ * Generate an import map from the current vendor manifest.
36
+ *
37
+ * Vendor modules are mapped to ns-vendor:// protocol URLs, which the
38
+ * native runtime resolves from the in-memory vendor registry (populated
39
+ * by vendor-bootstrap.ts).
40
+ *
41
+ * IMPORTANT: Vendor entries are EXACT only (no trailing-slash prefixes).
42
+ * The vendor bundle contains only root entry points. Subpath imports like
43
+ * solid-js/store or @nativescript/tanstack-router/solid are separate entry
44
+ * points with different exports — they must NOT resolve to the root vendor
45
+ * module. Instead, they fall through to the HTTP trailing-slash prefix
46
+ * entries from discoverInstalledPackages().
47
+ *
48
+ * @nativescript/core is mapped to the HTTP bridge endpoint.
49
+ * Everything else falls through to the runtime's normal resolution.
50
+ */
51
+ export declare function generateImportMap(options: ImportMapOptions): ImportMap;
52
+ /**
53
+ * Get volatile URL patterns for the current framework.
54
+ * These patterns tell the runtime to always re-fetch matching URLs
55
+ * instead of using cached modules.
56
+ */
57
+ export declare function getVolatilePatterns(flavor: string): string[];
58
+ /**
59
+ * Serialize the import map + volatile patterns into the config object
60
+ * that __nsConfigureRuntime() expects.
61
+ */
62
+ export declare function buildRuntimeConfig(options: ImportMapOptions): {
63
+ importMap: string;
64
+ volatilePatterns: string[];
65
+ };
@@ -0,0 +1,219 @@
1
+ /**
2
+ * Import Map Generator for NativeScript HMR
3
+ *
4
+ * Generates an import map that the iOS/Android runtime consumes via
5
+ * __nsConfigureRuntime(). This is the single source of truth for module
6
+ * resolution on the device.
7
+ *
8
+ * Resolution strategy:
9
+ * Vendor modules (direct project deps bundled by esbuild) → ns-vendor://
10
+ * Only EXACT specifier entries — no trailing-slash prefixes.
11
+ * Subpaths of vendor packages (e.g., solid-js/store) are NOT vendor-
12
+ * resolved; they fall through to HTTP trailing-slash prefixes below.
13
+ * @nativescript/core → HTTP bridge URL (/ns/core)
14
+ * All other npm packages (transitive deps, etc.) → HTTP URL (/ns/m/)
15
+ * Both exact AND trailing-slash prefix entries, so subpath imports
16
+ * like @nativescript/tanstack-router/solid resolve correctly via HTTP.
17
+ *
18
+ * The runtime's NormalizeViteSpecifier() extracts bare package names from
19
+ * Vite-rewritten paths (e.g. /node_modules/.vite/deps/solid-js.js → solid-js),
20
+ * then looks them up in this map. This ensures ALL imports — regardless of
21
+ * how Vite rewrites them — resolve through a single deterministic path.
22
+ */
23
+ import { getVendorManifest, listVendorModules } from '../shared/vendor/registry.js';
24
+ import { readFileSync, readdirSync, existsSync } from 'fs';
25
+ import { resolve, join } from 'path';
26
+ import { getProjectRootPath } from '../../helpers/project.js';
27
+ const OMIT_DEVICE_IMPORT_MAP_PACKAGES = new Set(['typescript', 'ts-node', 'esbuild', 'prettier', 'webpack', 'vite', '@nativescript/android', '@nativescript/ios', '@nativescript/visionos', '@nativescript/webpack', '@nativescript/types']);
28
+ const OMIT_DEVICE_IMPORT_MAP_PREFIXES = ['@types/', '@babel/', 'babel-', '@rollup/', '@vitejs/', 'vite-plugin-', '@angular-devkit/', '@angular/build', '@analogjs/'];
29
+ const PREFIX_ONLY_DEVICE_IMPORT_MAP_PACKAGES = new Set(['@nativescript/vite']);
30
+ function getDeviceImportMapExposure(name) {
31
+ if (PREFIX_ONLY_DEVICE_IMPORT_MAP_PACKAGES.has(name)) {
32
+ return 'prefix-only';
33
+ }
34
+ if (OMIT_DEVICE_IMPORT_MAP_PACKAGES.has(name)) {
35
+ return 'omit';
36
+ }
37
+ for (const prefix of OMIT_DEVICE_IMPORT_MAP_PREFIXES) {
38
+ if (name.startsWith(prefix)) {
39
+ return 'omit';
40
+ }
41
+ }
42
+ return 'full';
43
+ }
44
+ /**
45
+ * Generate an import map from the current vendor manifest.
46
+ *
47
+ * Vendor modules are mapped to ns-vendor:// protocol URLs, which the
48
+ * native runtime resolves from the in-memory vendor registry (populated
49
+ * by vendor-bootstrap.ts).
50
+ *
51
+ * IMPORTANT: Vendor entries are EXACT only (no trailing-slash prefixes).
52
+ * The vendor bundle contains only root entry points. Subpath imports like
53
+ * solid-js/store or @nativescript/tanstack-router/solid are separate entry
54
+ * points with different exports — they must NOT resolve to the root vendor
55
+ * module. Instead, they fall through to the HTTP trailing-slash prefix
56
+ * entries from discoverInstalledPackages().
57
+ *
58
+ * @nativescript/core is mapped to the HTTP bridge endpoint.
59
+ * Everything else falls through to the runtime's normal resolution.
60
+ */
61
+ export function generateImportMap(options) {
62
+ const { origin, flavor, extraEntries } = options;
63
+ const manifest = getVendorManifest();
64
+ const imports = {};
65
+ if (manifest) {
66
+ // Map vendor modules to ns-vendor:// — EXACT entries only.
67
+ // No trailing-slash prefixes: subpaths must resolve via HTTP, not vendor.
68
+ const vendorModules = listVendorModules();
69
+ for (const specifier of vendorModules) {
70
+ imports[specifier] = `ns-vendor://${specifier}`;
71
+ }
72
+ // Map aliases from the manifest (e.g., "solid-js/web" → ns-vendor://solid-js)
73
+ if (manifest.aliases) {
74
+ for (const [alias, canonical] of Object.entries(manifest.aliases)) {
75
+ if (!imports[alias] && imports[canonical]) {
76
+ imports[alias] = imports[canonical];
77
+ }
78
+ }
79
+ }
80
+ }
81
+ // @nativescript/core → bridge endpoint
82
+ imports['@nativescript/core'] = `${origin}/ns/core`;
83
+ imports['@nativescript/core/'] = `${origin}/ns/core/`;
84
+ // Add framework-specific entries
85
+ addFrameworkEntries(imports, origin, flavor);
86
+ // Scan installed packages and add HTTP URL entries for ALL packages
87
+ // (including vendor ones for their subpath imports).
88
+ discoverInstalledPackages(imports, origin);
89
+ // Merge extra entries (user-provided or from framework strategies)
90
+ if (extraEntries) {
91
+ Object.assign(imports, extraEntries);
92
+ }
93
+ return { imports };
94
+ }
95
+ /**
96
+ * Get volatile URL patterns for the current framework.
97
+ * These patterns tell the runtime to always re-fetch matching URLs
98
+ * instead of using cached modules.
99
+ */
100
+ export function getVolatilePatterns(flavor) {
101
+ const patterns = [];
102
+ // Version query params (used by HMR for cache busting)
103
+ patterns.push('?v=');
104
+ patterns.push('&v=');
105
+ // Framework-specific volatile patterns
106
+ switch (flavor) {
107
+ case 'vue':
108
+ // Vue SFC endpoints are volatile (change on every edit)
109
+ patterns.push('/@ns/sfc/');
110
+ patterns.push('/@ns/asm/');
111
+ break;
112
+ case 'angular':
113
+ // Angular template/style URLs may change on edit
114
+ patterns.push('/@ns/asm/');
115
+ break;
116
+ }
117
+ return patterns;
118
+ }
119
+ /**
120
+ * Serialize the import map + volatile patterns into the config object
121
+ * that __nsConfigureRuntime() expects.
122
+ */
123
+ export function buildRuntimeConfig(options) {
124
+ const importMap = generateImportMap(options);
125
+ const volatilePatterns = getVolatilePatterns(options.flavor);
126
+ return {
127
+ importMap: JSON.stringify(importMap),
128
+ volatilePatterns,
129
+ };
130
+ }
131
+ function addFrameworkEntries(imports, _origin, flavor) {
132
+ switch (flavor) {
133
+ case 'vue':
134
+ // nativescript-vue should resolve from vendor if available
135
+ if (!imports['nativescript-vue']) {
136
+ imports['nativescript-vue'] = `ns-vendor://nativescript-vue`;
137
+ }
138
+ if (!imports['vue']) {
139
+ imports['vue'] = `ns-vendor://vue`;
140
+ }
141
+ break;
142
+ case 'solid':
143
+ // Solid runtime root should resolve from vendor
144
+ if (!imports['solid-js']) {
145
+ imports['solid-js'] = `ns-vendor://solid-js`;
146
+ }
147
+ // No trailing-slash prefix — subpaths like solid-js/store,
148
+ // solid-js/jsx-runtime resolve via HTTP from discoverInstalledPackages()
149
+ break;
150
+ }
151
+ }
152
+ /**
153
+ * Scan the project's node_modules to discover ALL installed packages and
154
+ * add import map entries. Vendor packages get only trailing-slash prefix
155
+ * entries (their exact entries are already set to ns-vendor://). Non-vendor
156
+ * packages get both exact and trailing-slash entries.
157
+ *
158
+ * The trailing-slash prefix entries are critical: they enable subpath imports
159
+ * like solid-js/store or @nativescript/tanstack-router/solid to resolve via
160
+ * HTTP, even when the root package is vendored.
161
+ */
162
+ function discoverInstalledPackages(imports, origin) {
163
+ let projectRoot;
164
+ try {
165
+ projectRoot = getProjectRootPath();
166
+ }
167
+ catch {
168
+ return;
169
+ }
170
+ const nodeModulesDir = resolve(projectRoot, 'node_modules');
171
+ if (!existsSync(nodeModulesDir))
172
+ return;
173
+ const addPackage = (name) => {
174
+ const exposure = getDeviceImportMapExposure(name);
175
+ if (exposure === 'omit')
176
+ return;
177
+ // Add exact entry only if not already mapped (vendor packages already have ns-vendor:// exact entries)
178
+ if (exposure === 'full' && !imports[name]) {
179
+ imports[name] = `${origin}/ns/m/node_modules/${name}`;
180
+ }
181
+ // ALWAYS add trailing-slash prefix for HTTP subpath resolution,
182
+ // even for vendor packages. The vendor bundle only covers the root
183
+ // entry point — subpaths like solid-js/store or @nativescript/tanstack-router/solid
184
+ // are separate entry points that must resolve via HTTP.
185
+ if (!imports[name + '/']) {
186
+ imports[name + '/'] = `${origin}/ns/m/node_modules/${name}/`;
187
+ }
188
+ };
189
+ try {
190
+ const entries = readdirSync(nodeModulesDir, { withFileTypes: true });
191
+ for (const entry of entries) {
192
+ if (!entry.isDirectory() && !entry.isSymbolicLink())
193
+ continue;
194
+ const name = entry.name;
195
+ if (name.startsWith('.'))
196
+ continue;
197
+ if (name.startsWith('@')) {
198
+ // Scoped packages: read @scope/ directory
199
+ const scopeDir = join(nodeModulesDir, name);
200
+ try {
201
+ const scopeEntries = readdirSync(scopeDir, { withFileTypes: true });
202
+ for (const scopeEntry of scopeEntries) {
203
+ if (!scopeEntry.isDirectory() && !scopeEntry.isSymbolicLink())
204
+ continue;
205
+ if (scopeEntry.name.startsWith('.'))
206
+ continue;
207
+ addPackage(`${name}/${scopeEntry.name}`);
208
+ }
209
+ }
210
+ catch { }
211
+ }
212
+ else {
213
+ addPackage(name);
214
+ }
215
+ }
216
+ }
217
+ catch { }
218
+ }
219
+ //# sourceMappingURL=import-map.js.map
@@ -0,0 +1 @@
1
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,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;YAC7B,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,EAAE;gBAAE,SAAS;YAC9D,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;YACxB,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC;gBAAE,SAAS;YAEnC,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;gBAC1B,0CAA0C;gBAC1C,MAAM,QAAQ,GAAG,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,CAAC;gBAC5C,IAAI,CAAC;oBACJ,MAAM,YAAY,GAAG,WAAW,CAAC,QAAQ,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;oBACpE,KAAK,MAAM,UAAU,IAAI,YAAY,EAAE,CAAC;wBACvC,IAAI,CAAC,UAAU,CAAC,WAAW,EAAE,IAAI,CAAC,UAAU,CAAC,cAAc,EAAE;4BAAE,SAAS;wBACxE,IAAI,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC;4BAAE,SAAS;wBAC9C,UAAU,CAAC,GAAG,IAAI,IAAI,UAAU,CAAC,IAAI,EAAE,CAAC,CAAC;oBAC1C,CAAC;gBACF,CAAC;gBAAC,MAAM,CAAC,CAAA,CAAC;YACX,CAAC;iBAAM,CAAC;gBACP,UAAU,CAAC,IAAI,CAAC,CAAC;YAClB,CAAC;QACF,CAAC;IACF,CAAC;IAAC,MAAM,CAAC,CAAA,CAAC;AACX,CAAC"}
@@ -1,5 +1,6 @@
1
+ import type { NsDevPlatform } from '../shared/runtime/browser-runtime-contract.js';
1
2
  export declare function getHMRPlugins(opts: {
2
- platform: string;
3
+ platform: NsDevPlatform;
3
4
  flavor: string;
4
5
  verbose: boolean;
5
6
  }): import("vite").Plugin<any>[];
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/vite/hmr/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAEjH,MAAM,UAAU,aAAa,CAAC,IAA4D;IACzF,MAAM,OAAO,GAAG,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC,CAAC;IAC9C,QAAQ,IAAI,CAAC,MAAM,EAAE,CAAC;QACrB,KAAK,KAAK;YACT,OAAO,CAAC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC;YACpC,MAAM;QACP,KAAK,OAAO;YACX,MAAM;QACP,KAAK,SAAS;YACb,OAAO,CAAC,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC,CAAC;YACxC,MAAM;QACP,KAAK,YAAY;YAChB,OAAO,CAAC,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,CAAC,CAAC;YAC3C,MAAM;QACP,KAAK,OAAO;YACX,OAAO,CAAC,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC;YACtC,MAAM;IACR,CAAC;IACD,OAAO,OAAO,CAAC;AAChB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/vite/hmr/server/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAEjH,MAAM,UAAU,aAAa,CAAC,IAAmE;IAChG,MAAM,OAAO,GAAG,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC,CAAC;IAC9C,QAAQ,IAAI,CAAC,MAAM,EAAE,CAAC;QACrB,KAAK,KAAK;YACT,OAAO,CAAC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC;YACpC,MAAM;QACP,KAAK,OAAO;YACX,MAAM;QACP,KAAK,SAAS;YACb,OAAO,CAAC,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC,CAAC;YACxC,MAAM;QACP,KAAK,YAAY;YAChB,OAAO,CAAC,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,CAAC,CAAC;YAC3C,MAAM;QACP,KAAK,OAAO;YACX,OAAO,CAAC,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC;YACtC,MAAM;IACR,CAAC;IACD,OAAO,OAAO,CAAC;AAChB,CAAC"}
@@ -0,0 +1,5 @@
1
+ export declare function normalizeRuntimeGraphPath(value: string): string;
2
+ export declare function isRuntimeGraphExcludedPath(value: string): boolean;
3
+ export declare function shouldSkipRuntimeGraphDirectoryName(name: string): boolean;
4
+ export declare function shouldIncludeRuntimeGraphFile(value: string, filePattern: RegExp): boolean;
5
+ export declare function matchesRuntimeGraphModuleId(value: string, appPrefix: string, filePattern: RegExp): boolean;
@@ -0,0 +1,21 @@
1
+ export function normalizeRuntimeGraphPath(value) {
2
+ return String(value || '')
3
+ .replace(/\\/g, '/')
4
+ .replace(/[?#].*$/, '');
5
+ }
6
+ export function isRuntimeGraphExcludedPath(value) {
7
+ const normalized = normalizeRuntimeGraphPath(value);
8
+ return /(?:^|\/)(?:__tests__|__mocks__)(?:\/|$)|(?:^|\/)[^/]+\.(?:spec|test)\.[^/]+$/i.test(normalized);
9
+ }
10
+ export function shouldSkipRuntimeGraphDirectoryName(name) {
11
+ return name === '__tests__' || name === '__mocks__';
12
+ }
13
+ export function shouldIncludeRuntimeGraphFile(value, filePattern) {
14
+ const normalized = normalizeRuntimeGraphPath(value);
15
+ return filePattern.test(normalized) && !isRuntimeGraphExcludedPath(normalized);
16
+ }
17
+ export function matchesRuntimeGraphModuleId(value, appPrefix, filePattern) {
18
+ const normalized = normalizeRuntimeGraphPath(value);
19
+ return normalized.startsWith(appPrefix) && filePattern.test(normalized) && !isRuntimeGraphExcludedPath(normalized);
20
+ }
21
+ //# sourceMappingURL=runtime-graph-filter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-graph-filter.js","sourceRoot":"","sources":["../../../../../packages/vite/hmr/server/runtime-graph-filter.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,yBAAyB,CAAC,KAAa;IACtD,OAAO,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC;SACxB,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC;SACnB,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;AAC1B,CAAC;AAED,MAAM,UAAU,0BAA0B,CAAC,KAAa;IACvD,MAAM,UAAU,GAAG,yBAAyB,CAAC,KAAK,CAAC,CAAC;IACpD,OAAO,+EAA+E,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;AACzG,CAAC;AAED,MAAM,UAAU,mCAAmC,CAAC,IAAY;IAC/D,OAAO,IAAI,KAAK,WAAW,IAAI,IAAI,KAAK,WAAW,CAAC;AACrD,CAAC;AAED,MAAM,UAAU,6BAA6B,CAAC,KAAa,EAAE,WAAmB;IAC/E,MAAM,UAAU,GAAG,yBAAyB,CAAC,KAAK,CAAC,CAAC;IACpD,OAAO,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,0BAA0B,CAAC,UAAU,CAAC,CAAC;AAChF,CAAC;AAED,MAAM,UAAU,2BAA2B,CAAC,KAAa,EAAE,SAAiB,EAAE,WAAmB;IAChG,MAAM,UAAU,GAAG,yBAAyB,CAAC,KAAK,CAAC,CAAC;IACpD,OAAO,UAAU,CAAC,UAAU,CAAC,SAAS,CAAC,IAAI,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,0BAA0B,CAAC,UAAU,CAAC,CAAC;AACpH,CAAC"}