mirror of
https://github.com/storybookjs/storybook.git
synced 2025-03-21 05:02:39 +08:00
fix: correctly detect JS projects with type checking
This commit is contained in:
parent
293d52cbb8
commit
3adfd73c95
@ -1,4 +1,3 @@
|
||||
import path from 'path';
|
||||
import fs from 'fs';
|
||||
import findUp from 'find-up';
|
||||
import semver from 'semver';
|
||||
@ -85,7 +84,7 @@ const getFrameworkPreset = (
|
||||
}
|
||||
|
||||
if (Array.isArray(files) && files.length > 0) {
|
||||
matcher.files = files.map((name) => fs.existsSync(path.join(process.cwd(), name)));
|
||||
matcher.files = files.map((name) => fs.existsSync(name));
|
||||
}
|
||||
|
||||
return matcherFunction(matcher) ? preset : null;
|
||||
@ -151,7 +150,7 @@ export function isStorybookInstalled(
|
||||
export function detectLanguage(packageJson?: PackageJson) {
|
||||
let language = SupportedLanguage.JAVASCRIPT;
|
||||
|
||||
if (!packageJson) {
|
||||
if (!packageJson || fs.existsSync('jsconfig.json')) {
|
||||
return language;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user