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

Refactor CLI to include commands that perform Storybook related actions #1108

Closed
ndelangen opened this issue May 23, 2017 · 23 comments
Closed

Comments

@ndelangen
Copy link
Member

ndelangen commented May 23, 2017

I have big plans for the cli:
I actually want to build something like this (eventually):

sb start   # starts and opens storybook 
sb start --public  # starts and create a temp public url to share
sb build  # builds to static site
sb deploy  # builds to static site & deploy to heroku
sb help <searchterm>  # search our documentation 
sb migrate  # run codemods to latest version
sb init  # adds storybook to project (auto-detect or asks)
sb init --react  # adds storybook for react to project
sb info  # show version, addons, system, config status 

Initialising could be done without a global install using npx:

npx sb -- init

Choose which template:

npx sb -- init --type=vue

system info:
https://github.com/tabrindle/envinfo

@usulpro
Copy link
Member

usulpro commented Sep 19, 2017

In continuation of #764.
It would be nice to extend getstorybook with API which allow specifying custom templates in addition to those from @storybook/cli package.
I guess getstorybook was created to solve the issue of quick adding Storybook to the existing project. And it solved it at that stage, but the more new addons appear, the more time we need to spend to install them manually and harder to start using the project for beginners.

So providing additional customization could help with:

  • including addons

  • organizing files/folders structure

  • adding custom decorators or anything else to stories

  • adding specific boilerplates

Such templates could handle some specific use cases of Storybook

I think this API could look like this, for example:

getstorybook --with package

where package is everything that can be installed by npm i

Then we can provide some own extensions e.g.:

getstorybook --with @storybook/template-kitchen-sink

-- to get storybook with the maximum configuration

And other developers could create their own, like:

getstorybook --with https://github.com/react-theming/material-ui.git

what do you think?

@ndelangen
Copy link
Member Author

ndelangen commented Sep 20, 2017

I like the idea of adding addons via our cli.

I'm thinking we could add a add command to the future CLI:

sb add knobs

And in fact what would be really cool is if we could offer a autocomple feature here...

sb add

Would then use enquirer and a json-fetch to grab the list of recommended addons from https://storybook.js.org/addons.json

I really want to do away with the getstorybook uni-command that does absolutely everything using dark magic.

@ersel
Copy link
Contributor

ersel commented Dec 3, 2017

Just a quick update. I was busy for the last 2 weekends. Will pick this up following weekend.

@ersel
Copy link
Contributor

ersel commented Dec 10, 2017

I was bedridden with flu this weekend :( I have a 2 week holiday coming up, will make some time to pick it up before Xmas.

@ndelangen
Copy link
Member Author

🎄 🎁

@gersongoulart
Copy link

@ndelangen are there any plans to allow programmatic usage of storybook's build system? I'm needing to do something like:

const storybook = require('build-storybook');
const buildConfig = {/* ... */};
//...
storybook(buildConfig);

I'd be more than happy to contribute with a PR, just need some direction on how to get started...

@ndelangen
Copy link
Member Author

@gersongoulart I'd be happy to add this functionality to storybook.

How to exactly achieve this, I'd have to really dive into too. Right now, I just don't know either.

Let's have a look together, maybe you, me and @ersel can go on a skype-call together and figure this out?

@ersel
Copy link
Contributor

ersel commented Dec 17, 2017

I would be happy to have a call any time this week.

@ndelangen
Copy link
Member Author

ndelangen commented Dec 18, 2017

@gersongoulart when would you be available? Would you mind joining our slack so we can communicate easier?

self invite link

@gersongoulart
Copy link

@ndelangen, @ersel sorry for the delay, much going on lately. The "self invite link" above is no longer working (probably expired). I'm in Vancouver (UTC-08:00) but would be more than happy to join in a Skype call whenever works best for you.

@ndelangen
Copy link
Member Author

UPDATED the link above

@ndelangen ndelangen removed their assignment Feb 8, 2018
@danielduan
Copy link
Member

@ndelangen can we close this one?

I'd like to make these tickets more scoped in the future so they aren't open forever. If we are planning to add addons via the CLI, can we create a new ticket specifically for that?

@ersel ersel removed their assignment Mar 21, 2018
@ersel
Copy link
Contributor

ersel commented Mar 21, 2018

Sorry for the radio silence, my circumstances have changed since we last spoke. I have recently started a new job and don't have time to pick this up anymore. Hope someone else can pick it up.

@danielduan danielduan changed the title Improve CLI Refactor CLI to include commands that perform Storybook related actions Mar 23, 2018
@wuweiweiwu
Copy link
Member

wuweiweiwu commented Apr 16, 2018

@ndelangen @danielduan I'd like to take this up!

Seems like a large todo list..

perhaps starting with adding packages via the getstorybook cli?

@ndelangen
Copy link
Member Author

@wuweiweiwu and me are going to discuss this epic tomorrow evening.

@ndelangen ndelangen modified the milestones: v4.0.0, next May 24, 2018
@Keraito
Copy link
Contributor

Keraito commented Jun 12, 2018

I would definitely like to help out with this when we're actively working on it! 😍

@Keraito
Copy link
Contributor

Keraito commented Sep 2, 2018

Really wanted to work on this, so reached out the @ndelangen on Slack and for now the short term goals are to:

  • Change the current CLI to be able to handle more than just one thing.
  • Implement the trivial commands like start and build.
  • Probably also some migrations of tests.

After that, it can be expanded with all the ideas in this issue.
@wuweiweiwu, are you still down to work on this?

@Keraito Keraito mentioned this issue Sep 11, 2018
@libetl
Copy link
Member

libetl commented Sep 13, 2018

storybook snippets [framework] : add some sample snippets from the chosen framework (detected one or in param) as stories
We could also inject them from the kitchen sinks

@libetl
Copy link
Member

libetl commented Sep 13, 2018

storybook upgrade : upgrade to latest version of the cli

@libetl
Copy link
Member

libetl commented Sep 13, 2018

mmmh... storybook deploy is it worth trying surge instead ? surge would be free.

@libetl
Copy link
Member

libetl commented Sep 13, 2018

storybook test : run the storyshots ?

This was referenced Sep 16, 2018
@shilman shilman mentioned this issue Oct 15, 2018
3 tasks
@shilman shilman removed this from the next milestone Apr 26, 2019
@kohakukun
Copy link
Contributor

Is there work left to do for this feature? I would like to work on this

@shilman
Copy link
Member

shilman commented Jul 15, 2019

Hurrah!! I just released https://github.com/storybookjs/storybook/releases/tag/v5.2.0-alpha.44 containing PR #7414 that references this issue. Upgrade today to try it out!

You can find this prerelease on the @next NPM tag.

Closing this issue. Please re-open if you think there's still more to do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests