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

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 (356) hide show
  1. package/README.md +51 -11
  2. package/configuration/angular.d.ts +34 -1
  3. package/configuration/angular.js +373 -163
  4. package/configuration/angular.js.map +1 -1
  5. package/configuration/base.js +184 -14
  6. package/configuration/base.js.map +1 -1
  7. package/configuration/javascript.js +5 -72
  8. package/configuration/javascript.js.map +1 -1
  9. package/configuration/solid.js +27 -1
  10. package/configuration/solid.js.map +1 -1
  11. package/configuration/typescript.js +5 -75
  12. package/configuration/typescript.js.map +1 -1
  13. package/helpers/app-components.d.ts +2 -1
  14. package/helpers/app-components.js.map +1 -1
  15. package/helpers/app-css-state.d.ts +8 -0
  16. package/helpers/app-css-state.js +8 -0
  17. package/helpers/app-css-state.js.map +1 -0
  18. package/helpers/bundler-context.d.ts +11 -0
  19. package/helpers/bundler-context.js +71 -0
  20. package/helpers/bundler-context.js.map +1 -0
  21. package/helpers/config-as-json.js +10 -0
  22. package/helpers/config-as-json.js.map +1 -1
  23. package/helpers/dev-host.d.ts +341 -0
  24. package/helpers/dev-host.js +617 -0
  25. package/helpers/dev-host.js.map +1 -0
  26. package/helpers/esbuild-platform-resolver.js +4 -1
  27. package/helpers/esbuild-platform-resolver.js.map +1 -1
  28. package/helpers/global-defines.d.ts +51 -0
  29. package/helpers/global-defines.js +77 -0
  30. package/helpers/global-defines.js.map +1 -1
  31. package/helpers/hmr-scope.d.ts +26 -0
  32. package/helpers/hmr-scope.js +67 -0
  33. package/helpers/hmr-scope.js.map +1 -0
  34. package/helpers/init.js +0 -18
  35. package/helpers/init.js.map +1 -1
  36. package/helpers/logging.d.ts +1 -0
  37. package/helpers/logging.js +63 -3
  38. package/helpers/logging.js.map +1 -1
  39. package/helpers/main-entry.d.ts +2 -1
  40. package/helpers/main-entry.js +430 -47
  41. package/helpers/main-entry.js.map +1 -1
  42. package/helpers/nativeclass-esbuild-plugin.d.ts +2 -1
  43. package/helpers/nativeclass-esbuild-plugin.js.map +1 -1
  44. package/helpers/nativeclass-transform.js.map +1 -1
  45. package/helpers/nativeclass-transformer-plugin.d.ts +9 -2
  46. package/helpers/nativeclass-transformer-plugin.js +157 -14
  47. package/helpers/nativeclass-transformer-plugin.js.map +1 -1
  48. package/helpers/nativescript-package-resolver.js +8 -3
  49. package/helpers/nativescript-package-resolver.js.map +1 -1
  50. package/helpers/normalize-id.d.ts +42 -0
  51. package/helpers/normalize-id.js +60 -0
  52. package/helpers/normalize-id.js.map +1 -0
  53. package/helpers/ns-core-url.d.ts +88 -0
  54. package/helpers/ns-core-url.js +191 -0
  55. package/helpers/ns-core-url.js.map +1 -0
  56. package/helpers/package-platform-aliases.js +4 -3
  57. package/helpers/package-platform-aliases.js.map +1 -1
  58. package/helpers/platform-types.d.ts +2 -0
  59. package/helpers/platform-types.js +2 -0
  60. package/helpers/platform-types.js.map +1 -0
  61. package/helpers/project.d.ts +35 -0
  62. package/helpers/project.js +120 -2
  63. package/helpers/project.js.map +1 -1
  64. package/helpers/resolver.js +17 -2
  65. package/helpers/resolver.js.map +1 -1
  66. package/helpers/ts-config-paths.d.ts +14 -0
  67. package/helpers/ts-config-paths.js +89 -8
  68. package/helpers/ts-config-paths.js.map +1 -1
  69. package/helpers/typescript-check.d.ts +2 -1
  70. package/helpers/typescript-check.js.map +1 -1
  71. package/helpers/workers.d.ts +20 -19
  72. package/helpers/workers.js +624 -4
  73. package/helpers/workers.js.map +1 -1
  74. package/hmr/client/css-handler.d.ts +1 -0
  75. package/hmr/client/css-handler.js +33 -20
  76. package/hmr/client/css-handler.js.map +1 -1
  77. package/hmr/client/css-update-overlay.d.ts +18 -0
  78. package/hmr/client/css-update-overlay.js +27 -0
  79. package/hmr/client/css-update-overlay.js.map +1 -0
  80. package/hmr/client/framework-client-strategy.d.ts +73 -0
  81. package/hmr/client/framework-client-strategy.js +19 -0
  82. package/hmr/client/framework-client-strategy.js.map +1 -0
  83. package/hmr/client/hmr-pending-overlay.d.ts +27 -0
  84. package/hmr/client/hmr-pending-overlay.js +50 -0
  85. package/hmr/client/hmr-pending-overlay.js.map +1 -0
  86. package/hmr/client/index.js +459 -164
  87. package/hmr/client/index.js.map +1 -1
  88. package/hmr/client/utils.d.ts +6 -1
  89. package/hmr/client/utils.js +184 -8
  90. package/hmr/client/utils.js.map +1 -1
  91. package/hmr/entry-runtime.d.ts +2 -1
  92. package/hmr/entry-runtime.js +252 -65
  93. package/hmr/entry-runtime.js.map +1 -1
  94. package/hmr/frameworks/angular/build/angular-linker.d.ts +12 -0
  95. package/hmr/frameworks/angular/build/angular-linker.js +109 -0
  96. package/hmr/frameworks/angular/build/angular-linker.js.map +1 -0
  97. package/hmr/frameworks/angular/build/inject-component-hmr-registration.d.ts +112 -0
  98. package/hmr/frameworks/angular/build/inject-component-hmr-registration.js +291 -0
  99. package/hmr/frameworks/angular/build/inject-component-hmr-registration.js.map +1 -0
  100. package/hmr/frameworks/angular/build/inject-hmr-vite-ignore.d.ts +75 -0
  101. package/hmr/frameworks/angular/build/inject-hmr-vite-ignore.js +221 -0
  102. package/hmr/frameworks/angular/build/inject-hmr-vite-ignore.js.map +1 -0
  103. package/{helpers/angular → hmr/frameworks/angular/build}/inline-decorator-component-templates.js +1 -170
  104. package/hmr/frameworks/angular/build/inline-decorator-component-templates.js.map +1 -0
  105. package/hmr/frameworks/angular/build/js-lexer.d.ts +4 -0
  106. package/{helpers/angular/synthesize-decorator-ctor-parameters.js → hmr/frameworks/angular/build/js-lexer.js} +22 -96
  107. package/hmr/frameworks/angular/build/js-lexer.js.map +1 -0
  108. package/hmr/frameworks/angular/build/shared-linker.d.ts +39 -0
  109. package/hmr/frameworks/angular/build/shared-linker.js +128 -0
  110. package/hmr/frameworks/angular/build/shared-linker.js.map +1 -0
  111. package/hmr/frameworks/angular/build/synthesize-decorator-ctor-parameters.js +88 -0
  112. package/hmr/frameworks/angular/build/synthesize-decorator-ctor-parameters.js.map +1 -0
  113. package/{helpers/angular → hmr/frameworks/angular/build}/synthesize-injectable-factories.js +1 -174
  114. package/hmr/frameworks/angular/build/synthesize-injectable-factories.js.map +1 -0
  115. package/{helpers/angular → hmr/frameworks/angular/build}/util.d.ts +1 -0
  116. package/hmr/frameworks/angular/build/util.js +155 -0
  117. package/hmr/frameworks/angular/build/util.js.map +1 -0
  118. package/hmr/frameworks/angular/client/index.d.ts +1 -0
  119. package/hmr/frameworks/angular/client/index.js +778 -20
  120. package/hmr/frameworks/angular/client/index.js.map +1 -1
  121. package/hmr/frameworks/angular/client/strategy.d.ts +9 -0
  122. package/hmr/frameworks/angular/client/strategy.js +19 -0
  123. package/hmr/frameworks/angular/client/strategy.js.map +1 -0
  124. package/hmr/frameworks/angular/server/angular-root-component.d.ts +79 -0
  125. package/hmr/frameworks/angular/server/angular-root-component.js +149 -0
  126. package/hmr/frameworks/angular/server/angular-root-component.js.map +1 -0
  127. package/hmr/frameworks/angular/server/linker.js +1 -4
  128. package/hmr/frameworks/angular/server/linker.js.map +1 -1
  129. package/hmr/frameworks/angular/server/strategy.js +448 -12
  130. package/hmr/frameworks/angular/server/strategy.js.map +1 -1
  131. package/hmr/{server → frameworks/angular/server}/websocket-angular-entry.js +2 -2
  132. package/hmr/frameworks/angular/server/websocket-angular-entry.js.map +1 -0
  133. package/hmr/{server → frameworks/angular/server}/websocket-angular-hot-update.d.ts +17 -11
  134. package/hmr/frameworks/angular/server/websocket-angular-hot-update.js +336 -0
  135. package/hmr/frameworks/angular/server/websocket-angular-hot-update.js.map +1 -0
  136. package/hmr/frameworks/solid/build/solid-jsx-deps.d.ts +15 -0
  137. package/hmr/frameworks/solid/build/solid-jsx-deps.js +178 -0
  138. package/hmr/frameworks/solid/build/solid-jsx-deps.js.map +1 -0
  139. package/hmr/frameworks/solid/server/strategy.js +360 -16
  140. package/hmr/frameworks/solid/server/strategy.js.map +1 -1
  141. package/hmr/frameworks/typescript/server/strategy.js +28 -14
  142. package/hmr/frameworks/typescript/server/strategy.js.map +1 -1
  143. package/hmr/frameworks/vue/client/index.js +30 -199
  144. package/hmr/frameworks/vue/client/index.js.map +1 -1
  145. package/hmr/frameworks/vue/client/strategy.d.ts +7 -0
  146. package/hmr/frameworks/vue/client/strategy.js +83 -0
  147. package/hmr/frameworks/vue/client/strategy.js.map +1 -0
  148. package/hmr/frameworks/vue/client/vue-sfc-update-overlay.d.ts +82 -0
  149. package/hmr/frameworks/vue/client/vue-sfc-update-overlay.js +133 -0
  150. package/hmr/frameworks/vue/client/vue-sfc-update-overlay.js.map +1 -0
  151. package/hmr/frameworks/vue/server/sfc-route-assemble.d.ts +7 -0
  152. package/hmr/frameworks/vue/server/sfc-route-assemble.js +706 -0
  153. package/hmr/frameworks/vue/server/sfc-route-assemble.js.map +1 -0
  154. package/hmr/frameworks/vue/server/sfc-route-meta.d.ts +7 -0
  155. package/hmr/frameworks/vue/server/sfc-route-meta.js +80 -0
  156. package/hmr/frameworks/vue/server/sfc-route-meta.js.map +1 -0
  157. package/hmr/frameworks/vue/server/sfc-route-serve.d.ts +8 -0
  158. package/hmr/frameworks/vue/server/sfc-route-serve.js +457 -0
  159. package/hmr/frameworks/vue/server/sfc-route-serve.js.map +1 -0
  160. package/hmr/frameworks/vue/server/sfc-route-shared.d.ts +19 -0
  161. package/hmr/frameworks/vue/server/sfc-route-shared.js +14 -0
  162. package/hmr/frameworks/vue/server/sfc-route-shared.js.map +1 -0
  163. package/hmr/frameworks/vue/server/strategy.js +244 -0
  164. package/hmr/frameworks/vue/server/strategy.js.map +1 -1
  165. package/hmr/frameworks/vue/server/websocket-sfc.d.ts +15 -0
  166. package/hmr/frameworks/vue/server/websocket-sfc.js +20 -0
  167. package/hmr/frameworks/vue/server/websocket-sfc.js.map +1 -0
  168. package/hmr/helpers/ast-normalizer.js +52 -5
  169. package/hmr/helpers/ast-normalizer.js.map +1 -1
  170. package/hmr/helpers/cjs-named-exports.d.ts +23 -0
  171. package/hmr/helpers/cjs-named-exports.js +152 -0
  172. package/hmr/helpers/cjs-named-exports.js.map +1 -0
  173. package/hmr/helpers/package-exports.d.ts +16 -0
  174. package/hmr/helpers/package-exports.js +396 -0
  175. package/hmr/helpers/package-exports.js.map +1 -0
  176. package/hmr/server/constants.js +13 -4
  177. package/hmr/server/constants.js.map +1 -1
  178. package/hmr/server/core-sanitize.d.ts +90 -7
  179. package/hmr/server/core-sanitize.js +211 -56
  180. package/hmr/server/core-sanitize.js.map +1 -1
  181. package/hmr/server/device-transform-helpers.d.ts +24 -0
  182. package/hmr/server/device-transform-helpers.js +327 -0
  183. package/hmr/server/device-transform-helpers.js.map +1 -0
  184. package/hmr/server/framework-strategy.d.ts +95 -11
  185. package/hmr/server/hmr-module-graph.d.ts +37 -0
  186. package/hmr/server/hmr-module-graph.js +214 -0
  187. package/hmr/server/hmr-module-graph.js.map +1 -0
  188. package/hmr/server/import-map.d.ts +11 -2
  189. package/hmr/server/import-map.js +59 -40
  190. package/hmr/server/import-map.js.map +1 -1
  191. package/hmr/server/index.js +7 -16
  192. package/hmr/server/index.js.map +1 -1
  193. package/hmr/server/ns-core-cjs-shape.d.ts +204 -0
  194. package/hmr/server/ns-core-cjs-shape.js +271 -0
  195. package/hmr/server/ns-core-cjs-shape.js.map +1 -0
  196. package/hmr/server/ns-rt-bridge.d.ts +51 -0
  197. package/hmr/server/ns-rt-bridge.js +131 -0
  198. package/hmr/server/ns-rt-bridge.js.map +1 -0
  199. package/hmr/server/ns-rt-route.d.ts +5 -0
  200. package/hmr/server/ns-rt-route.js +35 -0
  201. package/hmr/server/ns-rt-route.js.map +1 -0
  202. package/hmr/server/perf-instrumentation.d.ts +114 -0
  203. package/hmr/server/perf-instrumentation.js +195 -0
  204. package/hmr/server/perf-instrumentation.js.map +1 -0
  205. package/hmr/server/process-code-for-device.d.ts +15 -0
  206. package/hmr/server/process-code-for-device.js +654 -0
  207. package/hmr/server/process-code-for-device.js.map +1 -0
  208. package/hmr/server/require-guard.d.ts +1 -0
  209. package/hmr/server/require-guard.js +12 -0
  210. package/hmr/server/require-guard.js.map +1 -0
  211. package/hmr/server/rewrite-imports.d.ts +2 -0
  212. package/hmr/server/rewrite-imports.js +604 -0
  213. package/hmr/server/rewrite-imports.js.map +1 -0
  214. package/hmr/server/route-helpers.d.ts +7 -0
  215. package/hmr/server/route-helpers.js +13 -0
  216. package/hmr/server/route-helpers.js.map +1 -0
  217. package/hmr/server/server-origin.d.ts +12 -0
  218. package/hmr/server/server-origin.js +66 -0
  219. package/hmr/server/server-origin.js.map +1 -0
  220. package/hmr/server/shared-transform-request.js +12 -5
  221. package/hmr/server/shared-transform-request.js.map +1 -1
  222. package/hmr/server/transform-cache-invalidation.d.ts +11 -0
  223. package/hmr/server/transform-cache-invalidation.js +84 -0
  224. package/hmr/server/transform-cache-invalidation.js.map +1 -0
  225. package/hmr/server/vendor-bare-module-shims.d.ts +4 -0
  226. package/hmr/server/vendor-bare-module-shims.js +80 -0
  227. package/hmr/server/vendor-bare-module-shims.js.map +1 -0
  228. package/hmr/server/vite-plugin.js +60 -42
  229. package/hmr/server/vite-plugin.js.map +1 -1
  230. package/hmr/server/websocket-core-bridge.d.ts +41 -6
  231. package/hmr/server/websocket-core-bridge.js +72 -75
  232. package/hmr/server/websocket-core-bridge.js.map +1 -1
  233. package/hmr/server/websocket-css-hot-update.d.ts +33 -0
  234. package/hmr/server/websocket-css-hot-update.js +65 -0
  235. package/hmr/server/websocket-css-hot-update.js.map +1 -0
  236. package/hmr/server/websocket-device-transform.d.ts +3 -0
  237. package/hmr/server/websocket-device-transform.js +7 -0
  238. package/hmr/server/websocket-device-transform.js.map +1 -0
  239. package/hmr/server/websocket-graph-upsert.d.ts +15 -0
  240. package/hmr/server/websocket-graph-upsert.js +20 -0
  241. package/hmr/server/websocket-graph-upsert.js.map +1 -1
  242. package/hmr/server/websocket-hmr-pending.d.ts +37 -0
  243. package/hmr/server/websocket-hmr-pending.js +55 -0
  244. package/hmr/server/websocket-hmr-pending.js.map +1 -0
  245. package/hmr/server/websocket-hot-update.d.ts +77 -0
  246. package/hmr/server/websocket-hot-update.js +330 -0
  247. package/hmr/server/websocket-hot-update.js.map +1 -0
  248. package/hmr/server/websocket-import-map-route.d.ts +15 -0
  249. package/hmr/server/websocket-import-map-route.js +46 -0
  250. package/hmr/server/websocket-import-map-route.js.map +1 -0
  251. package/hmr/server/websocket-module-bindings.js +3 -3
  252. package/hmr/server/websocket-module-bindings.js.map +1 -1
  253. package/hmr/server/websocket-module-specifiers.d.ts +66 -2
  254. package/hmr/server/websocket-module-specifiers.js +202 -19
  255. package/hmr/server/websocket-module-specifiers.js.map +1 -1
  256. package/hmr/server/websocket-ns-core.d.ts +21 -0
  257. package/hmr/server/websocket-ns-core.js +306 -0
  258. package/hmr/server/websocket-ns-core.js.map +1 -0
  259. package/hmr/server/websocket-ns-entry.d.ts +21 -0
  260. package/hmr/server/websocket-ns-entry.js +150 -0
  261. package/hmr/server/websocket-ns-entry.js.map +1 -0
  262. package/hmr/server/websocket-ns-m-paths.d.ts +3 -0
  263. package/hmr/server/websocket-ns-m-paths.js +92 -0
  264. package/hmr/server/websocket-ns-m-paths.js.map +1 -0
  265. package/hmr/server/websocket-ns-m-request.d.ts +45 -0
  266. package/hmr/server/websocket-ns-m-request.js +196 -0
  267. package/hmr/server/websocket-ns-m-request.js.map +1 -0
  268. package/hmr/server/websocket-ns-m.d.ts +33 -0
  269. package/hmr/server/websocket-ns-m.js +748 -0
  270. package/hmr/server/websocket-ns-m.js.map +1 -0
  271. package/hmr/server/websocket-served-module-helpers.d.ts +39 -0
  272. package/hmr/server/websocket-served-module-helpers.js +654 -0
  273. package/hmr/server/websocket-served-module-helpers.js.map +1 -0
  274. package/hmr/server/websocket-txn.d.ts +6 -0
  275. package/hmr/server/websocket-txn.js +39 -0
  276. package/hmr/server/websocket-txn.js.map +1 -0
  277. package/hmr/server/websocket-vendor-unifier.d.ts +9 -0
  278. package/hmr/server/websocket-vendor-unifier.js +46 -0
  279. package/hmr/server/websocket-vendor-unifier.js.map +1 -0
  280. package/hmr/server/websocket.d.ts +8 -39
  281. package/hmr/server/websocket.js +602 -6049
  282. package/hmr/server/websocket.js.map +1 -1
  283. package/hmr/shared/ns-globals.d.ts +118 -0
  284. package/hmr/shared/ns-globals.js +27 -0
  285. package/hmr/shared/ns-globals.js.map +1 -0
  286. package/hmr/shared/protocol.d.ts +136 -0
  287. package/hmr/shared/protocol.js +28 -0
  288. package/hmr/shared/protocol.js.map +1 -0
  289. package/hmr/shared/runtime/boot-placeholder-ui.d.ts +69 -0
  290. package/hmr/shared/runtime/boot-placeholder-ui.js +101 -0
  291. package/hmr/shared/runtime/boot-placeholder-ui.js.map +1 -0
  292. package/hmr/shared/runtime/boot-progress.d.ts +40 -0
  293. package/hmr/shared/runtime/boot-progress.js +128 -0
  294. package/hmr/shared/runtime/boot-progress.js.map +1 -0
  295. package/hmr/shared/runtime/boot-timeline.d.ts +18 -0
  296. package/hmr/shared/runtime/boot-timeline.js +52 -0
  297. package/hmr/shared/runtime/boot-timeline.js.map +1 -0
  298. package/hmr/shared/runtime/dev-overlay-snapshots.d.ts +31 -0
  299. package/hmr/shared/runtime/dev-overlay-snapshots.js +324 -0
  300. package/hmr/shared/runtime/dev-overlay-snapshots.js.map +1 -0
  301. package/hmr/shared/runtime/dev-overlay.d.ts +75 -26
  302. package/hmr/shared/runtime/dev-overlay.js +990 -260
  303. package/hmr/shared/runtime/dev-overlay.js.map +1 -1
  304. package/hmr/shared/runtime/module-provenance.js +1 -4
  305. package/hmr/shared/runtime/module-provenance.js.map +1 -1
  306. package/hmr/shared/runtime/root-placeholder-view.d.ts +19 -0
  307. package/hmr/shared/runtime/root-placeholder-view.js +310 -0
  308. package/hmr/shared/runtime/root-placeholder-view.js.map +1 -0
  309. package/hmr/shared/runtime/root-placeholder.js +352 -194
  310. package/hmr/shared/runtime/root-placeholder.js.map +1 -1
  311. package/hmr/shared/runtime/session-bootstrap.js +164 -1
  312. package/hmr/shared/runtime/session-bootstrap.js.map +1 -1
  313. package/hmr/shared/runtime/vendor-bootstrap.js +1 -9
  314. package/hmr/shared/runtime/vendor-bootstrap.js.map +1 -1
  315. package/hmr/shared/vendor/manifest-collect.d.ts +4 -0
  316. package/hmr/shared/vendor/manifest-collect.js +512 -0
  317. package/hmr/shared/vendor/manifest-collect.js.map +1 -0
  318. package/hmr/shared/vendor/manifest-loader.d.ts +2 -1
  319. package/hmr/shared/vendor/manifest-loader.js +3 -2
  320. package/hmr/shared/vendor/manifest-loader.js.map +1 -1
  321. package/hmr/shared/vendor/manifest.d.ts +1 -7
  322. package/hmr/shared/vendor/manifest.js +102 -741
  323. package/hmr/shared/vendor/manifest.js.map +1 -1
  324. package/hmr/shared/vendor/vendor-device-shim.d.ts +1 -0
  325. package/hmr/shared/vendor/vendor-device-shim.js +208 -0
  326. package/hmr/shared/vendor/vendor-device-shim.js.map +1 -0
  327. package/hmr/shared/vendor/vendor-esbuild-plugins.d.ts +16 -0
  328. package/hmr/shared/vendor/vendor-esbuild-plugins.js +203 -0
  329. package/hmr/shared/vendor/vendor-esbuild-plugins.js.map +1 -0
  330. package/index.d.ts +1 -0
  331. package/index.js +5 -0
  332. package/index.js.map +1 -1
  333. package/package.json +55 -11
  334. package/runtime/core-aliases-early.js +17 -41
  335. package/runtime/core-aliases-early.js.map +1 -1
  336. package/helpers/angular/angular-linker.d.ts +0 -13
  337. package/helpers/angular/angular-linker.js +0 -194
  338. package/helpers/angular/angular-linker.js.map +0 -1
  339. package/helpers/angular/inline-decorator-component-templates.js.map +0 -1
  340. package/helpers/angular/shared-linker.d.ts +0 -11
  341. package/helpers/angular/shared-linker.js +0 -75
  342. package/helpers/angular/shared-linker.js.map +0 -1
  343. package/helpers/angular/synthesize-decorator-ctor-parameters.js.map +0 -1
  344. package/helpers/angular/synthesize-injectable-factories.js.map +0 -1
  345. package/helpers/angular/util.js +0 -67
  346. package/helpers/angular/util.js.map +0 -1
  347. package/helpers/prelink-angular.d.ts +0 -2
  348. package/helpers/prelink-angular.js +0 -117
  349. package/helpers/prelink-angular.js.map +0 -1
  350. package/hmr/server/websocket-angular-entry.js.map +0 -1
  351. package/hmr/server/websocket-angular-hot-update.js +0 -239
  352. package/hmr/server/websocket-angular-hot-update.js.map +0 -1
  353. /package/{helpers/angular → hmr/frameworks/angular/build}/inline-decorator-component-templates.d.ts +0 -0
  354. /package/{helpers/angular → hmr/frameworks/angular/build}/synthesize-decorator-ctor-parameters.d.ts +0 -0
  355. /package/{helpers/angular → hmr/frameworks/angular/build}/synthesize-injectable-factories.d.ts +0 -0
  356. /package/hmr/{server → frameworks/angular/server}/websocket-angular-entry.d.ts +0 -0
@@ -0,0 +1,341 @@
1
+ /**
2
+ * Canonical resolver for the Vite dev-server origin that a NativeScript
3
+ * device or simulator can actually reach.
4
+ *
5
+ * Why this exists. The Vite dev server commonly binds to `0.0.0.0`
6
+ * (the wildcard "all interfaces" address) so both the host browser and
7
+ * a sibling mobile device can hit it. That bind address is fine for
8
+ * the LISTENING socket — but it is NOT a routable hostname:
9
+ *
10
+ * - iOS Simulator shares the host's network stack, so `localhost` /
11
+ * `127.0.0.1` work from inside the simulator and even `0.0.0.0`
12
+ * sometimes resolves there. The simulator path is forgiving.
13
+ *
14
+ * - Android Emulator runs inside a virtual NIC with NAT (QEMU
15
+ * `slirp`). `0.0.0.0` and `localhost` / `127.0.0.1` refer to the
16
+ * EMULATOR ITSELF, not the development host. Two routable paths
17
+ * exist:
18
+ *
19
+ * (a) `adb reverse tcp:<port> tcp:<port>` — multiplexes the
20
+ * device-side `127.0.0.1:<port>` over the existing ADB
21
+ * transport to the host. This is the PREFERRED path: slirp
22
+ * is famously flaky under burst-connect load and drops
23
+ * ~80% of cold-boot module-loader fetches with
24
+ * `IOException: unexpected end of stream`. The ADB tunnel
25
+ * bypasses slirp entirely and is reliable. We try this
26
+ * automatically — see `tryEnableAdbReverse`. We emit the
27
+ * IPv4 literal `127.0.0.1` instead of `localhost` because
28
+ * Android API 36+ system images periodically ship without
29
+ * a `localhost` mapping in the resolver, and
30
+ * `UnknownHostException` fires before adb-reverse can do
31
+ * its job.
32
+ *
33
+ * (b) `10.0.2.2` (Genymotion: `10.0.3.2`) — slirp's host alias.
34
+ * Used as a fallback when ADB isn't available or the user
35
+ * opted out via `NS_HMR_NO_ADB_REVERSE=1`. Works, just less
36
+ * reliable than the ADB tunnel.
37
+ *
38
+ * - Physical Android devices over USB get the same automatic
39
+ * `adb reverse` treatment as emulators. Over Wi-Fi (no ADB
40
+ * tunnel), the user must opt out of adb reverse via
41
+ * `NS_HMR_NO_ADB_REVERSE=1` and supply a routable host via
42
+ * `NS_HMR_HOST=<ip>` or `NS_HMR_PREFER_LAN_HOST=1`.
43
+ *
44
+ * Without this normalization, `bundle.mjs` ships with statically
45
+ * embedded URLs like `http://0.0.0.0:5173/ns/core/xhr` and the very
46
+ * first dynamic import during Application boot fails with
47
+ * `status=0 (network unreachable)` on Android, killing the runtime
48
+ * before any user code runs.
49
+ *
50
+ * Resolution rules (highest precedence first):
51
+ *
52
+ * 1. `process.env.NS_HMR_HOST` — always wins. CI, tunneled setups,
53
+ * and remote devices use this to point at a known-good origin.
54
+ *
55
+ * 2. A concrete non-wildcard, non-loopback `host` arg — trust the
56
+ * developer's explicit choice (`server.host: '192.168.1.42'`
57
+ * already routes from any device on the LAN).
58
+ *
59
+ * 3. `process.env.NS_HMR_PREFER_LAN_HOST` truthy AND a LAN NIC is
60
+ * detected — emit the LAN IP. Opt-in for physical-device-over-
61
+ * Wi-Fi dev. Also disables the adb-reverse path below so the
62
+ * caller actually gets LAN routing.
63
+ *
64
+ * 4. Wildcard bind (`0.0.0.0`, `::`, `true`, empty) OR Android
65
+ * loopback — emit the platform-appropriate routable address.
66
+ * For Android, we first try `adb reverse tcp:<port> tcp:<port>`
67
+ * and emit `127.0.0.1` on success (bypasses slirp NAT entirely
68
+ * and avoids Android API 36+'s missing-`localhost`-from-resolver
69
+ * bug); on failure we fall back to `10.0.2.2`. iOS/visionOS get
70
+ * `localhost` directly. iOS/visionOS loopback passes through
71
+ * unchanged.
72
+ *
73
+ * Every dev-mode emitter that bakes a URL into `bundle.mjs` or sends
74
+ * one to a device-side fetch site MUST run through this helper so the
75
+ * device receives a single canonical, reachable origin.
76
+ */
77
+ import type { Platform } from './platform-types.js';
78
+ export type DevHostPlatform = Platform;
79
+ /**
80
+ * Per-port cache of `adb reverse` setup attempts. Keyed by port so
81
+ * dev servers that switch ports across restarts get a clean attempt
82
+ * each time. The cache is required because every entry point that
83
+ * embeds a device-reachable URL (the bundle.mjs boot path, the
84
+ * `/ns/core/*` external resolver, the websocket URL emitter, the
85
+ * served-module rewriter) hits `resolveDeviceReachable*` — if we
86
+ * spawned `adb reverse` on every call we'd fork ~half a dozen
87
+ * subprocesses per Vite startup and the cold-boot would slow
88
+ * noticeably.
89
+ *
90
+ * The cache also gives us a stable answer across all consumers: once
91
+ * the first caller learns that adb reverse is available, every later
92
+ * caller in the same process gets the same `localhost`/`10.0.2.2`
93
+ * decision. URL identity is what keeps the iOS HTTP ESM realm from
94
+ * splitting and what keeps the Android HMR client and bundle.mjs
95
+ * pointing at the same origin.
96
+ */
97
+ interface AdbReverseStatus {
98
+ attempted: boolean;
99
+ succeeded: boolean;
100
+ error?: string;
101
+ /** Device serials that successfully received the reverse mapping. */
102
+ devices: string[];
103
+ /**
104
+ * Set when the mapping was established by the NativeScript CLI (it
105
+ * exported `NS_ADB_REVERSE_READY=1`) rather than by this plugin.
106
+ * In that case the plugin never spawned `adb` at all — it simply
107
+ * trusts that `127.0.0.1:<port>` already tunnels to the host. See
108
+ * the CLI-handoff note in `tryEnableAdbReverse`.
109
+ */
110
+ viaCli?: boolean;
111
+ }
112
+ /**
113
+ * Returns the first non-internal IPv4 address on the host machine, or
114
+ * `undefined` if no LAN NIC is up. Pure wrapper around
115
+ * `os.networkInterfaces()` so callers and tests can stub it cleanly.
116
+ */
117
+ export declare function guessLanHost(): string | undefined;
118
+ /**
119
+ * Whether the given host string is a wildcard "all interfaces" bind
120
+ * address rather than a routable hostname. `host` may be the literal
121
+ * string from a Vite config (`'0.0.0.0'`), an empty string, or `'true'`
122
+ * (some older Vite/CLI surfaces stringify the boolean).
123
+ */
124
+ export declare function isWildcardHost(host: string): boolean;
125
+ /**
126
+ * Whether the given host string is loopback. On Android the loopback
127
+ * address is the device itself, NOT the development host — so callers
128
+ * must remap it for Android consumers.
129
+ */
130
+ export declare function isLoopbackHost(host: string): boolean;
131
+ export interface DeviceHostResolution {
132
+ /** Final host string baked into the device-side URL. */
133
+ host: string;
134
+ /**
135
+ * How the value was chosen. `'env'` / `'explicit'` mean the result
136
+ * is locked-in; `'lan'`, `'adb-reverse'`, and `'platform-default'`
137
+ * are fallbacks selected by this helper.
138
+ */
139
+ source: 'env' | 'explicit' | 'lan' | 'adb-reverse' | 'platform-default';
140
+ }
141
+ export interface ResolveDeviceHostOptions {
142
+ /** The raw host value from the Vite config (`server.host`). */
143
+ host?: unknown;
144
+ /** Target device platform. Drives the loopback / wildcard fallback. */
145
+ platform: DevHostPlatform;
146
+ /**
147
+ * Override for `process.env`. Tests pass a fixture object; runtime
148
+ * callers omit this and pick up the ambient process environment.
149
+ */
150
+ env?: NodeJS.ProcessEnv;
151
+ /**
152
+ * Override for `guessLanHost()`. Tests stub a fixed return value;
153
+ * runtime callers omit this and the helper hits real NICs.
154
+ */
155
+ lanHostResolver?: () => string | undefined;
156
+ /**
157
+ * Dev-server port. When set AND `platform === 'android'`, this
158
+ * helper will lazily attempt `adb reverse tcp:<port> tcp:<port>`
159
+ * on first call and, if it succeeds, emit `localhost` instead of
160
+ * `10.0.2.2`. See `tryEnableAdbReverse` for the full rationale.
161
+ *
162
+ * Optional for backwards compatibility — callers that already have
163
+ * the port (which is everyone except a couple of legacy test
164
+ * fixtures) should pass it so Android emulator users get the
165
+ * reliable ADB tunnel path instead of QEMU slirp's flaky NAT.
166
+ */
167
+ port?: number;
168
+ /**
169
+ * Test seam for the adb-reverse subprocess. When passed, this
170
+ * helper uses the injected exec function instead of spawning
171
+ * `child_process.execFileSync`. Runtime callers omit this and pick
172
+ * up the SDK-resolved adb binary (see `resolveAdbPath`).
173
+ */
174
+ adbExec?: AdbExec;
175
+ }
176
+ /**
177
+ * Subprocess shim used by `tryEnableAdbReverse`. Production code
178
+ * routes through `child_process.execFileSync` — argv form, NO
179
+ * `/bin/sh -c` wrapper. That matters for two reasons:
180
+ *
181
+ * 1. On timeout, `execFileSync` signals the actual `adb` child
182
+ * directly. The old `execSync('adb …')` form spawned a shell
183
+ * that spawned adb; killing the shell on timeout ORPHANED the
184
+ * adb grandchild, and a half-handshaked orphan can wedge the
185
+ * adb daemon out from under the CLI's device tracker.
186
+ *
187
+ * 2. No shell means no quoting / `$PATH` surprises — we invoke an
188
+ * absolute, SDK-resolved adb binary (see `resolveAdbPath`) with
189
+ * a literal argv.
190
+ *
191
+ * Tests stub this so the suite can exercise success / failure /
192
+ * "multiple devices" / "no ADB" paths without touching a real
193
+ * Android emulator. The shim receives the resolved adb path and the
194
+ * argv array (e.g. `['-s', 'emulator-5554', 'reverse', …]`).
195
+ */
196
+ export type AdbExec = (adbPath: string, args: string[], opts: {
197
+ timeout: number;
198
+ }) => string;
199
+ /**
200
+ * Resolve the `adb` executable the way the Android SDK tooling does,
201
+ * so the plugin and the NativeScript CLI drive the *same* adb client.
202
+ *
203
+ * Why this is load-bearing. A bare `adb` from `$PATH` is frequently a
204
+ * DIFFERENT version than the one the CLI resolves from the SDK. When
205
+ * two adb *clients* of differing versions talk to the one global adb
206
+ * server (port 5037), the newer client prints
207
+ * `adb server version (NN) doesn't match this client (MM); killing...`
208
+ * and restarts the daemon — severing the CLI's `track-devices` stream
209
+ * and hanging it at "Searching for devices…" forever. Resolving the
210
+ * exact SDK adb eliminates that mismatch.
211
+ *
212
+ * Precedence:
213
+ * 1. `NS_ADB_PATH` — the CLI exports the absolute path to the adb it
214
+ * itself uses. Always wins so the two processes are byte-identical.
215
+ * 2. `$ANDROID_HOME/platform-tools/adb` (+ `.exe` on Windows).
216
+ * 3. `$ANDROID_SDK_ROOT/platform-tools/adb`.
217
+ * 4. Bare `adb` — last-resort PATH lookup (kept only so a machine
218
+ * with adb on PATH but no SDK env still limps along).
219
+ *
220
+ * Candidates from (2)/(3) are existence-checked; a stale env var that
221
+ * points at a missing binary falls through rather than guaranteeing a
222
+ * spawn failure.
223
+ */
224
+ export declare function resolveAdbPath(env?: NodeJS.ProcessEnv): string;
225
+ export interface TryEnableAdbReverseOptions {
226
+ /** Port to forward on both sides of the ADB bridge. */
227
+ port: number;
228
+ /** Override for `process.env`; tests pass a fixture object. */
229
+ env?: NodeJS.ProcessEnv;
230
+ /** Test seam — see `AdbExec`. */
231
+ exec?: AdbExec;
232
+ }
233
+ /**
234
+ * Read-only view of the current `adb reverse` status for a given
235
+ * dev-server port. Returns `undefined` if `tryEnableAdbReverse` has
236
+ * never been called for that port.
237
+ */
238
+ export declare function getAdbReverseStatus(port: number): AdbReverseStatus | undefined;
239
+ /**
240
+ * Test hook — clears the per-port cache so unit tests can exercise
241
+ * fresh "first call" behavior without leaking state between cases.
242
+ * NOT exported from the package barrel; spec files import via the
243
+ * file path directly.
244
+ */
245
+ export declare function __resetAdbReverseCacheForTests(): void;
246
+ /**
247
+ * Try to set up `adb reverse tcp:<port> tcp:<port>` for every
248
+ * connected Android device / emulator so device-side `localhost:port`
249
+ * routes through the ADB transport to the host's dev server.
250
+ *
251
+ * Why this beats `10.0.2.2`. The Android emulator's stock NAT is
252
+ * QEMU's `slirp` user-mode network stack, which is well-known to
253
+ * drop bursts of concurrent TCP setups to the host. In practice this
254
+ * surfaces as ~80% of synchronous module-loader fetches failing with
255
+ * `IOException: unexpected end of stream` — the connection establishes,
256
+ * the request goes out, and then slirp drops the response before
257
+ * okhttp can read the status line. The failures are random per-module
258
+ * across runs, retries help but don't eliminate them, and the symptom
259
+ * masquerades as a server-side bug.
260
+ *
261
+ * `adb reverse` bypasses the emulator NIC entirely — the device-side
262
+ * connection is multiplexed over the existing ADB USB / TCP channel
263
+ * to the host. It's the same mechanism React Native, Expo, and
264
+ * Flutter use for Android dev, and it works for both emulators and
265
+ * USB-connected physical devices.
266
+ *
267
+ * Caching. The result is cached per-port so repeat callers don't
268
+ * fork extra subprocesses. The cache is keyed on port (not platform)
269
+ * because the wildcard "Android-ness" of the call is already implied
270
+ * by the caller — only Android consumers hit this path.
271
+ *
272
+ * CLI handoff (the preferred path). When the NativeScript CLI drives
273
+ * the run it already owns device discovery, install, and launch — it
274
+ * knows the exact target serial and exactly when the device is ready.
275
+ * In that mode the CLI performs the `adb reverse` itself, with its own
276
+ * SDK-resolved adb, AFTER the device is up, and exports
277
+ * `NS_ADB_REVERSE_READY=1`. Seeing that flag, this function returns a
278
+ * synthetic success WITHOUT spawning adb at all — removing the second,
279
+ * racing adb owner that used to collide with the CLI's device search
280
+ * during cold start. `NS_DEVICE_SERIAL` (the CLI's deploy target) and
281
+ * `NS_ADB_PATH` (the CLI's adb) are honored in the self-managed
282
+ * fallback below for setups where the CLI did NOT pre-wire the reverse.
283
+ *
284
+ * Self-managed hardening (fallback). When `NS_ADB_REVERSE_READY` is
285
+ * absent we still set the mapping ourselves, but defensively:
286
+ * - resolve adb from the SDK (`resolveAdbPath`) — never a bare PATH
287
+ * `adb` that could version-mismatch and kill the CLI's daemon;
288
+ * - `adb start-server` once up front so a cold daemon is owned by a
289
+ * single, version-matched client before anything else touches it;
290
+ * - argv `execFileSync` (no shell) with a child-killing timeout so a
291
+ * hung adb is reaped rather than orphaned;
292
+ * - `wait-for-device` per serial so we don't issue `reverse` against
293
+ * an emulator whose `adbd` hasn't finished coming up.
294
+ *
295
+ * Failure modes (all surface as a cached `succeeded: false`):
296
+ * - `NS_HMR_NO_ADB_REVERSE=1` — explicit opt-out for unusual
297
+ * setups (e.g. Wi-Fi-connected device with no ADB tunnel, CI
298
+ * containers without ADB installed).
299
+ * - `adb` not resolvable / not runnable.
300
+ * - No connected devices — user started Vite before booting the
301
+ * emulator. We do NOT keep retrying after the first failure
302
+ * because the URL is baked into bundle.mjs at config-load time
303
+ * and there's no point in flipping it later.
304
+ * - "more than one device" — fatal for unqualified `adb reverse`,
305
+ * so we target each serial individually with `-s <serial>`. As
306
+ * long as at least one device gets the mapping we treat the whole
307
+ * call as a success.
308
+ */
309
+ export declare function tryEnableAdbReverse(opts: TryEnableAdbReverseOptions): AdbReverseStatus;
310
+ /**
311
+ * Pick the host string a device or simulator can actually reach.
312
+ *
313
+ * See the file-level comment for the full resolution-precedence
314
+ * narrative. Returns the chosen host alongside a `source` tag so
315
+ * callers (and logs) can explain why a given URL was emitted.
316
+ */
317
+ export declare function resolveDeviceReachableHost(opts: ResolveDeviceHostOptions): DeviceHostResolution;
318
+ export interface ResolveDeviceOriginOptions extends ResolveDeviceHostOptions {
319
+ /** Wire protocol; usually 'http' unless `server.https` is set. */
320
+ protocol?: 'http' | 'https';
321
+ /** Server port; defaults to 5173 to match the Vite dev default. */
322
+ port?: number;
323
+ }
324
+ export interface DeviceOriginResolution extends DeviceHostResolution {
325
+ /** Fully assembled `protocol://host:port` string. */
326
+ origin: string;
327
+ protocol: 'http' | 'https';
328
+ port: number;
329
+ }
330
+ /**
331
+ * Convenience wrapper that returns the full `protocol://host:port`
332
+ * origin string alongside the host-resolution metadata. The vast
333
+ * majority of callers want the assembled origin to splice into a
334
+ * `/ns/...` URL, so this saves them the trivial template string.
335
+ *
336
+ * When the resolved host already includes a `:port` suffix (a common
337
+ * shape for `NS_HMR_HOST=tunnel.example.com:5173`), we split it back
338
+ * out so the assembled origin never doubles up the port.
339
+ */
340
+ export declare function resolveDeviceReachableOrigin(opts: ResolveDeviceOriginOptions): DeviceOriginResolution;
341
+ export {};