one 1.1.320 → 1.1.322

Sign up to get free protection for your applications and to get access to all the features.
Files changed (311) hide show
  1. package/dist/cjs/Root.js +182 -0
  2. package/dist/cjs/Route.js +45 -0
  3. package/dist/cjs/cleanUrl.js +41 -0
  4. package/dist/cjs/cli/label-process.js +25 -0
  5. package/dist/cjs/cli/main.js +46 -0
  6. package/dist/cjs/cli/patch.js +34 -0
  7. package/dist/cjs/cli/prebuild.js +34 -0
  8. package/dist/cjs/cli/run.js +52 -0
  9. package/dist/cjs/cli/runAndroid.js +34 -0
  10. package/dist/cjs/cli/runIos.js +34 -0
  11. package/dist/cjs/cli.js +220 -0
  12. package/dist/cjs/clientLoaderResolver.js +32 -0
  13. package/dist/cjs/config.js +27 -0
  14. package/dist/cjs/constants.js +28 -0
  15. package/dist/cjs/createApp.js +46 -0
  16. package/dist/cjs/createHandleRequest.js +138 -0
  17. package/dist/cjs/createRoute.js +37 -0
  18. package/dist/cjs/fallbackViews/Sitemap.js +82 -0
  19. package/dist/cjs/fallbackViews/Unmatched.js +58 -0
  20. package/dist/cjs/fork/NavigationContainer.js +85 -0
  21. package/dist/cjs/fork/createMemoryHistory.js +100 -0
  22. package/dist/cjs/fork/extractPathFromURL.js +62 -0
  23. package/dist/cjs/fork/findFocusedRoute.js +26 -0
  24. package/dist/cjs/fork/getPathFromState.js +265 -0
  25. package/dist/cjs/fork/getStateFromPath.js +381 -0
  26. package/dist/cjs/fork/useLinking.js +182 -0
  27. package/dist/cjs/fork/validatePathConfig.js +46 -0
  28. package/dist/cjs/getLinkingConfig.js +59 -0
  29. package/dist/cjs/getReactNavigationConfig.js +69 -0
  30. package/dist/cjs/getRoutes.js +294 -0
  31. package/dist/cjs/getURL.js +24 -0
  32. package/dist/cjs/head/Head.js +23 -0
  33. package/dist/cjs/head/HeadModule.js +22 -0
  34. package/dist/cjs/head/index.js +15 -0
  35. package/dist/cjs/head/types.js +14 -0
  36. package/dist/cjs/head/url.js +52 -0
  37. package/dist/cjs/hooks.js +99 -0
  38. package/dist/cjs/imperative-api.js +45 -0
  39. package/dist/cjs/import-mode/index.js +21 -0
  40. package/dist/cjs/import-mode/index.web.js +21 -0
  41. package/dist/cjs/index.js +65 -0
  42. package/dist/cjs/interfaces/router.js +23 -0
  43. package/dist/cjs/layouts/Drawer.js +24 -0
  44. package/dist/cjs/layouts/Stack.js +24 -0
  45. package/dist/cjs/layouts/Tabs.js +52 -0
  46. package/dist/cjs/layouts/withLayoutContext.js +77 -0
  47. package/dist/cjs/link/Link.js +98 -0
  48. package/dist/cjs/link/Redirect.js +31 -0
  49. package/dist/cjs/link/href.js +50 -0
  50. package/dist/cjs/link/linking.js +82 -0
  51. package/dist/cjs/link/path.js +65 -0
  52. package/dist/cjs/link/useLinkTo.js +42 -0
  53. package/dist/cjs/link/useLoadedNavigation.js +50 -0
  54. package/dist/cjs/matchers.js +68 -0
  55. package/dist/cjs/platform.js +21 -0
  56. package/dist/cjs/polyfills-mobile.js +26 -0
  57. package/dist/cjs/polyfills-server.js +23 -0
  58. package/dist/cjs/render.js +44 -0
  59. package/dist/cjs/router/RouterStore.js +14 -0
  60. package/dist/cjs/router/getNormalizedStatePath.js +50 -0
  61. package/dist/cjs/router/lastAction.js +25 -0
  62. package/dist/cjs/router/router.js +345 -0
  63. package/dist/cjs/router/serverLocationContext.js +22 -0
  64. package/dist/cjs/router/useInitializeOneRouter.js +43 -0
  65. package/dist/cjs/serve.js +184 -0
  66. package/dist/cjs/server/createRoutesManifest.js +40 -0
  67. package/dist/cjs/server/getServerManifest.js +109 -0
  68. package/dist/cjs/server-render.js +42 -0
  69. package/dist/cjs/sortRoutes.js +64 -0
  70. package/dist/cjs/typed-routes/generateRouteTypes.js +33 -0
  71. package/dist/cjs/typed-routes/getTypedRoutesDeclarationFile.js +83 -0
  72. package/dist/cjs/types.js +14 -0
  73. package/dist/cjs/useFocusEffect.js +79 -0
  74. package/dist/cjs/useLoader.js +97 -0
  75. package/dist/cjs/useNavigation.js +60 -0
  76. package/dist/cjs/useScreens.js +176 -0
  77. package/dist/cjs/useViteRoutes.js +77 -0
  78. package/dist/cjs/utils/assertIsReady.js +26 -0
  79. package/dist/cjs/utils/dynamicImport.js +24 -0
  80. package/dist/cjs/utils/existsAsync.js +28 -0
  81. package/dist/cjs/utils/getPageExport.js +38 -0
  82. package/dist/cjs/utils/globDir.js +37 -0
  83. package/dist/cjs/utils/hashString.js +32 -0
  84. package/dist/cjs/utils/isResponse.js +23 -0
  85. package/dist/cjs/utils/isStatus.js +23 -0
  86. package/dist/cjs/utils/promiseWithResolvers.js +26 -0
  87. package/dist/cjs/utils/rand.js +21 -0
  88. package/dist/cjs/utils/redirect.js +28 -0
  89. package/dist/cjs/utils/removeSearch.js +23 -0
  90. package/dist/cjs/utils/removeUndefined.js +26 -0
  91. package/dist/cjs/utils/url.js +31 -0
  92. package/dist/cjs/utils/weakKey.js +24 -0
  93. package/dist/cjs/utils/weakMemo.js +30 -0
  94. package/dist/cjs/views/EmptyRoute.js +25 -0
  95. package/dist/cjs/views/ErrorBoundary.js +33 -0
  96. package/dist/cjs/views/LoadProgressBar.js +83 -0
  97. package/dist/cjs/views/Navigator.js +101 -0
  98. package/dist/cjs/views/PreloadLinks.js +42 -0
  99. package/dist/cjs/views/RootErrorBoundary.js +47 -0
  100. package/dist/cjs/views/Screen.js +29 -0
  101. package/dist/cjs/views/ScrollRestoration.js +70 -0
  102. package/dist/cjs/views/Try.js +44 -0
  103. package/dist/cjs/vite/build.js +377 -0
  104. package/dist/cjs/vite/clientTreeShakePlugin.js +76 -0
  105. package/dist/cjs/vite/constants.js +22 -0
  106. package/dist/cjs/vite/createFileSystemRouter.cjs +2 -1
  107. package/dist/cjs/vite/createFileSystemRouter.js +244 -0
  108. package/dist/cjs/vite/createFileSystemRouter.js.map +6 -0
  109. package/dist/cjs/vite/createFileSystemRouter.native.js +2 -1
  110. package/dist/cjs/vite/createFileSystemRouter.native.js.map +2 -2
  111. package/dist/cjs/vite/customNodeExternals.js +52 -0
  112. package/dist/cjs/vite/ensureTsConfig.js +66 -0
  113. package/dist/cjs/vite/findDepsToOptimize.js +66 -0
  114. package/dist/cjs/vite/fixDependenciesPlugin.js +43 -0
  115. package/dist/cjs/vite/generateTypesForRoutes.js +36 -0
  116. package/dist/cjs/vite/getManifest.js +27 -0
  117. package/dist/cjs/vite/headers.js +39 -0
  118. package/dist/cjs/vite/makePluginWebOnly.js +27 -0
  119. package/dist/cjs/vite/one.js +290 -0
  120. package/dist/cjs/vite/removeReactNativeWebAnimatedPlugin.js +50 -0
  121. package/dist/cjs/vite/replaceLoader.js +34 -0
  122. package/dist/cjs/vite/resolveAPIRequest.js +71 -0
  123. package/dist/cjs/vite/server.js +16 -0
  124. package/dist/cjs/vite/types.js +14 -0
  125. package/dist/cjs/vite/virtualEntryPlugin.js +67 -0
  126. package/dist/cjs/vite/vitePluginSsrCss.js +130 -0
  127. package/dist/cjs/vite.cjs +2 -0
  128. package/dist/cjs/vite.js +29 -0
  129. package/dist/cjs/vite.js.map +6 -0
  130. package/dist/cjs/vite.native.js +3 -1
  131. package/dist/cjs/vite.native.js.map +1 -1
  132. package/dist/cjs/zero/getQueryKey.js +24 -0
  133. package/dist/cjs/zero/isZeroQuery.js +23 -0
  134. package/dist/cjs/zero/resolveQuery.js +38 -0
  135. package/dist/cjs/zero/subscribeToQuery.js +28 -0
  136. package/dist/cjs/zero/types.js +14 -0
  137. package/dist/cjs/zero/useQuery.js +47 -0
  138. package/dist/cjs/zero/useQueryZero.js +38 -0
  139. package/dist/cjs/zero.js +23 -0
  140. package/dist/esm/vite/createFileSystemRouter.js +2 -1
  141. package/dist/esm/vite/createFileSystemRouter.js.map +1 -1
  142. package/dist/esm/vite/createFileSystemRouter.mjs +2 -1
  143. package/dist/esm/vite/createFileSystemRouter.mjs.map +1 -1
  144. package/dist/esm/vite/createFileSystemRouter.native.js +2 -1
  145. package/dist/esm/vite/createFileSystemRouter.native.js.map +2 -2
  146. package/dist/esm/vite.js +2 -0
  147. package/dist/esm/vite.js.map +1 -1
  148. package/dist/esm/vite.mjs +2 -1
  149. package/dist/esm/vite.mjs.map +1 -1
  150. package/dist/esm/vite.native.js +2 -0
  151. package/dist/esm/vite.native.js.map +2 -2
  152. package/package.json +8 -8
  153. package/src/vite/createFileSystemRouter.tsx +1 -1
  154. package/src/vite.ts +1 -0
  155. package/types/vite.d.ts +1 -0
  156. package/types/vite.d.ts.map +1 -1
  157. package/dist/cjs/createApp.native.cjs +0 -38
  158. package/dist/cjs/createApp.native.cjs.map +0 -6
  159. package/dist/cjs/fork/NavigationContainer.native.cjs +0 -103
  160. package/dist/cjs/fork/NavigationContainer.native.cjs.map +0 -6
  161. package/dist/cjs/fork/useLinking.native.cjs +0 -126
  162. package/dist/cjs/fork/useLinking.native.cjs.map +0 -6
  163. package/dist/cjs/getURL.native.cjs +0 -48
  164. package/dist/cjs/getURL.native.cjs.map +0 -6
  165. package/dist/cjs/head/Head.android.cjs +0 -28
  166. package/dist/cjs/head/Head.android.cjs.map +0 -6
  167. package/dist/cjs/head/Head.ios.cjs +0 -210
  168. package/dist/cjs/head/Head.ios.cjs.map +0 -6
  169. package/dist/cjs/import-mode/index.android.cjs +0 -26
  170. package/dist/cjs/import-mode/index.android.cjs.map +0 -6
  171. package/dist/cjs/import-mode/index.ios.cjs +0 -26
  172. package/dist/cjs/import-mode/index.ios.cjs.map +0 -6
  173. package/dist/cjs/import-mode/index.native.cjs +0 -26
  174. package/dist/cjs/import-mode/index.native.cjs.map +0 -6
  175. package/dist/cjs/render.native.cjs +0 -28
  176. package/dist/cjs/render.native.cjs.map +0 -6
  177. package/dist/cjs/views/PreloadLinks.native.cjs +0 -28
  178. package/dist/cjs/views/PreloadLinks.native.cjs.map +0 -6
  179. package/dist/cjs/vite/createFileSystemRouter.cjs.map +0 -6
  180. package/dist/cjs/vite/headers.native.cjs +0 -32
  181. package/dist/cjs/vite/headers.native.cjs.map +0 -6
  182. package/dist/cjs/vite.cjs.map +0 -6
  183. /package/dist/cjs/{Root.cjs.map → Root.js.map} +0 -0
  184. /package/dist/cjs/{Route.cjs.map → Route.js.map} +0 -0
  185. /package/dist/cjs/{cleanUrl.cjs.map → cleanUrl.js.map} +0 -0
  186. /package/dist/cjs/cli/{label-process.cjs.map → label-process.js.map} +0 -0
  187. /package/dist/cjs/cli/{main.cjs.map → main.js.map} +0 -0
  188. /package/dist/cjs/cli/{patch.cjs.map → patch.js.map} +0 -0
  189. /package/dist/cjs/cli/{prebuild.cjs.map → prebuild.js.map} +0 -0
  190. /package/dist/cjs/cli/{run.cjs.map → run.js.map} +0 -0
  191. /package/dist/cjs/cli/{runAndroid.cjs.map → runAndroid.js.map} +0 -0
  192. /package/dist/cjs/cli/{runIos.cjs.map → runIos.js.map} +0 -0
  193. /package/dist/cjs/{cli.cjs.map → cli.js.map} +0 -0
  194. /package/dist/cjs/{clientLoaderResolver.cjs.map → clientLoaderResolver.js.map} +0 -0
  195. /package/dist/cjs/{config.cjs.map → config.js.map} +0 -0
  196. /package/dist/cjs/{constants.cjs.map → constants.js.map} +0 -0
  197. /package/dist/cjs/{createApp.cjs.map → createApp.js.map} +0 -0
  198. /package/dist/cjs/{createHandleRequest.cjs.map → createHandleRequest.js.map} +0 -0
  199. /package/dist/cjs/{createRoute.cjs.map → createRoute.js.map} +0 -0
  200. /package/dist/cjs/fallbackViews/{Sitemap.cjs.map → Sitemap.js.map} +0 -0
  201. /package/dist/cjs/fallbackViews/{Unmatched.cjs.map → Unmatched.js.map} +0 -0
  202. /package/dist/cjs/fork/{NavigationContainer.cjs.map → NavigationContainer.js.map} +0 -0
  203. /package/dist/cjs/fork/{createMemoryHistory.cjs.map → createMemoryHistory.js.map} +0 -0
  204. /package/dist/cjs/fork/{extractPathFromURL.cjs.map → extractPathFromURL.js.map} +0 -0
  205. /package/dist/cjs/fork/{findFocusedRoute.cjs.map → findFocusedRoute.js.map} +0 -0
  206. /package/dist/cjs/fork/{getPathFromState.cjs.map → getPathFromState.js.map} +0 -0
  207. /package/dist/cjs/fork/{getStateFromPath.cjs.map → getStateFromPath.js.map} +0 -0
  208. /package/dist/cjs/fork/{useLinking.cjs.map → useLinking.js.map} +0 -0
  209. /package/dist/cjs/fork/{validatePathConfig.cjs.map → validatePathConfig.js.map} +0 -0
  210. /package/dist/cjs/{getLinkingConfig.cjs.map → getLinkingConfig.js.map} +0 -0
  211. /package/dist/cjs/{getReactNavigationConfig.cjs.map → getReactNavigationConfig.js.map} +0 -0
  212. /package/dist/cjs/{getRoutes.cjs.map → getRoutes.js.map} +0 -0
  213. /package/dist/cjs/{getURL.cjs.map → getURL.js.map} +0 -0
  214. /package/dist/cjs/head/{Head.cjs.map → Head.js.map} +0 -0
  215. /package/dist/cjs/head/{HeadModule.cjs.map → HeadModule.js.map} +0 -0
  216. /package/dist/cjs/head/{index.cjs.map → index.js.map} +0 -0
  217. /package/dist/cjs/head/{types.cjs.map → types.js.map} +0 -0
  218. /package/dist/cjs/head/{url.cjs.map → url.js.map} +0 -0
  219. /package/dist/cjs/{hooks.cjs.map → hooks.js.map} +0 -0
  220. /package/dist/cjs/{imperative-api.cjs.map → imperative-api.js.map} +0 -0
  221. /package/dist/cjs/import-mode/{index.cjs.map → index.js.map} +0 -0
  222. /package/dist/cjs/import-mode/{index.web.cjs.map → index.web.js.map} +0 -0
  223. /package/dist/cjs/{index.cjs.map → index.js.map} +0 -0
  224. /package/dist/cjs/interfaces/{router.cjs.map → router.js.map} +0 -0
  225. /package/dist/cjs/layouts/{Drawer.cjs.map → Drawer.js.map} +0 -0
  226. /package/dist/cjs/layouts/{Stack.cjs.map → Stack.js.map} +0 -0
  227. /package/dist/cjs/layouts/{Tabs.cjs.map → Tabs.js.map} +0 -0
  228. /package/dist/cjs/layouts/{withLayoutContext.cjs.map → withLayoutContext.js.map} +0 -0
  229. /package/dist/cjs/link/{Link.cjs.map → Link.js.map} +0 -0
  230. /package/dist/cjs/link/{Redirect.cjs.map → Redirect.js.map} +0 -0
  231. /package/dist/cjs/link/{href.cjs.map → href.js.map} +0 -0
  232. /package/dist/cjs/link/{linking.cjs.map → linking.js.map} +0 -0
  233. /package/dist/cjs/link/{path.cjs.map → path.js.map} +0 -0
  234. /package/dist/cjs/link/{useLinkTo.cjs.map → useLinkTo.js.map} +0 -0
  235. /package/dist/cjs/link/{useLoadedNavigation.cjs.map → useLoadedNavigation.js.map} +0 -0
  236. /package/dist/cjs/{matchers.cjs.map → matchers.js.map} +0 -0
  237. /package/dist/cjs/{platform.cjs.map → platform.js.map} +0 -0
  238. /package/dist/cjs/{polyfills-mobile.cjs.map → polyfills-mobile.js.map} +0 -0
  239. /package/dist/cjs/{polyfills-server.cjs.map → polyfills-server.js.map} +0 -0
  240. /package/dist/cjs/{render.cjs.map → render.js.map} +0 -0
  241. /package/dist/cjs/router/{RouterStore.cjs.map → RouterStore.js.map} +0 -0
  242. /package/dist/cjs/router/{getNormalizedStatePath.cjs.map → getNormalizedStatePath.js.map} +0 -0
  243. /package/dist/cjs/router/{lastAction.cjs.map → lastAction.js.map} +0 -0
  244. /package/dist/cjs/router/{router.cjs.map → router.js.map} +0 -0
  245. /package/dist/cjs/router/{serverLocationContext.cjs.map → serverLocationContext.js.map} +0 -0
  246. /package/dist/cjs/router/{useInitializeOneRouter.cjs.map → useInitializeOneRouter.js.map} +0 -0
  247. /package/dist/cjs/{serve.cjs.map → serve.js.map} +0 -0
  248. /package/dist/cjs/server/{createRoutesManifest.cjs.map → createRoutesManifest.js.map} +0 -0
  249. /package/dist/cjs/server/{getServerManifest.cjs.map → getServerManifest.js.map} +0 -0
  250. /package/dist/cjs/{server-render.cjs.map → server-render.js.map} +0 -0
  251. /package/dist/cjs/{sortRoutes.cjs.map → sortRoutes.js.map} +0 -0
  252. /package/dist/cjs/typed-routes/{generateRouteTypes.cjs.map → generateRouteTypes.js.map} +0 -0
  253. /package/dist/cjs/typed-routes/{getTypedRoutesDeclarationFile.cjs.map → getTypedRoutesDeclarationFile.js.map} +0 -0
  254. /package/dist/cjs/{types.cjs.map → types.js.map} +0 -0
  255. /package/dist/cjs/{useFocusEffect.cjs.map → useFocusEffect.js.map} +0 -0
  256. /package/dist/cjs/{useLoader.cjs.map → useLoader.js.map} +0 -0
  257. /package/dist/cjs/{useNavigation.cjs.map → useNavigation.js.map} +0 -0
  258. /package/dist/cjs/{useScreens.cjs.map → useScreens.js.map} +0 -0
  259. /package/dist/cjs/{useViteRoutes.cjs.map → useViteRoutes.js.map} +0 -0
  260. /package/dist/cjs/utils/{assertIsReady.cjs.map → assertIsReady.js.map} +0 -0
  261. /package/dist/cjs/utils/{dynamicImport.cjs.map → dynamicImport.js.map} +0 -0
  262. /package/dist/cjs/utils/{existsAsync.cjs.map → existsAsync.js.map} +0 -0
  263. /package/dist/cjs/utils/{getPageExport.cjs.map → getPageExport.js.map} +0 -0
  264. /package/dist/cjs/utils/{globDir.cjs.map → globDir.js.map} +0 -0
  265. /package/dist/cjs/utils/{hashString.cjs.map → hashString.js.map} +0 -0
  266. /package/dist/cjs/utils/{isResponse.cjs.map → isResponse.js.map} +0 -0
  267. /package/dist/cjs/utils/{isStatus.cjs.map → isStatus.js.map} +0 -0
  268. /package/dist/cjs/utils/{promiseWithResolvers.cjs.map → promiseWithResolvers.js.map} +0 -0
  269. /package/dist/cjs/utils/{rand.cjs.map → rand.js.map} +0 -0
  270. /package/dist/cjs/utils/{redirect.cjs.map → redirect.js.map} +0 -0
  271. /package/dist/cjs/utils/{removeSearch.cjs.map → removeSearch.js.map} +0 -0
  272. /package/dist/cjs/utils/{removeUndefined.cjs.map → removeUndefined.js.map} +0 -0
  273. /package/dist/cjs/utils/{url.cjs.map → url.js.map} +0 -0
  274. /package/dist/cjs/utils/{weakKey.cjs.map → weakKey.js.map} +0 -0
  275. /package/dist/cjs/utils/{weakMemo.cjs.map → weakMemo.js.map} +0 -0
  276. /package/dist/cjs/views/{EmptyRoute.cjs.map → EmptyRoute.js.map} +0 -0
  277. /package/dist/cjs/views/{ErrorBoundary.cjs.map → ErrorBoundary.js.map} +0 -0
  278. /package/dist/cjs/views/{LoadProgressBar.cjs.map → LoadProgressBar.js.map} +0 -0
  279. /package/dist/cjs/views/{Navigator.cjs.map → Navigator.js.map} +0 -0
  280. /package/dist/cjs/views/{PreloadLinks.cjs.map → PreloadLinks.js.map} +0 -0
  281. /package/dist/cjs/views/{RootErrorBoundary.cjs.map → RootErrorBoundary.js.map} +0 -0
  282. /package/dist/cjs/views/{Screen.cjs.map → Screen.js.map} +0 -0
  283. /package/dist/cjs/views/{ScrollRestoration.cjs.map → ScrollRestoration.js.map} +0 -0
  284. /package/dist/cjs/views/{Try.cjs.map → Try.js.map} +0 -0
  285. /package/dist/cjs/vite/{build.cjs.map → build.js.map} +0 -0
  286. /package/dist/cjs/vite/{clientTreeShakePlugin.cjs.map → clientTreeShakePlugin.js.map} +0 -0
  287. /package/dist/cjs/vite/{constants.cjs.map → constants.js.map} +0 -0
  288. /package/dist/cjs/vite/{customNodeExternals.cjs.map → customNodeExternals.js.map} +0 -0
  289. /package/dist/cjs/vite/{ensureTsConfig.cjs.map → ensureTsConfig.js.map} +0 -0
  290. /package/dist/cjs/vite/{findDepsToOptimize.cjs.map → findDepsToOptimize.js.map} +0 -0
  291. /package/dist/cjs/vite/{fixDependenciesPlugin.cjs.map → fixDependenciesPlugin.js.map} +0 -0
  292. /package/dist/cjs/vite/{generateTypesForRoutes.cjs.map → generateTypesForRoutes.js.map} +0 -0
  293. /package/dist/cjs/vite/{getManifest.cjs.map → getManifest.js.map} +0 -0
  294. /package/dist/cjs/vite/{headers.cjs.map → headers.js.map} +0 -0
  295. /package/dist/cjs/vite/{makePluginWebOnly.cjs.map → makePluginWebOnly.js.map} +0 -0
  296. /package/dist/cjs/vite/{one.cjs.map → one.js.map} +0 -0
  297. /package/dist/cjs/vite/{removeReactNativeWebAnimatedPlugin.cjs.map → removeReactNativeWebAnimatedPlugin.js.map} +0 -0
  298. /package/dist/cjs/vite/{replaceLoader.cjs.map → replaceLoader.js.map} +0 -0
  299. /package/dist/cjs/vite/{resolveAPIRequest.cjs.map → resolveAPIRequest.js.map} +0 -0
  300. /package/dist/cjs/vite/{server.cjs.map → server.js.map} +0 -0
  301. /package/dist/cjs/vite/{types.cjs.map → types.js.map} +0 -0
  302. /package/dist/cjs/vite/{virtualEntryPlugin.cjs.map → virtualEntryPlugin.js.map} +0 -0
  303. /package/dist/cjs/vite/{vitePluginSsrCss.cjs.map → vitePluginSsrCss.js.map} +0 -0
  304. /package/dist/cjs/zero/{getQueryKey.cjs.map → getQueryKey.js.map} +0 -0
  305. /package/dist/cjs/zero/{isZeroQuery.cjs.map → isZeroQuery.js.map} +0 -0
  306. /package/dist/cjs/zero/{resolveQuery.cjs.map → resolveQuery.js.map} +0 -0
  307. /package/dist/cjs/zero/{subscribeToQuery.cjs.map → subscribeToQuery.js.map} +0 -0
  308. /package/dist/cjs/zero/{types.cjs.map → types.js.map} +0 -0
  309. /package/dist/cjs/zero/{useQuery.cjs.map → useQuery.js.map} +0 -0
  310. /package/dist/cjs/zero/{useQueryZero.cjs.map → useQueryZero.js.map} +0 -0
  311. /package/dist/cjs/{zero.cjs.map → zero.js.map} +0 -0
@@ -0,0 +1,39 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: !0 });
8
+ }, __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from == "object" || typeof from == "function")
10
+ for (let key of __getOwnPropNames(from))
11
+ !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
15
+ var headers_exports = {};
16
+ __export(headers_exports, {
17
+ asyncHeadersCache: () => asyncHeadersCache,
18
+ mergeHeaders: () => mergeHeaders,
19
+ requestAsyncLocalStore: () => requestAsyncLocalStore,
20
+ setCurrentRequestHeaders: () => setCurrentRequestHeaders
21
+ });
22
+ module.exports = __toCommonJS(headers_exports);
23
+ var import_node_async_hooks = require("node:async_hooks");
24
+ const requestAsyncLocalStore = globalThis.__vxrnrequestAsyncLocalStore ?? new import_node_async_hooks.AsyncLocalStorage(), asyncHeadersCache = globalThis.__vxrnasyncHeadersCache ?? /* @__PURE__ */ new WeakMap();
25
+ globalThis.__vxrnrequestAsyncLocalStore ||= requestAsyncLocalStore;
26
+ globalThis.__vxrnasyncHeadersCache ||= asyncHeadersCache;
27
+ async function setCurrentRequestHeaders(cb) {
28
+ const id = requestAsyncLocalStore.getStore();
29
+ if (!id)
30
+ throw new Error("AsyncLocalStorage not working, no id!");
31
+ const headers = asyncHeadersCache.get(id) ?? new Headers();
32
+ asyncHeadersCache.set(id, headers), cb(headers);
33
+ }
34
+ function mergeHeaders(onto, from) {
35
+ from.forEach((value, key) => {
36
+ value === void 0 || value === "undefined" ? onto.delete(key) : onto.append(key, value);
37
+ });
38
+ }
39
+ //# sourceMappingURL=headers.js.map
@@ -0,0 +1,27 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: !0 });
8
+ }, __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from == "object" || typeof from == "function")
10
+ for (let key of __getOwnPropNames(from))
11
+ !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
15
+ var makePluginWebOnly_exports = {};
16
+ __export(makePluginWebOnly_exports, {
17
+ makePluginWebOnly: () => makePluginWebOnly
18
+ });
19
+ module.exports = __toCommonJS(makePluginWebOnly_exports);
20
+ function makePluginWebOnly(plugin) {
21
+ const og = plugin.transform;
22
+ return og && (plugin.transform = function(...args) {
23
+ if (this.environment.name === "client")
24
+ return og.call(this, ...args);
25
+ }), plugin;
26
+ }
27
+ //# sourceMappingURL=makePluginWebOnly.js.map
@@ -0,0 +1,290 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: !0 });
9
+ }, __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from == "object" || typeof from == "function")
11
+ for (let key of __getOwnPropNames(from))
12
+ !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
+ return to;
14
+ };
15
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
16
+ // If the importer is in node compatibility mode or this is not an ESM
17
+ // file that has been converted to a CommonJS file using a Babel-
18
+ // compatible transform (i.e. "__esModule" has not been set), then set
19
+ // "default" to the CommonJS "module.exports" for node compatibility.
20
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
21
+ mod
22
+ )), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
23
+ var one_exports = {};
24
+ __export(one_exports, {
25
+ loadUserOneOptions: () => loadUserOneOptions,
26
+ one: () => one
27
+ });
28
+ module.exports = __toCommonJS(one_exports);
29
+ var import_resolve = require("@vxrn/resolve"), import_node_events = __toESM(require("node:events"), 1), import_node_path = __toESM(require("node:path"), 1), import_vite = require("vite"), import_vite_tsconfig_paths = __toESM(require("vite-tsconfig-paths"), 1), import_vxrn = require("vxrn"), import_constants = require("../constants"), import_polyfills_server = require("../polyfills-server"), import_existsAsync = require("../utils/existsAsync"), import_clientTreeShakePlugin = require("./clientTreeShakePlugin"), import_createFileSystemRouter = require("./createFileSystemRouter"), import_ensureTsConfig = require("./ensureTsConfig"), import_fixDependenciesPlugin = require("./fixDependenciesPlugin"), import_generateTypesForRoutes = require("./generateTypesForRoutes"), import_virtualEntryPlugin = require("./virtualEntryPlugin"), import_vitePluginSsrCss = require("./vitePluginSsrCss");
30
+ import_node_events.default.setMaxListeners(1e3);
31
+ globalThis.__vxrnEnableNativeEnv = !0;
32
+ function one(options = {}) {
33
+ oneOptions = options, options.config?.ensureTSConfig !== !1 && (0, import_ensureTsConfig.ensureTSConfig)(), globalThis.__vxrnPluginConfig__ = options;
34
+ const { optimizeDeps } = (0, import_vxrn.getOptimizeDeps)("build"), optimizeIds = optimizeDeps.include, optimizeIdRegex = new RegExp(
35
+ // santize ids for regex
36
+ // https://stackoverflow.com/questions/6300183/sanitize-string-of-regex-characters-before-regexp-build
37
+ `${optimizeIds.map((id) => id.replace(/[#-.]|[[-^]|[?|{}]/g, "\\$&")).join("|")}`
38
+ );
39
+ let tsConfigPathsPlugin = null;
40
+ const vxrnOptions = (0, import_vxrn.getOptionsFilled)(), { clientEnvDefine } = (0, import_vxrn.loadEnv)(vxrnOptions?.mode ?? "development"), devAndProdPlugins = [
41
+ {
42
+ name: "one-define-env",
43
+ config() {
44
+ return {
45
+ define: clientEnvDefine
46
+ };
47
+ }
48
+ },
49
+ ...options.ssr?.disableAutoDepsPreBundling ? [] : [
50
+ (0, import_vxrn.autoPreBundleDepsForSsrPlugin)({
51
+ root: vxrnOptions?.root || process.cwd()
52
+ })
53
+ ],
54
+ // proxy because you cant add a plugin inside a plugin
55
+ new Proxy(
56
+ {
57
+ name: "one:tsconfig-paths",
58
+ config(configIncoming) {
59
+ const pathsConfig = options.config?.tsConfigPaths;
60
+ pathsConfig !== !1 && (configIncoming.plugins?.flat().some((p) => p && p.name === "vite-tsconfig-paths") || (tsConfigPathsPlugin = (0, import_vite_tsconfig_paths.default)(
61
+ pathsConfig && typeof pathsConfig == "object" ? pathsConfig : {}
62
+ )));
63
+ },
64
+ configResolved() {
65
+ },
66
+ resolveId() {
67
+ }
68
+ },
69
+ {
70
+ get(target, key, thisArg) {
71
+ if (key === "config" || key === "name")
72
+ return Reflect.get(target, key, thisArg);
73
+ if (tsConfigPathsPlugin)
74
+ return Reflect.get(tsConfigPathsPlugin, key, thisArg);
75
+ }
76
+ }
77
+ ),
78
+ {
79
+ name: "one-slim-deps",
80
+ enforce: "pre",
81
+ config() {
82
+ return {
83
+ resolve: {
84
+ alias: {
85
+ tslib: (0, import_resolve.resolvePath)("@vxrn/tslib-lite")
86
+ }
87
+ // [
88
+ // {
89
+ // find: /tslib/,
90
+ // replacement: resolvePath('@vxrn/tslib-lite'),
91
+ // },
92
+ // // not working but would save ~30Kb stat
93
+ // // {
94
+ // // find: /@react-navigation\/core.*\/getStateFromPath/,
95
+ // // replacement: join(forkPath, 'fork', 'getStateFromPath.mjs'),
96
+ // // },
97
+ // // {
98
+ // // find: /@react-navigation\/core.*\/getPathFromState/,
99
+ // // replacement: join(forkPath, 'fork', 'getPathFromState.mjs'),
100
+ // // },
101
+ // ],
102
+ }
103
+ };
104
+ }
105
+ },
106
+ {
107
+ name: "one:init-config",
108
+ config() {
109
+ return {
110
+ define: {
111
+ ...options.web?.defaultRenderMode && {
112
+ "process.env.ONE_DEFAULT_RENDER_MODE": JSON.stringify(options.web.defaultRenderMode),
113
+ "import.meta.env.ONE_DEFAULT_RENDER_MODE": JSON.stringify(
114
+ options.web.defaultRenderMode
115
+ )
116
+ },
117
+ ...options.setupFile && {
118
+ "process.env.ONE_SETUP_FILE": JSON.stringify(options.setupFile)
119
+ },
120
+ ...process.env.NODE_ENV !== "production" && vxrnOptions && {
121
+ "process.env.ONE_SERVER_URL": JSON.stringify(vxrnOptions.server.url),
122
+ "import.meta.env.ONE_SERVER_URL": JSON.stringify(vxrnOptions.server.url)
123
+ }
124
+ },
125
+ environments: {
126
+ client: {
127
+ define: {
128
+ "process.env.VITE_ENVIRONMENT": '"client"',
129
+ "import.meta.env.VITE_ENVIRONMENT": '"client"'
130
+ }
131
+ },
132
+ ssr: {
133
+ define: {
134
+ "process.env.VITE_ENVIRONMENT": '"ssr"',
135
+ "import.meta.env.VITE_ENVIRONMENT": '"ssr"'
136
+ }
137
+ },
138
+ ios: {
139
+ define: {
140
+ "process.env.VITE_ENVIRONMENT": '"ios"',
141
+ "import.meta.env.VITE_ENVIRONMENT": '"ios"'
142
+ }
143
+ },
144
+ android: {
145
+ define: {
146
+ "process.env.VITE_ENVIRONMENT": '"android"',
147
+ "import.meta.env.VITE_ENVIRONMENT": '"android"'
148
+ }
149
+ }
150
+ }
151
+ };
152
+ }
153
+ },
154
+ {
155
+ name: "one-zero",
156
+ config() {
157
+ if (options.zero)
158
+ return {
159
+ define: {
160
+ "process.env.ZERO_ENABLED": "true",
161
+ TESTING: "false",
162
+ REPLICACHE_VERSION: '"15.2.1"',
163
+ ZERO_VERSION: '"0.0.0"'
164
+ }
165
+ };
166
+ }
167
+ },
168
+ {
169
+ name: "tamagui-react-19",
170
+ config() {
171
+ return {
172
+ define: {
173
+ // safe to set because it only affects web in tamagui, and one is always react 19
174
+ "process.env.TAMAGUI_REACT_19": '"1"'
175
+ }
176
+ };
177
+ }
178
+ },
179
+ {
180
+ name: "route-module-hmr-fix",
181
+ hotUpdate({ server, modules }) {
182
+ return modules.map((m) => {
183
+ const { id } = m;
184
+ return id && import_node_path.default.relative(server.config.root, id).split(import_node_path.default.sep)[0] === "app" && (m.acceptedHmrExports = /* @__PURE__ */ new Set()), m;
185
+ });
186
+ }
187
+ }
188
+ ];
189
+ return globalThis.__vxrnAddNativePlugins = [(0, import_clientTreeShakePlugin.clientTreeShakePlugin)()], globalThis.__vxrnAddWebPluginsProd = devAndProdPlugins, [
190
+ ...devAndProdPlugins,
191
+ /**
192
+ * This is really the meat of one, where it handles requests:
193
+ */
194
+ (0, import_createFileSystemRouter.createFileSystemRouter)(options),
195
+ (0, import_generateTypesForRoutes.generateTypesForRoutes)(options),
196
+ (0, import_clientTreeShakePlugin.clientTreeShakePlugin)(),
197
+ (0, import_fixDependenciesPlugin.fixDependenciesPlugin)(options.deps),
198
+ (0, import_virtualEntryPlugin.createVirtualEntry)({
199
+ ...options,
200
+ root: "app"
201
+ }),
202
+ {
203
+ name: "one-define-environment",
204
+ config() {
205
+ return {
206
+ define: {
207
+ ...options.app?.key && {
208
+ "process.env.ONE_APP_NAME": JSON.stringify(options.app.key),
209
+ "import.meta.env.ONE_APP_NAME": JSON.stringify(options.app.key)
210
+ },
211
+ "process.env.ONE_CACHE_KEY": JSON.stringify(import_constants.CACHE_KEY),
212
+ "import.meta.env.ONE_CACHE_KEY": JSON.stringify(import_constants.CACHE_KEY)
213
+ }
214
+ };
215
+ }
216
+ },
217
+ {
218
+ name: "one-use-react-18-for-native",
219
+ enforce: "pre",
220
+ async config() {
221
+ const sharedNativeConfig = {
222
+ resolve: {
223
+ alias: {
224
+ react: (0, import_resolve.resolvePath)("one/react-18"),
225
+ "react-dom": (0, import_resolve.resolvePath)("one/react-dom-18")
226
+ }
227
+ }
228
+ };
229
+ return {
230
+ environments: {
231
+ ios: {
232
+ ...sharedNativeConfig
233
+ },
234
+ android: {
235
+ ...sharedNativeConfig
236
+ }
237
+ // this started erroring for no reason..
238
+ }
239
+ };
240
+ }
241
+ },
242
+ {
243
+ name: "one-optimize-deps-load-web-extensions",
244
+ enforce: "pre",
245
+ applyToEnvironment(environment) {
246
+ return (0, import_vxrn.isWebEnvironment)(environment);
247
+ },
248
+ async resolveId(id, importer = "") {
249
+ if (optimizeIdRegex.test(importer)) {
250
+ const absolutePath = (0, import_node_path.resolve)((0, import_node_path.dirname)(importer), id), webPath = absolutePath.replace(/(.m?js)/, "") + ".web.js";
251
+ if (webPath === id) return;
252
+ try {
253
+ const directoryPath = absolutePath + "/index.web.js";
254
+ if (await (0, import_existsAsync.existsAsync)(directoryPath))
255
+ return directoryPath;
256
+ if (await (0, import_existsAsync.existsAsync)(webPath))
257
+ return webPath;
258
+ } catch (err) {
259
+ console.warn("error probably fine", err);
260
+ }
261
+ }
262
+ }
263
+ },
264
+ (0, import_vitePluginSsrCss.vitePluginSsrCss)({
265
+ entries: [import_virtualEntryPlugin.virtualEntryId]
266
+ })
267
+ ];
268
+ }
269
+ let oneOptions = null;
270
+ async function getUserOneOptions(command) {
271
+ if (!oneOptions) {
272
+ if (!command) throw new Error("Options not loaded and no command given");
273
+ await loadUserOneOptions(command);
274
+ }
275
+ if (!oneOptions)
276
+ throw new Error("No One options were loaded");
277
+ return oneOptions;
278
+ }
279
+ async function loadUserOneOptions(command) {
280
+ if (!await (0, import_vite.loadConfigFromFile)({
281
+ mode: "prod",
282
+ command
283
+ }))
284
+ throw new Error(`No config found in ${process.cwd()}. Is this the correct directory?`);
285
+ const foundOptions = getUserOneOptions();
286
+ if (!foundOptions)
287
+ throw new Error("No One plugin found in this vite.config");
288
+ return foundOptions;
289
+ }
290
+ //# sourceMappingURL=one.js.map
@@ -0,0 +1,50 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: !0 });
8
+ }, __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from == "object" || typeof from == "function")
10
+ for (let key of __getOwnPropNames(from))
11
+ !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
15
+ var removeReactNativeWebAnimatedPlugin_exports = {};
16
+ __export(removeReactNativeWebAnimatedPlugin_exports, {
17
+ removeReactNativeWebAnimatedPlugin: () => removeReactNativeWebAnimatedPlugin
18
+ });
19
+ module.exports = __toCommonJS(removeReactNativeWebAnimatedPlugin_exports);
20
+ function removeReactNativeWebAnimatedPlugin(opts) {
21
+ const filter = opts?.panResponder ? /(react-native\/Animated\/Animated|PlatformPressable|PanResponder|ResponderSystem)/ : /(react-native\/Animated\/Animated|PlatformPressable)/, optimizeDeps = {
22
+ esbuildOptions: {
23
+ plugins: [
24
+ {
25
+ name: "remove-react-native-web-animated",
26
+ setup(build) {
27
+ build.onResolve(
28
+ {
29
+ filter
30
+ },
31
+ (args) => ({ path: args.path, namespace: "proxy-wormify" })
32
+ ), build.onLoad({ filter: /.*/, namespace: "proxy-wormify" }, (args) => ({
33
+ contents: 'export * from "@tamagui/proxy-worm";',
34
+ loader: "js"
35
+ }));
36
+ }
37
+ }
38
+ ]
39
+ }
40
+ };
41
+ return {
42
+ name: "remove-react-native-web-animated",
43
+ config() {
44
+ return {
45
+ optimizeDeps
46
+ };
47
+ }
48
+ };
49
+ }
50
+ //# sourceMappingURL=removeReactNativeWebAnimatedPlugin.js.map
@@ -0,0 +1,34 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: !0 });
8
+ }, __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from == "object" || typeof from == "function")
10
+ for (let key of __getOwnPropNames(from))
11
+ !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
15
+ var replaceLoader_exports = {};
16
+ __export(replaceLoader_exports, {
17
+ replaceLoader: () => replaceLoader
18
+ });
19
+ module.exports = __toCommonJS(replaceLoader_exports);
20
+ function replaceLoader({
21
+ code,
22
+ loaderData
23
+ }) {
24
+ const stringifiedData = JSON.stringify(loaderData);
25
+ return code.includes("__vxrn__loader__") ? code.replace(
26
+ /["']__vxrn__loader__['"]/,
27
+ // make sure this ' ' is added in front,
28
+ // minifiers will do `return"something"
29
+ // but if its null then it becomes returnnull
30
+ " " + stringifiedData.replace(/\$/g, "$$$$")
31
+ ) : code + `
32
+ export const loader = () => (${stringifiedData})`;
33
+ }
34
+ //# sourceMappingURL=replaceLoader.js.map
@@ -0,0 +1,71 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: !0 });
8
+ }, __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from == "object" || typeof from == "function")
10
+ for (let key of __getOwnPropNames(from))
11
+ !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
15
+ var resolveAPIRequest_exports = {};
16
+ __export(resolveAPIRequest_exports, {
17
+ resolveAPIRequest: () => resolveAPIRequest
18
+ });
19
+ module.exports = __toCommonJS(resolveAPIRequest_exports);
20
+ var import_isResponse = require("../utils/isResponse"), import_headers = require("./headers");
21
+ function resolveAPIRequest(asyncImport, request, params) {
22
+ if (asyncImport)
23
+ return new Promise((res, rej) => {
24
+ const id = { _id: Math.random() };
25
+ import_headers.requestAsyncLocalStore.run(id, async () => {
26
+ try {
27
+ const imported = await asyncImport(), requestType = request.method || "GET", handler = imported[requestType] || imported.default;
28
+ if (!handler) {
29
+ console.warn(`No handler found for request ${requestType}`);
30
+ return;
31
+ }
32
+ let response = await handler(request, { params });
33
+ const asyncHeaders = import_headers.asyncHeadersCache.get(id);
34
+ if (asyncHeaders)
35
+ try {
36
+ response instanceof Response ? (0, import_headers.mergeHeaders)(response.headers, asyncHeaders) : response && typeof response == "object" ? response = Response.json(response, { headers: asyncHeaders }) : response = new Response(response, { headers: asyncHeaders });
37
+ } catch (err) {
38
+ if (`${err}`.includes("immutable")) {
39
+ const body = response.body ? await streamToString(response.body) : "";
40
+ response = new Response(body, {
41
+ headers: response.headers,
42
+ status: response.status,
43
+ statusText: response.statusText
44
+ }), (0, import_headers.mergeHeaders)(response.headers, asyncHeaders);
45
+ } else
46
+ console.error(` [one] error adding headers: ${err}`);
47
+ }
48
+ res(response);
49
+ } catch (err) {
50
+ (0, import_isResponse.isResponse)(err) ? res(err) : rej(err);
51
+ }
52
+ });
53
+ });
54
+ }
55
+ async function streamToString(stream) {
56
+ const reader = stream.getReader(), decoder = new TextDecoder();
57
+ let result = "";
58
+ try {
59
+ for (; ; ) {
60
+ const { done, value } = await reader.read();
61
+ if (done) break;
62
+ result += decoder.decode(value, { stream: !0 });
63
+ }
64
+ } catch (error) {
65
+ console.error("Error reading the stream:", error);
66
+ } finally {
67
+ reader.releaseLock();
68
+ }
69
+ return result;
70
+ }
71
+ //# sourceMappingURL=resolveAPIRequest.js.map
@@ -0,0 +1,16 @@
1
+ var import_node_worker_threads = require("node:worker_threads"), import_node_url = require("node:url"), import_module_runner = require("vite/module-runner");
2
+ const import_meta = {};
3
+ if (!import_node_worker_threads.parentPort)
4
+ throw new Error("No parent port");
5
+ const runner = new import_module_runner.ModuleRunner(
6
+ {
7
+ root: (0, import_node_url.fileURLToPath)(new URL("./", import_meta.url)),
8
+ transport: new import_module_runner.RemoteRunnerTransport({
9
+ send: (data) => import_node_worker_threads.parentPort.postMessage(data),
10
+ onMessage: (listener) => import_node_worker_threads.parentPort.on("message", listener),
11
+ timeout: 5e3
12
+ })
13
+ },
14
+ new import_module_runner.ESModulesEvaluator()
15
+ );
16
+ //# sourceMappingURL=server.js.map
@@ -0,0 +1,14 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __copyProps = (to, from, except, desc) => {
6
+ if (from && typeof from == "object" || typeof from == "function")
7
+ for (let key of __getOwnPropNames(from))
8
+ !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
9
+ return to;
10
+ };
11
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
12
+ var types_exports = {};
13
+ module.exports = __toCommonJS(types_exports);
14
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1,67 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: !0 });
8
+ }, __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from == "object" || typeof from == "function")
10
+ for (let key of __getOwnPropNames(from))
11
+ !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
15
+ var virtualEntryPlugin_exports = {};
16
+ __export(virtualEntryPlugin_exports, {
17
+ createVirtualEntry: () => createVirtualEntry,
18
+ virtalEntryIdClient: () => virtalEntryIdClient,
19
+ virtualEntryId: () => virtualEntryId,
20
+ virtualEntryIdName: () => virtualEntryIdName,
21
+ virtualEntryIdNative: () => virtualEntryIdNative
22
+ });
23
+ module.exports = __toCommonJS(virtualEntryPlugin_exports);
24
+ var import_vxrn = require("vxrn");
25
+ const virtualEntryIdName = "one-entry", virtualEntryId = `virtual:${virtualEntryIdName}`, virtalEntryIdClient = `/@id/__x00__virtual:${virtualEntryIdName}`, resolvedVirtualEntryId = "\0" + virtualEntryId, virtualEntryIdNativeName = `${virtualEntryIdName}-native`, virtualEntryIdNative = `virtual:${virtualEntryIdNativeName}`, resolvedVirtualEntryIdNative = "\0" + virtualEntryIdNativeName, USE_ONE_SETUP_FILE = `
26
+ if (process.env.ONE_SETUP_FILE) {
27
+ import(/* @vite-ignore */ process.env.ONE_SETUP_FILE)
28
+ }
29
+ `;
30
+ function createVirtualEntry(options) {
31
+ const appDirGlob = `/${options.root}/**/*.tsx`;
32
+ return {
33
+ name: "one-virtual-entry",
34
+ enforce: "pre",
35
+ resolveId(id) {
36
+ if (id === virtualEntryId)
37
+ return resolvedVirtualEntryId;
38
+ if (id === virtualEntryIdNative)
39
+ return resolvedVirtualEntryIdNative;
40
+ },
41
+ load(id) {
42
+ if (id === resolvedVirtualEntryId)
43
+ return `
44
+ ${(0, import_vxrn.isNativeEnvironment)(this.environment) ? "" : USE_ONE_SETUP_FILE}
45
+
46
+ import { createApp } from 'one'
47
+
48
+ // globbing ${appDirGlob}
49
+ export default createApp({
50
+ routes: import.meta.glob('${appDirGlob}'),
51
+ })
52
+ `;
53
+ if (id === resolvedVirtualEntryIdNative)
54
+ return `
55
+ ${(0, import_vxrn.isNativeEnvironment)(this.environment) ? "" : USE_ONE_SETUP_FILE}
56
+
57
+ import { createApp } from 'one'
58
+
59
+ // globbing ${appDirGlob}
60
+ export default createApp({
61
+ routes: import.meta.glob('${appDirGlob}'),
62
+ })
63
+ `;
64
+ }
65
+ };
66
+ }
67
+ //# sourceMappingURL=virtualEntryPlugin.js.map