From b6c0ef5d5da814359f91d487d41978e0537256fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Tue, 31 Mar 2026 15:20:56 +0200 Subject: [PATCH] Add windowsPathsNoEscape to glob calls that may receive backslash paths MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Glob v13 treats backslashes as escape characters by default, unlike v7 which treated them as path separators on Windows. This broke Windows CI where path.join/resolve produce backslash paths. Co-Authored-By: Claude Opus 4.6 (1M context) Signed-off-by: Fredrik Adelöw --- .../src/commands/package/start/startPackage.ts | 5 ++++- packages/cli-module-test-jest/config/jest.js | 4 +++- packages/repo-tools/src/commands/package-docs/command.ts | 1 + .../catalog-backend/src/processors/FileReaderProcessor.ts | 4 +++- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/packages/cli-module-build/src/commands/package/start/startPackage.ts b/packages/cli-module-build/src/commands/package/start/startPackage.ts index e0ab13facc..628034a6d8 100644 --- a/packages/cli-module-build/src/commands/package/start/startPackage.ts +++ b/packages/cli-module-build/src/commands/package/start/startPackage.ts @@ -25,7 +25,10 @@ export function resolveEntryPath( targetDir: string, ): string { const { dir: entryDir, name: entryName } = parse(entrypoint); - const [entryFile] = glob.sync(`${resolve(targetDir, entryDir, entryName)}.*`); + const [entryFile] = glob.sync( + `${resolve(targetDir, entryDir, entryName)}.*`, + { windowsPathsNoEscape: true }, + ); if (entryFile) { return join(entryDir, entryName); } diff --git a/packages/cli-module-test-jest/config/jest.js b/packages/cli-module-test-jest/config/jest.js index 52ccf989c4..7697fbb6d7 100644 --- a/packages/cli-module-test-jest/config/jest.js +++ b/packages/cli-module-test-jest/config/jest.js @@ -367,7 +367,9 @@ async function getRootConfig() { // workspace and load those in as separate jest projects instead. const projectPaths = await Promise.all( workspacePatterns.map(pattern => - glob(path.join(paths.targetRoot, pattern)), + glob(path.join(paths.targetRoot, pattern), { + windowsPathsNoEscape: true, + }), ), ).then(_ => _.flat()); diff --git a/packages/repo-tools/src/commands/package-docs/command.ts b/packages/repo-tools/src/commands/package-docs/command.ts index 3e635b34f4..777f0f5883 100644 --- a/packages/repo-tools/src/commands/package-docs/command.ts +++ b/packages/repo-tools/src/commands/package-docs/command.ts @@ -119,6 +119,7 @@ export default async function packageDocs(paths: string[] = [], opts: any) { const existingDocsJsonPaths = glob.sync( targetPaths.resolveRoot('dist-types/**/docs.json'), + { windowsPathsNoEscape: true }, ); if (existingDocsJsonPaths.length > 0) { console.warn( diff --git a/plugins/catalog-backend/src/processors/FileReaderProcessor.ts b/plugins/catalog-backend/src/processors/FileReaderProcessor.ts index 12648aa96d..5658b8e0d0 100644 --- a/plugins/catalog-backend/src/processors/FileReaderProcessor.ts +++ b/plugins/catalog-backend/src/processors/FileReaderProcessor.ts @@ -44,7 +44,9 @@ export class FileReaderProcessor implements CatalogProcessor { } try { - const fileMatches = await glob(location.target); + const fileMatches = await glob(location.target, { + windowsPathsNoEscape: true, + }); if (fileMatches.length > 0) { for (const fileMatch of fileMatches) {