From e0bc765d2658f10652cad2c195a8affd07a6b44d Mon Sep 17 00:00:00 2001 From: PeterShershov Date: Wed, 25 Dec 2024 15:30:39 +0200 Subject: [PATCH 1/2] fix(define-remix-app): support windows path separator on page creation --- packages/define-remix-app/src/remix-app-utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/define-remix-app/src/remix-app-utils.ts b/packages/define-remix-app/src/remix-app-utils.ts index 88c1a11b..8e4eb910 100644 --- a/packages/define-remix-app/src/remix-app-utils.ts +++ b/packages/define-remix-app/src/remix-app-utils.ts @@ -75,7 +75,7 @@ export function readableUriToFilePath( routeDir: string, routingPattern: RoutingPattern, ): string { - const pageFileName = readableUri.replace(/\//g, '.'); + const pageFileName = readableUri.replace(/[/\\]/g, '.'); return routingPattern === 'folder(route)' ? path.join(routeDir, pageFileName, 'route.tsx') From db3a14c2c7243df91b28ed72f7c8b8e957690080 Mon Sep 17 00:00:00 2001 From: PeterShershov Date: Wed, 25 Dec 2024 15:34:54 +0200 Subject: [PATCH 2/2] remove windows slashes from invalid characters. --- packages/define-remix-app/test/define-remix.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/define-remix-app/test/define-remix.spec.ts b/packages/define-remix-app/test/define-remix.spec.ts index cfb29161..17a682c9 100644 --- a/packages/define-remix-app/test/define-remix.spec.ts +++ b/packages/define-remix-app/test/define-remix.spec.ts @@ -1062,7 +1062,7 @@ describe('define-remix', () => { const { driver } = await getInitialManifest({ [indexPath]: simpleLayout, }); - const invalidFsChars = ['\\', ':', '*', '?', '"', "'", '`', '<', '>', '|']; + const invalidFsChars = [':', '*', '?', '"', "'", '`', '<', '>', '|']; for (const invalidChar of invalidFsChars) { const { isValid, errorMessage, pageModule, newPageRoute, newPageSourceCode } = driver.getNewPageInfo('about/$param/invalid-' + invalidChar);