From d98afd0e104dcf722c13805c3fed8a8ed138bc42 Mon Sep 17 00:00:00 2001 From: Logan McAnsh Date: Wed, 25 Jan 2023 20:33:32 -0500 Subject: [PATCH 1/3] fix(remix-dev): fast glob will return posix style paths even on windows Signed-off-by: Logan McAnsh --- packages/remix-dev/config/flat-routes.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/remix-dev/config/flat-routes.ts b/packages/remix-dev/config/flat-routes.ts index 924c2751e51..d3a4aab138f 100644 --- a/packages/remix-dev/config/flat-routes.ts +++ b/packages/remix-dev/config/flat-routes.ts @@ -25,7 +25,12 @@ export function flatRoutes( ignore: ignoredFilePatterns, }); - return flatRoutesUniversal(appDirectory, routePaths); + let routePathsForOS = routePaths.map((routePath) => { + if (path.sep === "/") return routePath; + return routePath.split("/").join(path.sep); + }); + + return flatRoutesUniversal(appDirectory, routePathsForOS); } interface RouteInfo extends ConfigRoute { From 521d7ccb99e4c446c341da4eb7e0ed8151eec81a Mon Sep 17 00:00:00 2001 From: Logan McAnsh Date: Wed, 25 Jan 2023 20:35:58 -0500 Subject: [PATCH 2/3] Create hip-cats-warn.md --- .changeset/hip-cats-warn.md | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .changeset/hip-cats-warn.md diff --git a/.changeset/hip-cats-warn.md b/.changeset/hip-cats-warn.md new file mode 100644 index 00000000000..e1717768d4d --- /dev/null +++ b/.changeset/hip-cats-warn.md @@ -0,0 +1,8 @@ +--- +"remix": patch +"@remix-run/dev": patch +--- + +fix flat routes on windows, so that it picks up new files and renames + +fast glob will return posix style paths even on windows From 2ba82f7311c896c83888805af461ebd35ef1caa3 Mon Sep 17 00:00:00 2001 From: Logan McAnsh Date: Wed, 25 Jan 2023 21:01:49 -0500 Subject: [PATCH 3/3] chore: this is a little nicer..? Signed-off-by: Logan McAnsh --- packages/remix-dev/config/flat-routes.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/remix-dev/config/flat-routes.ts b/packages/remix-dev/config/flat-routes.ts index d3a4aab138f..a2e76dd734c 100644 --- a/packages/remix-dev/config/flat-routes.ts +++ b/packages/remix-dev/config/flat-routes.ts @@ -25,9 +25,10 @@ export function flatRoutes( ignore: ignoredFilePatterns, }); + // fast-glob will return posix paths even on windows + // convert posix to os specific paths let routePathsForOS = routePaths.map((routePath) => { - if (path.sep === "/") return routePath; - return routePath.split("/").join(path.sep); + return path.join(...routePath.split(path.posix.sep)); }); return flatRoutesUniversal(appDirectory, routePathsForOS);