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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. package/configuration/angular.d.ts +1 -1
  2. package/configuration/angular.js +286 -119
  3. package/configuration/angular.js.map +1 -1
  4. package/configuration/base.js +40 -23
  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/esbuild-platform-resolver.js +5 -5
  27. package/helpers/esbuild-platform-resolver.js.map +1 -1
  28. package/helpers/external-configs.d.ts +9 -1
  29. package/helpers/external-configs.js +31 -6
  30. package/helpers/external-configs.js.map +1 -1
  31. package/helpers/import-meta-path.d.ts +4 -0
  32. package/helpers/import-meta-path.js +5 -0
  33. package/helpers/import-meta-path.js.map +1 -0
  34. package/helpers/import-specifier.d.ts +1 -0
  35. package/helpers/import-specifier.js +18 -0
  36. package/helpers/import-specifier.js.map +1 -0
  37. package/helpers/main-entry.d.ts +4 -2
  38. package/helpers/main-entry.js +86 -10
  39. package/helpers/main-entry.js.map +1 -1
  40. package/helpers/nativeclass-transform.js +8 -127
  41. package/helpers/nativeclass-transform.js.map +1 -1
  42. package/helpers/nativeclass-transformer-plugin.d.ts +12 -1
  43. package/helpers/nativeclass-transformer-plugin.js +175 -36
  44. package/helpers/nativeclass-transformer-plugin.js.map +1 -1
  45. package/hmr/client/css-handler.js +60 -20
  46. package/hmr/client/css-handler.js.map +1 -1
  47. package/hmr/client/index.js +453 -5
  48. package/hmr/client/index.js.map +1 -1
  49. package/hmr/entry-runtime.d.ts +10 -0
  50. package/hmr/entry-runtime.js +263 -21
  51. package/hmr/entry-runtime.js.map +1 -1
  52. package/hmr/frameworks/angular/client/index.js +22 -18
  53. package/hmr/frameworks/angular/client/index.js.map +1 -1
  54. package/hmr/frameworks/angular/server/linker.js +36 -2
  55. package/hmr/frameworks/angular/server/linker.js.map +1 -1
  56. package/hmr/helpers/ast-normalizer.js +22 -10
  57. package/hmr/helpers/ast-normalizer.js.map +1 -1
  58. package/hmr/server/constants.d.ts +1 -0
  59. package/hmr/server/constants.js +2 -0
  60. package/hmr/server/constants.js.map +1 -1
  61. package/hmr/server/core-sanitize.d.ts +42 -0
  62. package/hmr/server/core-sanitize.js +189 -0
  63. package/hmr/server/core-sanitize.js.map +1 -1
  64. package/hmr/server/import-map.d.ts +65 -0
  65. package/hmr/server/import-map.js +213 -0
  66. package/hmr/server/import-map.js.map +1 -0
  67. package/hmr/server/websocket.d.ts +79 -3
  68. package/hmr/server/websocket.js +1888 -233
  69. package/hmr/server/websocket.js.map +1 -1
  70. package/hmr/shared/runtime/dev-overlay.d.ts +38 -0
  71. package/hmr/shared/runtime/dev-overlay.js +664 -0
  72. package/hmr/shared/runtime/dev-overlay.js.map +1 -0
  73. package/hmr/shared/runtime/http-only-boot.d.ts +1 -0
  74. package/hmr/shared/runtime/http-only-boot.js +53 -6
  75. package/hmr/shared/runtime/http-only-boot.js.map +1 -1
  76. package/hmr/shared/runtime/module-provenance.d.ts +1 -0
  77. package/hmr/shared/runtime/module-provenance.js +66 -0
  78. package/hmr/shared/runtime/module-provenance.js.map +1 -0
  79. package/hmr/shared/runtime/platform-polyfills.d.ts +26 -0
  80. package/hmr/shared/runtime/platform-polyfills.js +122 -0
  81. package/hmr/shared/runtime/platform-polyfills.js.map +1 -0
  82. package/hmr/shared/runtime/root-placeholder.js +175 -53
  83. package/hmr/shared/runtime/root-placeholder.js.map +1 -1
  84. package/hmr/shared/runtime/vendor-bootstrap.js +51 -6
  85. package/hmr/shared/runtime/vendor-bootstrap.js.map +1 -1
  86. package/hmr/shared/vendor/manifest.d.ts +5 -0
  87. package/hmr/shared/vendor/manifest.js +339 -13
  88. package/hmr/shared/vendor/manifest.js.map +1 -1
  89. package/hmr/shared/vendor/registry.js +104 -7
  90. package/hmr/shared/vendor/registry.js.map +1 -1
  91. package/package.json +6 -2
  92. package/shims/solid-jsx-runtime.d.ts +7 -0
  93. package/shims/solid-jsx-runtime.js +17 -0
  94. package/shims/solid-jsx-runtime.js.map +1 -0
@@ -131,4 +131,193 @@ export function normalizeAnyCoreSpecToBridge(code) {
131
131
  return code;
132
132
  }
133
133
  }
134
+ /**
135
+ * Rewrite a single import/export specifier for device consumption.
136
+ *
137
+ * Converts Vite-resolved root-relative paths to URLs the device can fetch:
138
+ * /node_modules/@nativescript/core/x/y → /ns/core/{ver}?p=x/y
139
+ * /node_modules/other-pkg/x.js → {origin}/ns/m/node_modules/other-pkg/x.js
140
+ * /src/app/foo.ts → {origin}/ns/m/src/app/foo.ts
141
+ * already /ns/... or http://... → unchanged
142
+ */
143
+ function rewriteSpec(spec, origin, ver) {
144
+ // Strip Vite cache-busting query params for bridge URLs
145
+ const cleanSpec = spec.split('?')[0];
146
+ // @nativescript/core anywhere in the path → core bridge
147
+ const coreIdx = cleanSpec.indexOf('@nativescript/core');
148
+ if (coreIdx !== -1) {
149
+ const after = cleanSpec.substring(coreIdx + '@nativescript/core'.length);
150
+ const sub = after.replace(/^\//, '').trim();
151
+ return sub ? `/ns/core/${ver}?p=${sub}` : `/ns/core/${ver}`;
152
+ }
153
+ // Already a bridge, vendor, or HTTP URL → leave unchanged
154
+ if (spec.startsWith('/ns/') || spec.startsWith('http://') || spec.startsWith('https://') || spec.startsWith('ns-vendor://')) {
155
+ return spec;
156
+ }
157
+ // Root-relative paths → HTTP URL through /ns/m/ handler
158
+ if (spec.startsWith('/')) {
159
+ return `${origin}/ns/m${spec}`;
160
+ }
161
+ return spec;
162
+ }
163
+ /**
164
+ * Minimal specifier rewriter for deep subpath core modules.
165
+ *
166
+ * Takes Vite's correctly-transformed ESM output and ONLY rewrites the
167
+ * specifier strings inside import/export clauses. Does NOT:
168
+ * - Inject global defines
169
+ * - Run AST normalization
170
+ * - Convert named imports to default + destructure
171
+ * - Mangle newlines or code structure
172
+ *
173
+ * This replaces the heavy 5-pass pipeline (processCodeForDevice →
174
+ * rewriteImports → deduplicateLinkerImports → CJS wrapping → etc.)
175
+ * for deep subpath core modules where Vite already produces correct ESM.
176
+ */
177
+ export function rewriteSpecifiersForDevice(code, origin, ver) {
178
+ if (!code)
179
+ return code;
180
+ let result = code;
181
+ // Pattern 1: from "specifier" — covers all static import/export forms
182
+ // import { X } from "spec"
183
+ // import X from "spec"
184
+ // import * as X from "spec"
185
+ // export { X } from "spec"
186
+ // export * from "spec"
187
+ result = result.replace(/(from\s*)(["'])([^"']+)\2/g, (_m, pre, q, spec) => {
188
+ return `${pre}${q}${rewriteSpec(spec, origin, ver)}${q}`;
189
+ });
190
+ // Pattern 2: import("specifier") — dynamic imports
191
+ result = result.replace(/(import\s*\(\s*)(["'])([^"']+)\2(\s*\))/g, (_m, pre, q, spec, post) => {
192
+ return `${pre}${q}${rewriteSpec(spec, origin, ver)}${q}${post}`;
193
+ });
194
+ // Pattern 3: import "specifier" — side-effect imports (no from clause)
195
+ // Anchored after line start, newline, or semicolon to avoid false matches
196
+ result = result.replace(/([;\n]\s*import\s+)(["'])([^"']+)\2/g, (_m, pre, q, spec) => {
197
+ // Skip if it looks like an identifier rather than a path
198
+ if (!/[/.@]/.test(spec))
199
+ return _m;
200
+ return `${pre}${q}${rewriteSpec(spec, origin, ver)}${q}`;
201
+ });
202
+ return result;
203
+ }
204
+ /**
205
+ * Determine whether a `/ns/core` bridge URL points to a real subpath module.
206
+ *
207
+ * Any `/ns/core?p=...` module now serves real ESM content with real named
208
+ * exports via Vite's transform pipeline, including shallow paths like
209
+ * `/ns/core?p=index.js` and `/ns/core?p=utils`.
210
+ * The main proxy bridge (`/ns/core`) still only exports a default Proxy and
211
+ * requires named imports to be destructured from it.
212
+ *
213
+ * This check is used in all named-import-to-default destructuring passes to
214
+ * skip rewriting for real subpath modules — they have named exports that work
215
+ * natively without conversion.
216
+ */
217
+ export function isDeepCoreSubpath(url) {
218
+ return /\?p=([^&'"#]+)/.test(url);
219
+ }
220
+ /**
221
+ * Synthesize a `default` export for an ESM module that only has named/star
222
+ * exports. Utility function — not currently called from the core bridge
223
+ * handler since `ensureDestructureCoreImports` now skips deep subpaths.
224
+ *
225
+ * Handles all three @nativescript/core patterns:
226
+ * 1. Direct declarations: export class X, export function Y, export const Z
227
+ * 2. Named re-exports: export { A, B } from '/path'
228
+ * 3. Star re-exports: export * from '/path'
229
+ *
230
+ * Returns the code unchanged if it already has a default export or CJS exports.
231
+ */
232
+ export function synthesizeDefaultExport(moduleCode) {
233
+ if (!moduleCode || typeof moduleCode !== 'string')
234
+ return moduleCode;
235
+ const hasExportDefault = /\bexport\s+default\b/.test(moduleCode) || /export\s*\{\s*default\s*(?:as\s*default)?\s*\}/.test(moduleCode);
236
+ if (hasExportDefault)
237
+ return moduleCode;
238
+ const hasCjsExports = /\bmodule\s*\.\s*exports\b/.test(moduleCode) || /\bexports\s*\.\s*\w/.test(moduleCode);
239
+ if (hasCjsExports)
240
+ return moduleCode;
241
+ try {
242
+ const bindings = []; // [localName, exportedName]
243
+ const extraImports = [];
244
+ const starSpreads = [];
245
+ let sIdx = 0;
246
+ let m;
247
+ // export { A, b as B } [from 'src'] — handles both local and re-exports
248
+ const reBraces = /\bexport\s*\{([^}]+)\}\s*(?:from\s*["']([^"']+)["'])?/g;
249
+ while ((m = reBraces.exec(moduleCode)) !== null) {
250
+ const specList = m[1];
251
+ const fromSrc = m[2]; // undefined for local exports
252
+ const specs = specList
253
+ .split(',')
254
+ .map((s) => s.trim())
255
+ .filter(Boolean);
256
+ for (const spec of specs) {
257
+ const parts = spec.split(/\s+as\s+/);
258
+ const srcName = parts[0].trim();
259
+ const expName = parts.length > 1 ? parts[1].trim() : srcName;
260
+ if (!expName || expName === 'default')
261
+ continue;
262
+ // For re-exports, the local name is the exported name (from the import we add below)
263
+ // For local exports, the local name is srcName (already in scope)
264
+ bindings.push(fromSrc ? [expName, expName] : [srcName, expName]);
265
+ }
266
+ if (fromSrc) {
267
+ const importSpecs = specs
268
+ .map((spec) => {
269
+ const parts = spec.split(/\s+as\s+/);
270
+ const srcName = parts[0].trim();
271
+ const expName = parts.length > 1 ? parts[1].trim() : srcName;
272
+ if (!expName || expName === 'default')
273
+ return '';
274
+ return parts.length > 1 ? `${srcName} as ${expName}` : expName;
275
+ })
276
+ .filter(Boolean);
277
+ if (importSpecs.length) {
278
+ extraImports.push(`import { ${importSpecs.join(', ')} } from ${JSON.stringify(fromSrc)};`);
279
+ }
280
+ }
281
+ }
282
+ // export const/let/var X
283
+ const reDecl = /\bexport\s+(?:const|let|var)\s+([A-Za-z_$][\w$]*)/g;
284
+ while ((m = reDecl.exec(moduleCode)) !== null) {
285
+ bindings.push([m[1], m[1]]);
286
+ }
287
+ // export [async] function[*]/class X
288
+ const reFunc = /\bexport\s+(?:async\s+)?(?:function\s*\*?|class)\s+([A-Za-z_$][\w$]*)/g;
289
+ while ((m = reFunc.exec(moduleCode)) !== null) {
290
+ bindings.push([m[1], m[1]]);
291
+ }
292
+ // export * as X from 'src' (namespace re-export)
293
+ const reStarAs = /\bexport\s*\*\s*as\s+([A-Za-z_$][\w$]*)\s+from\s*["']([^"']+)["']/g;
294
+ while ((m = reStarAs.exec(moduleCode)) !== null) {
295
+ extraImports.push(`import * as ${m[1]} from ${JSON.stringify(m[2])};`);
296
+ bindings.push([m[1], m[1]]);
297
+ }
298
+ // export * from 'src' (bare star re-export, NOT 'export * as')
299
+ const reStarBare = /\bexport\s*\*\s*(?!as\s)from\s*["']([^"']+)["']/g;
300
+ while ((m = reStarBare.exec(moduleCode)) !== null) {
301
+ const v = `__ns_star_${sIdx++}`;
302
+ extraImports.push(`import * as ${v} from ${JSON.stringify(m[1])};`);
303
+ starSpreads.push(`...${v}`);
304
+ }
305
+ if (bindings.length > 0 || starSpreads.length > 0) {
306
+ const entries = [...starSpreads];
307
+ const seen = new Set();
308
+ for (const [local, exported] of bindings) {
309
+ if (seen.has(exported))
310
+ continue;
311
+ seen.add(exported);
312
+ entries.push(local === exported ? exported : `${JSON.stringify(exported)}: ${local}`);
313
+ }
314
+ const prefix = extraImports.length ? extraImports.join('\n') + '\n' : '';
315
+ return prefix + moduleCode + `\nvar __ns_default_export = { ${entries.join(', ')} };\nexport { __ns_default_export as default };\n`;
316
+ }
317
+ return moduleCode;
318
+ }
319
+ catch {
320
+ return moduleCode;
321
+ }
322
+ }
134
323
  //# 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,EAA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C,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;YAC/B,KAAK,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,IAAI,QAAQ,EAAE,CAAC;gBAC1C,IAAI,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC;oBAAE,SAAS;gBACjC,IAAI,CAAC,GAAG,CAAC,QAAQ,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,213 @@
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
+ /**
28
+ * Generate an import map from the current vendor manifest.
29
+ *
30
+ * Vendor modules are mapped to ns-vendor:// protocol URLs, which the
31
+ * native runtime resolves from the in-memory vendor registry (populated
32
+ * by vendor-bootstrap.ts).
33
+ *
34
+ * IMPORTANT: Vendor entries are EXACT only (no trailing-slash prefixes).
35
+ * The vendor bundle contains only root entry points. Subpath imports like
36
+ * solid-js/store or @nativescript/tanstack-router/solid are separate entry
37
+ * points with different exports — they must NOT resolve to the root vendor
38
+ * module. Instead, they fall through to the HTTP trailing-slash prefix
39
+ * entries from discoverInstalledPackages().
40
+ *
41
+ * @nativescript/core is mapped to the HTTP bridge endpoint.
42
+ * Everything else falls through to the runtime's normal resolution.
43
+ */
44
+ export function generateImportMap(options) {
45
+ const { origin, flavor, extraEntries } = options;
46
+ const manifest = getVendorManifest();
47
+ const imports = {};
48
+ if (manifest) {
49
+ // Map vendor modules to ns-vendor:// — EXACT entries only.
50
+ // No trailing-slash prefixes: subpaths must resolve via HTTP, not vendor.
51
+ const vendorModules = listVendorModules();
52
+ for (const specifier of vendorModules) {
53
+ imports[specifier] = `ns-vendor://${specifier}`;
54
+ }
55
+ // Map aliases from the manifest (e.g., "solid-js/web" → ns-vendor://solid-js)
56
+ if (manifest.aliases) {
57
+ for (const [alias, canonical] of Object.entries(manifest.aliases)) {
58
+ if (!imports[alias] && imports[canonical]) {
59
+ imports[alias] = imports[canonical];
60
+ }
61
+ }
62
+ }
63
+ }
64
+ // @nativescript/core → bridge endpoint
65
+ imports['@nativescript/core'] = `${origin}/ns/core`;
66
+ imports['@nativescript/core/'] = `${origin}/ns/core/`;
67
+ // Add framework-specific entries
68
+ addFrameworkEntries(imports, origin, flavor);
69
+ // Scan installed packages and add HTTP URL entries for ALL packages
70
+ // (including vendor ones for their subpath imports).
71
+ discoverInstalledPackages(imports, origin);
72
+ // Merge extra entries (user-provided or from framework strategies)
73
+ if (extraEntries) {
74
+ Object.assign(imports, extraEntries);
75
+ }
76
+ return { imports };
77
+ }
78
+ /**
79
+ * Get volatile URL patterns for the current framework.
80
+ * These patterns tell the runtime to always re-fetch matching URLs
81
+ * instead of using cached modules.
82
+ */
83
+ export function getVolatilePatterns(flavor) {
84
+ const patterns = [];
85
+ // Version query params (used by HMR for cache busting)
86
+ patterns.push('?v=');
87
+ patterns.push('&v=');
88
+ // Framework-specific volatile patterns
89
+ switch (flavor) {
90
+ case 'vue':
91
+ // Vue SFC endpoints are volatile (change on every edit)
92
+ patterns.push('/@ns/sfc/');
93
+ patterns.push('/@ns/asm/');
94
+ break;
95
+ case 'angular':
96
+ // Angular template/style URLs may change on edit
97
+ patterns.push('/@ns/asm/');
98
+ break;
99
+ }
100
+ return patterns;
101
+ }
102
+ /**
103
+ * Serialize the import map + volatile patterns into the config object
104
+ * that __nsConfigureRuntime() expects.
105
+ */
106
+ export function buildRuntimeConfig(options) {
107
+ const importMap = generateImportMap(options);
108
+ const volatilePatterns = getVolatilePatterns(options.flavor);
109
+ return {
110
+ importMap: JSON.stringify(importMap),
111
+ volatilePatterns,
112
+ };
113
+ }
114
+ function addFrameworkEntries(imports, _origin, flavor) {
115
+ switch (flavor) {
116
+ case 'vue':
117
+ // nativescript-vue should resolve from vendor if available
118
+ if (!imports['nativescript-vue']) {
119
+ imports['nativescript-vue'] = `ns-vendor://nativescript-vue`;
120
+ }
121
+ if (!imports['vue']) {
122
+ imports['vue'] = `ns-vendor://vue`;
123
+ }
124
+ break;
125
+ case 'solid':
126
+ // Solid runtime root should resolve from vendor
127
+ if (!imports['solid-js']) {
128
+ imports['solid-js'] = `ns-vendor://solid-js`;
129
+ }
130
+ // No trailing-slash prefix — subpaths like solid-js/store,
131
+ // solid-js/jsx-runtime resolve via HTTP from discoverInstalledPackages()
132
+ break;
133
+ }
134
+ }
135
+ /**
136
+ * Scan the project's node_modules to discover ALL installed packages and
137
+ * add import map entries. Vendor packages get only trailing-slash prefix
138
+ * entries (their exact entries are already set to ns-vendor://). Non-vendor
139
+ * packages get both exact and trailing-slash entries.
140
+ *
141
+ * The trailing-slash prefix entries are critical: they enable subpath imports
142
+ * like solid-js/store or @nativescript/tanstack-router/solid to resolve via
143
+ * HTTP, even when the root package is vendored.
144
+ */
145
+ function discoverInstalledPackages(imports, origin) {
146
+ let projectRoot;
147
+ try {
148
+ projectRoot = getProjectRootPath();
149
+ }
150
+ catch {
151
+ return;
152
+ }
153
+ const nodeModulesDir = resolve(projectRoot, 'node_modules');
154
+ if (!existsSync(nodeModulesDir))
155
+ return;
156
+ // Packages that should never be in the import map (build tools, types)
157
+ const SKIP_PREFIXES = ['@types/', '@babel/', 'babel-', '@nativescript/types'];
158
+ const SKIP_EXACT = new Set(['typescript', 'ts-node', 'esbuild', 'prettier', 'webpack', '@nativescript/android', '@nativescript/ios', '@nativescript/visionos', '@nativescript/webpack', '@nativescript/types']);
159
+ const shouldSkip = (name) => {
160
+ if (SKIP_EXACT.has(name))
161
+ return true;
162
+ for (const prefix of SKIP_PREFIXES) {
163
+ if (name.startsWith(prefix))
164
+ return true;
165
+ }
166
+ return false;
167
+ };
168
+ const addPackage = (name) => {
169
+ if (shouldSkip(name))
170
+ return;
171
+ // Add exact entry only if not already mapped (vendor packages already have ns-vendor:// exact entries)
172
+ if (!imports[name]) {
173
+ imports[name] = `${origin}/ns/m/node_modules/${name}`;
174
+ }
175
+ // ALWAYS add trailing-slash prefix for HTTP subpath resolution,
176
+ // even for vendor packages. The vendor bundle only covers the root
177
+ // entry point — subpaths like solid-js/store or @nativescript/tanstack-router/solid
178
+ // are separate entry points that must resolve via HTTP.
179
+ if (!imports[name + '/']) {
180
+ imports[name + '/'] = `${origin}/ns/m/node_modules/${name}/`;
181
+ }
182
+ };
183
+ try {
184
+ const entries = readdirSync(nodeModulesDir, { withFileTypes: true });
185
+ for (const entry of entries) {
186
+ if (!entry.isDirectory() && !entry.isSymbolicLink())
187
+ continue;
188
+ const name = entry.name;
189
+ if (name.startsWith('.'))
190
+ continue;
191
+ if (name.startsWith('@')) {
192
+ // Scoped packages: read @scope/ directory
193
+ const scopeDir = join(nodeModulesDir, name);
194
+ try {
195
+ const scopeEntries = readdirSync(scopeDir, { withFileTypes: true });
196
+ for (const scopeEntry of scopeEntries) {
197
+ if (!scopeEntry.isDirectory() && !scopeEntry.isSymbolicLink())
198
+ continue;
199
+ if (scopeEntry.name.startsWith('.'))
200
+ continue;
201
+ addPackage(`${name}/${scopeEntry.name}`);
202
+ }
203
+ }
204
+ catch { }
205
+ }
206
+ else {
207
+ addPackage(name);
208
+ }
209
+ }
210
+ }
211
+ catch { }
212
+ }
213
+ //# sourceMappingURL=import-map.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"import-map.js","sourceRoot":"","sources":["../../../../../packages/vite/hmr/server/import-map.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;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AQ,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,10 +1,86 @@
1
- import type { Plugin } from 'vite';
1
+ import type { Plugin, TransformResult } from 'vite';
2
2
  import '../vendor-bootstrap.js';
3
- export declare function ensureNativeScriptModuleBindings(code: string): string;
3
+ export declare function tryReadRawExplicitJavaScriptModule(spec: string, projectRoot: string): {
4
+ code: string;
5
+ resolvedId: string;
6
+ } | null;
7
+ type HotUpdateGraphModuleLike = {
8
+ id?: string | null;
9
+ importedModules?: Iterable<{
10
+ id?: string | null;
11
+ }>;
12
+ importers?: Iterable<HotUpdateGraphModuleLike>;
13
+ };
14
+ export declare function buildBootProgressSnippet(bootModuleLabel: string): string;
15
+ export declare function collectGraphUpdateModulesForHotUpdate(options: {
16
+ file: string;
17
+ flavor: string;
18
+ modules?: Iterable<HotUpdateGraphModuleLike>;
19
+ getModuleById: (id: string) => HotUpdateGraphModuleLike | undefined;
20
+ }): HotUpdateGraphModuleLike[];
21
+ export declare function collectAngularHotUpdateRoots(options: {
22
+ file: string;
23
+ modules?: Iterable<HotUpdateGraphModuleLike>;
24
+ getModuleById: (id: string) => HotUpdateGraphModuleLike | undefined;
25
+ getModulesByFile?: (file: string) => Iterable<HotUpdateGraphModuleLike> | undefined | null;
26
+ }): HotUpdateGraphModuleLike[];
27
+ type TransitiveImporterModuleLike = {
28
+ id?: string | null;
29
+ file?: string | null;
30
+ importers?: Iterable<TransitiveImporterModuleLike> | null;
31
+ };
32
+ export declare function collectAngularTransitiveImportersForInvalidation(options: {
33
+ modules: Iterable<TransitiveImporterModuleLike> | undefined | null;
34
+ isExcluded?: (id: string) => boolean;
35
+ maxDepth?: number;
36
+ }): TransitiveImporterModuleLike[];
37
+ export declare function shouldInvalidateAngularTransitiveImporters(options: {
38
+ flavor: string;
39
+ file: string;
40
+ }): boolean;
41
+ export declare function shouldSuppressDefaultViteHotUpdate(options: {
42
+ flavor: string;
43
+ file: string;
44
+ }): boolean;
45
+ type PendingAngularReloadSuppressionEntry = {
46
+ absPath: string;
47
+ relPath: string;
48
+ expiresAt: number;
49
+ };
50
+ export declare function normalizeHotReloadMatchPath(raw: string, root?: string): string;
51
+ export declare function shouldSuppressViteFullReloadPayload(options: {
52
+ payload: any;
53
+ pendingEntries: Iterable<PendingAngularReloadSuppressionEntry>;
54
+ root?: string;
55
+ now?: number;
56
+ }): boolean;
57
+ type SharedTransformRequestRunnerOptions = {
58
+ maxConcurrent?: number;
59
+ resultCacheTtlMs?: number;
60
+ getResultCacheKey?: (url: string) => string;
61
+ };
62
+ type SharedTransformRequestRunner = ((url: string, timeoutMs?: number) => Promise<TransformResult | null>) & {
63
+ invalidate: (url: string) => void;
64
+ invalidateMany: (urls: Iterable<string>) => void;
65
+ clear: () => void;
66
+ };
67
+ export declare function createSharedTransformRequestRunner(transformRequest: (url: string) => Promise<TransformResult | null>, onTimeout?: (url: string, timeoutMs: number) => void, options?: SharedTransformRequestRunnerOptions): SharedTransformRequestRunner;
68
+ export declare function ensureNativeScriptModuleBindings(code: string, options?: {
69
+ preserveNonPluginVendorImports?: boolean;
70
+ }): string;
71
+ export declare function normalizeNodeModulesSpecifier(spec: string): string | null;
72
+ export declare function resolveVendorFromCandidate(specifier: string | null | undefined): string | null;
73
+ export declare function filterExistingNodeModulesTransformCandidates(spec: string, candidates: string[], projectRoot: string): string[];
74
+ export declare function buildVersionedCoreSubpathAliasModule(sub: string, ver: number | string): string;
75
+ export declare function wrapCommonJsModuleForDevice(code: string): string;
4
76
  /**
5
77
  * Process code for device: inject globals, remove framework imports
6
78
  */
7
- declare function processCodeForDevice(code: string, isVitePreBundled: boolean): string;
79
+ declare function processCodeForDevice(code: string, isVitePreBundled: boolean, preserveVendorImports?: boolean, isNodeModule?: boolean, sourceId?: string): string;
80
+ /**
81
+ * THE SINGLE REWRITE FUNCTION - used everywhere for consistency
82
+ */
83
+ export declare function rewriteImports(code: string, importerPath: string, sfcFileMap: Map<string, string>, depFileMap: Map<string, string>, projectRoot: string, verbose?: boolean, outputDirOverrideRel?: string, httpOrigin?: string, resolveVendorAsHttp?: boolean): string;
8
84
  export declare function hmrWebSocketVue(opts: {
9
85
  verbose?: boolean;
10
86
  }): Plugin;