mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-04 19:11:08 +08:00
Addon-controls: Make ensureDocsBeforeControls support sub-dependencies
This commit is contained in:
parent
a5bd17f262
commit
d5efc50048
@ -16,6 +16,7 @@ describe.each([
|
||||
|
||||
describe.each([
|
||||
[['@storybook/addon-docs', '@storybook/addon-controls']],
|
||||
[['@storybook/addon-docs', 'foo/node_modules/@storybook/addon-controls']],
|
||||
[[{ name: '@storybook/addon-docs' }, '@storybook/addon-controls']],
|
||||
[['@storybook/addon-essentials', '@storybook/addon-controls']],
|
||||
[['@storybook/addon-essentials']],
|
||||
|
@ -8,7 +8,7 @@ type Entry = string | OptionsEntry;
|
||||
const findIndex = (addon: string, addons: Entry[]) =>
|
||||
addons.findIndex((entry) => {
|
||||
const name = (entry as OptionsEntry).name || (entry as string);
|
||||
return name && name.startsWith(addon);
|
||||
return name && name.includes(addon);
|
||||
});
|
||||
|
||||
const indexOfAddonOrEssentials = (addon: string, addons: Entry[]) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user