From 0f691cca018a73f5cad911319c4f896dc75b10a5 Mon Sep 17 00:00:00 2001 From: Janeene Beeforth Date: Thu, 4 Jan 2024 13:47:50 +1100 Subject: [PATCH] Add 'root' id to RouteIds As it was being missed --- .../remix-routes/src/__tests__/__snapshots__/cli.test.ts.snap | 3 +++ packages/remix-routes/src/cli.ts | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/remix-routes/src/__tests__/__snapshots__/cli.test.ts.snap b/packages/remix-routes/src/__tests__/__snapshots__/cli.test.ts.snap index d57b2ce3..8cea493a 100644 --- a/packages/remix-routes/src/__tests__/__snapshots__/cli.test.ts.snap +++ b/packages/remix-routes/src/__tests__/__snapshots__/cli.test.ts.snap @@ -214,6 +214,7 @@ exports[`build customPaths routes 1`] = ` >; export type RouteId = + | 'root' | 'routes/($lang).about' | 'routes/admin' | 'routes/admin._index' @@ -469,6 +470,7 @@ exports[`build v1 routes 1`] = ` >; export type RouteId = + | 'root' | 'routes/($lang)/about' | 'routes/admin' | 'routes/admin/episodes/$id' @@ -732,6 +734,7 @@ exports[`build v2 routes 1`] = ` >; export type RouteId = + | 'root' | 'routes/($lang).about' | 'routes/admin' | 'routes/admin._index' diff --git a/packages/remix-routes/src/cli.ts b/packages/remix-routes/src/cli.ts index 45227c4c..1ab5d0af 100644 --- a/packages/remix-routes/src/cli.ts +++ b/packages/remix-routes/src/cli.ts @@ -69,6 +69,7 @@ async function buildHelpers(config: RemixConfig): Promise<[RoutesInfo, string[]] ); routes.forEach((route) => { let currentPath = parentPath; + routeIds.push(route.id); if (route.id === 'root') { routesInfo['/'] = { fileName: route.file, @@ -85,7 +86,6 @@ async function buildHelpers(config: RemixConfig): Promise<[RoutesInfo, string[]] fileName: route.file, params: paramsNames }; - routeIds.push(route.id); } handleRoutesRecursive(route.id, currentPath); });