Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion code/lib/codemod/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { extname, join } from 'node:path';
import { resolvePackageDir } from 'storybook/internal/common';

import { sync as spawnSync } from 'cross-spawn';
import { normalize } from 'pathe';
import { glob as tinyglobby } from 'tinyglobby';

import { jscodeshiftToPrettierParser } from './lib/utils';
Expand Down Expand Up @@ -60,7 +61,8 @@ export async function runCodemod(
}
}

const files = await tinyglobby([glob, '!**/node_modules', '!**/dist']);
// Normalize the glob pattern to use forward slashes (required for glob patterns on Windows)
const files = await tinyglobby([normalize(glob), '!**/node_modules', '!**/dist']);
const extensions = new Set(files.map((file) => extname(file).slice(1)));
const commaSeparatedExtensions = Array.from(extensions).join(',');

Expand Down
Loading