Add windowsPathsNoEscape to glob calls that may receive backslash paths
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) <noreply@anthropic.com> Signed-off-by: Fredrik Adelöw <freben@spotify.com>
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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());
|
||||
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user