Essentials: Add addon-controls

This commit is contained in:
Michael Shilman 2020-06-24 10:54:18 +08:00
parent f39cc687c4
commit 6810146f35
3 changed files with 4 additions and 2 deletions

View File

@ -10,6 +10,7 @@ Storybook essentials includes the following addons. Addons can be disabled and r
- [Actions](https://github.com/storybookjs/storybook/tree/next/addons/actions)
- [Backgrounds](https://github.com/storybookjs/storybook/tree/next/addons/backgrounds)
- [Controls](https://github.com/storybookjs/storybook/tree/next/addons/controls)
- [Docs](https://github.com/storybookjs/storybook/tree/next/addons/docs)
- [Viewport](https://github.com/storybookjs/storybook/tree/next/addons/viewport)
@ -50,4 +51,4 @@ module.exports = {
};
```
Valid addon keys include: `actions`, `backgrounds`, `docs`, `viewport`.
Valid addon keys include: `actions`, `backgrounds`, `controls`, `docs`, `viewport`.

View File

@ -30,6 +30,7 @@
"dependencies": {
"@storybook/addon-actions": "6.0.0-beta.34",
"@storybook/addon-backgrounds": "6.0.0-beta.34",
"@storybook/addon-controls": "6.0.0-beta.34",
"@storybook/addon-docs": "6.0.0-beta.34",
"@storybook/addon-viewport": "6.0.0-beta.34",
"@storybook/addons": "6.0.0-beta.34",

View File

@ -33,7 +33,7 @@ export function addons(options: PresetOptions = {}) {
};
const main = requireMain(options.configDir);
return ['actions', 'docs', 'backgrounds', 'viewport']
return ['actions', 'docs', 'controls', 'backgrounds', 'viewport']
.filter((key) => (options as any)[key] !== false)
.map((key) => `@storybook/addon-${key}`)
.filter((addon) => !checkInstalled(addon, main));