one 1.1.298 → 1.1.299

Sign up to get free protection for your applications and to get access to all the features.
Files changed (279) hide show
  1. package/dist/cjs/vite/replaceLoader.js +7 -1
  2. package/dist/cjs/vite/replaceLoader.js.map +1 -1
  3. package/dist/cjs/vite/replaceLoader.native.js +7 -1
  4. package/dist/cjs/vite/replaceLoader.native.js.map +1 -1
  5. package/dist/esm/Root.native.js +110 -104
  6. package/dist/esm/Root.native.js.map +6 -1
  7. package/dist/esm/Route.native.js +12 -10
  8. package/dist/esm/Route.native.js.map +6 -1
  9. package/dist/esm/cleanUrl.native.js +12 -13
  10. package/dist/esm/cleanUrl.native.js.map +6 -1
  11. package/dist/esm/cli/label-process.native.js +5 -4
  12. package/dist/esm/cli/label-process.native.js.map +6 -1
  13. package/dist/esm/cli/main.native.js +8 -13
  14. package/dist/esm/cli/main.native.js.map +6 -1
  15. package/dist/esm/cli/prebuild.native.js +5 -5
  16. package/dist/esm/cli/prebuild.native.js.map +6 -1
  17. package/dist/esm/cli/run.native.js +21 -28
  18. package/dist/esm/cli/run.native.js.map +6 -1
  19. package/dist/esm/cli.native.js +119 -148
  20. package/dist/esm/cli.native.js.map +6 -1
  21. package/dist/esm/clientLoaderResolver.native.js +9 -6
  22. package/dist/esm/clientLoaderResolver.native.js.map +6 -1
  23. package/dist/esm/config.native.js +12 -11
  24. package/dist/esm/config.native.js.map +6 -1
  25. package/dist/esm/constants.native.js +7 -5
  26. package/dist/esm/constants.native.js.map +6 -1
  27. package/dist/esm/createApp.native.js +13 -9
  28. package/dist/esm/createApp.native.js.map +6 -1
  29. package/dist/esm/createHandleRequest.native.js +55 -64
  30. package/dist/esm/createHandleRequest.native.js.map +6 -1
  31. package/dist/esm/createRoute.native.js +16 -16
  32. package/dist/esm/createRoute.native.js.map +6 -1
  33. package/dist/esm/fallbackViews/Sitemap.native.js +6 -3
  34. package/dist/esm/fallbackViews/Sitemap.native.js.map +6 -1
  35. package/dist/esm/fallbackViews/Unmatched.native.js +5 -3
  36. package/dist/esm/fallbackViews/Unmatched.native.js.map +6 -1
  37. package/dist/esm/fork/NavigationContainer.native.js +24 -31
  38. package/dist/esm/fork/NavigationContainer.native.js.map +6 -1
  39. package/dist/esm/fork/createMemoryHistory.native.js +99 -115
  40. package/dist/esm/fork/createMemoryHistory.native.js.map +6 -1
  41. package/dist/esm/fork/extractPathFromURL.native.js +16 -15
  42. package/dist/esm/fork/extractPathFromURL.native.js.map +6 -1
  43. package/dist/esm/fork/findFocusedRoute.native.js +6 -5
  44. package/dist/esm/fork/findFocusedRoute.native.js.map +6 -1
  45. package/dist/esm/fork/getPathFromState.native.js +127 -140
  46. package/dist/esm/fork/getPathFromState.native.js.map +6 -1
  47. package/dist/esm/fork/getStateFromPath.native.js +292 -288
  48. package/dist/esm/fork/getStateFromPath.native.js.map +6 -1
  49. package/dist/esm/fork/useLinking.native.js +70 -61
  50. package/dist/esm/fork/useLinking.native.js.map +6 -1
  51. package/dist/esm/fork/validatePathConfig.native.js +15 -9
  52. package/dist/esm/fork/validatePathConfig.native.js.map +6 -1
  53. package/dist/esm/getLinkingConfig.native.js +11 -6
  54. package/dist/esm/getLinkingConfig.native.js.map +6 -1
  55. package/dist/esm/getReactNavigationConfig.native.js +28 -20
  56. package/dist/esm/getReactNavigationConfig.native.js.map +6 -1
  57. package/dist/esm/getRoutes.native.js +249 -229
  58. package/dist/esm/getRoutes.native.js.map +6 -1
  59. package/dist/esm/getURL.native.js +4 -4
  60. package/dist/esm/getURL.native.js.map +6 -1
  61. package/dist/esm/head/Head.android.js +5 -3
  62. package/dist/esm/head/Head.android.js.map +6 -1
  63. package/dist/esm/head/Head.ios.js +144 -132
  64. package/dist/esm/head/Head.ios.js.map +6 -1
  65. package/dist/esm/head/Head.native.js +7 -7
  66. package/dist/esm/head/Head.native.js.map +6 -1
  67. package/dist/esm/head/HeadModule.native.js +6 -6
  68. package/dist/esm/head/HeadModule.native.js.map +6 -1
  69. package/dist/esm/head/index.native.js +2 -2
  70. package/dist/esm/head/index.native.js.map +6 -1
  71. package/dist/esm/head/types.native.js +1 -2
  72. package/dist/esm/head/types.native.js.map +6 -1
  73. package/dist/esm/head/url.native.js +10 -8
  74. package/dist/esm/head/url.native.js.map +6 -1
  75. package/dist/esm/hooks.native.js +53 -34
  76. package/dist/esm/hooks.native.js.map +6 -1
  77. package/dist/esm/imperative-api.native.js +9 -6
  78. package/dist/esm/imperative-api.native.js.map +6 -1
  79. package/dist/esm/import-mode/index.android.js +4 -3
  80. package/dist/esm/import-mode/index.android.js.map +6 -1
  81. package/dist/esm/import-mode/index.ios.js +4 -3
  82. package/dist/esm/import-mode/index.ios.js.map +6 -1
  83. package/dist/esm/import-mode/index.native.js +3 -1
  84. package/dist/esm/import-mode/index.native.js.map +6 -1
  85. package/dist/esm/index.native.js +65 -27
  86. package/dist/esm/index.native.js.map +6 -1
  87. package/dist/esm/interfaces/router.native.js +4 -2
  88. package/dist/esm/interfaces/router.native.js.map +6 -1
  89. package/dist/esm/layouts/Drawer.native.js +7 -6
  90. package/dist/esm/layouts/Drawer.native.js.map +6 -1
  91. package/dist/esm/layouts/Stack.native.js +7 -6
  92. package/dist/esm/layouts/Stack.native.js.map +6 -1
  93. package/dist/esm/layouts/Tabs.native.js +42 -39
  94. package/dist/esm/layouts/Tabs.native.js.map +6 -1
  95. package/dist/esm/layouts/withLayoutContext.native.js +51 -48
  96. package/dist/esm/layouts/withLayoutContext.native.js.map +6 -1
  97. package/dist/esm/link/Link.native.js +62 -53
  98. package/dist/esm/link/Link.native.js.map +6 -1
  99. package/dist/esm/link/Redirect.native.js +8 -9
  100. package/dist/esm/link/Redirect.native.js.map +6 -1
  101. package/dist/esm/link/href.native.js +28 -27
  102. package/dist/esm/link/href.native.js.map +6 -1
  103. package/dist/esm/link/linking.native.js +51 -40
  104. package/dist/esm/link/linking.native.js.map +6 -1
  105. package/dist/esm/link/path.native.js +28 -19
  106. package/dist/esm/link/path.native.js.map +6 -1
  107. package/dist/esm/link/useLinkTo.native.js +22 -20
  108. package/dist/esm/link/useLinkTo.native.js.map +6 -1
  109. package/dist/esm/link/useLoadedNavigation.native.js +30 -23
  110. package/dist/esm/link/useLoadedNavigation.native.js.map +6 -1
  111. package/dist/esm/matchers.native.js +16 -3
  112. package/dist/esm/matchers.native.js.map +6 -1
  113. package/dist/esm/platform.native.js +4 -2
  114. package/dist/esm/platform.native.js.map +6 -1
  115. package/dist/esm/polyfills-mobile.native.js +4 -5
  116. package/dist/esm/polyfills-mobile.native.js.map +6 -1
  117. package/dist/esm/polyfills-server.native.js +1 -1
  118. package/dist/esm/polyfills-server.native.js.map +6 -1
  119. package/dist/esm/render.native.js +3 -1
  120. package/dist/esm/render.native.js.map +6 -1
  121. package/dist/esm/router/RouterStore.native.js +1 -2
  122. package/dist/esm/router/RouterStore.native.js.map +6 -1
  123. package/dist/esm/router/constants.native.js +4 -2
  124. package/dist/esm/router/constants.native.js.map +6 -1
  125. package/dist/esm/router/getNormalizedStatePath.native.js +18 -17
  126. package/dist/esm/router/getNormalizedStatePath.native.js.map +6 -1
  127. package/dist/esm/router/lastAction.native.js +10 -9
  128. package/dist/esm/router/lastAction.native.js.map +6 -1
  129. package/dist/esm/router/router.native.js +135 -114
  130. package/dist/esm/router/router.native.js.map +6 -1
  131. package/dist/esm/router/serverLocationContext.native.js +4 -2
  132. package/dist/esm/router/serverLocationContext.native.js.map +6 -1
  133. package/dist/esm/router/useInitializeOneRouter.native.js +8 -5
  134. package/dist/esm/router/useInitializeOneRouter.native.js.map +6 -1
  135. package/dist/esm/serve.native.js +77 -104
  136. package/dist/esm/serve.native.js.map +6 -1
  137. package/dist/esm/server/createRoutesManifest.native.js +14 -11
  138. package/dist/esm/server/createRoutesManifest.native.js.map +6 -1
  139. package/dist/esm/server/getServerManifest.native.js +61 -67
  140. package/dist/esm/server/getServerManifest.native.js.map +6 -1
  141. package/dist/esm/server-render.native.js +9 -10
  142. package/dist/esm/server-render.native.js.map +6 -1
  143. package/dist/esm/sortRoutes.native.js +27 -17
  144. package/dist/esm/sortRoutes.native.js.map +6 -1
  145. package/dist/esm/typed-routes/generateRouteTypes.native.js +10 -11
  146. package/dist/esm/typed-routes/generateRouteTypes.native.js.map +6 -1
  147. package/dist/esm/typed-routes/getTypedRoutesDeclarationFile.native.js +38 -37
  148. package/dist/esm/typed-routes/getTypedRoutesDeclarationFile.native.js.map +6 -1
  149. package/dist/esm/types.native.js +1 -2
  150. package/dist/esm/types.native.js.map +6 -1
  151. package/dist/esm/useFocusEffect.native.js +25 -22
  152. package/dist/esm/useFocusEffect.native.js.map +6 -1
  153. package/dist/esm/useLoader.native.js +50 -50
  154. package/dist/esm/useLoader.native.js.map +6 -1
  155. package/dist/esm/useNavigation.native.js +23 -19
  156. package/dist/esm/useNavigation.native.js.map +6 -1
  157. package/dist/esm/useScreens.native.js +143 -160
  158. package/dist/esm/useScreens.native.js.map +6 -1
  159. package/dist/esm/useViteRoutes.native.js +25 -28
  160. package/dist/esm/useViteRoutes.native.js.map +6 -1
  161. package/dist/esm/utils/assertIsReady.native.js +6 -3
  162. package/dist/esm/utils/assertIsReady.native.js.map +6 -1
  163. package/dist/esm/utils/dynamicImport.native.js +5 -3
  164. package/dist/esm/utils/dynamicImport.native.js.map +6 -1
  165. package/dist/esm/utils/existsAsync.native.js +6 -4
  166. package/dist/esm/utils/existsAsync.native.js.map +6 -1
  167. package/dist/esm/utils/getPageExport.native.js +12 -11
  168. package/dist/esm/utils/getPageExport.native.js.map +6 -1
  169. package/dist/esm/utils/globDir.native.js +5 -3
  170. package/dist/esm/utils/globDir.native.js.map +6 -1
  171. package/dist/esm/utils/hashString.native.js +4 -2
  172. package/dist/esm/utils/hashString.native.js.map +6 -1
  173. package/dist/esm/utils/isResponse.native.js +4 -2
  174. package/dist/esm/utils/isResponse.native.js.map +6 -1
  175. package/dist/esm/utils/isStatus.native.js +4 -2
  176. package/dist/esm/utils/isStatus.native.js.map +6 -1
  177. package/dist/esm/utils/promiseWithResolvers.native.js +7 -7
  178. package/dist/esm/utils/promiseWithResolvers.native.js.map +6 -1
  179. package/dist/esm/utils/rand.native.js +5 -3
  180. package/dist/esm/utils/rand.native.js.map +6 -1
  181. package/dist/esm/utils/redirect.native.js +7 -5
  182. package/dist/esm/utils/redirect.native.js.map +6 -1
  183. package/dist/esm/utils/removeSearch.native.js +4 -2
  184. package/dist/esm/utils/removeSearch.native.js.map +6 -1
  185. package/dist/esm/utils/removeUndefined.native.js +6 -3
  186. package/dist/esm/utils/removeUndefined.native.js.map +6 -1
  187. package/dist/esm/utils/requireResolve.native.js +4 -2
  188. package/dist/esm/utils/requireResolve.native.js.map +6 -1
  189. package/dist/esm/utils/url.native.js +6 -2
  190. package/dist/esm/utils/url.native.js.map +6 -1
  191. package/dist/esm/utils/weakKey.native.js +11 -10
  192. package/dist/esm/utils/weakKey.native.js.map +6 -1
  193. package/dist/esm/utils/weakMemo.native.js +8 -8
  194. package/dist/esm/utils/weakMemo.native.js.map +6 -1
  195. package/dist/esm/views/EmptyRoute.native.js +5 -3
  196. package/dist/esm/views/EmptyRoute.native.js.map +6 -1
  197. package/dist/esm/views/ErrorBoundary.native.js +5 -8
  198. package/dist/esm/views/ErrorBoundary.native.js.map +6 -1
  199. package/dist/esm/views/LoadProgressBar.native.js +58 -57
  200. package/dist/esm/views/LoadProgressBar.native.js.map +6 -1
  201. package/dist/esm/views/Navigator.native.js +54 -71
  202. package/dist/esm/views/Navigator.native.js.map +6 -1
  203. package/dist/esm/views/PreloadLinks.native.js +3 -1
  204. package/dist/esm/views/PreloadLinks.native.js.map +6 -1
  205. package/dist/esm/views/RootErrorBoundary.native.js +39 -29
  206. package/dist/esm/views/RootErrorBoundary.native.js.map +6 -1
  207. package/dist/esm/views/Screen.native.js +12 -12
  208. package/dist/esm/views/Screen.native.js.map +6 -1
  209. package/dist/esm/views/ScrollRestoration.native.js +27 -27
  210. package/dist/esm/views/ScrollRestoration.native.js.map +6 -1
  211. package/dist/esm/views/Try.native.js +40 -37
  212. package/dist/esm/views/Try.native.js.map +6 -1
  213. package/dist/esm/vite/build.native.js +260 -295
  214. package/dist/esm/vite/build.native.js.map +6 -1
  215. package/dist/esm/vite/clientTreeShakePlugin.native.js +34 -33
  216. package/dist/esm/vite/clientTreeShakePlugin.native.js.map +6 -1
  217. package/dist/esm/vite/constants.native.js +6 -4
  218. package/dist/esm/vite/constants.native.js.map +6 -1
  219. package/dist/esm/vite/createFileSystemRouter.native.js +99 -130
  220. package/dist/esm/vite/createFileSystemRouter.native.js.map +6 -1
  221. package/dist/esm/vite/customNodeExternals.native.js +9 -10
  222. package/dist/esm/vite/customNodeExternals.native.js.map +6 -1
  223. package/dist/esm/vite/ensureTsConfig.native.js +7 -5
  224. package/dist/esm/vite/ensureTsConfig.native.js.map +6 -1
  225. package/dist/esm/vite/findDepsToOptimize.native.js +27 -19
  226. package/dist/esm/vite/findDepsToOptimize.native.js.map +6 -1
  227. package/dist/esm/vite/fixDependenciesPlugin.native.js +5 -3
  228. package/dist/esm/vite/fixDependenciesPlugin.native.js.map +6 -1
  229. package/dist/esm/vite/generateTypesForRoutes.native.js +9 -9
  230. package/dist/esm/vite/generateTypesForRoutes.native.js.map +6 -1
  231. package/dist/esm/vite/getManifest.native.js +6 -4
  232. package/dist/esm/vite/getManifest.native.js.map +6 -1
  233. package/dist/esm/vite/headers.native.js +11 -5
  234. package/dist/esm/vite/headers.native.js.map +6 -1
  235. package/dist/esm/vite/loadEnv.native.js +7 -6
  236. package/dist/esm/vite/loadEnv.native.js.map +6 -1
  237. package/dist/esm/vite/makePluginWebOnly.native.js +9 -5
  238. package/dist/esm/vite/makePluginWebOnly.native.js.map +6 -1
  239. package/dist/esm/vite/one.native.js +142 -127
  240. package/dist/esm/vite/one.native.js.map +6 -1
  241. package/dist/esm/vite/removeReactNativeWebAnimatedPlugin.native.js +14 -11
  242. package/dist/esm/vite/removeReactNativeWebAnimatedPlugin.native.js.map +6 -1
  243. package/dist/esm/vite/replaceLoader.js +7 -1
  244. package/dist/esm/vite/replaceLoader.js.map +1 -1
  245. package/dist/esm/vite/replaceLoader.mjs +5 -1
  246. package/dist/esm/vite/replaceLoader.mjs.map +1 -1
  247. package/dist/esm/vite/replaceLoader.native.js +13 -10
  248. package/dist/esm/vite/replaceLoader.native.js.map +6 -1
  249. package/dist/esm/vite/resolveAPIRequest.native.js +44 -47
  250. package/dist/esm/vite/resolveAPIRequest.native.js.map +6 -1
  251. package/dist/esm/vite/server.native.js +5 -4
  252. package/dist/esm/vite/server.native.js.map +6 -1
  253. package/dist/esm/vite/types.native.js +1 -2
  254. package/dist/esm/vite/types.native.js.map +6 -1
  255. package/dist/esm/vite/virtualEntryPlugin.native.js +21 -16
  256. package/dist/esm/vite/virtualEntryPlugin.native.js.map +6 -1
  257. package/dist/esm/vite/vitePluginSsrCss.native.js +61 -50
  258. package/dist/esm/vite/vitePluginSsrCss.native.js.map +6 -1
  259. package/dist/esm/vite.native.js +19 -10
  260. package/dist/esm/vite.native.js.map +6 -1
  261. package/dist/esm/zero/getQueryKey.native.js +5 -3
  262. package/dist/esm/zero/getQueryKey.native.js.map +6 -1
  263. package/dist/esm/zero/isZeroQuery.native.js +4 -2
  264. package/dist/esm/zero/isZeroQuery.native.js.map +6 -1
  265. package/dist/esm/zero/resolveQuery.native.js +9 -8
  266. package/dist/esm/zero/resolveQuery.native.js.map +6 -1
  267. package/dist/esm/zero/subscribeToQuery.native.js +5 -3
  268. package/dist/esm/zero/subscribeToQuery.native.js.map +6 -1
  269. package/dist/esm/zero/types.native.js +1 -2
  270. package/dist/esm/zero/types.native.js.map +6 -1
  271. package/dist/esm/zero/useQuery.native.js +12 -12
  272. package/dist/esm/zero/useQuery.native.js.map +6 -1
  273. package/dist/esm/zero/useQueryZero.native.js +24 -20
  274. package/dist/esm/zero/useQueryZero.native.js.map +6 -1
  275. package/dist/esm/zero.native.js +9 -5
  276. package/dist/esm/zero.native.js.map +6 -1
  277. package/package.json +7 -7
  278. package/src/vite/replaceLoader.ts +7 -1
  279. package/types/vite/replaceLoader.d.ts.map +1 -1
@@ -3,55 +3,51 @@ import path, { dirname, resolve } from "node:path";
3
3
  import { loadConfigFromFile } from "vite";
4
4
  import tsconfigPaths from "vite-tsconfig-paths";
5
5
  import { getOptimizeDeps, getOptionsFilled, isWebEnvironment } from "vxrn";
6
- import "../polyfills-server.native.js";
7
- import { existsAsync } from "../utils/existsAsync.native.js";
8
- import { requireResolve } from "../utils/requireResolve.native.js";
9
- import { clientTreeShakePlugin } from "./clientTreeShakePlugin.native.js";
10
- import { createFileSystemRouter } from "./createFileSystemRouter.native.js";
11
- import { ensureTSConfig } from "./ensureTsConfig.native.js";
12
- import { fixDependenciesPlugin } from "./fixDependenciesPlugin.native.js";
13
- import { generateTypesForRoutes } from "./generateTypesForRoutes.native.js";
14
- import { loadEnv } from "./loadEnv.native.js";
15
- import { createVirtualEntry, virtualEntryId } from "./virtualEntryPlugin.native.js";
16
- import { vitePluginSsrCss } from "./vitePluginSsrCss.native.js";
6
+ import "../polyfills-server";
7
+ import { existsAsync } from "../utils/existsAsync";
8
+ import { requireResolve } from "../utils/requireResolve";
9
+ import { clientTreeShakePlugin } from "./clientTreeShakePlugin";
10
+ import { createFileSystemRouter } from "./createFileSystemRouter";
11
+ import { ensureTSConfig } from "./ensureTsConfig";
12
+ import { fixDependenciesPlugin } from "./fixDependenciesPlugin";
13
+ import { generateTypesForRoutes } from "./generateTypesForRoutes";
14
+ import { loadEnv } from "./loadEnv";
15
+ import { createVirtualEntry, virtualEntryId } from "./virtualEntryPlugin";
16
+ import { vitePluginSsrCss } from "./vitePluginSsrCss";
17
17
  events.setMaxListeners(1e3);
18
18
  globalThis.__vxrnEnableNativeEnv = !0;
19
19
  function one() {
20
- var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {},
21
- _options_config;
20
+ var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, _options_config;
22
21
  oneOptions = options, loadEnv(process.cwd()), ((_options_config = options.config) === null || _options_config === void 0 ? void 0 : _options_config.ensureTSConfig) !== !1 && ensureTSConfig(), globalThis.__vxrnPluginConfig__ = options;
23
- var {
24
- optimizeDeps
25
- } = getOptimizeDeps("build"),
26
- optimizeIds = optimizeDeps.include,
27
- optimizeIdRegex = new RegExp(
22
+ var { optimizeDeps } = getOptimizeDeps("build"), optimizeIds = optimizeDeps.include, optimizeIdRegex = new RegExp(
28
23
  // santize ids for regex
29
24
  // https://stackoverflow.com/questions/6300183/sanitize-string-of-regex-characters-before-regexp-build
30
- `${optimizeIds.map(function (id) {
25
+ `${optimizeIds.map(function(id) {
31
26
  return id.replace(/[#-.]|[[-^]|[?|{}]/g, "\\$&");
32
- }).join("|")}`),
33
- tsConfigPathsPlugin = null,
34
- vxrnOptions = getOptionsFilled(),
35
- devAndProdPlugins = [
27
+ }).join("|")}`
28
+ ), tsConfigPathsPlugin = null, vxrnOptions = getOptionsFilled(), devAndProdPlugins = [
36
29
  // proxy because you cant add a plugin inside a plugin
37
30
  new Proxy({
38
31
  name: "one:tsconfig-paths",
39
32
  config(configIncoming) {
40
- var _options_config2,
41
- _configIncoming_plugins,
42
- pathsConfig = (_options_config2 = options.config) === null || _options_config2 === void 0 ? void 0 : _options_config2.tsConfigPaths;
43
- pathsConfig !== !1 && (!((_configIncoming_plugins = configIncoming.plugins) === null || _configIncoming_plugins === void 0) && _configIncoming_plugins.flat().some(function (p) {
33
+ var _options_config2, _configIncoming_plugins, pathsConfig = (_options_config2 = options.config) === null || _options_config2 === void 0 ? void 0 : _options_config2.tsConfigPaths;
34
+ pathsConfig !== !1 && (!((_configIncoming_plugins = configIncoming.plugins) === null || _configIncoming_plugins === void 0) && _configIncoming_plugins.flat().some(function(p) {
44
35
  return p && p.name === "vite-tsconfig-paths";
45
36
  }) || (tsConfigPathsPlugin = tsconfigPaths(pathsConfig && typeof pathsConfig == "object" ? pathsConfig : {})));
46
37
  },
47
- configResolved() {},
48
- resolveId() {}
38
+ configResolved() {
39
+ },
40
+ resolveId() {
41
+ }
49
42
  }, {
50
43
  get(target, key, thisArg) {
51
- if (key === "config" || key === "name") return Reflect.get(target, key, thisArg);
52
- if (tsConfigPathsPlugin) return Reflect.get(tsConfigPathsPlugin, key, thisArg);
44
+ if (key === "config" || key === "name")
45
+ return Reflect.get(target, key, thisArg);
46
+ if (tsConfigPathsPlugin)
47
+ return Reflect.get(tsConfigPathsPlugin, key, thisArg);
53
48
  }
54
- }), {
49
+ }),
50
+ {
55
51
  name: "one-slim-deps",
56
52
  enforce: "pre",
57
53
  config() {
@@ -85,15 +81,15 @@ function one() {
85
81
  var _options_web;
86
82
  return {
87
83
  define: {
88
- ...(((_options_web = options.web) === null || _options_web === void 0 ? void 0 : _options_web.defaultRenderMode) && {
84
+ ...((_options_web = options.web) === null || _options_web === void 0 ? void 0 : _options_web.defaultRenderMode) && {
89
85
  "process.env.One_DEFAULT_RENDER_MODE": JSON.stringify(options.web.defaultRenderMode)
90
- }),
91
- ...(options.setupFile && {
86
+ },
87
+ ...options.setupFile && {
92
88
  "process.env.One_SETUP_FILE": JSON.stringify(options.setupFile)
93
- }),
94
- ...(process.env.NODE_ENV !== "production" && vxrnOptions && {
89
+ },
90
+ ...process.env.NODE_ENV !== "production" && vxrnOptions && {
95
91
  "process.env.ONE_SERVER_URL": JSON.stringify(vxrnOptions.server.url)
96
- })
92
+ }
97
93
  },
98
94
  environments: {
99
95
  client: {
@@ -109,19 +105,22 @@ function one() {
109
105
  }
110
106
  };
111
107
  }
112
- }, {
108
+ },
109
+ {
113
110
  name: "one-zero",
114
111
  config() {
115
- if (options.zero) return {
116
- define: {
117
- "process.env.ZERO_ENABLED": "true",
118
- TESTING: "false",
119
- REPLICACHE_VERSION: '"15.2.1"',
120
- ZERO_VERSION: '"0.0.0"'
121
- }
122
- };
112
+ if (options.zero)
113
+ return {
114
+ define: {
115
+ "process.env.ZERO_ENABLED": "true",
116
+ TESTING: "false",
117
+ REPLICACHE_VERSION: '"15.2.1"',
118
+ ZERO_VERSION: '"0.0.0"'
119
+ }
120
+ };
123
121
  }
124
- }, {
122
+ },
123
+ {
125
124
  name: "tamagui-react-19",
126
125
  config() {
127
126
  return {
@@ -131,91 +130,101 @@ function one() {
131
130
  }
132
131
  };
133
132
  }
134
- }, {
133
+ },
134
+ {
135
135
  name: "route-module-hmr-fix",
136
136
  hotUpdate(param) {
137
- var {
138
- server,
139
- modules
140
- } = param;
141
- return modules.map(function (m) {
142
- var {
143
- id
144
- } = m;
137
+ var { server, modules } = param;
138
+ return modules.map(function(m) {
139
+ var { id } = m;
145
140
  if (!id) return m;
146
- var relativePath = path.relative(server.config.root, id),
147
- rootDir = relativePath.split(path.sep)[0];
148
- return rootDir === "app" && (m.acceptedHmrExports = /* @__PURE__ */new Set()), m;
141
+ var relativePath = path.relative(server.config.root, id), rootDir = relativePath.split(path.sep)[0];
142
+ return rootDir === "app" && (m.acceptedHmrExports = /* @__PURE__ */ new Set()), m;
149
143
  });
150
144
  }
151
- }];
152
- return globalThis.__vxrnAddNativePlugins = [clientTreeShakePlugin()], globalThis.__vxrnAddWebPluginsProd = devAndProdPlugins, [...devAndProdPlugins,
153
- /**
154
- * This is really the meat of one, where it handles requests:
155
- */
156
- createFileSystemRouter(options), generateTypesForRoutes(options), clientTreeShakePlugin(), fixDependenciesPlugin(options.deps), createVirtualEntry({
157
- ...options,
158
- root: "app"
159
- }), {
160
- name: "define-app-key",
161
- config() {
162
- var _options_app;
163
- if (!((_options_app = options.app) === null || _options_app === void 0) && _options_app.key) return {
164
- define: {
165
- "process.env.One_APP_NAME": JSON.stringify(options.app.key)
166
- }
167
- };
168
145
  }
169
- }, {
170
- name: "use-react-18-for-native",
171
- enforce: "pre",
172
- async config() {
173
- var sharedNativeConfig = {
174
- resolve: {
175
- alias: {
176
- react: requireResolve("one/react-18"),
177
- "react-dom": requireResolve("one/react-dom-18")
146
+ ];
147
+ return globalThis.__vxrnAddNativePlugins = [
148
+ clientTreeShakePlugin()
149
+ ], globalThis.__vxrnAddWebPluginsProd = devAndProdPlugins, [
150
+ ...devAndProdPlugins,
151
+ /**
152
+ * This is really the meat of one, where it handles requests:
153
+ */
154
+ createFileSystemRouter(options),
155
+ generateTypesForRoutes(options),
156
+ clientTreeShakePlugin(),
157
+ fixDependenciesPlugin(options.deps),
158
+ createVirtualEntry({
159
+ ...options,
160
+ root: "app"
161
+ }),
162
+ {
163
+ name: "define-app-key",
164
+ config() {
165
+ var _options_app;
166
+ if (!((_options_app = options.app) === null || _options_app === void 0) && _options_app.key)
167
+ return {
168
+ define: {
169
+ "process.env.One_APP_NAME": JSON.stringify(options.app.key)
170
+ }
171
+ };
172
+ }
173
+ },
174
+ {
175
+ name: "use-react-18-for-native",
176
+ enforce: "pre",
177
+ async config() {
178
+ var sharedNativeConfig = {
179
+ resolve: {
180
+ alias: {
181
+ react: requireResolve("one/react-18"),
182
+ "react-dom": requireResolve("one/react-dom-18")
183
+ }
178
184
  }
179
- }
180
- };
181
- return {
182
- environments: {
183
- ios: {
184
- ...sharedNativeConfig
185
- },
186
- android: {
187
- ...sharedNativeConfig
185
+ };
186
+ return {
187
+ environments: {
188
+ ios: {
189
+ ...sharedNativeConfig
190
+ },
191
+ android: {
192
+ ...sharedNativeConfig
193
+ }
188
194
  }
189
- }
190
- };
191
- }
192
- },
193
- // this started erroring for no reason..
194
- {
195
- name: "optimize-deps-load-web-extensions",
196
- enforce: "pre",
197
- applyToEnvironment(environment) {
198
- return isWebEnvironment(environment);
195
+ };
196
+ }
199
197
  },
200
- async resolveId(id) {
201
- var importer = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "",
202
- shouldOptimize = optimizeIdRegex.test(importer);
203
- if (shouldOptimize) {
204
- var absolutePath = resolve(dirname(importer), id),
205
- webPath = absolutePath.replace(/(.m?js)/, "") + ".web.js";
206
- if (webPath === id) return;
207
- try {
208
- var directoryPath = absolutePath + "/index.web.js";
209
- if (await existsAsync(directoryPath)) return directoryPath;
210
- if (await existsAsync(webPath)) return webPath;
211
- } catch (err) {
212
- console.warn("error probably fine", err);
198
+ // this started erroring for no reason..
199
+ {
200
+ name: "optimize-deps-load-web-extensions",
201
+ enforce: "pre",
202
+ applyToEnvironment(environment) {
203
+ return isWebEnvironment(environment);
204
+ },
205
+ async resolveId(id) {
206
+ var importer = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "", shouldOptimize = optimizeIdRegex.test(importer);
207
+ if (shouldOptimize) {
208
+ var absolutePath = resolve(dirname(importer), id), webPath = absolutePath.replace(/(.m?js)/, "") + ".web.js";
209
+ if (webPath === id) return;
210
+ try {
211
+ var directoryPath = absolutePath + "/index.web.js";
212
+ if (await existsAsync(directoryPath))
213
+ return directoryPath;
214
+ if (await existsAsync(webPath))
215
+ return webPath;
216
+ } catch (err) {
217
+ console.warn("error probably fine", err);
218
+ }
213
219
  }
214
220
  }
215
- }
216
- }, vitePluginSsrCss({
217
- entries: [virtualEntryId]
218
- })];
221
+ },
222
+ vitePluginSsrCss({
223
+ entries: [
224
+ virtualEntryId
225
+ ]
226
+ })
227
+ ];
219
228
  }
220
229
  var oneOptions = null;
221
230
  async function getUserOneOptions(command) {
@@ -223,7 +232,8 @@ async function getUserOneOptions(command) {
223
232
  if (!command) throw new Error("Options not loaded and no command given");
224
233
  await loadUserOneOptions(command);
225
234
  }
226
- if (!oneOptions) throw new Error("No One options were loaded");
235
+ if (!oneOptions)
236
+ throw new Error("No One options were loaded");
227
237
  return oneOptions;
228
238
  }
229
239
  async function loadUserOneOptions(command) {
@@ -231,10 +241,15 @@ async function loadUserOneOptions(command) {
231
241
  mode: "prod",
232
242
  command
233
243
  });
234
- if (!found) throw new Error(`No config found in ${process.cwd()}. Is this the correct directory?`);
244
+ if (!found)
245
+ throw new Error(`No config found in ${process.cwd()}. Is this the correct directory?`);
235
246
  var foundOptions = getUserOneOptions();
236
- if (!foundOptions) throw new Error("No One plugin found in this vite.config");
247
+ if (!foundOptions)
248
+ throw new Error("No One plugin found in this vite.config");
237
249
  return foundOptions;
238
250
  }
239
- export { loadUserOneOptions, one };
240
- //# sourceMappingURL=one.native.js.map
251
+ export {
252
+ loadUserOneOptions,
253
+ one
254
+ };
255
+ //# sourceMappingURL=one.js.map
@@ -1 +1,6 @@
1
- {"version":3,"names":["events","path","dirname","resolve","loadConfigFromFile","tsconfigPaths","getOptimizeDeps","getOptionsFilled","isWebEnvironment","existsAsync","requireResolve","clientTreeShakePlugin","createFileSystemRouter","ensureTSConfig","fixDependenciesPlugin","generateTypesForRoutes","loadEnv","createVirtualEntry","virtualEntryId","vitePluginSsrCss","setMaxListeners","globalThis","__vxrnEnableNativeEnv","one","options","arguments","length","_options_config","oneOptions","process","cwd","config","__vxrnPluginConfig__","optimizeDeps","optimizeIds","include","optimizeIdRegex","RegExp","map","id","replace","join","tsConfigPathsPlugin","vxrnOptions","devAndProdPlugins","Proxy","name","configIncoming","_options_config2","_configIncoming_plugins","pathsConfig","tsConfigPaths","plugins","flat","some","p","configResolved","resolveId","get","target","key","thisArg","Reflect","enforce","alias","tslib","_options_web","define","web","defaultRenderMode","JSON","stringify","setupFile","env","NODE_ENV","server","url","environments","client","ssr","zero","TESTING","REPLICACHE_VERSION","ZERO_VERSION","hotUpdate","param","modules","m","relativePath","relative","root","rootDir","split","sep","acceptedHmrExports","Set","__vxrnAddNativePlugins","__vxrnAddWebPluginsProd","deps","_options_app","app","sharedNativeConfig","react","ios","android","applyToEnvironment","environment","importer","shouldOptimize","test","absolutePath","webPath","directoryPath","err","console","warn","entries","getUserOneOptions","command","Error","loadUserOneOptions","found","mode"],"sources":["../../../src/vite/one.ts"],"sourcesContent":[null],"mappings":"AAAA,OAAOA,MAAA,MAAY;AACnB,OAAOC,IAAA,IAAQC,OAAA,EAAeC,OAAA,QAAe;AAC7C,SAA0DC,kBAAA,QAA0B;AACpF,OAAOC,aAAA,MAAmB;AAC1B,SAASC,eAAA,EAAiBC,gBAAA,EAAkBC,gBAAA,QAAwB;AACpE,OAAO;AACP,SAASC,WAAA,QAAmB;AAC5B,SAASC,cAAA,QAAsB;AAC/B,SAASC,qBAAA,QAA6B;AACtC,SAASC,sBAAA,QAA8B;AACvC,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E3C,eAAemF,kBAAkBC,SAA2B;AAC1D,MAAI,CAACpF,YAAY;AACf,QAAI,CAACoF,QAAS,OAAM,IAAIC,MAAM,yCAAyC;AACvE,UAAMC,mBAAmBF,OAAAA;EAC3B;AACA,MAAI,CAACpF;AACH,UAAM,IAAIqF,MAAM,4BAA4B;AAE9C,SAAOrF;AACT;AAEA,eAAsBsF,mBAAmBF,SAA0B;AACjE,MAAMG,QAAQ,MAAM5G,mBAAmB;IACrC6G,MAAM;IACNJ;EACF,CAAA;AACA,MAAI,CAACG;AACH,UAAM,IAAIF,MAAM,sBAAsBpF,QAAQC,IAAG,CAAA,kCAAoC;AAEvF,MAAMuF,eAAeN,kBAAAA;AACrB,MAAI,CAACM;AACH,UAAM,IAAIJ,MAAM,yCAAyC;AAE3D,SAAOI;AACT;",
5
+ "names": ["events", "path", "dirname", "resolve", "loadConfigFromFile", "tsconfigPaths", "getOptimizeDeps", "getOptionsFilled", "isWebEnvironment", "existsAsync", "requireResolve", "clientTreeShakePlugin", "createFileSystemRouter", "ensureTSConfig", "fixDependenciesPlugin", "generateTypesForRoutes", "loadEnv", "createVirtualEntry", "virtualEntryId", "vitePluginSsrCss", "setMaxListeners", "globalThis", "__vxrnEnableNativeEnv", "one", "options", "oneOptions", "process", "cwd", "config", "optimizeDeps", "optimizeIds", "include", "optimizeIdRegex", "RegExp", "map", "id", "replace", "join", "tsConfigPathsPlugin", "vxrnOptions", "devAndProdPlugins", "Proxy", "name", "configIncoming", "pathsConfig", "tsConfigPaths", "plugins", "flat", "some", "p", "configResolved", "resolveId", "get", "target", "key", "thisArg", "Reflect", "enforce", "alias", "tslib", "define", "web", "defaultRenderMode", "JSON", "stringify", "setupFile", "env", "NODE_ENV", "server", "url", "environments", "client", "ssr", "zero", "TESTING", "REPLICACHE_VERSION", "ZERO_VERSION", "hotUpdate", "modules", "m", "relativePath", "relative", "root", "rootDir", "split", "sep", "acceptedHmrExports", "Set", "__vxrnAddNativePlugins", "__vxrnAddWebPluginsProd", "deps", "app", "sharedNativeConfig", "react", "ios", "android", "applyToEnvironment", "environment", "importer", "shouldOptimize", "test", "absolutePath", "webPath", "directoryPath", "err", "console", "warn", "entries", "getUserOneOptions", "command", "Error", "loadUserOneOptions", "found", "mode", "foundOptions"]
6
+ }
@@ -1,13 +1,13 @@
1
1
  function removeReactNativeWebAnimatedPlugin(opts) {
2
- var filter = opts?.panResponder ? /(react-native\/Animated\/Animated|PlatformPressable|PanResponder|ResponderSystem)/ : /(react-native\/Animated\/Animated|PlatformPressable)/,
3
- optimizeDeps = {
4
- esbuildOptions: {
5
- plugins: [{
2
+ var filter = opts?.panResponder ? /(react-native\/Animated\/Animated|PlatformPressable|PanResponder|ResponderSystem)/ : /(react-native\/Animated\/Animated|PlatformPressable)/, optimizeDeps = {
3
+ esbuildOptions: {
4
+ plugins: [
5
+ {
6
6
  name: "remove-react-native-web-animated",
7
7
  setup(build) {
8
8
  build.onResolve({
9
9
  filter
10
- }, function (args) {
10
+ }, function(args) {
11
11
  return {
12
12
  path: args.path,
13
13
  namespace: "proxy-wormify"
@@ -15,16 +15,17 @@ function removeReactNativeWebAnimatedPlugin(opts) {
15
15
  }), build.onLoad({
16
16
  filter: /.*/,
17
17
  namespace: "proxy-wormify"
18
- }, function (args) {
18
+ }, function(args) {
19
19
  return {
20
20
  contents: 'export * from "@tamagui/proxy-worm";',
21
21
  loader: "js"
22
22
  };
23
23
  });
24
24
  }
25
- }]
26
- }
27
- };
25
+ }
26
+ ]
27
+ }
28
+ };
28
29
  return {
29
30
  name: "remove-react-native-web-animated",
30
31
  config() {
@@ -34,5 +35,7 @@ function removeReactNativeWebAnimatedPlugin(opts) {
34
35
  }
35
36
  };
36
37
  }
37
- export { removeReactNativeWebAnimatedPlugin };
38
- //# sourceMappingURL=removeReactNativeWebAnimatedPlugin.native.js.map
38
+ export {
39
+ removeReactNativeWebAnimatedPlugin
40
+ };
41
+ //# sourceMappingURL=removeReactNativeWebAnimatedPlugin.js.map
@@ -1 +1,6 @@
1
- {"version":3,"names":["removeReactNativeWebAnimatedPlugin","opts","filter","panResponder","optimizeDeps","esbuildOptions","plugins","name","setup","build","onResolve","args","path","namespace","onLoad","contents","loader"],"sources":["../../../src/vite/removeReactNativeWebAnimatedPlugin.ts"],"sourcesContent":[null],"mappings":"AAMO,SAASA,mCAAmCC,IAAA,EAExC;EACT,IAAAC,MAAM,GAAAD,IAAS,EAAAE,YAAM,sFACjB,yDACA;IAAAC,YAEE;MACJC,cAAA,EAAgB;QACdC,OAAA,EAAS,CACP;UACEC,IAAA,EAAM;UACNC,MAAMC,KAAA,EAAO;YACXA,KAAA,CAAMC,SAAA;cACJR;YAAA,aACES,IAAA;cACF;gBACCC,IAAA,EAAAD,IACQ,CAAEC,IAAA;gBAIbC,SAAM;cAEF;YAAU,EACV,EAAAJ,KAAA,CAAQK,MAAA;cAEXZ,MAAA;cACHW,SAAA;YACF,aAAAF,IAAA;cACF;gBACFI,QAAA;gBACFC,MAAA;cAEO;YACC;UAEN;QACE;MACE;IACF;EAEJ;IACFT,IAAA","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/vite/Users/n8/one/packages/one/src/vite/removeReactNativeWebAnimatedPlugin.ts"],
4
+ "mappings": "AAMO,SAASA,mCAAmCC,MAElD;AACC,MAAMC,SAASD,MAAME,eACjB,sFACA,wDAEEC,eAAe;IACnBC,gBAAgB;MACdC,SAAS;QACP;UACEC,MAAM;UACNC,MAAMC,OAAK;AACTA,kBAAMC,UACJ;cACER;YACF,GACA,SAACS,MAAAA;AACC,qBAAO;gBAAEC,MAAMD,KAAKC;gBAAMC,WAAW;cAAgB;YACvD,CAAA,GAGFJ,MAAMK,OAAO;cAAEZ,QAAQ;cAAMW,WAAW;YAAgB,GAAG,SAACF,MAAAA;AAC1D,qBAAO;gBACLI,UAAU;gBACVC,QAAQ;cACV;YACF,CAAA;UACF;QACF;;IAEJ;EACF;AAEA,SAAO;IACLT,MAAM;IAENU,SAAAA;AACE,aAAO;QACLb;MACF;IACF;EACF;AACF;",
5
+ "names": ["removeReactNativeWebAnimatedPlugin", "opts", "filter", "panResponder", "optimizeDeps", "esbuildOptions", "plugins", "name", "setup", "build", "onResolve", "args", "path", "namespace", "onLoad", "contents", "loader", "config"]
6
+ }
@@ -3,7 +3,13 @@ function replaceLoader({
3
3
  loaderData
4
4
  }) {
5
5
  const stringifiedData = JSON.stringify(loaderData);
6
- return code.includes("__vxrn__loader__") ? code.replace(/["']__vxrn__loader__['"]/, stringifiedData) : code + `
6
+ return code.includes("__vxrn__loader__") ? code.replace(
7
+ /["']__vxrn__loader__['"]/,
8
+ // make sure this ' ' is added in front,
9
+ // minifiers will do `return"something"
10
+ // but if its null then it becomes returnnull
11
+ " " + stringifiedData
12
+ ) : code + `
7
13
  export const loader = () => (${stringifiedData})`;
8
14
  }
9
15
  export {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/vite/replaceLoader.ts"],
4
- "mappings": "AAAO,SAAS,cAAc;AAAA,EAC5B;AAAA,EACA;AACF,GAGG;AACD,QAAM,kBAAkB,KAAK,UAAU,UAAU;AASjD,SANO,KAAK,SAAS,kBAAkB,IAG9B,KAAK,QAAQ,4BAA4B,eAAe,IAFtD,OAAO;AAAA,+BAAkC,eAAe;AAMrE;",
4
+ "mappings": "AAAO,SAAS,cAAc;AAAA,EAC5B;AAAA,EACA;AACF,GAGG;AACD,QAAM,kBAAkB,KAAK,UAAU,UAAU;AAejD,SAZO,KAAK,SAAS,kBAAkB,IAG9B,KAAK;AAAA,IACV;AAAA;AAAA;AAAA;AAAA,IAIA,MAAM;AAAA,EACR,IARS,OAAO;AAAA,+BAAkC,eAAe;AAYrE;",
5
5
  "names": []
6
6
  }
@@ -3,7 +3,11 @@ function replaceLoader({
3
3
  loaderData
4
4
  }) {
5
5
  const stringifiedData = JSON.stringify(loaderData);
6
- return code.includes("__vxrn__loader__") ? code.replace(/["']__vxrn__loader__['"]/, stringifiedData) : code + `
6
+ return code.includes("__vxrn__loader__") ? code.replace(/["']__vxrn__loader__['"]/,
7
+ // make sure this ' ' is added in front,
8
+ // minifiers will do `return"something"
9
+ // but if its null then it becomes returnnull
10
+ " " + stringifiedData) : code + `
7
11
  export const loader = () => (${stringifiedData})`;
8
12
  }
9
13
  export { replaceLoader };
@@ -1 +1 @@
1
- {"version":3,"names":["replaceLoader","code","loaderData","stringifiedData","JSON","stringify","includes","replace"],"sources":["../../../src/vite/replaceLoader.ts"],"sourcesContent":[null],"mappings":"AAAO,SAASA,cAAc;EAC5BC,IAAA;EACAC;AACF,GAGG;EACD,MAAMC,eAAA,GAAkBC,IAAA,CAAKC,SAAA,CAAUH,UAAU;EASjD,OANOD,IAAA,CAAKK,QAAA,CAAS,kBAAkB,IAG9BL,IAAA,CAAKM,OAAA,CAAQ,4BAA4BJ,eAAe,IAFtDF,IAAA,GAAO;AAAA,+BAAkCE,eAAe;AAMrE","ignoreList":[]}
1
+ {"version":3,"names":["replaceLoader","code","loaderData","stringifiedData","JSON","stringify","includes","replace"],"sources":["../../../src/vite/replaceLoader.ts"],"sourcesContent":[null],"mappings":"AAAO,SAASA,cAAc;EAC5BC,IAAA;EACAC;AACF,GAGG;EACD,MAAMC,eAAA,GAAkBC,IAAA,CAAKC,SAAA,CAAUH,UAAU;EAejD,OAZOD,IAAA,CAAKK,QAAA,CAAS,kBAAkB,IAG9BL,IAAA,CAAKM,OAAA,CACV;EAAA;EAAA;EAAA;EAIA,MAAMJ,eACR,IARSF,IAAA,GAAO;AAAA,+BAAkCE,eAAe;AAYrE","ignoreList":[]}
@@ -1,14 +1,17 @@
1
1
  function replaceLoader(param) {
2
- var {
3
- code,
4
- loaderData
5
- } = param,
6
- stringifiedData = JSON.stringify(loaderData),
7
- out = function () {
8
- return code.includes("__vxrn__loader__") ? code.replace(/["']__vxrn__loader__['"]/, stringifiedData) : code + `
2
+ var { code, loaderData } = param, stringifiedData = JSON.stringify(loaderData), out = function() {
3
+ return code.includes("__vxrn__loader__") ? code.replace(
4
+ /["']__vxrn__loader__['"]/,
5
+ // make sure this ' ' is added in front,
6
+ // minifiers will do `return"something"
7
+ // but if its null then it becomes returnnull
8
+ " " + stringifiedData
9
+ ) : code + `
9
10
  export const loader = () => (${stringifiedData})`;
10
- }();
11
+ }();
11
12
  return out;
12
13
  }
13
- export { replaceLoader };
14
- //# sourceMappingURL=replaceLoader.native.js.map
14
+ export {
15
+ replaceLoader
16
+ };
17
+ //# sourceMappingURL=replaceLoader.js.map
@@ -1 +1,6 @@
1
- {"version":3,"names":["replaceLoader","param","code","loaderData","stringifiedData","JSON","stringify","out","includes","replace"],"sources":["../../../src/vite/replaceLoader.ts"],"sourcesContent":[null],"mappings":"AAAO,SAASA,cAAcC,KAAA;EAC5B;MAAAC,IAAA;MAAAC;IAAA,IAAAF,KAAA;IAAAG,eAAA,GAAAC,IAAA,CAAAC,SAAA,CAAAH,UAAA;IAAAI,GAAA;MACA,OAAAL,IAAA,CAAAM,QAAA,uBAAAN,IAAA,CAAAO,OAAA,6BAAAL,eAAA,IAAAF,IAAA;AACF,+BAGGE,eAAA;IACD;EASA,OANOG,GAAA;AACW;AAMpB,S","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/vite/Users/n8/one/packages/one/src/vite/replaceLoader.ts"],
4
+ "mappings": "AAAO,SAASA,cAAc,OAM7B;MAN6B,EAC5BC,MACAC,WAAU,IAFkB,OAOtBC,kBAAkBC,KAAKC,UAAUH,UAAAA,GAEjCI,MAAO,WAAA;AACX,WAAKL,KAAKM,SAAS,kBAAA,IAGZN,KAAKO;MACV;;;;MAIA,MAAML;IAAAA,IAPCF,OAAO;+BAAkCE,eAAAA;EASpD,EAAA;AAEA,SAAOG;AACT;",
5
+ "names": ["replaceLoader", "code", "loaderData", "stringifiedData", "JSON", "stringify", "out", "includes", "replace"]
6
+ }
@@ -1,56 +1,51 @@
1
- import { isResponse } from "../utils/isResponse.native.js";
2
- import { asyncHeadersCache, mergeHeaders, requestAsyncLocalStore } from "./headers.native.js";
1
+ import { isResponse } from "../utils/isResponse";
2
+ import { asyncHeadersCache, mergeHeaders, requestAsyncLocalStore } from "./headers";
3
3
  function resolveAPIRequest(asyncImport, request, params) {
4
- if (asyncImport) return new Promise(function (res, rej) {
5
- var id = {
6
- _id: Math.random()
7
- };
8
- requestAsyncLocalStore.run(id, async function () {
9
- try {
10
- var imported = await asyncImport(),
11
- requestType = request.method || "GET",
12
- handler = imported[requestType] || imported.default;
13
- if (!handler) {
14
- console.warn(`No handler found for request ${requestType}`);
15
- return;
16
- }
17
- var response = await handler(request, {
4
+ if (asyncImport)
5
+ return new Promise(function(res, rej) {
6
+ var id = {
7
+ _id: Math.random()
8
+ };
9
+ requestAsyncLocalStore.run(id, async function() {
10
+ try {
11
+ var imported = await asyncImport(), requestType = request.method || "GET", handler = imported[requestType] || imported.default;
12
+ if (!handler) {
13
+ console.warn(`No handler found for request ${requestType}`);
14
+ return;
15
+ }
16
+ var response = await handler(request, {
18
17
  params
19
- }),
20
- asyncHeaders = asyncHeadersCache.get(id);
21
- if (asyncHeaders) try {
22
- response instanceof Response ? mergeHeaders(response.headers, asyncHeaders) : response && typeof response == "object" ? response = Response.json(response, {
23
- headers: asyncHeaders
24
- }) : response = new Response(response, {
25
- headers: asyncHeaders
26
- });
18
+ }), asyncHeaders = asyncHeadersCache.get(id);
19
+ if (asyncHeaders)
20
+ try {
21
+ response instanceof Response ? mergeHeaders(response.headers, asyncHeaders) : response && typeof response == "object" ? response = Response.json(response, {
22
+ headers: asyncHeaders
23
+ }) : response = new Response(response, {
24
+ headers: asyncHeaders
25
+ });
26
+ } catch (err) {
27
+ if (`${err}`.includes("immutable")) {
28
+ var body = response.body ? await streamToString(response.body) : "";
29
+ response = new Response(body, {
30
+ headers: response.headers,
31
+ status: response.status,
32
+ statusText: response.statusText
33
+ }), mergeHeaders(response.headers, asyncHeaders);
34
+ } else
35
+ console.error(` [one] error adding headers: ${err}`);
36
+ }
37
+ res(response);
27
38
  } catch (err) {
28
- if (`${err}`.includes("immutable")) {
29
- var body = response.body ? await streamToString(response.body) : "";
30
- response = new Response(body, {
31
- headers: response.headers,
32
- status: response.status,
33
- statusText: response.statusText
34
- }), mergeHeaders(response.headers, asyncHeaders);
35
- } else console.error(` [one] error adding headers: ${err}`);
39
+ isResponse(err) ? res(err) : rej(err);
36
40
  }
37
- res(response);
38
- } catch (err) {
39
- isResponse(err) ? res(err) : rej(err);
40
- }
41
+ });
41
42
  });
42
- });
43
43
  }
44
44
  async function streamToString(stream) {
45
- var reader = stream.getReader(),
46
- decoder = new TextDecoder(),
47
- result = "";
45
+ var reader = stream.getReader(), decoder = new TextDecoder(), result = "";
48
46
  try {
49
- for (;;) {
50
- var {
51
- done,
52
- value
53
- } = await reader.read();
47
+ for (; ; ) {
48
+ var { done, value } = await reader.read();
54
49
  if (done) break;
55
50
  result += decoder.decode(value, {
56
51
  stream: !0
@@ -63,5 +58,7 @@ async function streamToString(stream) {
63
58
  }
64
59
  return result;
65
60
  }
66
- export { resolveAPIRequest };
67
- //# sourceMappingURL=resolveAPIRequest.native.js.map
61
+ export {
62
+ resolveAPIRequest
63
+ };
64
+ //# sourceMappingURL=resolveAPIRequest.js.map