-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
React: Add official cra-template #10122
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, only a few comments/suggestions - I think a lot of people will value this!
Pinging @mrmckeb again for another review 😉 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure about the ignores for ESLint and Prettier - maybe long-term we can see if we can fix the root issus?
But definitely this is looking great, and I think we could get it out. What do you think @ndelangen and @shilman?
}, | ||
"license": "MIT", | ||
"author": "Storybook Team", | ||
"main": "template.json", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This won't be required in the next minor, but needs to stay for now.
@mrmckeb I'm not so sure about eslint/prettier issue. I had to ignore it because I want to better align the coding style in the template with the official CRA template. What do you mean of fixing the root issue? I can't think of any alternatives for now 🤔. |
@mrmckeb Pinging you again for another review :) (Take your time!) |
I see 2 errors:
|
@ndelangen I just updated all the dependencies and template to the latest version. It should work now! However, when running |
Thanks for the contribution @kevin940726. During 6.0 we overhauled the |
Issue: #9327
What I did
Create an official CRA template for Storybook:
@storybook/cra-template
. This template is targeting 6.0 withaddon-docs
by default.The example story is sitting right inside the
src
directory calledWelcome.stories.mdx
. Since the<Welcome>
component from@storybook/react/demo
is outdated for this template, I move the introduction to mdx instead.All the other files are copied from the official
cra-template
.Once this is ready, I'll create another PR for
@storybook/cra-template-typescript
How to test
Seems like bootstrapping with custom templates withfile:
schema will fail (maybe a bug from CRA?). I'm still figuring out how to properly test this without manually coping all the files.Once this is published to npm registry, we can bootstrap it with
npx create-react-app --template @storybook my-app
.Screenshot
Questions
template.json
? I guess we can just pin them to^6.0
when they're released.docs
panel by default?c.c. @mrmckeb