Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cli: colocate stories and components, centralize main.js #10913

Closed
wants to merge 56 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
dae9d40
rename generator
tooppaaa May 25, 2020
5597f5a
CLI: react stories
tooppaaa May 25, 2020
b2d5744
fix build
tooppaaa May 25, 2020
fb1a124
fixes
tooppaaa May 25, 2020
8434dcc
fix tests
tooppaaa May 25, 2020
8673294
fix unit test
tooppaaa May 25, 2020
2b5372e
fix lint
tooppaaa May 25, 2020
93eaae0
fix tests
tooppaaa May 25, 2020
665163d
fix unit test
tooppaaa May 25, 2020
7cf2595
Feedbacks
tooppaaa May 26, 2020
f535af4
Move ember
tooppaaa May 26, 2020
2783b12
Move Meteor
tooppaaa May 26, 2020
79d6b00
Move mithril
tooppaaa May 26, 2020
06e3c14
Move preact
tooppaaa May 26, 2020
fb3845d
Move rax
tooppaaa May 26, 2020
5ba3eef
Move riot
tooppaaa May 26, 2020
ba37d85
Move svelte
tooppaaa May 26, 2020
4722220
Move marko and cleanup
tooppaaa May 26, 2020
0e2f5f6
Move marionette
tooppaaa May 26, 2020
cdea7b9
Move vue
tooppaaa May 26, 2020
6d3eec2
Move html
tooppaaa May 26, 2020
6aad11e
no tabs
ndelangen May 28, 2020
c40b550
Merge remote-tracking branch 'origin/next' into tech/colocateReactSto…
tooppaaa May 28, 2020
858ff9f
Merge branch 'tech/colocateReactStories' into tech/colocateSomeStories
tooppaaa May 28, 2020
62d58b2
Merge pull request #10935 from storybookjs/tech/colocateSomeStories
tooppaaa May 28, 2020
10dbb81
Move WebComponents
tooppaaa May 28, 2020
6a29fb0
Move react-native
tooppaaa May 28, 2020
15f14a3
Move & clean aurelia
tooppaaa May 28, 2020
5931abc
Move and clean Angular
tooppaaa May 28, 2020
29f0473
Oops
tooppaaa May 28, 2020
b3a46d8
fix tests
tooppaaa May 29, 2020
61f6968
Merge remote-tracking branch 'origin/next' into tech/colocateReactSto…
tooppaaa Jun 5, 2020
e052b64
Merge branch 'tech/colocateReactStories' into tech/colocateMoreStories
tooppaaa Jun 5, 2020
2ce9d3e
Merge pull request #10972 from storybookjs/tech/colocateMoreStories
tooppaaa Jun 5, 2020
dde7de4
add angular stories back
tooppaaa Jun 5, 2020
4ef5c55
fix aurelia
tooppaaa Jun 5, 2020
68d6644
fix welcome story
tooppaaa Jun 5, 2020
fde26b3
remove plugin-external-helpers from fixtures
tooppaaa Jun 6, 2020
6802976
Merge remote-tracking branch 'origin/next' into tech/colocateReactSto…
tooppaaa Jun 7, 2020
6dc8533
merge
tooppaaa Jun 7, 2020
0002cd9
fix copy template when needed
tooppaaa Jun 7, 2020
5fda409
fix build
tooppaaa Jun 7, 2020
eb0cd84
switch to docs over essentials
tooppaaa Jun 8, 2020
5cb9011
fix build
tooppaaa Jun 8, 2020
c928b20
make it green
tooppaaa Jun 8, 2020
fbb5d89
Fix yarn 2
tooppaaa Jun 9, 2020
2570a66
fix(cli): use the same list of addons to build `main.js` as the one a…
gaetanmaisse Jun 9, 2020
0e8ae86
fix(cli): add peer deps of storybook addons when init a project
gaetanmaisse Jun 9, 2020
6e68926
PR Feedbacks
tooppaaa Jun 9, 2020
aca5302
Use docs & actions for now
tooppaaa Jun 9, 2020
d7113b5
Merge branch 'next' into tech/colocateReactStories
ndelangen Jun 10, 2020
afffa12
Revert "remove plugin-external-helpers from fixtures"
tooppaaa Jun 11, 2020
bf7616d
move vue
tooppaaa Jun 11, 2020
638b51e
Merge remote-tracking branch 'origin/next' into tech/colocateReactSto…
tooppaaa Jun 11, 2020
669fdb8
finish merge
tooppaaa Jun 11, 2020
6fc491c
fix merge
tooppaaa Jun 11, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions lib/cli/src/generators/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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']
: [];
Comment on lines +56 to +60
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shilman any reason to have react-is as a peerDep and not a regular dep? I'm guessing because having multiples different versions in a single project leads to chaos💥?


const packages = [
`@storybook/${framework}`,
...addons,
...extraPackages,
...extraAddons,
...addonsPeerDeps,
].filter(Boolean);
const versionedPackages = await getVersionedPackages(npmOptions, ...packages);

configure([...addons, ...extraAddons]);
Expand Down