@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,368 @@
1
+ import { existsSync, readFileSync, statSync } from 'node:fs';
2
+ import * as path from 'node:path';
3
+ import { normalizeCoreSub } from '../../helpers/ns-core-url.js';
4
+ // Detect (and log) `require('http(s)://...')` calls made from CJS shims.
5
+ // Pattern: HTTP-served ESM modules end up in NS-vite's `__nsRequire`
6
+ // shim with HTTP URLs as their relative resolution targets. The guard
7
+ // is install-once-per-isolate, dedupes per-URL (so semver's ~30 deep
8
+ // imports produce ~30 lines on the first boot and 0 on subsequent
9
+ // boots within the same isolate), and uses `console.warn` so the
10
+ // message reads as advisory. Forensic detail
11
+ // (stack) lives on `globalThis.__NS_REQUIRE_GUARD_LAST__` for
12
+ // post-mortem inspection. Set `globalThis.__NS_REQUIRE_GUARD_VERBOSE__`
13
+ // to `true` before any module loads to restore per-call logging.
14
+ const REQUIRE_GUARD_SNIPPET = `// [guard] install require('http(s)://') detector\n(()=>{try{var g=globalThis;if(g.__NS_REQUIRE_GUARD_INSTALLED__){}else{var seen=g.__NS_REQUIRE_GUARD_SEEN__||(g.__NS_REQUIRE_GUARD_SEEN__=new Set());var mk=function(o,l){return function(){try{var s=arguments[0];if(typeof s==='string'&&/^(?:https?:)\\/\\//.test(s)){var k=l+'|'+s;var v=g.__NS_REQUIRE_GUARD_VERBOSE__===true;var first=!seen.has(k);if(first)seen.add(k);if(first||v){var e=new Error('[ns-hmr][require-guard] require of URL: '+s+' via '+l);if(v)console.warn(e.message+'\\n'+(e.stack||''));else console.warn(e.message);try{g.__NS_REQUIRE_GUARD_LAST__={spec:s,stack:e.stack,label:l,ts:Date.now()};}catch(e3){}}}}catch(e1){}return o.apply(this, arguments);};};if(typeof g.require==='function'&&!g.require.__NS_REQ_GUARDED__){var o1=g.require;g.require=mk(o1,'require');g.require.__NS_REQ_GUARDED__=true;}if(typeof g.__nsRequire==='function'&&!g.__nsRequire.__NS_REQ_GUARDED__){var o2=g.__nsRequire;g.__nsRequire=mk(o2,'__nsRequire');g.__nsRequire.__NS_REQ_GUARDED__=true;}g.__NS_REQUIRE_GUARD_INSTALLED__=true;}}catch(e){}})();\n`;
15
+ export function extractDirectExportedNames(code) {
16
+ const names = new Set();
17
+ const declRe = /\bexport\s+(?:async\s+)?(?:function|class)\s+([A-Za-z_$][\w$]*)/g;
18
+ let match;
19
+ while ((match = declRe.exec(code)) !== null) {
20
+ names.add(match[1]);
21
+ }
22
+ const namespaceRe = /\bexport\s+namespace\s+([A-Za-z_$][\w$]*)/g;
23
+ while ((match = namespaceRe.exec(code)) !== null) {
24
+ names.add(match[1]);
25
+ }
26
+ const varRe = /\bexport\s+(?:const|let|var)\s+([^=;{]+)/g;
27
+ while ((match = varRe.exec(code)) !== null) {
28
+ const decl = match[1].trim();
29
+ if (decl.startsWith('{')) {
30
+ const inner = decl.replace(/^\{|\}$/g, '');
31
+ for (const part of inner.split(',')) {
32
+ const name = part.split(':')[0].trim();
33
+ if (/^[A-Za-z_$][\w$]*$/.test(name))
34
+ names.add(name);
35
+ }
36
+ }
37
+ else {
38
+ const name = decl.split(/[\s,=]/)[0].trim();
39
+ if (/^[A-Za-z_$][\w$]*$/.test(name))
40
+ names.add(name);
41
+ }
42
+ }
43
+ const directBraceRe = /\bexport\s*\{([^}]+)\}(?!\s*from)/g;
44
+ while ((match = directBraceRe.exec(code)) !== null) {
45
+ for (const part of match[1].split(',')) {
46
+ const trimmed = part.trim();
47
+ const asMatch = trimmed.match(/(\S+)\s+as\s+(\S+)/);
48
+ const name = asMatch ? asMatch[2] : trimmed.split(/\s/)[0];
49
+ if (name && /^[A-Za-z_$][\w$]*$/.test(name) && name !== 'default') {
50
+ names.add(name);
51
+ }
52
+ }
53
+ }
54
+ return Array.from(names);
55
+ }
56
+ function parseExportSpecList(specList) {
57
+ return String(specList || '')
58
+ .split(',')
59
+ .map((part) => part.trim())
60
+ .filter(Boolean)
61
+ .map((part) => {
62
+ const asMatch = part.match(/(\S+)\s+as\s+(\S+)/i);
63
+ if (asMatch) {
64
+ return { importedName: asMatch[1].trim(), exportedName: asMatch[2].trim() };
65
+ }
66
+ const name = part.split(/\s/)[0]?.trim() || '';
67
+ return { importedName: name, exportedName: name };
68
+ })
69
+ .filter(({ exportedName, importedName }) => /^[A-Za-z_$][\w$]*$/.test(exportedName) && exportedName !== 'default' && /^[A-Za-z_$][\w$]*$/.test(importedName));
70
+ }
71
+ function runtimeModuleIdForFile(modulePath, rootEntryPath) {
72
+ const cleanedPath = String(modulePath || '').replace(/[?#].*$/, '');
73
+ const cleanedRoot = String(rootEntryPath || '').replace(/[?#].*$/, '');
74
+ if (!cleanedPath || !cleanedRoot)
75
+ return null;
76
+ const rootDir = path.dirname(cleanedRoot);
77
+ let rel = path.relative(rootDir, cleanedPath).replace(/\\/g, '/');
78
+ if (!rel || rel === 'index.ts' || rel === 'index.js' || rel === 'index.mjs') {
79
+ return '@nativescript/core';
80
+ }
81
+ rel = rel.replace(/\.(?:ts|js|mjs)$/, '');
82
+ rel = rel.replace(/\/index$/, '');
83
+ return `@nativescript/core/${rel}`;
84
+ }
85
+ function runtimeModuleIdFromLocalSpecifier(spec, currentModuleId) {
86
+ if (!spec.startsWith('.'))
87
+ return spec || null;
88
+ const base = currentModuleId.replace(/^@nativescript\/core(?:\/|$)/, '');
89
+ const baseDir = base ? `/${base}` : '/';
90
+ let rel = path.posix.normalize(path.posix.join(baseDir, spec)).replace(/^\/+/, '');
91
+ rel = rel.replace(/\.(?:ts|js|mjs)$/, '');
92
+ rel = rel.replace(/\/index$/, '');
93
+ return rel ? `@nativescript/core/${rel}` : '@nativescript/core';
94
+ }
95
+ function canonicalCoreSubpathForFile(modulePath, rootEntryPath) {
96
+ const cleanedPath = String(modulePath || '').replace(/[?#].*$/, '');
97
+ const cleanedRoot = String(rootEntryPath || '').replace(/[?#].*$/, '');
98
+ if (!cleanedPath || !cleanedRoot)
99
+ return null;
100
+ const rootDir = path.dirname(cleanedRoot);
101
+ let rel = path.relative(rootDir, cleanedPath).replace(/\\/g, '/');
102
+ if (!rel || rel === 'index.ts' || rel === 'index.js' || rel === 'index.mjs') {
103
+ return null;
104
+ }
105
+ rel = rel.replace(/\.(?:ts|js|mjs)$/, '.js');
106
+ return rel;
107
+ }
108
+ function canonicalCoreSubpathFromLocalSpecifier(spec, currentCanonicalSubpath) {
109
+ if (!spec.startsWith('.'))
110
+ return null;
111
+ const baseDir = currentCanonicalSubpath ? path.posix.dirname(currentCanonicalSubpath) : '.';
112
+ let rel = path.posix.normalize(path.posix.join(baseDir, spec)).replace(/^\.?\/?/, '');
113
+ if (!rel)
114
+ return null;
115
+ if (/\.(?:ts|js|mjs)$/i.test(rel)) {
116
+ return rel.replace(/\.(?:ts|js|mjs)$/i, '.js');
117
+ }
118
+ return `${rel.replace(/\/+$/, '')}/index.js`;
119
+ }
120
+ export async function resolveRuntimeCoreModulePath(normalizedSubpath, resolveModuleId) {
121
+ const cleanedSubpath = String(normalizedSubpath || '').replace(/^\/+/, '');
122
+ const candidates = [];
123
+ if (!cleanedSubpath || cleanedSubpath === 'index.js') {
124
+ candidates.push('@nativescript/core');
125
+ }
126
+ else {
127
+ if (/\/index\.js$/i.test(cleanedSubpath)) {
128
+ const packageSubpath = cleanedSubpath.replace(/\/index\.js$/i, '');
129
+ if (packageSubpath) {
130
+ candidates.push(`@nativescript/core/${packageSubpath}`);
131
+ }
132
+ }
133
+ candidates.push(`@nativescript/core/${cleanedSubpath}`);
134
+ }
135
+ for (const candidate of candidates) {
136
+ try {
137
+ const resolved = await resolveModuleId(candidate);
138
+ if (resolved) {
139
+ return String(resolved).replace(/[?#].*$/, '');
140
+ }
141
+ }
142
+ catch { }
143
+ }
144
+ return null;
145
+ }
146
+ function appendCoreExportOrigin(map, exportedName, origin) {
147
+ if (!/^[A-Za-z_$][\w$]*$/.test(exportedName) || exportedName === 'default')
148
+ return;
149
+ const existing = map[exportedName] || (map[exportedName] = []);
150
+ if (existing.some((entry) => entry.moduleId === origin.moduleId && entry.mode === origin.mode && entry.importedName === origin.importedName)) {
151
+ return;
152
+ }
153
+ existing.push(origin);
154
+ }
155
+ function resolveLocalExportTarget(spec, importerId) {
156
+ const importerPath = String(importerId || '').replace(/[?#].*$/, '');
157
+ if (!importerPath)
158
+ return null;
159
+ const importerDir = path.dirname(importerPath);
160
+ // Include platform-specific variants (.ios.js / .android.js / .visionos.js).
161
+ // @nativescript/core ships only platform-specific files for many submodules
162
+ // (e.g. `./application/index.ios.js`, no plain `./application/index.js`), so
163
+ // a plain Node-style resolution misses them and the recursive export-name
164
+ // walk fails to follow `export * from './application'`. Without this, the
165
+ // /ns/core bridge's named-export list omits `Application`, and any static
166
+ // `import { Application } from '@nativescript/core'` through the bridge
167
+ // fails with "module does not provide an export named 'Application'".
168
+ //
169
+ // Prefer .ios variants at the top since the HMR dev server is iOS-first;
170
+ // .android variants are still tried so Android serving also works.
171
+ const platformVariants = ['.ios.ts', '.ios.js', '.ios.mjs', '.android.ts', '.android.js', '.android.mjs', '.visionos.ts', '.visionos.js', '.visionos.mjs'];
172
+ const candidates = [path.resolve(importerDir, spec), path.resolve(importerDir, `${spec}.ts`), path.resolve(importerDir, `${spec}.js`), path.resolve(importerDir, `${spec}.mjs`), ...platformVariants.map((ext) => path.resolve(importerDir, `${spec}${ext}`)), path.resolve(importerDir, spec, 'index.ts'), path.resolve(importerDir, spec, 'index.js'), path.resolve(importerDir, spec, 'index.mjs'), ...platformVariants.map((ext) => path.resolve(importerDir, spec, `index${ext}`))];
173
+ for (const candidate of candidates) {
174
+ if (existsSync(candidate) && !statSync(candidate).isDirectory()) {
175
+ return candidate;
176
+ }
177
+ }
178
+ return null;
179
+ }
180
+ export function collectStaticExportNamesFromFile(modulePath, seen = new Set()) {
181
+ return Object.keys(collectStaticExportOriginsFromFile(modulePath, modulePath, seen));
182
+ }
183
+ export function collectStaticExportOriginsFromFile(modulePath, rootEntryPath = modulePath, seen = new Set()) {
184
+ const cleanedPath = String(modulePath || '').replace(/[?#].*$/, '');
185
+ const cleanedRoot = String(rootEntryPath || '').replace(/[?#].*$/, '');
186
+ if (!cleanedPath || !cleanedRoot || seen.has(cleanedPath) || !existsSync(cleanedPath)) {
187
+ return {};
188
+ }
189
+ seen.add(cleanedPath);
190
+ let code = '';
191
+ try {
192
+ code = readFileSync(cleanedPath, 'utf8');
193
+ }
194
+ catch {
195
+ return {};
196
+ }
197
+ const currentModuleId = runtimeModuleIdForFile(cleanedPath, cleanedRoot) || '@nativescript/core';
198
+ const currentCanonicalSubpath = canonicalCoreSubpathForFile(cleanedPath, cleanedRoot);
199
+ // Use a null-prototype map so keys like `toString`, `constructor`, or
200
+ // `hasOwnProperty` — which DO appear as real exports in some core
201
+ // subpaths (e.g. `@nativescript/core/ui/gestures/gestures-common`
202
+ // re-exports `toString`) — don't collide with Object.prototype's own
203
+ // properties. Previously `origins['toString']` returned the inherited
204
+ // Function, and the subsequent `existing.some(...)` call threw
205
+ // "existing.some is not a function", causing the whole subpath's
206
+ // export discovery to bail and fall back to a pure `export *` which
207
+ // in turn leaked into the "hasKey not provided" downstream crash.
208
+ const origins = Object.create(null);
209
+ for (const name of extractDirectExportedNames(code)) {
210
+ appendCoreExportOrigin(origins, name, { moduleId: currentModuleId, mode: 'named', importedName: name, canonicalSubpath: currentCanonicalSubpath || undefined });
211
+ }
212
+ const starAsRe = /\bexport\s+\*\s+as\s+([A-Za-z_$][\w$]*)\s+from\s+["']([^"']+)["']/g;
213
+ let match;
214
+ while ((match = starAsRe.exec(code)) !== null) {
215
+ const exportedName = match[1];
216
+ const spec = match[2];
217
+ const resolvedTarget = spec.startsWith('.') ? resolveLocalExportTarget(spec, cleanedPath) : null;
218
+ const moduleId = resolvedTarget ? runtimeModuleIdForFile(resolvedTarget, cleanedRoot) : spec.startsWith('.') ? runtimeModuleIdFromLocalSpecifier(spec, currentModuleId) : spec;
219
+ const canonicalSubpath = resolvedTarget ? canonicalCoreSubpathForFile(resolvedTarget, cleanedRoot) : spec.startsWith('.') ? canonicalCoreSubpathFromLocalSpecifier(spec, currentCanonicalSubpath) : undefined;
220
+ if (!moduleId)
221
+ continue;
222
+ appendCoreExportOrigin(origins, exportedName, { moduleId, mode: 'module', canonicalSubpath: canonicalSubpath || undefined });
223
+ }
224
+ const namedReExportRe = /\bexport\s*\{([^}]+)\}\s*from\s*["']([^"']+)["']/g;
225
+ while ((match = namedReExportRe.exec(code)) !== null) {
226
+ const specList = match[1];
227
+ const spec = match[2];
228
+ const resolvedTarget = spec.startsWith('.') ? resolveLocalExportTarget(spec, cleanedPath) : null;
229
+ const moduleId = resolvedTarget ? runtimeModuleIdForFile(resolvedTarget, cleanedRoot) : spec.startsWith('.') ? runtimeModuleIdFromLocalSpecifier(spec, currentModuleId) : spec;
230
+ const canonicalSubpath = resolvedTarget ? canonicalCoreSubpathForFile(resolvedTarget, cleanedRoot) : spec.startsWith('.') ? canonicalCoreSubpathFromLocalSpecifier(spec, currentCanonicalSubpath) : undefined;
231
+ if (!moduleId)
232
+ continue;
233
+ for (const { exportedName, importedName } of parseExportSpecList(specList)) {
234
+ appendCoreExportOrigin(origins, exportedName, { moduleId, mode: 'named', importedName, canonicalSubpath: canonicalSubpath || undefined });
235
+ }
236
+ }
237
+ const directBraceRe = /\bexport\s*\{([^}]+)\}(?!\s*from)/g;
238
+ while ((match = directBraceRe.exec(code)) !== null) {
239
+ for (const { exportedName, importedName } of parseExportSpecList(match[1])) {
240
+ appendCoreExportOrigin(origins, exportedName, { moduleId: currentModuleId, mode: 'named', importedName, canonicalSubpath: currentCanonicalSubpath || undefined });
241
+ }
242
+ }
243
+ // Tolerate trailing comments on `export * from '…'` lines. @nativescript/core
244
+ // has lines like `export * from './layouts'; // barrel export`, and the
245
+ // previous strict `[ \t]*$` anchor refused to match them — which silently
246
+ // skipped recursion into ./layouts, omitting GridLayout/LayoutBase (and
247
+ // any name reached through a similarly-commented star re-export) from the
248
+ // /ns/core bridge's named-export list.
249
+ const starRe = /^[ \t]*export\s+\*\s+from\s+["']([^"']+)["'][^\n]*$/gm;
250
+ while ((match = starRe.exec(code)) !== null) {
251
+ const spec = match[1];
252
+ if (!spec.startsWith('.'))
253
+ continue;
254
+ const resolvedTarget = resolveLocalExportTarget(spec, cleanedPath);
255
+ const moduleId = resolvedTarget ? runtimeModuleIdForFile(resolvedTarget, cleanedRoot) : runtimeModuleIdFromLocalSpecifier(spec, currentModuleId);
256
+ const canonicalSubpath = resolvedTarget ? canonicalCoreSubpathForFile(resolvedTarget, cleanedRoot) : canonicalCoreSubpathFromLocalSpecifier(spec, currentCanonicalSubpath);
257
+ if (!resolvedTarget)
258
+ continue;
259
+ const childOrigins = collectStaticExportOriginsFromFile(resolvedTarget, cleanedRoot, seen);
260
+ for (const [exportedName, entries] of Object.entries(childOrigins)) {
261
+ if (moduleId) {
262
+ appendCoreExportOrigin(origins, exportedName, { moduleId, mode: 'named', importedName: exportedName, canonicalSubpath: canonicalSubpath || undefined });
263
+ }
264
+ for (const entry of entries) {
265
+ appendCoreExportOrigin(origins, exportedName, entry);
266
+ }
267
+ }
268
+ }
269
+ return origins;
270
+ }
271
+ export async function normalizeCoreExportOriginsForRuntime(exportOrigins, resolveModuleId, rootModulePath) {
272
+ const cleanedRoot = String(rootModulePath || '').replace(/[?#].*$/, '');
273
+ if (!cleanedRoot || !exportOrigins || typeof exportOrigins !== 'object') {
274
+ return exportOrigins;
275
+ }
276
+ const resolutionCache = new Map();
277
+ const normalizedOrigins = {};
278
+ for (const [exportedName, entries] of Object.entries(exportOrigins)) {
279
+ normalizedOrigins[exportedName] = await Promise.all((entries || []).map(async (entry) => {
280
+ if (!entry?.moduleId || !entry.moduleId.startsWith('@nativescript/core')) {
281
+ return entry;
282
+ }
283
+ let resolvedPath = resolutionCache.get(entry.moduleId);
284
+ if (resolvedPath === undefined) {
285
+ try {
286
+ resolvedPath = (await resolveModuleId(entry.moduleId)) || null;
287
+ }
288
+ catch {
289
+ resolvedPath = null;
290
+ }
291
+ resolvedPath = resolvedPath ? String(resolvedPath).replace(/[?#].*$/, '') : null;
292
+ resolutionCache.set(entry.moduleId, resolvedPath);
293
+ }
294
+ if (!resolvedPath) {
295
+ return entry;
296
+ }
297
+ const canonicalSubpath = canonicalCoreSubpathForFile(resolvedPath, cleanedRoot);
298
+ if (!canonicalSubpath || canonicalSubpath === entry.canonicalSubpath) {
299
+ return entry;
300
+ }
301
+ return { ...entry, canonicalSubpath };
302
+ }));
303
+ }
304
+ return normalizedOrigins;
305
+ }
306
+ export function hasModuleDefaultExport(moduleCode) {
307
+ if (!moduleCode || typeof moduleCode !== 'string')
308
+ return false;
309
+ return /\bexport\s+default\b/.test(moduleCode) || /\bexport\s*\{[^}]*\bdefault\b[^}]*\}/.test(moduleCode);
310
+ }
311
+ /**
312
+ * Parse an incoming `/ns/core` bridge request.
313
+ *
314
+ * Accepted shapes:
315
+ * - `/ns/core` → package main
316
+ * - `/ns/core/<sub>` → subpath form (`<sub>` may carry a
317
+ * `.js`/`/index`/platform-suffix tail
318
+ * that we strip via `normalizeCoreSub`
319
+ * and report through `canonicalPath` so
320
+ * the middleware can 301)
321
+ *
322
+ * Anything else returns `null` so the middleware falls through to
323
+ * `next()` and a downstream 404 surfaces the offending emitter.
324
+ *
325
+ * URL contract:
326
+ * - No version segment. `/ns/core/<digits>` was an experimental
327
+ * cache-busting shape that split iOS's HTTP-ESM module cache from
328
+ * the unversioned URL emitted by the runtime import map. Removed.
329
+ * - No `?p=<sub>` query form. The canonical path form
330
+ * `/ns/core/<sub>` is the only spelling every emitter produces.
331
+ */
332
+ export function parseCoreBridgeRequest(pathname, _searchParams, _currentGraphVersion) {
333
+ if (!pathname)
334
+ return null;
335
+ if (!(pathname === '/ns/core' || pathname === '/ns/core/' || pathname.startsWith('/ns/core/'))) {
336
+ return null;
337
+ }
338
+ const afterCore = pathname.replace(/^\/ns\/core\/?/, '');
339
+ if (afterCore.startsWith('/')) {
340
+ return null;
341
+ }
342
+ const sub = afterCore || '';
343
+ const normalizedSub = sub ? sub.replace(/^\/+/, '') : null;
344
+ let canonicalPath;
345
+ if (normalizedSub) {
346
+ const canonical = normalizeCoreSub(normalizedSub);
347
+ const expectedPath = canonical ? `/ns/core/${canonical}` : '/ns/core';
348
+ if (pathname !== expectedPath) {
349
+ canonicalPath = expectedPath;
350
+ try {
351
+ const g = globalThis;
352
+ g.__NS_BRIDGE_NONCANON__ || (g.__NS_BRIDGE_NONCANON__ = { count: 0, samples: [] });
353
+ g.__NS_BRIDGE_NONCANON__.count++;
354
+ if (g.__NS_BRIDGE_NONCANON__.samples.length < 10) {
355
+ g.__NS_BRIDGE_NONCANON__.samples.push({ raw: normalizedSub, canonical, pathname });
356
+ }
357
+ }
358
+ catch { }
359
+ }
360
+ }
361
+ return {
362
+ sub: normalizedSub || '',
363
+ normalizedSub,
364
+ key: normalizedSub ? `@nativescript/core/${normalizedSub}` : '@nativescript/core',
365
+ canonicalPath,
366
+ };
367
+ }
368
+ //# sourceMappingURL=websocket-core-bridge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"websocket-core-bridge.js","sourceRoot":"","sources":["../../../../../packages/vite/hmr/server/websocket-core-bridge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC7D,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAkChE,yEAAyE;AACzE,qEAAqE;AACrE,sEAAsE;AACtE,qEAAqE;AACrE,kEAAkE;AAClE,iEAAiE;AACjE,6CAA6C;AAC7C,8DAA8D;AAC9D,wEAAwE;AACxE,iEAAiE;AACjE,MAAM,qBAAqB,GAAG,kkCAAkkC,CAAC;AAEjmC,MAAM,UAAU,0BAA0B,CAAC,IAAY;IACtD,MAAM,KAAK,GAAG,IAAI,GAAG,EAAU,CAAC;IAChC,MAAM,MAAM,GAAG,kEAAkE,CAAC;IAClF,IAAI,KAA6B,CAAC;IAClC,OAAO,CAAC,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;QAC7C,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACrB,CAAC;IACD,MAAM,WAAW,GAAG,4CAA4C,CAAC;IACjE,OAAO,CAAC,KAAK,GAAG,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;QAClD,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CA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Y,CAAC;YAC7B,IAAI,CAAC;gBACJ,MAAM,CAAC,GAAG,UAAiB,CAAC;gBAC5B,CAAC,CAAC,sBAAsB,KAAxB,CAAC,CAAC,sBAAsB,GAAK,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,EAAC;gBACvD,CAAC,CAAC,sBAAsB,CAAC,KAAK,EAAE,CAAC;gBACjC,IAAI,CAAC,CAAC,sBAAsB,CAAC,OAAO,CAAC,MAAM,GAAG,EAAE,EAAE,CAAC;oBAClD,CAAC,CAAC,sBAAsB,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,aAAa,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC,CAAC;gBACpF,CAAC;YACF,CAAC;YAAC,MAAM,CAAC,CAAA,CAAC;QACX,CAAC;IACF,CAAC;IACD,OAAO;QACN,GAAG,EAAE,aAAa,IAAI,EAAE;QACxB,aAAa;QACb,GAAG,EAAE,aAAa,CAAC,CAAC,CAAC,sBAAsB,aAAa,EAAE,CAAC,CAAC,CAAC,oBAAoB;QACjF,aAAa;KACb,CAAC;AACH,CAAC"}
@@ -0,0 +1,33 @@
1
+ export interface CollectCssHotUpdatePathsOptions {
2
+ /** Absolute path of the file the watcher saw change. */
3
+ file: string;
4
+ /** Vite dev server `config.root` (project root for the NS app). */
5
+ root: string;
6
+ /** `nativescript.config#appPath` value. Defaults to `'src'`. */
7
+ appRootDir?: string;
8
+ /**
9
+ * Absolute path to the project's primary CSS entry
10
+ * (`<root>/<appRootDir>/app.css`). Required to broadcast for
11
+ * out-of-scope CSS saves — workspace deps `@import`'d from
12
+ * `app.css` invalidate the `virtual:ns-app-css` module, which has
13
+ * no real `.file` to broadcast on its own.
14
+ */
15
+ appEntryCss?: string | null;
16
+ }
17
+ /**
18
+ * Compute the root-relative POSIX path to broadcast in `ns:css-updates`
19
+ * for a given CSS hot-update.
20
+ *
21
+ * - **In-scope CSS edit** (`<root>/src|core|<appRootDir>/...css`):
22
+ * broadcast that file's path.
23
+ * - **Out-of-scope CSS edit** (workspace dep `@import`'d via
24
+ * `app.css`): broadcast `appEntryCss`. The runtime fetches
25
+ * `app.css?direct=1`, Vite re-runs PostCSS through the `@import`
26
+ * chain, and the merged CSS lands.
27
+ *
28
+ * NS only ever fetches the entry CSS at runtime, so a single
29
+ * `appEntryCss` broadcast covers every workspace-dep CSS save —
30
+ * regardless of how deep the `@import` chain goes. Returns `[]` for
31
+ * non-CSS files or when no broadcast target is available.
32
+ */
33
+ export declare function collectCssHotUpdatePaths(options: CollectCssHotUpdatePathsOptions): string[];
@@ -0,0 +1,65 @@
1
+ import path from 'path';
2
+ const CSS_EXTENSION = /\.css(?:[?#].*)?$/i;
3
+ function toPosix(value) {
4
+ return value.replace(/\\/g, '/');
5
+ }
6
+ function stripQuery(value) {
7
+ const idx = value.search(/[?#]/);
8
+ return idx === -1 ? value : value.slice(0, idx);
9
+ }
10
+ function isInProjectScope(absPath, root, appRootDir) {
11
+ if (!absPath || !root)
12
+ return false;
13
+ const absPosix = stripQuery(toPosix(absPath));
14
+ const rootPosix = toPosix(root).replace(/\/$/, '');
15
+ const dirs = [`${rootPosix}/src`, `${rootPosix}/core`];
16
+ if (appRootDir && appRootDir !== 'src') {
17
+ dirs.push(`${rootPosix}/${appRootDir}`);
18
+ }
19
+ return dirs.some((dir) => absPosix === dir || absPosix.startsWith(`${dir}/`));
20
+ }
21
+ function toRootRelative(absPath, root) {
22
+ if (!absPath || !root)
23
+ return null;
24
+ const cleaned = stripQuery(toPosix(absPath));
25
+ const rootPosix = toPosix(root).replace(/\/$/, '');
26
+ if (cleaned !== rootPosix && !cleaned.startsWith(`${rootPosix}/`)) {
27
+ return null;
28
+ }
29
+ const rel = path.posix.normalize(path.posix.relative(rootPosix, cleaned));
30
+ if (!rel || rel === '.' || rel.startsWith('..'))
31
+ return null;
32
+ return rel.startsWith('/') ? rel : `/${rel}`;
33
+ }
34
+ /**
35
+ * Compute the root-relative POSIX path to broadcast in `ns:css-updates`
36
+ * for a given CSS hot-update.
37
+ *
38
+ * - **In-scope CSS edit** (`<root>/src|core|<appRootDir>/...css`):
39
+ * broadcast that file's path.
40
+ * - **Out-of-scope CSS edit** (workspace dep `@import`'d via
41
+ * `app.css`): broadcast `appEntryCss`. The runtime fetches
42
+ * `app.css?direct=1`, Vite re-runs PostCSS through the `@import`
43
+ * chain, and the merged CSS lands.
44
+ *
45
+ * NS only ever fetches the entry CSS at runtime, so a single
46
+ * `appEntryCss` broadcast covers every workspace-dep CSS save —
47
+ * regardless of how deep the `@import` chain goes. Returns `[]` for
48
+ * non-CSS files or when no broadcast target is available.
49
+ */
50
+ export function collectCssHotUpdatePaths(options) {
51
+ const { file, root, appRootDir, appEntryCss } = options;
52
+ if (!file || !root)
53
+ return [];
54
+ if (!CSS_EXTENSION.test(file))
55
+ return [];
56
+ if (isInProjectScope(file, root, appRootDir)) {
57
+ const rel = toRootRelative(file, root);
58
+ return rel ? [rel] : [];
59
+ }
60
+ if (!appEntryCss)
61
+ return [];
62
+ const rel = toRootRelative(appEntryCss, root);
63
+ return rel ? [rel] : [];
64
+ }
65
+ //# sourceMappingURL=websocket-css-hot-update.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"websocket-css-hot-update.js","sourceRoot":"","sources":["../../../../../packages/vite/hmr/server/websocket-css-hot-update.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAmBxB,MAAM,aAAa,GAAG,oBAAoB,CAAC;AAE3C,SAAS,OAAO,CAAC,KAAa;IAC7B,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;AAClC,CAAC;AAED,SAAS,UAAU,CAAC,KAAa;IAChC,MAAM,GAAG,GAAG,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACjC,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CA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SAAS,EAAE,OAAO,CAAC,CAAC,CAAC;IAC1E,IAAI,CAAC,GAAG,IAAI,GAAG,KAAK,GAAG,IAAI,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IAC7D,OAAO,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,GAAG,EAAE,CAAC;AAC9C,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,wBAAwB,CAAC,OAAwC;IAChF,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC;IACxD,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI;QAAE,OAAO,EAAE,CAAC;IAC9B,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC;QAAE,OAAO,EAAE,CAAC;IAEzC,IAAI,gBAAgB,CAAC,IAAI,EAAE,IAAI,EAAE,UAAU,CAAC,EAAE,CAAC;QAC9C,MAAM,GAAG,GAAG,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QACvC,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACzB,CAAC;IAED,IAAI,CAAC,WAAW;QAAE,OAAO,EAAE,CAAC;IAC5B,MAAM,GAAG,GAAG,cAAc,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;IAC9C,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACzB,CAAC"}
@@ -0,0 +1,21 @@
1
+ export type GraphUpsertClassification = 'unchanged' | 'inserted' | 'changed';
2
+ export declare function classifyGraphUpsert(existing: {
3
+ hash: string;
4
+ deps: string[];
5
+ } | undefined, nextHash: string, nextDeps: string[]): GraphUpsertClassification;
6
+ export declare function shouldBroadcastGraphUpsertDelta(classification: GraphUpsertClassification, emitDeltaOnInsert?: boolean, broadcastEnabled?: boolean): boolean;
7
+ /**
8
+ * Decide whether an upsert should advance the shared graphVersion
9
+ * counter. Serve-time warm-ups (and the background initial-graph walk) pass
10
+ * `bumpVersion: false` so graphVersion stays stable during cold boot — that
11
+ * stability is what lets the dynamic-import helper tag every first-session
12
+ * URL with a consistent `v1` instead of drifting between `live`, `v12`,
13
+ * `v433`... (which would produce double-loaded modules on iOS HTTP ESM).
14
+ * Real live edits (handleHotUpdate and framework hot-update handlers) leave
15
+ * `bumpVersion` unset or true and advance the counter as before.
16
+ *
17
+ * The helper also treats `unchanged` classifications as no-op: they bypass
18
+ * the graph set entirely in upsertGraphModule, so the version must not
19
+ * advance for them either.
20
+ */
21
+ export declare function shouldBumpGraphVersion(classification: GraphUpsertClassification, bumpVersion?: boolean): boolean;
@@ -0,0 +1,33 @@
1
+ export function classifyGraphUpsert(existing, nextHash, nextDeps) {
2
+ if (!existing) {
3
+ return 'inserted';
4
+ }
5
+ if (existing.hash === nextHash && existing.deps.length === nextDeps.length && existing.deps.every((d, i) => d === nextDeps[i])) {
6
+ return 'unchanged';
7
+ }
8
+ return 'changed';
9
+ }
10
+ export function shouldBroadcastGraphUpsertDelta(classification, emitDeltaOnInsert = false, broadcastEnabled = true) {
11
+ return broadcastEnabled && (classification === 'changed' || (classification === 'inserted' && emitDeltaOnInsert));
12
+ }
13
+ /**
14
+ * Decide whether an upsert should advance the shared graphVersion
15
+ * counter. Serve-time warm-ups (and the background initial-graph walk) pass
16
+ * `bumpVersion: false` so graphVersion stays stable during cold boot — that
17
+ * stability is what lets the dynamic-import helper tag every first-session
18
+ * URL with a consistent `v1` instead of drifting between `live`, `v12`,
19
+ * `v433`... (which would produce double-loaded modules on iOS HTTP ESM).
20
+ * Real live edits (handleHotUpdate and framework hot-update handlers) leave
21
+ * `bumpVersion` unset or true and advance the counter as before.
22
+ *
23
+ * The helper also treats `unchanged` classifications as no-op: they bypass
24
+ * the graph set entirely in upsertGraphModule, so the version must not
25
+ * advance for them either.
26
+ */
27
+ export function shouldBumpGraphVersion(classification, bumpVersion = true) {
28
+ if (classification === 'unchanged') {
29
+ return false;
30
+ }
31
+ return bumpVersion !== false;
32
+ }
33
+ //# sourceMappingURL=websocket-graph-upsert.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"websocket-graph-upsert.js","sourceRoot":"","sources":["../../../../../packages/vite/hmr/server/websocket-graph-upsert.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,mBAAmB,CAAC,QAAsD,EAAE,QAAgB,EAAE,QAAkB;IAC/H,IAAI,CAAC,QAAQ,EAAE,CAAC;QACf,OAAO,UAAU,CAAC;IACnB,CAAC;IACD,IAAI,QAAQ,CAAC,IAAI,KAAK,QAAQ,IAAI,QAAQ,CAAC,IAAI,CAAC,MAAM,KAAK,QAAQ,CAAC,MAAM,IAAI,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAChI,OAAO,WAAW,CAAC;IACpB,CAAC;IACD,OAAO,SAAS,CAAC;AAClB,CAAC;AAED,MAAM,UAAU,+BAA+B,CAAC,cAAyC,EAAE,oBAA6B,KAAK,EAAE,mBAA4B,IAAI;IAC9J,OAAO,gBAAgB,IAAI,CAAC,cAAc,KAAK,SAAS,IAAI,CAAC,cAAc,KAAK,UAAU,IAAI,iBAAiB,CAAC,CAAC,CAAC;AACnH,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,sBAAsB,CAAC,cAAyC,EAAE,cAAuB,IAAI;IAC5G,IAAI,cAAc,KAAK,WAAW,EAAE,CAAC;QACpC,OAAO,KAAK,CAAC;IACd,CAAC;IACD,OAAO,WAAW,KAAK,KAAK,CAAC;AAC9B,CAAC"}
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Early "pending" notification for HMR.
3
+ *
4
+ * When `handleHotUpdate(ctx)` first fires for a save event, the server
5
+ * spends 7–200ms doing graph upserts, transforms and dependency
6
+ * analysis BEFORE broadcasting `ns:angular-update` (or
7
+ * `ns:css-updates`). During that window the client has no idea a
8
+ * change is in flight, so the HMR-applying overlay only appears at
9
+ * the tail end of the cycle and the user perceives the dev loop as
10
+ * laggy.
11
+ *
12
+ * `ns:hmr-pending` is broadcast at the very start of `handleHotUpdate`
13
+ * with just the file path + classified kind. The client reacts by
14
+ * showing the 'received' overlay frame immediately. The authoritative
15
+ * payload (`ns:angular-update` / `ns:css-updates`) follows once the
16
+ * server is ready and walks the rest of the stage progression.
17
+ *
18
+ * This module is intentionally a pure helper so the message shape and
19
+ * narrowing rules can be verified without spinning up a Vite dev
20
+ * server.
21
+ */
22
+ export type HmrPendingKind = 'ts' | 'css' | 'html' | 'unknown';
23
+ export type HmrPendingMessage = {
24
+ type: 'ns:hmr-pending';
25
+ origin: string;
26
+ path: string;
27
+ kind: HmrPendingKind;
28
+ timestamp: number;
29
+ };
30
+ export declare function createHmrPendingMessage(input: {
31
+ origin: string;
32
+ path: string;
33
+ kind: string;
34
+ timestamp: number;
35
+ }): HmrPendingMessage;
36
+ /**
37
+ * Parser used by the client to identify a pending message regardless of
38
+ * which framework is active. We accept the message only when every
39
+ * expected field is present and well-formed — this guards against
40
+ * accidental matches on legacy server payloads or developer-written
41
+ * mocks during tests.
42
+ */
43
+ export declare function isHmrPendingMessage(value: unknown): value is HmrPendingMessage;