one 1.1.320 → 1.1.322
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/Root.js +182 -0
- package/dist/cjs/Route.js +45 -0
- package/dist/cjs/cleanUrl.js +41 -0
- package/dist/cjs/cli/label-process.js +25 -0
- package/dist/cjs/cli/main.js +46 -0
- package/dist/cjs/cli/patch.js +34 -0
- package/dist/cjs/cli/prebuild.js +34 -0
- package/dist/cjs/cli/run.js +52 -0
- package/dist/cjs/cli/runAndroid.js +34 -0
- package/dist/cjs/cli/runIos.js +34 -0
- package/dist/cjs/cli.js +220 -0
- package/dist/cjs/clientLoaderResolver.js +32 -0
- package/dist/cjs/config.js +27 -0
- package/dist/cjs/constants.js +28 -0
- package/dist/cjs/createApp.js +46 -0
- package/dist/cjs/createHandleRequest.js +138 -0
- package/dist/cjs/createRoute.js +37 -0
- package/dist/cjs/fallbackViews/Sitemap.js +82 -0
- package/dist/cjs/fallbackViews/Unmatched.js +58 -0
- package/dist/cjs/fork/NavigationContainer.js +85 -0
- package/dist/cjs/fork/createMemoryHistory.js +100 -0
- package/dist/cjs/fork/extractPathFromURL.js +62 -0
- package/dist/cjs/fork/findFocusedRoute.js +26 -0
- package/dist/cjs/fork/getPathFromState.js +265 -0
- package/dist/cjs/fork/getStateFromPath.js +381 -0
- package/dist/cjs/fork/useLinking.js +182 -0
- package/dist/cjs/fork/validatePathConfig.js +46 -0
- package/dist/cjs/getLinkingConfig.js +59 -0
- package/dist/cjs/getReactNavigationConfig.js +69 -0
- package/dist/cjs/getRoutes.js +294 -0
- package/dist/cjs/getURL.js +24 -0
- package/dist/cjs/head/Head.js +23 -0
- package/dist/cjs/head/HeadModule.js +22 -0
- package/dist/cjs/head/index.js +15 -0
- package/dist/cjs/head/types.js +14 -0
- package/dist/cjs/head/url.js +52 -0
- package/dist/cjs/hooks.js +99 -0
- package/dist/cjs/imperative-api.js +45 -0
- package/dist/cjs/import-mode/index.js +21 -0
- package/dist/cjs/import-mode/index.web.js +21 -0
- package/dist/cjs/index.js +65 -0
- package/dist/cjs/interfaces/router.js +23 -0
- package/dist/cjs/layouts/Drawer.js +24 -0
- package/dist/cjs/layouts/Stack.js +24 -0
- package/dist/cjs/layouts/Tabs.js +52 -0
- package/dist/cjs/layouts/withLayoutContext.js +77 -0
- package/dist/cjs/link/Link.js +98 -0
- package/dist/cjs/link/Redirect.js +31 -0
- package/dist/cjs/link/href.js +50 -0
- package/dist/cjs/link/linking.js +82 -0
- package/dist/cjs/link/path.js +65 -0
- package/dist/cjs/link/useLinkTo.js +42 -0
- package/dist/cjs/link/useLoadedNavigation.js +50 -0
- package/dist/cjs/matchers.js +68 -0
- package/dist/cjs/platform.js +21 -0
- package/dist/cjs/polyfills-mobile.js +26 -0
- package/dist/cjs/polyfills-server.js +23 -0
- package/dist/cjs/render.js +44 -0
- package/dist/cjs/router/RouterStore.js +14 -0
- package/dist/cjs/router/getNormalizedStatePath.js +50 -0
- package/dist/cjs/router/lastAction.js +25 -0
- package/dist/cjs/router/router.js +345 -0
- package/dist/cjs/router/serverLocationContext.js +22 -0
- package/dist/cjs/router/useInitializeOneRouter.js +43 -0
- package/dist/cjs/serve.js +184 -0
- package/dist/cjs/server/createRoutesManifest.js +40 -0
- package/dist/cjs/server/getServerManifest.js +109 -0
- package/dist/cjs/server-render.js +42 -0
- package/dist/cjs/sortRoutes.js +64 -0
- package/dist/cjs/typed-routes/generateRouteTypes.js +33 -0
- package/dist/cjs/typed-routes/getTypedRoutesDeclarationFile.js +83 -0
- package/dist/cjs/types.js +14 -0
- package/dist/cjs/useFocusEffect.js +79 -0
- package/dist/cjs/useLoader.js +97 -0
- package/dist/cjs/useNavigation.js +60 -0
- package/dist/cjs/useScreens.js +176 -0
- package/dist/cjs/useViteRoutes.js +77 -0
- package/dist/cjs/utils/assertIsReady.js +26 -0
- package/dist/cjs/utils/dynamicImport.js +24 -0
- package/dist/cjs/utils/existsAsync.js +28 -0
- package/dist/cjs/utils/getPageExport.js +38 -0
- package/dist/cjs/utils/globDir.js +37 -0
- package/dist/cjs/utils/hashString.js +32 -0
- package/dist/cjs/utils/isResponse.js +23 -0
- package/dist/cjs/utils/isStatus.js +23 -0
- package/dist/cjs/utils/promiseWithResolvers.js +26 -0
- package/dist/cjs/utils/rand.js +21 -0
- package/dist/cjs/utils/redirect.js +28 -0
- package/dist/cjs/utils/removeSearch.js +23 -0
- package/dist/cjs/utils/removeUndefined.js +26 -0
- package/dist/cjs/utils/url.js +31 -0
- package/dist/cjs/utils/weakKey.js +24 -0
- package/dist/cjs/utils/weakMemo.js +30 -0
- package/dist/cjs/views/EmptyRoute.js +25 -0
- package/dist/cjs/views/ErrorBoundary.js +33 -0
- package/dist/cjs/views/LoadProgressBar.js +83 -0
- package/dist/cjs/views/Navigator.js +101 -0
- package/dist/cjs/views/PreloadLinks.js +42 -0
- package/dist/cjs/views/RootErrorBoundary.js +47 -0
- package/dist/cjs/views/Screen.js +29 -0
- package/dist/cjs/views/ScrollRestoration.js +70 -0
- package/dist/cjs/views/Try.js +44 -0
- package/dist/cjs/vite/build.js +377 -0
- package/dist/cjs/vite/clientTreeShakePlugin.js +76 -0
- package/dist/cjs/vite/constants.js +22 -0
- package/dist/cjs/vite/createFileSystemRouter.cjs +2 -1
- package/dist/cjs/vite/createFileSystemRouter.js +244 -0
- package/dist/cjs/vite/createFileSystemRouter.js.map +6 -0
- package/dist/cjs/vite/createFileSystemRouter.native.js +2 -1
- package/dist/cjs/vite/createFileSystemRouter.native.js.map +2 -2
- package/dist/cjs/vite/customNodeExternals.js +52 -0
- package/dist/cjs/vite/ensureTsConfig.js +66 -0
- package/dist/cjs/vite/findDepsToOptimize.js +66 -0
- package/dist/cjs/vite/fixDependenciesPlugin.js +43 -0
- package/dist/cjs/vite/generateTypesForRoutes.js +36 -0
- package/dist/cjs/vite/getManifest.js +27 -0
- package/dist/cjs/vite/headers.js +39 -0
- package/dist/cjs/vite/makePluginWebOnly.js +27 -0
- package/dist/cjs/vite/one.js +290 -0
- package/dist/cjs/vite/removeReactNativeWebAnimatedPlugin.js +50 -0
- package/dist/cjs/vite/replaceLoader.js +34 -0
- package/dist/cjs/vite/resolveAPIRequest.js +71 -0
- package/dist/cjs/vite/server.js +16 -0
- package/dist/cjs/vite/types.js +14 -0
- package/dist/cjs/vite/virtualEntryPlugin.js +67 -0
- package/dist/cjs/vite/vitePluginSsrCss.js +130 -0
- package/dist/cjs/vite.cjs +2 -0
- package/dist/cjs/vite.js +29 -0
- package/dist/cjs/vite.js.map +6 -0
- package/dist/cjs/vite.native.js +3 -1
- package/dist/cjs/vite.native.js.map +1 -1
- package/dist/cjs/zero/getQueryKey.js +24 -0
- package/dist/cjs/zero/isZeroQuery.js +23 -0
- package/dist/cjs/zero/resolveQuery.js +38 -0
- package/dist/cjs/zero/subscribeToQuery.js +28 -0
- package/dist/cjs/zero/types.js +14 -0
- package/dist/cjs/zero/useQuery.js +47 -0
- package/dist/cjs/zero/useQueryZero.js +38 -0
- package/dist/cjs/zero.js +23 -0
- package/dist/esm/vite/createFileSystemRouter.js +2 -1
- package/dist/esm/vite/createFileSystemRouter.js.map +1 -1
- package/dist/esm/vite/createFileSystemRouter.mjs +2 -1
- package/dist/esm/vite/createFileSystemRouter.mjs.map +1 -1
- package/dist/esm/vite/createFileSystemRouter.native.js +2 -1
- package/dist/esm/vite/createFileSystemRouter.native.js.map +2 -2
- package/dist/esm/vite.js +2 -0
- package/dist/esm/vite.js.map +1 -1
- package/dist/esm/vite.mjs +2 -1
- package/dist/esm/vite.mjs.map +1 -1
- package/dist/esm/vite.native.js +2 -0
- package/dist/esm/vite.native.js.map +2 -2
- package/package.json +8 -8
- package/src/vite/createFileSystemRouter.tsx +1 -1
- package/src/vite.ts +1 -0
- package/types/vite.d.ts +1 -0
- package/types/vite.d.ts.map +1 -1
- package/dist/cjs/createApp.native.cjs +0 -38
- package/dist/cjs/createApp.native.cjs.map +0 -6
- package/dist/cjs/fork/NavigationContainer.native.cjs +0 -103
- package/dist/cjs/fork/NavigationContainer.native.cjs.map +0 -6
- package/dist/cjs/fork/useLinking.native.cjs +0 -126
- package/dist/cjs/fork/useLinking.native.cjs.map +0 -6
- package/dist/cjs/getURL.native.cjs +0 -48
- package/dist/cjs/getURL.native.cjs.map +0 -6
- package/dist/cjs/head/Head.android.cjs +0 -28
- package/dist/cjs/head/Head.android.cjs.map +0 -6
- package/dist/cjs/head/Head.ios.cjs +0 -210
- package/dist/cjs/head/Head.ios.cjs.map +0 -6
- package/dist/cjs/import-mode/index.android.cjs +0 -26
- package/dist/cjs/import-mode/index.android.cjs.map +0 -6
- package/dist/cjs/import-mode/index.ios.cjs +0 -26
- package/dist/cjs/import-mode/index.ios.cjs.map +0 -6
- package/dist/cjs/import-mode/index.native.cjs +0 -26
- package/dist/cjs/import-mode/index.native.cjs.map +0 -6
- package/dist/cjs/render.native.cjs +0 -28
- package/dist/cjs/render.native.cjs.map +0 -6
- package/dist/cjs/views/PreloadLinks.native.cjs +0 -28
- package/dist/cjs/views/PreloadLinks.native.cjs.map +0 -6
- package/dist/cjs/vite/createFileSystemRouter.cjs.map +0 -6
- package/dist/cjs/vite/headers.native.cjs +0 -32
- package/dist/cjs/vite/headers.native.cjs.map +0 -6
- package/dist/cjs/vite.cjs.map +0 -6
- /package/dist/cjs/{Root.cjs.map → Root.js.map} +0 -0
- /package/dist/cjs/{Route.cjs.map → Route.js.map} +0 -0
- /package/dist/cjs/{cleanUrl.cjs.map → cleanUrl.js.map} +0 -0
- /package/dist/cjs/cli/{label-process.cjs.map → label-process.js.map} +0 -0
- /package/dist/cjs/cli/{main.cjs.map → main.js.map} +0 -0
- /package/dist/cjs/cli/{patch.cjs.map → patch.js.map} +0 -0
- /package/dist/cjs/cli/{prebuild.cjs.map → prebuild.js.map} +0 -0
- /package/dist/cjs/cli/{run.cjs.map → run.js.map} +0 -0
- /package/dist/cjs/cli/{runAndroid.cjs.map → runAndroid.js.map} +0 -0
- /package/dist/cjs/cli/{runIos.cjs.map → runIos.js.map} +0 -0
- /package/dist/cjs/{cli.cjs.map → cli.js.map} +0 -0
- /package/dist/cjs/{clientLoaderResolver.cjs.map → clientLoaderResolver.js.map} +0 -0
- /package/dist/cjs/{config.cjs.map → config.js.map} +0 -0
- /package/dist/cjs/{constants.cjs.map → constants.js.map} +0 -0
- /package/dist/cjs/{createApp.cjs.map → createApp.js.map} +0 -0
- /package/dist/cjs/{createHandleRequest.cjs.map → createHandleRequest.js.map} +0 -0
- /package/dist/cjs/{createRoute.cjs.map → createRoute.js.map} +0 -0
- /package/dist/cjs/fallbackViews/{Sitemap.cjs.map → Sitemap.js.map} +0 -0
- /package/dist/cjs/fallbackViews/{Unmatched.cjs.map → Unmatched.js.map} +0 -0
- /package/dist/cjs/fork/{NavigationContainer.cjs.map → NavigationContainer.js.map} +0 -0
- /package/dist/cjs/fork/{createMemoryHistory.cjs.map → createMemoryHistory.js.map} +0 -0
- /package/dist/cjs/fork/{extractPathFromURL.cjs.map → extractPathFromURL.js.map} +0 -0
- /package/dist/cjs/fork/{findFocusedRoute.cjs.map → findFocusedRoute.js.map} +0 -0
- /package/dist/cjs/fork/{getPathFromState.cjs.map → getPathFromState.js.map} +0 -0
- /package/dist/cjs/fork/{getStateFromPath.cjs.map → getStateFromPath.js.map} +0 -0
- /package/dist/cjs/fork/{useLinking.cjs.map → useLinking.js.map} +0 -0
- /package/dist/cjs/fork/{validatePathConfig.cjs.map → validatePathConfig.js.map} +0 -0
- /package/dist/cjs/{getLinkingConfig.cjs.map → getLinkingConfig.js.map} +0 -0
- /package/dist/cjs/{getReactNavigationConfig.cjs.map → getReactNavigationConfig.js.map} +0 -0
- /package/dist/cjs/{getRoutes.cjs.map → getRoutes.js.map} +0 -0
- /package/dist/cjs/{getURL.cjs.map → getURL.js.map} +0 -0
- /package/dist/cjs/head/{Head.cjs.map → Head.js.map} +0 -0
- /package/dist/cjs/head/{HeadModule.cjs.map → HeadModule.js.map} +0 -0
- /package/dist/cjs/head/{index.cjs.map → index.js.map} +0 -0
- /package/dist/cjs/head/{types.cjs.map → types.js.map} +0 -0
- /package/dist/cjs/head/{url.cjs.map → url.js.map} +0 -0
- /package/dist/cjs/{hooks.cjs.map → hooks.js.map} +0 -0
- /package/dist/cjs/{imperative-api.cjs.map → imperative-api.js.map} +0 -0
- /package/dist/cjs/import-mode/{index.cjs.map → index.js.map} +0 -0
- /package/dist/cjs/import-mode/{index.web.cjs.map → index.web.js.map} +0 -0
- /package/dist/cjs/{index.cjs.map → index.js.map} +0 -0
- /package/dist/cjs/interfaces/{router.cjs.map → router.js.map} +0 -0
- /package/dist/cjs/layouts/{Drawer.cjs.map → Drawer.js.map} +0 -0
- /package/dist/cjs/layouts/{Stack.cjs.map → Stack.js.map} +0 -0
- /package/dist/cjs/layouts/{Tabs.cjs.map → Tabs.js.map} +0 -0
- /package/dist/cjs/layouts/{withLayoutContext.cjs.map → withLayoutContext.js.map} +0 -0
- /package/dist/cjs/link/{Link.cjs.map → Link.js.map} +0 -0
- /package/dist/cjs/link/{Redirect.cjs.map → Redirect.js.map} +0 -0
- /package/dist/cjs/link/{href.cjs.map → href.js.map} +0 -0
- /package/dist/cjs/link/{linking.cjs.map → linking.js.map} +0 -0
- /package/dist/cjs/link/{path.cjs.map → path.js.map} +0 -0
- /package/dist/cjs/link/{useLinkTo.cjs.map → useLinkTo.js.map} +0 -0
- /package/dist/cjs/link/{useLoadedNavigation.cjs.map → useLoadedNavigation.js.map} +0 -0
- /package/dist/cjs/{matchers.cjs.map → matchers.js.map} +0 -0
- /package/dist/cjs/{platform.cjs.map → platform.js.map} +0 -0
- /package/dist/cjs/{polyfills-mobile.cjs.map → polyfills-mobile.js.map} +0 -0
- /package/dist/cjs/{polyfills-server.cjs.map → polyfills-server.js.map} +0 -0
- /package/dist/cjs/{render.cjs.map → render.js.map} +0 -0
- /package/dist/cjs/router/{RouterStore.cjs.map → RouterStore.js.map} +0 -0
- /package/dist/cjs/router/{getNormalizedStatePath.cjs.map → getNormalizedStatePath.js.map} +0 -0
- /package/dist/cjs/router/{lastAction.cjs.map → lastAction.js.map} +0 -0
- /package/dist/cjs/router/{router.cjs.map → router.js.map} +0 -0
- /package/dist/cjs/router/{serverLocationContext.cjs.map → serverLocationContext.js.map} +0 -0
- /package/dist/cjs/router/{useInitializeOneRouter.cjs.map → useInitializeOneRouter.js.map} +0 -0
- /package/dist/cjs/{serve.cjs.map → serve.js.map} +0 -0
- /package/dist/cjs/server/{createRoutesManifest.cjs.map → createRoutesManifest.js.map} +0 -0
- /package/dist/cjs/server/{getServerManifest.cjs.map → getServerManifest.js.map} +0 -0
- /package/dist/cjs/{server-render.cjs.map → server-render.js.map} +0 -0
- /package/dist/cjs/{sortRoutes.cjs.map → sortRoutes.js.map} +0 -0
- /package/dist/cjs/typed-routes/{generateRouteTypes.cjs.map → generateRouteTypes.js.map} +0 -0
- /package/dist/cjs/typed-routes/{getTypedRoutesDeclarationFile.cjs.map → getTypedRoutesDeclarationFile.js.map} +0 -0
- /package/dist/cjs/{types.cjs.map → types.js.map} +0 -0
- /package/dist/cjs/{useFocusEffect.cjs.map → useFocusEffect.js.map} +0 -0
- /package/dist/cjs/{useLoader.cjs.map → useLoader.js.map} +0 -0
- /package/dist/cjs/{useNavigation.cjs.map → useNavigation.js.map} +0 -0
- /package/dist/cjs/{useScreens.cjs.map → useScreens.js.map} +0 -0
- /package/dist/cjs/{useViteRoutes.cjs.map → useViteRoutes.js.map} +0 -0
- /package/dist/cjs/utils/{assertIsReady.cjs.map → assertIsReady.js.map} +0 -0
- /package/dist/cjs/utils/{dynamicImport.cjs.map → dynamicImport.js.map} +0 -0
- /package/dist/cjs/utils/{existsAsync.cjs.map → existsAsync.js.map} +0 -0
- /package/dist/cjs/utils/{getPageExport.cjs.map → getPageExport.js.map} +0 -0
- /package/dist/cjs/utils/{globDir.cjs.map → globDir.js.map} +0 -0
- /package/dist/cjs/utils/{hashString.cjs.map → hashString.js.map} +0 -0
- /package/dist/cjs/utils/{isResponse.cjs.map → isResponse.js.map} +0 -0
- /package/dist/cjs/utils/{isStatus.cjs.map → isStatus.js.map} +0 -0
- /package/dist/cjs/utils/{promiseWithResolvers.cjs.map → promiseWithResolvers.js.map} +0 -0
- /package/dist/cjs/utils/{rand.cjs.map → rand.js.map} +0 -0
- /package/dist/cjs/utils/{redirect.cjs.map → redirect.js.map} +0 -0
- /package/dist/cjs/utils/{removeSearch.cjs.map → removeSearch.js.map} +0 -0
- /package/dist/cjs/utils/{removeUndefined.cjs.map → removeUndefined.js.map} +0 -0
- /package/dist/cjs/utils/{url.cjs.map → url.js.map} +0 -0
- /package/dist/cjs/utils/{weakKey.cjs.map → weakKey.js.map} +0 -0
- /package/dist/cjs/utils/{weakMemo.cjs.map → weakMemo.js.map} +0 -0
- /package/dist/cjs/views/{EmptyRoute.cjs.map → EmptyRoute.js.map} +0 -0
- /package/dist/cjs/views/{ErrorBoundary.cjs.map → ErrorBoundary.js.map} +0 -0
- /package/dist/cjs/views/{LoadProgressBar.cjs.map → LoadProgressBar.js.map} +0 -0
- /package/dist/cjs/views/{Navigator.cjs.map → Navigator.js.map} +0 -0
- /package/dist/cjs/views/{PreloadLinks.cjs.map → PreloadLinks.js.map} +0 -0
- /package/dist/cjs/views/{RootErrorBoundary.cjs.map → RootErrorBoundary.js.map} +0 -0
- /package/dist/cjs/views/{Screen.cjs.map → Screen.js.map} +0 -0
- /package/dist/cjs/views/{ScrollRestoration.cjs.map → ScrollRestoration.js.map} +0 -0
- /package/dist/cjs/views/{Try.cjs.map → Try.js.map} +0 -0
- /package/dist/cjs/vite/{build.cjs.map → build.js.map} +0 -0
- /package/dist/cjs/vite/{clientTreeShakePlugin.cjs.map → clientTreeShakePlugin.js.map} +0 -0
- /package/dist/cjs/vite/{constants.cjs.map → constants.js.map} +0 -0
- /package/dist/cjs/vite/{customNodeExternals.cjs.map → customNodeExternals.js.map} +0 -0
- /package/dist/cjs/vite/{ensureTsConfig.cjs.map → ensureTsConfig.js.map} +0 -0
- /package/dist/cjs/vite/{findDepsToOptimize.cjs.map → findDepsToOptimize.js.map} +0 -0
- /package/dist/cjs/vite/{fixDependenciesPlugin.cjs.map → fixDependenciesPlugin.js.map} +0 -0
- /package/dist/cjs/vite/{generateTypesForRoutes.cjs.map → generateTypesForRoutes.js.map} +0 -0
- /package/dist/cjs/vite/{getManifest.cjs.map → getManifest.js.map} +0 -0
- /package/dist/cjs/vite/{headers.cjs.map → headers.js.map} +0 -0
- /package/dist/cjs/vite/{makePluginWebOnly.cjs.map → makePluginWebOnly.js.map} +0 -0
- /package/dist/cjs/vite/{one.cjs.map → one.js.map} +0 -0
- /package/dist/cjs/vite/{removeReactNativeWebAnimatedPlugin.cjs.map → removeReactNativeWebAnimatedPlugin.js.map} +0 -0
- /package/dist/cjs/vite/{replaceLoader.cjs.map → replaceLoader.js.map} +0 -0
- /package/dist/cjs/vite/{resolveAPIRequest.cjs.map → resolveAPIRequest.js.map} +0 -0
- /package/dist/cjs/vite/{server.cjs.map → server.js.map} +0 -0
- /package/dist/cjs/vite/{types.cjs.map → types.js.map} +0 -0
- /package/dist/cjs/vite/{virtualEntryPlugin.cjs.map → virtualEntryPlugin.js.map} +0 -0
- /package/dist/cjs/vite/{vitePluginSsrCss.cjs.map → vitePluginSsrCss.js.map} +0 -0
- /package/dist/cjs/zero/{getQueryKey.cjs.map → getQueryKey.js.map} +0 -0
- /package/dist/cjs/zero/{isZeroQuery.cjs.map → isZeroQuery.js.map} +0 -0
- /package/dist/cjs/zero/{resolveQuery.cjs.map → resolveQuery.js.map} +0 -0
- /package/dist/cjs/zero/{subscribeToQuery.cjs.map → subscribeToQuery.js.map} +0 -0
- /package/dist/cjs/zero/{types.cjs.map → types.js.map} +0 -0
- /package/dist/cjs/zero/{useQuery.cjs.map → useQuery.js.map} +0 -0
- /package/dist/cjs/zero/{useQueryZero.cjs.map → useQueryZero.js.map} +0 -0
- /package/dist/cjs/{zero.cjs.map → zero.js.map} +0 -0
@@ -0,0 +1,244 @@
|
|
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 createFileSystemRouter_exports = {};
|
16
|
+
__export(createFileSystemRouter_exports, {
|
17
|
+
createFileSystemRouter: () => createFileSystemRouter
|
18
|
+
});
|
19
|
+
module.exports = __toCommonJS(createFileSystemRouter_exports);
|
20
|
+
var import_node_path = require("node:path"), import_perfect_debounce = require("perfect-debounce"), import_vite = require("vite"), import_createHandleRequest = require("../createHandleRequest"), import_isResponse = require("../utils/isResponse"), import_isStatus = require("../utils/isStatus"), import_promiseWithResolvers = require("../utils/promiseWithResolvers"), import_constants = require("./constants"), import_replaceLoader = require("./replaceLoader"), import_resolveAPIRequest = require("./resolveAPIRequest"), import_virtualEntryPlugin = require("./virtualEntryPlugin");
|
21
|
+
const USE_SERVER_ENV = !1;
|
22
|
+
//!!process.env.USE_SERVER_ENV
|
23
|
+
function createFileSystemRouter(options) {
|
24
|
+
const preloads = ["/@vite/client", import_virtualEntryPlugin.virtalEntryIdClient];
|
25
|
+
let runner, server, handleRequest = createRequestHandler(), renderPromise = null;
|
26
|
+
function createRequestHandler() {
|
27
|
+
return (0, import_createHandleRequest.createHandleRequest)(options, {
|
28
|
+
async handleSSR({ route, url, loaderProps }) {
|
29
|
+
if (console.info(` \u24F5 [${route.type}] ${url} resolved to ${route.file}`), route.type === "spa")
|
30
|
+
return `<html><head>
|
31
|
+
<script>globalThis['global'] = globalThis</script>
|
32
|
+
<script>globalThis['__vxrnIsSPA'] = true</script>
|
33
|
+
<script type="module">
|
34
|
+
import { injectIntoGlobalHook } from "/@react-refresh";
|
35
|
+
injectIntoGlobalHook(window);
|
36
|
+
window.$RefreshReg$ = () => {};
|
37
|
+
window.$RefreshSig$ = () => (type) => type;
|
38
|
+
</script>
|
39
|
+
<script type="module" src="/@vite/client" async=""></script>
|
40
|
+
<script type="module" src="/@id/__x00__virtual:one-entry" async=""></script>
|
41
|
+
</head></html>`;
|
42
|
+
renderPromise && await renderPromise;
|
43
|
+
const { promise, resolve } = (0, import_promiseWithResolvers.promiseWithResolvers)();
|
44
|
+
renderPromise = promise;
|
45
|
+
try {
|
46
|
+
const routeFile = (0, import_node_path.join)("app", route.file);
|
47
|
+
runner.clearCache(), globalThis.__vxrnresetState?.();
|
48
|
+
const exported = routeFile === "" ? {} : await runner.import(routeFile), loaderData = await exported.loader?.(loaderProps);
|
49
|
+
eval("process.env.TAMAGUI_IS_SERVER = '1'");
|
50
|
+
const entry = await runner.import(import_virtualEntryPlugin.virtualEntryId), render = entry.default.render;
|
51
|
+
globalThis.__vxrnLoaderData__ = loaderData, globalThis.__vxrnLoaderProps__ = loaderProps, import_constants.LoaderDataCache[route.file] = loaderData;
|
52
|
+
const is404 = route.isNotFound || !exported.default, html = await render({
|
53
|
+
loaderData,
|
54
|
+
loaderProps,
|
55
|
+
path: loaderProps?.path || "/",
|
56
|
+
preloads
|
57
|
+
});
|
58
|
+
return is404 ? new Response(html, {
|
59
|
+
status: 404,
|
60
|
+
headers: { "Content-Type": "text/html" }
|
61
|
+
}) : html;
|
62
|
+
} catch (err) {
|
63
|
+
console.error(`SSR error while loading file ${route.file} from URL ${url.href}
|
64
|
+
`, err);
|
65
|
+
const title = `Error rendering ${url.pathname} on server`, message = err instanceof Error ? err.message : `${err}`, stack = err instanceof Error ? err.stack : "";
|
66
|
+
return console.error(`${title}
|
67
|
+
${message}
|
68
|
+
|
69
|
+
${stack}
|
70
|
+
`), `
|
71
|
+
<html>
|
72
|
+
<body style="background: #000; color: #fff; padding: 5%; font-family: monospace; line-height: 2rem;">
|
73
|
+
<h1 style="display: inline-flex; background: red; color: white; padding: 5px; margin: -5px;">${title}</h1>
|
74
|
+
<h2>${message}</h2>
|
75
|
+
${stack ? `<pre style="font-size: 15px; line-height: 24px; white-space: pre;">
|
76
|
+
${stack}
|
77
|
+
</pre>` : ""}
|
78
|
+
</body>
|
79
|
+
</html>
|
80
|
+
`;
|
81
|
+
} finally {
|
82
|
+
resolve();
|
83
|
+
}
|
84
|
+
},
|
85
|
+
async handleLoader({ request, route: route2, url: url2, loaderProps: loaderProps2 }) {
|
86
|
+
const routeFile2 = (0, import_node_path.join)("app", route2.file);
|
87
|
+
let transformedJS = (await server.transformRequest(routeFile2))?.code;
|
88
|
+
if (!transformedJS)
|
89
|
+
throw new Error("No transformed js returned");
|
90
|
+
const loaderData2 = await (await runner.import(routeFile2)).loader?.(loaderProps2);
|
91
|
+
loaderData2 && (transformedJS = (0, import_replaceLoader.replaceLoader)({
|
92
|
+
code: transformedJS,
|
93
|
+
loaderData: loaderData2
|
94
|
+
}));
|
95
|
+
const platform = url2.searchParams.get("platform");
|
96
|
+
if (platform === "ios" || platform === "android") {
|
97
|
+
if (!server.environments[platform || ""])
|
98
|
+
throw new Error(`[handleLoader] No Vite environment found for platform '${platform}'`);
|
99
|
+
return `exports.loader = () => (${JSON.stringify(loaderData2)});`;
|
100
|
+
}
|
101
|
+
return transformedJS;
|
102
|
+
},
|
103
|
+
async handleAPI({ request, route: route2, url: url2, loaderProps: loaderProps2 }) {
|
104
|
+
return await (0, import_resolveAPIRequest.resolveAPIRequest)(
|
105
|
+
() => runner.import((0, import_node_path.join)("app", route2.file)),
|
106
|
+
request,
|
107
|
+
loaderProps2?.params || {}
|
108
|
+
);
|
109
|
+
}
|
110
|
+
});
|
111
|
+
}
|
112
|
+
return {
|
113
|
+
name: "one-router-fs",
|
114
|
+
enforce: "post",
|
115
|
+
apply: "serve",
|
116
|
+
async config(userConfig) {
|
117
|
+
if (handleRequest.manifest.pageRoutes)
|
118
|
+
return {
|
119
|
+
optimizeDeps: {
|
120
|
+
/**
|
121
|
+
* This adds all our routes and layouts as entries which fixes initial load making
|
122
|
+
* optimizeDeps be triggered which causes hard refreshes (also on initial navigations)
|
123
|
+
*
|
124
|
+
* see: https://vitejs.dev/config/dep-optimization-options.html#optimizedeps-entries
|
125
|
+
* and: https://github.com/remix-run/remix/pull/9921
|
126
|
+
*/
|
127
|
+
entries: [
|
128
|
+
...new Set(
|
129
|
+
handleRequest.manifest.pageRoutes.flatMap((route2) => [
|
130
|
+
(0, import_node_path.join)("app", route2.file),
|
131
|
+
...route2.layouts?.map((layout) => (0, import_node_path.join)("app", layout.contextKey)) || []
|
132
|
+
])
|
133
|
+
)
|
134
|
+
]
|
135
|
+
}
|
136
|
+
};
|
137
|
+
},
|
138
|
+
configureServer(serverIn) {
|
139
|
+
server = serverIn, runner = (0, import_vite.createServerModuleRunner)(
|
140
|
+
USE_SERVER_ENV ? server.environments.server : server.environments.ssr
|
141
|
+
);
|
142
|
+
const appDir = (0, import_node_path.join)(process.cwd(), "app"), fileWatcherChangeListener = (0, import_perfect_debounce.debounce)(async (type, path) => {
|
143
|
+
(type === "add" || type === "delete") && path.startsWith(appDir) && (handleRequest = createRequestHandler());
|
144
|
+
}, 100);
|
145
|
+
return server.watcher.addListener("all", fileWatcherChangeListener), () => {
|
146
|
+
server.middlewares.use(async (req, res, next) => {
|
147
|
+
try {
|
148
|
+
const redirects = options.web?.redirects;
|
149
|
+
if (redirects) {
|
150
|
+
const url2 = new URL(req.url || "", `http://${req.headers.host}`);
|
151
|
+
for (const redirect of redirects) {
|
152
|
+
const regexStr = `^${redirect.source.replace(/:\w+/g, "([^/]+)")}$`, match = url2.pathname.match(new RegExp(regexStr));
|
153
|
+
if (match) {
|
154
|
+
let destination = redirect.destination;
|
155
|
+
const params = redirect.source.match(/:\w+/g);
|
156
|
+
params && params.forEach((param, index) => {
|
157
|
+
destination = destination.replace(param, match[index + 1] || "");
|
158
|
+
}), console.warn(` [one] redirecting via redirect: ${destination}`), res.writeHead(redirect.permanent ? 301 : 302, { Location: destination }), res.end();
|
159
|
+
return;
|
160
|
+
}
|
161
|
+
}
|
162
|
+
}
|
163
|
+
const reply = await handleRequest.handler(await convertIncomingMessageToRequest(req));
|
164
|
+
if (!reply)
|
165
|
+
return next();
|
166
|
+
if (typeof reply != "string" && (0, import_isResponse.isResponse)(reply)) {
|
167
|
+
if (reply.headers.forEach((value, key) => {
|
168
|
+
if (key === "set-cookie") {
|
169
|
+
const cookies = value.split(", ");
|
170
|
+
for (const cookie of cookies)
|
171
|
+
res.appendHeader("Set-Cookie", cookie);
|
172
|
+
} else
|
173
|
+
res.setHeader(key, value);
|
174
|
+
}), (0, import_isStatus.isStatusRedirect)(reply.status)) {
|
175
|
+
const location = `${reply.headers.get("location") || ""}`;
|
176
|
+
if (console.info(` \u21A6 Redirect ${location}`), location) {
|
177
|
+
res.writeHead(reply.status, {
|
178
|
+
Location: location
|
179
|
+
}), res.end();
|
180
|
+
return;
|
181
|
+
}
|
182
|
+
console.error("No location provided to redirected status reply", reply);
|
183
|
+
}
|
184
|
+
res.statusCode = reply.status, res.statusMessage = reply.statusText;
|
185
|
+
let outString = "";
|
186
|
+
reply.body && reply.body.locked && console.warn("Body is locked??");
|
187
|
+
try {
|
188
|
+
outString = reply.body ? await streamToString(reply.body) : "";
|
189
|
+
} catch (err) {
|
190
|
+
console.warn(`Error converting body in dev mode: ${err}`);
|
191
|
+
}
|
192
|
+
res.write(outString), res.end();
|
193
|
+
return;
|
194
|
+
}
|
195
|
+
if (reply && typeof reply == "object") {
|
196
|
+
res.setHeader("Content-Type", "application/json"), res.write(JSON.stringify(reply)), res.end();
|
197
|
+
return;
|
198
|
+
}
|
199
|
+
res.write(reply), res.end();
|
200
|
+
return;
|
201
|
+
} catch (error) {
|
202
|
+
console.error(`One routing error: ${error}`), next(error);
|
203
|
+
}
|
204
|
+
console.warn(`SSR handler didn't send a response for url: ${req.url}`);
|
205
|
+
});
|
206
|
+
};
|
207
|
+
}
|
208
|
+
};
|
209
|
+
}
|
210
|
+
async function streamToString(stream) {
|
211
|
+
const reader = stream.getReader(), decoder = new TextDecoder();
|
212
|
+
let result = "";
|
213
|
+
try {
|
214
|
+
for (; ; ) {
|
215
|
+
const { done, value } = await reader.read();
|
216
|
+
if (done) break;
|
217
|
+
result += decoder.decode(value, { stream: !0 });
|
218
|
+
}
|
219
|
+
} catch (error) {
|
220
|
+
console.error("Error reading the stream:", error);
|
221
|
+
} finally {
|
222
|
+
reader.releaseLock();
|
223
|
+
}
|
224
|
+
return result;
|
225
|
+
}
|
226
|
+
const convertIncomingMessageToRequest = async (req) => {
|
227
|
+
if (!req.originalUrl)
|
228
|
+
throw new Error("Can't convert");
|
229
|
+
const urlBase = `http://${req.headers.host}`, urlString = req.originalUrl || "", url2 = new URL(urlString, urlBase), headers = new Headers();
|
230
|
+
for (const key in req.headers)
|
231
|
+
req.headers[key] && headers.append(key, req.headers[key]);
|
232
|
+
return new Request(url2, {
|
233
|
+
method: req.method,
|
234
|
+
body: ["POST", "PUT", "PATCH", "DELETE"].includes(req.method || "") ? await readStream(req) : null,
|
235
|
+
headers
|
236
|
+
});
|
237
|
+
};
|
238
|
+
function readStream(stream) {
|
239
|
+
return new Promise((resolve2, reject) => {
|
240
|
+
const chunks = [];
|
241
|
+
stream.on("data", (chunk) => chunks.push(chunk)), stream.on("end", () => resolve2(Buffer.concat(chunks))), stream.on("error", reject);
|
242
|
+
});
|
243
|
+
}
|
244
|
+
//# sourceMappingURL=createFileSystemRouter.js.map
|
@@ -0,0 +1,6 @@
|
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"sources": ["../../../src/vite/createFileSystemRouter.tsx"],
|
4
|
+
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AA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EA,MAAM,kCAAkC,OAAO,QAAmD;AAChG,MAAI,CAAC,IAAI;AACP,UAAM,IAAI,MAAM,eAAe;AAGjC,QAAM,UAAU,UAAU,IAAI,QAAQ,IAAI,IACpC,YAAY,IAAI,eAAe,IAC/BA,OAAM,IAAI,IAAI,WAAW,OAAO,GAEhC,UAAU,IAAI,QAAQ;AAC5B,aAAW,OAAO,IAAI;AACpB,IAAI,IAAI,QAAQ,GAAG,KAAG,QAAQ,OAAO,KAAK,IAAI,QAAQ,GAAG,CAAW;AAGtE,SAAO,IAAI,QAAQA,MAAK;AAAA,IACtB,QAAQ,IAAI;AAAA,IACZ,MAAM,CAAC,QAAQ,OAAO,SAAS,QAAQ,EAAE,SAAS,IAAI,UAAU,EAAE,IAC9D,MAAM,WAAW,GAAG,IACpB;AAAA,IACJ;AAAA,EACF,CAAC;AACH;AAEA,SAAS,WAAW,QAAkD;AACpE,SAAO,IAAI,QAAQ,CAACI,UAAS,WAAW;AACtC,UAAM,SAAuB,CAAC;AAC9B,WAAO,GAAG,QAAQ,CAAC,UAAsB,OAAO,KAAK,KAAK,CAAC,GAC3D,OAAO,GAAG,OAAO,MAAMA,SAAQ,OAAO,OAAO,MAAM,CAAC,CAAC,GACrD,OAAO,GAAG,SAAS,MAAM;AAAA,EAC3B,CAAC;AACH;",
|
5
|
+
"names": ["route", "url", "loaderProps", "routeFile", "loaderData", "resolve"]
|
6
|
+
}
|
@@ -70,7 +70,8 @@ function createFileSystemRouter(options) {
|
|
70
70
|
}
|
71
71
|
}) : html;
|
72
72
|
} catch (err) {
|
73
|
-
console.error(
|
73
|
+
console.error(`SSR error while loading file ${route.file} from URL ${url.href}
|
74
|
+
`, err);
|
74
75
|
var title = `Error rendering ${url.pathname} on server`, message = err instanceof Error ? err.message : `${err}`, stack = err instanceof Error ? err.stack : "";
|
75
76
|
return console.error(`${title}
|
76
77
|
${message}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources":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SAASF,MAAMG,QAAQD;AAE7BX,qBAAW,qBAAwBM,YACnCN,WAAW,sBAAyBR,aAEpCqB,iCAAgBvB,MAAMM,IAAI,IAAIU;AAE9B,cAAMQ,QAAQxB,MAAMyB,cAAc,CAACd,SAASW,SAEtCI,OAAO,MAAML,OAAO;YACxBL;YACAd;YACAyB,OAAMzB,eAAAA,OAAAA,SAAAA,YAAayB,SAAQ;YAC3BpC;UACF,CAAA;AAEA,iBAAIiC,QACK,IAAII,SAASF,MAAM;YACxBG,QAAQ;YACRC,SAAS;cAAE,gBAAgB;YAAY;UACzC,CAAA,IAGKJ;QACT,SAASK,KAAK;AACZ5B,kBAAQ6B,MAAM,
|
5
|
-
"names": ["USE_SERVER_ENV", "createFileSystemRouter", "options", "preloads", "virtalEntryIdClient", "runner", "server", "handleRequest", "createRequestHandler", "renderPromise", "createHandleRequest", "handleSSR", "route", "url", "loaderProps", "console", "info", "type", "file", "promise", "resolve", "promiseWithResolvers", "globalThis", "exported", "routeFile", "join", "clearCache", "import", "loaderData", "loader", "eval", "entry", "virtualEntryId", "render", "default", "LoaderDataCache", "is404", "isNotFound", "html", "path", "Response", "status", "headers", "err", "error", "title", "pathname", "message", "Error", "stack", "handleLoader", "param", "request", "transformedJS", "transformRequest", "code", "replaceLoader", "platform", "searchParams", "get", "environment", "environments", "nativeTransformedJS", "JSON", "stringify", "handleAPI", "result", "resolveAPIRequest", "params", "name", "enforce", "apply", "config", "userConfig", "manifest", "pageRoutes", "routesAndLayouts", "Set", "flatMap", "layouts", "map", "layout", "contextKey", "optimizeDeps", "entries", "configureServer", "serverIn", "createServerModuleRunner", "ssr", "appDir", "process", "cwd", "fileWatcherChangeListener", "debounce", "startsWith", "watcher", "addListener", "middlewares", "use", "req", "res", "next", "redirects", "web", "URL", "host", "redirect", "regexStr", "source", "replace", "match", "RegExp", "destination", "forEach", "index", "warn", "writeHead", "permanent", "Location", "end", "reply", "handler", "convertIncomingMessageToRequest", "isResponse", "value", "key", "cookies", "split", "_iteratorNormalCompletion", "_didIteratorError", "_iteratorError", "_iterator", "_step", "cookie", "appendHeader", "setHeader", "isStatusRedirect", "location", "statusCode", "statusMessage", "statusText", "outString", "body", "locked", "streamToString", "write", "stream", "reader", "getReader", "decoder", "TextDecoder", "done", "read", "decode", "releaseLock", "originalUrl", "urlBase", "urlString", "Headers", "append", "Request", "method", "includes", "readStream", "Promise", "reject", "chunks", "on", "chunk", "push", "Buffer", "concat"]
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA,uBAAqB,sBACrB,0BAAyB,6BAEzB,cAAyC,iBAEzC,6BAAoC,mCAEpC,oBAA2B,gCAC3B,kBAAiC,8BACjC,8BAAqC,0CACrC,mBAAgC,wBAChC,uBAA8B,4BAC9B,2BAAkC,gCAElC,4BAAoD;;;;;AAGpD,IAAMA,iBAAiB;AAAM;AAEtB,SAASC,uBAAuBC,SAA0B;AAC/D,MAAMC,WAAW;IAAC;IAAiBC;KAE/BC,QACAC,QAEAC,gBAAgBC,qBAAAA,GAEhBC,gBAAsC;AAE1C,WAASD,uBAAAA;AACP,eAAOE,gDAAoBR,SAAS;MAClC,MAAMS,UAAU,OAA2B;YAA3B,EAAEC,OAAOC,KAAKC,YAAW,IAAzB;AAGd,YAFAC,QAAQC,KAAK,aAAQJ,MAAMK,IAAI,KAAKJ,GAAAA,gBAAmBD,MAAMM,IAAI,EAAE,GAE/DN,MAAMK,SAAS;AAEjB,iBAAO;;;;;;;;;;;;AAcT,QAAIR,iBACF,MAAMA;AAGR,YAAM,EAAEU,SAASC,QAAO,QAAKC,kDAAAA;AAC7BZ,wBAAgBU;AAEhB,YAAI;cAIFG,8BAAAA,aAGyBC,kBANnBC,gBAAYC,uBAAK,OAAOb,MAAMM,IAAI;AACxCb,iBAAOqB,WAAU,IAEjBJ,gCAAAA,cAAAA,YAAW,sBAAmB,QAA9BA,iCAAAA,UAAAA,6BAAAA,KAAAA,WAAAA;AAEA,cAAMC,WAAWC,cAAc,KAAK,CAAC,I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
5
|
+
"names": ["USE_SERVER_ENV", "createFileSystemRouter", "options", "preloads", "virtalEntryIdClient", "runner", "server", "handleRequest", "createRequestHandler", "renderPromise", "createHandleRequest", "handleSSR", "route", "url", "loaderProps", "console", "info", "type", "file", "promise", "resolve", "promiseWithResolvers", "globalThis", "exported", "routeFile", "join", "clearCache", "import", "loaderData", "loader", "eval", "entry", "virtualEntryId", "render", "default", "LoaderDataCache", "is404", "isNotFound", "html", "path", "Response", "status", "headers", "err", "error", "href", "title", "pathname", "message", "Error", "stack", "handleLoader", "param", "request", "transformedJS", "transformRequest", "code", "replaceLoader", "platform", "searchParams", "get", "environment", "environments", "nativeTransformedJS", "JSON", "stringify", "handleAPI", "result", "resolveAPIRequest", "params", "name", "enforce", "apply", "config", "userConfig", "manifest", "pageRoutes", "routesAndLayouts", "Set", "flatMap", "layouts", "map", "layout", "contextKey", "optimizeDeps", "entries", "configureServer", "serverIn", "createServerModuleRunner", "ssr", "appDir", "process", "cwd", "fileWatcherChangeListener", "debounce", "startsWith", "watcher", "addListener", "middlewares", "use", "req", "res", "next", "redirects", "web", "URL", "host", "redirect", "regexStr", "source", "replace", "match", "RegExp", "destination", "forEach", "index", "warn", "writeHead", "permanent", "Location", "end", "reply", "handler", "convertIncomingMessageToRequest", "isResponse", "value", "key", "cookies", "split", "_iteratorNormalCompletion", "_didIteratorError", "_iteratorError", "_iterator", "_step", "cookie", "appendHeader", "setHeader", "isStatusRedirect", "location", "statusCode", "statusMessage", "statusText", "outString", "body", "locked", "streamToString", "write", "stream", "reader", "getReader", "decoder", "TextDecoder", "done", "read", "decode", "releaseLock", "originalUrl", "urlBase", "urlString", "Headers", "append", "Request", "method", "includes", "readStream", "Promise", "reject", "chunks", "on", "chunk", "push", "Buffer", "concat"]
|
6
6
|
}
|
@@ -0,0 +1,52 @@
|
|
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 customNodeExternals_exports = {};
|
24
|
+
__export(customNodeExternals_exports, {
|
25
|
+
nodeExternals: () => nodeExternals
|
26
|
+
});
|
27
|
+
module.exports = __toCommonJS(customNodeExternals_exports);
|
28
|
+
var import_node_module = require("node:module"), import_node_path = __toESM(require("node:path"), 1);
|
29
|
+
function nodeExternals() {
|
30
|
+
return {
|
31
|
+
name: "node-externals",
|
32
|
+
enforce: "pre",
|
33
|
+
resolveId: {
|
34
|
+
order: "pre",
|
35
|
+
async handler(specifier, importer, { isEntry }) {
|
36
|
+
if (isEntry || // Ignore entry points (they should always be resolved)
|
37
|
+
/^(?:\0|\.{1,2}\/)/.test(specifier) || // Ignore virtual modules and relative imports
|
38
|
+
import_node_path.default.isAbsolute(specifier))
|
39
|
+
return null;
|
40
|
+
if ((0, import_node_module.isBuiltin)(specifier)) {
|
41
|
+
const stripped = specifier.replace(/^node:/, "");
|
42
|
+
return {
|
43
|
+
id: (0, import_node_module.isBuiltin)(stripped) ? stripped : "node:" + stripped,
|
44
|
+
external: !0,
|
45
|
+
moduleSideEffects: !1
|
46
|
+
};
|
47
|
+
}
|
48
|
+
}
|
49
|
+
}
|
50
|
+
};
|
51
|
+
}
|
52
|
+
//# sourceMappingURL=customNodeExternals.js.map
|
@@ -0,0 +1,66 @@
|
|
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
|
@@ -0,0 +1,66 @@
|
|
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
|
@@ -0,0 +1,43 @@
|
|
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 fixDependenciesPlugin_exports = {};
|
16
|
+
__export(fixDependenciesPlugin_exports, {
|
17
|
+
fixDependenciesPlugin: () => fixDependenciesPlugin
|
18
|
+
});
|
19
|
+
module.exports = __toCommonJS(fixDependenciesPlugin_exports);
|
20
|
+
var import_vxrn = require("vxrn");
|
21
|
+
let hasApplied = !1;
|
22
|
+
function fixDependenciesPlugin(options) {
|
23
|
+
const patches = [];
|
24
|
+
for (const key in options) {
|
25
|
+
const value = options[key];
|
26
|
+
patches.push({
|
27
|
+
module: key,
|
28
|
+
patchFiles: value && typeof value == "object" ? value : {
|
29
|
+
optimize: value
|
30
|
+
}
|
31
|
+
});
|
32
|
+
}
|
33
|
+
return {
|
34
|
+
name: "one-fix-dependencies",
|
35
|
+
async config(config) {
|
36
|
+
!hasApplied && patches.length && (hasApplied = !0, await (0, import_vxrn.applyOptimizePatches)(patches, config));
|
37
|
+
},
|
38
|
+
async configResolved(config) {
|
39
|
+
patches.length && await (0, import_vxrn.applyDependencyPatches)(patches, config);
|
40
|
+
}
|
41
|
+
};
|
42
|
+
}
|
43
|
+
//# sourceMappingURL=fixDependenciesPlugin.js.map
|
@@ -0,0 +1,36 @@
|
|
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
|
@@ -0,0 +1,27 @@
|
|
1
|
+
var __defProp = Object.defineProperty;
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
5
|
+
var __export = (target, all) => {
|
6
|
+
for (var name in all)
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: !0 });
|
8
|
+
}, __copyProps = (to, from, except, desc) => {
|
9
|
+
if (from && typeof from == "object" || typeof from == "function")
|
10
|
+
for (let key of __getOwnPropNames(from))
|
11
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
12
|
+
return to;
|
13
|
+
};
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
15
|
+
var getManifest_exports = {};
|
16
|
+
__export(getManifest_exports, {
|
17
|
+
getManifest: () => getManifest
|
18
|
+
});
|
19
|
+
module.exports = __toCommonJS(getManifest_exports);
|
20
|
+
var import_createRoutesManifest = require("../server/createRoutesManifest"), import_globDir = require("../utils/globDir");
|
21
|
+
function getManifest() {
|
22
|
+
const routePaths = (0, import_globDir.globDir)("app");
|
23
|
+
return (0, import_createRoutesManifest.createRoutesManifest)(routePaths, {
|
24
|
+
platform: "web"
|
25
|
+
});
|
26
|
+
}
|
27
|
+
//# sourceMappingURL=getManifest.js.map
|