Fix Create React (Native) App detection

This commit is contained in:
hypnos 2017-08-12 16:18:50 +03:00
parent 26d3a4228e
commit 07471781c7
2 changed files with 9 additions and 2 deletions

View File

@ -9,6 +9,7 @@ module.exports = latestVersion('@storybook/react').then(version => {
const packageJson = helpers.getPackageJson();
packageJson.devDependencies = packageJson.devDependencies || {};
packageJson.devDependencies['@storybook/react'] = `^${version}`;
packageJson.scripts.storybook = 'start-storybook -p 9009';
packageJson.scripts['build-storybook'] = 'build-storybook';

View File

@ -44,7 +44,10 @@ module.exports = function detect(options) {
return types.VUE;
}
if (packageJson.devDependencies && packageJson.devDependencies['react-scripts']) {
if (
(packageJson.dependencies && packageJson.dependencies['react-scripts']) ||
(packageJson.devDependencies && packageJson.devDependencies['react-scripts'])
) {
return types.REACT_SCRIPTS;
}
@ -56,7 +59,10 @@ module.exports = function detect(options) {
return types.REACT_PROJECT;
}
if (packageJson.devDependencies && packageJson.devDependencies['react-native-scripts']) {
if (
(packageJson.dependencies && packageJson.dependencies['react-native-scripts']) ||
(packageJson.devDependencies && packageJson.devDependencies['react-native-scripts'])
) {
return types.REACT_NATIVE_SCRIPTS;
}