Rocky_Mountain_Vending/.pnpm-store/v10/files/65/b5993887212251cc314d1a1f872553716d9c2e74850618afba7df40408021541adbff9327f34243a237cd5f8338a2c11c21ea2b50564f12ea3420508c08d73
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

48 lines
No EOL
2 KiB
Text

import path from '../../../shared/lib/isomorphic/path';
import { normalizePagePath } from '../../../shared/lib/page-path/normalize-page-path';
import { getNamedRouteRegex } from '../../../shared/lib/router/utils/route-regex';
import { RSC_PREFETCH_SUFFIX, RSC_SEGMENT_SUFFIX, RSC_SEGMENTS_DIR_SUFFIX } from '../../../lib/constants';
export const SEGMENT_PATH_KEY = 'nextSegmentPath';
export function buildPrefetchSegmentDataRoute(page, segmentPath) {
const pagePath = normalizePagePath(page);
const destination = path.posix.join(`${pagePath}${RSC_SEGMENTS_DIR_SUFFIX}`, `${segmentPath}${RSC_SEGMENT_SUFFIX}`);
const { namedRegex, routeKeys } = getNamedRouteRegex(destination, {
prefixRouteKeys: true,
includePrefix: true,
includeSuffix: true,
excludeOptionalTrailingSlash: true,
backreferenceDuplicateKeys: true
});
return {
destination,
source: namedRegex,
routeKeys
};
}
/**
* Builds a prefetch segment data route that is inverted. This means that it's
* supposed to rewrite from the previous segment paths route back to the
* prefetch RSC route.
*
* @param page - The page to build the route for.
* @param segmentPath - The segment path to build the route for.
* @returns The prefetch segment data route.
*/ export function buildInversePrefetchSegmentDataRoute(page, segmentPath) {
const pagePath = normalizePagePath(page);
const source = path.posix.join(`${pagePath}${RSC_SEGMENTS_DIR_SUFFIX}`, `${segmentPath}${RSC_SEGMENT_SUFFIX}`);
const { namedRegex, routeKeys } = getNamedRouteRegex(source, {
prefixRouteKeys: true,
includePrefix: true,
includeSuffix: true,
excludeOptionalTrailingSlash: true,
backreferenceDuplicateKeys: true
});
const destination = path.posix.join(`${pagePath}${RSC_PREFETCH_SUFFIX}`);
return {
source: namedRegex,
destination,
routeKeys
};
}
//# sourceMappingURL=build-prefetch-segment-data-route.js.map