Skip to content

Commit

Permalink
Add 'root' id to RouteIds
Browse files Browse the repository at this point in the history
As it was being missed
  • Loading branch information
dawnmist committed Jan 4, 2024
1 parent f414b95 commit 0f691cc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ exports[`build customPaths routes 1`] = `
>;
export type RouteId =
| 'root'
| 'routes/($lang).about'
| 'routes/admin'
| 'routes/admin._index'
Expand Down Expand Up @@ -469,6 +470,7 @@ exports[`build v1 routes 1`] = `
>;
export type RouteId =
| 'root'
| 'routes/($lang)/about'
| 'routes/admin'
| 'routes/admin/episodes/$id'
Expand Down Expand Up @@ -732,6 +734,7 @@ exports[`build v2 routes 1`] = `
>;
export type RouteId =
| 'root'
| 'routes/($lang).about'
| 'routes/admin'
| 'routes/admin._index'
Expand Down
2 changes: 1 addition & 1 deletion packages/remix-routes/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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);
});
Expand Down

0 comments on commit 0f691cc

Please sign in to comment.