diff --git a/.github/workflows/perf.yml b/.github/workflows/perf.yml index 037bb032e0..5d17b85037 100644 --- a/.github/workflows/perf.yml +++ b/.github/workflows/perf.yml @@ -198,7 +198,7 @@ jobs: done - name: Setup Vite+ - uses: voidzero-dev/setup-vp@250f29ce396baf5e8f24498e17c0dfdebabc26eb # v1 + uses: voidzero-dev/setup-vp@35171c92dd08b67d5a9d3f2a4327800e58396f2a # v1 with: node-version: "24" cache: true diff --git a/packages/vinext/src/routing/app-route-graph.ts b/packages/vinext/src/routing/app-route-graph.ts index 5e3961554e..4684ee7a1b 100644 --- a/packages/vinext/src/routing/app-route-graph.ts +++ b/packages/vinext/src/routing/app-route-graph.ts @@ -1197,7 +1197,7 @@ function discoverSlotSubRoutes( const subPages = findSlotSubPages(slotDir, matcher); for (const { relativePath, pagePath } of subPages) { - const subSegments = relativePath.split(path.sep); + const subSegments = relativePath.split("/"); const convertedSubRoute = convertSegmentsToRouteParts(subSegments); if (!convertedSubRoute) continue; @@ -1485,7 +1485,7 @@ function findSlotSubPages(slotDir: string, matcher: ValidFileMatcher): SlotSubPa const subDir = path.join(dir, entry.name); const page = findFile(subDir, "page", matcher); if (page) { - const relativePath = path.relative(slotDir, subDir); + const relativePath = normalizePathSeparators(path.relative(slotDir, subDir)); results.push({ relativePath, pagePath: page }); } // Continue scanning deeper for nested sub-pages @@ -1520,8 +1520,8 @@ function findSlotConfigLayoutTreePositions( layoutPaths: readonly string[], ): number[] { return layoutPaths.map((layoutPath) => { - const relativeDir = path.relative(slotDir, path.dirname(layoutPath)); - return relativeDir ? relativeDir.split(path.sep).filter(Boolean).length : 0; + const relativeDir = normalizePathSeparators(path.relative(slotDir, path.dirname(layoutPath))); + return relativeDir ? relativeDir.split("/").filter(Boolean).length : 0; }); } @@ -1796,9 +1796,9 @@ function computeLayoutTreePositions(appDir: string, layouts: string[]): number[] const layoutDir = path.dirname(layoutPath); // path.relative tolerates mixed separators and win32 case differences, // so an empty result is the separator-agnostic "layout at app root" test. - const relative = path.relative(appDir, layoutDir); + const relative = normalizePathSeparators(path.relative(appDir, layoutDir)); if (relative === "") return 0; - return relative.split(path.sep).length; + return relative.split("/").length; }); } @@ -2130,7 +2130,7 @@ function findMirroredSlotPage( }; let best: Candidate | null = null; for (const { relativePath, pagePath } of findSlotSubPages(slotDir, matcher)) { - const slotSegments = relativePath.split(path.sep); + const slotSegments = relativePath.split("/"); const slotUrl = convertSegmentsToRouteParts(slotSegments); if (!slotUrl) continue; if (!patternsCompatible(slotUrl.urlSegments, routeUrl.urlSegments)) continue;