Skip to content

Commit f65c44c

Browse files
Merge pull request #31229 from storybookjs/chore/framework-gen-helper-fscheck
Core: Check that frameworks do exist when generating the frameworks.t…
2 parents ec2b027 + e991519 commit f65c44c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

code/core/scripts/helpers/sourcefiles.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { existsSync } from 'node:fs';
12
import { readdir, writeFile } from 'node:fs/promises';
23
import { join } from 'node:path';
34

@@ -61,7 +62,9 @@ async function generateFrameworksFile(prettierConfig: prettier.Options | null):
6162
const location = join(__dirname, '..', '..', 'src', 'types', 'modules', 'frameworks.ts');
6263
const frameworksDirectory = join(__dirname, '..', '..', '..', 'frameworks');
6364

64-
const readFrameworks = await readdir(frameworksDirectory);
65+
const readFrameworks = (await readdir(frameworksDirectory)).filter((framework) =>
66+
existsSync(join(frameworksDirectory, framework, 'project.json'))
67+
);
6568
const frameworks = [...readFrameworks.sort(), ...thirdPartyFrameworks]
6669
.map((framework) => `'${framework}'`)
6770
.join(' | ');

0 commit comments

Comments
 (0)