Rocky_Mountain_Vending/.pnpm-store/v10/files/95/3b24ae8414ce42bf469cb989c7efadf59c08f8b66558cd73cb7ca7bf7500b8851301c19b48975557479b2a35c46a7a70e9e800ff8042f8d21c50bab6758be0
DMleadgen 46d973904b
Initial commit: Rocky Mountain Vending website
Next.js website for Rocky Mountain Vending company featuring:
- Product catalog with Stripe integration
- Service areas and parts pages
- Admin dashboard with Clerk authentication
- SEO optimized pages with JSON-LD structured data

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 16:22:15 -07:00

1 line
No EOL
14 KiB
Text

{"version":3,"sources":["../../../src/lib/metadata/is-metadata-route.ts"],"sourcesContent":["import type { PageExtensions } from '../../build/page-extensions-type'\nimport { normalizePathSep } from '../../shared/lib/page-path/normalize-path-sep'\nimport { normalizeAppPath } from '../../shared/lib/router/utils/app-paths'\nimport { isAppRouteRoute } from '../is-app-route-route'\n\nexport const STATIC_METADATA_IMAGES = {\n icon: {\n filename: 'icon',\n extensions: ['ico', 'jpg', 'jpeg', 'png', 'svg'],\n },\n apple: {\n filename: 'apple-icon',\n extensions: ['jpg', 'jpeg', 'png'],\n },\n favicon: {\n filename: 'favicon',\n extensions: ['ico'],\n },\n openGraph: {\n filename: 'opengraph-image',\n extensions: ['jpg', 'jpeg', 'png', 'gif'],\n },\n twitter: {\n filename: 'twitter-image',\n extensions: ['jpg', 'jpeg', 'png', 'gif'],\n },\n} as const\n\n// Match routes that are metadata routes, e.g. /sitemap.xml, /favicon.<ext>, /<icon>.<ext>, etc.\n// TODO-METADATA: support more metadata routes with more extensions\nexport const DEFAULT_METADATA_ROUTE_EXTENSIONS = ['js', 'jsx', 'ts', 'tsx']\n\n// Match the file extension with the dynamic multi-routes extensions\n// e.g. ([xml, js], null) -> can match `/sitemap.xml/route`, `sitemap.js/route`\n// e.g. ([png], [ts]) -> can match `/opengraph-image.png`, `/opengraph-image.ts`\nexport const getExtensionRegexString = (\n staticExtensions: readonly string[],\n dynamicExtensions: readonly string[] | null\n) => {\n let result: string\n // If there's no possible multi dynamic routes, will not match any <name>[].<ext> files\n if (!dynamicExtensions || dynamicExtensions.length === 0) {\n result = `(\\\\.(?:${staticExtensions.join('|')}))`\n } else {\n result = `(?:\\\\.(${staticExtensions.join('|')})|(\\\\.(${dynamicExtensions.join('|')})))`\n }\n return result\n}\n\n/**\n * Matches the static metadata files, e.g. /robots.txt, /sitemap.xml, /favicon.ico, etc.\n * @param appDirRelativePath the relative file path to app/\n * @returns if the path is a static metadata file route\n */\nexport function isStaticMetadataFile(appDirRelativePath: string) {\n return isMetadataRouteFile(appDirRelativePath, [], true)\n}\n\n// Pre-compiled static regexes for common cases\nconst FAVICON_REGEX = /^[\\\\/]favicon\\.ico$/\nconst ROBOTS_TXT_REGEX = /^[\\\\/]robots\\.txt$/\nconst MANIFEST_JSON_REGEX = /^[\\\\/]manifest\\.json$/\nconst MANIFEST_WEBMANIFEST_REGEX = /^[\\\\/]manifest\\.webmanifest$/\nconst SITEMAP_XML_REGEX = /[\\\\/]sitemap\\.xml$/\n\n// Cache for compiled regex patterns based on parameters\nconst compiledRegexCache = new Map<string, RegExp[]>()\n\n// Fast path checks for common metadata files\nfunction fastPathCheck(normalizedPath: string): boolean | null {\n // Check favicon.ico first (most common)\n if (FAVICON_REGEX.test(normalizedPath)) return true\n\n // Check other common static files\n if (ROBOTS_TXT_REGEX.test(normalizedPath)) return true\n if (MANIFEST_JSON_REGEX.test(normalizedPath)) return true\n if (MANIFEST_WEBMANIFEST_REGEX.test(normalizedPath)) return true\n if (SITEMAP_XML_REGEX.test(normalizedPath)) return true\n\n // Quick negative check - if it doesn't contain any metadata keywords, skip\n if (\n !normalizedPath.includes('robots') &&\n !normalizedPath.includes('manifest') &&\n !normalizedPath.includes('sitemap') &&\n !normalizedPath.includes('icon') &&\n !normalizedPath.includes('apple-icon') &&\n !normalizedPath.includes('opengraph-image') &&\n !normalizedPath.includes('twitter-image') &&\n !normalizedPath.includes('favicon')\n ) {\n return false\n }\n\n return null // Continue with full regex matching\n}\n\nfunction getCompiledRegexes(\n pageExtensions: PageExtensions,\n strictlyMatchExtensions: boolean\n): RegExp[] {\n // Create cache key\n const cacheKey = `${pageExtensions.join(',')}|${strictlyMatchExtensions}`\n\n const cached = compiledRegexCache.get(cacheKey)\n if (cached) {\n return cached\n }\n\n // Pre-compute common strings\n const trailingMatcher = strictlyMatchExtensions ? '$' : '?$'\n const variantsMatcher = '\\\\d?'\n const groupSuffix = strictlyMatchExtensions ? '' : '(-\\\\w{6})?'\n const suffixMatcher = variantsMatcher + groupSuffix\n\n // Pre-compute extension arrays to avoid repeated concatenation\n const robotsExts =\n pageExtensions.length > 0 ? [...pageExtensions, 'txt'] : ['txt']\n const manifestExts =\n pageExtensions.length > 0\n ? [...pageExtensions, 'webmanifest', 'json']\n : ['webmanifest', 'json']\n\n const regexes = [\n new RegExp(\n `^[\\\\\\\\/]robots${getExtensionRegexString(robotsExts, null)}${trailingMatcher}`\n ),\n new RegExp(\n `^[\\\\\\\\/]manifest${getExtensionRegexString(manifestExts, null)}${trailingMatcher}`\n ),\n // FAVICON_REGEX removed - already handled in fastPathCheck\n new RegExp(\n `[\\\\\\\\/]sitemap${getExtensionRegexString(['xml'], pageExtensions)}${trailingMatcher}`\n ),\n new RegExp(\n `[\\\\\\\\/]icon${suffixMatcher}${getExtensionRegexString(\n STATIC_METADATA_IMAGES.icon.extensions,\n pageExtensions\n )}${trailingMatcher}`\n ),\n new RegExp(\n `[\\\\\\\\/]apple-icon${suffixMatcher}${getExtensionRegexString(\n STATIC_METADATA_IMAGES.apple.extensions,\n pageExtensions\n )}${trailingMatcher}`\n ),\n new RegExp(\n `[\\\\\\\\/]opengraph-image${suffixMatcher}${getExtensionRegexString(\n STATIC_METADATA_IMAGES.openGraph.extensions,\n pageExtensions\n )}${trailingMatcher}`\n ),\n new RegExp(\n `[\\\\\\\\/]twitter-image${suffixMatcher}${getExtensionRegexString(\n STATIC_METADATA_IMAGES.twitter.extensions,\n pageExtensions\n )}${trailingMatcher}`\n ),\n ]\n\n compiledRegexCache.set(cacheKey, regexes)\n return regexes\n}\n\n/**\n * Determine if the file is a metadata route file entry\n * @param appDirRelativePath the relative file path to app/\n * @param pageExtensions the js extensions, such as ['js', 'jsx', 'ts', 'tsx']\n * @param strictlyMatchExtensions if it's true, match the file with page extension, otherwise match the file with default corresponding extension\n * @returns if the file is a metadata route file\n */\nexport function isMetadataRouteFile(\n appDirRelativePath: string,\n pageExtensions: PageExtensions,\n strictlyMatchExtensions: boolean\n): boolean {\n // Early exit for empty or obviously non-metadata paths\n if (!appDirRelativePath || appDirRelativePath.length < 2) {\n return false\n }\n\n const normalizedPath = normalizePathSep(appDirRelativePath)\n\n // Fast path check for common cases\n const fastResult = fastPathCheck(normalizedPath)\n if (fastResult !== null) {\n return fastResult\n }\n\n // Get compiled regexes from cache\n const regexes = getCompiledRegexes(pageExtensions, strictlyMatchExtensions)\n\n // Use for loop instead of .some() for better performance\n for (let i = 0; i < regexes.length; i++) {\n if (regexes[i].test(normalizedPath)) {\n return true\n }\n }\n\n return false\n}\n\n// Check if the route is a static metadata route, with /route suffix\n// e.g. /favicon.ico/route, /icon.png/route, etc.\n// But skip the text routes like robots.txt since they might also be dynamic.\n// Checking route path is not enough to determine if text routes is dynamic.\nexport function isStaticMetadataRoute(route: string) {\n // extract ext with regex\n const pathname = route.replace(/\\/route$/, '')\n\n const matched =\n isAppRouteRoute(route) &&\n isMetadataRouteFile(pathname, [], true) &&\n // These routes can either be built by static or dynamic entrypoints,\n // so we assume they're dynamic\n pathname !== '/robots.txt' &&\n pathname !== '/manifest.webmanifest' &&\n !pathname.endsWith('/sitemap.xml')\n\n return matched\n}\n\n/**\n * Determine if a page or pathname is a metadata page.\n *\n * The input is a page or pathname, which can be with or without page suffix /foo/page or /foo.\n * But it will not contain the /route suffix.\n *\n * .e.g\n * /robots -> true\n * /sitemap -> true\n * /foo -> false\n */\nexport function isMetadataPage(page: string) {\n const matched = !isAppRouteRoute(page) && isMetadataRouteFile(page, [], false)\n\n return matched\n}\n\n/*\n * Determine if a Next.js route is a metadata route.\n * `route` will has a route suffix.\n *\n * e.g.\n * /app/robots/route -> true\n * /robots/route -> true\n * /sitemap/[__metadata_id__]/route -> true\n * /app/sitemap/page -> false\n * /icon-a102f4/route -> true\n */\nexport function isMetadataRoute(route: string): boolean {\n let page = normalizeAppPath(route)\n .replace(/^\\/?app\\//, '')\n // Remove the dynamic route id\n .replace('/[__metadata_id__]', '')\n // Remove the /route suffix\n .replace(/\\/route$/, '')\n\n if (page[0] !== '/') page = '/' + page\n\n const matched = isAppRouteRoute(route) && isMetadataRouteFile(page, [], false)\n\n return matched\n}\n"],"names":["DEFAULT_METADATA_ROUTE_EXTENSIONS","STATIC_METADATA_IMAGES","getExtensionRegexString","isMetadataPage","isMetadataRoute","isMetadataRouteFile","isStaticMetadataFile","isStaticMetadataRoute","icon","filename","extensions","apple","favicon","openGraph","twitter","staticExtensions","dynamicExtensions","result","length","join","appDirRelativePath","FAVICON_REGEX","ROBOTS_TXT_REGEX","MANIFEST_JSON_REGEX","MANIFEST_WEBMANIFEST_REGEX","SITEMAP_XML_REGEX","compiledRegexCache","Map","fastPathCheck","normalizedPath","test","includes","getCompiledRegexes","pageExtensions","strictlyMatchExtensions","cacheKey","cached","get","trailingMatcher","variantsMatcher","groupSuffix","suffixMatcher","robotsExts","manifestExts","regexes","RegExp","set","normalizePathSep","fastResult","i","route","pathname","replace","matched","isAppRouteRoute","endsWith","page","normalizeAppPath"],"mappings":";;;;;;;;;;;;;;;;;;;;;IA8BaA,iCAAiC;eAAjCA;;IAzBAC,sBAAsB;eAAtBA;;IA8BAC,uBAAuB;eAAvBA;;IAqMGC,cAAc;eAAdA;;IAiBAC,eAAe;eAAfA;;IA/EAC,mBAAmB;eAAnBA;;IApHAC,oBAAoB;eAApBA;;IAuJAC,qBAAqB;eAArBA;;;kCA5MiB;0BACA;iCACD;AAEzB,MAAMN,yBAAyB;IACpCO,MAAM;QACJC,UAAU;QACVC,YAAY;YAAC;YA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