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>
1 line
No EOL
3.6 KiB
Text
1 line
No EOL
3.6 KiB
Text
{"version":3,"sources":["../../../../src/server/lib/router-utils/build-prefetch-segment-data-route.ts"],"sourcesContent":["import path from '../../../shared/lib/isomorphic/path'\nimport { normalizePagePath } from '../../../shared/lib/page-path/normalize-page-path'\nimport { getNamedRouteRegex } from '../../../shared/lib/router/utils/route-regex'\nimport {\n RSC_PREFETCH_SUFFIX,\n RSC_SEGMENT_SUFFIX,\n RSC_SEGMENTS_DIR_SUFFIX,\n} from '../../../lib/constants'\n\nexport const SEGMENT_PATH_KEY = 'nextSegmentPath'\n\nexport type PrefetchSegmentDataRoute = {\n source: string\n destination: string\n routeKeys: { [key: string]: string }\n}\n\nexport function buildPrefetchSegmentDataRoute(\n page: string,\n segmentPath: string\n): PrefetchSegmentDataRoute {\n const pagePath = normalizePagePath(page)\n\n const destination = path.posix.join(\n `${pagePath}${RSC_SEGMENTS_DIR_SUFFIX}`,\n `${segmentPath}${RSC_SEGMENT_SUFFIX}`\n )\n\n const { namedRegex, routeKeys } = getNamedRouteRegex(destination, {\n prefixRouteKeys: true,\n includePrefix: true,\n includeSuffix: true,\n excludeOptionalTrailingSlash: true,\n backreferenceDuplicateKeys: true,\n })\n\n return {\n destination,\n source: namedRegex,\n routeKeys,\n }\n}\n\n/**\n * Builds a prefetch segment data route that is inverted. This means that it's\n * supposed to rewrite from the previous segment paths route back to the\n * prefetch RSC route.\n *\n * @param page - The page to build the route for.\n * @param segmentPath - The segment path to build the route for.\n * @returns The prefetch segment data route.\n */\nexport function buildInversePrefetchSegmentDataRoute(\n page: string,\n segmentPath: string\n): PrefetchSegmentDataRoute {\n const pagePath = normalizePagePath(page)\n\n const source = path.posix.join(\n `${pagePath}${RSC_SEGMENTS_DIR_SUFFIX}`,\n `${segmentPath}${RSC_SEGMENT_SUFFIX}`\n )\n\n const { namedRegex, routeKeys } = getNamedRouteRegex(source, {\n prefixRouteKeys: true,\n includePrefix: true,\n includeSuffix: true,\n excludeOptionalTrailingSlash: true,\n backreferenceDuplicateKeys: true,\n })\n\n const destination = path.posix.join(`${pagePath}${RSC_PREFETCH_SUFFIX}`)\n\n return {\n source: namedRegex,\n destination,\n routeKeys,\n }\n}\n"],"names":["SEGMENT_PATH_KEY","buildInversePrefetchSegmentDataRoute","buildPrefetchSegmentDataRoute","page","segmentPath","pagePath","normalizePagePath","destination","path","posix","join","RSC_SEGMENTS_DIR_SUFFIX","RSC_SEGMENT_SUFFIX","namedRegex","routeKeys","getNamedRouteRegex","prefixRouteKeys","includePrefix","includeSuffix","excludeOptionalTrailingSlash","backreferenceDuplicateKeys","source","RSC_PREFETCH_SUFFIX"],"mappings":";;;;;;;;;;;;;;;;IASaA,gBAAgB;eAAhBA;;IA2CGC,oCAAoC;eAApCA;;IAnCAC,6BAA6B;eAA7BA;;;6DAjBC;mCACiB;4BACC;2BAK5B;;;;;;AAEA,MAAMF,mBAAmB;AAQzB,SAASE,8BACdC,IAAY,EACZC,WAAmB;IAEnB,MAAMC,WAAWC,IAAAA,oCAAiB,EAACH;IAEnC,MAAMI,cAAcC,aAAI,CAACC,KAAK,CAACC,IAAI,CACjC,GAAGL,WAAWM,kCAAuB,EAAE,EACvC,GAAGP,cAAcQ,6BAAkB,EAAE;IAGvC,MAAM,EAAEC,UAAU,EAAEC,SAAS,EAAE,GAAGC,IAAAA,8BAAkB,EAACR,aAAa;QAChES,iBAAiB;QACjBC,eAAe;QACfC,eAAe;QACfC,8BAA8B;QAC9BC,4BAA4B;IAC9B;IAEA,OAAO;QACLb;QACAc,QAAQR;QACRC;IACF;AACF;AAWO,SAASb,qCACdE,IAAY,EACZC,WAAmB;IAEnB,MAAMC,WAAWC,IAAAA,oCAAiB,EAACH;IAEnC,MAAMkB,SAASb,aAAI,CAACC,KAAK,CAACC,IAAI,CAC5B,GAAGL,WAAWM,kCAAuB,EAAE,EACvC,GAAGP,cAAcQ,6BAAkB,EAAE;IAGvC,MAAM,EAAEC,UAAU,EAAEC,SAAS,EAAE,GAAGC,IAAAA,8BAAkB,EAACM,QAAQ;QAC3DL,iBAAiB;QACjBC,eAAe;QACfC,eAAe;QACfC,8BAA8B;QAC9BC,4BAA4B;IAC9B;IAEA,MAAMb,cAAcC,aAAI,CAACC,KAAK,CAACC,IAAI,CAAC,GAAGL,WAAWiB,8BAAmB,EAAE;IAEvE,OAAO;QACLD,QAAQR;QACRN;QACAO;IACF;AACF","ignoreList":[0]} |