one 1.1.308 → 1.1.310
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/Root.cjs +212 -0
- 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} +60 -49
- 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.js → getURL.cjs} +16 -11
- 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/package.json +10 -10
- package/dist/cjs/Root.js +0 -182
- 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/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/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/{Root.js.map → Root.cjs.map} +0 -0
- /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/{createHandleRequest.js.map → createHandleRequest.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,24 +3,32 @@ 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 createRoutesManifest_exports = {};
|
16
22
|
__export(createRoutesManifest_exports, {
|
17
23
|
createRoutesManifest: () => createRoutesManifest
|
18
24
|
});
|
19
25
|
module.exports = __toCommonJS(createRoutesManifest_exports);
|
20
|
-
var import_getRoutes = require("../getRoutes"),
|
26
|
+
var import_getRoutes = require("../getRoutes.cjs"),
|
27
|
+
import_getServerManifest = require("./getServerManifest.cjs");
|
21
28
|
function createMockModuleWithContext(map = []) {
|
22
|
-
const contextModule =
|
23
|
-
|
29
|
+
const contextModule = key => ({
|
30
|
+
default() {}
|
31
|
+
});
|
24
32
|
return Object.defineProperty(contextModule, "keys", {
|
25
33
|
value: () => map
|
26
34
|
}), contextModule;
|
@@ -33,8 +41,6 @@ function createRoutesManifest(paths, options) {
|
|
33
41
|
ignoreEntryPoints: !0,
|
34
42
|
platform: "web"
|
35
43
|
});
|
36
|
-
if (!routeTree)
|
37
|
-
throw new Error(`No route tree found in paths: ${JSON.stringify(paths)}`);
|
44
|
+
if (!routeTree) throw new Error(`No route tree found in paths: ${JSON.stringify(paths)}`);
|
38
45
|
return (0, import_getServerManifest.getServerManifest)(routeTree);
|
39
|
-
}
|
40
|
-
//# sourceMappingURL=createRoutesManifest.js.map
|
46
|
+
}
|
@@ -3,41 +3,51 @@ 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 getServerManifest_exports = {};
|
16
22
|
__export(getServerManifest_exports, {
|
17
23
|
getServerManifest: () => getServerManifest,
|
18
24
|
parseParam: () => parseParam
|
19
25
|
});
|
20
26
|
module.exports = __toCommonJS(getServerManifest_exports);
|
21
|
-
var import_matchers = require("../matchers"),
|
27
|
+
var import_matchers = require("../matchers.cjs"),
|
28
|
+
import_sortRoutes = require("../sortRoutes.cjs");
|
22
29
|
function isNotFoundRoute(route) {
|
23
30
|
return !!(route.dynamic && route.dynamic[route.dynamic.length - 1].notFound);
|
24
31
|
}
|
25
32
|
function getServerManifest(route) {
|
26
33
|
function getFlatNodes(route2, layouts) {
|
27
|
-
if (route2.children.length)
|
28
|
-
return route2.children.flatMap((child) => getFlatNodes(child, [...layouts || [], route2]));
|
34
|
+
if (route2.children.length) return route2.children.flatMap(child => getFlatNodes(child, [...(layouts || []), route2]));
|
29
35
|
let key;
|
30
|
-
return route2.type === "api" ? key = (0, import_matchers.getContextKey)(route2.contextKey).replace(/\/index$/, "") || "/" : key = layouts?.flatMap(
|
36
|
+
return route2.type === "api" ? key = (0, import_matchers.getContextKey)(route2.contextKey).replace(/\/index$/, "") || "/" : key = layouts?.flatMap(route3 => {
|
31
37
|
const key2 = (0, import_matchers.getContextKey)(route3.route).replace(/\/index$/, "") || "/";
|
32
38
|
return key2 === "/" || key2.startsWith("/(") ? [] : [key2];
|
33
|
-
}) + (0, import_matchers.getContextKey)(route2.route).replace(/\/index$/, "") || "/", [[key, {
|
39
|
+
}) + (0, import_matchers.getContextKey)(route2.route).replace(/\/index$/, "") || "/", [[key, {
|
40
|
+
...route2,
|
41
|
+
layouts
|
42
|
+
}]];
|
34
43
|
}
|
35
|
-
const flat = getFlatNodes(route).sort(([, a], [, b]) => (0, import_sortRoutes.sortRoutes)(b, a)).reverse(),
|
36
|
-
|
37
|
-
|
44
|
+
const flat = getFlatNodes(route).sort(([, a], [, b]) => (0, import_sortRoutes.sortRoutes)(b, a)).reverse(),
|
45
|
+
pathToRoute = {};
|
46
|
+
for (const [path, route2] of flat) pathToRoute[path] && (console.warn(`
|
38
47
|
[one] \u274C Duplicate routes error`), console.warn(" Multiple routes at the same path! One route will always win over the other."), console.warn(` path: ${path}`), console.warn(` first route: ${pathToRoute[path].contextKey}`), console.warn(` second route: ${route2.contextKey}
|
39
48
|
`)), pathToRoute[path] = route2;
|
40
|
-
const apiRoutes = [],
|
49
|
+
const apiRoutes = [],
|
50
|
+
pageRoutes = [];
|
41
51
|
for (const [path, node] of flat) {
|
42
52
|
if (node.type === "api") {
|
43
53
|
apiRoutes.push(getGeneratedNamedRouteRegex(path, node));
|
@@ -69,11 +79,12 @@ function getNamedRouteRegex(normalizedRoute, node) {
|
|
69
79
|
};
|
70
80
|
}
|
71
81
|
function buildGetSafeRouteKey() {
|
72
|
-
let currentCharCode = 96,
|
82
|
+
let currentCharCode = 96,
|
83
|
+
currentLength = 1;
|
73
84
|
return () => {
|
74
|
-
let result = "",
|
75
|
-
|
76
|
-
|
85
|
+
let result = "",
|
86
|
+
incrementNext = !0;
|
87
|
+
for (let i = 0; i < currentLength; i++) incrementNext && (currentCharCode++, currentCharCode > 122 ? (currentCharCode = 97, incrementNext = !0) : incrementNext = !1), result = String.fromCharCode(currentCharCode) + result;
|
77
88
|
return incrementNext && (currentLength++, currentCharCode = 96), result;
|
78
89
|
};
|
79
90
|
}
|
@@ -81,16 +92,23 @@ function removeTrailingSlash(route) {
|
|
81
92
|
return route.replace(/\/$/, "") || "/";
|
82
93
|
}
|
83
94
|
function getNamedRegex(route) {
|
84
|
-
const segments = removeTrailingSlash(route).slice(1).split("/"),
|
95
|
+
const segments = removeTrailingSlash(route).slice(1).split("/"),
|
96
|
+
getSafeRouteKey = buildGetSafeRouteKey(),
|
97
|
+
routeKeys = {};
|
85
98
|
return {
|
86
99
|
namedRegex: `^${segments.map((segment, index) => {
|
87
100
|
if (segment === "+not-found" && index === segments.length - 1 && (segment = "[...not-found]"), /^\[.*\]$/.test(segment)) {
|
88
|
-
const {
|
89
|
-
|
101
|
+
const {
|
102
|
+
name,
|
103
|
+
optional,
|
104
|
+
repeat
|
105
|
+
} = parseParam(segment);
|
106
|
+
let cleanedKey = name.replace(/\W/g, ""),
|
107
|
+
invalidKey = !1;
|
90
108
|
return (cleanedKey.length === 0 || cleanedKey.length > 30) && (invalidKey = !0), Number.isNaN(Number.parseInt(cleanedKey.slice(0, 1), 10)) || (invalidKey = !0), cleanedKey in routeKeys && (invalidKey = !0), invalidKey && (cleanedKey = getSafeRouteKey()), routeKeys[cleanedKey] = name, repeat ? optional ? `(?:/(?<${cleanedKey}>.+?))?` : `/(?<${cleanedKey}>.+?)` : `/(?<${cleanedKey}>[^/]+?)`;
|
91
109
|
}
|
92
110
|
if (insideParensRegex.test(segment)) {
|
93
|
-
const groupName = (0, import_matchers.matchGroupName)(segment).split(",").map(
|
111
|
+
const groupName = (0, import_matchers.matchGroupName)(segment).split(",").map(group => group.trim()).filter(Boolean);
|
94
112
|
return groupName.length > 1 ? `(?:/${`\\((?:${groupName.map(escapeStringRegexp).join("|")})\\)`})?` : `(?:/${escapeStringRegexp(segment)})?`;
|
95
113
|
}
|
96
114
|
return `/${escapeStringRegexp(segment)}`;
|
@@ -98,12 +116,21 @@ function getNamedRegex(route) {
|
|
98
116
|
routeKeys
|
99
117
|
};
|
100
118
|
}
|
101
|
-
const insideBracketsRegex = /^\[.*\]$/,
|
119
|
+
const insideBracketsRegex = /^\[.*\]$/,
|
120
|
+
insideParensRegex = /^\(.*\)$/,
|
121
|
+
tripleDotRegex = /^\.\.\./,
|
122
|
+
replaceRegex = /[|\\{}()[\]^$+*?.-]/g,
|
123
|
+
hasRegExpRegex = /[|\\{}()[\]^$+*?.-]/;
|
102
124
|
function escapeStringRegexp(str) {
|
103
125
|
return hasRegExpRegex.test(str) ? str.replace(replaceRegex, "\\$&") : str;
|
104
126
|
}
|
105
127
|
function parseParam(param) {
|
106
|
-
let repeat = !1,
|
107
|
-
|
108
|
-
|
109
|
-
|
128
|
+
let repeat = !1,
|
129
|
+
optional = !1,
|
130
|
+
name = param;
|
131
|
+
return insideBracketsRegex.test(name) && (optional = !0, name = name.slice(1, -1)), tripleDotRegex.test(name) && (repeat = !0, name = name.slice(3)), {
|
132
|
+
name,
|
133
|
+
repeat,
|
134
|
+
optional
|
135
|
+
};
|
136
|
+
}
|
@@ -2,24 +2,33 @@ 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 server_render_exports = {};
|
24
33
|
__export(server_render_exports, {
|
25
34
|
renderToString: () => renderToString
|
@@ -33,10 +42,12 @@ const renderToString = async (app, options) => {
|
|
33
42
|
return await readableStream.allReady, await streamToString(readableStream);
|
34
43
|
};
|
35
44
|
async function streamToString(stream) {
|
36
|
-
const decoder = new TextDecoder("utf-8", {
|
45
|
+
const decoder = new TextDecoder("utf-8", {
|
46
|
+
fatal: !0
|
47
|
+
});
|
37
48
|
let result = "";
|
38
|
-
for await (const chunk of stream)
|
39
|
-
|
49
|
+
for await (const chunk of stream) result += decoder.decode(chunk, {
|
50
|
+
stream: !0
|
51
|
+
});
|
40
52
|
return result += decoder.decode(), result;
|
41
|
-
}
|
42
|
-
//# sourceMappingURL=server-render.js.map
|
53
|
+
}
|
@@ -0,0 +1,62 @@
|
|
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 sortRoutes_exports = {};
|
22
|
+
__export(sortRoutes_exports, {
|
23
|
+
sortRoutes: () => sortRoutes,
|
24
|
+
sortRoutesWithInitial: () => sortRoutesWithInitial
|
25
|
+
});
|
26
|
+
module.exports = __toCommonJS(sortRoutes_exports);
|
27
|
+
var import_matchers = require("./matchers.cjs");
|
28
|
+
function sortDynamicConvention(a, b) {
|
29
|
+
return a.deep && !b.deep ? 1 : !a.deep && b.deep ? -1 : 0;
|
30
|
+
}
|
31
|
+
function sortRoutes(a, b) {
|
32
|
+
if (a.dynamic && !b.dynamic) return 1;
|
33
|
+
if (!a.dynamic && b.dynamic) return -1;
|
34
|
+
if (a.dynamic && b.dynamic) {
|
35
|
+
if (a.dynamic.length !== b.dynamic.length) return b.dynamic.length - a.dynamic.length;
|
36
|
+
for (let i = 0; i < a.dynamic.length; i++) {
|
37
|
+
const aDynamic = a.dynamic[i],
|
38
|
+
bDynamic = b.dynamic[i];
|
39
|
+
if (aDynamic.notFound && bDynamic.notFound) {
|
40
|
+
const s2 = sortDynamicConvention(aDynamic, bDynamic);
|
41
|
+
if (s2) return s2;
|
42
|
+
}
|
43
|
+
if (aDynamic.notFound && !bDynamic.notFound) return 1;
|
44
|
+
if (!aDynamic.notFound && bDynamic.notFound) return -1;
|
45
|
+
const s = sortDynamicConvention(aDynamic, bDynamic);
|
46
|
+
if (s) return s;
|
47
|
+
}
|
48
|
+
return 0;
|
49
|
+
}
|
50
|
+
const aIndex = a.route === "index" || (0, import_matchers.matchGroupName)(a.route) != null,
|
51
|
+
bIndex = b.route === "index" || (0, import_matchers.matchGroupName)(b.route) != null;
|
52
|
+
return aIndex && !bIndex ? -1 : !aIndex && bIndex ? 1 : a.route.length - b.route.length;
|
53
|
+
}
|
54
|
+
function sortRoutesWithInitial(initialRouteName) {
|
55
|
+
return (a, b) => {
|
56
|
+
if (initialRouteName) {
|
57
|
+
if (a.route === initialRouteName) return -1;
|
58
|
+
if (b.route === initialRouteName) return 1;
|
59
|
+
}
|
60
|
+
return sortRoutes(a, b);
|
61
|
+
};
|
62
|
+
}
|
@@ -0,0 +1,48 @@
|
|
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 generateRouteTypes_exports = {};
|
33
|
+
__export(generateRouteTypes_exports, {
|
34
|
+
generateRouteTypes: () => generateRouteTypes
|
35
|
+
});
|
36
|
+
module.exports = __toCommonJS(generateRouteTypes_exports);
|
37
|
+
var import_fs_extra = __toESM(require("fs-extra"), 1),
|
38
|
+
import_promises = require("node:fs/promises"),
|
39
|
+
import_node_path = require("node:path"),
|
40
|
+
import_useViteRoutes = require("../useViteRoutes.cjs"),
|
41
|
+
import_globDir = require("../utils/globDir.cjs"),
|
42
|
+
import_getTypedRoutesDeclarationFile = require("./getTypedRoutesDeclarationFile.cjs");
|
43
|
+
async function generateRouteTypes(outFile) {
|
44
|
+
const routes = (0, import_globDir.globDir)("app").reduce((acc, cur) => (acc[cur] = {}, acc), {}),
|
45
|
+
context = (0, import_useViteRoutes.globbedRoutesToRouteContext)(routes),
|
46
|
+
declarations = (0, import_getTypedRoutesDeclarationFile.getTypedRoutesDeclarationFile)(context);
|
47
|
+
await import_fs_extra.default.ensureDir((0, import_node_path.dirname)(outFile)), await (0, import_promises.writeFile)(outFile, declarations);
|
48
|
+
}
|
package/dist/cjs/typed-routes/{getTypedRoutesDeclarationFile.js → getTypedRoutesDeclarationFile.cjs}
RENAMED
@@ -3,37 +3,41 @@ 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 getTypedRoutesDeclarationFile_exports = {};
|
16
22
|
__export(getTypedRoutesDeclarationFile_exports, {
|
17
23
|
getTypedRoutesDeclarationFile: () => getTypedRoutesDeclarationFile
|
18
24
|
});
|
19
25
|
module.exports = __toCommonJS(getTypedRoutesDeclarationFile_exports);
|
20
|
-
var import_getRoutes = require("../getRoutes"),
|
21
|
-
|
26
|
+
var import_getRoutes = require("../getRoutes.cjs"),
|
27
|
+
import_matchers = require("../matchers.cjs");
|
28
|
+
const CATCH_ALL = /\[\.\.\..+?\]/g,
|
29
|
+
SLUG = /\[.+?\]/g;
|
22
30
|
function getTypedRoutesDeclarationFile(ctx) {
|
23
|
-
const staticRoutes = /* @__PURE__ */
|
24
|
-
|
25
|
-
(
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
staticRoutes,
|
34
|
-
dynamicRoutes,
|
35
|
-
dynamicRouteContextKeys
|
36
|
-
), `
|
31
|
+
const staticRoutes = /* @__PURE__ */new Set(),
|
32
|
+
dynamicRoutes = /* @__PURE__ */new Set(),
|
33
|
+
dynamicRouteContextKeys = /* @__PURE__ */new Set();
|
34
|
+
return walkRouteNode((0, import_getRoutes.getRoutes)(ctx, {
|
35
|
+
platformRoutes: !1,
|
36
|
+
// We don't need to generate platform specific routes
|
37
|
+
ignoreEntryPoints: !0,
|
38
|
+
ignoreRequireErrors: !0
|
39
|
+
// importMode: 'async',
|
40
|
+
}), "", staticRoutes, dynamicRoutes, dynamicRouteContextKeys), `
|
37
41
|
import type { OneRouter } from 'one'
|
38
42
|
|
39
43
|
declare module 'one' {
|
@@ -51,33 +55,26 @@ declare module 'one' {
|
|
51
55
|
function walkRouteNode(routeNode, parentRoutePath, staticRoutes, dynamicRoutes, dynamicRouteContextKeys) {
|
52
56
|
if (routeNode) {
|
53
57
|
addRouteNode(routeNode, parentRoutePath, staticRoutes, dynamicRoutes, dynamicRouteContextKeys), parentRoutePath = `${(0, import_matchers.removeSupportedExtensions)(`${parentRoutePath}/${routeNode.route}`).replace(/\/?index$/, "")}`;
|
54
|
-
for (const child of routeNode.children)
|
55
|
-
walkRouteNode(child, parentRoutePath, staticRoutes, dynamicRoutes, dynamicRouteContextKeys);
|
58
|
+
for (const child of routeNode.children) walkRouteNode(child, parentRoutePath, staticRoutes, dynamicRoutes, dynamicRouteContextKeys);
|
56
59
|
}
|
57
60
|
}
|
58
61
|
function addRouteNode(routeNode, parentRoutePath, staticRoutes, dynamicRoutes, dynamicRouteContextKeys) {
|
59
62
|
if (!routeNode?.route || !(0, import_matchers.isTypedRoute)(routeNode.route)) return;
|
60
63
|
let routePath = `${parentRoutePath}/${(0, import_matchers.removeSupportedExtensions)(routeNode.route).replace(/\/?index$/, "")}`;
|
61
|
-
if (routePath.startsWith("/") || (routePath = `/${routePath}`), routeNode.dynamic)
|
62
|
-
for (const path of generateCombinations(routePath))
|
63
|
-
dynamicRouteContextKeys.add(path), dynamicRoutes.add(
|
64
|
-
`${path.replaceAll(CATCH_ALL, "${string}").replaceAll(SLUG, "${OneRouter.SingleRoutePart<T>}")}`
|
65
|
-
);
|
66
|
-
else
|
67
|
-
for (const combination of generateCombinations(routePath))
|
68
|
-
staticRoutes.add(combination);
|
64
|
+
if (routePath.startsWith("/") || (routePath = `/${routePath}`), routeNode.dynamic) for (const path of generateCombinations(routePath)) dynamicRouteContextKeys.add(path), dynamicRoutes.add(`${path.replaceAll(CATCH_ALL, "${string}").replaceAll(SLUG, "${OneRouter.SingleRoutePart<T>}")}`);else for (const combination of generateCombinations(routePath)) staticRoutes.add(combination);
|
69
65
|
}
|
70
|
-
const setToUnionType =
|
66
|
+
const setToUnionType = set => set.size > 0 ? [...set].sort().map(s => `\`${s}\``).join(" | ") : "never";
|
71
67
|
function generateCombinations(pathname) {
|
72
|
-
const groups = pathname.split("/").filter(
|
68
|
+
const groups = pathname.split("/").filter(part => part.startsWith("(") && part.endsWith(")")),
|
69
|
+
combinations = [];
|
73
70
|
function generate(currentIndex, currentPath) {
|
74
71
|
if (currentIndex === groups.length) {
|
75
72
|
combinations.push(currentPath.replace(/\/{2,}/g, "/"));
|
76
73
|
return;
|
77
74
|
}
|
78
|
-
const group = groups[currentIndex],
|
75
|
+
const group = groups[currentIndex],
|
76
|
+
withoutGroup = currentPath.replace(`/${group}`, "");
|
79
77
|
generate(currentIndex + 1, withoutGroup), generate(currentIndex + 1, currentPath);
|
80
78
|
}
|
81
79
|
return generate(0, pathname), combinations;
|
82
|
-
}
|
83
|
-
//# sourceMappingURL=getTypedRoutesDeclarationFile.js.map
|
80
|
+
}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
var __defProp = Object.defineProperty;
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
6
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
7
|
+
get: () => from[key],
|
8
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
9
|
+
});
|
10
|
+
return to;
|
11
|
+
};
|
12
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
13
|
+
value: !0
|
14
|
+
}), mod);
|
15
|
+
var types_exports = {};
|
16
|
+
module.exports = __toCommonJS(types_exports);
|
@@ -2,30 +2,40 @@ 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 useFocusEffect_exports = {};
|
24
33
|
__export(useFocusEffect_exports, {
|
25
34
|
useFocusEffect: () => useFocusEffect
|
26
35
|
});
|
27
36
|
module.exports = __toCommonJS(useFocusEffect_exports);
|
28
|
-
var React = __toESM(require("react"), 1),
|
37
|
+
var React = __toESM(require("react"), 1),
|
38
|
+
import_useLoadedNavigation = require("./link/useLoadedNavigation.cjs");
|
29
39
|
function useFocusEffect(effect, do_not_pass_a_second_prop) {
|
30
40
|
const navigation = (0, import_useLoadedNavigation.useOptionalNavigation)();
|
31
41
|
do_not_pass_a_second_prop !== void 0 && console.error(`You passed a second argument to 'useFocusEffect', but it only accepts one argument. If you want to pass a dependency array, you can use 'React.useCallback':
|
@@ -37,13 +47,12 @@ useFocusEffect(
|
|
37
47
|
);
|
38
48
|
|
39
49
|
See usage guide: https://reactnavigation.org/docs/use-focus-effect`), React.useEffect(() => {
|
40
|
-
if (!navigation)
|
41
|
-
|
42
|
-
|
50
|
+
if (!navigation) return;
|
51
|
+
let isFocused = !1,
|
52
|
+
cleanup;
|
43
53
|
const callback = () => {
|
44
54
|
const destroy = effect();
|
45
|
-
if (destroy === void 0 || typeof destroy == "function")
|
46
|
-
return destroy;
|
55
|
+
if (destroy === void 0 || typeof destroy == "function") return destroy;
|
47
56
|
if (process.env.NODE_ENV !== "production") {
|
48
57
|
let message = "An effect function must not return anything besides a function, which is used for clean-up.";
|
49
58
|
destroy === null ? message += " You returned 'null'. If your effect does not require clean-up, return 'undefined' (or nothing)." : typeof destroy.then == "function" ? message += `
|
@@ -67,13 +76,13 @@ See usage guide: https://reactnavigation.org/docs/use-focus-effect` : message +=
|
|
67
76
|
};
|
68
77
|
navigation.isFocused() && (cleanup = callback(), isFocused = !0);
|
69
78
|
const unsubscribeFocus = navigation.addListener("focus", () => {
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
79
|
+
isFocused || (cleanup !== void 0 && cleanup(), cleanup = callback(), isFocused = !0);
|
80
|
+
}),
|
81
|
+
unsubscribeBlur = navigation.addListener("blur", () => {
|
82
|
+
cleanup !== void 0 && cleanup(), cleanup = void 0, isFocused = !1;
|
83
|
+
});
|
74
84
|
return () => {
|
75
85
|
cleanup !== void 0 && cleanup(), unsubscribeFocus(), unsubscribeBlur();
|
76
86
|
};
|
77
87
|
}, [effect, navigation]);
|
78
|
-
}
|
79
|
-
//# sourceMappingURL=useFocusEffect.js.map
|
88
|
+
}
|