CLI: Add explicit dependencies on used plugins

This commit is contained in:
hypnos 2017-08-13 23:03:59 +03:00
parent f552cac4aa
commit 1601322fdc
28 changed files with 34 additions and 22 deletions

View File

@ -62,6 +62,8 @@ module.exports = Promise.all([
// write the new package.json.
packageJson.devDependencies['@storybook/react'] = `^${storybookVersion}`;
packageJson.devDependencies['@storybook/addon-actions'] = `^${storybookVersion}`;
packageJson.devDependencies['@storybook/addon-links'] = `^${storybookVersion}`;
packageJson.scripts.storybook = 'start-storybook -p 6006';
packageJson.scripts['build-storybook'] = 'build-storybook';

View File

@ -1,4 +1,4 @@
/* eslint-disable import/no-extraneous-dependencies, import/no-unresolved, import/extensions */
/* eslint-disable import/extensions */
import React from 'react';

View File

@ -1,4 +1,4 @@
/* eslint-disable import/no-extraneous-dependencies, import/no-unresolved, import/extensions */
/* eslint-disable import/extensions */
import '@storybook/addon-actions/register';
import '@storybook/addon-links/register';

View File

@ -1,4 +1,4 @@
/* eslint-disable import/no-extraneous-dependencies, import/no-unresolved, import/extensions */
/* eslint-disable import/extensions */
import { configure } from '@storybook/react';

View File

@ -10,6 +10,8 @@ module.exports = latestVersion('@storybook/react').then(version => {
packageJson.devDependencies = packageJson.devDependencies || {};
packageJson.devDependencies['@storybook/react'] = `^${version}`;
packageJson.devDependencies['@storybook/addon-actions'] = `^${version}`;
packageJson.devDependencies['@storybook/addon-links'] = `^${version}`;
packageJson.scripts = packageJson.scripts || {};
packageJson.scripts.storybook = 'start-storybook -p 6006';

View File

@ -1,4 +1,4 @@
/* eslint-disable import/no-extraneous-dependencies, import/no-unresolved, import/extensions */
/* eslint-disable import/extensions */
import '@storybook/addon-actions/register';
import '@storybook/addon-links/register';

View File

@ -1,4 +1,4 @@
/* eslint-disable import/no-extraneous-dependencies, import/no-unresolved, import/extensions */
/* eslint-disable import/extensions */
import { configure } from '@storybook/react';

View File

@ -29,6 +29,8 @@ module.exports = latestVersion('@storybook/react-native').then(version => {
packageJson.devDependencies = packageJson.devDependencies || {};
packageJson.devDependencies['@storybook/react-native'] = `^${version}`;
packageJson.devDependencies['@storybook/addon-actions'] = `^${version}`;
packageJson.devDependencies['@storybook/addon-links'] = `^${version}`;
if (!packageJson.dependencies['react-dom'] && !packageJson.devDependencies['react-dom']) {
const reactVersion = packageJson.dependencies.react;

View File

@ -1,4 +1,4 @@
/* eslint-disable import/no-extraneous-dependencies, import/no-unresolved, import/extensions */
/* eslint-disable import/extensions */
import '@storybook/addon-actions/register';
import '@storybook/addon-links/register';

View File

@ -1,4 +1,4 @@
/* eslint-disable import/no-extraneous-dependencies, import/no-unresolved, import/extensions */
/* eslint-disable import/extensions */
import React, { PropTypes } from 'react';
import { TouchableNativeFeedback } from 'react-native';

View File

@ -1,4 +1,4 @@
/* eslint-disable import/no-extraneous-dependencies, import/no-unresolved, import/extensions */
/* eslint-disable import/extensions */
import React, { PropTypes } from 'react';
import { TouchableHighlight } from 'react-native';

View File

@ -1,4 +1,4 @@
/* eslint-disable import/no-extraneous-dependencies, import/no-unresolved, import/extensions */
/* eslint-disable import/extensions */
import React, { PropTypes } from 'react';
import { View } from 'react-native';

View File

@ -1,4 +1,4 @@
/* eslint-disable import/no-extraneous-dependencies, import/no-unresolved, import/extensions */
/* eslint-disable import/extensions */
import React, { PropTypes } from 'react';
import { View, Text } from 'react-native';

View File

@ -1,4 +1,4 @@
/* eslint-disable import/no-extraneous-dependencies, import/no-unresolved, import/extensions */
/* eslint-disable import/extensions */
import React from 'react';
import { Text } from 'react-native';

View File

@ -1,4 +1,4 @@
/* eslint-disable import/no-extraneous-dependencies, import/no-unresolved, import/extensions, global-require */
/* eslint-disable import/extensions, global-require */
import { AppRegistry } from 'react-native';
import { getStorybookUI, configure } from '@storybook/react-native';

View File

@ -13,6 +13,8 @@ module.exports = latestVersion('@storybook/react-native').then(version => {
packageJson.devDependencies = packageJson.devDependencies || {};
packageJson.devDependencies['@storybook/react-native'] = `^${version}`;
packageJson.devDependencies['@storybook/addon-actions'] = `^${version}`;
packageJson.devDependencies['@storybook/addon-links'] = `^${version}`;
if (!packageJson.dependencies['react-dom'] && !packageJson.devDependencies['react-dom']) {
const reactVersion = packageJson.dependencies.react;

View File

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

View File

@ -1,4 +1,4 @@
/* eslint-disable import/no-extraneous-dependencies, import/no-unresolved, import/extensions */
/* eslint-disable import/extensions */
import '@storybook/addon-actions/register';
import '@storybook/addon-links/register';

View File

@ -1,4 +1,4 @@
/* eslint-disable import/no-extraneous-dependencies, import/no-unresolved, import/extensions */
/* eslint-disable import/extensions */
import { configure } from '@storybook/react';

View File

@ -10,6 +10,8 @@ module.exports = latestVersion('@storybook/vue').then(version => {
packageJson.devDependencies = packageJson.devDependencies || {};
packageJson.devDependencies['@storybook/vue'] = `^${version}`;
packageJson.devDependencies['@storybook/addon-actions'] = `^${version}`;
packageJson.devDependencies['@storybook/addon-links'] = `^${version}`;
packageJson.scripts = packageJson.scripts || {};
packageJson.scripts.storybook = 'start-storybook -p 6006';

View File

@ -1,4 +1,4 @@
/* eslint-disable import/no-extraneous-dependencies, import/no-unresolved, import/extensions */
/* eslint-disable import/extensions */
import '@storybook/addon-actions/register'
import '@storybook/addon-links/register'

View File

@ -1,4 +1,4 @@
/* eslint-disable import/no-extraneous-dependencies, import/no-unresolved, import/extensions */
/* eslint-disable import/extensions */
import { storiesOf } from '@storybook/vue';
import { action } from '@storybook/addon-actions';

View File

@ -10,6 +10,8 @@ module.exports = latestVersion('@storybook/vue').then(version => {
packageJson.devDependencies = packageJson.devDependencies || {};
packageJson.devDependencies['@storybook/vue'] = `^${version}`;
packageJson.devDependencies['@storybook/addon-actions'] = `^${version}`;
packageJson.devDependencies['@storybook/addon-links'] = `^${version}`;
packageJson.scripts = packageJson.scripts || {};
packageJson.scripts.storybook = 'start-storybook -p 6006';

View File

@ -1,4 +1,4 @@
/* eslint-disable import/no-extraneous-dependencies, import/no-unresolved, import/extensions */
/* eslint-disable import/extensions */
import '@storybook/addon-actions/register'
import '@storybook/addon-links/register'

View File

@ -1,4 +1,4 @@
/* eslint-disable import/no-extraneous-dependencies, import/no-unresolved, import/extensions */
/* eslint-disable import/extensions */
import { configure } from '@storybook/vue'

View File

@ -1,5 +1,3 @@
/* eslint-disable import/no-extraneous-dependencies, import/no-unresolved, import/extensions */
export default {
name: 'my-button',

View File

@ -1,5 +1,3 @@
/* eslint-disable import/no-extraneous-dependencies, import/no-unresolved, import/extensions */
const log = () => console.log('Welcome to storybook!')
export default {

View File

@ -10,6 +10,8 @@ module.exports = latestVersion('@storybook/react').then(version => {
packageJson.devDependencies = packageJson.devDependencies || {};
packageJson.devDependencies['@storybook/react'] = `^${version}`;
packageJson.devDependencies['@storybook/addon-actions'] = `^${version}`;
packageJson.devDependencies['@storybook/addon-links'] = `^${version}`;
packageJson.scripts = packageJson.scripts || {};
packageJson.scripts.storybook = 'start-storybook -p 6006';