@nativescript/vite 8.0.0-alpha.6 → 8.0.0-alpha.61

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 (465) hide show
  1. package/README.md +51 -11
  2. package/bin/cli.cjs +8 -14
  3. package/configuration/angular.d.ts +34 -1
  4. package/configuration/angular.js +390 -165
  5. package/configuration/angular.js.map +1 -1
  6. package/configuration/base.js +244 -53
  7. package/configuration/base.js.map +1 -1
  8. package/configuration/javascript.js +14 -93
  9. package/configuration/javascript.js.map +1 -1
  10. package/configuration/react.js +41 -73
  11. package/configuration/react.js.map +1 -1
  12. package/configuration/solid.js +51 -6
  13. package/configuration/solid.js.map +1 -1
  14. package/configuration/typescript.js +12 -93
  15. package/configuration/typescript.js.map +1 -1
  16. package/helpers/app-components.d.ts +2 -1
  17. package/helpers/app-components.js.map +1 -1
  18. package/helpers/app-css-state.d.ts +8 -0
  19. package/helpers/app-css-state.js +8 -0
  20. package/helpers/app-css-state.js.map +1 -0
  21. package/helpers/bundler-context.d.ts +11 -0
  22. package/helpers/bundler-context.js +71 -0
  23. package/helpers/bundler-context.js.map +1 -0
  24. package/helpers/cli-flags.d.ts +12 -0
  25. package/helpers/cli-flags.js +34 -0
  26. package/helpers/cli-flags.js.map +1 -1
  27. package/helpers/css-platform-plugin.d.ts +14 -0
  28. package/helpers/css-platform-plugin.js +43 -25
  29. package/helpers/css-platform-plugin.js.map +1 -1
  30. package/helpers/dev-host.d.ts +360 -0
  31. package/helpers/dev-host.js +694 -0
  32. package/helpers/dev-host.js.map +1 -0
  33. package/helpers/dynamic-import-plugin.js +9 -4
  34. package/helpers/dynamic-import-plugin.js.map +1 -1
  35. package/helpers/esbuild-platform-resolver.js +4 -1
  36. package/helpers/esbuild-platform-resolver.js.map +1 -1
  37. package/helpers/external-configs.d.ts +10 -12
  38. package/helpers/external-configs.js +58 -35
  39. package/helpers/external-configs.js.map +1 -1
  40. package/helpers/global-defines.d.ts +100 -13
  41. package/helpers/global-defines.js +165 -28
  42. package/helpers/global-defines.js.map +1 -1
  43. package/helpers/hmr-scope.d.ts +26 -0
  44. package/helpers/hmr-scope.js +67 -0
  45. package/helpers/hmr-scope.js.map +1 -0
  46. package/helpers/init.js +0 -18
  47. package/helpers/init.js.map +1 -1
  48. package/helpers/logging.js +29 -1
  49. package/helpers/logging.js.map +1 -1
  50. package/helpers/main-entry.d.ts +4 -1
  51. package/helpers/main-entry.js +368 -53
  52. package/helpers/main-entry.js.map +1 -1
  53. package/helpers/nativeclass-esbuild-plugin.d.ts +2 -1
  54. package/helpers/nativeclass-esbuild-plugin.js +6 -1
  55. package/helpers/nativeclass-esbuild-plugin.js.map +1 -1
  56. package/helpers/nativeclass-transform.d.ts +13 -0
  57. package/helpers/nativeclass-transform.js +37 -7
  58. package/helpers/nativeclass-transform.js.map +1 -1
  59. package/helpers/nativeclass-transformer-plugin.d.ts +9 -2
  60. package/helpers/nativeclass-transformer-plugin.js +163 -15
  61. package/helpers/nativeclass-transformer-plugin.js.map +1 -1
  62. package/helpers/nativescript-package-resolver.js +10 -62
  63. package/helpers/nativescript-package-resolver.js.map +1 -1
  64. package/helpers/normalize-id.d.ts +42 -0
  65. package/helpers/normalize-id.js +60 -0
  66. package/helpers/normalize-id.js.map +1 -0
  67. package/helpers/ns-core-url.d.ts +29 -7
  68. package/helpers/ns-core-url.js +69 -12
  69. package/helpers/ns-core-url.js.map +1 -1
  70. package/helpers/optimize-deps.d.ts +16 -0
  71. package/helpers/optimize-deps.js +17 -0
  72. package/helpers/optimize-deps.js.map +1 -0
  73. package/helpers/package-platform-aliases.js +34 -49
  74. package/helpers/package-platform-aliases.js.map +1 -1
  75. package/helpers/platform-types.d.ts +2 -0
  76. package/helpers/platform-types.js +2 -0
  77. package/helpers/platform-types.js.map +1 -0
  78. package/helpers/postcss-platform-config.d.ts +17 -1
  79. package/helpers/postcss-platform-config.js +20 -37
  80. package/helpers/postcss-platform-config.js.map +1 -1
  81. package/helpers/project.d.ts +35 -0
  82. package/helpers/project.js +120 -2
  83. package/helpers/project.js.map +1 -1
  84. package/helpers/resolve-main-field-platform.d.ts +20 -0
  85. package/helpers/resolve-main-field-platform.js +49 -0
  86. package/helpers/resolve-main-field-platform.js.map +1 -0
  87. package/helpers/resolver.js +17 -2
  88. package/helpers/resolver.js.map +1 -1
  89. package/helpers/theme-core-plugins.js +1 -1
  90. package/helpers/theme-core-plugins.js.map +1 -1
  91. package/helpers/ts-config-paths.d.ts +32 -0
  92. package/helpers/ts-config-paths.js +156 -27
  93. package/helpers/ts-config-paths.js.map +1 -1
  94. package/helpers/typescript-check.d.ts +2 -1
  95. package/helpers/typescript-check.js +2 -2
  96. package/helpers/typescript-check.js.map +1 -1
  97. package/helpers/ui-registration.d.ts +21 -0
  98. package/helpers/ui-registration.js +156 -0
  99. package/helpers/ui-registration.js.map +1 -0
  100. package/helpers/utils.d.ts +9 -0
  101. package/helpers/utils.js +22 -2
  102. package/helpers/utils.js.map +1 -1
  103. package/helpers/vite-package-version.d.ts +7 -0
  104. package/helpers/vite-package-version.js +44 -0
  105. package/helpers/vite-package-version.js.map +1 -0
  106. package/helpers/workers.d.ts +48 -19
  107. package/helpers/workers.js +662 -13
  108. package/helpers/workers.js.map +1 -1
  109. package/hmr/client/css-handler.d.ts +2 -1
  110. package/hmr/client/css-handler.js +50 -26
  111. package/hmr/client/css-handler.js.map +1 -1
  112. package/hmr/client/css-update-overlay.d.ts +18 -0
  113. package/hmr/client/css-update-overlay.js +27 -0
  114. package/hmr/client/css-update-overlay.js.map +1 -0
  115. package/hmr/client/framework-client-strategy.d.ts +79 -0
  116. package/hmr/client/framework-client-strategy.js +19 -0
  117. package/hmr/client/framework-client-strategy.js.map +1 -0
  118. package/hmr/client/hmr-pending-overlay.d.ts +0 -14
  119. package/hmr/client/hmr-pending-overlay.js +14 -4
  120. package/hmr/client/hmr-pending-overlay.js.map +1 -1
  121. package/hmr/client/hot-context.d.ts +67 -0
  122. package/hmr/client/hot-context.js +284 -0
  123. package/hmr/client/hot-context.js.map +1 -0
  124. package/hmr/client/index.js +922 -273
  125. package/hmr/client/index.js.map +1 -1
  126. package/hmr/client/utils.d.ts +2 -1
  127. package/hmr/client/utils.js +111 -99
  128. package/hmr/client/utils.js.map +1 -1
  129. package/hmr/entry-runtime.d.ts +2 -1
  130. package/hmr/entry-runtime.js +279 -71
  131. package/hmr/entry-runtime.js.map +1 -1
  132. package/hmr/frameworks/angular/build/angular-linker.d.ts +12 -0
  133. package/hmr/frameworks/angular/build/angular-linker.js +109 -0
  134. package/hmr/frameworks/angular/build/angular-linker.js.map +1 -0
  135. package/hmr/frameworks/angular/build/inject-component-hmr-registration.d.ts +112 -0
  136. package/hmr/frameworks/angular/build/inject-component-hmr-registration.js +291 -0
  137. package/hmr/frameworks/angular/build/inject-component-hmr-registration.js.map +1 -0
  138. package/hmr/frameworks/angular/build/inject-hmr-vite-ignore.d.ts +75 -0
  139. package/hmr/frameworks/angular/build/inject-hmr-vite-ignore.js +221 -0
  140. package/hmr/frameworks/angular/build/inject-hmr-vite-ignore.js.map +1 -0
  141. package/{helpers/angular → hmr/frameworks/angular/build}/inline-decorator-component-templates.js +1 -170
  142. package/hmr/frameworks/angular/build/inline-decorator-component-templates.js.map +1 -0
  143. package/hmr/frameworks/angular/build/js-lexer.d.ts +4 -0
  144. package/{helpers/angular/synthesize-decorator-ctor-parameters.js → hmr/frameworks/angular/build/js-lexer.js} +22 -96
  145. package/hmr/frameworks/angular/build/js-lexer.js.map +1 -0
  146. package/hmr/frameworks/angular/build/shared-linker.d.ts +39 -0
  147. package/hmr/frameworks/angular/build/shared-linker.js +128 -0
  148. package/hmr/frameworks/angular/build/shared-linker.js.map +1 -0
  149. package/hmr/frameworks/angular/build/synthesize-decorator-ctor-parameters.js +88 -0
  150. package/hmr/frameworks/angular/build/synthesize-decorator-ctor-parameters.js.map +1 -0
  151. package/{helpers/angular → hmr/frameworks/angular/build}/synthesize-injectable-factories.js +1 -174
  152. package/hmr/frameworks/angular/build/synthesize-injectable-factories.js.map +1 -0
  153. package/{helpers/angular → hmr/frameworks/angular/build}/util.d.ts +1 -0
  154. package/hmr/frameworks/angular/build/util.js +155 -0
  155. package/hmr/frameworks/angular/build/util.js.map +1 -0
  156. package/hmr/frameworks/angular/client/index.js +542 -175
  157. package/hmr/frameworks/angular/client/index.js.map +1 -1
  158. package/hmr/frameworks/angular/client/strategy.d.ts +9 -0
  159. package/hmr/frameworks/angular/client/strategy.js +19 -0
  160. package/hmr/frameworks/angular/client/strategy.js.map +1 -0
  161. package/hmr/frameworks/angular/server/angular-root-component.d.ts +79 -0
  162. package/hmr/frameworks/angular/server/angular-root-component.js +149 -0
  163. package/hmr/frameworks/angular/server/angular-root-component.js.map +1 -0
  164. package/hmr/frameworks/angular/server/linker.js +1 -4
  165. package/hmr/frameworks/angular/server/linker.js.map +1 -1
  166. package/hmr/frameworks/angular/server/strategy.js +458 -12
  167. package/hmr/frameworks/angular/server/strategy.js.map +1 -1
  168. package/hmr/{server → frameworks/angular/server}/websocket-angular-entry.js +2 -2
  169. package/hmr/frameworks/angular/server/websocket-angular-entry.js.map +1 -0
  170. package/hmr/{server → frameworks/angular/server}/websocket-angular-hot-update.d.ts +14 -11
  171. package/hmr/{server → frameworks/angular/server}/websocket-angular-hot-update.js +108 -111
  172. package/hmr/frameworks/angular/server/websocket-angular-hot-update.js.map +1 -0
  173. package/hmr/frameworks/react/server/strategy.d.ts +2 -0
  174. package/hmr/frameworks/react/server/strategy.js +230 -0
  175. package/hmr/frameworks/react/server/strategy.js.map +1 -0
  176. package/hmr/frameworks/solid/build/solid-jsx-deps.d.ts +15 -0
  177. package/hmr/frameworks/solid/build/solid-jsx-deps.js +178 -0
  178. package/hmr/frameworks/solid/build/solid-jsx-deps.js.map +1 -0
  179. package/hmr/frameworks/solid/client/app-runtime.d.ts +68 -0
  180. package/hmr/frameworks/solid/client/app-runtime.js +246 -0
  181. package/hmr/frameworks/solid/client/app-runtime.js.map +1 -0
  182. package/hmr/frameworks/solid/server/strategy.js +291 -16
  183. package/hmr/frameworks/solid/server/strategy.js.map +1 -1
  184. package/hmr/frameworks/typescript/server/strategy.js +38 -14
  185. package/hmr/frameworks/typescript/server/strategy.js.map +1 -1
  186. package/hmr/frameworks/vue/client/dep-propagation.d.ts +44 -0
  187. package/hmr/frameworks/vue/client/dep-propagation.js +148 -0
  188. package/hmr/frameworks/vue/client/dep-propagation.js.map +1 -0
  189. package/hmr/frameworks/vue/client/index.d.ts +9 -0
  190. package/hmr/frameworks/vue/client/index.js +251 -247
  191. package/hmr/frameworks/vue/client/index.js.map +1 -1
  192. package/hmr/frameworks/vue/client/strategy.d.ts +33 -0
  193. package/hmr/frameworks/vue/client/strategy.js +157 -0
  194. package/hmr/frameworks/vue/client/strategy.js.map +1 -0
  195. package/hmr/frameworks/vue/client/vue-sfc-update-overlay.d.ts +49 -0
  196. package/hmr/frameworks/vue/client/vue-sfc-update-overlay.js +142 -0
  197. package/hmr/frameworks/vue/client/vue-sfc-update-overlay.js.map +1 -0
  198. package/hmr/frameworks/vue/server/compiler.d.ts +3 -1
  199. package/hmr/frameworks/vue/server/compiler.js +3 -1
  200. package/hmr/frameworks/vue/server/compiler.js.map +1 -1
  201. package/hmr/frameworks/vue/server/sfc-route-assemble.d.ts +7 -0
  202. package/hmr/frameworks/vue/server/sfc-route-assemble.js +823 -0
  203. package/hmr/frameworks/vue/server/sfc-route-assemble.js.map +1 -0
  204. package/hmr/frameworks/vue/server/sfc-route-meta.d.ts +7 -0
  205. package/hmr/frameworks/vue/server/sfc-route-meta.js +80 -0
  206. package/hmr/frameworks/vue/server/sfc-route-meta.js.map +1 -0
  207. package/hmr/frameworks/vue/server/sfc-route-serve.d.ts +8 -0
  208. package/hmr/frameworks/vue/server/sfc-route-serve.js +462 -0
  209. package/hmr/frameworks/vue/server/sfc-route-serve.js.map +1 -0
  210. package/hmr/frameworks/vue/server/sfc-route-shared.d.ts +45 -0
  211. package/hmr/frameworks/vue/server/sfc-route-shared.js +105 -0
  212. package/hmr/frameworks/vue/server/sfc-route-shared.js.map +1 -0
  213. package/hmr/frameworks/vue/server/strategy.d.ts +35 -0
  214. package/hmr/frameworks/vue/server/strategy.js +286 -7
  215. package/hmr/frameworks/vue/server/strategy.js.map +1 -1
  216. package/hmr/frameworks/vue/server/websocket-sfc.d.ts +15 -0
  217. package/hmr/frameworks/vue/server/websocket-sfc.js +20 -0
  218. package/hmr/frameworks/vue/server/websocket-sfc.js.map +1 -0
  219. package/hmr/helpers/ast-normalizer.d.ts +3 -1
  220. package/hmr/helpers/ast-normalizer.js +77 -10
  221. package/hmr/helpers/ast-normalizer.js.map +1 -1
  222. package/hmr/helpers/cjs-named-exports.d.ts +23 -0
  223. package/hmr/helpers/cjs-named-exports.js +152 -0
  224. package/hmr/helpers/cjs-named-exports.js.map +1 -0
  225. package/hmr/helpers/package-exports.d.ts +16 -0
  226. package/hmr/helpers/package-exports.js +396 -0
  227. package/hmr/helpers/package-exports.js.map +1 -0
  228. package/hmr/helpers/vendor-rewrite.d.ts +1 -1
  229. package/hmr/helpers/vendor-rewrite.js +5 -3
  230. package/hmr/helpers/vendor-rewrite.js.map +1 -1
  231. package/hmr/server/boot-archive-route.d.ts +40 -0
  232. package/hmr/server/boot-archive-route.js +154 -0
  233. package/hmr/server/boot-archive-route.js.map +1 -0
  234. package/hmr/server/boot-closure-route.d.ts +49 -0
  235. package/hmr/server/boot-closure-route.js +144 -0
  236. package/hmr/server/boot-closure-route.js.map +1 -0
  237. package/hmr/server/boot-recording.d.ts +58 -0
  238. package/hmr/server/boot-recording.js +228 -0
  239. package/hmr/server/boot-recording.js.map +1 -0
  240. package/hmr/server/constants.js +20 -5
  241. package/hmr/server/constants.js.map +1 -1
  242. package/hmr/server/core-bundle.d.ts +140 -0
  243. package/hmr/server/core-bundle.js +614 -0
  244. package/hmr/server/core-bundle.js.map +1 -0
  245. package/hmr/server/core-sanitize.d.ts +86 -7
  246. package/hmr/server/core-sanitize.js +170 -45
  247. package/hmr/server/core-sanitize.js.map +1 -1
  248. package/hmr/server/css-device-module.d.ts +28 -0
  249. package/hmr/server/css-device-module.js +44 -0
  250. package/hmr/server/css-device-module.js.map +1 -0
  251. package/hmr/server/deps-bundle.d.ts +218 -0
  252. package/hmr/server/deps-bundle.js +998 -0
  253. package/hmr/server/deps-bundle.js.map +1 -0
  254. package/hmr/server/device-transform-helpers.d.ts +24 -0
  255. package/hmr/server/device-transform-helpers.js +408 -0
  256. package/hmr/server/device-transform-helpers.js.map +1 -0
  257. package/hmr/server/framework-strategy.d.ts +113 -11
  258. package/hmr/server/hmr-module-graph.d.ts +37 -0
  259. package/hmr/server/hmr-module-graph.js +215 -0
  260. package/hmr/server/hmr-module-graph.js.map +1 -0
  261. package/hmr/server/import-map.d.ts +13 -4
  262. package/hmr/server/import-map.js +94 -47
  263. package/hmr/server/import-map.js.map +1 -1
  264. package/hmr/server/index.js +7 -16
  265. package/hmr/server/index.js.map +1 -1
  266. package/hmr/server/ns-core-cjs-shape.d.ts +2 -4
  267. package/hmr/server/ns-core-cjs-shape.js +4 -6
  268. package/hmr/server/ns-core-cjs-shape.js.map +1 -1
  269. package/hmr/server/ns-m-response-memo.d.ts +10 -0
  270. package/hmr/server/ns-m-response-memo.js +33 -0
  271. package/hmr/server/ns-m-response-memo.js.map +1 -0
  272. package/hmr/server/ns-rt-bridge.d.ts +51 -0
  273. package/hmr/server/ns-rt-bridge.js +131 -0
  274. package/hmr/server/ns-rt-bridge.js.map +1 -0
  275. package/hmr/server/ns-rt-route.d.ts +5 -0
  276. package/hmr/server/ns-rt-route.js +39 -0
  277. package/hmr/server/ns-rt-route.js.map +1 -0
  278. package/hmr/server/perf-instrumentation.d.ts +6 -10
  279. package/hmr/server/perf-instrumentation.js +5 -6
  280. package/hmr/server/perf-instrumentation.js.map +1 -1
  281. package/hmr/server/process-code-for-device.d.ts +30 -0
  282. package/hmr/server/process-code-for-device.js +791 -0
  283. package/hmr/server/process-code-for-device.js.map +1 -0
  284. package/hmr/server/require-guard.d.ts +1 -0
  285. package/hmr/server/require-guard.js +12 -0
  286. package/hmr/server/require-guard.js.map +1 -0
  287. package/hmr/server/rewrite-imports.d.ts +2 -0
  288. package/hmr/server/rewrite-imports.js +638 -0
  289. package/hmr/server/rewrite-imports.js.map +1 -0
  290. package/hmr/server/route-helpers.d.ts +7 -0
  291. package/hmr/server/route-helpers.js +13 -0
  292. package/hmr/server/route-helpers.js.map +1 -0
  293. package/hmr/server/server-origin.d.ts +2 -0
  294. package/hmr/server/server-origin.js +83 -0
  295. package/hmr/server/server-origin.js.map +1 -0
  296. package/hmr/server/shared-transform-request.js +1 -2
  297. package/hmr/server/shared-transform-request.js.map +1 -1
  298. package/hmr/server/transform-cache-invalidation.d.ts +37 -0
  299. package/hmr/server/transform-cache-invalidation.js +156 -0
  300. package/hmr/server/transform-cache-invalidation.js.map +1 -0
  301. package/hmr/server/vendor-bare-module-shims.d.ts +4 -0
  302. package/hmr/server/vendor-bare-module-shims.js +80 -0
  303. package/hmr/server/vendor-bare-module-shims.js.map +1 -0
  304. package/hmr/server/vite-plugin.d.ts +1 -0
  305. package/hmr/server/vite-plugin.js +180 -54
  306. package/hmr/server/vite-plugin.js.map +1 -1
  307. package/hmr/server/websocket-core-bridge.d.ts +51 -4
  308. package/hmr/server/websocket-core-bridge.js +62 -54
  309. package/hmr/server/websocket-core-bridge.js.map +1 -1
  310. package/hmr/server/websocket-css-hot-update.d.ts +33 -0
  311. package/hmr/server/websocket-css-hot-update.js +65 -0
  312. package/hmr/server/websocket-css-hot-update.js.map +1 -0
  313. package/hmr/server/websocket-device-transform.d.ts +3 -0
  314. package/hmr/server/websocket-device-transform.js +7 -0
  315. package/hmr/server/websocket-device-transform.js.map +1 -0
  316. package/hmr/server/websocket-hmr-pending.d.ts +3 -9
  317. package/hmr/server/websocket-hmr-pending.js +1 -1
  318. package/hmr/server/websocket-hmr-pending.js.map +1 -1
  319. package/hmr/server/websocket-hot-update.d.ts +77 -0
  320. package/hmr/server/websocket-hot-update.js +360 -0
  321. package/hmr/server/websocket-hot-update.js.map +1 -0
  322. package/hmr/server/websocket-import-map-route.d.ts +15 -0
  323. package/hmr/server/websocket-import-map-route.js +50 -0
  324. package/hmr/server/websocket-import-map-route.js.map +1 -0
  325. package/hmr/server/websocket-module-bindings.js +3 -3
  326. package/hmr/server/websocket-module-bindings.js.map +1 -1
  327. package/hmr/server/websocket-module-specifiers.d.ts +66 -2
  328. package/hmr/server/websocket-module-specifiers.js +191 -20
  329. package/hmr/server/websocket-module-specifiers.js.map +1 -1
  330. package/hmr/server/websocket-ns-core.d.ts +34 -0
  331. package/hmr/server/websocket-ns-core.js +414 -0
  332. package/hmr/server/websocket-ns-core.js.map +1 -0
  333. package/hmr/server/websocket-ns-entry.d.ts +21 -0
  334. package/hmr/server/websocket-ns-entry.js +164 -0
  335. package/hmr/server/websocket-ns-entry.js.map +1 -0
  336. package/hmr/server/websocket-ns-m-paths.d.ts +1 -3
  337. package/hmr/server/websocket-ns-m-paths.js +25 -82
  338. package/hmr/server/websocket-ns-m-paths.js.map +1 -1
  339. package/hmr/server/websocket-ns-m-request.d.ts +11 -1
  340. package/hmr/server/websocket-ns-m-request.js +17 -9
  341. package/hmr/server/websocket-ns-m-request.js.map +1 -1
  342. package/hmr/server/websocket-ns-m.d.ts +52 -0
  343. package/hmr/server/websocket-ns-m.js +835 -0
  344. package/hmr/server/websocket-ns-m.js.map +1 -0
  345. package/hmr/server/websocket-served-module-helpers.d.ts +50 -4
  346. package/hmr/server/websocket-served-module-helpers.js +384 -86
  347. package/hmr/server/websocket-served-module-helpers.js.map +1 -1
  348. package/hmr/server/websocket-txn.js +6 -9
  349. package/hmr/server/websocket-txn.js.map +1 -1
  350. package/hmr/server/websocket-vendor-unifier.d.ts +0 -1
  351. package/hmr/server/websocket-vendor-unifier.js +4 -9
  352. package/hmr/server/websocket-vendor-unifier.js.map +1 -1
  353. package/hmr/server/websocket.d.ts +7 -39
  354. package/hmr/server/websocket.js +643 -6716
  355. package/hmr/server/websocket.js.map +1 -1
  356. package/hmr/shared/ns-globals.d.ts +108 -0
  357. package/hmr/shared/ns-globals.js +28 -0
  358. package/hmr/shared/ns-globals.js.map +1 -0
  359. package/hmr/shared/protocol.d.ts +145 -0
  360. package/hmr/shared/protocol.js +28 -0
  361. package/hmr/shared/protocol.js.map +1 -0
  362. package/hmr/shared/runtime/boot-archive-format.d.ts +16 -0
  363. package/hmr/shared/runtime/boot-archive-format.js +31 -0
  364. package/hmr/shared/runtime/boot-archive-format.js.map +1 -0
  365. package/hmr/shared/runtime/boot-complete.d.ts +14 -0
  366. package/hmr/shared/runtime/boot-complete.js +32 -0
  367. package/hmr/shared/runtime/boot-complete.js.map +1 -0
  368. package/hmr/shared/runtime/boot-placeholder-ui.d.ts +69 -0
  369. package/hmr/shared/runtime/boot-placeholder-ui.js +101 -0
  370. package/hmr/shared/runtime/boot-placeholder-ui.js.map +1 -0
  371. package/hmr/shared/runtime/boot-progress.d.ts +44 -0
  372. package/hmr/shared/runtime/boot-progress.js +134 -0
  373. package/hmr/shared/runtime/boot-progress.js.map +1 -0
  374. package/hmr/shared/runtime/boot-timeline.d.ts +2 -1
  375. package/hmr/shared/runtime/boot-timeline.js +9 -22
  376. package/hmr/shared/runtime/boot-timeline.js.map +1 -1
  377. package/hmr/shared/runtime/browser-runtime-contract.d.ts +53 -22
  378. package/hmr/shared/runtime/browser-runtime-contract.js +6 -9
  379. package/hmr/shared/runtime/browser-runtime-contract.js.map +1 -1
  380. package/hmr/shared/runtime/dev-overlay-snapshots.d.ts +31 -0
  381. package/hmr/shared/runtime/dev-overlay-snapshots.js +324 -0
  382. package/hmr/shared/runtime/dev-overlay-snapshots.js.map +1 -0
  383. package/hmr/shared/runtime/dev-overlay.d.ts +76 -30
  384. package/hmr/shared/runtime/dev-overlay.js +767 -408
  385. package/hmr/shared/runtime/dev-overlay.js.map +1 -1
  386. package/hmr/shared/runtime/global-scope.d.ts +18 -0
  387. package/hmr/shared/runtime/global-scope.js +21 -0
  388. package/hmr/shared/runtime/global-scope.js.map +1 -0
  389. package/hmr/shared/runtime/hooks.js +2 -1
  390. package/hmr/shared/runtime/hooks.js.map +1 -1
  391. package/hmr/shared/runtime/http-only-boot.js +7 -6
  392. package/hmr/shared/runtime/http-only-boot.js.map +1 -1
  393. package/hmr/shared/runtime/module-provenance.js +4 -6
  394. package/hmr/shared/runtime/module-provenance.js.map +1 -1
  395. package/hmr/shared/runtime/root-placeholder-view.d.ts +19 -0
  396. package/hmr/shared/runtime/root-placeholder-view.js +311 -0
  397. package/hmr/shared/runtime/root-placeholder-view.js.map +1 -0
  398. package/hmr/shared/runtime/root-placeholder.js +398 -204
  399. package/hmr/shared/runtime/root-placeholder.js.map +1 -1
  400. package/hmr/shared/runtime/session-bootstrap.js +274 -55
  401. package/hmr/shared/runtime/session-bootstrap.js.map +1 -1
  402. package/hmr/shared/runtime/vendor-bootstrap.js +3 -10
  403. package/hmr/shared/runtime/vendor-bootstrap.js.map +1 -1
  404. package/hmr/shared/vendor/manifest-collect.d.ts +4 -0
  405. package/hmr/shared/vendor/manifest-collect.js +549 -0
  406. package/hmr/shared/vendor/manifest-collect.js.map +1 -0
  407. package/hmr/shared/vendor/manifest-loader.d.ts +2 -1
  408. package/hmr/shared/vendor/manifest-loader.js +5 -3
  409. package/hmr/shared/vendor/manifest-loader.js.map +1 -1
  410. package/hmr/shared/vendor/manifest.d.ts +1 -7
  411. package/hmr/shared/vendor/manifest.js +136 -825
  412. package/hmr/shared/vendor/manifest.js.map +1 -1
  413. package/hmr/shared/vendor/registry.d.ts +2 -0
  414. package/hmr/shared/vendor/registry.js +14 -0
  415. package/hmr/shared/vendor/registry.js.map +1 -1
  416. package/hmr/shared/vendor/vendor-device-shim.d.ts +1 -0
  417. package/hmr/shared/vendor/vendor-device-shim.js +208 -0
  418. package/hmr/shared/vendor/vendor-device-shim.js.map +1 -0
  419. package/hmr/shared/vendor/vendor-esbuild-plugins.d.ts +76 -0
  420. package/hmr/shared/vendor/vendor-esbuild-plugins.js +401 -0
  421. package/hmr/shared/vendor/vendor-esbuild-plugins.js.map +1 -0
  422. package/hmr/vendor-bootstrap.d.ts +1 -3
  423. package/hmr/vendor-bootstrap.js +4 -6
  424. package/hmr/vendor-bootstrap.js.map +1 -1
  425. package/index.d.ts +1 -0
  426. package/index.js +5 -0
  427. package/index.js.map +1 -1
  428. package/package.json +65 -11
  429. package/runtime/core-aliases-early.js +25 -55
  430. package/runtime/core-aliases-early.js.map +1 -1
  431. package/shims/react-jsx-runtime.d.ts +4 -0
  432. package/shims/react-jsx-runtime.js +61 -0
  433. package/shims/react-jsx-runtime.js.map +1 -0
  434. package/helpers/angular/angular-linker.d.ts +0 -13
  435. package/helpers/angular/angular-linker.js +0 -194
  436. package/helpers/angular/angular-linker.js.map +0 -1
  437. package/helpers/angular/inline-decorator-component-templates.js.map +0 -1
  438. package/helpers/angular/shared-linker.d.ts +0 -11
  439. package/helpers/angular/shared-linker.js +0 -75
  440. package/helpers/angular/shared-linker.js.map +0 -1
  441. package/helpers/angular/synthesize-decorator-ctor-parameters.js.map +0 -1
  442. package/helpers/angular/synthesize-injectable-factories.js.map +0 -1
  443. package/helpers/angular/util.js +0 -67
  444. package/helpers/angular/util.js.map +0 -1
  445. package/helpers/prelink-angular.d.ts +0 -2
  446. package/helpers/prelink-angular.js +0 -117
  447. package/helpers/prelink-angular.js.map +0 -1
  448. package/hmr/server/websocket-angular-entry.js.map +0 -1
  449. package/hmr/server/websocket-angular-hot-update.js.map +0 -1
  450. package/hmr/server/websocket-ns-m-finalize.d.ts +0 -22
  451. package/hmr/server/websocket-ns-m-finalize.js +0 -88
  452. package/hmr/server/websocket-ns-m-finalize.js.map +0 -1
  453. package/hmr/server/websocket-runtime-compat.d.ts +0 -19
  454. package/hmr/server/websocket-runtime-compat.js +0 -286
  455. package/hmr/server/websocket-runtime-compat.js.map +0 -1
  456. package/hmr/server/websocket-vue-sfc.d.ts +0 -27
  457. package/hmr/server/websocket-vue-sfc.js +0 -1114
  458. package/hmr/server/websocket-vue-sfc.js.map +0 -1
  459. package/transformers/NativeClass/index.d.ts +0 -2
  460. package/transformers/NativeClass/index.js +0 -222
  461. package/transformers/NativeClass/index.js.map +0 -1
  462. /package/{helpers/angular → hmr/frameworks/angular/build}/inline-decorator-component-templates.d.ts +0 -0
  463. /package/{helpers/angular → hmr/frameworks/angular/build}/synthesize-decorator-ctor-parameters.d.ts +0 -0
  464. /package/{helpers/angular → hmr/frameworks/angular/build}/synthesize-injectable-factories.d.ts +0 -0
  465. /package/hmr/{server → frameworks/angular/server}/websocket-angular-entry.d.ts +0 -0
@@ -0,0 +1,414 @@
1
+ import { readFileSync } from 'node:fs';
2
+ import { isDirectoryIndexFilename, rewriteSpecifiersForDevice } from './core-sanitize.js';
3
+ import { buildDefaultExportFooter, buildShapeInstallHeader, hasExistingDefaultExport, hasNamespaceReExport, rewriteNamespaceReExportsForShape } from './ns-core-cjs-shape.js';
4
+ import { getCliFlags } from '../../helpers/cli-flags.js';
5
+ import { normalizeCoreSub as normalizeCoreSubCanonical } from '../../helpers/ns-core-url.js';
6
+ import { parseCoreBridgeRequest, resolveRuntimeCoreModulePath, collectStaticExportNamesFromFile } from './websocket-core-bridge.js';
7
+ import { setDeviceModuleHeaders } from './route-helpers.js';
8
+ import { getServerOrigin } from './server-origin.js';
9
+ import { resolveVerboseFlag } from '../../helpers/logging.js';
10
+ import { CORE_BUNDLE_PATH, buildCoreMainShimCode, buildCoreSubShimCode, getSharedCoreBundleService, isCorePerModuleServingEnabled, isExpectedCoreBundleExclusion } from './core-bundle.js';
11
+ /**
12
+ * Registers the `@nativescript/core` device bridge on the dev server:
13
+ * - a catch-all that rewrites stray `/node_modules/@nativescript/core/*`
14
+ * requests to the canonical `/ns/core[/<sub>]` URL,
15
+ * - `GET /ns/core-bundle.mjs` (bundle mode) — the single-eval core bundle, and
16
+ * - `GET /ns/core[/<sub>]` — the canonical core URL space. In bundle mode
17
+ * (default) these serve thin shims over the bundle; with
18
+ * `NS_CORE_PER_MODULE=1` (core maintainers editing core source in the
19
+ * monorepo) each core module is served/transformed individually so core
20
+ * edits participate in HMR. Either way this URL family is the ONE place
21
+ * @nativescript/core reaches the device (single module realm, shared class
22
+ * identities, one-time `register()`).
23
+ */
24
+ export function registerNsCoreRoute(server, options) {
25
+ const verbose = resolveVerboseFlag();
26
+ const coreBundle = options.coreBundle !== undefined ? options.coreBundle : isCorePerModuleServingEnabled() ? null : getSharedCoreBundleService(server);
27
+ if (coreBundle) {
28
+ // Warm the bundle build in the background so the first device request
29
+ // doesn't pay the esbuild cost (parallels the vendor bundle warmup).
30
+ void coreBundle.ensureBuilt();
31
+ // GET /ns/core-bundle.mjs — the single-eval core payload.
32
+ server.middlewares.use(async (req, res, next) => {
33
+ try {
34
+ const urlObj = new URL(req.url || '', 'http://localhost');
35
+ if (urlObj.pathname !== CORE_BUNDLE_PATH)
36
+ return next();
37
+ const state = await coreBundle.ensureBuilt();
38
+ if (!state) {
39
+ res.statusCode = 503;
40
+ res.setHeader('Access-Control-Allow-Origin', '*');
41
+ res.setHeader('Content-Type', 'application/json');
42
+ res.end(JSON.stringify({ error: 'core-bundle-build-failed' }));
43
+ return;
44
+ }
45
+ setDeviceModuleHeaders(res);
46
+ res.statusCode = 200;
47
+ res.end(state.code);
48
+ }
49
+ catch (e) {
50
+ console.warn('[ns-core-bundle] serve failed:', e?.message);
51
+ next();
52
+ }
53
+ });
54
+ }
55
+ const subExportInfoCache = new Map();
56
+ const resolveModuleIdViaVite = async (moduleId) => {
57
+ const resolved = await server.pluginContainer?.resolveId?.(moduleId, undefined);
58
+ return typeof resolved === 'string' ? resolved : resolved?.id || null;
59
+ };
60
+ const getSubShimExportInfo = (canonicalSub) => {
61
+ let pending = subExportInfoCache.get(canonicalSub);
62
+ if (!pending) {
63
+ pending = (async () => {
64
+ try {
65
+ const modulePath = await resolveRuntimeCoreModulePath(canonicalSub, resolveModuleIdViaVite);
66
+ if (!modulePath)
67
+ return { names: [], hasDefault: false };
68
+ let hasDefault = false;
69
+ try {
70
+ hasDefault = hasExistingDefaultExport(readFileSync(modulePath.replace(/[?#].*$/, ''), 'utf8'));
71
+ }
72
+ catch { }
73
+ return { names: collectStaticExportNamesFromFile(modulePath), hasDefault };
74
+ }
75
+ catch {
76
+ return { names: [], hasDefault: false };
77
+ }
78
+ })();
79
+ subExportInfoCache.set(canonicalSub, pending);
80
+ }
81
+ return pending;
82
+ };
83
+ const warnedFallbackSubs = new Set();
84
+ // Catch-all redirect for stray /node_modules/@nativescript/core/*
85
+ // requests — route them to the /ns/core bridge so they get the same
86
+ // __DEV__/__IOS__ preamble and specifier rewriting. Without this,
87
+ // Vite's default /node_modules/ handler serves the raw file, which
88
+ // references bare __DEV__ and crashes at module eval.
89
+ server.middlewares.use((req, _res, next) => {
90
+ try {
91
+ const urlObj = new URL(req.url || '', 'http://localhost');
92
+ const coreNmPrefix = '/node_modules/@nativescript/core';
93
+ if (!urlObj.pathname.startsWith(coreNmPrefix))
94
+ return next();
95
+ const sub = urlObj.pathname.slice(coreNmPrefix.length).replace(/^\/+/, '');
96
+ if (sub === '' || sub === 'index.js' || sub === 'index') {
97
+ req.url = `/ns/core`;
98
+ }
99
+ else {
100
+ req.url = `/ns/core/${sub}`;
101
+ }
102
+ return next();
103
+ }
104
+ catch {
105
+ return next();
106
+ }
107
+ });
108
+ // 2.6) ESM bridge for @nativescript/core: GET /ns/core[/<sub>]
109
+ //
110
+ // Since bundle.mjs no longer bundles @nativescript/core (it is
111
+ // declared external in the rolldown config under HMR), this
112
+ // endpoint is the ONE place core is evaluated. Every consumer —
113
+ // bundle.mjs's own `@nativescript/core*` imports (resolved to
114
+ // full HTTP URLs in the entry virtual module), externalized
115
+ // vendor packages, HTTP-served app modules — all end up here.
116
+ // No more proxy bridge, no enumeration, no namespace detection,
117
+ // no prototype-polluted maps. We just serve Vite's authoritative
118
+ // transformed module content.
119
+ //
120
+ // iOS caches by URL path, so each unique URL is evaluated exactly
121
+ // once per app lifetime. Every class identity is shared, every
122
+ // `register()` side effect runs once, every `Application` reference
123
+ // is the same iosApp singleton. The entire class of "does not
124
+ // provide an export named X" and "Cannot redefine property" errors
125
+ // is eliminated by construction.
126
+ server.middlewares.use(async (req, res, next) => {
127
+ try {
128
+ const urlObj = new URL(req.url || '', 'http://localhost');
129
+ const coreRequest = parseCoreBridgeRequest(urlObj.pathname, urlObj.searchParams, Number(options.getGraphVersion() || 0));
130
+ if (!coreRequest)
131
+ return next();
132
+ // Non-canonical incoming URL — every emitter is supposed
133
+ // to canonicalize before hitting the device. Promote the
134
+ // drift to a 301 redirect so iOS still gets the file at
135
+ // the canonical URL (no realm split) but the offending
136
+ // caller is forced to update. We log the offending raw
137
+ // pathname so the regression source is easy to find.
138
+ if (coreRequest.canonicalPath) {
139
+ // Diagnostic only — the 301 below transparently serves the canonical file, so this is not a user-facing problem.
140
+ if (verbose) {
141
+ try {
142
+ console.warn(`[ns-core-bridge] 301 ${urlObj.pathname}${urlObj.search} → ${coreRequest.canonicalPath} (non-canonical core URL — please update emitter)`);
143
+ }
144
+ catch { }
145
+ }
146
+ res.setHeader('Access-Control-Allow-Origin', '*');
147
+ res.setHeader('Location', coreRequest.canonicalPath);
148
+ res.statusCode = 301;
149
+ res.end();
150
+ return;
151
+ }
152
+ setDeviceModuleHeaders(res);
153
+ const { normalizedSub, sub } = coreRequest;
154
+ // BUNDLE MODE (default): serve thin shims over /ns/core-bundle.mjs.
155
+ // The canonical URL space is unchanged — only the response bodies
156
+ // differ. Fall through to the per-module pipeline below when the
157
+ // bundle build failed or when the requested subpath was excluded
158
+ // from bundle enumeration (e.g. debugger/ modules). That fallback
159
+ // is realm-safe: the per-module response's own core imports are
160
+ // rewritten to `/ns/core/<sub>` URLs, which resolve to shims that
161
+ // join the bundle realm.
162
+ if (coreBundle) {
163
+ const bundleState = await coreBundle.ensureBuilt();
164
+ if (bundleState) {
165
+ const canonicalSubForShim = normalizeCoreSubCanonical(normalizedSub || sub || '');
166
+ if (!canonicalSubForShim) {
167
+ res.statusCode = 200;
168
+ res.end(buildCoreMainShimCode());
169
+ return;
170
+ }
171
+ if (bundleState.subs.has(canonicalSubForShim)) {
172
+ const exportInfo = await getSubShimExportInfo(canonicalSubForShim);
173
+ res.statusCode = 200;
174
+ res.end(buildCoreSubShimCode(canonicalSubForShim, exportInfo.names, exportInfo.hasDefault));
175
+ return;
176
+ }
177
+ // Deliberately excluded subs (debugger/, inspector_modules,
178
+ // bundle-entry-points, …) hit this fallback on every dev boot
179
+ // by design — that is expected and harmless, so the log is
180
+ // verbose-only for them. An UNEXPECTED miss (a sub that
181
+ // should have been enumerated) still warns once so
182
+ // enumeration regressions stay visible.
183
+ if (!warnedFallbackSubs.has(canonicalSubForShim)) {
184
+ warnedFallbackSubs.add(canonicalSubForShim);
185
+ if (verbose || !isExpectedCoreBundleExclusion(canonicalSubForShim)) {
186
+ console.warn(`[ns-core-bundle] sub '${canonicalSubForShim}' not in bundle enumeration — serving per-module (realm-safe fallback)`);
187
+ }
188
+ }
189
+ }
190
+ }
191
+ const resolveModuleId = async (moduleId) => {
192
+ const resolved = await server.pluginContainer?.resolveId?.(moduleId, undefined);
193
+ return typeof resolved === 'string' ? resolved : resolved?.id || null;
194
+ };
195
+ let modulePath = null;
196
+ if (sub) {
197
+ const resolvedSubpath = normalizedSub || sub;
198
+ modulePath = await resolveRuntimeCoreModulePath(resolvedSubpath, resolveModuleId);
199
+ if (!modulePath) {
200
+ modulePath = `/node_modules/@nativescript/core/${resolvedSubpath}`;
201
+ }
202
+ }
203
+ else {
204
+ modulePath = (await resolveModuleId('@nativescript/core')) || '/node_modules/@nativescript/core/index.js';
205
+ }
206
+ const transformed = await options.sharedTransformRequest(modulePath);
207
+ if (!transformed?.code) {
208
+ res.statusCode = 500;
209
+ res.setHeader('Content-Type', 'application/json');
210
+ res.end(JSON.stringify({ error: 'core-transform-failed', modulePath, sub: sub || null }));
211
+ return;
212
+ }
213
+ // Vite's transform output references module IDs with /@fs,
214
+ // relative specifiers, or absolute project paths. Rewrite
215
+ // those to URLs iOS can fetch over HTTP.
216
+ //
217
+ // We also thread a `RelativeBase` so any lingering relative
218
+ // specifiers (`./x`, `../x`) — which Vite's import-analysis
219
+ // sometimes leaves untouched for `node_modules` files — get
220
+ // resolved against the served URL's logical directory and
221
+ // rewritten to canonical `/ns/core/<resolved>` URLs.
222
+ //
223
+ // Without this, V8/iOS apply RFC 3986 URL resolution against
224
+ // the served URL (which has no trailing slash) and treat the
225
+ // last path segment as a *file*, so `./layout-helper-common`
226
+ // from `/ns/core/utils/layout-helper` becomes
227
+ // `/ns/core/utils/layout-helper-common` — a sibling that
228
+ // doesn't exist, producing "Failed to load url … Does the
229
+ // file exist?" from Vite and a stuck boot screen.
230
+ const __rawSubForRel = String(normalizedSub || sub || '').replace(/^\/+|\/+$/g, '');
231
+ const __isDirIndex = isDirectoryIndexFilename(modulePath || '');
232
+ const __relBase = { sub: __rawSubForRel, isDirectoryIndex: __isDirIndex };
233
+ let rewritten = rewriteSpecifiersForDevice(transformed.code, getServerOrigin(server), Number(options.getGraphVersion() || 0), __relBase);
234
+ // Invariant D (CJS/ESM interop shape) — EXPORT-SIDE fix.
235
+ //
236
+ // `@nativescript/core/index.js` declares namespace
237
+ // re-exports like:
238
+ // export * as Utils from './utils';
239
+ // The ES spec says these produce Module Namespace Objects
240
+ // with [[Prototype]] = null. Consumers that reach them
241
+ // via direct ESM import — `import { Utils } from
242
+ // '@nativescript/core'` — get the raw null-proto value,
243
+ // bypassing any CJS `require` shim we install. Most
244
+ // consumers tolerate this, but CJS-style interop (most
245
+ // notably zone.js's `patchMethod`) calls
246
+ // `hasOwnProperty` on the target and crashes on
247
+ // null-proto.
248
+ //
249
+ // We rewrite the re-export to a shape-wrapped const:
250
+ // import * as __ns_re_Utils__ from './utils';
251
+ // export const Utils = __NS_CJS_SHAPE__(__ns_re_Utils__);
252
+ // so the EXPORT itself is a plain object — visible to
253
+ // both ESM and CJS consumers consistently.
254
+ //
255
+ // We only pay the rewrite cost when the module actually
256
+ // contains namespace re-exports (i.e., the main
257
+ // `index.js`). Subpaths (`/utils`, `/http`, …) don't
258
+ // re-export via `export * as`; they expose named
259
+ // exports directly, so the rewrite is a no-op on them.
260
+ if (hasNamespaceReExport(rewritten)) {
261
+ rewritten = rewriteNamespaceReExportsForShape(rewritten);
262
+ }
263
+ // Prepend the build-time defines (__DEV__, __IOS__, __ANDROID__,
264
+ // __APPLE__, …) that @nativescript/core source references directly.
265
+ // Vite's `define` config substitutes these in user-code transforms but
266
+ // skips node_modules by default; since core is now external and served
267
+ // over HTTP from this endpoint, the served transformed code still has
268
+ // bare identifiers like `if (__DEV__) …`. Without these consts, V8
269
+ // hits `ReferenceError: __DEV__ is not defined` at module eval because
270
+ // globalThis.__DEV__ is set by bundle.mjs's body AFTER all static
271
+ // imports (including these core modules) have resolved.
272
+ //
273
+ // We inject LITERAL boolean values based on CLI flags + dev-server
274
+ // mode rather than reading from globalThis, so the defines are
275
+ // resolved even before bundle.mjs's body runs.
276
+ const __cliFlags = getCliFlags() || {};
277
+ const __platformIsAndroid = !!__cliFlags.android;
278
+ const __platformIsVisionOS = !!__cliFlags.visionos;
279
+ const __platformIsIOS = !__platformIsAndroid && !__platformIsVisionOS;
280
+ const preamble = [
281
+ `const __ANDROID__ = ${__platformIsAndroid ? 'true' : 'false'};`,
282
+ `const __IOS__ = ${__platformIsIOS ? 'true' : 'false'};`,
283
+ `const __VISIONOS__ = ${__platformIsVisionOS ? 'true' : 'false'};`,
284
+ `const __APPLE__ = __IOS__ || __VISIONOS__;`,
285
+ `const __DEV__ = ${server.config?.mode === 'development' ? 'true' : 'false'};`,
286
+ `const __COMMONJS__ = false;`,
287
+ `const __NS_WEBPACK__ = false;`,
288
+ `const __NS_ENV_VERBOSE__ = globalThis.__NS_ENV_VERBOSE__ !== undefined ? !!globalThis.__NS_ENV_VERBOSE__ : false;`,
289
+ `const __CSS_PARSER__ = 'css-tree';`,
290
+ `const __UI_USE_XML_PARSER__ = true;`,
291
+ `const __UI_USE_EXTERNAL_RENDERER__ = false;`,
292
+ `const __TEST__ = false;`,
293
+ ].join('\n');
294
+ // Boot-time instrumentation + module self-registration.
295
+ //
296
+ // - URL canonicalization: the same logical module must
297
+ // always resolve to byte-identical URLs across every
298
+ // emitter. The /ns/core handler records the first URL
299
+ // seen for each canonical sub (or '' for main) in
300
+ // `globalThis.__NS_CORE_FIRST_URL__` and fails hard on
301
+ // mismatch so drift in any emitter surfaces
302
+ // immediately, before the realm splits.
303
+ // - CJS/ESM boot order: CommonJS
304
+ // `require('@nativescript/core/...')` calls from
305
+ // vendor install() hooks must resolve to the SAME
306
+ // ESM namespace that ran this side-effect preamble.
307
+ // The registration below keys the namespace object
308
+ // under BOTH the bare specifier and the canonical
309
+ // subpath (and raw subpath for back-compat) so the
310
+ // vendor shim's `createRequire` and the main-entry
311
+ // `_nsReq` hit on any lookup form.
312
+ const rawSub = normalizedSub || sub || '';
313
+ const canonicalSub = normalizeCoreSubCanonical(rawSub);
314
+ const registrationKeySet = new Set();
315
+ registrationKeySet.add(canonicalSub ? `@nativescript/core/${canonicalSub}` : '@nativescript/core');
316
+ registrationKeySet.add(canonicalSub);
317
+ if (rawSub && rawSub !== canonicalSub) {
318
+ registrationKeySet.add(`@nativescript/core/${rawSub}`);
319
+ registrationKeySet.add(rawSub);
320
+ }
321
+ const registrationKeys = Array.from(registrationKeySet).map((k) => JSON.stringify(k));
322
+ const canonicalUrl = `${getServerOrigin(server)}` + (canonicalSub ? `/ns/core/${canonicalSub}` : '/ns/core');
323
+ const instrumentationHeader = [
324
+ `/* @nativescript/core bridge — canonical URL: ${canonicalUrl} */`,
325
+ `try { if (typeof globalThis !== 'undefined') {`,
326
+ ` const __nsFirst = globalThis.__NS_CORE_FIRST_URL__ || (globalThis.__NS_CORE_FIRST_URL__ = Object.create(null));`,
327
+ ` const __nsSeen = globalThis.__NS_CORE_FETCHED_URLS__ || (globalThis.__NS_CORE_FETCHED_URLS__ = []);`,
328
+ ` const __nsKey = ${JSON.stringify(canonicalSub)};`,
329
+ ` const __nsUrl = ${JSON.stringify(canonicalUrl)};`,
330
+ ` __nsSeen.push(__nsUrl);`,
331
+ ` if (typeof __nsFirst[__nsKey] === 'string' && __nsFirst[__nsKey] !== __nsUrl) {`,
332
+ ` throw new Error('[ns-core] URL drift for sub=' + __nsKey + ': first=' + __nsFirst[__nsKey] + ' now=' + __nsUrl);`,
333
+ ` }`,
334
+ ` if (!__nsFirst[__nsKey]) __nsFirst[__nsKey] = __nsUrl;`,
335
+ ` globalThis.__NS_CORE_EVAL_COUNT__ = (globalThis.__NS_CORE_EVAL_COUNT__ || 0) + 1;`,
336
+ `} } catch (e) { console.warn('[ns-core] instrumentation failed:', (e && e.message) || e); }`,
337
+ ].join('\n');
338
+ // CJS/ESM interop shape — REGISTRATION side.
339
+ //
340
+ // The actual shape installer runs earlier in the module
341
+ // body (between preamble and selfImport; see
342
+ // buildShapeInstallHeader). At this point we just read
343
+ // globalThis.__NS_CJS_SHAPE__ and apply it to the self
344
+ // namespace before registering under the CJS key space.
345
+ //
346
+ // Why shape self at registration: consumers that reach
347
+ // `@nativescript/core` via `require()` (legacy vendors,
348
+ // `globalThis.require` shim) look up the registry. They
349
+ // expect a plain object (Object.prototype in chain) so
350
+ // `.hasOwnProperty` / `.toString` work. Shaping once on
351
+ // registration — the shape function is identity-preserving
352
+ // via WeakMap — gives a stable, shared, CJS-compatible
353
+ // view without copying on every require.
354
+ const registrationFooter = [
355
+ `try { if (typeof globalThis !== 'undefined') {`,
356
+ ` const __nsReg = globalThis.__NS_CORE_MODULES__ || (globalThis.__NS_CORE_MODULES__ = Object.create(null));`,
357
+ ` const __nsShapeFn = typeof globalThis.__NS_CJS_SHAPE__ === 'function' ? globalThis.__NS_CJS_SHAPE__ : function (x) { return x; };`,
358
+ ` const __nsSelfRaw = (typeof __ns_core_self_ns__ !== 'undefined') ? __ns_core_self_ns__ : { default: undefined };`,
359
+ ` const __nsSelf = __nsShapeFn(__nsSelfRaw);`,
360
+ ...registrationKeys.map((k) => ` __nsReg[${k}] = __nsSelf;`),
361
+ `} } catch (e) { console.warn('[ns-core] self-register failed:', (e && e.message) || e); }`,
362
+ ].join('\n');
363
+ // Bind `import * as __ns_core_self_ns__` to the module's
364
+ // own export namespace so the footer can stash it into
365
+ // the registry. Self-import is a no-op at eval time —
366
+ // V8 resolves it to the module record we're already
367
+ // evaluating and the final namespace is the same object
368
+ // the registry receives. We use the CANONICAL URL here
369
+ // so the self-import participates in Invariant A along
370
+ // with every other @nativescript/core URL.
371
+ const canonicalUrlForSelf = canonicalSub ? `/ns/core/${canonicalSub}` : '/ns/core';
372
+ const selfImport = `import * as __ns_core_self_ns__ from ${JSON.stringify(canonicalUrlForSelf)};`;
373
+ // Invariant D — SHAPE INSTALLER.
374
+ //
375
+ // Emits idempotent body-code that installs
376
+ // globalThis.__NS_CJS_SHAPE__ BEFORE `rewritten`'s body
377
+ // runs. This matters because the rewrite step above may
378
+ // have produced statements like
379
+ // `export const Utils = (typeof globalThis.__NS_CJS_SHAPE__ ...)(__ns_re_Utils__);`
380
+ // that execute during module evaluation. Without the
381
+ // installer running first, the ternary falls back to
382
+ // identity — still safe, but the null-proto namespace
383
+ // leaks through and consumers that expect a plain
384
+ // object would still crash.
385
+ //
386
+ // Placement is important: BEFORE selfImport in the
387
+ // concatenation. ESM imports are hoisted regardless of
388
+ // textual position, but body code executes in source
389
+ // order. Placing the installer first guarantees it
390
+ // runs before any body statement in `rewritten`.
391
+ //
392
+ // Install is idempotent: `|| (globalThis.X = ...)` so
393
+ // whichever /ns/core module evaluates first wins and
394
+ // every subsequent module becomes a no-op.
395
+ const shapeInstallHeader = buildShapeInstallHeader();
396
+ // Invariant D — DEFAULT EXPORT BRIDGE.
397
+ //
398
+ // See `buildDefaultExportFooter` in ns-core-cjs-shape.ts
399
+ // for the full rationale (consumer matrix, skip conditions,
400
+ // why the default isn't shaped). The short version:
401
+ // upstream rewrites turn `import { X } from '@nativescript/core'`
402
+ // into a DEFAULT import, and the bridge has to provide one.
403
+ const defaultExportFooter = buildDefaultExportFooter(rewritten);
404
+ const moduleCode = [instrumentationHeader, preamble, shapeInstallHeader, selfImport, rewritten, defaultExportFooter, registrationFooter].join('\n');
405
+ res.statusCode = 200;
406
+ res.end(moduleCode);
407
+ }
408
+ catch (e) {
409
+ console.warn('[ns-core-bridge] serve failed:', e?.message);
410
+ next();
411
+ }
412
+ });
413
+ }
414
+ //# sourceMappingURL=websocket-ns-core.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"websocket-ns-core.js","sourceRoot":"","sources":["../../../../../packages/vite/hmr/server/websocket-ns-core.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAIvC,OAAO,EAAE,wBAAwB,EAAE,0BAA0B,EAAqB,MAAM,oBAAoB,CAAC;AAC7G,OAAO,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,oBAAoB,EAAE,iCAAiC,EAAE,MAAM,wBAAwB,CAAC;AAC9K,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,gBAAgB,IAAI,yBAAyB,EAAE,MAAM,8BAA8B,CAAC;AAC7F,OAAO,EAAE,sBAAsB,EAAE,4BAA4B,EAAE,gCAAgC,EAAE,MAAM,4BAA4B,CAAC;AACpI,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,0BAA0B,EAAE,6BAA6B,EAAE,6BAA6B,EAA0B,MAAM,kBAAkB,CAAC;AAqBnN;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,mBAAmB,CAAC,MAAqB,EAAE,OAAmC;IAC7F,MAAM,OAAO,GAAG,kBAAkB,EAAE,CAAC;IACrC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BAAqB,EAAE,QAAQ,EAAE,kBAAkB,EAAE,UAAU,EAAE,SAAS,EAAE,mBAAmB,EAAE,kBAAkB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACpJ,GAAG,CAAC,UAAU,GAAG,GAAG,CAAC;YACrB,GAAG,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QACrB,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACZ,OAAO,CAAC,IAAI,CAAC,gCAAgC,EAAG,CAAS,EAAE,OAAO,CAAC,CAAC;YACpE,IAAI,EAAE,CAAC;QACR,CAAC;IACF,CAAC,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,21 @@
1
+ import type { ViteDevServer } from 'vite';
2
+ /**
3
+ * Dependencies the device-bootstrap routes need from the HMR plugin closure.
4
+ * The three project-path values are computed once in `websocket.ts`; injecting
5
+ * them (rather than recomputing) keeps a single source of truth.
6
+ */
7
+ export interface RegisterNsEntryRoutesOptions {
8
+ verbose: boolean;
9
+ appRootDir: string;
10
+ defaultMainEntry: string;
11
+ defaultMainEntryVirtual: string;
12
+ getGraphVersion(): number;
13
+ }
14
+ /**
15
+ * Registers the device bootstrap endpoints:
16
+ * - `GET /ns/entry-rt[?v=<ver>]` — serves the compiled entry runtime module
17
+ * (built `entry-runtime.js`, or a transformed `entry-runtime.ts` fallback), and
18
+ * - `GET /ns/entry[/<ver>]` — a script-safe wrapper that fetches the entry
19
+ * runtime and starts the app with `{ origin, main, ver }`.
20
+ */
21
+ export declare function registerNsEntryRoutes(server: ViteDevServer, options: RegisterNsEntryRoutesOptions): void;
@@ -0,0 +1,164 @@
1
+ import { createRequire } from 'node:module';
2
+ import { fileURLToPath } from 'node:url';
3
+ import { existsSync, readFileSync } from 'fs';
4
+ import * as path from 'path';
5
+ import babelCore from '@babel/core';
6
+ import { getPackageJson, getProjectFilePath } from '../../helpers/project.js';
7
+ import { REQUIRE_GUARD_SNIPPET } from './require-guard.js';
8
+ import { setDeviceModuleHeaders } from './route-helpers.js';
9
+ import { getServerOrigin } from './server-origin.js';
10
+ // Lazily loaded only for the source-tree fallback below (transform
11
+ // entry-runtime.ts on the fly when the built .js isn't present).
12
+ const pluginTransformTypescript = (() => {
13
+ const requireFromHere = createRequire(import.meta.url);
14
+ const loaded = requireFromHere('@babel/plugin-transform-typescript');
15
+ return loaded?.default || loaded;
16
+ })();
17
+ /**
18
+ * Registers the device bootstrap endpoints:
19
+ * - `GET /ns/entry-rt[?v=<ver>]` — serves the compiled entry runtime module
20
+ * (built `entry-runtime.js`, or a transformed `entry-runtime.ts` fallback), and
21
+ * - `GET /ns/entry[/<ver>]` — a script-safe wrapper that fetches the entry
22
+ * runtime and starts the app with `{ origin, main, ver }`.
23
+ */
24
+ export function registerNsEntryRoutes(server, options) {
25
+ const verbose = options.verbose;
26
+ const APP_ROOT_DIR = options.appRootDir;
27
+ const DEFAULT_MAIN_ENTRY = options.defaultMainEntry;
28
+ const DEFAULT_MAIN_ENTRY_VIRTUAL = options.defaultMainEntryVirtual;
29
+ const getGraphVersion = options.getGraphVersion;
30
+ // The compiled entry runtime is static for a dev-server session (a package
31
+ // rebuild restarts the server), so read/transform it once and reuse — avoids a
32
+ // `readFileSync` (and, in a source-tree checkout, a synchronous Babel
33
+ // transform) on every device boot.
34
+ let cachedEntryRtContent = null;
35
+ // 2.6a) Serve compiled entry runtime module: GET /ns/entry-rt[?v=<ver>]
36
+ server.middlewares.use(async (req, res, next) => {
37
+ try {
38
+ const urlObj = new URL(req.url || '', 'http://localhost');
39
+ if (!(urlObj.pathname === '/ns/entry-rt'))
40
+ return next();
41
+ if (verbose) {
42
+ const ra = req.socket?.remoteAddress;
43
+ const rp = req.socket?.remotePort;
44
+ console.log('[hmr-http] GET /ns/entry-rt from', ra + (rp ? ':' + rp : ''));
45
+ }
46
+ setDeviceModuleHeaders(res);
47
+ let content = cachedEntryRtContent || '';
48
+ if (!content) {
49
+ try {
50
+ const _req = createRequire(import.meta.url);
51
+ const entryRtPath = _req.resolve('@nativescript/vite/hmr/entry-runtime.js');
52
+ content = readFileSync(entryRtPath, 'utf-8');
53
+ }
54
+ catch (e) {
55
+ // .js not found (source tree without build) — transform .ts on the fly
56
+ try {
57
+ // fileURLToPath (not `new URL(...).pathname`) so the `/C:/…`
58
+ // leading-slash on Windows file URLs doesn't break the lookup.
59
+ const tsPath = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..', 'entry-runtime.ts');
60
+ if (existsSync(tsPath)) {
61
+ const tsSource = readFileSync(tsPath, 'utf-8');
62
+ const result = babelCore.transformSync(tsSource, {
63
+ filename: tsPath,
64
+ plugins: [[pluginTransformTypescript, { isTSX: false, allowDeclareFields: true }]],
65
+ sourceType: 'module',
66
+ });
67
+ if (result?.code) {
68
+ content = result.code;
69
+ }
70
+ }
71
+ }
72
+ catch (e2) {
73
+ if (verbose)
74
+ console.warn('[hmr-http] entry-runtime.ts transform failed', e2);
75
+ }
76
+ }
77
+ // Cache only successful content; never cache the not-found fallback stub.
78
+ if (content) {
79
+ cachedEntryRtContent = content;
80
+ }
81
+ else {
82
+ content = 'export default async function start(){ console.error("[/ns/entry-rt] not found"); }\n';
83
+ }
84
+ }
85
+ if (verbose)
86
+ console.log('[hmr-http] /ns/entry-rt serving', content.length, 'bytes');
87
+ res.statusCode = 200;
88
+ res.end(content);
89
+ }
90
+ catch (e) {
91
+ console.warn('[hmr-http] /ns/entry-rt error', e);
92
+ next();
93
+ }
94
+ });
95
+ // 2.6b) HTTP-only app entry endpoint: GET /ns/entry[/<ver>]
96
+ // Thin wrapper that imports the compiled entry runtime and starts it with parameters.
97
+ server.middlewares.use(async (req, res, next) => {
98
+ try {
99
+ const urlObj = new URL(req.url || '', 'http://localhost');
100
+ if (!(urlObj.pathname === '/ns/entry' || /^\/ns\/entry\/[\d]+$/.test(urlObj.pathname)))
101
+ return next();
102
+ try {
103
+ if (verbose) {
104
+ const ra = req.socket?.remoteAddress;
105
+ const rp = req.socket?.remotePort;
106
+ console.log('[hmr-http] GET /ns/entry from', ra + (rp ? ':' + rp : ''));
107
+ }
108
+ }
109
+ catch { }
110
+ const verSeg = urlObj.pathname.replace(/^\/ns\/entry\/?/, '');
111
+ // Resolve app main entry to an absolute path-like key used by /ns/m
112
+ res.setHeader('Cache-Control', 'no-store, no-cache, must-revalidate, max-age=0');
113
+ res.setHeader('Pragma', 'no-cache');
114
+ res.setHeader('Expires', '0');
115
+ const ver = /^[0-9]+$/.test(verSeg) ? verSeg : String(getGraphVersion() || 0);
116
+ const origin = getServerOrigin(server) || `${urlObj.protocol}//${urlObj.host}`;
117
+ // Resolve app main entry to an absolute path-like key used by /ns/m
118
+ let mainEntry = '/';
119
+ try {
120
+ const pkg = getPackageJson();
121
+ const main = pkg?.main || DEFAULT_MAIN_ENTRY;
122
+ const abs = getProjectFilePath(main).replace(/\\/g, '/');
123
+ // Normalize to '/app/...'
124
+ const marker = `/${APP_ROOT_DIR}/`;
125
+ const idx = abs.indexOf(marker);
126
+ mainEntry = idx >= 0 ? abs.substring(idx) : DEFAULT_MAIN_ENTRY_VIRTUAL;
127
+ }
128
+ catch { }
129
+ // Build a tiny wrapper that imports the compiled entry runtime from the dev server
130
+ let code = REQUIRE_GUARD_SNIPPET +
131
+ `// [ns-entry][v${ver}] wrapper (script-safe) bytes will follow\n` +
132
+ `(async function(){\n` +
133
+ ` let origin = ${JSON.stringify(origin)}; const main = ${JSON.stringify(mainEntry)}; const __ns_graph_ver = ${JSON.stringify(ver)};\n` +
134
+ ` try { const __b = (globalThis && globalThis.__NS_ENTRY_BASE__) ? String(globalThis.__NS_ENTRY_BASE__) : ''; if (__b) { try { const __o = new URL(__b).origin; if (__o) origin = __o; } catch {} } } catch {}\n` +
135
+ ` const __VERBOSE__ = (typeof __NS_ENV_VERBOSE__ !== 'undefined' && __NS_ENV_VERBOSE__) || (globalThis && globalThis.process && globalThis.process.env && globalThis.process.env.verbose) || (globalThis && globalThis.__NS_ENV_VERBOSE__) || ${JSON.stringify(!!verbose)};\n` +
136
+ ` if (__VERBOSE__) console.info('[ns-entry][wrapper] start', { origin, main, ver: __ns_graph_ver });\n` +
137
+ ` async function __ns_import_entry_rt(u){\n` +
138
+ ` // Prefer fetch+eval script transformation to avoid module import limitations on device\n` +
139
+ ` try { const r = await fetch(u); const t = await r.text(); if (__VERBOSE__) console.info('[ns-entry][wrapper] entry-rt fetched bytes', (t&&t.length)||0);\n` +
140
+ ` // Transform 'export default function' or 'export default async function' into global assignment\n` +
141
+ ` let s = t.replace(/export\\s+default\\s+async\\s+function\\s+([A-Za-z0-9_$]+)?/,'globalThis.__NS_START_ENTRY__=async function $1')\n` +
142
+ ` .replace(/export\\s+default\\s+function\\s+([A-Za-z0-9_$]+)?/,'globalThis.__NS_START_ENTRY__=function $1');\n` +
143
+ ` // Fallback: if function-form replacements didn't run, handle expression default export too\n` +
144
+ ` if (String(s).indexOf('__NS_START_ENTRY__') === -1) { s = 'globalThis.__NS_START_ENTRY__=' + s.replace(/export\\s+default\\s*/,''); }\n` +
145
+ ` try { (0,eval)(s); } catch (ee) { console.error('[ns-entry][wrapper] eval entry-rt failed', ee && (ee.message||ee)); throw ee; }\n` +
146
+ ` const fn = globalThis.__NS_START_ENTRY__; if (!fn) { throw new Error('entry-rt missing __NS_START_ENTRY__'); }\n` +
147
+ ` return { default: fn };\n` +
148
+ ` } catch(e) { console.error('[ns-entry][wrapper] entry-rt fetch/eval failed', e && (e.message||e)); throw e; }\n` +
149
+ ` }\n` +
150
+ ` const __entryRtUrl = '/ns/entry-rt?v=' + String(__ns_graph_ver);\n` +
151
+ ` let __mod; try { __mod = await __ns_import_entry_rt(__entryRtUrl); if (__VERBOSE__) console.info('[ns-entry][wrapper] entry-rt ready'); } catch (e) { console.error('[ns-entry][wrapper] failed to prepare entry-rt', e && (e.message||e)); throw e; }\n` +
152
+ ` const startEntry = (__mod && (__mod.default || __mod));\n` +
153
+ ` try { await startEntry({ origin, main, ver: __ns_graph_ver, verbose: !!__VERBOSE__ }); if (__VERBOSE__) console.info('[ns-entry][wrapper] startEntry() resolved'); } catch (e) { console.error('[ns-entry][wrapper] startEntry() failed', e && (e.message||e)); throw e; }\n` +
154
+ `})();\n`;
155
+ code = code + `\n//# sourceURL=${origin}/ns/entry`;
156
+ res.statusCode = 200;
157
+ res.end(code);
158
+ }
159
+ catch (e) {
160
+ next();
161
+ }
162
+ });
163
+ }
164
+ //# sourceMappingURL=websocket-ns-entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"websocket-ns-entry.js","sourceRoot":"","sources":["../../../../../packages/vite/hmr/server/websocket-ns-entry.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAC9C,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B,OAAO,SAAS,MAAM,aAAa,CAAC;AAEpC,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9E,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,mEAAmE;AACnE,iEAAiE;AACjE,MAAM,yBAAyB,GAAQ,CAAC,GAAG,EAAE;IAC5C,MAAM,eAAe,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACvD,MAAM,MAAM,GAAG,eAAe,CAAC,oCAAoC,CAAC,CAAC;IACrE,OAAO,MAAM,EAAE,OAAO,IAAI,MAAM,CAAC;AAClC,CAAC,CAAC,EAAE,CAAC;AAeL;;;;;;GAMG;AACH,MAAM,UAAU,qBAAqB,CAAC,MAAqB,EAAE,OAAqC;IACjG,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO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