one 1.1.298 → 1.1.299
Sign up to get free protection for your applications and to get access to all the features.
- 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.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.native.js +12 -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/vite/replaceLoader.ts +7 -1
- package/types/vite/replaceLoader.d.ts.map +1 -1
@@ -1,11 +1,16 @@
|
|
1
|
-
import { getDefaultRenderMode } from "./config
|
2
|
-
import { matchArrayGroupName, matchDeepDynamicRouteName, matchDynamicName, matchGroupName, removeSupportedExtensions } from "./matchers
|
3
|
-
import { getPageExport } from "./utils/getPageExport
|
4
|
-
var validPlatforms = /* @__PURE__ */new Set([
|
1
|
+
import { getDefaultRenderMode } from "./config";
|
2
|
+
import { matchArrayGroupName, matchDeepDynamicRouteName, matchDynamicName, matchGroupName, removeSupportedExtensions } from "./matchers";
|
3
|
+
import { getPageExport } from "./utils/getPageExport";
|
4
|
+
var validPlatforms = /* @__PURE__ */ new Set([
|
5
|
+
"android",
|
6
|
+
"ios",
|
7
|
+
"native",
|
8
|
+
"web"
|
9
|
+
]);
|
5
10
|
function getRoutes(contextModule) {
|
6
|
-
var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {},
|
7
|
-
|
8
|
-
|
11
|
+
var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, directoryTree = getDirectoryTree(contextModule, options);
|
12
|
+
if (!directoryTree)
|
13
|
+
return null;
|
9
14
|
var rootNode = flattenDirectoryTreeToRoutes(directoryTree, options);
|
10
15
|
return options.ignoreEntryPoints || crawlAndAppendInitialRoutesAndEntryFiles(rootNode, options), rootNode;
|
11
16
|
}
|
@@ -17,133 +22,136 @@ function getExactRoutes(contextModule) {
|
|
17
22
|
});
|
18
23
|
}
|
19
24
|
function getDirectoryTree(contextModule, options) {
|
20
|
-
var importMode = options.importMode || process.env.One_ROUTER_IMPORT_MODE,
|
21
|
-
|
25
|
+
var importMode = options.importMode || process.env.One_ROUTER_IMPORT_MODE, ignoreList = [
|
26
|
+
/^\.\/\+html\.[tj]sx?$/
|
27
|
+
];
|
22
28
|
options.ignore && ignoreList.push(...options.ignore), options.preserveApiRoutes || ignoreList.push(/\+api\.[tj]sx?$/);
|
23
29
|
var rootDirectory = {
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
hasRoutes = !1,
|
28
|
-
isValid = !1,
|
29
|
-
_iteratorNormalCompletion = !0,
|
30
|
-
_didIteratorError = !1,
|
31
|
-
_iteratorError = void 0;
|
30
|
+
files: /* @__PURE__ */ new Map(),
|
31
|
+
subdirectories: /* @__PURE__ */ new Map()
|
32
|
+
}, hasRoutes = !1, isValid = !1, _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
|
32
33
|
try {
|
33
|
-
for (var _loop = function
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
} catch {
|
48
|
-
return {};
|
49
|
-
} else return contextModule(filePath);
|
50
|
-
},
|
51
|
-
contextKey: filePath,
|
52
|
-
route: "",
|
53
|
-
// This is overwritten during hoisting based upon the _layout
|
54
|
-
dynamic: null,
|
55
|
-
children: []
|
56
|
-
};
|
57
|
-
if (process.env.NODE_ENV === "development" && node.type !== "api" && importMode === "sync" && !getPageExport(node.loadRoute())) return "continue";
|
58
|
-
var _iteratorNormalCompletion2 = !0,
|
59
|
-
_didIteratorError2 = !1,
|
60
|
-
_iteratorError2 = void 0;
|
61
|
-
try {
|
62
|
-
for (var _iterator2 = extrapolateGroups(meta.route)[Symbol.iterator](), _step1; !(_iteratorNormalCompletion2 = (_step1 = _iterator2.next()).done); _iteratorNormalCompletion2 = !0) {
|
63
|
-
var route = _step1.value,
|
64
|
-
subdirectoryParts = route.split("/").slice(0, -1),
|
65
|
-
directory = rootDirectory,
|
66
|
-
_iteratorNormalCompletion1 = !0,
|
67
|
-
_didIteratorError1 = !1,
|
68
|
-
_iteratorError1 = void 0;
|
34
|
+
for (var _loop = function() {
|
35
|
+
var filePath = _step.value;
|
36
|
+
if (ignoreList.some(function(regex) {
|
37
|
+
return regex.test(filePath);
|
38
|
+
}))
|
39
|
+
return "continue";
|
40
|
+
isValid = !0;
|
41
|
+
var meta = getFileMeta(filePath, options);
|
42
|
+
if (meta.specificity < 0)
|
43
|
+
return "continue";
|
44
|
+
var type = meta.isLayout ? "layout" : meta.renderMode || getDefaultRenderMode(), node = {
|
45
|
+
type,
|
46
|
+
loadRoute() {
|
47
|
+
if (options.ignoreRequireErrors)
|
69
48
|
try {
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
subDirectory || (subDirectory = {
|
74
|
-
files: /* @__PURE__ */new Map(),
|
75
|
-
subdirectories: /* @__PURE__ */new Map()
|
76
|
-
}, directory.subdirectories.set(part, subDirectory)), directory = subDirectory;
|
77
|
-
}
|
78
|
-
} catch (err) {
|
79
|
-
_didIteratorError1 = !0, _iteratorError1 = err;
|
80
|
-
} finally {
|
81
|
-
try {
|
82
|
-
!_iteratorNormalCompletion1 && _iterator1.return != null && _iterator1.return();
|
83
|
-
} finally {
|
84
|
-
if (_didIteratorError1) throw _iteratorError1;
|
85
|
-
}
|
49
|
+
return contextModule(filePath);
|
50
|
+
} catch {
|
51
|
+
return {};
|
86
52
|
}
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
if (existing1) {
|
103
|
-
if (process.env.NODE_ENV !== "production") throw new Error(`The API route file "${filePath}" and "${existing1.contextKey}" conflict on the route "/${route}". Please remove or rename one of these files.`);
|
104
|
-
} else nodes[0] = node;
|
105
|
-
} else {
|
106
|
-
var nodes1 = directory.files.get(route);
|
107
|
-
nodes1 || (nodes1 = [], directory.files.set(route, nodes1));
|
108
|
-
var existing2 = nodes1[meta.specificity];
|
109
|
-
if (existing2) {
|
110
|
-
if (process.env.NODE_ENV !== "production") throw new Error(`The route files "${filePath}" and "${existing2.contextKey}" conflict on the route "/${route}". Please remove or rename one of these files.`);
|
111
|
-
} else hasRoutes || (hasRoutes = !0), nodes1[meta.specificity] = node;
|
112
|
-
}
|
113
|
-
}
|
114
|
-
} catch (err) {
|
115
|
-
_didIteratorError2 = !0, _iteratorError2 = err;
|
116
|
-
} finally {
|
53
|
+
else
|
54
|
+
return contextModule(filePath);
|
55
|
+
},
|
56
|
+
contextKey: filePath,
|
57
|
+
route: "",
|
58
|
+
// This is overwritten during hoisting based upon the _layout
|
59
|
+
dynamic: null,
|
60
|
+
children: []
|
61
|
+
};
|
62
|
+
if (process.env.NODE_ENV === "development" && node.type !== "api" && importMode === "sync" && !getPageExport(node.loadRoute()))
|
63
|
+
return "continue";
|
64
|
+
var _iteratorNormalCompletion2 = !0, _didIteratorError2 = !1, _iteratorError2 = void 0;
|
65
|
+
try {
|
66
|
+
for (var _iterator2 = extrapolateGroups(meta.route)[Symbol.iterator](), _step1; !(_iteratorNormalCompletion2 = (_step1 = _iterator2.next()).done); _iteratorNormalCompletion2 = !0) {
|
67
|
+
var route = _step1.value, subdirectoryParts = route.split("/").slice(0, -1), directory = rootDirectory, _iteratorNormalCompletion1 = !0, _didIteratorError1 = !1, _iteratorError1 = void 0;
|
117
68
|
try {
|
118
|
-
|
69
|
+
for (var _iterator1 = subdirectoryParts[Symbol.iterator](), _step2; !(_iteratorNormalCompletion1 = (_step2 = _iterator1.next()).done); _iteratorNormalCompletion1 = !0) {
|
70
|
+
var part = _step2.value, subDirectory = directory.subdirectories.get(part);
|
71
|
+
subDirectory || (subDirectory = {
|
72
|
+
files: /* @__PURE__ */ new Map(),
|
73
|
+
subdirectories: /* @__PURE__ */ new Map()
|
74
|
+
}, directory.subdirectories.set(part, subDirectory)), directory = subDirectory;
|
75
|
+
}
|
76
|
+
} catch (err) {
|
77
|
+
_didIteratorError1 = !0, _iteratorError1 = err;
|
119
78
|
} finally {
|
120
|
-
|
79
|
+
try {
|
80
|
+
!_iteratorNormalCompletion1 && _iterator1.return != null && _iterator1.return();
|
81
|
+
} finally {
|
82
|
+
if (_didIteratorError1)
|
83
|
+
throw _iteratorError1;
|
84
|
+
}
|
121
85
|
}
|
86
|
+
if (node = {
|
87
|
+
...node,
|
88
|
+
route
|
89
|
+
}, meta.isLayout) {
|
90
|
+
var _directory, _layout;
|
91
|
+
(_layout = (_directory = directory).layout) !== null && _layout !== void 0 || (_directory.layout = []);
|
92
|
+
var existing = directory.layout[meta.specificity];
|
93
|
+
if (existing) {
|
94
|
+
if (process.env.NODE_ENV !== "production")
|
95
|
+
throw new Error(`The layouts "${filePath}" and "${existing.contextKey}" conflict on the route "/${route}". Please remove or rename one of these files.`);
|
96
|
+
} else
|
97
|
+
node = getLayoutNode(node, options), directory.layout[meta.specificity] = node;
|
98
|
+
} else if (type === "api") {
|
99
|
+
var fileKey = `${route}+api`, nodes = directory.files.get(fileKey);
|
100
|
+
nodes || (nodes = [], directory.files.set(fileKey, nodes));
|
101
|
+
var existing1 = nodes[0];
|
102
|
+
if (existing1) {
|
103
|
+
if (process.env.NODE_ENV !== "production")
|
104
|
+
throw new Error(`The API route file "${filePath}" and "${existing1.contextKey}" conflict on the route "/${route}". Please remove or rename one of these files.`);
|
105
|
+
} else
|
106
|
+
nodes[0] = node;
|
107
|
+
} else {
|
108
|
+
var nodes1 = directory.files.get(route);
|
109
|
+
nodes1 || (nodes1 = [], directory.files.set(route, nodes1));
|
110
|
+
var existing2 = nodes1[meta.specificity];
|
111
|
+
if (existing2) {
|
112
|
+
if (process.env.NODE_ENV !== "production")
|
113
|
+
throw new Error(`The route files "${filePath}" and "${existing2.contextKey}" conflict on the route "/${route}". Please remove or rename one of these files.`);
|
114
|
+
} else
|
115
|
+
hasRoutes || (hasRoutes = !0), nodes1[meta.specificity] = node;
|
116
|
+
}
|
117
|
+
}
|
118
|
+
} catch (err) {
|
119
|
+
_didIteratorError2 = !0, _iteratorError2 = err;
|
120
|
+
} finally {
|
121
|
+
try {
|
122
|
+
!_iteratorNormalCompletion2 && _iterator2.return != null && _iterator2.return();
|
123
|
+
} finally {
|
124
|
+
if (_didIteratorError2)
|
125
|
+
throw _iteratorError2;
|
122
126
|
}
|
123
|
-
}
|
127
|
+
}
|
128
|
+
}, _iterator = contextModule.keys()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) _loop();
|
124
129
|
} catch (err) {
|
125
130
|
_didIteratorError = !0, _iteratorError = err;
|
126
131
|
} finally {
|
127
132
|
try {
|
128
133
|
!_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
|
129
134
|
} finally {
|
130
|
-
if (_didIteratorError)
|
135
|
+
if (_didIteratorError)
|
136
|
+
throw _iteratorError;
|
131
137
|
}
|
132
138
|
}
|
133
|
-
return isValid ? (rootDirectory.layout || (rootDirectory.layout = [
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
139
|
+
return isValid ? (rootDirectory.layout || (rootDirectory.layout = [
|
140
|
+
{
|
141
|
+
type: "layout",
|
142
|
+
loadRoute: function() {
|
143
|
+
return {
|
144
|
+
default: require("./views/Navigator").DefaultNavigator
|
145
|
+
};
|
146
|
+
},
|
147
|
+
// Generate a fake file name for the directory
|
148
|
+
contextKey: "router/build/views/Navigator.js",
|
149
|
+
route: "",
|
150
|
+
generated: !0,
|
151
|
+
dynamic: null,
|
152
|
+
children: []
|
153
|
+
}
|
154
|
+
]), options.skipGenerated || (hasRoutes && appendSitemapRoute(rootDirectory), appendNotFoundRoute(rootDirectory)), rootDirectory) : null;
|
147
155
|
}
|
148
156
|
function flattenDirectoryTreeToRoutes(directory, options, layout) {
|
149
157
|
var pathToRemove = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : "";
|
@@ -154,13 +162,10 @@ function flattenDirectoryTreeToRoutes(directory, options, layout) {
|
|
154
162
|
pathToRemove = layout.route ? `${layout.route}/` : "", layout.route = newRoute, layout.dynamic = generateDynamic(layout.route);
|
155
163
|
}
|
156
164
|
if (!layout) throw new Error("One Internal Error: No nearest layout");
|
157
|
-
var _iteratorNormalCompletion = !0,
|
158
|
-
_didIteratorError = !1,
|
159
|
-
_iteratorError = void 0;
|
165
|
+
var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
|
160
166
|
try {
|
161
167
|
for (var _iterator = directory.files.values()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
|
162
|
-
var routes = _step.value,
|
163
|
-
routeNode = getMostSpecific(routes);
|
168
|
+
var routes = _step.value, routeNode = getMostSpecific(routes);
|
164
169
|
routeNode.route = routeNode.route.replace(pathToRemove, ""), routeNode.dynamic = generateDynamic(routeNode.route), options.internal_stripLoadRoute && delete routeNode.loadRoute, layout.children.push(routeNode);
|
165
170
|
}
|
166
171
|
} catch (err) {
|
@@ -169,12 +174,11 @@ function flattenDirectoryTreeToRoutes(directory, options, layout) {
|
|
169
174
|
try {
|
170
175
|
!_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
|
171
176
|
} finally {
|
172
|
-
if (_didIteratorError)
|
177
|
+
if (_didIteratorError)
|
178
|
+
throw _iteratorError;
|
173
179
|
}
|
174
180
|
}
|
175
|
-
var _iteratorNormalCompletion1 = !0,
|
176
|
-
_didIteratorError1 = !1,
|
177
|
-
_iteratorError1 = void 0;
|
181
|
+
var _iteratorNormalCompletion1 = !0, _didIteratorError1 = !1, _iteratorError1 = void 0;
|
178
182
|
try {
|
179
183
|
for (var _iterator1 = directory.subdirectories.values()[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = !0) {
|
180
184
|
var child = _step1.value;
|
@@ -186,32 +190,28 @@ function flattenDirectoryTreeToRoutes(directory, options, layout) {
|
|
186
190
|
try {
|
187
191
|
!_iteratorNormalCompletion1 && _iterator1.return != null && _iterator1.return();
|
188
192
|
} finally {
|
189
|
-
if (_didIteratorError1)
|
193
|
+
if (_didIteratorError1)
|
194
|
+
throw _iteratorError1;
|
190
195
|
}
|
191
196
|
}
|
192
197
|
return layout;
|
193
198
|
}
|
194
199
|
function getFileMeta(key, options) {
|
195
200
|
key = key.replace(/^\.\//, "");
|
196
|
-
var parts = key.split("/"),
|
197
|
-
|
198
|
-
|
199
|
-
filenameWithoutExtensions = removeSupportedExtensions(filename),
|
200
|
-
isLayout = filenameWithoutExtensions.startsWith("_layout"),
|
201
|
-
[_fullname, renderModeFound] = filename.match(/\+(api|ssg|ssr|spa)\.(\w+\.)?[jt]sx?$/) || [],
|
202
|
-
renderMode = renderModeFound;
|
203
|
-
if (filenameWithoutExtensions.startsWith("(") && filenameWithoutExtensions.endsWith(")")) throw new Error(`Invalid route ./${key}. Routes cannot end with '(group)' syntax`);
|
201
|
+
var parts = key.split("/"), route = removeSupportedExtensions(key), filename = parts[parts.length - 1], filenameWithoutExtensions = removeSupportedExtensions(filename), isLayout = filenameWithoutExtensions.startsWith("_layout"), [_fullname, renderModeFound] = filename.match(/\+(api|ssg|ssr|spa)\.(\w+\.)?[jt]sx?$/) || [], renderMode = renderModeFound;
|
202
|
+
if (filenameWithoutExtensions.startsWith("(") && filenameWithoutExtensions.endsWith(")"))
|
203
|
+
throw new Error(`Invalid route ./${key}. Routes cannot end with '(group)' syntax`);
|
204
204
|
if (renderMode !== "api" && filename.startsWith("+") && filenameWithoutExtensions !== "+not-found") {
|
205
|
-
var renamedRoute = [
|
205
|
+
var renamedRoute = [
|
206
|
+
...parts.slice(0, -1),
|
207
|
+
filename.slice(1)
|
208
|
+
].join("/");
|
206
209
|
throw new Error(`Invalid route ./${key}. Route nodes cannot start with the '+' character. "Please rename to ${renamedRoute}"`);
|
207
210
|
}
|
208
|
-
var specificity = 0,
|
209
|
-
platformExtension = filenameWithoutExtensions.split(".")[1],
|
210
|
-
hasPlatformExtension = validPlatforms.has(platformExtension),
|
211
|
-
_options_platformRoutes,
|
212
|
-
usePlatformRoutes = (_options_platformRoutes = options.platformRoutes) !== null && _options_platformRoutes !== void 0 ? _options_platformRoutes : !0;
|
211
|
+
var specificity = 0, platformExtension = filenameWithoutExtensions.split(".")[1], hasPlatformExtension = validPlatforms.has(platformExtension), _options_platformRoutes, usePlatformRoutes = (_options_platformRoutes = options.platformRoutes) !== null && _options_platformRoutes !== void 0 ? _options_platformRoutes : !0;
|
213
212
|
if (hasPlatformExtension) {
|
214
|
-
if (usePlatformRoutes && options.platform ? platformExtension === options.platform ? specificity = 2 : platformExtension === "native" && options.platform !== "web" ? specificity = 1 : platformExtension !== options.platform && (specificity = -1) : specificity = -1, renderMode === "api" && specificity !== 0)
|
213
|
+
if (usePlatformRoutes && options.platform ? platformExtension === options.platform ? specificity = 2 : platformExtension === "native" && options.platform !== "web" ? specificity = 1 : platformExtension !== options.platform && (specificity = -1) : specificity = -1, renderMode === "api" && specificity !== 0)
|
214
|
+
throw new Error(`Api routes cannot have platform extensions. Please remove '.${platformExtension}' from './${key}'`);
|
215
215
|
route = route.replace(new RegExp(`.${platformExtension}$`), "");
|
216
216
|
}
|
217
217
|
return {
|
@@ -223,29 +223,31 @@ function getFileMeta(key, options) {
|
|
223
223
|
}
|
224
224
|
function getMostSpecific(routes) {
|
225
225
|
var route = routes[routes.length - 1];
|
226
|
-
if (!routes[0])
|
227
|
-
${
|
228
|
-
|
229
|
-
|
226
|
+
if (!routes[0])
|
227
|
+
throw new Error(` [one] The file ${route.contextKey} does not have a fallback sibling file without a platform extension in routes (${routes[0]}, ${routes.length}):
|
228
|
+
${routes.map(function(r) {
|
229
|
+
return r.contextKey || "NONE";
|
230
|
+
}).join(`
|
230
231
|
`)}.`);
|
231
232
|
return routes[routes.length - 1];
|
232
233
|
}
|
233
234
|
function getIgnoreList(options) {
|
234
|
-
var _options_ignore,
|
235
|
-
|
235
|
+
var _options_ignore, ignore = [
|
236
|
+
/^\.\/\+html\.[tj]sx?$/,
|
237
|
+
...(_options_ignore = options?.ignore) !== null && _options_ignore !== void 0 ? _options_ignore : []
|
238
|
+
];
|
236
239
|
return options?.preserveApiRoutes !== !0 && ignore.push(/\+api\.[tj]sx?$/), ignore;
|
237
240
|
}
|
238
241
|
function extrapolateGroups(key) {
|
239
|
-
var keys = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : /* @__PURE__ */new Set(),
|
240
|
-
|
241
|
-
|
242
|
-
var groups = match.split(","),
|
243
|
-
|
244
|
-
|
245
|
-
if (groups.length === 1)
|
246
|
-
|
247
|
-
|
248
|
-
_iteratorError = void 0;
|
242
|
+
var keys = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : /* @__PURE__ */ new Set(), match = matchArrayGroupName(key);
|
243
|
+
if (!match)
|
244
|
+
return keys.add(key), keys;
|
245
|
+
var groups = match.split(","), groupsSet = new Set(groups);
|
246
|
+
if (groupsSet.size !== groups.length)
|
247
|
+
throw new Error(`Array syntax cannot contain duplicate group name "${groups}" in "${key}".`);
|
248
|
+
if (groups.length === 1)
|
249
|
+
return keys.add(key), keys;
|
250
|
+
var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
|
249
251
|
try {
|
250
252
|
for (var _iterator = groups[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
|
251
253
|
var group = _step.value;
|
@@ -257,76 +259,82 @@ function extrapolateGroups(key) {
|
|
257
259
|
try {
|
258
260
|
!_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
|
259
261
|
} finally {
|
260
|
-
if (_didIteratorError)
|
262
|
+
if (_didIteratorError)
|
263
|
+
throw _iteratorError;
|
261
264
|
}
|
262
265
|
}
|
263
266
|
return keys;
|
264
267
|
}
|
265
268
|
function generateDynamic(path) {
|
266
|
-
var dynamic = path.split("/").map(function
|
267
|
-
if (part === "+not-found")
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
269
|
+
var dynamic = path.split("/").map(function(part) {
|
270
|
+
if (part === "+not-found")
|
271
|
+
return {
|
272
|
+
name: "+not-found",
|
273
|
+
deep: !0,
|
274
|
+
notFound: !0
|
275
|
+
};
|
276
|
+
var deepDynamicName = matchDeepDynamicRouteName(part), dynamicName = deepDynamicName ?? matchDynamicName(part);
|
274
277
|
return dynamicName ? {
|
275
278
|
name: dynamicName,
|
276
279
|
deep: !!deepDynamicName
|
277
280
|
} : null;
|
278
|
-
}).filter(function
|
281
|
+
}).filter(function(part) {
|
279
282
|
return !!part;
|
280
283
|
});
|
281
284
|
return dynamic.length === 0 ? null : dynamic;
|
282
285
|
}
|
283
286
|
function appendSitemapRoute(directory) {
|
284
|
-
directory.files.has("_sitemap") || directory.files.set("_sitemap", [
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
287
|
+
directory.files.has("_sitemap") || directory.files.set("_sitemap", [
|
288
|
+
{
|
289
|
+
loadRoute() {
|
290
|
+
return {
|
291
|
+
default: function() {
|
292
|
+
return null;
|
293
|
+
},
|
294
|
+
getNavOptions: function() {
|
295
|
+
}
|
296
|
+
};
|
297
|
+
},
|
298
|
+
route: "_sitemap",
|
299
|
+
type: "ssg",
|
300
|
+
contextKey: "",
|
301
|
+
generated: !0,
|
302
|
+
internal: !0,
|
303
|
+
dynamic: null,
|
304
|
+
children: []
|
305
|
+
}
|
306
|
+
]);
|
301
307
|
}
|
302
308
|
function appendNotFoundRoute(directory) {
|
303
|
-
directory.files.has("+not-found") || directory.files.set("+not-found", [
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
309
|
+
directory.files.has("+not-found") || directory.files.set("+not-found", [
|
310
|
+
{
|
311
|
+
loadRoute() {
|
312
|
+
return {
|
313
|
+
default: function() {
|
314
|
+
return null;
|
315
|
+
}
|
316
|
+
};
|
317
|
+
},
|
318
|
+
type: "spa",
|
319
|
+
route: "+not-found",
|
320
|
+
contextKey: "",
|
321
|
+
generated: !0,
|
322
|
+
internal: !0,
|
323
|
+
dynamic: [
|
324
|
+
{
|
325
|
+
name: "+not-found",
|
326
|
+
deep: !0,
|
327
|
+
notFound: !0
|
308
328
|
}
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
contextKey: "",
|
314
|
-
generated: !0,
|
315
|
-
internal: !0,
|
316
|
-
dynamic: [{
|
317
|
-
name: "+not-found",
|
318
|
-
deep: !0,
|
319
|
-
notFound: !0
|
320
|
-
}],
|
321
|
-
children: []
|
322
|
-
}]);
|
329
|
+
],
|
330
|
+
children: []
|
331
|
+
}
|
332
|
+
]);
|
323
333
|
}
|
324
334
|
function getLayoutNode(node, options) {
|
325
|
-
var groupName = matchGroupName(node.route),
|
326
|
-
|
327
|
-
|
328
|
-
}),
|
329
|
-
initialRouteName = childMatchingGroup?.route;
|
335
|
+
var groupName = matchGroupName(node.route), childMatchingGroup = node.children.find(function(child) {
|
336
|
+
return child.route.replace(/\/index$/, "") === groupName;
|
337
|
+
}), initialRouteName = childMatchingGroup?.route;
|
330
338
|
return {
|
331
339
|
...node,
|
332
340
|
route: node.route.replace(/\/?_layout$/, ""),
|
@@ -337,43 +345,48 @@ function getLayoutNode(node, options) {
|
|
337
345
|
}
|
338
346
|
function crawlAndAppendInitialRoutesAndEntryFiles(node, options) {
|
339
347
|
var entryPoints = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [];
|
340
|
-
if (node.type === "spa" || node.type === "ssg" || node.type === "ssr")
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
+
if (node.type === "spa" || node.type === "ssg" || node.type === "ssr")
|
349
|
+
node.entryPoints = [
|
350
|
+
.../* @__PURE__ */ new Set([
|
351
|
+
...entryPoints,
|
352
|
+
node.contextKey
|
353
|
+
])
|
354
|
+
];
|
355
|
+
else if (node.type === "layout") {
|
356
|
+
if (!node.children)
|
357
|
+
throw new Error(`Layout "${node.contextKey}" does not contain any child routes`);
|
358
|
+
entryPoints = [
|
359
|
+
...entryPoints,
|
360
|
+
node.contextKey
|
361
|
+
];
|
362
|
+
var groupName = matchGroupName(node.route), childMatchingGroup = node.children.find(function(child2) {
|
363
|
+
return child2.route.replace(/\/index$/, "") === groupName;
|
364
|
+
}), initialRouteName = childMatchingGroup?.route;
|
348
365
|
if (!options.internal_stripLoadRoute) {
|
349
366
|
var loaded = node.loadRoute();
|
350
367
|
if (loaded?.unstable_settings) {
|
351
368
|
var _loaded_unstable_settings_initialRouteName;
|
352
369
|
if (initialRouteName = (_loaded_unstable_settings_initialRouteName = loaded.unstable_settings.initialRouteName) !== null && _loaded_unstable_settings_initialRouteName !== void 0 ? _loaded_unstable_settings_initialRouteName : initialRouteName, groupName) {
|
353
|
-
var _loaded_unstable_settings_groupName,
|
354
|
-
_loaded_unstable_settings,
|
355
|
-
groupSpecificInitialRouteName = (_loaded_unstable_settings = loaded.unstable_settings) === null || _loaded_unstable_settings === void 0 || (_loaded_unstable_settings_groupName = _loaded_unstable_settings[groupName]) === null || _loaded_unstable_settings_groupName === void 0 ? void 0 : _loaded_unstable_settings_groupName.initialRouteName;
|
370
|
+
var _loaded_unstable_settings_groupName, _loaded_unstable_settings, groupSpecificInitialRouteName = (_loaded_unstable_settings = loaded.unstable_settings) === null || _loaded_unstable_settings === void 0 || (_loaded_unstable_settings_groupName = _loaded_unstable_settings[groupName]) === null || _loaded_unstable_settings_groupName === void 0 ? void 0 : _loaded_unstable_settings_groupName.initialRouteName;
|
356
371
|
initialRouteName = groupSpecificInitialRouteName ?? initialRouteName;
|
357
372
|
}
|
358
373
|
}
|
359
374
|
}
|
360
375
|
if (initialRouteName) {
|
361
|
-
var initialRoute = node.children.find(function
|
376
|
+
var initialRoute = node.children.find(function(child2) {
|
362
377
|
return child2.route === initialRouteName;
|
363
378
|
});
|
364
379
|
if (!initialRoute) {
|
365
|
-
var validInitialRoutes = node.children.filter(function
|
380
|
+
var validInitialRoutes = node.children.filter(function(child2) {
|
366
381
|
return !child2.generated;
|
367
|
-
}).map(function
|
382
|
+
}).map(function(child2) {
|
368
383
|
return `'${child2.route}'`;
|
369
384
|
}).join(", ");
|
370
385
|
throw groupName ? new Error(`Layout ${node.contextKey} has invalid initialRouteName '${initialRouteName}' for group '(${groupName})'. Valid options are: ${validInitialRoutes}`) : new Error(`Layout ${node.contextKey} has invalid initialRouteName '${initialRouteName}'. Valid options are: ${validInitialRoutes}`);
|
371
386
|
}
|
372
387
|
node.initialRouteName = initialRouteName, entryPoints.push(initialRoute.contextKey);
|
373
388
|
}
|
374
|
-
var _iteratorNormalCompletion = !0,
|
375
|
-
_didIteratorError = !1,
|
376
|
-
_iteratorError = void 0;
|
389
|
+
var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
|
377
390
|
try {
|
378
391
|
for (var _iterator = node.children[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
|
379
392
|
var child = _step.value;
|
@@ -385,10 +398,17 @@ function crawlAndAppendInitialRoutesAndEntryFiles(node, options) {
|
|
385
398
|
try {
|
386
399
|
!_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
|
387
400
|
} finally {
|
388
|
-
if (_didIteratorError)
|
401
|
+
if (_didIteratorError)
|
402
|
+
throw _iteratorError;
|
389
403
|
}
|
390
404
|
}
|
391
405
|
}
|
392
406
|
}
|
393
|
-
export {
|
394
|
-
|
407
|
+
export {
|
408
|
+
extrapolateGroups,
|
409
|
+
generateDynamic,
|
410
|
+
getExactRoutes,
|
411
|
+
getIgnoreList,
|
412
|
+
getRoutes
|
413
|
+
};
|
414
|
+
//# sourceMappingURL=getRoutes.js.map
|