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

Explain the -g pattern in documentation is for generating only, not to run storybook itself #916

Closed
TheJaredWilcurt opened this issue Apr 18, 2017 · 7 comments

Comments

@TheJaredWilcurt
Copy link

TheJaredWilcurt commented Apr 18, 2017

It's widely considered to be an anti-pattern to request that people globally install your Node Module. You shouldn't have to have Grunt, Bower, Webpack, Rollup, Storybook, etc, etc, etc, added to your system's global PATH.

Further, it can cause version issues. If the project I am using was written expecting an older version of X, but the newer, globally installed, version doesn't work with the project. Had the project just listed X in the devDependencies and accessed it via a npm run scriptName then when I ran npm install I'd have the correct version downloaded locally, and when I run it via npm run whatever it will use the correct version.

There should be documentation showing how to get start-storybook/build-storybook to run locally without adding anything to the PATH.

In order to run someone else's project, the expectation should be just to run npm install and npm start. If you have to globally install something, you're adding barriers of entry to getting more people to contribute.

@shilman
Copy link
Member

shilman commented Apr 18, 2017

Hi @TheJaredWilcurt. As far as I know, there are no global requirements for Storybook. getstorybook is a convenient way to add storybook to any React project, but you can also just edit by hand. The documentation is here:

https://storybooks.github.io/docs/react-storybook/basics/slow-start-guide

Please let me know if that answers your concern!

@avaly
Copy link
Contributor

avaly commented Apr 19, 2017

@shilman I think he might be referring to these instructions:

@shilman
Copy link
Member

shilman commented Apr 20, 2017

Ok @avaly @TheJaredWilcurt. Given that there is documentation that describes how to set things up by hand without any global requirement, does that address your concern? And if not, why not?

If you think it can be made better, please feel free to submit a PR to improve the docs!

@TheJaredWilcurt
Copy link
Author

TheJaredWilcurt commented Apr 20, 2017

You could just add in a link to the slow guide next to the other, far easier to find, instructions that said:

"If you want instructions on using Storybook that don't require polluting your PATH, click here."

Feel free to pretty up that language, I'm no wordsmith.

@ndelangen
Copy link
Member

We're working on better documentation, thanks for the notification we should improve on this front.

I agree, less global installs is better.

However to get a project setup from scratch it's very common to have some sort of generator you need to install globally. This is what getstorybook is.

@ndelangen ndelangen changed the title Avoid -g anti-pattern Explain the -g pattern in documentation is for generating only, not to run storybook itself Jul 7, 2017
@stale
Copy link

stale bot commented Oct 31, 2017

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. We do try to do some housekeeping every once in a while so inactive issues will get closed after 90 days. Thanks!

@danielduan
Copy link
Member

done.

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

5 participants