mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-04 15:11:10 +08:00
CLI (React Native): ensure having an explicit dependency on prop-types
This commit is contained in:
parent
70d8829e5d
commit
cfc8bf070a
@ -9,7 +9,8 @@ module.exports = Promise.all([
|
||||
latestVersion('@storybook/react'),
|
||||
latestVersion('@storybook/addon-actions'),
|
||||
latestVersion('@storybook/addon-links'),
|
||||
]).then(([storybookVersion, actionsVersion, linksVersion]) => {
|
||||
latestVersion('prop-types'),
|
||||
]).then(([storybookVersion, actionsVersion, linksVersion, propTypesVersion]) => {
|
||||
// copy all files from the template directory to project directory
|
||||
mergeDirs(path.resolve(__dirname, 'template/'), '.', 'overwrite');
|
||||
|
||||
@ -41,6 +42,10 @@ module.exports = Promise.all([
|
||||
packageJson.devDependencies['react-dom'] = reactVersion;
|
||||
}
|
||||
|
||||
if (!packageJson.dependencies['prop-types'] && !packageJson.devDependencies['prop-types']) {
|
||||
packageJson.devDependencies['prop-types'] = `^${propTypesVersion}`;
|
||||
}
|
||||
|
||||
packageJson.scripts = packageJson.scripts || {};
|
||||
packageJson.scripts.storybook = 'storybook start -p 7007';
|
||||
|
||||
|
@ -7,7 +7,8 @@ module.exports = Promise.all([
|
||||
latestVersion('@storybook/react'),
|
||||
latestVersion('@storybook/addon-actions'),
|
||||
latestVersion('@storybook/addon-links'),
|
||||
]).then(([storybookVersion, actionsVersion, linksVersion]) => {
|
||||
latestVersion('prop-types'),
|
||||
]).then(([storybookVersion, actionsVersion, linksVersion, propTypesVersion]) => {
|
||||
// copy all files from the template directory to project directory
|
||||
mergeDirs(path.resolve(__dirname, 'template/'), '.', 'overwrite');
|
||||
|
||||
@ -25,6 +26,10 @@ module.exports = Promise.all([
|
||||
packageJson.devDependencies['react-dom'] = reactVersion;
|
||||
}
|
||||
|
||||
if (!packageJson.dependencies['prop-types'] && !packageJson.devDependencies['prop-types']) {
|
||||
packageJson.devDependencies['prop-types'] = `^${propTypesVersion}`;
|
||||
}
|
||||
|
||||
packageJson.scripts = packageJson.scripts || {};
|
||||
packageJson.scripts.storybook = 'storybook start -p 7007';
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user