one 1.1.297 → 1.1.299
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/Root.js.map +1 -1
- package/dist/cjs/Root.native.js.map +1 -1
- package/dist/cjs/cleanUrl.js +9 -2
- package/dist/cjs/cleanUrl.js.map +1 -1
- package/dist/cjs/cleanUrl.native.js +5 -2
- package/dist/cjs/cleanUrl.native.js.map +2 -2
- package/dist/cjs/vite/replaceLoader.js +7 -1
- package/dist/cjs/vite/replaceLoader.js.map +1 -1
- package/dist/cjs/vite/replaceLoader.native.js +7 -1
- package/dist/cjs/vite/replaceLoader.native.js.map +1 -1
- package/dist/esm/Root.js.map +1 -1
- package/dist/esm/Root.mjs.map +1 -1
- package/dist/esm/Root.native.js +110 -104
- package/dist/esm/Root.native.js.map +6 -1
- package/dist/esm/Route.native.js +12 -10
- package/dist/esm/Route.native.js.map +6 -1
- package/dist/esm/cleanUrl.js +9 -2
- package/dist/esm/cleanUrl.js.map +1 -1
- package/dist/esm/cleanUrl.mjs +7 -2
- package/dist/esm/cleanUrl.mjs.map +1 -1
- package/dist/esm/cleanUrl.native.js +16 -13
- package/dist/esm/cleanUrl.native.js.map +6 -1
- package/dist/esm/cli/label-process.native.js +5 -4
- package/dist/esm/cli/label-process.native.js.map +6 -1
- package/dist/esm/cli/main.native.js +8 -13
- package/dist/esm/cli/main.native.js.map +6 -1
- package/dist/esm/cli/prebuild.native.js +5 -5
- package/dist/esm/cli/prebuild.native.js.map +6 -1
- package/dist/esm/cli/run.native.js +21 -28
- package/dist/esm/cli/run.native.js.map +6 -1
- package/dist/esm/cli.native.js +119 -148
- package/dist/esm/cli.native.js.map +6 -1
- package/dist/esm/clientLoaderResolver.native.js +9 -6
- package/dist/esm/clientLoaderResolver.native.js.map +6 -1
- package/dist/esm/config.native.js +12 -11
- package/dist/esm/config.native.js.map +6 -1
- package/dist/esm/constants.native.js +7 -5
- package/dist/esm/constants.native.js.map +6 -1
- package/dist/esm/createApp.native.js +13 -9
- package/dist/esm/createApp.native.js.map +6 -1
- package/dist/esm/createHandleRequest.native.js +55 -64
- package/dist/esm/createHandleRequest.native.js.map +6 -1
- package/dist/esm/createRoute.native.js +16 -16
- package/dist/esm/createRoute.native.js.map +6 -1
- package/dist/esm/fallbackViews/Sitemap.native.js +6 -3
- package/dist/esm/fallbackViews/Sitemap.native.js.map +6 -1
- package/dist/esm/fallbackViews/Unmatched.native.js +5 -3
- package/dist/esm/fallbackViews/Unmatched.native.js.map +6 -1
- package/dist/esm/fork/NavigationContainer.native.js +24 -31
- package/dist/esm/fork/NavigationContainer.native.js.map +6 -1
- package/dist/esm/fork/createMemoryHistory.native.js +99 -115
- package/dist/esm/fork/createMemoryHistory.native.js.map +6 -1
- package/dist/esm/fork/extractPathFromURL.native.js +16 -15
- package/dist/esm/fork/extractPathFromURL.native.js.map +6 -1
- package/dist/esm/fork/findFocusedRoute.native.js +6 -5
- package/dist/esm/fork/findFocusedRoute.native.js.map +6 -1
- package/dist/esm/fork/getPathFromState.native.js +127 -140
- package/dist/esm/fork/getPathFromState.native.js.map +6 -1
- package/dist/esm/fork/getStateFromPath.native.js +292 -288
- package/dist/esm/fork/getStateFromPath.native.js.map +6 -1
- package/dist/esm/fork/useLinking.native.js +70 -61
- package/dist/esm/fork/useLinking.native.js.map +6 -1
- package/dist/esm/fork/validatePathConfig.native.js +15 -9
- package/dist/esm/fork/validatePathConfig.native.js.map +6 -1
- package/dist/esm/getLinkingConfig.native.js +11 -6
- package/dist/esm/getLinkingConfig.native.js.map +6 -1
- package/dist/esm/getReactNavigationConfig.native.js +28 -20
- package/dist/esm/getReactNavigationConfig.native.js.map +6 -1
- package/dist/esm/getRoutes.native.js +249 -229
- package/dist/esm/getRoutes.native.js.map +6 -1
- package/dist/esm/getURL.native.js +4 -4
- package/dist/esm/getURL.native.js.map +6 -1
- package/dist/esm/head/Head.android.js +5 -3
- package/dist/esm/head/Head.android.js.map +6 -1
- package/dist/esm/head/Head.ios.js +144 -132
- package/dist/esm/head/Head.ios.js.map +6 -1
- package/dist/esm/head/Head.native.js +7 -7
- package/dist/esm/head/Head.native.js.map +6 -1
- package/dist/esm/head/HeadModule.native.js +6 -6
- package/dist/esm/head/HeadModule.native.js.map +6 -1
- package/dist/esm/head/index.native.js +2 -2
- package/dist/esm/head/index.native.js.map +6 -1
- package/dist/esm/head/types.native.js +1 -2
- package/dist/esm/head/types.native.js.map +6 -1
- package/dist/esm/head/url.native.js +10 -8
- package/dist/esm/head/url.native.js.map +6 -1
- package/dist/esm/hooks.native.js +53 -34
- package/dist/esm/hooks.native.js.map +6 -1
- package/dist/esm/imperative-api.native.js +9 -6
- package/dist/esm/imperative-api.native.js.map +6 -1
- package/dist/esm/import-mode/index.android.js +4 -3
- package/dist/esm/import-mode/index.android.js.map +6 -1
- package/dist/esm/import-mode/index.ios.js +4 -3
- package/dist/esm/import-mode/index.ios.js.map +6 -1
- package/dist/esm/import-mode/index.native.js +3 -1
- package/dist/esm/import-mode/index.native.js.map +6 -1
- package/dist/esm/index.native.js +65 -27
- package/dist/esm/index.native.js.map +6 -1
- package/dist/esm/interfaces/router.native.js +4 -2
- package/dist/esm/interfaces/router.native.js.map +6 -1
- package/dist/esm/layouts/Drawer.native.js +7 -6
- package/dist/esm/layouts/Drawer.native.js.map +6 -1
- package/dist/esm/layouts/Stack.native.js +7 -6
- package/dist/esm/layouts/Stack.native.js.map +6 -1
- package/dist/esm/layouts/Tabs.native.js +42 -39
- package/dist/esm/layouts/Tabs.native.js.map +6 -1
- package/dist/esm/layouts/withLayoutContext.native.js +51 -48
- package/dist/esm/layouts/withLayoutContext.native.js.map +6 -1
- package/dist/esm/link/Link.native.js +62 -53
- package/dist/esm/link/Link.native.js.map +6 -1
- package/dist/esm/link/Redirect.native.js +8 -9
- package/dist/esm/link/Redirect.native.js.map +6 -1
- package/dist/esm/link/href.native.js +28 -27
- package/dist/esm/link/href.native.js.map +6 -1
- package/dist/esm/link/linking.native.js +51 -40
- package/dist/esm/link/linking.native.js.map +6 -1
- package/dist/esm/link/path.native.js +28 -19
- package/dist/esm/link/path.native.js.map +6 -1
- package/dist/esm/link/useLinkTo.native.js +22 -20
- package/dist/esm/link/useLinkTo.native.js.map +6 -1
- package/dist/esm/link/useLoadedNavigation.native.js +30 -23
- package/dist/esm/link/useLoadedNavigation.native.js.map +6 -1
- package/dist/esm/matchers.native.js +16 -3
- package/dist/esm/matchers.native.js.map +6 -1
- package/dist/esm/platform.native.js +4 -2
- package/dist/esm/platform.native.js.map +6 -1
- package/dist/esm/polyfills-mobile.native.js +4 -5
- package/dist/esm/polyfills-mobile.native.js.map +6 -1
- package/dist/esm/polyfills-server.native.js +1 -1
- package/dist/esm/polyfills-server.native.js.map +6 -1
- package/dist/esm/render.native.js +3 -1
- package/dist/esm/render.native.js.map +6 -1
- package/dist/esm/router/RouterStore.native.js +1 -2
- package/dist/esm/router/RouterStore.native.js.map +6 -1
- package/dist/esm/router/constants.native.js +4 -2
- package/dist/esm/router/constants.native.js.map +6 -1
- package/dist/esm/router/getNormalizedStatePath.native.js +18 -17
- package/dist/esm/router/getNormalizedStatePath.native.js.map +6 -1
- package/dist/esm/router/lastAction.native.js +10 -9
- package/dist/esm/router/lastAction.native.js.map +6 -1
- package/dist/esm/router/router.native.js +135 -114
- package/dist/esm/router/router.native.js.map +6 -1
- package/dist/esm/router/serverLocationContext.native.js +4 -2
- package/dist/esm/router/serverLocationContext.native.js.map +6 -1
- package/dist/esm/router/useInitializeOneRouter.native.js +8 -5
- package/dist/esm/router/useInitializeOneRouter.native.js.map +6 -1
- package/dist/esm/serve.native.js +77 -104
- package/dist/esm/serve.native.js.map +6 -1
- package/dist/esm/server/createRoutesManifest.native.js +14 -11
- package/dist/esm/server/createRoutesManifest.native.js.map +6 -1
- package/dist/esm/server/getServerManifest.native.js +61 -67
- package/dist/esm/server/getServerManifest.native.js.map +6 -1
- package/dist/esm/server-render.native.js +9 -10
- package/dist/esm/server-render.native.js.map +6 -1
- package/dist/esm/sortRoutes.native.js +27 -17
- package/dist/esm/sortRoutes.native.js.map +6 -1
- package/dist/esm/typed-routes/generateRouteTypes.native.js +10 -11
- package/dist/esm/typed-routes/generateRouteTypes.native.js.map +6 -1
- package/dist/esm/typed-routes/getTypedRoutesDeclarationFile.native.js +38 -37
- package/dist/esm/typed-routes/getTypedRoutesDeclarationFile.native.js.map +6 -1
- package/dist/esm/types.native.js +1 -2
- package/dist/esm/types.native.js.map +6 -1
- package/dist/esm/useFocusEffect.native.js +25 -22
- package/dist/esm/useFocusEffect.native.js.map +6 -1
- package/dist/esm/useLoader.native.js +50 -50
- package/dist/esm/useLoader.native.js.map +6 -1
- package/dist/esm/useNavigation.native.js +23 -19
- package/dist/esm/useNavigation.native.js.map +6 -1
- package/dist/esm/useScreens.native.js +143 -160
- package/dist/esm/useScreens.native.js.map +6 -1
- package/dist/esm/useViteRoutes.native.js +25 -28
- package/dist/esm/useViteRoutes.native.js.map +6 -1
- package/dist/esm/utils/assertIsReady.native.js +6 -3
- package/dist/esm/utils/assertIsReady.native.js.map +6 -1
- package/dist/esm/utils/dynamicImport.native.js +5 -3
- package/dist/esm/utils/dynamicImport.native.js.map +6 -1
- package/dist/esm/utils/existsAsync.native.js +6 -4
- package/dist/esm/utils/existsAsync.native.js.map +6 -1
- package/dist/esm/utils/getPageExport.native.js +12 -11
- package/dist/esm/utils/getPageExport.native.js.map +6 -1
- package/dist/esm/utils/globDir.native.js +5 -3
- package/dist/esm/utils/globDir.native.js.map +6 -1
- package/dist/esm/utils/hashString.native.js +4 -2
- package/dist/esm/utils/hashString.native.js.map +6 -1
- package/dist/esm/utils/isResponse.native.js +4 -2
- package/dist/esm/utils/isResponse.native.js.map +6 -1
- package/dist/esm/utils/isStatus.native.js +4 -2
- package/dist/esm/utils/isStatus.native.js.map +6 -1
- package/dist/esm/utils/promiseWithResolvers.native.js +7 -7
- package/dist/esm/utils/promiseWithResolvers.native.js.map +6 -1
- package/dist/esm/utils/rand.native.js +5 -3
- package/dist/esm/utils/rand.native.js.map +6 -1
- package/dist/esm/utils/redirect.native.js +7 -5
- package/dist/esm/utils/redirect.native.js.map +6 -1
- package/dist/esm/utils/removeSearch.native.js +4 -2
- package/dist/esm/utils/removeSearch.native.js.map +6 -1
- package/dist/esm/utils/removeUndefined.native.js +6 -3
- package/dist/esm/utils/removeUndefined.native.js.map +6 -1
- package/dist/esm/utils/requireResolve.native.js +4 -2
- package/dist/esm/utils/requireResolve.native.js.map +6 -1
- package/dist/esm/utils/url.native.js +6 -2
- package/dist/esm/utils/url.native.js.map +6 -1
- package/dist/esm/utils/weakKey.native.js +11 -10
- package/dist/esm/utils/weakKey.native.js.map +6 -1
- package/dist/esm/utils/weakMemo.native.js +8 -8
- package/dist/esm/utils/weakMemo.native.js.map +6 -1
- package/dist/esm/views/EmptyRoute.native.js +5 -3
- package/dist/esm/views/EmptyRoute.native.js.map +6 -1
- package/dist/esm/views/ErrorBoundary.native.js +5 -8
- package/dist/esm/views/ErrorBoundary.native.js.map +6 -1
- package/dist/esm/views/LoadProgressBar.native.js +58 -57
- package/dist/esm/views/LoadProgressBar.native.js.map +6 -1
- package/dist/esm/views/Navigator.native.js +54 -71
- package/dist/esm/views/Navigator.native.js.map +6 -1
- package/dist/esm/views/PreloadLinks.native.js +3 -1
- package/dist/esm/views/PreloadLinks.native.js.map +6 -1
- package/dist/esm/views/RootErrorBoundary.native.js +39 -29
- package/dist/esm/views/RootErrorBoundary.native.js.map +6 -1
- package/dist/esm/views/Screen.native.js +12 -12
- package/dist/esm/views/Screen.native.js.map +6 -1
- package/dist/esm/views/ScrollRestoration.native.js +27 -27
- package/dist/esm/views/ScrollRestoration.native.js.map +6 -1
- package/dist/esm/views/Try.native.js +40 -37
- package/dist/esm/views/Try.native.js.map +6 -1
- package/dist/esm/vite/build.native.js +260 -295
- package/dist/esm/vite/build.native.js.map +6 -1
- package/dist/esm/vite/clientTreeShakePlugin.native.js +34 -33
- package/dist/esm/vite/clientTreeShakePlugin.native.js.map +6 -1
- package/dist/esm/vite/constants.native.js +6 -4
- package/dist/esm/vite/constants.native.js.map +6 -1
- package/dist/esm/vite/createFileSystemRouter.native.js +99 -130
- package/dist/esm/vite/createFileSystemRouter.native.js.map +6 -1
- package/dist/esm/vite/customNodeExternals.native.js +9 -10
- package/dist/esm/vite/customNodeExternals.native.js.map +6 -1
- package/dist/esm/vite/ensureTsConfig.native.js +7 -5
- package/dist/esm/vite/ensureTsConfig.native.js.map +6 -1
- package/dist/esm/vite/findDepsToOptimize.native.js +27 -19
- package/dist/esm/vite/findDepsToOptimize.native.js.map +6 -1
- package/dist/esm/vite/fixDependenciesPlugin.native.js +5 -3
- package/dist/esm/vite/fixDependenciesPlugin.native.js.map +6 -1
- package/dist/esm/vite/generateTypesForRoutes.native.js +9 -9
- package/dist/esm/vite/generateTypesForRoutes.native.js.map +6 -1
- package/dist/esm/vite/getManifest.native.js +6 -4
- package/dist/esm/vite/getManifest.native.js.map +6 -1
- package/dist/esm/vite/headers.native.js +11 -5
- package/dist/esm/vite/headers.native.js.map +6 -1
- package/dist/esm/vite/loadEnv.native.js +7 -6
- package/dist/esm/vite/loadEnv.native.js.map +6 -1
- package/dist/esm/vite/makePluginWebOnly.native.js +9 -5
- package/dist/esm/vite/makePluginWebOnly.native.js.map +6 -1
- package/dist/esm/vite/one.native.js +142 -127
- package/dist/esm/vite/one.native.js.map +6 -1
- package/dist/esm/vite/removeReactNativeWebAnimatedPlugin.native.js +14 -11
- package/dist/esm/vite/removeReactNativeWebAnimatedPlugin.native.js.map +6 -1
- package/dist/esm/vite/replaceLoader.js +7 -1
- package/dist/esm/vite/replaceLoader.js.map +1 -1
- package/dist/esm/vite/replaceLoader.mjs +5 -1
- package/dist/esm/vite/replaceLoader.mjs.map +1 -1
- package/dist/esm/vite/replaceLoader.native.js +13 -10
- package/dist/esm/vite/replaceLoader.native.js.map +6 -1
- package/dist/esm/vite/resolveAPIRequest.native.js +44 -47
- package/dist/esm/vite/resolveAPIRequest.native.js.map +6 -1
- package/dist/esm/vite/server.native.js +5 -4
- package/dist/esm/vite/server.native.js.map +6 -1
- package/dist/esm/vite/types.native.js +1 -2
- package/dist/esm/vite/types.native.js.map +6 -1
- package/dist/esm/vite/virtualEntryPlugin.native.js +21 -16
- package/dist/esm/vite/virtualEntryPlugin.native.js.map +6 -1
- package/dist/esm/vite/vitePluginSsrCss.native.js +61 -50
- package/dist/esm/vite/vitePluginSsrCss.native.js.map +6 -1
- package/dist/esm/vite.native.js +19 -10
- package/dist/esm/vite.native.js.map +6 -1
- package/dist/esm/zero/getQueryKey.native.js +5 -3
- package/dist/esm/zero/getQueryKey.native.js.map +6 -1
- package/dist/esm/zero/isZeroQuery.native.js +4 -2
- package/dist/esm/zero/isZeroQuery.native.js.map +6 -1
- package/dist/esm/zero/resolveQuery.native.js +9 -8
- package/dist/esm/zero/resolveQuery.native.js.map +6 -1
- package/dist/esm/zero/subscribeToQuery.native.js +5 -3
- package/dist/esm/zero/subscribeToQuery.native.js.map +6 -1
- package/dist/esm/zero/types.native.js +1 -2
- package/dist/esm/zero/types.native.js.map +6 -1
- package/dist/esm/zero/useQuery.native.js +12 -12
- package/dist/esm/zero/useQuery.native.js.map +6 -1
- package/dist/esm/zero/useQueryZero.native.js +24 -20
- package/dist/esm/zero/useQueryZero.native.js.map +6 -1
- package/dist/esm/zero.native.js +9 -5
- package/dist/esm/zero.native.js.map +6 -1
- package/package.json +7 -7
- package/src/Root.tsx +20 -16
- package/src/cleanUrl.ts +15 -1
- package/src/vite/replaceLoader.ts +7 -1
- package/types/cleanUrl.d.ts.map +1 -1
- package/types/vite/replaceLoader.d.ts.map +1 -1
@@ -3,55 +3,51 @@ import path, { dirname, resolve } from "node:path";
|
|
3
3
|
import { loadConfigFromFile } from "vite";
|
4
4
|
import tsconfigPaths from "vite-tsconfig-paths";
|
5
5
|
import { getOptimizeDeps, getOptionsFilled, isWebEnvironment } from "vxrn";
|
6
|
-
import "../polyfills-server
|
7
|
-
import { existsAsync } from "../utils/existsAsync
|
8
|
-
import { requireResolve } from "../utils/requireResolve
|
9
|
-
import { clientTreeShakePlugin } from "./clientTreeShakePlugin
|
10
|
-
import { createFileSystemRouter } from "./createFileSystemRouter
|
11
|
-
import { ensureTSConfig } from "./ensureTsConfig
|
12
|
-
import { fixDependenciesPlugin } from "./fixDependenciesPlugin
|
13
|
-
import { generateTypesForRoutes } from "./generateTypesForRoutes
|
14
|
-
import { loadEnv } from "./loadEnv
|
15
|
-
import { createVirtualEntry, virtualEntryId } from "./virtualEntryPlugin
|
16
|
-
import { vitePluginSsrCss } from "./vitePluginSsrCss
|
6
|
+
import "../polyfills-server";
|
7
|
+
import { existsAsync } from "../utils/existsAsync";
|
8
|
+
import { requireResolve } from "../utils/requireResolve";
|
9
|
+
import { clientTreeShakePlugin } from "./clientTreeShakePlugin";
|
10
|
+
import { createFileSystemRouter } from "./createFileSystemRouter";
|
11
|
+
import { ensureTSConfig } from "./ensureTsConfig";
|
12
|
+
import { fixDependenciesPlugin } from "./fixDependenciesPlugin";
|
13
|
+
import { generateTypesForRoutes } from "./generateTypesForRoutes";
|
14
|
+
import { loadEnv } from "./loadEnv";
|
15
|
+
import { createVirtualEntry, virtualEntryId } from "./virtualEntryPlugin";
|
16
|
+
import { vitePluginSsrCss } from "./vitePluginSsrCss";
|
17
17
|
events.setMaxListeners(1e3);
|
18
18
|
globalThis.__vxrnEnableNativeEnv = !0;
|
19
19
|
function one() {
|
20
|
-
var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {},
|
21
|
-
_options_config;
|
20
|
+
var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, _options_config;
|
22
21
|
oneOptions = options, loadEnv(process.cwd()), ((_options_config = options.config) === null || _options_config === void 0 ? void 0 : _options_config.ensureTSConfig) !== !1 && ensureTSConfig(), globalThis.__vxrnPluginConfig__ = options;
|
23
|
-
var {
|
24
|
-
optimizeDeps
|
25
|
-
} = getOptimizeDeps("build"),
|
26
|
-
optimizeIds = optimizeDeps.include,
|
27
|
-
optimizeIdRegex = new RegExp(
|
22
|
+
var { optimizeDeps } = getOptimizeDeps("build"), optimizeIds = optimizeDeps.include, optimizeIdRegex = new RegExp(
|
28
23
|
// santize ids for regex
|
29
24
|
// https://stackoverflow.com/questions/6300183/sanitize-string-of-regex-characters-before-regexp-build
|
30
|
-
`${optimizeIds.map(function
|
25
|
+
`${optimizeIds.map(function(id) {
|
31
26
|
return id.replace(/[#-.]|[[-^]|[?|{}]/g, "\\$&");
|
32
|
-
}).join("|")}`
|
33
|
-
|
34
|
-
vxrnOptions = getOptionsFilled(),
|
35
|
-
devAndProdPlugins = [
|
27
|
+
}).join("|")}`
|
28
|
+
), tsConfigPathsPlugin = null, vxrnOptions = getOptionsFilled(), devAndProdPlugins = [
|
36
29
|
// proxy because you cant add a plugin inside a plugin
|
37
30
|
new Proxy({
|
38
31
|
name: "one:tsconfig-paths",
|
39
32
|
config(configIncoming) {
|
40
|
-
var _options_config2,
|
41
|
-
|
42
|
-
pathsConfig = (_options_config2 = options.config) === null || _options_config2 === void 0 ? void 0 : _options_config2.tsConfigPaths;
|
43
|
-
pathsConfig !== !1 && (!((_configIncoming_plugins = configIncoming.plugins) === null || _configIncoming_plugins === void 0) && _configIncoming_plugins.flat().some(function (p) {
|
33
|
+
var _options_config2, _configIncoming_plugins, pathsConfig = (_options_config2 = options.config) === null || _options_config2 === void 0 ? void 0 : _options_config2.tsConfigPaths;
|
34
|
+
pathsConfig !== !1 && (!((_configIncoming_plugins = configIncoming.plugins) === null || _configIncoming_plugins === void 0) && _configIncoming_plugins.flat().some(function(p) {
|
44
35
|
return p && p.name === "vite-tsconfig-paths";
|
45
36
|
}) || (tsConfigPathsPlugin = tsconfigPaths(pathsConfig && typeof pathsConfig == "object" ? pathsConfig : {})));
|
46
37
|
},
|
47
|
-
configResolved() {
|
48
|
-
|
38
|
+
configResolved() {
|
39
|
+
},
|
40
|
+
resolveId() {
|
41
|
+
}
|
49
42
|
}, {
|
50
43
|
get(target, key, thisArg) {
|
51
|
-
if (key === "config" || key === "name")
|
52
|
-
|
44
|
+
if (key === "config" || key === "name")
|
45
|
+
return Reflect.get(target, key, thisArg);
|
46
|
+
if (tsConfigPathsPlugin)
|
47
|
+
return Reflect.get(tsConfigPathsPlugin, key, thisArg);
|
53
48
|
}
|
54
|
-
}),
|
49
|
+
}),
|
50
|
+
{
|
55
51
|
name: "one-slim-deps",
|
56
52
|
enforce: "pre",
|
57
53
|
config() {
|
@@ -85,15 +81,15 @@ function one() {
|
|
85
81
|
var _options_web;
|
86
82
|
return {
|
87
83
|
define: {
|
88
|
-
...((
|
84
|
+
...((_options_web = options.web) === null || _options_web === void 0 ? void 0 : _options_web.defaultRenderMode) && {
|
89
85
|
"process.env.One_DEFAULT_RENDER_MODE": JSON.stringify(options.web.defaultRenderMode)
|
90
|
-
}
|
91
|
-
...
|
86
|
+
},
|
87
|
+
...options.setupFile && {
|
92
88
|
"process.env.One_SETUP_FILE": JSON.stringify(options.setupFile)
|
93
|
-
}
|
94
|
-
...
|
89
|
+
},
|
90
|
+
...process.env.NODE_ENV !== "production" && vxrnOptions && {
|
95
91
|
"process.env.ONE_SERVER_URL": JSON.stringify(vxrnOptions.server.url)
|
96
|
-
}
|
92
|
+
}
|
97
93
|
},
|
98
94
|
environments: {
|
99
95
|
client: {
|
@@ -109,19 +105,22 @@ function one() {
|
|
109
105
|
}
|
110
106
|
};
|
111
107
|
}
|
112
|
-
},
|
108
|
+
},
|
109
|
+
{
|
113
110
|
name: "one-zero",
|
114
111
|
config() {
|
115
|
-
if (options.zero)
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
112
|
+
if (options.zero)
|
113
|
+
return {
|
114
|
+
define: {
|
115
|
+
"process.env.ZERO_ENABLED": "true",
|
116
|
+
TESTING: "false",
|
117
|
+
REPLICACHE_VERSION: '"15.2.1"',
|
118
|
+
ZERO_VERSION: '"0.0.0"'
|
119
|
+
}
|
120
|
+
};
|
123
121
|
}
|
124
|
-
},
|
122
|
+
},
|
123
|
+
{
|
125
124
|
name: "tamagui-react-19",
|
126
125
|
config() {
|
127
126
|
return {
|
@@ -131,91 +130,101 @@ function one() {
|
|
131
130
|
}
|
132
131
|
};
|
133
132
|
}
|
134
|
-
},
|
133
|
+
},
|
134
|
+
{
|
135
135
|
name: "route-module-hmr-fix",
|
136
136
|
hotUpdate(param) {
|
137
|
-
var {
|
138
|
-
|
139
|
-
|
140
|
-
} = param;
|
141
|
-
return modules.map(function (m) {
|
142
|
-
var {
|
143
|
-
id
|
144
|
-
} = m;
|
137
|
+
var { server, modules } = param;
|
138
|
+
return modules.map(function(m) {
|
139
|
+
var { id } = m;
|
145
140
|
if (!id) return m;
|
146
|
-
var relativePath = path.relative(server.config.root, id),
|
147
|
-
|
148
|
-
return rootDir === "app" && (m.acceptedHmrExports = /* @__PURE__ */new Set()), m;
|
141
|
+
var relativePath = path.relative(server.config.root, id), rootDir = relativePath.split(path.sep)[0];
|
142
|
+
return rootDir === "app" && (m.acceptedHmrExports = /* @__PURE__ */ new Set()), m;
|
149
143
|
});
|
150
144
|
}
|
151
|
-
}];
|
152
|
-
return globalThis.__vxrnAddNativePlugins = [clientTreeShakePlugin()], globalThis.__vxrnAddWebPluginsProd = devAndProdPlugins, [...devAndProdPlugins,
|
153
|
-
/**
|
154
|
-
* This is really the meat of one, where it handles requests:
|
155
|
-
*/
|
156
|
-
createFileSystemRouter(options), generateTypesForRoutes(options), clientTreeShakePlugin(), fixDependenciesPlugin(options.deps), createVirtualEntry({
|
157
|
-
...options,
|
158
|
-
root: "app"
|
159
|
-
}), {
|
160
|
-
name: "define-app-key",
|
161
|
-
config() {
|
162
|
-
var _options_app;
|
163
|
-
if (!((_options_app = options.app) === null || _options_app === void 0) && _options_app.key) return {
|
164
|
-
define: {
|
165
|
-
"process.env.One_APP_NAME": JSON.stringify(options.app.key)
|
166
|
-
}
|
167
|
-
};
|
168
145
|
}
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
146
|
+
];
|
147
|
+
return globalThis.__vxrnAddNativePlugins = [
|
148
|
+
clientTreeShakePlugin()
|
149
|
+
], globalThis.__vxrnAddWebPluginsProd = devAndProdPlugins, [
|
150
|
+
...devAndProdPlugins,
|
151
|
+
/**
|
152
|
+
* This is really the meat of one, where it handles requests:
|
153
|
+
*/
|
154
|
+
createFileSystemRouter(options),
|
155
|
+
generateTypesForRoutes(options),
|
156
|
+
clientTreeShakePlugin(),
|
157
|
+
fixDependenciesPlugin(options.deps),
|
158
|
+
createVirtualEntry({
|
159
|
+
...options,
|
160
|
+
root: "app"
|
161
|
+
}),
|
162
|
+
{
|
163
|
+
name: "define-app-key",
|
164
|
+
config() {
|
165
|
+
var _options_app;
|
166
|
+
if (!((_options_app = options.app) === null || _options_app === void 0) && _options_app.key)
|
167
|
+
return {
|
168
|
+
define: {
|
169
|
+
"process.env.One_APP_NAME": JSON.stringify(options.app.key)
|
170
|
+
}
|
171
|
+
};
|
172
|
+
}
|
173
|
+
},
|
174
|
+
{
|
175
|
+
name: "use-react-18-for-native",
|
176
|
+
enforce: "pre",
|
177
|
+
async config() {
|
178
|
+
var sharedNativeConfig = {
|
179
|
+
resolve: {
|
180
|
+
alias: {
|
181
|
+
react: requireResolve("one/react-18"),
|
182
|
+
"react-dom": requireResolve("one/react-dom-18")
|
183
|
+
}
|
178
184
|
}
|
179
|
-
}
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
185
|
+
};
|
186
|
+
return {
|
187
|
+
environments: {
|
188
|
+
ios: {
|
189
|
+
...sharedNativeConfig
|
190
|
+
},
|
191
|
+
android: {
|
192
|
+
...sharedNativeConfig
|
193
|
+
}
|
188
194
|
}
|
189
|
-
}
|
190
|
-
}
|
191
|
-
}
|
192
|
-
},
|
193
|
-
// this started erroring for no reason..
|
194
|
-
{
|
195
|
-
name: "optimize-deps-load-web-extensions",
|
196
|
-
enforce: "pre",
|
197
|
-
applyToEnvironment(environment) {
|
198
|
-
return isWebEnvironment(environment);
|
195
|
+
};
|
196
|
+
}
|
199
197
|
},
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
198
|
+
// this started erroring for no reason..
|
199
|
+
{
|
200
|
+
name: "optimize-deps-load-web-extensions",
|
201
|
+
enforce: "pre",
|
202
|
+
applyToEnvironment(environment) {
|
203
|
+
return isWebEnvironment(environment);
|
204
|
+
},
|
205
|
+
async resolveId(id) {
|
206
|
+
var importer = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "", shouldOptimize = optimizeIdRegex.test(importer);
|
207
|
+
if (shouldOptimize) {
|
208
|
+
var absolutePath = resolve(dirname(importer), id), webPath = absolutePath.replace(/(.m?js)/, "") + ".web.js";
|
209
|
+
if (webPath === id) return;
|
210
|
+
try {
|
211
|
+
var directoryPath = absolutePath + "/index.web.js";
|
212
|
+
if (await existsAsync(directoryPath))
|
213
|
+
return directoryPath;
|
214
|
+
if (await existsAsync(webPath))
|
215
|
+
return webPath;
|
216
|
+
} catch (err) {
|
217
|
+
console.warn("error probably fine", err);
|
218
|
+
}
|
213
219
|
}
|
214
220
|
}
|
215
|
-
}
|
216
|
-
|
217
|
-
|
218
|
-
|
221
|
+
},
|
222
|
+
vitePluginSsrCss({
|
223
|
+
entries: [
|
224
|
+
virtualEntryId
|
225
|
+
]
|
226
|
+
})
|
227
|
+
];
|
219
228
|
}
|
220
229
|
var oneOptions = null;
|
221
230
|
async function getUserOneOptions(command) {
|
@@ -223,7 +232,8 @@ async function getUserOneOptions(command) {
|
|
223
232
|
if (!command) throw new Error("Options not loaded and no command given");
|
224
233
|
await loadUserOneOptions(command);
|
225
234
|
}
|
226
|
-
if (!oneOptions)
|
235
|
+
if (!oneOptions)
|
236
|
+
throw new Error("No One options were loaded");
|
227
237
|
return oneOptions;
|
228
238
|
}
|
229
239
|
async function loadUserOneOptions(command) {
|
@@ -231,10 +241,15 @@ async function loadUserOneOptions(command) {
|
|
231
241
|
mode: "prod",
|
232
242
|
command
|
233
243
|
});
|
234
|
-
if (!found)
|
244
|
+
if (!found)
|
245
|
+
throw new Error(`No config found in ${process.cwd()}. Is this the correct directory?`);
|
235
246
|
var foundOptions = getUserOneOptions();
|
236
|
-
if (!foundOptions)
|
247
|
+
if (!foundOptions)
|
248
|
+
throw new Error("No One plugin found in this vite.config");
|
237
249
|
return foundOptions;
|
238
250
|
}
|
239
|
-
export {
|
240
|
-
|
251
|
+
export {
|
252
|
+
loadUserOneOptions,
|
253
|
+
one
|
254
|
+
};
|
255
|
+
//# sourceMappingURL=one.js.map
|
@@ -1 +1,6 @@
|
|
1
|
-
{
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"sources": ["../../../src/vite/Users/n8/one/packages/one/src/vite/one.ts"],
|
4
|
+
"mappings": "AAAA,OAAOA,YAAY;AACnB,OAAOC,QAAQC,SAAeC,eAAe;AAC7C,SAA0DC,0BAA0B;AACpF,OAAOC,mBAAmB;AAC1B,SAASC,iBAAiBC,kBAAkBC,wBAAwB;AACpE,OAAO;AACP,SAASC,mBAAmB;AAC5B,SAASC,sBAAsB;AAC/B,SAASC,6BAA6B;AACtC,SAASC,8BAA8B;AACvC,SAASC,sBAAsB;AAC/B,SAASC,6BAA6B;AACtC,SAASC,8BAA8B;AACvC,SAASC,eAAe;AAExB,SAASC,oBAAoBC,sBAAsB;AACnD,SAASC,wBAAwB;AAEjCnB,OAAOoB,gBAAgB,GAAA;AAGvBC,WAAWC,wBAAwB;AAE5B,SAASC,MAAAA;MAAIC,UAAAA,UAAAA,SAAAA,KAAAA,UAAAA,CAAAA,MAAAA,SAAAA,UAAAA,CAAAA,IAA6B,CAAC,GAM5CA;AALJC,eAAaD,SAERR,QAAQU,QAAQC,IAAG,CAAA,KAGpBH,kBAAAA,QAAQI,YAAM,QAAdJ,oBAAAA,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ACfwF,SAAS;QAACzF;;IACZ,CAAA;;AAEJ;AAEA,IAAIO,aAAuC;AAE3C,eAAemF,kBAAkBC,SAA2B;AAC1D,MAAI,CAACpF,YAAY;AACf,QAAI,CAACoF,QAAS,OAAM,IAAIC,MAAM,yCAAyC;AACvE,UAAMC,mBAAmBF,OAAAA;EAC3B;AACA,MAAI,CAACpF;AACH,UAAM,IAAIqF,MAAM,4BAA4B;AAE9C,SAAOrF;AACT;AAEA,eAAsBsF,mBAAmBF,SAA0B;AACjE,MAAMG,QAAQ,MAAM5G,mBAAmB;IACrC6G,MAAM;IACNJ;EACF,CAAA;AACA,MAAI,CAACG;AACH,UAAM,IAAIF,MAAM,sBAAsBpF,QAAQC,IAAG,CAAA,kCAAoC;AAEvF,MAAMuF,eAAeN,kBAAAA;AACrB,MAAI,CAACM;AACH,UAAM,IAAIJ,MAAM,yCAAyC;AAE3D,SAAOI;AACT;",
|
5
|
+
"names": ["events", "path", "dirname", "resolve", "loadConfigFromFile", "tsconfigPaths", "getOptimizeDeps", "getOptionsFilled", "isWebEnvironment", "existsAsync", "requireResolve", "clientTreeShakePlugin", "createFileSystemRouter", "ensureTSConfig", "fixDependenciesPlugin", "generateTypesForRoutes", "loadEnv", "createVirtualEntry", "virtualEntryId", "vitePluginSsrCss", "setMaxListeners", "globalThis", "__vxrnEnableNativeEnv", "one", "options", "oneOptions", "process", "cwd", "config", "optimizeDeps", "optimizeIds", "include", "optimizeIdRegex", "RegExp", "map", "id", "replace", "join", "tsConfigPathsPlugin", "vxrnOptions", "devAndProdPlugins", "Proxy", "name", "configIncoming", "pathsConfig", "tsConfigPaths", "plugins", "flat", "some", "p", "configResolved", "resolveId", "get", "target", "key", "thisArg", "Reflect", "enforce", "alias", "tslib", "define", "web", "defaultRenderMode", "JSON", "stringify", "setupFile", "env", "NODE_ENV", "server", "url", "environments", "client", "ssr", "zero", "TESTING", "REPLICACHE_VERSION", "ZERO_VERSION", "hotUpdate", "modules", "m", "relativePath", "relative", "root", "rootDir", "split", "sep", "acceptedHmrExports", "Set", "__vxrnAddNativePlugins", "__vxrnAddWebPluginsProd", "deps", "app", "sharedNativeConfig", "react", "ios", "android", "applyToEnvironment", "environment", "importer", "shouldOptimize", "test", "absolutePath", "webPath", "directoryPath", "err", "console", "warn", "entries", "getUserOneOptions", "command", "Error", "loadUserOneOptions", "found", "mode", "foundOptions"]
|
6
|
+
}
|
@@ -1,13 +1,13 @@
|
|
1
1
|
function removeReactNativeWebAnimatedPlugin(opts) {
|
2
|
-
var filter = opts?.panResponder ? /(react-native\/Animated\/Animated|PlatformPressable|PanResponder|ResponderSystem)/ : /(react-native\/Animated\/Animated|PlatformPressable)/,
|
3
|
-
|
4
|
-
|
5
|
-
|
2
|
+
var filter = opts?.panResponder ? /(react-native\/Animated\/Animated|PlatformPressable|PanResponder|ResponderSystem)/ : /(react-native\/Animated\/Animated|PlatformPressable)/, optimizeDeps = {
|
3
|
+
esbuildOptions: {
|
4
|
+
plugins: [
|
5
|
+
{
|
6
6
|
name: "remove-react-native-web-animated",
|
7
7
|
setup(build) {
|
8
8
|
build.onResolve({
|
9
9
|
filter
|
10
|
-
}, function
|
10
|
+
}, function(args) {
|
11
11
|
return {
|
12
12
|
path: args.path,
|
13
13
|
namespace: "proxy-wormify"
|
@@ -15,16 +15,17 @@ function removeReactNativeWebAnimatedPlugin(opts) {
|
|
15
15
|
}), build.onLoad({
|
16
16
|
filter: /.*/,
|
17
17
|
namespace: "proxy-wormify"
|
18
|
-
}, function
|
18
|
+
}, function(args) {
|
19
19
|
return {
|
20
20
|
contents: 'export * from "@tamagui/proxy-worm";',
|
21
21
|
loader: "js"
|
22
22
|
};
|
23
23
|
});
|
24
24
|
}
|
25
|
-
}
|
26
|
-
|
27
|
-
}
|
25
|
+
}
|
26
|
+
]
|
27
|
+
}
|
28
|
+
};
|
28
29
|
return {
|
29
30
|
name: "remove-react-native-web-animated",
|
30
31
|
config() {
|
@@ -34,5 +35,7 @@ function removeReactNativeWebAnimatedPlugin(opts) {
|
|
34
35
|
}
|
35
36
|
};
|
36
37
|
}
|
37
|
-
export {
|
38
|
-
|
38
|
+
export {
|
39
|
+
removeReactNativeWebAnimatedPlugin
|
40
|
+
};
|
41
|
+
//# sourceMappingURL=removeReactNativeWebAnimatedPlugin.js.map
|
@@ -1 +1,6 @@
|
|
1
|
-
{
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"sources": ["../../../src/vite/Users/n8/one/packages/one/src/vite/removeReactNativeWebAnimatedPlugin.ts"],
|
4
|
+
"mappings": "AAMO,SAASA,mCAAmCC,MAElD;AACC,MAAMC,SAASD,MAAME,eACjB,sFACA,wDAEEC,eAAe;IACnBC,gBAAgB;MACdC,SAAS;QACP;UACEC,MAAM;UACNC,MAAMC,OAAK;AACTA,kBAAMC,UACJ;cACER;YACF,GACA,SAACS,MAAAA;AACC,qBAAO;gBAAEC,MAAMD,KAAKC;gBAAMC,WAAW;cAAgB;YACvD,CAAA,GAGFJ,MAAMK,OAAO;cAAEZ,QAAQ;cAAMW,WAAW;YAAgB,GAAG,SAACF,MAAAA;AAC1D,qBAAO;gBACLI,UAAU;gBACVC,QAAQ;cACV;YACF,CAAA;UACF;QACF;;IAEJ;EACF;AAEA,SAAO;IACLT,MAAM;IAENU,SAAAA;AACE,aAAO;QACLb;MACF;IACF;EACF;AACF;",
|
5
|
+
"names": ["removeReactNativeWebAnimatedPlugin", "opts", "filter", "panResponder", "optimizeDeps", "esbuildOptions", "plugins", "name", "setup", "build", "onResolve", "args", "path", "namespace", "onLoad", "contents", "loader", "config"]
|
6
|
+
}
|
@@ -3,7 +3,13 @@ function replaceLoader({
|
|
3
3
|
loaderData
|
4
4
|
}) {
|
5
5
|
const stringifiedData = JSON.stringify(loaderData);
|
6
|
-
return code.includes("__vxrn__loader__") ? code.replace(
|
6
|
+
return code.includes("__vxrn__loader__") ? code.replace(
|
7
|
+
/["']__vxrn__loader__['"]/,
|
8
|
+
// make sure this ' ' is added in front,
|
9
|
+
// minifiers will do `return"something"
|
10
|
+
// but if its null then it becomes returnnull
|
11
|
+
" " + stringifiedData
|
12
|
+
) : code + `
|
7
13
|
export const loader = () => (${stringifiedData})`;
|
8
14
|
}
|
9
15
|
export {
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../src/vite/replaceLoader.ts"],
|
4
|
-
"mappings": "AAAO,SAAS,cAAc;AAAA,EAC5B;AAAA,EACA;AACF,GAGG;AACD,QAAM,kBAAkB,KAAK,UAAU,UAAU;
|
4
|
+
"mappings": "AAAO,SAAS,cAAc;AAAA,EAC5B;AAAA,EACA;AACF,GAGG;AACD,QAAM,kBAAkB,KAAK,UAAU,UAAU;AAejD,SAZO,KAAK,SAAS,kBAAkB,IAG9B,KAAK;AAAA,IACV;AAAA;AAAA;AAAA;AAAA,IAIA,MAAM;AAAA,EACR,IARS,OAAO;AAAA,+BAAkC,eAAe;AAYrE;",
|
5
5
|
"names": []
|
6
6
|
}
|
@@ -3,7 +3,11 @@ function replaceLoader({
|
|
3
3
|
loaderData
|
4
4
|
}) {
|
5
5
|
const stringifiedData = JSON.stringify(loaderData);
|
6
|
-
return code.includes("__vxrn__loader__") ? code.replace(/["']__vxrn__loader__['"]/,
|
6
|
+
return code.includes("__vxrn__loader__") ? code.replace(/["']__vxrn__loader__['"]/,
|
7
|
+
// make sure this ' ' is added in front,
|
8
|
+
// minifiers will do `return"something"
|
9
|
+
// but if its null then it becomes returnnull
|
10
|
+
" " + stringifiedData) : code + `
|
7
11
|
export const loader = () => (${stringifiedData})`;
|
8
12
|
}
|
9
13
|
export { replaceLoader };
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["replaceLoader","code","loaderData","stringifiedData","JSON","stringify","includes","replace"],"sources":["../../../src/vite/replaceLoader.ts"],"sourcesContent":[null],"mappings":"AAAO,SAASA,cAAc;EAC5BC,IAAA;EACAC;AACF,GAGG;EACD,MAAMC,eAAA,GAAkBC,IAAA,CAAKC,SAAA,CAAUH,UAAU;
|
1
|
+
{"version":3,"names":["replaceLoader","code","loaderData","stringifiedData","JSON","stringify","includes","replace"],"sources":["../../../src/vite/replaceLoader.ts"],"sourcesContent":[null],"mappings":"AAAO,SAASA,cAAc;EAC5BC,IAAA;EACAC;AACF,GAGG;EACD,MAAMC,eAAA,GAAkBC,IAAA,CAAKC,SAAA,CAAUH,UAAU;EAejD,OAZOD,IAAA,CAAKK,QAAA,CAAS,kBAAkB,IAG9BL,IAAA,CAAKM,OAAA,CACV;EAAA;EAAA;EAAA;EAIA,MAAMJ,eACR,IARSF,IAAA,GAAO;AAAA,+BAAkCE,eAAe;AAYrE","ignoreList":[]}
|
@@ -1,14 +1,17 @@
|
|
1
1
|
function replaceLoader(param) {
|
2
|
-
var {
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
2
|
+
var { code, loaderData } = param, stringifiedData = JSON.stringify(loaderData), out = function() {
|
3
|
+
return code.includes("__vxrn__loader__") ? code.replace(
|
4
|
+
/["']__vxrn__loader__['"]/,
|
5
|
+
// make sure this ' ' is added in front,
|
6
|
+
// minifiers will do `return"something"
|
7
|
+
// but if its null then it becomes returnnull
|
8
|
+
" " + stringifiedData
|
9
|
+
) : code + `
|
9
10
|
export const loader = () => (${stringifiedData})`;
|
10
|
-
|
11
|
+
}();
|
11
12
|
return out;
|
12
13
|
}
|
13
|
-
export {
|
14
|
-
|
14
|
+
export {
|
15
|
+
replaceLoader
|
16
|
+
};
|
17
|
+
//# sourceMappingURL=replaceLoader.js.map
|
@@ -1 +1,6 @@
|
|
1
|
-
{
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"sources": ["../../../src/vite/Users/n8/one/packages/one/src/vite/replaceLoader.ts"],
|
4
|
+
"mappings": "AAAO,SAASA,cAAc,OAM7B;MAN6B,EAC5BC,MACAC,WAAU,IAFkB,OAOtBC,kBAAkBC,KAAKC,UAAUH,UAAAA,GAEjCI,MAAO,WAAA;AACX,WAAKL,KAAKM,SAAS,kBAAA,IAGZN,KAAKO;MACV;;;;MAIA,MAAML;IAAAA,IAPCF,OAAO;+BAAkCE,eAAAA;EASpD,EAAA;AAEA,SAAOG;AACT;",
|
5
|
+
"names": ["replaceLoader", "code", "loaderData", "stringifiedData", "JSON", "stringify", "out", "includes", "replace"]
|
6
|
+
}
|
@@ -1,56 +1,51 @@
|
|
1
|
-
import { isResponse } from "../utils/isResponse
|
2
|
-
import { asyncHeadersCache, mergeHeaders, requestAsyncLocalStore } from "./headers
|
1
|
+
import { isResponse } from "../utils/isResponse";
|
2
|
+
import { asyncHeadersCache, mergeHeaders, requestAsyncLocalStore } from "./headers";
|
3
3
|
function resolveAPIRequest(asyncImport, request, params) {
|
4
|
-
if (asyncImport)
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
requestType = request.method || "GET",
|
12
|
-
handler
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
var response = await handler(request, {
|
4
|
+
if (asyncImport)
|
5
|
+
return new Promise(function(res, rej) {
|
6
|
+
var id = {
|
7
|
+
_id: Math.random()
|
8
|
+
};
|
9
|
+
requestAsyncLocalStore.run(id, async function() {
|
10
|
+
try {
|
11
|
+
var imported = await asyncImport(), requestType = request.method || "GET", handler = imported[requestType] || imported.default;
|
12
|
+
if (!handler) {
|
13
|
+
console.warn(`No handler found for request ${requestType}`);
|
14
|
+
return;
|
15
|
+
}
|
16
|
+
var response = await handler(request, {
|
18
17
|
params
|
19
|
-
}),
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
18
|
+
}), asyncHeaders = asyncHeadersCache.get(id);
|
19
|
+
if (asyncHeaders)
|
20
|
+
try {
|
21
|
+
response instanceof Response ? mergeHeaders(response.headers, asyncHeaders) : response && typeof response == "object" ? response = Response.json(response, {
|
22
|
+
headers: asyncHeaders
|
23
|
+
}) : response = new Response(response, {
|
24
|
+
headers: asyncHeaders
|
25
|
+
});
|
26
|
+
} catch (err) {
|
27
|
+
if (`${err}`.includes("immutable")) {
|
28
|
+
var body = response.body ? await streamToString(response.body) : "";
|
29
|
+
response = new Response(body, {
|
30
|
+
headers: response.headers,
|
31
|
+
status: response.status,
|
32
|
+
statusText: response.statusText
|
33
|
+
}), mergeHeaders(response.headers, asyncHeaders);
|
34
|
+
} else
|
35
|
+
console.error(` [one] error adding headers: ${err}`);
|
36
|
+
}
|
37
|
+
res(response);
|
27
38
|
} catch (err) {
|
28
|
-
|
29
|
-
var body = response.body ? await streamToString(response.body) : "";
|
30
|
-
response = new Response(body, {
|
31
|
-
headers: response.headers,
|
32
|
-
status: response.status,
|
33
|
-
statusText: response.statusText
|
34
|
-
}), mergeHeaders(response.headers, asyncHeaders);
|
35
|
-
} else console.error(` [one] error adding headers: ${err}`);
|
39
|
+
isResponse(err) ? res(err) : rej(err);
|
36
40
|
}
|
37
|
-
|
38
|
-
} catch (err) {
|
39
|
-
isResponse(err) ? res(err) : rej(err);
|
40
|
-
}
|
41
|
+
});
|
41
42
|
});
|
42
|
-
});
|
43
43
|
}
|
44
44
|
async function streamToString(stream) {
|
45
|
-
var reader = stream.getReader(),
|
46
|
-
decoder = new TextDecoder(),
|
47
|
-
result = "";
|
45
|
+
var reader = stream.getReader(), decoder = new TextDecoder(), result = "";
|
48
46
|
try {
|
49
|
-
for (
|
50
|
-
var {
|
51
|
-
done,
|
52
|
-
value
|
53
|
-
} = await reader.read();
|
47
|
+
for (; ; ) {
|
48
|
+
var { done, value } = await reader.read();
|
54
49
|
if (done) break;
|
55
50
|
result += decoder.decode(value, {
|
56
51
|
stream: !0
|
@@ -63,5 +58,7 @@ async function streamToString(stream) {
|
|
63
58
|
}
|
64
59
|
return result;
|
65
60
|
}
|
66
|
-
export {
|
67
|
-
|
61
|
+
export {
|
62
|
+
resolveAPIRequest
|
63
|
+
};
|
64
|
+
//# sourceMappingURL=resolveAPIRequest.js.map
|