Skip to content

Commit

Permalink
Merge branch 'next' into chore_add_api_section_snippets
Browse files Browse the repository at this point in the history
  • Loading branch information
jonniebigodes committed Aug 11, 2020
2 parents 2581f63 + 7a34522 commit fe3b3e0
Show file tree
Hide file tree
Showing 112 changed files with 551 additions and 513 deletions.
2 changes: 1 addition & 1 deletion MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,7 @@ addons.setConfig({
The `addParameters` and `addDecorator` APIs to add global decorators and parameters, exported by the various frameworks (e.g. `@storybook/react`) and `@storybook/client` are now deprecated.
Instead, use `export const parameters = {};` and `export const decorators = [];` in your `.storybook/preview.js`. Addon authors similarly should use such an export in a `previewEntry` file.
Instead, use `export const parameters = {};` and `export const decorators = [];` in your `.storybook/preview.js`. Addon authors similarly should use such an export in a preview entry file (see [Preview entries](https://github.com/storybookjs/storybook/blob/next/docs/api/writing-presets.md#preview-entries)).
#### Deprecated clearDecorators
Expand Down
2 changes: 1 addition & 1 deletion addons/a11y/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"publishConfig": {
"access": "public"
},
"gitHead": "d31e743fc15970ad5722abf4678e03be82bf8b8b",
"gitHead": "46bf85714342208cf612aee130f8876ce56ba46b",
"typesVersions": {
"<=3.5": {
"*": [
Expand Down
2 changes: 1 addition & 1 deletion addons/actions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"publishConfig": {
"access": "public"
},
"gitHead": "d31e743fc15970ad5722abf4678e03be82bf8b8b",
"gitHead": "46bf85714342208cf612aee130f8876ce56ba46b",
"typesVersions": {
"<=3.5": {
"*": [
Expand Down
2 changes: 1 addition & 1 deletion addons/backgrounds/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"publishConfig": {
"access": "public"
},
"gitHead": "d31e743fc15970ad5722abf4678e03be82bf8b8b",
"gitHead": "46bf85714342208cf612aee130f8876ce56ba46b",
"typesVersions": {
"<=3.5": {
"*": [
Expand Down
2 changes: 1 addition & 1 deletion addons/controls/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,5 @@
"publishConfig": {
"access": "public"
},
"gitHead": "d31e743fc15970ad5722abf4678e03be82bf8b8b"
"gitHead": "46bf85714342208cf612aee130f8876ce56ba46b"
}
2 changes: 1 addition & 1 deletion addons/cssresources/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"publishConfig": {
"access": "public"
},
"gitHead": "d31e743fc15970ad5722abf4678e03be82bf8b8b",
"gitHead": "46bf85714342208cf612aee130f8876ce56ba46b",
"typesVersions": {
"<=3.5": {
"*": [
Expand Down
2 changes: 1 addition & 1 deletion addons/design-assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"publishConfig": {
"access": "public"
},
"gitHead": "d31e743fc15970ad5722abf4678e03be82bf8b8b",
"gitHead": "46bf85714342208cf612aee130f8876ce56ba46b",
"typesVersions": {
"<=3.5": {
"*": [
Expand Down
2 changes: 1 addition & 1 deletion addons/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@
"publishConfig": {
"access": "public"
},
"gitHead": "d31e743fc15970ad5722abf4678e03be82bf8b8b",
"gitHead": "46bf85714342208cf612aee130f8876ce56ba46b",
"typesVersions": {
"<=3.5": {
"*": [
Expand Down
2 changes: 1 addition & 1 deletion addons/essentials/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"publishConfig": {
"access": "public"
},
"gitHead": "d31e743fc15970ad5722abf4678e03be82bf8b8b",
"gitHead": "46bf85714342208cf612aee130f8876ce56ba46b",
"typesVersions": {
"<=3.5": {
"*": [
Expand Down
2 changes: 1 addition & 1 deletion addons/events/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"publishConfig": {
"access": "public"
},
"gitHead": "d31e743fc15970ad5722abf4678e03be82bf8b8b",
"gitHead": "46bf85714342208cf612aee130f8876ce56ba46b",
"typesVersions": {
"<=3.5": {
"*": [
Expand Down
2 changes: 1 addition & 1 deletion addons/google-analytics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@
"publishConfig": {
"access": "public"
},
"gitHead": "d31e743fc15970ad5722abf4678e03be82bf8b8b"
"gitHead": "46bf85714342208cf612aee130f8876ce56ba46b"
}
2 changes: 1 addition & 1 deletion addons/graphql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"publishConfig": {
"access": "public"
},
"gitHead": "d31e743fc15970ad5722abf4678e03be82bf8b8b",
"gitHead": "46bf85714342208cf612aee130f8876ce56ba46b",
"typesVersions": {
"<=3.5": {
"*": [
Expand Down
2 changes: 1 addition & 1 deletion addons/jest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"publishConfig": {
"access": "public"
},
"gitHead": "d31e743fc15970ad5722abf4678e03be82bf8b8b",
"gitHead": "46bf85714342208cf612aee130f8876ce56ba46b",
"typesVersions": {
"<=3.5": {
"*": [
Expand Down
2 changes: 1 addition & 1 deletion addons/knobs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"publishConfig": {
"access": "public"
},
"gitHead": "d31e743fc15970ad5722abf4678e03be82bf8b8b",
"gitHead": "46bf85714342208cf612aee130f8876ce56ba46b",
"typesVersions": {
"<=3.5": {
"*": [
Expand Down
2 changes: 1 addition & 1 deletion addons/links/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"publishConfig": {
"access": "public"
},
"gitHead": "d31e743fc15970ad5722abf4678e03be82bf8b8b",
"gitHead": "46bf85714342208cf612aee130f8876ce56ba46b",
"typesVersions": {
"<=3.5": {
"*": [
Expand Down
2 changes: 1 addition & 1 deletion addons/queryparams/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"publishConfig": {
"access": "public"
},
"gitHead": "d31e743fc15970ad5722abf4678e03be82bf8b8b",
"gitHead": "46bf85714342208cf612aee130f8876ce56ba46b",
"typesVersions": {
"<=3.5": {
"*": [
Expand Down
2 changes: 1 addition & 1 deletion addons/storyshots/storyshots-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"publishConfig": {
"access": "public"
},
"gitHead": "d31e743fc15970ad5722abf4678e03be82bf8b8b",
"gitHead": "46bf85714342208cf612aee130f8876ce56ba46b",
"typesVersions": {
"<=3.5": {
"*": [
Expand Down
2 changes: 1 addition & 1 deletion addons/storyshots/storyshots-puppeteer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"publishConfig": {
"access": "public"
},
"gitHead": "d31e743fc15970ad5722abf4678e03be82bf8b8b",
"gitHead": "46bf85714342208cf612aee130f8876ce56ba46b",
"typesVersions": {
"<=3.5": {
"*": [
Expand Down
2 changes: 1 addition & 1 deletion addons/storysource/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,5 @@
"publishConfig": {
"access": "public"
},
"gitHead": "d31e743fc15970ad5722abf4678e03be82bf8b8b"
"gitHead": "46bf85714342208cf612aee130f8876ce56ba46b"
}
2 changes: 1 addition & 1 deletion addons/toolbars/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@
"publishConfig": {
"access": "public"
},
"gitHead": "d31e743fc15970ad5722abf4678e03be82bf8b8b"
"gitHead": "46bf85714342208cf612aee130f8876ce56ba46b"
}
2 changes: 1 addition & 1 deletion addons/viewport/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"publishConfig": {
"access": "public"
},
"gitHead": "d31e743fc15970ad5722abf4678e03be82bf8b8b",
"gitHead": "46bf85714342208cf612aee130f8876ce56ba46b",
"typesVersions": {
"<=3.5": {
"*": [
Expand Down
2 changes: 1 addition & 1 deletion app/angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"publishConfig": {
"access": "public"
},
"gitHead": "d31e743fc15970ad5722abf4678e03be82bf8b8b",
"gitHead": "46bf85714342208cf612aee130f8876ce56ba46b",
"typesVersions": {
"<=3.5": {
"*": [
Expand Down
2 changes: 1 addition & 1 deletion app/aurelia/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,5 @@
"publishConfig": {
"access": "public"
},
"gitHead": "d31e743fc15970ad5722abf4678e03be82bf8b8b"
"gitHead": "46bf85714342208cf612aee130f8876ce56ba46b"
}
2 changes: 1 addition & 1 deletion app/ember/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,5 @@
"publishConfig": {
"access": "public"
},
"gitHead": "d31e743fc15970ad5722abf4678e03be82bf8b8b"
"gitHead": "46bf85714342208cf612aee130f8876ce56ba46b"
}
2 changes: 1 addition & 1 deletion app/html/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"publishConfig": {
"access": "public"
},
"gitHead": "d31e743fc15970ad5722abf4678e03be82bf8b8b",
"gitHead": "46bf85714342208cf612aee130f8876ce56ba46b",
"typesVersions": {
"<=3.5": {
"*": [
Expand Down
2 changes: 1 addition & 1 deletion app/marionette/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,5 @@
"publishConfig": {
"access": "public"
},
"gitHead": "d31e743fc15970ad5722abf4678e03be82bf8b8b"
"gitHead": "46bf85714342208cf612aee130f8876ce56ba46b"
}
2 changes: 1 addition & 1 deletion app/marko/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,5 @@
"publishConfig": {
"access": "public"
},
"gitHead": "d31e743fc15970ad5722abf4678e03be82bf8b8b"
"gitHead": "46bf85714342208cf612aee130f8876ce56ba46b"
}
2 changes: 1 addition & 1 deletion app/mithril/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"publishConfig": {
"access": "public"
},
"gitHead": "d31e743fc15970ad5722abf4678e03be82bf8b8b",
"gitHead": "46bf85714342208cf612aee130f8876ce56ba46b",
"typesVersions": {
"<=3.5": {
"*": [
Expand Down
2 changes: 1 addition & 1 deletion app/preact/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"publishConfig": {
"access": "public"
},
"gitHead": "d31e743fc15970ad5722abf4678e03be82bf8b8b",
"gitHead": "46bf85714342208cf612aee130f8876ce56ba46b",
"typesVersions": {
"<=3.5": {
"*": [
Expand Down
2 changes: 1 addition & 1 deletion app/rax/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,5 @@
"publishConfig": {
"access": "public"
},
"gitHead": "d31e743fc15970ad5722abf4678e03be82bf8b8b"
"gitHead": "46bf85714342208cf612aee130f8876ce56ba46b"
}
2 changes: 1 addition & 1 deletion app/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"publishConfig": {
"access": "public"
},
"gitHead": "d31e743fc15970ad5722abf4678e03be82bf8b8b",
"gitHead": "46bf85714342208cf612aee130f8876ce56ba46b",
"typesVersions": {
"<=3.5": {
"*": [
Expand Down
2 changes: 1 addition & 1 deletion app/riot/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,5 @@
"publishConfig": {
"access": "public"
},
"gitHead": "d31e743fc15970ad5722abf4678e03be82bf8b8b"
"gitHead": "46bf85714342208cf612aee130f8876ce56ba46b"
}
2 changes: 1 addition & 1 deletion app/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,5 @@
"publishConfig": {
"access": "public"
},
"gitHead": "d31e743fc15970ad5722abf4678e03be82bf8b8b"
"gitHead": "46bf85714342208cf612aee130f8876ce56ba46b"
}
2 changes: 1 addition & 1 deletion app/svelte/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"publishConfig": {
"access": "public"
},
"gitHead": "d31e743fc15970ad5722abf4678e03be82bf8b8b",
"gitHead": "46bf85714342208cf612aee130f8876ce56ba46b",
"typesVersions": {
"<=3.5": {
"*": [
Expand Down
2 changes: 1 addition & 1 deletion app/vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"publishConfig": {
"access": "public"
},
"gitHead": "d31e743fc15970ad5722abf4678e03be82bf8b8b",
"gitHead": "46bf85714342208cf612aee130f8876ce56ba46b",
"typesVersions": {
"<=3.5": {
"*": [
Expand Down
2 changes: 1 addition & 1 deletion app/web-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"publishConfig": {
"access": "public"
},
"gitHead": "d31e743fc15970ad5722abf4678e03be82bf8b8b",
"gitHead": "46bf85714342208cf612aee130f8876ce56ba46b",
"typesVersions": {
"<=3.5": {
"*": [
Expand Down
2 changes: 1 addition & 1 deletion dev-kits/addon-decorator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"publishConfig": {
"access": "public"
},
"gitHead": "d31e743fc15970ad5722abf4678e03be82bf8b8b",
"gitHead": "46bf85714342208cf612aee130f8876ce56ba46b",
"typesVersions": {
"<=3.5": {
"*": [
Expand Down
2 changes: 1 addition & 1 deletion dev-kits/addon-parameter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"publishConfig": {
"access": "public"
},
"gitHead": "d31e743fc15970ad5722abf4678e03be82bf8b8b",
"gitHead": "46bf85714342208cf612aee130f8876ce56ba46b",
"typesVersions": {
"<=3.5": {
"*": [
Expand Down
2 changes: 1 addition & 1 deletion dev-kits/addon-preview-wrapper/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"publishConfig": {
"access": "public"
},
"gitHead": "d31e743fc15970ad5722abf4678e03be82bf8b8b",
"gitHead": "46bf85714342208cf612aee130f8876ce56ba46b",
"typesVersions": {
"<=3.5": {
"*": [
Expand Down
2 changes: 1 addition & 1 deletion dev-kits/addon-roundtrip/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"publishConfig": {
"access": "public"
},
"gitHead": "d31e743fc15970ad5722abf4678e03be82bf8b8b",
"gitHead": "46bf85714342208cf612aee130f8876ce56ba46b",
"typesVersions": {
"<=3.5": {
"*": [
Expand Down
33 changes: 31 additions & 2 deletions docs/api/writing-presets.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
title: 'Writing your own Storybook Preset'
---


[Storybook presets](./presets.md) are grouped collections of `babel`, `webpack`, and `addons` configurations that support specific use cases in Storybook, such as typescript or MDX support.

This doc covers the [presets API](#presets-api) and how to use the presets mechanism for [advanced configuration](#advanced-configuration).
Expand Down Expand Up @@ -95,6 +94,35 @@ This is equivalent to [registering the addon manually](../get-started/browse-sto

<!-- prettier-ignore-end -->

### Preview entries

The addon config `config` allows you to add extra preview configuration from within a preset, for example to add parameters or decorators from an addon.

For example, the Backgrounds preset contains the following code:

```js
// preset.js
export function config(entry = []) {
return [...entry, require.resolve('./defaultParameters')];
}
```

Which in turn invokes:

```js
// defaultParameters.js
export const parameters = {
backgrounds: {
values: [
{ name: 'light', value: '#F8F8F8' },
{ name: 'dark', value: '#333333' },
],
},
};
```

This is equivalent to exporting the `backgrounds` parameter manually in `main.js`.

### Addons

For users, the name `managerEntries` might be a bit too technical, so instead both users and preset-authors can simply use the property: `addons`:
Expand Down Expand Up @@ -175,4 +203,5 @@ and extract the configuration to a new file `./storybook/my-preset.js`:

<!-- prettier-ignore-end -->

Place your `my-preset.js` file wherever you want, if you want to share it far and wide you'll want to make it its own package.

Place your `my-preset.js` file wherever you want, if you want to share it far and wide you'll want to make it its own package.
Loading

0 comments on commit fe3b3e0

Please sign in to comment.