one 1.1.538 → 1.1.539
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/Root.native.js +83 -61
- package/dist/cjs/Root.native.js.map +1 -6
- package/dist/cjs/babel-plugins/one-router-metro.native.js +31 -20
- package/dist/cjs/babel-plugins/one-router-metro.native.js.map +1 -6
- package/dist/cjs/cli/build.native.js +340 -277
- package/dist/cjs/cli/build.native.js.map +1 -6
- package/dist/cjs/cli/buildPage.native.js +65 -36
- package/dist/cjs/cli/buildPage.native.js.map +1 -6
- package/dist/cjs/cli/checkNodeVersion.native.js +17 -14
- package/dist/cjs/cli/checkNodeVersion.native.js.map +1 -6
- package/dist/cjs/cli/dev.native.js +55 -37
- package/dist/cjs/cli/dev.native.js.map +1 -6
- package/dist/cjs/cli/label-process.native.js +20 -16
- package/dist/cjs/cli/label-process.native.js.map +1 -6
- package/dist/cjs/cli/main.native.js +37 -22
- package/dist/cjs/cli/main.native.js.map +1 -6
- package/dist/cjs/cli/patch.native.js +28 -19
- package/dist/cjs/cli/patch.native.js.map +1 -6
- package/dist/cjs/cli/prebuild.native.js +26 -18
- package/dist/cjs/cli/prebuild.native.js.map +1 -6
- package/dist/cjs/cli/runAndroid.native.js +26 -18
- package/dist/cjs/cli/runAndroid.native.js.map +1 -6
- package/dist/cjs/cli/runIos.native.js +26 -18
- package/dist/cjs/cli/runIos.native.js.map +1 -6
- package/dist/cjs/cli.native.js +281 -220
- package/dist/cjs/cli.native.js.map +1 -6
- package/dist/cjs/clientLoaderResolver.native.js +21 -19
- package/dist/cjs/clientLoaderResolver.native.js.map +1 -6
- package/dist/cjs/config.native.js +26 -21
- package/dist/cjs/config.native.js.map +1 -6
- package/dist/cjs/constants.native.js +36 -30
- package/dist/cjs/constants.native.js.map +1 -6
- package/dist/cjs/createApp.native.js +26 -21
- package/dist/cjs/createApp.native.js.map +1 -6
- package/dist/cjs/createHandleRequest.native.js +94 -85
- package/dist/cjs/createHandleRequest.native.js.map +1 -6
- package/dist/cjs/createMiddleware.native.js +17 -14
- package/dist/cjs/createMiddleware.native.js.map +1 -6
- package/dist/cjs/fallbackViews/Sitemap.native.js +21 -17
- package/dist/cjs/fallbackViews/Sitemap.native.js.map +1 -6
- package/dist/cjs/fallbackViews/Unmatched.native.js +27 -19
- package/dist/cjs/fallbackViews/Unmatched.native.js.map +1 -6
- package/dist/cjs/fork/NavigationContainer.native.js +93 -64
- package/dist/cjs/fork/NavigationContainer.native.js.map +1 -6
- package/dist/cjs/fork/__tests__/getPathFromState.test.cjs +9 -10
- package/dist/cjs/fork/__tests__/getPathFromState.test.js +3 -3
- package/dist/cjs/fork/__tests__/getPathFromState.test.js.map +1 -1
- package/dist/cjs/fork/__tests__/getPathFromState.test.native.js +1144 -1288
- package/dist/cjs/fork/__tests__/getPathFromState.test.native.js.map +1 -6
- package/dist/cjs/fork/__tests__/getStateFromPath.test.cjs +5 -7
- package/dist/cjs/fork/__tests__/getStateFromPath.test.js +5 -5
- package/dist/cjs/fork/__tests__/getStateFromPath.test.js.map +1 -1
- package/dist/cjs/fork/__tests__/getStateFromPath.test.native.js +1881 -2104
- package/dist/cjs/fork/__tests__/getStateFromPath.test.native.js.map +1 -6
- package/dist/cjs/fork/_shared.native.js +19 -19
- package/dist/cjs/fork/_shared.native.js.map +1 -6
- package/dist/cjs/fork/createMemoryHistory.native.js +131 -109
- package/dist/cjs/fork/createMemoryHistory.native.js.map +1 -6
- package/dist/cjs/fork/extractPathFromURL.native.js +43 -41
- package/dist/cjs/fork/extractPathFromURL.native.js.map +1 -6
- package/dist/cjs/fork/findFocusedRoute.native.js +20 -16
- package/dist/cjs/fork/findFocusedRoute.native.js.map +1 -6
- package/dist/cjs/fork/getPathFromState-mods.native.js +37 -25
- package/dist/cjs/fork/getPathFromState-mods.native.js.map +1 -6
- package/dist/cjs/fork/getPathFromState.native.js +112 -107
- package/dist/cjs/fork/getPathFromState.native.js.map +1 -6
- package/dist/cjs/fork/getPathFromState.test.native.js +63 -74
- package/dist/cjs/fork/getPathFromState.test.native.js.map +1 -6
- package/dist/cjs/fork/getStateFromPath-mods.native.js +126 -131
- package/dist/cjs/fork/getStateFromPath-mods.native.js.map +1 -6
- package/dist/cjs/fork/getStateFromPath.native.js +271 -240
- package/dist/cjs/fork/getStateFromPath.native.js.map +1 -6
- package/dist/cjs/fork/getStateFromPath.test.native.js +167 -306
- package/dist/cjs/fork/getStateFromPath.test.native.js.map +1 -6
- package/dist/cjs/fork/useBackButton.native.js +28 -23
- package/dist/cjs/fork/useBackButton.native.js.map +1 -6
- package/dist/cjs/fork/useDocumentTitle.native.js +17 -15
- package/dist/cjs/fork/useDocumentTitle.native.js.map +1 -6
- package/dist/cjs/fork/useLinking.native.js +111 -100
- package/dist/cjs/fork/useLinking.native.js.map +1 -6
- package/dist/cjs/fork/useThenable.native.js +41 -44
- package/dist/cjs/fork/useThenable.native.js.map +1 -6
- package/dist/cjs/fork/validatePathConfig.native.js +48 -49
- package/dist/cjs/fork/validatePathConfig.native.js.map +1 -6
- package/dist/cjs/getReactNavigationConfig.native.js +36 -39
- package/dist/cjs/getReactNavigationConfig.native.js.map +1 -6
- package/dist/cjs/getURL.native.js +25 -17
- package/dist/cjs/getURL.native.js.map +1 -6
- package/dist/cjs/head/Head.android.js +20 -16
- package/dist/cjs/head/Head.android.js.map +1 -6
- package/dist/cjs/head/Head.ios.js +162 -156
- package/dist/cjs/head/Head.ios.js.map +1 -6
- package/dist/cjs/head/Head.native.js +24 -18
- package/dist/cjs/head/Head.native.js.map +1 -6
- package/dist/cjs/head/HeadModule.native.js +21 -16
- package/dist/cjs/head/HeadModule.native.js.map +1 -6
- package/dist/cjs/head/index.native.js +13 -12
- package/dist/cjs/head/index.native.js.map +1 -6
- package/dist/cjs/head/types.native.js +9 -5
- package/dist/cjs/head/types.native.js.map +1 -6
- package/dist/cjs/head/url.js +2 -2
- package/dist/cjs/head/url.js.map +1 -1
- package/dist/cjs/head/url.native.js +23 -20
- package/dist/cjs/head/url.native.js.map +1 -6
- package/dist/cjs/hooks.native.js +62 -67
- package/dist/cjs/hooks.native.js.map +1 -6
- package/dist/cjs/href.native.js +18 -16
- package/dist/cjs/href.native.js.map +1 -6
- package/dist/cjs/import-mode/index.android.js +18 -10
- package/dist/cjs/import-mode/index.android.js.map +1 -6
- package/dist/cjs/import-mode/index.ios.js +18 -10
- package/dist/cjs/import-mode/index.ios.js.map +1 -6
- package/dist/cjs/import-mode/index.native.js +16 -9
- package/dist/cjs/import-mode/index.native.js.map +1 -6
- package/dist/cjs/index.native.js +57 -63
- package/dist/cjs/index.native.js.map +1 -6
- package/dist/cjs/interfaces/router.native.js +17 -14
- package/dist/cjs/interfaces/router.native.js.map +1 -6
- package/dist/cjs/layouts/Drawer.native.js +22 -15
- package/dist/cjs/layouts/Drawer.native.js.map +1 -6
- package/dist/cjs/layouts/Stack.native.js +22 -15
- package/dist/cjs/layouts/Stack.native.js.map +1 -6
- package/dist/cjs/layouts/Tabs.native.js +76 -63
- package/dist/cjs/layouts/Tabs.native.js.map +1 -6
- package/dist/cjs/layouts/withLayoutContext.native.js +67 -56
- package/dist/cjs/layouts/withLayoutContext.native.js.map +1 -6
- package/dist/cjs/link/Link.native.js +94 -89
- package/dist/cjs/link/Link.native.js.map +1 -6
- package/dist/cjs/link/Redirect.native.js +25 -20
- package/dist/cjs/link/Redirect.native.js.map +1 -6
- package/dist/cjs/link/href.native.js +42 -38
- package/dist/cjs/link/href.native.js.map +1 -6
- package/dist/cjs/link/linking.native.js +63 -61
- package/dist/cjs/link/linking.native.js.map +1 -6
- package/dist/cjs/link/path.native.js +34 -38
- package/dist/cjs/link/path.native.js.map +1 -6
- package/dist/cjs/link/useLinkTo.native.js +36 -30
- package/dist/cjs/link/useLinkTo.native.js.map +1 -6
- package/dist/cjs/link/useLoadedNavigation.native.js +40 -40
- package/dist/cjs/link/useLoadedNavigation.native.js.map +1 -6
- package/dist/cjs/metro-config/getViteMetroPluginOptions.native.js +115 -112
- package/dist/cjs/metro-config/getViteMetroPluginOptions.native.js.map +1 -6
- package/dist/cjs/polyfills-mobile.native.js +28 -15
- package/dist/cjs/polyfills-mobile.native.js.map +1 -6
- package/dist/cjs/polyfills-server.native.js +19 -13
- package/dist/cjs/polyfills-server.native.js.map +1 -6
- package/dist/cjs/render.native.js +16 -13
- package/dist/cjs/render.native.js.map +1 -6
- package/dist/cjs/router/FlagsContext.native.js +19 -15
- package/dist/cjs/router/FlagsContext.native.js.map +1 -6
- package/dist/cjs/router/Route.native.js +39 -28
- package/dist/cjs/router/Route.native.js.map +1 -6
- package/dist/cjs/router/RouteInfoContext.native.js +37 -21
- package/dist/cjs/router/RouteInfoContext.native.js.map +1 -6
- package/dist/cjs/router/RouterStore.native.js +9 -5
- package/dist/cjs/router/RouterStore.native.js.map +1 -6
- package/dist/cjs/router/createRoute.native.js +31 -26
- package/dist/cjs/router/createRoute.native.js.map +1 -6
- package/dist/cjs/router/filterRootHTML.native.js +40 -24
- package/dist/cjs/router/filterRootHTML.native.js.map +1 -6
- package/dist/cjs/router/getLinkingConfig.native.js +24 -21
- package/dist/cjs/router/getLinkingConfig.native.js.map +1 -6
- package/dist/cjs/router/getNormalizedStatePath.native.js +32 -28
- package/dist/cjs/router/getNormalizedStatePath.native.js.map +1 -6
- package/dist/cjs/router/getRoutes.native.js +261 -273
- package/dist/cjs/router/getRoutes.native.js.map +1 -6
- package/dist/cjs/router/glob-patterns.native.js +21 -24
- package/dist/cjs/router/glob-patterns.native.js.map +1 -6
- package/dist/cjs/router/imperative-api.native.js +39 -32
- package/dist/cjs/router/imperative-api.native.js.map +1 -6
- package/dist/cjs/router/lastAction.native.js +24 -20
- package/dist/cjs/router/lastAction.native.js.map +1 -6
- package/dist/cjs/router/matchers.native.js +18 -26
- package/dist/cjs/router/matchers.native.js.map +1 -6
- package/dist/cjs/router/matchers.test.native.js +19 -17
- package/dist/cjs/router/matchers.test.native.js.map +1 -6
- package/dist/cjs/router/router.native.js +156 -150
- package/dist/cjs/router/router.native.js.map +1 -6
- package/dist/cjs/router/serverLocationContext.native.js +19 -15
- package/dist/cjs/router/serverLocationContext.native.js.map +1 -6
- package/dist/cjs/router/sortRoutes.native.js +37 -44
- package/dist/cjs/router/sortRoutes.native.js.map +1 -6
- package/dist/cjs/router/useInitializeOneRouter.native.js +28 -20
- package/dist/cjs/router/useInitializeOneRouter.native.js.map +1 -6
- package/dist/cjs/router/useNavigation.native.js +42 -35
- package/dist/cjs/router/useNavigation.native.js.map +1 -6
- package/dist/cjs/router/useScreens.native.js +280 -248
- package/dist/cjs/router/useScreens.native.js.map +1 -6
- package/dist/cjs/router/useViteRoutes.native.js +36 -31
- package/dist/cjs/router/useViteRoutes.native.js.map +1 -6
- package/dist/cjs/router/utils/getNavigateAction.native.js +33 -23
- package/dist/cjs/router/utils/getNavigateAction.native.js.map +1 -6
- package/dist/cjs/router/utils/getNavigateAction.test.native.js +142 -197
- package/dist/cjs/router/utils/getNavigateAction.test.native.js.map +1 -6
- package/dist/cjs/serve-worker.native.js +25 -16
- package/dist/cjs/serve-worker.native.js.map +1 -6
- package/dist/cjs/serve.native.js +50 -25
- package/dist/cjs/serve.native.js.map +1 -6
- package/dist/cjs/server/ServerContextScript.native.js +31 -26
- package/dist/cjs/server/ServerContextScript.native.js.map +1 -6
- package/dist/cjs/server/createRoutesManifest.native.js +26 -23
- package/dist/cjs/server/createRoutesManifest.native.js.map +1 -6
- package/dist/cjs/server/getServerManifest.native.js +107 -87
- package/dist/cjs/server/getServerManifest.native.js.map +1 -6
- package/dist/cjs/server/oneServe.native.js +199 -132
- package/dist/cjs/server/oneServe.native.js.map +1 -6
- package/dist/cjs/server/setServerGlobals.native.js +17 -14
- package/dist/cjs/server/setServerGlobals.native.js.map +1 -6
- package/dist/cjs/server/setupBuildOptions.native.js +17 -14
- package/dist/cjs/server/setupBuildOptions.native.js.map +1 -6
- package/dist/cjs/server/setupServerGlobals.native.js +3 -2
- package/dist/cjs/server/setupServerGlobals.native.js.map +1 -6
- package/dist/cjs/server-render.native.js +39 -29
- package/dist/cjs/server-render.native.js.map +1 -6
- package/dist/cjs/setup.native.js.map +1 -6
- package/dist/cjs/testing-utils.native.js +39 -41
- package/dist/cjs/testing-utils.native.js.map +1 -6
- package/dist/cjs/typed-routes/generateRouteTypes.native.js +36 -22
- package/dist/cjs/typed-routes/generateRouteTypes.native.js.map +1 -6
- package/dist/cjs/typed-routes/getTypedRoutesDeclarationFile.native.js +53 -47
- package/dist/cjs/typed-routes/getTypedRoutesDeclarationFile.native.js.map +1 -6
- package/dist/cjs/types.native.js +9 -5
- package/dist/cjs/types.native.js.map +1 -6
- package/dist/cjs/useFocusEffect.native.js +39 -36
- package/dist/cjs/useFocusEffect.native.js.map +1 -6
- package/dist/cjs/useLoader.native.js +67 -52
- package/dist/cjs/useLoader.native.js.map +1 -6
- package/dist/cjs/useServerHeadInsertion.native.js +32 -25
- package/dist/cjs/useServerHeadInsertion.native.js.map +1 -6
- package/dist/cjs/utils/assertIsReady.native.js +18 -16
- package/dist/cjs/utils/assertIsReady.native.js.map +1 -6
- package/dist/cjs/utils/cleanUrl.native.js +26 -19
- package/dist/cjs/utils/cleanUrl.native.js.map +1 -6
- package/dist/cjs/utils/dynamicImport.native.js +18 -15
- package/dist/cjs/utils/dynamicImport.native.js.map +1 -6
- package/dist/cjs/utils/ensureExists.native.js +18 -16
- package/dist/cjs/utils/ensureExists.native.js.map +1 -6
- package/dist/cjs/utils/existsAsync.native.js +27 -23
- package/dist/cjs/utils/existsAsync.native.js.map +1 -6
- package/dist/cjs/utils/getPageExport.native.js +34 -30
- package/dist/cjs/utils/getPageExport.native.js.map +1 -6
- package/dist/cjs/utils/getPathnameFromFilePath.native.js +36 -27
- package/dist/cjs/utils/getPathnameFromFilePath.native.js.map +1 -6
- package/dist/cjs/utils/getRouterRootFromOneOptions.native.js +17 -14
- package/dist/cjs/utils/getRouterRootFromOneOptions.native.js.map +1 -6
- package/dist/cjs/utils/globDir.native.js +24 -18
- package/dist/cjs/utils/globDir.native.js.map +1 -6
- package/dist/cjs/utils/hashString.native.js +23 -17
- package/dist/cjs/utils/hashString.native.js.map +1 -6
- package/dist/cjs/utils/isResponse.native.js +21 -15
- package/dist/cjs/utils/isResponse.native.js.map +1 -6
- package/dist/cjs/utils/isRolldown.native.js +24 -19
- package/dist/cjs/utils/isRolldown.native.js.map +1 -6
- package/dist/cjs/utils/isStatus.native.js +17 -14
- package/dist/cjs/utils/isStatus.native.js.map +1 -6
- package/dist/cjs/utils/platform.native.js +17 -14
- package/dist/cjs/utils/platform.native.js.map +1 -6
- package/dist/cjs/utils/promiseWithResolvers.native.js +22 -17
- package/dist/cjs/utils/promiseWithResolvers.native.js.map +1 -6
- package/dist/cjs/utils/rand.native.js +18 -15
- package/dist/cjs/utils/rand.native.js.map +1 -6
- package/dist/cjs/utils/redirect.native.js +26 -21
- package/dist/cjs/utils/redirect.native.js.map +1 -6
- package/dist/cjs/utils/removeSearch.native.js +17 -14
- package/dist/cjs/utils/removeSearch.native.js.map +1 -6
- package/dist/cjs/utils/removeUndefined.native.js +18 -16
- package/dist/cjs/utils/removeUndefined.native.js.map +1 -6
- package/dist/cjs/utils/toAbsolute.native.js +21 -17
- package/dist/cjs/utils/toAbsolute.native.js.map +1 -6
- package/dist/cjs/utils/url.native.js +17 -16
- package/dist/cjs/utils/url.native.js.map +1 -6
- package/dist/cjs/utils/useConstant.native.js +26 -21
- package/dist/cjs/utils/useConstant.native.js.map +1 -6
- package/dist/cjs/utils/weakKey.native.js +25 -21
- package/dist/cjs/utils/weakKey.native.js.map +1 -6
- package/dist/cjs/utils/weakMemo.native.js +23 -18
- package/dist/cjs/utils/weakMemo.native.js.map +1 -6
- package/dist/cjs/utils/withStaticProperties.native.js +48 -35
- package/dist/cjs/utils/withStaticProperties.native.js.map +1 -6
- package/dist/cjs/vercel/build/buildVercelOutputDirectory.native.js +120 -95
- package/dist/cjs/vercel/build/buildVercelOutputDirectory.native.js.map +1 -6
- package/dist/cjs/vercel/build/config/vc-build-output-config-base.native.js +17 -14
- package/dist/cjs/vercel/build/config/vc-build-output-config-base.native.js.map +1 -6
- package/dist/cjs/vercel/build/config/vc-config-base.native.js +17 -14
- package/dist/cjs/vercel/build/config/vc-config-base.native.js.map +1 -6
- package/dist/cjs/vercel/build/config/vc-package-base.native.js +17 -14
- package/dist/cjs/vercel/build/config/vc-package-base.native.js.map +1 -6
- package/dist/cjs/vercel/build/generate/createApiServerlessFunction.native.js +60 -71
- package/dist/cjs/vercel/build/generate/createApiServerlessFunction.native.js.map +1 -6
- package/dist/cjs/vercel/build/generate/createSsrServerlessFunction.native.js +36 -24
- package/dist/cjs/vercel/build/generate/createSsrServerlessFunction.native.js.map +1 -6
- package/dist/cjs/vercel/build/getPathFromRoute.native.js +18 -15
- package/dist/cjs/vercel/build/getPathFromRoute.native.js.map +1 -6
- package/dist/cjs/views/EmptyRoute.native.js +19 -15
- package/dist/cjs/views/EmptyRoute.native.js.map +1 -6
- package/dist/cjs/views/ErrorBoundary.native.js +33 -19
- package/dist/cjs/views/ErrorBoundary.native.js.map +1 -6
- package/dist/cjs/views/LoadProgressBar.native.js +75 -67
- package/dist/cjs/views/LoadProgressBar.native.js.map +1 -6
- package/dist/cjs/views/Navigator.native.js +99 -64
- package/dist/cjs/views/Navigator.native.js.map +1 -6
- package/dist/cjs/views/OneStackRouter.native.js +27 -23
- package/dist/cjs/views/OneStackRouter.native.js.map +1 -6
- package/dist/cjs/views/PreloadLinks.native.js +16 -13
- package/dist/cjs/views/PreloadLinks.native.js.map +1 -6
- package/dist/cjs/views/RootErrorBoundary.native.js +54 -53
- package/dist/cjs/views/RootErrorBoundary.native.js.map +1 -6
- package/dist/cjs/views/Screen.native.js +28 -22
- package/dist/cjs/views/Screen.native.js.map +1 -6
- package/dist/cjs/views/ScrollBehavior.native.js +54 -43
- package/dist/cjs/views/ScrollBehavior.native.js.map +1 -6
- package/dist/cjs/views/Try.native.js +60 -54
- package/dist/cjs/views/Try.native.js.map +1 -6
- package/dist/cjs/vite/DevHead.native.js +19 -15
- package/dist/cjs/vite/DevHead.native.js.map +1 -6
- package/dist/cjs/vite/constants.native.js +20 -17
- package/dist/cjs/vite/constants.native.js.map +1 -6
- package/dist/cjs/vite/customNodeExternals.native.js +35 -25
- package/dist/cjs/vite/customNodeExternals.native.js.map +1 -6
- package/dist/cjs/vite/ensureTsConfig.native.js +21 -16
- package/dist/cjs/vite/ensureTsConfig.native.js.map +1 -6
- package/dist/cjs/vite/findDepsToOptimize.native.js +46 -43
- package/dist/cjs/vite/findDepsToOptimize.native.js.map +1 -6
- package/dist/cjs/vite/getManifest.native.js +23 -16
- package/dist/cjs/vite/getManifest.native.js.map +1 -6
- package/dist/cjs/vite/loadConfig.native.js +22 -22
- package/dist/cjs/vite/loadConfig.native.js.map +1 -6
- package/dist/cjs/vite/makePluginWebOnly.native.js +20 -19
- package/dist/cjs/vite/makePluginWebOnly.native.js.map +1 -6
- package/dist/cjs/vite/one-server-only.native.js +24 -33
- package/dist/cjs/vite/one-server-only.native.js.map +1 -6
- package/dist/cjs/vite/one.native.js +202 -181
- package/dist/cjs/vite/one.native.js.map +1 -6
- package/dist/cjs/vite/plugins/SSRCSSPlugin.native.js +75 -74
- package/dist/cjs/vite/plugins/SSRCSSPlugin.native.js.map +1 -6
- package/dist/cjs/vite/plugins/clientTreeShakePlugin.native.js +69 -56
- package/dist/cjs/vite/plugins/clientTreeShakePlugin.native.js.map +1 -6
- package/dist/cjs/vite/plugins/fileSystemRouterPlugin.native.js +154 -108
- package/dist/cjs/vite/plugins/fileSystemRouterPlugin.native.js.map +1 -6
- package/dist/cjs/vite/plugins/fixDependenciesPlugin.native.js +25 -16
- package/dist/cjs/vite/plugins/fixDependenciesPlugin.native.js.map +1 -6
- package/dist/cjs/vite/plugins/generateFileSystemRouteTypesPlugin.native.js +33 -24
- package/dist/cjs/vite/plugins/generateFileSystemRouteTypesPlugin.native.js.map +1 -6
- package/dist/cjs/vite/plugins/removeReactNativeWebAnimatedPlugin.native.js +26 -24
- package/dist/cjs/vite/plugins/removeReactNativeWebAnimatedPlugin.native.js.map +1 -6
- package/dist/cjs/vite/plugins/useDomPlugin.native.js +32 -26
- package/dist/cjs/vite/plugins/useDomPlugin.native.js.map +1 -6
- package/dist/cjs/vite/plugins/virtualEntryConstants.native.js +24 -20
- package/dist/cjs/vite/plugins/virtualEntryConstants.native.js.map +1 -6
- package/dist/cjs/vite/plugins/virtualEntryPlugin.native.js +38 -45
- package/dist/cjs/vite/plugins/virtualEntryPlugin.native.js.map +1 -6
- package/dist/cjs/vite/replaceLoader.native.js +26 -20
- package/dist/cjs/vite/replaceLoader.native.js.map +1 -6
- package/dist/cjs/vite/resolveResponse.native.js +59 -42
- package/dist/cjs/vite/resolveResponse.native.js.map +1 -6
- package/dist/cjs/vite/types.native.js +9 -5
- package/dist/cjs/vite/types.native.js.map +1 -6
- package/dist/cjs/vite.native.js +26 -22
- package/dist/cjs/vite.native.js.map +1 -6
- package/dist/cjs/zero/getQueryKey.native.js +18 -15
- package/dist/cjs/zero/getQueryKey.native.js.map +1 -6
- package/dist/cjs/zero/isZeroQuery.native.js +23 -15
- package/dist/cjs/zero/isZeroQuery.native.js.map +1 -6
- package/dist/cjs/zero/resolveQuery.native.js +23 -19
- package/dist/cjs/zero/resolveQuery.native.js.map +1 -6
- package/dist/cjs/zero/subscribeToQuery.native.js +18 -15
- package/dist/cjs/zero/subscribeToQuery.native.js.map +1 -6
- package/dist/cjs/zero/types.native.js +9 -5
- package/dist/cjs/zero/types.native.js.map +1 -6
- package/dist/cjs/zero/useQuery.js +2 -2
- package/dist/cjs/zero/useQuery.js.map +1 -1
- package/dist/cjs/zero/useQuery.native.js +30 -19
- package/dist/cjs/zero/useQuery.native.js.map +1 -6
- package/dist/cjs/zero/useQueryZero.native.js +35 -34
- package/dist/cjs/zero/useQueryZero.native.js.map +1 -6
- package/dist/cjs/zero.native.js +20 -17
- package/dist/cjs/zero.native.js.map +1 -6
- package/dist/esm/cli/build.native.js +2 -2
- package/dist/esm/cli/build.native.js.map +1 -1
- package/dist/esm/cli/buildPage.native.js +5 -2
- package/dist/esm/cli/buildPage.native.js.map +1 -1
- package/dist/esm/cli/label-process.native.js +1 -1
- package/dist/esm/cli/main.native.js +2 -2
- package/dist/esm/cli.native.js +3 -3
- package/dist/esm/createApp.native.js.map +1 -1
- package/dist/esm/fork/__tests__/getPathFromState.test.js +3 -3
- package/dist/esm/fork/__tests__/getPathFromState.test.js.map +1 -1
- package/dist/esm/fork/__tests__/getPathFromState.test.mjs +9 -10
- package/dist/esm/fork/__tests__/getPathFromState.test.mjs.map +1 -1
- package/dist/esm/fork/__tests__/getPathFromState.test.native.js.map +1 -1
- package/dist/esm/fork/__tests__/getStateFromPath.test.js +5 -5
- package/dist/esm/fork/__tests__/getStateFromPath.test.js.map +1 -1
- package/dist/esm/fork/__tests__/getStateFromPath.test.mjs +5 -7
- package/dist/esm/fork/__tests__/getStateFromPath.test.mjs.map +1 -1
- package/dist/esm/fork/__tests__/getStateFromPath.test.native.js.map +1 -1
- package/dist/esm/fork/getStateFromPath.native.js +6 -1
- package/dist/esm/fork/getStateFromPath.native.js.map +1 -1
- package/dist/esm/fork/useBackButton.native.js.map +1 -1
- package/dist/esm/fork/useDocumentTitle.native.js.map +1 -1
- package/dist/esm/fork/useLinking.native.js +6 -1
- package/dist/esm/fork/useLinking.native.js.map +1 -1
- package/dist/esm/fork/validatePathConfig.native.js +7 -2
- package/dist/esm/fork/validatePathConfig.native.js.map +1 -1
- package/dist/esm/getURL.native.js.map +1 -1
- package/dist/esm/head/Head.android.js.map +1 -1
- package/dist/esm/head/Head.ios.js +7 -2
- package/dist/esm/head/Head.ios.js.map +1 -1
- package/dist/esm/head/url.js +2 -2
- package/dist/esm/head/url.js.map +1 -1
- package/dist/esm/head/url.native.js.map +1 -1
- package/dist/esm/import-mode/index.android.js.map +1 -1
- package/dist/esm/import-mode/index.ios.js.map +1 -1
- package/dist/esm/import-mode/index.native.js.map +1 -1
- package/dist/esm/metro-config/getViteMetroPluginOptions.native.js +2 -2
- package/dist/esm/metro-config/getViteMetroPluginOptions.native.js.map +1 -1
- package/dist/esm/render.native.js.map +1 -1
- package/dist/esm/router/filterRootHTML.native.js +6 -1
- package/dist/esm/router/filterRootHTML.native.js.map +1 -1
- package/dist/esm/router/router.native.js +6 -1
- package/dist/esm/router/router.native.js.map +1 -1
- package/dist/esm/router/useScreens.native.js +7 -4
- package/dist/esm/router/useScreens.native.js.map +1 -1
- package/dist/esm/server/oneServe.native.js +1 -1
- package/dist/esm/testing-utils.native.js +1 -1
- package/dist/esm/typed-routes/generateRouteTypes.native.js +2 -2
- package/dist/esm/useLoader.native.js +5 -2
- package/dist/esm/useLoader.native.js.map +1 -1
- package/dist/esm/utils/existsAsync.native.js +1 -1
- package/dist/esm/utils/getPathnameFromFilePath.native.js +1 -1
- package/dist/esm/utils/isResponse.native.js +4 -1
- package/dist/esm/utils/isResponse.native.js.map +1 -1
- package/dist/esm/utils/toAbsolute.native.js +1 -1
- package/dist/esm/utils/withStaticProperties.native.js +6 -1
- package/dist/esm/utils/withStaticProperties.native.js.map +1 -1
- package/dist/esm/vercel/build/buildVercelOutputDirectory.native.js +1 -1
- package/dist/esm/vercel/build/generate/createApiServerlessFunction.native.js +1 -1
- package/dist/esm/vercel/build/generate/createSsrServerlessFunction.native.js +1 -1
- package/dist/esm/views/PreloadLinks.native.js.map +1 -1
- package/dist/esm/views/RootErrorBoundary.native.js +4 -1
- package/dist/esm/vite/customNodeExternals.native.js +2 -2
- package/dist/esm/vite/ensureTsConfig.native.js +1 -1
- package/dist/esm/vite/findDepsToOptimize.native.js +3 -3
- package/dist/esm/vite/one-server-only.native.js.map +1 -1
- package/dist/esm/vite/one.native.js +8 -3
- package/dist/esm/vite/one.native.js.map +1 -1
- package/dist/esm/vite/plugins/clientTreeShakePlugin.native.js +8 -5
- package/dist/esm/vite/plugins/clientTreeShakePlugin.native.js.map +1 -1
- package/dist/esm/vite/plugins/fileSystemRouterPlugin.native.js +8 -5
- package/dist/esm/vite/plugins/fileSystemRouterPlugin.native.js.map +1 -1
- package/dist/esm/vite/plugins/fixDependenciesPlugin.native.js +6 -1
- package/dist/esm/vite/plugins/fixDependenciesPlugin.native.js.map +1 -1
- package/dist/esm/vite/plugins/generateFileSystemRouteTypesPlugin.native.js +1 -1
- package/dist/esm/vite/plugins/generateFileSystemRouteTypesPlugin.native.js.map +1 -1
- package/dist/esm/vite/plugins/useDomPlugin.native.js +1 -1
- package/dist/esm/vite/resolveResponse.native.js +9 -1
- package/dist/esm/vite/resolveResponse.native.js.map +1 -1
- package/dist/esm/zero/isZeroQuery.native.js +6 -1
- package/dist/esm/zero/isZeroQuery.native.js.map +1 -1
- package/dist/esm/zero/useQuery.js +2 -2
- package/dist/esm/zero/useQuery.js.map +1 -1
- package/dist/esm/zero/useQuery.native.js.map +1 -1
- package/package.json +10 -10
|
@@ -1,138 +1,193 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
|
|
2
3
|
var __create = Object.create;
|
|
3
4
|
var __defProp = Object.defineProperty;
|
|
4
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf,
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf,
|
|
8
|
+
__hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
9
|
var __export = (target, all) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
for (var name in all) __defProp(target, name, {
|
|
11
|
+
get: all[name],
|
|
12
|
+
enumerable: !0
|
|
13
|
+
});
|
|
14
|
+
},
|
|
15
|
+
__copyProps = (to, from, except, desc) => {
|
|
16
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
17
|
+
get: () => from[key],
|
|
18
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
19
|
+
});
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
16
22
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
23
|
// If the importer is in node compatibility mode or this is not an ESM
|
|
18
24
|
// file that has been converted to a CommonJS file using a Babel-
|
|
19
25
|
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
20
26
|
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
22
|
-
|
|
23
|
-
|
|
27
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
28
|
+
value: mod,
|
|
29
|
+
enumerable: !0
|
|
30
|
+
}) : target, mod)),
|
|
31
|
+
__toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
32
|
+
value: !0
|
|
33
|
+
}), mod);
|
|
24
34
|
var build_exports = {};
|
|
25
35
|
__export(build_exports, {
|
|
26
36
|
build: () => build
|
|
27
37
|
});
|
|
28
38
|
module.exports = __toCommonJS(build_exports);
|
|
29
|
-
var import_fs_extra = __toESM(require("fs-extra"), 1),
|
|
39
|
+
var import_fs_extra = __toESM(require("fs-extra"), 1),
|
|
40
|
+
import_micromatch = __toESM(require("micromatch"), 1),
|
|
41
|
+
import_module = require("module"),
|
|
42
|
+
import_path = __toESM(require("path"), 1),
|
|
43
|
+
import_vite = require("vite"),
|
|
44
|
+
import_vxrn = require("vxrn"),
|
|
45
|
+
constants = __toESM(require("../constants.native.js"), 1),
|
|
46
|
+
import_setServerGlobals = require("../server/setServerGlobals.native.js"),
|
|
47
|
+
import_toAbsolute = require("../utils/toAbsolute.native.js"),
|
|
48
|
+
import_getManifest = require("../vite/getManifest.native.js"),
|
|
49
|
+
import_loadConfig = require("../vite/loadConfig.native.js"),
|
|
50
|
+
import_one_server_only = require("../vite/one-server-only.native.js"),
|
|
51
|
+
import_buildVercelOutputDirectory = require("../vercel/build/buildVercelOutputDirectory.native.js"),
|
|
52
|
+
import_getRouterRootFromOneOptions = require("../utils/getRouterRootFromOneOptions.native.js"),
|
|
53
|
+
import_buildPage = require("./buildPage.native.js"),
|
|
54
|
+
import_checkNodeVersion = require("./checkNodeVersion.native.js"),
|
|
55
|
+
import_label_process = require("./label-process.native.js"),
|
|
56
|
+
import_getPathnameFromFilePath = require("../utils/getPathnameFromFilePath.native.js");
|
|
30
57
|
const import_meta = {};
|
|
31
|
-
var {
|
|
32
|
-
|
|
33
|
-
|
|
58
|
+
var {
|
|
59
|
+
ensureDir,
|
|
60
|
+
writeJSON
|
|
61
|
+
} = import_fs_extra.default;
|
|
62
|
+
process.on("uncaughtException", function (err) {
|
|
63
|
+
console.error(err?.message || err);
|
|
34
64
|
});
|
|
35
65
|
async function build(args) {
|
|
36
66
|
var _oneOptions_build, _oneOptions_build_server, _oneOptions_build1, _oneOptions_build2, _oneOptions_web;
|
|
37
67
|
process.env.IS_VXRN_CLI = "true", process.env.NODE_ENV = "production", (0, import_label_process.labelProcess)("build"), (0, import_checkNodeVersion.checkNodeVersion)(), (0, import_setServerGlobals.setServerGlobals)();
|
|
38
|
-
var {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
68
|
+
var {
|
|
69
|
+
oneOptions
|
|
70
|
+
} = await (0, import_loadConfig.loadUserOneOptions)("build"),
|
|
71
|
+
routerRoot = (0, import_getRouterRootFromOneOptions.getRouterRootFromOneOptions)(oneOptions),
|
|
72
|
+
routerRootRegexp = new RegExp(`^${routerRoot}`),
|
|
73
|
+
manifest = (0, import_getManifest.getManifest)({
|
|
74
|
+
routerRoot
|
|
75
|
+
}),
|
|
76
|
+
_oneOptions_build_server_outputFormat,
|
|
77
|
+
serverOutputFormat = ((_oneOptions_build = oneOptions.build) === null || _oneOptions_build === void 0 ? void 0 : _oneOptions_build.server) === !1 ? "esm" : (_oneOptions_build_server_outputFormat = (_oneOptions_build1 = oneOptions.build) === null || _oneOptions_build1 === void 0 || (_oneOptions_build_server = _oneOptions_build1.server) === null || _oneOptions_build_server === void 0 ? void 0 : _oneOptions_build_server.outputFormat) !== null && _oneOptions_build_server_outputFormat !== void 0 ? _oneOptions_build_server_outputFormat : "esm",
|
|
78
|
+
vxrnOutput = await (0, import_vxrn.build)({
|
|
79
|
+
server: oneOptions.server,
|
|
80
|
+
build: {
|
|
81
|
+
analyze: !0,
|
|
82
|
+
server: ((_oneOptions_build2 = oneOptions.build) === null || _oneOptions_build2 === void 0 ? void 0 : _oneOptions_build2.server) === !1 ? !1 : {
|
|
83
|
+
outputFormat: serverOutputFormat
|
|
84
|
+
}
|
|
46
85
|
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
return;
|
|
51
|
-
var options = await (0, import_vxrn.fillOptions)(vxrnOutput.options), { optimizeDeps } = (0, import_vxrn.getOptimizeDeps)("build"), apiBuildConfig = (0, import_vite.mergeConfig)(
|
|
52
|
-
// feels like this should build off the *server* build config not web
|
|
53
|
-
vxrnOutput.webBuildConfig,
|
|
86
|
+
}, args);
|
|
87
|
+
if (!vxrnOutput || args.platform !== "web") return;
|
|
88
|
+
var options = await (0, import_vxrn.fillOptions)(vxrnOutput.options),
|
|
54
89
|
{
|
|
90
|
+
optimizeDeps
|
|
91
|
+
} = (0, import_vxrn.getOptimizeDeps)("build"),
|
|
92
|
+
apiBuildConfig = (0, import_vite.mergeConfig)(
|
|
93
|
+
// feels like this should build off the *server* build config not web
|
|
94
|
+
vxrnOutput.webBuildConfig, {
|
|
55
95
|
configFile: !1,
|
|
56
96
|
appType: "custom",
|
|
57
97
|
optimizeDeps
|
|
58
|
-
}
|
|
59
|
-
);
|
|
98
|
+
});
|
|
60
99
|
async function buildCustomRoutes(subFolder, routes) {
|
|
61
|
-
var _oneOptions_build_api,
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
100
|
+
var _oneOptions_build_api,
|
|
101
|
+
_oneOptions_build3,
|
|
102
|
+
_oneOptions_build_api1,
|
|
103
|
+
_oneOptions_build12,
|
|
104
|
+
_oneOptions_build_api2,
|
|
105
|
+
_oneOptions_build22,
|
|
106
|
+
input = routes.reduce(function (entries, param) {
|
|
107
|
+
var {
|
|
108
|
+
page,
|
|
109
|
+
file
|
|
110
|
+
} = param;
|
|
111
|
+
return entries[page.slice(1) + ".js"] = (0, import_path.join)(routerRoot, file), entries;
|
|
112
|
+
}, {}),
|
|
113
|
+
_oneOptions_build_api_outputFormat,
|
|
114
|
+
outputFormat = (_oneOptions_build_api_outputFormat = oneOptions == null || (_oneOptions_build3 = oneOptions.build) === null || _oneOptions_build3 === void 0 || (_oneOptions_build_api = _oneOptions_build3.api) === null || _oneOptions_build_api === void 0 ? void 0 : _oneOptions_build_api.outputFormat) !== null && _oneOptions_build_api_outputFormat !== void 0 ? _oneOptions_build_api_outputFormat : serverOutputFormat,
|
|
115
|
+
treeshake = oneOptions == null || (_oneOptions_build12 = oneOptions.build) === null || _oneOptions_build12 === void 0 || (_oneOptions_build_api1 = _oneOptions_build12.api) === null || _oneOptions_build_api1 === void 0 ? void 0 : _oneOptions_build_api1.treeshake,
|
|
116
|
+
mergedConfig = (0, import_vite.mergeConfig)(apiBuildConfig, {
|
|
117
|
+
appType: "custom",
|
|
118
|
+
configFile: !1,
|
|
119
|
+
// plugins: [
|
|
120
|
+
// nodeExternals({
|
|
121
|
+
// exclude: optimizeDeps.include,
|
|
122
|
+
// }) as any,
|
|
123
|
+
// ],
|
|
124
|
+
define: {
|
|
125
|
+
...vxrnOutput.processEnvDefines
|
|
126
|
+
},
|
|
127
|
+
ssr: {
|
|
128
|
+
noExternal: !0,
|
|
129
|
+
external: ["react", "react-dom"],
|
|
130
|
+
optimizeDeps
|
|
131
|
+
},
|
|
132
|
+
build: {
|
|
133
|
+
ssr: !0,
|
|
134
|
+
emptyOutDir: !1,
|
|
135
|
+
outDir: `dist/${subFolder}`,
|
|
136
|
+
copyPublicDir: !1,
|
|
137
|
+
minify: !1,
|
|
138
|
+
rollupOptions: {
|
|
139
|
+
treeshake: treeshake ?? {
|
|
140
|
+
moduleSideEffects: !1
|
|
141
|
+
},
|
|
142
|
+
plugins: [
|
|
94
143
|
// otherwise rollup is leaving commonjs-only top level imports...
|
|
95
|
-
outputFormat === "esm" ? import_vxrn.rollupRemoveUnusedImportsPlugin : null
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
144
|
+
outputFormat === "esm" ? import_vxrn.rollupRemoveUnusedImportsPlugin : null].filter(Boolean),
|
|
145
|
+
// too many issues
|
|
146
|
+
// treeshake: {
|
|
147
|
+
// moduleSideEffects: false,
|
|
148
|
+
// },
|
|
149
|
+
// prevents it from shaking out the exports
|
|
150
|
+
preserveEntrySignatures: "strict",
|
|
151
|
+
input,
|
|
152
|
+
external: function (id) {
|
|
153
|
+
return !1;
|
|
154
|
+
},
|
|
155
|
+
output: {
|
|
156
|
+
entryFileNames: "[name]",
|
|
157
|
+
exports: "auto",
|
|
158
|
+
...(outputFormat === "esm" ? {
|
|
159
|
+
format: "esm",
|
|
160
|
+
esModule: !0
|
|
161
|
+
} : {
|
|
162
|
+
format: "cjs",
|
|
163
|
+
// Preserve folder structure and use .cjs extension
|
|
164
|
+
entryFileNames: function (chunkInfo) {
|
|
165
|
+
var name = chunkInfo.name.replace(/\.js$/, ".cjs");
|
|
166
|
+
return name;
|
|
167
|
+
},
|
|
168
|
+
chunkFileNames: function (chunkInfo) {
|
|
169
|
+
var dir = import_path.default.dirname(chunkInfo.name),
|
|
170
|
+
name = import_path.default.basename(chunkInfo.name, import_path.default.extname(chunkInfo.name));
|
|
171
|
+
return import_path.default.join(dir, `${name}-[hash].cjs`);
|
|
172
|
+
},
|
|
173
|
+
assetFileNames: function (assetInfo) {
|
|
174
|
+
var _assetInfo_name,
|
|
175
|
+
name = (_assetInfo_name = assetInfo.name) !== null && _assetInfo_name !== void 0 ? _assetInfo_name : "",
|
|
176
|
+
dir = import_path.default.dirname(name),
|
|
177
|
+
baseName = import_path.default.basename(name, import_path.default.extname(name)),
|
|
178
|
+
ext = import_path.default.extname(name);
|
|
179
|
+
return import_path.default.join(dir, `${baseName}-[hash]${ext}`);
|
|
180
|
+
}
|
|
181
|
+
})
|
|
128
182
|
}
|
|
129
183
|
}
|
|
130
184
|
}
|
|
131
|
-
}
|
|
132
|
-
|
|
185
|
+
}),
|
|
186
|
+
userApiBuildConf = (_oneOptions_build22 = oneOptions.build) === null || _oneOptions_build22 === void 0 || (_oneOptions_build_api2 = _oneOptions_build22.api) === null || _oneOptions_build_api2 === void 0 ? void 0 : _oneOptions_build_api2.config,
|
|
187
|
+
finalApiBuildConf = userApiBuildConf ? (0, import_vite.mergeConfig)(mergedConfig, userApiBuildConf) : mergedConfig,
|
|
188
|
+
output = await (0, import_vite.build)(
|
|
133
189
|
// allow user merging api build config
|
|
134
|
-
finalApiBuildConf
|
|
135
|
-
);
|
|
190
|
+
finalApiBuildConf);
|
|
136
191
|
return output;
|
|
137
192
|
}
|
|
138
193
|
var apiOutput = null;
|
|
@@ -144,139 +199,142 @@ async function build(args) {
|
|
|
144
199
|
console.info(`
|
|
145
200
|
\u{1F528} build middlewares
|
|
146
201
|
`);
|
|
147
|
-
var middlewareBuildInfo = await buildCustomRoutes("middlewares", manifest.middlewareRoutes),
|
|
202
|
+
var middlewareBuildInfo = await buildCustomRoutes("middlewares", manifest.middlewareRoutes),
|
|
203
|
+
_iteratorNormalCompletion = !0,
|
|
204
|
+
_didIteratorError = !1,
|
|
205
|
+
_iteratorError = void 0;
|
|
148
206
|
try {
|
|
149
|
-
for (var _loop = function() {
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
207
|
+
for (var _loop = function () {
|
|
208
|
+
var middleware = _step.value,
|
|
209
|
+
absoluteRoot = (0, import_path.resolve)(process.cwd(), options.root),
|
|
210
|
+
fullPath = (0, import_path.join)(absoluteRoot, routerRoot, middleware.file),
|
|
211
|
+
outChunks = middlewareBuildInfo.output.filter(function (x) {
|
|
212
|
+
return x.type === "chunk";
|
|
213
|
+
}),
|
|
214
|
+
chunk = outChunks.find(function (x) {
|
|
215
|
+
return x.facadeModuleId === fullPath;
|
|
216
|
+
});
|
|
217
|
+
if (!chunk) throw new Error("internal err finding middleware");
|
|
218
|
+
builtMiddlewares[middleware.file] = (0, import_path.join)("dist", "middlewares", chunk.fileName);
|
|
219
|
+
}, _iterator = manifest.middlewareRoutes[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) _loop();
|
|
158
220
|
} catch (err) {
|
|
159
221
|
_didIteratorError = !0, _iteratorError = err;
|
|
160
222
|
} finally {
|
|
161
223
|
try {
|
|
162
224
|
!_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
|
|
163
225
|
} finally {
|
|
164
|
-
if (_didIteratorError)
|
|
165
|
-
throw _iteratorError;
|
|
226
|
+
if (_didIteratorError) throw _iteratorError;
|
|
166
227
|
}
|
|
167
228
|
}
|
|
168
229
|
}
|
|
169
|
-
globalThis.require = (0,
|
|
170
|
-
var assets = [],
|
|
230
|
+
globalThis.require = (0, import_module.createRequire)((0, import_path.join)(import_meta.url, ".."));
|
|
231
|
+
var assets = [],
|
|
232
|
+
builtRoutes = [];
|
|
171
233
|
console.info(`
|
|
172
234
|
\u{1F528} build static routes
|
|
173
235
|
`);
|
|
174
|
-
var staticDir = (0,
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
var outputEntries = [
|
|
178
|
-
|
|
179
|
-
|
|
236
|
+
var staticDir = (0, import_path.join)("dist/static"),
|
|
237
|
+
clientDir = (0, import_path.join)("dist/client");
|
|
238
|
+
if (await ensureDir(staticDir), !vxrnOutput.serverOutput) throw new Error("No server output");
|
|
239
|
+
var outputEntries = [...vxrnOutput.serverOutput.entries()],
|
|
240
|
+
_iteratorNormalCompletion1 = !0,
|
|
241
|
+
_didIteratorError1 = !1,
|
|
242
|
+
_iteratorError1 = void 0;
|
|
180
243
|
try {
|
|
181
|
-
for (var _loop1 = async function() {
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
244
|
+
for (var _loop1 = async function () {
|
|
245
|
+
var [index, output] = _step1.value,
|
|
246
|
+
_vxrnOutput_buildArgs,
|
|
247
|
+
_foundRoute_layouts,
|
|
248
|
+
_exported_generateStaticParams;
|
|
249
|
+
if (output.type === "asset") return assets.push(output), "continue";
|
|
250
|
+
var id = output.facadeModuleId || "",
|
|
251
|
+
file = import_path.default.basename(id);
|
|
252
|
+
if (!id || file[0] === "_" || file.includes("entry-server") || id.includes("+api") || !id.includes(`/${routerRoot}/`)) return "continue";
|
|
253
|
+
var relativeId = (0, import_path.relative)(process.cwd(), id).replace(`${routerRoot}/`, "/"),
|
|
254
|
+
onlyBuild = (_vxrnOutput_buildArgs = vxrnOutput.buildArgs) === null || _vxrnOutput_buildArgs === void 0 ? void 0 : _vxrnOutput_buildArgs.only;
|
|
255
|
+
if (onlyBuild && !import_micromatch.default.contains(relativeId, onlyBuild)) return "continue";
|
|
256
|
+
var clientManifestKey = Object.keys(vxrnOutput.clientManifest).find(function (key) {
|
|
257
|
+
return id.endsWith(key);
|
|
258
|
+
}) || "";
|
|
259
|
+
if (!clientManifestKey) return "continue";
|
|
260
|
+
var clientManifestEntry = vxrnOutput.clientManifest[clientManifestKey],
|
|
261
|
+
foundRoute = manifest.pageRoutes.find(function (route2) {
|
|
262
|
+
return route2.file && clientManifestKey.replace(routerRootRegexp, "") === route2.file.slice(1);
|
|
263
|
+
});
|
|
264
|
+
if (!foundRoute) return "continue";
|
|
265
|
+
foundRoute.loaderServerPath = output.fileName;
|
|
266
|
+
function collectImports(param) {
|
|
267
|
+
var {
|
|
268
|
+
imports = [],
|
|
269
|
+
css
|
|
270
|
+
} = param,
|
|
271
|
+
{
|
|
272
|
+
type = "js"
|
|
273
|
+
} = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
274
|
+
return [...new Set([...(type === "js" ? imports : css || []), ...imports.flatMap(function (name) {
|
|
275
|
+
var found = vxrnOutput.clientManifest[name];
|
|
276
|
+
return found || console.warn("No found imports", name, vxrnOutput.clientManifest), collectImports(found, {
|
|
277
|
+
type
|
|
278
|
+
});
|
|
279
|
+
})].flat().filter(function (x) {
|
|
214
280
|
return x && (type === "css" || x.endsWith(".js"));
|
|
215
|
-
}).map(function(x) {
|
|
281
|
+
}).map(function (x) {
|
|
216
282
|
return type === "css" || x.startsWith("assets/") ? x : `assets/${x.slice(1)}`;
|
|
217
|
-
}))
|
|
218
|
-
];
|
|
219
|
-
}
|
|
220
|
-
clientManifestEntry || console.warn(`No client manifest entry found: ${clientManifestKey} in manifest ${JSON.stringify(vxrnOutput.clientManifest, null, 2)}`);
|
|
221
|
-
var entryImports = collectImports(clientManifestEntry || {}), _foundRoute_layouts_flatMap, layoutEntries = (_foundRoute_layouts_flatMap = (_foundRoute_layouts = foundRoute.layouts) === null || _foundRoute_layouts === void 0 ? void 0 : _foundRoute_layouts.flatMap(function(layout) {
|
|
222
|
-
var clientKey = `${routerRoot}${layout.contextKey.slice(1)}`, found = vxrnOutput.clientManifest[clientKey];
|
|
223
|
-
return found || [];
|
|
224
|
-
})) !== null && _foundRoute_layouts_flatMap !== void 0 ? _foundRoute_layouts_flatMap : [], layoutImports = layoutEntries.flatMap(function(entry) {
|
|
225
|
-
return [
|
|
226
|
-
entry.file,
|
|
227
|
-
...collectImports(entry)
|
|
228
|
-
];
|
|
229
|
-
}), preloadSetupFilePreloads = function() {
|
|
230
|
-
if (oneOptions.setupFile) {
|
|
231
|
-
var needle = oneOptions.setupFile.replace(/^\.\//, "");
|
|
232
|
-
for (var file2 in vxrnOutput.clientManifest)
|
|
233
|
-
if (file2 === needle) {
|
|
234
|
-
var entry = vxrnOutput.clientManifest[file2];
|
|
235
|
-
return [
|
|
236
|
-
entry.file
|
|
237
|
-
];
|
|
238
|
-
}
|
|
283
|
+
}))];
|
|
239
284
|
}
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
285
|
+
clientManifestEntry || console.warn(`No client manifest entry found: ${clientManifestKey} in manifest ${JSON.stringify(vxrnOutput.clientManifest, null, 2)}`);
|
|
286
|
+
var entryImports = collectImports(clientManifestEntry || {}),
|
|
287
|
+
_foundRoute_layouts_flatMap,
|
|
288
|
+
layoutEntries = (_foundRoute_layouts_flatMap = (_foundRoute_layouts = foundRoute.layouts) === null || _foundRoute_layouts === void 0 ? void 0 : _foundRoute_layouts.flatMap(function (layout) {
|
|
289
|
+
var clientKey = `${routerRoot}${layout.contextKey.slice(1)}`,
|
|
290
|
+
found = vxrnOutput.clientManifest[clientKey];
|
|
291
|
+
return found || [];
|
|
292
|
+
})) !== null && _foundRoute_layouts_flatMap !== void 0 ? _foundRoute_layouts_flatMap : [],
|
|
293
|
+
layoutImports = layoutEntries.flatMap(function (entry) {
|
|
294
|
+
return [entry.file, ...collectImports(entry)];
|
|
295
|
+
}),
|
|
296
|
+
preloadSetupFilePreloads = function () {
|
|
297
|
+
if (oneOptions.setupFile) {
|
|
298
|
+
var needle = oneOptions.setupFile.replace(/^\.\//, "");
|
|
299
|
+
for (var file2 in vxrnOutput.clientManifest) if (file2 === needle) {
|
|
300
|
+
var entry = vxrnOutput.clientManifest[file2];
|
|
301
|
+
return [entry.file];
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
return [];
|
|
305
|
+
}(),
|
|
306
|
+
preloads2 = [... /* @__PURE__ */new Set([...preloadSetupFilePreloads,
|
|
244
307
|
// add the route entry js (like ./app/index.ts)
|
|
245
308
|
clientManifestEntry.file,
|
|
246
309
|
// add the virtual entry
|
|
247
|
-
vxrnOutput.clientManifest["virtual:one-entry"].file,
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
process.env.DEBUG && console.info("[one] building routes", {
|
|
264
|
-
foundRoute,
|
|
265
|
-
layoutEntries,
|
|
266
|
-
allEntries,
|
|
267
|
-
allCSS
|
|
268
|
-
});
|
|
269
|
-
var serverJsPath = (0, import_node_path.join)("dist/server", output.fileName), exported = void 0;
|
|
270
|
-
try {
|
|
271
|
-
exported = await import((0, import_toAbsolute.toAbsolute)(serverJsPath));
|
|
272
|
-
} catch (err) {
|
|
273
|
-
throw console.error("Error importing page (original error)", err), new Error(`Error importing page: ${serverJsPath}`, {
|
|
274
|
-
cause: err
|
|
310
|
+
vxrnOutput.clientManifest["virtual:one-entry"].file, ...entryImports, ...layoutImports])].map(function (path) {
|
|
311
|
+
return `/${path}`;
|
|
312
|
+
}),
|
|
313
|
+
allEntries = [clientManifestEntry, ...layoutEntries],
|
|
314
|
+
allCSS = allEntries.flatMap(function (entry) {
|
|
315
|
+
return collectImports(entry, {
|
|
316
|
+
type: "css"
|
|
317
|
+
});
|
|
318
|
+
}).map(function (path) {
|
|
319
|
+
return `/${path}`;
|
|
320
|
+
});
|
|
321
|
+
process.env.DEBUG && console.info("[one] building routes", {
|
|
322
|
+
foundRoute,
|
|
323
|
+
layoutEntries,
|
|
324
|
+
allEntries,
|
|
325
|
+
allCSS
|
|
275
326
|
});
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
327
|
+
var serverJsPath = (0, import_path.join)("dist/server", output.fileName),
|
|
328
|
+
exported = void 0;
|
|
329
|
+
try {
|
|
330
|
+
exported = await import((0, import_toAbsolute.toAbsolute)(serverJsPath));
|
|
331
|
+
} catch (err) {
|
|
332
|
+
throw console.error("Error importing page (original error)", err), new Error(`Error importing page: ${serverJsPath}`, {
|
|
333
|
+
cause: err
|
|
334
|
+
});
|
|
335
|
+
}
|
|
336
|
+
var isDynamic = !!Object.keys(foundRoute.routeKeys).length;
|
|
337
|
+
if (foundRoute.type === "ssg" && isDynamic && !foundRoute.page.includes("+not-found") && !foundRoute.page.includes("_sitemap") && !exported.generateStaticParams) throw new Error(`[one] Error: Missing generateStaticParams
|
|
280
338
|
|
|
281
339
|
Route ${foundRoute.page} of type ${foundRoute.type} must export generateStaticParams so build can complete.
|
|
282
340
|
|
|
@@ -284,48 +342,55 @@ async function build(args) {
|
|
|
284
342
|
https://onestack.dev/docs/routing-exports#generatestaticparams
|
|
285
343
|
|
|
286
344
|
`);
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
console.info(`
|
|
345
|
+
var _ref,
|
|
346
|
+
paramsList = (_ref = await ((_exported_generateStaticParams = exported.generateStaticParams) === null || _exported_generateStaticParams === void 0 ? void 0 : _exported_generateStaticParams.call(exported))) !== null && _ref !== void 0 ? _ref : [{}];
|
|
347
|
+
console.info(`
|
|
291
348
|
[build] page ${relativeId} (with ${paramsList.length} routes)
|
|
292
349
|
`), process.env.DEBUG && console.info("paramsList", JSON.stringify(paramsList, null, 2));
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
var params = _step4.value, path = (0, import_getPathnameFromFilePath.getPathnameFromFilePath)(relativeId, params, foundRoute.type === "ssg");
|
|
297
|
-
console.info(` \u21A6 route ${path}`);
|
|
298
|
-
var built = await (0, import_one_server_only.runWithAsyncLocalContext)(async function() {
|
|
299
|
-
return await (0, import_buildPage.buildPage)(vxrnOutput.serverEntry, path, relativeId, params, foundRoute, clientManifestEntry, staticDir, clientDir, builtMiddlewares, serverJsPath, preloads2, allCSS);
|
|
300
|
-
});
|
|
301
|
-
builtRoutes.push(built);
|
|
302
|
-
}, _iterator4 = paramsList[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = !0) await _loop2();
|
|
303
|
-
} catch (err) {
|
|
304
|
-
_didIteratorError4 = !0, _iteratorError4 = err;
|
|
305
|
-
} finally {
|
|
350
|
+
var _iteratorNormalCompletion4 = !0,
|
|
351
|
+
_didIteratorError4 = !1,
|
|
352
|
+
_iteratorError4 = void 0;
|
|
306
353
|
try {
|
|
307
|
-
|
|
354
|
+
for (var _loop2 = async function () {
|
|
355
|
+
var params = _step4.value,
|
|
356
|
+
path = (0, import_getPathnameFromFilePath.getPathnameFromFilePath)(relativeId, params, foundRoute.type === "ssg");
|
|
357
|
+
console.info(` \u21A6 route ${path}`);
|
|
358
|
+
var built = await (0, import_one_server_only.runWithAsyncLocalContext)(async function () {
|
|
359
|
+
return await (0, import_buildPage.buildPage)(vxrnOutput.serverEntry, path, relativeId, params, foundRoute, clientManifestEntry, staticDir, clientDir, builtMiddlewares, serverJsPath, preloads2, allCSS);
|
|
360
|
+
});
|
|
361
|
+
builtRoutes.push(built);
|
|
362
|
+
}, _iterator4 = paramsList[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = !0) await _loop2();
|
|
363
|
+
} catch (err) {
|
|
364
|
+
_didIteratorError4 = !0, _iteratorError4 = err;
|
|
308
365
|
} finally {
|
|
309
|
-
|
|
310
|
-
|
|
366
|
+
try {
|
|
367
|
+
!_iteratorNormalCompletion4 && _iterator4.return != null && _iterator4.return();
|
|
368
|
+
} finally {
|
|
369
|
+
if (_didIteratorError4) throw _iteratorError4;
|
|
370
|
+
}
|
|
311
371
|
}
|
|
312
|
-
}
|
|
313
|
-
}, _iterator1 = outputEntries[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = !0) await _loop1();
|
|
372
|
+
}, _iterator1 = outputEntries[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = !0) await _loop1();
|
|
314
373
|
} catch (err) {
|
|
315
374
|
_didIteratorError1 = !0, _iteratorError1 = err;
|
|
316
375
|
} finally {
|
|
317
376
|
try {
|
|
318
377
|
!_iteratorNormalCompletion1 && _iterator1.return != null && _iterator1.return();
|
|
319
378
|
} finally {
|
|
320
|
-
if (_didIteratorError1)
|
|
321
|
-
throw _iteratorError1;
|
|
379
|
+
if (_didIteratorError1) throw _iteratorError1;
|
|
322
380
|
}
|
|
323
381
|
}
|
|
324
382
|
await moveAllFiles(staticDir, clientDir), await import_fs_extra.default.rm(staticDir, {
|
|
325
383
|
force: !0,
|
|
326
384
|
recursive: !0
|
|
327
385
|
});
|
|
328
|
-
var routeMap = {},
|
|
386
|
+
var routeMap = {},
|
|
387
|
+
routeToBuildInfo = {},
|
|
388
|
+
pathToRoute = {},
|
|
389
|
+
preloads = {},
|
|
390
|
+
loaders = {},
|
|
391
|
+
_iteratorNormalCompletion2 = !0,
|
|
392
|
+
_didIteratorError2 = !1,
|
|
393
|
+
_iteratorError2 = void 0;
|
|
329
394
|
try {
|
|
330
395
|
for (var _iterator2 = builtRoutes[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = !0) {
|
|
331
396
|
var route = _step2.value;
|
|
@@ -336,12 +401,11 @@ async function build(args) {
|
|
|
336
401
|
...rest
|
|
337
402
|
} = route;
|
|
338
403
|
routeToBuildInfo[route.routeFile] = rest;
|
|
339
|
-
var _iteratorNormalCompletion3 = !0,
|
|
404
|
+
var _iteratorNormalCompletion3 = !0,
|
|
405
|
+
_didIteratorError3 = !1,
|
|
406
|
+
_iteratorError3 = void 0;
|
|
340
407
|
try {
|
|
341
|
-
for (var _iterator3 = getCleanPaths([
|
|
342
|
-
route.path,
|
|
343
|
-
route.cleanPath
|
|
344
|
-
])[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = !0) {
|
|
408
|
+
for (var _iterator3 = getCleanPaths([route.path, route.cleanPath])[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = !0) {
|
|
345
409
|
var p = _step3.value;
|
|
346
410
|
pathToRoute[p] = route.routeFile;
|
|
347
411
|
}
|
|
@@ -351,8 +415,7 @@ async function build(args) {
|
|
|
351
415
|
try {
|
|
352
416
|
!_iteratorNormalCompletion3 && _iterator3.return != null && _iterator3.return();
|
|
353
417
|
} finally {
|
|
354
|
-
if (_didIteratorError3)
|
|
355
|
-
throw _iteratorError3;
|
|
418
|
+
if (_didIteratorError3) throw _iteratorError3;
|
|
356
419
|
}
|
|
357
420
|
}
|
|
358
421
|
preloads[route.preloadPath] = !0, loaders[route.loaderPath] = !0;
|
|
@@ -363,16 +426,21 @@ async function build(args) {
|
|
|
363
426
|
try {
|
|
364
427
|
!_iteratorNormalCompletion2 && _iterator2.return != null && _iterator2.return();
|
|
365
428
|
} finally {
|
|
366
|
-
if (_didIteratorError2)
|
|
367
|
-
throw _iteratorError2;
|
|
429
|
+
if (_didIteratorError2) throw _iteratorError2;
|
|
368
430
|
}
|
|
369
431
|
}
|
|
370
432
|
function createBuildManifestRoute(route2) {
|
|
371
|
-
var {
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
433
|
+
var {
|
|
434
|
+
layouts,
|
|
435
|
+
...built
|
|
436
|
+
} = route2,
|
|
437
|
+
buildInfo = builtRoutes.find(function (x) {
|
|
438
|
+
return x.routeFile === route2.file;
|
|
439
|
+
});
|
|
440
|
+
if (built.middlewares && buildInfo?.middlewares) {
|
|
441
|
+
var _iteratorNormalCompletion4 = !0,
|
|
442
|
+
_didIteratorError4 = !1,
|
|
443
|
+
_iteratorError4 = void 0;
|
|
376
444
|
try {
|
|
377
445
|
for (var _iterator4 = built.middlewares.entries()[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = !0) {
|
|
378
446
|
var [index, mw] = _step4.value;
|
|
@@ -384,8 +452,7 @@ async function build(args) {
|
|
|
384
452
|
try {
|
|
385
453
|
!_iteratorNormalCompletion4 && _iterator4.return != null && _iterator4.return();
|
|
386
454
|
} finally {
|
|
387
|
-
if (_didIteratorError4)
|
|
388
|
-
throw _iteratorError4;
|
|
455
|
+
if (_didIteratorError4) throw _iteratorError4;
|
|
389
456
|
}
|
|
390
457
|
}
|
|
391
458
|
}
|
|
@@ -408,22 +475,24 @@ async function build(args) {
|
|
|
408
475
|
loaders
|
|
409
476
|
};
|
|
410
477
|
await writeJSON((0, import_toAbsolute.toAbsolute)("dist/buildInfo.json"), buildInfoForWriting);
|
|
411
|
-
var postBuildLogs = [],
|
|
478
|
+
var postBuildLogs = [],
|
|
479
|
+
platform = (_oneOptions_web = oneOptions.web) === null || _oneOptions_web === void 0 ? void 0 : _oneOptions_web.deploy;
|
|
412
480
|
switch (platform && postBuildLogs.push(`[one.build] platform ${platform}`), platform) {
|
|
413
|
-
case "vercel":
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
481
|
+
case "vercel":
|
|
482
|
+
{
|
|
483
|
+
await (0, import_buildVercelOutputDirectory.buildVercelOutputDirectory)({
|
|
484
|
+
apiOutput,
|
|
485
|
+
buildInfoForWriting,
|
|
486
|
+
clientDir,
|
|
487
|
+
oneOptionsRoot: options.root,
|
|
488
|
+
postBuildLogs
|
|
489
|
+
});
|
|
490
|
+
break;
|
|
491
|
+
}
|
|
423
492
|
}
|
|
424
493
|
process.env.VXRN_ANALYZE_BUNDLE && postBuildLogs.push(`client build report: ${(0, import_toAbsolute.toAbsolute)("dist/report.html")}`), postBuildLogs.length && (console.info(`
|
|
425
494
|
|
|
426
|
-
`), postBuildLogs.forEach(function(log) {
|
|
495
|
+
`), postBuildLogs.forEach(function (log) {
|
|
427
496
|
console.info(` \xB7 ${log}`);
|
|
428
497
|
})), console.info(`
|
|
429
498
|
|
|
@@ -433,10 +502,8 @@ async function build(args) {
|
|
|
433
502
|
}
|
|
434
503
|
var TRAILING_INDEX_REGEX = /\/index(\.(web))?/;
|
|
435
504
|
function getCleanPaths(possiblePaths) {
|
|
436
|
-
return Array.from(new Set(Array.from(new Set(possiblePaths)).flatMap(function(p) {
|
|
437
|
-
var paths = [
|
|
438
|
-
p
|
|
439
|
-
];
|
|
505
|
+
return Array.from(new Set(Array.from(new Set(possiblePaths)).flatMap(function (p) {
|
|
506
|
+
var paths = [p];
|
|
440
507
|
if (p.match(TRAILING_INDEX_REGEX)) {
|
|
441
508
|
var pathWithTrailingIndexRemoved = p.replace(TRAILING_INDEX_REGEX, "");
|
|
442
509
|
paths.push(pathWithTrailingIndexRemoved), paths.push(pathWithTrailingIndexRemoved + "/");
|
|
@@ -454,8 +521,4 @@ async function moveAllFiles(src, dest) {
|
|
|
454
521
|
console.error("Error moving files:", err);
|
|
455
522
|
}
|
|
456
523
|
}
|
|
457
|
-
|
|
458
|
-
0 && (module.exports = {
|
|
459
|
-
build
|
|
460
|
-
});
|
|
461
|
-
//# sourceMappingURL=build.js.map
|
|
524
|
+
//# sourceMappingURL=build.native.js.map
|