one 1.1.538 → 1.1.539

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 (462) hide show
  1. package/dist/cjs/Root.native.js +83 -61
  2. package/dist/cjs/Root.native.js.map +1 -6
  3. package/dist/cjs/babel-plugins/one-router-metro.native.js +31 -20
  4. package/dist/cjs/babel-plugins/one-router-metro.native.js.map +1 -6
  5. package/dist/cjs/cli/build.native.js +340 -277
  6. package/dist/cjs/cli/build.native.js.map +1 -6
  7. package/dist/cjs/cli/buildPage.native.js +65 -36
  8. package/dist/cjs/cli/buildPage.native.js.map +1 -6
  9. package/dist/cjs/cli/checkNodeVersion.native.js +17 -14
  10. package/dist/cjs/cli/checkNodeVersion.native.js.map +1 -6
  11. package/dist/cjs/cli/dev.native.js +55 -37
  12. package/dist/cjs/cli/dev.native.js.map +1 -6
  13. package/dist/cjs/cli/label-process.native.js +20 -16
  14. package/dist/cjs/cli/label-process.native.js.map +1 -6
  15. package/dist/cjs/cli/main.native.js +37 -22
  16. package/dist/cjs/cli/main.native.js.map +1 -6
  17. package/dist/cjs/cli/patch.native.js +28 -19
  18. package/dist/cjs/cli/patch.native.js.map +1 -6
  19. package/dist/cjs/cli/prebuild.native.js +26 -18
  20. package/dist/cjs/cli/prebuild.native.js.map +1 -6
  21. package/dist/cjs/cli/runAndroid.native.js +26 -18
  22. package/dist/cjs/cli/runAndroid.native.js.map +1 -6
  23. package/dist/cjs/cli/runIos.native.js +26 -18
  24. package/dist/cjs/cli/runIos.native.js.map +1 -6
  25. package/dist/cjs/cli.native.js +281 -220
  26. package/dist/cjs/cli.native.js.map +1 -6
  27. package/dist/cjs/clientLoaderResolver.native.js +21 -19
  28. package/dist/cjs/clientLoaderResolver.native.js.map +1 -6
  29. package/dist/cjs/config.native.js +26 -21
  30. package/dist/cjs/config.native.js.map +1 -6
  31. package/dist/cjs/constants.native.js +36 -30
  32. package/dist/cjs/constants.native.js.map +1 -6
  33. package/dist/cjs/createApp.native.js +26 -21
  34. package/dist/cjs/createApp.native.js.map +1 -6
  35. package/dist/cjs/createHandleRequest.native.js +94 -85
  36. package/dist/cjs/createHandleRequest.native.js.map +1 -6
  37. package/dist/cjs/createMiddleware.native.js +17 -14
  38. package/dist/cjs/createMiddleware.native.js.map +1 -6
  39. package/dist/cjs/fallbackViews/Sitemap.native.js +21 -17
  40. package/dist/cjs/fallbackViews/Sitemap.native.js.map +1 -6
  41. package/dist/cjs/fallbackViews/Unmatched.native.js +27 -19
  42. package/dist/cjs/fallbackViews/Unmatched.native.js.map +1 -6
  43. package/dist/cjs/fork/NavigationContainer.native.js +93 -64
  44. package/dist/cjs/fork/NavigationContainer.native.js.map +1 -6
  45. package/dist/cjs/fork/__tests__/getPathFromState.test.cjs +9 -10
  46. package/dist/cjs/fork/__tests__/getPathFromState.test.js +3 -3
  47. package/dist/cjs/fork/__tests__/getPathFromState.test.js.map +1 -1
  48. package/dist/cjs/fork/__tests__/getPathFromState.test.native.js +1144 -1288
  49. package/dist/cjs/fork/__tests__/getPathFromState.test.native.js.map +1 -6
  50. package/dist/cjs/fork/__tests__/getStateFromPath.test.cjs +5 -7
  51. package/dist/cjs/fork/__tests__/getStateFromPath.test.js +5 -5
  52. package/dist/cjs/fork/__tests__/getStateFromPath.test.js.map +1 -1
  53. package/dist/cjs/fork/__tests__/getStateFromPath.test.native.js +1881 -2104
  54. package/dist/cjs/fork/__tests__/getStateFromPath.test.native.js.map +1 -6
  55. package/dist/cjs/fork/_shared.native.js +19 -19
  56. package/dist/cjs/fork/_shared.native.js.map +1 -6
  57. package/dist/cjs/fork/createMemoryHistory.native.js +131 -109
  58. package/dist/cjs/fork/createMemoryHistory.native.js.map +1 -6
  59. package/dist/cjs/fork/extractPathFromURL.native.js +43 -41
  60. package/dist/cjs/fork/extractPathFromURL.native.js.map +1 -6
  61. package/dist/cjs/fork/findFocusedRoute.native.js +20 -16
  62. package/dist/cjs/fork/findFocusedRoute.native.js.map +1 -6
  63. package/dist/cjs/fork/getPathFromState-mods.native.js +37 -25
  64. package/dist/cjs/fork/getPathFromState-mods.native.js.map +1 -6
  65. package/dist/cjs/fork/getPathFromState.native.js +112 -107
  66. package/dist/cjs/fork/getPathFromState.native.js.map +1 -6
  67. package/dist/cjs/fork/getPathFromState.test.native.js +63 -74
  68. package/dist/cjs/fork/getPathFromState.test.native.js.map +1 -6
  69. package/dist/cjs/fork/getStateFromPath-mods.native.js +126 -131
  70. package/dist/cjs/fork/getStateFromPath-mods.native.js.map +1 -6
  71. package/dist/cjs/fork/getStateFromPath.native.js +271 -240
  72. package/dist/cjs/fork/getStateFromPath.native.js.map +1 -6
  73. package/dist/cjs/fork/getStateFromPath.test.native.js +167 -306
  74. package/dist/cjs/fork/getStateFromPath.test.native.js.map +1 -6
  75. package/dist/cjs/fork/useBackButton.native.js +28 -23
  76. package/dist/cjs/fork/useBackButton.native.js.map +1 -6
  77. package/dist/cjs/fork/useDocumentTitle.native.js +17 -15
  78. package/dist/cjs/fork/useDocumentTitle.native.js.map +1 -6
  79. package/dist/cjs/fork/useLinking.native.js +111 -100
  80. package/dist/cjs/fork/useLinking.native.js.map +1 -6
  81. package/dist/cjs/fork/useThenable.native.js +41 -44
  82. package/dist/cjs/fork/useThenable.native.js.map +1 -6
  83. package/dist/cjs/fork/validatePathConfig.native.js +48 -49
  84. package/dist/cjs/fork/validatePathConfig.native.js.map +1 -6
  85. package/dist/cjs/getReactNavigationConfig.native.js +36 -39
  86. package/dist/cjs/getReactNavigationConfig.native.js.map +1 -6
  87. package/dist/cjs/getURL.native.js +25 -17
  88. package/dist/cjs/getURL.native.js.map +1 -6
  89. package/dist/cjs/head/Head.android.js +20 -16
  90. package/dist/cjs/head/Head.android.js.map +1 -6
  91. package/dist/cjs/head/Head.ios.js +162 -156
  92. package/dist/cjs/head/Head.ios.js.map +1 -6
  93. package/dist/cjs/head/Head.native.js +24 -18
  94. package/dist/cjs/head/Head.native.js.map +1 -6
  95. package/dist/cjs/head/HeadModule.native.js +21 -16
  96. package/dist/cjs/head/HeadModule.native.js.map +1 -6
  97. package/dist/cjs/head/index.native.js +13 -12
  98. package/dist/cjs/head/index.native.js.map +1 -6
  99. package/dist/cjs/head/types.native.js +9 -5
  100. package/dist/cjs/head/types.native.js.map +1 -6
  101. package/dist/cjs/head/url.js +2 -2
  102. package/dist/cjs/head/url.js.map +1 -1
  103. package/dist/cjs/head/url.native.js +23 -20
  104. package/dist/cjs/head/url.native.js.map +1 -6
  105. package/dist/cjs/hooks.native.js +62 -67
  106. package/dist/cjs/hooks.native.js.map +1 -6
  107. package/dist/cjs/href.native.js +18 -16
  108. package/dist/cjs/href.native.js.map +1 -6
  109. package/dist/cjs/import-mode/index.android.js +18 -10
  110. package/dist/cjs/import-mode/index.android.js.map +1 -6
  111. package/dist/cjs/import-mode/index.ios.js +18 -10
  112. package/dist/cjs/import-mode/index.ios.js.map +1 -6
  113. package/dist/cjs/import-mode/index.native.js +16 -9
  114. package/dist/cjs/import-mode/index.native.js.map +1 -6
  115. package/dist/cjs/index.native.js +57 -63
  116. package/dist/cjs/index.native.js.map +1 -6
  117. package/dist/cjs/interfaces/router.native.js +17 -14
  118. package/dist/cjs/interfaces/router.native.js.map +1 -6
  119. package/dist/cjs/layouts/Drawer.native.js +22 -15
  120. package/dist/cjs/layouts/Drawer.native.js.map +1 -6
  121. package/dist/cjs/layouts/Stack.native.js +22 -15
  122. package/dist/cjs/layouts/Stack.native.js.map +1 -6
  123. package/dist/cjs/layouts/Tabs.native.js +76 -63
  124. package/dist/cjs/layouts/Tabs.native.js.map +1 -6
  125. package/dist/cjs/layouts/withLayoutContext.native.js +67 -56
  126. package/dist/cjs/layouts/withLayoutContext.native.js.map +1 -6
  127. package/dist/cjs/link/Link.native.js +94 -89
  128. package/dist/cjs/link/Link.native.js.map +1 -6
  129. package/dist/cjs/link/Redirect.native.js +25 -20
  130. package/dist/cjs/link/Redirect.native.js.map +1 -6
  131. package/dist/cjs/link/href.native.js +42 -38
  132. package/dist/cjs/link/href.native.js.map +1 -6
  133. package/dist/cjs/link/linking.native.js +63 -61
  134. package/dist/cjs/link/linking.native.js.map +1 -6
  135. package/dist/cjs/link/path.native.js +34 -38
  136. package/dist/cjs/link/path.native.js.map +1 -6
  137. package/dist/cjs/link/useLinkTo.native.js +36 -30
  138. package/dist/cjs/link/useLinkTo.native.js.map +1 -6
  139. package/dist/cjs/link/useLoadedNavigation.native.js +40 -40
  140. package/dist/cjs/link/useLoadedNavigation.native.js.map +1 -6
  141. package/dist/cjs/metro-config/getViteMetroPluginOptions.native.js +115 -112
  142. package/dist/cjs/metro-config/getViteMetroPluginOptions.native.js.map +1 -6
  143. package/dist/cjs/polyfills-mobile.native.js +28 -15
  144. package/dist/cjs/polyfills-mobile.native.js.map +1 -6
  145. package/dist/cjs/polyfills-server.native.js +19 -13
  146. package/dist/cjs/polyfills-server.native.js.map +1 -6
  147. package/dist/cjs/render.native.js +16 -13
  148. package/dist/cjs/render.native.js.map +1 -6
  149. package/dist/cjs/router/FlagsContext.native.js +19 -15
  150. package/dist/cjs/router/FlagsContext.native.js.map +1 -6
  151. package/dist/cjs/router/Route.native.js +39 -28
  152. package/dist/cjs/router/Route.native.js.map +1 -6
  153. package/dist/cjs/router/RouteInfoContext.native.js +37 -21
  154. package/dist/cjs/router/RouteInfoContext.native.js.map +1 -6
  155. package/dist/cjs/router/RouterStore.native.js +9 -5
  156. package/dist/cjs/router/RouterStore.native.js.map +1 -6
  157. package/dist/cjs/router/createRoute.native.js +31 -26
  158. package/dist/cjs/router/createRoute.native.js.map +1 -6
  159. package/dist/cjs/router/filterRootHTML.native.js +40 -24
  160. package/dist/cjs/router/filterRootHTML.native.js.map +1 -6
  161. package/dist/cjs/router/getLinkingConfig.native.js +24 -21
  162. package/dist/cjs/router/getLinkingConfig.native.js.map +1 -6
  163. package/dist/cjs/router/getNormalizedStatePath.native.js +32 -28
  164. package/dist/cjs/router/getNormalizedStatePath.native.js.map +1 -6
  165. package/dist/cjs/router/getRoutes.native.js +261 -273
  166. package/dist/cjs/router/getRoutes.native.js.map +1 -6
  167. package/dist/cjs/router/glob-patterns.native.js +21 -24
  168. package/dist/cjs/router/glob-patterns.native.js.map +1 -6
  169. package/dist/cjs/router/imperative-api.native.js +39 -32
  170. package/dist/cjs/router/imperative-api.native.js.map +1 -6
  171. package/dist/cjs/router/lastAction.native.js +24 -20
  172. package/dist/cjs/router/lastAction.native.js.map +1 -6
  173. package/dist/cjs/router/matchers.native.js +18 -26
  174. package/dist/cjs/router/matchers.native.js.map +1 -6
  175. package/dist/cjs/router/matchers.test.native.js +19 -17
  176. package/dist/cjs/router/matchers.test.native.js.map +1 -6
  177. package/dist/cjs/router/router.native.js +156 -150
  178. package/dist/cjs/router/router.native.js.map +1 -6
  179. package/dist/cjs/router/serverLocationContext.native.js +19 -15
  180. package/dist/cjs/router/serverLocationContext.native.js.map +1 -6
  181. package/dist/cjs/router/sortRoutes.native.js +37 -44
  182. package/dist/cjs/router/sortRoutes.native.js.map +1 -6
  183. package/dist/cjs/router/useInitializeOneRouter.native.js +28 -20
  184. package/dist/cjs/router/useInitializeOneRouter.native.js.map +1 -6
  185. package/dist/cjs/router/useNavigation.native.js +42 -35
  186. package/dist/cjs/router/useNavigation.native.js.map +1 -6
  187. package/dist/cjs/router/useScreens.native.js +280 -248
  188. package/dist/cjs/router/useScreens.native.js.map +1 -6
  189. package/dist/cjs/router/useViteRoutes.native.js +36 -31
  190. package/dist/cjs/router/useViteRoutes.native.js.map +1 -6
  191. package/dist/cjs/router/utils/getNavigateAction.native.js +33 -23
  192. package/dist/cjs/router/utils/getNavigateAction.native.js.map +1 -6
  193. package/dist/cjs/router/utils/getNavigateAction.test.native.js +142 -197
  194. package/dist/cjs/router/utils/getNavigateAction.test.native.js.map +1 -6
  195. package/dist/cjs/serve-worker.native.js +25 -16
  196. package/dist/cjs/serve-worker.native.js.map +1 -6
  197. package/dist/cjs/serve.native.js +50 -25
  198. package/dist/cjs/serve.native.js.map +1 -6
  199. package/dist/cjs/server/ServerContextScript.native.js +31 -26
  200. package/dist/cjs/server/ServerContextScript.native.js.map +1 -6
  201. package/dist/cjs/server/createRoutesManifest.native.js +26 -23
  202. package/dist/cjs/server/createRoutesManifest.native.js.map +1 -6
  203. package/dist/cjs/server/getServerManifest.native.js +107 -87
  204. package/dist/cjs/server/getServerManifest.native.js.map +1 -6
  205. package/dist/cjs/server/oneServe.native.js +199 -132
  206. package/dist/cjs/server/oneServe.native.js.map +1 -6
  207. package/dist/cjs/server/setServerGlobals.native.js +17 -14
  208. package/dist/cjs/server/setServerGlobals.native.js.map +1 -6
  209. package/dist/cjs/server/setupBuildOptions.native.js +17 -14
  210. package/dist/cjs/server/setupBuildOptions.native.js.map +1 -6
  211. package/dist/cjs/server/setupServerGlobals.native.js +3 -2
  212. package/dist/cjs/server/setupServerGlobals.native.js.map +1 -6
  213. package/dist/cjs/server-render.native.js +39 -29
  214. package/dist/cjs/server-render.native.js.map +1 -6
  215. package/dist/cjs/setup.native.js.map +1 -6
  216. package/dist/cjs/testing-utils.native.js +39 -41
  217. package/dist/cjs/testing-utils.native.js.map +1 -6
  218. package/dist/cjs/typed-routes/generateRouteTypes.native.js +36 -22
  219. package/dist/cjs/typed-routes/generateRouteTypes.native.js.map +1 -6
  220. package/dist/cjs/typed-routes/getTypedRoutesDeclarationFile.native.js +53 -47
  221. package/dist/cjs/typed-routes/getTypedRoutesDeclarationFile.native.js.map +1 -6
  222. package/dist/cjs/types.native.js +9 -5
  223. package/dist/cjs/types.native.js.map +1 -6
  224. package/dist/cjs/useFocusEffect.native.js +39 -36
  225. package/dist/cjs/useFocusEffect.native.js.map +1 -6
  226. package/dist/cjs/useLoader.native.js +67 -52
  227. package/dist/cjs/useLoader.native.js.map +1 -6
  228. package/dist/cjs/useServerHeadInsertion.native.js +32 -25
  229. package/dist/cjs/useServerHeadInsertion.native.js.map +1 -6
  230. package/dist/cjs/utils/assertIsReady.native.js +18 -16
  231. package/dist/cjs/utils/assertIsReady.native.js.map +1 -6
  232. package/dist/cjs/utils/cleanUrl.native.js +26 -19
  233. package/dist/cjs/utils/cleanUrl.native.js.map +1 -6
  234. package/dist/cjs/utils/dynamicImport.native.js +18 -15
  235. package/dist/cjs/utils/dynamicImport.native.js.map +1 -6
  236. package/dist/cjs/utils/ensureExists.native.js +18 -16
  237. package/dist/cjs/utils/ensureExists.native.js.map +1 -6
  238. package/dist/cjs/utils/existsAsync.native.js +27 -23
  239. package/dist/cjs/utils/existsAsync.native.js.map +1 -6
  240. package/dist/cjs/utils/getPageExport.native.js +34 -30
  241. package/dist/cjs/utils/getPageExport.native.js.map +1 -6
  242. package/dist/cjs/utils/getPathnameFromFilePath.native.js +36 -27
  243. package/dist/cjs/utils/getPathnameFromFilePath.native.js.map +1 -6
  244. package/dist/cjs/utils/getRouterRootFromOneOptions.native.js +17 -14
  245. package/dist/cjs/utils/getRouterRootFromOneOptions.native.js.map +1 -6
  246. package/dist/cjs/utils/globDir.native.js +24 -18
  247. package/dist/cjs/utils/globDir.native.js.map +1 -6
  248. package/dist/cjs/utils/hashString.native.js +23 -17
  249. package/dist/cjs/utils/hashString.native.js.map +1 -6
  250. package/dist/cjs/utils/isResponse.native.js +21 -15
  251. package/dist/cjs/utils/isResponse.native.js.map +1 -6
  252. package/dist/cjs/utils/isRolldown.native.js +24 -19
  253. package/dist/cjs/utils/isRolldown.native.js.map +1 -6
  254. package/dist/cjs/utils/isStatus.native.js +17 -14
  255. package/dist/cjs/utils/isStatus.native.js.map +1 -6
  256. package/dist/cjs/utils/platform.native.js +17 -14
  257. package/dist/cjs/utils/platform.native.js.map +1 -6
  258. package/dist/cjs/utils/promiseWithResolvers.native.js +22 -17
  259. package/dist/cjs/utils/promiseWithResolvers.native.js.map +1 -6
  260. package/dist/cjs/utils/rand.native.js +18 -15
  261. package/dist/cjs/utils/rand.native.js.map +1 -6
  262. package/dist/cjs/utils/redirect.native.js +26 -21
  263. package/dist/cjs/utils/redirect.native.js.map +1 -6
  264. package/dist/cjs/utils/removeSearch.native.js +17 -14
  265. package/dist/cjs/utils/removeSearch.native.js.map +1 -6
  266. package/dist/cjs/utils/removeUndefined.native.js +18 -16
  267. package/dist/cjs/utils/removeUndefined.native.js.map +1 -6
  268. package/dist/cjs/utils/toAbsolute.native.js +21 -17
  269. package/dist/cjs/utils/toAbsolute.native.js.map +1 -6
  270. package/dist/cjs/utils/url.native.js +17 -16
  271. package/dist/cjs/utils/url.native.js.map +1 -6
  272. package/dist/cjs/utils/useConstant.native.js +26 -21
  273. package/dist/cjs/utils/useConstant.native.js.map +1 -6
  274. package/dist/cjs/utils/weakKey.native.js +25 -21
  275. package/dist/cjs/utils/weakKey.native.js.map +1 -6
  276. package/dist/cjs/utils/weakMemo.native.js +23 -18
  277. package/dist/cjs/utils/weakMemo.native.js.map +1 -6
  278. package/dist/cjs/utils/withStaticProperties.native.js +48 -35
  279. package/dist/cjs/utils/withStaticProperties.native.js.map +1 -6
  280. package/dist/cjs/vercel/build/buildVercelOutputDirectory.native.js +120 -95
  281. package/dist/cjs/vercel/build/buildVercelOutputDirectory.native.js.map +1 -6
  282. package/dist/cjs/vercel/build/config/vc-build-output-config-base.native.js +17 -14
  283. package/dist/cjs/vercel/build/config/vc-build-output-config-base.native.js.map +1 -6
  284. package/dist/cjs/vercel/build/config/vc-config-base.native.js +17 -14
  285. package/dist/cjs/vercel/build/config/vc-config-base.native.js.map +1 -6
  286. package/dist/cjs/vercel/build/config/vc-package-base.native.js +17 -14
  287. package/dist/cjs/vercel/build/config/vc-package-base.native.js.map +1 -6
  288. package/dist/cjs/vercel/build/generate/createApiServerlessFunction.native.js +60 -71
  289. package/dist/cjs/vercel/build/generate/createApiServerlessFunction.native.js.map +1 -6
  290. package/dist/cjs/vercel/build/generate/createSsrServerlessFunction.native.js +36 -24
  291. package/dist/cjs/vercel/build/generate/createSsrServerlessFunction.native.js.map +1 -6
  292. package/dist/cjs/vercel/build/getPathFromRoute.native.js +18 -15
  293. package/dist/cjs/vercel/build/getPathFromRoute.native.js.map +1 -6
  294. package/dist/cjs/views/EmptyRoute.native.js +19 -15
  295. package/dist/cjs/views/EmptyRoute.native.js.map +1 -6
  296. package/dist/cjs/views/ErrorBoundary.native.js +33 -19
  297. package/dist/cjs/views/ErrorBoundary.native.js.map +1 -6
  298. package/dist/cjs/views/LoadProgressBar.native.js +75 -67
  299. package/dist/cjs/views/LoadProgressBar.native.js.map +1 -6
  300. package/dist/cjs/views/Navigator.native.js +99 -64
  301. package/dist/cjs/views/Navigator.native.js.map +1 -6
  302. package/dist/cjs/views/OneStackRouter.native.js +27 -23
  303. package/dist/cjs/views/OneStackRouter.native.js.map +1 -6
  304. package/dist/cjs/views/PreloadLinks.native.js +16 -13
  305. package/dist/cjs/views/PreloadLinks.native.js.map +1 -6
  306. package/dist/cjs/views/RootErrorBoundary.native.js +54 -53
  307. package/dist/cjs/views/RootErrorBoundary.native.js.map +1 -6
  308. package/dist/cjs/views/Screen.native.js +28 -22
  309. package/dist/cjs/views/Screen.native.js.map +1 -6
  310. package/dist/cjs/views/ScrollBehavior.native.js +54 -43
  311. package/dist/cjs/views/ScrollBehavior.native.js.map +1 -6
  312. package/dist/cjs/views/Try.native.js +60 -54
  313. package/dist/cjs/views/Try.native.js.map +1 -6
  314. package/dist/cjs/vite/DevHead.native.js +19 -15
  315. package/dist/cjs/vite/DevHead.native.js.map +1 -6
  316. package/dist/cjs/vite/constants.native.js +20 -17
  317. package/dist/cjs/vite/constants.native.js.map +1 -6
  318. package/dist/cjs/vite/customNodeExternals.native.js +35 -25
  319. package/dist/cjs/vite/customNodeExternals.native.js.map +1 -6
  320. package/dist/cjs/vite/ensureTsConfig.native.js +21 -16
  321. package/dist/cjs/vite/ensureTsConfig.native.js.map +1 -6
  322. package/dist/cjs/vite/findDepsToOptimize.native.js +46 -43
  323. package/dist/cjs/vite/findDepsToOptimize.native.js.map +1 -6
  324. package/dist/cjs/vite/getManifest.native.js +23 -16
  325. package/dist/cjs/vite/getManifest.native.js.map +1 -6
  326. package/dist/cjs/vite/loadConfig.native.js +22 -22
  327. package/dist/cjs/vite/loadConfig.native.js.map +1 -6
  328. package/dist/cjs/vite/makePluginWebOnly.native.js +20 -19
  329. package/dist/cjs/vite/makePluginWebOnly.native.js.map +1 -6
  330. package/dist/cjs/vite/one-server-only.native.js +24 -33
  331. package/dist/cjs/vite/one-server-only.native.js.map +1 -6
  332. package/dist/cjs/vite/one.native.js +202 -181
  333. package/dist/cjs/vite/one.native.js.map +1 -6
  334. package/dist/cjs/vite/plugins/SSRCSSPlugin.native.js +75 -74
  335. package/dist/cjs/vite/plugins/SSRCSSPlugin.native.js.map +1 -6
  336. package/dist/cjs/vite/plugins/clientTreeShakePlugin.native.js +69 -56
  337. package/dist/cjs/vite/plugins/clientTreeShakePlugin.native.js.map +1 -6
  338. package/dist/cjs/vite/plugins/fileSystemRouterPlugin.native.js +154 -108
  339. package/dist/cjs/vite/plugins/fileSystemRouterPlugin.native.js.map +1 -6
  340. package/dist/cjs/vite/plugins/fixDependenciesPlugin.native.js +25 -16
  341. package/dist/cjs/vite/plugins/fixDependenciesPlugin.native.js.map +1 -6
  342. package/dist/cjs/vite/plugins/generateFileSystemRouteTypesPlugin.native.js +33 -24
  343. package/dist/cjs/vite/plugins/generateFileSystemRouteTypesPlugin.native.js.map +1 -6
  344. package/dist/cjs/vite/plugins/removeReactNativeWebAnimatedPlugin.native.js +26 -24
  345. package/dist/cjs/vite/plugins/removeReactNativeWebAnimatedPlugin.native.js.map +1 -6
  346. package/dist/cjs/vite/plugins/useDomPlugin.native.js +32 -26
  347. package/dist/cjs/vite/plugins/useDomPlugin.native.js.map +1 -6
  348. package/dist/cjs/vite/plugins/virtualEntryConstants.native.js +24 -20
  349. package/dist/cjs/vite/plugins/virtualEntryConstants.native.js.map +1 -6
  350. package/dist/cjs/vite/plugins/virtualEntryPlugin.native.js +38 -45
  351. package/dist/cjs/vite/plugins/virtualEntryPlugin.native.js.map +1 -6
  352. package/dist/cjs/vite/replaceLoader.native.js +26 -20
  353. package/dist/cjs/vite/replaceLoader.native.js.map +1 -6
  354. package/dist/cjs/vite/resolveResponse.native.js +59 -42
  355. package/dist/cjs/vite/resolveResponse.native.js.map +1 -6
  356. package/dist/cjs/vite/types.native.js +9 -5
  357. package/dist/cjs/vite/types.native.js.map +1 -6
  358. package/dist/cjs/vite.native.js +26 -22
  359. package/dist/cjs/vite.native.js.map +1 -6
  360. package/dist/cjs/zero/getQueryKey.native.js +18 -15
  361. package/dist/cjs/zero/getQueryKey.native.js.map +1 -6
  362. package/dist/cjs/zero/isZeroQuery.native.js +23 -15
  363. package/dist/cjs/zero/isZeroQuery.native.js.map +1 -6
  364. package/dist/cjs/zero/resolveQuery.native.js +23 -19
  365. package/dist/cjs/zero/resolveQuery.native.js.map +1 -6
  366. package/dist/cjs/zero/subscribeToQuery.native.js +18 -15
  367. package/dist/cjs/zero/subscribeToQuery.native.js.map +1 -6
  368. package/dist/cjs/zero/types.native.js +9 -5
  369. package/dist/cjs/zero/types.native.js.map +1 -6
  370. package/dist/cjs/zero/useQuery.js +2 -2
  371. package/dist/cjs/zero/useQuery.js.map +1 -1
  372. package/dist/cjs/zero/useQuery.native.js +30 -19
  373. package/dist/cjs/zero/useQuery.native.js.map +1 -6
  374. package/dist/cjs/zero/useQueryZero.native.js +35 -34
  375. package/dist/cjs/zero/useQueryZero.native.js.map +1 -6
  376. package/dist/cjs/zero.native.js +20 -17
  377. package/dist/cjs/zero.native.js.map +1 -6
  378. package/dist/esm/cli/build.native.js +2 -2
  379. package/dist/esm/cli/build.native.js.map +1 -1
  380. package/dist/esm/cli/buildPage.native.js +5 -2
  381. package/dist/esm/cli/buildPage.native.js.map +1 -1
  382. package/dist/esm/cli/label-process.native.js +1 -1
  383. package/dist/esm/cli/main.native.js +2 -2
  384. package/dist/esm/cli.native.js +3 -3
  385. package/dist/esm/createApp.native.js.map +1 -1
  386. package/dist/esm/fork/__tests__/getPathFromState.test.js +3 -3
  387. package/dist/esm/fork/__tests__/getPathFromState.test.js.map +1 -1
  388. package/dist/esm/fork/__tests__/getPathFromState.test.mjs +9 -10
  389. package/dist/esm/fork/__tests__/getPathFromState.test.mjs.map +1 -1
  390. package/dist/esm/fork/__tests__/getPathFromState.test.native.js.map +1 -1
  391. package/dist/esm/fork/__tests__/getStateFromPath.test.js +5 -5
  392. package/dist/esm/fork/__tests__/getStateFromPath.test.js.map +1 -1
  393. package/dist/esm/fork/__tests__/getStateFromPath.test.mjs +5 -7
  394. package/dist/esm/fork/__tests__/getStateFromPath.test.mjs.map +1 -1
  395. package/dist/esm/fork/__tests__/getStateFromPath.test.native.js.map +1 -1
  396. package/dist/esm/fork/getStateFromPath.native.js +6 -1
  397. package/dist/esm/fork/getStateFromPath.native.js.map +1 -1
  398. package/dist/esm/fork/useBackButton.native.js.map +1 -1
  399. package/dist/esm/fork/useDocumentTitle.native.js.map +1 -1
  400. package/dist/esm/fork/useLinking.native.js +6 -1
  401. package/dist/esm/fork/useLinking.native.js.map +1 -1
  402. package/dist/esm/fork/validatePathConfig.native.js +7 -2
  403. package/dist/esm/fork/validatePathConfig.native.js.map +1 -1
  404. package/dist/esm/getURL.native.js.map +1 -1
  405. package/dist/esm/head/Head.android.js.map +1 -1
  406. package/dist/esm/head/Head.ios.js +7 -2
  407. package/dist/esm/head/Head.ios.js.map +1 -1
  408. package/dist/esm/head/url.js +2 -2
  409. package/dist/esm/head/url.js.map +1 -1
  410. package/dist/esm/head/url.native.js.map +1 -1
  411. package/dist/esm/import-mode/index.android.js.map +1 -1
  412. package/dist/esm/import-mode/index.ios.js.map +1 -1
  413. package/dist/esm/import-mode/index.native.js.map +1 -1
  414. package/dist/esm/metro-config/getViteMetroPluginOptions.native.js +2 -2
  415. package/dist/esm/metro-config/getViteMetroPluginOptions.native.js.map +1 -1
  416. package/dist/esm/render.native.js.map +1 -1
  417. package/dist/esm/router/filterRootHTML.native.js +6 -1
  418. package/dist/esm/router/filterRootHTML.native.js.map +1 -1
  419. package/dist/esm/router/router.native.js +6 -1
  420. package/dist/esm/router/router.native.js.map +1 -1
  421. package/dist/esm/router/useScreens.native.js +7 -4
  422. package/dist/esm/router/useScreens.native.js.map +1 -1
  423. package/dist/esm/server/oneServe.native.js +1 -1
  424. package/dist/esm/testing-utils.native.js +1 -1
  425. package/dist/esm/typed-routes/generateRouteTypes.native.js +2 -2
  426. package/dist/esm/useLoader.native.js +5 -2
  427. package/dist/esm/useLoader.native.js.map +1 -1
  428. package/dist/esm/utils/existsAsync.native.js +1 -1
  429. package/dist/esm/utils/getPathnameFromFilePath.native.js +1 -1
  430. package/dist/esm/utils/isResponse.native.js +4 -1
  431. package/dist/esm/utils/isResponse.native.js.map +1 -1
  432. package/dist/esm/utils/toAbsolute.native.js +1 -1
  433. package/dist/esm/utils/withStaticProperties.native.js +6 -1
  434. package/dist/esm/utils/withStaticProperties.native.js.map +1 -1
  435. package/dist/esm/vercel/build/buildVercelOutputDirectory.native.js +1 -1
  436. package/dist/esm/vercel/build/generate/createApiServerlessFunction.native.js +1 -1
  437. package/dist/esm/vercel/build/generate/createSsrServerlessFunction.native.js +1 -1
  438. package/dist/esm/views/PreloadLinks.native.js.map +1 -1
  439. package/dist/esm/views/RootErrorBoundary.native.js +4 -1
  440. package/dist/esm/vite/customNodeExternals.native.js +2 -2
  441. package/dist/esm/vite/ensureTsConfig.native.js +1 -1
  442. package/dist/esm/vite/findDepsToOptimize.native.js +3 -3
  443. package/dist/esm/vite/one-server-only.native.js.map +1 -1
  444. package/dist/esm/vite/one.native.js +8 -3
  445. package/dist/esm/vite/one.native.js.map +1 -1
  446. package/dist/esm/vite/plugins/clientTreeShakePlugin.native.js +8 -5
  447. package/dist/esm/vite/plugins/clientTreeShakePlugin.native.js.map +1 -1
  448. package/dist/esm/vite/plugins/fileSystemRouterPlugin.native.js +8 -5
  449. package/dist/esm/vite/plugins/fileSystemRouterPlugin.native.js.map +1 -1
  450. package/dist/esm/vite/plugins/fixDependenciesPlugin.native.js +6 -1
  451. package/dist/esm/vite/plugins/fixDependenciesPlugin.native.js.map +1 -1
  452. package/dist/esm/vite/plugins/generateFileSystemRouteTypesPlugin.native.js +1 -1
  453. package/dist/esm/vite/plugins/generateFileSystemRouteTypesPlugin.native.js.map +1 -1
  454. package/dist/esm/vite/plugins/useDomPlugin.native.js +1 -1
  455. package/dist/esm/vite/resolveResponse.native.js +9 -1
  456. package/dist/esm/vite/resolveResponse.native.js.map +1 -1
  457. package/dist/esm/zero/isZeroQuery.native.js +6 -1
  458. package/dist/esm/zero/isZeroQuery.native.js.map +1 -1
  459. package/dist/esm/zero/useQuery.js +2 -2
  460. package/dist/esm/zero/useQuery.js.map +1 -1
  461. package/dist/esm/zero/useQuery.native.js.map +1 -1
  462. package/package.json +10 -10
@@ -1,138 +1,193 @@
1
1
  "use strict";
2
+
2
3
  var __create = Object.create;
3
4
  var __defProp = Object.defineProperty;
4
5
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
6
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __getProtoOf = Object.getPrototypeOf,
8
+ __hasOwnProp = Object.prototype.hasOwnProperty;
7
9
  var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: !0 });
10
- }, __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from == "object" || typeof from == "function")
12
- for (let key of __getOwnPropNames(from))
13
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- return to;
15
- };
10
+ for (var name in all) __defProp(target, name, {
11
+ get: all[name],
12
+ enumerable: !0
13
+ });
14
+ },
15
+ __copyProps = (to, from, except, desc) => {
16
+ if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
17
+ get: () => from[key],
18
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
19
+ });
20
+ return to;
21
+ };
16
22
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
17
23
  // If the importer is in node compatibility mode or this is not an ESM
18
24
  // file that has been converted to a CommonJS file using a Babel-
19
25
  // compatible transform (i.e. "__esModule" has not been set), then set
20
26
  // "default" to the CommonJS "module.exports" for node compatibility.
21
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
22
- mod
23
- )), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
27
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
28
+ value: mod,
29
+ enumerable: !0
30
+ }) : target, mod)),
31
+ __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
32
+ value: !0
33
+ }), mod);
24
34
  var build_exports = {};
25
35
  __export(build_exports, {
26
36
  build: () => build
27
37
  });
28
38
  module.exports = __toCommonJS(build_exports);
29
- var import_fs_extra = __toESM(require("fs-extra"), 1), import_micromatch = __toESM(require("micromatch"), 1), import_node_module = require("node:module"), import_node_path = __toESM(require("node:path"), 1), import_vite = require("vite"), import_vxrn = require("vxrn"), constants = __toESM(require("../constants"), 1), import_setServerGlobals = require("../server/setServerGlobals"), import_toAbsolute = require("../utils/toAbsolute"), import_getManifest = require("../vite/getManifest"), import_loadConfig = require("../vite/loadConfig"), import_one_server_only = require("../vite/one-server-only"), import_buildVercelOutputDirectory = require("../vercel/build/buildVercelOutputDirectory"), import_getRouterRootFromOneOptions = require("../utils/getRouterRootFromOneOptions"), import_buildPage = require("./buildPage"), import_checkNodeVersion = require("./checkNodeVersion"), import_label_process = require("./label-process"), import_getPathnameFromFilePath = require("../utils/getPathnameFromFilePath");
39
+ var import_fs_extra = __toESM(require("fs-extra"), 1),
40
+ import_micromatch = __toESM(require("micromatch"), 1),
41
+ import_module = require("module"),
42
+ import_path = __toESM(require("path"), 1),
43
+ import_vite = require("vite"),
44
+ import_vxrn = require("vxrn"),
45
+ constants = __toESM(require("../constants.native.js"), 1),
46
+ import_setServerGlobals = require("../server/setServerGlobals.native.js"),
47
+ import_toAbsolute = require("../utils/toAbsolute.native.js"),
48
+ import_getManifest = require("../vite/getManifest.native.js"),
49
+ import_loadConfig = require("../vite/loadConfig.native.js"),
50
+ import_one_server_only = require("../vite/one-server-only.native.js"),
51
+ import_buildVercelOutputDirectory = require("../vercel/build/buildVercelOutputDirectory.native.js"),
52
+ import_getRouterRootFromOneOptions = require("../utils/getRouterRootFromOneOptions.native.js"),
53
+ import_buildPage = require("./buildPage.native.js"),
54
+ import_checkNodeVersion = require("./checkNodeVersion.native.js"),
55
+ import_label_process = require("./label-process.native.js"),
56
+ import_getPathnameFromFilePath = require("../utils/getPathnameFromFilePath.native.js");
30
57
  const import_meta = {};
31
- var { ensureDir, writeJSON } = import_fs_extra.default;
32
- process.on("uncaughtException", function(err) {
33
- console.error((err == null ? void 0 : err.message) || err);
58
+ var {
59
+ ensureDir,
60
+ writeJSON
61
+ } = import_fs_extra.default;
62
+ process.on("uncaughtException", function (err) {
63
+ console.error(err?.message || err);
34
64
  });
35
65
  async function build(args) {
36
66
  var _oneOptions_build, _oneOptions_build_server, _oneOptions_build1, _oneOptions_build2, _oneOptions_web;
37
67
  process.env.IS_VXRN_CLI = "true", process.env.NODE_ENV = "production", (0, import_label_process.labelProcess)("build"), (0, import_checkNodeVersion.checkNodeVersion)(), (0, import_setServerGlobals.setServerGlobals)();
38
- var { oneOptions } = await (0, import_loadConfig.loadUserOneOptions)("build"), routerRoot = (0, import_getRouterRootFromOneOptions.getRouterRootFromOneOptions)(oneOptions), routerRootRegexp = new RegExp(`^${routerRoot}`), manifest = (0, import_getManifest.getManifest)({
39
- routerRoot
40
- }), _oneOptions_build_server_outputFormat, serverOutputFormat = ((_oneOptions_build = oneOptions.build) === null || _oneOptions_build === void 0 ? void 0 : _oneOptions_build.server) === !1 ? "esm" : (_oneOptions_build_server_outputFormat = (_oneOptions_build1 = oneOptions.build) === null || _oneOptions_build1 === void 0 || (_oneOptions_build_server = _oneOptions_build1.server) === null || _oneOptions_build_server === void 0 ? void 0 : _oneOptions_build_server.outputFormat) !== null && _oneOptions_build_server_outputFormat !== void 0 ? _oneOptions_build_server_outputFormat : "esm", vxrnOutput = await (0, import_vxrn.build)({
41
- server: oneOptions.server,
42
- build: {
43
- analyze: !0,
44
- server: ((_oneOptions_build2 = oneOptions.build) === null || _oneOptions_build2 === void 0 ? void 0 : _oneOptions_build2.server) === !1 ? !1 : {
45
- outputFormat: serverOutputFormat
68
+ var {
69
+ oneOptions
70
+ } = await (0, import_loadConfig.loadUserOneOptions)("build"),
71
+ routerRoot = (0, import_getRouterRootFromOneOptions.getRouterRootFromOneOptions)(oneOptions),
72
+ routerRootRegexp = new RegExp(`^${routerRoot}`),
73
+ manifest = (0, import_getManifest.getManifest)({
74
+ routerRoot
75
+ }),
76
+ _oneOptions_build_server_outputFormat,
77
+ serverOutputFormat = ((_oneOptions_build = oneOptions.build) === null || _oneOptions_build === void 0 ? void 0 : _oneOptions_build.server) === !1 ? "esm" : (_oneOptions_build_server_outputFormat = (_oneOptions_build1 = oneOptions.build) === null || _oneOptions_build1 === void 0 || (_oneOptions_build_server = _oneOptions_build1.server) === null || _oneOptions_build_server === void 0 ? void 0 : _oneOptions_build_server.outputFormat) !== null && _oneOptions_build_server_outputFormat !== void 0 ? _oneOptions_build_server_outputFormat : "esm",
78
+ vxrnOutput = await (0, import_vxrn.build)({
79
+ server: oneOptions.server,
80
+ build: {
81
+ analyze: !0,
82
+ server: ((_oneOptions_build2 = oneOptions.build) === null || _oneOptions_build2 === void 0 ? void 0 : _oneOptions_build2.server) === !1 ? !1 : {
83
+ outputFormat: serverOutputFormat
84
+ }
46
85
  }
47
- }
48
- }, args);
49
- if (!vxrnOutput || args.platform !== "web")
50
- return;
51
- var options = await (0, import_vxrn.fillOptions)(vxrnOutput.options), { optimizeDeps } = (0, import_vxrn.getOptimizeDeps)("build"), apiBuildConfig = (0, import_vite.mergeConfig)(
52
- // feels like this should build off the *server* build config not web
53
- vxrnOutput.webBuildConfig,
86
+ }, args);
87
+ if (!vxrnOutput || args.platform !== "web") return;
88
+ var options = await (0, import_vxrn.fillOptions)(vxrnOutput.options),
54
89
  {
90
+ optimizeDeps
91
+ } = (0, import_vxrn.getOptimizeDeps)("build"),
92
+ apiBuildConfig = (0, import_vite.mergeConfig)(
93
+ // feels like this should build off the *server* build config not web
94
+ vxrnOutput.webBuildConfig, {
55
95
  configFile: !1,
56
96
  appType: "custom",
57
97
  optimizeDeps
58
- }
59
- );
98
+ });
60
99
  async function buildCustomRoutes(subFolder, routes) {
61
- var _oneOptions_build_api, _oneOptions_build3, _oneOptions_build_api1, _oneOptions_build12, _oneOptions_build_api2, _oneOptions_build22, input = routes.reduce(function(entries, param) {
62
- var { page, file } = param;
63
- return entries[page.slice(1) + ".js"] = (0, import_node_path.join)(routerRoot, file), entries;
64
- }, {}), _oneOptions_build_api_outputFormat, outputFormat = (_oneOptions_build_api_outputFormat = oneOptions == null || (_oneOptions_build3 = oneOptions.build) === null || _oneOptions_build3 === void 0 || (_oneOptions_build_api = _oneOptions_build3.api) === null || _oneOptions_build_api === void 0 ? void 0 : _oneOptions_build_api.outputFormat) !== null && _oneOptions_build_api_outputFormat !== void 0 ? _oneOptions_build_api_outputFormat : serverOutputFormat, treeshake = oneOptions == null || (_oneOptions_build12 = oneOptions.build) === null || _oneOptions_build12 === void 0 || (_oneOptions_build_api1 = _oneOptions_build12.api) === null || _oneOptions_build_api1 === void 0 ? void 0 : _oneOptions_build_api1.treeshake, mergedConfig = (0, import_vite.mergeConfig)(apiBuildConfig, {
65
- appType: "custom",
66
- configFile: !1,
67
- // plugins: [
68
- // nodeExternals({
69
- // exclude: optimizeDeps.include,
70
- // }) as any,
71
- // ],
72
- define: {
73
- ...vxrnOutput.processEnvDefines
74
- },
75
- ssr: {
76
- noExternal: !0,
77
- external: [
78
- "react",
79
- "react-dom"
80
- ],
81
- optimizeDeps
82
- },
83
- build: {
84
- ssr: !0,
85
- emptyOutDir: !1,
86
- outDir: `dist/${subFolder}`,
87
- copyPublicDir: !1,
88
- minify: !1,
89
- rollupOptions: {
90
- treeshake: treeshake ?? {
91
- moduleSideEffects: !1
92
- },
93
- plugins: [
100
+ var _oneOptions_build_api,
101
+ _oneOptions_build3,
102
+ _oneOptions_build_api1,
103
+ _oneOptions_build12,
104
+ _oneOptions_build_api2,
105
+ _oneOptions_build22,
106
+ input = routes.reduce(function (entries, param) {
107
+ var {
108
+ page,
109
+ file
110
+ } = param;
111
+ return entries[page.slice(1) + ".js"] = (0, import_path.join)(routerRoot, file), entries;
112
+ }, {}),
113
+ _oneOptions_build_api_outputFormat,
114
+ outputFormat = (_oneOptions_build_api_outputFormat = oneOptions == null || (_oneOptions_build3 = oneOptions.build) === null || _oneOptions_build3 === void 0 || (_oneOptions_build_api = _oneOptions_build3.api) === null || _oneOptions_build_api === void 0 ? void 0 : _oneOptions_build_api.outputFormat) !== null && _oneOptions_build_api_outputFormat !== void 0 ? _oneOptions_build_api_outputFormat : serverOutputFormat,
115
+ treeshake = oneOptions == null || (_oneOptions_build12 = oneOptions.build) === null || _oneOptions_build12 === void 0 || (_oneOptions_build_api1 = _oneOptions_build12.api) === null || _oneOptions_build_api1 === void 0 ? void 0 : _oneOptions_build_api1.treeshake,
116
+ mergedConfig = (0, import_vite.mergeConfig)(apiBuildConfig, {
117
+ appType: "custom",
118
+ configFile: !1,
119
+ // plugins: [
120
+ // nodeExternals({
121
+ // exclude: optimizeDeps.include,
122
+ // }) as any,
123
+ // ],
124
+ define: {
125
+ ...vxrnOutput.processEnvDefines
126
+ },
127
+ ssr: {
128
+ noExternal: !0,
129
+ external: ["react", "react-dom"],
130
+ optimizeDeps
131
+ },
132
+ build: {
133
+ ssr: !0,
134
+ emptyOutDir: !1,
135
+ outDir: `dist/${subFolder}`,
136
+ copyPublicDir: !1,
137
+ minify: !1,
138
+ rollupOptions: {
139
+ treeshake: treeshake ?? {
140
+ moduleSideEffects: !1
141
+ },
142
+ plugins: [
94
143
  // otherwise rollup is leaving commonjs-only top level imports...
95
- outputFormat === "esm" ? import_vxrn.rollupRemoveUnusedImportsPlugin : null
96
- ].filter(Boolean),
97
- // too many issues
98
- // treeshake: {
99
- // moduleSideEffects: false,
100
- // },
101
- // prevents it from shaking out the exports
102
- preserveEntrySignatures: "strict",
103
- input,
104
- external: function(id) {
105
- return !1;
106
- },
107
- output: {
108
- entryFileNames: "[name]",
109
- exports: "auto",
110
- ...outputFormat === "esm" ? {
111
- format: "esm",
112
- esModule: !0
113
- } : {
114
- format: "cjs",
115
- // Preserve folder structure and use .cjs extension
116
- entryFileNames: function(chunkInfo) {
117
- var name = chunkInfo.name.replace(/\.js$/, ".cjs");
118
- return name;
119
- },
120
- chunkFileNames: function(chunkInfo) {
121
- var dir = import_node_path.default.dirname(chunkInfo.name), name = import_node_path.default.basename(chunkInfo.name, import_node_path.default.extname(chunkInfo.name));
122
- return import_node_path.default.join(dir, `${name}-[hash].cjs`);
123
- },
124
- assetFileNames: function(assetInfo) {
125
- var _assetInfo_name, name = (_assetInfo_name = assetInfo.name) !== null && _assetInfo_name !== void 0 ? _assetInfo_name : "", dir = import_node_path.default.dirname(name), baseName = import_node_path.default.basename(name, import_node_path.default.extname(name)), ext = import_node_path.default.extname(name);
126
- return import_node_path.default.join(dir, `${baseName}-[hash]${ext}`);
127
- }
144
+ outputFormat === "esm" ? import_vxrn.rollupRemoveUnusedImportsPlugin : null].filter(Boolean),
145
+ // too many issues
146
+ // treeshake: {
147
+ // moduleSideEffects: false,
148
+ // },
149
+ // prevents it from shaking out the exports
150
+ preserveEntrySignatures: "strict",
151
+ input,
152
+ external: function (id) {
153
+ return !1;
154
+ },
155
+ output: {
156
+ entryFileNames: "[name]",
157
+ exports: "auto",
158
+ ...(outputFormat === "esm" ? {
159
+ format: "esm",
160
+ esModule: !0
161
+ } : {
162
+ format: "cjs",
163
+ // Preserve folder structure and use .cjs extension
164
+ entryFileNames: function (chunkInfo) {
165
+ var name = chunkInfo.name.replace(/\.js$/, ".cjs");
166
+ return name;
167
+ },
168
+ chunkFileNames: function (chunkInfo) {
169
+ var dir = import_path.default.dirname(chunkInfo.name),
170
+ name = import_path.default.basename(chunkInfo.name, import_path.default.extname(chunkInfo.name));
171
+ return import_path.default.join(dir, `${name}-[hash].cjs`);
172
+ },
173
+ assetFileNames: function (assetInfo) {
174
+ var _assetInfo_name,
175
+ name = (_assetInfo_name = assetInfo.name) !== null && _assetInfo_name !== void 0 ? _assetInfo_name : "",
176
+ dir = import_path.default.dirname(name),
177
+ baseName = import_path.default.basename(name, import_path.default.extname(name)),
178
+ ext = import_path.default.extname(name);
179
+ return import_path.default.join(dir, `${baseName}-[hash]${ext}`);
180
+ }
181
+ })
128
182
  }
129
183
  }
130
184
  }
131
- }
132
- }), userApiBuildConf = (_oneOptions_build22 = oneOptions.build) === null || _oneOptions_build22 === void 0 || (_oneOptions_build_api2 = _oneOptions_build22.api) === null || _oneOptions_build_api2 === void 0 ? void 0 : _oneOptions_build_api2.config, finalApiBuildConf = userApiBuildConf ? (0, import_vite.mergeConfig)(mergedConfig, userApiBuildConf) : mergedConfig, output = await (0, import_vite.build)(
185
+ }),
186
+ userApiBuildConf = (_oneOptions_build22 = oneOptions.build) === null || _oneOptions_build22 === void 0 || (_oneOptions_build_api2 = _oneOptions_build22.api) === null || _oneOptions_build_api2 === void 0 ? void 0 : _oneOptions_build_api2.config,
187
+ finalApiBuildConf = userApiBuildConf ? (0, import_vite.mergeConfig)(mergedConfig, userApiBuildConf) : mergedConfig,
188
+ output = await (0, import_vite.build)(
133
189
  // allow user merging api build config
134
- finalApiBuildConf
135
- );
190
+ finalApiBuildConf);
136
191
  return output;
137
192
  }
138
193
  var apiOutput = null;
@@ -144,139 +199,142 @@ async function build(args) {
144
199
  console.info(`
145
200
  \u{1F528} build middlewares
146
201
  `);
147
- var middlewareBuildInfo = await buildCustomRoutes("middlewares", manifest.middlewareRoutes), _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
202
+ var middlewareBuildInfo = await buildCustomRoutes("middlewares", manifest.middlewareRoutes),
203
+ _iteratorNormalCompletion = !0,
204
+ _didIteratorError = !1,
205
+ _iteratorError = void 0;
148
206
  try {
149
- for (var _loop = function() {
150
- var middleware = _step.value, absoluteRoot = (0, import_node_path.resolve)(process.cwd(), options.root), fullPath = (0, import_node_path.join)(absoluteRoot, routerRoot, middleware.file), outChunks = middlewareBuildInfo.output.filter(function(x) {
151
- return x.type === "chunk";
152
- }), chunk = outChunks.find(function(x) {
153
- return x.facadeModuleId === fullPath;
154
- });
155
- if (!chunk) throw new Error("internal err finding middleware");
156
- builtMiddlewares[middleware.file] = (0, import_node_path.join)("dist", "middlewares", chunk.fileName);
157
- }, _iterator = manifest.middlewareRoutes[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) _loop();
207
+ for (var _loop = function () {
208
+ var middleware = _step.value,
209
+ absoluteRoot = (0, import_path.resolve)(process.cwd(), options.root),
210
+ fullPath = (0, import_path.join)(absoluteRoot, routerRoot, middleware.file),
211
+ outChunks = middlewareBuildInfo.output.filter(function (x) {
212
+ return x.type === "chunk";
213
+ }),
214
+ chunk = outChunks.find(function (x) {
215
+ return x.facadeModuleId === fullPath;
216
+ });
217
+ if (!chunk) throw new Error("internal err finding middleware");
218
+ builtMiddlewares[middleware.file] = (0, import_path.join)("dist", "middlewares", chunk.fileName);
219
+ }, _iterator = manifest.middlewareRoutes[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) _loop();
158
220
  } catch (err) {
159
221
  _didIteratorError = !0, _iteratorError = err;
160
222
  } finally {
161
223
  try {
162
224
  !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
163
225
  } finally {
164
- if (_didIteratorError)
165
- throw _iteratorError;
226
+ if (_didIteratorError) throw _iteratorError;
166
227
  }
167
228
  }
168
229
  }
169
- globalThis.require = (0, import_node_module.createRequire)((0, import_node_path.join)(import_meta.url, ".."));
170
- var assets = [], builtRoutes = [];
230
+ globalThis.require = (0, import_module.createRequire)((0, import_path.join)(import_meta.url, ".."));
231
+ var assets = [],
232
+ builtRoutes = [];
171
233
  console.info(`
172
234
  \u{1F528} build static routes
173
235
  `);
174
- var staticDir = (0, import_node_path.join)("dist/static"), clientDir = (0, import_node_path.join)("dist/client");
175
- if (await ensureDir(staticDir), !vxrnOutput.serverOutput)
176
- throw new Error("No server output");
177
- var outputEntries = [
178
- ...vxrnOutput.serverOutput.entries()
179
- ], _iteratorNormalCompletion1 = !0, _didIteratorError1 = !1, _iteratorError1 = void 0;
236
+ var staticDir = (0, import_path.join)("dist/static"),
237
+ clientDir = (0, import_path.join)("dist/client");
238
+ if (await ensureDir(staticDir), !vxrnOutput.serverOutput) throw new Error("No server output");
239
+ var outputEntries = [...vxrnOutput.serverOutput.entries()],
240
+ _iteratorNormalCompletion1 = !0,
241
+ _didIteratorError1 = !1,
242
+ _iteratorError1 = void 0;
180
243
  try {
181
- for (var _loop1 = async function() {
182
- var [index, output] = _step1.value, _vxrnOutput_buildArgs, _foundRoute_layouts, _exported_generateStaticParams;
183
- if (output.type === "asset")
184
- return assets.push(output), "continue";
185
- var id = output.facadeModuleId || "", file = import_node_path.default.basename(id);
186
- if (!id || file[0] === "_" || file.includes("entry-server") || id.includes("+api") || !id.includes(`/${routerRoot}/`))
187
- return "continue";
188
- var relativeId = (0, import_node_path.relative)(process.cwd(), id).replace(`${routerRoot}/`, "/"), onlyBuild = (_vxrnOutput_buildArgs = vxrnOutput.buildArgs) === null || _vxrnOutput_buildArgs === void 0 ? void 0 : _vxrnOutput_buildArgs.only;
189
- if (onlyBuild && !import_micromatch.default.contains(relativeId, onlyBuild))
190
- return "continue";
191
- var clientManifestKey = Object.keys(vxrnOutput.clientManifest).find(function(key) {
192
- return id.endsWith(key);
193
- }) || "";
194
- if (!clientManifestKey)
195
- return "continue";
196
- var clientManifestEntry = vxrnOutput.clientManifest[clientManifestKey], foundRoute = manifest.pageRoutes.find(function(route2) {
197
- return route2.file && clientManifestKey.replace(routerRootRegexp, "") === route2.file.slice(1);
198
- });
199
- if (!foundRoute)
200
- return "continue";
201
- foundRoute.loaderServerPath = output.fileName;
202
- function collectImports(param) {
203
- var { imports = [], css } = param, { type = "js" } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
204
- return [
205
- ...new Set([
206
- ...type === "js" ? imports : css || [],
207
- ...imports.flatMap(function(name) {
208
- var found = vxrnOutput.clientManifest[name];
209
- return found || console.warn("No found imports", name, vxrnOutput.clientManifest), collectImports(found, {
210
- type
211
- });
212
- })
213
- ].flat().filter(function(x) {
244
+ for (var _loop1 = async function () {
245
+ var [index, output] = _step1.value,
246
+ _vxrnOutput_buildArgs,
247
+ _foundRoute_layouts,
248
+ _exported_generateStaticParams;
249
+ if (output.type === "asset") return assets.push(output), "continue";
250
+ var id = output.facadeModuleId || "",
251
+ file = import_path.default.basename(id);
252
+ if (!id || file[0] === "_" || file.includes("entry-server") || id.includes("+api") || !id.includes(`/${routerRoot}/`)) return "continue";
253
+ var relativeId = (0, import_path.relative)(process.cwd(), id).replace(`${routerRoot}/`, "/"),
254
+ onlyBuild = (_vxrnOutput_buildArgs = vxrnOutput.buildArgs) === null || _vxrnOutput_buildArgs === void 0 ? void 0 : _vxrnOutput_buildArgs.only;
255
+ if (onlyBuild && !import_micromatch.default.contains(relativeId, onlyBuild)) return "continue";
256
+ var clientManifestKey = Object.keys(vxrnOutput.clientManifest).find(function (key) {
257
+ return id.endsWith(key);
258
+ }) || "";
259
+ if (!clientManifestKey) return "continue";
260
+ var clientManifestEntry = vxrnOutput.clientManifest[clientManifestKey],
261
+ foundRoute = manifest.pageRoutes.find(function (route2) {
262
+ return route2.file && clientManifestKey.replace(routerRootRegexp, "") === route2.file.slice(1);
263
+ });
264
+ if (!foundRoute) return "continue";
265
+ foundRoute.loaderServerPath = output.fileName;
266
+ function collectImports(param) {
267
+ var {
268
+ imports = [],
269
+ css
270
+ } = param,
271
+ {
272
+ type = "js"
273
+ } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
274
+ return [...new Set([...(type === "js" ? imports : css || []), ...imports.flatMap(function (name) {
275
+ var found = vxrnOutput.clientManifest[name];
276
+ return found || console.warn("No found imports", name, vxrnOutput.clientManifest), collectImports(found, {
277
+ type
278
+ });
279
+ })].flat().filter(function (x) {
214
280
  return x && (type === "css" || x.endsWith(".js"));
215
- }).map(function(x) {
281
+ }).map(function (x) {
216
282
  return type === "css" || x.startsWith("assets/") ? x : `assets/${x.slice(1)}`;
217
- }))
218
- ];
219
- }
220
- clientManifestEntry || console.warn(`No client manifest entry found: ${clientManifestKey} in manifest ${JSON.stringify(vxrnOutput.clientManifest, null, 2)}`);
221
- var entryImports = collectImports(clientManifestEntry || {}), _foundRoute_layouts_flatMap, layoutEntries = (_foundRoute_layouts_flatMap = (_foundRoute_layouts = foundRoute.layouts) === null || _foundRoute_layouts === void 0 ? void 0 : _foundRoute_layouts.flatMap(function(layout) {
222
- var clientKey = `${routerRoot}${layout.contextKey.slice(1)}`, found = vxrnOutput.clientManifest[clientKey];
223
- return found || [];
224
- })) !== null && _foundRoute_layouts_flatMap !== void 0 ? _foundRoute_layouts_flatMap : [], layoutImports = layoutEntries.flatMap(function(entry) {
225
- return [
226
- entry.file,
227
- ...collectImports(entry)
228
- ];
229
- }), preloadSetupFilePreloads = function() {
230
- if (oneOptions.setupFile) {
231
- var needle = oneOptions.setupFile.replace(/^\.\//, "");
232
- for (var file2 in vxrnOutput.clientManifest)
233
- if (file2 === needle) {
234
- var entry = vxrnOutput.clientManifest[file2];
235
- return [
236
- entry.file
237
- ];
238
- }
283
+ }))];
239
284
  }
240
- return [];
241
- }(), preloads2 = [
242
- .../* @__PURE__ */ new Set([
243
- ...preloadSetupFilePreloads,
285
+ clientManifestEntry || console.warn(`No client manifest entry found: ${clientManifestKey} in manifest ${JSON.stringify(vxrnOutput.clientManifest, null, 2)}`);
286
+ var entryImports = collectImports(clientManifestEntry || {}),
287
+ _foundRoute_layouts_flatMap,
288
+ layoutEntries = (_foundRoute_layouts_flatMap = (_foundRoute_layouts = foundRoute.layouts) === null || _foundRoute_layouts === void 0 ? void 0 : _foundRoute_layouts.flatMap(function (layout) {
289
+ var clientKey = `${routerRoot}${layout.contextKey.slice(1)}`,
290
+ found = vxrnOutput.clientManifest[clientKey];
291
+ return found || [];
292
+ })) !== null && _foundRoute_layouts_flatMap !== void 0 ? _foundRoute_layouts_flatMap : [],
293
+ layoutImports = layoutEntries.flatMap(function (entry) {
294
+ return [entry.file, ...collectImports(entry)];
295
+ }),
296
+ preloadSetupFilePreloads = function () {
297
+ if (oneOptions.setupFile) {
298
+ var needle = oneOptions.setupFile.replace(/^\.\//, "");
299
+ for (var file2 in vxrnOutput.clientManifest) if (file2 === needle) {
300
+ var entry = vxrnOutput.clientManifest[file2];
301
+ return [entry.file];
302
+ }
303
+ }
304
+ return [];
305
+ }(),
306
+ preloads2 = [... /* @__PURE__ */new Set([...preloadSetupFilePreloads,
244
307
  // add the route entry js (like ./app/index.ts)
245
308
  clientManifestEntry.file,
246
309
  // add the virtual entry
247
- vxrnOutput.clientManifest["virtual:one-entry"].file,
248
- ...entryImports,
249
- ...layoutImports
250
- ])
251
- ].map(function(path) {
252
- return `/${path}`;
253
- }), allEntries = [
254
- clientManifestEntry,
255
- ...layoutEntries
256
- ], allCSS = allEntries.flatMap(function(entry) {
257
- return collectImports(entry, {
258
- type: "css"
259
- });
260
- }).map(function(path) {
261
- return `/${path}`;
262
- });
263
- process.env.DEBUG && console.info("[one] building routes", {
264
- foundRoute,
265
- layoutEntries,
266
- allEntries,
267
- allCSS
268
- });
269
- var serverJsPath = (0, import_node_path.join)("dist/server", output.fileName), exported = void 0;
270
- try {
271
- exported = await import((0, import_toAbsolute.toAbsolute)(serverJsPath));
272
- } catch (err) {
273
- throw console.error("Error importing page (original error)", err), new Error(`Error importing page: ${serverJsPath}`, {
274
- cause: err
310
+ vxrnOutput.clientManifest["virtual:one-entry"].file, ...entryImports, ...layoutImports])].map(function (path) {
311
+ return `/${path}`;
312
+ }),
313
+ allEntries = [clientManifestEntry, ...layoutEntries],
314
+ allCSS = allEntries.flatMap(function (entry) {
315
+ return collectImports(entry, {
316
+ type: "css"
317
+ });
318
+ }).map(function (path) {
319
+ return `/${path}`;
320
+ });
321
+ process.env.DEBUG && console.info("[one] building routes", {
322
+ foundRoute,
323
+ layoutEntries,
324
+ allEntries,
325
+ allCSS
275
326
  });
276
- }
277
- var isDynamic = !!Object.keys(foundRoute.routeKeys).length;
278
- if (foundRoute.type === "ssg" && isDynamic && !foundRoute.page.includes("+not-found") && !foundRoute.page.includes("_sitemap") && !exported.generateStaticParams)
279
- throw new Error(`[one] Error: Missing generateStaticParams
327
+ var serverJsPath = (0, import_path.join)("dist/server", output.fileName),
328
+ exported = void 0;
329
+ try {
330
+ exported = await import((0, import_toAbsolute.toAbsolute)(serverJsPath));
331
+ } catch (err) {
332
+ throw console.error("Error importing page (original error)", err), new Error(`Error importing page: ${serverJsPath}`, {
333
+ cause: err
334
+ });
335
+ }
336
+ var isDynamic = !!Object.keys(foundRoute.routeKeys).length;
337
+ if (foundRoute.type === "ssg" && isDynamic && !foundRoute.page.includes("+not-found") && !foundRoute.page.includes("_sitemap") && !exported.generateStaticParams) throw new Error(`[one] Error: Missing generateStaticParams
280
338
 
281
339
  Route ${foundRoute.page} of type ${foundRoute.type} must export generateStaticParams so build can complete.
282
340
 
@@ -284,48 +342,55 @@ async function build(args) {
284
342
  https://onestack.dev/docs/routing-exports#generatestaticparams
285
343
 
286
344
  `);
287
- var _ref, paramsList = (_ref = await ((_exported_generateStaticParams = exported.generateStaticParams) === null || _exported_generateStaticParams === void 0 ? void 0 : _exported_generateStaticParams.call(exported))) !== null && _ref !== void 0 ? _ref : [
288
- {}
289
- ];
290
- console.info(`
345
+ var _ref,
346
+ paramsList = (_ref = await ((_exported_generateStaticParams = exported.generateStaticParams) === null || _exported_generateStaticParams === void 0 ? void 0 : _exported_generateStaticParams.call(exported))) !== null && _ref !== void 0 ? _ref : [{}];
347
+ console.info(`
291
348
  [build] page ${relativeId} (with ${paramsList.length} routes)
292
349
  `), process.env.DEBUG && console.info("paramsList", JSON.stringify(paramsList, null, 2));
293
- var _iteratorNormalCompletion4 = !0, _didIteratorError4 = !1, _iteratorError4 = void 0;
294
- try {
295
- for (var _loop2 = async function() {
296
- var params = _step4.value, path = (0, import_getPathnameFromFilePath.getPathnameFromFilePath)(relativeId, params, foundRoute.type === "ssg");
297
- console.info(` \u21A6 route ${path}`);
298
- var built = await (0, import_one_server_only.runWithAsyncLocalContext)(async function() {
299
- return await (0, import_buildPage.buildPage)(vxrnOutput.serverEntry, path, relativeId, params, foundRoute, clientManifestEntry, staticDir, clientDir, builtMiddlewares, serverJsPath, preloads2, allCSS);
300
- });
301
- builtRoutes.push(built);
302
- }, _iterator4 = paramsList[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = !0) await _loop2();
303
- } catch (err) {
304
- _didIteratorError4 = !0, _iteratorError4 = err;
305
- } finally {
350
+ var _iteratorNormalCompletion4 = !0,
351
+ _didIteratorError4 = !1,
352
+ _iteratorError4 = void 0;
306
353
  try {
307
- !_iteratorNormalCompletion4 && _iterator4.return != null && _iterator4.return();
354
+ for (var _loop2 = async function () {
355
+ var params = _step4.value,
356
+ path = (0, import_getPathnameFromFilePath.getPathnameFromFilePath)(relativeId, params, foundRoute.type === "ssg");
357
+ console.info(` \u21A6 route ${path}`);
358
+ var built = await (0, import_one_server_only.runWithAsyncLocalContext)(async function () {
359
+ return await (0, import_buildPage.buildPage)(vxrnOutput.serverEntry, path, relativeId, params, foundRoute, clientManifestEntry, staticDir, clientDir, builtMiddlewares, serverJsPath, preloads2, allCSS);
360
+ });
361
+ builtRoutes.push(built);
362
+ }, _iterator4 = paramsList[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = !0) await _loop2();
363
+ } catch (err) {
364
+ _didIteratorError4 = !0, _iteratorError4 = err;
308
365
  } finally {
309
- if (_didIteratorError4)
310
- throw _iteratorError4;
366
+ try {
367
+ !_iteratorNormalCompletion4 && _iterator4.return != null && _iterator4.return();
368
+ } finally {
369
+ if (_didIteratorError4) throw _iteratorError4;
370
+ }
311
371
  }
312
- }
313
- }, _iterator1 = outputEntries[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = !0) await _loop1();
372
+ }, _iterator1 = outputEntries[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = !0) await _loop1();
314
373
  } catch (err) {
315
374
  _didIteratorError1 = !0, _iteratorError1 = err;
316
375
  } finally {
317
376
  try {
318
377
  !_iteratorNormalCompletion1 && _iterator1.return != null && _iterator1.return();
319
378
  } finally {
320
- if (_didIteratorError1)
321
- throw _iteratorError1;
379
+ if (_didIteratorError1) throw _iteratorError1;
322
380
  }
323
381
  }
324
382
  await moveAllFiles(staticDir, clientDir), await import_fs_extra.default.rm(staticDir, {
325
383
  force: !0,
326
384
  recursive: !0
327
385
  });
328
- var routeMap = {}, routeToBuildInfo = {}, pathToRoute = {}, preloads = {}, loaders = {}, _iteratorNormalCompletion2 = !0, _didIteratorError2 = !1, _iteratorError2 = void 0;
386
+ var routeMap = {},
387
+ routeToBuildInfo = {},
388
+ pathToRoute = {},
389
+ preloads = {},
390
+ loaders = {},
391
+ _iteratorNormalCompletion2 = !0,
392
+ _didIteratorError2 = !1,
393
+ _iteratorError2 = void 0;
329
394
  try {
330
395
  for (var _iterator2 = builtRoutes[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = !0) {
331
396
  var route = _step2.value;
@@ -336,12 +401,11 @@ async function build(args) {
336
401
  ...rest
337
402
  } = route;
338
403
  routeToBuildInfo[route.routeFile] = rest;
339
- var _iteratorNormalCompletion3 = !0, _didIteratorError3 = !1, _iteratorError3 = void 0;
404
+ var _iteratorNormalCompletion3 = !0,
405
+ _didIteratorError3 = !1,
406
+ _iteratorError3 = void 0;
340
407
  try {
341
- for (var _iterator3 = getCleanPaths([
342
- route.path,
343
- route.cleanPath
344
- ])[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = !0) {
408
+ for (var _iterator3 = getCleanPaths([route.path, route.cleanPath])[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = !0) {
345
409
  var p = _step3.value;
346
410
  pathToRoute[p] = route.routeFile;
347
411
  }
@@ -351,8 +415,7 @@ async function build(args) {
351
415
  try {
352
416
  !_iteratorNormalCompletion3 && _iterator3.return != null && _iterator3.return();
353
417
  } finally {
354
- if (_didIteratorError3)
355
- throw _iteratorError3;
418
+ if (_didIteratorError3) throw _iteratorError3;
356
419
  }
357
420
  }
358
421
  preloads[route.preloadPath] = !0, loaders[route.loaderPath] = !0;
@@ -363,16 +426,21 @@ async function build(args) {
363
426
  try {
364
427
  !_iteratorNormalCompletion2 && _iterator2.return != null && _iterator2.return();
365
428
  } finally {
366
- if (_didIteratorError2)
367
- throw _iteratorError2;
429
+ if (_didIteratorError2) throw _iteratorError2;
368
430
  }
369
431
  }
370
432
  function createBuildManifestRoute(route2) {
371
- var { layouts, ...built } = route2, buildInfo = builtRoutes.find(function(x) {
372
- return x.routeFile === route2.file;
373
- });
374
- if (built.middlewares && (buildInfo != null && buildInfo.middlewares)) {
375
- var _iteratorNormalCompletion4 = !0, _didIteratorError4 = !1, _iteratorError4 = void 0;
433
+ var {
434
+ layouts,
435
+ ...built
436
+ } = route2,
437
+ buildInfo = builtRoutes.find(function (x) {
438
+ return x.routeFile === route2.file;
439
+ });
440
+ if (built.middlewares && buildInfo?.middlewares) {
441
+ var _iteratorNormalCompletion4 = !0,
442
+ _didIteratorError4 = !1,
443
+ _iteratorError4 = void 0;
376
444
  try {
377
445
  for (var _iterator4 = built.middlewares.entries()[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = !0) {
378
446
  var [index, mw] = _step4.value;
@@ -384,8 +452,7 @@ async function build(args) {
384
452
  try {
385
453
  !_iteratorNormalCompletion4 && _iterator4.return != null && _iterator4.return();
386
454
  } finally {
387
- if (_didIteratorError4)
388
- throw _iteratorError4;
455
+ if (_didIteratorError4) throw _iteratorError4;
389
456
  }
390
457
  }
391
458
  }
@@ -408,22 +475,24 @@ async function build(args) {
408
475
  loaders
409
476
  };
410
477
  await writeJSON((0, import_toAbsolute.toAbsolute)("dist/buildInfo.json"), buildInfoForWriting);
411
- var postBuildLogs = [], platform = (_oneOptions_web = oneOptions.web) === null || _oneOptions_web === void 0 ? void 0 : _oneOptions_web.deploy;
478
+ var postBuildLogs = [],
479
+ platform = (_oneOptions_web = oneOptions.web) === null || _oneOptions_web === void 0 ? void 0 : _oneOptions_web.deploy;
412
480
  switch (platform && postBuildLogs.push(`[one.build] platform ${platform}`), platform) {
413
- case "vercel": {
414
- await (0, import_buildVercelOutputDirectory.buildVercelOutputDirectory)({
415
- apiOutput,
416
- buildInfoForWriting,
417
- clientDir,
418
- oneOptionsRoot: options.root,
419
- postBuildLogs
420
- });
421
- break;
422
- }
481
+ case "vercel":
482
+ {
483
+ await (0, import_buildVercelOutputDirectory.buildVercelOutputDirectory)({
484
+ apiOutput,
485
+ buildInfoForWriting,
486
+ clientDir,
487
+ oneOptionsRoot: options.root,
488
+ postBuildLogs
489
+ });
490
+ break;
491
+ }
423
492
  }
424
493
  process.env.VXRN_ANALYZE_BUNDLE && postBuildLogs.push(`client build report: ${(0, import_toAbsolute.toAbsolute)("dist/report.html")}`), postBuildLogs.length && (console.info(`
425
494
 
426
- `), postBuildLogs.forEach(function(log) {
495
+ `), postBuildLogs.forEach(function (log) {
427
496
  console.info(` \xB7 ${log}`);
428
497
  })), console.info(`
429
498
 
@@ -433,10 +502,8 @@ async function build(args) {
433
502
  }
434
503
  var TRAILING_INDEX_REGEX = /\/index(\.(web))?/;
435
504
  function getCleanPaths(possiblePaths) {
436
- return Array.from(new Set(Array.from(new Set(possiblePaths)).flatMap(function(p) {
437
- var paths = [
438
- p
439
- ];
505
+ return Array.from(new Set(Array.from(new Set(possiblePaths)).flatMap(function (p) {
506
+ var paths = [p];
440
507
  if (p.match(TRAILING_INDEX_REGEX)) {
441
508
  var pathWithTrailingIndexRemoved = p.replace(TRAILING_INDEX_REGEX, "");
442
509
  paths.push(pathWithTrailingIndexRemoved), paths.push(pathWithTrailingIndexRemoved + "/");
@@ -454,8 +521,4 @@ async function moveAllFiles(src, dest) {
454
521
  console.error("Error moving files:", err);
455
522
  }
456
523
  }
457
- // Annotate the CommonJS export names for ESM import in node:
458
- 0 && (module.exports = {
459
- build
460
- });
461
- //# sourceMappingURL=build.js.map
524
+ //# sourceMappingURL=build.native.js.map