one 2.17.0 → 2.17.1
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/android/src/main/java/com/margelo/nitro/one/HybridOneNotifications.kt +28 -8
- package/dist/cjs/router/getRoutes.cjs +4 -2
- package/dist/cjs/router/getRoutes.native.cjs +4 -2
- package/dist/cjs/router/getRoutes.native.js +4 -2
- package/dist/cjs/router/getRoutes.native.js.map +1 -1
- package/dist/esm/router/getRoutes.mjs +4 -2
- package/dist/esm/router/getRoutes.mjs.map +1 -1
- package/dist/esm/router/getRoutes.native.js +4 -2
- package/dist/esm/router/getRoutes.native.js.map +1 -1
- package/ios/Generated/OneNativeOverlayContentView.swift +1 -1
- package/ios/Generated/OneNativeSwipeActionsActionsView.swift +1 -1
- package/ios/OneNativeComposition.swift +37 -0
- package/package.json +13 -13
- package/src/router/getRoutes.test.ts +16 -0
- package/src/router/getRoutes.ts +7 -2
- package/types/router/getRoutes.d.ts.map +1 -1
|
@@ -87,6 +87,7 @@ class HybridOneNotifications :
|
|
|
87
87
|
NitroModules.applicationContext?.let {
|
|
88
88
|
it.addActivityEventListener(activityListener)
|
|
89
89
|
it.addLifecycleEventListener(this)
|
|
90
|
+
restoreAlarms(it)
|
|
90
91
|
}
|
|
91
92
|
instance = this
|
|
92
93
|
}
|
|
@@ -1011,16 +1012,17 @@ class HybridOneNotifications :
|
|
|
1011
1012
|
)
|
|
1012
1013
|
}
|
|
1013
1014
|
|
|
1014
|
-
//
|
|
1015
|
-
//
|
|
1016
|
-
//
|
|
1015
|
+
// exact needs schedule_exact_alarm from android 12, so there it stays
|
|
1016
|
+
// inexact (bounded to an hour); before 12 an exact alarm needs no
|
|
1017
|
+
// permission and inexact would defer a day-ahead alarm by hours.
|
|
1017
1018
|
private fun setAlarm(context: Context, identifier: String, fireAtMs: Long) {
|
|
1018
1019
|
val manager = context.getSystemService(Context.ALARM_SERVICE) as AlarmManager
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
fireAtMs,
|
|
1022
|
-
|
|
1023
|
-
|
|
1020
|
+
val intent = alarmIntent(context, identifier)
|
|
1021
|
+
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.S) {
|
|
1022
|
+
manager.setExactAndAllowWhileIdle(AlarmManager.RTC_WAKEUP, fireAtMs, intent)
|
|
1023
|
+
} else {
|
|
1024
|
+
manager.setAndAllowWhileIdle(AlarmManager.RTC_WAKEUP, fireAtMs, intent)
|
|
1025
|
+
}
|
|
1024
1026
|
}
|
|
1025
1027
|
|
|
1026
1028
|
private fun cancelAlarm(context: Context, identifier: String) {
|
|
@@ -1306,6 +1308,24 @@ class HybridOneNotifications :
|
|
|
1306
1308
|
instance?.currentListeners()?.onPushToken?.invoke(NativePushToken("android", token))
|
|
1307
1309
|
}
|
|
1308
1310
|
|
|
1311
|
+
// a force stop cancels the app's alarms; opening the app sets the
|
|
1312
|
+
// stored future ones again at their saved dates, restarts repeats that
|
|
1313
|
+
// missed their fire from now, and drops expired one-shots.
|
|
1314
|
+
private fun restoreAlarms(context: Context) {
|
|
1315
|
+
val now = System.currentTimeMillis()
|
|
1316
|
+
for (schedule in loadSchedules(context)) {
|
|
1317
|
+
if (schedule.fireAtMs > now) {
|
|
1318
|
+
setAlarm(context, schedule.identifier, schedule.fireAtMs)
|
|
1319
|
+
} else if (schedule.repeats) {
|
|
1320
|
+
val rearmed = schedule.copy(fireAtMs = now + (schedule.seconds * 1000).toLong())
|
|
1321
|
+
saveSchedule(context, rearmed)
|
|
1322
|
+
setAlarm(context, schedule.identifier, rearmed.fireAtMs)
|
|
1323
|
+
} else {
|
|
1324
|
+
removeSchedule(context, schedule.identifier)
|
|
1325
|
+
}
|
|
1326
|
+
}
|
|
1327
|
+
}
|
|
1328
|
+
|
|
1309
1329
|
// boot entry: future schedules re-arm, repeats restart from now, and
|
|
1310
1330
|
// one-shots that expired while the device was off are dropped.
|
|
1311
1331
|
fun rearmAll(context: Context) {
|
|
@@ -43,7 +43,7 @@ function getRoutes(contextModule, options = {}) {
|
|
|
43
43
|
return null;
|
|
44
44
|
}
|
|
45
45
|
const rootNode = flattenDirectoryTreeToRoutes(directoryTree, options);
|
|
46
|
-
if (!options.ignoreEntryPoints) {
|
|
46
|
+
if (!options.ignoreEntryPoints || options.platform && options.platform !== "web") {
|
|
47
47
|
crawlAndAppendInitialRoutesAndEntryFiles(rootNode, options);
|
|
48
48
|
}
|
|
49
49
|
return rootNode;
|
|
@@ -505,7 +505,9 @@ function getLayoutNode(node, options) {
|
|
|
505
505
|
}
|
|
506
506
|
function crawlAndAppendInitialRoutesAndEntryFiles(node, options, entryPoints = []) {
|
|
507
507
|
if (node.type === "spa" || node.type === "ssg" || node.type === "ssr") {
|
|
508
|
-
|
|
508
|
+
if (!options.ignoreEntryPoints) {
|
|
509
|
+
node.entryPoints = [.../* @__PURE__ */ new Set([...entryPoints, node.contextKey])];
|
|
510
|
+
}
|
|
509
511
|
} else if (node.type === "layout") {
|
|
510
512
|
if (!node.children) {
|
|
511
513
|
throw new Error(`Layout "${node.contextKey}" does not contain any child routes`);
|
|
@@ -46,7 +46,7 @@ function getRoutes(contextModule) {
|
|
|
46
46
|
return null;
|
|
47
47
|
}
|
|
48
48
|
var rootNode = flattenDirectoryTreeToRoutes(directoryTree, options);
|
|
49
|
-
if (!options.ignoreEntryPoints) {
|
|
49
|
+
if (!options.ignoreEntryPoints || options.platform && options.platform !== "web") {
|
|
50
50
|
crawlAndAppendInitialRoutesAndEntryFiles(rootNode, options);
|
|
51
51
|
}
|
|
52
52
|
return rootNode;
|
|
@@ -795,7 +795,9 @@ function getLayoutNode(node, options) {
|
|
|
795
795
|
function crawlAndAppendInitialRoutesAndEntryFiles(node, options) {
|
|
796
796
|
var entryPoints = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [];
|
|
797
797
|
if (node.type === "spa" || node.type === "ssg" || node.type === "ssr") {
|
|
798
|
-
|
|
798
|
+
if (!options.ignoreEntryPoints) {
|
|
799
|
+
node.entryPoints = [.../* @__PURE__ */ new Set([...entryPoints, node.contextKey])];
|
|
800
|
+
}
|
|
799
801
|
} else if (node.type === "layout") {
|
|
800
802
|
if (!node.children) {
|
|
801
803
|
throw new Error(`Layout "${node.contextKey}" does not contain any child routes`);
|
|
@@ -46,7 +46,7 @@ function getRoutes(contextModule) {
|
|
|
46
46
|
return null;
|
|
47
47
|
}
|
|
48
48
|
var rootNode = flattenDirectoryTreeToRoutes(directoryTree, options);
|
|
49
|
-
if (!options.ignoreEntryPoints) {
|
|
49
|
+
if (!options.ignoreEntryPoints || options.platform && options.platform !== "web") {
|
|
50
50
|
crawlAndAppendInitialRoutesAndEntryFiles(rootNode, options);
|
|
51
51
|
}
|
|
52
52
|
return rootNode;
|
|
@@ -795,7 +795,9 @@ function getLayoutNode(node, options) {
|
|
|
795
795
|
function crawlAndAppendInitialRoutesAndEntryFiles(node, options) {
|
|
796
796
|
var entryPoints = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [];
|
|
797
797
|
if (node.type === "spa" || node.type === "ssg" || node.type === "ssr") {
|
|
798
|
-
|
|
798
|
+
if (!options.ignoreEntryPoints) {
|
|
799
|
+
node.entryPoints = [.../* @__PURE__ */ new Set([...entryPoints, node.contextKey])];
|
|
800
|
+
}
|
|
799
801
|
} else if (node.type === "layout") {
|
|
800
802
|
if (!node.children) {
|
|
801
803
|
throw new Error(`Layout "${node.contextKey}" does not contain any child routes`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getRoutes.native.js","names":[],"sources":["cjs/router/getRoutes.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar getRoutes_exports = {};\n__export(getRoutes_exports, {\n extrapolateGroups: () => extrapolateGroups,\n generateDynamic: () => generateDynamic,\n getIgnoreList: () => getIgnoreList,\n getRoutes: () => getRoutes\n});\nmodule.exports = __toCommonJS(getRoutes_exports);\nvar import_config = require(\"../config\");\nvar import_getPageExport = require(\"../utils/getPageExport\");\nvar import_matchers = require(\"./matchers\");\nvar validPlatforms = /* @__PURE__ */ new Set([\n \"android\",\n \"ios\",\n \"linux\",\n \"macos\",\n \"native\",\n \"web\"\n]);\nfunction getRoutes(contextModule) {\n var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};\n var directoryTree = getDirectoryTree(contextModule, options);\n if (!directoryTree) {\n return null;\n }\n var rootNode = flattenDirectoryTreeToRoutes(directoryTree, options);\n if (!options.ignoreEntryPoints) {\n crawlAndAppendInitialRoutesAndEntryFiles(rootNode, options);\n }\n return rootNode;\n}\nfunction getDirectoryTree(contextModule, options) {\n var importMode = options.importMode || process.env.One_ROUTER_IMPORT_MODE;\n var ignoreList = [\n /^\\.\\/\\+html\\.[tj]sx?$/,\n // Ignore the top level ./+html file\n /\\.d\\.ts$/\n ];\n if (options.ignore) {\n ignoreList.push(...options.ignore);\n }\n if (!options.preserveApiRoutes) {\n ignoreList.push(/\\+api\\.[tj]sx?$/);\n }\n var rootDirectory = {\n files: /* @__PURE__ */ new Map(),\n subdirectories: /* @__PURE__ */ new Map(),\n slots: /* @__PURE__ */ new Map()\n };\n var hasRoutes = false;\n var isValid = false;\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n var _loop = function() {\n var filePath = _step.value;\n if (ignoreList.some(function(regex) {\n return regex.test(filePath);\n })) {\n return \"continue\";\n }\n isValid = true;\n var parentRenderMode = void 0;\n var pathParts = filePath.replace(/^\\.\\//, \"\").split(\"/\");\n var directoryParts = pathParts.slice(0, -1);\n var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;\n try {\n for (var _iterator2 = directoryParts[Symbol.iterator](), _step1; !(_iteratorNormalCompletion2 = (_step1 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var part = _step1.value;\n var dirRenderMode = (0, import_matchers.matchDirectoryRenderMode)(part);\n if (dirRenderMode) {\n parentRenderMode = dirRenderMode.renderMode;\n }\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return != null) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n var meta = getFileMeta(filePath, options, parentRenderMode);\n if (meta.specificity < 0) {\n return \"continue\";\n }\n var type = meta.isLayout ? \"layout\" : meta.renderMode || (0, import_config.getDefaultRenderMode)();\n var layoutRenderMode = meta.isLayout && meta.renderMode && meta.renderMode !== \"api\" ? meta.renderMode : void 0;\n var node = {\n type,\n // store layout render mode if this is a layout with an explicit mode\n ...layoutRenderMode && {\n layoutRenderMode\n },\n loadRoute() {\n if (options.ignoreRequireErrors) {\n try {\n return contextModule(filePath);\n } catch (unused) {\n return {};\n }\n } else {\n return contextModule(filePath);\n }\n },\n contextKey: filePath,\n route: \"\",\n // This is overwritten during hoisting based upon the _layout\n dynamic: null,\n children: []\n };\n if (process.env.NODE_ENV === \"development\") {\n if (node.type !== \"api\" && importMode === \"sync\") {\n if (!(0, import_getPageExport.getPageExport)(node.loadRoute())) {\n return \"continue\";\n }\n }\n }\n var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;\n try {\n for (var _iterator1 = extrapolateGroups(meta.route)[Symbol.iterator](), _step2; !(_iteratorNormalCompletion1 = (_step2 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {\n var route = _step2.value;\n var subdirectoryParts = route.split(\"/\").slice(0, -1);\n var directory = rootDirectory;\n var _iteratorNormalCompletion22 = true, _didIteratorError22 = false, _iteratorError22 = void 0;\n try {\n for (var _iterator22 = subdirectoryParts[Symbol.iterator](), _step3; !(_iteratorNormalCompletion22 = (_step3 = _iterator22.next()).done); _iteratorNormalCompletion22 = true) {\n var part1 = _step3.value;\n var slotName = (0, import_matchers.matchSlotName)(part1);\n if (slotName) {\n var slotDirectory = directory.slots.get(slotName);\n if (!slotDirectory) {\n slotDirectory = {\n files: /* @__PURE__ */ new Map(),\n subdirectories: /* @__PURE__ */ new Map(),\n slots: /* @__PURE__ */ new Map()\n };\n directory.slots.set(slotName, slotDirectory);\n }\n directory = slotDirectory;\n } else {\n var _ref;\n var dirRenderMode1 = (0, import_matchers.matchDirectoryRenderMode)(part1);\n var dirName = (_ref = dirRenderMode1 === null || dirRenderMode1 === void 0 ? void 0 : dirRenderMode1.name) !== null && _ref !== void 0 ? _ref : part1;\n var subDirectory = directory.subdirectories.get(dirName);\n if (!subDirectory) {\n subDirectory = {\n files: /* @__PURE__ */ new Map(),\n subdirectories: /* @__PURE__ */ new Map(),\n slots: /* @__PURE__ */ new Map(),\n renderMode: dirRenderMode1 === null || dirRenderMode1 === void 0 ? void 0 : dirRenderMode1.renderMode\n };\n directory.subdirectories.set(dirName, subDirectory);\n }\n directory = subDirectory;\n }\n }\n } catch (err) {\n _didIteratorError22 = true;\n _iteratorError22 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion22 && _iterator22.return != null) {\n _iterator22.return();\n }\n } finally {\n if (_didIteratorError22) {\n throw _iteratorError22;\n }\n }\n }\n node = {\n ...node,\n route,\n slotName: meta.slotName,\n intercept: meta.interceptMatch ? {\n levels: meta.interceptMatch.levels,\n targetPath: meta.interceptMatch.targetPath\n } : void 0\n };\n if (meta.isLayout) {\n var _directory, _layout;\n (_layout = (_directory = directory).layout) !== null && _layout !== void 0 ? _layout : _directory.layout = [];\n var existing = directory.layout[meta.specificity];\n if (existing) {\n if (process.env.NODE_ENV !== \"production\") {\n throw new Error(`The layouts \"${filePath}\" and \"${existing.contextKey}\" conflict on the route \"/${route}\". Please remove or rename one of these files.`);\n }\n } else {\n node = getLayoutNode(node, options);\n directory.layout[meta.specificity] = node;\n }\n } else if (meta.isMiddleware) {\n directory.middleware = node;\n } else if (type === \"api\") {\n var fileKey = `${route}+api`;\n var nodes = directory.files.get(fileKey);\n if (!nodes) {\n nodes = [];\n directory.files.set(fileKey, nodes);\n }\n var existing1 = nodes[0];\n if (existing1) {\n if (process.env.NODE_ENV !== \"production\") {\n throw new Error(`The API route file \"${filePath}\" and \"${existing1.contextKey}\" conflict on the route \"/${route}\". Please remove or rename one of these files.`);\n }\n } else {\n nodes[0] = node;\n }\n } else {\n var nodes1 = directory.files.get(route);\n if (!nodes1) {\n nodes1 = [];\n directory.files.set(route, nodes1);\n }\n var existing2 = nodes1[meta.specificity];\n if (existing2) {\n if (process.env.NODE_ENV !== \"production\") {\n throw new Error(`The route files \"${filePath}\" and \"${existing2.contextKey}\" conflict on the route \"/${route}\". Please remove or rename one of these files.`);\n }\n } else {\n hasRoutes || (hasRoutes = true);\n nodes1[meta.specificity] = node;\n }\n }\n }\n } catch (err) {\n _didIteratorError1 = true;\n _iteratorError1 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion1 && _iterator1.return != null) {\n _iterator1.return();\n }\n } finally {\n if (_didIteratorError1) {\n throw _iteratorError1;\n }\n }\n }\n };\n for (var _iterator = contextModule.keys()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) _loop();\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n if (!isValid) {\n return null;\n }\n if (!rootDirectory.layout) {\n rootDirectory.layout = [\n {\n type: \"layout\",\n loadRoute: function loadRoute() {\n return {\n default: (function() {\n try {\n return require(\"../views/Navigator\");\n } catch (e) {\n return {\n DefaultNavigator: function DefaultNavigator() {\n throw e;\n }\n };\n }\n })().DefaultNavigator\n };\n },\n // Generate a fake file name for the directory\n contextKey: \"router/build/views/Navigator.js\",\n route: \"\",\n generated: true,\n dynamic: null,\n children: []\n }\n ];\n }\n if (hasRoutes) {\n appendSitemapRoute(rootDirectory);\n }\n appendNotFoundRoute(rootDirectory);\n return rootDirectory;\n}\nfunction flattenDirectoryTreeToRoutes(directory, options, layout) {\n var pathToRemove = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : \"\", parentMiddlewares = arguments.length > 4 ? arguments[4] : void 0;\n if (directory.layout) {\n var previousLayout = layout;\n layout = getMostSpecific(directory.layout);\n if (previousLayout) {\n previousLayout.children.push(layout);\n }\n var newRoute = layout.route.replace(pathToRemove, \"\");\n pathToRemove = layout.route ? `${layout.route}/` : \"\";\n layout.route = newRoute;\n layout.dynamic = generateDynamic(layout.route);\n }\n if (!layout) throw new Error(\"One Internal Error: No nearest layout\");\n var middlewares = directory.middleware ? [\n ...parentMiddlewares || [],\n directory.middleware\n ] : parentMiddlewares;\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = directory.files.values()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var routes = _step.value;\n var routeNode = getMostSpecific(routes);\n routeNode.route = routeNode.route.replace(pathToRemove, \"\");\n routeNode.dynamic = generateDynamic(routeNode.route);\n routeNode.middlewares = middlewares;\n layout.children.push(routeNode);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;\n try {\n for (var _iterator1 = directory.subdirectories.values()[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {\n var child = _step1.value;\n flattenDirectoryTreeToRoutes(child, options, layout, pathToRemove, middlewares);\n }\n } catch (err) {\n _didIteratorError1 = true;\n _iteratorError1 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion1 && _iterator1.return != null) {\n _iterator1.return();\n }\n } finally {\n if (_didIteratorError1) {\n throw _iteratorError1;\n }\n }\n }\n if (directory.slots.size > 0) {\n layout.slots = /* @__PURE__ */ new Map();\n var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;\n try {\n for (var _iterator2 = directory.slots[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var [slotName, slotDir] = _step2.value;\n var slotConfig = flattenSlotDirectory(slotDir, slotName, options, pathToRemove);\n layout.slots.set(slotName, slotConfig);\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return != null) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n }\n return layout;\n}\nfunction flattenSlotDirectory(directory, slotName, options, pathToRemove) {\n var interceptRoutes = [];\n var defaultRoute;\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = directory.files.values()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var routes = _step.value;\n var routeNode = getMostSpecific(routes);\n var cleanRoute = routeNode.route.replace(pathToRemove, \"\");\n cleanRoute = cleanRoute.split(\"/\").filter(function(segment) {\n return !(0, import_matchers.matchSlotName)(segment);\n }).map(function(segment) {\n return (0, import_matchers.stripInterceptPrefix)(segment);\n }).join(\"/\");\n if (cleanRoute.endsWith(\"default\") || cleanRoute === \"default\") {\n defaultRoute = {\n ...routeNode,\n route: cleanRoute,\n slotName,\n dynamic: generateDynamic(cleanRoute)\n };\n } else {\n interceptRoutes.push({\n ...routeNode,\n route: cleanRoute,\n slotName,\n dynamic: generateDynamic(cleanRoute)\n });\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;\n try {\n for (var _iterator1 = directory.subdirectories[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {\n var [subDirName, subDir] = _step1.value;\n var subRoutes = flattenSlotSubdirectory(subDir, slotName, options, pathToRemove, subDirName);\n interceptRoutes.push(...subRoutes);\n }\n } catch (err) {\n _didIteratorError1 = true;\n _iteratorError1 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion1 && _iterator1.return != null) {\n _iterator1.return();\n }\n } finally {\n if (_didIteratorError1) {\n throw _iteratorError1;\n }\n }\n }\n return {\n name: slotName,\n defaultRoute,\n interceptRoutes\n };\n}\nfunction flattenSlotSubdirectory(directory, slotName, options, pathToRemove, currentPath) {\n var routes = [];\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = directory.files.values()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var fileRoutes = _step.value;\n var routeNode = getMostSpecific(fileRoutes);\n var cleanRoute = routeNode.route.replace(pathToRemove, \"\");\n cleanRoute = cleanRoute.split(\"/\").filter(function(segment) {\n return !(0, import_matchers.matchSlotName)(segment);\n }).map(function(segment) {\n return (0, import_matchers.stripInterceptPrefix)(segment);\n }).join(\"/\");\n routes.push({\n ...routeNode,\n route: cleanRoute,\n slotName,\n dynamic: generateDynamic(cleanRoute)\n });\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;\n try {\n for (var _iterator1 = directory.subdirectories[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {\n var [subDirName, subDir] = _step1.value;\n var subPath = currentPath ? `${currentPath}/${subDirName}` : subDirName;\n routes.push(...flattenSlotSubdirectory(subDir, slotName, options, pathToRemove, subPath));\n }\n } catch (err) {\n _didIteratorError1 = true;\n _iteratorError1 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion1 && _iterator1.return != null) {\n _iterator1.return();\n }\n } finally {\n if (_didIteratorError1) {\n throw _iteratorError1;\n }\n }\n }\n return routes;\n}\nfunction getFileMeta(key, options, parentRenderMode) {\n var _options_platformRoutes;\n key = key.replace(/^\\.\\//, \"\");\n var parts = key.split(\"/\");\n var route = (0, import_matchers.removeSupportedExtensions)(key);\n var filename = parts[parts.length - 1];\n var filenameWithoutExtensions = (0, import_matchers.removeSupportedExtensions)(filename);\n var isLayout = filenameWithoutExtensions.startsWith(\"_layout\");\n var isMiddleware = filenameWithoutExtensions.startsWith(\"_middleware\");\n var fileRenderMode = (0, import_matchers.matchFileRenderMode)(filename);\n var renderMode = fileRenderMode !== null && fileRenderMode !== void 0 ? fileRenderMode : parentRenderMode;\n route = route.split(\"/\").map(function(segment) {\n var dirRenderMode = (0, import_matchers.matchDirectoryRenderMode)(segment);\n return dirRenderMode ? dirRenderMode.name : segment;\n }).join(\"/\");\n if (filenameWithoutExtensions.startsWith(\"(\") && filenameWithoutExtensions.endsWith(\")\")) {\n throw new Error(`Invalid route ./${key}. Routes cannot end with '(group)' syntax`);\n }\n if (renderMode !== \"api\" && filename.startsWith(\"+\") && filenameWithoutExtensions !== \"+not-found\") {\n var renamedRoute = [\n ...parts.slice(0, -1),\n filename.slice(1)\n ].join(\"/\");\n throw new Error(`Invalid route ./${key}. Route nodes cannot start with the '+' character. \"Please rename to ${renamedRoute}\"`);\n }\n var slotName;\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = parts[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var part = _step.value;\n var match = (0, import_matchers.matchSlotName)(part);\n if (match) {\n slotName = match;\n break;\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n var interceptMatch;\n for (var i = 0; i < parts.length; i++) {\n var part1 = parts[i];\n var match1 = (0, import_matchers.matchInterceptPrefix)(part1);\n if (match1) {\n var remainingParts = parts.slice(i + 1).map(function(p) {\n return (0, import_matchers.removeSupportedExtensions)(p);\n }).filter(function(p) {\n return p !== \"index\";\n });\n var fullTargetPath = [\n match1.targetPath,\n ...remainingParts\n ].filter(Boolean).join(\"/\");\n interceptMatch = {\n ...match1,\n targetPath: fullTargetPath\n };\n break;\n }\n }\n var specificity = 0;\n var platformExtension = filenameWithoutExtensions.split(\".\")[1];\n var hasPlatformExtension = validPlatforms.has(platformExtension);\n var usePlatformRoutes = (_options_platformRoutes = options.platformRoutes) !== null && _options_platformRoutes !== void 0 ? _options_platformRoutes : true;\n if (hasPlatformExtension) {\n if (!usePlatformRoutes) {\n specificity = -1;\n } else if (!options.platform) {\n specificity = -1;\n } else if (platformExtension === options.platform) {\n specificity = 2;\n } else if (platformExtension === \"native\" && options.platform !== \"web\") {\n specificity = 1;\n } else if (platformExtension !== options.platform) {\n specificity = -1;\n }\n if (renderMode === \"api\" && specificity !== 0) {\n throw new Error(`Api routes cannot have platform extensions. Please remove '.${platformExtension}' from './${key}'`);\n }\n route = route.replace(new RegExp(`.${platformExtension}$`), \"\");\n }\n return {\n route,\n specificity,\n isLayout,\n isMiddleware,\n renderMode,\n slotName,\n interceptMatch\n };\n}\nfunction getMostSpecific(routes) {\n var route = routes[routes.length - 1];\n if (!routes[0]) {\n 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}):\n${routes.map(function(r) {\n return r.contextKey || \"NONE\";\n }).join(\"\\n\")}.`);\n }\n return route;\n}\nfunction getIgnoreList(options) {\n var _ref;\n var ignore = [\n /^\\.\\/\\+html\\.[tj]sx?$/,\n ...(_ref = options === null || options === void 0 ? void 0 : options.ignore) !== null && _ref !== void 0 ? _ref : []\n ];\n if ((options === null || options === void 0 ? void 0 : options.preserveApiRoutes) !== true) {\n ignore.push(/\\+api\\.[tj]sx?$/);\n }\n return ignore;\n}\nfunction extrapolateGroups(key) {\n var keys = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : /* @__PURE__ */ new Set();\n var match = (0, import_matchers.matchArrayGroupName)(key);\n if (!match) {\n keys.add(key);\n return keys;\n }\n var groups = match.split(\",\");\n var groupsSet = new Set(groups);\n if (groupsSet.size !== groups.length) {\n throw new Error(`Array syntax cannot contain duplicate group name \"${groups}\" in \"${key}\".`);\n }\n if (groups.length === 1) {\n keys.add(key);\n return keys;\n }\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = groups[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var group = _step.value;\n extrapolateGroups(key.replace(match, group.trim()), keys);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n return keys;\n}\nfunction generateDynamic(path) {\n var dynamic = path.split(\"/\").map(function(part) {\n if (part === \"+not-found\") {\n return {\n name: \"+not-found\",\n deep: true,\n notFound: true\n };\n }\n var dynamicMatch = (0, import_matchers.matchDynamicName)(part);\n if (!dynamicMatch) return null;\n return {\n name: dynamicMatch.name,\n deep: dynamicMatch.deep\n };\n }).filter(function(part) {\n return !!part;\n });\n return dynamic.length === 0 ? null : dynamic;\n}\nfunction appendSitemapRoute(directory) {\n if (!directory.files.has(\"_sitemap\")) {\n directory.files.set(\"_sitemap\", [\n {\n loadRoute() {\n return {\n default: function _default() {\n return null;\n },\n getNavOptions: function getNavOptions() {\n }\n };\n },\n route: \"_sitemap\",\n type: \"ssg\",\n contextKey: \"\",\n generated: true,\n internal: true,\n dynamic: null,\n children: []\n }\n ]);\n }\n}\nfunction hasNotFoundInGroupSubdirs(directory) {\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = directory.subdirectories[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var [dirName, subDir] = _step.value;\n if (!(0, import_matchers.matchGroupName)(dirName)) continue;\n var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;\n try {\n for (var _iterator1 = subDir.files.keys()[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {\n var fileKey = _step1.value;\n if (fileKey.endsWith(\"+not-found\")) {\n return true;\n }\n }\n } catch (err) {\n _didIteratorError1 = true;\n _iteratorError1 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion1 && _iterator1.return != null) {\n _iterator1.return();\n }\n } finally {\n if (_didIteratorError1) {\n throw _iteratorError1;\n }\n }\n }\n if (hasNotFoundInGroupSubdirs(subDir)) {\n return true;\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n return false;\n}\nfunction appendNotFoundRoute(directory) {\n if (!directory.files.has(\"+not-found\") && !hasNotFoundInGroupSubdirs(directory)) {\n directory.files.set(\"+not-found\", [\n {\n loadRoute() {\n return {\n default: function _default() {\n return null;\n }\n };\n },\n type: \"spa\",\n route: \"+not-found\",\n contextKey: \"\",\n generated: true,\n internal: true,\n dynamic: [\n {\n name: \"+not-found\",\n deep: true,\n notFound: true\n }\n ],\n children: []\n }\n ]);\n }\n}\nfunction getLayoutNode(node, options) {\n var groupName = (0, import_matchers.matchGroupName)(node.route);\n var childMatchingGroup = node.children.find(function(child) {\n return child.route.replace(/\\/index$/, \"\") === groupName;\n });\n var initialRouteName = childMatchingGroup === null || childMatchingGroup === void 0 ? void 0 : childMatchingGroup.route;\n return {\n ...node,\n route: node.route.replace(/\\/?_layout$/, \"\"),\n children: [],\n // Each layout should have its own children\n initialRouteName\n };\n}\nfunction crawlAndAppendInitialRoutesAndEntryFiles(node, options) {\n var entryPoints = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [];\n if (node.type === \"spa\" || node.type === \"ssg\" || node.type === \"ssr\") {\n node.entryPoints = [\n .../* @__PURE__ */ new Set([\n ...entryPoints,\n node.contextKey\n ])\n ];\n } else if (node.type === \"layout\") {\n if (!node.children) {\n throw new Error(`Layout \"${node.contextKey}\" does not contain any child routes`);\n }\n entryPoints = [\n ...entryPoints,\n node.contextKey\n ];\n var groupName = (0, import_matchers.matchGroupName)(node.route);\n var childMatchingGroup = node.children.find(function(child2) {\n return child2.route.replace(/\\/index$/, \"\") === groupName;\n });\n var initialRouteName = childMatchingGroup === null || childMatchingGroup === void 0 ? void 0 : childMatchingGroup.route;\n var loaded = node.loadRoute();\n if (loaded === null || loaded === void 0 ? void 0 : loaded.unstable_settings) {\n var _loaded_unstable_settings_initialRouteName;\n initialRouteName = (_loaded_unstable_settings_initialRouteName = loaded.unstable_settings.initialRouteName) !== null && _loaded_unstable_settings_initialRouteName !== void 0 ? _loaded_unstable_settings_initialRouteName : initialRouteName;\n if (groupName) {\n var _loaded_unstable_settings_groupName, _loaded_unstable_settings;\n var groupSpecificInitialRouteName = (_loaded_unstable_settings = loaded.unstable_settings) === null || _loaded_unstable_settings === void 0 ? void 0 : (_loaded_unstable_settings_groupName = _loaded_unstable_settings[groupName]) === null || _loaded_unstable_settings_groupName === void 0 ? void 0 : _loaded_unstable_settings_groupName.initialRouteName;\n initialRouteName = groupSpecificInitialRouteName !== null && groupSpecificInitialRouteName !== void 0 ? groupSpecificInitialRouteName : initialRouteName;\n }\n }\n if (initialRouteName) {\n var initialRoute = node.children.find(function(child2) {\n return child2.route === initialRouteName;\n });\n if (!initialRoute) {\n var validInitialRoutes = node.children.filter(function(child2) {\n return !child2.generated;\n }).map(function(child2) {\n return `'${child2.route}'`;\n }).join(\", \");\n if (groupName) {\n throw new Error(`Layout ${node.contextKey} has invalid initialRouteName '${initialRouteName}' for group '(${groupName})'. Valid options are: ${validInitialRoutes}`);\n }\n throw new Error(`Layout ${node.contextKey} has invalid initialRouteName '${initialRouteName}'. Valid options are: ${validInitialRoutes}`);\n }\n node.initialRouteName = initialRouteName;\n entryPoints.push(initialRoute.contextKey);\n }\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = node.children[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var child = _step.value;\n crawlAndAppendInitialRoutesAndEntryFiles(child, options, entryPoints);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n }\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1B,CAAC,CAAC,CAAC,KAAK,IAAI;IACZ,IAAI,WAAW;KACb,MAAM,IAAI,MAAM,UAAU,KAAK,WAAW,iCAAiC,iBAAiB,gBAAgB,UAAU,yBAAyB,oBAAoB;IACrK;IACA,MAAM,IAAI,MAAM,UAAU,KAAK,WAAW,iCAAiC,iBAAiB,wBAAwB,oBAAoB;GAC1I;GACA,KAAK,mBAAmB;GACxB,YAAY,KAAK,aAAa,UAAU;EAC1C;EACA,IAAI,4BAA4B,MAAM,oBAAoB,OAAO,iBAAiB,KAAK;EACvF,IAAI;GACF,KAAK,IAAI,YAAY,KAAK,SAAS,OAAO,SAAS,CAAC,GAAG,OAAO,EAAE,6BAA6B,QAAQ,UAAU,KAAK,EAAC,CAAE,OAAO,4BAA4B,MAAM;IAC9J,IAAI,QAAQ,MAAM;IAClB,yCAAyC,OAAO,SAAS,WAAW;GACtE;EACF,SAAS,KAAK;GACZ,oBAAoB;GACpB,iBAAiB;EACnB,UAAU;GACR,IAAI;IACF,IAAI,CAAC,6BAA6B,UAAU,UAAU,MAAM;KAC1D,UAAU,OAAO;IACnB;GACF,UAAU;IACR,IAAI,mBAAmB;KACrB,MAAM;IACR;GACF;EACF;CACF;AACF"}
|
|
1
|
+
{"version":3,"file":"getRoutes.native.js","names":[],"sources":["cjs/router/getRoutes.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar getRoutes_exports = {};\n__export(getRoutes_exports, {\n extrapolateGroups: () => extrapolateGroups,\n generateDynamic: () => generateDynamic,\n getIgnoreList: () => getIgnoreList,\n getRoutes: () => getRoutes\n});\nmodule.exports = __toCommonJS(getRoutes_exports);\nvar import_config = require(\"../config\");\nvar import_getPageExport = require(\"../utils/getPageExport\");\nvar import_matchers = require(\"./matchers\");\nvar validPlatforms = /* @__PURE__ */ new Set([\n \"android\",\n \"ios\",\n \"linux\",\n \"macos\",\n \"native\",\n \"web\"\n]);\nfunction getRoutes(contextModule) {\n var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};\n var directoryTree = getDirectoryTree(contextModule, options);\n if (!directoryTree) {\n return null;\n }\n var rootNode = flattenDirectoryTreeToRoutes(directoryTree, options);\n if (!options.ignoreEntryPoints || options.platform && options.platform !== \"web\") {\n crawlAndAppendInitialRoutesAndEntryFiles(rootNode, options);\n }\n return rootNode;\n}\nfunction getDirectoryTree(contextModule, options) {\n var importMode = options.importMode || process.env.One_ROUTER_IMPORT_MODE;\n var ignoreList = [\n /^\\.\\/\\+html\\.[tj]sx?$/,\n // Ignore the top level ./+html file\n /\\.d\\.ts$/\n ];\n if (options.ignore) {\n ignoreList.push(...options.ignore);\n }\n if (!options.preserveApiRoutes) {\n ignoreList.push(/\\+api\\.[tj]sx?$/);\n }\n var rootDirectory = {\n files: /* @__PURE__ */ new Map(),\n subdirectories: /* @__PURE__ */ new Map(),\n slots: /* @__PURE__ */ new Map()\n };\n var hasRoutes = false;\n var isValid = false;\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n var _loop = function() {\n var filePath = _step.value;\n if (ignoreList.some(function(regex) {\n return regex.test(filePath);\n })) {\n return \"continue\";\n }\n isValid = true;\n var parentRenderMode = void 0;\n var pathParts = filePath.replace(/^\\.\\//, \"\").split(\"/\");\n var directoryParts = pathParts.slice(0, -1);\n var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;\n try {\n for (var _iterator2 = directoryParts[Symbol.iterator](), _step1; !(_iteratorNormalCompletion2 = (_step1 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var part = _step1.value;\n var dirRenderMode = (0, import_matchers.matchDirectoryRenderMode)(part);\n if (dirRenderMode) {\n parentRenderMode = dirRenderMode.renderMode;\n }\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return != null) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n var meta = getFileMeta(filePath, options, parentRenderMode);\n if (meta.specificity < 0) {\n return \"continue\";\n }\n var type = meta.isLayout ? \"layout\" : meta.renderMode || (0, import_config.getDefaultRenderMode)();\n var layoutRenderMode = meta.isLayout && meta.renderMode && meta.renderMode !== \"api\" ? meta.renderMode : void 0;\n var node = {\n type,\n // store layout render mode if this is a layout with an explicit mode\n ...layoutRenderMode && {\n layoutRenderMode\n },\n loadRoute() {\n if (options.ignoreRequireErrors) {\n try {\n return contextModule(filePath);\n } catch (unused) {\n return {};\n }\n } else {\n return contextModule(filePath);\n }\n },\n contextKey: filePath,\n route: \"\",\n // This is overwritten during hoisting based upon the _layout\n dynamic: null,\n children: []\n };\n if (process.env.NODE_ENV === \"development\") {\n if (node.type !== \"api\" && importMode === \"sync\") {\n if (!(0, import_getPageExport.getPageExport)(node.loadRoute())) {\n return \"continue\";\n }\n }\n }\n var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;\n try {\n for (var _iterator1 = extrapolateGroups(meta.route)[Symbol.iterator](), _step2; !(_iteratorNormalCompletion1 = (_step2 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {\n var route = _step2.value;\n var subdirectoryParts = route.split(\"/\").slice(0, -1);\n var directory = rootDirectory;\n var _iteratorNormalCompletion22 = true, _didIteratorError22 = false, _iteratorError22 = void 0;\n try {\n for (var _iterator22 = subdirectoryParts[Symbol.iterator](), _step3; !(_iteratorNormalCompletion22 = (_step3 = _iterator22.next()).done); _iteratorNormalCompletion22 = true) {\n var part1 = _step3.value;\n var slotName = (0, import_matchers.matchSlotName)(part1);\n if (slotName) {\n var slotDirectory = directory.slots.get(slotName);\n if (!slotDirectory) {\n slotDirectory = {\n files: /* @__PURE__ */ new Map(),\n subdirectories: /* @__PURE__ */ new Map(),\n slots: /* @__PURE__ */ new Map()\n };\n directory.slots.set(slotName, slotDirectory);\n }\n directory = slotDirectory;\n } else {\n var _ref;\n var dirRenderMode1 = (0, import_matchers.matchDirectoryRenderMode)(part1);\n var dirName = (_ref = dirRenderMode1 === null || dirRenderMode1 === void 0 ? void 0 : dirRenderMode1.name) !== null && _ref !== void 0 ? _ref : part1;\n var subDirectory = directory.subdirectories.get(dirName);\n if (!subDirectory) {\n subDirectory = {\n files: /* @__PURE__ */ new Map(),\n subdirectories: /* @__PURE__ */ new Map(),\n slots: /* @__PURE__ */ new Map(),\n renderMode: dirRenderMode1 === null || dirRenderMode1 === void 0 ? void 0 : dirRenderMode1.renderMode\n };\n directory.subdirectories.set(dirName, subDirectory);\n }\n directory = subDirectory;\n }\n }\n } catch (err) {\n _didIteratorError22 = true;\n _iteratorError22 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion22 && _iterator22.return != null) {\n _iterator22.return();\n }\n } finally {\n if (_didIteratorError22) {\n throw _iteratorError22;\n }\n }\n }\n node = {\n ...node,\n route,\n slotName: meta.slotName,\n intercept: meta.interceptMatch ? {\n levels: meta.interceptMatch.levels,\n targetPath: meta.interceptMatch.targetPath\n } : void 0\n };\n if (meta.isLayout) {\n var _directory, _layout;\n (_layout = (_directory = directory).layout) !== null && _layout !== void 0 ? _layout : _directory.layout = [];\n var existing = directory.layout[meta.specificity];\n if (existing) {\n if (process.env.NODE_ENV !== \"production\") {\n throw new Error(`The layouts \"${filePath}\" and \"${existing.contextKey}\" conflict on the route \"/${route}\". Please remove or rename one of these files.`);\n }\n } else {\n node = getLayoutNode(node, options);\n directory.layout[meta.specificity] = node;\n }\n } else if (meta.isMiddleware) {\n directory.middleware = node;\n } else if (type === \"api\") {\n var fileKey = `${route}+api`;\n var nodes = directory.files.get(fileKey);\n if (!nodes) {\n nodes = [];\n directory.files.set(fileKey, nodes);\n }\n var existing1 = nodes[0];\n if (existing1) {\n if (process.env.NODE_ENV !== \"production\") {\n throw new Error(`The API route file \"${filePath}\" and \"${existing1.contextKey}\" conflict on the route \"/${route}\". Please remove or rename one of these files.`);\n }\n } else {\n nodes[0] = node;\n }\n } else {\n var nodes1 = directory.files.get(route);\n if (!nodes1) {\n nodes1 = [];\n directory.files.set(route, nodes1);\n }\n var existing2 = nodes1[meta.specificity];\n if (existing2) {\n if (process.env.NODE_ENV !== \"production\") {\n throw new Error(`The route files \"${filePath}\" and \"${existing2.contextKey}\" conflict on the route \"/${route}\". Please remove or rename one of these files.`);\n }\n } else {\n hasRoutes || (hasRoutes = true);\n nodes1[meta.specificity] = node;\n }\n }\n }\n } catch (err) {\n _didIteratorError1 = true;\n _iteratorError1 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion1 && _iterator1.return != null) {\n _iterator1.return();\n }\n } finally {\n if (_didIteratorError1) {\n throw _iteratorError1;\n }\n }\n }\n };\n for (var _iterator = contextModule.keys()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) _loop();\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n if (!isValid) {\n return null;\n }\n if (!rootDirectory.layout) {\n rootDirectory.layout = [\n {\n type: \"layout\",\n loadRoute: function loadRoute() {\n return {\n default: (function() {\n try {\n return require(\"../views/Navigator\");\n } catch (e) {\n return {\n DefaultNavigator: function DefaultNavigator() {\n throw e;\n }\n };\n }\n })().DefaultNavigator\n };\n },\n // Generate a fake file name for the directory\n contextKey: \"router/build/views/Navigator.js\",\n route: \"\",\n generated: true,\n dynamic: null,\n children: []\n }\n ];\n }\n if (hasRoutes) {\n appendSitemapRoute(rootDirectory);\n }\n appendNotFoundRoute(rootDirectory);\n return rootDirectory;\n}\nfunction flattenDirectoryTreeToRoutes(directory, options, layout) {\n var pathToRemove = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : \"\", parentMiddlewares = arguments.length > 4 ? arguments[4] : void 0;\n if (directory.layout) {\n var previousLayout = layout;\n layout = getMostSpecific(directory.layout);\n if (previousLayout) {\n previousLayout.children.push(layout);\n }\n var newRoute = layout.route.replace(pathToRemove, \"\");\n pathToRemove = layout.route ? `${layout.route}/` : \"\";\n layout.route = newRoute;\n layout.dynamic = generateDynamic(layout.route);\n }\n if (!layout) throw new Error(\"One Internal Error: No nearest layout\");\n var middlewares = directory.middleware ? [\n ...parentMiddlewares || [],\n directory.middleware\n ] : parentMiddlewares;\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = directory.files.values()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var routes = _step.value;\n var routeNode = getMostSpecific(routes);\n routeNode.route = routeNode.route.replace(pathToRemove, \"\");\n routeNode.dynamic = generateDynamic(routeNode.route);\n routeNode.middlewares = middlewares;\n layout.children.push(routeNode);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;\n try {\n for (var _iterator1 = directory.subdirectories.values()[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {\n var child = _step1.value;\n flattenDirectoryTreeToRoutes(child, options, layout, pathToRemove, middlewares);\n }\n } catch (err) {\n _didIteratorError1 = true;\n _iteratorError1 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion1 && _iterator1.return != null) {\n _iterator1.return();\n }\n } finally {\n if (_didIteratorError1) {\n throw _iteratorError1;\n }\n }\n }\n if (directory.slots.size > 0) {\n layout.slots = /* @__PURE__ */ new Map();\n var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;\n try {\n for (var _iterator2 = directory.slots[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var [slotName, slotDir] = _step2.value;\n var slotConfig = flattenSlotDirectory(slotDir, slotName, options, pathToRemove);\n layout.slots.set(slotName, slotConfig);\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return != null) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n }\n return layout;\n}\nfunction flattenSlotDirectory(directory, slotName, options, pathToRemove) {\n var interceptRoutes = [];\n var defaultRoute;\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = directory.files.values()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var routes = _step.value;\n var routeNode = getMostSpecific(routes);\n var cleanRoute = routeNode.route.replace(pathToRemove, \"\");\n cleanRoute = cleanRoute.split(\"/\").filter(function(segment) {\n return !(0, import_matchers.matchSlotName)(segment);\n }).map(function(segment) {\n return (0, import_matchers.stripInterceptPrefix)(segment);\n }).join(\"/\");\n if (cleanRoute.endsWith(\"default\") || cleanRoute === \"default\") {\n defaultRoute = {\n ...routeNode,\n route: cleanRoute,\n slotName,\n dynamic: generateDynamic(cleanRoute)\n };\n } else {\n interceptRoutes.push({\n ...routeNode,\n route: cleanRoute,\n slotName,\n dynamic: generateDynamic(cleanRoute)\n });\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;\n try {\n for (var _iterator1 = directory.subdirectories[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {\n var [subDirName, subDir] = _step1.value;\n var subRoutes = flattenSlotSubdirectory(subDir, slotName, options, pathToRemove, subDirName);\n interceptRoutes.push(...subRoutes);\n }\n } catch (err) {\n _didIteratorError1 = true;\n _iteratorError1 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion1 && _iterator1.return != null) {\n _iterator1.return();\n }\n } finally {\n if (_didIteratorError1) {\n throw _iteratorError1;\n }\n }\n }\n return {\n name: slotName,\n defaultRoute,\n interceptRoutes\n };\n}\nfunction flattenSlotSubdirectory(directory, slotName, options, pathToRemove, currentPath) {\n var routes = [];\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = directory.files.values()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var fileRoutes = _step.value;\n var routeNode = getMostSpecific(fileRoutes);\n var cleanRoute = routeNode.route.replace(pathToRemove, \"\");\n cleanRoute = cleanRoute.split(\"/\").filter(function(segment) {\n return !(0, import_matchers.matchSlotName)(segment);\n }).map(function(segment) {\n return (0, import_matchers.stripInterceptPrefix)(segment);\n }).join(\"/\");\n routes.push({\n ...routeNode,\n route: cleanRoute,\n slotName,\n dynamic: generateDynamic(cleanRoute)\n });\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;\n try {\n for (var _iterator1 = directory.subdirectories[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {\n var [subDirName, subDir] = _step1.value;\n var subPath = currentPath ? `${currentPath}/${subDirName}` : subDirName;\n routes.push(...flattenSlotSubdirectory(subDir, slotName, options, pathToRemove, subPath));\n }\n } catch (err) {\n _didIteratorError1 = true;\n _iteratorError1 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion1 && _iterator1.return != null) {\n _iterator1.return();\n }\n } finally {\n if (_didIteratorError1) {\n throw _iteratorError1;\n }\n }\n }\n return routes;\n}\nfunction getFileMeta(key, options, parentRenderMode) {\n var _options_platformRoutes;\n key = key.replace(/^\\.\\//, \"\");\n var parts = key.split(\"/\");\n var route = (0, import_matchers.removeSupportedExtensions)(key);\n var filename = parts[parts.length - 1];\n var filenameWithoutExtensions = (0, import_matchers.removeSupportedExtensions)(filename);\n var isLayout = filenameWithoutExtensions.startsWith(\"_layout\");\n var isMiddleware = filenameWithoutExtensions.startsWith(\"_middleware\");\n var fileRenderMode = (0, import_matchers.matchFileRenderMode)(filename);\n var renderMode = fileRenderMode !== null && fileRenderMode !== void 0 ? fileRenderMode : parentRenderMode;\n route = route.split(\"/\").map(function(segment) {\n var dirRenderMode = (0, import_matchers.matchDirectoryRenderMode)(segment);\n return dirRenderMode ? dirRenderMode.name : segment;\n }).join(\"/\");\n if (filenameWithoutExtensions.startsWith(\"(\") && filenameWithoutExtensions.endsWith(\")\")) {\n throw new Error(`Invalid route ./${key}. Routes cannot end with '(group)' syntax`);\n }\n if (renderMode !== \"api\" && filename.startsWith(\"+\") && filenameWithoutExtensions !== \"+not-found\") {\n var renamedRoute = [\n ...parts.slice(0, -1),\n filename.slice(1)\n ].join(\"/\");\n throw new Error(`Invalid route ./${key}. Route nodes cannot start with the '+' character. \"Please rename to ${renamedRoute}\"`);\n }\n var slotName;\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = parts[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var part = _step.value;\n var match = (0, import_matchers.matchSlotName)(part);\n if (match) {\n slotName = match;\n break;\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n var interceptMatch;\n for (var i = 0; i < parts.length; i++) {\n var part1 = parts[i];\n var match1 = (0, import_matchers.matchInterceptPrefix)(part1);\n if (match1) {\n var remainingParts = parts.slice(i + 1).map(function(p) {\n return (0, import_matchers.removeSupportedExtensions)(p);\n }).filter(function(p) {\n return p !== \"index\";\n });\n var fullTargetPath = [\n match1.targetPath,\n ...remainingParts\n ].filter(Boolean).join(\"/\");\n interceptMatch = {\n ...match1,\n targetPath: fullTargetPath\n };\n break;\n }\n }\n var specificity = 0;\n var platformExtension = filenameWithoutExtensions.split(\".\")[1];\n var hasPlatformExtension = validPlatforms.has(platformExtension);\n var usePlatformRoutes = (_options_platformRoutes = options.platformRoutes) !== null && _options_platformRoutes !== void 0 ? _options_platformRoutes : true;\n if (hasPlatformExtension) {\n if (!usePlatformRoutes) {\n specificity = -1;\n } else if (!options.platform) {\n specificity = -1;\n } else if (platformExtension === options.platform) {\n specificity = 2;\n } else if (platformExtension === \"native\" && options.platform !== \"web\") {\n specificity = 1;\n } else if (platformExtension !== options.platform) {\n specificity = -1;\n }\n if (renderMode === \"api\" && specificity !== 0) {\n throw new Error(`Api routes cannot have platform extensions. Please remove '.${platformExtension}' from './${key}'`);\n }\n route = route.replace(new RegExp(`.${platformExtension}$`), \"\");\n }\n return {\n route,\n specificity,\n isLayout,\n isMiddleware,\n renderMode,\n slotName,\n interceptMatch\n };\n}\nfunction getMostSpecific(routes) {\n var route = routes[routes.length - 1];\n if (!routes[0]) {\n 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}):\n${routes.map(function(r) {\n return r.contextKey || \"NONE\";\n }).join(\"\\n\")}.`);\n }\n return route;\n}\nfunction getIgnoreList(options) {\n var _ref;\n var ignore = [\n /^\\.\\/\\+html\\.[tj]sx?$/,\n ...(_ref = options === null || options === void 0 ? void 0 : options.ignore) !== null && _ref !== void 0 ? _ref : []\n ];\n if ((options === null || options === void 0 ? void 0 : options.preserveApiRoutes) !== true) {\n ignore.push(/\\+api\\.[tj]sx?$/);\n }\n return ignore;\n}\nfunction extrapolateGroups(key) {\n var keys = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : /* @__PURE__ */ new Set();\n var match = (0, import_matchers.matchArrayGroupName)(key);\n if (!match) {\n keys.add(key);\n return keys;\n }\n var groups = match.split(\",\");\n var groupsSet = new Set(groups);\n if (groupsSet.size !== groups.length) {\n throw new Error(`Array syntax cannot contain duplicate group name \"${groups}\" in \"${key}\".`);\n }\n if (groups.length === 1) {\n keys.add(key);\n return keys;\n }\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = groups[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var group = _step.value;\n extrapolateGroups(key.replace(match, group.trim()), keys);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n return keys;\n}\nfunction generateDynamic(path) {\n var dynamic = path.split(\"/\").map(function(part) {\n if (part === \"+not-found\") {\n return {\n name: \"+not-found\",\n deep: true,\n notFound: true\n };\n }\n var dynamicMatch = (0, import_matchers.matchDynamicName)(part);\n if (!dynamicMatch) return null;\n return {\n name: dynamicMatch.name,\n deep: dynamicMatch.deep\n };\n }).filter(function(part) {\n return !!part;\n });\n return dynamic.length === 0 ? null : dynamic;\n}\nfunction appendSitemapRoute(directory) {\n if (!directory.files.has(\"_sitemap\")) {\n directory.files.set(\"_sitemap\", [\n {\n loadRoute() {\n return {\n default: function _default() {\n return null;\n },\n getNavOptions: function getNavOptions() {\n }\n };\n },\n route: \"_sitemap\",\n type: \"ssg\",\n contextKey: \"\",\n generated: true,\n internal: true,\n dynamic: null,\n children: []\n }\n ]);\n }\n}\nfunction hasNotFoundInGroupSubdirs(directory) {\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = directory.subdirectories[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var [dirName, subDir] = _step.value;\n if (!(0, import_matchers.matchGroupName)(dirName)) continue;\n var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;\n try {\n for (var _iterator1 = subDir.files.keys()[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {\n var fileKey = _step1.value;\n if (fileKey.endsWith(\"+not-found\")) {\n return true;\n }\n }\n } catch (err) {\n _didIteratorError1 = true;\n _iteratorError1 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion1 && _iterator1.return != null) {\n _iterator1.return();\n }\n } finally {\n if (_didIteratorError1) {\n throw _iteratorError1;\n }\n }\n }\n if (hasNotFoundInGroupSubdirs(subDir)) {\n return true;\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n return false;\n}\nfunction appendNotFoundRoute(directory) {\n if (!directory.files.has(\"+not-found\") && !hasNotFoundInGroupSubdirs(directory)) {\n directory.files.set(\"+not-found\", [\n {\n loadRoute() {\n return {\n default: function _default() {\n return null;\n }\n };\n },\n type: \"spa\",\n route: \"+not-found\",\n contextKey: \"\",\n generated: true,\n internal: true,\n dynamic: [\n {\n name: \"+not-found\",\n deep: true,\n notFound: true\n }\n ],\n children: []\n }\n ]);\n }\n}\nfunction getLayoutNode(node, options) {\n var groupName = (0, import_matchers.matchGroupName)(node.route);\n var childMatchingGroup = node.children.find(function(child) {\n return child.route.replace(/\\/index$/, \"\") === groupName;\n });\n var initialRouteName = childMatchingGroup === null || childMatchingGroup === void 0 ? void 0 : childMatchingGroup.route;\n return {\n ...node,\n route: node.route.replace(/\\/?_layout$/, \"\"),\n children: [],\n // Each layout should have its own children\n initialRouteName\n };\n}\nfunction crawlAndAppendInitialRoutesAndEntryFiles(node, options) {\n var entryPoints = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [];\n if (node.type === \"spa\" || node.type === \"ssg\" || node.type === \"ssr\") {\n if (!options.ignoreEntryPoints) {\n node.entryPoints = [\n .../* @__PURE__ */ new Set([\n ...entryPoints,\n node.contextKey\n ])\n ];\n }\n } else if (node.type === \"layout\") {\n if (!node.children) {\n throw new Error(`Layout \"${node.contextKey}\" does not contain any child routes`);\n }\n entryPoints = [\n ...entryPoints,\n node.contextKey\n ];\n var groupName = (0, import_matchers.matchGroupName)(node.route);\n var childMatchingGroup = node.children.find(function(child2) {\n return child2.route.replace(/\\/index$/, \"\") === groupName;\n });\n var initialRouteName = childMatchingGroup === null || childMatchingGroup === void 0 ? void 0 : childMatchingGroup.route;\n var loaded = node.loadRoute();\n if (loaded === null || loaded === void 0 ? void 0 : loaded.unstable_settings) {\n var _loaded_unstable_settings_initialRouteName;\n initialRouteName = (_loaded_unstable_settings_initialRouteName = loaded.unstable_settings.initialRouteName) !== null && _loaded_unstable_settings_initialRouteName !== void 0 ? _loaded_unstable_settings_initialRouteName : initialRouteName;\n if (groupName) {\n var _loaded_unstable_settings_groupName, _loaded_unstable_settings;\n var groupSpecificInitialRouteName = (_loaded_unstable_settings = loaded.unstable_settings) === null || _loaded_unstable_settings === void 0 ? void 0 : (_loaded_unstable_settings_groupName = _loaded_unstable_settings[groupName]) === null || _loaded_unstable_settings_groupName === void 0 ? void 0 : _loaded_unstable_settings_groupName.initialRouteName;\n initialRouteName = groupSpecificInitialRouteName !== null && groupSpecificInitialRouteName !== void 0 ? groupSpecificInitialRouteName : initialRouteName;\n }\n }\n if (initialRouteName) {\n var initialRoute = node.children.find(function(child2) {\n return child2.route === initialRouteName;\n });\n if (!initialRoute) {\n var validInitialRoutes = node.children.filter(function(child2) {\n return !child2.generated;\n }).map(function(child2) {\n return `'${child2.route}'`;\n }).join(\", \");\n if (groupName) {\n throw new Error(`Layout ${node.contextKey} has invalid initialRouteName '${initialRouteName}' for group '(${groupName})'. Valid options are: ${validInitialRoutes}`);\n }\n throw new Error(`Layout ${node.contextKey} has invalid initialRouteName '${initialRouteName}'. Valid options are: ${validInitialRoutes}`);\n }\n node.initialRouteName = initialRouteName;\n entryPoints.push(initialRoute.contextKey);\n }\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = node.children[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var child = _step.value;\n crawlAndAppendInitialRoutesAndEntryFiles(child, options, entryPoints);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n }\n}\n//# sourceMappingURL=getRoutes.js.map\n"],"mappings":";;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oB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,IAAI,WAAW;KACb,MAAM,IAAI,MAAM,UAAU,KAAK,WAAW,iCAAiC,iBAAiB,gBAAgB,UAAU,yBAAyB,oBAAoB;IACrK;IACA,MAAM,IAAI,MAAM,UAAU,KAAK,WAAW,iCAAiC,iBAAiB,wBAAwB,oBAAoB;GAC1I;GACA,KAAK,mBAAmB;GACxB,YAAY,KAAK,aAAa,UAAU;EAC1C;EACA,IAAI,4BAA4B,MAAM,oBAAoB,OAAO,iBAAiB,KAAK;EACvF,IAAI;GACF,KAAK,IAAI,YAAY,KAAK,SAAS,OAAO,SAAS,CAAC,GAAG,OAAO,EAAE,6BAA6B,QAAQ,UAAU,KAAK,EAAC,CAAE,OAAO,4BAA4B,MAAM;IAC9J,IAAI,QAAQ,MAAM;IAClB,yCAAyC,OAAO,SAAS,WAAW;GACtE;EACF,SAAS,KAAK;GACZ,oBAAoB;GACpB,iBAAiB;EACnB,UAAU;GACR,IAAI;IACF,IAAI,CAAC,6BAA6B,UAAU,UAAU,MAAM;KAC1D,UAAU,OAAO;IACnB;GACF,UAAU;IACR,IAAI,mBAAmB;KACrB,MAAM;IACR;GACF;EACF;CACF;AACF"}
|
|
@@ -16,7 +16,7 @@ function getRoutes(contextModule, options = {}) {
|
|
|
16
16
|
return null;
|
|
17
17
|
}
|
|
18
18
|
const rootNode = flattenDirectoryTreeToRoutes(directoryTree, options);
|
|
19
|
-
if (!options.ignoreEntryPoints) {
|
|
19
|
+
if (!options.ignoreEntryPoints || options.platform && options.platform !== "web") {
|
|
20
20
|
crawlAndAppendInitialRoutesAndEntryFiles(rootNode, options);
|
|
21
21
|
}
|
|
22
22
|
return rootNode;
|
|
@@ -478,7 +478,9 @@ function getLayoutNode(node, options) {
|
|
|
478
478
|
}
|
|
479
479
|
function crawlAndAppendInitialRoutesAndEntryFiles(node, options, entryPoints = []) {
|
|
480
480
|
if (node.type === "spa" || node.type === "ssg" || node.type === "ssr") {
|
|
481
|
-
|
|
481
|
+
if (!options.ignoreEntryPoints) {
|
|
482
|
+
node.entryPoints = [.../* @__PURE__ */ new Set([...entryPoints, node.contextKey])];
|
|
483
|
+
}
|
|
482
484
|
} else if (node.type === "layout") {
|
|
483
485
|
if (!node.children) {
|
|
484
486
|
throw new Error(`Layout "${node.contextKey}" does not contain any child routes`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getRoutes.js","names":[],"sources":["esm/router/getRoutes.js"],"sourcesContent":["import { getDefaultRenderMode } from \"../config\";\nimport { getPageExport } from \"../utils/getPageExport\";\nimport {\n matchArrayGroupName,\n matchDirectoryRenderMode,\n matchDynamicName,\n matchFileRenderMode,\n matchGroupName,\n matchInterceptPrefix,\n matchSlotName,\n removeSupportedExtensions,\n stripInterceptPrefix\n} from \"./matchers\";\nconst validPlatforms = /* @__PURE__ */ new Set([\"android\", \"ios\", \"linux\", \"macos\", \"native\", \"web\"]);\nfunction getRoutes(contextModule, options = {}) {\n const directoryTree = getDirectoryTree(contextModule, options);\n if (!directoryTree) {\n return null;\n }\n const rootNode = flattenDirectoryTreeToRoutes(directoryTree, options);\n if (!options.ignoreEntryPoints) {\n crawlAndAppendInitialRoutesAndEntryFiles(rootNode, options);\n }\n return rootNode;\n}\nfunction getDirectoryTree(contextModule, options) {\n const importMode = options.importMode || process.env.One_ROUTER_IMPORT_MODE;\n const ignoreList = [\n /^\\.\\/\\+html\\.[tj]sx?$/,\n // Ignore the top level ./+html file\n /\\.d\\.ts$/\n // Ignore TypeScript declaration files\n ];\n if (options.ignore) {\n ignoreList.push(...options.ignore);\n }\n if (!options.preserveApiRoutes) {\n ignoreList.push(/\\+api\\.[tj]sx?$/);\n }\n const rootDirectory = {\n files: /* @__PURE__ */ new Map(),\n subdirectories: /* @__PURE__ */ new Map(),\n slots: /* @__PURE__ */ new Map()\n };\n let hasRoutes = false;\n let isValid = false;\n for (const filePath of contextModule.keys()) {\n if (ignoreList.some((regex) => regex.test(filePath))) {\n continue;\n }\n isValid = true;\n let parentRenderMode;\n const pathParts = filePath.replace(/^\\.\\//, \"\").split(\"/\");\n const directoryParts = pathParts.slice(0, -1);\n for (const part of directoryParts) {\n const dirRenderMode = matchDirectoryRenderMode(part);\n if (dirRenderMode) {\n parentRenderMode = dirRenderMode.renderMode;\n }\n }\n const meta = getFileMeta(filePath, options, parentRenderMode);\n if (meta.specificity < 0) {\n continue;\n }\n const type = meta.isLayout ? \"layout\" : meta.renderMode || getDefaultRenderMode();\n const layoutRenderMode = meta.isLayout && meta.renderMode && meta.renderMode !== \"api\" ? meta.renderMode : void 0;\n let node = {\n type,\n // store layout render mode if this is a layout with an explicit mode\n ...layoutRenderMode && { layoutRenderMode },\n loadRoute() {\n if (options.ignoreRequireErrors) {\n try {\n return contextModule(filePath);\n } catch {\n return {};\n }\n } else {\n return contextModule(filePath);\n }\n },\n contextKey: filePath,\n route: \"\",\n // This is overwritten during hoisting based upon the _layout\n dynamic: null,\n children: []\n // While we are building the directory tree, we don't know the node's children just yet. This is added during hoisting\n };\n if (process.env.NODE_ENV === \"development\") {\n if (node.type !== \"api\" && importMode === \"sync\") {\n if (!getPageExport(node.loadRoute())) {\n continue;\n }\n }\n }\n for (const route of extrapolateGroups(meta.route)) {\n const subdirectoryParts = route.split(\"/\").slice(0, -1);\n let directory = rootDirectory;\n for (const part of subdirectoryParts) {\n const slotName = matchSlotName(part);\n if (slotName) {\n let slotDirectory = directory.slots.get(slotName);\n if (!slotDirectory) {\n slotDirectory = {\n files: /* @__PURE__ */ new Map(),\n subdirectories: /* @__PURE__ */ new Map(),\n slots: /* @__PURE__ */ new Map()\n };\n directory.slots.set(slotName, slotDirectory);\n }\n directory = slotDirectory;\n } else {\n const dirRenderMode = matchDirectoryRenderMode(part);\n const dirName = dirRenderMode?.name ?? part;\n let subDirectory = directory.subdirectories.get(dirName);\n if (!subDirectory) {\n subDirectory = {\n files: /* @__PURE__ */ new Map(),\n subdirectories: /* @__PURE__ */ new Map(),\n slots: /* @__PURE__ */ new Map(),\n renderMode: dirRenderMode?.renderMode\n };\n directory.subdirectories.set(dirName, subDirectory);\n }\n directory = subDirectory;\n }\n }\n node = {\n ...node,\n route,\n slotName: meta.slotName,\n intercept: meta.interceptMatch ? {\n levels: meta.interceptMatch.levels,\n targetPath: meta.interceptMatch.targetPath\n } : void 0\n };\n if (meta.isLayout) {\n directory.layout ??= [];\n const existing = directory.layout[meta.specificity];\n if (existing) {\n if (process.env.NODE_ENV !== \"production\") {\n throw new Error(\n `The layouts \"${filePath}\" and \"${existing.contextKey}\" conflict on the route \"/${route}\". Please remove or rename one of these files.`\n );\n }\n } else {\n node = getLayoutNode(node, options);\n directory.layout[meta.specificity] = node;\n }\n } else if (meta.isMiddleware) {\n directory.middleware = node;\n } else if (type === \"api\") {\n const fileKey = `${route}+api`;\n let nodes = directory.files.get(fileKey);\n if (!nodes) {\n nodes = [];\n directory.files.set(fileKey, nodes);\n }\n const existing = nodes[0];\n if (existing) {\n if (process.env.NODE_ENV !== \"production\") {\n throw new Error(\n `The API route file \"${filePath}\" and \"${existing.contextKey}\" conflict on the route \"/${route}\". Please remove or rename one of these files.`\n );\n }\n } else {\n nodes[0] = node;\n }\n } else {\n let nodes = directory.files.get(route);\n if (!nodes) {\n nodes = [];\n directory.files.set(route, nodes);\n }\n const existing = nodes[meta.specificity];\n if (existing) {\n if (process.env.NODE_ENV !== \"production\") {\n throw new Error(\n `The route files \"${filePath}\" and \"${existing.contextKey}\" conflict on the route \"/${route}\". Please remove or rename one of these files.`\n );\n }\n } else {\n hasRoutes ||= true;\n nodes[meta.specificity] = node;\n }\n }\n }\n }\n if (!isValid) {\n return null;\n }\n if (!rootDirectory.layout) {\n rootDirectory.layout = [\n {\n type: \"layout\",\n loadRoute: () => ({\n default: (() => {\n try {\n return require(\"../views/Navigator\");\n } catch (e) {\n return {\n DefaultNavigator: () => {\n throw e;\n }\n };\n }\n })().DefaultNavigator\n }),\n // Generate a fake file name for the directory\n contextKey: \"router/build/views/Navigator.js\",\n route: \"\",\n generated: true,\n dynamic: null,\n children: []\n }\n ];\n }\n if (hasRoutes) {\n appendSitemapRoute(rootDirectory);\n }\n appendNotFoundRoute(rootDirectory);\n return rootDirectory;\n}\nfunction flattenDirectoryTreeToRoutes(directory, options, layout, pathToRemove = \"\", parentMiddlewares) {\n if (directory.layout) {\n const previousLayout = layout;\n layout = getMostSpecific(directory.layout);\n if (previousLayout) {\n previousLayout.children.push(layout);\n }\n const newRoute = layout.route.replace(pathToRemove, \"\");\n pathToRemove = layout.route ? `${layout.route}/` : \"\";\n layout.route = newRoute;\n layout.dynamic = generateDynamic(layout.route);\n }\n if (!layout) throw new Error(\"One Internal Error: No nearest layout\");\n const middlewares = directory.middleware ? [...parentMiddlewares || [], directory.middleware] : parentMiddlewares;\n for (const routes of directory.files.values()) {\n const routeNode = getMostSpecific(routes);\n routeNode.route = routeNode.route.replace(pathToRemove, \"\");\n routeNode.dynamic = generateDynamic(routeNode.route);\n routeNode.middlewares = middlewares;\n layout.children.push(routeNode);\n }\n for (const child of directory.subdirectories.values()) {\n flattenDirectoryTreeToRoutes(child, options, layout, pathToRemove, middlewares);\n }\n if (directory.slots.size > 0) {\n layout.slots = /* @__PURE__ */ new Map();\n for (const [slotName, slotDir] of directory.slots) {\n const slotConfig = flattenSlotDirectory(slotDir, slotName, options, pathToRemove);\n layout.slots.set(slotName, slotConfig);\n }\n }\n return layout;\n}\nfunction flattenSlotDirectory(directory, slotName, options, pathToRemove) {\n const interceptRoutes = [];\n let defaultRoute;\n for (const routes of directory.files.values()) {\n const routeNode = getMostSpecific(routes);\n let cleanRoute = routeNode.route.replace(pathToRemove, \"\");\n cleanRoute = cleanRoute.split(\"/\").filter((segment) => !matchSlotName(segment)).map((segment) => stripInterceptPrefix(segment)).join(\"/\");\n if (cleanRoute.endsWith(\"default\") || cleanRoute === \"default\") {\n defaultRoute = {\n ...routeNode,\n route: cleanRoute,\n slotName,\n dynamic: generateDynamic(cleanRoute)\n };\n } else {\n interceptRoutes.push({\n ...routeNode,\n route: cleanRoute,\n slotName,\n dynamic: generateDynamic(cleanRoute)\n });\n }\n }\n for (const [subDirName, subDir] of directory.subdirectories) {\n const subRoutes = flattenSlotSubdirectory(\n subDir,\n slotName,\n options,\n pathToRemove,\n subDirName\n );\n interceptRoutes.push(...subRoutes);\n }\n return {\n name: slotName,\n defaultRoute,\n interceptRoutes\n };\n}\nfunction flattenSlotSubdirectory(directory, slotName, options, pathToRemove, currentPath) {\n const routes = [];\n for (const fileRoutes of directory.files.values()) {\n const routeNode = getMostSpecific(fileRoutes);\n let cleanRoute = routeNode.route.replace(pathToRemove, \"\");\n cleanRoute = cleanRoute.split(\"/\").filter((segment) => !matchSlotName(segment)).map((segment) => stripInterceptPrefix(segment)).join(\"/\");\n routes.push({\n ...routeNode,\n route: cleanRoute,\n slotName,\n dynamic: generateDynamic(cleanRoute)\n });\n }\n for (const [subDirName, subDir] of directory.subdirectories) {\n const subPath = currentPath ? `${currentPath}/${subDirName}` : subDirName;\n routes.push(\n ...flattenSlotSubdirectory(subDir, slotName, options, pathToRemove, subPath)\n );\n }\n return routes;\n}\nfunction getFileMeta(key, options, parentRenderMode) {\n key = key.replace(/^\\.\\//, \"\");\n const parts = key.split(\"/\");\n let route = removeSupportedExtensions(key);\n const filename = parts[parts.length - 1];\n const filenameWithoutExtensions = removeSupportedExtensions(filename);\n const isLayout = filenameWithoutExtensions.startsWith(\"_layout\");\n const isMiddleware = filenameWithoutExtensions.startsWith(\"_middleware\");\n const fileRenderMode = matchFileRenderMode(filename);\n const renderMode = fileRenderMode ?? parentRenderMode;\n route = route.split(\"/\").map((segment) => {\n const dirRenderMode = matchDirectoryRenderMode(segment);\n return dirRenderMode ? dirRenderMode.name : segment;\n }).join(\"/\");\n if (filenameWithoutExtensions.startsWith(\"(\") && filenameWithoutExtensions.endsWith(\")\")) {\n throw new Error(`Invalid route ./${key}. Routes cannot end with '(group)' syntax`);\n }\n if (renderMode !== \"api\" && filename.startsWith(\"+\") && filenameWithoutExtensions !== \"+not-found\") {\n const renamedRoute = [...parts.slice(0, -1), filename.slice(1)].join(\"/\");\n throw new Error(\n `Invalid route ./${key}. Route nodes cannot start with the '+' character. \"Please rename to ${renamedRoute}\"`\n );\n }\n let slotName;\n for (const part of parts) {\n const match = matchSlotName(part);\n if (match) {\n slotName = match;\n break;\n }\n }\n let interceptMatch;\n for (let i = 0; i < parts.length; i++) {\n const part = parts[i];\n const match = matchInterceptPrefix(part);\n if (match) {\n const remainingParts = parts.slice(i + 1).map((p) => removeSupportedExtensions(p)).filter((p) => p !== \"index\");\n const fullTargetPath = [match.targetPath, ...remainingParts].filter(Boolean).join(\"/\");\n interceptMatch = {\n ...match,\n targetPath: fullTargetPath\n };\n break;\n }\n }\n let specificity = 0;\n const platformExtension = filenameWithoutExtensions.split(\".\")[1];\n const hasPlatformExtension = validPlatforms.has(platformExtension);\n const usePlatformRoutes = options.platformRoutes ?? true;\n if (hasPlatformExtension) {\n if (!usePlatformRoutes) {\n specificity = -1;\n } else if (!options.platform) {\n specificity = -1;\n } else if (platformExtension === options.platform) {\n specificity = 2;\n } else if (platformExtension === \"native\" && options.platform !== \"web\") {\n specificity = 1;\n } else if (platformExtension !== options.platform) {\n specificity = -1;\n }\n if (renderMode === \"api\" && specificity !== 0) {\n throw new Error(\n `Api routes cannot have platform extensions. Please remove '.${platformExtension}' from './${key}'`\n );\n }\n route = route.replace(new RegExp(`.${platformExtension}$`), \"\");\n }\n return {\n route,\n specificity,\n isLayout,\n isMiddleware,\n renderMode,\n slotName,\n interceptMatch\n };\n}\nfunction getMostSpecific(routes) {\n const route = routes[routes.length - 1];\n if (!routes[0]) {\n throw new Error(\n ` [one] The file ${route.contextKey} does not have a fallback sibling file without a platform extension in routes (${routes[0]}, ${routes.length}):\n${routes.map((r) => r.contextKey || \"NONE\").join(\"\\n\")}.`\n );\n }\n return route;\n}\nfunction getIgnoreList(options) {\n const ignore = [/^\\.\\/\\+html\\.[tj]sx?$/, ...options?.ignore ?? []];\n if (options?.preserveApiRoutes !== true) {\n ignore.push(/\\+api\\.[tj]sx?$/);\n }\n return ignore;\n}\nfunction extrapolateGroups(key, keys = /* @__PURE__ */ new Set()) {\n const match = matchArrayGroupName(key);\n if (!match) {\n keys.add(key);\n return keys;\n }\n const groups = match.split(\",\");\n const groupsSet = new Set(groups);\n if (groupsSet.size !== groups.length) {\n throw new Error(\n `Array syntax cannot contain duplicate group name \"${groups}\" in \"${key}\".`\n );\n }\n if (groups.length === 1) {\n keys.add(key);\n return keys;\n }\n for (const group of groups) {\n extrapolateGroups(key.replace(match, group.trim()), keys);\n }\n return keys;\n}\nfunction generateDynamic(path) {\n const dynamic = path.split(\"/\").map((part) => {\n if (part === \"+not-found\") {\n return {\n name: \"+not-found\",\n deep: true,\n notFound: true\n };\n }\n const dynamicMatch = matchDynamicName(part);\n if (!dynamicMatch) return null;\n return { name: dynamicMatch.name, deep: dynamicMatch.deep };\n }).filter((part) => !!part);\n return dynamic.length === 0 ? null : dynamic;\n}\nfunction appendSitemapRoute(directory) {\n if (!directory.files.has(\"_sitemap\")) {\n directory.files.set(\"_sitemap\", [\n {\n loadRoute() {\n return { default: () => null, getNavOptions: () => {\n } };\n },\n route: \"_sitemap\",\n type: \"ssg\",\n contextKey: \"\",\n generated: true,\n internal: true,\n dynamic: null,\n children: []\n }\n ]);\n }\n}\nfunction hasNotFoundInGroupSubdirs(directory) {\n for (const [dirName, subDir] of directory.subdirectories) {\n if (!matchGroupName(dirName)) continue;\n for (const fileKey of subDir.files.keys()) {\n if (fileKey.endsWith(\"+not-found\")) {\n return true;\n }\n }\n if (hasNotFoundInGroupSubdirs(subDir)) {\n return true;\n }\n }\n return false;\n}\nfunction appendNotFoundRoute(directory) {\n if (!directory.files.has(\"+not-found\") && !hasNotFoundInGroupSubdirs(directory)) {\n directory.files.set(\"+not-found\", [\n {\n loadRoute() {\n return { default: () => null };\n },\n type: \"spa\",\n route: \"+not-found\",\n contextKey: \"\",\n generated: true,\n internal: true,\n dynamic: [{ name: \"+not-found\", deep: true, notFound: true }],\n children: []\n }\n ]);\n }\n}\nfunction getLayoutNode(node, options) {\n const groupName = matchGroupName(node.route);\n const childMatchingGroup = node.children.find((child) => {\n return child.route.replace(/\\/index$/, \"\") === groupName;\n });\n const initialRouteName = childMatchingGroup?.route;\n return {\n ...node,\n route: node.route.replace(/\\/?_layout$/, \"\"),\n children: [],\n // Each layout should have its own children\n initialRouteName\n };\n}\nfunction crawlAndAppendInitialRoutesAndEntryFiles(node, options, entryPoints = []) {\n if (node.type === \"spa\" || node.type === \"ssg\" || node.type === \"ssr\") {\n node.entryPoints = [.../* @__PURE__ */ new Set([...entryPoints, node.contextKey])];\n } else if (node.type === \"layout\") {\n if (!node.children) {\n throw new Error(`Layout \"${node.contextKey}\" does not contain any child routes`);\n }\n entryPoints = [...entryPoints, node.contextKey];\n const groupName = matchGroupName(node.route);\n const childMatchingGroup = node.children.find((child) => {\n return child.route.replace(/\\/index$/, \"\") === groupName;\n });\n let initialRouteName = childMatchingGroup?.route;\n const loaded = node.loadRoute();\n if (loaded?.unstable_settings) {\n initialRouteName = loaded.unstable_settings.initialRouteName ?? initialRouteName;\n if (groupName) {\n const groupSpecificInitialRouteName = loaded.unstable_settings?.[groupName]?.initialRouteName;\n initialRouteName = groupSpecificInitialRouteName ?? initialRouteName;\n }\n }\n if (initialRouteName) {\n const initialRoute = node.children.find((child) => child.route === initialRouteName);\n if (!initialRoute) {\n const validInitialRoutes = node.children.filter((child) => !child.generated).map((child) => `'${child.route}'`).join(\", \");\n if (groupName) {\n throw new Error(\n `Layout ${node.contextKey} has invalid initialRouteName '${initialRouteName}' for group '(${groupName})'. Valid options are: ${validInitialRoutes}`\n );\n }\n throw new Error(\n `Layout ${node.contextKey} has invalid initialRouteName '${initialRouteName}'. Valid options are: ${validInitialRoutes}`\n );\n }\n node.initialRouteName = initialRouteName;\n entryPoints.push(initialRoute.contextKey);\n }\n for (const child of node.children) {\n crawlAndAppendInitialRoutesAndEntryFiles(child, options, entryPoints);\n }\n }\n}\nexport {\n extrapolateGroups,\n generateDyn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IAAI,WAAW;KACb,MAAM,IAAI,MACR,UAAU,KAAK,WAAW,iCAAiC,iBAAiB,gBAAgB,UAAU,yBAAyB,oBACjI;IACF;IACA,MAAM,IAAI,MACR,UAAU,KAAK,WAAW,iCAAiC,iBAAiB,wBAAwB,oBACtG;GACF;GACA,KAAK,mBAAmB;GACxB,YAAY,KAAK,aAAa,UAAU;EAC1C;EACA,KAAK,MAAM,SAAS,KAAK,UAAU;GACjC,yCAAyC,OAAO,SAAS,WAAW;EACtE;CACF;AACF"}
|
|
1
|
+
{"version":3,"file":"getRoutes.js","names":[],"sources":["esm/router/getRoutes.js"],"sourcesContent":["import { getDefaultRenderMode } from \"../config\";\nimport { getPageExport } from \"../utils/getPageExport\";\nimport {\n matchArrayGroupName,\n matchDirectoryRenderMode,\n matchDynamicName,\n matchFileRenderMode,\n matchGroupName,\n matchInterceptPrefix,\n matchSlotName,\n removeSupportedExtensions,\n stripInterceptPrefix\n} from \"./matchers\";\nconst validPlatforms = /* @__PURE__ */ new Set([\"android\", \"ios\", \"linux\", \"macos\", \"native\", \"web\"]);\nfunction getRoutes(contextModule, options = {}) {\n const directoryTree = getDirectoryTree(contextModule, options);\n if (!directoryTree) {\n return null;\n }\n const rootNode = flattenDirectoryTreeToRoutes(directoryTree, options);\n if (!options.ignoreEntryPoints || options.platform && options.platform !== \"web\") {\n crawlAndAppendInitialRoutesAndEntryFiles(rootNode, options);\n }\n return rootNode;\n}\nfunction getDirectoryTree(contextModule, options) {\n const importMode = options.importMode || process.env.One_ROUTER_IMPORT_MODE;\n const ignoreList = [\n /^\\.\\/\\+html\\.[tj]sx?$/,\n // Ignore the top level ./+html file\n /\\.d\\.ts$/\n // Ignore TypeScript declaration files\n ];\n if (options.ignore) {\n ignoreList.push(...options.ignore);\n }\n if (!options.preserveApiRoutes) {\n ignoreList.push(/\\+api\\.[tj]sx?$/);\n }\n const rootDirectory = {\n files: /* @__PURE__ */ new Map(),\n subdirectories: /* @__PURE__ */ new Map(),\n slots: /* @__PURE__ */ new Map()\n };\n let hasRoutes = false;\n let isValid = false;\n for (const filePath of contextModule.keys()) {\n if (ignoreList.some((regex) => regex.test(filePath))) {\n continue;\n }\n isValid = true;\n let parentRenderMode;\n const pathParts = filePath.replace(/^\\.\\//, \"\").split(\"/\");\n const directoryParts = pathParts.slice(0, -1);\n for (const part of directoryParts) {\n const dirRenderMode = matchDirectoryRenderMode(part);\n if (dirRenderMode) {\n parentRenderMode = dirRenderMode.renderMode;\n }\n }\n const meta = getFileMeta(filePath, options, parentRenderMode);\n if (meta.specificity < 0) {\n continue;\n }\n const type = meta.isLayout ? \"layout\" : meta.renderMode || getDefaultRenderMode();\n const layoutRenderMode = meta.isLayout && meta.renderMode && meta.renderMode !== \"api\" ? meta.renderMode : void 0;\n let node = {\n type,\n // store layout render mode if this is a layout with an explicit mode\n ...layoutRenderMode && { layoutRenderMode },\n loadRoute() {\n if (options.ignoreRequireErrors) {\n try {\n return contextModule(filePath);\n } catch {\n return {};\n }\n } else {\n return contextModule(filePath);\n }\n },\n contextKey: filePath,\n route: \"\",\n // This is overwritten during hoisting based upon the _layout\n dynamic: null,\n children: []\n // While we are building the directory tree, we don't know the node's children just yet. This is added during hoisting\n };\n if (process.env.NODE_ENV === \"development\") {\n if (node.type !== \"api\" && importMode === \"sync\") {\n if (!getPageExport(node.loadRoute())) {\n continue;\n }\n }\n }\n for (const route of extrapolateGroups(meta.route)) {\n const subdirectoryParts = route.split(\"/\").slice(0, -1);\n let directory = rootDirectory;\n for (const part of subdirectoryParts) {\n const slotName = matchSlotName(part);\n if (slotName) {\n let slotDirectory = directory.slots.get(slotName);\n if (!slotDirectory) {\n slotDirectory = {\n files: /* @__PURE__ */ new Map(),\n subdirectories: /* @__PURE__ */ new Map(),\n slots: /* @__PURE__ */ new Map()\n };\n directory.slots.set(slotName, slotDirectory);\n }\n directory = slotDirectory;\n } else {\n const dirRenderMode = matchDirectoryRenderMode(part);\n const dirName = dirRenderMode?.name ?? part;\n let subDirectory = directory.subdirectories.get(dirName);\n if (!subDirectory) {\n subDirectory = {\n files: /* @__PURE__ */ new Map(),\n subdirectories: /* @__PURE__ */ new Map(),\n slots: /* @__PURE__ */ new Map(),\n renderMode: dirRenderMode?.renderMode\n };\n directory.subdirectories.set(dirName, subDirectory);\n }\n directory = subDirectory;\n }\n }\n node = {\n ...node,\n route,\n slotName: meta.slotName,\n intercept: meta.interceptMatch ? {\n levels: meta.interceptMatch.levels,\n targetPath: meta.interceptMatch.targetPath\n } : void 0\n };\n if (meta.isLayout) {\n directory.layout ??= [];\n const existing = directory.layout[meta.specificity];\n if (existing) {\n if (process.env.NODE_ENV !== \"production\") {\n throw new Error(\n `The layouts \"${filePath}\" and \"${existing.contextKey}\" conflict on the route \"/${route}\". Please remove or rename one of these files.`\n );\n }\n } else {\n node = getLayoutNode(node, options);\n directory.layout[meta.specificity] = node;\n }\n } else if (meta.isMiddleware) {\n directory.middleware = node;\n } else if (type === \"api\") {\n const fileKey = `${route}+api`;\n let nodes = directory.files.get(fileKey);\n if (!nodes) {\n nodes = [];\n directory.files.set(fileKey, nodes);\n }\n const existing = nodes[0];\n if (existing) {\n if (process.env.NODE_ENV !== \"production\") {\n throw new Error(\n `The API route file \"${filePath}\" and \"${existing.contextKey}\" conflict on the route \"/${route}\". Please remove or rename one of these files.`\n );\n }\n } else {\n nodes[0] = node;\n }\n } else {\n let nodes = directory.files.get(route);\n if (!nodes) {\n nodes = [];\n directory.files.set(route, nodes);\n }\n const existing = nodes[meta.specificity];\n if (existing) {\n if (process.env.NODE_ENV !== \"production\") {\n throw new Error(\n `The route files \"${filePath}\" and \"${existing.contextKey}\" conflict on the route \"/${route}\". Please remove or rename one of these files.`\n );\n }\n } else {\n hasRoutes ||= true;\n nodes[meta.specificity] = node;\n }\n }\n }\n }\n if (!isValid) {\n return null;\n }\n if (!rootDirectory.layout) {\n rootDirectory.layout = [\n {\n type: \"layout\",\n loadRoute: () => ({\n default: (() => {\n try {\n return require(\"../views/Navigator\");\n } catch (e) {\n return {\n DefaultNavigator: () => {\n throw e;\n }\n };\n }\n })().DefaultNavigator\n }),\n // Generate a fake file name for the directory\n contextKey: \"router/build/views/Navigator.js\",\n route: \"\",\n generated: true,\n dynamic: null,\n children: []\n }\n ];\n }\n if (hasRoutes) {\n appendSitemapRoute(rootDirectory);\n }\n appendNotFoundRoute(rootDirectory);\n return rootDirectory;\n}\nfunction flattenDirectoryTreeToRoutes(directory, options, layout, pathToRemove = \"\", parentMiddlewares) {\n if (directory.layout) {\n const previousLayout = layout;\n layout = getMostSpecific(directory.layout);\n if (previousLayout) {\n previousLayout.children.push(layout);\n }\n const newRoute = layout.route.replace(pathToRemove, \"\");\n pathToRemove = layout.route ? `${layout.route}/` : \"\";\n layout.route = newRoute;\n layout.dynamic = generateDynamic(layout.route);\n }\n if (!layout) throw new Error(\"One Internal Error: No nearest layout\");\n const middlewares = directory.middleware ? [...parentMiddlewares || [], directory.middleware] : parentMiddlewares;\n for (const routes of directory.files.values()) {\n const routeNode = getMostSpecific(routes);\n routeNode.route = routeNode.route.replace(pathToRemove, \"\");\n routeNode.dynamic = generateDynamic(routeNode.route);\n routeNode.middlewares = middlewares;\n layout.children.push(routeNode);\n }\n for (const child of directory.subdirectories.values()) {\n flattenDirectoryTreeToRoutes(child, options, layout, pathToRemove, middlewares);\n }\n if (directory.slots.size > 0) {\n layout.slots = /* @__PURE__ */ new Map();\n for (const [slotName, slotDir] of directory.slots) {\n const slotConfig = flattenSlotDirectory(slotDir, slotName, options, pathToRemove);\n layout.slots.set(slotName, slotConfig);\n }\n }\n return layout;\n}\nfunction flattenSlotDirectory(directory, slotName, options, pathToRemove) {\n const interceptRoutes = [];\n let defaultRoute;\n for (const routes of directory.files.values()) {\n const routeNode = getMostSpecific(routes);\n let cleanRoute = routeNode.route.replace(pathToRemove, \"\");\n cleanRoute = cleanRoute.split(\"/\").filter((segment) => !matchSlotName(segment)).map((segment) => stripInterceptPrefix(segment)).join(\"/\");\n if (cleanRoute.endsWith(\"default\") || cleanRoute === \"default\") {\n defaultRoute = {\n ...routeNode,\n route: cleanRoute,\n slotName,\n dynamic: generateDynamic(cleanRoute)\n };\n } else {\n interceptRoutes.push({\n ...routeNode,\n route: cleanRoute,\n slotName,\n dynamic: generateDynamic(cleanRoute)\n });\n }\n }\n for (const [subDirName, subDir] of directory.subdirectories) {\n const subRoutes = flattenSlotSubdirectory(\n subDir,\n slotName,\n options,\n pathToRemove,\n subDirName\n );\n interceptRoutes.push(...subRoutes);\n }\n return {\n name: slotName,\n defaultRoute,\n interceptRoutes\n };\n}\nfunction flattenSlotSubdirectory(directory, slotName, options, pathToRemove, currentPath) {\n const routes = [];\n for (const fileRoutes of directory.files.values()) {\n const routeNode = getMostSpecific(fileRoutes);\n let cleanRoute = routeNode.route.replace(pathToRemove, \"\");\n cleanRoute = cleanRoute.split(\"/\").filter((segment) => !matchSlotName(segment)).map((segment) => stripInterceptPrefix(segment)).join(\"/\");\n routes.push({\n ...routeNode,\n route: cleanRoute,\n slotName,\n dynamic: generateDynamic(cleanRoute)\n });\n }\n for (const [subDirName, subDir] of directory.subdirectories) {\n const subPath = currentPath ? `${currentPath}/${subDirName}` : subDirName;\n routes.push(\n ...flattenSlotSubdirectory(subDir, slotName, options, pathToRemove, subPath)\n );\n }\n return routes;\n}\nfunction getFileMeta(key, options, parentRenderMode) {\n key = key.replace(/^\\.\\//, \"\");\n const parts = key.split(\"/\");\n let route = removeSupportedExtensions(key);\n const filename = parts[parts.length - 1];\n const filenameWithoutExtensions = removeSupportedExtensions(filename);\n const isLayout = filenameWithoutExtensions.startsWith(\"_layout\");\n const isMiddleware = filenameWithoutExtensions.startsWith(\"_middleware\");\n const fileRenderMode = matchFileRenderMode(filename);\n const renderMode = fileRenderMode ?? parentRenderMode;\n route = route.split(\"/\").map((segment) => {\n const dirRenderMode = matchDirectoryRenderMode(segment);\n return dirRenderMode ? dirRenderMode.name : segment;\n }).join(\"/\");\n if (filenameWithoutExtensions.startsWith(\"(\") && filenameWithoutExtensions.endsWith(\")\")) {\n throw new Error(`Invalid route ./${key}. Routes cannot end with '(group)' syntax`);\n }\n if (renderMode !== \"api\" && filename.startsWith(\"+\") && filenameWithoutExtensions !== \"+not-found\") {\n const renamedRoute = [...parts.slice(0, -1), filename.slice(1)].join(\"/\");\n throw new Error(\n `Invalid route ./${key}. Route nodes cannot start with the '+' character. \"Please rename to ${renamedRoute}\"`\n );\n }\n let slotName;\n for (const part of parts) {\n const match = matchSlotName(part);\n if (match) {\n slotName = match;\n break;\n }\n }\n let interceptMatch;\n for (let i = 0; i < parts.length; i++) {\n const part = parts[i];\n const match = matchInterceptPrefix(part);\n if (match) {\n const remainingParts = parts.slice(i + 1).map((p) => removeSupportedExtensions(p)).filter((p) => p !== \"index\");\n const fullTargetPath = [match.targetPath, ...remainingParts].filter(Boolean).join(\"/\");\n interceptMatch = {\n ...match,\n targetPath: fullTargetPath\n };\n break;\n }\n }\n let specificity = 0;\n const platformExtension = filenameWithoutExtensions.split(\".\")[1];\n const hasPlatformExtension = validPlatforms.has(platformExtension);\n const usePlatformRoutes = options.platformRoutes ?? true;\n if (hasPlatformExtension) {\n if (!usePlatformRoutes) {\n specificity = -1;\n } else if (!options.platform) {\n specificity = -1;\n } else if (platformExtension === options.platform) {\n specificity = 2;\n } else if (platformExtension === \"native\" && options.platform !== \"web\") {\n specificity = 1;\n } else if (platformExtension !== options.platform) {\n specificity = -1;\n }\n if (renderMode === \"api\" && specificity !== 0) {\n throw new Error(\n `Api routes cannot have platform extensions. Please remove '.${platformExtension}' from './${key}'`\n );\n }\n route = route.replace(new RegExp(`.${platformExtension}$`), \"\");\n }\n return {\n route,\n specificity,\n isLayout,\n isMiddleware,\n renderMode,\n slotName,\n interceptMatch\n };\n}\nfunction getMostSpecific(routes) {\n const route = routes[routes.length - 1];\n if (!routes[0]) {\n throw new Error(\n ` [one] The file ${route.contextKey} does not have a fallback sibling file without a platform extension in routes (${routes[0]}, ${routes.length}):\n${routes.map((r) => r.contextKey || \"NONE\").join(\"\\n\")}.`\n );\n }\n return route;\n}\nfunction getIgnoreList(options) {\n const ignore = [/^\\.\\/\\+html\\.[tj]sx?$/, ...options?.ignore ?? []];\n if (options?.preserveApiRoutes !== true) {\n ignore.push(/\\+api\\.[tj]sx?$/);\n }\n return ignore;\n}\nfunction extrapolateGroups(key, keys = /* @__PURE__ */ new Set()) {\n const match = matchArrayGroupName(key);\n if (!match) {\n keys.add(key);\n return keys;\n }\n const groups = match.split(\",\");\n const groupsSet = new Set(groups);\n if (groupsSet.size !== groups.length) {\n throw new Error(\n `Array syntax cannot contain duplicate group name \"${groups}\" in \"${key}\".`\n );\n }\n if (groups.length === 1) {\n keys.add(key);\n return keys;\n }\n for (const group of groups) {\n extrapolateGroups(key.replace(match, group.trim()), keys);\n }\n return keys;\n}\nfunction generateDynamic(path) {\n const dynamic = path.split(\"/\").map((part) => {\n if (part === \"+not-found\") {\n return {\n name: \"+not-found\",\n deep: true,\n notFound: true\n };\n }\n const dynamicMatch = matchDynamicName(part);\n if (!dynamicMatch) return null;\n return { name: dynamicMatch.name, deep: dynamicMatch.deep };\n }).filter((part) => !!part);\n return dynamic.length === 0 ? null : dynamic;\n}\nfunction appendSitemapRoute(directory) {\n if (!directory.files.has(\"_sitemap\")) {\n directory.files.set(\"_sitemap\", [\n {\n loadRoute() {\n return { default: () => null, getNavOptions: () => {\n } };\n },\n route: \"_sitemap\",\n type: \"ssg\",\n contextKey: \"\",\n generated: true,\n internal: true,\n dynamic: null,\n children: []\n }\n ]);\n }\n}\nfunction hasNotFoundInGroupSubdirs(directory) {\n for (const [dirName, subDir] of directory.subdirectories) {\n if (!matchGroupName(dirName)) continue;\n for (const fileKey of subDir.files.keys()) {\n if (fileKey.endsWith(\"+not-found\")) {\n return true;\n }\n }\n if (hasNotFoundInGroupSubdirs(subDir)) {\n return true;\n }\n }\n return false;\n}\nfunction appendNotFoundRoute(directory) {\n if (!directory.files.has(\"+not-found\") && !hasNotFoundInGroupSubdirs(directory)) {\n directory.files.set(\"+not-found\", [\n {\n loadRoute() {\n return { default: () => null };\n },\n type: \"spa\",\n route: \"+not-found\",\n contextKey: \"\",\n generated: true,\n internal: true,\n dynamic: [{ name: \"+not-found\", deep: true, notFound: true }],\n children: []\n }\n ]);\n }\n}\nfunction getLayoutNode(node, options) {\n const groupName = matchGroupName(node.route);\n const childMatchingGroup = node.children.find((child) => {\n return child.route.replace(/\\/index$/, \"\") === groupName;\n });\n const initialRouteName = childMatchingGroup?.route;\n return {\n ...node,\n route: node.route.replace(/\\/?_layout$/, \"\"),\n children: [],\n // Each layout should have its own children\n initialRouteName\n };\n}\nfunction crawlAndAppendInitialRoutesAndEntryFiles(node, options, entryPoints = []) {\n if (node.type === \"spa\" || node.type === \"ssg\" || node.type === \"ssr\") {\n if (!options.ignoreEntryPoints) {\n node.entryPoints = [.../* @__PURE__ */ new Set([...entryPoints, node.contextKey])];\n }\n } else if (node.type === \"layout\") {\n if (!node.children) {\n throw new Error(`Layout \"${node.contextKey}\" does not contain any child routes`);\n }\n entryPoints = [...entryPoints, node.contextKey];\n const groupName = matchGroupName(node.route);\n const childMatchingGroup = node.children.find((child) => {\n return child.route.replace(/\\/index$/, \"\") === groupName;\n });\n let initialRouteName = childMatchingGroup?.route;\n const loaded = node.loadRoute();\n if (loaded?.unstable_settings) {\n initialRouteName = loaded.unstable_settings.initialRouteName ?? initialRouteName;\n if (groupName) {\n const groupSpecificInitialRouteName = loaded.unstable_settings?.[groupName]?.initialRouteName;\n initialRouteName = groupSpecificInitialRouteName ?? initialRouteName;\n }\n }\n if (initialRouteName) {\n const initialRoute = node.children.find((child) => child.route === initialRouteName);\n if (!initialRoute) {\n const validInitialRoutes = node.children.filter((child) => !child.generated).map((child) => `'${child.route}'`).join(\", \");\n if (groupName) {\n throw new Error(\n `Layout ${node.contextKey} has invalid initialRouteName '${initialRouteName}' for group '(${groupName})'. Valid options are: ${validInitialRoutes}`\n );\n }\n throw new Error(\n `Layout ${node.contextKey} has invalid initialRouteName '${initialRouteName}'. Valid options are: ${validInitialRoutes}`\n );\n }\n node.initialRouteName = initialRouteName;\n entryPoints.push(initialRoute.contextKey);\n }\n for (const child of node.children) {\n crawlAndAppendInitialRoutesAndEntryFiles(child, options, entryPoints);\n }\n }\n}\nexport {\n extrapolateGroups,\n generateDynamic,\n getIgnoreList,\n getRoutes\n};\n//# sourceMappingURL=getRoutes.js.map\n"],"mappings":";;;;;;;;;;;;AAaA,MAAM,iCAAiC,IAAI,IAAI;CAAC;CAAW;CAAO;CAAS;CAAS;CAAU;AAAK,CAAC;AACpG,SAAS,UAAU,eAAe,UAAU,CAAC,GAAG;CAC9C,MAAM,gBAAgB,iBAAiB,eAAe,OAAO;CAC7D,IAAI,CAAC,eAAe;EAClB,OAAO;CACT;CACA,MAAM,WAAW,6BAA6B,eAAe,OAAO;CACpE,IAAI,CAAC,QAAQ,qBAAqB,QAAQ,YAAY,QAAQ,aAAa,OAAO;EAChF,yCAAyC,UAAU,OAAO;CAC5D;CACA,OAAO;AACT;AACA,SAAS,iBAAiB,eAAe,SAAS;CAChD,MAAM,aAAa,QAAQ,cAAc,QAAQ,IAAI;CACrD,MAAM,aAAa,CACjB,yBAEA,UAEF;CACA,IAAI,QAAQ,QAAQ;EAClB,WAAW,KAAK,GAAG,QAAQ,MAAM;CACnC;CACA,IAAI,CAAC,QAAQ,mBAAmB;EAC9B,WAAW,KAAK,iBAAiB;CACnC;CACA,MAAM,gBAAgB;EACpB,uBAAuB,IAAI,IAAI;EAC/B,gCAAgC,IAAI,IAAI;EACxC,uBAAuB,IAAI,IAAI;CACjC;CACA,IAAI,YAAY;CAChB,IAAI,UAAU;CACd,KAAK,MAAM,YAAY,cAAc,KAAK,GAAG;EAC3C,IAAI,WAAW,MAAM,UAAU,MAAM,KAAK,QAAQ,CAAC,GAAG;GACpD;EACF;EACA,UAAU;EACV,IAAI;EACJ,MAAM,YAAY,SAAS,QAAQ,SAAS,EAAE,CAAC,CAAC,MAAM,GAAG;EACzD,MAAM,iBAAiB,UAAU,MAA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AAI,kBAAkB;GACpB,MAAM,eAAe,KAAK,SAAS,MAAM,UAAU,MAAM,UAAU,gBAAgB;GACnF,IAAI,CAAC,cAAc;IACjB,MAAM,qBAAqB,KAAK,SAAS,QAAQ,UAAU,CAAC,MAAM,SAAS,CAAC,CAAC,KAAK,UAAU,IAAI,MAAM,MAAM,EAAE,CAAC,CAAC,KAAK,IAAI;IACzH,IAAI,WAAW;KACb,MAAM,IAAI,MACR,UAAU,KAAK,WAAW,iCAAiC,iBAAiB,gBAAgB,UAAU,yBAAyB,oBACjI;IACF;IACA,MAAM,IAAI,MACR,UAAU,KAAK,WAAW,iCAAiC,iBAAiB,wBAAwB,oBACtG;GACF;GACA,KAAK,mBAAmB;GACxB,YAAY,KAAK,aAAa,UAAU;EAC1C;EACA,KAAK,MAAM,SAAS,KAAK,UAAU;GACjC,yCAAyC,OAAO,SAAS,WAAW;EACtE;CACF;AACF"}
|
|
@@ -17,7 +17,7 @@ function getRoutes(contextModule) {
|
|
|
17
17
|
return null;
|
|
18
18
|
}
|
|
19
19
|
var rootNode = flattenDirectoryTreeToRoutes(directoryTree, options);
|
|
20
|
-
if (!options.ignoreEntryPoints) {
|
|
20
|
+
if (!options.ignoreEntryPoints || options.platform && options.platform !== "web") {
|
|
21
21
|
crawlAndAppendInitialRoutesAndEntryFiles(rootNode, options);
|
|
22
22
|
}
|
|
23
23
|
return rootNode;
|
|
@@ -766,7 +766,9 @@ function getLayoutNode(node, options) {
|
|
|
766
766
|
function crawlAndAppendInitialRoutesAndEntryFiles(node, options) {
|
|
767
767
|
var entryPoints = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [];
|
|
768
768
|
if (node.type === "spa" || node.type === "ssg" || node.type === "ssr") {
|
|
769
|
-
|
|
769
|
+
if (!options.ignoreEntryPoints) {
|
|
770
|
+
node.entryPoints = [.../* @__PURE__ */ new Set([...entryPoints, node.contextKey])];
|
|
771
|
+
}
|
|
770
772
|
} else if (node.type === "layout") {
|
|
771
773
|
if (!node.children) {
|
|
772
774
|
throw new Error(`Layout "${node.contextKey}" does not contain any child routes`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getRoutes.native.js","names":[],"sources":["esm/router/getRoutes.native.js"],"sourcesContent":["import { getDefaultRenderMode } from \"../config\";\nimport { getPageExport } from \"../utils/getPageExport\";\nimport { matchArrayGroupName, matchDirectoryRenderMode, matchDynamicName, matchFileRenderMode, matchGroupName, matchInterceptPrefix, matchSlotName, removeSupportedExtensions, stripInterceptPrefix } from \"./matchers\";\nvar validPlatforms = /* @__PURE__ */ new Set([\n \"android\",\n \"ios\",\n \"linux\",\n \"macos\",\n \"native\",\n \"web\"\n]);\nfunction getRoutes(contextModule) {\n var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};\n var directoryTree = getDirectoryTree(contextModule, options);\n if (!directoryTree) {\n return null;\n }\n var rootNode = flattenDirectoryTreeToRoutes(directoryTree, options);\n if (!options.ignoreEntryPoints) {\n crawlAndAppendInitialRoutesAndEntryFiles(rootNode, options);\n }\n return rootNode;\n}\nfunction getDirectoryTree(contextModule, options) {\n var importMode = options.importMode || process.env.One_ROUTER_IMPORT_MODE;\n var ignoreList = [\n /^\\.\\/\\+html\\.[tj]sx?$/,\n // Ignore the top level ./+html file\n /\\.d\\.ts$/\n ];\n if (options.ignore) {\n ignoreList.push(...options.ignore);\n }\n if (!options.preserveApiRoutes) {\n ignoreList.push(/\\+api\\.[tj]sx?$/);\n }\n var rootDirectory = {\n files: /* @__PURE__ */ new Map(),\n subdirectories: /* @__PURE__ */ new Map(),\n slots: /* @__PURE__ */ new Map()\n };\n var hasRoutes = false;\n var isValid = false;\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n var _loop = function() {\n var filePath = _step.value;\n if (ignoreList.some(function(regex) {\n return regex.test(filePath);\n })) {\n return \"continue\";\n }\n isValid = true;\n var parentRenderMode = void 0;\n var pathParts = filePath.replace(/^\\.\\//, \"\").split(\"/\");\n var directoryParts = pathParts.slice(0, -1);\n var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;\n try {\n for (var _iterator2 = directoryParts[Symbol.iterator](), _step1; !(_iteratorNormalCompletion2 = (_step1 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var part = _step1.value;\n var dirRenderMode = matchDirectoryRenderMode(part);\n if (dirRenderMode) {\n parentRenderMode = dirRenderMode.renderMode;\n }\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return != null) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n var meta = getFileMeta(filePath, options, parentRenderMode);\n if (meta.specificity < 0) {\n return \"continue\";\n }\n var type = meta.isLayout ? \"layout\" : meta.renderMode || getDefaultRenderMode();\n var layoutRenderMode = meta.isLayout && meta.renderMode && meta.renderMode !== \"api\" ? meta.renderMode : void 0;\n var node = {\n type,\n // store layout render mode if this is a layout with an explicit mode\n ...layoutRenderMode && {\n layoutRenderMode\n },\n loadRoute() {\n if (options.ignoreRequireErrors) {\n try {\n return contextModule(filePath);\n } catch (unused) {\n return {};\n }\n } else {\n return contextModule(filePath);\n }\n },\n contextKey: filePath,\n route: \"\",\n // This is overwritten during hoisting based upon the _layout\n dynamic: null,\n children: []\n };\n if (process.env.NODE_ENV === \"development\") {\n if (node.type !== \"api\" && importMode === \"sync\") {\n if (!getPageExport(node.loadRoute())) {\n return \"continue\";\n }\n }\n }\n var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;\n try {\n for (var _iterator1 = extrapolateGroups(meta.route)[Symbol.iterator](), _step2; !(_iteratorNormalCompletion1 = (_step2 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {\n var route = _step2.value;\n var subdirectoryParts = route.split(\"/\").slice(0, -1);\n var directory = rootDirectory;\n var _iteratorNormalCompletion22 = true, _didIteratorError22 = false, _iteratorError22 = void 0;\n try {\n for (var _iterator22 = subdirectoryParts[Symbol.iterator](), _step3; !(_iteratorNormalCompletion22 = (_step3 = _iterator22.next()).done); _iteratorNormalCompletion22 = true) {\n var part1 = _step3.value;\n var slotName = matchSlotName(part1);\n if (slotName) {\n var slotDirectory = directory.slots.get(slotName);\n if (!slotDirectory) {\n slotDirectory = {\n files: /* @__PURE__ */ new Map(),\n subdirectories: /* @__PURE__ */ new Map(),\n slots: /* @__PURE__ */ new Map()\n };\n directory.slots.set(slotName, slotDirectory);\n }\n directory = slotDirectory;\n } else {\n var _ref;\n var dirRenderMode1 = matchDirectoryRenderMode(part1);\n var dirName = (_ref = dirRenderMode1 === null || dirRenderMode1 === void 0 ? void 0 : dirRenderMode1.name) !== null && _ref !== void 0 ? _ref : part1;\n var subDirectory = directory.subdirectories.get(dirName);\n if (!subDirectory) {\n subDirectory = {\n files: /* @__PURE__ */ new Map(),\n subdirectories: /* @__PURE__ */ new Map(),\n slots: /* @__PURE__ */ new Map(),\n renderMode: dirRenderMode1 === null || dirRenderMode1 === void 0 ? void 0 : dirRenderMode1.renderMode\n };\n directory.subdirectories.set(dirName, subDirectory);\n }\n directory = subDirectory;\n }\n }\n } catch (err) {\n _didIteratorError22 = true;\n _iteratorError22 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion22 && _iterator22.return != null) {\n _iterator22.return();\n }\n } finally {\n if (_didIteratorError22) {\n throw _iteratorError22;\n }\n }\n }\n node = {\n ...node,\n route,\n slotName: meta.slotName,\n intercept: meta.interceptMatch ? {\n levels: meta.interceptMatch.levels,\n targetPath: meta.interceptMatch.targetPath\n } : void 0\n };\n if (meta.isLayout) {\n var _directory, _layout;\n (_layout = (_directory = directory).layout) !== null && _layout !== void 0 ? _layout : _directory.layout = [];\n var existing = directory.layout[meta.specificity];\n if (existing) {\n if (process.env.NODE_ENV !== \"production\") {\n throw new Error(`The layouts \"${filePath}\" and \"${existing.contextKey}\" conflict on the route \"/${route}\". Please remove or rename one of these files.`);\n }\n } else {\n node = getLayoutNode(node, options);\n directory.layout[meta.specificity] = node;\n }\n } else if (meta.isMiddleware) {\n directory.middleware = node;\n } else if (type === \"api\") {\n var fileKey = `${route}+api`;\n var nodes = directory.files.get(fileKey);\n if (!nodes) {\n nodes = [];\n directory.files.set(fileKey, nodes);\n }\n var existing1 = nodes[0];\n if (existing1) {\n if (process.env.NODE_ENV !== \"production\") {\n throw new Error(`The API route file \"${filePath}\" and \"${existing1.contextKey}\" conflict on the route \"/${route}\". Please remove or rename one of these files.`);\n }\n } else {\n nodes[0] = node;\n }\n } else {\n var nodes1 = directory.files.get(route);\n if (!nodes1) {\n nodes1 = [];\n directory.files.set(route, nodes1);\n }\n var existing2 = nodes1[meta.specificity];\n if (existing2) {\n if (process.env.NODE_ENV !== \"production\") {\n throw new Error(`The route files \"${filePath}\" and \"${existing2.contextKey}\" conflict on the route \"/${route}\". Please remove or rename one of these files.`);\n }\n } else {\n hasRoutes || (hasRoutes = true);\n nodes1[meta.specificity] = node;\n }\n }\n }\n } catch (err) {\n _didIteratorError1 = true;\n _iteratorError1 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion1 && _iterator1.return != null) {\n _iterator1.return();\n }\n } finally {\n if (_didIteratorError1) {\n throw _iteratorError1;\n }\n }\n }\n };\n for (var _iterator = contextModule.keys()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) _loop();\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n if (!isValid) {\n return null;\n }\n if (!rootDirectory.layout) {\n rootDirectory.layout = [\n {\n type: \"layout\",\n loadRoute: function loadRoute() {\n return {\n default: (function() {\n try {\n return require(\"../views/Navigator\");\n } catch (e) {\n return {\n DefaultNavigator: function DefaultNavigator() {\n throw e;\n }\n };\n }\n })().DefaultNavigator\n };\n },\n // Generate a fake file name for the directory\n contextKey: \"router/build/views/Navigator.js\",\n route: \"\",\n generated: true,\n dynamic: null,\n children: []\n }\n ];\n }\n if (hasRoutes) {\n appendSitemapRoute(rootDirectory);\n }\n appendNotFoundRoute(rootDirectory);\n return rootDirectory;\n}\nfunction flattenDirectoryTreeToRoutes(directory, options, layout) {\n var pathToRemove = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : \"\", parentMiddlewares = arguments.length > 4 ? arguments[4] : void 0;\n if (directory.layout) {\n var previousLayout = layout;\n layout = getMostSpecific(directory.layout);\n if (previousLayout) {\n previousLayout.children.push(layout);\n }\n var newRoute = layout.route.replace(pathToRemove, \"\");\n pathToRemove = layout.route ? `${layout.route}/` : \"\";\n layout.route = newRoute;\n layout.dynamic = generateDynamic(layout.route);\n }\n if (!layout) throw new Error(\"One Internal Error: No nearest layout\");\n var middlewares = directory.middleware ? [\n ...parentMiddlewares || [],\n directory.middleware\n ] : parentMiddlewares;\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = directory.files.values()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var routes = _step.value;\n var routeNode = getMostSpecific(routes);\n routeNode.route = routeNode.route.replace(pathToRemove, \"\");\n routeNode.dynamic = generateDynamic(routeNode.route);\n routeNode.middlewares = middlewares;\n layout.children.push(routeNode);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;\n try {\n for (var _iterator1 = directory.subdirectories.values()[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {\n var child = _step1.value;\n flattenDirectoryTreeToRoutes(child, options, layout, pathToRemove, middlewares);\n }\n } catch (err) {\n _didIteratorError1 = true;\n _iteratorError1 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion1 && _iterator1.return != null) {\n _iterator1.return();\n }\n } finally {\n if (_didIteratorError1) {\n throw _iteratorError1;\n }\n }\n }\n if (directory.slots.size > 0) {\n layout.slots = /* @__PURE__ */ new Map();\n var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;\n try {\n for (var _iterator2 = directory.slots[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var [slotName, slotDir] = _step2.value;\n var slotConfig = flattenSlotDirectory(slotDir, slotName, options, pathToRemove);\n layout.slots.set(slotName, slotConfig);\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return != null) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n }\n return layout;\n}\nfunction flattenSlotDirectory(directory, slotName, options, pathToRemove) {\n var interceptRoutes = [];\n var defaultRoute;\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = directory.files.values()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var routes = _step.value;\n var routeNode = getMostSpecific(routes);\n var cleanRoute = routeNode.route.replace(pathToRemove, \"\");\n cleanRoute = cleanRoute.split(\"/\").filter(function(segment) {\n return !matchSlotName(segment);\n }).map(function(segment) {\n return stripInterceptPrefix(segment);\n }).join(\"/\");\n if (cleanRoute.endsWith(\"default\") || cleanRoute === \"default\") {\n defaultRoute = {\n ...routeNode,\n route: cleanRoute,\n slotName,\n dynamic: generateDynamic(cleanRoute)\n };\n } else {\n interceptRoutes.push({\n ...routeNode,\n route: cleanRoute,\n slotName,\n dynamic: generateDynamic(cleanRoute)\n });\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;\n try {\n for (var _iterator1 = directory.subdirectories[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {\n var [subDirName, subDir] = _step1.value;\n var subRoutes = flattenSlotSubdirectory(subDir, slotName, options, pathToRemove, subDirName);\n interceptRoutes.push(...subRoutes);\n }\n } catch (err) {\n _didIteratorError1 = true;\n _iteratorError1 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion1 && _iterator1.return != null) {\n _iterator1.return();\n }\n } finally {\n if (_didIteratorError1) {\n throw _iteratorError1;\n }\n }\n }\n return {\n name: slotName,\n defaultRoute,\n interceptRoutes\n };\n}\nfunction flattenSlotSubdirectory(directory, slotName, options, pathToRemove, currentPath) {\n var routes = [];\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = directory.files.values()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var fileRoutes = _step.value;\n var routeNode = getMostSpecific(fileRoutes);\n var cleanRoute = routeNode.route.replace(pathToRemove, \"\");\n cleanRoute = cleanRoute.split(\"/\").filter(function(segment) {\n return !matchSlotName(segment);\n }).map(function(segment) {\n return stripInterceptPrefix(segment);\n }).join(\"/\");\n routes.push({\n ...routeNode,\n route: cleanRoute,\n slotName,\n dynamic: generateDynamic(cleanRoute)\n });\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;\n try {\n for (var _iterator1 = directory.subdirectories[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {\n var [subDirName, subDir] = _step1.value;\n var subPath = currentPath ? `${currentPath}/${subDirName}` : subDirName;\n routes.push(...flattenSlotSubdirectory(subDir, slotName, options, pathToRemove, subPath));\n }\n } catch (err) {\n _didIteratorError1 = true;\n _iteratorError1 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion1 && _iterator1.return != null) {\n _iterator1.return();\n }\n } finally {\n if (_didIteratorError1) {\n throw _iteratorError1;\n }\n }\n }\n return routes;\n}\nfunction getFileMeta(key, options, parentRenderMode) {\n var _options_platformRoutes;\n key = key.replace(/^\\.\\//, \"\");\n var parts = key.split(\"/\");\n var route = removeSupportedExtensions(key);\n var filename = parts[parts.length - 1];\n var filenameWithoutExtensions = removeSupportedExtensions(filename);\n var isLayout = filenameWithoutExtensions.startsWith(\"_layout\");\n var isMiddleware = filenameWithoutExtensions.startsWith(\"_middleware\");\n var fileRenderMode = matchFileRenderMode(filename);\n var renderMode = fileRenderMode !== null && fileRenderMode !== void 0 ? fileRenderMode : parentRenderMode;\n route = route.split(\"/\").map(function(segment) {\n var dirRenderMode = matchDirectoryRenderMode(segment);\n return dirRenderMode ? dirRenderMode.name : segment;\n }).join(\"/\");\n if (filenameWithoutExtensions.startsWith(\"(\") && filenameWithoutExtensions.endsWith(\")\")) {\n throw new Error(`Invalid route ./${key}. Routes cannot end with '(group)' syntax`);\n }\n if (renderMode !== \"api\" && filename.startsWith(\"+\") && filenameWithoutExtensions !== \"+not-found\") {\n var renamedRoute = [\n ...parts.slice(0, -1),\n filename.slice(1)\n ].join(\"/\");\n throw new Error(`Invalid route ./${key}. Route nodes cannot start with the '+' character. \"Please rename to ${renamedRoute}\"`);\n }\n var slotName;\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = parts[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var part = _step.value;\n var match = matchSlotName(part);\n if (match) {\n slotName = match;\n break;\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n var interceptMatch;\n for (var i = 0; i < parts.length; i++) {\n var part1 = parts[i];\n var match1 = matchInterceptPrefix(part1);\n if (match1) {\n var remainingParts = parts.slice(i + 1).map(function(p) {\n return removeSupportedExtensions(p);\n }).filter(function(p) {\n return p !== \"index\";\n });\n var fullTargetPath = [\n match1.targetPath,\n ...remainingParts\n ].filter(Boolean).join(\"/\");\n interceptMatch = {\n ...match1,\n targetPath: fullTargetPath\n };\n break;\n }\n }\n var specificity = 0;\n var platformExtension = filenameWithoutExtensions.split(\".\")[1];\n var hasPlatformExtension = validPlatforms.has(platformExtension);\n var usePlatformRoutes = (_options_platformRoutes = options.platformRoutes) !== null && _options_platformRoutes !== void 0 ? _options_platformRoutes : true;\n if (hasPlatformExtension) {\n if (!usePlatformRoutes) {\n specificity = -1;\n } else if (!options.platform) {\n specificity = -1;\n } else if (platformExtension === options.platform) {\n specificity = 2;\n } else if (platformExtension === \"native\" && options.platform !== \"web\") {\n specificity = 1;\n } else if (platformExtension !== options.platform) {\n specificity = -1;\n }\n if (renderMode === \"api\" && specificity !== 0) {\n throw new Error(`Api routes cannot have platform extensions. Please remove '.${platformExtension}' from './${key}'`);\n }\n route = route.replace(new RegExp(`.${platformExtension}$`), \"\");\n }\n return {\n route,\n specificity,\n isLayout,\n isMiddleware,\n renderMode,\n slotName,\n interceptMatch\n };\n}\nfunction getMostSpecific(routes) {\n var route = routes[routes.length - 1];\n if (!routes[0]) {\n 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}):\n${routes.map(function(r) {\n return r.contextKey || \"NONE\";\n }).join(\"\\n\")}.`);\n }\n return route;\n}\nfunction getIgnoreList(options) {\n var _ref;\n var ignore = [\n /^\\.\\/\\+html\\.[tj]sx?$/,\n ...(_ref = options === null || options === void 0 ? void 0 : options.ignore) !== null && _ref !== void 0 ? _ref : []\n ];\n if ((options === null || options === void 0 ? void 0 : options.preserveApiRoutes) !== true) {\n ignore.push(/\\+api\\.[tj]sx?$/);\n }\n return ignore;\n}\nfunction extrapolateGroups(key) {\n var keys = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : /* @__PURE__ */ new Set();\n var match = matchArrayGroupName(key);\n if (!match) {\n keys.add(key);\n return keys;\n }\n var groups = match.split(\",\");\n var groupsSet = new Set(groups);\n if (groupsSet.size !== groups.length) {\n throw new Error(`Array syntax cannot contain duplicate group name \"${groups}\" in \"${key}\".`);\n }\n if (groups.length === 1) {\n keys.add(key);\n return keys;\n }\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = groups[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var group = _step.value;\n extrapolateGroups(key.replace(match, group.trim()), keys);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n return keys;\n}\nfunction generateDynamic(path) {\n var dynamic = path.split(\"/\").map(function(part) {\n if (part === \"+not-found\") {\n return {\n name: \"+not-found\",\n deep: true,\n notFound: true\n };\n }\n var dynamicMatch = matchDynamicName(part);\n if (!dynamicMatch) return null;\n return {\n name: dynamicMatch.name,\n deep: dynamicMatch.deep\n };\n }).filter(function(part) {\n return !!part;\n });\n return dynamic.length === 0 ? null : dynamic;\n}\nfunction appendSitemapRoute(directory) {\n if (!directory.files.has(\"_sitemap\")) {\n directory.files.set(\"_sitemap\", [\n {\n loadRoute() {\n return {\n default: function _default() {\n return null;\n },\n getNavOptions: function getNavOptions() {\n }\n };\n },\n route: \"_sitemap\",\n type: \"ssg\",\n contextKey: \"\",\n generated: true,\n internal: true,\n dynamic: null,\n children: []\n }\n ]);\n }\n}\nfunction hasNotFoundInGroupSubdirs(directory) {\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = directory.subdirectories[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var [dirName, subDir] = _step.value;\n if (!matchGroupName(dirName)) continue;\n var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;\n try {\n for (var _iterator1 = subDir.files.keys()[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {\n var fileKey = _step1.value;\n if (fileKey.endsWith(\"+not-found\")) {\n return true;\n }\n }\n } catch (err) {\n _didIteratorError1 = true;\n _iteratorError1 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion1 && _iterator1.return != null) {\n _iterator1.return();\n }\n } finally {\n if (_didIteratorError1) {\n throw _iteratorError1;\n }\n }\n }\n if (hasNotFoundInGroupSubdirs(subDir)) {\n return true;\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n return false;\n}\nfunction appendNotFoundRoute(directory) {\n if (!directory.files.has(\"+not-found\") && !hasNotFoundInGroupSubdirs(directory)) {\n directory.files.set(\"+not-found\", [\n {\n loadRoute() {\n return {\n default: function _default() {\n return null;\n }\n };\n },\n type: \"spa\",\n route: \"+not-found\",\n contextKey: \"\",\n generated: true,\n internal: true,\n dynamic: [\n {\n name: \"+not-found\",\n deep: true,\n notFound: true\n }\n ],\n children: []\n }\n ]);\n }\n}\nfunction getLayoutNode(node, options) {\n var groupName = matchGroupName(node.route);\n var childMatchingGroup = node.children.find(function(child) {\n return child.route.replace(/\\/index$/, \"\") === groupName;\n });\n var initialRouteName = childMatchingGroup === null || childMatchingGroup === void 0 ? void 0 : childMatchingGroup.route;\n return {\n ...node,\n route: node.route.replace(/\\/?_layout$/, \"\"),\n children: [],\n // Each layout should have its own children\n initialRouteName\n };\n}\nfunction crawlAndAppendInitialRoutesAndEntryFiles(node, options) {\n var entryPoints = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [];\n if (node.type === \"spa\" || node.type === \"ssg\" || node.type === \"ssr\") {\n node.entryPoints = [\n .../* @__PURE__ */ new Set([\n ...entryPoints,\n node.contextKey\n ])\n ];\n } else if (node.type === \"layout\") {\n if (!node.children) {\n throw new Error(`Layout \"${node.contextKey}\" does not contain any child routes`);\n }\n entryPoints = [\n ...entryPoints,\n node.contextKey\n ];\n var groupName = matchGroupName(node.route);\n var childMatchingGroup = node.children.find(function(child2) {\n return child2.route.replace(/\\/index$/, \"\") === groupName;\n });\n var initialRouteName = childMatchingGroup === null || childMatchingGroup === void 0 ? void 0 : childMatchingGroup.route;\n var loaded = node.loadRoute();\n if (loaded === null || loaded === void 0 ? void 0 : loaded.unstable_settings) {\n var _loaded_unstable_settings_initialRouteName;\n initialRouteName = (_loaded_unstable_settings_initialRouteName = loaded.unstable_settings.initialRouteName) !== null && _loaded_unstable_settings_initialRouteName !== void 0 ? _loaded_unstable_settings_initialRouteName : initialRouteName;\n if (groupName) {\n var _loaded_unstable_settings_groupName, _loaded_unstable_settings;\n var groupSpecificInitialRouteName = (_loaded_unstable_settings = loaded.unstable_settings) === null || _loaded_unstable_settings === void 0 ? void 0 : (_loaded_unstable_settings_groupName = _loaded_unstable_settings[groupName]) === null || _loaded_unstable_settings_groupName === void 0 ? void 0 : _loaded_unstable_settings_groupName.initialRouteName;\n initialRouteName = groupSpecificInitialRouteName !== null && groupSpecificInitialRouteName !== void 0 ? groupSpecificInitialRouteName : initialRouteName;\n }\n }\n if (initialRouteName) {\n var initialRoute = node.children.find(function(child2) {\n return child2.route === initialRouteName;\n });\n if (!initialRoute) {\n var validInitialRoutes = node.children.filter(function(child2) {\n return !child2.generated;\n }).map(function(child2) {\n return `'${child2.route}'`;\n }).join(\", \");\n if (groupName) {\n throw new Error(`Layout ${node.contextKey} has invalid initialRouteName '${initialRouteName}' for group '(${groupName})'. Valid options are: ${validInitialRoutes}`);\n }\n throw new Error(`Layout ${node.contextKey} has invalid initialRouteName '${initialRouteName}'. Valid options are: ${validInitialRoutes}`);\n }\n node.initialRouteName = initialRouteName;\n entryPoints.push(initialRoute.contextKey);\n }\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = node.children[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var child = _step.value;\n crawlAndAppendInitialRoutesAndEntryFiles(child, options, entryPoints);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n }\n}\nexport {\n extrapolateGroups,\n generateDynamic,\n getIgnoreList,\n getRoutes\n};\n//# sourceMappingURL=getRoutes.js.map\n"],"mappings":";;;;;;;;;;;;AAGA,IAAI,iCAAiC,IAAI,IAAI;CAC3C;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AACD,SAAS,UAAU,eAAe;CAChC,IAAI,UAAU,UAAU,SAAS,KAAK,UAAU,OAAO,KAAK,IAAI,UAAU,KAAK,CAAC;CAChF,IAAI,gBAAgB,iBAAiB,eAAe,OAAO;CAC3D,IAAI,CAAC,eAAe;EAClB,OAAO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AE,6BAA6B,QAAQ,UAAU,KAAK,EAAC,CAAE,OAAO,4BAA4B,MAAM;IAC9J,IAAI,QAAQ,MAAM;IAClB,yCAAyC,OAAO,SAAS,WAAW;GACtE;EACF,SAAS,KAAK;GACZ,oBAAoB;GACpB,iBAAiB;EACnB,UAAU;GACR,IAAI;IACF,IAAI,CAAC,6BAA6B,UAAU,UAAU,MAAM;KAC1D,UAAU,OAAO;IACnB;GACF,UAAU;IACR,IAAI,mBAAmB;KACrB,MAAM;IACR;GACF;EACF;CACF;AACF"}
|
|
1
|
+
{"version":3,"file":"getRoutes.native.js","names":[],"sources":["esm/router/getRoutes.native.js"],"sourcesContent":["import { getDefaultRenderMode } from \"../config\";\nimport { getPageExport } from \"../utils/getPageExport\";\nimport { matchArrayGroupName, matchDirectoryRenderMode, matchDynamicName, matchFileRenderMode, matchGroupName, matchInterceptPrefix, matchSlotName, removeSupportedExtensions, stripInterceptPrefix } from \"./matchers\";\nvar validPlatforms = /* @__PURE__ */ new Set([\n \"android\",\n \"ios\",\n \"linux\",\n \"macos\",\n \"native\",\n \"web\"\n]);\nfunction getRoutes(contextModule) {\n var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};\n var directoryTree = getDirectoryTree(contextModule, options);\n if (!directoryTree) {\n return null;\n }\n var rootNode = flattenDirectoryTreeToRoutes(directoryTree, options);\n if (!options.ignoreEntryPoints || options.platform && options.platform !== \"web\") {\n crawlAndAppendInitialRoutesAndEntryFiles(rootNode, options);\n }\n return rootNode;\n}\nfunction getDirectoryTree(contextModule, options) {\n var importMode = options.importMode || process.env.One_ROUTER_IMPORT_MODE;\n var ignoreList = [\n /^\\.\\/\\+html\\.[tj]sx?$/,\n // Ignore the top level ./+html file\n /\\.d\\.ts$/\n ];\n if (options.ignore) {\n ignoreList.push(...options.ignore);\n }\n if (!options.preserveApiRoutes) {\n ignoreList.push(/\\+api\\.[tj]sx?$/);\n }\n var rootDirectory = {\n files: /* @__PURE__ */ new Map(),\n subdirectories: /* @__PURE__ */ new Map(),\n slots: /* @__PURE__ */ new Map()\n };\n var hasRoutes = false;\n var isValid = false;\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n var _loop = function() {\n var filePath = _step.value;\n if (ignoreList.some(function(regex) {\n return regex.test(filePath);\n })) {\n return \"continue\";\n }\n isValid = true;\n var parentRenderMode = void 0;\n var pathParts = filePath.replace(/^\\.\\//, \"\").split(\"/\");\n var directoryParts = pathParts.slice(0, -1);\n var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;\n try {\n for (var _iterator2 = directoryParts[Symbol.iterator](), _step1; !(_iteratorNormalCompletion2 = (_step1 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var part = _step1.value;\n var dirRenderMode = matchDirectoryRenderMode(part);\n if (dirRenderMode) {\n parentRenderMode = dirRenderMode.renderMode;\n }\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return != null) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n var meta = getFileMeta(filePath, options, parentRenderMode);\n if (meta.specificity < 0) {\n return \"continue\";\n }\n var type = meta.isLayout ? \"layout\" : meta.renderMode || getDefaultRenderMode();\n var layoutRenderMode = meta.isLayout && meta.renderMode && meta.renderMode !== \"api\" ? meta.renderMode : void 0;\n var node = {\n type,\n // store layout render mode if this is a layout with an explicit mode\n ...layoutRenderMode && {\n layoutRenderMode\n },\n loadRoute() {\n if (options.ignoreRequireErrors) {\n try {\n return contextModule(filePath);\n } catch (unused) {\n return {};\n }\n } else {\n return contextModule(filePath);\n }\n },\n contextKey: filePath,\n route: \"\",\n // This is overwritten during hoisting based upon the _layout\n dynamic: null,\n children: []\n };\n if (process.env.NODE_ENV === \"development\") {\n if (node.type !== \"api\" && importMode === \"sync\") {\n if (!getPageExport(node.loadRoute())) {\n return \"continue\";\n }\n }\n }\n var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;\n try {\n for (var _iterator1 = extrapolateGroups(meta.route)[Symbol.iterator](), _step2; !(_iteratorNormalCompletion1 = (_step2 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {\n var route = _step2.value;\n var subdirectoryParts = route.split(\"/\").slice(0, -1);\n var directory = rootDirectory;\n var _iteratorNormalCompletion22 = true, _didIteratorError22 = false, _iteratorError22 = void 0;\n try {\n for (var _iterator22 = subdirectoryParts[Symbol.iterator](), _step3; !(_iteratorNormalCompletion22 = (_step3 = _iterator22.next()).done); _iteratorNormalCompletion22 = true) {\n var part1 = _step3.value;\n var slotName = matchSlotName(part1);\n if (slotName) {\n var slotDirectory = directory.slots.get(slotName);\n if (!slotDirectory) {\n slotDirectory = {\n files: /* @__PURE__ */ new Map(),\n subdirectories: /* @__PURE__ */ new Map(),\n slots: /* @__PURE__ */ new Map()\n };\n directory.slots.set(slotName, slotDirectory);\n }\n directory = slotDirectory;\n } else {\n var _ref;\n var dirRenderMode1 = matchDirectoryRenderMode(part1);\n var dirName = (_ref = dirRenderMode1 === null || dirRenderMode1 === void 0 ? void 0 : dirRenderMode1.name) !== null && _ref !== void 0 ? _ref : part1;\n var subDirectory = directory.subdirectories.get(dirName);\n if (!subDirectory) {\n subDirectory = {\n files: /* @__PURE__ */ new Map(),\n subdirectories: /* @__PURE__ */ new Map(),\n slots: /* @__PURE__ */ new Map(),\n renderMode: dirRenderMode1 === null || dirRenderMode1 === void 0 ? void 0 : dirRenderMode1.renderMode\n };\n directory.subdirectories.set(dirName, subDirectory);\n }\n directory = subDirectory;\n }\n }\n } catch (err) {\n _didIteratorError22 = true;\n _iteratorError22 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion22 && _iterator22.return != null) {\n _iterator22.return();\n }\n } finally {\n if (_didIteratorError22) {\n throw _iteratorError22;\n }\n }\n }\n node = {\n ...node,\n route,\n slotName: meta.slotName,\n intercept: meta.interceptMatch ? {\n levels: meta.interceptMatch.levels,\n targetPath: meta.interceptMatch.targetPath\n } : void 0\n };\n if (meta.isLayout) {\n var _directory, _layout;\n (_layout = (_directory = directory).layout) !== null && _layout !== void 0 ? _layout : _directory.layout = [];\n var existing = directory.layout[meta.specificity];\n if (existing) {\n if (process.env.NODE_ENV !== \"production\") {\n throw new Error(`The layouts \"${filePath}\" and \"${existing.contextKey}\" conflict on the route \"/${route}\". Please remove or rename one of these files.`);\n }\n } else {\n node = getLayoutNode(node, options);\n directory.layout[meta.specificity] = node;\n }\n } else if (meta.isMiddleware) {\n directory.middleware = node;\n } else if (type === \"api\") {\n var fileKey = `${route}+api`;\n var nodes = directory.files.get(fileKey);\n if (!nodes) {\n nodes = [];\n directory.files.set(fileKey, nodes);\n }\n var existing1 = nodes[0];\n if (existing1) {\n if (process.env.NODE_ENV !== \"production\") {\n throw new Error(`The API route file \"${filePath}\" and \"${existing1.contextKey}\" conflict on the route \"/${route}\". Please remove or rename one of these files.`);\n }\n } else {\n nodes[0] = node;\n }\n } else {\n var nodes1 = directory.files.get(route);\n if (!nodes1) {\n nodes1 = [];\n directory.files.set(route, nodes1);\n }\n var existing2 = nodes1[meta.specificity];\n if (existing2) {\n if (process.env.NODE_ENV !== \"production\") {\n throw new Error(`The route files \"${filePath}\" and \"${existing2.contextKey}\" conflict on the route \"/${route}\". Please remove or rename one of these files.`);\n }\n } else {\n hasRoutes || (hasRoutes = true);\n nodes1[meta.specificity] = node;\n }\n }\n }\n } catch (err) {\n _didIteratorError1 = true;\n _iteratorError1 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion1 && _iterator1.return != null) {\n _iterator1.return();\n }\n } finally {\n if (_didIteratorError1) {\n throw _iteratorError1;\n }\n }\n }\n };\n for (var _iterator = contextModule.keys()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) _loop();\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n if (!isValid) {\n return null;\n }\n if (!rootDirectory.layout) {\n rootDirectory.layout = [\n {\n type: \"layout\",\n loadRoute: function loadRoute() {\n return {\n default: (function() {\n try {\n return require(\"../views/Navigator\");\n } catch (e) {\n return {\n DefaultNavigator: function DefaultNavigator() {\n throw e;\n }\n };\n }\n })().DefaultNavigator\n };\n },\n // Generate a fake file name for the directory\n contextKey: \"router/build/views/Navigator.js\",\n route: \"\",\n generated: true,\n dynamic: null,\n children: []\n }\n ];\n }\n if (hasRoutes) {\n appendSitemapRoute(rootDirectory);\n }\n appendNotFoundRoute(rootDirectory);\n return rootDirectory;\n}\nfunction flattenDirectoryTreeToRoutes(directory, options, layout) {\n var pathToRemove = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : \"\", parentMiddlewares = arguments.length > 4 ? arguments[4] : void 0;\n if (directory.layout) {\n var previousLayout = layout;\n layout = getMostSpecific(directory.layout);\n if (previousLayout) {\n previousLayout.children.push(layout);\n }\n var newRoute = layout.route.replace(pathToRemove, \"\");\n pathToRemove = layout.route ? `${layout.route}/` : \"\";\n layout.route = newRoute;\n layout.dynamic = generateDynamic(layout.route);\n }\n if (!layout) throw new Error(\"One Internal Error: No nearest layout\");\n var middlewares = directory.middleware ? [\n ...parentMiddlewares || [],\n directory.middleware\n ] : parentMiddlewares;\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = directory.files.values()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var routes = _step.value;\n var routeNode = getMostSpecific(routes);\n routeNode.route = routeNode.route.replace(pathToRemove, \"\");\n routeNode.dynamic = generateDynamic(routeNode.route);\n routeNode.middlewares = middlewares;\n layout.children.push(routeNode);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;\n try {\n for (var _iterator1 = directory.subdirectories.values()[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {\n var child = _step1.value;\n flattenDirectoryTreeToRoutes(child, options, layout, pathToRemove, middlewares);\n }\n } catch (err) {\n _didIteratorError1 = true;\n _iteratorError1 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion1 && _iterator1.return != null) {\n _iterator1.return();\n }\n } finally {\n if (_didIteratorError1) {\n throw _iteratorError1;\n }\n }\n }\n if (directory.slots.size > 0) {\n layout.slots = /* @__PURE__ */ new Map();\n var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;\n try {\n for (var _iterator2 = directory.slots[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var [slotName, slotDir] = _step2.value;\n var slotConfig = flattenSlotDirectory(slotDir, slotName, options, pathToRemove);\n layout.slots.set(slotName, slotConfig);\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return != null) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n }\n return layout;\n}\nfunction flattenSlotDirectory(directory, slotName, options, pathToRemove) {\n var interceptRoutes = [];\n var defaultRoute;\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = directory.files.values()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var routes = _step.value;\n var routeNode = getMostSpecific(routes);\n var cleanRoute = routeNode.route.replace(pathToRemove, \"\");\n cleanRoute = cleanRoute.split(\"/\").filter(function(segment) {\n return !matchSlotName(segment);\n }).map(function(segment) {\n return stripInterceptPrefix(segment);\n }).join(\"/\");\n if (cleanRoute.endsWith(\"default\") || cleanRoute === \"default\") {\n defaultRoute = {\n ...routeNode,\n route: cleanRoute,\n slotName,\n dynamic: generateDynamic(cleanRoute)\n };\n } else {\n interceptRoutes.push({\n ...routeNode,\n route: cleanRoute,\n slotName,\n dynamic: generateDynamic(cleanRoute)\n });\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;\n try {\n for (var _iterator1 = directory.subdirectories[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {\n var [subDirName, subDir] = _step1.value;\n var subRoutes = flattenSlotSubdirectory(subDir, slotName, options, pathToRemove, subDirName);\n interceptRoutes.push(...subRoutes);\n }\n } catch (err) {\n _didIteratorError1 = true;\n _iteratorError1 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion1 && _iterator1.return != null) {\n _iterator1.return();\n }\n } finally {\n if (_didIteratorError1) {\n throw _iteratorError1;\n }\n }\n }\n return {\n name: slotName,\n defaultRoute,\n interceptRoutes\n };\n}\nfunction flattenSlotSubdirectory(directory, slotName, options, pathToRemove, currentPath) {\n var routes = [];\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = directory.files.values()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var fileRoutes = _step.value;\n var routeNode = getMostSpecific(fileRoutes);\n var cleanRoute = routeNode.route.replace(pathToRemove, \"\");\n cleanRoute = cleanRoute.split(\"/\").filter(function(segment) {\n return !matchSlotName(segment);\n }).map(function(segment) {\n return stripInterceptPrefix(segment);\n }).join(\"/\");\n routes.push({\n ...routeNode,\n route: cleanRoute,\n slotName,\n dynamic: generateDynamic(cleanRoute)\n });\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;\n try {\n for (var _iterator1 = directory.subdirectories[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {\n var [subDirName, subDir] = _step1.value;\n var subPath = currentPath ? `${currentPath}/${subDirName}` : subDirName;\n routes.push(...flattenSlotSubdirectory(subDir, slotName, options, pathToRemove, subPath));\n }\n } catch (err) {\n _didIteratorError1 = true;\n _iteratorError1 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion1 && _iterator1.return != null) {\n _iterator1.return();\n }\n } finally {\n if (_didIteratorError1) {\n throw _iteratorError1;\n }\n }\n }\n return routes;\n}\nfunction getFileMeta(key, options, parentRenderMode) {\n var _options_platformRoutes;\n key = key.replace(/^\\.\\//, \"\");\n var parts = key.split(\"/\");\n var route = removeSupportedExtensions(key);\n var filename = parts[parts.length - 1];\n var filenameWithoutExtensions = removeSupportedExtensions(filename);\n var isLayout = filenameWithoutExtensions.startsWith(\"_layout\");\n var isMiddleware = filenameWithoutExtensions.startsWith(\"_middleware\");\n var fileRenderMode = matchFileRenderMode(filename);\n var renderMode = fileRenderMode !== null && fileRenderMode !== void 0 ? fileRenderMode : parentRenderMode;\n route = route.split(\"/\").map(function(segment) {\n var dirRenderMode = matchDirectoryRenderMode(segment);\n return dirRenderMode ? dirRenderMode.name : segment;\n }).join(\"/\");\n if (filenameWithoutExtensions.startsWith(\"(\") && filenameWithoutExtensions.endsWith(\")\")) {\n throw new Error(`Invalid route ./${key}. Routes cannot end with '(group)' syntax`);\n }\n if (renderMode !== \"api\" && filename.startsWith(\"+\") && filenameWithoutExtensions !== \"+not-found\") {\n var renamedRoute = [\n ...parts.slice(0, -1),\n filename.slice(1)\n ].join(\"/\");\n throw new Error(`Invalid route ./${key}. Route nodes cannot start with the '+' character. \"Please rename to ${renamedRoute}\"`);\n }\n var slotName;\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = parts[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var part = _step.value;\n var match = matchSlotName(part);\n if (match) {\n slotName = match;\n break;\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n var interceptMatch;\n for (var i = 0; i < parts.length; i++) {\n var part1 = parts[i];\n var match1 = matchInterceptPrefix(part1);\n if (match1) {\n var remainingParts = parts.slice(i + 1).map(function(p) {\n return removeSupportedExtensions(p);\n }).filter(function(p) {\n return p !== \"index\";\n });\n var fullTargetPath = [\n match1.targetPath,\n ...remainingParts\n ].filter(Boolean).join(\"/\");\n interceptMatch = {\n ...match1,\n targetPath: fullTargetPath\n };\n break;\n }\n }\n var specificity = 0;\n var platformExtension = filenameWithoutExtensions.split(\".\")[1];\n var hasPlatformExtension = validPlatforms.has(platformExtension);\n var usePlatformRoutes = (_options_platformRoutes = options.platformRoutes) !== null && _options_platformRoutes !== void 0 ? _options_platformRoutes : true;\n if (hasPlatformExtension) {\n if (!usePlatformRoutes) {\n specificity = -1;\n } else if (!options.platform) {\n specificity = -1;\n } else if (platformExtension === options.platform) {\n specificity = 2;\n } else if (platformExtension === \"native\" && options.platform !== \"web\") {\n specificity = 1;\n } else if (platformExtension !== options.platform) {\n specificity = -1;\n }\n if (renderMode === \"api\" && specificity !== 0) {\n throw new Error(`Api routes cannot have platform extensions. Please remove '.${platformExtension}' from './${key}'`);\n }\n route = route.replace(new RegExp(`.${platformExtension}$`), \"\");\n }\n return {\n route,\n specificity,\n isLayout,\n isMiddleware,\n renderMode,\n slotName,\n interceptMatch\n };\n}\nfunction getMostSpecific(routes) {\n var route = routes[routes.length - 1];\n if (!routes[0]) {\n 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}):\n${routes.map(function(r) {\n return r.contextKey || \"NONE\";\n }).join(\"\\n\")}.`);\n }\n return route;\n}\nfunction getIgnoreList(options) {\n var _ref;\n var ignore = [\n /^\\.\\/\\+html\\.[tj]sx?$/,\n ...(_ref = options === null || options === void 0 ? void 0 : options.ignore) !== null && _ref !== void 0 ? _ref : []\n ];\n if ((options === null || options === void 0 ? void 0 : options.preserveApiRoutes) !== true) {\n ignore.push(/\\+api\\.[tj]sx?$/);\n }\n return ignore;\n}\nfunction extrapolateGroups(key) {\n var keys = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : /* @__PURE__ */ new Set();\n var match = matchArrayGroupName(key);\n if (!match) {\n keys.add(key);\n return keys;\n }\n var groups = match.split(\",\");\n var groupsSet = new Set(groups);\n if (groupsSet.size !== groups.length) {\n throw new Error(`Array syntax cannot contain duplicate group name \"${groups}\" in \"${key}\".`);\n }\n if (groups.length === 1) {\n keys.add(key);\n return keys;\n }\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = groups[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var group = _step.value;\n extrapolateGroups(key.replace(match, group.trim()), keys);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n return keys;\n}\nfunction generateDynamic(path) {\n var dynamic = path.split(\"/\").map(function(part) {\n if (part === \"+not-found\") {\n return {\n name: \"+not-found\",\n deep: true,\n notFound: true\n };\n }\n var dynamicMatch = matchDynamicName(part);\n if (!dynamicMatch) return null;\n return {\n name: dynamicMatch.name,\n deep: dynamicMatch.deep\n };\n }).filter(function(part) {\n return !!part;\n });\n return dynamic.length === 0 ? null : dynamic;\n}\nfunction appendSitemapRoute(directory) {\n if (!directory.files.has(\"_sitemap\")) {\n directory.files.set(\"_sitemap\", [\n {\n loadRoute() {\n return {\n default: function _default() {\n return null;\n },\n getNavOptions: function getNavOptions() {\n }\n };\n },\n route: \"_sitemap\",\n type: \"ssg\",\n contextKey: \"\",\n generated: true,\n internal: true,\n dynamic: null,\n children: []\n }\n ]);\n }\n}\nfunction hasNotFoundInGroupSubdirs(directory) {\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = directory.subdirectories[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var [dirName, subDir] = _step.value;\n if (!matchGroupName(dirName)) continue;\n var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;\n try {\n for (var _iterator1 = subDir.files.keys()[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {\n var fileKey = _step1.value;\n if (fileKey.endsWith(\"+not-found\")) {\n return true;\n }\n }\n } catch (err) {\n _didIteratorError1 = true;\n _iteratorError1 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion1 && _iterator1.return != null) {\n _iterator1.return();\n }\n } finally {\n if (_didIteratorError1) {\n throw _iteratorError1;\n }\n }\n }\n if (hasNotFoundInGroupSubdirs(subDir)) {\n return true;\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n return false;\n}\nfunction appendNotFoundRoute(directory) {\n if (!directory.files.has(\"+not-found\") && !hasNotFoundInGroupSubdirs(directory)) {\n directory.files.set(\"+not-found\", [\n {\n loadRoute() {\n return {\n default: function _default() {\n return null;\n }\n };\n },\n type: \"spa\",\n route: \"+not-found\",\n contextKey: \"\",\n generated: true,\n internal: true,\n dynamic: [\n {\n name: \"+not-found\",\n deep: true,\n notFound: true\n }\n ],\n children: []\n }\n ]);\n }\n}\nfunction getLayoutNode(node, options) {\n var groupName = matchGroupName(node.route);\n var childMatchingGroup = node.children.find(function(child) {\n return child.route.replace(/\\/index$/, \"\") === groupName;\n });\n var initialRouteName = childMatchingGroup === null || childMatchingGroup === void 0 ? void 0 : childMatchingGroup.route;\n return {\n ...node,\n route: node.route.replace(/\\/?_layout$/, \"\"),\n children: [],\n // Each layout should have its own children\n initialRouteName\n };\n}\nfunction crawlAndAppendInitialRoutesAndEntryFiles(node, options) {\n var entryPoints = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [];\n if (node.type === \"spa\" || node.type === \"ssg\" || node.type === \"ssr\") {\n if (!options.ignoreEntryPoints) {\n node.entryPoints = [\n .../* @__PURE__ */ new Set([\n ...entryPoints,\n node.contextKey\n ])\n ];\n }\n } else if (node.type === \"layout\") {\n if (!node.children) {\n throw new Error(`Layout \"${node.contextKey}\" does not contain any child routes`);\n }\n entryPoints = [\n ...entryPoints,\n node.contextKey\n ];\n var groupName = matchGroupName(node.route);\n var childMatchingGroup = node.children.find(function(child2) {\n return child2.route.replace(/\\/index$/, \"\") === groupName;\n });\n var initialRouteName = childMatchingGroup === null || childMatchingGroup === void 0 ? void 0 : childMatchingGroup.route;\n var loaded = node.loadRoute();\n if (loaded === null || loaded === void 0 ? void 0 : loaded.unstable_settings) {\n var _loaded_unstable_settings_initialRouteName;\n initialRouteName = (_loaded_unstable_settings_initialRouteName = loaded.unstable_settings.initialRouteName) !== null && _loaded_unstable_settings_initialRouteName !== void 0 ? _loaded_unstable_settings_initialRouteName : initialRouteName;\n if (groupName) {\n var _loaded_unstable_settings_groupName, _loaded_unstable_settings;\n var groupSpecificInitialRouteName = (_loaded_unstable_settings = loaded.unstable_settings) === null || _loaded_unstable_settings === void 0 ? void 0 : (_loaded_unstable_settings_groupName = _loaded_unstable_settings[groupName]) === null || _loaded_unstable_settings_groupName === void 0 ? void 0 : _loaded_unstable_settings_groupName.initialRouteName;\n initialRouteName = groupSpecificInitialRouteName !== null && groupSpecificInitialRouteName !== void 0 ? groupSpecificInitialRouteName : initialRouteName;\n }\n }\n if (initialRouteName) {\n var initialRoute = node.children.find(function(child2) {\n return child2.route === initialRouteName;\n });\n if (!initialRoute) {\n var validInitialRoutes = node.children.filter(function(child2) {\n return !child2.generated;\n }).map(function(child2) {\n return `'${child2.route}'`;\n }).join(\", \");\n if (groupName) {\n throw new Error(`Layout ${node.contextKey} has invalid initialRouteName '${initialRouteName}' for group '(${groupName})'. Valid options are: ${validInitialRoutes}`);\n }\n throw new Error(`Layout ${node.contextKey} has invalid initialRouteName '${initialRouteName}'. Valid options are: ${validInitialRoutes}`);\n }\n node.initialRouteName = initialRouteName;\n entryPoints.push(initialRoute.contextKey);\n }\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = node.children[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var child = _step.value;\n crawlAndAppendInitialRoutesAndEntryFiles(child, options, entryPoints);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n }\n}\nexport {\n extrapolateGroups,\n generateDynamic,\n getIgnoreList,\n getRoutes\n};\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,WAAW;KACb,MAAM,IAAI,MAAM,UAAU,KAAK,WAAW,iCAAiC,iBAAiB,gBAAgB,UAAU,yBAAyB,oBAAoB;IACrK;IACA,MAAM,IAAI,MAAM,UAAU,KAAK,WAAW,iCAAiC,iBAAiB,wBAAwB,oBAAoB;GAC1I;GACA,KAAK,mBAAmB;GACxB,YAAY,KAAK,aAAa,UAAU;EAC1C;EACA,IAAI,4BAA4B,MAAM,oBAAoB,OAAO,iBAAiB,KAAK;EACvF,IAAI;GACF,KAAK,IAAI,YAAY,KAAK,SAAS,OAAO,SAAS,CAAC,GAAG,OAAO,EAAE,6BAA6B,QAAQ,UAAU,KAAK,EAAC,CAAE,OAAO,4BAA4B,MAAM;IAC9J,IAAI,QAAQ,MAAM;IAClB,yCAAyC,OAAO,SAAS,WAAW;GACtE;EACF,SAAS,KAAK;GACZ,oBAAoB;GACpB,iBAAiB;EACnB,UAAU;GACR,IAAI;IACF,IAAI,CAAC,6BAA6B,UAAU,UAAU,MAAM;KAC1D,UAAU,OAAO;IACnB;GACF,UAAU;IACR,IAAI,mBAAmB;KACrB,MAAM;IACR;GACF;EACF;CACF;AACF"}
|
|
@@ -17,7 +17,7 @@ private struct OverlayContentContent: View {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
@objcMembers
|
|
20
|
-
public final class OneNativeOverlayContentView:
|
|
20
|
+
public final class OneNativeOverlayContentView: OneNativeMarkerView {
|
|
21
21
|
public init() {
|
|
22
22
|
super.init(styled: { children, style, standalone in
|
|
23
23
|
AnyView(OverlayContentContent(children: children, style: style, standalone: standalone))
|
|
@@ -17,7 +17,7 @@ private struct SwipeActionsActionsContent: View {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
@objcMembers
|
|
20
|
-
public final class OneNativeSwipeActionsActionsView:
|
|
20
|
+
public final class OneNativeSwipeActionsActionsView: OneNativeMarkerView {
|
|
21
21
|
public var edge: String = "trailing"
|
|
22
22
|
public var allowsFullSwipe: Bool = true
|
|
23
23
|
var onConfigurationChange: (() -> Void)?
|
|
@@ -458,6 +458,43 @@ private struct OneNativeHostRoot: View {
|
|
|
458
458
|
}
|
|
459
459
|
}
|
|
460
460
|
|
|
461
|
+
// a destination can stay visible after swiftui removes its presenting root from the window.
|
|
462
|
+
@objcMembers public class OneNativeMarkerView: OneNativeContainerView {
|
|
463
|
+
private var appearances = 0
|
|
464
|
+
private var lifetime = 0
|
|
465
|
+
|
|
466
|
+
public override func propagateActive(_ active: Bool) {}
|
|
467
|
+
|
|
468
|
+
private func changeAppearances(_ delta: Int, lifetime: Int) {
|
|
469
|
+
guard lifetime == self.lifetime else { return }
|
|
470
|
+
appearances = max(0, appearances + delta)
|
|
471
|
+
super.propagateActive(appearances > 0)
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
private func clearVisibility() {
|
|
475
|
+
lifetime += 1
|
|
476
|
+
appearances = 0
|
|
477
|
+
super.propagateActive(false)
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
public override func compositionContent() -> AnyView {
|
|
481
|
+
let lifetime = self.lifetime
|
|
482
|
+
return AnyView(super.compositionContent()
|
|
483
|
+
.onAppear { [weak self] in self?.changeAppearances(1, lifetime: lifetime) }
|
|
484
|
+
.onDisappear { [weak self] in self?.changeAppearances(-1, lifetime: lifetime) })
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
public override func decompose() {
|
|
488
|
+
clearVisibility()
|
|
489
|
+
super.decompose()
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
public override func reset() {
|
|
493
|
+
clearVisibility()
|
|
494
|
+
super.reset()
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
|
|
461
498
|
// the style chain applies this from another file: in the same file swiftc 6.4 expands its
|
|
462
499
|
// opaque result into oneNativeStyle's and crashes lowering it
|
|
463
500
|
extension View {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "one",
|
|
3
|
-
"version": "2.17.
|
|
3
|
+
"version": "2.17.1",
|
|
4
4
|
"description": "One is a React framework for web, iOS, and Android apps.",
|
|
5
5
|
"license": "BSD-3-Clause",
|
|
6
6
|
"sideEffects": [
|
|
@@ -282,15 +282,15 @@
|
|
|
282
282
|
"@react-navigation/routers": "8.0.0-alpha.21",
|
|
283
283
|
"@rozenite/middleware": "^2.5.0",
|
|
284
284
|
"@ungap/structured-clone": "^1.2.0",
|
|
285
|
-
"@vxrn/color-scheme": "2.17.
|
|
286
|
-
"@vxrn/compiler": "2.17.
|
|
287
|
-
"@vxrn/resolve": "2.17.
|
|
288
|
-
"@vxrn/tslib-lite": "2.17.
|
|
289
|
-
"@vxrn/use-isomorphic-layout-effect": "2.17.
|
|
290
|
-
"@vxrn/utils": "2.17.
|
|
285
|
+
"@vxrn/color-scheme": "2.17.1",
|
|
286
|
+
"@vxrn/compiler": "2.17.1",
|
|
287
|
+
"@vxrn/resolve": "2.17.1",
|
|
288
|
+
"@vxrn/tslib-lite": "2.17.1",
|
|
289
|
+
"@vxrn/use-isomorphic-layout-effect": "2.17.1",
|
|
290
|
+
"@vxrn/utils": "2.17.1",
|
|
291
291
|
"citty": "^0.1.6",
|
|
292
292
|
"core-js": "^3.38.1",
|
|
293
|
-
"create-vxrn": "2.17.
|
|
293
|
+
"create-vxrn": "2.17.1",
|
|
294
294
|
"escape-string-regexp": "^5.0.0",
|
|
295
295
|
"fast-deep-equal": "^3.1.3",
|
|
296
296
|
"fast-glob": "^3.3.3",
|
|
@@ -311,7 +311,7 @@
|
|
|
311
311
|
"tsconfig-paths": "^4",
|
|
312
312
|
"use-latest-callback": "^0.3.5",
|
|
313
313
|
"vite": "^8.2.2",
|
|
314
|
-
"vxrn": "2.17.
|
|
314
|
+
"vxrn": "2.17.1",
|
|
315
315
|
"web-streams-polyfill": "^4.3.0",
|
|
316
316
|
"ws": "^8.21.0",
|
|
317
317
|
"xxhashjs": "^0.2.2"
|
|
@@ -341,7 +341,7 @@
|
|
|
341
341
|
"@babel/types": "^7.28.5",
|
|
342
342
|
"babel-dead-code-elimination": "1.0.10",
|
|
343
343
|
"babel-plugin-module-resolver": "^5.0.2",
|
|
344
|
-
"@vxrn/vite-plugin-metro": "2.17.
|
|
344
|
+
"@vxrn/vite-plugin-metro": "2.17.1",
|
|
345
345
|
"react-native-css-interop": "^0.2.6"
|
|
346
346
|
},
|
|
347
347
|
"peerDependenciesMeta": {
|
|
@@ -419,7 +419,7 @@
|
|
|
419
419
|
"@types/react-dom": "^19.3.0",
|
|
420
420
|
"@types/react-test-renderer": "^19.1.0",
|
|
421
421
|
"@types/xxhashjs": "^0.2.4",
|
|
422
|
-
"@vxrn/emitter": "2.17.
|
|
422
|
+
"@vxrn/emitter": "2.17.1",
|
|
423
423
|
"depcheck": "^1.4.7",
|
|
424
424
|
"esbuild": "^0.28.1",
|
|
425
425
|
"immer": "^10.1.1",
|
|
@@ -447,7 +447,7 @@
|
|
|
447
447
|
"@babel/types": "^7.28.5",
|
|
448
448
|
"babel-dead-code-elimination": "1.0.10",
|
|
449
449
|
"babel-plugin-module-resolver": "^5.0.2",
|
|
450
|
-
"@vxrn/vite-plugin-metro": "2.17.
|
|
450
|
+
"@vxrn/vite-plugin-metro": "2.17.1",
|
|
451
451
|
"react-native-css-interop": "^0.2.6"
|
|
452
452
|
},
|
|
453
453
|
"publishConfig": {
|
|
@@ -616,7 +616,7 @@
|
|
|
616
616
|
}
|
|
617
617
|
}
|
|
618
618
|
},
|
|
619
|
-
"releaseSourceCommit": "
|
|
619
|
+
"releaseSourceCommit": "a47c12ac1ff7a8252ec425b33431915a4c4fea9a",
|
|
620
620
|
"repository": {
|
|
621
621
|
"type": "git",
|
|
622
622
|
"url": "git+https://github.com/onejs/one.git",
|
|
@@ -72,3 +72,19 @@ describe('getRoutes', () => {
|
|
|
72
72
|
expect(notFoundRoutes[0].generated).toBe(true)
|
|
73
73
|
})
|
|
74
74
|
})
|
|
75
|
+
|
|
76
|
+
describe('getRoutes initial routes', () => {
|
|
77
|
+
it('reads unstable_settings.initialRouteName when entry points are ignored', () => {
|
|
78
|
+
const ctx = createMockContext({
|
|
79
|
+
'./_layout.tsx': { default: () => null, unstable_settings: { initialRouteName: '(tabs)' } },
|
|
80
|
+
'./(tabs)/_layout.tsx': { default: () => null },
|
|
81
|
+
'./(tabs)/index.tsx': { default: () => null },
|
|
82
|
+
'./session/[id].tsx': { default: () => null },
|
|
83
|
+
})
|
|
84
|
+
|
|
85
|
+
const root = getRoutes(ctx, { ignoreEntryPoints: true, ignoreRequireErrors: true, platform: 'ios' })
|
|
86
|
+
|
|
87
|
+
expect(root?.initialRouteName).toBe('(tabs)')
|
|
88
|
+
expect(collectRoutes(root!).every((route) => route.entryPoints === undefined)).toBe(true)
|
|
89
|
+
})
|
|
90
|
+
})
|
package/src/router/getRoutes.ts
CHANGED
|
@@ -62,7 +62,10 @@ export function getRoutes(
|
|
|
62
62
|
|
|
63
63
|
const rootNode = flattenDirectoryTreeToRoutes(directoryTree, options)
|
|
64
64
|
|
|
65
|
-
|
|
65
|
+
// a native client skips entry points but still needs
|
|
66
|
+
// unstable_settings.initialRouteName to build a deep link's stack. its layouts
|
|
67
|
+
// are already in the bundle; on web the crawl would load split layouts early.
|
|
68
|
+
if (!options.ignoreEntryPoints || (options.platform && options.platform !== 'web')) {
|
|
66
69
|
crawlAndAppendInitialRoutesAndEntryFiles(rootNode, options)
|
|
67
70
|
}
|
|
68
71
|
|
|
@@ -831,7 +834,9 @@ function crawlAndAppendInitialRoutesAndEntryFiles(
|
|
|
831
834
|
entryPoints: string[] = []
|
|
832
835
|
) {
|
|
833
836
|
if (node.type === 'spa' || node.type === 'ssg' || node.type === 'ssr') {
|
|
834
|
-
|
|
837
|
+
if (!options.ignoreEntryPoints) {
|
|
838
|
+
node.entryPoints = [...new Set([...entryPoints, node.contextKey])]
|
|
839
|
+
}
|
|
835
840
|
} else if (node.type === 'layout') {
|
|
836
841
|
if (!node.children) {
|
|
837
842
|
throw new Error(`Layout "${node.contextKey}" does not contain any child routes`)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getRoutes.d.ts","sourceRoot":"","sources":["../../src/router/getRoutes.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,eAAe,CAAA;AAYxC,OAAO,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAc,MAAM,SAAS,CAAA;AAEvE,MAAM,MAAM,OAAO,GAAG;IACpB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;IACjB,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AAeD;;;;;;;;;;;GAWG;AACH,wBAAgB,SAAS,CACvB,aAAa,EAAE,GAAG,CAAC,YAAY,EAC/B,OAAO,GAAE,OAAY,GACpB,SAAS,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"getRoutes.d.ts","sourceRoot":"","sources":["../../src/router/getRoutes.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,eAAe,CAAA;AAYxC,OAAO,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAc,MAAM,SAAS,CAAA;AAEvE,MAAM,MAAM,OAAO,GAAG;IACpB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;IACjB,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AAeD;;;;;;;;;;;GAWG;AACH,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