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
package/dist/cjs/vite/build.js
DELETED
@@ -1,376 +0,0 @@
|
|
1
|
-
var __create = Object.create;
|
2
|
-
var __defProp = Object.defineProperty;
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
5
|
-
var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
|
6
|
-
var __export = (target, all) => {
|
7
|
-
for (var name in all)
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: !0 });
|
9
|
-
}, __copyProps = (to, from, except, desc) => {
|
10
|
-
if (from && typeof from == "object" || typeof from == "function")
|
11
|
-
for (let key of __getOwnPropNames(from))
|
12
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
13
|
-
return to;
|
14
|
-
};
|
15
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
16
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
17
|
-
// file that has been converted to a CommonJS file using a Babel-
|
18
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
19
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
20
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
|
21
|
-
mod
|
22
|
-
)), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
23
|
-
var build_exports = {};
|
24
|
-
__export(build_exports, {
|
25
|
-
build: () => build
|
26
|
-
});
|
27
|
-
module.exports = __toCommonJS(build_exports);
|
28
|
-
var import_fs_extra = __toESM(require("fs-extra"), 1), import_micromatch = __toESM(require("micromatch"), 1), import_node_module = require("node:module"), import_node_path = __toESM(require("node:path"), 1), import_rollup_plugin_node_externals = require("rollup-plugin-node-externals"), import_vite = require("vite"), import_vxrn = require("vxrn"), import_cleanUrl = require("../cleanUrl"), import_getManifest = require("./getManifest"), import_one = require("./one"), import_replaceLoader = require("./replaceLoader"), import_label_process = require("../cli/label-process");
|
29
|
-
const import_meta = {}, { ensureDir, readFile, outputFile } = import_fs_extra.default;
|
30
|
-
process.on("uncaughtException", (err) => {
|
31
|
-
console.error(err?.message || err);
|
32
|
-
});
|
33
|
-
async function build(args) {
|
34
|
-
(0, import_label_process.labelProcess)("build");
|
35
|
-
const userOptions = await (0, import_one.loadUserOneOptions)("build"), serverOutputFormat = userOptions.build?.server?.outputFormat ?? "esm";
|
36
|
-
process.env.VXRN_REACT_19 = "1", process.env.ONE_SERVER_URL || console.warn(
|
37
|
-
"\u26A0\uFE0F No ONE_SERVER_URL environment set, set it in your .env to your target deploy URL"
|
38
|
-
);
|
39
|
-
const vxrnOutput = await (0, import_vxrn.build)(
|
40
|
-
{
|
41
|
-
server: userOptions.server,
|
42
|
-
build: {
|
43
|
-
analyze: !0,
|
44
|
-
server: {
|
45
|
-
outputFormat: serverOutputFormat
|
46
|
-
}
|
47
|
-
}
|
48
|
-
},
|
49
|
-
args
|
50
|
-
), options = await (0, import_vxrn.fillOptions)(vxrnOutput.options), toAbsolute = (p) => import_node_path.default.resolve(options.root, p), manifest = (0, import_getManifest.getManifest)(), { optimizeDeps } = (0, import_vxrn.getOptimizeDeps)("build"), apiBuildConfig = (0, import_vite.mergeConfig)(
|
51
|
-
// feels like this should build off the *server* build config not web
|
52
|
-
vxrnOutput.webBuildConfig,
|
53
|
-
{
|
54
|
-
configFile: !1,
|
55
|
-
appType: "custom",
|
56
|
-
optimizeDeps
|
57
|
-
}
|
58
|
-
);
|
59
|
-
if (manifest.apiRoutes.length) {
|
60
|
-
console.info(`
|
61
|
-
\u{1F528} build api routes
|
62
|
-
`);
|
63
|
-
const processEnvDefines = Object.fromEntries(
|
64
|
-
Object.entries(process.env).map(([key, value]) => [`process.env.${key}`, JSON.stringify(value)])
|
65
|
-
), apiRouteExternalRegex = buildRegexExcludingDeps(optimizeDeps.include), apiEntryPoints = manifest.apiRoutes.reduce((entries, { page, file }) => (entries[page.slice(1) + ".js"] = (0, import_node_path.join)("app", file), entries), {}), apiOutputFormat = userOptions?.build?.api?.outputFormat ?? serverOutputFormat, treeshake = userOptions?.build?.api?.treeshake;
|
66
|
-
await (0, import_vite.build)(
|
67
|
-
(0, import_vite.mergeConfig)(apiBuildConfig, {
|
68
|
-
appType: "custom",
|
69
|
-
configFile: !1,
|
70
|
-
plugins: [
|
71
|
-
(0, import_rollup_plugin_node_externals.nodeExternals)({
|
72
|
-
exclude: optimizeDeps.include
|
73
|
-
})
|
74
|
-
],
|
75
|
-
define: {
|
76
|
-
...processEnvDefines
|
77
|
-
},
|
78
|
-
ssr: {
|
79
|
-
noExternal: !0,
|
80
|
-
// we patched them to switch to react 19
|
81
|
-
external: ["react", "react-dom"],
|
82
|
-
optimizeDeps
|
83
|
-
},
|
84
|
-
build: {
|
85
|
-
ssr: !0,
|
86
|
-
emptyOutDir: !1,
|
87
|
-
outDir: "dist/api",
|
88
|
-
copyPublicDir: !1,
|
89
|
-
minify: !1,
|
90
|
-
rollupOptions: {
|
91
|
-
treeshake: treeshake ?? {
|
92
|
-
moduleSideEffects: !1
|
93
|
-
},
|
94
|
-
plugins: [
|
95
|
-
// otherwise rollup is leaving commonjs-only top level imports...
|
96
|
-
apiOutputFormat === "esm" ? import_vxrn.rollupRemoveUnusedImportsPlugin : null
|
97
|
-
].filter(Boolean),
|
98
|
-
// too many issues
|
99
|
-
// treeshake: {
|
100
|
-
// moduleSideEffects: false,
|
101
|
-
// },
|
102
|
-
// prevents it from shaking out the exports
|
103
|
-
preserveEntrySignatures: "strict",
|
104
|
-
input: apiEntryPoints,
|
105
|
-
external: apiRouteExternalRegex,
|
106
|
-
output: {
|
107
|
-
entryFileNames: "[name]",
|
108
|
-
exports: "auto",
|
109
|
-
...apiOutputFormat === "esm" ? {
|
110
|
-
format: "esm",
|
111
|
-
esModule: !0
|
112
|
-
} : {
|
113
|
-
format: "cjs",
|
114
|
-
// Preserve folder structure and use .cjs extension
|
115
|
-
entryFileNames: (chunkInfo) => chunkInfo.name.replace(/\.js$/, ".cjs"),
|
116
|
-
chunkFileNames: (chunkInfo) => {
|
117
|
-
const dir = import_node_path.default.dirname(chunkInfo.name), name = import_node_path.default.basename(chunkInfo.name, import_node_path.default.extname(chunkInfo.name));
|
118
|
-
return import_node_path.default.join(dir, `${name}-[hash].cjs`);
|
119
|
-
},
|
120
|
-
assetFileNames: (assetInfo) => {
|
121
|
-
const name = assetInfo.name ?? "", dir = import_node_path.default.dirname(name), baseName = import_node_path.default.basename(name, import_node_path.default.extname(name)), ext = import_node_path.default.extname(name);
|
122
|
-
return import_node_path.default.join(dir, `${baseName}-[hash]${ext}`);
|
123
|
-
}
|
124
|
-
}
|
125
|
-
}
|
126
|
-
}
|
127
|
-
}
|
128
|
-
})
|
129
|
-
);
|
130
|
-
}
|
131
|
-
globalThis.require = (0, import_node_module.createRequire)((0, import_node_path.join)(import_meta.url, ".."));
|
132
|
-
const assets = [], builtRoutes = [];
|
133
|
-
console.info(`
|
134
|
-
\u{1F528} build static routes
|
135
|
-
`);
|
136
|
-
let render = null;
|
137
|
-
const entryServer = vxrnOutput.serverEntry;
|
138
|
-
try {
|
139
|
-
const serverImport = await import(entryServer);
|
140
|
-
render = serverImport.default.render || // for an unknown reason this is necessary
|
141
|
-
serverImport.default.default?.render, typeof render != "function" && (console.error("\u274C Error: didn't find render function in entry", serverImport), process.exit(1));
|
142
|
-
} catch (err) {
|
143
|
-
console.error("\u274C Error importing the root entry:"), console.error(` This error happened in the built file: ${entryServer}`), console.error(err.stack), process.exit(1);
|
144
|
-
}
|
145
|
-
const staticDir = (0, import_node_path.join)("dist/static"), clientDir = (0, import_node_path.join)("dist/client");
|
146
|
-
await ensureDir(staticDir);
|
147
|
-
const outputEntries = [...vxrnOutput.serverOutput.entries()];
|
148
|
-
for (const [index, output] of outputEntries) {
|
149
|
-
let collectImports = function({ imports = [], css }, { type = "js" } = {}) {
|
150
|
-
return [
|
151
|
-
...new Set(
|
152
|
-
[
|
153
|
-
...type === "js" ? imports : css || [],
|
154
|
-
...imports.flatMap((name) => {
|
155
|
-
const found = vxrnOutput.clientManifest[name];
|
156
|
-
return found || console.warn("No found imports", name, vxrnOutput.clientManifest), collectImports(found, { type });
|
157
|
-
})
|
158
|
-
].flat().filter((x) => x && (type === "css" || x.endsWith(".js"))).map((x) => type === "css" || x.startsWith("assets/") ? x : `assets/${x.slice(1)}`)
|
159
|
-
)
|
160
|
-
];
|
161
|
-
};
|
162
|
-
if (output.type === "asset") {
|
163
|
-
assets.push(output);
|
164
|
-
continue;
|
165
|
-
}
|
166
|
-
const id = output.facadeModuleId || "", file = import_node_path.default.basename(id);
|
167
|
-
if (!id || file[0] === "_" || file.includes("entry-server") || id.includes("+api") || !id.includes("/app/"))
|
168
|
-
continue;
|
169
|
-
const relativeId = (0, import_node_path.relative)(process.cwd(), id).replace("app/", "/"), onlyBuild = vxrnOutput.buildArgs?.only;
|
170
|
-
if (onlyBuild && !import_micromatch.default.contains(relativeId, onlyBuild))
|
171
|
-
continue;
|
172
|
-
const clientManifestKey = Object.keys(vxrnOutput.clientManifest).find((key) => id.endsWith(key)) || "";
|
173
|
-
if (!clientManifestKey)
|
174
|
-
continue;
|
175
|
-
const clientManifestEntry = vxrnOutput.clientManifest[clientManifestKey], findMatchingRoute = (route) => route.file && clientManifestKey.endsWith(route.file.slice(1)), foundRoute = manifest.pageRoutes.find(findMatchingRoute);
|
176
|
-
if (!foundRoute) {
|
177
|
-
clientManifestKey.startsWith("app") && (console.error(" No html route found!", { id, clientManifestKey }), console.error(" In manifest", manifest), process.exit(1));
|
178
|
-
continue;
|
179
|
-
}
|
180
|
-
clientManifestEntry || console.warn(
|
181
|
-
`No client manifest entry found: ${clientManifestKey} in manifest ${JSON.stringify(
|
182
|
-
vxrnOutput.clientManifest,
|
183
|
-
null,
|
184
|
-
2
|
185
|
-
)}`
|
186
|
-
);
|
187
|
-
const entryImports = collectImports(clientManifestEntry || {}), layoutEntries = foundRoute.layouts?.flatMap((layout) => {
|
188
|
-
const clientKey = `app${layout.contextKey.slice(1)}`;
|
189
|
-
return vxrnOutput.clientManifest[clientKey];
|
190
|
-
}) ?? [], layoutImports = layoutEntries.flatMap((entry) => [entry.file, ...collectImports(entry)]), preloadSetupFilePreloads = (() => {
|
191
|
-
if (userOptions.setupFile) {
|
192
|
-
const needle = userOptions.setupFile.replace(/^\.\//, "");
|
193
|
-
for (const file2 in vxrnOutput.clientManifest)
|
194
|
-
if (file2 === needle)
|
195
|
-
return [
|
196
|
-
vxrnOutput.clientManifest[file2].file
|
197
|
-
// getting 404s for preloading the imports as well?
|
198
|
-
// ...(entry.imports as string[])
|
199
|
-
];
|
200
|
-
}
|
201
|
-
return [];
|
202
|
-
})(), preloads = [
|
203
|
-
.../* @__PURE__ */ new Set([
|
204
|
-
...preloadSetupFilePreloads,
|
205
|
-
// add the route entry js (like ./app/index.ts)
|
206
|
-
clientManifestEntry.file,
|
207
|
-
// add the virtual entry
|
208
|
-
vxrnOutput.clientManifest["virtual:one-entry"].file,
|
209
|
-
...entryImports,
|
210
|
-
...layoutImports
|
211
|
-
])
|
212
|
-
].map((path) => `/${path}`), allEntries = [clientManifestEntry, ...layoutEntries], allCSS = allEntries.flatMap((entry) => collectImports(entry, { type: "css" })).map((path) => `/${path}`);
|
213
|
-
process.env.DEBUG && console.info("[one] building routes", { foundRoute, layoutEntries, allEntries, allCSS });
|
214
|
-
const serverJsPath = toAbsolute((0, import_node_path.join)("dist/server", output.fileName));
|
215
|
-
let exported;
|
216
|
-
try {
|
217
|
-
exported = await import(serverJsPath);
|
218
|
-
} catch (err) {
|
219
|
-
throw console.error("Error importing page (original error)", err), new Error(`Error importing page: ${serverJsPath}`, {
|
220
|
-
cause: err
|
221
|
-
});
|
222
|
-
}
|
223
|
-
if (foundRoute.type !== "ssr" && !foundRoute.page.includes("+not-found") && !foundRoute.page.includes("_sitemap") && !exported.generateStaticParams && relativeId.includes("["))
|
224
|
-
throw new Error(`[one] Error: Missing generateStaticParams
|
225
|
-
|
226
|
-
Route ${foundRoute.page} of type ${foundRoute.type} must export generateStaticParams so build can complete.
|
227
|
-
|
228
|
-
See docs on generateStaticParams:
|
229
|
-
https://onestack.dev/docs/routing-exports#generatestaticparams
|
230
|
-
|
231
|
-
`);
|
232
|
-
const paramsList = await exported.generateStaticParams?.() ?? [{}];
|
233
|
-
console.info(`
|
234
|
-
[build] page ${relativeId} (with ${paramsList.length} routes)
|
235
|
-
`), process.env.DEBUG && console.info("paramsList", JSON.stringify(paramsList, null, 2));
|
236
|
-
for (const params of paramsList) {
|
237
|
-
const cleanId = relativeId.replace(/\+(spa|ssg|ssr)\.tsx?$/, ""), path = getPathnameFromFilePath(cleanId, params, foundRoute.type === "ssg"), htmlPath = `${path.endsWith("/") ? `${removeTrailingSlash(path)}/index` : path}.html`, clientJsPath = (0, import_node_path.join)("dist/client", clientManifestEntry.file), htmlOutPath = toAbsolute((0, import_node_path.join)(staticDir, htmlPath));
|
238
|
-
let loaderData = {};
|
239
|
-
try {
|
240
|
-
console.info(` \u21A6 route ${path}`);
|
241
|
-
const cleanPath = path === "/" ? path : removeTrailingSlash(path), preloadPath = (0, import_cleanUrl.getPreloadPath)(path);
|
242
|
-
if (await import_fs_extra.default.writeFile(
|
243
|
-
(0, import_node_path.join)(clientDir, preloadPath),
|
244
|
-
preloads.map((preload) => `import "${preload}"`).join(`
|
245
|
-
`)
|
246
|
-
), builtRoutes.push({
|
247
|
-
type: foundRoute.type,
|
248
|
-
cleanPath,
|
249
|
-
preloadPath,
|
250
|
-
clientJsPath,
|
251
|
-
serverJsPath,
|
252
|
-
htmlPath,
|
253
|
-
loaderData,
|
254
|
-
params,
|
255
|
-
path,
|
256
|
-
preloads
|
257
|
-
}), foundRoute.type !== "ssr") {
|
258
|
-
const loaderProps = { path, params };
|
259
|
-
if (globalThis.__vxrnLoaderProps__ = loaderProps, globalThis.__vxrnresetState?.(), exported.loader) {
|
260
|
-
loaderData = await exported.loader?.({ path, params }) ?? null;
|
261
|
-
const code = await readFile(clientJsPath, "utf-8"), withLoader = (0, import_replaceLoader.replaceLoader)({
|
262
|
-
code,
|
263
|
-
loaderData
|
264
|
-
}), loaderPartialPath = (0, import_node_path.join)(clientDir, (0, import_cleanUrl.getLoaderPath)(path));
|
265
|
-
await outputFile(loaderPartialPath, withLoader);
|
266
|
-
}
|
267
|
-
if (foundRoute.type === "ssg") {
|
268
|
-
const html = await render({ path, preloads, loaderProps, loaderData, css: allCSS });
|
269
|
-
await outputFile(htmlOutPath, html);
|
270
|
-
continue;
|
271
|
-
}
|
272
|
-
foundRoute.type === "spa" && await outputFile(
|
273
|
-
htmlOutPath,
|
274
|
-
`<html><head>
|
275
|
-
<script>globalThis['global'] = globalThis</script>
|
276
|
-
<script>globalThis['__vxrnIsSPA'] = true</script>
|
277
|
-
${preloads.map((preload) => ` <script type="module" src="${preload}"></script>`).join(`
|
278
|
-
`)}
|
279
|
-
${allCSS.map((file2) => ` <link rel="stylesheet" href=${file2} />`).join(`
|
280
|
-
`)}
|
281
|
-
</head></html>`
|
282
|
-
);
|
283
|
-
}
|
284
|
-
} catch (err) {
|
285
|
-
const errMsg = err instanceof Error ? `${err.message}
|
286
|
-
${err.stack}` : `${err}`;
|
287
|
-
console.error(
|
288
|
-
`Error building static page at ${path} with id ${relativeId}:
|
289
|
-
|
290
|
-
${errMsg}
|
291
|
-
|
292
|
-
loaderData:
|
293
|
-
|
294
|
-
${JSON.stringify(loaderData || null, null, 2)}
|
295
|
-
params:
|
296
|
-
|
297
|
-
${JSON.stringify(params || null, null, 2)}`
|
298
|
-
), console.error(err), process.exit(1);
|
299
|
-
}
|
300
|
-
}
|
301
|
-
}
|
302
|
-
await moveAllFiles(staticDir, clientDir), await import_fs_extra.default.rm(staticDir, { force: !0, recursive: !0 });
|
303
|
-
const buildInfoForWriting = {
|
304
|
-
routeMap: builtRoutes.reduce((acc, { cleanPath, htmlPath }) => (acc[cleanPath] = htmlPath, acc), {}),
|
305
|
-
builtRoutes
|
306
|
-
}, buildInfo = {
|
307
|
-
...buildInfoForWriting,
|
308
|
-
...vxrnOutput
|
309
|
-
};
|
310
|
-
await import_fs_extra.default.writeJSON(toAbsolute("dist/buildInfo.json"), buildInfoForWriting);
|
311
|
-
let postBuildLogs = [];
|
312
|
-
(userOptions.web?.deploy ?? options.server?.platform) === "vercel" && (await import_fs_extra.default.writeFile(
|
313
|
-
(0, import_node_path.join)(options.root, "dist", "index.js"),
|
314
|
-
`import { serve } from 'one/serve'
|
315
|
-
const handler = await serve()
|
316
|
-
export const { GET, POST, PUT, PATCH, OPTIONS } = handler`
|
317
|
-
), postBuildLogs.push(`wrote vercel entry to: ${(0, import_node_path.join)(".", "dist", "index.js")}`), postBuildLogs.push("point vercel outputDirectory to dist")), userOptions?.afterBuild && await userOptions?.afterBuild?.(buildInfo), process.env.VXRN_ANALYZE_BUNDLE && postBuildLogs.push(`client build report: ${toAbsolute("dist/report.html")}`), postBuildLogs.length && (console.info(`
|
318
|
-
|
319
|
-
`), postBuildLogs.forEach((log) => {
|
320
|
-
console.info(` \xB7 ${log}`);
|
321
|
-
})), console.info(`
|
322
|
-
|
323
|
-
\u{1F49B} build complete
|
324
|
-
|
325
|
-
`);
|
326
|
-
}
|
327
|
-
function removeTrailingSlash(path) {
|
328
|
-
return path.endsWith("/") ? path.slice(0, path.length - 1) : path;
|
329
|
-
}
|
330
|
-
async function moveAllFiles(src, dest) {
|
331
|
-
try {
|
332
|
-
await import_fs_extra.default.copy(src, dest, { overwrite: !0, errorOnExist: !1 });
|
333
|
-
} catch (err) {
|
334
|
-
console.error("Error moving files:", err);
|
335
|
-
}
|
336
|
-
}
|
337
|
-
function getPathnameFromFilePath(path, params = {}, strict = !1) {
|
338
|
-
const dirname = import_node_path.default.dirname(path).replace(/\([^\/]+\)/gi, ""), fileName = import_node_path.default.basename(path).replace(/\.[a-z]+$/, ""), nameWithParams = (() => {
|
339
|
-
if (fileName === "index")
|
340
|
-
return "/";
|
341
|
-
if (fileName.startsWith("[...")) {
|
342
|
-
const part = fileName.replace("[...", "").replace("]", "");
|
343
|
-
return params[part] || console.warn(`couldn't resolve ${fileName} segment in path ${path}`), `/${params[part]}`;
|
344
|
-
}
|
345
|
-
return `/${fileName.split("/").map((part) => {
|
346
|
-
if (part[0] === "[") {
|
347
|
-
const found = params[part.slice(1, part.length - 1)];
|
348
|
-
if (!found) {
|
349
|
-
if (strict)
|
350
|
-
throw new Error(
|
351
|
-
`[one] Params doesn't fit route:
|
352
|
-
|
353
|
-
- path: ${path}
|
354
|
-
- part: ${part}
|
355
|
-
- fileName: ${fileName}
|
356
|
-
- params:
|
357
|
-
|
358
|
-
${JSON.stringify(params, null, 2)}`
|
359
|
-
);
|
360
|
-
return ":" + part.replace("[", "").replace("]", "");
|
361
|
-
}
|
362
|
-
return found;
|
363
|
-
}
|
364
|
-
return part;
|
365
|
-
}).join("/")}`;
|
366
|
-
})();
|
367
|
-
return `${dirname}${nameWithParams}`.replace(/\/\/+/gi, "/");
|
368
|
-
}
|
369
|
-
function escapeRegex(string) {
|
370
|
-
return string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
371
|
-
}
|
372
|
-
function buildRegexExcludingDeps(deps) {
|
373
|
-
const regexPattern = `node_modules/(?!(${deps.map((dep) => escapeRegex(dep)).join("|")})).*`;
|
374
|
-
return new RegExp(regexPattern);
|
375
|
-
}
|
376
|
-
//# sourceMappingURL=build.js.map
|
@@ -1,22 +0,0 @@
|
|
1
|
-
var __defProp = Object.defineProperty;
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
5
|
-
var __export = (target, all) => {
|
6
|
-
for (var name in all)
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: !0 });
|
8
|
-
}, __copyProps = (to, from, except, desc) => {
|
9
|
-
if (from && typeof from == "object" || typeof from == "function")
|
10
|
-
for (let key of __getOwnPropNames(from))
|
11
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
12
|
-
return to;
|
13
|
-
};
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
15
|
-
var constants_exports = {};
|
16
|
-
__export(constants_exports, {
|
17
|
-
EMPTY_LOADER_STRING: () => EMPTY_LOADER_STRING,
|
18
|
-
LoaderDataCache: () => LoaderDataCache
|
19
|
-
});
|
20
|
-
module.exports = __toCommonJS(constants_exports);
|
21
|
-
const EMPTY_LOADER_STRING = 'export function loader() {return "__vxrn__loader__"};', LoaderDataCache = {};
|
22
|
-
//# sourceMappingURL=constants.js.map
|
@@ -1,66 +0,0 @@
|
|
1
|
-
var __defProp = Object.defineProperty;
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
5
|
-
var __export = (target, all) => {
|
6
|
-
for (var name in all)
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: !0 });
|
8
|
-
}, __copyProps = (to, from, except, desc) => {
|
9
|
-
if (from && typeof from == "object" || typeof from == "function")
|
10
|
-
for (let key of __getOwnPropNames(from))
|
11
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
12
|
-
return to;
|
13
|
-
};
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
15
|
-
var ensureTsConfig_exports = {};
|
16
|
-
__export(ensureTsConfig_exports, {
|
17
|
-
ensureTSConfig: () => ensureTSConfig
|
18
|
-
});
|
19
|
-
module.exports = __toCommonJS(ensureTsConfig_exports);
|
20
|
-
var import_promises = require("node:fs/promises"), import_polyfills_server = require("../polyfills-server"), import_existsAsync = require("../utils/existsAsync");
|
21
|
-
function ensureTSConfig() {
|
22
|
-
(0, import_existsAsync.existsAsync)("tsconfig.json").then((hasTsConfig) => {
|
23
|
-
hasTsConfig || (console.info(
|
24
|
-
"[one] adding default tsconfig.json. to disable set one/vite { config: { tsConfigPaths: false } }"
|
25
|
-
), (0, import_promises.writeFile)(
|
26
|
-
"tsconfig.json",
|
27
|
-
`{
|
28
|
-
"compilerOptions": {
|
29
|
-
"baseUrl": ".",
|
30
|
-
"paths": {
|
31
|
-
"~/*": ["./*"]
|
32
|
-
},
|
33
|
-
"strict": true,
|
34
|
-
"rootDir": ".",
|
35
|
-
"noEmit": true,
|
36
|
-
"module": "Preserve",
|
37
|
-
// allows react-native style imports without path extensions, for compat with platform-specific files
|
38
|
-
"moduleResolution": "Bundler",
|
39
|
-
"preserveSymlinks": true,
|
40
|
-
"skipLibCheck": true,
|
41
|
-
"jsx": "react-jsx",
|
42
|
-
"noImplicitAny": false,
|
43
|
-
"types": [
|
44
|
-
"node",
|
45
|
-
"react",
|
46
|
-
"vite/client"
|
47
|
-
],
|
48
|
-
"lib": [
|
49
|
-
"dom",
|
50
|
-
"esnext"
|
51
|
-
]
|
52
|
-
},
|
53
|
-
"exclude": [
|
54
|
-
"node_modules",
|
55
|
-
".expo",
|
56
|
-
"**/test",
|
57
|
-
"**/dist",
|
58
|
-
"**/types",
|
59
|
-
"**/__tests__"
|
60
|
-
],
|
61
|
-
}
|
62
|
-
`
|
63
|
-
));
|
64
|
-
});
|
65
|
-
}
|
66
|
-
//# sourceMappingURL=ensureTsConfig.js.map
|
@@ -1,66 +0,0 @@
|
|
1
|
-
var __create = Object.create;
|
2
|
-
var __defProp = Object.defineProperty;
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
5
|
-
var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
|
6
|
-
var __export = (target, all) => {
|
7
|
-
for (var name in all)
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: !0 });
|
9
|
-
}, __copyProps = (to, from, except, desc) => {
|
10
|
-
if (from && typeof from == "object" || typeof from == "function")
|
11
|
-
for (let key of __getOwnPropNames(from))
|
12
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
13
|
-
return to;
|
14
|
-
};
|
15
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
16
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
17
|
-
// file that has been converted to a CommonJS file using a Babel-
|
18
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
19
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
20
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
|
21
|
-
mod
|
22
|
-
)), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
23
|
-
var findDepsToOptimize_exports = {};
|
24
|
-
__export(findDepsToOptimize_exports, {
|
25
|
-
getAllDependencies: () => getAllDependencies
|
26
|
-
});
|
27
|
-
module.exports = __toCommonJS(findDepsToOptimize_exports);
|
28
|
-
var import_fs_extra = __toESM(require("fs-extra"), 1), import_promises = __toESM(require("node:fs/promises"), 1), import_node_path = __toESM(require("node:path"), 1), import_node_module = require("node:module");
|
29
|
-
async function getAllDependencies(root, depth = 20) {
|
30
|
-
if (depth === 0)
|
31
|
-
return [];
|
32
|
-
const pkgJsonPath = await findClosestPkgJsonPath(root);
|
33
|
-
if (!pkgJsonPath)
|
34
|
-
throw new Error(`Cannot find package.json from ${root}`);
|
35
|
-
return await crawl(pkgJsonPath, depth - 1);
|
36
|
-
}
|
37
|
-
async function crawl(pkgJsonPath, depth = 1 / 0) {
|
38
|
-
const pkgJson = await import_fs_extra.default.readJson(pkgJsonPath).catch((e) => {
|
39
|
-
throw new Error(`Unable to read ${pkgJsonPath}`, { cause: e });
|
40
|
-
});
|
41
|
-
let dependencies = pkgJson.dependencies ? Object.keys(pkgJson.dependencies) : [];
|
42
|
-
return await Promise.all(
|
43
|
-
dependencies.map(async (depName) => {
|
44
|
-
try {
|
45
|
-
const resolved = (0, import_node_module.createRequire)((0, import_node_path.dirname)(pkgJsonPath)).resolve(depName), subDeps = await getAllDependencies(resolved, depth - 1);
|
46
|
-
subDeps && (dependencies = [...dependencies, ...subDeps]);
|
47
|
-
} catch {
|
48
|
-
console.log("Couldn't resolve", depName);
|
49
|
-
}
|
50
|
-
})
|
51
|
-
), [...new Set(dependencies)];
|
52
|
-
}
|
53
|
-
async function findClosestPkgJsonPath(dir, predicate) {
|
54
|
-
for (dir.endsWith("package.json") && (dir = import_node_path.default.dirname(dir)); dir; ) {
|
55
|
-
const pkg = import_node_path.default.join(dir, "package.json");
|
56
|
-
try {
|
57
|
-
if ((await import_promises.default.stat(pkg)).isFile() && (!predicate || await predicate(pkg)))
|
58
|
-
return pkg;
|
59
|
-
} catch {
|
60
|
-
}
|
61
|
-
const nextDir = import_node_path.default.dirname(dir);
|
62
|
-
if (nextDir === dir) break;
|
63
|
-
dir = nextDir;
|
64
|
-
}
|
65
|
-
}
|
66
|
-
//# sourceMappingURL=findDepsToOptimize.js.map
|
@@ -1,36 +0,0 @@
|
|
1
|
-
var __defProp = Object.defineProperty;
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
5
|
-
var __export = (target, all) => {
|
6
|
-
for (var name in all)
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: !0 });
|
8
|
-
}, __copyProps = (to, from, except, desc) => {
|
9
|
-
if (from && typeof from == "object" || typeof from == "function")
|
10
|
-
for (let key of __getOwnPropNames(from))
|
11
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
12
|
-
return to;
|
13
|
-
};
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
15
|
-
var generateTypesForRoutes_exports = {};
|
16
|
-
__export(generateTypesForRoutes_exports, {
|
17
|
-
generateTypesForRoutes: () => generateTypesForRoutes
|
18
|
-
});
|
19
|
-
module.exports = __toCommonJS(generateTypesForRoutes_exports);
|
20
|
-
var import_node_path = require("node:path"), import_perfect_debounce = require("perfect-debounce"), import_generateRouteTypes = require("../typed-routes/generateRouteTypes");
|
21
|
-
function generateTypesForRoutes(options) {
|
22
|
-
return {
|
23
|
-
name: "one-generate-fs-route-types",
|
24
|
-
enforce: "post",
|
25
|
-
apply: "serve",
|
26
|
-
configureServer(server) {
|
27
|
-
const appDir = (0, import_node_path.join)(process.cwd(), "app"), outFile = (0, import_node_path.join)(process.cwd(), "routes.d.ts"), fileWatcherChangeListener = (0, import_perfect_debounce.debounce)(async (type, path) => {
|
28
|
-
(type === "add" || type === "delete") && path.startsWith(appDir) && (0, import_generateRouteTypes.generateRouteTypes)(outFile);
|
29
|
-
}, 100);
|
30
|
-
return server.watcher.addListener("all", fileWatcherChangeListener), () => {
|
31
|
-
(0, import_generateRouteTypes.generateRouteTypes)(outFile);
|
32
|
-
};
|
33
|
-
}
|
34
|
-
};
|
35
|
-
}
|
36
|
-
//# sourceMappingURL=generateTypesForRoutes.js.map
|
@@ -1,27 +0,0 @@
|
|
1
|
-
var __defProp = Object.defineProperty;
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
5
|
-
var __export = (target, all) => {
|
6
|
-
for (var name in all)
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: !0 });
|
8
|
-
}, __copyProps = (to, from, except, desc) => {
|
9
|
-
if (from && typeof from == "object" || typeof from == "function")
|
10
|
-
for (let key of __getOwnPropNames(from))
|
11
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
12
|
-
return to;
|
13
|
-
};
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
15
|
-
var makePluginWebOnly_exports = {};
|
16
|
-
__export(makePluginWebOnly_exports, {
|
17
|
-
makePluginWebOnly: () => makePluginWebOnly
|
18
|
-
});
|
19
|
-
module.exports = __toCommonJS(makePluginWebOnly_exports);
|
20
|
-
function makePluginWebOnly(plugin) {
|
21
|
-
const og = plugin.transform;
|
22
|
-
return og && (plugin.transform = function(...args) {
|
23
|
-
if (this.environment.name === "client")
|
24
|
-
return og.call(this, ...args);
|
25
|
-
}), plugin;
|
26
|
-
}
|
27
|
-
//# sourceMappingURL=makePluginWebOnly.js.map
|