@sentry/remix
Version:
Official Sentry SDK for Remix
46 lines • 1.94 kB
TypeScript
import type { RouteManifest } from './remixRouteManifest';
export type CreateRemixRouteManifestOptions = {
/**
* Path to the app directory (where routes folder is located)
*/
appDirPath?: string;
/**
* The root directory of the project (defaults to process.cwd())
*/
rootDir?: string;
};
/**
* Convert Remix route file paths to parameterized paths at build time.
*
* Examples:
* - index.tsx -> /
* - users.tsx -> /users
* - users.$id.tsx -> /users/:id
* - users.$id.posts.$postId.tsx -> /users/:id/posts/:postId
* - $.tsx -> /:*
* - docs.$.tsx -> /docs/:*
* - users/$id.tsx (nested folder) -> /users/:id
* - users/$id/posts.tsx (nested folder) -> /users/:id/posts
* - users/index.tsx (nested folder) -> /users
* - _layout.tsx -> null (pathless layout route, not URL-addressable)
* - _auth.tsx -> null (pathless layout route, not URL-addressable)
*
* @param filename - The route filename or path (can include directory separators for nested routes)
* @returns Object containing the parameterized path and whether it's dynamic, or null for pathless layout routes
* @internal Exported for testing purposes
*/
export declare function convertRemixRouteToPath(filename: string): {
path: string;
isDynamic: boolean;
} | null;
/**
* Scans Remix routes directory and generates a manifest containing all static
* and dynamic routes with their regex patterns for client-side route parameterization.
*
* @param options - Configuration options
* @param options.appDirPath - Path to the app directory (where routes folder is located)
* @param options.rootDir - The root directory of the project (defaults to process.cwd())
* @returns A RouteManifest containing arrays of dynamic and static routes
*/
export declare function createRemixRouteManifest(options?: CreateRemixRouteManifestOptions): RouteManifest;
//# sourceMappingURL=createRemixRouteManifest.d.ts.map