Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
pcattori committed Feb 20, 2024
1 parent 12bb20f commit 4df8b3d
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 6 deletions.
10 changes: 5 additions & 5 deletions integration/helpers/create-fixture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -376,11 +376,11 @@ function build(
});

// These logs are helpful for debugging. Remove comments if needed.
// console.log("spawning node " + buildArgs.join(" ") + ":\n");
// console.log(" STDOUT:");
// console.log(" " + buildSpawn.stdout.toString("utf-8"));
// console.log(" STDERR:");
// console.log(" " + buildSpawn.stderr.toString("utf-8"));
console.log("spawning node " + buildArgs.join(" ") + ":\n");
console.log(" STDOUT:");
console.log(" " + buildSpawn.stdout.toString("utf-8"));
console.log(" STDERR:");
console.log(" " + buildSpawn.stderr.toString("utf-8"));

if (buildStdio) {
buildStdio.write(buildSpawn.stdout.toString("utf-8"));
Expand Down
21 changes: 20 additions & 1 deletion packages/remix-dev/config/flat-routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export function flatRoutes(

let routes: string[] = [];
for (let entry of entries) {
let filepath = path.join(routesDir, entry.name);
let filepath = normalizeSlashes(path.join(routesDir, entry.name));

let route: string | null = null;
// If it's a directory, don't recurse into it, instead just look for a route module
Expand All @@ -117,6 +117,7 @@ export function flatRoutes(
} else if (entry.isFile()) {
route = findRouteModuleForFile(appDirectory, filepath, ignoredFileRegex);
}
console.log({ filepath, route });

if (route) routes.push(route);
}
Expand Down Expand Up @@ -150,6 +151,15 @@ export function flatRoutesUniversal(
.relative(normalizedApp, normalizedFile)
.slice(0, -routeExt.length)
: path.posix.relative(normalizedApp, routeDir);
console.log({
type: "routeId",
routeId,
normalizedApp,
prefix,
normalizedFile,
routeExt,
routeDir,
});

let conflict = routeIds.get(routeId);
if (conflict) {
Expand Down Expand Up @@ -183,6 +193,7 @@ export function flatRoutesUniversal(
let childRouteIds = prefixLookup.findAndRemove(routeId, (value) => {
return [".", "/"].includes(value.slice(routeId.length).charAt(0));
});
console.log("add:", routeId);
prefixLookup.add(routeId);

if (childRouteIds.length > 0) {
Expand Down Expand Up @@ -304,6 +315,14 @@ function findRouteModuleForFile(
): string | null {
let relativePath = path.relative(appDirectory, filepath);
let isIgnored = ignoredFileRegex.some((regex) => regex.test(relativePath));
console.log({
type: "find",
filepath,
isIgnored,
isIgnored2: ignoredFileRegex.some((rg) =>
rg.test(normalizeSlashes(relativePath.replace("/", "\\")))
),
});
if (isIgnored) return null;
return filepath;
}
Expand Down
1 change: 1 addition & 0 deletions packages/remix-dev/vite/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1441,6 +1441,7 @@ export const remixVitePlugin: RemixVitePlugin = (remixUserConfig = {}) => {
async transform(code, id, options) {
if (options?.ssr) return;

// change to trigger windows ci 1
let route = getRoute(ctx.remixConfig, id);
if (!route) return;

Expand Down

0 comments on commit 4df8b3d

Please sign in to comment.