learnstorybook.com icon indicating copy to clipboard operation
learnstorybook.com copied to clipboard

getting started guide

Open dataf3l opened this issue 1 year ago • 1 comments

in the guide you say:

https://github.com/chromaui/learnstorybook.com/blob/master/content/intro-to-storybook/react/en/get-started.md

git add .

this may accidentally add the node_modules folder.

should we add a step to prevent that? maybe some new person will make this mistake and will create large repos.

just a thought

dataf3l avatar May 08 '24 00:05 dataf3l

@dataf3l thanks for reaching out to us with your feedback. We appreciate it. While I understand your reasoning, both the template and a standard application initialized via a generator (e.g., Vite) will automatically set up a .gitignore file configured with a set of files and directories that should not be committed and pushed to a repository. Adding it wouldn't bring anything new to the tutorial and would add a breaking point in the documentation (if it was added as an aside), or extend it more unnecessarily.

jonniebigodes avatar May 08 '24 13:05 jonniebigodes

Maybe the documentation could be structured like this (just an example):

git init
git add .gitignore

⚠️ If .gitignore isn’t present yet, you might consider creating it first:

echo 'node_modules/' > .gitignore
git add .gitignore
git commit -m "Add .gitignore to ignore dependencies"

If .gitignore already exists, make sure it includes node_modules/. If not, consider editing it using your preferred text editor.

The reason I bring this up: running git add . before ensuring node_modules is ignored can accidentally add thousands of files. This happens more than you'd think:

https://github.com/search?q=%22remove+node_modules%22+language%3AJavaScript&type=issues

Once you're confident the ignore rules are in place, then:

git add .
git commit -m "Initial commit"

Totally possible my thinking is off here — just wanted to share this idea in case it helps others avoid a common pitfall.

dataf3l avatar Apr 29 '25 17:04 dataf3l