one 1.1.309 → 1.1.311
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/Root.cjs +213 -0
- package/dist/cjs/Root.cjs.map +6 -0
- package/dist/cjs/Root.native.js +2 -2
- package/dist/cjs/Root.native.js.map +2 -2
- package/dist/cjs/{Route.js → Route.cjs} +34 -19
- package/dist/cjs/{cleanUrl.js → cleanUrl.cjs} +27 -18
- package/dist/cjs/cli/label-process.cjs +31 -0
- package/dist/cjs/cli/{main.js → main.cjs} +28 -16
- package/dist/cjs/cli/{prebuild.js → prebuild.cjs} +25 -15
- package/dist/cjs/cli/run.cjs +70 -0
- package/dist/cjs/cli/{runAndroid.js → runAndroid.cjs} +25 -15
- package/dist/cjs/cli/{runIos.js → runIos.cjs} +25 -15
- package/dist/cjs/cli.cjs +258 -0
- package/dist/cjs/clientLoaderResolver.cjs +35 -0
- package/dist/cjs/config.cjs +32 -0
- package/dist/cjs/constants.cjs +30 -0
- package/dist/cjs/{createApp.js → createApp.cjs} +33 -17
- package/dist/cjs/createApp.native.cjs +38 -0
- package/dist/cjs/createApp.native.cjs.map +6 -0
- package/dist/cjs/{createHandleRequest.js → createHandleRequest.cjs} +61 -49
- package/dist/cjs/createHandleRequest.cjs.map +6 -0
- package/dist/cjs/createHandleRequest.native.js +1 -0
- package/dist/cjs/createHandleRequest.native.js.map +2 -2
- package/dist/cjs/createRoute.cjs +42 -0
- package/dist/cjs/fallbackViews/{Sitemap.js → Sitemap.cjs} +35 -16
- package/dist/cjs/fallbackViews/{Unmatched.js → Unmatched.cjs} +32 -17
- package/dist/cjs/fork/NavigationContainer.cjs +105 -0
- package/dist/cjs/fork/NavigationContainer.native.cjs +103 -0
- package/dist/cjs/fork/NavigationContainer.native.cjs.map +6 -0
- package/dist/cjs/fork/createMemoryHistory.cjs +136 -0
- package/dist/cjs/fork/{extractPathFromURL.js → extractPathFromURL.cjs} +30 -21
- package/dist/cjs/fork/findFocusedRoute.cjs +30 -0
- package/dist/cjs/fork/{getPathFromState.js → getPathFromState.cjs} +120 -113
- package/dist/cjs/fork/getStateFromPath.cjs +366 -0
- package/dist/cjs/fork/useLinking.cjs +215 -0
- package/dist/cjs/fork/useLinking.native.cjs +126 -0
- package/dist/cjs/fork/useLinking.native.cjs.map +6 -0
- package/dist/cjs/fork/validatePathConfig.cjs +44 -0
- package/dist/cjs/{getLinkingConfig.js → getLinkingConfig.cjs} +21 -15
- package/dist/cjs/{getReactNavigationConfig.js → getReactNavigationConfig.cjs} +33 -32
- package/dist/cjs/getRoutes.cjs +276 -0
- package/dist/cjs/getURL.cjs +29 -0
- package/dist/cjs/getURL.native.cjs +48 -0
- package/dist/cjs/getURL.native.cjs.map +6 -0
- package/dist/cjs/head/Head.android.cjs +28 -0
- package/dist/cjs/head/Head.android.cjs.map +6 -0
- package/dist/cjs/head/Head.cjs +30 -0
- package/dist/cjs/head/Head.ios.cjs +210 -0
- package/dist/cjs/head/Head.ios.cjs.map +6 -0
- package/dist/cjs/head/HeadModule.cjs +27 -0
- package/dist/cjs/head/index.cjs +18 -0
- package/dist/cjs/head/types.cjs +16 -0
- package/dist/cjs/head/url.cjs +50 -0
- package/dist/cjs/{hooks.js → hooks.cjs} +52 -40
- package/dist/cjs/{imperative-api.js → imperative-api.cjs} +26 -19
- package/dist/cjs/import-mode/index.android.cjs +26 -0
- package/dist/cjs/import-mode/index.android.cjs.map +6 -0
- package/dist/cjs/import-mode/index.cjs +26 -0
- package/dist/cjs/import-mode/index.ios.cjs +26 -0
- package/dist/cjs/import-mode/index.ios.cjs.map +6 -0
- package/dist/cjs/import-mode/index.native.cjs +26 -0
- package/dist/cjs/import-mode/index.native.cjs.map +6 -0
- package/dist/cjs/import-mode/index.web.cjs +26 -0
- package/dist/cjs/{index.js → index.cjs} +50 -14
- package/dist/cjs/interfaces/router.cjs +27 -0
- package/dist/cjs/layouts/Drawer.cjs +31 -0
- package/dist/cjs/layouts/Stack.cjs +31 -0
- package/dist/cjs/layouts/Tabs.cjs +64 -0
- package/dist/cjs/layouts/withLayoutContext.cjs +91 -0
- package/dist/cjs/link/Link.cjs +120 -0
- package/dist/cjs/link/Redirect.cjs +39 -0
- package/dist/cjs/link/href.cjs +58 -0
- package/dist/cjs/link/linking.cjs +89 -0
- package/dist/cjs/link/path.cjs +69 -0
- package/dist/cjs/link/useLinkTo.cjs +54 -0
- package/dist/cjs/link/useLoadedNavigation.cjs +60 -0
- package/dist/cjs/{matchers.js → matchers.cjs} +16 -11
- package/dist/cjs/platform.cjs +26 -0
- package/dist/cjs/polyfills-mobile.cjs +33 -0
- package/dist/cjs/polyfills-server.cjs +25 -0
- package/dist/cjs/render.cjs +47 -0
- package/dist/cjs/render.native.cjs +28 -0
- package/dist/cjs/render.native.cjs.map +6 -0
- package/dist/cjs/router/RouterStore.cjs +16 -0
- package/dist/cjs/router/constants.cjs +26 -0
- package/dist/cjs/router/{getNormalizedStatePath.js → getNormalizedStatePath.cjs} +25 -23
- package/dist/cjs/router/lastAction.cjs +31 -0
- package/dist/cjs/router/{router.js → router.cjs} +104 -78
- package/dist/cjs/router/serverLocationContext.cjs +27 -0
- package/dist/cjs/router/{useInitializeOneRouter.js → useInitializeOneRouter.cjs} +26 -16
- package/dist/cjs/serve.cjs +185 -0
- package/dist/cjs/server/{createRoutesManifest.js → createRoutesManifest.cjs} +22 -16
- package/dist/cjs/server/{getServerManifest.js → getServerManifest.cjs} +58 -31
- package/dist/cjs/{server-render.js → server-render.cjs} +28 -17
- package/dist/cjs/sortRoutes.cjs +62 -0
- package/dist/cjs/typed-routes/generateRouteTypes.cjs +48 -0
- package/dist/cjs/typed-routes/{getTypedRoutesDeclarationFile.js → getTypedRoutesDeclarationFile.cjs} +37 -40
- package/dist/cjs/types.cjs +16 -0
- package/dist/cjs/{useFocusEffect.js → useFocusEffect.cjs} +33 -24
- package/dist/cjs/useLoader.cjs +114 -0
- package/dist/cjs/useNavigation.cjs +68 -0
- package/dist/cjs/useScreens.cjs +233 -0
- package/dist/cjs/{useViteRoutes.js → useViteRoutes.cjs} +36 -24
- package/dist/cjs/utils/assertIsReady.cjs +28 -0
- package/dist/cjs/utils/dynamicImport.cjs +27 -0
- package/dist/cjs/utils/existsAsync.cjs +33 -0
- package/dist/cjs/utils/getPageExport.cjs +32 -0
- package/dist/cjs/utils/{globDir.js → globDir.cjs} +23 -15
- package/dist/cjs/utils/{hashString.js → hashString.cjs} +22 -14
- package/dist/cjs/utils/isResponse.cjs +28 -0
- package/dist/cjs/utils/isStatus.cjs +28 -0
- package/dist/cjs/utils/promiseWithResolvers.cjs +37 -0
- package/dist/cjs/utils/rand.cjs +26 -0
- package/dist/cjs/utils/redirect.cjs +34 -0
- package/dist/cjs/utils/removeSearch.cjs +28 -0
- package/dist/cjs/utils/removeUndefined.cjs +30 -0
- package/dist/cjs/utils/{url.js → url.cjs} +16 -11
- package/dist/cjs/utils/weakKey.cjs +30 -0
- package/dist/cjs/utils/weakMemo.cjs +34 -0
- package/dist/cjs/views/EmptyRoute.cjs +30 -0
- package/dist/cjs/views/{ErrorBoundary.js → ErrorBoundary.cjs} +30 -16
- package/dist/cjs/views/LoadProgressBar.cjs +90 -0
- package/dist/cjs/views/Navigator.cjs +149 -0
- package/dist/cjs/views/{PreloadLinks.js → PreloadLinks.cjs} +20 -13
- package/dist/cjs/views/PreloadLinks.native.cjs +28 -0
- package/dist/cjs/views/PreloadLinks.native.cjs.map +6 -0
- package/dist/cjs/views/{RootErrorBoundary.js → RootErrorBoundary.cjs} +28 -16
- package/dist/cjs/views/Screen.cjs +39 -0
- package/dist/cjs/views/ScrollRestoration.cjs +74 -0
- package/dist/cjs/views/Try.cjs +68 -0
- package/dist/cjs/vite/build.cjs +425 -0
- package/dist/cjs/vite/{clientTreeShakePlugin.js → clientTreeShakePlugin.cjs} +53 -35
- package/dist/cjs/vite/constants.cjs +28 -0
- package/dist/cjs/vite/{createFileSystemRouter.js → createFileSystemRouter.cjs} +117 -84
- package/dist/cjs/vite/{customNodeExternals.js → customNodeExternals.cjs} +32 -20
- package/dist/cjs/vite/ensureTsConfig.cjs +68 -0
- package/dist/cjs/vite/findDepsToOptimize.cjs +74 -0
- package/dist/cjs/vite/{fixDependenciesPlugin.js → fixDependenciesPlugin.cjs} +17 -12
- package/dist/cjs/vite/generateTypesForRoutes.cjs +45 -0
- package/dist/cjs/vite/{getManifest.js → getManifest.cjs} +18 -12
- package/dist/cjs/vite/{headers.js → headers.cjs} +19 -14
- package/dist/cjs/vite/headers.native.cjs +32 -0
- package/dist/cjs/vite/headers.native.cjs.map +6 -0
- package/dist/cjs/vite/{loadEnv.js → loadEnv.cjs} +27 -16
- package/dist/cjs/vite/makePluginWebOnly.cjs +31 -0
- package/dist/cjs/vite/one.cjs +256 -0
- package/dist/cjs/vite/{removeReactNativeWebAnimatedPlugin.js → removeReactNativeWebAnimatedPlugin.cjs} +32 -25
- package/dist/cjs/vite/replaceLoader.cjs +37 -0
- package/dist/cjs/vite/resolveAPIRequest.cjs +90 -0
- package/dist/cjs/vite/server.cjs +13 -0
- package/dist/cjs/vite/types.cjs +16 -0
- package/dist/cjs/vite/{virtualEntryPlugin.js → virtualEntryPlugin.cjs} +28 -20
- package/dist/cjs/vite/{vitePluginSsrCss.js → vitePluginSsrCss.cjs} +56 -50
- package/dist/cjs/vite.cjs +40 -0
- package/dist/cjs/zero/getQueryKey.cjs +29 -0
- package/dist/cjs/zero/isZeroQuery.cjs +28 -0
- package/dist/cjs/zero/resolveQuery.cjs +41 -0
- package/dist/cjs/zero/{subscribeToQuery.js → subscribeToQuery.cjs} +16 -11
- package/dist/cjs/zero/types.cjs +16 -0
- package/dist/cjs/zero/useQuery.cjs +58 -0
- package/dist/cjs/zero/{useQueryZero.js → useQueryZero.cjs} +21 -15
- package/dist/cjs/zero.cjs +30 -0
- package/dist/esm/Root.js +2 -1
- package/dist/esm/Root.js.map +1 -1
- package/dist/esm/Root.mjs +2 -1
- package/dist/esm/Root.mjs.map +1 -1
- package/dist/esm/Root.native.js +2 -1
- package/dist/esm/Root.native.js.map +2 -2
- package/dist/esm/createHandleRequest.js +1 -0
- package/dist/esm/createHandleRequest.js.map +1 -1
- package/dist/esm/createHandleRequest.mjs +1 -0
- package/dist/esm/createHandleRequest.mjs.map +1 -1
- package/dist/esm/createHandleRequest.native.js +1 -0
- package/dist/esm/createHandleRequest.native.js.map +2 -2
- package/dist/esm/getURL.js +1 -1
- package/dist/esm/getURL.mjs +1 -1
- package/package.json +10 -10
- package/src/Root.tsx +2 -1
- package/src/createHandleRequest.ts +5 -0
- package/src/getURL.ts +1 -1
- package/types/Root.d.ts.map +1 -1
- package/types/createHandleRequest.d.ts.map +1 -1
- package/dist/cjs/Root.js +0 -182
- package/dist/cjs/Root.js.map +0 -6
- package/dist/cjs/cli/label-process.js +0 -25
- package/dist/cjs/cli/run.js +0 -52
- package/dist/cjs/cli.js +0 -209
- package/dist/cjs/clientLoaderResolver.js +0 -32
- package/dist/cjs/config.js +0 -27
- package/dist/cjs/constants.js +0 -23
- package/dist/cjs/createHandleRequest.js.map +0 -6
- package/dist/cjs/createRoute.js +0 -37
- package/dist/cjs/fork/NavigationContainer.js +0 -85
- package/dist/cjs/fork/createMemoryHistory.js +0 -100
- package/dist/cjs/fork/findFocusedRoute.js +0 -26
- package/dist/cjs/fork/getStateFromPath.js +0 -381
- package/dist/cjs/fork/useLinking.js +0 -182
- package/dist/cjs/fork/validatePathConfig.js +0 -46
- package/dist/cjs/getRoutes.js +0 -294
- package/dist/cjs/getURL.js +0 -24
- package/dist/cjs/head/Head.js +0 -23
- package/dist/cjs/head/HeadModule.js +0 -22
- package/dist/cjs/head/index.js +0 -15
- package/dist/cjs/head/types.js +0 -14
- package/dist/cjs/head/url.js +0 -52
- package/dist/cjs/import-mode/index.js +0 -21
- package/dist/cjs/import-mode/index.web.js +0 -21
- package/dist/cjs/interfaces/router.js +0 -23
- package/dist/cjs/layouts/Drawer.js +0 -24
- package/dist/cjs/layouts/Stack.js +0 -24
- package/dist/cjs/layouts/Tabs.js +0 -52
- package/dist/cjs/layouts/withLayoutContext.js +0 -77
- package/dist/cjs/link/Link.js +0 -98
- package/dist/cjs/link/Redirect.js +0 -31
- package/dist/cjs/link/href.js +0 -50
- package/dist/cjs/link/linking.js +0 -82
- package/dist/cjs/link/path.js +0 -65
- package/dist/cjs/link/useLinkTo.js +0 -42
- package/dist/cjs/link/useLoadedNavigation.js +0 -50
- package/dist/cjs/platform.js +0 -21
- package/dist/cjs/polyfills-mobile.js +0 -26
- package/dist/cjs/polyfills-server.js +0 -23
- package/dist/cjs/render.js +0 -44
- package/dist/cjs/router/RouterStore.js +0 -14
- package/dist/cjs/router/constants.js +0 -21
- package/dist/cjs/router/lastAction.js +0 -25
- package/dist/cjs/router/serverLocationContext.js +0 -22
- package/dist/cjs/serve.js +0 -175
- package/dist/cjs/sortRoutes.js +0 -64
- package/dist/cjs/typed-routes/generateRouteTypes.js +0 -33
- package/dist/cjs/types.js +0 -14
- package/dist/cjs/useLoader.js +0 -97
- package/dist/cjs/useNavigation.js +0 -60
- package/dist/cjs/useScreens.js +0 -176
- package/dist/cjs/utils/assertIsReady.js +0 -26
- package/dist/cjs/utils/dynamicImport.js +0 -24
- package/dist/cjs/utils/existsAsync.js +0 -28
- package/dist/cjs/utils/getPageExport.js +0 -27
- package/dist/cjs/utils/isResponse.js +0 -23
- package/dist/cjs/utils/isStatus.js +0 -23
- package/dist/cjs/utils/promiseWithResolvers.js +0 -26
- package/dist/cjs/utils/rand.js +0 -21
- package/dist/cjs/utils/redirect.js +0 -28
- package/dist/cjs/utils/removeSearch.js +0 -23
- package/dist/cjs/utils/removeUndefined.js +0 -26
- package/dist/cjs/utils/weakKey.js +0 -24
- package/dist/cjs/utils/weakMemo.js +0 -30
- package/dist/cjs/views/EmptyRoute.js +0 -25
- package/dist/cjs/views/LoadProgressBar.js +0 -83
- package/dist/cjs/views/Navigator.js +0 -101
- package/dist/cjs/views/Screen.js +0 -29
- package/dist/cjs/views/ScrollRestoration.js +0 -70
- package/dist/cjs/views/Try.js +0 -44
- package/dist/cjs/vite/build.js +0 -376
- package/dist/cjs/vite/constants.js +0 -22
- package/dist/cjs/vite/ensureTsConfig.js +0 -66
- package/dist/cjs/vite/findDepsToOptimize.js +0 -66
- package/dist/cjs/vite/generateTypesForRoutes.js +0 -36
- package/dist/cjs/vite/makePluginWebOnly.js +0 -27
- package/dist/cjs/vite/one.js +0 -255
- package/dist/cjs/vite/replaceLoader.js +0 -34
- package/dist/cjs/vite/resolveAPIRequest.js +0 -71
- package/dist/cjs/vite/server.js +0 -16
- package/dist/cjs/vite/types.js +0 -14
- package/dist/cjs/vite.js +0 -28
- package/dist/cjs/zero/getQueryKey.js +0 -24
- package/dist/cjs/zero/isZeroQuery.js +0 -23
- package/dist/cjs/zero/resolveQuery.js +0 -38
- package/dist/cjs/zero/types.js +0 -14
- package/dist/cjs/zero/useQuery.js +0 -47
- package/dist/cjs/zero.js +0 -23
- /package/dist/cjs/{Route.js.map → Route.cjs.map} +0 -0
- /package/dist/cjs/{cleanUrl.js.map → cleanUrl.cjs.map} +0 -0
- /package/dist/cjs/cli/{label-process.js.map → label-process.cjs.map} +0 -0
- /package/dist/cjs/cli/{main.js.map → main.cjs.map} +0 -0
- /package/dist/cjs/cli/{prebuild.js.map → prebuild.cjs.map} +0 -0
- /package/dist/cjs/cli/{run.js.map → run.cjs.map} +0 -0
- /package/dist/cjs/cli/{runAndroid.js.map → runAndroid.cjs.map} +0 -0
- /package/dist/cjs/cli/{runIos.js.map → runIos.cjs.map} +0 -0
- /package/dist/cjs/{cli.js.map → cli.cjs.map} +0 -0
- /package/dist/cjs/{clientLoaderResolver.js.map → clientLoaderResolver.cjs.map} +0 -0
- /package/dist/cjs/{config.js.map → config.cjs.map} +0 -0
- /package/dist/cjs/{constants.js.map → constants.cjs.map} +0 -0
- /package/dist/cjs/{createApp.js.map → createApp.cjs.map} +0 -0
- /package/dist/cjs/{createRoute.js.map → createRoute.cjs.map} +0 -0
- /package/dist/cjs/fallbackViews/{Sitemap.js.map → Sitemap.cjs.map} +0 -0
- /package/dist/cjs/fallbackViews/{Unmatched.js.map → Unmatched.cjs.map} +0 -0
- /package/dist/cjs/fork/{NavigationContainer.js.map → NavigationContainer.cjs.map} +0 -0
- /package/dist/cjs/fork/{createMemoryHistory.js.map → createMemoryHistory.cjs.map} +0 -0
- /package/dist/cjs/fork/{extractPathFromURL.js.map → extractPathFromURL.cjs.map} +0 -0
- /package/dist/cjs/fork/{findFocusedRoute.js.map → findFocusedRoute.cjs.map} +0 -0
- /package/dist/cjs/fork/{getPathFromState.js.map → getPathFromState.cjs.map} +0 -0
- /package/dist/cjs/fork/{getStateFromPath.js.map → getStateFromPath.cjs.map} +0 -0
- /package/dist/cjs/fork/{useLinking.js.map → useLinking.cjs.map} +0 -0
- /package/dist/cjs/fork/{validatePathConfig.js.map → validatePathConfig.cjs.map} +0 -0
- /package/dist/cjs/{getLinkingConfig.js.map → getLinkingConfig.cjs.map} +0 -0
- /package/dist/cjs/{getReactNavigationConfig.js.map → getReactNavigationConfig.cjs.map} +0 -0
- /package/dist/cjs/{getRoutes.js.map → getRoutes.cjs.map} +0 -0
- /package/dist/cjs/{getURL.js.map → getURL.cjs.map} +0 -0
- /package/dist/cjs/head/{Head.js.map → Head.cjs.map} +0 -0
- /package/dist/cjs/head/{HeadModule.js.map → HeadModule.cjs.map} +0 -0
- /package/dist/cjs/head/{index.js.map → index.cjs.map} +0 -0
- /package/dist/cjs/head/{types.js.map → types.cjs.map} +0 -0
- /package/dist/cjs/head/{url.js.map → url.cjs.map} +0 -0
- /package/dist/cjs/{hooks.js.map → hooks.cjs.map} +0 -0
- /package/dist/cjs/{imperative-api.js.map → imperative-api.cjs.map} +0 -0
- /package/dist/cjs/import-mode/{index.js.map → index.cjs.map} +0 -0
- /package/dist/cjs/import-mode/{index.web.js.map → index.web.cjs.map} +0 -0
- /package/dist/cjs/{index.js.map → index.cjs.map} +0 -0
- /package/dist/cjs/interfaces/{router.js.map → router.cjs.map} +0 -0
- /package/dist/cjs/layouts/{Drawer.js.map → Drawer.cjs.map} +0 -0
- /package/dist/cjs/layouts/{Stack.js.map → Stack.cjs.map} +0 -0
- /package/dist/cjs/layouts/{Tabs.js.map → Tabs.cjs.map} +0 -0
- /package/dist/cjs/layouts/{withLayoutContext.js.map → withLayoutContext.cjs.map} +0 -0
- /package/dist/cjs/link/{Link.js.map → Link.cjs.map} +0 -0
- /package/dist/cjs/link/{Redirect.js.map → Redirect.cjs.map} +0 -0
- /package/dist/cjs/link/{href.js.map → href.cjs.map} +0 -0
- /package/dist/cjs/link/{linking.js.map → linking.cjs.map} +0 -0
- /package/dist/cjs/link/{path.js.map → path.cjs.map} +0 -0
- /package/dist/cjs/link/{useLinkTo.js.map → useLinkTo.cjs.map} +0 -0
- /package/dist/cjs/link/{useLoadedNavigation.js.map → useLoadedNavigation.cjs.map} +0 -0
- /package/dist/cjs/{matchers.js.map → matchers.cjs.map} +0 -0
- /package/dist/cjs/{platform.js.map → platform.cjs.map} +0 -0
- /package/dist/cjs/{polyfills-mobile.js.map → polyfills-mobile.cjs.map} +0 -0
- /package/dist/cjs/{polyfills-server.js.map → polyfills-server.cjs.map} +0 -0
- /package/dist/cjs/{render.js.map → render.cjs.map} +0 -0
- /package/dist/cjs/router/{RouterStore.js.map → RouterStore.cjs.map} +0 -0
- /package/dist/cjs/router/{constants.js.map → constants.cjs.map} +0 -0
- /package/dist/cjs/router/{getNormalizedStatePath.js.map → getNormalizedStatePath.cjs.map} +0 -0
- /package/dist/cjs/router/{lastAction.js.map → lastAction.cjs.map} +0 -0
- /package/dist/cjs/router/{router.js.map → router.cjs.map} +0 -0
- /package/dist/cjs/router/{serverLocationContext.js.map → serverLocationContext.cjs.map} +0 -0
- /package/dist/cjs/router/{useInitializeOneRouter.js.map → useInitializeOneRouter.cjs.map} +0 -0
- /package/dist/cjs/{serve.js.map → serve.cjs.map} +0 -0
- /package/dist/cjs/server/{createRoutesManifest.js.map → createRoutesManifest.cjs.map} +0 -0
- /package/dist/cjs/server/{getServerManifest.js.map → getServerManifest.cjs.map} +0 -0
- /package/dist/cjs/{server-render.js.map → server-render.cjs.map} +0 -0
- /package/dist/cjs/{sortRoutes.js.map → sortRoutes.cjs.map} +0 -0
- /package/dist/cjs/typed-routes/{generateRouteTypes.js.map → generateRouteTypes.cjs.map} +0 -0
- /package/dist/cjs/typed-routes/{getTypedRoutesDeclarationFile.js.map → getTypedRoutesDeclarationFile.cjs.map} +0 -0
- /package/dist/cjs/{types.js.map → types.cjs.map} +0 -0
- /package/dist/cjs/{useFocusEffect.js.map → useFocusEffect.cjs.map} +0 -0
- /package/dist/cjs/{useLoader.js.map → useLoader.cjs.map} +0 -0
- /package/dist/cjs/{useNavigation.js.map → useNavigation.cjs.map} +0 -0
- /package/dist/cjs/{useScreens.js.map → useScreens.cjs.map} +0 -0
- /package/dist/cjs/{useViteRoutes.js.map → useViteRoutes.cjs.map} +0 -0
- /package/dist/cjs/utils/{assertIsReady.js.map → assertIsReady.cjs.map} +0 -0
- /package/dist/cjs/utils/{dynamicImport.js.map → dynamicImport.cjs.map} +0 -0
- /package/dist/cjs/utils/{existsAsync.js.map → existsAsync.cjs.map} +0 -0
- /package/dist/cjs/utils/{getPageExport.js.map → getPageExport.cjs.map} +0 -0
- /package/dist/cjs/utils/{globDir.js.map → globDir.cjs.map} +0 -0
- /package/dist/cjs/utils/{hashString.js.map → hashString.cjs.map} +0 -0
- /package/dist/cjs/utils/{isResponse.js.map → isResponse.cjs.map} +0 -0
- /package/dist/cjs/utils/{isStatus.js.map → isStatus.cjs.map} +0 -0
- /package/dist/cjs/utils/{promiseWithResolvers.js.map → promiseWithResolvers.cjs.map} +0 -0
- /package/dist/cjs/utils/{rand.js.map → rand.cjs.map} +0 -0
- /package/dist/cjs/utils/{redirect.js.map → redirect.cjs.map} +0 -0
- /package/dist/cjs/utils/{removeSearch.js.map → removeSearch.cjs.map} +0 -0
- /package/dist/cjs/utils/{removeUndefined.js.map → removeUndefined.cjs.map} +0 -0
- /package/dist/cjs/utils/{url.js.map → url.cjs.map} +0 -0
- /package/dist/cjs/utils/{weakKey.js.map → weakKey.cjs.map} +0 -0
- /package/dist/cjs/utils/{weakMemo.js.map → weakMemo.cjs.map} +0 -0
- /package/dist/cjs/views/{EmptyRoute.js.map → EmptyRoute.cjs.map} +0 -0
- /package/dist/cjs/views/{ErrorBoundary.js.map → ErrorBoundary.cjs.map} +0 -0
- /package/dist/cjs/views/{LoadProgressBar.js.map → LoadProgressBar.cjs.map} +0 -0
- /package/dist/cjs/views/{Navigator.js.map → Navigator.cjs.map} +0 -0
- /package/dist/cjs/views/{PreloadLinks.js.map → PreloadLinks.cjs.map} +0 -0
- /package/dist/cjs/views/{RootErrorBoundary.js.map → RootErrorBoundary.cjs.map} +0 -0
- /package/dist/cjs/views/{Screen.js.map → Screen.cjs.map} +0 -0
- /package/dist/cjs/views/{ScrollRestoration.js.map → ScrollRestoration.cjs.map} +0 -0
- /package/dist/cjs/views/{Try.js.map → Try.cjs.map} +0 -0
- /package/dist/cjs/vite/{build.js.map → build.cjs.map} +0 -0
- /package/dist/cjs/vite/{clientTreeShakePlugin.js.map → clientTreeShakePlugin.cjs.map} +0 -0
- /package/dist/cjs/vite/{constants.js.map → constants.cjs.map} +0 -0
- /package/dist/cjs/vite/{createFileSystemRouter.js.map → createFileSystemRouter.cjs.map} +0 -0
- /package/dist/cjs/vite/{customNodeExternals.js.map → customNodeExternals.cjs.map} +0 -0
- /package/dist/cjs/vite/{ensureTsConfig.js.map → ensureTsConfig.cjs.map} +0 -0
- /package/dist/cjs/vite/{findDepsToOptimize.js.map → findDepsToOptimize.cjs.map} +0 -0
- /package/dist/cjs/vite/{fixDependenciesPlugin.js.map → fixDependenciesPlugin.cjs.map} +0 -0
- /package/dist/cjs/vite/{generateTypesForRoutes.js.map → generateTypesForRoutes.cjs.map} +0 -0
- /package/dist/cjs/vite/{getManifest.js.map → getManifest.cjs.map} +0 -0
- /package/dist/cjs/vite/{headers.js.map → headers.cjs.map} +0 -0
- /package/dist/cjs/vite/{loadEnv.js.map → loadEnv.cjs.map} +0 -0
- /package/dist/cjs/vite/{makePluginWebOnly.js.map → makePluginWebOnly.cjs.map} +0 -0
- /package/dist/cjs/vite/{one.js.map → one.cjs.map} +0 -0
- /package/dist/cjs/vite/{removeReactNativeWebAnimatedPlugin.js.map → removeReactNativeWebAnimatedPlugin.cjs.map} +0 -0
- /package/dist/cjs/vite/{replaceLoader.js.map → replaceLoader.cjs.map} +0 -0
- /package/dist/cjs/vite/{resolveAPIRequest.js.map → resolveAPIRequest.cjs.map} +0 -0
- /package/dist/cjs/vite/{server.js.map → server.cjs.map} +0 -0
- /package/dist/cjs/vite/{types.js.map → types.cjs.map} +0 -0
- /package/dist/cjs/vite/{virtualEntryPlugin.js.map → virtualEntryPlugin.cjs.map} +0 -0
- /package/dist/cjs/vite/{vitePluginSsrCss.js.map → vitePluginSsrCss.cjs.map} +0 -0
- /package/dist/cjs/{vite.js.map → vite.cjs.map} +0 -0
- /package/dist/cjs/zero/{getQueryKey.js.map → getQueryKey.cjs.map} +0 -0
- /package/dist/cjs/zero/{isZeroQuery.js.map → isZeroQuery.cjs.map} +0 -0
- /package/dist/cjs/zero/{resolveQuery.js.map → resolveQuery.cjs.map} +0 -0
- /package/dist/cjs/zero/{subscribeToQuery.js.map → subscribeToQuery.cjs.map} +0 -0
- /package/dist/cjs/zero/{types.js.map → types.cjs.map} +0 -0
- /package/dist/cjs/zero/{useQuery.js.map → useQuery.cjs.map} +0 -0
- /package/dist/cjs/zero/{useQueryZero.js.map → useQueryZero.cjs.map} +0 -0
- /package/dist/cjs/{zero.js.map → zero.cjs.map} +0 -0
@@ -3,31 +3,53 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
4
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
5
5
|
var __export = (target, all) => {
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
6
|
+
for (var name in all) __defProp(target, name, {
|
7
|
+
get: all[name],
|
8
|
+
enumerable: !0
|
9
|
+
});
|
10
|
+
},
|
11
|
+
__copyProps = (to, from, except, desc) => {
|
12
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
13
|
+
get: () => from[key],
|
14
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
15
|
+
});
|
16
|
+
return to;
|
17
|
+
};
|
18
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
19
|
+
value: !0
|
20
|
+
}), mod);
|
15
21
|
var createFileSystemRouter_exports = {};
|
16
22
|
__export(createFileSystemRouter_exports, {
|
17
23
|
createFileSystemRouter: () => createFileSystemRouter
|
18
24
|
});
|
19
25
|
module.exports = __toCommonJS(createFileSystemRouter_exports);
|
20
|
-
var import_node_path = require("node:path"),
|
26
|
+
var import_node_path = require("node:path"),
|
27
|
+
import_perfect_debounce = require("perfect-debounce"),
|
28
|
+
import_vite = require("vite"),
|
29
|
+
import_createHandleRequest = require("../createHandleRequest.cjs"),
|
30
|
+
import_isResponse = require("../utils/isResponse.cjs"),
|
31
|
+
import_isStatus = require("../utils/isStatus.cjs"),
|
32
|
+
import_promiseWithResolvers = require("../utils/promiseWithResolvers.cjs"),
|
33
|
+
import_constants = require("./constants.cjs"),
|
34
|
+
import_replaceLoader = require("./replaceLoader.cjs"),
|
35
|
+
import_resolveAPIRequest = require("./resolveAPIRequest.cjs"),
|
36
|
+
import_virtualEntryPlugin = require("./virtualEntryPlugin.cjs");
|
21
37
|
const USE_SERVER_ENV = !1;
|
22
38
|
//!!process.env.USE_SERVER_ENV
|
23
39
|
function createFileSystemRouter(options) {
|
24
40
|
const preloads = ["/@vite/client", import_virtualEntryPlugin.virtalEntryIdClient];
|
25
|
-
let runner,
|
41
|
+
let runner,
|
42
|
+
server,
|
43
|
+
handleRequest = createRequestHandler(),
|
44
|
+
renderPromise = null;
|
26
45
|
function createRequestHandler() {
|
27
46
|
return (0, import_createHandleRequest.createHandleRequest)(options, {
|
28
|
-
async handleSSR({
|
29
|
-
|
30
|
-
|
47
|
+
async handleSSR({
|
48
|
+
route,
|
49
|
+
url,
|
50
|
+
loaderProps
|
51
|
+
}) {
|
52
|
+
if (console.info(` \u24F5 [${route.type}] ${url} resolved to ${route.file}`), route.type === "spa") return `<html><head>
|
31
53
|
<script>globalThis['global'] = globalThis</script>
|
32
54
|
<script>globalThis['__vxrnIsSPA'] = true</script>
|
33
55
|
<script type="module">
|
@@ -39,29 +61,39 @@ function createFileSystemRouter(options) {
|
|
39
61
|
<script type="module" src="/@vite/client" async=""></script>
|
40
62
|
<script type="module" src="/@id/__x00__virtual:one-entry" async=""></script>
|
41
63
|
</head></html>`;
|
42
|
-
renderPromise && await renderPromise;
|
43
|
-
const {
|
64
|
+
renderPromise && (await renderPromise);
|
65
|
+
const {
|
66
|
+
promise,
|
67
|
+
resolve
|
68
|
+
} = (0, import_promiseWithResolvers.promiseWithResolvers)();
|
44
69
|
renderPromise = promise;
|
45
70
|
try {
|
46
71
|
const routeFile = (0, import_node_path.join)("app", route.file);
|
47
72
|
runner.clearCache(), globalThis.__vxrnresetState?.();
|
48
|
-
const exported = routeFile === "" ? {} : await runner.import(routeFile),
|
73
|
+
const exported = routeFile === "" ? {} : await runner.import(routeFile),
|
74
|
+
loaderData = await exported.loader?.(loaderProps);
|
49
75
|
eval("process.env.TAMAGUI_IS_SERVER = '1'");
|
50
|
-
const entry = await runner.import(import_virtualEntryPlugin.virtualEntryId),
|
76
|
+
const entry = await runner.import(import_virtualEntryPlugin.virtualEntryId),
|
77
|
+
render = entry.default.render;
|
51
78
|
globalThis.__vxrnLoaderData__ = loaderData, globalThis.__vxrnLoaderProps__ = loaderProps, import_constants.LoaderDataCache[route.file] = loaderData;
|
52
|
-
const is404 = route.isNotFound || !exported.default,
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
79
|
+
const is404 = route.isNotFound || !exported.default,
|
80
|
+
html = await render({
|
81
|
+
loaderData,
|
82
|
+
loaderProps,
|
83
|
+
path: loaderProps?.path || "/",
|
84
|
+
preloads
|
85
|
+
});
|
58
86
|
return is404 ? new Response(html, {
|
59
87
|
status: 404,
|
60
|
-
headers: {
|
88
|
+
headers: {
|
89
|
+
"Content-Type": "text/html"
|
90
|
+
}
|
61
91
|
}) : html;
|
62
92
|
} catch (err) {
|
63
93
|
console.error("Error in handleSSR:", err);
|
64
|
-
const title = `Error rendering ${url.pathname} on server`,
|
94
|
+
const title = `Error rendering ${url.pathname} on server`,
|
95
|
+
message = err instanceof Error ? err.message : `${err}`,
|
96
|
+
stack = err instanceof Error ? err.stack : "";
|
65
97
|
return console.error(`${title}
|
66
98
|
${message}
|
67
99
|
|
@@ -81,11 +113,15 @@ ${stack}
|
|
81
113
|
resolve();
|
82
114
|
}
|
83
115
|
},
|
84
|
-
async handleLoader({
|
116
|
+
async handleLoader({
|
117
|
+
request,
|
118
|
+
route: route2,
|
119
|
+
url: url2,
|
120
|
+
loaderProps: loaderProps2
|
121
|
+
}) {
|
85
122
|
const routeFile2 = (0, import_node_path.join)("app", route2.file);
|
86
123
|
let transformedJS = (await server.transformRequest(routeFile2))?.code;
|
87
|
-
if (!transformedJS)
|
88
|
-
throw new Error("No transformed js returned");
|
124
|
+
if (!transformedJS) throw new Error("No transformed js returned");
|
89
125
|
const loaderData2 = await (await runner.import(routeFile2)).loader?.(loaderProps2);
|
90
126
|
loaderData2 && (transformedJS = (0, import_replaceLoader.replaceLoader)({
|
91
127
|
code: transformedJS,
|
@@ -93,18 +129,18 @@ ${stack}
|
|
93
129
|
}));
|
94
130
|
const platform = url2.searchParams.get("platform");
|
95
131
|
if (platform === "ios" || platform === "android") {
|
96
|
-
if (!server.environments[platform || ""])
|
97
|
-
throw new Error(`[handleLoader] No Vite environment found for platform '${platform}'`);
|
132
|
+
if (!server.environments[platform || ""]) throw new Error(`[handleLoader] No Vite environment found for platform '${platform}'`);
|
98
133
|
return `exports.loader = () => (${JSON.stringify(loaderData2)});`;
|
99
134
|
}
|
100
135
|
return transformedJS;
|
101
136
|
},
|
102
|
-
async handleAPI({
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
137
|
+
async handleAPI({
|
138
|
+
request,
|
139
|
+
route: route2,
|
140
|
+
url: url2,
|
141
|
+
loaderProps: loaderProps2
|
142
|
+
}) {
|
143
|
+
return await (0, import_resolveAPIRequest.resolveAPIRequest)(() => runner.import((0, import_node_path.join)("app", route2.file)), request, loaderProps2?.params || {});
|
108
144
|
}
|
109
145
|
});
|
110
146
|
}
|
@@ -113,34 +149,25 @@ ${stack}
|
|
113
149
|
enforce: "post",
|
114
150
|
apply: "serve",
|
115
151
|
async config(userConfig) {
|
116
|
-
if (handleRequest.manifest.pageRoutes)
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
handleRequest.manifest.pageRoutes.flatMap((route2) => [
|
129
|
-
(0, import_node_path.join)("app", route2.file),
|
130
|
-
...route2.layouts?.map((layout) => (0, import_node_path.join)("app", layout.contextKey)) || []
|
131
|
-
])
|
132
|
-
)
|
133
|
-
]
|
134
|
-
}
|
135
|
-
};
|
152
|
+
if (handleRequest.manifest.pageRoutes) return {
|
153
|
+
optimizeDeps: {
|
154
|
+
/**
|
155
|
+
* This adds all our routes and layouts as entries which fixes initial load making
|
156
|
+
* optimizeDeps be triggered which causes hard refreshes (also on initial navigations)
|
157
|
+
*
|
158
|
+
* see: https://vitejs.dev/config/dep-optimization-options.html#optimizedeps-entries
|
159
|
+
* and: https://github.com/remix-run/remix/pull/9921
|
160
|
+
*/
|
161
|
+
entries: [...new Set(handleRequest.manifest.pageRoutes.flatMap(route2 => [(0, import_node_path.join)("app", route2.file), ...(route2.layouts?.map(layout => (0, import_node_path.join)("app", layout.contextKey)) || [])]))]
|
162
|
+
}
|
163
|
+
};
|
136
164
|
},
|
137
165
|
configureServer(serverIn) {
|
138
|
-
server = serverIn, runner = (0, import_vite.createServerModuleRunner)(
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
}, 100);
|
166
|
+
server = serverIn, runner = (0, import_vite.createServerModuleRunner)(USE_SERVER_ENV ? server.environments.server : server.environments.ssr);
|
167
|
+
const appDir = (0, import_node_path.join)(process.cwd(), "app"),
|
168
|
+
fileWatcherChangeListener = (0, import_perfect_debounce.debounce)(async (type, path) => {
|
169
|
+
(type === "add" || type === "delete") && path.startsWith(appDir) && (handleRequest = createRequestHandler());
|
170
|
+
}, 100);
|
144
171
|
return server.watcher.addListener("all", fileWatcherChangeListener), () => {
|
145
172
|
server.middlewares.use(async (req, res, next) => {
|
146
173
|
try {
|
@@ -148,20 +175,22 @@ ${stack}
|
|
148
175
|
if (redirects) {
|
149
176
|
const url2 = new URL(req.url || "", `http://${req.headers.host}`);
|
150
177
|
for (const redirect of redirects) {
|
151
|
-
const regexStr = `^${redirect.source.replace(/:\w+/g, "([^/]+)")}$`,
|
178
|
+
const regexStr = `^${redirect.source.replace(/:\w+/g, "([^/]+)")}$`,
|
179
|
+
match = url2.pathname.match(new RegExp(regexStr));
|
152
180
|
if (match) {
|
153
181
|
let destination = redirect.destination;
|
154
182
|
const params = redirect.source.match(/:\w+/g);
|
155
183
|
params && params.forEach((param, index) => {
|
156
184
|
destination = destination.replace(param, match[index + 1] || "");
|
157
|
-
}), console.warn(` [one] redirecting via redirect: ${destination}`), res.writeHead(redirect.permanent ? 301 : 302, {
|
185
|
+
}), console.warn(` [one] redirecting via redirect: ${destination}`), res.writeHead(redirect.permanent ? 301 : 302, {
|
186
|
+
Location: destination
|
187
|
+
}), res.end();
|
158
188
|
return;
|
159
189
|
}
|
160
190
|
}
|
161
191
|
}
|
162
192
|
const reply = await handleRequest.handler(await convertIncomingMessageToRequest(req));
|
163
|
-
if (!reply)
|
164
|
-
return next();
|
193
|
+
if (!reply) return next();
|
165
194
|
if (typeof reply != "string" && (0, import_isResponse.isResponse)(reply)) {
|
166
195
|
if ((0, import_isStatus.isStatusRedirect)(reply.status)) {
|
167
196
|
const location = `${reply.headers.get("location") || ""}`;
|
@@ -176,10 +205,8 @@ ${stack}
|
|
176
205
|
res.statusCode = reply.status, res.statusMessage = reply.statusText, reply.headers.forEach((value, key) => {
|
177
206
|
if (key === "set-cookie") {
|
178
207
|
const cookies = value.split(", ");
|
179
|
-
for (const cookie of cookies)
|
180
|
-
|
181
|
-
} else
|
182
|
-
res.setHeader(key, value);
|
208
|
+
for (const cookie of cookies) res.appendHeader("Set-Cookie", cookie);
|
209
|
+
} else res.setHeader(key, value);
|
183
210
|
});
|
184
211
|
let outString = "";
|
185
212
|
reply.body && reply.body.locked && console.warn("Body is locked??");
|
@@ -207,13 +234,19 @@ ${stack}
|
|
207
234
|
};
|
208
235
|
}
|
209
236
|
async function streamToString(stream) {
|
210
|
-
const reader = stream.getReader(),
|
237
|
+
const reader = stream.getReader(),
|
238
|
+
decoder = new TextDecoder();
|
211
239
|
let result = "";
|
212
240
|
try {
|
213
|
-
for (
|
214
|
-
const {
|
241
|
+
for (;;) {
|
242
|
+
const {
|
243
|
+
done,
|
244
|
+
value
|
245
|
+
} = await reader.read();
|
215
246
|
if (done) break;
|
216
|
-
result += decoder.decode(value, {
|
247
|
+
result += decoder.decode(value, {
|
248
|
+
stream: !0
|
249
|
+
});
|
217
250
|
}
|
218
251
|
} catch (error) {
|
219
252
|
console.error("Error reading the stream:", error);
|
@@ -222,12 +255,13 @@ async function streamToString(stream) {
|
|
222
255
|
}
|
223
256
|
return result;
|
224
257
|
}
|
225
|
-
const convertIncomingMessageToRequest = async
|
226
|
-
if (!req.originalUrl)
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
258
|
+
const convertIncomingMessageToRequest = async req => {
|
259
|
+
if (!req.originalUrl) throw new Error("Can't convert");
|
260
|
+
const urlBase = `http://${req.headers.host}`,
|
261
|
+
urlString = req.originalUrl || "",
|
262
|
+
url2 = new URL(urlString, urlBase),
|
263
|
+
headers = new Headers();
|
264
|
+
for (const key in req.headers) req.headers[key] && headers.append(key, req.headers[key]);
|
231
265
|
return new Request(url2, {
|
232
266
|
method: req.method,
|
233
267
|
body: ["POST", "PUT", "PATCH", "DELETE"].includes(req.method || "") ? await readStream(req) : null,
|
@@ -237,7 +271,6 @@ const convertIncomingMessageToRequest = async (req) => {
|
|
237
271
|
function readStream(stream) {
|
238
272
|
return new Promise((resolve2, reject) => {
|
239
273
|
const chunks = [];
|
240
|
-
stream.on("data",
|
274
|
+
stream.on("data", chunk => chunks.push(chunk)), stream.on("end", () => resolve2(Buffer.concat(chunks))), stream.on("error", reject);
|
241
275
|
});
|
242
|
-
}
|
243
|
-
//# sourceMappingURL=createFileSystemRouter.js.map
|
276
|
+
}
|
@@ -2,41 +2,54 @@ var __create = Object.create;
|
|
2
2
|
var __defProp = Object.defineProperty;
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
5
|
-
var __getProtoOf = Object.getPrototypeOf,
|
5
|
+
var __getProtoOf = Object.getPrototypeOf,
|
6
|
+
__hasOwnProp = Object.prototype.hasOwnProperty;
|
6
7
|
var __export = (target, all) => {
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
8
|
+
for (var name in all) __defProp(target, name, {
|
9
|
+
get: all[name],
|
10
|
+
enumerable: !0
|
11
|
+
});
|
12
|
+
},
|
13
|
+
__copyProps = (to, from, except, desc) => {
|
14
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
15
|
+
get: () => from[key],
|
16
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
17
|
+
});
|
18
|
+
return to;
|
19
|
+
};
|
15
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
16
21
|
// If the importer is in node compatibility mode or this is not an ESM
|
17
22
|
// file that has been converted to a CommonJS file using a Babel-
|
18
23
|
// compatible transform (i.e. "__esModule" has not been set), then set
|
19
24
|
// "default" to the CommonJS "module.exports" for node compatibility.
|
20
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
21
|
-
|
22
|
-
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
26
|
+
value: mod,
|
27
|
+
enumerable: !0
|
28
|
+
}) : target, mod)),
|
29
|
+
__toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
30
|
+
value: !0
|
31
|
+
}), mod);
|
23
32
|
var customNodeExternals_exports = {};
|
24
33
|
__export(customNodeExternals_exports, {
|
25
34
|
nodeExternals: () => nodeExternals
|
26
35
|
});
|
27
36
|
module.exports = __toCommonJS(customNodeExternals_exports);
|
28
|
-
var import_node_module = require("node:module"),
|
37
|
+
var import_node_module = require("node:module"),
|
38
|
+
import_node_path = __toESM(require("node:path"), 1);
|
29
39
|
function nodeExternals() {
|
30
40
|
return {
|
31
41
|
name: "node-externals",
|
32
42
|
enforce: "pre",
|
33
43
|
resolveId: {
|
34
44
|
order: "pre",
|
35
|
-
async handler(specifier, importer, {
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
45
|
+
async handler(specifier, importer, {
|
46
|
+
isEntry
|
47
|
+
}) {
|
48
|
+
if (isEntry ||
|
49
|
+
// Ignore entry points (they should always be resolved)
|
50
|
+
/^(?:\0|\.{1,2}\/)/.test(specifier) ||
|
51
|
+
// Ignore virtual modules and relative imports
|
52
|
+
import_node_path.default.isAbsolute(specifier)) return null;
|
40
53
|
if ((0, import_node_module.isBuiltin)(specifier)) {
|
41
54
|
const stripped = specifier.replace(/^node:/, "");
|
42
55
|
return {
|
@@ -48,5 +61,4 @@ function nodeExternals() {
|
|
48
61
|
}
|
49
62
|
}
|
50
63
|
};
|
51
|
-
}
|
52
|
-
//# sourceMappingURL=customNodeExternals.js.map
|
64
|
+
}
|
@@ -0,0 +1,68 @@
|
|
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) __defProp(target, name, {
|
7
|
+
get: all[name],
|
8
|
+
enumerable: !0
|
9
|
+
});
|
10
|
+
},
|
11
|
+
__copyProps = (to, from, except, desc) => {
|
12
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
13
|
+
get: () => from[key],
|
14
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
15
|
+
});
|
16
|
+
return to;
|
17
|
+
};
|
18
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
19
|
+
value: !0
|
20
|
+
}), mod);
|
21
|
+
var ensureTsConfig_exports = {};
|
22
|
+
__export(ensureTsConfig_exports, {
|
23
|
+
ensureTSConfig: () => ensureTSConfig
|
24
|
+
});
|
25
|
+
module.exports = __toCommonJS(ensureTsConfig_exports);
|
26
|
+
var import_promises = require("node:fs/promises"),
|
27
|
+
import_polyfills_server = require("../polyfills-server.cjs"),
|
28
|
+
import_existsAsync = require("../utils/existsAsync.cjs");
|
29
|
+
function ensureTSConfig() {
|
30
|
+
(0, import_existsAsync.existsAsync)("tsconfig.json").then(hasTsConfig => {
|
31
|
+
hasTsConfig || (console.info("[one] adding default tsconfig.json. to disable set one/vite { config: { tsConfigPaths: false } }"), (0, import_promises.writeFile)("tsconfig.json", `{
|
32
|
+
"compilerOptions": {
|
33
|
+
"baseUrl": ".",
|
34
|
+
"paths": {
|
35
|
+
"~/*": ["./*"]
|
36
|
+
},
|
37
|
+
"strict": true,
|
38
|
+
"rootDir": ".",
|
39
|
+
"noEmit": true,
|
40
|
+
"module": "Preserve",
|
41
|
+
// allows react-native style imports without path extensions, for compat with platform-specific files
|
42
|
+
"moduleResolution": "Bundler",
|
43
|
+
"preserveSymlinks": true,
|
44
|
+
"skipLibCheck": true,
|
45
|
+
"jsx": "react-jsx",
|
46
|
+
"noImplicitAny": false,
|
47
|
+
"types": [
|
48
|
+
"node",
|
49
|
+
"react",
|
50
|
+
"vite/client"
|
51
|
+
],
|
52
|
+
"lib": [
|
53
|
+
"dom",
|
54
|
+
"esnext"
|
55
|
+
]
|
56
|
+
},
|
57
|
+
"exclude": [
|
58
|
+
"node_modules",
|
59
|
+
".expo",
|
60
|
+
"**/test",
|
61
|
+
"**/dist",
|
62
|
+
"**/types",
|
63
|
+
"**/__tests__"
|
64
|
+
],
|
65
|
+
}
|
66
|
+
`));
|
67
|
+
});
|
68
|
+
}
|
@@ -0,0 +1,74 @@
|
|
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,
|
6
|
+
__hasOwnProp = Object.prototype.hasOwnProperty;
|
7
|
+
var __export = (target, all) => {
|
8
|
+
for (var name in all) __defProp(target, name, {
|
9
|
+
get: all[name],
|
10
|
+
enumerable: !0
|
11
|
+
});
|
12
|
+
},
|
13
|
+
__copyProps = (to, from, except, desc) => {
|
14
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
15
|
+
get: () => from[key],
|
16
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
17
|
+
});
|
18
|
+
return to;
|
19
|
+
};
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
26
|
+
value: mod,
|
27
|
+
enumerable: !0
|
28
|
+
}) : target, mod)),
|
29
|
+
__toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
30
|
+
value: !0
|
31
|
+
}), mod);
|
32
|
+
var findDepsToOptimize_exports = {};
|
33
|
+
__export(findDepsToOptimize_exports, {
|
34
|
+
getAllDependencies: () => getAllDependencies
|
35
|
+
});
|
36
|
+
module.exports = __toCommonJS(findDepsToOptimize_exports);
|
37
|
+
var import_fs_extra = __toESM(require("fs-extra"), 1),
|
38
|
+
import_promises = __toESM(require("node:fs/promises"), 1),
|
39
|
+
import_node_path = __toESM(require("node:path"), 1),
|
40
|
+
import_node_module = require("node:module");
|
41
|
+
async function getAllDependencies(root, depth = 20) {
|
42
|
+
if (depth === 0) return [];
|
43
|
+
const pkgJsonPath = await findClosestPkgJsonPath(root);
|
44
|
+
if (!pkgJsonPath) throw new Error(`Cannot find package.json from ${root}`);
|
45
|
+
return await crawl(pkgJsonPath, depth - 1);
|
46
|
+
}
|
47
|
+
async function crawl(pkgJsonPath, depth = 1 / 0) {
|
48
|
+
const pkgJson = await import_fs_extra.default.readJson(pkgJsonPath).catch(e => {
|
49
|
+
throw new Error(`Unable to read ${pkgJsonPath}`, {
|
50
|
+
cause: e
|
51
|
+
});
|
52
|
+
});
|
53
|
+
let dependencies = pkgJson.dependencies ? Object.keys(pkgJson.dependencies) : [];
|
54
|
+
return await Promise.all(dependencies.map(async depName => {
|
55
|
+
try {
|
56
|
+
const resolved = (0, import_node_module.createRequire)((0, import_node_path.dirname)(pkgJsonPath)).resolve(depName),
|
57
|
+
subDeps = await getAllDependencies(resolved, depth - 1);
|
58
|
+
subDeps && (dependencies = [...dependencies, ...subDeps]);
|
59
|
+
} catch {
|
60
|
+
console.log("Couldn't resolve", depName);
|
61
|
+
}
|
62
|
+
})), [...new Set(dependencies)];
|
63
|
+
}
|
64
|
+
async function findClosestPkgJsonPath(dir, predicate) {
|
65
|
+
for (dir.endsWith("package.json") && (dir = import_node_path.default.dirname(dir)); dir;) {
|
66
|
+
const pkg = import_node_path.default.join(dir, "package.json");
|
67
|
+
try {
|
68
|
+
if ((await import_promises.default.stat(pkg)).isFile() && (!predicate || (await predicate(pkg)))) return pkg;
|
69
|
+
} catch {}
|
70
|
+
const nextDir = import_node_path.default.dirname(dir);
|
71
|
+
if (nextDir === dir) break;
|
72
|
+
dir = nextDir;
|
73
|
+
}
|
74
|
+
}
|
@@ -3,15 +3,21 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
4
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
5
5
|
var __export = (target, all) => {
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
6
|
+
for (var name in all) __defProp(target, name, {
|
7
|
+
get: all[name],
|
8
|
+
enumerable: !0
|
9
|
+
});
|
10
|
+
},
|
11
|
+
__copyProps = (to, from, except, desc) => {
|
12
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
13
|
+
get: () => from[key],
|
14
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
15
|
+
});
|
16
|
+
return to;
|
17
|
+
};
|
18
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
19
|
+
value: !0
|
20
|
+
}), mod);
|
15
21
|
var fixDependenciesPlugin_exports = {};
|
16
22
|
__export(fixDependenciesPlugin_exports, {
|
17
23
|
fixDependenciesPlugin: () => fixDependenciesPlugin
|
@@ -36,8 +42,7 @@ function fixDependenciesPlugin(options) {
|
|
36
42
|
!hasApplied && patches.length && (hasApplied = !0, await (0, import_vxrn.applyOptimizePatches)(patches, config));
|
37
43
|
},
|
38
44
|
async configResolved(config) {
|
39
|
-
patches.length && await (0, import_vxrn.applyDependencyPatches)(patches, config);
|
45
|
+
patches.length && (await (0, import_vxrn.applyDependencyPatches)(patches, config));
|
40
46
|
}
|
41
47
|
};
|
42
|
-
}
|
43
|
-
//# sourceMappingURL=fixDependenciesPlugin.js.map
|
48
|
+
}
|
@@ -0,0 +1,45 @@
|
|
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) __defProp(target, name, {
|
7
|
+
get: all[name],
|
8
|
+
enumerable: !0
|
9
|
+
});
|
10
|
+
},
|
11
|
+
__copyProps = (to, from, except, desc) => {
|
12
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
13
|
+
get: () => from[key],
|
14
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
15
|
+
});
|
16
|
+
return to;
|
17
|
+
};
|
18
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
19
|
+
value: !0
|
20
|
+
}), mod);
|
21
|
+
var generateTypesForRoutes_exports = {};
|
22
|
+
__export(generateTypesForRoutes_exports, {
|
23
|
+
generateTypesForRoutes: () => generateTypesForRoutes
|
24
|
+
});
|
25
|
+
module.exports = __toCommonJS(generateTypesForRoutes_exports);
|
26
|
+
var import_node_path = require("node:path"),
|
27
|
+
import_perfect_debounce = require("perfect-debounce"),
|
28
|
+
import_generateRouteTypes = require("../typed-routes/generateRouteTypes.cjs");
|
29
|
+
function generateTypesForRoutes(options) {
|
30
|
+
return {
|
31
|
+
name: "one-generate-fs-route-types",
|
32
|
+
enforce: "post",
|
33
|
+
apply: "serve",
|
34
|
+
configureServer(server) {
|
35
|
+
const appDir = (0, import_node_path.join)(process.cwd(), "app"),
|
36
|
+
outFile = (0, import_node_path.join)(process.cwd(), "routes.d.ts"),
|
37
|
+
fileWatcherChangeListener = (0, import_perfect_debounce.debounce)(async (type, path) => {
|
38
|
+
(type === "add" || type === "delete") && path.startsWith(appDir) && (0, import_generateRouteTypes.generateRouteTypes)(outFile);
|
39
|
+
}, 100);
|
40
|
+
return server.watcher.addListener("all", fileWatcherChangeListener), () => {
|
41
|
+
(0, import_generateRouteTypes.generateRouteTypes)(outFile);
|
42
|
+
};
|
43
|
+
}
|
44
|
+
};
|
45
|
+
}
|