mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-04 15:11:10 +08:00
CLI: Add explicit dependencies on used plugins
This commit is contained in:
parent
f552cac4aa
commit
1601322fdc
@ -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';
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* eslint-disable import/no-extraneous-dependencies, import/no-unresolved, import/extensions */
|
||||
/* eslint-disable import/extensions */
|
||||
|
||||
import React from 'react';
|
||||
|
||||
|
@ -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';
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* eslint-disable import/no-extraneous-dependencies, import/no-unresolved, import/extensions */
|
||||
/* eslint-disable import/extensions */
|
||||
|
||||
import { configure } from '@storybook/react';
|
||||
|
||||
|
@ -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';
|
||||
|
@ -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';
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* eslint-disable import/no-extraneous-dependencies, import/no-unresolved, import/extensions */
|
||||
/* eslint-disable import/extensions */
|
||||
|
||||
import { configure } from '@storybook/react';
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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';
|
||||
|
@ -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';
|
||||
|
@ -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';
|
||||
|
@ -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';
|
||||
|
@ -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';
|
||||
|
@ -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';
|
||||
|
@ -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';
|
||||
|
@ -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;
|
||||
|
@ -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';
|
||||
|
||||
|
@ -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';
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* eslint-disable import/no-extraneous-dependencies, import/no-unresolved, import/extensions */
|
||||
/* eslint-disable import/extensions */
|
||||
|
||||
import { configure } from '@storybook/react';
|
||||
|
||||
|
@ -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';
|
||||
|
@ -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'
|
||||
|
@ -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';
|
||||
|
@ -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';
|
||||
|
@ -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'
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* eslint-disable import/no-extraneous-dependencies, import/no-unresolved, import/extensions */
|
||||
/* eslint-disable import/extensions */
|
||||
|
||||
import { configure } from '@storybook/vue'
|
||||
|
||||
|
@ -1,5 +1,3 @@
|
||||
/* eslint-disable import/no-extraneous-dependencies, import/no-unresolved, import/extensions */
|
||||
|
||||
export default {
|
||||
name: 'my-button',
|
||||
|
||||
|
@ -1,5 +1,3 @@
|
||||
/* eslint-disable import/no-extraneous-dependencies, import/no-unresolved, import/extensions */
|
||||
|
||||
const log = () => console.log('Welcome to storybook!')
|
||||
|
||||
export default {
|
||||
|
@ -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';
|
||||
|
Loading…
x
Reference in New Issue
Block a user