@nativescript/vite 8.0.0-alpha.5 → 8.0.0-alpha.50

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 (424) 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 +376 -165
  5. package/configuration/angular.js.map +1 -1
  6. package/configuration/base.js +241 -51
  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 +1 -1
  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 +142 -0
  41. package/helpers/global-defines.js +213 -11
  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.d.ts +1 -0
  49. package/helpers/logging.js +65 -4
  50. package/helpers/logging.js.map +1 -1
  51. package/helpers/main-entry.d.ts +3 -1
  52. package/helpers/main-entry.js +301 -53
  53. package/helpers/main-entry.js.map +1 -1
  54. package/helpers/nativeclass-esbuild-plugin.d.ts +2 -1
  55. package/helpers/nativeclass-esbuild-plugin.js.map +1 -1
  56. package/helpers/nativeclass-transform.js +5 -6
  57. package/helpers/nativeclass-transform.js.map +1 -1
  58. package/helpers/nativeclass-transformer-plugin.d.ts +9 -2
  59. package/helpers/nativeclass-transformer-plugin.js +157 -14
  60. package/helpers/nativeclass-transformer-plugin.js.map +1 -1
  61. package/helpers/nativescript-package-resolver.js +10 -62
  62. package/helpers/nativescript-package-resolver.js.map +1 -1
  63. package/helpers/normalize-id.d.ts +42 -0
  64. package/helpers/normalize-id.js +60 -0
  65. package/helpers/normalize-id.js.map +1 -0
  66. package/helpers/ns-core-url.d.ts +29 -7
  67. package/helpers/ns-core-url.js +69 -12
  68. package/helpers/ns-core-url.js.map +1 -1
  69. package/helpers/optimize-deps.d.ts +16 -0
  70. package/helpers/optimize-deps.js +17 -0
  71. package/helpers/optimize-deps.js.map +1 -0
  72. package/helpers/package-platform-aliases.js +34 -49
  73. package/helpers/package-platform-aliases.js.map +1 -1
  74. package/helpers/platform-types.d.ts +2 -0
  75. package/helpers/platform-types.js +2 -0
  76. package/helpers/platform-types.js.map +1 -0
  77. package/helpers/postcss-platform-config.d.ts +17 -1
  78. package/helpers/postcss-platform-config.js +20 -37
  79. package/helpers/postcss-platform-config.js.map +1 -1
  80. package/helpers/project.d.ts +35 -0
  81. package/helpers/project.js +120 -2
  82. package/helpers/project.js.map +1 -1
  83. package/helpers/resolve-main-field-platform.d.ts +20 -0
  84. package/helpers/resolve-main-field-platform.js +49 -0
  85. package/helpers/resolve-main-field-platform.js.map +1 -0
  86. package/helpers/resolver.js +17 -2
  87. package/helpers/resolver.js.map +1 -1
  88. package/helpers/theme-core-plugins.js +1 -1
  89. package/helpers/theme-core-plugins.js.map +1 -1
  90. package/helpers/ts-config-paths.d.ts +14 -0
  91. package/helpers/ts-config-paths.js +90 -9
  92. package/helpers/ts-config-paths.js.map +1 -1
  93. package/helpers/typescript-check.d.ts +2 -1
  94. package/helpers/typescript-check.js +2 -2
  95. package/helpers/typescript-check.js.map +1 -1
  96. package/helpers/ui-registration.d.ts +21 -0
  97. package/helpers/ui-registration.js +156 -0
  98. package/helpers/ui-registration.js.map +1 -0
  99. package/helpers/utils.d.ts +9 -0
  100. package/helpers/utils.js +22 -2
  101. package/helpers/utils.js.map +1 -1
  102. package/helpers/workers.d.ts +20 -19
  103. package/helpers/workers.js +624 -4
  104. package/helpers/workers.js.map +1 -1
  105. package/hmr/client/css-handler.d.ts +2 -1
  106. package/hmr/client/css-handler.js +50 -26
  107. package/hmr/client/css-handler.js.map +1 -1
  108. package/hmr/client/css-update-overlay.d.ts +18 -0
  109. package/hmr/client/css-update-overlay.js +27 -0
  110. package/hmr/client/css-update-overlay.js.map +1 -0
  111. package/hmr/client/framework-client-strategy.d.ts +79 -0
  112. package/hmr/client/framework-client-strategy.js +19 -0
  113. package/hmr/client/framework-client-strategy.js.map +1 -0
  114. package/hmr/client/hmr-pending-overlay.d.ts +13 -0
  115. package/hmr/client/hmr-pending-overlay.js +60 -0
  116. package/hmr/client/hmr-pending-overlay.js.map +1 -0
  117. package/hmr/client/index.js +891 -220
  118. package/hmr/client/index.js.map +1 -1
  119. package/hmr/client/utils.d.ts +7 -1
  120. package/hmr/client/utils.js +207 -29
  121. package/hmr/client/utils.js.map +1 -1
  122. package/hmr/entry-runtime.d.ts +2 -1
  123. package/hmr/entry-runtime.js +256 -69
  124. package/hmr/entry-runtime.js.map +1 -1
  125. package/hmr/frameworks/angular/build/angular-linker.d.ts +12 -0
  126. package/hmr/frameworks/angular/build/angular-linker.js +109 -0
  127. package/hmr/frameworks/angular/build/angular-linker.js.map +1 -0
  128. package/hmr/frameworks/angular/build/inject-component-hmr-registration.d.ts +112 -0
  129. package/hmr/frameworks/angular/build/inject-component-hmr-registration.js +291 -0
  130. package/hmr/frameworks/angular/build/inject-component-hmr-registration.js.map +1 -0
  131. package/hmr/frameworks/angular/build/inject-hmr-vite-ignore.d.ts +75 -0
  132. package/hmr/frameworks/angular/build/inject-hmr-vite-ignore.js +221 -0
  133. package/hmr/frameworks/angular/build/inject-hmr-vite-ignore.js.map +1 -0
  134. package/{helpers/angular → hmr/frameworks/angular/build}/inline-decorator-component-templates.js +1 -170
  135. package/hmr/frameworks/angular/build/inline-decorator-component-templates.js.map +1 -0
  136. package/hmr/frameworks/angular/build/js-lexer.d.ts +4 -0
  137. package/{helpers/angular/synthesize-decorator-ctor-parameters.js → hmr/frameworks/angular/build/js-lexer.js} +22 -96
  138. package/hmr/frameworks/angular/build/js-lexer.js.map +1 -0
  139. package/hmr/frameworks/angular/build/shared-linker.d.ts +39 -0
  140. package/hmr/frameworks/angular/build/shared-linker.js +128 -0
  141. package/hmr/frameworks/angular/build/shared-linker.js.map +1 -0
  142. package/hmr/frameworks/angular/build/synthesize-decorator-ctor-parameters.js +88 -0
  143. package/hmr/frameworks/angular/build/synthesize-decorator-ctor-parameters.js.map +1 -0
  144. package/{helpers/angular → hmr/frameworks/angular/build}/synthesize-injectable-factories.js +1 -174
  145. package/hmr/frameworks/angular/build/synthesize-injectable-factories.js.map +1 -0
  146. package/{helpers/angular → hmr/frameworks/angular/build}/util.d.ts +1 -0
  147. package/hmr/frameworks/angular/build/util.js +155 -0
  148. package/hmr/frameworks/angular/build/util.js.map +1 -0
  149. package/hmr/frameworks/angular/client/index.d.ts +1 -0
  150. package/hmr/frameworks/angular/client/index.js +859 -21
  151. package/hmr/frameworks/angular/client/index.js.map +1 -1
  152. package/hmr/frameworks/angular/client/strategy.d.ts +9 -0
  153. package/hmr/frameworks/angular/client/strategy.js +19 -0
  154. package/hmr/frameworks/angular/client/strategy.js.map +1 -0
  155. package/hmr/frameworks/angular/server/angular-root-component.d.ts +79 -0
  156. package/hmr/frameworks/angular/server/angular-root-component.js +149 -0
  157. package/hmr/frameworks/angular/server/angular-root-component.js.map +1 -0
  158. package/hmr/frameworks/angular/server/linker.js +1 -4
  159. package/hmr/frameworks/angular/server/linker.js.map +1 -1
  160. package/hmr/frameworks/angular/server/strategy.js +460 -12
  161. package/hmr/frameworks/angular/server/strategy.js.map +1 -1
  162. package/hmr/{server → frameworks/angular/server}/websocket-angular-entry.js +2 -2
  163. package/hmr/frameworks/angular/server/websocket-angular-entry.js.map +1 -0
  164. package/hmr/{server → frameworks/angular/server}/websocket-angular-hot-update.d.ts +17 -11
  165. package/hmr/frameworks/angular/server/websocket-angular-hot-update.js +336 -0
  166. package/hmr/frameworks/angular/server/websocket-angular-hot-update.js.map +1 -0
  167. package/hmr/frameworks/react/server/strategy.d.ts +2 -0
  168. package/hmr/frameworks/react/server/strategy.js +150 -0
  169. package/hmr/frameworks/react/server/strategy.js.map +1 -0
  170. package/hmr/frameworks/solid/build/solid-jsx-deps.d.ts +15 -0
  171. package/hmr/frameworks/solid/build/solid-jsx-deps.js +178 -0
  172. package/hmr/frameworks/solid/build/solid-jsx-deps.js.map +1 -0
  173. package/hmr/frameworks/solid/client/app-runtime.d.ts +54 -0
  174. package/hmr/frameworks/solid/client/app-runtime.js +184 -0
  175. package/hmr/frameworks/solid/client/app-runtime.js.map +1 -0
  176. package/hmr/frameworks/solid/server/strategy.js +291 -16
  177. package/hmr/frameworks/solid/server/strategy.js.map +1 -1
  178. package/hmr/frameworks/typescript/server/strategy.js +38 -14
  179. package/hmr/frameworks/typescript/server/strategy.js.map +1 -1
  180. package/hmr/frameworks/vue/client/dep-propagation.d.ts +36 -0
  181. package/hmr/frameworks/vue/client/dep-propagation.js +101 -0
  182. package/hmr/frameworks/vue/client/dep-propagation.js.map +1 -0
  183. package/hmr/frameworks/vue/client/index.d.ts +8 -0
  184. package/hmr/frameworks/vue/client/index.js +56 -243
  185. package/hmr/frameworks/vue/client/index.js.map +1 -1
  186. package/hmr/frameworks/vue/client/strategy.d.ts +33 -0
  187. package/hmr/frameworks/vue/client/strategy.js +157 -0
  188. package/hmr/frameworks/vue/client/strategy.js.map +1 -0
  189. package/hmr/frameworks/vue/client/vue-sfc-update-overlay.d.ts +49 -0
  190. package/hmr/frameworks/vue/client/vue-sfc-update-overlay.js +142 -0
  191. package/hmr/frameworks/vue/client/vue-sfc-update-overlay.js.map +1 -0
  192. package/hmr/frameworks/vue/server/sfc-route-assemble.d.ts +7 -0
  193. package/hmr/frameworks/vue/server/sfc-route-assemble.js +747 -0
  194. package/hmr/frameworks/vue/server/sfc-route-assemble.js.map +1 -0
  195. package/hmr/frameworks/vue/server/sfc-route-meta.d.ts +7 -0
  196. package/hmr/frameworks/vue/server/sfc-route-meta.js +80 -0
  197. package/hmr/frameworks/vue/server/sfc-route-meta.js.map +1 -0
  198. package/hmr/frameworks/vue/server/sfc-route-serve.d.ts +8 -0
  199. package/hmr/frameworks/vue/server/sfc-route-serve.js +459 -0
  200. package/hmr/frameworks/vue/server/sfc-route-serve.js.map +1 -0
  201. package/hmr/frameworks/vue/server/sfc-route-shared.d.ts +38 -0
  202. package/hmr/frameworks/vue/server/sfc-route-shared.js +48 -0
  203. package/hmr/frameworks/vue/server/sfc-route-shared.js.map +1 -0
  204. package/hmr/frameworks/vue/server/strategy.d.ts +35 -0
  205. package/hmr/frameworks/vue/server/strategy.js +278 -1
  206. package/hmr/frameworks/vue/server/strategy.js.map +1 -1
  207. package/hmr/frameworks/vue/server/websocket-sfc.d.ts +15 -0
  208. package/hmr/frameworks/vue/server/websocket-sfc.js +20 -0
  209. package/hmr/frameworks/vue/server/websocket-sfc.js.map +1 -0
  210. package/hmr/helpers/ast-normalizer.d.ts +3 -1
  211. package/hmr/helpers/ast-normalizer.js +77 -10
  212. package/hmr/helpers/ast-normalizer.js.map +1 -1
  213. package/hmr/helpers/cjs-named-exports.d.ts +23 -0
  214. package/hmr/helpers/cjs-named-exports.js +152 -0
  215. package/hmr/helpers/cjs-named-exports.js.map +1 -0
  216. package/hmr/helpers/package-exports.d.ts +16 -0
  217. package/hmr/helpers/package-exports.js +396 -0
  218. package/hmr/helpers/package-exports.js.map +1 -0
  219. package/hmr/server/constants.js +20 -5
  220. package/hmr/server/constants.js.map +1 -1
  221. package/hmr/server/core-sanitize.d.ts +86 -7
  222. package/hmr/server/core-sanitize.js +170 -45
  223. package/hmr/server/core-sanitize.js.map +1 -1
  224. package/hmr/server/device-transform-helpers.d.ts +24 -0
  225. package/hmr/server/device-transform-helpers.js +408 -0
  226. package/hmr/server/device-transform-helpers.js.map +1 -0
  227. package/hmr/server/framework-strategy.d.ts +108 -11
  228. package/hmr/server/hmr-module-graph.d.ts +37 -0
  229. package/hmr/server/hmr-module-graph.js +214 -0
  230. package/hmr/server/hmr-module-graph.js.map +1 -0
  231. package/hmr/server/import-map.d.ts +11 -2
  232. package/hmr/server/import-map.js +92 -45
  233. package/hmr/server/import-map.js.map +1 -1
  234. package/hmr/server/index.js +7 -16
  235. package/hmr/server/index.js.map +1 -1
  236. package/hmr/server/ns-core-cjs-shape.d.ts +2 -4
  237. package/hmr/server/ns-core-cjs-shape.js +4 -6
  238. package/hmr/server/ns-core-cjs-shape.js.map +1 -1
  239. package/hmr/server/ns-rt-bridge.d.ts +51 -0
  240. package/hmr/server/ns-rt-bridge.js +131 -0
  241. package/hmr/server/ns-rt-bridge.js.map +1 -0
  242. package/hmr/server/ns-rt-route.d.ts +5 -0
  243. package/hmr/server/ns-rt-route.js +38 -0
  244. package/hmr/server/ns-rt-route.js.map +1 -0
  245. package/hmr/server/perf-instrumentation.d.ts +114 -0
  246. package/hmr/server/perf-instrumentation.js +197 -0
  247. package/hmr/server/perf-instrumentation.js.map +1 -0
  248. package/hmr/server/process-code-for-device.d.ts +14 -0
  249. package/hmr/server/process-code-for-device.js +699 -0
  250. package/hmr/server/process-code-for-device.js.map +1 -0
  251. package/hmr/server/require-guard.d.ts +1 -0
  252. package/hmr/server/require-guard.js +12 -0
  253. package/hmr/server/require-guard.js.map +1 -0
  254. package/hmr/server/rewrite-imports.d.ts +2 -0
  255. package/hmr/server/rewrite-imports.js +630 -0
  256. package/hmr/server/rewrite-imports.js.map +1 -0
  257. package/hmr/server/route-helpers.d.ts +7 -0
  258. package/hmr/server/route-helpers.js +13 -0
  259. package/hmr/server/route-helpers.js.map +1 -0
  260. package/hmr/server/server-origin.d.ts +2 -0
  261. package/hmr/server/server-origin.js +83 -0
  262. package/hmr/server/server-origin.js.map +1 -0
  263. package/hmr/server/shared-transform-request.js +13 -7
  264. package/hmr/server/shared-transform-request.js.map +1 -1
  265. package/hmr/server/transform-cache-invalidation.d.ts +37 -0
  266. package/hmr/server/transform-cache-invalidation.js +156 -0
  267. package/hmr/server/transform-cache-invalidation.js.map +1 -0
  268. package/hmr/server/vendor-bare-module-shims.d.ts +4 -0
  269. package/hmr/server/vendor-bare-module-shims.js +80 -0
  270. package/hmr/server/vendor-bare-module-shims.js.map +1 -0
  271. package/hmr/server/vite-plugin.js +78 -42
  272. package/hmr/server/vite-plugin.js.map +1 -1
  273. package/hmr/server/websocket-core-bridge.d.ts +45 -4
  274. package/hmr/server/websocket-core-bridge.js +50 -48
  275. package/hmr/server/websocket-core-bridge.js.map +1 -1
  276. package/hmr/server/websocket-css-hot-update.d.ts +33 -0
  277. package/hmr/server/websocket-css-hot-update.js +65 -0
  278. package/hmr/server/websocket-css-hot-update.js.map +1 -0
  279. package/hmr/server/websocket-device-transform.d.ts +3 -0
  280. package/hmr/server/websocket-device-transform.js +7 -0
  281. package/hmr/server/websocket-device-transform.js.map +1 -0
  282. package/hmr/server/websocket-graph-upsert.d.ts +15 -0
  283. package/hmr/server/websocket-graph-upsert.js +20 -0
  284. package/hmr/server/websocket-graph-upsert.js.map +1 -1
  285. package/hmr/server/websocket-hmr-pending.d.ts +37 -0
  286. package/hmr/server/websocket-hmr-pending.js +55 -0
  287. package/hmr/server/websocket-hmr-pending.js.map +1 -0
  288. package/hmr/server/websocket-hot-update.d.ts +77 -0
  289. package/hmr/server/websocket-hot-update.js +360 -0
  290. package/hmr/server/websocket-hot-update.js.map +1 -0
  291. package/hmr/server/websocket-import-map-route.d.ts +15 -0
  292. package/hmr/server/websocket-import-map-route.js +50 -0
  293. package/hmr/server/websocket-import-map-route.js.map +1 -0
  294. package/hmr/server/websocket-module-bindings.js +3 -3
  295. package/hmr/server/websocket-module-bindings.js.map +1 -1
  296. package/hmr/server/websocket-module-specifiers.d.ts +66 -2
  297. package/hmr/server/websocket-module-specifiers.js +191 -20
  298. package/hmr/server/websocket-module-specifiers.js.map +1 -1
  299. package/hmr/server/websocket-ns-core.d.ts +21 -0
  300. package/hmr/server/websocket-ns-core.js +311 -0
  301. package/hmr/server/websocket-ns-core.js.map +1 -0
  302. package/hmr/server/websocket-ns-entry.d.ts +21 -0
  303. package/hmr/server/websocket-ns-entry.js +164 -0
  304. package/hmr/server/websocket-ns-entry.js.map +1 -0
  305. package/hmr/server/websocket-ns-m-paths.d.ts +1 -1
  306. package/hmr/server/websocket-ns-m-paths.js +58 -13
  307. package/hmr/server/websocket-ns-m-paths.js.map +1 -1
  308. package/hmr/server/websocket-ns-m-request.d.ts +11 -1
  309. package/hmr/server/websocket-ns-m-request.js +18 -25
  310. package/hmr/server/websocket-ns-m-request.js.map +1 -1
  311. package/hmr/server/websocket-ns-m.d.ts +33 -0
  312. package/hmr/server/websocket-ns-m.js +752 -0
  313. package/hmr/server/websocket-ns-m.js.map +1 -0
  314. package/hmr/server/websocket-served-module-helpers.d.ts +49 -3
  315. package/hmr/server/websocket-served-module-helpers.js +403 -87
  316. package/hmr/server/websocket-served-module-helpers.js.map +1 -1
  317. package/hmr/server/websocket-txn.js +2 -8
  318. package/hmr/server/websocket-txn.js.map +1 -1
  319. package/hmr/server/websocket-vendor-unifier.d.ts +0 -1
  320. package/hmr/server/websocket-vendor-unifier.js +4 -9
  321. package/hmr/server/websocket-vendor-unifier.js.map +1 -1
  322. package/hmr/server/websocket.d.ts +8 -39
  323. package/hmr/server/websocket.js +608 -6300
  324. package/hmr/server/websocket.js.map +1 -1
  325. package/hmr/shared/ns-globals.d.ts +118 -0
  326. package/hmr/shared/ns-globals.js +29 -0
  327. package/hmr/shared/ns-globals.js.map +1 -0
  328. package/hmr/shared/protocol.d.ts +145 -0
  329. package/hmr/shared/protocol.js +28 -0
  330. package/hmr/shared/protocol.js.map +1 -0
  331. package/hmr/shared/runtime/boot-placeholder-ui.d.ts +69 -0
  332. package/hmr/shared/runtime/boot-placeholder-ui.js +101 -0
  333. package/hmr/shared/runtime/boot-placeholder-ui.js.map +1 -0
  334. package/hmr/shared/runtime/boot-progress.d.ts +44 -0
  335. package/hmr/shared/runtime/boot-progress.js +133 -0
  336. package/hmr/shared/runtime/boot-progress.js.map +1 -0
  337. package/hmr/shared/runtime/boot-timeline.d.ts +18 -0
  338. package/hmr/shared/runtime/boot-timeline.js +42 -0
  339. package/hmr/shared/runtime/boot-timeline.js.map +1 -0
  340. package/hmr/shared/runtime/browser-runtime-contract.js.map +1 -1
  341. package/hmr/shared/runtime/dev-overlay-snapshots.d.ts +31 -0
  342. package/hmr/shared/runtime/dev-overlay-snapshots.js +324 -0
  343. package/hmr/shared/runtime/dev-overlay-snapshots.js.map +1 -0
  344. package/hmr/shared/runtime/dev-overlay.d.ts +119 -26
  345. package/hmr/shared/runtime/dev-overlay.js +1196 -262
  346. package/hmr/shared/runtime/dev-overlay.js.map +1 -1
  347. package/hmr/shared/runtime/global-scope.d.ts +18 -0
  348. package/hmr/shared/runtime/global-scope.js +21 -0
  349. package/hmr/shared/runtime/global-scope.js.map +1 -0
  350. package/hmr/shared/runtime/hooks.js +2 -1
  351. package/hmr/shared/runtime/hooks.js.map +1 -1
  352. package/hmr/shared/runtime/http-only-boot.js +7 -6
  353. package/hmr/shared/runtime/http-only-boot.js.map +1 -1
  354. package/hmr/shared/runtime/module-provenance.js +4 -6
  355. package/hmr/shared/runtime/module-provenance.js.map +1 -1
  356. package/hmr/shared/runtime/root-placeholder-view.d.ts +19 -0
  357. package/hmr/shared/runtime/root-placeholder-view.js +311 -0
  358. package/hmr/shared/runtime/root-placeholder-view.js.map +1 -0
  359. package/hmr/shared/runtime/root-placeholder.js +393 -200
  360. package/hmr/shared/runtime/root-placeholder.js.map +1 -1
  361. package/hmr/shared/runtime/session-bootstrap.js +168 -4
  362. package/hmr/shared/runtime/session-bootstrap.js.map +1 -1
  363. package/hmr/shared/runtime/vendor-bootstrap.js +3 -10
  364. package/hmr/shared/runtime/vendor-bootstrap.js.map +1 -1
  365. package/hmr/shared/vendor/manifest-collect.d.ts +4 -0
  366. package/hmr/shared/vendor/manifest-collect.js +549 -0
  367. package/hmr/shared/vendor/manifest-collect.js.map +1 -0
  368. package/hmr/shared/vendor/manifest-loader.d.ts +2 -1
  369. package/hmr/shared/vendor/manifest-loader.js +5 -3
  370. package/hmr/shared/vendor/manifest-loader.js.map +1 -1
  371. package/hmr/shared/vendor/manifest.d.ts +1 -7
  372. package/hmr/shared/vendor/manifest.js +84 -819
  373. package/hmr/shared/vendor/manifest.js.map +1 -1
  374. package/hmr/shared/vendor/vendor-device-shim.d.ts +1 -0
  375. package/hmr/shared/vendor/vendor-device-shim.js +208 -0
  376. package/hmr/shared/vendor/vendor-device-shim.js.map +1 -0
  377. package/hmr/shared/vendor/vendor-esbuild-plugins.d.ts +38 -0
  378. package/hmr/shared/vendor/vendor-esbuild-plugins.js +296 -0
  379. package/hmr/shared/vendor/vendor-esbuild-plugins.js.map +1 -0
  380. package/hmr/vendor-bootstrap.d.ts +1 -3
  381. package/hmr/vendor-bootstrap.js +4 -6
  382. package/hmr/vendor-bootstrap.js.map +1 -1
  383. package/index.d.ts +1 -0
  384. package/index.js +5 -0
  385. package/index.js.map +1 -1
  386. package/package.json +61 -11
  387. package/runtime/core-aliases-early.js +25 -55
  388. package/runtime/core-aliases-early.js.map +1 -1
  389. package/shims/react-jsx-runtime.d.ts +4 -0
  390. package/shims/react-jsx-runtime.js +37 -0
  391. package/shims/react-jsx-runtime.js.map +1 -0
  392. package/helpers/angular/angular-linker.d.ts +0 -13
  393. package/helpers/angular/angular-linker.js +0 -194
  394. package/helpers/angular/angular-linker.js.map +0 -1
  395. package/helpers/angular/inline-decorator-component-templates.js.map +0 -1
  396. package/helpers/angular/shared-linker.d.ts +0 -11
  397. package/helpers/angular/shared-linker.js +0 -75
  398. package/helpers/angular/shared-linker.js.map +0 -1
  399. package/helpers/angular/synthesize-decorator-ctor-parameters.js.map +0 -1
  400. package/helpers/angular/synthesize-injectable-factories.js.map +0 -1
  401. package/helpers/angular/util.js +0 -67
  402. package/helpers/angular/util.js.map +0 -1
  403. package/helpers/prelink-angular.d.ts +0 -2
  404. package/helpers/prelink-angular.js +0 -117
  405. package/helpers/prelink-angular.js.map +0 -1
  406. package/hmr/server/websocket-angular-entry.js.map +0 -1
  407. package/hmr/server/websocket-angular-hot-update.js +0 -239
  408. package/hmr/server/websocket-angular-hot-update.js.map +0 -1
  409. package/hmr/server/websocket-ns-m-finalize.d.ts +0 -22
  410. package/hmr/server/websocket-ns-m-finalize.js +0 -88
  411. package/hmr/server/websocket-ns-m-finalize.js.map +0 -1
  412. package/hmr/server/websocket-runtime-compat.d.ts +0 -19
  413. package/hmr/server/websocket-runtime-compat.js +0 -286
  414. package/hmr/server/websocket-runtime-compat.js.map +0 -1
  415. package/hmr/server/websocket-vue-sfc.d.ts +0 -27
  416. package/hmr/server/websocket-vue-sfc.js +0 -1117
  417. package/hmr/server/websocket-vue-sfc.js.map +0 -1
  418. package/transformers/NativeClass/index.d.ts +0 -2
  419. package/transformers/NativeClass/index.js +0 -222
  420. package/transformers/NativeClass/index.js.map +0 -1
  421. /package/{helpers/angular → hmr/frameworks/angular/build}/inline-decorator-component-templates.d.ts +0 -0
  422. /package/{helpers/angular → hmr/frameworks/angular/build}/synthesize-decorator-ctor-parameters.d.ts +0 -0
  423. /package/{helpers/angular → hmr/frameworks/angular/build}/synthesize-injectable-factories.d.ts +0 -0
  424. /package/hmr/{server → frameworks/angular/server}/websocket-angular-entry.d.ts +0 -0
@@ -0,0 +1,296 @@
1
+ import * as esbuild from 'esbuild';
2
+ import path from 'path';
3
+ import { readFile } from 'fs/promises';
4
+ import { getAngularLinkerFactory, runAngularLinker } from '../../frameworks/angular/build/shared-linker.js';
5
+ import { vendorModuleShim } from './vendor-device-shim.js';
6
+ export function createVendorEsbuildPlugin(projectRoot) {
7
+ return {
8
+ name: 'ns-vendor-resolver',
9
+ setup(build) {
10
+ const debug = process.env.VITE_DEBUG_LOGS === 'true' || process.env.VITE_DEBUG_LOGS === '1';
11
+ build.onResolve({ filter: /^~\/package\.json$/ }, () => ({
12
+ path: path.resolve(projectRoot, 'package.json'),
13
+ }));
14
+ build.onResolve({ filter: /^module$/ }, () => ({
15
+ path: 'ns-vendor-module-shim',
16
+ namespace: 'ns-vendor',
17
+ }));
18
+ build.onLoad({ filter: /^ns-vendor-module-shim$/, namespace: 'ns-vendor' }, () => ({
19
+ contents: vendorModuleShim,
20
+ loader: 'js',
21
+ }));
22
+ // Stub Angular animations in vendor to avoid bundling browser-only code.
23
+ // Provide named exports expected by @nativescript/angular to satisfy esbuild.
24
+ const PB_ANIMATIONS_ID = 'ns-animations-pb-shim';
25
+ const ANIMATIONS_BROWSER_ID = 'ns-animations-browser-shim';
26
+ const ANIMATIONS_ID = 'ns-animations-noop';
27
+ // @angular/platform-browser/animations -> provide concrete named stubs
28
+ build.onResolve({ filter: /^@angular\/platform-browser\/animations(?:\/.*)?$/ }, (args) => {
29
+ if (debug) {
30
+ console.log('[vendor] map', args.path, '->', PB_ANIMATIONS_ID);
31
+ }
32
+ return { path: PB_ANIMATIONS_ID, namespace: 'ns-vendor' };
33
+ });
34
+ build.onLoad({ filter: new RegExp(`^${PB_ANIMATIONS_ID}$`), namespace: 'ns-vendor' }, () => ({
35
+ contents: [
36
+ 'export default {};',
37
+ // Commonly imported symbols by @nativescript/angular
38
+ 'export class AnimationBuilder {};',
39
+ 'export const \u0275BrowserAnimationBuilder = class {};',
40
+ 'export const \u0275AnimationEngine = class {};',
41
+ 'export const \u0275AnimationRendererFactory = class {};',
42
+ 'export const \u0275WebAnimationsStyleNormalizer = class {};',
43
+ // Typical platform-browser/animations APIs exported; safe no-ops
44
+ 'export class BrowserAnimationsModule {};',
45
+ 'export class NoopAnimationsModule {};',
46
+ 'export const provideAnimations = (..._args) => [];',
47
+ 'export const provideNoopAnimations = (..._args) => [];',
48
+ // Marker used by some Angular internals
49
+ 'export const ANIMATION_MODULE_TYPE = void 0;',
50
+ ].join('\n'),
51
+ loader: 'js',
52
+ }));
53
+ // @angular/animations/browser -> provide ɵ* engine/renderer/style normalizer stubs
54
+ build.onResolve({ filter: /^@angular\/animations\/browser(?:\/.*)?$/ }, (args) => {
55
+ if (debug) {
56
+ console.log('[vendor] map', args.path, '->', ANIMATIONS_BROWSER_ID);
57
+ }
58
+ return { path: ANIMATIONS_BROWSER_ID, namespace: 'ns-vendor' };
59
+ });
60
+ build.onLoad({ filter: new RegExp(`^${ANIMATIONS_BROWSER_ID}$`), namespace: 'ns-vendor' }, () => ({
61
+ contents: [
62
+ 'export default {};',
63
+ 'export class AnimationDriver {};',
64
+ 'export const \u0275AnimationRendererFactory = class {};',
65
+ 'export const \u0275AnimationStyleNormalizer = class {};',
66
+ 'export const \u0275WebAnimationsStyleNormalizer = class {};',
67
+ 'export const \u0275AnimationEngine = class {};',
68
+ // Convenience alias if any consumers import non-ɵ name
69
+ 'export const AnimationStyleNormalizer = \u0275AnimationStyleNormalizer;',
70
+ ].join('\n'),
71
+ loader: 'js',
72
+ }));
73
+ // @angular/animations -> broad no-op surface
74
+ build.onResolve(
75
+ // Keep generic mapping for @angular/animations base; /browser is handled above
76
+ { filter: /^@angular\/animations(?:$|\/)$/ }, (args) => {
77
+ if (debug) {
78
+ console.log('[vendor] map', args.path, '->', ANIMATIONS_ID);
79
+ }
80
+ return { path: ANIMATIONS_ID, namespace: 'ns-vendor' };
81
+ });
82
+ build.onLoad({ filter: new RegExp(`^${ANIMATIONS_ID}$`), namespace: 'ns-vendor' }, () => ({
83
+ contents: [
84
+ 'export default {};',
85
+ // Provide names sometimes (incorrectly) imported from @angular/animations by wrappers
86
+ 'export class AnimationBuilder {};',
87
+ 'export const \u0275BrowserAnimationBuilder = class {};',
88
+ 'export const \u0275AnimationEngine = class {};',
89
+ 'export const \u0275AnimationRendererFactory = class {};',
90
+ 'export const \u0275WebAnimationsStyleNormalizer = class {};',
91
+ 'export const ANIMATION_MODULE_TYPE = void 0;',
92
+ // Export a few common tokens as harmless stubs
93
+ 'export const animate = (..._a) => ({});',
94
+ 'export const state = (..._a) => ({});',
95
+ 'export const style = (..._a) => ({});',
96
+ 'export const transition = (..._a) => ({});',
97
+ 'export const trigger = (..._a) => ({});',
98
+ 'export const sequence = (..._a) => ({});',
99
+ 'export const group = (..._a) => ({});',
100
+ 'export const query = (..._a) => ({});',
101
+ 'export const stagger = (..._a) => ({});',
102
+ 'export const keyframes = (..._a) => ({});',
103
+ ].join('\n'),
104
+ loader: 'js',
105
+ }));
106
+ },
107
+ };
108
+ }
109
+ /**
110
+ * esbuild plugin to compile .jsx/.tsx files from Solid packages through
111
+ * babel-preset-solid. Without this, esbuild uses its default React JSX
112
+ * transform, producing React.createElement calls that crash at runtime.
113
+ *
114
+ * Only applied to files inside node_modules that have .jsx or .tsx extension.
115
+ */
116
+ export function createSolidJsxEsbuildPlugin(projectRoot) {
117
+ // Lazy-load Babel and the Solid preset so they're only required when
118
+ // the Solid flavor is active.
119
+ let babel;
120
+ let solidPreset;
121
+ return {
122
+ name: 'ns-vendor-solid-jsx',
123
+ setup(build) {
124
+ // Intercept .jsx and .tsx files from node_modules
125
+ build.onLoad({ filter: /node_modules[\\/].*\.[jt]sx$/ }, async (args) => {
126
+ try {
127
+ if (!babel) {
128
+ babel = await import('@babel/core');
129
+ // babel-preset-solid is the standard Solid JSX transform
130
+ solidPreset = (await import('babel-preset-solid')).default;
131
+ }
132
+ const source = await readFile(args.path, 'utf-8');
133
+ const result = await babel.transformAsync(source, {
134
+ filename: args.path,
135
+ presets: [
136
+ [
137
+ solidPreset,
138
+ {
139
+ generate: 'universal',
140
+ hydratable: false,
141
+ moduleName: '@nativescript-community/solid-js',
142
+ },
143
+ ],
144
+ ],
145
+ parserOpts: {
146
+ plugins: ['jsx', ...(args.path.endsWith('.tsx') ? ['typescript'] : [])],
147
+ },
148
+ ast: false,
149
+ sourceMaps: false,
150
+ configFile: false,
151
+ babelrc: false,
152
+ });
153
+ if (result?.code) {
154
+ return { contents: result.code, loader: 'js' };
155
+ }
156
+ }
157
+ catch (e) {
158
+ console.warn(`[ns-vendor-solid-jsx] failed to transform ${args.path}:`, e?.message || e);
159
+ }
160
+ // Fall through to esbuild's default handling
161
+ return undefined;
162
+ });
163
+ },
164
+ };
165
+ }
166
+ /**
167
+ * esbuild plugin that rewrites Unicode property-escape regular expressions
168
+ * (`\p{…}` / `\P{…}` used with the `u`/`v` flag) in vendored `node_modules`
169
+ * code into explicit character ranges, via
170
+ * `@babel/plugin-transform-unicode-property-regex`.
171
+ *
172
+ * NativeScript's V8 is compiled WITHOUT ICU/Intl, so Unicode property escapes
173
+ * are unrecognized and throw `SyntaxError: Invalid property name in character
174
+ * class` at *compile* time — not at match time. Because the HMR vendor bundle
175
+ * is a single large module, one offending regex (e.g. highlight.js's
176
+ * `TAG_NAME_RE = regex.concat(/[\p{L}_]/u, …)`) aborts the whole `vendor.mjs`
177
+ * compile and takes the entire dev session down with the misleading
178
+ * "ES module returned empty namespace" error.
179
+ *
180
+ * Babel expands the escapes to explicit ranges (`[A-Za-z\xAA…]`) that compile
181
+ * on a non-ICU engine while preserving match semantics — the `u` flag itself
182
+ * works fine without ICU; only the `\p{…}` property lookups need it. The
183
+ * transform is gated on a cheap substring check so only files that actually
184
+ * contain `\p{` / `\P{` pay the parse/regenerate cost, and any failure falls
185
+ * through to the untransformed source rather than aborting the build.
186
+ */
187
+ export function createUnicodeRegexEsbuildPlugin(projectRoot) {
188
+ // Lazy-load Babel and the transform so the cost is only paid when a vendored
189
+ // package actually ships property-escape regexes.
190
+ let babel;
191
+ let unicodePropertyRegexPlugin;
192
+ let toolingUnavailable = false;
193
+ return {
194
+ name: 'ns-vendor-unicode-regex',
195
+ setup(build) {
196
+ const debug = process.env.VITE_DEBUG_LOGS === 'true' || process.env.VITE_DEBUG_LOGS === '1';
197
+ // .js/.mjs/.cjs only — .jsx/.tsx are owned by the Solid JSX pass and
198
+ // Angular partials by the linker pass.
199
+ build.onLoad({ filter: /node_modules[\\/].*\.[mc]?js$/ }, async (args) => {
200
+ // Angular framework files are handled by the linker pass; leave them
201
+ // to it to avoid double-processing the same module.
202
+ if (/[\\/](?:@angular|@nativescript[\\/]angular)[\\/]/.test(args.path)) {
203
+ return undefined;
204
+ }
205
+ let source;
206
+ try {
207
+ source = await readFile(args.path, 'utf-8');
208
+ }
209
+ catch {
210
+ return undefined;
211
+ }
212
+ // Fast path: skip files that cannot contain a property escape.
213
+ if (!source.includes('\\p{') && !source.includes('\\P{')) {
214
+ return undefined;
215
+ }
216
+ if (toolingUnavailable) {
217
+ return undefined;
218
+ }
219
+ try {
220
+ if (!babel) {
221
+ babel = await import('@babel/core');
222
+ unicodePropertyRegexPlugin = (await import('@babel/plugin-transform-unicode-property-regex')).default;
223
+ }
224
+ }
225
+ catch (e) {
226
+ // Don't fail the build if the optional transform tooling is
227
+ // missing — leave the regex as-is (it only matters if the
228
+ // package is actually evaluated on-device).
229
+ toolingUnavailable = true;
230
+ console.warn(`[ns-vendor-unicode-regex] @babel/plugin-transform-unicode-property-regex unavailable; leaving \\p{} regexes untransformed:`, e?.message || e);
231
+ return undefined;
232
+ }
233
+ try {
234
+ const result = await babel.transformAsync(source, {
235
+ filename: args.path,
236
+ // node_modules dist files may be ESM or CJS/UMD; let Babel decide.
237
+ sourceType: 'unambiguous',
238
+ plugins: [unicodePropertyRegexPlugin],
239
+ ast: false,
240
+ sourceMaps: false,
241
+ configFile: false,
242
+ babelrc: false,
243
+ });
244
+ if (result?.code) {
245
+ if (debug) {
246
+ console.log('[ns-vendor-unicode-regex] transformed', args.path);
247
+ }
248
+ return { contents: result.code, loader: 'js' };
249
+ }
250
+ }
251
+ catch (e) {
252
+ console.warn(`[ns-vendor-unicode-regex] failed to transform ${args.path}:`, e?.message || e);
253
+ }
254
+ return undefined;
255
+ });
256
+ },
257
+ };
258
+ }
259
+ /**
260
+ * Minimal esbuild plugin to run Angular linker (Babel) over partial-compiled
261
+ * Angular packages in node_modules. This converts ɵɵngDeclare* calls into
262
+ * ɵɵdefine* so runtime doesn't require the JIT compiler.
263
+ */
264
+ export function angularLinkerEsbuildPlugin(projectRoot) {
265
+ // Restrict to Angular framework packages to minimize esbuild memory usage.
266
+ const FILTER = /node_modules[\\/](?:@angular|@nativescript[\\/]angular)[\\/].*\.[mc]?js$/;
267
+ return {
268
+ name: 'ns-angular-linker',
269
+ async setup(build) {
270
+ const debug = process.env.VITE_DEBUG_LOGS === 'true' || process.env.VITE_DEBUG_LOGS === '1';
271
+ const { babel, createLinker } = await getAngularLinkerFactory(projectRoot);
272
+ if (!babel || !createLinker) {
273
+ // Nothing to do if deps unavailable
274
+ return;
275
+ }
276
+ build.onLoad({ filter: FILTER }, async (args) => {
277
+ try {
278
+ const source = await readFile(args.path, 'utf8');
279
+ // Fast-path: only run linker when partial declarations are present
280
+ if (!(source.includes('\u0275\u0275ngDeclare') || source.includes('ɵɵngDeclare'))) {
281
+ return { contents: source, loader: 'js' };
282
+ }
283
+ if (debug) {
284
+ console.log('[ns-angular-linker][vendor] linking', args.path);
285
+ }
286
+ const linked = await runAngularLinker(source, { filename: args.path, projectRoot, freshPlugin: true });
287
+ return { contents: linked || source, loader: 'js' };
288
+ }
289
+ catch {
290
+ return { contents: await readFile(args.path, 'utf8'), loader: 'js' };
291
+ }
292
+ });
293
+ },
294
+ };
295
+ }
296
+ //# sourceMappingURL=vendor-esbuild-plugins.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vendor-esbuild-plugins.js","sourceRoot":"","sources":["../../../../../../packages/vite/hmr/shared/vendor/vendor-esbuild-plugins.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AACnC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,MAAM,iDAAiD,CAAC;AAC5G,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3D,MAAM,UAAU,yBAAyB,CAAC,WAAmB;IAC5D,OAAO;QACN,IAAI,EAAE,oBAAoB;QAC1B,KAAK,CAAC,KAAK;YACV,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,KAAK,MAAM,IAAI,OAAO,CAAC,GAAG,CAAC,eAAe,KAAK,GAAG,CAAC;YAC5F,KAAK,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,oBAAoB,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC;gBACxD,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,cAAc,CAAC;aAC/C,CAAC,CAAC,CAAC;YAEJ,KAAK,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC;gBAC9C,IAAI,EAAE,uBAAuB;gBAC7B,SAAS,EAAE,WAAW;aACtB,CAAC,CAAC,CAAC;YAEJ,KAAK,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,yBAAyB,EAAE,SAAS,EAAE,WAAW,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC;gBAClF,QAAQ,EAAE,gBAAgB;gBAC1B,MAAM,EAAE,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,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,uBAAuB,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,EAAE,CAAC;wBACnF,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;oBAC3C,CAAC;oBACD,IAAI,KAAK,EAAE,CAAC;wBACX,OAAO,CAAC,GAAG,CAAC,qCAAqC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;oBAC/D,CAAC;oBACD,MAAM,MAAM,GAAG,MAAM,gBAAgB,CAAC,MAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,IAAI,EAAE,WAAW,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC;oBACvG,OAAO,EAAE,QAAQ,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;gBACrD,CAAC;gBAAC,MAAM,CAAC;oBACR,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;gBACtE,CAAC;YACF,CAAC,CAAC,CAAC;QACJ,CAAC;KACD,CAAC;AACH,CAAC"}
@@ -1,3 +1 @@
1
- interface VendorLookupFn {
2
- (id: string): any;
3
- }
1
+ export {};
@@ -1,11 +1,9 @@
1
- // HMR vendor bootstrap helper
2
- // Ensures a stable global lookup for vendor modules that were bundled and registered.
3
- // This can be injected or imported by the HMR runtime before rewriting modules rely on it.
1
+ import { getGlobalScope } from './shared/runtime/global-scope.js';
4
2
  (function initVendorAccessor() {
5
- if (globalThis.__nsVendor)
3
+ if (getGlobalScope().__nsVendor)
6
4
  return;
7
- const getManifest = () => globalThis.__NS_VENDOR_MANIFEST__ || null;
8
- const getRegistry = () => globalThis.__nsModules || globalThis.__nsModuleRegistry || null;
5
+ const getManifest = () => getGlobalScope().__NS_VENDOR_MANIFEST__ || null;
6
+ const getRegistry = () => getGlobalScope().__nsModules || getGlobalScope().__nsModuleRegistry || null;
9
7
  const accessor = function (id) {
10
8
  if (!id)
11
9
  return undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"vendor-bootstrap.js","sourceRoot":"","sources":["../../../../packages/vite/hmr/vendor-bootstrap.ts"],"names":[],"mappings":"AAAA,8BAA8B;AAC9B,sFAAsF;AACtF,2FAA2F;AAM3F,CAAC,SAAS,kBAAkB;IAC3B,IAAK,UAAkB,CAAC,UAAU;QAAE,OAAO;IAE3C,MAAM,WAAW,GAAG,GAAG,EAAE,CAAE,UAAkB,CAAC,sBAAsB,IAAI,IAAI,CAAC;IAC7E,MAAM,WAAW,GAAG,GAAG,EAAE,CAAE,UAAkB,CAAC,WAAW,IAAK,UAAkB,CAAC,kBAAkB,IAAI,IAAI,CAAC;IAE5G,MAAM,QAAQ,GAAmB,UAAU,EAAU;QACpD,IAAI,CAAC,EAAE;YAAE,OAAO,SAAS,CAAC;QAC1B,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;QAC/B,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;QAC/B,IAAI,CAAC,QAAQ,IAAI,CAAC,QAAQ,CAAC,OAAO,IAAI,CAAC,QAAQ;YAAE,OAAO,SAAS,CAAC;QAClE,eAAe;QACf,IAAI,QAAQ,CAAC,GAAG,IAAI,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YAAE,OAAO,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAC9D,uBAAuB;QACvB,MAAM,KAAK,GAAG,QAAQ,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC;QACrC,IAAI,KAAK,IAAI,QAAQ,CAAC,GAAG,IAAI,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC;YAAE,OAAO,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QAC7E,OAAO,SAAS,CAAC;IAClB,CAAC,CAAC;IAEF,MAAM,CAAC,cAA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AAC,KAAK,CAAC,CAAC;QAC7E,OAAO,SAAS,CAAC;IAClB,CAAC,CAAC;IAEF,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,YAAY,EAAE;QAC/C,KAAK,EAAE,QAAQ;QACf,UAAU,EAAE,KAAK;QACjB,YAAY,EAAE,IAAI;QAClB,QAAQ,EAAE,KAAK;KACf,CAAC,CAAC;AACJ,CAAC,CAAC,EAAE,CAAC"}
package/index.d.ts CHANGED
@@ -2,3 +2,4 @@ export * from './configuration/base.js';
2
2
  export * from './configuration/javascript.js';
3
3
  export * from './configuration/typescript.js';
4
4
  export { appComponentsPlugin, type AppComponentsOptions } from './helpers/app-components.js';
5
+ export { getCliFlags } from './helpers/cli-flags.js';
package/index.js CHANGED
@@ -3,6 +3,11 @@ export * from './configuration/javascript.js';
3
3
  export * from './configuration/typescript.js';
4
4
  // App components plugin for custom Android Activity/Application classes
5
5
  export { appComponentsPlugin } from './helpers/app-components.js';
6
+ // Helper for parsing `--env.foo=bar` style flags forwarded by the NativeScript
7
+ // CLI (and any other `vite … -- --env.X=Y` invocation). Exposed so apps with a
8
+ // custom `vite.config.ts` can read the same flag set the base config sees
9
+ // without having to re-implement the parser.
10
+ export { getCliFlags } from './helpers/cli-flags.js';
6
11
  // Simple CLI entry to support `npx @nativescript/vite init`
7
12
  // This keeps the library export surface intact while allowing a
8
13
  // lightweight command for project bootstrapping.
package/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../packages/vite/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAE9C,wEAAwE;AACxE,OAAO,EAAE,mBAAmB,EAA6B,MAAM,6BAA6B,CAAC;AAE7F,4DAA4D;AAC5D,gEAAgE;AAChE,iDAAiD;AACjD,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,yBAAyB,CAAC,IAAI,C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AAC;QACxE,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IACtB,CAAC,CAAC,CAAC;AACL,CAAC"}
package/package.json CHANGED
@@ -1,11 +1,18 @@
1
1
  {
2
2
  "name": "@nativescript/vite",
3
- "version": "8.0.0-alpha.5",
3
+ "version": "8.0.0-alpha.50",
4
4
  "description": "Vite for NativeScript",
5
5
  "main": "./index.js",
6
6
  "module": "./index.js",
7
7
  "types": "./index.d.ts",
8
8
  "type": "module",
9
+ "files": [
10
+ "**/*.d.ts",
11
+ "**/*.js",
12
+ "**/*.mjs",
13
+ "**/*.cjs",
14
+ "**/*.map"
15
+ ],
9
16
  "exports": {
10
17
  ".": {
11
18
  "types": "./index.d.ts",
@@ -27,6 +34,11 @@
27
34
  "import": "./configuration/solid.js",
28
35
  "default": "./configuration/solid.js"
29
36
  },
37
+ "./solid-bootstrap": {
38
+ "types": "./hmr/frameworks/solid/client/app-runtime.d.ts",
39
+ "import": "./hmr/frameworks/solid/client/app-runtime.js",
40
+ "default": "./hmr/frameworks/solid/client/app-runtime.js"
41
+ },
30
42
  "./vue": {
31
43
  "types": "./configuration/vue.d.ts",
32
44
  "import": "./configuration/vue.js",
@@ -78,32 +90,70 @@
78
90
  "vite"
79
91
  ],
80
92
  "dependencies": {
81
- "@analogjs/vite-plugin-angular": "^2.0.0",
82
- "@angular-devkit/build-angular": "^21.0.0",
83
- "@angular/build": "^21.0.0",
84
93
  "@babel/core": "^7.28.0",
85
94
  "@babel/generator": "^7.28.0",
86
95
  "@babel/parser": "^7.28.0",
87
96
  "@babel/plugin-transform-typescript": "^7.28.0",
97
+ "@babel/plugin-transform-unicode-property-regex": "^7.25.9",
88
98
  "@rollup/plugin-alias": "^6.0.0",
89
99
  "@rollup/plugin-commonjs": "^29.0.0",
90
100
  "@rollup/plugin-replace": "^6.0.2",
91
- "@vitejs/plugin-vue": "^6.0.5",
92
- "@vitejs/plugin-vue-jsx": "^5.1.5",
93
- "@vue/compiler-sfc": "^3.5.0",
94
- "vue-tsc": "^3.2.0",
101
+ "css": "^3.0.0",
95
102
  "esbuild": "^0.27.4",
96
103
  "minimist": "^1.2.8",
97
- "react-reconciler": "^0.32.0",
98
104
  "sass": ">=1.70.0 <2",
99
105
  "vite": "^8.0.0",
100
- "vite-plugin-solid": "^2.11.11",
101
106
  "vite-plugin-static-copy": "^4.0.1",
102
107
  "ws": "^8.18.0"
103
108
  },
109
+ "peerDependencies": {
110
+ "@analogjs/vite-plugin-angular": "^2.0.0",
111
+ "@angular/build": "^21.0.0",
112
+ "@vitejs/plugin-vue": "^6.0.5",
113
+ "@vitejs/plugin-vue-jsx": "^5.1.5",
114
+ "@vue/compiler-sfc": "^3.5.0",
115
+ "react-reconciler": "^0.32.0",
116
+ "vite-plugin-solid": "^2.11.11",
117
+ "vue-tsc": "^3.2.0"
118
+ },
119
+ "peerDependenciesMeta": {
120
+ "@analogjs/vite-plugin-angular": {
121
+ "optional": true
122
+ },
123
+ "@angular/build": {
124
+ "optional": true
125
+ },
126
+ "@vitejs/plugin-vue": {
127
+ "optional": true
128
+ },
129
+ "@vitejs/plugin-vue-jsx": {
130
+ "optional": true
131
+ },
132
+ "@vue/compiler-sfc": {
133
+ "optional": true
134
+ },
135
+ "react-reconciler": {
136
+ "optional": true
137
+ },
138
+ "vite-plugin-solid": {
139
+ "optional": true
140
+ },
141
+ "vue-tsc": {
142
+ "optional": true
143
+ }
144
+ },
104
145
  "devDependencies": {
146
+ "@analogjs/vite-plugin-angular": "^2.0.0",
147
+ "@angular/build": "^21.0.0",
148
+ "@types/css": "^0.0.38",
105
149
  "@types/node": "^24.9.1",
106
- "vitest": "~4.0.9"
150
+ "@vitejs/plugin-vue": "^6.0.5",
151
+ "@vitejs/plugin-vue-jsx": "^5.1.5",
152
+ "@vue/compiler-sfc": "^3.5.0",
153
+ "react-reconciler": "^0.32.0",
154
+ "vite-plugin-solid": "^2.11.11",
155
+ "vitest": "~4.0.9",
156
+ "vue-tsc": "^3.2.0"
107
157
  },
108
158
  "homepage": "https://docs.nativescript.org/configuration/vite",
109
159
  "repository": {
@@ -1,8 +1,7 @@
1
- // Early alias installer for @nativescript/core plus Android init resilience.
2
- // Runs on device in the virtual entry context.
1
+ import { getGlobalScope } from '../hmr/shared/runtime/global-scope.js';
3
2
  export function installCoreAliasesEarly(verbose) {
4
3
  try {
5
- const g = globalThis;
4
+ const g = getGlobalScope();
6
5
  const resolveModule = (moduleIds) => {
7
6
  for (const moduleId of moduleIds) {
8
7
  try {
@@ -93,29 +92,23 @@ export function installCoreAliasesEarly(verbose) {
93
92
  if (val && needs) {
94
93
  g[n] = val;
95
94
  if (verbose) {
96
- try {
97
- console.info('[ns-entry] core alias (early)', n);
98
- }
99
- catch { }
95
+ console.info('[ns-entry] core alias (early)', n);
100
96
  }
101
97
  }
102
98
  }
103
99
  catch { }
104
100
  }
105
101
  if (verbose) {
106
- try {
107
- console.info('[ns-entry] core alias status (early)', {
108
- has: { Frame: !!g.Frame, Application: !!g.Application, Page: !!g.Page },
109
- resolution: resolutionStatus,
110
- moduleApis: {
111
- moduleExists: typeof g.moduleExists === 'function',
112
- loadModule: typeof g.loadModule === 'function',
113
- uiModuleRegistered: typeof g.moduleExists === 'function' ? !!g.moduleExists('@nativescript/core/ui') : false,
114
- },
115
- methods: { FrameTopmost: typeof g.Frame?.topmost === 'function', AppResetRoot: typeof g.Application?.resetRootView === 'function' },
116
- });
117
- }
118
- catch { }
102
+ console.info('[ns-entry] core alias status (early)', {
103
+ has: { Frame: !!g.Frame, Application: !!g.Application, Page: !!g.Page },
104
+ resolution: resolutionStatus,
105
+ moduleApis: {
106
+ moduleExists: typeof g.moduleExists === 'function',
107
+ loadModule: typeof g.loadModule === 'function',
108
+ uiModuleRegistered: typeof g.moduleExists === 'function' ? !!g.moduleExists('@nativescript/core/ui') : false,
109
+ },
110
+ methods: { FrameTopmost: typeof g.Frame?.topmost === 'function', AppResetRoot: typeof g.Application?.resetRootView === 'function' },
111
+ });
119
112
  }
120
113
  // Android-only resilience: patch AndroidApplication.init
121
114
  try {
@@ -217,10 +210,7 @@ export function installCoreAliasesEarly(verbose) {
217
210
  }
218
211
  catch { }
219
212
  if (verbose) {
220
- try {
221
- console.warn('[ns-entry][android] Application.init called with null and resolution failed; deferring.');
222
- }
223
- catch { }
213
+ console.warn('[ns-entry][android] Application.init called with null and resolution failed; deferring.');
224
214
  }
225
215
  return;
226
216
  }
@@ -240,10 +230,7 @@ export function installCoreAliasesEarly(verbose) {
240
230
  }
241
231
  catch { }
242
232
  if (verbose) {
243
- try {
244
- console.info('[ns-entry][android] Application.init already initialized; continuing.');
245
- }
246
- catch { }
233
+ console.info('[ns-entry][android] Application.init already initialized; continuing.');
247
234
  }
248
235
  return;
249
236
  }
@@ -255,10 +242,7 @@ export function installCoreAliasesEarly(verbose) {
255
242
  }
256
243
  catch { }
257
244
  if (verbose) {
258
- try {
259
- console.info('[ns-entry] AndroidApplication.init patched for resilience');
260
- }
261
- catch { }
245
+ console.info('[ns-entry] AndroidApplication.init patched for resilience');
262
246
  }
263
247
  }
264
248
  catch { }
@@ -318,10 +302,7 @@ export function installCoreAliasesEarly(verbose) {
318
302
  const patched = function __ns_safe_resetRootView(entry) {
319
303
  if (!isReady()) {
320
304
  if (verbose) {
321
- try {
322
- console.info('[ns-entry][android] deferring resetRootView until activity is ready');
323
- }
324
- catch { }
305
+ console.info('[ns-entry][android] deferring resetRootView until activity is ready');
325
306
  }
326
307
  return once(() => {
327
308
  try {
@@ -334,27 +315,19 @@ export function installCoreAliasesEarly(verbose) {
334
315
  catch { }
335
316
  }
336
317
  catch (e) {
337
- try {
338
- console.error('[ns-entry][android] deferred resetRootView failed', e);
339
- }
340
- catch { }
318
+ console.error('[ns-entry][android] deferred resetRootView failed', e);
341
319
  throw e;
342
320
  }
343
321
  });
344
322
  }
323
+ const res = origReset.call(this, entry);
345
324
  try {
346
- const res = origReset.call(this, entry);
347
- try {
348
- const restore = g['__NS_DEV_RESTORE_PLACEHOLDER__'];
349
- if (typeof restore === 'function')
350
- restore();
351
- }
352
- catch { }
353
- return res;
354
- }
355
- catch (e) {
356
- throw e;
325
+ const restore = g['__NS_DEV_RESTORE_PLACEHOLDER__'];
326
+ if (typeof restore === 'function')
327
+ restore();
357
328
  }
329
+ catch { }
330
+ return res;
358
331
  };
359
332
  try {
360
333
  App.resetRootView = patched;
@@ -370,10 +343,7 @@ export function installCoreAliasesEarly(verbose) {
370
343
  }
371
344
  catch { }
372
345
  if (verbose) {
373
- try {
374
- console.info('[ns-entry] Application.resetRootView patched for early-boot readiness');
375
- }
376
- catch { }
346
+ console.info('[ns-entry] Application.resetRootView patched for early-boot readiness');
377
347
  }
378
348
  }
379
349
  }