expo-router 56.2.20 → 56.2.22

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.
Files changed (50) hide show
  1. package/android/build.gradle +2 -2
  2. package/build/getRoutesCore.d.ts.map +1 -1
  3. package/build/getRoutesCore.js +8 -6
  4. package/build/getRoutesCore.js.map +1 -1
  5. package/build/matchers.d.ts +2 -0
  6. package/build/matchers.d.ts.map +1 -1
  7. package/build/matchers.js +19 -1
  8. package/build/matchers.js.map +1 -1
  9. package/build/standard-navigation/index.d.ts +9 -5
  10. package/build/standard-navigation/index.d.ts.map +1 -1
  11. package/build/standard-navigation/index.js +5 -3
  12. package/build/standard-navigation/index.js.map +1 -1
  13. package/build/standard-navigation/types.d.ts +42 -26
  14. package/build/standard-navigation/types.d.ts.map +1 -1
  15. package/build/standard-navigation/types.js.map +1 -1
  16. package/expo-module.config.json +1 -1
  17. package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.20/expo.modules.router-56.2.20.module → 56.2.22/expo.modules.router-56.2.22.module} +7 -7
  18. package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.22/expo.modules.router-56.2.22.module.md5 +1 -0
  19. package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.22/expo.modules.router-56.2.22.module.sha1 +1 -0
  20. package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.22/expo.modules.router-56.2.22.module.sha256 +1 -0
  21. package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.22/expo.modules.router-56.2.22.module.sha512 +1 -0
  22. package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.20/expo.modules.router-56.2.20.pom → 56.2.22/expo.modules.router-56.2.22.pom} +1 -1
  23. package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.22/expo.modules.router-56.2.22.pom.md5 +1 -0
  24. package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.22/expo.modules.router-56.2.22.pom.sha1 +1 -0
  25. package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.22/expo.modules.router-56.2.22.pom.sha256 +1 -0
  26. package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.22/expo.modules.router-56.2.22.pom.sha512 +1 -0
  27. package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml +4 -4
  28. package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml.md5 +1 -1
  29. package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml.sha1 +1 -1
  30. package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml.sha256 +1 -1
  31. package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml.sha512 +1 -1
  32. package/package.json +5 -5
  33. package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.20/expo.modules.router-56.2.20.module.md5 +0 -1
  34. package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.20/expo.modules.router-56.2.20.module.sha1 +0 -1
  35. package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.20/expo.modules.router-56.2.20.module.sha256 +0 -1
  36. package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.20/expo.modules.router-56.2.20.module.sha512 +0 -1
  37. package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.20/expo.modules.router-56.2.20.pom.md5 +0 -1
  38. package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.20/expo.modules.router-56.2.20.pom.sha1 +0 -1
  39. package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.20/expo.modules.router-56.2.20.pom.sha256 +0 -1
  40. package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.20/expo.modules.router-56.2.20.pom.sha512 +0 -1
  41. /package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.20/expo.modules.router-56.2.20-sources.jar → 56.2.22/expo.modules.router-56.2.22-sources.jar} +0 -0
  42. /package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.20/expo.modules.router-56.2.20-sources.jar.md5 → 56.2.22/expo.modules.router-56.2.22-sources.jar.md5} +0 -0
  43. /package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.20/expo.modules.router-56.2.20-sources.jar.sha1 → 56.2.22/expo.modules.router-56.2.22-sources.jar.sha1} +0 -0
  44. /package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.20/expo.modules.router-56.2.20-sources.jar.sha256 → 56.2.22/expo.modules.router-56.2.22-sources.jar.sha256} +0 -0
  45. /package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.20/expo.modules.router-56.2.20-sources.jar.sha512 → 56.2.22/expo.modules.router-56.2.22-sources.jar.sha512} +0 -0
  46. /package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.20/expo.modules.router-56.2.20.aar → 56.2.22/expo.modules.router-56.2.22.aar} +0 -0
  47. /package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.20/expo.modules.router-56.2.20.aar.md5 → 56.2.22/expo.modules.router-56.2.22.aar.md5} +0 -0
  48. /package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.20/expo.modules.router-56.2.20.aar.sha1 → 56.2.22/expo.modules.router-56.2.22.aar.sha1} +0 -0
  49. /package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.20/expo.modules.router-56.2.20.aar.sha256 → 56.2.22/expo.modules.router-56.2.22.aar.sha256} +0 -0
  50. /package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.20/expo.modules.router-56.2.20.aar.sha512 → 56.2.22/expo.modules.router-56.2.22.aar.sha512} +0 -0
@@ -4,13 +4,13 @@ plugins {
4
4
  }
5
5
 
6
6
  group = 'expo.modules.router'
7
- version = '56.2.20'
7
+ version = '56.2.22'
8
8
 
9
9
  android {
10
10
  namespace "expo.modules.router"
11
11
  defaultConfig {
12
12
  versionCode 1
13
- versionName "56.2.20"
13
+ versionName "56.2.22"
14
14
  }
15
15
  lintOptions {
16
16
  abortOnError false
@@ -1 +1 @@
1
- {"version":3,"file":"getRoutesCore.d.ts","sourceRoot":"","sources":["../src/getRoutesCore.ts"],"names":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;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,GAAE,GAAG,CAAC,MAAM,CAAa,GAAG,GAAG,CAAC,MAAM,CAAC,CAwBzF;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,iBAAiB,EAAE,GAAG,IAAI,CAgBxE"}
@@ -5,7 +5,6 @@ exports.extrapolateGroups = extrapolateGroups;
5
5
  exports.generateDynamic = generateDynamic;
6
6
  const matchers_1 = require("./matchers");
7
7
  const url_1 = require("./utils/url");
8
- const validPlatforms = new Set(['android', 'ios', 'native', 'web']);
9
8
  /**
10
9
  * Given a Metro context module, return an array of nested routes.
11
10
  *
@@ -518,13 +517,16 @@ function validateRouteTreeExports(node) {
518
517
  }
519
518
  function getFileMeta(originalKey, options, redirects, rewrites) {
520
519
  // Remove the leading `./`
520
+ // NOTE(@hassankhan): Why not use `getNameFromFilePath()` here?
521
521
  const key = (0, matchers_1.removeSupportedExtensions)((0, matchers_1.removeFileSystemDots)(originalKey));
522
522
  let route = key;
523
523
  const parts = (0, matchers_1.removeFileSystemDots)(originalKey).split('/');
524
524
  const filename = parts[parts.length - 1];
525
- const filenameParts = (0, matchers_1.removeSupportedExtensions)(filename).split('.');
526
- const filenameWithoutExtensions = filenameParts[0];
527
- const platformExtension = filenameParts[1];
525
+ const filenameWithoutFileExtension = (0, matchers_1.removeSupportedExtensions)(filename);
526
+ const platformExtension = (0, matchers_1.getPlatformFromFilePath)(filename);
527
+ const filenameWithoutExtensions = platformExtension
528
+ ? filenameWithoutFileExtension.slice(0, -(platformExtension.length + 1))
529
+ : filenameWithoutFileExtension;
528
530
  const isLayout = filenameWithoutExtensions === '_layout';
529
531
  const isApi = originalKey.match(/\+api\.(\w+\.)?[jt]sx?$/);
530
532
  if (filenameWithoutExtensions.startsWith('(') && filenameWithoutExtensions.endsWith(')')) {
@@ -536,7 +538,7 @@ function getFileMeta(originalKey, options, redirects, rewrites) {
536
538
  throw new Error(`Invalid route ${originalKey}. Route nodes cannot start with the '+' character. "Rename it to ${renamedRoute}"`);
537
539
  }
538
540
  let specificity = 0;
539
- const hasPlatformExtension = validPlatforms.has(platformExtension);
541
+ const hasPlatformExtension = platformExtension != null;
540
542
  const usePlatformRoutes = options.platformRoutes ?? true;
541
543
  if (hasPlatformExtension) {
542
544
  if (!usePlatformRoutes) {
@@ -564,7 +566,7 @@ function getFileMeta(originalKey, options, redirects, rewrites) {
564
566
  if (isApi && specificity !== 0) {
565
567
  throw new Error(`API routes cannot have platform extensions. Remove '.${platformExtension}' from '${originalKey}'`);
566
568
  }
567
- route = route.replace(new RegExp(`.${platformExtension}$`), '');
569
+ route = route.slice(0, -(platformExtension.length + 1));
568
570
  }
569
571
  return {
570
572
  route,
@@ -1 +1 @@
1
- {"version":3,"file":"getRoutesCore.js","sourceRoot":"","sources":["../src/getRoutesCore.ts"],"names":[],"mappings":";;AAqFA,8BA6BC;AAkqBD,8CAwBC;AAED,0CAgBC;AA7zBD,yCASoB;AAEpB,qCAAmD;AA2DnD,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC,CAAC,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC;AAEpE;;;;;;;;;;;GAWG;AACH,SAAgB,SAAS,CAAC,aAA6B,EAAE,OAAgB;IACvE,MAAM,UAAU,GAAG,aAAa,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;IACzD,MAAM,aAAa,GAAG,gBAAgB,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;IAE/D,yBAAyB;IACzB,IAAI,CAAC,aAAa,EAAE,CAAC;QACnB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,QAAQ,GAAG,4BAA4B,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;IAEtE,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,IAAI,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC;IAC7E,IACE,OAAO,CAAC,GAAG,C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BAAyB,iBAAiB,EAAE,CACpG,CAAC;gBACJ,CAAC;YACH,CAAC;YAED,2GAA2G;YAC3G,IAAI,CAAC,gBAAgB,GAAG,MAAM,CAAC;YAC/B,WAAW,CAAC,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;QAC3C,CAAC;QAED,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAClC,wCAAwC,CAAC,KAAK,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC;QACxE,CAAC;IACH,CAAC;AACH,CAAC;AAED,SAAS,eAAe,CAAC,MAAmB;IAC1C,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAE,CAAC;IAEzC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CACb,YAAY,KAAK,CAAC,UAAU,sEAAsE,CACnG,CAAC;IACJ,CAAC;IAED,wFAAwF;IACxF,4CAA4C;IAC5C,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["import type { DynamicConvention, MiddlewareNode, RouteNode } from './Route';\nimport {\n matchArrayGroupName,\n matchDynamicName,\n matchGroupName,\n matchLastGroupName,\n removeFileSystemDots,\n removeFileSystemExtensions,\n removeSupportedExtensions,\n stripInvisibleSegmentsFromPath,\n} from './matchers';\nimport type { RequireContext } from './types';\nimport { shouldLinkExternally } from './utils/url';\n\nexport type Options = {\n ignore?: RegExp[];\n preserveApiRoutes?: boolean;\n ignoreRequireErrors?: boolean;\n ignoreEntryPoints?: boolean;\n /* Used to simplify testing for toEqual() comparison */\n internal_stripLoadRoute?: boolean;\n /* Used to simplify by skipping the generated routes */\n skipGenerated?: boolean;\n /** Skip routes created by `generateStaticParams()` */\n skipStaticParams?: boolean;\n /* Skip the generated not found route */\n notFound?: boolean;\n /* Enable experimental server middleware support */\n unstable_useServerMiddleware?: boolean;\n importMode?: string;\n platformRoutes?: boolean;\n sitemap?: boolean;\n platform?: string;\n redirects?: RedirectConfig[];\n rewrites?: RewriteConfig[];\n headers?: Record<string, string | string[]>;\n /* Keep redirects as valid routes within the RouteConfig tree */\n preserveRedirectAndRewrites?: boolean;\n\n /** Get the system route for a location. Useful for shimming React Native imports in SSR environments. */\n getSystemRoute: (\n route: Pick<RouteNode, 'route' | 'type'> & {\n defaults?: RouteNode;\n redirectConfig?: RedirectConfig;\n rewriteConfig?: RewriteConfig;\n }\n ) => RouteNode;\n};\n\ntype DirectoryNode = {\n layout?: RouteNode[];\n files: Map<string, RouteNode[]>;\n subdirectories: Map<string, DirectoryNode>;\n};\n\nexport type RedirectConfig = {\n source: string;\n destination: string;\n destinationContextKey: string;\n permanent?: boolean;\n methods?: string[];\n external?: boolean;\n};\n\nexport type RewriteConfig = {\n source: string;\n destination: string;\n destinationContextKey: string;\n methods?: string[];\n};\n\nconst validPlatforms = new Set(['android', 'ios', 'native', 'web']);\n\n/**\n * Given a Metro context module, return an array of nested routes.\n *\n * This is a two step process:\n * 1. Convert the RequireContext keys (file paths) into a directory tree.\n * - This should extrapolate array syntax into multiple routes\n * - Routes are given a specificity score\n * 2. Flatten the directory tree into routes\n * - Routes in directories without _layout files are hoisted to the nearest _layout\n * - The name of the route is relative to the nearest _layout\n * - If multiple routes have the same name, the most specific route is used\n */\nexport function getRoutes(contextModule: RequireContext, options: Options): RouteNode | null {\n const middleware = getMiddleware(contextModule, options);\n const directoryTree = getDirectoryTree(contextModule, options);\n\n // If there are no routes\n if (!directoryTree) {\n return null;\n }\n\n const rootNode = flattenDirectoryTreeToRoutes(directoryTree, options);\n\n const importMode = options.importMode || process.env.EXPO_ROUTER_IMPORT_MODE;\n if (\n process.env.NODE_ENV === 'development' &&\n importMode === 'sync' &&\n !options.ignoreRequireErrors\n ) {\n validateRouteTreeExports(rootNode);\n }\n\n if (middleware) {\n rootNode.middleware = middleware;\n }\n\n if (!options.ignoreEntryPoints) {\n crawlAndAppendInitialRoutesAndEntryFiles(rootNode, options);\n }\n\n return rootNode;\n}\n\n/**\n * Given a RequireContext, return the middleware node if one is found. If more than one middleware file is found, an error is thrown.\n */\nfunction getMiddleware(contextModule: RequireContext, options: Options): MiddlewareNode | null {\n const allMiddlewareFiles = contextModule.keys().filter((key) => key.includes('+middleware'));\n\n // Check if middleware is enabled via plugin config\n if (!options.unstable_useServerMiddleware) {\n if (allMiddlewareFiles.length > 0) {\n console.warn(\n 'Server middleware is not enabled. Add unstable_useServerMiddleware: true to your `expo-router` plugin config.\\n\\n' +\n JSON.stringify(\n {\n expo: {\n plugins: [['expo-router', { unstable_useServerMiddleware: true }]],\n },\n },\n null,\n 2\n )\n );\n }\n return null;\n }\n\n const isValidMiddleware = (key: string) => /^\\.\\/\\+middleware\\.[tj]sx?$/.test(key);\n\n const rootMiddlewareFiles = allMiddlewareFiles.filter(isValidMiddleware);\n\n const nonRootMiddleware = allMiddlewareFiles.filter(\n (file) => !rootMiddlewareFiles.includes(file)\n );\n if (nonRootMiddleware.length > 0) {\n throw new Error(\n `The middleware file can only be placed at the root level. Remove the following files: ${nonRootMiddleware.join(', ')}`\n );\n }\n\n if (rootMiddlewareFiles.length === 0) {\n return null;\n }\n\n // In development, throw an error if there are multiple root-level middleware files\n if (rootMiddlewareFiles.length > 1) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error(\n `Only one middleware file is allowed. Keep one of the conflicting files: ${rootMiddlewareFiles.map((p) => `\"${p}\"`).join(' or ')}`\n );\n }\n }\n\n const middlewareFilePath = rootMiddlewareFiles[0]!;\n\n const middleware: MiddlewareNode = {\n loadRoute() {\n if (options.ignoreRequireErrors) {\n try {\n return contextModule(middlewareFilePath);\n } catch {\n return {};\n }\n } else {\n return contextModule(middlewareFilePath);\n }\n },\n contextKey: middlewareFilePath,\n };\n\n if (options.internal_stripLoadRoute) {\n delete (middleware as any).loadRoute;\n }\n\n return middleware;\n}\n\n/**\n * Converts the RequireContext keys (file paths) into a directory tree.\n */\nfunction getDirectoryTree(contextModule: RequireContext, options: Options) {\n const importMode = options.importMode || process.env.EXPO_ROUTER_IMPORT_MODE;\n\n const ignoreList: RegExp[] = [/^\\.\\/\\+(html|native-intent)\\.[tj]sx?$/]; // Ignore the top level ./+html file\n\n if (options.ignore) {\n ignoreList.push(...options.ignore);\n }\n if (!options.preserveApiRoutes) {\n ignoreList.push(/\\+api$/, /\\+api\\.[tj]sx?$/);\n }\n\n // Always ignore middleware files in regular route processing\n ignoreList.push(/\\+middleware$/, /\\+middleware\\.[tj]sx?$/);\n\n const rootDirectory: DirectoryNode = {\n files: new Map(),\n subdirectories: new Map(),\n };\n\n let hasRoutes = false;\n let isValid = false;\n\n const contextKeys = contextModule.keys();\n const redirects: Record<string, RedirectConfig> = {};\n const rewrites: Record<string, RewriteConfig> = {};\n\n let validRedirectDestinations: { contextKey: string; nameWithoutInvisible: string }[] | undefined;\n\n const getValidDestinations = () => {\n // Loop over contexts once and cache the valid destinations\n validRedirectDestinations ??= contextKeys.map((key) => {\n return {\n contextKey: key,\n nameWithoutInvisible: getNameWithoutInvisibleSegmentsFromRedirectPath(\n removeSupportedExtensions(key)\n ),\n };\n });\n return validRedirectDestinations;\n };\n\n // If we are keeping redirects as valid routes, then we need to add them to the contextKeys\n // This is useful for generating a sitemap with redirects, or static site generation that includes redirects\n if (options.preserveRedirectAndRewrites) {\n if (options.redirects) {\n for (const redirect of options.redirects) {\n const sourceContextKey = getSourceContextKeyFromRedirectSource(redirect.source);\n const sourceName = getNameFromRedirectPath(redirect.source);\n\n const isExternalRedirect = shouldLinkExternally(redirect.destination);\n\n const targetDestinationName = isExternalRedirect\n ? redirect.destination\n : getNameWithoutInvisibleSegmentsFromRedirectPath(redirect.destination);\n\n if (ignoreList.some((regex) => regex.test(sourceContextKey))) {\n continue;\n }\n\n const validDestination = isExternalRedirect\n ? undefined\n : getValidDestinations().find(\n (key) => key.nameWithoutInvisible === targetDestinationName\n );\n const destination = isExternalRedirect\n ? targetDestinationName\n : validDestination?.nameWithoutInvisible;\n const destinationContextKey = isExternalRedirect\n ? targetDestinationName\n : validDestination?.contextKey;\n\n if (!destinationContextKey || destination === undefined) {\n /*\n * Only throw the error when we are preserving the api routes\n * When doing a static export, API routes will not exist so the redirect destination may not exist.\n * The desired behavior for this error is to warn the user when running `expo start`, so its ok if\n * `expo export` swallows this error.\n */\n if (options.preserveApiRoutes) {\n throw new Error(`Redirect destination \"${redirect.destination}\" does not exist.`);\n }\n\n continue;\n }\n\n contextKeys.push(sourceContextKey);\n redirects[sourceName] = {\n source: sourceName,\n destination,\n destinationContextKey,\n permanent: Boolean(redirect.permanent),\n external: isExternalRedirect,\n methods: redirect.methods,\n };\n }\n }\n\n if (options.rewrites) {\n for (const rewrite of options.rewrites) {\n const sourceContextKey = getSourceContextKeyFromRedirectSource(rewrite.source);\n const sourceName = getNameFromRedirectPath(rewrite.source);\n\n // We check to see if the context key is already known so that we don't create a rewrite for\n // a route that already exists on disk\n const isSourceContextKeyAlreadyKnown = contextKeys.includes(sourceContextKey);\n const targetDestinationName = isSourceContextKeyAlreadyKnown\n ? getNameFromRedirectPath(rewrite.destination)\n : getNameWithoutInvisibleSegmentsFromRedirectPath(rewrite.destination);\n\n if (ignoreList.some((regex) => regex.test(sourceContextKey))) {\n continue;\n }\n\n const validDestination = getValidDestinations().find(\n (key) => key.nameWithoutInvisible === targetDestinationName\n );\n const destination = validDestination?.nameWithoutInvisible;\n const destinationContextKey = validDestination?.contextKey;\n\n if (!destinationContextKey || destination === undefined) {\n /*\n * Only throw the error when we are preserving the api routes\n * When doing a static export, API routes will not exist so the redirect destination may not exist.\n * The desired behavior for this error is to warn the user when running `expo start`, so its ok if\n * `expo export` swallows this error.\n */\n if (options.preserveApiRoutes) {\n throw new Error(`Rewrite destination \"${rewrite.destination}\" does not exist.`);\n }\n\n continue;\n }\n\n contextKeys.push(sourceContextKey);\n rewrites[sourceName] = {\n source: sourceName,\n destination,\n destinationContextKey,\n methods: rewrite.methods,\n };\n }\n }\n }\n\n const processedRedirectsRewrites = new Set<string>();\n\n for (const filePath of contextKeys) {\n if (ignoreList.some((regex) => regex.test(filePath))) {\n continue;\n }\n\n isValid = true;\n\n const meta = getFileMeta(filePath, options, redirects, rewrites);\n\n // This is a file that should be ignored. e.g maybe it has an invalid platform?\n if (meta.specificity < 0) {\n continue;\n }\n\n let node: RouteNode = {\n type: meta.isApi ? 'api' : meta.isLayout ? 'layout' : 'route',\n loadRoute() {\n let routeModule: any;\n\n if (options.ignoreRequireErrors) {\n try {\n routeModule = contextModule(filePath);\n } catch {\n routeModule = {};\n }\n } else {\n routeModule = contextModule(filePath);\n }\n\n // See: expo/src/async-require/asyncRequireModule.ts\n // The \"lazy\" async require function returns a thenable that may carry\n // a raw `_result` value that's either a promise or the synchronously resolved module\n if (importMode === 'lazy' || importMode === 'lazy-once') {\n routeModule =\n '_result' in routeModule && routeModule._result != null\n ? routeModule._result\n : routeModule;\n }\n\n if (process.env.NODE_ENV === 'development' && importMode === 'sync') {\n // In development mode, when async routes are disabled, add some extra error handling to improve the developer experience.\n // This can be useful when you accidentally use an async function in a route file for the default export.\n if (routeModule instanceof Promise) {\n throw new Error(\n `Route \"${filePath}\" cannot be a promise when async routes is disabled.`\n );\n }\n\n const defaultExport = routeModule?.default;\n if (defaultExport instanceof Promise) {\n throw new Error(\n `The default export from route \"${filePath}\" is a promise. Ensure the React Component does not use async or promises.`\n );\n }\n\n // check if default is an async function without invoking it\n if (\n defaultExport instanceof Function &&\n // This only works on web because Hermes support async functions so we have to transform them out.\n defaultExport.constructor.name === 'AsyncFunction'\n ) {\n throw new Error(\n `The default export from route \"${filePath}\" is an async function. Ensure the React Component does not use async or promises.`\n );\n }\n\n // Validate loader export in development\n const loaderExport = routeModule?.loader;\n if (loaderExport && typeof loaderExport !== 'function') {\n throw new Error(`Route \"${filePath}\" exports a loader that is not a function.`);\n }\n\n const metadataExport = routeModule?.generateMetadata;\n if (metadataExport && typeof metadataExport !== 'function') {\n throw new Error(`Route \"${filePath}\" exports generateMetadata that is not a function.`);\n }\n }\n\n return routeModule;\n },\n contextKey: filePath,\n route: '', // This is overwritten during hoisting based upon the _layout\n dynamic: null,\n children: [], // While we are building the directory tree, we don't know the node's children just yet. This is added during hoisting\n };\n\n if (meta.isRedirect) {\n if (processedRedirectsRewrites.has(meta.route)) {\n continue;\n }\n\n const redirect = redirects[meta.route]!;\n node.destinationContextKey = redirect.destinationContextKey;\n node.permanent = redirect.permanent;\n node.generated = true;\n if (node.type === 'route') {\n node = options.getSystemRoute({\n type: 'redirect',\n route: redirect.destination,\n defaults: node,\n redirectConfig: redirect,\n });\n }\n if (redirect!.methods) {\n node.methods = redirect.methods;\n }\n node.type = 'redirect';\n processedRedirectsRewrites.add(meta.route);\n }\n\n if (meta.isRewrite) {\n if (processedRedirectsRewrites.has(meta.route)) {\n continue;\n }\n\n const rewrite = rewrites[meta.route]!;\n node.destinationContextKey = rewrite.destinationContextKey;\n node.generated = true;\n if (node.type === 'route') {\n node = options.getSystemRoute({\n type: 'rewrite',\n route: rewrite.destination,\n defaults: node,\n rewriteConfig: rewrite,\n });\n }\n if (rewrite.methods) {\n node.methods = rewrite.methods;\n }\n node.type = 'rewrite';\n processedRedirectsRewrites.add(meta.route);\n }\n\n /**\n * A single filepath may be extrapolated into multiple routes if it contains array syntax.\n * Another way to thinking about is that a filepath node is present in multiple leaves of the directory tree.\n */\n for (const route of extrapolateGroups(meta.route)) {\n // Traverse the directory tree to its leaf node, creating any missing directories along the way\n const subdirectoryParts = route.split('/').slice(0, -1);\n\n // Start at the root directory and traverse the path to the leaf directory\n let directory = rootDirectory;\n\n for (const part of subdirectoryParts) {\n let subDirectory = directory.subdirectories.get(part);\n\n // Create any missing subdirectories\n if (!subDirectory) {\n subDirectory = {\n files: new Map(),\n subdirectories: new Map(),\n };\n directory.subdirectories.set(part, subDirectory);\n }\n\n directory = subDirectory;\n }\n\n // Clone the node for this route\n node = { ...node, route };\n\n if (meta.isLayout) {\n directory.layout ??= [];\n const existing = directory.layout[meta.specificity];\n if (existing) {\n // In production, use the first route found\n if (process.env.NODE_ENV !== 'production') {\n throw new Error(\n `The layouts \"${filePath}\" and \"${existing.contextKey}\" conflict on the route \"/${route}\". 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.isApi) {\n const fileKey = `${route}+api`;\n let nodes = directory.files.get(fileKey);\n\n if (!nodes) {\n nodes = [];\n directory.files.set(fileKey, nodes);\n }\n\n // API Routes have no specificity, they are always the first node\n const existing = nodes[0];\n\n if (existing) {\n // In production, use the first route found\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}\". 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\n if (!nodes) {\n nodes = [];\n directory.files.set(route, nodes);\n }\n\n /**\n * If there is an existing node with the same specificity, then we have a conflict.\n * NOTE(Platform Routes):\n * We cannot check for specificity conflicts here, as we haven't processed all the context keys yet!\n * This will be checked during hoisting, as well as enforcing that all routes have a non-platform route.\n */\n const existing = nodes[meta.specificity];\n if (existing) {\n // In production, use the first route found\n if (process.env.NODE_ENV !== 'production') {\n throw new Error(\n `The route files \"${filePath}\" and \"${existing.contextKey}\" conflict on the route \"/${route}\". Remove or rename one of these files.`\n );\n }\n } else {\n hasRoutes ||= true;\n nodes[meta.specificity] = node;\n }\n }\n }\n }\n\n // If there are no routes/layouts then we should display the tutorial.\n if (!isValid) {\n return null;\n }\n\n /**\n * If there are no top-level _layout, add a default _layout\n * While this is a generated route, it will still be generated even if skipGenerated is true.\n */\n if (!rootDirectory.layout) {\n rootDirectory.layout = [\n options.getSystemRoute({\n type: 'layout',\n route: '',\n }),\n ];\n }\n\n // Only include the sitemap if there are routes.\n if (!options.skipGenerated) {\n if (hasRoutes && options.sitemap !== false) {\n appendSitemapRoute(rootDirectory, options);\n }\n if (options.notFound !== false) {\n appendNotFoundRoute(rootDirectory, options);\n }\n }\n return rootDirectory;\n}\n\nfunction getNameFromRedirectPath(path: string): string {\n // Removing only the filesystem extensions, to be able to handle +api, +html\n return (\n removeFileSystemExtensions(removeFileSystemDots(path))\n // Remove the leading `/`\n .replace(/^\\//, '')\n );\n}\n\nfunction getNameWithoutInvisibleSegmentsFromRedirectPath(path: string): string {\n return stripInvisibleSegmentsFromPath(getNameFromRedirectPath(path));\n}\n\n// Creates fake context key for redirects and rewrites\nfunction getSourceContextKeyFromRedirectSource(source: string): string {\n const name = getNameFromRedirectPath(source);\n const prefix = './';\n const suffix = /\\.[tj]sx?$/.test(name) ? '' : '.js'; // Ensure it has a file extension\n return `${prefix}${name}${suffix}`;\n}\n\n/**\n * Flatten the directory tree into routes, hoisting routes to the nearest _layout.\n */\nfunction flattenDirectoryTreeToRoutes(\n directory: DirectoryNode,\n options: Options,\n /* The nearest _layout file in the directory tree */\n layout?: RouteNode,\n /* Route names are relative to their layout */\n pathToRemove = ''\n) {\n /**\n * This directory has a _layout file so it becomes the new target for hoisting routes.\n */\n if (directory.layout) {\n const previousLayout = layout;\n layout = getMostSpecific(directory.layout);\n\n // Add the new layout as a child of its parent\n if (previousLayout) {\n previousLayout.children.push(layout);\n }\n\n if (options.internal_stripLoadRoute) {\n delete (layout as any).loadRoute;\n }\n\n // `route` is the absolute pathname. We need to make this relative to the last _layout\n const newRoute = layout.route.replace(pathToRemove, '');\n pathToRemove = layout.route ? `${layout.route}/` : '';\n\n // Now update this layout with the new relative route and dynamic conventions\n layout.route = newRoute;\n layout.dynamic = generateDynamic(layout.contextKey.slice(0));\n }\n\n // This should never occur as there will always be a root layout, but it makes the type system happy\n if (!layout) throw new Error('Expo Router Internal Error: No nearest layout');\n\n for (const routes of directory.files.values()) {\n const routeNode = getMostSpecific(routes);\n\n // `route` is the absolute pathname. We need to make this relative to the nearest layout\n routeNode.route = routeNode.route.replace(pathToRemove, '');\n routeNode.dynamic = generateDynamic(routeNode.route);\n\n if (options.internal_stripLoadRoute) {\n delete (routeNode as any).loadRoute;\n }\n\n layout.children.push(routeNode);\n }\n\n // Recursively flatten the subdirectories\n for (const child of directory.subdirectories.values()) {\n flattenDirectoryTreeToRoutes(child, options, layout, pathToRemove);\n }\n\n return layout;\n}\n\nfunction validateRouteTreeExports(node: RouteNode) {\n if (process.env.NODE_ENV !== 'development' || node.type === 'api') {\n return;\n }\n\n function runtimeValidateRouteNode(node: RouteNode) {\n const routeItem = node.loadRoute();\n // Have a warning for nullish ex\n const route = routeItem?.default;\n if (route == null) {\n // Do not throw an error since a user may just be creating a new route.\n console.warn(\n `Route \"${node.contextKey}\" is missing the required default export. Ensure a React component is exported as default.`\n );\n }\n if (['boolean', 'number', 'string'].includes(typeof route)) {\n throw new Error(\n `The default export from route \"${node.contextKey}\" is an unsupported type: \"${typeof route}\". Only React Components are supported as default exports from route files.`\n );\n }\n }\n\n runtimeValidateRouteNode(node);\n for (const child of node.children) {\n validateRouteTreeExports(child);\n }\n}\n\nfunction getFileMeta(\n originalKey: string,\n options: Options,\n redirects: Record<string, RedirectConfig>,\n rewrites: Record<string, RewriteConfig>\n) {\n // Remove the leading `./`\n const key = removeSupportedExtensions(removeFileSystemDots(originalKey));\n let route = key;\n\n const parts = removeFileSystemDots(originalKey).split('/');\n const filename = parts[parts.length - 1]!;\n const filenameParts = removeSupportedExtensions(filename).split('.');\n const filenameWithoutExtensions = filenameParts[0]!;\n const platformExtension = filenameParts[1];\n\n const isLayout = filenameWithoutExtensions === '_layout';\n const isApi = originalKey.match(/\\+api\\.(\\w+\\.)?[jt]sx?$/);\n\n if (filenameWithoutExtensions.startsWith('(') && filenameWithoutExtensions.endsWith(')')) {\n throw new Error(`Invalid route ${originalKey}. Routes cannot end with '(group)' syntax`);\n }\n\n // Nested routes cannot start with the '+' character, except for the '+not-found' route\n if (!isApi && filename.startsWith('+') && filenameWithoutExtensions !== '+not-found') {\n const renamedRoute = [...parts.slice(0, -1), filename.slice(1)].join('/');\n throw new Error(\n `Invalid route ${originalKey}. Route nodes cannot start with the '+' character. \"Rename it to ${renamedRoute}\"`\n );\n }\n let specificity = 0;\n\n const hasPlatformExtension = validPlatforms.has(platformExtension!);\n const usePlatformRoutes = options.platformRoutes ?? true;\n\n if (hasPlatformExtension) {\n if (!usePlatformRoutes) {\n // If the user has disabled platform routes, then we should ignore this file\n specificity = -1;\n } else if (!options.platform) {\n // If we don't have a platform, then we should ignore this file\n // This used by typed routes, sitemap, etc\n specificity = -1;\n } else if (platformExtension === options.platform) {\n // If the platform extension is the same as the options.platform, then it is the most specific\n specificity = 2;\n } else if (platformExtension === 'native' && options.platform !== 'web') {\n // `native` is allow but isn't as specific as the platform\n specificity = 1;\n } else if (platformExtension !== options.platform) {\n // Somehow we have a platform extension that doesn't match the options.platform and it isn't native\n // This is an invalid file and we will ignore it\n specificity = -1;\n }\n\n if (isApi && specificity !== 0) {\n throw new Error(\n `API routes cannot have platform extensions. Remove '.${platformExtension}' from '${originalKey}'`\n );\n }\n\n route = route.replace(new RegExp(`.${platformExtension}$`), '');\n }\n\n return {\n route,\n specificity,\n isLayout,\n isApi,\n isRedirect: key in redirects,\n isRewrite: key in rewrites,\n };\n}\n\n/**\n * Generates a set of strings which have the router array syntax extrapolated.\n *\n * /(a,b)/(c,d)/e.tsx => new Set(['a/c/e.tsx', 'a/d/e.tsx', 'b/c/e.tsx', 'b/d/e.tsx'])\n */\nexport function extrapolateGroups(key: string, keys: Set<string> = new Set()): Set<string> {\n const match = matchArrayGroupName(key);\n\n if (!match) {\n keys.add(key);\n return keys;\n }\n const groups = match.split(',');\n const groupsSet = new Set(groups);\n\n if (groupsSet.size !== groups.length) {\n throw new Error(`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\n for (const group of groups) {\n extrapolateGroups(key.replace(match, group.trim()), keys);\n }\n\n return keys;\n}\n\nexport function generateDynamic(path: string): DynamicConvention[] | null {\n const dynamic = path\n .split('/')\n .map((part): DynamicConvention | null => {\n if (part === '+not-found') {\n return {\n name: '+not-found',\n deep: true,\n notFound: true,\n };\n }\n return matchDynamicName(part) ?? null;\n })\n .filter((part): part is DynamicConvention => !!part);\n\n return dynamic.length === 0 ? null : dynamic;\n}\n\nfunction appendSitemapRoute(directory: DirectoryNode, options: Options) {\n if (!directory.files.has('_sitemap') && options.getSystemRoute) {\n directory.files.set('_sitemap', [\n options.getSystemRoute({\n type: 'route',\n route: '_sitemap',\n }),\n ]);\n }\n}\n\nfunction appendNotFoundRoute(directory: DirectoryNode, options: Options) {\n if (!directory.files.has('+not-found') && options.getSystemRoute) {\n directory.files.set('+not-found', [\n options.getSystemRoute({\n type: 'route',\n route: '+not-found',\n }),\n ]);\n }\n}\n\nfunction getLayoutNode(node: RouteNode, options: Options) {\n /**\n * A file called `(a,b)/(c)/_layout.tsx` will generate two _layout routes: `(a)/(c)/_layout` and `(b)/(c)/_layout`.\n * Each of these layouts will have a different anchor based upon the first group name.\n */\n // We may strip loadRoute during testing\n const groupName = matchLastGroupName(node.route);\n const childMatchingGroup = node.children.find((child) => {\n return child.route.replace(/\\/index$/, '') === groupName;\n });\n let anchor = childMatchingGroup?.route;\n const loaded = node.loadRoute();\n if (loaded?.unstable_settings) {\n try {\n // Allow unstable_settings={ initialRouteName: '...' } to override the default initial route name.\n anchor =\n loaded.unstable_settings.anchor ?? loaded.unstable_settings.initialRouteName ?? anchor;\n } catch (error: any) {\n if (error instanceof Error) {\n if (!error.message.match(/You cannot dot into a client module/)) {\n throw error;\n }\n }\n }\n\n if (groupName) {\n // Allow unstable_settings={ 'custom': { initialRouteName: '...' } } to override the less specific initial route name.\n const groupSpecificInitialRouteName =\n loaded.unstable_settings?.[groupName]?.anchor ??\n loaded.unstable_settings?.[groupName]?.initialRouteName;\n\n anchor = groupSpecificInitialRouteName ?? anchor;\n }\n }\n\n return {\n ...node,\n route: node.route.replace(/\\/?_layout$/, ''),\n children: [], // Each layout should have its own children\n initialRouteName: anchor,\n };\n}\n\nfunction crawlAndAppendInitialRoutesAndEntryFiles(\n node: RouteNode,\n options: Options,\n entryPoints: string[] = []\n) {\n if (node.type === 'route') {\n node.entryPoints = [...new Set([...entryPoints, node.contextKey])];\n } else if (node.type === 'redirect') {\n node.entryPoints = [...new Set([...entryPoints, node.destinationContextKey!])];\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\n // Every node below this layout will have it as an entryPoint\n entryPoints = [...entryPoints, node.contextKey];\n\n /**\n * Calculate the initialRouteNode\n *\n * A file called `(a,b)/(c)/_layout.tsx` will generate two _layout routes: `(a)/(c)/_layout` and `(b)/(c)/_layout`.\n * Each of these layouts will have a different anchor based upon the first group.\n */\n const groupName = matchGroupName(node.route);\n const childMatchingGroup = node.children.find((child) => {\n return child.route.replace(/\\/index$/, '') === groupName;\n });\n let anchor = childMatchingGroup?.route;\n // We may strip loadRoute during testing\n if (!options.internal_stripLoadRoute) {\n const loaded = node.loadRoute();\n if (loaded?.unstable_settings) {\n try {\n // Allow unstable_settings={ initialRouteName: '...' } to override the default initial route name.\n anchor =\n loaded.unstable_settings.anchor ?? loaded.unstable_settings.initialRouteName ?? anchor;\n } catch (error: any) {\n if (error instanceof Error) {\n if (!error.message.match(/You cannot dot into a client module/)) {\n throw error;\n }\n }\n }\n\n if (groupName) {\n // Allow unstable_settings={ 'custom': { initialRouteName: '...' } } to override the less specific initial route name.\n const groupSpecificInitialRouteName =\n loaded.unstable_settings?.[groupName]?.anchor ??\n loaded.unstable_settings?.[groupName]?.initialRouteName;\n\n anchor = groupSpecificInitialRouteName ?? anchor;\n }\n }\n }\n\n if (anchor) {\n const anchorRoute = node.children.find((child) => child.route === anchor);\n if (!anchorRoute) {\n const validAnchorRoutes = node.children\n .filter((child) => !child.generated)\n .map((child) => `'${child.route}'`)\n .join(', ');\n\n if (groupName) {\n throw new Error(\n `Layout ${node.contextKey} has invalid anchor '${anchor}' for group '(${groupName})'. Valid options are: ${validAnchorRoutes}`\n );\n } else {\n throw new Error(\n `Layout ${node.contextKey} has invalid anchor '${anchor}'. Valid options are: ${validAnchorRoutes}`\n );\n }\n }\n\n // Navigators can add initialsRoutes into the history, so they need to be to be included in the entryPoints\n node.initialRouteName = anchor;\n entryPoints.push(anchorRoute.contextKey);\n }\n\n for (const child of node.children) {\n crawlAndAppendInitialRoutesAndEntryFiles(child, options, entryPoints);\n }\n }\n}\n\nfunction getMostSpecific(routes: RouteNode[]) {\n const route = routes[routes.length - 1]!;\n\n if (!routes[0]) {\n throw new Error(\n `The file ${route.contextKey} does not have a fallback sibling file without a platform extension.`\n );\n }\n\n // This works even tho routes is holey array (e.g it might have index 0 and 2 but not 1)\n // `.length` includes the holes in its count\n return route;\n}\n"]}
1
+ {"version":3,"file":"getRoutesCore.js","sourceRoot":"","sources":["../src/getRoutesCore.ts"],"names":[],"mappings":";;AAoFA,8BA6BC;AAqqBD,8CAwBC;AAED,0CAgBC;AA/zBD,yCAUoB;AAEpB,qCAAmD;AA2DnD;;;;;;;;;;;GAWG;AACH,SAAgB,SAAS,CAAC,aAA6B,EAAE,OAAgB;IACvE,MAAM,UAAU,GAAG,aAAa,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;IACzD,MAAM,aAAa,GAAG,gBAAgB,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;IAE/D,yBAAyB;IACzB,IAAI,CAAC,aAAa,EAAE,CAAC;QACnB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,QAAQ,GAAG,4BAA4B,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;IAEtE,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,IAAI,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC;IAC7E,IACE,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAa;QACtC,UAAU,KAAK,MAAM;QACrB,CAAC,OAAO,CAAC,mBAAmB,EAC5B,CAAC;QACD,wBAAwB,CAAC,QAAQ,CAAC,CAAC;IACrC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G,CAAC;gBACJ,CAAC;YACH,CAAC;YAED,2GAA2G;YAC3G,IAAI,CAAC,gBAAgB,GAAG,MAAM,CAAC;YAC/B,WAAW,CAAC,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;QAC3C,CAAC;QAED,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAClC,wCAAwC,CAAC,KAAK,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC;QACxE,CAAC;IACH,CAAC;AACH,CAAC;AAED,SAAS,eAAe,CAAC,MAAmB;IAC1C,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAE,CAAC;IAEzC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CACb,YAAY,KAAK,CAAC,UAAU,sEAAsE,CACnG,CAAC;IACJ,CAAC;IAED,wFAAwF;IACxF,4CAA4C;IAC5C,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["import type { DynamicConvention, MiddlewareNode, RouteNode } from './Route';\nimport {\n matchArrayGroupName,\n matchDynamicName,\n matchGroupName,\n matchLastGroupName,\n getPlatformFromFilePath,\n removeFileSystemDots,\n removeFileSystemExtensions,\n removeSupportedExtensions,\n stripInvisibleSegmentsFromPath,\n} from './matchers';\nimport type { RequireContext } from './types';\nimport { shouldLinkExternally } from './utils/url';\n\nexport type Options = {\n ignore?: RegExp[];\n preserveApiRoutes?: boolean;\n ignoreRequireErrors?: boolean;\n ignoreEntryPoints?: boolean;\n /* Used to simplify testing for toEqual() comparison */\n internal_stripLoadRoute?: boolean;\n /* Used to simplify by skipping the generated routes */\n skipGenerated?: boolean;\n /** Skip routes created by `generateStaticParams()` */\n skipStaticParams?: boolean;\n /* Skip the generated not found route */\n notFound?: boolean;\n /* Enable experimental server middleware support */\n unstable_useServerMiddleware?: boolean;\n importMode?: string;\n platformRoutes?: boolean;\n sitemap?: boolean;\n platform?: string;\n redirects?: RedirectConfig[];\n rewrites?: RewriteConfig[];\n headers?: Record<string, string | string[]>;\n /* Keep redirects as valid routes within the RouteConfig tree */\n preserveRedirectAndRewrites?: boolean;\n\n /** Get the system route for a location. Useful for shimming React Native imports in SSR environments. */\n getSystemRoute: (\n route: Pick<RouteNode, 'route' | 'type'> & {\n defaults?: RouteNode;\n redirectConfig?: RedirectConfig;\n rewriteConfig?: RewriteConfig;\n }\n ) => RouteNode;\n};\n\ntype DirectoryNode = {\n layout?: RouteNode[];\n files: Map<string, RouteNode[]>;\n subdirectories: Map<string, DirectoryNode>;\n};\n\nexport type RedirectConfig = {\n source: string;\n destination: string;\n destinationContextKey: string;\n permanent?: boolean;\n methods?: string[];\n external?: boolean;\n};\n\nexport type RewriteConfig = {\n source: string;\n destination: string;\n destinationContextKey: string;\n methods?: string[];\n};\n\n/**\n * Given a Metro context module, return an array of nested routes.\n *\n * This is a two step process:\n * 1. Convert the RequireContext keys (file paths) into a directory tree.\n * - This should extrapolate array syntax into multiple routes\n * - Routes are given a specificity score\n * 2. Flatten the directory tree into routes\n * - Routes in directories without _layout files are hoisted to the nearest _layout\n * - The name of the route is relative to the nearest _layout\n * - If multiple routes have the same name, the most specific route is used\n */\nexport function getRoutes(contextModule: RequireContext, options: Options): RouteNode | null {\n const middleware = getMiddleware(contextModule, options);\n const directoryTree = getDirectoryTree(contextModule, options);\n\n // If there are no routes\n if (!directoryTree) {\n return null;\n }\n\n const rootNode = flattenDirectoryTreeToRoutes(directoryTree, options);\n\n const importMode = options.importMode || process.env.EXPO_ROUTER_IMPORT_MODE;\n if (\n process.env.NODE_ENV === 'development' &&\n importMode === 'sync' &&\n !options.ignoreRequireErrors\n ) {\n validateRouteTreeExports(rootNode);\n }\n\n if (middleware) {\n rootNode.middleware = middleware;\n }\n\n if (!options.ignoreEntryPoints) {\n crawlAndAppendInitialRoutesAndEntryFiles(rootNode, options);\n }\n\n return rootNode;\n}\n\n/**\n * Given a RequireContext, return the middleware node if one is found. If more than one middleware file is found, an error is thrown.\n */\nfunction getMiddleware(contextModule: RequireContext, options: Options): MiddlewareNode | null {\n const allMiddlewareFiles = contextModule.keys().filter((key) => key.includes('+middleware'));\n\n // Check if middleware is enabled via plugin config\n if (!options.unstable_useServerMiddleware) {\n if (allMiddlewareFiles.length > 0) {\n console.warn(\n 'Server middleware is not enabled. Add unstable_useServerMiddleware: true to your `expo-router` plugin config.\\n\\n' +\n JSON.stringify(\n {\n expo: {\n plugins: [['expo-router', { unstable_useServerMiddleware: true }]],\n },\n },\n null,\n 2\n )\n );\n }\n return null;\n }\n\n const isValidMiddleware = (key: string) => /^\\.\\/\\+middleware\\.[tj]sx?$/.test(key);\n\n const rootMiddlewareFiles = allMiddlewareFiles.filter(isValidMiddleware);\n\n const nonRootMiddleware = allMiddlewareFiles.filter(\n (file) => !rootMiddlewareFiles.includes(file)\n );\n if (nonRootMiddleware.length > 0) {\n throw new Error(\n `The middleware file can only be placed at the root level. Remove the following files: ${nonRootMiddleware.join(', ')}`\n );\n }\n\n if (rootMiddlewareFiles.length === 0) {\n return null;\n }\n\n // In development, throw an error if there are multiple root-level middleware files\n if (rootMiddlewareFiles.length > 1) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error(\n `Only one middleware file is allowed. Keep one of the conflicting files: ${rootMiddlewareFiles.map((p) => `\"${p}\"`).join(' or ')}`\n );\n }\n }\n\n const middlewareFilePath = rootMiddlewareFiles[0]!;\n\n const middleware: MiddlewareNode = {\n loadRoute() {\n if (options.ignoreRequireErrors) {\n try {\n return contextModule(middlewareFilePath);\n } catch {\n return {};\n }\n } else {\n return contextModule(middlewareFilePath);\n }\n },\n contextKey: middlewareFilePath,\n };\n\n if (options.internal_stripLoadRoute) {\n delete (middleware as any).loadRoute;\n }\n\n return middleware;\n}\n\n/**\n * Converts the RequireContext keys (file paths) into a directory tree.\n */\nfunction getDirectoryTree(contextModule: RequireContext, options: Options) {\n const importMode = options.importMode || process.env.EXPO_ROUTER_IMPORT_MODE;\n\n const ignoreList: RegExp[] = [/^\\.\\/\\+(html|native-intent)\\.[tj]sx?$/]; // Ignore the top level ./+html file\n\n if (options.ignore) {\n ignoreList.push(...options.ignore);\n }\n if (!options.preserveApiRoutes) {\n ignoreList.push(/\\+api$/, /\\+api\\.[tj]sx?$/);\n }\n\n // Always ignore middleware files in regular route processing\n ignoreList.push(/\\+middleware$/, /\\+middleware\\.[tj]sx?$/);\n\n const rootDirectory: DirectoryNode = {\n files: new Map(),\n subdirectories: new Map(),\n };\n\n let hasRoutes = false;\n let isValid = false;\n\n const contextKeys = contextModule.keys();\n const redirects: Record<string, RedirectConfig> = {};\n const rewrites: Record<string, RewriteConfig> = {};\n\n let validRedirectDestinations: { contextKey: string; nameWithoutInvisible: string }[] | undefined;\n\n const getValidDestinations = () => {\n // Loop over contexts once and cache the valid destinations\n validRedirectDestinations ??= contextKeys.map((key) => {\n return {\n contextKey: key,\n nameWithoutInvisible: getNameWithoutInvisibleSegmentsFromRedirectPath(\n removeSupportedExtensions(key)\n ),\n };\n });\n return validRedirectDestinations;\n };\n\n // If we are keeping redirects as valid routes, then we need to add them to the contextKeys\n // This is useful for generating a sitemap with redirects, or static site generation that includes redirects\n if (options.preserveRedirectAndRewrites) {\n if (options.redirects) {\n for (const redirect of options.redirects) {\n const sourceContextKey = getSourceContextKeyFromRedirectSource(redirect.source);\n const sourceName = getNameFromRedirectPath(redirect.source);\n\n const isExternalRedirect = shouldLinkExternally(redirect.destination);\n\n const targetDestinationName = isExternalRedirect\n ? redirect.destination\n : getNameWithoutInvisibleSegmentsFromRedirectPath(redirect.destination);\n\n if (ignoreList.some((regex) => regex.test(sourceContextKey))) {\n continue;\n }\n\n const validDestination = isExternalRedirect\n ? undefined\n : getValidDestinations().find(\n (key) => key.nameWithoutInvisible === targetDestinationName\n );\n const destination = isExternalRedirect\n ? targetDestinationName\n : validDestination?.nameWithoutInvisible;\n const destinationContextKey = isExternalRedirect\n ? targetDestinationName\n : validDestination?.contextKey;\n\n if (!destinationContextKey || destination === undefined) {\n /*\n * Only throw the error when we are preserving the api routes\n * When doing a static export, API routes will not exist so the redirect destination may not exist.\n * The desired behavior for this error is to warn the user when running `expo start`, so its ok if\n * `expo export` swallows this error.\n */\n if (options.preserveApiRoutes) {\n throw new Error(`Redirect destination \"${redirect.destination}\" does not exist.`);\n }\n\n continue;\n }\n\n contextKeys.push(sourceContextKey);\n redirects[sourceName] = {\n source: sourceName,\n destination,\n destinationContextKey,\n permanent: Boolean(redirect.permanent),\n external: isExternalRedirect,\n methods: redirect.methods,\n };\n }\n }\n\n if (options.rewrites) {\n for (const rewrite of options.rewrites) {\n const sourceContextKey = getSourceContextKeyFromRedirectSource(rewrite.source);\n const sourceName = getNameFromRedirectPath(rewrite.source);\n\n // We check to see if the context key is already known so that we don't create a rewrite for\n // a route that already exists on disk\n const isSourceContextKeyAlreadyKnown = contextKeys.includes(sourceContextKey);\n const targetDestinationName = isSourceContextKeyAlreadyKnown\n ? getNameFromRedirectPath(rewrite.destination)\n : getNameWithoutInvisibleSegmentsFromRedirectPath(rewrite.destination);\n\n if (ignoreList.some((regex) => regex.test(sourceContextKey))) {\n continue;\n }\n\n const validDestination = getValidDestinations().find(\n (key) => key.nameWithoutInvisible === targetDestinationName\n );\n const destination = validDestination?.nameWithoutInvisible;\n const destinationContextKey = validDestination?.contextKey;\n\n if (!destinationContextKey || destination === undefined) {\n /*\n * Only throw the error when we are preserving the api routes\n * When doing a static export, API routes will not exist so the redirect destination may not exist.\n * The desired behavior for this error is to warn the user when running `expo start`, so its ok if\n * `expo export` swallows this error.\n */\n if (options.preserveApiRoutes) {\n throw new Error(`Rewrite destination \"${rewrite.destination}\" does not exist.`);\n }\n\n continue;\n }\n\n contextKeys.push(sourceContextKey);\n rewrites[sourceName] = {\n source: sourceName,\n destination,\n destinationContextKey,\n methods: rewrite.methods,\n };\n }\n }\n }\n\n const processedRedirectsRewrites = new Set<string>();\n\n for (const filePath of contextKeys) {\n if (ignoreList.some((regex) => regex.test(filePath))) {\n continue;\n }\n\n isValid = true;\n\n const meta = getFileMeta(filePath, options, redirects, rewrites);\n\n // This is a file that should be ignored. e.g maybe it has an invalid platform?\n if (meta.specificity < 0) {\n continue;\n }\n\n let node: RouteNode = {\n type: meta.isApi ? 'api' : meta.isLayout ? 'layout' : 'route',\n loadRoute() {\n let routeModule: any;\n\n if (options.ignoreRequireErrors) {\n try {\n routeModule = contextModule(filePath);\n } catch {\n routeModule = {};\n }\n } else {\n routeModule = contextModule(filePath);\n }\n\n // See: expo/src/async-require/asyncRequireModule.ts\n // The \"lazy\" async require function returns a thenable that may carry\n // a raw `_result` value that's either a promise or the synchronously resolved module\n if (importMode === 'lazy' || importMode === 'lazy-once') {\n routeModule =\n '_result' in routeModule && routeModule._result != null\n ? routeModule._result\n : routeModule;\n }\n\n if (process.env.NODE_ENV === 'development' && importMode === 'sync') {\n // In development mode, when async routes are disabled, add some extra error handling to improve the developer experience.\n // This can be useful when you accidentally use an async function in a route file for the default export.\n if (routeModule instanceof Promise) {\n throw new Error(\n `Route \"${filePath}\" cannot be a promise when async routes is disabled.`\n );\n }\n\n const defaultExport = routeModule?.default;\n if (defaultExport instanceof Promise) {\n throw new Error(\n `The default export from route \"${filePath}\" is a promise. Ensure the React Component does not use async or promises.`\n );\n }\n\n // check if default is an async function without invoking it\n if (\n defaultExport instanceof Function &&\n // This only works on web because Hermes support async functions so we have to transform them out.\n defaultExport.constructor.name === 'AsyncFunction'\n ) {\n throw new Error(\n `The default export from route \"${filePath}\" is an async function. Ensure the React Component does not use async or promises.`\n );\n }\n\n // Validate loader export in development\n const loaderExport = routeModule?.loader;\n if (loaderExport && typeof loaderExport !== 'function') {\n throw new Error(`Route \"${filePath}\" exports a loader that is not a function.`);\n }\n\n const metadataExport = routeModule?.generateMetadata;\n if (metadataExport && typeof metadataExport !== 'function') {\n throw new Error(`Route \"${filePath}\" exports generateMetadata that is not a function.`);\n }\n }\n\n return routeModule;\n },\n contextKey: filePath,\n route: '', // This is overwritten during hoisting based upon the _layout\n dynamic: null,\n children: [], // While we are building the directory tree, we don't know the node's children just yet. This is added during hoisting\n };\n\n if (meta.isRedirect) {\n if (processedRedirectsRewrites.has(meta.route)) {\n continue;\n }\n\n const redirect = redirects[meta.route]!;\n node.destinationContextKey = redirect.destinationContextKey;\n node.permanent = redirect.permanent;\n node.generated = true;\n if (node.type === 'route') {\n node = options.getSystemRoute({\n type: 'redirect',\n route: redirect.destination,\n defaults: node,\n redirectConfig: redirect,\n });\n }\n if (redirect!.methods) {\n node.methods = redirect.methods;\n }\n node.type = 'redirect';\n processedRedirectsRewrites.add(meta.route);\n }\n\n if (meta.isRewrite) {\n if (processedRedirectsRewrites.has(meta.route)) {\n continue;\n }\n\n const rewrite = rewrites[meta.route]!;\n node.destinationContextKey = rewrite.destinationContextKey;\n node.generated = true;\n if (node.type === 'route') {\n node = options.getSystemRoute({\n type: 'rewrite',\n route: rewrite.destination,\n defaults: node,\n rewriteConfig: rewrite,\n });\n }\n if (rewrite.methods) {\n node.methods = rewrite.methods;\n }\n node.type = 'rewrite';\n processedRedirectsRewrites.add(meta.route);\n }\n\n /**\n * A single filepath may be extrapolated into multiple routes if it contains array syntax.\n * Another way to thinking about is that a filepath node is present in multiple leaves of the directory tree.\n */\n for (const route of extrapolateGroups(meta.route)) {\n // Traverse the directory tree to its leaf node, creating any missing directories along the way\n const subdirectoryParts = route.split('/').slice(0, -1);\n\n // Start at the root directory and traverse the path to the leaf directory\n let directory = rootDirectory;\n\n for (const part of subdirectoryParts) {\n let subDirectory = directory.subdirectories.get(part);\n\n // Create any missing subdirectories\n if (!subDirectory) {\n subDirectory = {\n files: new Map(),\n subdirectories: new Map(),\n };\n directory.subdirectories.set(part, subDirectory);\n }\n\n directory = subDirectory;\n }\n\n // Clone the node for this route\n node = { ...node, route };\n\n if (meta.isLayout) {\n directory.layout ??= [];\n const existing = directory.layout[meta.specificity];\n if (existing) {\n // In production, use the first route found\n if (process.env.NODE_ENV !== 'production') {\n throw new Error(\n `The layouts \"${filePath}\" and \"${existing.contextKey}\" conflict on the route \"/${route}\". 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.isApi) {\n const fileKey = `${route}+api`;\n let nodes = directory.files.get(fileKey);\n\n if (!nodes) {\n nodes = [];\n directory.files.set(fileKey, nodes);\n }\n\n // API Routes have no specificity, they are always the first node\n const existing = nodes[0];\n\n if (existing) {\n // In production, use the first route found\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}\". 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\n if (!nodes) {\n nodes = [];\n directory.files.set(route, nodes);\n }\n\n /**\n * If there is an existing node with the same specificity, then we have a conflict.\n * NOTE(Platform Routes):\n * We cannot check for specificity conflicts here, as we haven't processed all the context keys yet!\n * This will be checked during hoisting, as well as enforcing that all routes have a non-platform route.\n */\n const existing = nodes[meta.specificity];\n if (existing) {\n // In production, use the first route found\n if (process.env.NODE_ENV !== 'production') {\n throw new Error(\n `The route files \"${filePath}\" and \"${existing.contextKey}\" conflict on the route \"/${route}\". Remove or rename one of these files.`\n );\n }\n } else {\n hasRoutes ||= true;\n nodes[meta.specificity] = node;\n }\n }\n }\n }\n\n // If there are no routes/layouts then we should display the tutorial.\n if (!isValid) {\n return null;\n }\n\n /**\n * If there are no top-level _layout, add a default _layout\n * While this is a generated route, it will still be generated even if skipGenerated is true.\n */\n if (!rootDirectory.layout) {\n rootDirectory.layout = [\n options.getSystemRoute({\n type: 'layout',\n route: '',\n }),\n ];\n }\n\n // Only include the sitemap if there are routes.\n if (!options.skipGenerated) {\n if (hasRoutes && options.sitemap !== false) {\n appendSitemapRoute(rootDirectory, options);\n }\n if (options.notFound !== false) {\n appendNotFoundRoute(rootDirectory, options);\n }\n }\n return rootDirectory;\n}\n\nfunction getNameFromRedirectPath(path: string): string {\n // Removing only the filesystem extensions, to be able to handle +api, +html\n return (\n removeFileSystemExtensions(removeFileSystemDots(path))\n // Remove the leading `/`\n .replace(/^\\//, '')\n );\n}\n\nfunction getNameWithoutInvisibleSegmentsFromRedirectPath(path: string): string {\n return stripInvisibleSegmentsFromPath(getNameFromRedirectPath(path));\n}\n\n// Creates fake context key for redirects and rewrites\nfunction getSourceContextKeyFromRedirectSource(source: string): string {\n const name = getNameFromRedirectPath(source);\n const prefix = './';\n const suffix = /\\.[tj]sx?$/.test(name) ? '' : '.js'; // Ensure it has a file extension\n return `${prefix}${name}${suffix}`;\n}\n\n/**\n * Flatten the directory tree into routes, hoisting routes to the nearest _layout.\n */\nfunction flattenDirectoryTreeToRoutes(\n directory: DirectoryNode,\n options: Options,\n /* The nearest _layout file in the directory tree */\n layout?: RouteNode,\n /* Route names are relative to their layout */\n pathToRemove = ''\n) {\n /**\n * This directory has a _layout file so it becomes the new target for hoisting routes.\n */\n if (directory.layout) {\n const previousLayout = layout;\n layout = getMostSpecific(directory.layout);\n\n // Add the new layout as a child of its parent\n if (previousLayout) {\n previousLayout.children.push(layout);\n }\n\n if (options.internal_stripLoadRoute) {\n delete (layout as any).loadRoute;\n }\n\n // `route` is the absolute pathname. We need to make this relative to the last _layout\n const newRoute = layout.route.replace(pathToRemove, '');\n pathToRemove = layout.route ? `${layout.route}/` : '';\n\n // Now update this layout with the new relative route and dynamic conventions\n layout.route = newRoute;\n layout.dynamic = generateDynamic(layout.contextKey.slice(0));\n }\n\n // This should never occur as there will always be a root layout, but it makes the type system happy\n if (!layout) throw new Error('Expo Router Internal Error: No nearest layout');\n\n for (const routes of directory.files.values()) {\n const routeNode = getMostSpecific(routes);\n\n // `route` is the absolute pathname. We need to make this relative to the nearest layout\n routeNode.route = routeNode.route.replace(pathToRemove, '');\n routeNode.dynamic = generateDynamic(routeNode.route);\n\n if (options.internal_stripLoadRoute) {\n delete (routeNode as any).loadRoute;\n }\n\n layout.children.push(routeNode);\n }\n\n // Recursively flatten the subdirectories\n for (const child of directory.subdirectories.values()) {\n flattenDirectoryTreeToRoutes(child, options, layout, pathToRemove);\n }\n\n return layout;\n}\n\nfunction validateRouteTreeExports(node: RouteNode) {\n if (process.env.NODE_ENV !== 'development' || node.type === 'api') {\n return;\n }\n\n function runtimeValidateRouteNode(node: RouteNode) {\n const routeItem = node.loadRoute();\n // Have a warning for nullish ex\n const route = routeItem?.default;\n if (route == null) {\n // Do not throw an error since a user may just be creating a new route.\n console.warn(\n `Route \"${node.contextKey}\" is missing the required default export. Ensure a React component is exported as default.`\n );\n }\n if (['boolean', 'number', 'string'].includes(typeof route)) {\n throw new Error(\n `The default export from route \"${node.contextKey}\" is an unsupported type: \"${typeof route}\". Only React Components are supported as default exports from route files.`\n );\n }\n }\n\n runtimeValidateRouteNode(node);\n for (const child of node.children) {\n validateRouteTreeExports(child);\n }\n}\n\nfunction getFileMeta(\n originalKey: string,\n options: Options,\n redirects: Record<string, RedirectConfig>,\n rewrites: Record<string, RewriteConfig>\n) {\n // Remove the leading `./`\n // NOTE(@hassankhan): Why not use `getNameFromFilePath()` here?\n const key = removeSupportedExtensions(removeFileSystemDots(originalKey));\n let route = key;\n\n const parts = removeFileSystemDots(originalKey).split('/');\n const filename = parts[parts.length - 1]!;\n const filenameWithoutFileExtension = removeSupportedExtensions(filename);\n const platformExtension = getPlatformFromFilePath(filename);\n const filenameWithoutExtensions = platformExtension\n ? filenameWithoutFileExtension.slice(0, -(platformExtension.length + 1))\n : filenameWithoutFileExtension;\n\n const isLayout = filenameWithoutExtensions === '_layout';\n const isApi = originalKey.match(/\\+api\\.(\\w+\\.)?[jt]sx?$/);\n\n if (filenameWithoutExtensions.startsWith('(') && filenameWithoutExtensions.endsWith(')')) {\n throw new Error(`Invalid route ${originalKey}. Routes cannot end with '(group)' syntax`);\n }\n\n // Nested routes cannot start with the '+' character, except for the '+not-found' route\n if (!isApi && filename.startsWith('+') && filenameWithoutExtensions !== '+not-found') {\n const renamedRoute = [...parts.slice(0, -1), filename.slice(1)].join('/');\n throw new Error(\n `Invalid route ${originalKey}. Route nodes cannot start with the '+' character. \"Rename it to ${renamedRoute}\"`\n );\n }\n let specificity = 0;\n\n const hasPlatformExtension = platformExtension != null;\n const usePlatformRoutes = options.platformRoutes ?? true;\n\n if (hasPlatformExtension) {\n if (!usePlatformRoutes) {\n // If the user has disabled platform routes, then we should ignore this file\n specificity = -1;\n } else if (!options.platform) {\n // If we don't have a platform, then we should ignore this file\n // This used by typed routes, sitemap, etc\n specificity = -1;\n } else if (platformExtension === options.platform) {\n // If the platform extension is the same as the options.platform, then it is the most specific\n specificity = 2;\n } else if (platformExtension === 'native' && options.platform !== 'web') {\n // `native` is allow but isn't as specific as the platform\n specificity = 1;\n } else if (platformExtension !== options.platform) {\n // Somehow we have a platform extension that doesn't match the options.platform and it isn't native\n // This is an invalid file and we will ignore it\n specificity = -1;\n }\n\n if (isApi && specificity !== 0) {\n throw new Error(\n `API routes cannot have platform extensions. Remove '.${platformExtension}' from '${originalKey}'`\n );\n }\n\n route = route.slice(0, -(platformExtension.length + 1));\n }\n\n return {\n route,\n specificity,\n isLayout,\n isApi,\n isRedirect: key in redirects,\n isRewrite: key in rewrites,\n };\n}\n\n/**\n * Generates a set of strings which have the router array syntax extrapolated.\n *\n * /(a,b)/(c,d)/e.tsx => new Set(['a/c/e.tsx', 'a/d/e.tsx', 'b/c/e.tsx', 'b/d/e.tsx'])\n */\nexport function extrapolateGroups(key: string, keys: Set<string> = new Set()): Set<string> {\n const match = matchArrayGroupName(key);\n\n if (!match) {\n keys.add(key);\n return keys;\n }\n const groups = match.split(',');\n const groupsSet = new Set(groups);\n\n if (groupsSet.size !== groups.length) {\n throw new Error(`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\n for (const group of groups) {\n extrapolateGroups(key.replace(match, group.trim()), keys);\n }\n\n return keys;\n}\n\nexport function generateDynamic(path: string): DynamicConvention[] | null {\n const dynamic = path\n .split('/')\n .map((part): DynamicConvention | null => {\n if (part === '+not-found') {\n return {\n name: '+not-found',\n deep: true,\n notFound: true,\n };\n }\n return matchDynamicName(part) ?? null;\n })\n .filter((part): part is DynamicConvention => !!part);\n\n return dynamic.length === 0 ? null : dynamic;\n}\n\nfunction appendSitemapRoute(directory: DirectoryNode, options: Options) {\n if (!directory.files.has('_sitemap') && options.getSystemRoute) {\n directory.files.set('_sitemap', [\n options.getSystemRoute({\n type: 'route',\n route: '_sitemap',\n }),\n ]);\n }\n}\n\nfunction appendNotFoundRoute(directory: DirectoryNode, options: Options) {\n if (!directory.files.has('+not-found') && options.getSystemRoute) {\n directory.files.set('+not-found', [\n options.getSystemRoute({\n type: 'route',\n route: '+not-found',\n }),\n ]);\n }\n}\n\nfunction getLayoutNode(node: RouteNode, options: Options) {\n /**\n * A file called `(a,b)/(c)/_layout.tsx` will generate two _layout routes: `(a)/(c)/_layout` and `(b)/(c)/_layout`.\n * Each of these layouts will have a different anchor based upon the first group name.\n */\n // We may strip loadRoute during testing\n const groupName = matchLastGroupName(node.route);\n const childMatchingGroup = node.children.find((child) => {\n return child.route.replace(/\\/index$/, '') === groupName;\n });\n let anchor = childMatchingGroup?.route;\n const loaded = node.loadRoute();\n if (loaded?.unstable_settings) {\n try {\n // Allow unstable_settings={ initialRouteName: '...' } to override the default initial route name.\n anchor =\n loaded.unstable_settings.anchor ?? loaded.unstable_settings.initialRouteName ?? anchor;\n } catch (error: any) {\n if (error instanceof Error) {\n if (!error.message.match(/You cannot dot into a client module/)) {\n throw error;\n }\n }\n }\n\n if (groupName) {\n // Allow unstable_settings={ 'custom': { initialRouteName: '...' } } to override the less specific initial route name.\n const groupSpecificInitialRouteName =\n loaded.unstable_settings?.[groupName]?.anchor ??\n loaded.unstable_settings?.[groupName]?.initialRouteName;\n\n anchor = groupSpecificInitialRouteName ?? anchor;\n }\n }\n\n return {\n ...node,\n route: node.route.replace(/\\/?_layout$/, ''),\n children: [], // Each layout should have its own children\n initialRouteName: anchor,\n };\n}\n\nfunction crawlAndAppendInitialRoutesAndEntryFiles(\n node: RouteNode,\n options: Options,\n entryPoints: string[] = []\n) {\n if (node.type === 'route') {\n node.entryPoints = [...new Set([...entryPoints, node.contextKey])];\n } else if (node.type === 'redirect') {\n node.entryPoints = [...new Set([...entryPoints, node.destinationContextKey!])];\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\n // Every node below this layout will have it as an entryPoint\n entryPoints = [...entryPoints, node.contextKey];\n\n /**\n * Calculate the initialRouteNode\n *\n * A file called `(a,b)/(c)/_layout.tsx` will generate two _layout routes: `(a)/(c)/_layout` and `(b)/(c)/_layout`.\n * Each of these layouts will have a different anchor based upon the first group.\n */\n const groupName = matchGroupName(node.route);\n const childMatchingGroup = node.children.find((child) => {\n return child.route.replace(/\\/index$/, '') === groupName;\n });\n let anchor = childMatchingGroup?.route;\n // We may strip loadRoute during testing\n if (!options.internal_stripLoadRoute) {\n const loaded = node.loadRoute();\n if (loaded?.unstable_settings) {\n try {\n // Allow unstable_settings={ initialRouteName: '...' } to override the default initial route name.\n anchor =\n loaded.unstable_settings.anchor ?? loaded.unstable_settings.initialRouteName ?? anchor;\n } catch (error: any) {\n if (error instanceof Error) {\n if (!error.message.match(/You cannot dot into a client module/)) {\n throw error;\n }\n }\n }\n\n if (groupName) {\n // Allow unstable_settings={ 'custom': { initialRouteName: '...' } } to override the less specific initial route name.\n const groupSpecificInitialRouteName =\n loaded.unstable_settings?.[groupName]?.anchor ??\n loaded.unstable_settings?.[groupName]?.initialRouteName;\n\n anchor = groupSpecificInitialRouteName ?? anchor;\n }\n }\n }\n\n if (anchor) {\n const anchorRoute = node.children.find((child) => child.route === anchor);\n if (!anchorRoute) {\n const validAnchorRoutes = node.children\n .filter((child) => !child.generated)\n .map((child) => `'${child.route}'`)\n .join(', ');\n\n if (groupName) {\n throw new Error(\n `Layout ${node.contextKey} has invalid anchor '${anchor}' for group '(${groupName})'. Valid options are: ${validAnchorRoutes}`\n );\n } else {\n throw new Error(\n `Layout ${node.contextKey} has invalid anchor '${anchor}'. Valid options are: ${validAnchorRoutes}`\n );\n }\n }\n\n // Navigators can add initialsRoutes into the history, so they need to be to be included in the entryPoints\n node.initialRouteName = anchor;\n entryPoints.push(anchorRoute.contextKey);\n }\n\n for (const child of node.children) {\n crawlAndAppendInitialRoutesAndEntryFiles(child, options, entryPoints);\n }\n }\n}\n\nfunction getMostSpecific(routes: RouteNode[]) {\n const route = routes[routes.length - 1]!;\n\n if (!routes[0]) {\n throw new Error(\n `The file ${route.contextKey} does not have a fallback sibling file without a platform extension.`\n );\n }\n\n // This works even tho routes is holey array (e.g it might have index 0 and 2 but not 1)\n // `.length` includes the holes in its count\n return route;\n}\n"]}
@@ -2,6 +2,7 @@ interface DynamicNameMatch {
2
2
  name: string;
3
3
  deep: boolean;
4
4
  }
5
+ export declare const VALID_PLATFORMS: Set<string>;
5
6
  /** Match `[page]` -> `page` */
6
7
  export declare function matchDynamicName(name: string): DynamicNameMatch | undefined;
7
8
  /** Test `/` -> `page` */
@@ -13,6 +14,7 @@ export declare function matchLastGroupName(name: string): string | undefined;
13
14
  /** Match the first array group name `(a,b,c)/(d,c)` -> `'a,b,c'` */
14
15
  export declare function matchArrayGroupName(name: string): string | undefined;
15
16
  export declare function getNameFromFilePath(name: string): string;
17
+ export declare function getPlatformFromFilePath(filePath: string): string | undefined;
16
18
  export declare function getContextKey(name: string): string;
17
19
  /** Remove `.js`, `.ts`, `.jsx`, `.tsx`, and the +api suffix */
18
20
  export declare function removeSupportedExtensions(name: string): string;
@@ -1 +1 @@
1
- {"version":3,"file":"matchers.d.ts","sourceRoot":"","sources":["../src/matchers.tsx"],"names":[],"mappings":"AAGA,UAAU,gBAAgB;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,OAAO,CAAC;CACf;AAED,+BAA+B;AAC/B,wBAAgB,gBAAgB,CAAC,IAAI,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wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAElD;AAED,+BAA+B;AAC/B,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAE/D;AAED,qCAAqC;AACrC,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAEnE;AAED,oEAAoE;AACpE,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,sBAE/C;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAExD;AAED,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAU5E;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAalD;AAED,+DAA+D;AAC/D,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE9D;AAED,0CAA0C;AAC1C,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE/D;AAGD,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE7D;AAED,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAU/D;AAED,wBAAgB,8BAA8B,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEnE;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,WAExC"}
package/build/matchers.js CHANGED
@@ -1,11 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.VALID_PLATFORMS = void 0;
3
4
  exports.matchDynamicName = matchDynamicName;
4
5
  exports.testNotFound = testNotFound;
5
6
  exports.matchGroupName = matchGroupName;
6
7
  exports.matchLastGroupName = matchLastGroupName;
7
8
  exports.matchArrayGroupName = matchArrayGroupName;
8
9
  exports.getNameFromFilePath = getNameFromFilePath;
10
+ exports.getPlatformFromFilePath = getPlatformFromFilePath;
9
11
  exports.getContextKey = getContextKey;
10
12
  exports.removeSupportedExtensions = removeSupportedExtensions;
11
13
  exports.removeFileSystemExtensions = removeFileSystemExtensions;
@@ -15,6 +17,8 @@ exports.stripInvisibleSegmentsFromPath = stripInvisibleSegmentsFromPath;
15
17
  exports.isTypedRoute = isTypedRoute;
16
18
  /** Match `[page]` -> `page` or `[...group]` -> `...group` */
17
19
  const dynamicNameRe = /^\[([^[\]]+?)\]$/;
20
+ // NOTE(@hassankhan): Should we retrieve these from a more central location?
21
+ exports.VALID_PLATFORMS = new Set(['android', 'ios', 'native', 'web']);
18
22
  /** Match `[page]` -> `page` */
19
23
  function matchDynamicName(name) {
20
24
  const paramName = name.match(dynamicNameRe)?.[1];
@@ -47,10 +51,24 @@ function matchArrayGroupName(name) {
47
51
  function getNameFromFilePath(name) {
48
52
  return removeSupportedExtensions(removeFileSystemDots(name));
49
53
  }
54
+ function getPlatformFromFilePath(filePath) {
55
+ const filename = getNameFromFilePath(filePath).split('/').pop();
56
+ const extensionIndex = filename.lastIndexOf('.');
57
+ if (extensionIndex < 0) {
58
+ return undefined;
59
+ }
60
+ const platform = filename.slice(extensionIndex + 1);
61
+ return exports.VALID_PLATFORMS.has(platform) ? platform : undefined;
62
+ }
50
63
  function getContextKey(name) {
51
64
  // The root path is `` (empty string) so always prepend `/` to ensure
52
65
  // there is some value.
53
- const normal = '/' + getNameFromFilePath(name);
66
+ const contextKey = getNameFromFilePath(name);
67
+ const platform = getPlatformFromFilePath(name);
68
+ const contextKeyWithoutPlatform = platform
69
+ ? contextKey.slice(0, -(platform.length + 1))
70
+ : contextKey;
71
+ const normal = '/' + contextKeyWithoutPlatform;
54
72
  if (!normal.endsWith('_layout')) {
55
73
  return normal;
56
74
  }
@@ -1 +1 @@
1
- {"version":3,"file":"matchers.js","sourceRoot":"","sources":["../src/matchers.tsx"],"names":[],"mappings":";;AASA,4CASC;AAGD,oCAEC;AAGD,wC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CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;AACnE,CAAC;AAED;;;;GAIG;AACH,SAAgB,YAAY,CAAC,IAAY;IACvC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,oCAAoC,CAAC,KAAK,IAAI,CAAC;AAC5F,CAAC","sourcesContent":["/** Match `[page]` -> `page` or `[...group]` -> `...group` */\nconst dynamicNameRe = /^\\[([^[\\]]+?)\\]$/;\n\ninterface DynamicNameMatch {\n name: string;\n deep: boolean;\n}\n\n/** Match `[page]` -> `page` */\nexport function matchDynamicName(name: string): DynamicNameMatch | undefined {\n const paramName = name.match(dynamicNameRe)?.[1];\n if (paramName == null) {\n return undefined;\n } else if (paramName.startsWith('...')) {\n return { name: paramName.slice(3), deep: true };\n } else {\n return { name: paramName, deep: false };\n }\n}\n\n/** Test `/` -> `page` */\nexport function testNotFound(name: string): boolean {\n return /\\+not-found$/.test(name);\n}\n\n/** Match `(page)` -> `page` */\nexport function matchGroupName(name: string): string | undefined {\n return name.match(/^(?:[^\\\\()])*?\\(([^\\\\/]+)\\)/)?.[1];\n}\n\n/** Match `(app)/(page)` -> `page` */\nexport function matchLastGroupName(name: string): string | undefined {\n return name.match(/.*(?:\\/|^)\\(([^\\\\/]+)\\)[^\\s]*$/)?.[1];\n}\n\n/** Match the first array group name `(a,b,c)/(d,c)` -> `'a,b,c'` */\nexport function matchArrayGroupName(name: string) {\n return name.match(/(?:[^\\\\()])*?\\(([^\\\\/]+,[^\\\\/]+)\\)/)?.[1];\n}\n\nexport function getNameFromFilePath(name: string): string {\n return removeSupportedExtensions(removeFileSystemDots(name));\n}\n\nexport function getContextKey(name: string): string {\n // The root path is `` (empty string) so always prepend `/` to ensure\n // there is some value.\n const normal = '/' + getNameFromFilePath(name);\n if (!normal.endsWith('_layout')) {\n return normal;\n }\n return normal.replace(/\\/?_layout$/, '');\n}\n\n/** Remove `.js`, `.ts`, `.jsx`, `.tsx`, and the +api suffix */\nexport function removeSupportedExtensions(name: string): string {\n return name.replace(/(\\+api)?\\.[jt]sx?$/g, '');\n}\n\n/** Remove `.js`, `.ts`, `.jsx`, `.tsx` */\nexport function removeFileSystemExtensions(name: string): string {\n return name.replace(/\\.[jt]sx?$/g, '');\n}\n\n// Remove any amount of `./` and `../` from the start of the string\nexport function removeFileSystemDots(filePath: string): string {\n return filePath.replace(/^(?:\\.\\.?\\/)+/g, '');\n}\n\nexport function stripGroupSegmentsFromPath(path: string): string {\n return path\n .split('/')\n .reduce((acc, v) => {\n if (matchGroupName(v) == null) {\n acc.push(v);\n }\n return acc;\n }, [] as string[])\n .join('/');\n}\n\nexport function stripInvisibleSegmentsFromPath(path: string): string {\n return stripGroupSegmentsFromPath(path).replace(/\\/?index$/, '');\n}\n\n/**\n * Match:\n * - _layout files, +html, +not-found, string+api, etc\n * - Routes can still use `+`, but it cannot be in the last segment.\n */\nexport function isTypedRoute(name: string) {\n return !name.startsWith('+') && name.match(/(_layout|[^/]*?\\+[^/]*?)\\.[tj]sx?$/) === null;\n}\n"]}
1
+ {"version":3,"file":"matchers.js","sourceRoot":"","sources":["../src/matchers.tsx"],"names":[],"mappings":";;;AAYA,4CASC;AAGD,oCAEC;AAGD,wCAEC;AAGD,gDAEC;AAGD,kDAEC;AAED,kDAEC;AAED,0DAUC;AAED,sCAaC;AAGD,8DAEC;AAGD,gEAEC;AAGD,oDAEC;AAED,gEAUC;AAED,wEAEC;AAOD,oCAEC;AAhHD,6DAA6D;AAC7D,MAAM,aAAa,GAAG,kBAAkB,CAAC;AAOzC,4EAA4E;AAC/D,QAAA,eAAe,GAAG,IAAI,GAAG,CAAC,CAAC,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC;AAE5E,+BAA+B;AAC/B,SAAgB,gBAAgB,CAAC,IAAY;IAC3C,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC,CAAC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;AAED,SAAgB,0BAA0B,CAAC,IAAY;IACrD,OAAO,IAAI;SACR,KAAK,CAAC,GAAG,CAAC;SACV,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE;QACjB,IAAI,cAAc,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC;YAC9B,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACd,CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC,EAAE,EAAc,CAAC;SACjB,IAAI,CAAC,GAAG,CAAC,CAAC;AACf,CAAC;AAED,SAAgB,8BAA8B,CAAC,IAAY;IACzD,OAAO,0BAA0B,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;AACnE,CAAC;AAED;;;;GAIG;AACH,SAAgB,YAAY,CAAC,IAAY;IACvC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,oCAAoC,CAAC,KAAK,IAAI,CAAC;AAC5F,CAAC","sourcesContent":["/** Match `[page]` -> `page` or `[...group]` -> `...group` */\nconst dynamicNameRe = /^\\[([^[\\]]+?)\\]$/;\n\ninterface DynamicNameMatch {\n name: string;\n deep: boolean;\n}\n\n// NOTE(@hassankhan): Should we retrieve these from a more central location?\nexport const VALID_PLATFORMS = new Set(['android', 'ios', 'native', 'web']);\n\n/** Match `[page]` -> `page` */\nexport function matchDynamicName(name: string): DynamicNameMatch | undefined {\n const paramName = name.match(dynamicNameRe)?.[1];\n if (paramName == null) {\n return undefined;\n } else if (paramName.startsWith('...')) {\n return { name: paramName.slice(3), deep: true };\n } else {\n return { name: paramName, deep: false };\n }\n}\n\n/** Test `/` -> `page` */\nexport function testNotFound(name: string): boolean {\n return /\\+not-found$/.test(name);\n}\n\n/** Match `(page)` -> `page` */\nexport function matchGroupName(name: string): string | undefined {\n return name.match(/^(?:[^\\\\()])*?\\(([^\\\\/]+)\\)/)?.[1];\n}\n\n/** Match `(app)/(page)` -> `page` */\nexport function matchLastGroupName(name: string): string | undefined {\n return name.match(/.*(?:\\/|^)\\(([^\\\\/]+)\\)[^\\s]*$/)?.[1];\n}\n\n/** Match the first array group name `(a,b,c)/(d,c)` -> `'a,b,c'` */\nexport function matchArrayGroupName(name: string) {\n return name.match(/(?:[^\\\\()])*?\\(([^\\\\/]+,[^\\\\/]+)\\)/)?.[1];\n}\n\nexport function getNameFromFilePath(name: string): string {\n return removeSupportedExtensions(removeFileSystemDots(name));\n}\n\nexport function getPlatformFromFilePath(filePath: string): string | undefined {\n const filename = getNameFromFilePath(filePath).split('/').pop()!;\n const extensionIndex = filename.lastIndexOf('.');\n\n if (extensionIndex < 0) {\n return undefined;\n }\n\n const platform = filename.slice(extensionIndex + 1);\n return VALID_PLATFORMS.has(platform) ? platform : undefined;\n}\n\nexport function getContextKey(name: string): string {\n // The root path is `` (empty string) so always prepend `/` to ensure\n // there is some value.\n const contextKey = getNameFromFilePath(name);\n const platform = getPlatformFromFilePath(name);\n const contextKeyWithoutPlatform = platform\n ? contextKey.slice(0, -(platform.length + 1))\n : contextKey;\n const normal = '/' + contextKeyWithoutPlatform;\n if (!normal.endsWith('_layout')) {\n return normal;\n }\n return normal.replace(/\\/?_layout$/, '');\n}\n\n/** Remove `.js`, `.ts`, `.jsx`, `.tsx`, and the +api suffix */\nexport function removeSupportedExtensions(name: string): string {\n return name.replace(/(\\+api)?\\.[jt]sx?$/g, '');\n}\n\n/** Remove `.js`, `.ts`, `.jsx`, `.tsx` */\nexport function removeFileSystemExtensions(name: string): string {\n return name.replace(/\\.[jt]sx?$/g, '');\n}\n\n// Remove any amount of `./` and `../` from the start of the string\nexport function removeFileSystemDots(filePath: string): string {\n return filePath.replace(/^(?:\\.\\.?\\/)+/g, '');\n}\n\nexport function stripGroupSegmentsFromPath(path: string): string {\n return path\n .split('/')\n .reduce((acc, v) => {\n if (matchGroupName(v) == null) {\n acc.push(v);\n }\n return acc;\n }, [] as string[])\n .join('/');\n}\n\nexport function stripInvisibleSegmentsFromPath(path: string): string {\n return stripGroupSegmentsFromPath(path).replace(/\\/?index$/, '');\n}\n\n/**\n * Match:\n * - _layout files, +html, +not-found, string+api, etc\n * - Routes can still use `+`, but it cannot be in the last segment.\n */\nexport function isTypedRoute(name: string) {\n return !name.startsWith('+') && name.match(/(_layout|[^/]*?\\+[^/]*?)\\.[tj]sx?$/) === null;\n}\n"]}
@@ -1,13 +1,20 @@
1
1
  import { type ComponentType } from 'react';
2
2
  import type { IntegrateWithRouterOptions, NavigatorContentProps, StandardNavigator, StandardNavigatorEventMapBase, StandardRouterNavigatorProps } from './types';
3
+ import { withLayoutContext } from '../layouts/withLayoutContext';
3
4
  import { type DefaultRouterOptions, type EventMapBase, type NavigationAction, type NavigationState, type RouterFactory } from '../react-navigation/native';
4
5
  export type { IntegrateWithRouterOptions, NavigatorContentProps, StandardNavigatorEventMapBase, StandardUseNavigationBuilderOptions, } from './types';
6
+ type IntegrateWithRouterOptionsTuple<State extends NavigationState, CreateProps extends object> = [
7
+ keyof CreateProps
8
+ ] extends [never] ? [options?: IntegrateWithRouterOptions<State, CreateProps>] : [options: IntegrateWithRouterOptions<State, CreateProps>];
9
+ type StandardRouterNavigatorComponent<NavigatorOptions extends object, State extends NavigationState, EventMap extends StandardNavigatorEventMapBase, NavigatorProps extends object, RouterOptions extends DefaultRouterOptions> = ReturnType<typeof withLayoutContext<NavigatorOptions, ComponentType<StandardRouterNavigatorProps<State, NavigatorOptions, EventMap, NavigatorProps, RouterOptions>>, State, EventMap & EventMapBase>>;
5
10
  /**
6
11
  * > **warning** This API is unstable and may change between minor releases.
7
12
  *
8
13
  * Creates a [`standard-navigation`](https://www.npmjs.com/package/standard-navigation) navigator and
9
14
  * wires it into Expo Router in one step. Use `unstable_integrateWithRouter` instead if you already
10
15
  * have a navigator from `createStandardNavigator`.
16
+ * Props declared in both `NavigatorProps` and `CreateProps` are intersected, so incompatible types
17
+ * produce `never` rather than a type error at this call.
11
18
  *
12
19
  * @param NavigatorContent Renders the navigator UI; receives the standard-navigation `state`,
13
20
  * `descriptors`, `actions`, and `emitter`.
@@ -21,10 +28,7 @@ export type { IntegrateWithRouterOptions, NavigatorContentProps, StandardNavigat
21
28
  * export const Tabs = unstable_createStandardRouterNavigator(MyTabsContent, TabRouter);
22
29
  * ```
23
30
  */
24
- export declare function unstable_createStandardRouterNavigator<NavigatorOptions extends object, State extends NavigationState, EventMap extends StandardNavigatorEventMapBase, NavigatorProps extends object, RouterOptions extends DefaultRouterOptions>(NavigatorContent: ComponentType<NavigatorContentProps<NavigatorOptions, EventMap, NavigatorProps>>, router: RouterFactory<State, NavigationAction, RouterOptions>, options?: IntegrateWithRouterOptions<State, NavigatorProps>): import("react").ForwardRefExoticComponent<import("react").PropsWithoutRef<import("..").PickPartial<StandardRouterNavigatorProps<State, NavigatorOptions, EventMap, NavigatorProps, RouterOptions>, "children">> & import("react").RefAttributes<unknown>> & {
25
- Screen: (props: import("..").ScreenProps<NavigatorOptions, State, EventMap & EventMapBase>) => null;
26
- Protected: typeof import("../views/Protected").Protected;
27
- };
31
+ export declare function unstable_createStandardRouterNavigator<NavigatorOptions extends object, State extends NavigationState, EventMap extends StandardNavigatorEventMapBase, NavigatorProps extends object, RouterOptions extends DefaultRouterOptions, CreateProps extends object = object>(NavigatorContent: ComponentType<NavigatorContentProps<NavigatorOptions, EventMap, NavigatorProps, CreateProps>>, router: RouterFactory<State, NavigationAction, RouterOptions>, ...options: IntegrateWithRouterOptionsTuple<State, NoInfer<CreateProps>>): StandardRouterNavigatorComponent<NavigatorOptions, State, EventMap, NavigatorProps, RouterOptions>;
28
32
  /**
29
33
  * > **warning** This API is unstable and may change between minor releases.
30
34
  *
@@ -45,7 +49,7 @@ export declare function unstable_createStandardRouterNavigator<NavigatorOptions
45
49
  * export const Tabs = unstable_integrateWithRouter(navigator, TabRouter);
46
50
  * ```
47
51
  */
48
- export declare function unstable_integrateWithRouter<NavigatorOptions extends object, State extends NavigationState, EventMap extends StandardNavigatorEventMapBase, NavigatorProps extends object, RouterOptions extends DefaultRouterOptions>(navigator: StandardNavigator<NavigatorOptions, EventMap, NavigatorProps>, router: RouterFactory<State, NavigationAction, RouterOptions>, options?: IntegrateWithRouterOptions<State, NavigatorProps>): import("react").ForwardRefExoticComponent<import("react").PropsWithoutRef<import("..").PickPartial<StandardRouterNavigatorProps<State, NavigatorOptions, EventMap, NavigatorProps, RouterOptions>, "children">> & import("react").RefAttributes<unknown>> & {
52
+ export declare function unstable_integrateWithRouter<NavigatorOptions extends object, State extends NavigationState, EventMap extends StandardNavigatorEventMapBase, NavigatorProps extends object, RouterOptions extends DefaultRouterOptions, CreateProps extends object = object>(navigator: StandardNavigator<NavigatorOptions, EventMap, NavigatorProps & CreateProps>, router: RouterFactory<State, NavigationAction, RouterOptions>, ...[options]: IntegrateWithRouterOptionsTuple<State, NoInfer<CreateProps>>): import("react").ForwardRefExoticComponent<import("react").PropsWithoutRef<import("..").PickPartial<StandardRouterNavigatorProps<State, NavigatorOptions, EventMap, NavigatorProps, RouterOptions>, "children">> & import("react").RefAttributes<unknown>> & {
49
53
  Screen: (props: import("..").ScreenProps<NavigatorOptions, State, EventMap & EventMapBase>) => null;
50
54
  Protected: typeof import("../views/Protected").Protected;
51
55
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/standard-navigation/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,aAAa,EAAW,MAAM,OAAO,CAAC;AAIpD,OAAO,KAAK,EACV,0BAA0B,EAC1B,qBAAqB,EACrB,iBAAiB,EACjB,6BAA6B,EAC7B,4BAA4B,EAE7B,MAAM,SAAS,CAAC;AAMjB,OAAO,EAEL,KAAK,oBAAoB,EACzB,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,aAAa,EACnB,MAAM,4BAA4B,CAAC;AAEpC,YAAY,EACV,0BAA0B,EAC1B,qBAAqB,EACrB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AAO,EAAE,+BAA+B,CAAC,KAAK,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC,GACvE,gCAAgC,CACjC,gBAAgB,EAChB,KAAK,EACL,QAAQ,EACR,cAAc,EACd,aAAa,CACd,CAcA;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,4BAA4B,CAC1C,gBAAgB,SAAS,MAAM,EAC/B,KAAK,SAAS,eAAe,EAC7B,QAAQ,SAAS,6BAA6B,EAC9C,cAAc,SAAS,MAAM,EAC7B,aAAa,SAAS,oBAAoB,EAC1C,WAAW,SAAS,MAAM,GAAG,MAAM,EAEnC,SAAS,EAAE,iBAAiB,CAAC,gBAAgB,EAAE,QAAQ,EAAE,cAAc,GAAG,WAAW,CAAC,EACtF,MAAM,EAAE,aAAa,CAAC,KAAK,EAAE,gBAAgB,EAAE,aAAa,CAAC,EAC7D,GAAG,CAAC,OAAO,CAAC,EAAE,+BAA+B,CAAC,KAAK,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;;;EAoE3E"}
@@ -20,6 +20,8 @@ const STANDARD_NAVIGATOR_TYPE = 'standard';
20
20
  * Creates a [`standard-navigation`](https://www.npmjs.com/package/standard-navigation) navigator and
21
21
  * wires it into Expo Router in one step. Use `unstable_integrateWithRouter` instead if you already
22
22
  * have a navigator from `createStandardNavigator`.
23
+ * Props declared in both `NavigatorProps` and `CreateProps` are intersected, so incompatible types
24
+ * produce `never` rather than a type error at this call.
23
25
  *
24
26
  * @param NavigatorContent Renders the navigator UI; receives the standard-navigation `state`,
25
27
  * `descriptors`, `actions`, and `emitter`.
@@ -33,9 +35,9 @@ const STANDARD_NAVIGATOR_TYPE = 'standard';
33
35
  * export const Tabs = unstable_createStandardRouterNavigator(MyTabsContent, TabRouter);
34
36
  * ```
35
37
  */
36
- function unstable_createStandardRouterNavigator(NavigatorContent, router, options) {
38
+ function unstable_createStandardRouterNavigator(NavigatorContent, router, ...options) {
37
39
  const navigator = (0, standard_navigation_1.createStandardNavigator)(NavigatorContent);
38
- return unstable_integrateWithRouter(navigator, router, options);
40
+ return unstable_integrateWithRouter(navigator, router, ...options);
39
41
  }
40
42
  /**
41
43
  * > **warning** This API is unstable and may change between minor releases.
@@ -57,7 +59,7 @@ function unstable_createStandardRouterNavigator(NavigatorContent, router, option
57
59
  * export const Tabs = unstable_integrateWithRouter(navigator, TabRouter);
58
60
  * ```
59
61
  */
60
- function unstable_integrateWithRouter(navigator, router, options) {
62
+ function unstable_integrateWithRouter(navigator, router, ...[options]) {
61
63
  assertStandardNavigator(navigator);
62
64
  const { NavigatorContent } = navigator;
63
65
  function StandardRouterNavigator(props) {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/standard-navigation/index.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;AAyDb,wFAuBC;AAsBD,oEA2EC;;AA/KD,iCAAoD;AACpD,6DAA8D;AAW9D,uEAAoE;AACpE,6DAA0D;AAC1D,6DAA0D;AAC1D,yDAAsD;AACtD,oEAAiE;AACjE,uDAOoC;AASpC,MAAM,iBAAiB,GAAG,CAAC,CAAC;AAC5B,MAAM,uBAAuB,GAAG,UAAU,CAAC;AAE3C;;;;;;;;;;;;;;;;;;GAkBG;AACH,SAAgB,sCAAsC,CAOpD,gBAEC,EACD,MAA6D,EAC7D,OAA2D;IAE3D,MAAM,SAAS,GAAG,IAAA,6CAAuB,EACvC,gBAAgB,CACjB,CAAC;IACF,OAAO,4BAA4B,CAMjC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;AAChC,CAAC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,SAAgB,4BAA4B,CAO1C,SAAwE,EACxE,MAA6D,EAC7D,OAA2D;IAE3D,uBAAuB,CAAC,SAAS,CAAC,CAAC;IACnC,MAAM,EAAE,gBAAgB,EAAE,GAAG,SAAS,CAAC;IAUvC,SAAS,uBAAuB,CAAC,KAAmB;QAClD,MAAM,EAAE,UAAU,EAAE,yBAAyB,E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EACZ,eAAe,EACf,aAAa,EACb,iCAAiC,EACjC,eAAe,EACf,GAAG,UAAU,EACd,GAAG,KAAK,CAAC;IACV,+FAA+F;IAC/F,qGAAqG;IACrG,sGAAsG;IACtG,oGAAoG;IACpG,kEAAkE;IAClE,MAAM,yBAAyB,GAI3B;QACF,EAAE;QACF,QAAQ;QACR,gBAAgB;QAChB,MAAM;QACN,YAAY;QACZ,eAAe;QACf,aAAa;QACb,iCAAiC;QACjC,eAAe;KAChB,CAAC;IACF,OAAO;QACL,UAAU;QACV,uFAAuF;QACvF,yFAAyF;QACzF,yBAAyB,EAAE;YACzB,GAAG,UAAU;YACb,GAAG,yBAAyB;SAC7B;KACF,CAAC;AACJ,CAAC;AAED,SAAS,uBAAuB,CAAC,SAAkB;IAGjD,IAAI,SAAS,IAAI,IAAI,EAAE,CAAC;QACtB,MAAM,IAAI,KAAK,CACb,8EAA8E;YAC5E,qGAAqG;YACrG,qGAAqG,CACxG,CAAC;IACJ,CAAC;IAED,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,SAAkD,CAAC;IAE7E,IAAI,IAAI,KAAK,uBAAuB,EAAE,CAAC;QACrC,MAAM,IAAI,KAAK,CACb,oEAAoE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,oBAAoB;YAC1G,4DAA4D;YAC5D,wFAAwF;YACxF,4EAA4E,CAC/E,CAAC;IACJ,CAAC;IAED,IAAI,OAAO,KAAK,iBAAiB,EAAE,CAAC;QAClC,6FAA6F;QAC7F,gGAAgG;QAChG,8FAA8F;QAC9F,0FAA0F;QAC1F,OAAO,CAAC,IAAI,CACV,4DAA4D,OAAO,aAAa;YAC9E,sDAAsD,iBAAiB,IAAI;YAC3E,6EAA6E;YAC7E,mFAAmF;YACnF,qEAAqE,CACxE,CAAC;IACJ,CAAC;AACH,CAAC","sourcesContent":["'use client';\n\nimport { type ComponentType, useMemo } from 'react';\nimport { createStandardNavigator } from 'standard-navigation';\nimport type { NavigatorArgs } from 'standard-navigation';\n\nimport type {\n IntegrateWithRouterOptions,\n NavigatorContentProps,\n StandardNavigator,\n StandardNavigatorEventMapBase,\n StandardRouterNavigatorProps,\n StandardUseNavigationBuilderOptions,\n} from './types';\nimport { useProjectedDescriptors } from './useProjectedDescriptors';\nimport { useStandardActions } from './useStandardActions';\nimport { useStandardEmitter } from './useStandardEmitter';\nimport { useStandardState } from './useStandardState';\nimport { withLayoutContext } from '../layouts/withLayoutContext';\nimport {\n useNavigationBuilder,\n type DefaultRouterOptions,\n type EventMapBase,\n type NavigationAction,\n type NavigationState,\n type RouterFactory,\n} from '../react-navigation/native';\n\nexport type {\n IntegrateWithRouterOptions,\n NavigatorContentProps,\n StandardNavigatorEventMapBase,\n StandardUseNavigationBuilderOptions,\n} from './types';\n\nconst SUPPORTED_VERSION = 1;\nconst STANDARD_NAVIGATOR_TYPE = 'standard';\n\n/**\n * > **warning** This API is unstable and may change between minor releases.\n *\n * Creates a [`standard-navigation`](https://www.npmjs.com/package/standard-navigation) navigator and\n * wires it into Expo Router in one step. Use `unstable_integrateWithRouter` instead if you already\n * have a navigator from `createStandardNavigator`.\n *\n * @param NavigatorContent Renders the navigator UI; receives the standard-navigation `state`,\n * `descriptors`, `actions`, and `emitter`.\n * @param router The router factory to use. For example, `StackRouter` or `TabRouter`.\n * @param options See `IntegrateWithRouterOptions`.\n *\n * @example\n * ```tsx\n * import { unstable_createStandardRouterNavigator, TabRouter } from 'expo-router';\n *\n * export const Tabs = unstable_createStandardRouterNavigator(MyTabsContent, TabRouter);\n * ```\n */\nexport function unstable_createStandardRouterNavigator<\n NavigatorOptions extends object,\n State extends NavigationState,\n EventMap extends StandardNavigatorEventMapBase,\n NavigatorProps extends object,\n RouterOptions extends DefaultRouterOptions,\n>(\n NavigatorContent: ComponentType<\n NavigatorContentProps<NavigatorOptions, EventMap, NavigatorProps>\n >,\n router: RouterFactory<State, NavigationAction, RouterOptions>,\n options?: IntegrateWithRouterOptions<State, NavigatorProps>\n) {\n const navigator = createStandardNavigator<NavigatorOptions, EventMap, NavigatorProps>(\n NavigatorContent\n );\n return unstable_integrateWithRouter<\n NavigatorOptions,\n State,\n EventMap,\n NavigatorProps,\n RouterOptions\n >(navigator, router, options);\n}\n\n/**\n * > **warning** This API is unstable and may change between minor releases.\n *\n * Wires an existing [`standard-navigation`](https://www.npmjs.com/package/standard-navigation)\n * navigator into Expo Router, returning a navigator component (with a `.Screen` child) usable as a\n * layout. Use `unstable_createStandardRouterNavigator` to create and integrate in one step.\n *\n * @param navigator The object returned by `createStandardNavigator(...)`.\n * @param router The router factory to use. For example, `StackRouter` or `TabRouter`.\n * @param options See `IntegrateWithRouterOptions`.\n *\n * @example\n * ```tsx\n * import { createStandardNavigator } from 'standard-navigation';\n * import { unstable_integrateWithRouter, TabRouter } from 'expo-router';\n *\n * const navigator = createStandardNavigator(MyTabsContent);\n * export const Tabs = unstable_integrateWithRouter(navigator, TabRouter);\n * ```\n */\nexport function unstable_integrateWithRouter<\n NavigatorOptions extends object,\n State extends NavigationState,\n EventMap extends StandardNavigatorEventMapBase,\n NavigatorProps extends object,\n RouterOptions extends DefaultRouterOptions,\n>(\n navigator: StandardNavigator<NavigatorOptions, EventMap, NavigatorProps>,\n router: RouterFactory<State, NavigationAction, RouterOptions>,\n options?: IntegrateWithRouterOptions<State, NavigatorProps>\n) {\n assertStandardNavigator(navigator);\n const { NavigatorContent } = navigator;\n\n type NavPropsType = StandardRouterNavigatorProps<\n State,\n NavigatorOptions,\n EventMap,\n NavigatorProps,\n RouterOptions\n >;\n\n function StandardRouterNavigator(props: NavPropsType) {\n const { extraProps, useNavigationBuilderProps } = partitionNavigatorProps<\n NavigatorOptions,\n State,\n EventMap,\n NavigatorProps,\n RouterOptions\n >(props);\n const { state, navigation, descriptors, describe, NavigationContent } = useNavigationBuilder<\n State,\n RouterOptions,\n Record<string, (...args: unknown[]) => void>,\n NavigatorOptions,\n EventMap\n >(router, useNavigationBuilderProps);\n\n const { dispatch } = navigation;\n\n const derivedProps = useMemo<Partial<NavigatorProps>>(\n () => options?.createProps?.({ state, dispatch, navigation }) ?? {},\n [state, dispatch, navigation, options]\n );\n\n const standardArgs: NavigatorArgs<NavigatorOptions, EventMap> = {\n state: useStandardState(state),\n descriptors: useProjectedDescriptors(state, descriptors, describe),\n actions: useStandardActions(navigation, state.key),\n emitter: useStandardEmitter(navigation),\n };\n\n return (\n <NavigationContent>\n <NavigatorContent\n // `extraProps` is everything that is not a `useNavigationBuilder` option, which is the\n // navigator props *and* the router options merged together — at runtime there is no way\n // to tell the two apart, so the router options are intentionally forwarded here as well.\n // This is benign: `StandardNavigatorContentProps` only surfaces the navigator props in\n // its type, so the TS contract keeps users from reading router options off `NavigatorContent`\n // in the common case, even though they are physically present on the object.\n {...(extraProps as unknown as NavigatorProps)}\n {...derivedProps}\n {...standardArgs}\n />\n </NavigationContent>\n );\n }\n\n return withLayoutContext<\n NavigatorOptions,\n typeof StandardRouterNavigator,\n State,\n EventMap & EventMapBase\n >(StandardRouterNavigator, undefined, options?.useOnlyUserDefinedScreens);\n}\n\n/**\n * Partitions a navigator's props into the subset consumed by `useNavigationBuilder`\n * (`useNavigationBuilderProps`) and everything else (`extraProps`, forwarded to `NavigatorContent`).\n */\nfunction partitionNavigatorProps<\n NavigatorOptions extends object,\n State extends NavigationState,\n EventMap extends StandardNavigatorEventMapBase,\n NavigatorProps extends object,\n RouterOptions extends DefaultRouterOptions,\n>(\n props: StandardRouterNavigatorProps<\n State,\n NavigatorOptions,\n EventMap,\n NavigatorProps,\n RouterOptions\n > & {\n ref?: unknown;\n }\n) {\n const {\n id,\n children,\n initialRouteName,\n layout,\n // `ref` is supplied by `withLayoutContext` and consumed by React; it must not be forwarded\n // to `NavigatorContent`, so it is pulled out of the props here and intentionally dropped.\n ref,\n screenLayout,\n screenListeners,\n screenOptions,\n UNSTABLE_routeNamesChangeBehavior,\n UNSTABLE_router,\n ...extraProps\n } = props;\n // The builder-specific keys are explicitly destructured so they cannot leak into `extraProps`.\n // Re-listing them as a pure object literal typed as `StandardUseNavigationBuilderOptions` also makes\n // the partition type-checked: a key that is not a valid builder option is rejected by excess-property\n // checking, and a missing required builder option is rejected too — both surface as a compile error\n // here instead of silently passing through to the wrong consumer.\n const useNavigationBuilderProps: StandardUseNavigationBuilderOptions<\n State,\n NavigatorOptions,\n EventMap\n > = {\n id,\n children,\n initialRouteName,\n layout,\n screenLayout,\n screenListeners,\n screenOptions,\n UNSTABLE_routeNamesChangeBehavior,\n UNSTABLE_router,\n };\n return {\n extraProps,\n // Spread `extraProps` first so router-specific options (e.g. `backBehavior`) reach the\n // router, then the framework keys above. `NavigatorContent` still receives `extraProps`.\n useNavigationBuilderProps: {\n ...extraProps,\n ...useNavigationBuilderProps,\n },\n };\n}\n\nfunction assertStandardNavigator(navigator: unknown): asserts navigator is {\n type: typeof STANDARD_NAVIGATOR_TYPE;\n} {\n if (navigator == null) {\n throw new Error(\n 'Could not integrate a standard navigator because no navigator was provided. ' +\n 'Pass the object returned by `createStandardNavigator(...)` from the `standard-navigation` package, ' +\n 'or use `unstable_createStandardRouterNavigator(NavigatorContent, router)` which creates it for you.'\n );\n }\n\n const { type, version } = navigator as { type?: unknown; version?: unknown };\n\n if (type !== STANDARD_NAVIGATOR_TYPE) {\n throw new Error(\n `Could not integrate a standard navigator because its \\`type\\` is ${JSON.stringify(type)}, not \"standard\". ` +\n 'This value is likely not a standard-navigation navigator. ' +\n 'Create it with `createStandardNavigator(...)` from the `standard-navigation` package, ' +\n 'or use `unstable_createStandardRouterNavigator(NavigatorContent, router)`.'\n );\n }\n\n if (version !== SUPPORTED_VERSION) {\n // This is a warning rather than a hard error on purpose: the standard-navigation contract is\n // versioned by the `standard-navigation` package, not by expo-router, and integration is likely\n // to keep working across adjacent versions. Blocking here would needlessly break those cases.\n // If a mismatch does cause problems, this points at the version skew as the likely cause.\n console.warn(\n `This standard navigator targets the standard-navigation v${version} contract, ` +\n `but this version of expo-router was built against v${SUPPORTED_VERSION}. ` +\n 'Integration may still work, but if you hit unexpected navigation behavior, ' +\n 'align the installed `standard-navigation` version with your expo-router version, ' +\n 'or check the standard-navigation release notes for migration steps.'\n );\n }\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/standard-navigation/index.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;AAoFb,wFAiCC;AAsBD,oEA8EC;;AAvND,iCAAoD;AACpD,6DAA8D;AAW9D,uEAAoE;AACpE,6DAA0D;AAC1D,6DAA0D;AAC1D,yDAAsD;AACtD,oEAAiE;AACjE,uDAOoC;AASpC,MAAM,iBAAiB,GAAG,CAAC,CAAC;AAC5B,MAAM,uBAAuB,GAAG,UAAU,CAAC;AA2B3C;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,SAAgB,sCAAsC,CAQpD,gBAEC,EACD,MAA6D,EAC7D,GAAG,OAAqE;IAQxE,MAAM,SAAS,GAAG,IAAA,6CAAuB,EAIvC,gBAAgB,CAAC,CAAC;IACpB,OAAO,4BAA4B,CAOjC,SAAS,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,CAAC;AACnC,CAAC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,SAAgB,4BAA4B,CAQ1C,SAAsF,EACtF,MAA6D,EAC7D,GAAG,CAAC,OAAO,CAA+D;IAE1E,uBAAuB,CAAC,SAAS,CAAC,CAAC;IACnC,MAAM,EAAE,gBAAgB,EAAE,GAAG,SAAS,CAAC;IAUvC,SAAS,uBAAuB,CAAC,KAAmB;QAClD,MAAM,EAAE,UAAU,EAAE,yBAAyB,EAAE,GAAG,uBAAuB,CAMvE,KAAK,CAAC,CAAC;QACT,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,QAAQ,EAAE,iBAAiB,EAAE,GAAG,IAAA,6BAAoB,EAM1F,MAAM,EAAE,yBAAyB,CAAC,CAAC;QAErC,MAAM,EAAE,QAAQ,EAAE,GAAG,UAAU,CAAC;QAEhC,MAAM,YAAY,GAAG,IAAA,eAAO,EA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ACb,iCAAiC;QACjC,eAAe;KAChB,CAAC;IACF,OAAO;QACL,UAAU;QACV,uFAAuF;QACvF,yFAAyF;QACzF,yBAAyB,EAAE;YACzB,GAAG,UAAU;YACb,GAAG,yBAAyB;SAC7B;KACF,CAAC;AACJ,CAAC;AAED,SAAS,uBAAuB,CAAC,SAAkB;IAGjD,IAAI,SAAS,IAAI,IAAI,EAAE,CAAC;QACtB,MAAM,IAAI,KAAK,CACb,8EAA8E;YAC5E,qGAAqG;YACrG,qGAAqG,CACxG,CAAC;IACJ,CAAC;IAED,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,SAAkD,CAAC;IAE7E,IAAI,IAAI,KAAK,uBAAuB,EAAE,CAAC;QACrC,MAAM,IAAI,KAAK,CACb,oEAAoE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,oBAAoB;YAC1G,4DAA4D;YAC5D,wFAAwF;YACxF,4EAA4E,CAC/E,CAAC;IACJ,CAAC;IAED,IAAI,OAAO,KAAK,iBAAiB,EAAE,CAAC;QAClC,6FAA6F;QAC7F,gGAAgG;QAChG,8FAA8F;QAC9F,0FAA0F;QAC1F,OAAO,CAAC,IAAI,CACV,4DAA4D,OAAO,aAAa;YAC9E,sDAAsD,iBAAiB,IAAI;YAC3E,6EAA6E;YAC7E,mFAAmF;YACnF,qEAAqE,CACxE,CAAC;IACJ,CAAC;AACH,CAAC","sourcesContent":["'use client';\n\nimport { type ComponentType, useMemo } from 'react';\nimport { createStandardNavigator } from 'standard-navigation';\nimport type { NavigatorArgs } from 'standard-navigation';\n\nimport type {\n IntegrateWithRouterOptions,\n NavigatorContentProps,\n StandardNavigator,\n StandardNavigatorEventMapBase,\n StandardRouterNavigatorProps,\n StandardUseNavigationBuilderOptions,\n} from './types';\nimport { useProjectedDescriptors } from './useProjectedDescriptors';\nimport { useStandardActions } from './useStandardActions';\nimport { useStandardEmitter } from './useStandardEmitter';\nimport { useStandardState } from './useStandardState';\nimport { withLayoutContext } from '../layouts/withLayoutContext';\nimport {\n useNavigationBuilder,\n type DefaultRouterOptions,\n type EventMapBase,\n type NavigationAction,\n type NavigationState,\n type RouterFactory,\n} from '../react-navigation/native';\n\nexport type {\n IntegrateWithRouterOptions,\n NavigatorContentProps,\n StandardNavigatorEventMapBase,\n StandardUseNavigationBuilderOptions,\n} from './types';\n\nconst SUPPORTED_VERSION = 1;\nconst STANDARD_NAVIGATOR_TYPE = 'standard';\n\n// A rest tuple is the only way to make the whole argument optional for empty `CreateProps` and\n// required otherwise; a normal optional parameter would accept `undefined` in both cases.\ntype IntegrateWithRouterOptionsTuple<State extends NavigationState, CreateProps extends object> = [\n keyof CreateProps,\n] extends [never]\n ? [options?: IntegrateWithRouterOptions<State, CreateProps>]\n : [options: IntegrateWithRouterOptions<State, CreateProps>];\n\ntype StandardRouterNavigatorComponent<\n NavigatorOptions extends object,\n State extends NavigationState,\n EventMap extends StandardNavigatorEventMapBase,\n NavigatorProps extends object,\n RouterOptions extends DefaultRouterOptions,\n> = ReturnType<\n typeof withLayoutContext<\n NavigatorOptions,\n ComponentType<\n StandardRouterNavigatorProps<State, NavigatorOptions, EventMap, NavigatorProps, RouterOptions>\n >,\n State,\n EventMap & EventMapBase\n >\n>;\n\n/**\n * > **warning** This API is unstable and may change between minor releases.\n *\n * Creates a [`standard-navigation`](https://www.npmjs.com/package/standard-navigation) navigator and\n * wires it into Expo Router in one step. Use `unstable_integrateWithRouter` instead if you already\n * have a navigator from `createStandardNavigator`.\n * Props declared in both `NavigatorProps` and `CreateProps` are intersected, so incompatible types\n * produce `never` rather than a type error at this call.\n *\n * @param NavigatorContent Renders the navigator UI; receives the standard-navigation `state`,\n * `descriptors`, `actions`, and `emitter`.\n * @param router The router factory to use. For example, `StackRouter` or `TabRouter`.\n * @param options See `IntegrateWithRouterOptions`.\n *\n * @example\n * ```tsx\n * import { unstable_createStandardRouterNavigator, TabRouter } from 'expo-router';\n *\n * export const Tabs = unstable_createStandardRouterNavigator(MyTabsContent, TabRouter);\n * ```\n */\nexport function unstable_createStandardRouterNavigator<\n NavigatorOptions extends object,\n State extends NavigationState,\n EventMap extends StandardNavigatorEventMapBase,\n NavigatorProps extends object,\n RouterOptions extends DefaultRouterOptions,\n CreateProps extends object = object,\n>(\n NavigatorContent: ComponentType<\n NavigatorContentProps<NavigatorOptions, EventMap, NavigatorProps, CreateProps>\n >,\n router: RouterFactory<State, NavigationAction, RouterOptions>,\n ...options: IntegrateWithRouterOptionsTuple<State, NoInfer<CreateProps>>\n): StandardRouterNavigatorComponent<\n NavigatorOptions,\n State,\n EventMap,\n NavigatorProps,\n RouterOptions\n> {\n const navigator = createStandardNavigator<\n NavigatorOptions,\n EventMap,\n NavigatorProps & CreateProps\n >(NavigatorContent);\n return unstable_integrateWithRouter<\n NavigatorOptions,\n State,\n EventMap,\n NavigatorProps,\n RouterOptions,\n CreateProps\n >(navigator, router, ...options);\n}\n\n/**\n * > **warning** This API is unstable and may change between minor releases.\n *\n * Wires an existing [`standard-navigation`](https://www.npmjs.com/package/standard-navigation)\n * navigator into Expo Router, returning a navigator component (with a `.Screen` child) usable as a\n * layout. Use `unstable_createStandardRouterNavigator` to create and integrate in one step.\n *\n * @param navigator The object returned by `createStandardNavigator(...)`.\n * @param router The router factory to use. For example, `StackRouter` or `TabRouter`.\n * @param options See `IntegrateWithRouterOptions`.\n *\n * @example\n * ```tsx\n * import { createStandardNavigator } from 'standard-navigation';\n * import { unstable_integrateWithRouter, TabRouter } from 'expo-router';\n *\n * const navigator = createStandardNavigator(MyTabsContent);\n * export const Tabs = unstable_integrateWithRouter(navigator, TabRouter);\n * ```\n */\nexport function unstable_integrateWithRouter<\n NavigatorOptions extends object,\n State extends NavigationState,\n EventMap extends StandardNavigatorEventMapBase,\n NavigatorProps extends object,\n RouterOptions extends DefaultRouterOptions,\n CreateProps extends object = object,\n>(\n navigator: StandardNavigator<NavigatorOptions, EventMap, NavigatorProps & CreateProps>,\n router: RouterFactory<State, NavigationAction, RouterOptions>,\n ...[options]: IntegrateWithRouterOptionsTuple<State, NoInfer<CreateProps>>\n) {\n assertStandardNavigator(navigator);\n const { NavigatorContent } = navigator;\n\n type NavPropsType = StandardRouterNavigatorProps<\n State,\n NavigatorOptions,\n EventMap,\n NavigatorProps,\n RouterOptions\n >;\n\n function StandardRouterNavigator(props: NavPropsType) {\n const { extraProps, useNavigationBuilderProps } = partitionNavigatorProps<\n NavigatorOptions,\n State,\n EventMap,\n NavigatorProps,\n RouterOptions\n >(props);\n const { state, navigation, descriptors, describe, NavigationContent } = useNavigationBuilder<\n State,\n RouterOptions,\n Record<string, (...args: unknown[]) => void>,\n NavigatorOptions,\n EventMap\n >(router, useNavigationBuilderProps);\n\n const { dispatch } = navigation;\n\n const derivedProps = useMemo<Partial<CreateProps>>(\n () => options?.createProps?.({ state, dispatch, navigation }) ?? {},\n [state, dispatch, navigation, options]\n );\n\n const standardArgs: NavigatorArgs<NavigatorOptions, EventMap> = {\n state: useStandardState(state),\n descriptors: useProjectedDescriptors(state, descriptors, describe),\n actions: useStandardActions(navigation, state.key),\n emitter: useStandardEmitter(navigation),\n };\n\n return (\n <NavigationContent>\n <NavigatorContent\n // `extraProps` is everything that is not a `useNavigationBuilder` option, which is the\n // navigator props *and* the router options merged together — at runtime there is no way\n // to tell the two apart, so the router options are intentionally forwarded here as well.\n // This is benign: `StandardNavigatorContentProps` only surfaces the navigator props in\n // its type, so the TS contract keeps users from reading router options off `NavigatorContent`\n // in the common case, even though they are physically present on the object.\n {...(extraProps as unknown as NavigatorProps)}\n // `derivedProps` is partial only when `CreateProps` is empty; otherwise `createProps` is\n // required and returns the complete shape.\n {...(derivedProps as CreateProps)}\n {...standardArgs}\n />\n </NavigationContent>\n );\n }\n\n return withLayoutContext<\n NavigatorOptions,\n typeof StandardRouterNavigator,\n State,\n EventMap & EventMapBase\n >(StandardRouterNavigator, undefined, options?.useOnlyUserDefinedScreens);\n}\n\n/**\n * Partitions a navigator's props into the subset consumed by `useNavigationBuilder`\n * (`useNavigationBuilderProps`) and everything else (`extraProps`, forwarded to `NavigatorContent`).\n */\nfunction partitionNavigatorProps<\n NavigatorOptions extends object,\n State extends NavigationState,\n EventMap extends StandardNavigatorEventMapBase,\n NavigatorProps extends object,\n RouterOptions extends DefaultRouterOptions,\n>(\n props: StandardRouterNavigatorProps<\n State,\n NavigatorOptions,\n EventMap,\n NavigatorProps,\n RouterOptions\n > & {\n ref?: unknown;\n }\n) {\n const {\n id,\n children,\n initialRouteName,\n layout,\n // `ref` is supplied by `withLayoutContext` and consumed by React; it must not be forwarded\n // to `NavigatorContent`, so it is pulled out of the props here and intentionally dropped.\n ref,\n screenLayout,\n screenListeners,\n screenOptions,\n UNSTABLE_routeNamesChangeBehavior,\n UNSTABLE_router,\n ...extraProps\n } = props;\n // The builder-specific keys are explicitly destructured so they cannot leak into `extraProps`.\n // Re-listing them as a pure object literal typed as `StandardUseNavigationBuilderOptions` also makes\n // the partition type-checked: a key that is not a valid builder option is rejected by excess-property\n // checking, and a missing required builder option is rejected too — both surface as a compile error\n // here instead of silently passing through to the wrong consumer.\n const useNavigationBuilderProps: StandardUseNavigationBuilderOptions<\n State,\n NavigatorOptions,\n EventMap\n > = {\n id,\n children,\n initialRouteName,\n layout,\n screenLayout,\n screenListeners,\n screenOptions,\n UNSTABLE_routeNamesChangeBehavior,\n UNSTABLE_router,\n };\n return {\n extraProps,\n // Spread `extraProps` first so router-specific options (e.g. `backBehavior`) reach the\n // router, then the framework keys above. `NavigatorContent` still receives `extraProps`.\n useNavigationBuilderProps: {\n ...extraProps,\n ...useNavigationBuilderProps,\n },\n };\n}\n\nfunction assertStandardNavigator(navigator: unknown): asserts navigator is {\n type: typeof STANDARD_NAVIGATOR_TYPE;\n} {\n if (navigator == null) {\n throw new Error(\n 'Could not integrate a standard navigator because no navigator was provided. ' +\n 'Pass the object returned by `createStandardNavigator(...)` from the `standard-navigation` package, ' +\n 'or use `unstable_createStandardRouterNavigator(NavigatorContent, router)` which creates it for you.'\n );\n }\n\n const { type, version } = navigator as { type?: unknown; version?: unknown };\n\n if (type !== STANDARD_NAVIGATOR_TYPE) {\n throw new Error(\n `Could not integrate a standard navigator because its \\`type\\` is ${JSON.stringify(type)}, not \"standard\". ` +\n 'This value is likely not a standard-navigation navigator. ' +\n 'Create it with `createStandardNavigator(...)` from the `standard-navigation` package, ' +\n 'or use `unstable_createStandardRouterNavigator(NavigatorContent, router)`.'\n );\n }\n\n if (version !== SUPPORTED_VERSION) {\n // This is a warning rather than a hard error on purpose: the standard-navigation contract is\n // versioned by the `standard-navigation` package, not by expo-router, and integration is likely\n // to keep working across adjacent versions. Blocking here would needlessly break those cases.\n // If a mismatch does cause problems, this points at the version skew as the likely cause.\n console.warn(\n `This standard navigator targets the standard-navigation v${version} contract, ` +\n `but this version of expo-router was built against v${SUPPORTED_VERSION}. ` +\n 'Integration may still work, but if you hit unexpected navigation behavior, ' +\n 'align the installed `standard-navigation` version with your expo-router version, ' +\n 'or check the standard-navigation release notes for migration steps.'\n );\n }\n}\n"]}
@@ -13,47 +13,61 @@ export interface StandardNavigatorCreatePropsFactoryDeps<State extends Navigatio
13
13
  dispatch: (action: NavigationAction) => void;
14
14
  navigation: NavigationHelpers<ParamListBase>;
15
15
  }
16
- export interface IntegrateWithRouterOptions<State extends NavigationState = NavigationState, NavigatorProps extends object = object> {
16
+ /**
17
+ * Allows router-specific information to be exposed via navigator props alongside the standard
18
+ * `state` and `actions`.
19
+ *
20
+ * Receives the raw Expo Router `state` and `dispatch`. Both are internal and may have small
21
+ * breaking changes between releases, so prefer the `state` and `actions` passed to
22
+ * `NavigatorContent` when they suffice.
23
+ *
24
+ * @example
25
+ * ```tsx
26
+ * createProps: ({ state, dispatch }) => ({
27
+ * activeRouteKey: state.routes[state.index].key,
28
+ * preload: (name: string) => dispatch({ type: 'PRELOAD', payload: { name } }),
29
+ * })
30
+ * ```
31
+ */
32
+ type CreatePropsFn<State extends NavigationState, CreateProps extends object> = (deps: StandardNavigatorCreatePropsFactoryDeps<State>) => CreateProps;
33
+ type CreatePropsOption<State extends NavigationState, CreateProps extends object> = [
34
+ keyof CreateProps
35
+ ] extends [never] ? {
36
+ /**
37
+ * Declare injected props with the fourth type argument of `NavigatorContentProps` before
38
+ * providing this factory.
39
+ */
40
+ createProps?: never;
41
+ } : {
42
+ createProps: CreatePropsFn<State, CreateProps>;
43
+ };
44
+ export type IntegrateWithRouterOptions<State extends NavigationState = NavigationState, CreateProps extends object = object> = {
17
45
  /**
18
46
  * When `true`, only screens explicitly declared as `<Navigator.Screen>` children are rendered;
19
47
  * routes discovered from the filesystem that were not declared are ignored.
20
48
  */
21
49
  useOnlyUserDefinedScreens?: boolean;
22
- /**
23
- * Allows router-specific information to be exposed via navigator props alongside the standard
24
- * `state` and `actions`.
25
- *
26
- * Receives the raw Expo Router `state` and `dispatch`. Both are internal and may have small
27
- * breaking changes between releases, so prefer the `state` and `actions` passed to
28
- * `NavigatorContent` when they suffice.
29
- *
30
- * @example
31
- * ```tsx
32
- * createProps: ({ state, dispatch }) => ({
33
- * activeRouteKey: state.routes[state.index].key,
34
- * preload: (name: string) => dispatch({ type: 'PRELOAD', payload: { name } }),
35
- * })
36
- * ```
37
- */
38
- createProps?: (deps: StandardNavigatorCreatePropsFactoryDeps<State>) => Partial<NavigatorProps>;
39
- }
50
+ } & CreatePropsOption<State, CreateProps>;
40
51
  export type StandardNavigatorContentProps<NavigatorOptions extends object, EventMap extends StandardNavigatorEventMapBase, NavigatorProps extends object> = NavigatorArgs<NavigatorOptions, EventMap> & Omit<NavigatorProps, keyof NavigatorArgs<NavigatorOptions, EventMap>>;
41
52
  /**
42
- * Lets TypeScript infer `EventMap` and `NavigatorProps` from a `NavigatorContent` component.
53
+ * Lets TypeScript infer `EventMap`, `NavigatorProps`, and `CreateProps` from a `NavigatorContent`
54
+ * component.
43
55
  *
44
56
  * On their own these can't be inferred: `EventMap` only appears as an argument to `emitter.emit`,
45
- * and `NavigatorProps` only inside `Omit<NavigatorProps, …>` — neither is a position TypeScript can
46
- * read a type back out of. Without these two properties it gives up and falls back to the base
47
- * shapes, rejecting components that declare specific events or extra props.
57
+ * while `NavigatorProps` and `CreateProps` are combined inside an intersection and `Omit` — none
58
+ * are positions TypeScript can read a type back out of. Without these properties it gives up and
59
+ * falls back to the base shapes, rejecting components that declare specific events or extra props.
48
60
  *
49
61
  * The properties are phantom: they never exist at runtime and are never read. They exist only to
50
62
  * put each type somewhere TypeScript will infer it from.
51
63
  */
52
- type NavigatorContentInferenceCarrier<EventMap extends StandardNavigatorEventMapBase, NavigatorProps extends object> = {
64
+ type NavigatorContentInferenceCarrier<EventMap extends StandardNavigatorEventMapBase, NavigatorProps extends object, CreateProps extends object> = {
53
65
  /** @internal */
54
66
  readonly __eventMap__?: EventMap;
55
67
  /** @internal */
56
68
  readonly __navigatorProps__?: NavigatorProps;
69
+ /** @internal */
70
+ readonly __createProps__?: CreateProps;
57
71
  };
58
72
  /**
59
73
  * Props for a standard navigator's `NavigatorContent` component. Annotate your content component
@@ -68,11 +82,13 @@ type NavigatorContentInferenceCarrier<EventMap extends StandardNavigatorEventMap
68
82
  * // Typed events:
69
83
  * type TabsContentProps = NavigatorContentProps<
70
84
  * { title?: string },
71
- * { tabPress: { data: undefined; canPreventDefault: true } }
85
+ * { tabPress: { data: undefined; canPreventDefault: true } },
86
+ * { tintColor?: string },
87
+ * { activeRouteKey: string }
72
88
  * >;
73
89
  * ```
74
90
  */
75
- export type NavigatorContentProps<NavigatorOptions extends object, EventMap extends StandardNavigatorEventMapBase = Record<string, never>, NavigatorProps extends object = object> = StandardNavigatorContentProps<NavigatorOptions, EventMap, NavigatorProps> & NavigatorContentInferenceCarrier<EventMap, NavigatorProps>;
91
+ export type NavigatorContentProps<NavigatorOptions extends object, EventMap extends StandardNavigatorEventMapBase = Record<string, never>, NavigatorProps extends object = object, CreateProps extends object = object> = StandardNavigatorContentProps<NavigatorOptions, EventMap, NavigatorProps & CreateProps> & NavigatorContentInferenceCarrier<EventMap, NavigatorProps, CreateProps>;
76
92
  export type StandardRouterNavigatorProps<State extends NavigationState, NavigatorOptions extends object, EventMap extends StandardNavigatorEventMapBase, NavigatorProps extends object, RouterOptions extends DefaultRouterOptions> = StandardUseNavigationBuilderOptions<State, NavigatorOptions, EventMap> & NavigatorProps & RouterOptions;
77
93
  export {};
78
94
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/standard-navigation/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAElF,OAAO,KAAK,EACV,uBAAuB,EACvB,oBAAoB,EACpB,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,aAAa,EACd,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAE9F,MAAM,MAAM,6BAA6B,GAAG,MAAM,CAChD,MAAM,EACN;IAAE,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IAAC,iBAAiB,EAAE,OAAO,CAAA;CAAE,CACzD,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG,cAAc,GAAG,YAAY,CAAC;AAErE,MAAM,MAAM,iBAAiB,CAC3B,gBAAgB,SAAS,MAAM,EAC/B,QAAQ,SAAS,6BAA6B,EAC9C,cAAc,SAAS,MAAM,IAC3B,UAAU,CAAC,OAAO,uBAAuB,CAAC,gBAAgB,EAAE,QAAQ,EAAE,cAAc,CAAC,CAAC,CAAC;AAE3F,MAAM,MAAM,mCAAmC,CAC7C,KAAK,SAAS,eAAe,EAC7B,gBAAgB,SAAS,MAAM,EAC/B,QAAQ,SAAS,6BAA6B,IAC5C,uBAAuB,CACzB,aAAa,EACb,MAAM,GAAG,SAAS,EAClB,KAAK,EACL,gBAAgB,EAChB,QAAQ,GAAG,6BAA6B,EAExC,GAAG,CACJ,CAAC;AAEF,MAAM,WAAW,uCAAuC,CAAC,KAAK,SAA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B;IAChB,QAAQ,CAAC,YAAY,CAAC,EAAE,QAAQ,CAAC;IACjC,gBAAgB;IAChB,QAAQ,CAAC,kBAAkB,CAAC,EAAE,cAAc,CAAC;IAC7C,gBAAgB;IAChB,QAAQ,CAAC,eAAe,CAAC,EAAE,WAAW,CAAC;CACxC,CAAC;AAEF;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,MAAM,qBAAqB,CAC/B,gBAAgB,SAAS,MAAM,EAC/B,QAAQ,SAAS,6BAA6B,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,EACtE,cAAc,SAAS,MAAM,GAAG,MAAM,EACtC,WAAW,SAAS,MAAM,GAAG,MAAM,IACjC,6BAA6B,CAAC,gBAAgB,EAAE,QAAQ,EAAE,cAAc,GAAG,WAAW,CAAC,GACzF,gCAAgC,CAAC,QAAQ,EAAE,cAAc,EAAE,WAAW,CAAC,CAAC;AAE1E,MAAM,MAAM,4BAA4B,CACtC,KAAK,SAAS,eAAe,EAC7B,gBAAgB,SAAS,MAAM,EAC/B,QAAQ,SAAS,6BAA6B,EAC9C,cAAc,SAAS,MAAM,EAC7B,aAAa,SAAS,oBAAoB,IACxC,mCAAmC,CAAC,KAAK,EAAE,gBAAgB,EAAE,QAAQ,CAAC,GACxE,cAAc,GACd,aAAa,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/standard-navigation/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { createStandardNavigator, NavigatorArgs } from 'standard-navigation';\n\nimport type {\n DefaultNavigatorOptions,\n DefaultRouterOptions,\n NavigationAction,\n NavigationHelpers,\n NavigationState,\n ParamListBase,\n} from '../react-navigation/native';\nimport type { GoBackAction, NavigateAction } from '../react-navigation/routers/CommonActions';\n\nexport type StandardNavigatorEventMapBase = Record<\n string,\n { data: object | undefined; canPreventDefault: boolean }\n>;\n\nexport type StandardNavigationAction = NavigateAction | GoBackAction;\n\nexport type StandardNavigator<\n NavigatorOptions extends object,\n EventMap extends StandardNavigatorEventMapBase,\n NavigatorProps extends object,\n> = ReturnType<typeof createStandardNavigator<NavigatorOptions, EventMap, NavigatorProps>>;\n\nexport type StandardUseNavigationBuilderOptions<\n State extends NavigationState,\n NavigatorOptions extends object,\n EventMap extends StandardNavigatorEventMapBase,\n> = DefaultNavigatorOptions<\n ParamListBase,\n string | undefined,\n State,\n NavigatorOptions,\n EventMap & StandardNavigatorEventMapBase,\n // `useNavigationBuilder` itself types the screenListeners `navigation` argument as `any`.\n any\n>;\n\nexport interface StandardNavigatorCreatePropsFactoryDeps<State extends NavigationState> {\n state: State;\n dispatch: (action: NavigationAction) => void;\n navigation: NavigationHelpers<ParamListBase>;\n}\n\nexport interface IntegrateWithRouterOptions<\n State extends NavigationState = NavigationState,\n NavigatorProps extends object = object,\n> {\n /**\n * When `true`, only screens explicitly declared as `<Navigator.Screen>` children are rendered;\n * routes discovered from the filesystem that were not declared are ignored.\n */\n useOnlyUserDefinedScreens?: boolean;\n\n /**\n * Allows router-specific information to be exposed via navigator props alongside the standard\n * `state` and `actions`.\n *\n * Receives the raw Expo Router `state` and `dispatch`. Both are internal and may have small\n * breaking changes between releases, so prefer the `state` and `actions` passed to\n * `NavigatorContent` when they suffice.\n *\n * @example\n * ```tsx\n * createProps: ({ state, dispatch }) => ({\n * activeRouteKey: state.routes[state.index].key,\n * preload: (name: string) => dispatch({ type: 'PRELOAD', payload: { name } }),\n * })\n * ```\n */\n createProps?: (deps: StandardNavigatorCreatePropsFactoryDeps<State>) => Partial<NavigatorProps>;\n}\n\nexport type StandardNavigatorContentProps<\n NavigatorOptions extends object,\n EventMap extends StandardNavigatorEventMapBase,\n NavigatorProps extends object,\n> = NavigatorArgs<NavigatorOptions, EventMap> &\n Omit<NavigatorProps, keyof NavigatorArgs<NavigatorOptions, EventMap>>;\n\n/**\n * Lets TypeScript infer `EventMap` and `NavigatorProps` from a `NavigatorContent` component.\n *\n * On their own these can't be inferred: `EventMap` only appears as an argument to `emitter.emit`,\n * and `NavigatorProps` only inside `Omit<NavigatorProps, …>` — neither is a position TypeScript can\n * read a type back out of. Without these two properties it gives up and falls back to the base\n * shapes, rejecting components that declare specific events or extra props.\n *\n * The properties are phantom: they never exist at runtime and are never read. They exist only to\n * put each type somewhere TypeScript will infer it from.\n */\ntype NavigatorContentInferenceCarrier<\n EventMap extends StandardNavigatorEventMapBase,\n NavigatorProps extends object,\n> = {\n /** @internal */\n readonly __eventMap__?: EventMap;\n /** @internal */\n readonly __navigatorProps__?: NavigatorProps;\n};\n\n/**\n * Props for a standard navigator's `NavigatorContent` component. Annotate your content component\n * with this type to declare the events it emits, so `unstable_createStandardRouterNavigator` can\n * type `emitter.emit` for you.\n *\n * @example\n * ```tsx\n * // No events:\n * type TabsContentProps = NavigatorContentProps<{ title?: string }>;\n *\n * // Typed events:\n * type TabsContentProps = NavigatorContentProps<\n * { title?: string },\n * { tabPress: { data: undefined; canPreventDefault: true } }\n * >;\n * ```\n */\nexport type NavigatorContentProps<\n NavigatorOptions extends object,\n EventMap extends StandardNavigatorEventMapBase = Record<string, never>,\n NavigatorProps extends object = object,\n> = StandardNavigatorContentProps<NavigatorOptions, EventMap, NavigatorProps> &\n NavigatorContentInferenceCarrier<EventMap, NavigatorProps>;\n\nexport type StandardRouterNavigatorProps<\n State extends NavigationState,\n NavigatorOptions extends object,\n EventMap extends StandardNavigatorEventMapBase,\n NavigatorProps extends object,\n RouterOptions extends DefaultRouterOptions,\n> = StandardUseNavigationBuilderOptions<State, NavigatorOptions, EventMap> &\n NavigatorProps &\n RouterOptions;\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/standard-navigation/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { createStandardNavigator, NavigatorArgs } from 'standard-navigation';\n\nimport type {\n DefaultNavigatorOptions,\n DefaultRouterOptions,\n NavigationAction,\n NavigationHelpers,\n NavigationState,\n ParamListBase,\n} from '../react-navigation/native';\nimport type { GoBackAction, NavigateAction } from '../react-navigation/routers/CommonActions';\n\nexport type StandardNavigatorEventMapBase = Record<\n string,\n { data: object | undefined; canPreventDefault: boolean }\n>;\n\nexport type StandardNavigationAction = NavigateAction | GoBackAction;\n\nexport type StandardNavigator<\n NavigatorOptions extends object,\n EventMap extends StandardNavigatorEventMapBase,\n NavigatorProps extends object,\n> = ReturnType<typeof createStandardNavigator<NavigatorOptions, EventMap, NavigatorProps>>;\n\nexport type StandardUseNavigationBuilderOptions<\n State extends NavigationState,\n NavigatorOptions extends object,\n EventMap extends StandardNavigatorEventMapBase,\n> = DefaultNavigatorOptions<\n ParamListBase,\n string | undefined,\n State,\n NavigatorOptions,\n EventMap & StandardNavigatorEventMapBase,\n // `useNavigationBuilder` itself types the screenListeners `navigation` argument as `any`.\n any\n>;\n\nexport interface StandardNavigatorCreatePropsFactoryDeps<State extends NavigationState> {\n state: State;\n dispatch: (action: NavigationAction) => void;\n navigation: NavigationHelpers<ParamListBase>;\n}\n\n/**\n * Allows router-specific information to be exposed via navigator props alongside the standard\n * `state` and `actions`.\n *\n * Receives the raw Expo Router `state` and `dispatch`. Both are internal and may have small\n * breaking changes between releases, so prefer the `state` and `actions` passed to\n * `NavigatorContent` when they suffice.\n *\n * @example\n * ```tsx\n * createProps: ({ state, dispatch }) => ({\n * activeRouteKey: state.routes[state.index].key,\n * preload: (name: string) => dispatch({ type: 'PRELOAD', payload: { name } }),\n * })\n * ```\n */\ntype CreatePropsFn<State extends NavigationState, CreateProps extends object> = (\n deps: StandardNavigatorCreatePropsFactoryDeps<State>\n) => CreateProps;\n\ntype CreatePropsOption<State extends NavigationState, CreateProps extends object> = [\n keyof CreateProps,\n] extends [never]\n ? {\n /**\n * Declare injected props with the fourth type argument of `NavigatorContentProps` before\n * providing this factory.\n */\n createProps?: never;\n }\n : { createProps: CreatePropsFn<State, CreateProps> };\n\nexport type IntegrateWithRouterOptions<\n State extends NavigationState = NavigationState,\n CreateProps extends object = object,\n> = {\n /**\n * When `true`, only screens explicitly declared as `<Navigator.Screen>` children are rendered;\n * routes discovered from the filesystem that were not declared are ignored.\n */\n useOnlyUserDefinedScreens?: boolean;\n} & CreatePropsOption<State, CreateProps>;\n\nexport type StandardNavigatorContentProps<\n NavigatorOptions extends object,\n EventMap extends StandardNavigatorEventMapBase,\n NavigatorProps extends object,\n> = NavigatorArgs<NavigatorOptions, EventMap> &\n Omit<NavigatorProps, keyof NavigatorArgs<NavigatorOptions, EventMap>>;\n\n/**\n * Lets TypeScript infer `EventMap`, `NavigatorProps`, and `CreateProps` from a `NavigatorContent`\n * component.\n *\n * On their own these can't be inferred: `EventMap` only appears as an argument to `emitter.emit`,\n * while `NavigatorProps` and `CreateProps` are combined inside an intersection and `Omit` — none\n * are positions TypeScript can read a type back out of. Without these properties it gives up and\n * falls back to the base shapes, rejecting components that declare specific events or extra props.\n *\n * The properties are phantom: they never exist at runtime and are never read. They exist only to\n * put each type somewhere TypeScript will infer it from.\n */\ntype NavigatorContentInferenceCarrier<\n EventMap extends StandardNavigatorEventMapBase,\n NavigatorProps extends object,\n CreateProps extends object,\n> = {\n /** @internal */\n readonly __eventMap__?: EventMap;\n /** @internal */\n readonly __navigatorProps__?: NavigatorProps;\n /** @internal */\n readonly __createProps__?: CreateProps;\n};\n\n/**\n * Props for a standard navigator's `NavigatorContent` component. Annotate your content component\n * with this type to declare the events it emits, so `unstable_createStandardRouterNavigator` can\n * type `emitter.emit` for you.\n *\n * @example\n * ```tsx\n * // No events:\n * type TabsContentProps = NavigatorContentProps<{ title?: string }>;\n *\n * // Typed events:\n * type TabsContentProps = NavigatorContentProps<\n * { title?: string },\n * { tabPress: { data: undefined; canPreventDefault: true } },\n * { tintColor?: string },\n * { activeRouteKey: string }\n * >;\n * ```\n */\nexport type NavigatorContentProps<\n NavigatorOptions extends object,\n EventMap extends StandardNavigatorEventMapBase = Record<string, never>,\n NavigatorProps extends object = object,\n CreateProps extends object = object,\n> = StandardNavigatorContentProps<NavigatorOptions, EventMap, NavigatorProps & CreateProps> &\n NavigatorContentInferenceCarrier<EventMap, NavigatorProps, CreateProps>;\n\nexport type StandardRouterNavigatorProps<\n State extends NavigationState,\n NavigatorOptions extends object,\n EventMap extends StandardNavigatorEventMapBase,\n NavigatorProps extends object,\n RouterOptions extends DefaultRouterOptions,\n> = StandardUseNavigationBuilderOptions<State, NavigatorOptions, EventMap> &\n NavigatorProps &\n RouterOptions;\n"]}
@@ -9,7 +9,7 @@
9
9
  "publication": {
10
10
  "groupId": "expo.modules.router",
11
11
  "artifactId": "expo.modules.router",
12
- "version": "56.2.20",
12
+ "version": "56.2.22",
13
13
  "repository": "local-maven-repo"
14
14
  }
15
15
  }
@@ -3,7 +3,7 @@
3
3
  "component": {
4
4
  "group": "expo.modules.router",
5
5
  "module": "expo.modules.router",
6
- "version": "56.2.20",
6
+ "version": "56.2.22",
7
7
  "attributes": {
8
8
  "org.gradle.status": "release"
9
9
  }
@@ -24,8 +24,8 @@
24
24
  },
25
25
  "files": [
26
26
  {
27
- "name": "expo.modules.router-56.2.20.aar",
28
- "url": "expo.modules.router-56.2.20.aar",
27
+ "name": "expo.modules.router-56.2.22.aar",
28
+ "url": "expo.modules.router-56.2.22.aar",
29
29
  "size": 15835,
30
30
  "sha512": "72b5be73401c4b0a8807373f01bd79e202212f07713d071019c24eb27227a4c8568d6148d0a48338f6955f9dbe713f56e7877d8e3fe0acec28dbb68533953d90",
31
31
  "sha256": "7c41d508ab24d199ead0eb06525957cdd227a73925863865bf2956d48cb707ef",
@@ -74,8 +74,8 @@
74
74
  ],
75
75
  "files": [
76
76
  {
77
- "name": "expo.modules.router-56.2.20.aar",
78
- "url": "expo.modules.router-56.2.20.aar",
77
+ "name": "expo.modules.router-56.2.22.aar",
78
+ "url": "expo.modules.router-56.2.22.aar",
79
79
  "size": 15835,
80
80
  "sha512": "72b5be73401c4b0a8807373f01bd79e202212f07713d071019c24eb27227a4c8568d6148d0a48338f6955f9dbe713f56e7877d8e3fe0acec28dbb68533953d90",
81
81
  "sha256": "7c41d508ab24d199ead0eb06525957cdd227a73925863865bf2956d48cb707ef",
@@ -94,8 +94,8 @@
94
94
  },
95
95
  "files": [
96
96
  {
97
- "name": "expo.modules.router-56.2.20-sources.jar",
98
- "url": "expo.modules.router-56.2.20-sources.jar",
97
+ "name": "expo.modules.router-56.2.22-sources.jar",
98
+ "url": "expo.modules.router-56.2.22-sources.jar",
99
99
  "size": 2326,
100
100
  "sha512": "a1a1537b57bc0d66efbf2bdfd5f514684400b9598e549eaf53c528d1bf32ff42b7826e74fb6e115f8ec0490b9e06ffbb3c3efe9f2f703652c13291ef82b0fa03",
101
101
  "sha256": "2add0f802e663eb9b5f90e086dca0e0e337a1442e15fb372a05945e01ee0d289",
@@ -0,0 +1 @@
1
+ 14c505f358868bf4ecad48d0b084e52693b5c58792e1e7f81451b7bbecc79552
@@ -0,0 +1 @@
1
+ 4b1e1c4e80f57892f87effa73d172b359f2bdc2affe30f6b2ea10d592a617074bb2c49aefe54ccd2345bcf0dd671ef140bbce89572429d670d024f4060da750d
@@ -9,7 +9,7 @@
9
9
  <modelVersion>4.0.0</modelVersion>
10
10
  <groupId>expo.modules.router</groupId>
11
11
  <artifactId>expo.modules.router</artifactId>
12
- <version>56.2.20</version>
12
+ <version>56.2.22</version>
13
13
  <packaging>aar</packaging>
14
14
  <name>expo.modules.router</name>
15
15
  <url>https://github.com/expo/expo</url>
@@ -0,0 +1 @@
1
+ de81a27a5e0ec8e049577b61d2d62c8b17a2c0953b7006e6c5206553eb8595df
@@ -0,0 +1 @@
1
+ 0d14ee2b6a32173017610e3c1ee6ce3197bd95ab8198773dccbba8ef5c1c7d8efa814113ce622bdd2a113476d5cb74bda5369d3d32028948928e2b4795436ced
@@ -3,11 +3,11 @@
3
3
  <groupId>expo.modules.router</groupId>
4
4
  <artifactId>expo.modules.router</artifactId>
5
5
  <versioning>
6
- <latest>56.2.20</latest>
7
- <release>56.2.20</release>
6
+ <latest>56.2.22</latest>
7
+ <release>56.2.22</release>
8
8
  <versions>
9
- <version>56.2.20</version>
9
+ <version>56.2.22</version>
10
10
  </versions>
11
- <lastUpdated>20260828085607</lastUpdated>
11
+ <lastUpdated>20261021144835</lastUpdated>
12
12
  </versioning>
13
13
  </metadata>
@@ -1 +1 @@
1
- 5331746f36e44fa3ed0db2c3dc6d78b9
1
+ 6de2def2a580a328469c9082506c351f
@@ -1 +1 @@
1
- 082b16595fd971909c1d9abdf9d7ed2eccd3150d
1
+ c1fc4fae043fd9fc7abe71257e4286d473fe8e20
@@ -1 +1 @@
1
- 4b9307109f57fa49c95419d8cfaaf82504d9e99e230276b59df92a67463d9524
1
+ a2730215f553ce1188ab4fada03c1364e2fed50a2f33043ab5b4492355abdfa2
@@ -1 +1 @@
1
- 9ce3fcd2f249a4546741a864952591e3ac1633dd1a3998267699b3e324f36de9bf424b9a787e5dea3018a5ddf8b73ae856982fc71494efaf95301d66cd9d1160
1
+ 5092c97d104b96d928b39f36a919461f2d338c217df2beb87d93ad4d5ee6c2ce317ea3717dd5fbc21d5c5ba65293d3f2879fff575ce0a611b8cd903319931bcd
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-router",
3
- "version": "56.2.20",
3
+ "version": "56.2.22",
4
4
  "description": "Expo Router is a file-based router for React Native and web applications.",
5
5
  "author": "650 Industries, Inc.",
6
6
  "license": "MIT",
@@ -82,8 +82,8 @@
82
82
  "@expo/metro-runtime": "^56.0.21",
83
83
  "@testing-library/react-native": ">= 13.2.0",
84
84
  "expo": "*",
85
- "expo-constants": "^56.0.25",
86
- "expo-linking": "^56.0.17",
85
+ "expo-constants": "^56.0.27",
86
+ "expo-linking": "^56.0.19",
87
87
  "react": "*",
88
88
  "react-dom": "*",
89
89
  "react-native": "*",
@@ -136,7 +136,7 @@
136
136
  "react-native-web": "~0.21.0",
137
137
  "react-server-dom-webpack": "~19.0.6",
138
138
  "tsd": "^0.33.0",
139
- "expo": "56.0.21"
139
+ "expo": "56.0.24"
140
140
  },
141
141
  "dependencies": {
142
142
  "@expo/log-box": "^56.0.14",
@@ -169,7 +169,7 @@
169
169
  "standard-navigation": "^0.0.5",
170
170
  "vaul": "^1.1.2"
171
171
  },
172
- "gitHead": "1b8eb0e13635d3ef52c1c11d305ff927d01390ae",
172
+ "gitHead": "52c38e9c5f785a112e6632526bf4250918d4af14",
173
173
  "scripts": {
174
174
  "build": "node ./scripts/build.js",
175
175
  "clean": "expo-module clean",
@@ -1 +0,0 @@
1
- 0b5bd5cc9620b03701effd8a55d5a9788d8ed376b7ab945e8d44ad1ede010851
@@ -1 +0,0 @@
1
- 97bc8e9123f105e1b71af93cf31b2acef4c03690869e0fc635ae366d142d3bfffaaf6eba32c4437438430485c881e56e0ea4ddcf6d7e73f585a659d210746441
@@ -1 +0,0 @@
1
- 8081e237bd5f0f3ab91c75ed1ff3ac9cf6d51c398af9ef60e4f45321be992988
@@ -1 +0,0 @@
1
- 73ca3ccd589b549346ac69d2fc43bbce74a01f6e5649aeffba6f3b3653e7ae86686e883e038ba1a8af40913a3cebba75eb7562fb9b90eeb269b32a12b2f4bdaa