-
-
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
cli: colocate stories and components, centralize main.js #10913
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.
This looks great @tooppaaa! Some small nitpicks in the review, but otherwise feels good.
HTMLAttributes, | ||
} from 'react'; | ||
|
||
type MainProps = Omit<DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>, 'style'>; |
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.
Can we simplify the TypeScript in our welcome component? Otherwise it's very welcoming!
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 have in mind of having Welcome being a mdx story and having another more simple/friendly component. Not sure how to simplify this one
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.
Agree with @shilman a simpler type would be great but I'm a React newbie so I don't if we can do better or if there is a workaround.
@@ -54,4 +56,58 @@ describe('Helpers', () => { | |||
}).toThrowError(expectedMessage); | |||
}); | |||
}); | |||
|
|||
it.each` | |||
language | exists | expected |
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.
WHOA!!! 😍
#9103 is also impacting this as it's the reason of this nice line of code: I'm hoping removing it before being able to merge this. Before cleaning up here's what's left:
I'm confident to quickly have a PR with a single Welcome.mdx to cleanup template-mdx so I won't do much tests, but they should work anyway |
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.
Now let's take a look at this pb with Yarn 2 😄 🙃
HTMLAttributes, | ||
} from 'react'; | ||
|
||
type MainProps = Omit<DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>, 'style'>; |
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.
Agree with @shilman a simpler type would be great but I'm a React newbie so I don't if we can do better or if there is a workaround.
lib/cli/src/generators/configure.ts
Outdated
addons: [ | ||
'@storybook/addon-actions', | ||
'@storybook/addon-links', | ||
'@storybook/addon-docs', |
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.
Shouldn't it be @storybook/addon-essentials
instead?
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.
See 2570a66
Yarn 2 issue seems related to this line: https://github.com/storybookjs/storybook/blob/next/lib/core/src/server/presets.js#L124 Edit: Or not 🙃 I added 2 commits, I will check the new errors and continue to 🔍 asap |
…dded during init
Some addons have peer deps that must be added to make everything works, like '@storybook/addon-docs' => 'react-is'
const addonsPeerDeps = addons.some( | ||
(addon) => addon === '@storybook/addon-essentials' || addon === '@storybook/addon-docs' | ||
) | ||
? ['react-is'] | ||
: []; |
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.
@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💥?
Closing in favor of #11136 |
Issue: #10901
What I did
How to test