-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
TestBuild: Globalize @storybook/blocks
if build.test.emptyBlocks
is true
#24650
Changes from all commits
6538477
9a72ed0
dd598b4
bbcf2bc
fc00057
e157a2a
d241d03
533d728
af3225f
c100c46
9188288
8c2d720
8fbe192
52e38c6
33ec86a
40ea412
5230210
665ddee
901516b
dda1af7
cd3ad1f
1a90573
ebd4fa6
5c51f63
1c70ab2
c3e78ac
d64b883
7c7661a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -76,6 +76,7 @@ export interface Presets { | |
apply(extension: 'managerEntries', config: [], args?: any): Promise<string[]>; | ||
apply(extension: 'refs', config?: [], args?: any): Promise<unknown>; | ||
apply(extension: 'core', config?: {}, args?: any): Promise<CoreConfig>; | ||
apply(extension: 'build', config?: {}, args?: any): Promise<StorybookConfig['build']>; | ||
apply<T>(extension: string, config?: T, args?: unknown): Promise<T>; | ||
} | ||
|
||
|
@@ -156,6 +157,7 @@ export interface CLIOptions { | |
quiet?: boolean; | ||
versionUpdates?: boolean; | ||
docs?: boolean; | ||
test?: boolean; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I changed it to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @IanVS We had a long internal discussion about this. I'm okay with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure, though I don't like relying on docs to make up for confusing names. Not everyone reads docs, and the command may be put into a package.json script where the docs are not at hand when someone is reading it and trying to understand what it does. I kind of like That said, I don't feel super-strongly about the naming, just wanted to bring it up as a potentially confusing name. Thanks for the consideration! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @shilman What do you think about —tests? |
||
debugWebpack?: boolean; | ||
webpackStatsJson?: string | boolean; | ||
outputDir?: string; | ||
|
@@ -312,6 +314,15 @@ export interface StorybookConfig { | |
legacyDecoratorFileOrder?: boolean; | ||
}; | ||
|
||
build?: { | ||
test?: { | ||
/** | ||
* Globalize @storybook/blocks | ||
*/ | ||
emptyBlocks?: boolean; | ||
}; | ||
}; | ||
|
||
/** | ||
* Tells Storybook where to find stories. | ||
* | ||
|
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 is a bit of a hack, reusing the
externalGlobalsPlugin
for this purpose.It would be more "correct" and easier to understand later to create a separate plugin for this that did
effectively it's the same, but I think this might be easier to debug down the line. It's also more effort though, which might not be worth it right now.
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.
On second thought, I don't understand why this PR even works in it's current state. Based on what I see in that plugin, it will now do:
But if
__STORYBOOK_BLOCKS_EMPTY_MODULE__
isundefined
that line will surely fail to destructure?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.
It gets assigned an empty object in the builders!