From dae9d404642304d986e4374288da17606a7d904e Mon Sep 17 00:00:00 2001 From: tooppaaa Date: Mon, 25 May 2020 16:08:19 +0200 Subject: [PATCH 01/47] rename generator --- lib/cli/src/generators/Generator.ts | 8 ---- lib/cli/src/generators/generator1.ts | 57 ++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+), 8 deletions(-) delete mode 100644 lib/cli/src/generators/Generator.ts create mode 100644 lib/cli/src/generators/generator1.ts diff --git a/lib/cli/src/generators/Generator.ts b/lib/cli/src/generators/Generator.ts deleted file mode 100644 index b6143c0c92dc..000000000000 --- a/lib/cli/src/generators/Generator.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { NpmOptions } from '../NpmOptions'; -import { StoryFormat } from '../project_types'; - -export type GeneratorOptions = { - storyFormat: StoryFormat; -}; - -export type Generator = (npmOptions: NpmOptions, options: GeneratorOptions) => Promise; diff --git a/lib/cli/src/generators/generator1.ts b/lib/cli/src/generators/generator1.ts new file mode 100644 index 000000000000..1a0b7ce3206f --- /dev/null +++ b/lib/cli/src/generators/generator1.ts @@ -0,0 +1,57 @@ +import { NpmOptions } from '../NpmOptions'; +import { StoryFormat, SupportedLanguage, SupportedFrameworks } from '../project_types'; +import { + retrievePackageJson, + getVersionedPackages, + writePackageJson, + getBabelDependencies, + installDependencies, + copyTemplate, + copyComponents, +} from '../helpers'; +import configure from './configure'; + +export type GeneratorOptions = { + language: SupportedLanguage; + storyFormat: StoryFormat; +}; + +export type Generator = (npmOptions: NpmOptions, options: GeneratorOptions) => Promise; + +const generator = async ( + npmOptions: NpmOptions, + { storyFormat, language }: GeneratorOptions, + framework: SupportedFrameworks, + extraPackages?: string[], + extraAddons?: string[] +) => { + const packages = [ + `@storybook/${framework}`, + '@storybook/addon-essentials', + '@storybook/addon-links', + ...extraPackages, + ...extraAddons, + ]; + const versionedPackages = await getVersionedPackages(npmOptions, ...packages); + + configure(extraAddons); + copyComponents(framework, language); + copyTemplate(__dirname, storyFormat); + + const packageJson = await retrievePackageJson(); + + packageJson.dependencies = packageJson.dependencies || {}; + packageJson.devDependencies = packageJson.devDependencies || {}; + + packageJson.scripts = packageJson.scripts || {}; + packageJson.scripts.storybook = 'start-storybook -p 6006'; + packageJson.scripts['build-storybook'] = 'build-storybook'; + + writePackageJson(packageJson); + + const babelDependencies = await getBabelDependencies(npmOptions, packageJson); + + installDependencies({ ...npmOptions, packageJson }, [...versionedPackages, ...babelDependencies]); +}; + +export default generator; From 5597f5a67bf594b1086663781fc3b5ff59ae80a6 Mon Sep 17 00:00:00 2001 From: tooppaaa Date: Mon, 25 May 2020 16:08:46 +0200 Subject: [PATCH 02/47] CLI: react stories --- lib/cli/.babelrc.json | 1 + lib/cli/src/{generators => }/.eslintrc.js | 16 +- .../react/js}/0-Welcome.stories.js | 2 +- .../react/js}/1-Button.stories.js | 2 +- lib/cli/src/frameworks/react/js/Button.jsx | 19 +++ lib/cli/src/frameworks/react/js/Welcome.jsx | 128 ++++++++++++++ .../react/ts}/0-Welcome.stories.tsx | 2 +- .../react/ts/1-Button.stories.tsx} | 2 +- lib/cli/src/frameworks/react/ts/Button.tsx | 20 +++ lib/cli/src/frameworks/react/ts/Welcome.tsx | 159 ++++++++++++++++++ lib/cli/src/generators/ANGULAR/index.ts | 2 +- lib/cli/src/generators/AURELIA/index.ts | 2 +- lib/cli/src/generators/EMBER/index.ts | 2 +- lib/cli/src/generators/HTML/index.ts | 2 +- lib/cli/src/generators/MARIONETTE/index.ts | 2 +- lib/cli/src/generators/MARKO/index.ts | 2 +- lib/cli/src/generators/METEOR/index.ts | 2 +- lib/cli/src/generators/MITHRIL/index.ts | 2 +- lib/cli/src/generators/PREACT/index.ts | 2 +- lib/cli/src/generators/RAX/index.ts | 2 +- lib/cli/src/generators/REACT/index.ts | 42 +---- .../REACT/template-csf/.storybook/main.js | 2 +- .../template-csf/stories/0-Welcome.stories.js | 12 -- .../REACT/template-mdx/.storybook/main.js | 5 +- .../stories/0-Welcome.stories.mdx | 2 +- .../template-mdx/stories/1-Button.stories.mdx | 2 +- lib/cli/src/generators/REACT_NATIVE/index.ts | 2 +- lib/cli/src/generators/REACT_SCRIPTS/index.ts | 47 +----- .../template-csf-ts/.storybook/main.js | 8 - .../src/stories/1-Button.stories.tsx | 18 -- .../template-csf/.storybook/main.js | 2 +- .../template-mdx/.storybook/main.js | 5 +- .../{src => }/stories/0-Welcome.stories.mdx | 2 +- .../{src => }/stories/1-Button.stories.mdx | 2 +- lib/cli/src/generators/RIOT/index.ts | 2 +- lib/cli/src/generators/SFC_VUE/index.ts | 2 +- lib/cli/src/generators/SVELTE/index.ts | 2 +- lib/cli/src/generators/VUE/index.ts | 2 +- .../src/generators/WEB-COMPONENTS/index.ts | 2 +- lib/cli/src/generators/WEBPACK_REACT/index.ts | 41 +---- .../template-csf/.storybook/main.js | 9 - .../template-csf/stories/0-Welcome.stories.js | 12 -- .../template-csf/stories/1-Button.stories.js | 42 ----- .../template-mdx/.storybook/main.js | 16 -- .../stories/0-Welcome.stories.mdx | 2 +- .../template-mdx/stories/1-Button.stories.mdx | 2 +- lib/cli/src/generators/configure.ts | 16 ++ .../{generator1.ts => generator.ts} | 0 lib/cli/src/helpers.test.ts | 53 +++++- lib/cli/src/helpers.ts | 51 +++++- lib/cli/src/initiate.ts | 6 +- lib/cli/src/project_types.ts | 6 +- lib/cli/tsconfig.json | 2 +- scripts/prepare.js | 11 +- 54 files changed, 525 insertions(+), 276 deletions(-) rename lib/cli/src/{generators => }/.eslintrc.js (58%) rename lib/cli/src/{generators/REACT_SCRIPTS/template-csf/src/stories => frameworks/react/js}/0-Welcome.stories.js (83%) rename lib/cli/src/{generators/REACT_SCRIPTS/template-csf/src/stories => frameworks/react/js}/1-Button.stories.js (95%) create mode 100644 lib/cli/src/frameworks/react/js/Button.jsx create mode 100644 lib/cli/src/frameworks/react/js/Welcome.jsx rename lib/cli/src/{generators/REACT_SCRIPTS/template-csf-ts/src/stories => frameworks/react/ts}/0-Welcome.stories.tsx (83%) rename lib/cli/src/{generators/REACT/template-csf/stories/1-Button.stories.js => frameworks/react/ts/1-Button.stories.tsx} (95%) create mode 100644 lib/cli/src/frameworks/react/ts/Button.tsx create mode 100644 lib/cli/src/frameworks/react/ts/Welcome.tsx delete mode 100644 lib/cli/src/generators/REACT/template-csf/stories/0-Welcome.stories.js delete mode 100644 lib/cli/src/generators/REACT_SCRIPTS/template-csf-ts/.storybook/main.js delete mode 100644 lib/cli/src/generators/REACT_SCRIPTS/template-csf-ts/src/stories/1-Button.stories.tsx rename lib/cli/src/generators/REACT_SCRIPTS/template-mdx/{src => }/stories/0-Welcome.stories.mdx (89%) rename lib/cli/src/generators/REACT_SCRIPTS/template-mdx/{src => }/stories/1-Button.stories.mdx (90%) delete mode 100644 lib/cli/src/generators/WEBPACK_REACT/template-csf/.storybook/main.js delete mode 100644 lib/cli/src/generators/WEBPACK_REACT/template-csf/stories/0-Welcome.stories.js delete mode 100644 lib/cli/src/generators/WEBPACK_REACT/template-csf/stories/1-Button.stories.js delete mode 100644 lib/cli/src/generators/WEBPACK_REACT/template-mdx/.storybook/main.js create mode 100644 lib/cli/src/generators/configure.ts rename lib/cli/src/generators/{generator1.ts => generator.ts} (100%) diff --git a/lib/cli/.babelrc.json b/lib/cli/.babelrc.json index 9ab56eefbb58..d2ad1c00b008 100644 --- a/lib/cli/.babelrc.json +++ b/lib/cli/.babelrc.json @@ -12,6 +12,7 @@ ] ], "ignore": [ + "./src/frameworks", "./src/generators/**/template", "./src/generators/**/template-csf", "./src/generators/**/template-csf-ts", diff --git a/lib/cli/src/generators/.eslintrc.js b/lib/cli/src/.eslintrc.js similarity index 58% rename from lib/cli/src/generators/.eslintrc.js rename to lib/cli/src/.eslintrc.js index d7fac90c788e..3625258646f3 100644 --- a/lib/cli/src/generators/.eslintrc.js +++ b/lib/cli/src/.eslintrc.js @@ -3,7 +3,7 @@ const ignore = 0; module.exports = { overrides: [ { - files: '*/template[-?]*/**', + files: '**/template[-?]*/**', env: { browser: true, }, @@ -12,7 +12,6 @@ module.exports = { 'import/no-unresolved': ignore, 'import/no-extraneous-dependencies': ignore, 'global-require': ignore, - 'react/react-in-jsx-scope': ignore, }, }, { @@ -21,5 +20,18 @@ module.exports = { browser: false, }, }, + { + files: 'frameworks/**/*', + env: { + browser: true, + }, + rules: { + 'jsx-a11y/anchor-is-valid': ignore, + 'import/no-unresolved': ignore, + 'react/prop-types': ignore, + 'react/react-in-jsx-scope': ignore, + 'import/no-extraneous-dependencies': ignore, + }, + }, ], }; diff --git a/lib/cli/src/generators/REACT_SCRIPTS/template-csf/src/stories/0-Welcome.stories.js b/lib/cli/src/frameworks/react/js/0-Welcome.stories.js similarity index 83% rename from lib/cli/src/generators/REACT_SCRIPTS/template-csf/src/stories/0-Welcome.stories.js rename to lib/cli/src/frameworks/react/js/0-Welcome.stories.js index 9920a416e1ff..1274ca16a4ff 100644 --- a/lib/cli/src/generators/REACT_SCRIPTS/template-csf/src/stories/0-Welcome.stories.js +++ b/lib/cli/src/frameworks/react/js/0-Welcome.stories.js @@ -1,6 +1,6 @@ import React from 'react'; import { linkTo } from '@storybook/addon-links'; -import { Welcome } from '@storybook/react/demo'; +import Welcome from './Welcome'; export default { title: 'Welcome', diff --git a/lib/cli/src/generators/REACT_SCRIPTS/template-csf/src/stories/1-Button.stories.js b/lib/cli/src/frameworks/react/js/1-Button.stories.js similarity index 95% rename from lib/cli/src/generators/REACT_SCRIPTS/template-csf/src/stories/1-Button.stories.js rename to lib/cli/src/frameworks/react/js/1-Button.stories.js index 383864b23ad1..57f15cf2a479 100644 --- a/lib/cli/src/generators/REACT_SCRIPTS/template-csf/src/stories/1-Button.stories.js +++ b/lib/cli/src/frameworks/react/js/1-Button.stories.js @@ -1,7 +1,7 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; import { linkTo } from '@storybook/addon-links'; -import { Button } from '@storybook/react/demo'; +import Button from './Button'; export default { title: 'Button', diff --git a/lib/cli/src/frameworks/react/js/Button.jsx b/lib/cli/src/frameworks/react/js/Button.jsx new file mode 100644 index 000000000000..8b431e3d0e57 --- /dev/null +++ b/lib/cli/src/frameworks/react/js/Button.jsx @@ -0,0 +1,19 @@ +import React from 'react'; + +const styles = { + border: '1px solid #eee', + borderRadius: 3, + backgroundColor: '#FFFFFF', + cursor: 'pointer', + fontSize: 15, + padding: '3px 10px', + margin: 10, +}; + +const Button = ({ children, onClick }) => ( + +); + +export default Button; diff --git a/lib/cli/src/frameworks/react/js/Welcome.jsx b/lib/cli/src/frameworks/react/js/Welcome.jsx new file mode 100644 index 000000000000..42328a1b4fc7 --- /dev/null +++ b/lib/cli/src/frameworks/react/js/Welcome.jsx @@ -0,0 +1,128 @@ +import React from 'react'; + +const Main = (props) => ( +
+); + +const Title = ({ children, ...props }) =>

{children}

; + +const Note = (props) => ( +

+); + +const InlineCode = (props) => ( + +); + +const Link = ({ children, href, target, rel, ...props }) => ( + + {children} + +); + +const NavButton = ({ children, onClick, ...props }) => ( + +); + +const Welcome = ({ showApp }) => ( +

+ Welcome to storybook +

This is a UI component dev environment for your app.

+

+ We've added some basic stories inside the src/stories directory. +
A story is a single state of one or more UI components. You can have as many stories as + you want. +
+ (Basically a story is like a visual test case.) +

+

+ See these sample stories for a component called  + Button. +

+

+ Just like that, you can add your own components as stories. +
+ You can also edit those components and see changes right away. +
+ (Try editing the Button stories located at  + src/stories/1-Button.stories.js + .) +

+

+ Usually we create stories with smaller UI components in the app. +
+ Have a look at the  + + Writing Stories + +  section in our documentation. +

+ + NOTE: +
+ Have a look at the .storybook/webpack.config.js to add webpack + loaders and plugins you are using in this project. +
+
+); + +export default Welcome; diff --git a/lib/cli/src/generators/REACT_SCRIPTS/template-csf-ts/src/stories/0-Welcome.stories.tsx b/lib/cli/src/frameworks/react/ts/0-Welcome.stories.tsx similarity index 83% rename from lib/cli/src/generators/REACT_SCRIPTS/template-csf-ts/src/stories/0-Welcome.stories.tsx rename to lib/cli/src/frameworks/react/ts/0-Welcome.stories.tsx index 9920a416e1ff..1274ca16a4ff 100644 --- a/lib/cli/src/generators/REACT_SCRIPTS/template-csf-ts/src/stories/0-Welcome.stories.tsx +++ b/lib/cli/src/frameworks/react/ts/0-Welcome.stories.tsx @@ -1,6 +1,6 @@ import React from 'react'; import { linkTo } from '@storybook/addon-links'; -import { Welcome } from '@storybook/react/demo'; +import Welcome from './Welcome'; export default { title: 'Welcome', diff --git a/lib/cli/src/generators/REACT/template-csf/stories/1-Button.stories.js b/lib/cli/src/frameworks/react/ts/1-Button.stories.tsx similarity index 95% rename from lib/cli/src/generators/REACT/template-csf/stories/1-Button.stories.js rename to lib/cli/src/frameworks/react/ts/1-Button.stories.tsx index 383864b23ad1..57f15cf2a479 100644 --- a/lib/cli/src/generators/REACT/template-csf/stories/1-Button.stories.js +++ b/lib/cli/src/frameworks/react/ts/1-Button.stories.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; import { linkTo } from '@storybook/addon-links'; -import { Button } from '@storybook/react/demo'; +import Button from './Button'; export default { title: 'Button', diff --git a/lib/cli/src/frameworks/react/ts/Button.tsx b/lib/cli/src/frameworks/react/ts/Button.tsx new file mode 100644 index 000000000000..bd79304547b2 --- /dev/null +++ b/lib/cli/src/frameworks/react/ts/Button.tsx @@ -0,0 +1,20 @@ +import React, { FunctionComponent, HTMLAttributes } from 'react'; + +const styles = { + border: '1px solid #eee', + borderRadius: 3, + backgroundColor: '#FFFFFF', + cursor: 'pointer', + fontSize: 15, + padding: '3px 10px', + margin: 10, +}; + +type Props = Pick, 'onClick'>; +const Button: FunctionComponent = ({ children, onClick }) => ( + +); + +export default Button; diff --git a/lib/cli/src/frameworks/react/ts/Welcome.tsx b/lib/cli/src/frameworks/react/ts/Welcome.tsx new file mode 100644 index 000000000000..2d5d35e5000a --- /dev/null +++ b/lib/cli/src/frameworks/react/ts/Welcome.tsx @@ -0,0 +1,159 @@ +import React, { + AnchorHTMLAttributes, + ButtonHTMLAttributes, + DetailedHTMLProps, + FunctionComponent, + HTMLAttributes, +} from 'react'; + +type MainProps = Omit, HTMLElement>, 'style'>; +const Main: FunctionComponent = (props) => ( +
+); + +type TitleProps = DetailedHTMLProps, HTMLHeadingElement>; +const Title: FunctionComponent = ({ children, ...props }) => ( +

{children}

+); + +type NoteProps = Omit< + DetailedHTMLProps, HTMLParagraphElement>, + 'style' +>; +const Note: FunctionComponent = (props) => ( +

+); + +type InlineCodeProps = Omit, HTMLElement>, 'style'>; +const InlineCode: FunctionComponent = (props) => ( + +); + +type LinkProps = Omit< + DetailedHTMLProps, HTMLAnchorElement>, + 'style' +> & { + href: string; + target: string; + rel: string; +}; +const Link: FunctionComponent = ({ children, href, target, rel, ...props }) => ( + + {children} + +); + +type NavButtonProps = Omit< + DetailedHTMLProps, HTMLButtonElement>, + 'style' | 'type' +> & {}; +const NavButton: FunctionComponent = ({ children, onClick, ...props }) => ( + +); + +interface WelcomeProps { + showApp: () => void; +} +const Welcome: FunctionComponent = ({ showApp }) => ( +

+ Welcome to storybook +

This is a UI component dev environment for your app.

+

+ We've added some basic stories inside the src/stories directory. +
A story is a single state of one or more UI components. You can have as many stories as + you want. +
+ (Basically a story is like a visual test case.) +

+

+ See these sample stories for a component called  + Button. +

+

+ Just like that, you can add your own components as stories. +
+ You can also edit those components and see changes right away. +
+ (Try editing the Button stories located at  + src/stories/1-Button.stories.js + .) +

+

+ Usually we create stories with smaller UI components in the app. +
+ Have a look at the  + + Writing Stories + +  section in our documentation. +

+ + NOTE: +
+ Have a look at the .storybook/webpack.config.js to add webpack + loaders and plugins you are using in this project. +
+
+); +Welcome.displayName = 'Welcome'; + +export { Welcome as default }; diff --git a/lib/cli/src/generators/ANGULAR/index.ts b/lib/cli/src/generators/ANGULAR/index.ts index cc9d5921366f..0a9c387ec980 100644 --- a/lib/cli/src/generators/ANGULAR/index.ts +++ b/lib/cli/src/generators/ANGULAR/index.ts @@ -16,7 +16,7 @@ import { } from '../../helpers'; import { StoryFormat } from '../../project_types'; import { NpmOptions } from '../../NpmOptions'; -import { Generator, GeneratorOptions } from '../Generator'; +import { Generator, GeneratorOptions } from '../generator'; async function addDependencies(npmOptions: NpmOptions, { storyFormat }: GeneratorOptions) { const packages = [ diff --git a/lib/cli/src/generators/AURELIA/index.ts b/lib/cli/src/generators/AURELIA/index.ts index 3f7362f13759..2e8a1e3e091a 100644 --- a/lib/cli/src/generators/AURELIA/index.ts +++ b/lib/cli/src/generators/AURELIA/index.ts @@ -8,7 +8,7 @@ import { copyTemplate, readFileAsJson, } from '../../helpers'; -import { Generator } from '../Generator'; +import { Generator } from '../generator'; import { StoryFormat } from '../../project_types'; function addStorybookExcludeGlobToTsConfig() { diff --git a/lib/cli/src/generators/EMBER/index.ts b/lib/cli/src/generators/EMBER/index.ts index 874e81e6e2e7..5ce6864cf87e 100644 --- a/lib/cli/src/generators/EMBER/index.ts +++ b/lib/cli/src/generators/EMBER/index.ts @@ -6,7 +6,7 @@ import { installDependencies, copyTemplate, } from '../../helpers'; -import { Generator } from '../Generator'; +import { Generator } from '../generator'; const generator: Generator = async (npmOptions, { storyFormat }) => { const [ diff --git a/lib/cli/src/generators/HTML/index.ts b/lib/cli/src/generators/HTML/index.ts index 25d850192b6c..a11a0bd4321c 100755 --- a/lib/cli/src/generators/HTML/index.ts +++ b/lib/cli/src/generators/HTML/index.ts @@ -7,7 +7,7 @@ import { copyTemplate, } from '../../helpers'; import { StoryFormat } from '../../project_types'; -import { Generator } from '../Generator'; +import { Generator } from '../generator'; const generator: Generator = async (npmOptions, { storyFormat }) => { const packages = ['@storybook/html', '@storybook/addon-actions', '@storybook/addon-links']; diff --git a/lib/cli/src/generators/MARIONETTE/index.ts b/lib/cli/src/generators/MARIONETTE/index.ts index e3ce805931a8..a55e1f36aab0 100644 --- a/lib/cli/src/generators/MARIONETTE/index.ts +++ b/lib/cli/src/generators/MARIONETTE/index.ts @@ -7,7 +7,7 @@ import { installDependencies, retrievePackageJson, } from '../../helpers'; -import { Generator } from '../Generator'; +import { Generator } from '../generator'; const generator: Generator = async (npmOptions) => { const storybookVersion = await getVersion(npmOptions, '@storybook/marionette'); diff --git a/lib/cli/src/generators/MARKO/index.ts b/lib/cli/src/generators/MARKO/index.ts index b8a3bc0e40e1..5220b6a1d81d 100644 --- a/lib/cli/src/generators/MARKO/index.ts +++ b/lib/cli/src/generators/MARKO/index.ts @@ -6,7 +6,7 @@ import { installDependencies, copyTemplate, } from '../../helpers'; -import { Generator } from '../Generator'; +import { Generator } from '../generator'; const generator: Generator = async (npmOptions, { storyFormat }) => { const [storybookVersion, addonActionVersion, addonKnobsVersion] = await getVersions( diff --git a/lib/cli/src/generators/METEOR/index.ts b/lib/cli/src/generators/METEOR/index.ts index 6420a01f0b03..94f2c1c21b1c 100644 --- a/lib/cli/src/generators/METEOR/index.ts +++ b/lib/cli/src/generators/METEOR/index.ts @@ -8,7 +8,7 @@ import { installDependencies, copyTemplate, } from '../../helpers'; -import { Generator } from '../Generator'; +import { Generator } from '../generator'; const generator: Generator = async (npmOptions, { storyFormat }) => { const [ diff --git a/lib/cli/src/generators/MITHRIL/index.ts b/lib/cli/src/generators/MITHRIL/index.ts index d6bff9454643..271187acd3d2 100644 --- a/lib/cli/src/generators/MITHRIL/index.ts +++ b/lib/cli/src/generators/MITHRIL/index.ts @@ -6,7 +6,7 @@ import { installDependencies, copyTemplate, } from '../../helpers'; -import { Generator } from '../Generator'; +import { Generator } from '../generator'; const generator: Generator = async (npmOptions, { storyFormat }) => { const [ diff --git a/lib/cli/src/generators/PREACT/index.ts b/lib/cli/src/generators/PREACT/index.ts index 42c9eb416c9d..4a4b9dba7aa7 100644 --- a/lib/cli/src/generators/PREACT/index.ts +++ b/lib/cli/src/generators/PREACT/index.ts @@ -6,7 +6,7 @@ import { installDependencies, copyTemplate, } from '../../helpers'; -import { Generator } from '../Generator'; +import { Generator } from '../generator'; const generator: Generator = async (npmOptions, { storyFormat }) => { const [storybookVersion, actionsVersion, linksVersion, addonsVersion] = await getVersions( diff --git a/lib/cli/src/generators/RAX/index.ts b/lib/cli/src/generators/RAX/index.ts index 4ac18e259ab9..8e7e2f12e049 100644 --- a/lib/cli/src/generators/RAX/index.ts +++ b/lib/cli/src/generators/RAX/index.ts @@ -6,7 +6,7 @@ import { installDependencies, copyTemplate, } from '../../helpers'; -import { Generator } from '../Generator'; +import { Generator } from '../generator'; const generator: Generator = async (npmOptions, { storyFormat }) => { const [ diff --git a/lib/cli/src/generators/REACT/index.ts b/lib/cli/src/generators/REACT/index.ts index 586dac39814b..117af995d217 100644 --- a/lib/cli/src/generators/REACT/index.ts +++ b/lib/cli/src/generators/REACT/index.ts @@ -1,43 +1,7 @@ -import { - getVersionedPackages, - retrievePackageJson, - writePackageJson, - getBabelDependencies, - installDependencies, - copyTemplate, -} from '../../helpers'; -import { StoryFormat } from '../../project_types'; -import { Generator } from '../Generator'; +import baseGenerator, { Generator } from '../generator'; -const generator: Generator = async (npmOptions, { storyFormat }) => { - const packages = [ - '@storybook/react', - '@storybook/addon-actions', - '@storybook/addon-links', - '@storybook/addons', - ]; - if (storyFormat === StoryFormat.MDX) { - packages.push('@storybook/addon-docs'); - } - - const versionedPackages = await getVersionedPackages(npmOptions, ...packages); - - copyTemplate(__dirname, storyFormat); - - const packageJson = await retrievePackageJson(); - - packageJson.dependencies = packageJson.dependencies || {}; - packageJson.devDependencies = packageJson.devDependencies || {}; - - packageJson.scripts = packageJson.scripts || {}; - packageJson.scripts.storybook = 'start-storybook -p 6006'; - packageJson.scripts['build-storybook'] = 'build-storybook'; - - writePackageJson(packageJson); - - const babelDependencies = await getBabelDependencies(npmOptions, packageJson); - - installDependencies({ ...npmOptions, packageJson }, [...versionedPackages, ...babelDependencies]); +const generator: Generator = async (npmOptions, options) => { + baseGenerator(npmOptions, options, 'react'); }; export default generator; diff --git a/lib/cli/src/generators/REACT/template-csf/.storybook/main.js b/lib/cli/src/generators/REACT/template-csf/.storybook/main.js index 11692a0e7725..2271016abe6b 100644 --- a/lib/cli/src/generators/REACT/template-csf/.storybook/main.js +++ b/lib/cli/src/generators/REACT/template-csf/.storybook/main.js @@ -1,4 +1,4 @@ module.exports = { - stories: ['../stories/**/*.stories.(ts|tsx|js|jsx)'], + stories: ['../src/**/*.stories.(ts|tsx|js|jsx)'], addons: ['@storybook/addon-actions', '@storybook/addon-links'], }; diff --git a/lib/cli/src/generators/REACT/template-csf/stories/0-Welcome.stories.js b/lib/cli/src/generators/REACT/template-csf/stories/0-Welcome.stories.js deleted file mode 100644 index 9920a416e1ff..000000000000 --- a/lib/cli/src/generators/REACT/template-csf/stories/0-Welcome.stories.js +++ /dev/null @@ -1,12 +0,0 @@ -import React from 'react'; -import { linkTo } from '@storybook/addon-links'; -import { Welcome } from '@storybook/react/demo'; - -export default { - title: 'Welcome', - component: Welcome, -}; - -export const ToStorybook = () => ; - -ToStorybook.storyName = 'to Storybook'; diff --git a/lib/cli/src/generators/REACT/template-mdx/.storybook/main.js b/lib/cli/src/generators/REACT/template-mdx/.storybook/main.js index 687009302e52..c698efe5509d 100644 --- a/lib/cli/src/generators/REACT/template-mdx/.storybook/main.js +++ b/lib/cli/src/generators/REACT/template-mdx/.storybook/main.js @@ -1,5 +1,8 @@ module.exports = { - stories: ['../stories/**/*.stories.(js|mdx)'], + stories: [ + '../src/**/*.stories.(ts|tsx|js|jsx|mdx)', + '../stories/**/*.stories.(ts|tsx|js|jsx|mdx)', + ], addons: [ '@storybook/addon-actions', '@storybook/addon-links', diff --git a/lib/cli/src/generators/REACT/template-mdx/stories/0-Welcome.stories.mdx b/lib/cli/src/generators/REACT/template-mdx/stories/0-Welcome.stories.mdx index 8f48008a3b56..4e0f04619efe 100644 --- a/lib/cli/src/generators/REACT/template-mdx/stories/0-Welcome.stories.mdx +++ b/lib/cli/src/generators/REACT/template-mdx/stories/0-Welcome.stories.mdx @@ -1,6 +1,6 @@ import { Meta, Story, Preview } from '@storybook/addon-docs/blocks'; import { linkTo } from '@storybook/addon-links'; -import { Welcome } from '@storybook/react/demo'; +import Welcome from '../Welcome'; diff --git a/lib/cli/src/generators/REACT/template-mdx/stories/1-Button.stories.mdx b/lib/cli/src/generators/REACT/template-mdx/stories/1-Button.stories.mdx index ed90840f9dcb..09554ab784a8 100644 --- a/lib/cli/src/generators/REACT/template-mdx/stories/1-Button.stories.mdx +++ b/lib/cli/src/generators/REACT/template-mdx/stories/1-Button.stories.mdx @@ -1,6 +1,6 @@ import { action } from '@storybook/addon-actions'; -import { Button } from '@storybook/react/demo'; import { Meta, Story } from '@storybook/addon-docs/blocks'; +import Button from '../Button'; diff --git a/lib/cli/src/generators/REACT_NATIVE/index.ts b/lib/cli/src/generators/REACT_NATIVE/index.ts index aad02bcb16c6..f69c29ec9a98 100644 --- a/lib/cli/src/generators/REACT_NATIVE/index.ts +++ b/lib/cli/src/generators/REACT_NATIVE/index.ts @@ -10,7 +10,7 @@ import { copyTemplate, } from '../../helpers'; import { NpmOptions } from '../../NpmOptions'; -import { GeneratorOptions } from '../Generator'; +import { GeneratorOptions } from '../generator'; export default async ( npmOptions: NpmOptions, diff --git a/lib/cli/src/generators/REACT_SCRIPTS/index.ts b/lib/cli/src/generators/REACT_SCRIPTS/index.ts index cc43eafdb98e..a06f24bfb011 100644 --- a/lib/cli/src/generators/REACT_SCRIPTS/index.ts +++ b/lib/cli/src/generators/REACT_SCRIPTS/index.ts @@ -1,53 +1,18 @@ import path from 'path'; import fs from 'fs'; -import { - retrievePackageJson, - getVersionedPackages, - writePackageJson, - getBabelDependencies, - installDependencies, - copyTemplate, -} from '../../helpers'; -import { StoryFormat } from '../../project_types'; -import { Generator } from '../Generator'; +import { retrievePackageJson, writePackageJson } from '../../helpers'; -const generator: Generator = async (npmOptions, { storyFormat }) => { - const packages = [ - '@storybook/react', - '@storybook/preset-create-react-app', - '@storybook/addon-actions', - '@storybook/addon-links', - '@storybook/addons', - ]; - - if (storyFormat === StoryFormat.MDX) { - packages.push('@storybook/addon-docs'); - } - - const versionedPackages = await getVersionedPackages(npmOptions, ...packages); - - copyTemplate(__dirname, storyFormat); - - const packageJson = await retrievePackageJson(); - - packageJson.dependencies = packageJson.dependencies || {}; - packageJson.devDependencies = packageJson.devDependencies || {}; - - packageJson.scripts = packageJson.scripts || {}; - packageJson.scripts.storybook = 'start-storybook -p 9009'; - packageJson.scripts['build-storybook'] = 'build-storybook'; +import baseGenerator, { Generator } from '../generator'; +const generator: Generator = async (npmOptions, options) => { + await baseGenerator(npmOptions, options, 'react', [], ['@storybook/preset-create-react-app']); if (fs.existsSync(path.resolve('./public'))) { + const packageJson = await retrievePackageJson(); // has a public folder and add support to it. packageJson.scripts.storybook += ' -s public'; packageJson.scripts['build-storybook'] += ' -s public'; + writePackageJson(packageJson); } - - writePackageJson(packageJson); - - const babelDependencies = await getBabelDependencies(npmOptions, packageJson); - - installDependencies({ ...npmOptions, packageJson }, [...versionedPackages, ...babelDependencies]); }; export default generator; diff --git a/lib/cli/src/generators/REACT_SCRIPTS/template-csf-ts/.storybook/main.js b/lib/cli/src/generators/REACT_SCRIPTS/template-csf-ts/.storybook/main.js deleted file mode 100644 index cd20fe295779..000000000000 --- a/lib/cli/src/generators/REACT_SCRIPTS/template-csf-ts/.storybook/main.js +++ /dev/null @@ -1,8 +0,0 @@ -module.exports = { - stories: ['../src/**/*.stories.(ts|tsx|js|jsx)'], - addons: [ - '@storybook/preset-create-react-app', - '@storybook/addon-actions', - '@storybook/addon-links', - ], -}; diff --git a/lib/cli/src/generators/REACT_SCRIPTS/template-csf-ts/src/stories/1-Button.stories.tsx b/lib/cli/src/generators/REACT_SCRIPTS/template-csf-ts/src/stories/1-Button.stories.tsx deleted file mode 100644 index 6bcfa2146627..000000000000 --- a/lib/cli/src/generators/REACT_SCRIPTS/template-csf-ts/src/stories/1-Button.stories.tsx +++ /dev/null @@ -1,18 +0,0 @@ -import React from 'react'; -import { action } from '@storybook/addon-actions'; -import { Button } from '@storybook/react/demo'; - -export default { - title: 'Button', - component: Button, -}; - -export const Text = () => ; - -export const Emoji = () => ( - -); diff --git a/lib/cli/src/generators/REACT_SCRIPTS/template-csf/.storybook/main.js b/lib/cli/src/generators/REACT_SCRIPTS/template-csf/.storybook/main.js index 8f79d4617f2b..cd20fe295779 100644 --- a/lib/cli/src/generators/REACT_SCRIPTS/template-csf/.storybook/main.js +++ b/lib/cli/src/generators/REACT_SCRIPTS/template-csf/.storybook/main.js @@ -1,5 +1,5 @@ module.exports = { - stories: ['../src/**/*.stories.js'], + stories: ['../src/**/*.stories.(ts|tsx|js|jsx)'], addons: [ '@storybook/preset-create-react-app', '@storybook/addon-actions', diff --git a/lib/cli/src/generators/REACT_SCRIPTS/template-mdx/.storybook/main.js b/lib/cli/src/generators/REACT_SCRIPTS/template-mdx/.storybook/main.js index fac25378d41e..6181a3b86505 100644 --- a/lib/cli/src/generators/REACT_SCRIPTS/template-mdx/.storybook/main.js +++ b/lib/cli/src/generators/REACT_SCRIPTS/template-mdx/.storybook/main.js @@ -1,5 +1,8 @@ module.exports = { - stories: ['../src/**/*.stories.(js|mdx)'], + stories: [ + '../src/**/*.stories.(ts|tsx|js|jsx|mdx)', + '../stories/**/*.stories.(ts|tsx|js|jsx|mdx)', + ], addons: [ '@storybook/addon-actions', '@storybook/addon-links', diff --git a/lib/cli/src/generators/REACT_SCRIPTS/template-mdx/src/stories/0-Welcome.stories.mdx b/lib/cli/src/generators/REACT_SCRIPTS/template-mdx/stories/0-Welcome.stories.mdx similarity index 89% rename from lib/cli/src/generators/REACT_SCRIPTS/template-mdx/src/stories/0-Welcome.stories.mdx rename to lib/cli/src/generators/REACT_SCRIPTS/template-mdx/stories/0-Welcome.stories.mdx index 8f48008a3b56..3e250967895c 100644 --- a/lib/cli/src/generators/REACT_SCRIPTS/template-mdx/src/stories/0-Welcome.stories.mdx +++ b/lib/cli/src/generators/REACT_SCRIPTS/template-mdx/stories/0-Welcome.stories.mdx @@ -1,6 +1,6 @@ import { Meta, Story, Preview } from '@storybook/addon-docs/blocks'; import { linkTo } from '@storybook/addon-links'; -import { Welcome } from '@storybook/react/demo'; +import Welcome from '../src/Welcome'; diff --git a/lib/cli/src/generators/REACT_SCRIPTS/template-mdx/src/stories/1-Button.stories.mdx b/lib/cli/src/generators/REACT_SCRIPTS/template-mdx/stories/1-Button.stories.mdx similarity index 90% rename from lib/cli/src/generators/REACT_SCRIPTS/template-mdx/src/stories/1-Button.stories.mdx rename to lib/cli/src/generators/REACT_SCRIPTS/template-mdx/stories/1-Button.stories.mdx index 7c87b32323cd..8005ba7e0e0b 100644 --- a/lib/cli/src/generators/REACT_SCRIPTS/template-mdx/src/stories/1-Button.stories.mdx +++ b/lib/cli/src/generators/REACT_SCRIPTS/template-mdx/stories/1-Button.stories.mdx @@ -1,6 +1,6 @@ import { Meta, Story, Preview } from '@storybook/addon-docs/blocks'; import { action } from '@storybook/addon-actions'; -import { Button } from '@storybook/react/demo'; +import Button from '../src/Button'; diff --git a/lib/cli/src/generators/RIOT/index.ts b/lib/cli/src/generators/RIOT/index.ts index 2c624431018a..12a27c812cd0 100644 --- a/lib/cli/src/generators/RIOT/index.ts +++ b/lib/cli/src/generators/RIOT/index.ts @@ -6,7 +6,7 @@ import { installDependencies, copyTemplate, } from '../../helpers'; -import { Generator } from '../Generator'; +import { Generator } from '../generator'; const generator: Generator = async (npmOptions, { storyFormat }) => { const [ diff --git a/lib/cli/src/generators/SFC_VUE/index.ts b/lib/cli/src/generators/SFC_VUE/index.ts index 0f85dbce6b12..26b6246983e5 100644 --- a/lib/cli/src/generators/SFC_VUE/index.ts +++ b/lib/cli/src/generators/SFC_VUE/index.ts @@ -7,7 +7,7 @@ import { copyTemplate, } from '../../helpers'; import { StoryFormat } from '../../project_types'; -import { Generator } from '../Generator'; +import { Generator } from '../generator'; const generator: Generator = async (npmOptions, { storyFormat }) => { const packages = [ diff --git a/lib/cli/src/generators/SVELTE/index.ts b/lib/cli/src/generators/SVELTE/index.ts index 9da7bfa15463..bb7bb6007bdf 100644 --- a/lib/cli/src/generators/SVELTE/index.ts +++ b/lib/cli/src/generators/SVELTE/index.ts @@ -6,7 +6,7 @@ import { installDependencies, copyTemplate, } from '../../helpers'; -import { Generator } from '../Generator'; +import { Generator } from '../generator'; const generator: Generator = async (npmOptions, { storyFormat }) => { const [ diff --git a/lib/cli/src/generators/VUE/index.ts b/lib/cli/src/generators/VUE/index.ts index d35af935858a..881e44d3415a 100644 --- a/lib/cli/src/generators/VUE/index.ts +++ b/lib/cli/src/generators/VUE/index.ts @@ -9,7 +9,7 @@ import { copyTemplate, } from '../../helpers'; import { StoryFormat } from '../../project_types'; -import { Generator } from '../Generator'; +import { Generator } from '../generator'; const generator: Generator = async (npmOptions, { storyFormat }) => { const packages = [ diff --git a/lib/cli/src/generators/WEB-COMPONENTS/index.ts b/lib/cli/src/generators/WEB-COMPONENTS/index.ts index 373eac327a67..6884166f964f 100755 --- a/lib/cli/src/generators/WEB-COMPONENTS/index.ts +++ b/lib/cli/src/generators/WEB-COMPONENTS/index.ts @@ -8,7 +8,7 @@ import { installDependencies, } from '../../helpers'; import { StoryFormat } from '../../project_types'; -import { Generator } from '../Generator'; +import { Generator } from '../generator'; const generator: Generator = async (npmOptions, { storyFormat }) => { const packages = [ diff --git a/lib/cli/src/generators/WEBPACK_REACT/index.ts b/lib/cli/src/generators/WEBPACK_REACT/index.ts index 75bec7324ed2..117af995d217 100644 --- a/lib/cli/src/generators/WEBPACK_REACT/index.ts +++ b/lib/cli/src/generators/WEBPACK_REACT/index.ts @@ -1,42 +1,7 @@ -import { - retrievePackageJson, - getVersionedPackages, - writePackageJson, - getBabelDependencies, - installDependencies, - copyTemplate, -} from '../../helpers'; -import { StoryFormat } from '../../project_types'; -import { Generator } from '../Generator'; +import baseGenerator, { Generator } from '../generator'; -const generator: Generator = async (npmOptions, { storyFormat }) => { - const packages = [ - '@storybook/react', - '@storybook/addon-actions', - '@storybook/addon-links', - '@storybook/addons', - ]; - if (storyFormat === StoryFormat.MDX) { - packages.push('@storybook/addon-docs'); - } - const versionedPackages = await getVersionedPackages(npmOptions, ...packages); - - copyTemplate(__dirname, storyFormat); - - const packageJson = await retrievePackageJson(); - - packageJson.dependencies = packageJson.dependencies || {}; - packageJson.devDependencies = packageJson.devDependencies || {}; - - packageJson.scripts = packageJson.scripts || {}; - packageJson.scripts.storybook = 'start-storybook -p 6006'; - packageJson.scripts['build-storybook'] = 'build-storybook'; - - writePackageJson(packageJson); - - const babelDependencies = await getBabelDependencies(npmOptions, packageJson); - - installDependencies({ ...npmOptions, packageJson }, [...versionedPackages, ...babelDependencies]); +const generator: Generator = async (npmOptions, options) => { + baseGenerator(npmOptions, options, 'react'); }; export default generator; diff --git a/lib/cli/src/generators/WEBPACK_REACT/template-csf/.storybook/main.js b/lib/cli/src/generators/WEBPACK_REACT/template-csf/.storybook/main.js deleted file mode 100644 index 69e89d84f741..000000000000 --- a/lib/cli/src/generators/WEBPACK_REACT/template-csf/.storybook/main.js +++ /dev/null @@ -1,9 +0,0 @@ -module.exports = { - stories: ['../stories/**/*.stories.js'], - addons: ['@storybook/addon-actions', '@storybook/addon-links'], - webpackFinal: async (config) => { - // do mutation to the config - - return config; - }, -}; diff --git a/lib/cli/src/generators/WEBPACK_REACT/template-csf/stories/0-Welcome.stories.js b/lib/cli/src/generators/WEBPACK_REACT/template-csf/stories/0-Welcome.stories.js deleted file mode 100644 index 9920a416e1ff..000000000000 --- a/lib/cli/src/generators/WEBPACK_REACT/template-csf/stories/0-Welcome.stories.js +++ /dev/null @@ -1,12 +0,0 @@ -import React from 'react'; -import { linkTo } from '@storybook/addon-links'; -import { Welcome } from '@storybook/react/demo'; - -export default { - title: 'Welcome', - component: Welcome, -}; - -export const ToStorybook = () => ; - -ToStorybook.storyName = 'to Storybook'; diff --git a/lib/cli/src/generators/WEBPACK_REACT/template-csf/stories/1-Button.stories.js b/lib/cli/src/generators/WEBPACK_REACT/template-csf/stories/1-Button.stories.js deleted file mode 100644 index 383864b23ad1..000000000000 --- a/lib/cli/src/generators/WEBPACK_REACT/template-csf/stories/1-Button.stories.js +++ /dev/null @@ -1,42 +0,0 @@ -import React from 'react'; -import { action } from '@storybook/addon-actions'; -import { linkTo } from '@storybook/addon-links'; -import { Button } from '@storybook/react/demo'; - -export default { - title: 'Button', - component: Button, -}; - -export const Text = () => ; - -export const Emoji = () => ( - -); - -Emoji.parameters = { notes: 'My notes on a button with emojis' }; - -export const WithSomeEmojiAndAction = () => ( - -); - -WithSomeEmojiAndAction.storyName = 'with some emoji and action'; -WithSomeEmojiAndAction.parameters = { notes: 'My notes on a button with emojis' }; - -export const ButtonWithLinkToAnotherStory = () => ( - -); - -ButtonWithLinkToAnotherStory.storyName = 'button with link to another story'; diff --git a/lib/cli/src/generators/WEBPACK_REACT/template-mdx/.storybook/main.js b/lib/cli/src/generators/WEBPACK_REACT/template-mdx/.storybook/main.js deleted file mode 100644 index b6db46a69841..000000000000 --- a/lib/cli/src/generators/WEBPACK_REACT/template-mdx/.storybook/main.js +++ /dev/null @@ -1,16 +0,0 @@ -module.exports = { - stories: ['../stories/**/*.stories.(js|mdx)'], - addons: [ - '@storybook/addon-actions', - '@storybook/addon-links', - { - name: '@storybook/addon-docs', - options: { configureJSX: true }, - }, - ], - webpackFinal: async (config) => { - // do mutation to the config - - return config; - }, -}; diff --git a/lib/cli/src/generators/WEBPACK_REACT/template-mdx/stories/0-Welcome.stories.mdx b/lib/cli/src/generators/WEBPACK_REACT/template-mdx/stories/0-Welcome.stories.mdx index 8f48008a3b56..3e250967895c 100644 --- a/lib/cli/src/generators/WEBPACK_REACT/template-mdx/stories/0-Welcome.stories.mdx +++ b/lib/cli/src/generators/WEBPACK_REACT/template-mdx/stories/0-Welcome.stories.mdx @@ -1,6 +1,6 @@ import { Meta, Story, Preview } from '@storybook/addon-docs/blocks'; import { linkTo } from '@storybook/addon-links'; -import { Welcome } from '@storybook/react/demo'; +import Welcome from '../src/Welcome'; diff --git a/lib/cli/src/generators/WEBPACK_REACT/template-mdx/stories/1-Button.stories.mdx b/lib/cli/src/generators/WEBPACK_REACT/template-mdx/stories/1-Button.stories.mdx index 876782206a82..e7606083b0a3 100644 --- a/lib/cli/src/generators/WEBPACK_REACT/template-mdx/stories/1-Button.stories.mdx +++ b/lib/cli/src/generators/WEBPACK_REACT/template-mdx/stories/1-Button.stories.mdx @@ -1,6 +1,6 @@ import { Meta, Story } from '@storybook/addon-docs/blocks'; import { action } from '@storybook/addon-actions'; -import { Button } from '@storybook/react/demo'; +import Button from '../src/Button'; diff --git a/lib/cli/src/generators/configure.ts b/lib/cli/src/generators/configure.ts new file mode 100644 index 000000000000..333576de9b33 --- /dev/null +++ b/lib/cli/src/generators/configure.ts @@ -0,0 +1,16 @@ +import fse from 'fs-extra'; + +function mainConfigurationGenerator(addons?: string[], custom?: any) { + const hasSrc = fse.existsSync('./src'); + + const config = { + stories: ['../stories/**/*.stories.*', hasSrc && '../src/**/*.stories.*'].filter(Boolean), + addons: ['@storybook/addon-essentials', '@storybook/addon-links', ...addons], + ...custom, + }; + + const stringified = `module.exports = ${JSON.stringify(config, null, 2)}`; + fse.writeFileSync('./.storybook/main.js', stringified, { encoding: 'utf8' }); +} + +export default mainConfigurationGenerator; diff --git a/lib/cli/src/generators/generator1.ts b/lib/cli/src/generators/generator.ts similarity index 100% rename from lib/cli/src/generators/generator1.ts rename to lib/cli/src/generators/generator.ts diff --git a/lib/cli/src/helpers.test.ts b/lib/cli/src/helpers.test.ts index 47dedbb8da34..a6c1503c86e9 100644 --- a/lib/cli/src/helpers.test.ts +++ b/lib/cli/src/helpers.test.ts @@ -2,7 +2,7 @@ import fs from 'fs'; import fse from 'fs-extra'; import * as helpers from './helpers'; -import { StoryFormat } from './project_types'; +import { StoryFormat, SupportedLanguage, SupportedFrameworks } from './project_types'; jest.mock('fs', () => ({ existsSync: jest.fn(), @@ -10,6 +10,7 @@ jest.mock('fs', () => ({ jest.mock('fs-extra', () => ({ copySync: jest.fn(() => ({})), + ensureDir: jest.fn(() => {}), })); jest.mock('path', () => ({ @@ -54,4 +55,54 @@ describe('Helpers', () => { }).toThrowError(expectedMessage); }); }); + + it.each` + language | exists | expected + ${'javascript'} | ${['js', 'ts']} | ${'/js'} + ${'typescript'} | ${['js', 'ts']} | ${'/ts'} + ${'typescript'} | ${['js']} | ${'/js'} + ${'javascript'} | ${[]} | ${''} + ${'typescript'} | ${[]} | ${''} + `( + `should copy $expected when folder $exists exists for language $language`, + ({ language, exists, expected }) => { + const componentsDirectory = exists.map((folder: string) => `frameworks/react/${folder}`); + const expectedDirectory = `frameworks/react${expected}`; + (fse.existsSync as jest.Mock).mockImplementation((filePath) => { + return componentsDirectory.includes(filePath) || filePath === 'frameworks/react'; + }); + helpers.copyComponents('react', language); + + const copySyncSpy = jest.spyOn(fse, 'copySync'); + expect(copySyncSpy).toHaveBeenCalledWith( + expectedDirectory, + expect.anything(), + expect.anything() + ); + } + ); + + it(`should copy to src folder when exists`, () => { + (fse.existsSync as jest.Mock).mockImplementation((filePath) => { + return filePath === 'frameworks/react' || filePath === './src'; + }); + helpers.copyComponents('react', SupportedLanguage.JAVASCRIPT); + expect(fse.copySync).toHaveBeenCalledWith(expect.anything(), './src', expect.anything()); + }); + + it(`should copy to root folder when src doesn't exist`, () => { + (fse.existsSync as jest.Mock).mockImplementation((filePath) => { + return filePath === 'frameworks/react'; + }); + helpers.copyComponents('react', SupportedLanguage.JAVASCRIPT); + expect(fse.copySync).toHaveBeenCalledWith(expect.anything(), '.', expect.anything()); + }); + + it(`should throw an error for unsupported framework`, () => { + const framework = 'unknown framework' as SupportedFrameworks; + const expectedMessage = `Unsupported framework: ${framework}`; + expect(() => { + helpers.copyComponents(framework, SupportedLanguage.JAVASCRIPT); + }).toThrowError(expectedMessage); + }); }); diff --git a/lib/cli/src/helpers.ts b/lib/cli/src/helpers.ts index 4e345911d346..2d15b4583aeb 100644 --- a/lib/cli/src/helpers.ts +++ b/lib/cli/src/helpers.ts @@ -9,7 +9,7 @@ import stripJsonComments from 'strip-json-comments'; import { latestVersion } from './latest_version'; import { npmInit } from './npm_init'; -import { StoryFormat } from './project_types'; +import { StoryFormat, SupportedFrameworks, SupportedLanguage } from './project_types'; import { PackageJson } from './PackageJson'; import { NpmOptions } from './NpmOptions'; @@ -328,6 +328,16 @@ export function addToDevDependenciesIfNotPresent( export function copyTemplate(templateRoot: string, storyFormat: StoryFormat) { const templateDir = path.resolve(templateRoot, `template-${storyFormat}/`); + const newTemplates = [/WEBPACK_REACT/, /REACT/, /REACT_SCRIPTS/]; + const reactNative = /REACT_NATIVE/; + if ( + newTemplates.some((t) => templateRoot.match(t)) && + storyFormat !== StoryFormat.MDX && + !templateRoot.match(reactNative) + ) { + return; + } + if (!fs.existsSync(templateDir)) { // Fallback to CSF plain first, in case format is typescript but template is not available. if (storyFormat === StoryFormat.CSF_TYPESCRIPT) { @@ -339,3 +349,42 @@ export function copyTemplate(templateRoot: string, storyFormat: StoryFormat) { } fse.copySync(templateDir, '.', { overwrite: true }); } + +export function copyComponents(framework: SupportedFrameworks, language: SupportedLanguage) { + const languageFolderMapping: { [key in SupportedLanguage]: string } = { + javascript: 'js', + typescript: 'ts', + }; + const componentsPath = () => { + const frameworkPath = `frameworks/${framework}`; + const languageSpecific = path.resolve( + __dirname, + `${frameworkPath}/${languageFolderMapping[language]}` + ); + if (fse.existsSync(languageSpecific)) { + return languageSpecific; + } + const jsFallback = path.resolve( + __dirname, + `${frameworkPath}/${languageFolderMapping.javascript}` + ); + if (fse.existsSync(jsFallback)) { + return jsFallback; + } + const frameworkRootPath = path.resolve(__dirname, frameworkPath); + if (fse.existsSync(frameworkRootPath)) { + return frameworkRootPath; + } + throw new Error(`Unsupported framework: ${framework}`); + }; + + const targetPath = () => { + if (fse.existsSync('./src')) { + return './src/stories'; + } + return './stories'; + }; + + const destinationPath = targetPath(); + fse.copySync(componentsPath(), destinationPath, { overwrite: true }); +} diff --git a/lib/cli/src/initiate.ts b/lib/cli/src/initiate.ts index 1c080c029a09..7a5f7c6f2a3c 100644 --- a/lib/cli/src/initiate.ts +++ b/lib/cli/src/initiate.ts @@ -58,13 +58,13 @@ const installStorybook = (projectType: ProjectType, options: CommandOptions): Pr skipInstall: options.skipInstall, }; + const language = detectLanguage(); const defaultStoryFormat = - detectLanguage() === SupportedLanguage.TYPESCRIPT - ? StoryFormat.CSF_TYPESCRIPT - : StoryFormat.CSF; + language === SupportedLanguage.TYPESCRIPT ? StoryFormat.CSF_TYPESCRIPT : StoryFormat.CSF; const generatorOptions = { storyFormat: options.storyFormat || defaultStoryFormat, + language, }; const runStorybookCommand = useYarn ? 'yarn storybook' : 'npm run storybook'; diff --git a/lib/cli/src/project_types.ts b/lib/cli/src/project_types.ts index 48df5d200767..35cf14657a83 100644 --- a/lib/cli/src/project_types.ts +++ b/lib/cli/src/project_types.ts @@ -1,3 +1,4 @@ +// Should match @storybook/ export type SupportedFrameworks = | 'react' | 'react-native' @@ -11,7 +12,10 @@ export type SupportedFrameworks = | 'meteor' | 'preact' | 'svelte' - | 'rax'; + | 'rax' + | 'aurelia' + | 'html' + | 'web-components'; export enum ProjectType { UNDETECTED = 'UNDETECTED', diff --git a/lib/cli/tsconfig.json b/lib/cli/tsconfig.json index c4e40706894b..d87605d41afd 100644 --- a/lib/cli/tsconfig.json +++ b/lib/cli/tsconfig.json @@ -12,5 +12,5 @@ "noFallthroughCasesInSwitch": true }, "include": ["src/**/*"], - "exclude": ["src/**/template*"] + "exclude": ["src/**/template*", "src/frameworks/**/*"] } diff --git a/scripts/prepare.js b/scripts/prepare.js index 19e50ee6bccf..84c397565b51 100644 --- a/scripts/prepare.js +++ b/scripts/prepare.js @@ -34,9 +34,16 @@ function cleanup() { if (fs.existsSync(path.join(process.cwd(), 'dist'))) { const files = shell.find('dist').filter((filePath) => { // Do not remove folder - // And do not clean anything for @storybook/cli/dist/generators/**/template* because these are the template files + // And do not clean anything for: + // - @storybook/cli/dist/generators/**/template* + // - @storybook/cli/dist/frameworks/* + // because these are the template files // that will be copied to init SB on users' projects - if (fs.lstatSync(filePath).isDirectory() || /generators\/.+\/template.*/.test(filePath)) { + if ( + fs.lstatSync(filePath).isDirectory() || + /generators\/.+\/template.*/.test(filePath) || + /dist\/frameworks\/.*/.test(filePath) + ) { return false; } From b2d57445fa7ca41c11b37a3511f1a64c9812813f Mon Sep 17 00:00:00 2001 From: tooppaaa Date: Mon, 25 May 2020 16:12:13 +0200 Subject: [PATCH 03/47] fix build --- lib/cli/src/generators/ANGULAR/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/cli/src/generators/ANGULAR/index.ts b/lib/cli/src/generators/ANGULAR/index.ts index 0a9c387ec980..f2587a863a8d 100644 --- a/lib/cli/src/generators/ANGULAR/index.ts +++ b/lib/cli/src/generators/ANGULAR/index.ts @@ -64,7 +64,7 @@ function editAngularAppTsConfig() { writeFileAsJson(getAngularAppTsConfigPath(), tsConfigJson); } -const generator: Generator = async (npmOptions, { storyFormat }) => { +const generator: Generator = async (npmOptions, { storyFormat, language }) => { if (!isDefaultProjectSet()) { throw new Error( 'Could not find a default project in your Angular workspace.\nSet a defaultProject in your angular.json and re-run the installation.' @@ -73,7 +73,7 @@ const generator: Generator = async (npmOptions, { storyFormat }) => { copyTemplate(__dirname, storyFormat); - await addDependencies(npmOptions, { storyFormat }); + await addDependencies(npmOptions, { storyFormat, language }); editAngularAppTsConfig(); editStorybookTsConfig(path.resolve('./.storybook/tsconfig.json')); }; From fb1a12416da157b465f911045b46b4778ce6aa10 Mon Sep 17 00:00:00 2001 From: tooppaaa Date: Mon, 25 May 2020 16:58:51 +0200 Subject: [PATCH 04/47] fixes --- lib/cli/src/generators/REACT/index.ts | 5 ++++- .../REACT/template-csf/.storybook/main.js | 4 ---- .../REACT/template-mdx/.storybook/main.js | 14 -------------- .../template-mdx/stories/0-Welcome.stories.mdx | 4 ++-- .../template-mdx/stories/1-Button.stories.mdx | 4 ++-- lib/cli/src/generators/REACT_SCRIPTS/index.ts | 6 +++++- .../template-csf/.storybook/main.js | 8 -------- .../template-mdx/.storybook/main.js | 17 ----------------- .../template-mdx/stories/0-Welcome.stories.mdx | 4 ++-- .../template-mdx/stories/1-Button.stories.mdx | 4 ++-- lib/cli/src/generators/WEBPACK_REACT/index.ts | 5 ++++- .../template-mdx/stories/0-Welcome.stories.mdx | 4 ++-- .../template-mdx/stories/1-Button.stories.mdx | 4 ++-- lib/cli/src/generators/configure.ts | 1 + lib/cli/src/generators/generator.ts | 18 +++++++++++++++--- lib/cli/src/helpers.ts | 6 ++---- 16 files changed, 43 insertions(+), 65 deletions(-) delete mode 100644 lib/cli/src/generators/REACT/template-csf/.storybook/main.js delete mode 100644 lib/cli/src/generators/REACT/template-mdx/.storybook/main.js delete mode 100644 lib/cli/src/generators/REACT_SCRIPTS/template-csf/.storybook/main.js delete mode 100644 lib/cli/src/generators/REACT_SCRIPTS/template-mdx/.storybook/main.js diff --git a/lib/cli/src/generators/REACT/index.ts b/lib/cli/src/generators/REACT/index.ts index 117af995d217..3d6e7120e850 100644 --- a/lib/cli/src/generators/REACT/index.ts +++ b/lib/cli/src/generators/REACT/index.ts @@ -1,7 +1,10 @@ import baseGenerator, { Generator } from '../generator'; +import { StoryFormat } from '../../project_types'; const generator: Generator = async (npmOptions, options) => { - baseGenerator(npmOptions, options, 'react'); + await baseGenerator(npmOptions, options, 'react', { + dirname: options.storyFormat === StoryFormat.MDX ? __dirname : undefined, + }); }; export default generator; diff --git a/lib/cli/src/generators/REACT/template-csf/.storybook/main.js b/lib/cli/src/generators/REACT/template-csf/.storybook/main.js deleted file mode 100644 index 2271016abe6b..000000000000 --- a/lib/cli/src/generators/REACT/template-csf/.storybook/main.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - stories: ['../src/**/*.stories.(ts|tsx|js|jsx)'], - addons: ['@storybook/addon-actions', '@storybook/addon-links'], -}; diff --git a/lib/cli/src/generators/REACT/template-mdx/.storybook/main.js b/lib/cli/src/generators/REACT/template-mdx/.storybook/main.js deleted file mode 100644 index c698efe5509d..000000000000 --- a/lib/cli/src/generators/REACT/template-mdx/.storybook/main.js +++ /dev/null @@ -1,14 +0,0 @@ -module.exports = { - stories: [ - '../src/**/*.stories.(ts|tsx|js|jsx|mdx)', - '../stories/**/*.stories.(ts|tsx|js|jsx|mdx)', - ], - addons: [ - '@storybook/addon-actions', - '@storybook/addon-links', - { - name: '@storybook/addon-docs', - options: { configureJSX: true }, - }, - ], -}; diff --git a/lib/cli/src/generators/REACT/template-mdx/stories/0-Welcome.stories.mdx b/lib/cli/src/generators/REACT/template-mdx/stories/0-Welcome.stories.mdx index 4e0f04619efe..705382f9fa56 100644 --- a/lib/cli/src/generators/REACT/template-mdx/stories/0-Welcome.stories.mdx +++ b/lib/cli/src/generators/REACT/template-mdx/stories/0-Welcome.stories.mdx @@ -1,8 +1,8 @@ import { Meta, Story, Preview } from '@storybook/addon-docs/blocks'; import { linkTo } from '@storybook/addon-links'; -import Welcome from '../Welcome'; +import Welcome from './Welcome'; - + # Welcome diff --git a/lib/cli/src/generators/REACT/template-mdx/stories/1-Button.stories.mdx b/lib/cli/src/generators/REACT/template-mdx/stories/1-Button.stories.mdx index 09554ab784a8..9688920f604b 100644 --- a/lib/cli/src/generators/REACT/template-mdx/stories/1-Button.stories.mdx +++ b/lib/cli/src/generators/REACT/template-mdx/stories/1-Button.stories.mdx @@ -1,8 +1,8 @@ import { action } from '@storybook/addon-actions'; import { Meta, Story } from '@storybook/addon-docs/blocks'; -import Button from '../Button'; +import Button from './Button'; - + # Button diff --git a/lib/cli/src/generators/REACT_SCRIPTS/index.ts b/lib/cli/src/generators/REACT_SCRIPTS/index.ts index a06f24bfb011..28ac3d70c4b2 100644 --- a/lib/cli/src/generators/REACT_SCRIPTS/index.ts +++ b/lib/cli/src/generators/REACT_SCRIPTS/index.ts @@ -3,9 +3,13 @@ import fs from 'fs'; import { retrievePackageJson, writePackageJson } from '../../helpers'; import baseGenerator, { Generator } from '../generator'; +import { StoryFormat } from '../../project_types'; const generator: Generator = async (npmOptions, options) => { - await baseGenerator(npmOptions, options, 'react', [], ['@storybook/preset-create-react-app']); + await baseGenerator(npmOptions, options, 'react', { + extraAddons: ['@storybook/preset-create-react-app'], + dirname: options.storyFormat === StoryFormat.MDX ? __dirname : undefined, + }); if (fs.existsSync(path.resolve('./public'))) { const packageJson = await retrievePackageJson(); // has a public folder and add support to it. diff --git a/lib/cli/src/generators/REACT_SCRIPTS/template-csf/.storybook/main.js b/lib/cli/src/generators/REACT_SCRIPTS/template-csf/.storybook/main.js deleted file mode 100644 index cd20fe295779..000000000000 --- a/lib/cli/src/generators/REACT_SCRIPTS/template-csf/.storybook/main.js +++ /dev/null @@ -1,8 +0,0 @@ -module.exports = { - stories: ['../src/**/*.stories.(ts|tsx|js|jsx)'], - addons: [ - '@storybook/preset-create-react-app', - '@storybook/addon-actions', - '@storybook/addon-links', - ], -}; diff --git a/lib/cli/src/generators/REACT_SCRIPTS/template-mdx/.storybook/main.js b/lib/cli/src/generators/REACT_SCRIPTS/template-mdx/.storybook/main.js deleted file mode 100644 index 6181a3b86505..000000000000 --- a/lib/cli/src/generators/REACT_SCRIPTS/template-mdx/.storybook/main.js +++ /dev/null @@ -1,17 +0,0 @@ -module.exports = { - stories: [ - '../src/**/*.stories.(ts|tsx|js|jsx|mdx)', - '../stories/**/*.stories.(ts|tsx|js|jsx|mdx)', - ], - addons: [ - '@storybook/addon-actions', - '@storybook/addon-links', - '@storybook/preset-create-react-app', - { - name: '@storybook/addon-docs', - options: { - configureJSX: true, - }, - }, - ], -}; diff --git a/lib/cli/src/generators/REACT_SCRIPTS/template-mdx/stories/0-Welcome.stories.mdx b/lib/cli/src/generators/REACT_SCRIPTS/template-mdx/stories/0-Welcome.stories.mdx index 3e250967895c..705382f9fa56 100644 --- a/lib/cli/src/generators/REACT_SCRIPTS/template-mdx/stories/0-Welcome.stories.mdx +++ b/lib/cli/src/generators/REACT_SCRIPTS/template-mdx/stories/0-Welcome.stories.mdx @@ -1,8 +1,8 @@ import { Meta, Story, Preview } from '@storybook/addon-docs/blocks'; import { linkTo } from '@storybook/addon-links'; -import Welcome from '../src/Welcome'; +import Welcome from './Welcome'; - + # Welcome diff --git a/lib/cli/src/generators/REACT_SCRIPTS/template-mdx/stories/1-Button.stories.mdx b/lib/cli/src/generators/REACT_SCRIPTS/template-mdx/stories/1-Button.stories.mdx index 8005ba7e0e0b..2abc573287c6 100644 --- a/lib/cli/src/generators/REACT_SCRIPTS/template-mdx/stories/1-Button.stories.mdx +++ b/lib/cli/src/generators/REACT_SCRIPTS/template-mdx/stories/1-Button.stories.mdx @@ -1,8 +1,8 @@ import { Meta, Story, Preview } from '@storybook/addon-docs/blocks'; import { action } from '@storybook/addon-actions'; -import Button from '../src/Button'; +import Button from './Button'; - + # Button diff --git a/lib/cli/src/generators/WEBPACK_REACT/index.ts b/lib/cli/src/generators/WEBPACK_REACT/index.ts index 117af995d217..98bcc8af2986 100644 --- a/lib/cli/src/generators/WEBPACK_REACT/index.ts +++ b/lib/cli/src/generators/WEBPACK_REACT/index.ts @@ -1,7 +1,10 @@ import baseGenerator, { Generator } from '../generator'; +import { StoryFormat } from '../../project_types'; const generator: Generator = async (npmOptions, options) => { - baseGenerator(npmOptions, options, 'react'); + baseGenerator(npmOptions, options, 'react', { + dirname: options.storyFormat === StoryFormat.MDX ? __dirname : undefined, + }); }; export default generator; diff --git a/lib/cli/src/generators/WEBPACK_REACT/template-mdx/stories/0-Welcome.stories.mdx b/lib/cli/src/generators/WEBPACK_REACT/template-mdx/stories/0-Welcome.stories.mdx index 3e250967895c..705382f9fa56 100644 --- a/lib/cli/src/generators/WEBPACK_REACT/template-mdx/stories/0-Welcome.stories.mdx +++ b/lib/cli/src/generators/WEBPACK_REACT/template-mdx/stories/0-Welcome.stories.mdx @@ -1,8 +1,8 @@ import { Meta, Story, Preview } from '@storybook/addon-docs/blocks'; import { linkTo } from '@storybook/addon-links'; -import Welcome from '../src/Welcome'; +import Welcome from './Welcome'; - + # Welcome diff --git a/lib/cli/src/generators/WEBPACK_REACT/template-mdx/stories/1-Button.stories.mdx b/lib/cli/src/generators/WEBPACK_REACT/template-mdx/stories/1-Button.stories.mdx index e7606083b0a3..329ea1da39c1 100644 --- a/lib/cli/src/generators/WEBPACK_REACT/template-mdx/stories/1-Button.stories.mdx +++ b/lib/cli/src/generators/WEBPACK_REACT/template-mdx/stories/1-Button.stories.mdx @@ -1,8 +1,8 @@ import { Meta, Story } from '@storybook/addon-docs/blocks'; import { action } from '@storybook/addon-actions'; -import Button from '../src/Button'; +import Button from './Button'; - + # Button diff --git a/lib/cli/src/generators/configure.ts b/lib/cli/src/generators/configure.ts index 333576de9b33..710986f3713a 100644 --- a/lib/cli/src/generators/configure.ts +++ b/lib/cli/src/generators/configure.ts @@ -10,6 +10,7 @@ function mainConfigurationGenerator(addons?: string[], custom?: any) { }; const stringified = `module.exports = ${JSON.stringify(config, null, 2)}`; + fse.ensureDirSync('./.storybook'); fse.writeFileSync('./.storybook/main.js', stringified, { encoding: 'utf8' }); } diff --git a/lib/cli/src/generators/generator.ts b/lib/cli/src/generators/generator.ts index 1a0b7ce3206f..ab6ad6fde4a2 100644 --- a/lib/cli/src/generators/generator.ts +++ b/lib/cli/src/generators/generator.ts @@ -16,18 +16,30 @@ export type GeneratorOptions = { storyFormat: StoryFormat; }; +export interface FrameworkOptions { + extraPackages?: string[]; + extraAddons?: string[]; + dirname?: string; +} + export type Generator = (npmOptions: NpmOptions, options: GeneratorOptions) => Promise; +const defaultOptions: FrameworkOptions = { + extraPackages: [], + extraAddons: [], + dirname: __dirname, +}; const generator = async ( npmOptions: NpmOptions, { storyFormat, language }: GeneratorOptions, framework: SupportedFrameworks, - extraPackages?: string[], - extraAddons?: string[] + options: FrameworkOptions = defaultOptions ) => { + const { extraAddons, extraPackages, dirname } = { ...defaultOptions, ...options }; const packages = [ `@storybook/${framework}`, '@storybook/addon-essentials', + '@storybook/addon-actions', '@storybook/addon-links', ...extraPackages, ...extraAddons, @@ -36,7 +48,7 @@ const generator = async ( configure(extraAddons); copyComponents(framework, language); - copyTemplate(__dirname, storyFormat); + copyTemplate(dirname, storyFormat); const packageJson = await retrievePackageJson(); diff --git a/lib/cli/src/helpers.ts b/lib/cli/src/helpers.ts index 2d15b4583aeb..ba6b3798aad6 100644 --- a/lib/cli/src/helpers.ts +++ b/lib/cli/src/helpers.ts @@ -328,12 +328,10 @@ export function addToDevDependenciesIfNotPresent( export function copyTemplate(templateRoot: string, storyFormat: StoryFormat) { const templateDir = path.resolve(templateRoot, `template-${storyFormat}/`); - const newTemplates = [/WEBPACK_REACT/, /REACT/, /REACT_SCRIPTS/]; - const reactNative = /REACT_NATIVE/; + console.log('templateRoot', templateRoot); if ( - newTemplates.some((t) => templateRoot.match(t)) && storyFormat !== StoryFormat.MDX && - !templateRoot.match(reactNative) + templateRoot.match(/generators$/) // Means we're using base config and migrated ) { return; } From 8434dcc2b2b2b084350844e412d08e589176140e Mon Sep 17 00:00:00 2001 From: tooppaaa Date: Mon, 25 May 2020 17:20:44 +0200 Subject: [PATCH 05/47] fix tests --- lib/cli/src/generators/generator.ts | 2 +- lib/cli/src/helpers.ts | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/cli/src/generators/generator.ts b/lib/cli/src/generators/generator.ts index ab6ad6fde4a2..b7e638116a19 100644 --- a/lib/cli/src/generators/generator.ts +++ b/lib/cli/src/generators/generator.ts @@ -48,7 +48,7 @@ const generator = async ( configure(extraAddons); copyComponents(framework, language); - copyTemplate(dirname, storyFormat); + copyTemplate(dirname || __dirname, storyFormat); const packageJson = await retrievePackageJson(); diff --git a/lib/cli/src/helpers.ts b/lib/cli/src/helpers.ts index ba6b3798aad6..3e9d8df38e0d 100644 --- a/lib/cli/src/helpers.ts +++ b/lib/cli/src/helpers.ts @@ -328,7 +328,6 @@ export function addToDevDependenciesIfNotPresent( export function copyTemplate(templateRoot: string, storyFormat: StoryFormat) { const templateDir = path.resolve(templateRoot, `template-${storyFormat}/`); - console.log('templateRoot', templateRoot); if ( storyFormat !== StoryFormat.MDX && templateRoot.match(/generators$/) // Means we're using base config and migrated From 8673294311b3bc79cc4e9d4eccad39ee0d6c5071 Mon Sep 17 00:00:00 2001 From: tooppaaa Date: Mon, 25 May 2020 17:37:34 +0200 Subject: [PATCH 06/47] fix unit test --- lib/cli/src/helpers.test.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/cli/src/helpers.test.ts b/lib/cli/src/helpers.test.ts index a6c1503c86e9..dd2b59cf614c 100644 --- a/lib/cli/src/helpers.test.ts +++ b/lib/cli/src/helpers.test.ts @@ -11,6 +11,7 @@ jest.mock('fs', () => ({ jest.mock('fs-extra', () => ({ copySync: jest.fn(() => ({})), ensureDir: jest.fn(() => {}), + existsSync: jest.fn(), })); jest.mock('path', () => ({ From 2b5372ee798a0e4c4799136cd35bf4459081d3a7 Mon Sep 17 00:00:00 2001 From: tooppaaa Date: Mon, 25 May 2020 17:39:24 +0200 Subject: [PATCH 07/47] fix lint --- lib/cli/src/.eslintrc.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/cli/src/.eslintrc.js b/lib/cli/src/.eslintrc.js index 3625258646f3..fe5159bc5894 100644 --- a/lib/cli/src/.eslintrc.js +++ b/lib/cli/src/.eslintrc.js @@ -10,6 +10,7 @@ module.exports = { rules: { 'react/no-this-in-sfc': ignore, 'import/no-unresolved': ignore, + 'react/react-in-jsx-scope': ignore, 'import/no-extraneous-dependencies': ignore, 'global-require': ignore, }, From 93eaae00a1ddde6c401b5e49b2f447eec3f222b3 Mon Sep 17 00:00:00 2001 From: tooppaaa Date: Mon, 25 May 2020 18:41:59 +0200 Subject: [PATCH 08/47] fix tests --- lib/cli/src/generators/configure.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/cli/src/generators/configure.ts b/lib/cli/src/generators/configure.ts index 710986f3713a..cd9e86432b52 100644 --- a/lib/cli/src/generators/configure.ts +++ b/lib/cli/src/generators/configure.ts @@ -4,7 +4,9 @@ function mainConfigurationGenerator(addons?: string[], custom?: any) { const hasSrc = fse.existsSync('./src'); const config = { - stories: ['../stories/**/*.stories.*', hasSrc && '../src/**/*.stories.*'].filter(Boolean), + stories: [!hasSrc && '../stories/**/*.stories.*', hasSrc && '../src/**/*.stories.*'].filter( + Boolean + ), addons: ['@storybook/addon-essentials', '@storybook/addon-links', ...addons], ...custom, }; From 665163dfb0e99173e624707236df8fcf26689721 Mon Sep 17 00:00:00 2001 From: tooppaaa Date: Mon, 25 May 2020 18:43:25 +0200 Subject: [PATCH 09/47] fix unit test --- lib/cli/src/helpers.test.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/cli/src/helpers.test.ts b/lib/cli/src/helpers.test.ts index dd2b59cf614c..6aca0d062250 100644 --- a/lib/cli/src/helpers.test.ts +++ b/lib/cli/src/helpers.test.ts @@ -88,7 +88,11 @@ describe('Helpers', () => { return filePath === 'frameworks/react' || filePath === './src'; }); helpers.copyComponents('react', SupportedLanguage.JAVASCRIPT); - expect(fse.copySync).toHaveBeenCalledWith(expect.anything(), './src', expect.anything()); + expect(fse.copySync).toHaveBeenCalledWith( + expect.anything(), + './src/stories', + expect.anything() + ); }); it(`should copy to root folder when src doesn't exist`, () => { @@ -96,7 +100,7 @@ describe('Helpers', () => { return filePath === 'frameworks/react'; }); helpers.copyComponents('react', SupportedLanguage.JAVASCRIPT); - expect(fse.copySync).toHaveBeenCalledWith(expect.anything(), '.', expect.anything()); + expect(fse.copySync).toHaveBeenCalledWith(expect.anything(), './stories', expect.anything()); }); it(`should throw an error for unsupported framework`, () => { From 7cf2595cfa8ea4207475795dee35c39bc0d2ac1c Mon Sep 17 00:00:00 2001 From: tooppaaa Date: Tue, 26 May 2020 21:39:16 +0200 Subject: [PATCH 10/47] Feedbacks --- lib/cli/src/frameworks/react/js/0-Welcome.stories.js | 2 +- lib/cli/src/frameworks/react/js/1-Button.stories.js | 2 +- lib/cli/src/frameworks/react/js/Button.jsx | 4 +--- lib/cli/src/frameworks/react/js/Welcome.jsx | 4 +--- lib/cli/src/frameworks/react/ts/0-Welcome.stories.tsx | 2 +- lib/cli/src/frameworks/react/ts/1-Button.stories.tsx | 2 +- lib/cli/src/frameworks/react/ts/Button.tsx | 4 ++-- lib/cli/src/frameworks/react/ts/Welcome.tsx | 4 ++-- 8 files changed, 10 insertions(+), 14 deletions(-) diff --git a/lib/cli/src/frameworks/react/js/0-Welcome.stories.js b/lib/cli/src/frameworks/react/js/0-Welcome.stories.js index 1274ca16a4ff..4c2d95bdb227 100644 --- a/lib/cli/src/frameworks/react/js/0-Welcome.stories.js +++ b/lib/cli/src/frameworks/react/js/0-Welcome.stories.js @@ -1,6 +1,6 @@ import React from 'react'; import { linkTo } from '@storybook/addon-links'; -import Welcome from './Welcome'; +import { Welcome } from './Welcome'; export default { title: 'Welcome', diff --git a/lib/cli/src/frameworks/react/js/1-Button.stories.js b/lib/cli/src/frameworks/react/js/1-Button.stories.js index 57f15cf2a479..abe7d581770b 100644 --- a/lib/cli/src/frameworks/react/js/1-Button.stories.js +++ b/lib/cli/src/frameworks/react/js/1-Button.stories.js @@ -1,7 +1,7 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; import { linkTo } from '@storybook/addon-links'; -import Button from './Button'; +import { Button } from './Button'; export default { title: 'Button', diff --git a/lib/cli/src/frameworks/react/js/Button.jsx b/lib/cli/src/frameworks/react/js/Button.jsx index 8b431e3d0e57..0b9a6baeb6a1 100644 --- a/lib/cli/src/frameworks/react/js/Button.jsx +++ b/lib/cli/src/frameworks/react/js/Button.jsx @@ -10,10 +10,8 @@ const styles = { margin: 10, }; -const Button = ({ children, onClick }) => ( +export const Button = ({ children, onClick }) => ( ); - -export default Button; diff --git a/lib/cli/src/frameworks/react/js/Welcome.jsx b/lib/cli/src/frameworks/react/js/Welcome.jsx index 42328a1b4fc7..45d25f6ebafd 100644 --- a/lib/cli/src/frameworks/react/js/Welcome.jsx +++ b/lib/cli/src/frameworks/react/js/Welcome.jsx @@ -79,7 +79,7 @@ const NavButton = ({ children, onClick, ...props }) => ( ); -const Welcome = ({ showApp }) => ( +export const Welcome = ({ showApp }) => (
Welcome to storybook

This is a UI component dev environment for your app.

@@ -124,5 +124,3 @@ const Welcome = ({ showApp }) => (
); - -export default Welcome; diff --git a/lib/cli/src/frameworks/react/ts/0-Welcome.stories.tsx b/lib/cli/src/frameworks/react/ts/0-Welcome.stories.tsx index 1274ca16a4ff..4c2d95bdb227 100644 --- a/lib/cli/src/frameworks/react/ts/0-Welcome.stories.tsx +++ b/lib/cli/src/frameworks/react/ts/0-Welcome.stories.tsx @@ -1,6 +1,6 @@ import React from 'react'; import { linkTo } from '@storybook/addon-links'; -import Welcome from './Welcome'; +import { Welcome } from './Welcome'; export default { title: 'Welcome', diff --git a/lib/cli/src/frameworks/react/ts/1-Button.stories.tsx b/lib/cli/src/frameworks/react/ts/1-Button.stories.tsx index 57f15cf2a479..abe7d581770b 100644 --- a/lib/cli/src/frameworks/react/ts/1-Button.stories.tsx +++ b/lib/cli/src/frameworks/react/ts/1-Button.stories.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; import { linkTo } from '@storybook/addon-links'; -import Button from './Button'; +import { Button } from './Button'; export default { title: 'Button', diff --git a/lib/cli/src/frameworks/react/ts/Button.tsx b/lib/cli/src/frameworks/react/ts/Button.tsx index bd79304547b2..42b1313f8bf1 100644 --- a/lib/cli/src/frameworks/react/ts/Button.tsx +++ b/lib/cli/src/frameworks/react/ts/Button.tsx @@ -10,8 +10,8 @@ const styles = { margin: 10, }; -type Props = Pick, 'onClick'>; -const Button: FunctionComponent = ({ children, onClick }) => ( +export type ButtonProps = HTMLAttributes; +export const Button: FunctionComponent = ({ children, onClick }: ButtonProps) => ( diff --git a/lib/cli/src/frameworks/react/ts/Welcome.tsx b/lib/cli/src/frameworks/react/ts/Welcome.tsx index 2d5d35e5000a..3d0885f6bbdc 100644 --- a/lib/cli/src/frameworks/react/ts/Welcome.tsx +++ b/lib/cli/src/frameworks/react/ts/Welcome.tsx @@ -106,10 +106,10 @@ const NavButton: FunctionComponent = ({ children, onClick, ...pr ); -interface WelcomeProps { +export interface WelcomeProps { showApp: () => void; } -const Welcome: FunctionComponent = ({ showApp }) => ( +export const Welcome: FunctionComponent = ({ showApp }: WelcomeProps) => (
Welcome to storybook

This is a UI component dev environment for your app.

From f535af4519a4bad11154f31c907b28b241d3c752 Mon Sep 17 00:00:00 2001 From: tooppaaa Date: Tue, 26 May 2020 22:10:47 +0200 Subject: [PATCH 11/47] Move ember --- .../ember}/0-Welcome.stories.js | 0 .../ember}/1-Button.stories.js | 0 lib/cli/src/generators/EMBER/index.ts | 72 ++++--------------- .../EMBER/template-csf/.storybook/main.js | 4 -- lib/cli/src/generators/REACT_SCRIPTS/index.ts | 9 +-- lib/cli/src/generators/generator.ts | 9 ++- 6 files changed, 21 insertions(+), 73 deletions(-) rename lib/cli/src/{generators/EMBER/template-csf/stories => frameworks/ember}/0-Welcome.stories.js (100%) rename lib/cli/src/{generators/EMBER/template-csf/stories => frameworks/ember}/1-Button.stories.js (100%) delete mode 100644 lib/cli/src/generators/EMBER/template-csf/.storybook/main.js diff --git a/lib/cli/src/generators/EMBER/template-csf/stories/0-Welcome.stories.js b/lib/cli/src/frameworks/ember/0-Welcome.stories.js similarity index 100% rename from lib/cli/src/generators/EMBER/template-csf/stories/0-Welcome.stories.js rename to lib/cli/src/frameworks/ember/0-Welcome.stories.js diff --git a/lib/cli/src/generators/EMBER/template-csf/stories/1-Button.stories.js b/lib/cli/src/frameworks/ember/1-Button.stories.js similarity index 100% rename from lib/cli/src/generators/EMBER/template-csf/stories/1-Button.stories.js rename to lib/cli/src/frameworks/ember/1-Button.stories.js diff --git a/lib/cli/src/generators/EMBER/index.ts b/lib/cli/src/generators/EMBER/index.ts index 5ce6864cf87e..5560a8e453b3 100644 --- a/lib/cli/src/generators/EMBER/index.ts +++ b/lib/cli/src/generators/EMBER/index.ts @@ -1,61 +1,17 @@ -import { - getVersions, - retrievePackageJson, - writePackageJson, - getBabelDependencies, - installDependencies, - copyTemplate, -} from '../../helpers'; -import { Generator } from '../generator'; - -const generator: Generator = async (npmOptions, { storyFormat }) => { - const [ - storybookVersion, - babelPluginEmberModulePolyfillVersion, - babelPluginHtmlBarsInlinePrecompileVersion, - linksVersion, - actionsVersion, - addonsVersion, - ] = await getVersions( - npmOptions, - '@storybook/ember', - // babel-plugin-ember-modules-api-polyfill is a peerDep of @storybook/ember - 'babel-plugin-ember-modules-api-polyfill', - // babel-plugin-htmlbars-inline-precompile is a peerDep of @storybook/ember - 'babel-plugin-htmlbars-inline-precompile', - '@storybook/addon-links', - '@storybook/addon-actions', - '@storybook/addons' - ); - - copyTemplate(__dirname, storyFormat); - - const packageJson = await retrievePackageJson(); - - packageJson.dependencies = packageJson.dependencies || {}; - packageJson.devDependencies = packageJson.devDependencies || {}; - - packageJson.scripts = { - ...packageJson.scripts, - ...{ - storybook: 'start-storybook -p 6006 -s dist', - 'build-storybook': 'build-storybook -s dist', - }, - }; - - writePackageJson(packageJson); - - const babelDependencies = await getBabelDependencies(npmOptions, packageJson); - - installDependencies({ ...npmOptions, packageJson }, [ - `@storybook/ember@${storybookVersion}`, - `@storybook/addon-actions@${actionsVersion}`, - `@storybook/addon-links@${linksVersion}`, - `@storybook/addons@${addonsVersion}`, - `babel-plugin-ember-modules-api-polyfill@${babelPluginEmberModulePolyfillVersion}`, - `babel-plugin-htmlbars-inline-precompile@${babelPluginHtmlBarsInlinePrecompileVersion}`, - ...babelDependencies, - ]); +import baseGenerator, { Generator } from '../generator'; +import { StoryFormat } from '../../project_types'; + +const generator: Generator = async (npmOptions, options) => { + baseGenerator(npmOptions, options, 'ember', { + dirname: options.storyFormat === StoryFormat.MDX ? __dirname : undefined, + extraPackages: [ + // babel-plugin-ember-modules-api-polyfill is a peerDep of @storybook/ember + 'babel-plugin-ember-modules-api-polyfill', + // babel-plugin-htmlbars-inline-precompile is a peerDep of @storybook/ember + 'babel-plugin-htmlbars-inline-precompile', + ], + staticDir: 'dist', + }); }; export default generator; diff --git a/lib/cli/src/generators/EMBER/template-csf/.storybook/main.js b/lib/cli/src/generators/EMBER/template-csf/.storybook/main.js deleted file mode 100644 index 3036098563cc..000000000000 --- a/lib/cli/src/generators/EMBER/template-csf/.storybook/main.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - stories: ['../stories/**/*.stories.js'], - addons: ['@storybook/addon-actions', '@storybook/addon-links'], -}; diff --git a/lib/cli/src/generators/REACT_SCRIPTS/index.ts b/lib/cli/src/generators/REACT_SCRIPTS/index.ts index 28ac3d70c4b2..6112ab646032 100644 --- a/lib/cli/src/generators/REACT_SCRIPTS/index.ts +++ b/lib/cli/src/generators/REACT_SCRIPTS/index.ts @@ -1,6 +1,5 @@ import path from 'path'; import fs from 'fs'; -import { retrievePackageJson, writePackageJson } from '../../helpers'; import baseGenerator, { Generator } from '../generator'; import { StoryFormat } from '../../project_types'; @@ -9,14 +8,8 @@ const generator: Generator = async (npmOptions, options) => { await baseGenerator(npmOptions, options, 'react', { extraAddons: ['@storybook/preset-create-react-app'], dirname: options.storyFormat === StoryFormat.MDX ? __dirname : undefined, + staticDir: fs.existsSync(path.resolve('./public')) ? 'public' : undefined, }); - if (fs.existsSync(path.resolve('./public'))) { - const packageJson = await retrievePackageJson(); - // has a public folder and add support to it. - packageJson.scripts.storybook += ' -s public'; - packageJson.scripts['build-storybook'] += ' -s public'; - writePackageJson(packageJson); - } }; export default generator; diff --git a/lib/cli/src/generators/generator.ts b/lib/cli/src/generators/generator.ts index b7e638116a19..7d3b7a68b3bb 100644 --- a/lib/cli/src/generators/generator.ts +++ b/lib/cli/src/generators/generator.ts @@ -20,6 +20,7 @@ export interface FrameworkOptions { extraPackages?: string[]; extraAddons?: string[]; dirname?: string; + staticDir?: string; } export type Generator = (npmOptions: NpmOptions, options: GeneratorOptions) => Promise; @@ -28,6 +29,7 @@ const defaultOptions: FrameworkOptions = { extraPackages: [], extraAddons: [], dirname: __dirname, + staticDir: undefined, }; const generator = async ( npmOptions: NpmOptions, @@ -35,7 +37,7 @@ const generator = async ( framework: SupportedFrameworks, options: FrameworkOptions = defaultOptions ) => { - const { extraAddons, extraPackages, dirname } = { ...defaultOptions, ...options }; + const { extraAddons, extraPackages, dirname, staticDir } = { ...defaultOptions, ...options }; const packages = [ `@storybook/${framework}`, '@storybook/addon-essentials', @@ -55,9 +57,10 @@ const generator = async ( packageJson.dependencies = packageJson.dependencies || {}; packageJson.devDependencies = packageJson.devDependencies || {}; + const staticParameter = staticDir ? `-s ${staticDir}` : ''; packageJson.scripts = packageJson.scripts || {}; - packageJson.scripts.storybook = 'start-storybook -p 6006'; - packageJson.scripts['build-storybook'] = 'build-storybook'; + packageJson.scripts.storybook = `start-storybook -p 6006 ${staticParameter}`.trim(); + packageJson.scripts['build-storybook'] = `build-storybook ${staticParameter}`.trim(); writePackageJson(packageJson); From 2783b12ceab483f654dab270ea7ffa72a5b7ddbf Mon Sep 17 00:00:00 2001 From: tooppaaa Date: Tue, 26 May 2020 22:21:03 +0200 Subject: [PATCH 12/47] Move Meteor --- lib/cli/src/generators/METEOR/index.ts | 84 ++----------------- .../METEOR/template-csf/.storybook/main.js | 4 - .../template-csf/stories/0-Welcome.stories.js | 12 --- .../template-csf/stories/1-Button.stories.js | 18 ---- 4 files changed, 8 insertions(+), 110 deletions(-) delete mode 100644 lib/cli/src/generators/METEOR/template-csf/.storybook/main.js delete mode 100644 lib/cli/src/generators/METEOR/template-csf/stories/0-Welcome.stories.js delete mode 100644 lib/cli/src/generators/METEOR/template-csf/stories/1-Button.stories.js diff --git a/lib/cli/src/generators/METEOR/index.ts b/lib/cli/src/generators/METEOR/index.ts index 94f2c1c21b1c..f638c6d22a8c 100644 --- a/lib/cli/src/generators/METEOR/index.ts +++ b/lib/cli/src/generators/METEOR/index.ts @@ -1,54 +1,14 @@ import fs from 'fs'; import JSON5 from 'json5'; -import { - getVersions, - retrievePackageJson, - writePackageJson, - getBabelDependencies, - installDependencies, - copyTemplate, -} from '../../helpers'; -import { Generator } from '../generator'; +import baseGenerator, { Generator } from '../generator'; +import { StoryFormat } from '../../project_types'; -const generator: Generator = async (npmOptions, { storyFormat }) => { - const [ - storybookVersion, - actionsVersion, - linksVersion, - knobsVersion, - addonsVersion, - reactVersion, - reactDomVersion, - presetEnvVersion, - presetReactVersion, - ] = await getVersions( - npmOptions, - '@storybook/react', - '@storybook/addon-actions', - '@storybook/addon-links', - '@storybook/addon-knobs', - '@storybook/addons', - 'react', - 'react-dom', - '@babel/preset-env', - '@babel/preset-react' - ); - - copyTemplate(__dirname, storyFormat); - - const packageJson = await retrievePackageJson(); - - packageJson.devDependencies = packageJson.devDependencies || {}; - packageJson.scripts = packageJson.scripts || {}; - packageJson.dependencies = packageJson.dependencies || {}; - - const devDependencies = [ - `@storybook/react@${storybookVersion}`, - `@storybook/addon-actions@${actionsVersion}`, - `@storybook/addon-links@${linksVersion}`, - `@storybook/addon-knobs@${knobsVersion}`, - `@storybook/addons@${addonsVersion}`, - ]; +const generator: Generator = async (npmOptions, options) => { + baseGenerator(npmOptions, options, 'react', { + dirname: options.storyFormat === StoryFormat.MDX ? __dirname : undefined, + extraPackages: ['react', 'react-dom', '@babel/preset-env', '@babel/preset-react'], + staticDir: 'dist', + }); // create or update .babelrc let babelrc = null; @@ -63,37 +23,9 @@ const generator: Generator = async (npmOptions, { storyFormat }) => { '@babel/preset-react', ], }; - - devDependencies.push(`@babel/preset-env@${presetEnvVersion}`); - devDependencies.push(`@babel/preset-react@${presetReactVersion}`); } fs.writeFileSync('.babelrc', JSON.stringify(babelrc, null, 2), 'utf8'); - - packageJson.scripts.storybook = 'start-storybook -p 6006'; - packageJson.scripts['build-storybook'] = 'build-storybook'; - - writePackageJson(packageJson); - - const babelDependencies = await getBabelDependencies(npmOptions, packageJson); - - // add react packages. - const dependencies = []; - if (!packageJson.dependencies.react) { - dependencies.push(`react@${reactVersion}`); - } - if (!packageJson.dependencies['react-dom']) { - dependencies.push(`react-dom@${reactDomVersion}`); - } - - if (dependencies.length > 0) { - installDependencies( - { ...npmOptions, packageJson, installAsDevDependencies: false }, - dependencies - ); - } - - installDependencies({ ...npmOptions, packageJson }, [...devDependencies, ...babelDependencies]); }; export default generator; diff --git a/lib/cli/src/generators/METEOR/template-csf/.storybook/main.js b/lib/cli/src/generators/METEOR/template-csf/.storybook/main.js deleted file mode 100644 index c6a06f1fbc34..000000000000 --- a/lib/cli/src/generators/METEOR/template-csf/.storybook/main.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - stories: ['../stories/**/*.stories.js'], - addons: ['@storybook/addon-actions', '@storybook/addon-knobs'], -}; diff --git a/lib/cli/src/generators/METEOR/template-csf/stories/0-Welcome.stories.js b/lib/cli/src/generators/METEOR/template-csf/stories/0-Welcome.stories.js deleted file mode 100644 index 9920a416e1ff..000000000000 --- a/lib/cli/src/generators/METEOR/template-csf/stories/0-Welcome.stories.js +++ /dev/null @@ -1,12 +0,0 @@ -import React from 'react'; -import { linkTo } from '@storybook/addon-links'; -import { Welcome } from '@storybook/react/demo'; - -export default { - title: 'Welcome', - component: Welcome, -}; - -export const ToStorybook = () => ; - -ToStorybook.storyName = 'to Storybook'; diff --git a/lib/cli/src/generators/METEOR/template-csf/stories/1-Button.stories.js b/lib/cli/src/generators/METEOR/template-csf/stories/1-Button.stories.js deleted file mode 100644 index 6bcfa2146627..000000000000 --- a/lib/cli/src/generators/METEOR/template-csf/stories/1-Button.stories.js +++ /dev/null @@ -1,18 +0,0 @@ -import React from 'react'; -import { action } from '@storybook/addon-actions'; -import { Button } from '@storybook/react/demo'; - -export default { - title: 'Button', - component: Button, -}; - -export const Text = () => ; - -export const Emoji = () => ( - -); From 79d6b00cbef8e39cecdd8b8dad5af05553c3096e Mon Sep 17 00:00:00 2001 From: tooppaaa Date: Tue, 26 May 2020 22:22:48 +0200 Subject: [PATCH 13/47] Move mithril --- .../mithril}/0-Welcome.stories.js | 0 .../mithril}/1-Button.stories.js | 0 .../stories => frameworks/mithril}/Button.js | 0 .../stories => frameworks/mithril}/Welcome.js | 0 lib/cli/src/generators/MITHRIL/index.ts | 54 +++---------------- .../MITHRIL/template-csf/.storybook/main.js | 4 -- 6 files changed, 6 insertions(+), 52 deletions(-) rename lib/cli/src/{generators/MITHRIL/template-csf/stories => frameworks/mithril}/0-Welcome.stories.js (100%) rename lib/cli/src/{generators/MITHRIL/template-csf/stories => frameworks/mithril}/1-Button.stories.js (100%) rename lib/cli/src/{generators/MITHRIL/template-csf/stories => frameworks/mithril}/Button.js (100%) rename lib/cli/src/{generators/MITHRIL/template-csf/stories => frameworks/mithril}/Welcome.js (100%) delete mode 100644 lib/cli/src/generators/MITHRIL/template-csf/.storybook/main.js diff --git a/lib/cli/src/generators/MITHRIL/template-csf/stories/0-Welcome.stories.js b/lib/cli/src/frameworks/mithril/0-Welcome.stories.js similarity index 100% rename from lib/cli/src/generators/MITHRIL/template-csf/stories/0-Welcome.stories.js rename to lib/cli/src/frameworks/mithril/0-Welcome.stories.js diff --git a/lib/cli/src/generators/MITHRIL/template-csf/stories/1-Button.stories.js b/lib/cli/src/frameworks/mithril/1-Button.stories.js similarity index 100% rename from lib/cli/src/generators/MITHRIL/template-csf/stories/1-Button.stories.js rename to lib/cli/src/frameworks/mithril/1-Button.stories.js diff --git a/lib/cli/src/generators/MITHRIL/template-csf/stories/Button.js b/lib/cli/src/frameworks/mithril/Button.js similarity index 100% rename from lib/cli/src/generators/MITHRIL/template-csf/stories/Button.js rename to lib/cli/src/frameworks/mithril/Button.js diff --git a/lib/cli/src/generators/MITHRIL/template-csf/stories/Welcome.js b/lib/cli/src/frameworks/mithril/Welcome.js similarity index 100% rename from lib/cli/src/generators/MITHRIL/template-csf/stories/Welcome.js rename to lib/cli/src/frameworks/mithril/Welcome.js diff --git a/lib/cli/src/generators/MITHRIL/index.ts b/lib/cli/src/generators/MITHRIL/index.ts index 271187acd3d2..5f4f46de1b66 100644 --- a/lib/cli/src/generators/MITHRIL/index.ts +++ b/lib/cli/src/generators/MITHRIL/index.ts @@ -1,52 +1,10 @@ -import { - getVersions, - retrievePackageJson, - writePackageJson, - getBabelDependencies, - installDependencies, - copyTemplate, -} from '../../helpers'; -import { Generator } from '../generator'; +import baseGenerator, { Generator } from '../generator'; +import { StoryFormat } from '../../project_types'; -const generator: Generator = async (npmOptions, { storyFormat }) => { - const [ - storybookVersion, - actionsVersion, - linksVersion, - knobsVersion, - addonsVersion, - ] = await getVersions( - npmOptions, - '@storybook/mithril', - '@storybook/addon-actions', - '@storybook/addon-links', - '@storybook/addon-knobs', - '@storybook/addons' - ); - - copyTemplate(__dirname, storyFormat); - - const packageJson = await retrievePackageJson(); - - packageJson.dependencies = packageJson.dependencies || {}; - packageJson.devDependencies = packageJson.devDependencies || {}; - - packageJson.scripts = packageJson.scripts || {}; - packageJson.scripts.storybook = 'start-storybook -p 6006'; - packageJson.scripts['build-storybook'] = 'build-storybook'; - - writePackageJson(packageJson); - - const babelDependencies = await getBabelDependencies(npmOptions, packageJson); - - installDependencies({ ...npmOptions, packageJson }, [ - `@storybook/mithril@${storybookVersion}`, - `@storybook/addon-actions@${actionsVersion}`, - `@storybook/addon-links@${linksVersion}`, - `@storybook/addon-knobs@${knobsVersion}`, - `@storybook/addons@${addonsVersion}`, - ...babelDependencies, - ]); +const generator: Generator = async (npmOptions, options) => { + baseGenerator(npmOptions, options, 'mithril', { + dirname: options.storyFormat === StoryFormat.MDX ? __dirname : undefined, + }); }; export default generator; diff --git a/lib/cli/src/generators/MITHRIL/template-csf/.storybook/main.js b/lib/cli/src/generators/MITHRIL/template-csf/.storybook/main.js deleted file mode 100644 index c6a06f1fbc34..000000000000 --- a/lib/cli/src/generators/MITHRIL/template-csf/.storybook/main.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - stories: ['../stories/**/*.stories.js'], - addons: ['@storybook/addon-actions', '@storybook/addon-knobs'], -}; From 06e3c149adb5197e88bd3001d9cac6508edc2466 Mon Sep 17 00:00:00 2001 From: tooppaaa Date: Tue, 26 May 2020 22:25:14 +0200 Subject: [PATCH 14/47] Move preact --- .../preact}/0-Welcome.stories.js | 0 .../preact}/1-Button.stories.js | 0 .../stories => frameworks/preact}/Button.js | 2 +- .../stories => frameworks/preact}/Welcome.js | 4 -- lib/cli/src/generators/PREACT/index.ts | 46 +++---------------- .../PREACT/template-csf/.storybook/main.js | 4 -- 6 files changed, 7 insertions(+), 49 deletions(-) rename lib/cli/src/{generators/PREACT/template-csf/stories => frameworks/preact}/0-Welcome.stories.js (100%) rename lib/cli/src/{generators/PREACT/template-csf/stories => frameworks/preact}/1-Button.stories.js (100%) rename lib/cli/src/{generators/PREACT/template-csf/stories => frameworks/preact}/Button.js (74%) rename lib/cli/src/{generators/PREACT/template-csf/stories => frameworks/preact}/Welcome.js (94%) delete mode 100644 lib/cli/src/generators/PREACT/template-csf/.storybook/main.js diff --git a/lib/cli/src/generators/PREACT/template-csf/stories/0-Welcome.stories.js b/lib/cli/src/frameworks/preact/0-Welcome.stories.js similarity index 100% rename from lib/cli/src/generators/PREACT/template-csf/stories/0-Welcome.stories.js rename to lib/cli/src/frameworks/preact/0-Welcome.stories.js diff --git a/lib/cli/src/generators/PREACT/template-csf/stories/1-Button.stories.js b/lib/cli/src/frameworks/preact/1-Button.stories.js similarity index 100% rename from lib/cli/src/generators/PREACT/template-csf/stories/1-Button.stories.js rename to lib/cli/src/frameworks/preact/1-Button.stories.js diff --git a/lib/cli/src/generators/PREACT/template-csf/stories/Button.js b/lib/cli/src/frameworks/preact/Button.js similarity index 74% rename from lib/cli/src/generators/PREACT/template-csf/stories/Button.js rename to lib/cli/src/frameworks/preact/Button.js index 2a3546d48c5d..698f9d881933 100644 --- a/lib/cli/src/generators/PREACT/template-csf/stories/Button.js +++ b/lib/cli/src/frameworks/preact/Button.js @@ -1,5 +1,5 @@ /** @jsx h */ -/* eslint-disable react/no-unknown-property, react/prop-types */ +/* eslint-disable react/no-unknown-property */ import { h } from 'preact'; const Button = ({ children, ...props }) => ( diff --git a/lib/cli/src/generators/PREACT/template-csf/stories/Welcome.js b/lib/cli/src/frameworks/preact/Welcome.js similarity index 94% rename from lib/cli/src/generators/PREACT/template-csf/stories/Welcome.js rename to lib/cli/src/frameworks/preact/Welcome.js index b4ce7052f260..7a47695cf121 100644 --- a/lib/cli/src/generators/PREACT/template-csf/stories/Welcome.js +++ b/lib/cli/src/frameworks/preact/Welcome.js @@ -13,7 +13,6 @@ const Main = (props) => ( /> ); -// eslint-disable-next-line react/prop-types const Title = ({ children, ...props }) =>

{children}

; const Note = (props) => ( @@ -40,7 +39,6 @@ const InlineCode = (props) => ( /> ); -// eslint-disable-next-line react/prop-types const Link = ({ children, href, ...props }) => ( ( ); -// eslint-disable-next-line react/prop-types const NavButton = ({ children, ...props }) => ( ); -/* eslint-disable-next-line react/prop-types */ const Welcome = ({ showApp }) => (
Welcome to storybook diff --git a/lib/cli/src/generators/PREACT/index.ts b/lib/cli/src/generators/PREACT/index.ts index 4a4b9dba7aa7..edecc76690fb 100644 --- a/lib/cli/src/generators/PREACT/index.ts +++ b/lib/cli/src/generators/PREACT/index.ts @@ -1,44 +1,10 @@ -import { - getVersions, - retrievePackageJson, - writePackageJson, - getBabelDependencies, - installDependencies, - copyTemplate, -} from '../../helpers'; -import { Generator } from '../generator'; +import baseGenerator, { Generator } from '../generator'; +import { StoryFormat } from '../../project_types'; -const generator: Generator = async (npmOptions, { storyFormat }) => { - const [storybookVersion, actionsVersion, linksVersion, addonsVersion] = await getVersions( - npmOptions, - '@storybook/preact', - '@storybook/addon-actions', - '@storybook/addon-links', - '@storybook/addons' - ); - - copyTemplate(__dirname, storyFormat); - - const packageJson = await retrievePackageJson(); - - packageJson.dependencies = packageJson.dependencies || {}; - packageJson.devDependencies = packageJson.devDependencies || {}; - - packageJson.scripts = packageJson.scripts || {}; - packageJson.scripts.storybook = 'start-storybook -p 6006'; - packageJson.scripts['build-storybook'] = 'build-storybook'; - - writePackageJson(packageJson); - - const babelDependencies = await getBabelDependencies(npmOptions, packageJson); - - installDependencies({ ...npmOptions, packageJson }, [ - `@storybook/preact@${storybookVersion}`, - `@storybook/addon-actions@${actionsVersion}`, - `@storybook/addon-links@${linksVersion}`, - `@storybook/addons@${addonsVersion}`, - ...babelDependencies, - ]); +const generator: Generator = async (npmOptions, options) => { + baseGenerator(npmOptions, options, 'preact', { + dirname: options.storyFormat === StoryFormat.MDX ? __dirname : undefined, + }); }; export default generator; diff --git a/lib/cli/src/generators/PREACT/template-csf/.storybook/main.js b/lib/cli/src/generators/PREACT/template-csf/.storybook/main.js deleted file mode 100644 index 3036098563cc..000000000000 --- a/lib/cli/src/generators/PREACT/template-csf/.storybook/main.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - stories: ['../stories/**/*.stories.js'], - addons: ['@storybook/addon-actions', '@storybook/addon-links'], -}; From fb3845de7f1e43f04b1b7996e2faf14e9b6b1e0b Mon Sep 17 00:00:00 2001 From: tooppaaa Date: Tue, 26 May 2020 22:33:16 +0200 Subject: [PATCH 15/47] Move rax --- .../rax}/0-Welcome.stories.js | 0 .../rax}/1-Button.stories.js | 0 .../stories => frameworks/rax}/Welcome.js | 1 - lib/cli/src/generators/RAX/index.ts | 49 ++++--------------- .../RAX/template-csf/.storybook/main.js | 4 -- 5 files changed, 9 insertions(+), 45 deletions(-) rename lib/cli/src/{generators/RAX/template-csf/stories => frameworks/rax}/0-Welcome.stories.js (100%) rename lib/cli/src/{generators/RAX/template-csf/stories => frameworks/rax}/1-Button.stories.js (100%) rename lib/cli/src/{generators/RAX/template-csf/stories => frameworks/rax}/Welcome.js (97%) delete mode 100644 lib/cli/src/generators/RAX/template-csf/.storybook/main.js diff --git a/lib/cli/src/generators/RAX/template-csf/stories/0-Welcome.stories.js b/lib/cli/src/frameworks/rax/0-Welcome.stories.js similarity index 100% rename from lib/cli/src/generators/RAX/template-csf/stories/0-Welcome.stories.js rename to lib/cli/src/frameworks/rax/0-Welcome.stories.js diff --git a/lib/cli/src/generators/RAX/template-csf/stories/1-Button.stories.js b/lib/cli/src/frameworks/rax/1-Button.stories.js similarity index 100% rename from lib/cli/src/generators/RAX/template-csf/stories/1-Button.stories.js rename to lib/cli/src/frameworks/rax/1-Button.stories.js diff --git a/lib/cli/src/generators/RAX/template-csf/stories/Welcome.js b/lib/cli/src/frameworks/rax/Welcome.js similarity index 97% rename from lib/cli/src/generators/RAX/template-csf/stories/Welcome.js rename to lib/cli/src/frameworks/rax/Welcome.js index 340844748cd3..6995d7de5947 100644 --- a/lib/cli/src/generators/RAX/template-csf/stories/Welcome.js +++ b/lib/cli/src/frameworks/rax/Welcome.js @@ -1,4 +1,3 @@ -/* eslint-disable react/prop-types, jsx-a11y/anchor-is-valid */ import { createElement } from 'rax'; import View from 'rax-view'; import Text from 'rax-text'; diff --git a/lib/cli/src/generators/RAX/index.ts b/lib/cli/src/generators/RAX/index.ts index 8e7e2f12e049..b1854a1a6afb 100644 --- a/lib/cli/src/generators/RAX/index.ts +++ b/lib/cli/src/generators/RAX/index.ts @@ -1,31 +1,9 @@ -import { - getVersions, - retrievePackageJson, - writePackageJson, - getBabelDependencies, - installDependencies, - copyTemplate, -} from '../../helpers'; -import { Generator } from '../generator'; - -const generator: Generator = async (npmOptions, { storyFormat }) => { - const [ - storybookVersion, - actionsVersion, - linksVersion, - addonsVersion, - latestRaxVersion, - ] = await getVersions( - npmOptions, - '@storybook/rax', - '@storybook/addon-actions', - '@storybook/addon-links', - '@storybook/addons', - 'rax' - ); - - copyTemplate(__dirname, storyFormat); +import { getVersions, retrievePackageJson, writePackageJson } from '../../helpers'; +import baseGenerator, { Generator } from '../generator'; +import { StoryFormat } from '../../project_types'; +const generator: Generator = async (npmOptions, options) => { + const [latestRaxVersion] = await getVersions(npmOptions, 'rax'); const packageJson = await retrievePackageJson(); packageJson.dependencies = packageJson.dependencies || {}; @@ -42,21 +20,12 @@ const generator: Generator = async (npmOptions, { storyFormat }) => { packageJson.dependencies['rax-text'] = packageJson.dependencies['rax-text'] || raxVersion; packageJson.dependencies['rax-view'] = packageJson.dependencies['rax-view'] || raxVersion; - packageJson.scripts = packageJson.scripts || {}; - packageJson.scripts.storybook = 'start-storybook -p 6006'; - packageJson.scripts['build-storybook'] = 'build-storybook'; - writePackageJson(packageJson); - const babelDependencies = await getBabelDependencies(npmOptions, packageJson); - - installDependencies({ ...npmOptions, packageJson }, [ - `@storybook/rax@${storybookVersion}`, - `@storybook/addon-actions@${actionsVersion}`, - `@storybook/addon-links@${linksVersion}`, - `@storybook/addons@${addonsVersion}`, - ...babelDependencies, - ]); + baseGenerator(npmOptions, options, 'rax', { + dirname: options.storyFormat === StoryFormat.MDX ? __dirname : undefined, + extraPackages: ['rax'], + }); }; export default generator; diff --git a/lib/cli/src/generators/RAX/template-csf/.storybook/main.js b/lib/cli/src/generators/RAX/template-csf/.storybook/main.js deleted file mode 100644 index 3036098563cc..000000000000 --- a/lib/cli/src/generators/RAX/template-csf/.storybook/main.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - stories: ['../stories/**/*.stories.js'], - addons: ['@storybook/addon-actions', '@storybook/addon-links'], -}; From 5ba3eef437451f9c3caafc7593699f0fc6760e2c Mon Sep 17 00:00:00 2001 From: tooppaaa Date: Tue, 26 May 2020 22:37:21 +0200 Subject: [PATCH 16/47] Move riot --- .../riot}/0-Welcome.stories.js | 0 .../riot}/1-Button.stories.js | 0 .../stories => frameworks/riot}/MyButton.tag | 0 .../stories => frameworks/riot}/Welcome.tag | 0 lib/cli/src/generators/RIOT/index.ts | 62 +++---------------- .../RIOT/template-csf/.storybook/main.js | 4 -- 6 files changed, 8 insertions(+), 58 deletions(-) rename lib/cli/src/{generators/RIOT/template-csf/stories => frameworks/riot}/0-Welcome.stories.js (100%) rename lib/cli/src/{generators/RIOT/template-csf/stories => frameworks/riot}/1-Button.stories.js (100%) rename lib/cli/src/{generators/RIOT/template-csf/stories => frameworks/riot}/MyButton.tag (100%) rename lib/cli/src/{generators/RIOT/template-csf/stories => frameworks/riot}/Welcome.tag (100%) delete mode 100644 lib/cli/src/generators/RIOT/template-csf/.storybook/main.js diff --git a/lib/cli/src/generators/RIOT/template-csf/stories/0-Welcome.stories.js b/lib/cli/src/frameworks/riot/0-Welcome.stories.js similarity index 100% rename from lib/cli/src/generators/RIOT/template-csf/stories/0-Welcome.stories.js rename to lib/cli/src/frameworks/riot/0-Welcome.stories.js diff --git a/lib/cli/src/generators/RIOT/template-csf/stories/1-Button.stories.js b/lib/cli/src/frameworks/riot/1-Button.stories.js similarity index 100% rename from lib/cli/src/generators/RIOT/template-csf/stories/1-Button.stories.js rename to lib/cli/src/frameworks/riot/1-Button.stories.js diff --git a/lib/cli/src/generators/RIOT/template-csf/stories/MyButton.tag b/lib/cli/src/frameworks/riot/MyButton.tag similarity index 100% rename from lib/cli/src/generators/RIOT/template-csf/stories/MyButton.tag rename to lib/cli/src/frameworks/riot/MyButton.tag diff --git a/lib/cli/src/generators/RIOT/template-csf/stories/Welcome.tag b/lib/cli/src/frameworks/riot/Welcome.tag similarity index 100% rename from lib/cli/src/generators/RIOT/template-csf/stories/Welcome.tag rename to lib/cli/src/frameworks/riot/Welcome.tag diff --git a/lib/cli/src/generators/RIOT/index.ts b/lib/cli/src/generators/RIOT/index.ts index 12a27c812cd0..f9986bb8da87 100644 --- a/lib/cli/src/generators/RIOT/index.ts +++ b/lib/cli/src/generators/RIOT/index.ts @@ -1,57 +1,11 @@ -import { - getVersions, - retrievePackageJson, - writePackageJson, - getBabelDependencies, - installDependencies, - copyTemplate, -} from '../../helpers'; -import { Generator } from '../generator'; - -const generator: Generator = async (npmOptions, { storyFormat }) => { - const [ - storybookVersion, - actionsVersion, - linksVersion, - addonsVersion, - tagLoaderVersion, - ] = await getVersions( - npmOptions, - '@storybook/riot', - '@storybook/addon-actions', - '@storybook/addon-links', - '@storybook/addons', - 'riot-tag-loader' - ); - - copyTemplate(__dirname, storyFormat); - - const packageJson = await retrievePackageJson(); - - packageJson.dependencies = packageJson.dependencies || {}; - packageJson.devDependencies = packageJson.devDependencies || {}; - - const dependencies = [ - `@storybook/riot@${storybookVersion}`, - `@storybook/addon-actions@${actionsVersion}`, - `@storybook/addon-links@${linksVersion}`, - `@storybook/addons@${addonsVersion}`, - ]; - if ( - !packageJson.devDependencies['riot-tag-loader'] && - !packageJson.dependencies['riot-tag-loader'] - ) - dependencies.push(`riot-tag-loader@${tagLoaderVersion}`); - - packageJson.scripts = packageJson.scripts || {}; - packageJson.scripts.storybook = 'start-storybook -p 6006'; - packageJson.scripts['build-storybook'] = 'build-storybook'; - - writePackageJson(packageJson); - - const babelDependencies = await getBabelDependencies(npmOptions, packageJson); - - installDependencies({ ...npmOptions, packageJson }, [...dependencies, ...babelDependencies]); +import baseGenerator, { Generator } from '../generator'; +import { StoryFormat } from '../../project_types'; + +const generator: Generator = async (npmOptions, options) => { + baseGenerator(npmOptions, options, 'riot', { + dirname: options.storyFormat === StoryFormat.MDX ? __dirname : undefined, + extraPackages: ['riot-tag-loader'], + }); }; export default generator; diff --git a/lib/cli/src/generators/RIOT/template-csf/.storybook/main.js b/lib/cli/src/generators/RIOT/template-csf/.storybook/main.js deleted file mode 100644 index 3036098563cc..000000000000 --- a/lib/cli/src/generators/RIOT/template-csf/.storybook/main.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - stories: ['../stories/**/*.stories.js'], - addons: ['@storybook/addon-actions', '@storybook/addon-links'], -}; From ba37d85223d2563ef651c27089fffe43a826c831 Mon Sep 17 00:00:00 2001 From: tooppaaa Date: Tue, 26 May 2020 22:37:38 +0200 Subject: [PATCH 17/47] Move svelte --- .../svelte}/0-welcome.stories.js | 0 .../svelte}/1-button.stories.js | 0 .../svelte}/button.svelte | 0 .../svelte}/welcome.svelte | 0 lib/cli/src/generators/SVELTE/index.ts | 60 +++---------------- .../SVELTE/template-csf/.storybook/main.js | 4 -- 6 files changed, 8 insertions(+), 56 deletions(-) rename lib/cli/src/{generators/SVELTE/template-csf/stories => frameworks/svelte}/0-welcome.stories.js (100%) rename lib/cli/src/{generators/SVELTE/template-csf/stories => frameworks/svelte}/1-button.stories.js (100%) rename lib/cli/src/{generators/SVELTE/template-csf/stories => frameworks/svelte}/button.svelte (100%) rename lib/cli/src/{generators/SVELTE/template-csf/stories => frameworks/svelte}/welcome.svelte (100%) delete mode 100644 lib/cli/src/generators/SVELTE/template-csf/.storybook/main.js diff --git a/lib/cli/src/generators/SVELTE/template-csf/stories/0-welcome.stories.js b/lib/cli/src/frameworks/svelte/0-welcome.stories.js similarity index 100% rename from lib/cli/src/generators/SVELTE/template-csf/stories/0-welcome.stories.js rename to lib/cli/src/frameworks/svelte/0-welcome.stories.js diff --git a/lib/cli/src/generators/SVELTE/template-csf/stories/1-button.stories.js b/lib/cli/src/frameworks/svelte/1-button.stories.js similarity index 100% rename from lib/cli/src/generators/SVELTE/template-csf/stories/1-button.stories.js rename to lib/cli/src/frameworks/svelte/1-button.stories.js diff --git a/lib/cli/src/generators/SVELTE/template-csf/stories/button.svelte b/lib/cli/src/frameworks/svelte/button.svelte similarity index 100% rename from lib/cli/src/generators/SVELTE/template-csf/stories/button.svelte rename to lib/cli/src/frameworks/svelte/button.svelte diff --git a/lib/cli/src/generators/SVELTE/template-csf/stories/welcome.svelte b/lib/cli/src/frameworks/svelte/welcome.svelte similarity index 100% rename from lib/cli/src/generators/SVELTE/template-csf/stories/welcome.svelte rename to lib/cli/src/frameworks/svelte/welcome.svelte diff --git a/lib/cli/src/generators/SVELTE/index.ts b/lib/cli/src/generators/SVELTE/index.ts index bb7bb6007bdf..3a5a2547678b 100644 --- a/lib/cli/src/generators/SVELTE/index.ts +++ b/lib/cli/src/generators/SVELTE/index.ts @@ -1,55 +1,11 @@ -import { - getVersions, - retrievePackageJson, - writePackageJson, - getBabelDependencies, - installDependencies, - copyTemplate, -} from '../../helpers'; -import { Generator } from '../generator'; - -const generator: Generator = async (npmOptions, { storyFormat }) => { - const [ - storybookVersion, - actionsVersion, - linksVersion, - addonsVersion, - svelte, - svelteLoader, - ] = await getVersions( - npmOptions, - '@storybook/svelte', - '@storybook/addon-actions', - '@storybook/addon-links', - '@storybook/addons', - 'svelte', - 'svelte-loader' - ); - - copyTemplate(__dirname, storyFormat); - - const packageJson = await retrievePackageJson(); - - packageJson.dependencies = packageJson.dependencies || {}; - packageJson.devDependencies = packageJson.devDependencies || {}; - - packageJson.scripts = packageJson.scripts || {}; - packageJson.scripts.storybook = 'start-storybook -p 6006'; - packageJson.scripts['build-storybook'] = 'build-storybook'; - - writePackageJson(packageJson); - - const babelDependencies = await getBabelDependencies(npmOptions, packageJson); - - installDependencies({ ...npmOptions, packageJson }, [ - `@storybook/svelte@${storybookVersion}`, - `@storybook/addon-actions@${actionsVersion}`, - `@storybook/addon-links@${linksVersion}`, - `@storybook/addons@${addonsVersion}`, - `svelte@${svelte}`, - `svelte-loader@${svelteLoader}`, - ...babelDependencies, - ]); +import baseGenerator, { Generator } from '../generator'; +import { StoryFormat } from '../../project_types'; + +const generator: Generator = async (npmOptions, options) => { + baseGenerator(npmOptions, options, 'svelte', { + dirname: options.storyFormat === StoryFormat.MDX ? __dirname : undefined, + extraPackages: ['svelte', 'svelte-loader'], + }); }; export default generator; diff --git a/lib/cli/src/generators/SVELTE/template-csf/.storybook/main.js b/lib/cli/src/generators/SVELTE/template-csf/.storybook/main.js deleted file mode 100644 index 3036098563cc..000000000000 --- a/lib/cli/src/generators/SVELTE/template-csf/.storybook/main.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - stories: ['../stories/**/*.stories.js'], - addons: ['@storybook/addon-actions', '@storybook/addon-links'], -}; From 472222026ff01e4ef22c6af644532116c36afe48 Mon Sep 17 00:00:00 2001 From: tooppaaa Date: Tue, 26 May 2020 22:53:42 +0200 Subject: [PATCH 18/47] Move marko and cleanup --- .../marko/0-Welcome.stories.js} | 2 +- lib/cli/src/frameworks/marko/welcome.marko | 37 +++++++++++++++ lib/cli/src/generators/MARKO/index.ts | 44 +++--------------- .../MARKO/template-csf/.storybook/main.js | 4 -- .../stories/components/welcome/index.marko | 46 ------------------- 5 files changed, 44 insertions(+), 89 deletions(-) rename lib/cli/src/{generators/MARKO/template-csf/stories/index.stories.js => frameworks/marko/0-Welcome.stories.js} (68%) create mode 100644 lib/cli/src/frameworks/marko/welcome.marko delete mode 100644 lib/cli/src/generators/MARKO/template-csf/.storybook/main.js delete mode 100644 lib/cli/src/generators/MARKO/template-csf/stories/components/welcome/index.marko diff --git a/lib/cli/src/generators/MARKO/template-csf/stories/index.stories.js b/lib/cli/src/frameworks/marko/0-Welcome.stories.js similarity index 68% rename from lib/cli/src/generators/MARKO/template-csf/stories/index.stories.js rename to lib/cli/src/frameworks/marko/0-Welcome.stories.js index 41fcb8b4fc12..a0cba3b6d1b0 100644 --- a/lib/cli/src/generators/MARKO/template-csf/stories/index.stories.js +++ b/lib/cli/src/frameworks/marko/0-Welcome.stories.js @@ -1,4 +1,4 @@ -import Welcome from './components/welcome/index.marko'; +import Welcome from './welcome.marko'; export default { title: 'Welcome', diff --git a/lib/cli/src/frameworks/marko/welcome.marko b/lib/cli/src/frameworks/marko/welcome.marko new file mode 100644 index 000000000000..74f9e032ac03 --- /dev/null +++ b/lib/cli/src/frameworks/marko/welcome.marko @@ -0,0 +1,37 @@ + +class { + onCreate() {} +} + +style { + #app { + font-family: 'Avenir', Helvetica, Arial, sans-serif; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + text-align: center; + color: #2c3e50; + margin-top: 60px; + } + + h1, h2 { + font-weight: normal; + } + + ul { + list-style-type: none; + padding: 0; + } + + li { + display: inline-block; + margin: 0 10px; + } + + a { + color: #42b983; + } +} + + +

Welcome to storybook

+ diff --git a/lib/cli/src/generators/MARKO/index.ts b/lib/cli/src/generators/MARKO/index.ts index 5220b6a1d81d..3c83040bdb61 100644 --- a/lib/cli/src/generators/MARKO/index.ts +++ b/lib/cli/src/generators/MARKO/index.ts @@ -1,42 +1,10 @@ -import { - getVersions, - retrievePackageJson, - writePackageJson, - getBabelDependencies, - installDependencies, - copyTemplate, -} from '../../helpers'; -import { Generator } from '../generator'; +import baseGenerator, { Generator } from '../generator'; +import { StoryFormat } from '../../project_types'; -const generator: Generator = async (npmOptions, { storyFormat }) => { - const [storybookVersion, addonActionVersion, addonKnobsVersion] = await getVersions( - npmOptions, - '@storybook/marko', - '@storybook/addon-actions', - '@storybook/addon-knobs' - ); - - copyTemplate(__dirname, storyFormat); - - const packageJson = await retrievePackageJson(); - - packageJson.dependencies = packageJson.dependencies || {}; - packageJson.devDependencies = packageJson.devDependencies || {}; - - packageJson.scripts = packageJson.scripts || {}; - packageJson.scripts.storybook = 'start-storybook -p 6006'; - packageJson.scripts['build-storybook'] = 'build-storybook'; - - writePackageJson(packageJson); - - const babelDependencies = await getBabelDependencies(npmOptions, packageJson); - - installDependencies({ ...npmOptions, packageJson }, [ - `@storybook/marko@${storybookVersion}`, - `@storybook/addon-actions@${addonActionVersion}`, - `@storybook/addon-knobs@${addonKnobsVersion}`, - ...babelDependencies, - ]); +const generator: Generator = async (npmOptions, options) => { + await baseGenerator(npmOptions, options, 'marko', { + dirname: options.storyFormat === StoryFormat.MDX ? __dirname : undefined, + }); }; export default generator; diff --git a/lib/cli/src/generators/MARKO/template-csf/.storybook/main.js b/lib/cli/src/generators/MARKO/template-csf/.storybook/main.js deleted file mode 100644 index c6a06f1fbc34..000000000000 --- a/lib/cli/src/generators/MARKO/template-csf/.storybook/main.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - stories: ['../stories/**/*.stories.js'], - addons: ['@storybook/addon-actions', '@storybook/addon-knobs'], -}; diff --git a/lib/cli/src/generators/MARKO/template-csf/stories/components/welcome/index.marko b/lib/cli/src/generators/MARKO/template-csf/stories/components/welcome/index.marko deleted file mode 100644 index 272d7211f2bf..000000000000 --- a/lib/cli/src/generators/MARKO/template-csf/stories/components/welcome/index.marko +++ /dev/null @@ -1,46 +0,0 @@ - -class { - onCreate() {} -} - -style { - #app { - font-family: 'Avenir', Helvetica, Arial, sans-serif; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; - text-align: center; - color: #2c3e50; - margin-top: 60px; - } - - .logo { - background-image:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAW0AAADICAYAAAAjp7DLAAAAAXNSR0IArs4c6QAAAAlwSFlzAA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0DBdtAAAAAASUVORK5CYII='); - background-repeat:no-repeat; - display:inline-block; - width: 365px; - height: 200px; - } - - h1, h2 { - font-weight: normal; - } - - ul { - list-style-type: none; - padding: 0; - } - - li { - display: inline-block; - margin: 0 10px; - } - - a { - color: #42b983; - } -} - - -

Welcome to storybook

- - From 0e2f5f6a81bebed55e05e4d9c76eaf10977442bd Mon Sep 17 00:00:00 2001 From: tooppaaa Date: Tue, 26 May 2020 22:58:40 +0200 Subject: [PATCH 19/47] Move marionette --- .../marionette}/index.stories.js | 4 +- lib/cli/src/generators/MARIONETTE/index.ts | 37 +++---------------- .../MARIONETTE/template/.storybook/main.js | 4 -- 3 files changed, 8 insertions(+), 37 deletions(-) rename lib/cli/src/{generators/MARIONETTE/template/stories => frameworks/marionette}/index.stories.js (83%) delete mode 100644 lib/cli/src/generators/MARIONETTE/template/.storybook/main.js diff --git a/lib/cli/src/generators/MARIONETTE/template/stories/index.stories.js b/lib/cli/src/frameworks/marionette/index.stories.js similarity index 83% rename from lib/cli/src/generators/MARIONETTE/template/stories/index.stories.js rename to lib/cli/src/frameworks/marionette/index.stories.js index 32f924b93608..a21a55194725 100644 --- a/lib/cli/src/generators/MARIONETTE/template/stories/index.stories.js +++ b/lib/cli/src/frameworks/marionette/index.stories.js @@ -1,11 +1,11 @@ -import Marionette from 'backbone.marionette'; +import { View } from 'backbone.marionette'; import { storiesOf } from '@storybook/marionette'; storiesOf('Demo', module).add( 'button', () => - new Marionette.View({ + new View({ template: () => '', ui: { button: '#my_button', diff --git a/lib/cli/src/generators/MARIONETTE/index.ts b/lib/cli/src/generators/MARIONETTE/index.ts index a55e1f36aab0..6f030e5f7856 100644 --- a/lib/cli/src/generators/MARIONETTE/index.ts +++ b/lib/cli/src/generators/MARIONETTE/index.ts @@ -1,35 +1,10 @@ -import fse from 'fs-extra'; -import path from 'path'; -import { - getVersion, - writePackageJson, - getBabelDependencies, - installDependencies, - retrievePackageJson, -} from '../../helpers'; -import { Generator } from '../generator'; +import baseGenerator, { Generator } from '../generator'; +import { StoryFormat } from '../../project_types'; -const generator: Generator = async (npmOptions) => { - const storybookVersion = await getVersion(npmOptions, '@storybook/marionette'); - fse.copySync(path.resolve(__dirname, 'template/'), '.', { overwrite: true }); - - const packageJson = await retrievePackageJson(); - - packageJson.dependencies = packageJson.dependencies || {}; - packageJson.devDependencies = packageJson.devDependencies || {}; - - packageJson.scripts = packageJson.scripts || {}; - packageJson.scripts.storybook = 'start-storybook -p 6006'; - packageJson.scripts['build-storybook'] = 'build-storybook'; - - writePackageJson(packageJson); - - const babelDependencies = await getBabelDependencies(npmOptions, packageJson); - - installDependencies({ ...npmOptions, packageJson }, [ - `@storybook/marionette@${storybookVersion}`, - ...babelDependencies, - ]); +const generator: Generator = async (npmOptions, options) => { + await baseGenerator(npmOptions, options, 'marionette', { + dirname: options.storyFormat === StoryFormat.MDX ? __dirname : undefined, + }); }; export default generator; diff --git a/lib/cli/src/generators/MARIONETTE/template/.storybook/main.js b/lib/cli/src/generators/MARIONETTE/template/.storybook/main.js deleted file mode 100644 index a0f65ec500a5..000000000000 --- a/lib/cli/src/generators/MARIONETTE/template/.storybook/main.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - stories: '../stories/**/*.stories.js', - addons: ['@storybook/addon-actions', '@storybook/addon-knobs'], -}; From cdea7b95b70ab962c1191c4d4174996d06599d24 Mon Sep 17 00:00:00 2001 From: tooppaaa Date: Tue, 26 May 2020 23:04:58 +0200 Subject: [PATCH 20/47] Move vue --- .../vue}/0-Welcome.stories.js | 0 .../vue}/1-Button.stories.js | 2 +- .../vue/Button.vue} | 0 .../stories => frameworks/vue}/Welcome.vue | 0 lib/cli/src/generators/SFC_VUE/index.ts | 42 +------ .../SFC_VUE/template-csf/.storybook/main.js | 4 - .../SFC_VUE/template-mdx/.storybook/main.js | 4 - .../template-mdx/src/stories/MyButton.vue | 29 ----- .../template-mdx/src/stories/Welcome.vue | 119 ------------------ .../{src => }/stories/0-Welcome.stories.mdx | 0 .../{src => }/stories/1-Button.stories.mdx | 2 +- 11 files changed, 7 insertions(+), 195 deletions(-) rename lib/cli/src/{generators/SFC_VUE/template-csf/src/stories => frameworks/vue}/0-Welcome.stories.js (100%) rename lib/cli/src/{generators/SFC_VUE/template-csf/src/stories => frameworks/vue}/1-Button.stories.js (96%) rename lib/cli/src/{generators/SFC_VUE/template-csf/src/stories/MyButton.vue => frameworks/vue/Button.vue} (100%) rename lib/cli/src/{generators/SFC_VUE/template-csf/src/stories => frameworks/vue}/Welcome.vue (100%) delete mode 100644 lib/cli/src/generators/SFC_VUE/template-csf/.storybook/main.js delete mode 100644 lib/cli/src/generators/SFC_VUE/template-mdx/.storybook/main.js delete mode 100644 lib/cli/src/generators/SFC_VUE/template-mdx/src/stories/MyButton.vue delete mode 100644 lib/cli/src/generators/SFC_VUE/template-mdx/src/stories/Welcome.vue rename lib/cli/src/generators/SFC_VUE/template-mdx/{src => }/stories/0-Welcome.stories.mdx (100%) rename lib/cli/src/generators/SFC_VUE/template-mdx/{src => }/stories/1-Button.stories.mdx (94%) diff --git a/lib/cli/src/generators/SFC_VUE/template-csf/src/stories/0-Welcome.stories.js b/lib/cli/src/frameworks/vue/0-Welcome.stories.js similarity index 100% rename from lib/cli/src/generators/SFC_VUE/template-csf/src/stories/0-Welcome.stories.js rename to lib/cli/src/frameworks/vue/0-Welcome.stories.js diff --git a/lib/cli/src/generators/SFC_VUE/template-csf/src/stories/1-Button.stories.js b/lib/cli/src/frameworks/vue/1-Button.stories.js similarity index 96% rename from lib/cli/src/generators/SFC_VUE/template-csf/src/stories/1-Button.stories.js rename to lib/cli/src/frameworks/vue/1-Button.stories.js index 19f372961463..20fb5fd82f3f 100644 --- a/lib/cli/src/generators/SFC_VUE/template-csf/src/stories/1-Button.stories.js +++ b/lib/cli/src/frameworks/vue/1-Button.stories.js @@ -1,7 +1,7 @@ import { action } from '@storybook/addon-actions'; import { linkTo } from '@storybook/addon-links'; -import MyButton from './MyButton.vue'; +import MyButton from './Button.vue'; export default { title: 'Button', diff --git a/lib/cli/src/generators/SFC_VUE/template-csf/src/stories/MyButton.vue b/lib/cli/src/frameworks/vue/Button.vue similarity index 100% rename from lib/cli/src/generators/SFC_VUE/template-csf/src/stories/MyButton.vue rename to lib/cli/src/frameworks/vue/Button.vue diff --git a/lib/cli/src/generators/SFC_VUE/template-csf/src/stories/Welcome.vue b/lib/cli/src/frameworks/vue/Welcome.vue similarity index 100% rename from lib/cli/src/generators/SFC_VUE/template-csf/src/stories/Welcome.vue rename to lib/cli/src/frameworks/vue/Welcome.vue diff --git a/lib/cli/src/generators/SFC_VUE/index.ts b/lib/cli/src/generators/SFC_VUE/index.ts index 26b6246983e5..a947c486e843 100644 --- a/lib/cli/src/generators/SFC_VUE/index.ts +++ b/lib/cli/src/generators/SFC_VUE/index.ts @@ -1,42 +1,10 @@ -import { - retrievePackageJson, - getVersionedPackages, - writePackageJson, - getBabelDependencies, - installDependencies, - copyTemplate, -} from '../../helpers'; +import baseGenerator, { Generator } from '../generator'; import { StoryFormat } from '../../project_types'; -import { Generator } from '../generator'; -const generator: Generator = async (npmOptions, { storyFormat }) => { - const packages = [ - '@storybook/vue', - '@storybook/addon-actions', - '@storybook/addon-links', - '@storybook/addons', - ]; - if (storyFormat === StoryFormat.MDX) { - packages.push('@storybook/addon-docs'); - } - const versionedPackages = await getVersionedPackages(npmOptions, ...packages); - - copyTemplate(__dirname, storyFormat); - - const packageJson = await retrievePackageJson(); - - packageJson.dependencies = packageJson.dependencies || {}; - packageJson.devDependencies = packageJson.devDependencies || {}; - - packageJson.scripts = packageJson.scripts || {}; - packageJson.scripts.storybook = 'start-storybook -p 6006'; - packageJson.scripts['build-storybook'] = 'build-storybook'; - - writePackageJson(packageJson); - - const babelDependencies = await getBabelDependencies(npmOptions, packageJson); - - installDependencies({ ...npmOptions, packageJson }, [...versionedPackages, ...babelDependencies]); +const generator: Generator = async (npmOptions, options) => { + baseGenerator(npmOptions, options, 'vue', { + dirname: options.storyFormat === StoryFormat.MDX ? __dirname : undefined, + }); }; export default generator; diff --git a/lib/cli/src/generators/SFC_VUE/template-csf/.storybook/main.js b/lib/cli/src/generators/SFC_VUE/template-csf/.storybook/main.js deleted file mode 100644 index 302586ca4090..000000000000 --- a/lib/cli/src/generators/SFC_VUE/template-csf/.storybook/main.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - stories: ['../src/**/*.stories.js'], - addons: ['@storybook/addon-actions', '@storybook/addon-links'], -}; diff --git a/lib/cli/src/generators/SFC_VUE/template-mdx/.storybook/main.js b/lib/cli/src/generators/SFC_VUE/template-mdx/.storybook/main.js deleted file mode 100644 index a956ae0c91da..000000000000 --- a/lib/cli/src/generators/SFC_VUE/template-mdx/.storybook/main.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - stories: ['../src/**/*.stories.(js|mdx)'], - addons: ['@storybook/addon-docs', '@storybook/addon-actions', '@storybook/addon-links'], -}; diff --git a/lib/cli/src/generators/SFC_VUE/template-mdx/src/stories/MyButton.vue b/lib/cli/src/generators/SFC_VUE/template-mdx/src/stories/MyButton.vue deleted file mode 100644 index 4ad8ff85f08c..000000000000 --- a/lib/cli/src/generators/SFC_VUE/template-mdx/src/stories/MyButton.vue +++ /dev/null @@ -1,29 +0,0 @@ - - - - - diff --git a/lib/cli/src/generators/SFC_VUE/template-mdx/src/stories/Welcome.vue b/lib/cli/src/generators/SFC_VUE/template-mdx/src/stories/Welcome.vue deleted file mode 100644 index bfb932da3d2a..000000000000 --- a/lib/cli/src/generators/SFC_VUE/template-mdx/src/stories/Welcome.vue +++ /dev/null @@ -1,119 +0,0 @@ - - - - - diff --git a/lib/cli/src/generators/SFC_VUE/template-mdx/src/stories/0-Welcome.stories.mdx b/lib/cli/src/generators/SFC_VUE/template-mdx/stories/0-Welcome.stories.mdx similarity index 100% rename from lib/cli/src/generators/SFC_VUE/template-mdx/src/stories/0-Welcome.stories.mdx rename to lib/cli/src/generators/SFC_VUE/template-mdx/stories/0-Welcome.stories.mdx diff --git a/lib/cli/src/generators/SFC_VUE/template-mdx/src/stories/1-Button.stories.mdx b/lib/cli/src/generators/SFC_VUE/template-mdx/stories/1-Button.stories.mdx similarity index 94% rename from lib/cli/src/generators/SFC_VUE/template-mdx/src/stories/1-Button.stories.mdx rename to lib/cli/src/generators/SFC_VUE/template-mdx/stories/1-Button.stories.mdx index f37647542ac2..8a5b92a8d630 100644 --- a/lib/cli/src/generators/SFC_VUE/template-mdx/src/stories/1-Button.stories.mdx +++ b/lib/cli/src/generators/SFC_VUE/template-mdx/stories/1-Button.stories.mdx @@ -1,7 +1,7 @@ import { Meta, Story } from '@storybook/addon-docs/blocks'; import { action } from '@storybook/addon-actions'; import { linkTo } from '@storybook/addon-links'; -import MyButton from './MyButton.vue'; +import MyButton from './Button.vue'; From 6d3eec2d1c1b892698f57ecfb850f5411fec45e4 Mon Sep 17 00:00:00 2001 From: tooppaaa Date: Tue, 26 May 2020 23:17:17 +0200 Subject: [PATCH 21/47] Move html --- .../html}/0-Welcome.stories.js | 0 .../html}/1-Button.stories.js | 0 lib/cli/src/generators/HTML/index.ts | 38 +++---------------- .../HTML/template-csf/.storybook/main.js | 4 -- .../HTML/template-mdx/.storybook/main.js | 4 -- 5 files changed, 5 insertions(+), 41 deletions(-) rename lib/cli/src/{generators/HTML/template-csf/stories => frameworks/html}/0-Welcome.stories.js (100%) rename lib/cli/src/{generators/HTML/template-csf/stories => frameworks/html}/1-Button.stories.js (100%) delete mode 100644 lib/cli/src/generators/HTML/template-csf/.storybook/main.js delete mode 100644 lib/cli/src/generators/HTML/template-mdx/.storybook/main.js diff --git a/lib/cli/src/generators/HTML/template-csf/stories/0-Welcome.stories.js b/lib/cli/src/frameworks/html/0-Welcome.stories.js similarity index 100% rename from lib/cli/src/generators/HTML/template-csf/stories/0-Welcome.stories.js rename to lib/cli/src/frameworks/html/0-Welcome.stories.js diff --git a/lib/cli/src/generators/HTML/template-csf/stories/1-Button.stories.js b/lib/cli/src/frameworks/html/1-Button.stories.js similarity index 100% rename from lib/cli/src/generators/HTML/template-csf/stories/1-Button.stories.js rename to lib/cli/src/frameworks/html/1-Button.stories.js diff --git a/lib/cli/src/generators/HTML/index.ts b/lib/cli/src/generators/HTML/index.ts index a11a0bd4321c..519e6880ac07 100755 --- a/lib/cli/src/generators/HTML/index.ts +++ b/lib/cli/src/generators/HTML/index.ts @@ -1,38 +1,10 @@ -import { - retrievePackageJson, - getVersionedPackages, - writePackageJson, - getBabelDependencies, - installDependencies, - copyTemplate, -} from '../../helpers'; +import baseGenerator, { Generator } from '../generator'; import { StoryFormat } from '../../project_types'; -import { Generator } from '../generator'; -const generator: Generator = async (npmOptions, { storyFormat }) => { - const packages = ['@storybook/html', '@storybook/addon-actions', '@storybook/addon-links']; - - const versionedPackages = await getVersionedPackages(npmOptions, ...packages); - if (storyFormat === StoryFormat.MDX) { - packages.push('@storybook/addon-docs'); - } - - copyTemplate(__dirname, storyFormat); - - const packageJson = await retrievePackageJson(); - - packageJson.dependencies = packageJson.dependencies || {}; - packageJson.devDependencies = packageJson.devDependencies || {}; - - packageJson.scripts = packageJson.scripts || {}; - packageJson.scripts.storybook = 'start-storybook -p 6006'; - packageJson.scripts['build-storybook'] = 'build-storybook'; - - writePackageJson(packageJson); - - const babelDependencies = await getBabelDependencies(npmOptions, packageJson); - - installDependencies({ ...npmOptions, packageJson }, [...versionedPackages, ...babelDependencies]); +const generator: Generator = async (npmOptions, options) => { + baseGenerator(npmOptions, options, 'html', { + dirname: options.storyFormat === StoryFormat.MDX ? __dirname : undefined, + }); }; export default generator; diff --git a/lib/cli/src/generators/HTML/template-csf/.storybook/main.js b/lib/cli/src/generators/HTML/template-csf/.storybook/main.js deleted file mode 100644 index 3036098563cc..000000000000 --- a/lib/cli/src/generators/HTML/template-csf/.storybook/main.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - stories: ['../stories/**/*.stories.js'], - addons: ['@storybook/addon-actions', '@storybook/addon-links'], -}; diff --git a/lib/cli/src/generators/HTML/template-mdx/.storybook/main.js b/lib/cli/src/generators/HTML/template-mdx/.storybook/main.js deleted file mode 100644 index be80f95bd994..000000000000 --- a/lib/cli/src/generators/HTML/template-mdx/.storybook/main.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - stories: ['../stories/**/*.stories.(js|mdx)'], - addons: ['@storybook/addon-docs'], -}; From 6aad11e4a1bd5842bdc1070b9b5bbb6c72e0d3ca Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Thu, 28 May 2020 10:17:55 +0200 Subject: [PATCH 22/47] no tabs --- lib/cli/src/frameworks/marko/welcome.marko | 46 +++++++++++----------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/lib/cli/src/frameworks/marko/welcome.marko b/lib/cli/src/frameworks/marko/welcome.marko index 74f9e032ac03..828d359bcc42 100644 --- a/lib/cli/src/frameworks/marko/welcome.marko +++ b/lib/cli/src/frameworks/marko/welcome.marko @@ -1,35 +1,35 @@ class { - onCreate() {} + onCreate() {} } style { - #app { - font-family: 'Avenir', Helvetica, Arial, sans-serif; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; - text-align: center; - color: #2c3e50; - margin-top: 60px; - } + #app { + font-family: 'Avenir', Helvetica, Arial, sans-serif; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + text-align: center; + color: #2c3e50; + margin-top: 60px; + } - h1, h2 { - font-weight: normal; - } + h1, h2 { + font-weight: normal; + } - ul { - list-style-type: none; - padding: 0; - } + ul { + list-style-type: none; + padding: 0; + } - li { - display: inline-block; - margin: 0 10px; - } + li { + display: inline-block; + margin: 0 10px; + } - a { - color: #42b983; - } + a { + color: #42b983; + } } From 10dbb81ab91dea464b69b106d865c3f65792d439 Mon Sep 17 00:00:00 2001 From: tooppaaa Date: Thu, 28 May 2020 22:43:56 +0200 Subject: [PATCH 23/47] Move WebComponents --- lib/cli/src/.eslintrc.js | 1 + .../web-components}/0-Welcome.stories.js | 0 .../web-components}/1-Button.stories.js | 0 .../src/generators/WEB-COMPONENTS/index.ts | 47 +++---------------- .../.storybook/preview.js | 0 .../template/.storybook/main.js | 4 -- scripts/run-e2e.ts | 5 +- 7 files changed, 11 insertions(+), 46 deletions(-) rename lib/cli/src/{generators/WEB-COMPONENTS/template/stories => frameworks/web-components}/0-Welcome.stories.js (100%) rename lib/cli/src/{generators/WEB-COMPONENTS/template/stories => frameworks/web-components}/1-Button.stories.js (100%) rename lib/cli/src/generators/WEB-COMPONENTS/{template => template-csf}/.storybook/preview.js (100%) delete mode 100644 lib/cli/src/generators/WEB-COMPONENTS/template/.storybook/main.js diff --git a/lib/cli/src/.eslintrc.js b/lib/cli/src/.eslintrc.js index fe5159bc5894..ae114bfdcc2f 100644 --- a/lib/cli/src/.eslintrc.js +++ b/lib/cli/src/.eslintrc.js @@ -13,6 +13,7 @@ module.exports = { 'react/react-in-jsx-scope': ignore, 'import/no-extraneous-dependencies': ignore, 'global-require': ignore, + 'no-redeclare': ignore, }, }, { diff --git a/lib/cli/src/generators/WEB-COMPONENTS/template/stories/0-Welcome.stories.js b/lib/cli/src/frameworks/web-components/0-Welcome.stories.js similarity index 100% rename from lib/cli/src/generators/WEB-COMPONENTS/template/stories/0-Welcome.stories.js rename to lib/cli/src/frameworks/web-components/0-Welcome.stories.js diff --git a/lib/cli/src/generators/WEB-COMPONENTS/template/stories/1-Button.stories.js b/lib/cli/src/frameworks/web-components/1-Button.stories.js similarity index 100% rename from lib/cli/src/generators/WEB-COMPONENTS/template/stories/1-Button.stories.js rename to lib/cli/src/frameworks/web-components/1-Button.stories.js diff --git a/lib/cli/src/generators/WEB-COMPONENTS/index.ts b/lib/cli/src/generators/WEB-COMPONENTS/index.ts index 6884166f964f..24fb41a2e24f 100755 --- a/lib/cli/src/generators/WEB-COMPONENTS/index.ts +++ b/lib/cli/src/generators/WEB-COMPONENTS/index.ts @@ -1,45 +1,10 @@ -import fse from 'fs-extra'; -import path from 'path'; -import { - getVersionedPackages, - retrievePackageJson, - writePackageJson, - getBabelDependencies, - installDependencies, -} from '../../helpers'; -import { StoryFormat } from '../../project_types'; -import { Generator } from '../generator'; +import baseGenerator, { Generator } from '../generator'; -const generator: Generator = async (npmOptions, { storyFormat }) => { - const packages = [ - '@storybook/web-components', - '@storybook/addon-actions', - '@storybook/addon-links', - 'lit-html', - ]; - - const versionedPackages = await getVersionedPackages(npmOptions, ...packages); - - fse.copySync(path.resolve(__dirname, 'template/'), '.', { overwrite: true }); - - if (storyFormat === StoryFormat.MDX) { - // TODO: handle adding of docs mode - } - - const packageJson = await retrievePackageJson(); - - packageJson.dependencies = packageJson.dependencies || {}; - packageJson.devDependencies = packageJson.devDependencies || {}; - - packageJson.scripts = packageJson.scripts || {}; - packageJson.scripts.storybook = 'start-storybook -p 6006'; - packageJson.scripts['build-storybook'] = 'build-storybook'; - - writePackageJson(packageJson); - - const babelDependencies = await getBabelDependencies(npmOptions, packageJson); - - installDependencies({ ...npmOptions, packageJson }, [...versionedPackages, ...babelDependencies]); +const generator: Generator = async (npmOptions, options) => { + baseGenerator(npmOptions, options, 'web-components', { + dirname: __dirname, + extraPackages: ['lit-html'], + }); }; export default generator; diff --git a/lib/cli/src/generators/WEB-COMPONENTS/template/.storybook/preview.js b/lib/cli/src/generators/WEB-COMPONENTS/template-csf/.storybook/preview.js similarity index 100% rename from lib/cli/src/generators/WEB-COMPONENTS/template/.storybook/preview.js rename to lib/cli/src/generators/WEB-COMPONENTS/template-csf/.storybook/preview.js diff --git a/lib/cli/src/generators/WEB-COMPONENTS/template/.storybook/main.js b/lib/cli/src/generators/WEB-COMPONENTS/template/.storybook/main.js deleted file mode 100644 index 3036098563cc..000000000000 --- a/lib/cli/src/generators/WEB-COMPONENTS/template/.storybook/main.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - stories: ['../stories/**/*.stories.js'], - addons: ['@storybook/addon-actions', '@storybook/addon-links'], -}; diff --git a/scripts/run-e2e.ts b/scripts/run-e2e.ts index 40e510297d6b..98ed6ca2a9e4 100644 --- a/scripts/run-e2e.ts +++ b/scripts/run-e2e.ts @@ -85,7 +85,10 @@ const initStorybook = async ({ cwd, autoDetect = true, name }: Options) => { logger.info(`🎨 Initializing Storybook with @storybook/cli`); try { const type = autoDetect ? '' : `--type ${name}`; - await exec(`npx -p @storybook/cli sb init --skip-install --yes ${type}`, { cwd }); + await exec(`node ../../storybook/lib/cli/dist/generate.js init --skip-install --yes ${type}`, { + cwd, + }); + // await exec(`npx -p @storybook/cli sb init --skip-install --yes ${type}`, { cwd }); } catch (e) { logger.error(`🚨 Storybook initialization failed`); throw e; From 6a29fb0e2e88924751ac8ef44523e31f36004d54 Mon Sep 17 00:00:00 2001 From: tooppaaa Date: Thu, 28 May 2020 23:23:18 +0200 Subject: [PATCH 24/47] Move react-native --- lib/cli/src/generators/REACT_NATIVE/index.ts | 73 +++++--------------- lib/cli/src/generators/generator.ts | 26 ++++--- 2 files changed, 36 insertions(+), 63 deletions(-) diff --git a/lib/cli/src/generators/REACT_NATIVE/index.ts b/lib/cli/src/generators/REACT_NATIVE/index.ts index f69c29ec9a98..8dbe9ae44505 100644 --- a/lib/cli/src/generators/REACT_NATIVE/index.ts +++ b/lib/cli/src/generators/REACT_NATIVE/index.ts @@ -1,32 +1,14 @@ import shell from 'shelljs'; import chalk from 'chalk'; -import { - getVersions, - retrievePackageJson, - writePackageJson, - paddedLog, - getBabelDependencies, - installDependencies, - copyTemplate, -} from '../../helpers'; +import { retrievePackageJson, paddedLog } from '../../helpers'; import { NpmOptions } from '../../NpmOptions'; -import { GeneratorOptions } from '../generator'; +import baseGenerator, { GeneratorOptions } from '../generator'; -export default async ( +const generator = async ( npmOptions: NpmOptions, installServer: boolean, - { storyFormat }: GeneratorOptions -) => { - const [storybookVersion, addonsVersion, actionsVersion, linksVersion] = await getVersions( - npmOptions, - '@storybook/react-native', - '@storybook/addons', - '@storybook/addon-actions', - '@storybook/addon-links' - ); - - copyTemplate(__dirname, storyFormat); - + options: GeneratorOptions +): Promise => { // set correct project name on entry files if possible const dirname = shell.ls('-d', 'ios/*.xcodeproj').stdout; @@ -47,35 +29,18 @@ export default async ( const packageJson = await retrievePackageJson(); - packageJson.dependencies = packageJson.dependencies || {}; - packageJson.devDependencies = packageJson.devDependencies || {}; - - const devDependencies = [ - `@storybook/react-native@${storybookVersion}`, - `@storybook/addon-actions@${actionsVersion}`, - `@storybook/addon-links@${linksVersion}`, - `@storybook/addons@${addonsVersion}`, - ]; - - if (installServer) { - devDependencies.push(`@storybook/react-native-server@${storybookVersion}`); - } - - if (!packageJson.dependencies['react-dom'] && !packageJson.devDependencies['react-dom']) { - if (packageJson.dependencies.react) { - const reactVersion = packageJson.dependencies.react; - devDependencies.push(`react-dom@${reactVersion}`); - } - } - - if (installServer) { - packageJson.scripts = packageJson.scripts || {}; - packageJson.scripts.storybook = 'start-storybook -p 7007'; - } - - writePackageJson(packageJson); - - const babelDependencies = await getBabelDependencies(npmOptions, packageJson); - - installDependencies({ ...npmOptions, packageJson }, [...devDependencies, ...babelDependencies]); + const missingReactDom = + !packageJson.dependencies['react-dom'] && !packageJson.devDependencies['react-dom']; + const reactVersion = packageJson.dependencies.react; + + await baseGenerator(npmOptions, options, 'react-native', { + extraPackages: [ + missingReactDom && reactVersion && `react-dom@${reactVersion}`, + installServer && '@storybook/react-native-server', + ].filter(Boolean), + addScripts: installServer, + addComponents: false, // We copy template-csf as it's wrapped in a storybook folder + }); }; + +export default generator; diff --git a/lib/cli/src/generators/generator.ts b/lib/cli/src/generators/generator.ts index 7d3b7a68b3bb..4e6be60e3c04 100644 --- a/lib/cli/src/generators/generator.ts +++ b/lib/cli/src/generators/generator.ts @@ -21,6 +21,8 @@ export interface FrameworkOptions { extraAddons?: string[]; dirname?: string; staticDir?: string; + addScripts?: boolean; + addComponents?: boolean; } export type Generator = (npmOptions: NpmOptions, options: GeneratorOptions) => Promise; @@ -30,6 +32,8 @@ const defaultOptions: FrameworkOptions = { extraAddons: [], dirname: __dirname, staticDir: undefined, + addScripts: true, + addComponents: true, }; const generator = async ( npmOptions: NpmOptions, @@ -37,7 +41,10 @@ const generator = async ( framework: SupportedFrameworks, options: FrameworkOptions = defaultOptions ) => { - const { extraAddons, extraPackages, dirname, staticDir } = { ...defaultOptions, ...options }; + const { extraAddons, extraPackages, dirname, staticDir, addScripts, addComponents } = { + ...defaultOptions, + ...options, + }; const packages = [ `@storybook/${framework}`, '@storybook/addon-essentials', @@ -49,18 +56,19 @@ const generator = async ( const versionedPackages = await getVersionedPackages(npmOptions, ...packages); configure(extraAddons); - copyComponents(framework, language); + if (addComponents) { + copyComponents(framework, language); + } copyTemplate(dirname || __dirname, storyFormat); const packageJson = await retrievePackageJson(); - packageJson.dependencies = packageJson.dependencies || {}; - packageJson.devDependencies = packageJson.devDependencies || {}; - - const staticParameter = staticDir ? `-s ${staticDir}` : ''; - packageJson.scripts = packageJson.scripts || {}; - packageJson.scripts.storybook = `start-storybook -p 6006 ${staticParameter}`.trim(); - packageJson.scripts['build-storybook'] = `build-storybook ${staticParameter}`.trim(); + if (addScripts) { + const staticParameter = staticDir ? `-s ${staticDir}` : ''; + packageJson.scripts = packageJson.scripts || {}; + packageJson.scripts.storybook = `start-storybook -p 6006 ${staticParameter}`.trim(); + packageJson.scripts['build-storybook'] = `build-storybook ${staticParameter}`.trim(); + } writePackageJson(packageJson); From 15f14a3ec34a872667624c50ba33c182714bb509 Mon Sep 17 00:00:00 2001 From: tooppaaa Date: Thu, 28 May 2020 23:30:44 +0200 Subject: [PATCH 25/47] Move & clean aurelia --- app/aurelia/src/demo/index.ts | 2 - .../aurelia}/0-Welcome.stories.ts | 2 +- .../aurelia}/1-Button.stories.ts | 2 +- .../cli/src/frameworks/aurelia}/button.ts | 0 .../cli/src/frameworks/aurelia}/welcome.ts | 0 lib/cli/src/generators/AURELIA/index.ts | 46 +++---------------- .../AURELIA/template-csf/.storybook/main.js | 4 -- .../AURELIA/template-mdx/.storybook/main.js | 4 -- .../src/stories/0-Welcome.stories.mdx | 2 +- .../src/stories/1-Button.stories.mdx | 2 +- 10 files changed, 11 insertions(+), 53 deletions(-) delete mode 100644 app/aurelia/src/demo/index.ts rename lib/cli/src/{generators/AURELIA/template-csf/src/stories => frameworks/aurelia}/0-Welcome.stories.ts (77%) rename lib/cli/src/{generators/AURELIA/template-csf/src/stories => frameworks/aurelia}/1-Button.stories.ts (94%) rename {app/aurelia/src/demo => lib/cli/src/frameworks/aurelia}/button.ts (100%) rename {app/aurelia/src/demo => lib/cli/src/frameworks/aurelia}/welcome.ts (100%) delete mode 100644 lib/cli/src/generators/AURELIA/template-csf/.storybook/main.js delete mode 100644 lib/cli/src/generators/AURELIA/template-mdx/.storybook/main.js diff --git a/app/aurelia/src/demo/index.ts b/app/aurelia/src/demo/index.ts deleted file mode 100644 index 9463e32d9b59..000000000000 --- a/app/aurelia/src/demo/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { default as Button } from './button'; -export { default as Welcome } from './welcome'; diff --git a/lib/cli/src/generators/AURELIA/template-csf/src/stories/0-Welcome.stories.ts b/lib/cli/src/frameworks/aurelia/0-Welcome.stories.ts similarity index 77% rename from lib/cli/src/generators/AURELIA/template-csf/src/stories/0-Welcome.stories.ts rename to lib/cli/src/frameworks/aurelia/0-Welcome.stories.ts index 92ddbc26b274..acefc457a070 100644 --- a/lib/cli/src/generators/AURELIA/template-csf/src/stories/0-Welcome.stories.ts +++ b/lib/cli/src/frameworks/aurelia/0-Welcome.stories.ts @@ -1,4 +1,4 @@ -import { Welcome } from '@storybook/aurelia/demo'; +import Welcome from './welcome'; export default { title: 'Welcome', diff --git a/lib/cli/src/generators/AURELIA/template-csf/src/stories/1-Button.stories.ts b/lib/cli/src/frameworks/aurelia/1-Button.stories.ts similarity index 94% rename from lib/cli/src/generators/AURELIA/template-csf/src/stories/1-Button.stories.ts rename to lib/cli/src/frameworks/aurelia/1-Button.stories.ts index fc178de32482..b0bb7cfc9a30 100644 --- a/lib/cli/src/generators/AURELIA/template-csf/src/stories/1-Button.stories.ts +++ b/lib/cli/src/frameworks/aurelia/1-Button.stories.ts @@ -1,7 +1,7 @@ import { action } from '@storybook/addon-actions'; import { linkTo } from '@storybook/addon-links'; -import { Button } from '@storybook/aurelia/demo'; +import Button from './button'; export default { title: 'Button', diff --git a/app/aurelia/src/demo/button.ts b/lib/cli/src/frameworks/aurelia/button.ts similarity index 100% rename from app/aurelia/src/demo/button.ts rename to lib/cli/src/frameworks/aurelia/button.ts diff --git a/app/aurelia/src/demo/welcome.ts b/lib/cli/src/frameworks/aurelia/welcome.ts similarity index 100% rename from app/aurelia/src/demo/welcome.ts rename to lib/cli/src/frameworks/aurelia/welcome.ts diff --git a/lib/cli/src/generators/AURELIA/index.ts b/lib/cli/src/generators/AURELIA/index.ts index 2e8a1e3e091a..36051a82ee74 100644 --- a/lib/cli/src/generators/AURELIA/index.ts +++ b/lib/cli/src/generators/AURELIA/index.ts @@ -1,15 +1,6 @@ -import { - getVersionedPackages, - writePackageJson, - getBabelDependencies, - installDependencies, - getPackageJson, - writeFileAsJson, - copyTemplate, - readFileAsJson, -} from '../../helpers'; -import { Generator } from '../generator'; +import { writeFileAsJson, readFileAsJson } from '../../helpers'; import { StoryFormat } from '../../project_types'; +import baseGenerator, { Generator } from '../generator'; function addStorybookExcludeGlobToTsConfig() { const tsConfigJson = readFileAsJson('tsconfig.json', true); @@ -26,36 +17,13 @@ function addStorybookExcludeGlobToTsConfig() { tsConfigJson.exclude = [...exclude, glob]; writeFileAsJson('tsconfig.json', tsConfigJson); } -const generator: Generator = async (npmOptions, { storyFormat = StoryFormat.CSF }) => { - copyTemplate(__dirname, storyFormat); - const packages = [ - '@storybook/aurelia', - '@storybook/addon-actions', - '@storybook/addon-links', - '@storybook/addons', - '@storybook/addon-storysource', - '@storybook/addon-knobs', - '@storybook/addon-options', - '@storybook/addon-a11y', - '@storybook/addon-backgrounds', - 'aurelia', - ]; - if (storyFormat === 'mdx') { - packages.push('@storybook/addon-docs'); - } - - const versionedPackages = await getVersionedPackages(npmOptions, ...packages); - const packageJson = getPackageJson(); - packageJson.dependencies = packageJson.dependencies || {}; - packageJson.devDependencies = packageJson.devDependencies || {}; - packageJson.scripts = packageJson.scripts || {}; - packageJson.scripts.storybook = 'start-storybook -p 6006'; - packageJson.scripts['build-storybook'] = 'build-storybook'; - writePackageJson(packageJson); +const generator: Generator = async (npmOptions, options) => { addStorybookExcludeGlobToTsConfig(); - const babelDependencies = await getBabelDependencies(npmOptions, packageJson); - installDependencies({ ...npmOptions, packageJson }, [...versionedPackages, ...babelDependencies]); + baseGenerator(npmOptions, options, 'aurelia', { + dirname: options.storyFormat === StoryFormat.MDX ? __dirname : undefined, + extraPackages: ['aurelia'], + }); }; export default generator; diff --git a/lib/cli/src/generators/AURELIA/template-csf/.storybook/main.js b/lib/cli/src/generators/AURELIA/template-csf/.storybook/main.js deleted file mode 100644 index 16aa97cdc160..000000000000 --- a/lib/cli/src/generators/AURELIA/template-csf/.storybook/main.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - stories: ['../src/**/*.stories.ts'], - addons: ['@storybook/addon-actions', '@storybook/addon-links'], -}; diff --git a/lib/cli/src/generators/AURELIA/template-mdx/.storybook/main.js b/lib/cli/src/generators/AURELIA/template-mdx/.storybook/main.js deleted file mode 100644 index ef8b96bacf01..000000000000 --- a/lib/cli/src/generators/AURELIA/template-mdx/.storybook/main.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - stories: ['../src/**/*.stories.(ts|mdx)'], - addons: ['@storybook/addon-docs', '@storybook/addon-actions', '@storybook/addon-links'], -}; diff --git a/lib/cli/src/generators/AURELIA/template-mdx/src/stories/0-Welcome.stories.mdx b/lib/cli/src/generators/AURELIA/template-mdx/src/stories/0-Welcome.stories.mdx index 17ad75634de5..531a441afb63 100644 --- a/lib/cli/src/generators/AURELIA/template-mdx/src/stories/0-Welcome.stories.mdx +++ b/lib/cli/src/generators/AURELIA/template-mdx/src/stories/0-Welcome.stories.mdx @@ -1,5 +1,5 @@ import { Meta, Story, Preview } from '@storybook/addon-docs/blocks'; -import { Welcome } from '@storybook/aurelia/demo'; +import Welcome from './welcome'; diff --git a/lib/cli/src/generators/AURELIA/template-mdx/src/stories/1-Button.stories.mdx b/lib/cli/src/generators/AURELIA/template-mdx/src/stories/1-Button.stories.mdx index 991fc8e92b37..de199019f6c5 100644 --- a/lib/cli/src/generators/AURELIA/template-mdx/src/stories/1-Button.stories.mdx +++ b/lib/cli/src/generators/AURELIA/template-mdx/src/stories/1-Button.stories.mdx @@ -2,7 +2,7 @@ import { Meta, Story, Preview } from '@storybook/addon-docs/blocks'; import { action } from '@storybook/addon-actions'; import { linkTo } from '@storybook/addon-links'; -import { Button } from '@storybook/aurelia/demo'; +import Button from './button'; From 5931abc70f6692d3c0e455cbef7bc8b9e8a400ff Mon Sep 17 00:00:00 2001 From: tooppaaa Date: Thu, 28 May 2020 23:40:08 +0200 Subject: [PATCH 26/47] Move and clean Angular --- .../angular}/0-Welcome.stories.ts | 2 +- .../angular}/1-Button.stories.ts | 2 +- .../frameworks/angular}/button.component.ts | 0 .../frameworks/angular}/welcome.component.ts | 0 lib/cli/src/generators/ANGULAR/index.ts | 51 +++---------------- .../ANGULAR/template-csf/.storybook/main.js | 4 -- .../ANGULAR/template-mdx/.storybook/main.js | 4 -- .../src/stories/0-Welcome.stories.mdx | 2 +- .../src/stories/1-Button.stories.mdx | 2 +- 9 files changed, 10 insertions(+), 57 deletions(-) rename lib/cli/src/{generators/ANGULAR/template-csf/src/stories => frameworks/angular}/0-Welcome.stories.ts (77%) rename lib/cli/src/{generators/ANGULAR/template-csf/src/stories => frameworks/angular}/1-Button.stories.ts (94%) rename {app/angular/src/demo => lib/cli/src/frameworks/angular}/button.component.ts (100%) rename {app/angular/src/demo => lib/cli/src/frameworks/angular}/welcome.component.ts (100%) delete mode 100644 lib/cli/src/generators/ANGULAR/template-csf/.storybook/main.js delete mode 100644 lib/cli/src/generators/ANGULAR/template-mdx/.storybook/main.js diff --git a/lib/cli/src/generators/ANGULAR/template-csf/src/stories/0-Welcome.stories.ts b/lib/cli/src/frameworks/angular/0-Welcome.stories.ts similarity index 77% rename from lib/cli/src/generators/ANGULAR/template-csf/src/stories/0-Welcome.stories.ts rename to lib/cli/src/frameworks/angular/0-Welcome.stories.ts index 058c0cc13555..38786fa32607 100644 --- a/lib/cli/src/generators/ANGULAR/template-csf/src/stories/0-Welcome.stories.ts +++ b/lib/cli/src/frameworks/angular/0-Welcome.stories.ts @@ -1,4 +1,4 @@ -import { Welcome } from '@storybook/angular/demo'; +import Welcome from './welcome.component'; export default { title: 'Welcome', diff --git a/lib/cli/src/generators/ANGULAR/template-csf/src/stories/1-Button.stories.ts b/lib/cli/src/frameworks/angular/1-Button.stories.ts similarity index 94% rename from lib/cli/src/generators/ANGULAR/template-csf/src/stories/1-Button.stories.ts rename to lib/cli/src/frameworks/angular/1-Button.stories.ts index 96383ef5d513..7915c779f6cc 100644 --- a/lib/cli/src/generators/ANGULAR/template-csf/src/stories/1-Button.stories.ts +++ b/lib/cli/src/frameworks/angular/1-Button.stories.ts @@ -1,7 +1,7 @@ import { action } from '@storybook/addon-actions'; import { linkTo } from '@storybook/addon-links'; -import { Button } from '@storybook/angular/demo'; +import Button from './button.component'; export default { title: 'Button', diff --git a/app/angular/src/demo/button.component.ts b/lib/cli/src/frameworks/angular/button.component.ts similarity index 100% rename from app/angular/src/demo/button.component.ts rename to lib/cli/src/frameworks/angular/button.component.ts diff --git a/app/angular/src/demo/welcome.component.ts b/lib/cli/src/frameworks/angular/welcome.component.ts similarity index 100% rename from app/angular/src/demo/welcome.component.ts rename to lib/cli/src/frameworks/angular/welcome.component.ts diff --git a/lib/cli/src/generators/ANGULAR/index.ts b/lib/cli/src/generators/ANGULAR/index.ts index f2587a863a8d..3d8a44cbe6f9 100644 --- a/lib/cli/src/generators/ANGULAR/index.ts +++ b/lib/cli/src/generators/ANGULAR/index.ts @@ -5,48 +5,9 @@ import { getAngularAppTsConfigJson, getAngularAppTsConfigPath, } from './angular-helpers'; -import { - retrievePackageJson, - getVersionedPackages, - writePackageJson, - getBabelDependencies, - installDependencies, - writeFileAsJson, - copyTemplate, -} from '../../helpers'; +import { writeFileAsJson } from '../../helpers'; import { StoryFormat } from '../../project_types'; -import { NpmOptions } from '../../NpmOptions'; -import { Generator, GeneratorOptions } from '../generator'; - -async function addDependencies(npmOptions: NpmOptions, { storyFormat }: GeneratorOptions) { - const packages = [ - '@storybook/angular', - '@storybook/addon-actions', - '@storybook/addon-links', - '@storybook/addons', - ]; - - if (storyFormat === StoryFormat.MDX) { - packages.push('@storybook/addon-docs'); - } - - const versionedPackages = await getVersionedPackages(npmOptions, ...packages); - - const packageJson = await retrievePackageJson(); - - packageJson.dependencies = packageJson.dependencies || {}; - packageJson.devDependencies = packageJson.devDependencies || {}; - - packageJson.scripts = packageJson.scripts || {}; - packageJson.scripts.storybook = 'start-storybook -p 6006'; - packageJson.scripts['build-storybook'] = 'build-storybook'; - - writePackageJson(packageJson); - - const babelDependencies = await getBabelDependencies(npmOptions, packageJson); - - installDependencies({ ...npmOptions, packageJson }, [...versionedPackages, ...babelDependencies]); -} +import baseGenerator, { Generator } from '../generator'; function editAngularAppTsConfig() { const tsConfigJson = getAngularAppTsConfigJson(); @@ -64,16 +25,16 @@ function editAngularAppTsConfig() { writeFileAsJson(getAngularAppTsConfigPath(), tsConfigJson); } -const generator: Generator = async (npmOptions, { storyFormat, language }) => { +const generator: Generator = async (npmOptions, options) => { if (!isDefaultProjectSet()) { throw new Error( 'Could not find a default project in your Angular workspace.\nSet a defaultProject in your angular.json and re-run the installation.' ); } + baseGenerator(npmOptions, options, 'angular', { + dirname: options.storyFormat === StoryFormat.MDX ? __dirname : undefined, + }); - copyTemplate(__dirname, storyFormat); - - await addDependencies(npmOptions, { storyFormat, language }); editAngularAppTsConfig(); editStorybookTsConfig(path.resolve('./.storybook/tsconfig.json')); }; diff --git a/lib/cli/src/generators/ANGULAR/template-csf/.storybook/main.js b/lib/cli/src/generators/ANGULAR/template-csf/.storybook/main.js deleted file mode 100644 index 16aa97cdc160..000000000000 --- a/lib/cli/src/generators/ANGULAR/template-csf/.storybook/main.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - stories: ['../src/**/*.stories.ts'], - addons: ['@storybook/addon-actions', '@storybook/addon-links'], -}; diff --git a/lib/cli/src/generators/ANGULAR/template-mdx/.storybook/main.js b/lib/cli/src/generators/ANGULAR/template-mdx/.storybook/main.js deleted file mode 100644 index ef8b96bacf01..000000000000 --- a/lib/cli/src/generators/ANGULAR/template-mdx/.storybook/main.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - stories: ['../src/**/*.stories.(ts|mdx)'], - addons: ['@storybook/addon-docs', '@storybook/addon-actions', '@storybook/addon-links'], -}; diff --git a/lib/cli/src/generators/ANGULAR/template-mdx/src/stories/0-Welcome.stories.mdx b/lib/cli/src/generators/ANGULAR/template-mdx/src/stories/0-Welcome.stories.mdx index 5fc361cd9b67..1abbfd8a65ed 100644 --- a/lib/cli/src/generators/ANGULAR/template-mdx/src/stories/0-Welcome.stories.mdx +++ b/lib/cli/src/generators/ANGULAR/template-mdx/src/stories/0-Welcome.stories.mdx @@ -1,5 +1,5 @@ import { Meta, Story, Preview } from '@storybook/addon-docs/blocks'; -import { Welcome } from '@storybook/angular/demo'; +import Welcome from './welcome.component'; diff --git a/lib/cli/src/generators/ANGULAR/template-mdx/src/stories/1-Button.stories.mdx b/lib/cli/src/generators/ANGULAR/template-mdx/src/stories/1-Button.stories.mdx index 554bf7dc0dae..d4252b3fcc47 100644 --- a/lib/cli/src/generators/ANGULAR/template-mdx/src/stories/1-Button.stories.mdx +++ b/lib/cli/src/generators/ANGULAR/template-mdx/src/stories/1-Button.stories.mdx @@ -2,7 +2,7 @@ import { Meta, Story, Preview } from '@storybook/addon-docs/blocks'; import { action } from '@storybook/addon-actions'; import { linkTo } from '@storybook/addon-links'; -import { Button } from '@storybook/angular/demo'; +import Button from './button.component'; From 29f04737743e46a668f1cba5a74b8f2fbf475559 Mon Sep 17 00:00:00 2001 From: tooppaaa Date: Thu, 28 May 2020 23:50:17 +0200 Subject: [PATCH 27/47] Oops --- scripts/run-e2e.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/scripts/run-e2e.ts b/scripts/run-e2e.ts index 98ed6ca2a9e4..40e510297d6b 100644 --- a/scripts/run-e2e.ts +++ b/scripts/run-e2e.ts @@ -85,10 +85,7 @@ const initStorybook = async ({ cwd, autoDetect = true, name }: Options) => { logger.info(`🎨 Initializing Storybook with @storybook/cli`); try { const type = autoDetect ? '' : `--type ${name}`; - await exec(`node ../../storybook/lib/cli/dist/generate.js init --skip-install --yes ${type}`, { - cwd, - }); - // await exec(`npx -p @storybook/cli sb init --skip-install --yes ${type}`, { cwd }); + await exec(`npx -p @storybook/cli sb init --skip-install --yes ${type}`, { cwd }); } catch (e) { logger.error(`🚨 Storybook initialization failed`); throw e; From b3a46d8196ab164aaf89b985e0ba6de20a9d37d0 Mon Sep 17 00:00:00 2001 From: tooppaaa Date: Fri, 29 May 2020 22:53:14 +0200 Subject: [PATCH 28/47] fix tests --- lib/cli/src/generators/generator.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/cli/src/generators/generator.ts b/lib/cli/src/generators/generator.ts index 4e6be60e3c04..797ffa1efb44 100644 --- a/lib/cli/src/generators/generator.ts +++ b/lib/cli/src/generators/generator.ts @@ -63,6 +63,9 @@ const generator = async ( const packageJson = await retrievePackageJson(); + packageJson.dependencies = packageJson.dependencies || {}; + packageJson.devDependencies = packageJson.devDependencies || {}; + if (addScripts) { const staticParameter = staticDir ? `-s ${staticDir}` : ''; packageJson.scripts = packageJson.scripts || {}; From dde7de421df594a80cc65293b04f0ee0f8b71672 Mon Sep 17 00:00:00 2001 From: tooppaaa Date: Fri, 5 Jun 2020 22:46:45 +0200 Subject: [PATCH 29/47] add angular stories back --- app/angular/src/demo/button.component.ts | 26 +++++++++++++++++++++++ app/angular/src/demo/welcome.component.ts | 26 +++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 app/angular/src/demo/button.component.ts create mode 100644 app/angular/src/demo/welcome.component.ts diff --git a/app/angular/src/demo/button.component.ts b/app/angular/src/demo/button.component.ts new file mode 100644 index 000000000000..da804e507b7d --- /dev/null +++ b/app/angular/src/demo/button.component.ts @@ -0,0 +1,26 @@ +import { Component, Input, Output, EventEmitter } from '@angular/core'; + +@Component({ + selector: 'storybook-button-component', + template: ` `, + styles: [ + ` + button { + border: 1px solid #eee; + border-radius: 3px; + background-color: #ffffff; + cursor: pointer; + font-size: 15px; + padding: 3px 10px; + margin: 10px; + } + `, + ], +}) +export default class ButtonComponent { + @Input() + text = ''; + + @Output() + onClick = new EventEmitter(); +} diff --git a/app/angular/src/demo/welcome.component.ts b/app/angular/src/demo/welcome.component.ts new file mode 100644 index 000000000000..da804e507b7d --- /dev/null +++ b/app/angular/src/demo/welcome.component.ts @@ -0,0 +1,26 @@ +import { Component, Input, Output, EventEmitter } from '@angular/core'; + +@Component({ + selector: 'storybook-button-component', + template: ` `, + styles: [ + ` + button { + border: 1px solid #eee; + border-radius: 3px; + background-color: #ffffff; + cursor: pointer; + font-size: 15px; + padding: 3px 10px; + margin: 10px; + } + `, + ], +}) +export default class ButtonComponent { + @Input() + text = ''; + + @Output() + onClick = new EventEmitter(); +} From 4ef5c5523db74e3f7cd2b9d1d54d564ebf1837c5 Mon Sep 17 00:00:00 2001 From: tooppaaa Date: Fri, 5 Jun 2020 22:54:40 +0200 Subject: [PATCH 30/47] fix aurelia --- app/aurelia/demo.d.ts | 4 --- app/aurelia/demo.js | 5 ---- .../src/stories/button.ts | 28 +++++++++++++++++++ .../src/stories/mdx.stories.mdx | 12 ++++---- 4 files changed, 33 insertions(+), 16 deletions(-) delete mode 100644 app/aurelia/demo.d.ts delete mode 100644 app/aurelia/demo.js create mode 100644 examples/aurelia-kitchen-sink/src/stories/button.ts diff --git a/app/aurelia/demo.d.ts b/app/aurelia/demo.d.ts deleted file mode 100644 index 0183b7ef451b..000000000000 --- a/app/aurelia/demo.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -declare module '@storybook/aurelia/demo' { - export const Button: any; - export const Welcome: any; -} diff --git a/app/aurelia/demo.js b/app/aurelia/demo.js deleted file mode 100644 index 64bcd548d7e8..000000000000 --- a/app/aurelia/demo.js +++ /dev/null @@ -1,5 +0,0 @@ -/* eslint-disable global-require */ -module.exports = { - Welcome: require('./dist/demo/welcome').default, - Button: require('./dist/demo/button').default, -}; diff --git a/examples/aurelia-kitchen-sink/src/stories/button.ts b/examples/aurelia-kitchen-sink/src/stories/button.ts new file mode 100644 index 000000000000..86cac656b57c --- /dev/null +++ b/examples/aurelia-kitchen-sink/src/stories/button.ts @@ -0,0 +1,28 @@ +import { customElement, bindable } from 'aurelia'; + +@customElement({ + name: 'storybook-button-component', + template: ` + + `, +}) +export default class Button { + @bindable() + text = ''; + + @bindable() + onClick: MouseEvent; +} diff --git a/examples/aurelia-kitchen-sink/src/stories/mdx.stories.mdx b/examples/aurelia-kitchen-sink/src/stories/mdx.stories.mdx index 1d2eebc447a2..cce4f666a6ec 100644 --- a/examples/aurelia-kitchen-sink/src/stories/mdx.stories.mdx +++ b/examples/aurelia-kitchen-sink/src/stories/mdx.stories.mdx @@ -1,10 +1,10 @@ import { Meta, Story, Preview } from '@storybook/addon-docs/blocks'; import { CoolButton } from '../cool-button/cool-button'; -import { Button } from '@storybook/aurelia/demo'; import { addComponents } from '@storybook/aurelia'; -import { text, withKnobs, } from '@storybook/addon-knobs'; +import { text, withKnobs } from '@storybook/addon-knobs'; +import Button from './button'; - + # Welcome @@ -15,10 +15,8 @@ This is a test document written in MDX that defines a `CoolButton` story wrapped {{ template: ``, state: { - testText: text('asfdafds', 'asasfdsa') - } + testText: text('asfdafds', 'asasfdsa'), + }, }} - - From 68d66444ab7a7b60869224fb760492c8ad346440 Mon Sep 17 00:00:00 2001 From: tooppaaa Date: Fri, 5 Jun 2020 23:17:11 +0200 Subject: [PATCH 31/47] fix welcome story --- app/angular/src/demo/welcome.component.ts | 80 +++++++++++++++++++---- 1 file changed, 66 insertions(+), 14 deletions(-) diff --git a/app/angular/src/demo/welcome.component.ts b/app/angular/src/demo/welcome.component.ts index da804e507b7d..9d97760c1d2c 100644 --- a/app/angular/src/demo/welcome.component.ts +++ b/app/angular/src/demo/welcome.component.ts @@ -1,26 +1,78 @@ -import { Component, Input, Output, EventEmitter } from '@angular/core'; +import { Component, Output, EventEmitter } from '@angular/core'; @Component({ - selector: 'storybook-button-component', - template: ` `, + selector: 'storybook-welcome-component', + template: ` +
+

Welcome to storybook

+

This is a UI component dev environment for your app.

+

+ We've added some basic stories inside the + src/stories directory.
+ A story is a single state of one or more UI components. You can have as many stories as you + want.
+ (Basically a story is like a visual test case.) +

+

+ See these sample + stories for a component + called Button . +

+

+ Just like that, you can add your own components as stories.
+ You can also edit those components and see changes right away.
+ (Try editing the Button stories located at + src/stories/index.js.) +

+

+ Usually we create stories with smaller UI components in the app.
+ Have a look at the + + Writing Stories + + section in our documentation. +

+

+ NOTE:
+ Have a look at the .storybook/webpack.config.js to add + webpack loaders and plugins you are using in this project. +

+
+ `, styles: [ ` - button { - border: 1px solid #eee; - border-radius: 3px; + main { + padding: 15px; + line-height: 1.4; + font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; background-color: #ffffff; - cursor: pointer; + } + .note { + opacity: 0.5; + } + .inline-code { font-size: 15px; - padding: 3px 10px; - margin: 10px; + font-weight: 600; + padding: 2px 5px; + border: 1px solid #eae9e9; + border-radius: 4px; + background-color: #f3f2f2; + color: #3a3a3a; + } + a { + color: #1474f3; + text-decoration: none; + border-bottom: 1px solid #1474f3; + padding-bottom: 2px; } `, ], }) -export default class ButtonComponent { - @Input() - text = ''; - +export default class WelcomeComponent { @Output() - onClick = new EventEmitter(); + showApp = new EventEmitter(); } From fde26b373f2ef0f02d4012b144d57ca9029b5db5 Mon Sep 17 00:00:00 2001 From: tooppaaa Date: Sat, 6 Jun 2020 10:45:49 +0200 Subject: [PATCH 32/47] remove plugin-external-helpers from fixtures --- lib/cli/test/fixtures/webpack_react_frozen_lock/.babelrc | 3 +-- lib/cli/test/fixtures/webpack_react_frozen_lock/package.json | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/cli/test/fixtures/webpack_react_frozen_lock/.babelrc b/lib/cli/test/fixtures/webpack_react_frozen_lock/.babelrc index e636022c817b..7dd5e9df2340 100644 --- a/lib/cli/test/fixtures/webpack_react_frozen_lock/.babelrc +++ b/lib/cli/test/fixtures/webpack_react_frozen_lock/.babelrc @@ -1,4 +1,3 @@ { - "presets": ["@babel/preset-react"], - "plugins": ["@babel/plugin-external-helpers"] + "presets": ["@babel/preset-react"] } diff --git a/lib/cli/test/fixtures/webpack_react_frozen_lock/package.json b/lib/cli/test/fixtures/webpack_react_frozen_lock/package.json index 6efbd6282c5f..3ebfc0eed05a 100644 --- a/lib/cli/test/fixtures/webpack_react_frozen_lock/package.json +++ b/lib/cli/test/fixtures/webpack_react_frozen_lock/package.json @@ -12,7 +12,6 @@ }, "devDependencies": { "@babel/core": "^7.3.4", - "@babel/plugin-external-helpers": "7.2.0", "@babel/preset-react": "7.0.0", "babel-core": "^7.0.0-bridge.0", "babel-loader": "^8.0.5", From 6dc85337af52a7cf4641688030c29aa4660b5f25 Mon Sep 17 00:00:00 2001 From: tooppaaa Date: Sun, 7 Jun 2020 20:37:36 +0200 Subject: [PATCH 33/47] merge --- .../REACT/template-csf-ts/.storybook/main.js | 4 --- .../src/stories/0-Welcome.stories.tsx | 14 -------- .../src/stories/1-Button.stories.tsx | 34 ------------------- 3 files changed, 52 deletions(-) delete mode 100644 lib/cli/src/generators/REACT/template-csf-ts/.storybook/main.js delete mode 100644 lib/cli/src/generators/REACT/template-csf-ts/src/stories/0-Welcome.stories.tsx delete mode 100644 lib/cli/src/generators/REACT/template-csf-ts/src/stories/1-Button.stories.tsx diff --git a/lib/cli/src/generators/REACT/template-csf-ts/.storybook/main.js b/lib/cli/src/generators/REACT/template-csf-ts/.storybook/main.js deleted file mode 100644 index 523dca65b677..000000000000 --- a/lib/cli/src/generators/REACT/template-csf-ts/.storybook/main.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - stories: ['../src/**/*.stories.@(ts|tsx|js|jsx)'], - addons: ['@storybook/addon-actions', '@storybook/addon-links'], -}; diff --git a/lib/cli/src/generators/REACT/template-csf-ts/src/stories/0-Welcome.stories.tsx b/lib/cli/src/generators/REACT/template-csf-ts/src/stories/0-Welcome.stories.tsx deleted file mode 100644 index c76f45f3b4be..000000000000 --- a/lib/cli/src/generators/REACT/template-csf-ts/src/stories/0-Welcome.stories.tsx +++ /dev/null @@ -1,14 +0,0 @@ -import React from 'react'; -import { linkTo } from '@storybook/addon-links'; -import { Welcome } from '@storybook/react/demo'; - -export default { - title: 'Welcome', - component: Welcome, -}; - -export const ToStorybook = () => ; - -ToStorybook.story = { - name: 'to Storybook', -}; diff --git a/lib/cli/src/generators/REACT/template-csf-ts/src/stories/1-Button.stories.tsx b/lib/cli/src/generators/REACT/template-csf-ts/src/stories/1-Button.stories.tsx deleted file mode 100644 index fdbd42fe76fe..000000000000 --- a/lib/cli/src/generators/REACT/template-csf-ts/src/stories/1-Button.stories.tsx +++ /dev/null @@ -1,34 +0,0 @@ -import React from 'react'; -import { action } from '@storybook/addon-actions'; -import { linkTo } from '@storybook/addon-links'; -import { Button } from '@storybook/react/demo'; - -export default { - title: 'Button', - component: Button, -}; - -export const Text = () => ; - -export const Emoji = () => ( - -); - -Emoji.parameters = { notes: 'My notes on a button with emojis' }; - -export const TextWithAction = () => ( - -); - -TextWithAction.storyName = 'With an action'; -TextWithAction.parameters = { notes: 'My notes on a button with emojis' }; - -export const ButtonWithLinkToAnotherStory = () => ( - -); - -ButtonWithLinkToAnotherStory.storyName = 'button with link to another story'; From 0002cd9924e5ee304a86a0fb5cb4d65333849a9a Mon Sep 17 00:00:00 2001 From: tooppaaa Date: Sun, 7 Jun 2020 22:37:42 +0200 Subject: [PATCH 34/47] fix copy template when needed --- lib/cli/src/generators/ANGULAR/index.ts | 3 ++- lib/cli/src/generators/AURELIA/index.ts | 3 ++- lib/cli/src/generators/EMBER/index.ts | 1 - lib/cli/src/generators/HTML/index.ts | 8 +++++--- lib/cli/src/generators/MARIONETTE/index.ts | 5 +---- lib/cli/src/generators/MARKO/index.ts | 5 +---- lib/cli/src/generators/MITHRIL/index.ts | 5 +---- lib/cli/src/generators/PREACT/index.ts | 5 +---- lib/cli/src/generators/RAX/index.ts | 2 -- lib/cli/src/generators/REACT/index.ts | 8 +++++--- lib/cli/src/generators/REACT_NATIVE/index.ts | 3 ++- lib/cli/src/generators/REACT_SCRIPTS/index.ts | 5 ++++- lib/cli/src/generators/RIOT/index.ts | 1 - lib/cli/src/generators/SFC_VUE/index.ts | 8 +++++--- lib/cli/src/generators/SVELTE/index.ts | 2 -- lib/cli/src/generators/WEB-COMPONENTS/index.ts | 3 +++ lib/cli/src/generators/WEBPACK_REACT/index.ts | 8 +++++--- .../template-csf-ts/.storybook/main.js | 4 ---- .../src/stories/0-Welcome.stories.tsx | 14 -------------- .../src/stories/1-Button.stories.tsx | 18 ------------------ lib/cli/src/generators/generator.ts | 5 ++--- lib/cli/src/helpers.ts | 6 ------ 22 files changed, 39 insertions(+), 83 deletions(-) delete mode 100644 lib/cli/src/generators/WEBPACK_REACT/template-csf-ts/.storybook/main.js delete mode 100644 lib/cli/src/generators/WEBPACK_REACT/template-csf-ts/src/stories/0-Welcome.stories.tsx delete mode 100644 lib/cli/src/generators/WEBPACK_REACT/template-csf-ts/src/stories/1-Button.stories.tsx diff --git a/lib/cli/src/generators/ANGULAR/index.ts b/lib/cli/src/generators/ANGULAR/index.ts index 3d8a44cbe6f9..ca976874feef 100644 --- a/lib/cli/src/generators/ANGULAR/index.ts +++ b/lib/cli/src/generators/ANGULAR/index.ts @@ -5,7 +5,7 @@ import { getAngularAppTsConfigJson, getAngularAppTsConfigPath, } from './angular-helpers'; -import { writeFileAsJson } from '../../helpers'; +import { writeFileAsJson, copyTemplate } from '../../helpers'; import { StoryFormat } from '../../project_types'; import baseGenerator, { Generator } from '../generator'; @@ -34,6 +34,7 @@ const generator: Generator = async (npmOptions, options) => { baseGenerator(npmOptions, options, 'angular', { dirname: options.storyFormat === StoryFormat.MDX ? __dirname : undefined, }); + copyTemplate(__dirname, options.storyFormat); editAngularAppTsConfig(); editStorybookTsConfig(path.resolve('./.storybook/tsconfig.json')); diff --git a/lib/cli/src/generators/AURELIA/index.ts b/lib/cli/src/generators/AURELIA/index.ts index 36051a82ee74..b2c8b5c39a7e 100644 --- a/lib/cli/src/generators/AURELIA/index.ts +++ b/lib/cli/src/generators/AURELIA/index.ts @@ -1,4 +1,4 @@ -import { writeFileAsJson, readFileAsJson } from '../../helpers'; +import { writeFileAsJson, readFileAsJson, copyTemplate } from '../../helpers'; import { StoryFormat } from '../../project_types'; import baseGenerator, { Generator } from '../generator'; @@ -24,6 +24,7 @@ const generator: Generator = async (npmOptions, options) => { dirname: options.storyFormat === StoryFormat.MDX ? __dirname : undefined, extraPackages: ['aurelia'], }); + copyTemplate(__dirname, options.storyFormat); }; export default generator; diff --git a/lib/cli/src/generators/EMBER/index.ts b/lib/cli/src/generators/EMBER/index.ts index 5560a8e453b3..f2dcbcfd0433 100644 --- a/lib/cli/src/generators/EMBER/index.ts +++ b/lib/cli/src/generators/EMBER/index.ts @@ -3,7 +3,6 @@ import { StoryFormat } from '../../project_types'; const generator: Generator = async (npmOptions, options) => { baseGenerator(npmOptions, options, 'ember', { - dirname: options.storyFormat === StoryFormat.MDX ? __dirname : undefined, extraPackages: [ // babel-plugin-ember-modules-api-polyfill is a peerDep of @storybook/ember 'babel-plugin-ember-modules-api-polyfill', diff --git a/lib/cli/src/generators/HTML/index.ts b/lib/cli/src/generators/HTML/index.ts index 519e6880ac07..ea3ba74c319f 100755 --- a/lib/cli/src/generators/HTML/index.ts +++ b/lib/cli/src/generators/HTML/index.ts @@ -1,10 +1,12 @@ import baseGenerator, { Generator } from '../generator'; import { StoryFormat } from '../../project_types'; +import { copyTemplate } from '../../helpers'; const generator: Generator = async (npmOptions, options) => { - baseGenerator(npmOptions, options, 'html', { - dirname: options.storyFormat === StoryFormat.MDX ? __dirname : undefined, - }); + baseGenerator(npmOptions, options, 'html'); + if (options.storyFormat === StoryFormat.MDX) { + copyTemplate(__dirname, StoryFormat.MDX); + } }; export default generator; diff --git a/lib/cli/src/generators/MARIONETTE/index.ts b/lib/cli/src/generators/MARIONETTE/index.ts index 6f030e5f7856..b75fc68f3699 100644 --- a/lib/cli/src/generators/MARIONETTE/index.ts +++ b/lib/cli/src/generators/MARIONETTE/index.ts @@ -1,10 +1,7 @@ import baseGenerator, { Generator } from '../generator'; -import { StoryFormat } from '../../project_types'; const generator: Generator = async (npmOptions, options) => { - await baseGenerator(npmOptions, options, 'marionette', { - dirname: options.storyFormat === StoryFormat.MDX ? __dirname : undefined, - }); + await baseGenerator(npmOptions, options, 'marionette'); }; export default generator; diff --git a/lib/cli/src/generators/MARKO/index.ts b/lib/cli/src/generators/MARKO/index.ts index 3c83040bdb61..8a986eb56914 100644 --- a/lib/cli/src/generators/MARKO/index.ts +++ b/lib/cli/src/generators/MARKO/index.ts @@ -1,10 +1,7 @@ import baseGenerator, { Generator } from '../generator'; -import { StoryFormat } from '../../project_types'; const generator: Generator = async (npmOptions, options) => { - await baseGenerator(npmOptions, options, 'marko', { - dirname: options.storyFormat === StoryFormat.MDX ? __dirname : undefined, - }); + await baseGenerator(npmOptions, options, 'marko'); }; export default generator; diff --git a/lib/cli/src/generators/MITHRIL/index.ts b/lib/cli/src/generators/MITHRIL/index.ts index 5f4f46de1b66..670559b5adba 100644 --- a/lib/cli/src/generators/MITHRIL/index.ts +++ b/lib/cli/src/generators/MITHRIL/index.ts @@ -1,10 +1,7 @@ import baseGenerator, { Generator } from '../generator'; -import { StoryFormat } from '../../project_types'; const generator: Generator = async (npmOptions, options) => { - baseGenerator(npmOptions, options, 'mithril', { - dirname: options.storyFormat === StoryFormat.MDX ? __dirname : undefined, - }); + baseGenerator(npmOptions, options, 'mithril'); }; export default generator; diff --git a/lib/cli/src/generators/PREACT/index.ts b/lib/cli/src/generators/PREACT/index.ts index edecc76690fb..d600ee291e44 100644 --- a/lib/cli/src/generators/PREACT/index.ts +++ b/lib/cli/src/generators/PREACT/index.ts @@ -1,10 +1,7 @@ import baseGenerator, { Generator } from '../generator'; -import { StoryFormat } from '../../project_types'; const generator: Generator = async (npmOptions, options) => { - baseGenerator(npmOptions, options, 'preact', { - dirname: options.storyFormat === StoryFormat.MDX ? __dirname : undefined, - }); + baseGenerator(npmOptions, options, 'preact'); }; export default generator; diff --git a/lib/cli/src/generators/RAX/index.ts b/lib/cli/src/generators/RAX/index.ts index b1854a1a6afb..07669769284a 100644 --- a/lib/cli/src/generators/RAX/index.ts +++ b/lib/cli/src/generators/RAX/index.ts @@ -1,6 +1,5 @@ import { getVersions, retrievePackageJson, writePackageJson } from '../../helpers'; import baseGenerator, { Generator } from '../generator'; -import { StoryFormat } from '../../project_types'; const generator: Generator = async (npmOptions, options) => { const [latestRaxVersion] = await getVersions(npmOptions, 'rax'); @@ -23,7 +22,6 @@ const generator: Generator = async (npmOptions, options) => { writePackageJson(packageJson); baseGenerator(npmOptions, options, 'rax', { - dirname: options.storyFormat === StoryFormat.MDX ? __dirname : undefined, extraPackages: ['rax'], }); }; diff --git a/lib/cli/src/generators/REACT/index.ts b/lib/cli/src/generators/REACT/index.ts index 3d6e7120e850..41f6aaedb6ca 100644 --- a/lib/cli/src/generators/REACT/index.ts +++ b/lib/cli/src/generators/REACT/index.ts @@ -1,10 +1,12 @@ import baseGenerator, { Generator } from '../generator'; import { StoryFormat } from '../../project_types'; +import { copyTemplate } from '../../helpers'; const generator: Generator = async (npmOptions, options) => { - await baseGenerator(npmOptions, options, 'react', { - dirname: options.storyFormat === StoryFormat.MDX ? __dirname : undefined, - }); + await baseGenerator(npmOptions, options, 'react'); + if (options.storyFormat === StoryFormat.MDX) { + copyTemplate(__dirname, StoryFormat.MDX); + } }; export default generator; diff --git a/lib/cli/src/generators/REACT_NATIVE/index.ts b/lib/cli/src/generators/REACT_NATIVE/index.ts index 8dbe9ae44505..1221fcec47e1 100644 --- a/lib/cli/src/generators/REACT_NATIVE/index.ts +++ b/lib/cli/src/generators/REACT_NATIVE/index.ts @@ -1,6 +1,6 @@ import shell from 'shelljs'; import chalk from 'chalk'; -import { retrievePackageJson, paddedLog } from '../../helpers'; +import { retrievePackageJson, paddedLog, copyTemplate } from '../../helpers'; import { NpmOptions } from '../../NpmOptions'; import baseGenerator, { GeneratorOptions } from '../generator'; @@ -41,6 +41,7 @@ const generator = async ( addScripts: installServer, addComponents: false, // We copy template-csf as it's wrapped in a storybook folder }); + copyTemplate(__dirname, options.storyFormat); }; export default generator; diff --git a/lib/cli/src/generators/REACT_SCRIPTS/index.ts b/lib/cli/src/generators/REACT_SCRIPTS/index.ts index 6112ab646032..90250854dca4 100644 --- a/lib/cli/src/generators/REACT_SCRIPTS/index.ts +++ b/lib/cli/src/generators/REACT_SCRIPTS/index.ts @@ -2,14 +2,17 @@ import path from 'path'; import fs from 'fs'; import baseGenerator, { Generator } from '../generator'; +import { copyTemplate } from '../../helpers'; import { StoryFormat } from '../../project_types'; const generator: Generator = async (npmOptions, options) => { await baseGenerator(npmOptions, options, 'react', { extraAddons: ['@storybook/preset-create-react-app'], - dirname: options.storyFormat === StoryFormat.MDX ? __dirname : undefined, staticDir: fs.existsSync(path.resolve('./public')) ? 'public' : undefined, }); + if (options.storyFormat === StoryFormat.MDX) { + copyTemplate(__dirname, StoryFormat.MDX); + } }; export default generator; diff --git a/lib/cli/src/generators/RIOT/index.ts b/lib/cli/src/generators/RIOT/index.ts index f9986bb8da87..0b076661013f 100644 --- a/lib/cli/src/generators/RIOT/index.ts +++ b/lib/cli/src/generators/RIOT/index.ts @@ -3,7 +3,6 @@ import { StoryFormat } from '../../project_types'; const generator: Generator = async (npmOptions, options) => { baseGenerator(npmOptions, options, 'riot', { - dirname: options.storyFormat === StoryFormat.MDX ? __dirname : undefined, extraPackages: ['riot-tag-loader'], }); }; diff --git a/lib/cli/src/generators/SFC_VUE/index.ts b/lib/cli/src/generators/SFC_VUE/index.ts index a947c486e843..a8f8d021f70b 100644 --- a/lib/cli/src/generators/SFC_VUE/index.ts +++ b/lib/cli/src/generators/SFC_VUE/index.ts @@ -1,10 +1,12 @@ import baseGenerator, { Generator } from '../generator'; import { StoryFormat } from '../../project_types'; +import { copyTemplate } from '../../helpers'; const generator: Generator = async (npmOptions, options) => { - baseGenerator(npmOptions, options, 'vue', { - dirname: options.storyFormat === StoryFormat.MDX ? __dirname : undefined, - }); + baseGenerator(npmOptions, options, 'vue'); + if (options.storyFormat === StoryFormat.MDX) { + copyTemplate(__dirname, StoryFormat.MDX); + } }; export default generator; diff --git a/lib/cli/src/generators/SVELTE/index.ts b/lib/cli/src/generators/SVELTE/index.ts index 3a5a2547678b..d00fe6976db3 100644 --- a/lib/cli/src/generators/SVELTE/index.ts +++ b/lib/cli/src/generators/SVELTE/index.ts @@ -1,9 +1,7 @@ import baseGenerator, { Generator } from '../generator'; -import { StoryFormat } from '../../project_types'; const generator: Generator = async (npmOptions, options) => { baseGenerator(npmOptions, options, 'svelte', { - dirname: options.storyFormat === StoryFormat.MDX ? __dirname : undefined, extraPackages: ['svelte', 'svelte-loader'], }); }; diff --git a/lib/cli/src/generators/WEB-COMPONENTS/index.ts b/lib/cli/src/generators/WEB-COMPONENTS/index.ts index 24fb41a2e24f..568297bc9b1c 100755 --- a/lib/cli/src/generators/WEB-COMPONENTS/index.ts +++ b/lib/cli/src/generators/WEB-COMPONENTS/index.ts @@ -1,10 +1,13 @@ import baseGenerator, { Generator } from '../generator'; +import { StoryFormat } from '../../project_types'; +import { copyTemplate } from '../../helpers'; const generator: Generator = async (npmOptions, options) => { baseGenerator(npmOptions, options, 'web-components', { dirname: __dirname, extraPackages: ['lit-html'], }); + copyTemplate(__dirname, StoryFormat.CSF); }; export default generator; diff --git a/lib/cli/src/generators/WEBPACK_REACT/index.ts b/lib/cli/src/generators/WEBPACK_REACT/index.ts index 98bcc8af2986..ba2e379c317e 100644 --- a/lib/cli/src/generators/WEBPACK_REACT/index.ts +++ b/lib/cli/src/generators/WEBPACK_REACT/index.ts @@ -1,10 +1,12 @@ import baseGenerator, { Generator } from '../generator'; import { StoryFormat } from '../../project_types'; +import { copyTemplate } from '../../helpers'; const generator: Generator = async (npmOptions, options) => { - baseGenerator(npmOptions, options, 'react', { - dirname: options.storyFormat === StoryFormat.MDX ? __dirname : undefined, - }); + baseGenerator(npmOptions, options, 'react'); + if (options.storyFormat === StoryFormat.MDX) { + copyTemplate(__dirname, StoryFormat.MDX); + } }; export default generator; diff --git a/lib/cli/src/generators/WEBPACK_REACT/template-csf-ts/.storybook/main.js b/lib/cli/src/generators/WEBPACK_REACT/template-csf-ts/.storybook/main.js deleted file mode 100644 index 523dca65b677..000000000000 --- a/lib/cli/src/generators/WEBPACK_REACT/template-csf-ts/.storybook/main.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - stories: ['../src/**/*.stories.@(ts|tsx|js|jsx)'], - addons: ['@storybook/addon-actions', '@storybook/addon-links'], -}; diff --git a/lib/cli/src/generators/WEBPACK_REACT/template-csf-ts/src/stories/0-Welcome.stories.tsx b/lib/cli/src/generators/WEBPACK_REACT/template-csf-ts/src/stories/0-Welcome.stories.tsx deleted file mode 100644 index c76f45f3b4be..000000000000 --- a/lib/cli/src/generators/WEBPACK_REACT/template-csf-ts/src/stories/0-Welcome.stories.tsx +++ /dev/null @@ -1,14 +0,0 @@ -import React from 'react'; -import { linkTo } from '@storybook/addon-links'; -import { Welcome } from '@storybook/react/demo'; - -export default { - title: 'Welcome', - component: Welcome, -}; - -export const ToStorybook = () => ; - -ToStorybook.story = { - name: 'to Storybook', -}; diff --git a/lib/cli/src/generators/WEBPACK_REACT/template-csf-ts/src/stories/1-Button.stories.tsx b/lib/cli/src/generators/WEBPACK_REACT/template-csf-ts/src/stories/1-Button.stories.tsx deleted file mode 100644 index 6bcfa2146627..000000000000 --- a/lib/cli/src/generators/WEBPACK_REACT/template-csf-ts/src/stories/1-Button.stories.tsx +++ /dev/null @@ -1,18 +0,0 @@ -import React from 'react'; -import { action } from '@storybook/addon-actions'; -import { Button } from '@storybook/react/demo'; - -export default { - title: 'Button', - component: Button, -}; - -export const Text = () => ; - -export const Emoji = () => ( - -); diff --git a/lib/cli/src/generators/generator.ts b/lib/cli/src/generators/generator.ts index 797ffa1efb44..c082bb5041bf 100644 --- a/lib/cli/src/generators/generator.ts +++ b/lib/cli/src/generators/generator.ts @@ -37,11 +37,11 @@ const defaultOptions: FrameworkOptions = { }; const generator = async ( npmOptions: NpmOptions, - { storyFormat, language }: GeneratorOptions, + { language }: GeneratorOptions, framework: SupportedFrameworks, options: FrameworkOptions = defaultOptions ) => { - const { extraAddons, extraPackages, dirname, staticDir, addScripts, addComponents } = { + const { extraAddons, extraPackages, staticDir, addScripts, addComponents } = { ...defaultOptions, ...options, }; @@ -59,7 +59,6 @@ const generator = async ( if (addComponents) { copyComponents(framework, language); } - copyTemplate(dirname || __dirname, storyFormat); const packageJson = await retrievePackageJson(); diff --git a/lib/cli/src/helpers.ts b/lib/cli/src/helpers.ts index 775d2840ce1a..e2a7a6b289f5 100644 --- a/lib/cli/src/helpers.ts +++ b/lib/cli/src/helpers.ts @@ -333,12 +333,6 @@ export function addToDevDependenciesIfNotPresent( export function copyTemplate(templateRoot: string, storyFormat: StoryFormat) { const templateDir = path.resolve(templateRoot, `template-${storyFormat}/`); - if ( - storyFormat !== StoryFormat.MDX && - templateRoot.match(/generators$/) // Means we're using base config and migrated - ) { - return; - } if (!fs.existsSync(templateDir)) { // Fallback to CSF plain first, in case format is typescript but template is not available. From 5fda409fdcc342a0afcb8f9abcdda643117acfc5 Mon Sep 17 00:00:00 2001 From: tooppaaa Date: Sun, 7 Jun 2020 22:49:40 +0200 Subject: [PATCH 35/47] fix build --- lib/cli/src/generators/EMBER/index.ts | 1 - lib/cli/src/generators/RIOT/index.ts | 1 - lib/cli/src/generators/generator.ts | 1 - 3 files changed, 3 deletions(-) diff --git a/lib/cli/src/generators/EMBER/index.ts b/lib/cli/src/generators/EMBER/index.ts index f2dcbcfd0433..e7b9284f03d5 100644 --- a/lib/cli/src/generators/EMBER/index.ts +++ b/lib/cli/src/generators/EMBER/index.ts @@ -1,5 +1,4 @@ import baseGenerator, { Generator } from '../generator'; -import { StoryFormat } from '../../project_types'; const generator: Generator = async (npmOptions, options) => { baseGenerator(npmOptions, options, 'ember', { diff --git a/lib/cli/src/generators/RIOT/index.ts b/lib/cli/src/generators/RIOT/index.ts index 0b076661013f..bc7361784bcd 100644 --- a/lib/cli/src/generators/RIOT/index.ts +++ b/lib/cli/src/generators/RIOT/index.ts @@ -1,5 +1,4 @@ import baseGenerator, { Generator } from '../generator'; -import { StoryFormat } from '../../project_types'; const generator: Generator = async (npmOptions, options) => { baseGenerator(npmOptions, options, 'riot', { diff --git a/lib/cli/src/generators/generator.ts b/lib/cli/src/generators/generator.ts index c082bb5041bf..f3fce69efbab 100644 --- a/lib/cli/src/generators/generator.ts +++ b/lib/cli/src/generators/generator.ts @@ -6,7 +6,6 @@ import { writePackageJson, getBabelDependencies, installDependencies, - copyTemplate, copyComponents, } from '../helpers'; import configure from './configure'; From eb0cd845e90858dc7f4928a23698df17fb09843b Mon Sep 17 00:00:00 2001 From: tooppaaa Date: Mon, 8 Jun 2020 21:53:36 +0200 Subject: [PATCH 36/47] switch to docs over essentials --- lib/cli/src/generators/ANGULAR/index.ts | 7 ++----- lib/cli/src/generators/configure.ts | 7 ++++++- lib/cli/src/generators/generator.ts | 4 +--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/cli/src/generators/ANGULAR/index.ts b/lib/cli/src/generators/ANGULAR/index.ts index ca976874feef..ca5f560dc16a 100644 --- a/lib/cli/src/generators/ANGULAR/index.ts +++ b/lib/cli/src/generators/ANGULAR/index.ts @@ -6,12 +6,11 @@ import { getAngularAppTsConfigPath, } from './angular-helpers'; import { writeFileAsJson, copyTemplate } from '../../helpers'; -import { StoryFormat } from '../../project_types'; import baseGenerator, { Generator } from '../generator'; function editAngularAppTsConfig() { const tsConfigJson = getAngularAppTsConfigJson(); - const glob = '**/*.stories.ts'; + const glob = '**/*.stories.*'; if (!tsConfigJson) { return; } @@ -31,9 +30,7 @@ const generator: Generator = async (npmOptions, options) => { 'Could not find a default project in your Angular workspace.\nSet a defaultProject in your angular.json and re-run the installation.' ); } - baseGenerator(npmOptions, options, 'angular', { - dirname: options.storyFormat === StoryFormat.MDX ? __dirname : undefined, - }); + baseGenerator(npmOptions, options, 'angular'); copyTemplate(__dirname, options.storyFormat); editAngularAppTsConfig(); diff --git a/lib/cli/src/generators/configure.ts b/lib/cli/src/generators/configure.ts index cd9e86432b52..96b12074f6d0 100644 --- a/lib/cli/src/generators/configure.ts +++ b/lib/cli/src/generators/configure.ts @@ -7,7 +7,12 @@ function mainConfigurationGenerator(addons?: string[], custom?: any) { stories: [!hasSrc && '../stories/**/*.stories.*', hasSrc && '../src/**/*.stories.*'].filter( Boolean ), - addons: ['@storybook/addon-essentials', '@storybook/addon-links', ...addons], + addons: [ + '@storybook/addon-actions', + '@storybook/addon-links', + '@storybook/addon-docs', + ...addons, + ], ...custom, }; diff --git a/lib/cli/src/generators/generator.ts b/lib/cli/src/generators/generator.ts index f3fce69efbab..835682e056a2 100644 --- a/lib/cli/src/generators/generator.ts +++ b/lib/cli/src/generators/generator.ts @@ -18,7 +18,6 @@ export type GeneratorOptions = { export interface FrameworkOptions { extraPackages?: string[]; extraAddons?: string[]; - dirname?: string; staticDir?: string; addScripts?: boolean; addComponents?: boolean; @@ -29,7 +28,6 @@ export type Generator = (npmOptions: NpmOptions, options: GeneratorOptions) => P const defaultOptions: FrameworkOptions = { extraPackages: [], extraAddons: [], - dirname: __dirname, staticDir: undefined, addScripts: true, addComponents: true, @@ -46,7 +44,7 @@ const generator = async ( }; const packages = [ `@storybook/${framework}`, - '@storybook/addon-essentials', + '@storybook/addon-docs', '@storybook/addon-actions', '@storybook/addon-links', ...extraPackages, From 5cb901174a4858fe9f50bcae2c9d81db0d6dad18 Mon Sep 17 00:00:00 2001 From: tooppaaa Date: Mon, 8 Jun 2020 22:15:56 +0200 Subject: [PATCH 37/47] fix build --- lib/cli/src/generators/AURELIA/index.ts | 2 -- lib/cli/src/generators/METEOR/index.ts | 2 -- lib/cli/src/generators/WEB-COMPONENTS/index.ts | 4 +--- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/lib/cli/src/generators/AURELIA/index.ts b/lib/cli/src/generators/AURELIA/index.ts index b2c8b5c39a7e..dd588e5d2297 100644 --- a/lib/cli/src/generators/AURELIA/index.ts +++ b/lib/cli/src/generators/AURELIA/index.ts @@ -1,5 +1,4 @@ import { writeFileAsJson, readFileAsJson, copyTemplate } from '../../helpers'; -import { StoryFormat } from '../../project_types'; import baseGenerator, { Generator } from '../generator'; function addStorybookExcludeGlobToTsConfig() { @@ -21,7 +20,6 @@ function addStorybookExcludeGlobToTsConfig() { const generator: Generator = async (npmOptions, options) => { addStorybookExcludeGlobToTsConfig(); baseGenerator(npmOptions, options, 'aurelia', { - dirname: options.storyFormat === StoryFormat.MDX ? __dirname : undefined, extraPackages: ['aurelia'], }); copyTemplate(__dirname, options.storyFormat); diff --git a/lib/cli/src/generators/METEOR/index.ts b/lib/cli/src/generators/METEOR/index.ts index f638c6d22a8c..0c9eb93c1ba1 100644 --- a/lib/cli/src/generators/METEOR/index.ts +++ b/lib/cli/src/generators/METEOR/index.ts @@ -1,11 +1,9 @@ import fs from 'fs'; import JSON5 from 'json5'; import baseGenerator, { Generator } from '../generator'; -import { StoryFormat } from '../../project_types'; const generator: Generator = async (npmOptions, options) => { baseGenerator(npmOptions, options, 'react', { - dirname: options.storyFormat === StoryFormat.MDX ? __dirname : undefined, extraPackages: ['react', 'react-dom', '@babel/preset-env', '@babel/preset-react'], staticDir: 'dist', }); diff --git a/lib/cli/src/generators/WEB-COMPONENTS/index.ts b/lib/cli/src/generators/WEB-COMPONENTS/index.ts index 568297bc9b1c..18cf796b775e 100755 --- a/lib/cli/src/generators/WEB-COMPONENTS/index.ts +++ b/lib/cli/src/generators/WEB-COMPONENTS/index.ts @@ -1,13 +1,11 @@ import baseGenerator, { Generator } from '../generator'; -import { StoryFormat } from '../../project_types'; import { copyTemplate } from '../../helpers'; const generator: Generator = async (npmOptions, options) => { baseGenerator(npmOptions, options, 'web-components', { - dirname: __dirname, extraPackages: ['lit-html'], }); - copyTemplate(__dirname, StoryFormat.CSF); + copyTemplate(__dirname, options.storyFormat); }; export default generator; From c928b2043368aeaf27e4ad62bb32a539efad7935 Mon Sep 17 00:00:00 2001 From: tooppaaa Date: Mon, 8 Jun 2020 22:48:40 +0200 Subject: [PATCH 38/47] make it green --- lib/cli/src/generators/generator.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/cli/src/generators/generator.ts b/lib/cli/src/generators/generator.ts index 835682e056a2..e592f87e5c32 100644 --- a/lib/cli/src/generators/generator.ts +++ b/lib/cli/src/generators/generator.ts @@ -44,12 +44,13 @@ const generator = async ( }; const packages = [ `@storybook/${framework}`, - '@storybook/addon-docs', + // https://github.com/storybookjs/storybook/issues/9103 + framework !== 'angular' && '@storybook/addon-essentials', '@storybook/addon-actions', '@storybook/addon-links', ...extraPackages, ...extraAddons, - ]; + ].filter(Boolean); const versionedPackages = await getVersionedPackages(npmOptions, ...packages); configure(extraAddons); From fbb5d89613d12ca2cc68d146f8ea7b9f5c2cf403 Mon Sep 17 00:00:00 2001 From: tooppaaa Date: Tue, 9 Jun 2020 08:41:50 +0200 Subject: [PATCH 39/47] Fix yarn 2 --- addons/essentials/src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/essentials/src/index.ts b/addons/essentials/src/index.ts index d95fb32acf88..470d8d192f60 100644 --- a/addons/essentials/src/index.ts +++ b/addons/essentials/src/index.ts @@ -35,6 +35,6 @@ export function addons(options: PresetOptions = {}) { const main = requireMain(options.configDir); return ['actions', 'docs', 'backgrounds', 'viewport'] .filter((key) => (options as any)[key] !== false) - .map((key) => `@storybook/addon-${key}`) + .map((key) => require.resolve(`@storybook/addon-${key}`)) .filter((addon) => !checkInstalled(addon, main)); } From 2570a66ae08d16e6110823627878258740785a96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Maisse?= Date: Tue, 9 Jun 2020 18:38:12 +0200 Subject: [PATCH 40/47] fix(cli): use the same list of addons to build `main.js` as the one added during init --- lib/cli/src/generators/configure.ts | 9 ++------- lib/cli/src/generators/generator.ts | 20 +++++++++++--------- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/lib/cli/src/generators/configure.ts b/lib/cli/src/generators/configure.ts index 96b12074f6d0..a390c4a0f6ea 100644 --- a/lib/cli/src/generators/configure.ts +++ b/lib/cli/src/generators/configure.ts @@ -1,18 +1,13 @@ import fse from 'fs-extra'; -function mainConfigurationGenerator(addons?: string[], custom?: any) { +function mainConfigurationGenerator(addons: string[], custom?: any) { const hasSrc = fse.existsSync('./src'); const config = { stories: [!hasSrc && '../stories/**/*.stories.*', hasSrc && '../src/**/*.stories.*'].filter( Boolean ), - addons: [ - '@storybook/addon-actions', - '@storybook/addon-links', - '@storybook/addon-docs', - ...addons, - ], + addons, ...custom, }; diff --git a/lib/cli/src/generators/generator.ts b/lib/cli/src/generators/generator.ts index e592f87e5c32..bc3b9e22b576 100644 --- a/lib/cli/src/generators/generator.ts +++ b/lib/cli/src/generators/generator.ts @@ -42,18 +42,20 @@ const generator = async ( ...defaultOptions, ...options, }; - const packages = [ - `@storybook/${framework}`, - // https://github.com/storybookjs/storybook/issues/9103 - framework !== 'angular' && '@storybook/addon-essentials', - '@storybook/addon-actions', + + const addons = [ '@storybook/addon-links', - ...extraPackages, - ...extraAddons, - ].filter(Boolean); + // If angular add only `actions` because docs is buggy for now (https://github.com/storybookjs/storybook/issues/9103) + // for others framework add `essentials` i.e. `actions`, `backgrounds`, `docs`, `viewport` + framework !== 'angular' ? '@storybook/addon-essentials' : '@storybook/addon-actions', + ]; + + const packages = [`@storybook/${framework}`, ...addons, ...extraPackages, ...extraAddons].filter( + Boolean + ); const versionedPackages = await getVersionedPackages(npmOptions, ...packages); - configure(extraAddons); + configure([...addons, ...extraAddons]); if (addComponents) { copyComponents(framework, language); } From 0e8ae86502bf36960c5ead7c30e8bcd80f0bc519 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Maisse?= Date: Tue, 9 Jun 2020 18:51:06 +0200 Subject: [PATCH 41/47] fix(cli): add peer deps of storybook addons when init a project Some addons have peer deps that must be added to make everything works, like '@storybook/addon-docs' => 'react-is' --- lib/cli/src/generators/generator.ts | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/lib/cli/src/generators/generator.ts b/lib/cli/src/generators/generator.ts index bc3b9e22b576..98955265146f 100644 --- a/lib/cli/src/generators/generator.ts +++ b/lib/cli/src/generators/generator.ts @@ -50,9 +50,20 @@ const generator = async ( framework !== 'angular' ? '@storybook/addon-essentials' : '@storybook/addon-actions', ]; - const packages = [`@storybook/${framework}`, ...addons, ...extraPackages, ...extraAddons].filter( - Boolean - ); + // ⚠️ Some addons have peer deps that must be added too, like '@storybook/addon-docs' => 'react-is' + const addonsPeerDeps = addons.some( + (addon) => addon === '@storybook/addon-essentials' || addon === '@storybook/addon-docs' + ) + ? ['react-is'] + : []; + + const packages = [ + `@storybook/${framework}`, + ...addons, + ...extraPackages, + ...extraAddons, + ...addonsPeerDeps, + ].filter(Boolean); const versionedPackages = await getVersionedPackages(npmOptions, ...packages); configure([...addons, ...extraAddons]); From 6e68926ef62f16141c5cff739c9bb21964224034 Mon Sep 17 00:00:00 2001 From: tooppaaa Date: Tue, 9 Jun 2020 22:21:20 +0200 Subject: [PATCH 42/47] PR Feedbacks --- lib/cli/src/generators/ANGULAR/index.ts | 2 +- lib/cli/src/generators/AURELIA/index.ts | 2 +- lib/cli/src/generators/EMBER/index.ts | 2 +- lib/cli/src/generators/HTML/index.ts | 2 +- lib/cli/src/generators/MARIONETTE/index.ts | 2 +- lib/cli/src/generators/MARKO/index.ts | 2 +- lib/cli/src/generators/METEOR/index.ts | 2 +- lib/cli/src/generators/MITHRIL/index.ts | 2 +- lib/cli/src/generators/PREACT/index.ts | 2 +- lib/cli/src/generators/RAX/index.ts | 2 +- lib/cli/src/generators/REACT/index.ts | 2 +- lib/cli/src/generators/REACT_NATIVE/index.ts | 2 +- lib/cli/src/generators/REACT_SCRIPTS/index.ts | 2 +- lib/cli/src/generators/RIOT/index.ts | 2 +- lib/cli/src/generators/SFC_VUE/index.ts | 2 +- lib/cli/src/generators/SVELTE/index.ts | 2 +- lib/cli/src/generators/WEB-COMPONENTS/index.ts | 2 +- lib/cli/src/generators/WEBPACK_REACT/index.ts | 2 +- lib/cli/src/generators/generator.ts | 9 ++++----- lib/cli/src/helpers.ts | 2 +- 20 files changed, 23 insertions(+), 24 deletions(-) diff --git a/lib/cli/src/generators/ANGULAR/index.ts b/lib/cli/src/generators/ANGULAR/index.ts index ca5f560dc16a..dd83f544fbbf 100644 --- a/lib/cli/src/generators/ANGULAR/index.ts +++ b/lib/cli/src/generators/ANGULAR/index.ts @@ -6,7 +6,7 @@ import { getAngularAppTsConfigPath, } from './angular-helpers'; import { writeFileAsJson, copyTemplate } from '../../helpers'; -import baseGenerator, { Generator } from '../generator'; +import { baseGenerator, Generator } from '../generator'; function editAngularAppTsConfig() { const tsConfigJson = getAngularAppTsConfigJson(); diff --git a/lib/cli/src/generators/AURELIA/index.ts b/lib/cli/src/generators/AURELIA/index.ts index dd588e5d2297..4b97428b8b68 100644 --- a/lib/cli/src/generators/AURELIA/index.ts +++ b/lib/cli/src/generators/AURELIA/index.ts @@ -1,5 +1,5 @@ import { writeFileAsJson, readFileAsJson, copyTemplate } from '../../helpers'; -import baseGenerator, { Generator } from '../generator'; +import { baseGenerator, Generator } from '../generator'; function addStorybookExcludeGlobToTsConfig() { const tsConfigJson = readFileAsJson('tsconfig.json', true); diff --git a/lib/cli/src/generators/EMBER/index.ts b/lib/cli/src/generators/EMBER/index.ts index e7b9284f03d5..80cab0f1b789 100644 --- a/lib/cli/src/generators/EMBER/index.ts +++ b/lib/cli/src/generators/EMBER/index.ts @@ -1,4 +1,4 @@ -import baseGenerator, { Generator } from '../generator'; +import { baseGenerator, Generator } from '../generator'; const generator: Generator = async (npmOptions, options) => { baseGenerator(npmOptions, options, 'ember', { diff --git a/lib/cli/src/generators/HTML/index.ts b/lib/cli/src/generators/HTML/index.ts index ea3ba74c319f..82b89a06b54a 100755 --- a/lib/cli/src/generators/HTML/index.ts +++ b/lib/cli/src/generators/HTML/index.ts @@ -1,4 +1,4 @@ -import baseGenerator, { Generator } from '../generator'; +import { baseGenerator, Generator } from '../generator'; import { StoryFormat } from '../../project_types'; import { copyTemplate } from '../../helpers'; diff --git a/lib/cli/src/generators/MARIONETTE/index.ts b/lib/cli/src/generators/MARIONETTE/index.ts index b75fc68f3699..c6b3e6d08f4d 100644 --- a/lib/cli/src/generators/MARIONETTE/index.ts +++ b/lib/cli/src/generators/MARIONETTE/index.ts @@ -1,4 +1,4 @@ -import baseGenerator, { Generator } from '../generator'; +import { baseGenerator, Generator } from '../generator'; const generator: Generator = async (npmOptions, options) => { await baseGenerator(npmOptions, options, 'marionette'); diff --git a/lib/cli/src/generators/MARKO/index.ts b/lib/cli/src/generators/MARKO/index.ts index 8a986eb56914..2ba06306d619 100644 --- a/lib/cli/src/generators/MARKO/index.ts +++ b/lib/cli/src/generators/MARKO/index.ts @@ -1,4 +1,4 @@ -import baseGenerator, { Generator } from '../generator'; +import { baseGenerator, Generator } from '../generator'; const generator: Generator = async (npmOptions, options) => { await baseGenerator(npmOptions, options, 'marko'); diff --git a/lib/cli/src/generators/METEOR/index.ts b/lib/cli/src/generators/METEOR/index.ts index 0c9eb93c1ba1..6055685383c6 100644 --- a/lib/cli/src/generators/METEOR/index.ts +++ b/lib/cli/src/generators/METEOR/index.ts @@ -1,6 +1,6 @@ import fs from 'fs'; import JSON5 from 'json5'; -import baseGenerator, { Generator } from '../generator'; +import { baseGenerator, Generator } from '../generator'; const generator: Generator = async (npmOptions, options) => { baseGenerator(npmOptions, options, 'react', { diff --git a/lib/cli/src/generators/MITHRIL/index.ts b/lib/cli/src/generators/MITHRIL/index.ts index 670559b5adba..d46d9f52425e 100644 --- a/lib/cli/src/generators/MITHRIL/index.ts +++ b/lib/cli/src/generators/MITHRIL/index.ts @@ -1,4 +1,4 @@ -import baseGenerator, { Generator } from '../generator'; +import { baseGenerator, Generator } from '../generator'; const generator: Generator = async (npmOptions, options) => { baseGenerator(npmOptions, options, 'mithril'); diff --git a/lib/cli/src/generators/PREACT/index.ts b/lib/cli/src/generators/PREACT/index.ts index d600ee291e44..7ffb6d6ebff7 100644 --- a/lib/cli/src/generators/PREACT/index.ts +++ b/lib/cli/src/generators/PREACT/index.ts @@ -1,4 +1,4 @@ -import baseGenerator, { Generator } from '../generator'; +import { baseGenerator, Generator } from '../generator'; const generator: Generator = async (npmOptions, options) => { baseGenerator(npmOptions, options, 'preact'); diff --git a/lib/cli/src/generators/RAX/index.ts b/lib/cli/src/generators/RAX/index.ts index 07669769284a..a59084beb540 100644 --- a/lib/cli/src/generators/RAX/index.ts +++ b/lib/cli/src/generators/RAX/index.ts @@ -1,5 +1,5 @@ import { getVersions, retrievePackageJson, writePackageJson } from '../../helpers'; -import baseGenerator, { Generator } from '../generator'; +import { baseGenerator, Generator } from '../generator'; const generator: Generator = async (npmOptions, options) => { const [latestRaxVersion] = await getVersions(npmOptions, 'rax'); diff --git a/lib/cli/src/generators/REACT/index.ts b/lib/cli/src/generators/REACT/index.ts index 41f6aaedb6ca..69ffaf26027d 100644 --- a/lib/cli/src/generators/REACT/index.ts +++ b/lib/cli/src/generators/REACT/index.ts @@ -1,4 +1,4 @@ -import baseGenerator, { Generator } from '../generator'; +import { baseGenerator, Generator } from '../generator'; import { StoryFormat } from '../../project_types'; import { copyTemplate } from '../../helpers'; diff --git a/lib/cli/src/generators/REACT_NATIVE/index.ts b/lib/cli/src/generators/REACT_NATIVE/index.ts index 1221fcec47e1..8cb227f09135 100644 --- a/lib/cli/src/generators/REACT_NATIVE/index.ts +++ b/lib/cli/src/generators/REACT_NATIVE/index.ts @@ -2,7 +2,7 @@ import shell from 'shelljs'; import chalk from 'chalk'; import { retrievePackageJson, paddedLog, copyTemplate } from '../../helpers'; import { NpmOptions } from '../../NpmOptions'; -import baseGenerator, { GeneratorOptions } from '../generator'; +import { baseGenerator, GeneratorOptions } from '../generator'; const generator = async ( npmOptions: NpmOptions, diff --git a/lib/cli/src/generators/REACT_SCRIPTS/index.ts b/lib/cli/src/generators/REACT_SCRIPTS/index.ts index 90250854dca4..3695a0297167 100644 --- a/lib/cli/src/generators/REACT_SCRIPTS/index.ts +++ b/lib/cli/src/generators/REACT_SCRIPTS/index.ts @@ -1,7 +1,7 @@ import path from 'path'; import fs from 'fs'; -import baseGenerator, { Generator } from '../generator'; +import { baseGenerator, Generator } from '../generator'; import { copyTemplate } from '../../helpers'; import { StoryFormat } from '../../project_types'; diff --git a/lib/cli/src/generators/RIOT/index.ts b/lib/cli/src/generators/RIOT/index.ts index bc7361784bcd..ba2cb30377db 100644 --- a/lib/cli/src/generators/RIOT/index.ts +++ b/lib/cli/src/generators/RIOT/index.ts @@ -1,4 +1,4 @@ -import baseGenerator, { Generator } from '../generator'; +import { baseGenerator, Generator } from '../generator'; const generator: Generator = async (npmOptions, options) => { baseGenerator(npmOptions, options, 'riot', { diff --git a/lib/cli/src/generators/SFC_VUE/index.ts b/lib/cli/src/generators/SFC_VUE/index.ts index a8f8d021f70b..49079bfe1193 100644 --- a/lib/cli/src/generators/SFC_VUE/index.ts +++ b/lib/cli/src/generators/SFC_VUE/index.ts @@ -1,4 +1,4 @@ -import baseGenerator, { Generator } from '../generator'; +import { baseGenerator, Generator } from '../generator'; import { StoryFormat } from '../../project_types'; import { copyTemplate } from '../../helpers'; diff --git a/lib/cli/src/generators/SVELTE/index.ts b/lib/cli/src/generators/SVELTE/index.ts index d00fe6976db3..29ffe349fe09 100644 --- a/lib/cli/src/generators/SVELTE/index.ts +++ b/lib/cli/src/generators/SVELTE/index.ts @@ -1,4 +1,4 @@ -import baseGenerator, { Generator } from '../generator'; +import { baseGenerator, Generator } from '../generator'; const generator: Generator = async (npmOptions, options) => { baseGenerator(npmOptions, options, 'svelte', { diff --git a/lib/cli/src/generators/WEB-COMPONENTS/index.ts b/lib/cli/src/generators/WEB-COMPONENTS/index.ts index 18cf796b775e..e6f86aa9010a 100755 --- a/lib/cli/src/generators/WEB-COMPONENTS/index.ts +++ b/lib/cli/src/generators/WEB-COMPONENTS/index.ts @@ -1,4 +1,4 @@ -import baseGenerator, { Generator } from '../generator'; +import { baseGenerator, Generator } from '../generator'; import { copyTemplate } from '../../helpers'; const generator: Generator = async (npmOptions, options) => { diff --git a/lib/cli/src/generators/WEBPACK_REACT/index.ts b/lib/cli/src/generators/WEBPACK_REACT/index.ts index ba2e379c317e..79aa177f7413 100644 --- a/lib/cli/src/generators/WEBPACK_REACT/index.ts +++ b/lib/cli/src/generators/WEBPACK_REACT/index.ts @@ -1,4 +1,4 @@ -import baseGenerator, { Generator } from '../generator'; +import { baseGenerator, Generator } from '../generator'; import { StoryFormat } from '../../project_types'; import { copyTemplate } from '../../helpers'; diff --git a/lib/cli/src/generators/generator.ts b/lib/cli/src/generators/generator.ts index 98955265146f..8de164c1c147 100644 --- a/lib/cli/src/generators/generator.ts +++ b/lib/cli/src/generators/generator.ts @@ -32,12 +32,13 @@ const defaultOptions: FrameworkOptions = { addScripts: true, addComponents: true, }; -const generator = async ( + +export async function baseGenerator( npmOptions: NpmOptions, { language }: GeneratorOptions, framework: SupportedFrameworks, options: FrameworkOptions = defaultOptions -) => { +) { const { extraAddons, extraPackages, staticDir, addScripts, addComponents } = { ...defaultOptions, ...options, @@ -88,6 +89,4 @@ const generator = async ( const babelDependencies = await getBabelDependencies(npmOptions, packageJson); installDependencies({ ...npmOptions, packageJson }, [...versionedPackages, ...babelDependencies]); -}; - -export default generator; +} diff --git a/lib/cli/src/helpers.ts b/lib/cli/src/helpers.ts index e2a7a6b289f5..b0039b13502e 100644 --- a/lib/cli/src/helpers.ts +++ b/lib/cli/src/helpers.ts @@ -347,7 +347,7 @@ export function copyTemplate(templateRoot: string, storyFormat: StoryFormat) { } export function copyComponents(framework: SupportedFrameworks, language: SupportedLanguage) { - const languageFolderMapping: { [key in SupportedLanguage]: string } = { + const languageFolderMapping: Record = { javascript: 'js', typescript: 'ts', }; From aca53020a4ff70df50719901c156a579feee2b50 Mon Sep 17 00:00:00 2001 From: tooppaaa Date: Tue, 9 Jun 2020 22:41:01 +0200 Subject: [PATCH 43/47] Use docs & actions for now --- lib/cli/src/generators/generator.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/cli/src/generators/generator.ts b/lib/cli/src/generators/generator.ts index 8de164c1c147..0ca15e7077e6 100644 --- a/lib/cli/src/generators/generator.ts +++ b/lib/cli/src/generators/generator.ts @@ -46,10 +46,12 @@ export async function baseGenerator( const addons = [ '@storybook/addon-links', - // If angular add only `actions` because docs is buggy for now (https://github.com/storybookjs/storybook/issues/9103) + '@storybook/addon-actions', + // If angular skip `docs` because docs is buggy for now (https://github.com/storybookjs/storybook/issues/9103) // for others framework add `essentials` i.e. `actions`, `backgrounds`, `docs`, `viewport` - framework !== 'angular' ? '@storybook/addon-essentials' : '@storybook/addon-actions', - ]; + // API of essentials needs to be clarified whether we need to add dependencies or not + framework !== 'angular' && '@storybook/addon-docs', + ].filter(Boolean); // ⚠️ Some addons have peer deps that must be added too, like '@storybook/addon-docs' => 'react-is' const addonsPeerDeps = addons.some( From afffa12f5533865f08b3fb83253b60c9fb0e86a7 Mon Sep 17 00:00:00 2001 From: tooppaaa Date: Thu, 11 Jun 2020 19:09:45 +0200 Subject: [PATCH 44/47] Revert "remove plugin-external-helpers from fixtures" This reverts commit fde26b373f2ef0f02d4012b144d57ca9029b5db5. --- lib/cli/test/fixtures/webpack_react_frozen_lock/.babelrc | 3 ++- lib/cli/test/fixtures/webpack_react_frozen_lock/package.json | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/cli/test/fixtures/webpack_react_frozen_lock/.babelrc b/lib/cli/test/fixtures/webpack_react_frozen_lock/.babelrc index 7dd5e9df2340..e636022c817b 100644 --- a/lib/cli/test/fixtures/webpack_react_frozen_lock/.babelrc +++ b/lib/cli/test/fixtures/webpack_react_frozen_lock/.babelrc @@ -1,3 +1,4 @@ { - "presets": ["@babel/preset-react"] + "presets": ["@babel/preset-react"], + "plugins": ["@babel/plugin-external-helpers"] } diff --git a/lib/cli/test/fixtures/webpack_react_frozen_lock/package.json b/lib/cli/test/fixtures/webpack_react_frozen_lock/package.json index 3ebfc0eed05a..6efbd6282c5f 100644 --- a/lib/cli/test/fixtures/webpack_react_frozen_lock/package.json +++ b/lib/cli/test/fixtures/webpack_react_frozen_lock/package.json @@ -12,6 +12,7 @@ }, "devDependencies": { "@babel/core": "^7.3.4", + "@babel/plugin-external-helpers": "7.2.0", "@babel/preset-react": "7.0.0", "babel-core": "^7.0.0-bridge.0", "babel-loader": "^8.0.5", From bf7616dd46a6d979a3fc2fe262a0852466250f12 Mon Sep 17 00:00:00 2001 From: tooppaaa Date: Thu, 11 Jun 2020 19:10:22 +0200 Subject: [PATCH 45/47] move vue --- lib/cli/src/generators/VUE/index.ts | 58 +-------- .../VUE/template-csf/.storybook/main.js | 4 - .../template-csf/stories/0-Welcome.stories.js | 16 --- .../template-csf/stories/1-Button.stories.js | 32 ----- .../VUE/template-csf/stories/MyButton.js | 29 ----- .../VUE/template-csf/stories/Welcome.js | 121 ------------------ 6 files changed, 6 insertions(+), 254 deletions(-) delete mode 100644 lib/cli/src/generators/VUE/template-csf/.storybook/main.js delete mode 100644 lib/cli/src/generators/VUE/template-csf/stories/0-Welcome.stories.js delete mode 100644 lib/cli/src/generators/VUE/template-csf/stories/1-Button.stories.js delete mode 100644 lib/cli/src/generators/VUE/template-csf/stories/MyButton.js delete mode 100644 lib/cli/src/generators/VUE/template-csf/stories/Welcome.js diff --git a/lib/cli/src/generators/VUE/index.ts b/lib/cli/src/generators/VUE/index.ts index 881e44d3415a..49079bfe1193 100644 --- a/lib/cli/src/generators/VUE/index.ts +++ b/lib/cli/src/generators/VUE/index.ts @@ -1,58 +1,12 @@ -import { - retrievePackageJson, - getVersion, - getVersionedPackages, - writePackageJson, - getBabelDependencies, - installDependencies, - addToDevDependenciesIfNotPresent, - copyTemplate, -} from '../../helpers'; +import { baseGenerator, Generator } from '../generator'; import { StoryFormat } from '../../project_types'; -import { Generator } from '../generator'; +import { copyTemplate } from '../../helpers'; -const generator: Generator = async (npmOptions, { storyFormat }) => { - const packages = [ - '@storybook/vue', - '@storybook/addon-actions', - '@storybook/addon-links', - '@storybook/addons', - '@babel/core', - ]; - if (storyFormat === StoryFormat.MDX) { - packages.push('@storybook/addon-docs'); +const generator: Generator = async (npmOptions, options) => { + baseGenerator(npmOptions, options, 'vue'); + if (options.storyFormat === StoryFormat.MDX) { + copyTemplate(__dirname, StoryFormat.MDX); } - const versionedPackages = await getVersionedPackages(npmOptions, ...packages); - - copyTemplate(__dirname, storyFormat); - - const packageJson = await retrievePackageJson(); - - packageJson.dependencies = packageJson.dependencies || {}; - packageJson.devDependencies = packageJson.devDependencies || {}; - - const packageBabelCoreVersion = - packageJson.dependencies['babel-core'] || packageJson.devDependencies['babel-core']; - - // This seems to be the version installed by the Vue CLI, and it is not handled by - // installBabel below. For some reason it leads to the wrong version of @babel/core (a beta) - // being installed - if (packageBabelCoreVersion === '7.0.0-bridge.0') { - addToDevDependenciesIfNotPresent( - packageJson, - '@babel/core', - await getVersion(npmOptions, '@babel/core') - ); - } - - packageJson.scripts = packageJson.scripts || {}; - packageJson.scripts.storybook = 'start-storybook -p 6006'; - packageJson.scripts['build-storybook'] = 'build-storybook'; - - writePackageJson(packageJson); - - const babelDependencies = await getBabelDependencies(npmOptions, packageJson); - installDependencies({ ...npmOptions, packageJson }, [...versionedPackages, ...babelDependencies]); }; export default generator; diff --git a/lib/cli/src/generators/VUE/template-csf/.storybook/main.js b/lib/cli/src/generators/VUE/template-csf/.storybook/main.js deleted file mode 100644 index 3036098563cc..000000000000 --- a/lib/cli/src/generators/VUE/template-csf/.storybook/main.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - stories: ['../stories/**/*.stories.js'], - addons: ['@storybook/addon-actions', '@storybook/addon-links'], -}; diff --git a/lib/cli/src/generators/VUE/template-csf/stories/0-Welcome.stories.js b/lib/cli/src/generators/VUE/template-csf/stories/0-Welcome.stories.js deleted file mode 100644 index 751d3002ef69..000000000000 --- a/lib/cli/src/generators/VUE/template-csf/stories/0-Welcome.stories.js +++ /dev/null @@ -1,16 +0,0 @@ -import { linkTo } from '@storybook/addon-links'; - -import Welcome from './Welcome'; - -export default { - title: 'Welcome', - component: Welcome, -}; - -export const ToStorybook = () => ({ - components: { Welcome }, - template: '', - methods: { action: linkTo('Button') }, -}); - -ToStorybook.storyName = 'to Storybook'; diff --git a/lib/cli/src/generators/VUE/template-csf/stories/1-Button.stories.js b/lib/cli/src/generators/VUE/template-csf/stories/1-Button.stories.js deleted file mode 100644 index 790039811cc5..000000000000 --- a/lib/cli/src/generators/VUE/template-csf/stories/1-Button.stories.js +++ /dev/null @@ -1,32 +0,0 @@ -import { action } from '@storybook/addon-actions'; -import { linkTo } from '@storybook/addon-links'; - -import MyButton from './MyButton'; - -export default { - title: 'Button', - component: MyButton, -}; - -export const Text = () => ({ - components: { MyButton }, - template: 'Hello Button', - methods: { action: action('clicked') }, -}); - -export const TextWithAction = () => ({ - components: { MyButton }, - template: 'Trigger Action', - methods: { action: () => action('This was clicked')() }, -}); - -TextWithAction.storyName = 'With an action'; -TextWithAction.parameters = { notes: 'My notes on a button with emojis' }; - -export const ButtonWithLinkToAnotherStory = () => ({ - components: { MyButton }, - template: 'Go to Welcome Story', - methods: { action: linkTo('Welcome') }, -}); - -ButtonWithLinkToAnotherStory.storyName = 'button with link to another story'; diff --git a/lib/cli/src/generators/VUE/template-csf/stories/MyButton.js b/lib/cli/src/generators/VUE/template-csf/stories/MyButton.js deleted file mode 100644 index 7ed4b85378de..000000000000 --- a/lib/cli/src/generators/VUE/template-csf/stories/MyButton.js +++ /dev/null @@ -1,29 +0,0 @@ -export default { - name: 'my-button', - - data() { - return { - buttonStyles: { - border: '1px solid #eee', - borderRadius: 3, - backgroundColor: '#FFFFFF', - cursor: 'pointer', - fontSize: 15, - padding: '3px 10px', - margin: 10, - }, - }; - }, - - template: ` - - `, - - methods: { - onClick() { - this.$emit('click'); - }, - }, -}; diff --git a/lib/cli/src/generators/VUE/template-csf/stories/Welcome.js b/lib/cli/src/generators/VUE/template-csf/stories/Welcome.js deleted file mode 100644 index 80df0039e05c..000000000000 --- a/lib/cli/src/generators/VUE/template-csf/stories/Welcome.js +++ /dev/null @@ -1,121 +0,0 @@ -// eslint-disable-next-line no-console -const log = () => console.log('Welcome to storybook!'); - -export default { - name: 'welcome', - - props: { - showApp: { - type: Function, - default: log, - }, - }, - - data() { - return { - main: { - padding: 15, - lineHeight: 1.4, - fontFamily: '"Helvetica Neue", Helvetica, "Segoe UI", Arial, freesans, sans-serif', - backgroundColor: '#ffffff', - }, - - logo: { - width: 200, - }, - - link: { - color: '#1474f3', - textDecoration: 'none', - borderBottom: '1px solid #1474f3', - paddingBottom: 2, - }, - - code: { - fontSize: 15, - fontWeight: 600, - padding: '2px 5px', - border: '1px solid #eae9e9', - borderRadius: 4, - backgroundColor: '#f3f2f2', - color: '#3a3a3a', - }, - - note: { - opacity: 0.5, - }, - }; - }, - - template: ` -
-

Welcome to storybook

-

- This is a UI component dev environment for your app. -

-

- We've added some basic stories inside the -
- src/stories -
- directory. -
- A story is a single state of one or more UI components. You can have as many stories as - you want. -
- (Basically a story is like a visual test case.) -

-

- See these sample -
- stories -
- for a component called -
- Button - . -

-

- Just like that, you can add your own components as stories. -
- You can also edit those components and see changes right away. -
- (Try editing the Button component - located at src/stories/Button.js.) -

-

- This is just one thing you can do with Storybook. -
- Have a look at the -
- - Storybook - -
- repo for more information. -

-

- NOTE: -
- Have a look at the -
- .storybook/webpack.config.js -
- to add webpack - loaders and plugins you are using in this project. -

-
- `, - - methods: { - onClick(event) { - event.preventDefault(); - this.showApp(); - }, - }, -}; From 669fdb8b4c92cc8ff51304216495177e15a07ce0 Mon Sep 17 00:00:00 2001 From: tooppaaa Date: Thu, 11 Jun 2020 21:23:52 +0200 Subject: [PATCH 46/47] finish merge --- lib/cli/src/generators/generator.ts | 16 +++++---------- lib/cli/versions.json | 30 ++++++++++++++--------------- 2 files changed, 20 insertions(+), 26 deletions(-) diff --git a/lib/cli/src/generators/generator.ts b/lib/cli/src/generators/generator.ts index fc183cf5a4d9..f3e9eda49cda 100644 --- a/lib/cli/src/generators/generator.ts +++ b/lib/cli/src/generators/generator.ts @@ -2,7 +2,7 @@ import { NpmOptions } from '../NpmOptions'; import { StoryFormat, SupportedLanguage, SupportedFrameworks } from '../project_types'; import { getBabelDependencies, copyComponents } from '../helpers'; import configure from './configure'; -import { JsPackageManager, writePackageJson } from '../js-package-manager'; +import { JsPackageManager } from '../js-package-manager'; export type GeneratorOptions = { language: SupportedLanguage; @@ -75,18 +75,12 @@ export async function baseGenerator( const packageJson = packageManager.retrievePackageJson(); - packageJson.dependencies = packageJson.dependencies || {}; - packageJson.devDependencies = packageJson.devDependencies || {}; - if (addScripts) { - const staticParameter = staticDir ? `-s ${staticDir}` : ''; - packageJson.scripts = packageJson.scripts || {}; - packageJson.scripts.storybook = `start-storybook -p 6006 ${staticParameter}`.trim(); - packageJson.scripts['build-storybook'] = `build-storybook ${staticParameter}`.trim(); + packageManager.addStorybookCommandInScripts({ + port: 6006, + staticFolder: staticDir, + }); } - - writePackageJson(packageJson); - const babelDependencies = await getBabelDependencies(packageManager, packageJson); packageManager.addDependencies({ ...npmOptions, packageJson }, [ ...versionedPackages, diff --git a/lib/cli/versions.json b/lib/cli/versions.json index 484f75880689..32702f5965be 100644 --- a/lib/cli/versions.json +++ b/lib/cli/versions.json @@ -1,17 +1,17 @@ { - "@storybook/angular": "6.0.0-beta.23", - "@storybook/aurelia": "6.0.0-beta.23", - "@storybook/ember": "6.0.0-beta.23", - "@storybook/html": "6.0.0-beta.23", - "@storybook/marionette": "6.0.0-beta.23", - "@storybook/marko": "6.0.0-beta.23", - "@storybook/mithril": "6.0.0-beta.23", - "@storybook/preact": "6.0.0-beta.23", - "@storybook/rax": "6.0.0-beta.23", - "@storybook/react": "6.0.0-beta.23", - "@storybook/riot": "6.0.0-beta.23", - "@storybook/server": "6.0.0-beta.23", - "@storybook/svelte": "6.0.0-beta.23", - "@storybook/vue": "6.0.0-beta.23", - "@storybook/web-components": "6.0.0-beta.23" + "@storybook/angular": "6.0.0-beta.25", + "@storybook/aurelia": "6.0.0-beta.25", + "@storybook/ember": "6.0.0-beta.25", + "@storybook/html": "6.0.0-beta.25", + "@storybook/marionette": "6.0.0-beta.25", + "@storybook/marko": "6.0.0-beta.25", + "@storybook/mithril": "6.0.0-beta.25", + "@storybook/preact": "6.0.0-beta.25", + "@storybook/rax": "6.0.0-beta.25", + "@storybook/react": "6.0.0-beta.25", + "@storybook/riot": "6.0.0-beta.25", + "@storybook/server": "6.0.0-beta.25", + "@storybook/svelte": "6.0.0-beta.25", + "@storybook/vue": "6.0.0-beta.25", + "@storybook/web-components": "6.0.0-beta.25" } \ No newline at end of file From 6fc491c4e9a3ee67f430bdea0714e86317a9b91a Mon Sep 17 00:00:00 2001 From: tooppaaa Date: Thu, 11 Jun 2020 21:41:14 +0200 Subject: [PATCH 47/47] fix merge --- lib/cli/src/generators/RAX/index.ts | 3 --- lib/cli/src/generators/generator.ts | 4 ++-- lib/cli/src/js-package-manager/JsPackageManager.ts | 1 + 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/cli/src/generators/RAX/index.ts b/lib/cli/src/generators/RAX/index.ts index 303edb0d022f..fc0ebc038b57 100644 --- a/lib/cli/src/generators/RAX/index.ts +++ b/lib/cli/src/generators/RAX/index.ts @@ -5,9 +5,6 @@ const generator: Generator = async (packageManager, npmOptions, options) => { const [latestRaxVersion] = await packageManager.getVersions('rax'); const packageJson = packageManager.retrievePackageJson(); - packageJson.dependencies = packageJson.dependencies || {}; - packageJson.devDependencies = packageJson.devDependencies || {}; - const raxVersion = packageJson.dependencies.rax || latestRaxVersion; // in case Rax project is not detected, `rax` package is not available either diff --git a/lib/cli/src/generators/generator.ts b/lib/cli/src/generators/generator.ts index f3e9eda49cda..344c3e8438c1 100644 --- a/lib/cli/src/generators/generator.ts +++ b/lib/cli/src/generators/generator.ts @@ -66,8 +66,8 @@ export async function baseGenerator( ...extraAddons, ...addonsPeerDeps, ].filter(Boolean); - const versionedPackages = await packageManager.getVersions(...packages); - + const versionedPackages = await packageManager.getVersionedPackages(...packages); + console.log('versionedPackages', versionedPackages); configure([...addons, ...extraAddons]); if (addComponents) { copyComponents(framework, language); diff --git a/lib/cli/src/js-package-manager/JsPackageManager.ts b/lib/cli/src/js-package-manager/JsPackageManager.ts index eeb52bfa4be7..43ee1fb5435f 100644 --- a/lib/cli/src/js-package-manager/JsPackageManager.ts +++ b/lib/cli/src/js-package-manager/JsPackageManager.ts @@ -129,6 +129,7 @@ export abstract class JsPackageManager { * @param packageNames */ public getVersions(...packageNames: string[]): Promise { + console.log('getVersions', packageNames); return Promise.all(packageNames.map((packageName) => this.getVersion(packageName))); }