diff --git a/CHANGELOG.md b/CHANGELOG.md index f426803a086..21a4ebbf5fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,14 @@ +## 5.2.0-beta.1 (July 18, 2019) + +### Features + +* React native: Emit event when story is rendered ([#7449](https://github.com/storybookjs/storybook/pull/7449)) + +### Bug Fixes + +* Addon-knobs: improve types via generics and readonlyarray ([#7411](https://github.com/storybookjs/storybook/pull/7411)) +* Ondevice-backgrounds: use same param key as addon-backgrounds ([#7437](https://github.com/storybookjs/storybook/pull/7437)) + ## 5.2.0-beta.0 (July 15, 2019) ### Features @@ -31,6 +42,11 @@ * Addon-actions: Use v4 UUID instead of v1 for action IDs ([#7397](https://github.com/storybookjs/storybook/pull/7397)) * UI: Remove recompose ([#7385](https://github.com/storybookjs/storybook/pull/7385)) +* UI: FIX & IMPROVE styling interop of addon-background & addon-viewport ([#7385](https://github.com/storybookjs/storybook/pull/7385)) + +### Breaking Changes + +* Move grid toolbar feature to background-addon ([#7385](https://github.com/storybookjs/storybook/pull/7385)) ## 5.2.0-alpha.42 (July 12, 2019) diff --git a/MIGRATION.md b/MIGRATION.md index 9d1c4b5985e..e61987b01e9 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -64,6 +64,10 @@ ## From version 5.1.x to 5.2.x +### Grid toolbar-feature + +The grid feature in the toolbar has been relocated to [addon-background](https://github.com/storybookjs/storybook/tree/next/addons/backgrounds), follow the setup intructions on that addon to get the feature again. + ### Docs mode docgen This isn't a breaking change per se, because `addon-docs` is a new feature. However it's intended to replace `addon-info`, so if you're migrating from `addon-info` there are a few things you should know: diff --git a/addons/a11y/package.json b/addons/a11y/package.json index 4cb2db170d4..ba0b36a35f2 100644 --- a/addons/a11y/package.json +++ b/addons/a11y/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-a11y", - "version": "5.2.0-beta.0", + "version": "5.2.0-beta.1", "description": "a11y addon for storybook", "keywords": [ "a11y", @@ -26,12 +26,12 @@ "prepare": "node ../../scripts/prepare.js" }, "dependencies": { - "@storybook/addons": "5.2.0-beta.0", - "@storybook/api": "5.2.0-beta.0", - "@storybook/client-logger": "5.2.0-beta.0", - "@storybook/components": "5.2.0-beta.0", - "@storybook/core-events": "5.2.0-beta.0", - "@storybook/theming": "5.2.0-beta.0", + "@storybook/addons": "5.2.0-beta.1", + "@storybook/api": "5.2.0-beta.1", + "@storybook/client-logger": "5.2.0-beta.1", + "@storybook/components": "5.2.0-beta.1", + "@storybook/core-events": "5.2.0-beta.1", + "@storybook/theming": "5.2.0-beta.1", "axe-core": "^3.2.2", "common-tags": "^1.8.0", "core-js": "^3.0.1", diff --git a/addons/actions/package.json b/addons/actions/package.json index 7886e29d798..74797d21651 100644 --- a/addons/actions/package.json +++ b/addons/actions/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-actions", - "version": "5.2.0-beta.0", + "version": "5.2.0-beta.1", "description": "Action Logger addon for storybook", "keywords": [ "storybook" @@ -21,12 +21,12 @@ "prepare": "node ../../scripts/prepare.js" }, "dependencies": { - "@storybook/addons": "5.2.0-beta.0", - "@storybook/api": "5.2.0-beta.0", - "@storybook/client-api": "5.2.0-beta.0", - "@storybook/components": "5.2.0-beta.0", - "@storybook/core-events": "5.2.0-beta.0", - "@storybook/theming": "5.2.0-beta.0", + "@storybook/addons": "5.2.0-beta.1", + "@storybook/api": "5.2.0-beta.1", + "@storybook/client-api": "5.2.0-beta.1", + "@storybook/components": "5.2.0-beta.1", + "@storybook/core-events": "5.2.0-beta.1", + "@storybook/theming": "5.2.0-beta.1", "core-js": "^3.0.1", "fast-deep-equal": "^2.0.1", "global": "^4.3.2", diff --git a/addons/backgrounds/package.json b/addons/backgrounds/package.json index 572269f4035..c8de65edeb3 100644 --- a/addons/backgrounds/package.json +++ b/addons/backgrounds/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-backgrounds", - "version": "5.2.0-beta.0", + "version": "5.2.0-beta.1", "description": "A storybook addon to show different backgrounds for your preview", "keywords": [ "addon", @@ -25,12 +25,12 @@ "prepare": "node ../../scripts/prepare.js" }, "dependencies": { - "@storybook/addons": "5.2.0-beta.0", - "@storybook/api": "5.2.0-beta.0", - "@storybook/client-logger": "5.2.0-beta.0", - "@storybook/components": "5.2.0-beta.0", - "@storybook/core-events": "5.2.0-beta.0", - "@storybook/theming": "5.2.0-beta.0", + "@storybook/addons": "5.2.0-beta.1", + "@storybook/api": "5.2.0-beta.1", + "@storybook/client-logger": "5.2.0-beta.1", + "@storybook/components": "5.2.0-beta.1", + "@storybook/core-events": "5.2.0-beta.1", + "@storybook/theming": "5.2.0-beta.1", "core-js": "^3.0.1", "memoizerific": "^1.11.3", "react": "^16.8.3", diff --git a/addons/centered/package.json b/addons/centered/package.json index c4a186b9625..7ca2fc49d80 100644 --- a/addons/centered/package.json +++ b/addons/centered/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-centered", - "version": "5.2.0-beta.0", + "version": "5.2.0-beta.1", "description": "Storybook decorator to center components", "keywords": [ "addon", @@ -23,7 +23,7 @@ "prepare": "node ../../scripts/prepare.js" }, "dependencies": { - "@storybook/addons": "5.2.0-beta.0", + "@storybook/addons": "5.2.0-beta.1", "core-js": "^3.0.1", "global": "^4.3.2", "util-deprecate": "^1.0.2" diff --git a/addons/contexts/package.json b/addons/contexts/package.json index 866c70f9724..52270af6fbb 100644 --- a/addons/contexts/package.json +++ b/addons/contexts/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-contexts", - "version": "5.2.0-beta.0", + "version": "5.2.0-beta.1", "description": "Storybook Addon Contexts", "keywords": [ "storybook", @@ -28,10 +28,10 @@ "dev:check-types": "tsc --noEmit" }, "dependencies": { - "@storybook/addons": "5.2.0-beta.0", - "@storybook/api": "5.2.0-beta.0", - "@storybook/components": "5.2.0-beta.0", - "@storybook/core-events": "5.2.0-beta.0", + "@storybook/addons": "5.2.0-beta.1", + "@storybook/api": "5.2.0-beta.1", + "@storybook/components": "5.2.0-beta.1", + "@storybook/core-events": "5.2.0-beta.1", "core-js": "^3.0.1" }, "peerDependencies": { diff --git a/addons/cssresources/package.json b/addons/cssresources/package.json index f3ebdde9698..45d1a9b06dc 100644 --- a/addons/cssresources/package.json +++ b/addons/cssresources/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-cssresources", - "version": "5.2.0-beta.0", + "version": "5.2.0-beta.1", "description": "A storybook addon to switch between css resources at runtime for your story", "keywords": [ "addon", @@ -25,10 +25,10 @@ "prepare": "node ../../scripts/prepare.js" }, "dependencies": { - "@storybook/addons": "5.2.0-beta.0", - "@storybook/api": "5.2.0-beta.0", - "@storybook/components": "5.2.0-beta.0", - "@storybook/core-events": "5.2.0-beta.0", + "@storybook/addons": "5.2.0-beta.1", + "@storybook/api": "5.2.0-beta.1", + "@storybook/components": "5.2.0-beta.1", + "@storybook/core-events": "5.2.0-beta.1", "core-js": "^3.0.1", "global": "^4.3.2", "react": "^16.8.3" diff --git a/addons/design-assets/package.json b/addons/design-assets/package.json index 794671b14d3..df281c52960 100644 --- a/addons/design-assets/package.json +++ b/addons/design-assets/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-design-assets", - "version": "5.2.0-beta.0", + "version": "5.2.0-beta.1", "description": "Design asset preview for storybook", "keywords": [ "addon", @@ -27,12 +27,12 @@ "prepare": "node ../../scripts/prepare.js" }, "dependencies": { - "@storybook/addons": "5.2.0-beta.0", - "@storybook/api": "5.2.0-beta.0", - "@storybook/client-logger": "5.2.0-beta.0", - "@storybook/components": "5.2.0-beta.0", - "@storybook/core-events": "5.2.0-beta.0", - "@storybook/theming": "5.2.0-beta.0", + "@storybook/addons": "5.2.0-beta.1", + "@storybook/api": "5.2.0-beta.1", + "@storybook/client-logger": "5.2.0-beta.1", + "@storybook/components": "5.2.0-beta.1", + "@storybook/core-events": "5.2.0-beta.1", + "@storybook/theming": "5.2.0-beta.1", "common-tags": "^1.8.0", "core-js": "^3.0.1", "global": "^4.3.2", diff --git a/addons/docs/html/index.js b/addons/docs/html/index.js new file mode 100644 index 00000000000..38c1756201b --- /dev/null +++ b/addons/docs/html/index.js @@ -0,0 +1 @@ +module.exports = require('../common/index'); diff --git a/addons/docs/html/preset.js b/addons/docs/html/preset.js new file mode 100644 index 00000000000..a9b8af2cce0 --- /dev/null +++ b/addons/docs/html/preset.js @@ -0,0 +1 @@ +module.exports = require('../common/preset'); diff --git a/addons/docs/package.json b/addons/docs/package.json index 9d8a72a1c1e..27064b7560d 100644 --- a/addons/docs/package.json +++ b/addons/docs/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-docs", - "version": "5.2.0-beta.0", + "version": "5.2.0-beta.1", "description": "Superior documentation for your components", "keywords": [ "addon", @@ -28,11 +28,11 @@ "@mdx-js/loader": "^1.0.0", "@mdx-js/mdx": "^1.0.0", "@mdx-js/react": "^1.0.16", - "@storybook/addons": "5.2.0-beta.0", - "@storybook/api": "5.2.0-beta.0", - "@storybook/components": "5.2.0-beta.0", - "@storybook/router": "5.2.0-beta.0", - "@storybook/theming": "5.2.0-beta.0", + "@storybook/addons": "5.2.0-beta.1", + "@storybook/api": "5.2.0-beta.1", + "@storybook/components": "5.2.0-beta.1", + "@storybook/router": "5.2.0-beta.1", + "@storybook/theming": "5.2.0-beta.1", "core-js": "^3.0.1", "global": "^4.3.2", "lodash": "^4.17.11", diff --git a/addons/events/package.json b/addons/events/package.json index 08ff74eb8dd..26a86093a6e 100644 --- a/addons/events/package.json +++ b/addons/events/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-events", - "version": "5.2.0-beta.0", + "version": "5.2.0-beta.1", "description": "Add events to your Storybook stories.", "keywords": [ "addon", @@ -24,11 +24,11 @@ "prepare": "node ../../scripts/prepare.js" }, "dependencies": { - "@storybook/addons": "5.2.0-beta.0", - "@storybook/api": "5.2.0-beta.0", - "@storybook/client-api": "5.2.0-beta.0", - "@storybook/core-events": "5.2.0-beta.0", - "@storybook/theming": "5.2.0-beta.0", + "@storybook/addons": "5.2.0-beta.1", + "@storybook/api": "5.2.0-beta.1", + "@storybook/client-api": "5.2.0-beta.1", + "@storybook/core-events": "5.2.0-beta.1", + "@storybook/theming": "5.2.0-beta.1", "core-js": "^3.0.1", "format-json": "^1.0.3", "lodash": "^4.17.11", diff --git a/addons/google-analytics/package.json b/addons/google-analytics/package.json index dd67d9ff7c0..aca302e8043 100644 --- a/addons/google-analytics/package.json +++ b/addons/google-analytics/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-google-analytics", - "version": "5.2.0-beta.0", + "version": "5.2.0-beta.1", "description": "Storybook addon for google analytics", "keywords": [ "addon", @@ -20,8 +20,8 @@ "prepare": "node ../../scripts/prepare.js" }, "dependencies": { - "@storybook/addons": "5.2.0-beta.0", - "@storybook/core-events": "5.2.0-beta.0", + "@storybook/addons": "5.2.0-beta.1", + "@storybook/core-events": "5.2.0-beta.1", "core-js": "^3.0.1", "global": "^4.3.2", "react-ga": "^2.5.7" diff --git a/addons/graphql/package.json b/addons/graphql/package.json index a07d905384d..2de72ae7923 100644 --- a/addons/graphql/package.json +++ b/addons/graphql/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-graphql", - "version": "5.2.0-beta.0", + "version": "5.2.0-beta.1", "description": "Storybook addon to display the GraphiQL IDE", "keywords": [ "addon", @@ -22,8 +22,8 @@ "prepare": "node ../../scripts/prepare.js" }, "dependencies": { - "@storybook/addons": "5.2.0-beta.0", - "@storybook/api": "5.2.0-beta.0", + "@storybook/addons": "5.2.0-beta.1", + "@storybook/api": "5.2.0-beta.1", "core-js": "^3.0.1", "global": "^4.3.2", "graphiql": "^0.13.0", diff --git a/addons/info/package.json b/addons/info/package.json index cd44a2211a6..f9f953f531d 100644 --- a/addons/info/package.json +++ b/addons/info/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-info", - "version": "5.2.0-beta.0", + "version": "5.2.0-beta.1", "description": "A Storybook addon to show additional information for your stories.", "keywords": [ "addon", @@ -22,10 +22,10 @@ "prepare": "node ../../scripts/prepare.js" }, "dependencies": { - "@storybook/addons": "5.2.0-beta.0", - "@storybook/client-logger": "5.2.0-beta.0", - "@storybook/components": "5.2.0-beta.0", - "@storybook/theming": "5.2.0-beta.0", + "@storybook/addons": "5.2.0-beta.1", + "@storybook/client-logger": "5.2.0-beta.1", + "@storybook/components": "5.2.0-beta.1", + "@storybook/theming": "5.2.0-beta.1", "core-js": "^3.0.1", "global": "^4.3.2", "jsx-to-string": "^1.4.0", diff --git a/addons/jest/package.json b/addons/jest/package.json index eb71b3eb3ac..532c1f9423e 100644 --- a/addons/jest/package.json +++ b/addons/jest/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-jest", - "version": "5.2.0-beta.0", + "version": "5.2.0-beta.1", "description": "React storybook addon that show component jest report", "keywords": [ "addon", @@ -28,11 +28,11 @@ "prepare": "node ../../scripts/prepare.js" }, "dependencies": { - "@storybook/addons": "5.2.0-beta.0", - "@storybook/api": "5.2.0-beta.0", - "@storybook/components": "5.2.0-beta.0", - "@storybook/core-events": "5.2.0-beta.0", - "@storybook/theming": "5.2.0-beta.0", + "@storybook/addons": "5.2.0-beta.1", + "@storybook/api": "5.2.0-beta.1", + "@storybook/components": "5.2.0-beta.1", + "@storybook/core-events": "5.2.0-beta.1", + "@storybook/theming": "5.2.0-beta.1", "core-js": "^3.0.1", "global": "^4.3.2", "react": "^16.8.3", diff --git a/addons/knobs/package.json b/addons/knobs/package.json index 6f934a746ff..abbfe841848 100644 --- a/addons/knobs/package.json +++ b/addons/knobs/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-knobs", - "version": "5.2.0-beta.0", + "version": "5.2.0-beta.1", "description": "Storybook Addon Prop Editor Component", "keywords": [ "addon", @@ -22,11 +22,11 @@ "prepare": "node ../../scripts/prepare.js" }, "dependencies": { - "@storybook/addons": "5.2.0-beta.0", - "@storybook/client-api": "5.2.0-beta.0", - "@storybook/components": "5.2.0-beta.0", - "@storybook/core-events": "5.2.0-beta.0", - "@storybook/theming": "5.2.0-beta.0", + "@storybook/addons": "5.2.0-beta.1", + "@storybook/client-api": "5.2.0-beta.1", + "@storybook/components": "5.2.0-beta.1", + "@storybook/core-events": "5.2.0-beta.1", + "@storybook/theming": "5.2.0-beta.1", "copy-to-clipboard": "^3.0.8", "core-js": "^3.0.1", "escape-html": "^1.0.3", diff --git a/addons/knobs/src/KnobManager.ts b/addons/knobs/src/KnobManager.ts index fe875efd61e..e9c172de39b 100644 --- a/addons/knobs/src/KnobManager.ts +++ b/addons/knobs/src/KnobManager.ts @@ -7,7 +7,7 @@ import { getQueryParams } from '@storybook/client-api'; import { Channel } from '@storybook/channels'; import KnobStore, { KnobStoreKnob } from './KnobStore'; -import { Knob, KnobType } from './type-defs'; +import { Knob, KnobType, Mutable } from './type-defs'; import { SET } from './shared'; import { deserializers } from './converters'; @@ -72,7 +72,7 @@ export default class KnobManager { return this.options.escapeHTML ? escapeStrings(value) : value; } - knob(name: string, options: Knob): Knob['value'] { + knob(name: string, options: Knob): Mutable['value']> { this._mayCallChannel(); const knobName = options.groupId ? `${name}_${options.groupId}` : name; diff --git a/addons/knobs/src/__types__/knob-test-cases.ts b/addons/knobs/src/__types__/knob-test-cases.ts new file mode 100644 index 00000000000..1e1e2d8684d --- /dev/null +++ b/addons/knobs/src/__types__/knob-test-cases.ts @@ -0,0 +1,204 @@ +import { + number, + color, + files, + object, + boolean, + text, + select, + date, + array, + button, + knob, + radios, + optionsKnob as options, +} from '../index'; + +// Note: this is a helper to batch test return types and avoid "declared but never read" errors +function expectKnobOfType(..._: T[]) {} + +const groupId = 'GROUP-ID1'; + +/** Text knob */ + +expectKnobOfType( + text('text simple', 'Batman'), + text('text with group', 'default', groupId) +); + +/** Date knob */ + +expectKnobOfType( + date('date simple', new Date('January 20 1887')), + date('date with group', new Date(), groupId) +); + +/** Boolean knob */ + +expectKnobOfType( + boolean('boolean simple', false), + boolean('boolean with group', true, groupId) +); + +/** Color knob */ + +expectKnobOfType( + color('color simple', 'black'), + color('color with group', '#ffffff', groupId) +); + +/** Number knob */ + +expectKnobOfType( + number('number basic', 42), + number('number with options', 72, { range: true, min: 60, max: 90, step: 1 }), + number('number with group', 1, {}, groupId) +); + +/** Radios knob */ + +expectKnobOfType( + radios( + 'radio with string values', + { + 1100: '1100', + 2200: '2200', + 3300: '3300', + }, + '2200' + ), + radios('radio with number values', { 3: 3, 7: 7, 23: 23 }, 3), + radios( + 'radio with mixed value', + { + 1100: '1100', + 2200: 2200, + 3300: '3300', + }, + null, + groupId + ) +); + +/** Select knob */ + +enum SomeEnum { + Type1 = 1, + Type2, +} +enum ButtonVariant { + primary = 'primary', + secondary = 'secondary', +} +const stringLiteralArray: ('Apple' | 'Banana' | 'Grapes')[] = ['Apple', 'Banana', 'Grapes']; + +expectKnobOfType( + select( + 'select with string options', + { + None: 'none', + Underline: 'underline', + 'Line-through': 'line-through', + }, + 'none' + ), + select('select with string array', ['yes', 'no'], 'yes'), + select('select with string literal array', stringLiteralArray, stringLiteralArray[0]), + select('select with readonly array', ['red', 'blue'] as const, 'red'), + select('select with string enum options', ButtonVariant, ButtonVariant.primary), + select('select with null option', { a: 'Option', b: null }, null, groupId) +); + +expectKnobOfType( + select('select with number options', { 'type a': 1, 'type b': 2 }, 1), + select( + 'select with numeric enum options', + { 'type a': SomeEnum.Type1, 'type b': SomeEnum.Type2 }, + SomeEnum.Type2 + ), + select('select with number array', [1, 2, 3, 4], 1), + select('select with readonly number array', [1, 2] as const, 1) +); + +/** Object knob */ + +expectKnobOfType( + object('object simple', { + fontFamily: 'Arial', + padding: 20, + }), + object('object with group', {}, groupId) +); + +/** Options knob */ + +type Tool = 'hammer' | 'saw' | 'drill'; +const visibleToolOptions: Record = { + hammer: 'hammer', + saw: 'saw', + drill: 'drill', +}; + +expectKnobOfType( + options('options with single selection', visibleToolOptions, 'hammer', { + display: 'check', + }), + options('options with multi selection', visibleToolOptions, ['hammer', 'saw'], { + display: 'inline-check', + }), + options('options with readonly multi selection', visibleToolOptions, ['hammer'] as const, { + display: 'radio', + }), + options('options with group', {}, '', { display: 'check' }) +); + +/** Array knob */ + +const arrayReadonly = array('array as readonly', ['hi', 'there'] as const); + +expectKnobOfType( + array('array simple', ['red', 'green', 'blue']), + arrayReadonly, + array('array with group', [], ',', groupId) +); + +// Should return a mutable array despite the readonly input +arrayReadonly.push('Make sure that the output is still mutable although the input need not be!'); + +/** Button knob */ + +expectKnobOfType( + button('button simple', () => {}), + button('button with group', () => undefined, groupId) +); + +/** Files knob */ + +expectKnobOfType( + files('files simple', 'image/*', []), + files('files with group', 'image/*', ['img.jpg'], groupId) +); + +/** Generic knob */ + +expectKnobOfType( + knob('generic knob as text', { type: 'text', value: 'a' }), + knob('generic knob as color', { type: 'color', value: 'black' }), + knob<'select', string>('generic knob as string select', { + type: 'select', + value: 'yes', + options: ['yes', 'no'], + selectV2: true, + }) +); + +expectKnobOfType( + knob('generic knob as number', { type: 'number', value: 42 }), + knob('generic knob as select', { type: 'radios', value: 3, options: { 3: 3, 7: 7, 23: 23 } }), + knob('generic knob as number select', { + type: 'select', + value: 1, + options: [1, 2], + selectV2: true, + }) +); diff --git a/addons/knobs/src/components/types/Array.tsx b/addons/knobs/src/components/types/Array.tsx index d9f7ca82f55..7583f2d3eef 100644 --- a/addons/knobs/src/components/types/Array.tsx +++ b/addons/knobs/src/components/types/Array.tsx @@ -2,18 +2,16 @@ import PropTypes from 'prop-types'; import React, { ChangeEvent, Component, WeakValidationMap } from 'react'; import { Form } from '@storybook/components'; +import { KnobControlConfig, KnobControlProps } from './types'; -type ArrayTypeKnobValue = string[]; +export type ArrayTypeKnobValue = string[] | readonly string[]; -export interface ArrayTypeKnob { - name: string; - value: ArrayTypeKnobValue; +export interface ArrayTypeKnob extends KnobControlConfig { separator: string; } -interface ArrayTypeProps { +interface ArrayTypeProps extends KnobControlProps { knob: ArrayTypeKnob; - onChange: (value: ArrayTypeKnobValue) => ArrayTypeKnobValue; } function formatArray(value: string, separator: string) { @@ -41,7 +39,7 @@ export default class ArrayType extends Component { static serialize = (value: ArrayTypeKnobValue) => value; - static deserialize = (value: ArrayTypeKnobValue) => { + static deserialize = (value: string[]) => { if (Array.isArray(value)) return value; return Object.keys(value) diff --git a/addons/knobs/src/components/types/Boolean.tsx b/addons/knobs/src/components/types/Boolean.tsx index d9c1443d260..25d30dd6605 100644 --- a/addons/knobs/src/components/types/Boolean.tsx +++ b/addons/knobs/src/components/types/Boolean.tsx @@ -2,18 +2,14 @@ import PropTypes from 'prop-types'; import React, { FunctionComponent } from 'react'; import { styled } from '@storybook/theming'; +import { KnobControlConfig, KnobControlProps } from './types'; type BooleanTypeKnobValue = boolean; -export interface BooleanTypeKnob { - name: string; - value: BooleanTypeKnobValue; - separator: string; -} +export type BooleanTypeKnob = KnobControlConfig; -export interface BooleanTypeProps { +export interface BooleanTypeProps extends KnobControlProps { knob: BooleanTypeKnob; - onChange: (value: BooleanTypeKnobValue) => BooleanTypeKnobValue; } const Input = styled.input({ diff --git a/addons/knobs/src/components/types/Button.tsx b/addons/knobs/src/components/types/Button.tsx index 4dfe28b6639..79f3a311850 100644 --- a/addons/knobs/src/components/types/Button.tsx +++ b/addons/knobs/src/components/types/Button.tsx @@ -2,19 +2,17 @@ import PropTypes from 'prop-types'; import React, { FunctionComponent, Validator } from 'react'; import { Form } from '@storybook/components'; +import { KnobControlConfig, KnobControlProps } from './types'; -export interface ButtonTypeKnob { - name: string; - value: unknown; -} +export type ButtonTypeKnob = KnobControlConfig; -export type ButtonTypeOnClickProp = (knob: ButtonTypeKnob) => any; - -export interface ButtonTypeProps { +export interface ButtonTypeProps extends KnobControlProps { knob: ButtonTypeKnob; onClick: ButtonTypeOnClickProp; } +export type ButtonTypeOnClickProp = (knob: ButtonTypeKnob) => any; + const serialize = (): undefined => undefined; const deserialize = (): undefined => undefined; diff --git a/addons/knobs/src/components/types/Checkboxes.tsx b/addons/knobs/src/components/types/Checkboxes.tsx index 7b12cf53767..8f5ef3d21ac 100644 --- a/addons/knobs/src/components/types/Checkboxes.tsx +++ b/addons/knobs/src/components/types/Checkboxes.tsx @@ -1,32 +1,28 @@ import React, { Component, ChangeEvent, WeakValidationMap } from 'react'; import PropTypes from 'prop-types'; import { styled } from '@storybook/theming'; +import { KnobControlConfig, KnobControlProps } from './types'; type CheckboxesTypeKnobValue = string[]; -interface CheckboxesWrapperProps { - isInline: boolean; +export interface CheckboxesTypeKnob extends KnobControlConfig { + options: Record; } -export interface CheckboxesTypeKnob { - name: string; - value: CheckboxesTypeKnobValue; - defaultValue: CheckboxesTypeKnobValue; - options: { - [key: string]: string; - }; -} - -interface CheckboxesTypeProps { +interface CheckboxesTypeProps + extends KnobControlProps, + CheckboxesWrapperProps { knob: CheckboxesTypeKnob; - isInline: boolean; - onChange: (value: CheckboxesTypeKnobValue) => CheckboxesTypeKnobValue; } interface CheckboxesTypeState { values: CheckboxesTypeKnobValue; } +interface CheckboxesWrapperProps { + isInline: boolean; +} + const CheckboxesWrapper = styled.div(({ isInline }: CheckboxesWrapperProps) => isInline ? { diff --git a/addons/knobs/src/components/types/Color.tsx b/addons/knobs/src/components/types/Color.tsx index b6ae06cb3ba..80d3c418683 100644 --- a/addons/knobs/src/components/types/Color.tsx +++ b/addons/knobs/src/components/types/Color.tsx @@ -5,18 +5,11 @@ import { SketchPicker, ColorResult } from 'react-color'; import { styled } from '@storybook/theming'; import { Form } from '@storybook/components'; +import { KnobControlConfig, KnobControlProps } from './types'; type ColorTypeKnobValue = string; - -export interface ColorTypeKnob { - name: string; - value: ColorTypeKnobValue; -} - -interface ColorTypeProps { - knob: ColorTypeKnob; - onChange: (value: ColorTypeKnobValue) => ColorTypeKnobValue; -} +export type ColorTypeKnob = KnobControlConfig; +type ColorTypeProps = KnobControlProps; interface ColorTypeState { displayColorPicker: boolean; diff --git a/addons/knobs/src/components/types/Date.tsx b/addons/knobs/src/components/types/Date.tsx index e27b70eca10..59e3a0ac71e 100644 --- a/addons/knobs/src/components/types/Date.tsx +++ b/addons/knobs/src/components/types/Date.tsx @@ -2,18 +2,11 @@ import React, { Component, ChangeEvent, WeakValidationMap } from 'react'; import PropTypes from 'prop-types'; import { styled } from '@storybook/theming'; import { Form } from '@storybook/components'; +import { KnobControlConfig, KnobControlProps } from './types'; type DateTypeKnobValue = number; - -export interface DateTypeKnob { - name: string; - value: DateTypeKnobValue; -} - -interface DateTypeProps { - knob: DateTypeKnob; - onChange: (value: DateTypeKnobValue) => DateTypeKnobValue; -} +export type DateTypeKnob = KnobControlConfig; +type DateTypeProps = KnobControlProps; interface DateTypeState { valid: boolean | undefined; diff --git a/addons/knobs/src/components/types/Files.tsx b/addons/knobs/src/components/types/Files.tsx index 762bdd67d93..76668f1d186 100644 --- a/addons/knobs/src/components/types/Files.tsx +++ b/addons/knobs/src/components/types/Files.tsx @@ -4,18 +4,16 @@ import React, { ChangeEvent, FunctionComponent } from 'react'; import { styled } from '@storybook/theming'; import { Form } from '@storybook/components'; +import { KnobControlConfig, KnobControlProps } from './types'; type DateTypeKnobValue = string[]; -export interface FileTypeKnob { - name: string; +export interface FileTypeKnob extends KnobControlConfig { accept: string; - value: DateTypeKnobValue; } -export interface FilesTypeProps { +export interface FilesTypeProps extends KnobControlProps { knob: FileTypeKnob; - onChange: (value: DateTypeKnobValue) => DateTypeKnobValue; } const FileInput = styled(Form.Input)({ diff --git a/addons/knobs/src/components/types/Number.tsx b/addons/knobs/src/components/types/Number.tsx index 686abd9948e..1f7e47e8463 100644 --- a/addons/knobs/src/components/types/Number.tsx +++ b/addons/knobs/src/components/types/Number.tsx @@ -3,6 +3,7 @@ import React, { Component, ChangeEvent } from 'react'; import { styled } from '@storybook/theming'; import { Form } from '@storybook/components'; +import { KnobControlConfig, KnobControlProps } from './types'; type NumberTypeKnobValue = number; @@ -13,14 +14,14 @@ export interface NumberTypeKnobOptions { step?: number; } -export interface NumberTypeKnob extends NumberTypeKnobOptions { - name: string; - value: number; +export interface NumberTypeKnob + extends KnobControlConfig, + NumberTypeKnobOptions { + value: NumberTypeKnobValue; } -interface NumberTypeProps { +interface NumberTypeProps extends KnobControlProps { knob: NumberTypeKnob; - onChange: (value: NumberTypeKnobValue) => NumberTypeKnobValue; } const RangeInput = styled.input( diff --git a/addons/knobs/src/components/types/Object.tsx b/addons/knobs/src/components/types/Object.tsx index 3000e24cabe..3bac4dc597c 100644 --- a/addons/knobs/src/components/types/Object.tsx +++ b/addons/knobs/src/components/types/Object.tsx @@ -3,16 +3,10 @@ import PropTypes from 'prop-types'; import deepEqual from 'fast-deep-equal'; import { polyfill } from 'react-lifecycles-compat'; import { Form } from '@storybook/components'; +import { KnobControlConfig, KnobControlProps } from './types'; -export interface ObjectTypeKnob { - name: string; - value: T; -} - -interface ObjectTypeProps { - knob: ObjectTypeKnob; - onChange: (value: T) => T; -} +export type ObjectTypeKnob = KnobControlConfig; +type ObjectTypeProps = KnobControlProps; interface ObjectTypeState { value: string; diff --git a/addons/knobs/src/components/types/Options.tsx b/addons/knobs/src/components/types/Options.tsx index 62a972d1a41..c5d5bcb98cf 100644 --- a/addons/knobs/src/components/types/Options.tsx +++ b/addons/knobs/src/components/types/Options.tsx @@ -3,12 +3,19 @@ import PropTypes from 'prop-types'; import ReactSelect from 'react-select'; import { ValueType } from 'react-select/lib/types'; import { styled } from '@storybook/theming'; +import { KnobControlConfig, KnobControlProps } from './types'; import RadiosType from './Radio'; import CheckboxesType from './Checkboxes'; // TODO: Apply the Storybook theme to react-select +export type OptionsTypeKnobSingleValue = string | number | null | undefined; + +export type OptionsTypeKnobValue< + T extends OptionsTypeKnobSingleValue = OptionsTypeKnobSingleValue +> = T | NonNullable[] | readonly NonNullable[]; + export type OptionsKnobOptionsDisplay = | 'radio' | 'inline-radio' @@ -21,10 +28,7 @@ export interface OptionsKnobOptions { display?: OptionsKnobOptionsDisplay; } -export interface OptionsTypeKnob { - name: string; - value: T; - defaultValue: T; +export interface OptionsTypeKnob extends KnobControlConfig { options: OptionsTypeOptionsProp; optionsObj: OptionsKnobOptions; } @@ -33,10 +37,9 @@ export interface OptionsTypeOptionsProp { [key: string]: T; } -export interface OptionsTypeProps { +export interface OptionsTypeProps extends KnobControlProps { knob: OptionsTypeKnob; display: OptionsKnobOptionsDisplay; - onChange: (value: T) => T; } // : React.ComponentType diff --git a/addons/knobs/src/components/types/Radio.tsx b/addons/knobs/src/components/types/Radio.tsx index 9cd910f6795..375ce20a629 100644 --- a/addons/knobs/src/components/types/Radio.tsx +++ b/addons/knobs/src/components/types/Radio.tsx @@ -1,24 +1,18 @@ import React, { Component, WeakValidationMap } from 'react'; import PropTypes from 'prop-types'; import { styled } from '@storybook/theming'; +import { KnobControlConfig, KnobControlProps } from './types'; -type RadiosTypeKnobValue = string; +export type RadiosTypeKnobValue = string | number | null | undefined; -export interface RadiosTypeKnob { - name: string; - value: RadiosTypeKnobValue; - defaultValue: RadiosTypeKnobValue; - options: RadiosTypeOptionsProp; +export type RadiosTypeOptionsProp = Record; + +export interface RadiosTypeKnob extends KnobControlConfig { + options: RadiosTypeOptionsProp; } -export interface RadiosTypeOptionsProp { - [key: string]: RadiosTypeKnobValue; -} - -interface RadiosTypeProps { +interface RadiosTypeProps extends KnobControlProps, RadiosWrapperProps { knob: RadiosTypeKnob; - isInline: boolean; - onChange: (value: RadiosTypeKnobValue) => RadiosTypeKnobValue; } interface RadiosWrapperProps { diff --git a/addons/knobs/src/components/types/Select.tsx b/addons/knobs/src/components/types/Select.tsx index ab338edc7a9..18154ab6843 100644 --- a/addons/knobs/src/components/types/Select.tsx +++ b/addons/knobs/src/components/types/Select.tsx @@ -2,22 +2,24 @@ import React, { FunctionComponent, ChangeEvent } from 'react'; import PropTypes from 'prop-types'; import { Form } from '@storybook/components'; +import { KnobControlConfig, KnobControlProps } from './types'; export type SelectTypeKnobValue = string | number | null | undefined; -export interface SelectTypeKnob { - name: string; - value: SelectTypeKnobValue; - options: SelectTypeOptionsProp; +export type SelectTypeOptionsProp = + | Record + | Record + | T[] + | readonly T[]; + +export interface SelectTypeKnob + extends KnobControlConfig { + options: SelectTypeOptionsProp; } -export type SelectTypeOptionsProp = - | Record - | NonNullable[]; - -export interface SelectTypeProps { - knob: SelectTypeKnob; - onChange: (value: SelectTypeKnobValue) => SelectTypeKnobValue; +export interface SelectTypeProps + extends KnobControlProps { + knob: SelectTypeKnob; } const serialize = (value: SelectTypeKnobValue) => value; @@ -29,8 +31,11 @@ const SelectType: FunctionComponent & { } = ({ knob, onChange }) => { const { options } = knob; const entries = Array.isArray(options) - ? options.reduce((acc, k) => Object.assign(acc, { [k]: k }), {}) - : options; + ? options.reduce>( + (acc, k) => Object.assign(acc, { [k]: k }), + {} + ) + : (options as Record); const selectedKey = Object.keys(entries).find(k => entries[k] === knob.value); diff --git a/addons/knobs/src/components/types/Text.tsx b/addons/knobs/src/components/types/Text.tsx index cf939ffa3f1..cc4c74ec6a9 100644 --- a/addons/knobs/src/components/types/Text.tsx +++ b/addons/knobs/src/components/types/Text.tsx @@ -2,18 +2,11 @@ import PropTypes from 'prop-types'; import React, { Component, ChangeEvent, WeakValidationMap } from 'react'; import { Form } from '@storybook/components'; +import { KnobControlConfig, KnobControlProps } from './types'; type TextTypeKnobValue = string; - -export interface TextTypeKnob { - name: string; - value: TextTypeKnobValue; -} - -interface TextTypeProps { - knob: TextTypeKnob; - onChange: (value: TextTypeKnobValue) => TextTypeKnobValue; -} +export type TextTypeKnob = KnobControlConfig; +type TextTypeProps = KnobControlProps; export default class TextType extends Component { static defaultProps: TextTypeProps = { diff --git a/addons/knobs/src/components/types/index.ts b/addons/knobs/src/components/types/index.ts index 1a25315f8d0..9340dee5699 100644 --- a/addons/knobs/src/components/types/index.ts +++ b/addons/knobs/src/components/types/index.ts @@ -45,9 +45,15 @@ export { ColorTypeKnob } from './Color'; export { BooleanTypeKnob } from './Boolean'; export { ObjectTypeKnob } from './Object'; export { SelectTypeKnob, SelectTypeOptionsProp, SelectTypeKnobValue } from './Select'; -export { RadiosTypeKnob, RadiosTypeOptionsProp } from './Radio'; -export { ArrayTypeKnob } from './Array'; +export { RadiosTypeKnob, RadiosTypeOptionsProp, RadiosTypeKnobValue } from './Radio'; +export { ArrayTypeKnob, ArrayTypeKnobValue } from './Array'; export { DateTypeKnob } from './Date'; export { ButtonTypeKnob, ButtonTypeOnClickProp } from './Button'; export { FileTypeKnob } from './Files'; -export { OptionsTypeKnob, OptionsTypeOptionsProp, OptionsKnobOptions } from './Options'; +export { + OptionsTypeKnob, + OptionsKnobOptions, + OptionsTypeOptionsProp, + OptionsTypeKnobSingleValue, + OptionsTypeKnobValue, +} from './Options'; diff --git a/addons/knobs/src/components/types/types.ts b/addons/knobs/src/components/types/types.ts new file mode 100644 index 00000000000..91e1f36e27e --- /dev/null +++ b/addons/knobs/src/components/types/types.ts @@ -0,0 +1,10 @@ +export interface KnobControlConfig { + name: string; + value: T; + defaultValue?: T; +} + +export interface KnobControlProps { + knob: KnobControlConfig; + onChange: (value: T) => T; +} diff --git a/addons/knobs/src/index.ts b/addons/knobs/src/index.ts index c7a060c5785..f240cf34092 100644 --- a/addons/knobs/src/index.ts +++ b/addons/knobs/src/index.ts @@ -2,19 +2,26 @@ import addons, { makeDecorator } from '@storybook/addons'; import { SET_OPTIONS } from './shared'; import { manager, registerKnobs } from './registerKnobs'; -import { Knob, KnobType } from './type-defs'; +import { Knob, KnobType, Mutable } from './type-defs'; import { NumberTypeKnobOptions, ButtonTypeOnClickProp, RadiosTypeOptionsProp, SelectTypeOptionsProp, SelectTypeKnobValue, + OptionsTypeKnobValue, OptionsTypeOptionsProp, + OptionsTypeKnobSingleValue, OptionsKnobOptions, + RadiosTypeKnobValue, + ArrayTypeKnobValue, } from './components/types'; -export function knob(name: string, options: Knob) { - return manager.knob(name, options); +export function knob['value']>>( + name: string, + options: Knob +): V { + return manager.knob(name, options) as V; } export function text(name: string, value: string, groupId?: string) { @@ -62,25 +69,31 @@ export function object(name: string, value: T, groupId?: string): T { return manager.knob(name, { type: 'object', value, groupId }); } -export function select( +export function select( name: string, - options: SelectTypeOptionsProp, - value: SelectTypeKnobValue, + options: SelectTypeOptionsProp, + value: T, groupId?: string -) { - return manager.knob(name, { type: 'select', selectV2: true, options, value, groupId }); +): T { + return manager.knob(name, { + type: 'select', + selectV2: true, + options: options as SelectTypeOptionsProp, + value, + groupId, + }) as T; } -export function radios( +export function radios( name: string, - options: RadiosTypeOptionsProp, - value: string, + options: RadiosTypeOptionsProp, + value: T, groupId?: string -) { - return manager.knob(name, { type: 'radios', options, value, groupId }); +): T { + return manager.knob(name, { type: 'radios', options, value, groupId }) as T; } -export function array(name: string, value: string[], separator = ',', groupId?: string) { +export function array(name: string, value: ArrayTypeKnobValue, separator = ',', groupId?: string) { return manager.knob(name, { type: 'array', value, separator, groupId }); } @@ -97,10 +110,10 @@ export function files(name: string, accept: string, value: string[] = [], groupI return manager.knob(name, { type: 'files', accept, value, groupId }); } -export function optionsKnob( +export function optionsKnob( name: string, valuesObj: OptionsTypeOptionsProp, - value: T, + value: OptionsTypeKnobValue, optionsObj: OptionsKnobOptions, groupId?: string ): T { diff --git a/addons/knobs/src/type-defs.ts b/addons/knobs/src/type-defs.ts index 51c76c6c2b3..ddc8c2de34e 100644 --- a/addons/knobs/src/type-defs.ts +++ b/addons/knobs/src/type-defs.ts @@ -14,6 +14,10 @@ import { KnobType, } from './components/types'; +export type Mutable = { + -readonly [P in keyof T]: T[P] extends readonly (infer U)[] ? U[] : T[P]; +}; + type KnobPlus = K & { type: T; groupId?: string }; export type Knob = T extends 'text' diff --git a/addons/links/package.json b/addons/links/package.json index 64da8aba35a..5b417b58a39 100644 --- a/addons/links/package.json +++ b/addons/links/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-links", - "version": "5.2.0-beta.0", + "version": "5.2.0-beta.1", "description": "Story Links addon for storybook", "keywords": [ "addon", @@ -22,9 +22,9 @@ "prepare": "node ../../scripts/prepare.js" }, "dependencies": { - "@storybook/addons": "5.2.0-beta.0", - "@storybook/core-events": "5.2.0-beta.0", - "@storybook/router": "5.2.0-beta.0", + "@storybook/addons": "5.2.0-beta.1", + "@storybook/core-events": "5.2.0-beta.1", + "@storybook/router": "5.2.0-beta.1", "common-tags": "^1.8.0", "core-js": "^3.0.1", "global": "^4.3.2", diff --git a/addons/notes/package.json b/addons/notes/package.json index e77e5e0b66a..fb987b61834 100644 --- a/addons/notes/package.json +++ b/addons/notes/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-notes", - "version": "5.2.0-beta.0", + "version": "5.2.0-beta.1", "description": "Write notes for your Storybook stories.", "keywords": [ "addon", @@ -23,13 +23,13 @@ "prepare": "node ../../scripts/prepare.js" }, "dependencies": { - "@storybook/addons": "5.2.0-beta.0", - "@storybook/api": "5.2.0-beta.0", - "@storybook/client-logger": "5.2.0-beta.0", - "@storybook/components": "5.2.0-beta.0", - "@storybook/core-events": "5.2.0-beta.0", - "@storybook/router": "5.2.0-beta.0", - "@storybook/theming": "5.2.0-beta.0", + "@storybook/addons": "5.2.0-beta.1", + "@storybook/api": "5.2.0-beta.1", + "@storybook/client-logger": "5.2.0-beta.1", + "@storybook/components": "5.2.0-beta.1", + "@storybook/core-events": "5.2.0-beta.1", + "@storybook/router": "5.2.0-beta.1", + "@storybook/theming": "5.2.0-beta.1", "core-js": "^3.0.1", "global": "^4.3.2", "markdown-to-jsx": "^6.9.3", diff --git a/addons/ondevice-actions/package.json b/addons/ondevice-actions/package.json index e78cd80a8cf..42d89c66c40 100644 --- a/addons/ondevice-actions/package.json +++ b/addons/ondevice-actions/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-ondevice-actions", - "version": "5.2.0-beta.0", + "version": "5.2.0-beta.1", "description": "Action Logger addon for react-native storybook", "keywords": [ "storybook" @@ -19,13 +19,13 @@ "prepare": "node ../../scripts/prepare.js" }, "dependencies": { - "@storybook/addons": "5.2.0-beta.0", - "@storybook/core-events": "5.2.0-beta.0", + "@storybook/addons": "5.2.0-beta.1", + "@storybook/core-events": "5.2.0-beta.1", "core-js": "^2.5.7", "fast-deep-equal": "^2.0.1" }, "devDependencies": { - "@storybook/addon-actions": "5.2.0-beta.0" + "@storybook/addon-actions": "5.2.0-beta.1" }, "peerDependencies": { "@storybook/addon-actions": "*", diff --git a/addons/ondevice-backgrounds/package.json b/addons/ondevice-backgrounds/package.json index 9ebf1aec2ab..9a7174f988d 100644 --- a/addons/ondevice-backgrounds/package.json +++ b/addons/ondevice-backgrounds/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-ondevice-backgrounds", - "version": "5.2.0-beta.0", + "version": "5.2.0-beta.1", "description": "A react-native storybook addon to show different backgrounds for your preview", "keywords": [ "addon", @@ -24,7 +24,7 @@ "prepare": "node ../../scripts/prepare.js" }, "dependencies": { - "@storybook/addons": "5.2.0-beta.0", + "@storybook/addons": "5.2.0-beta.1", "core-js": "^3.0.1", "prop-types": "^15.7.2" }, diff --git a/addons/ondevice-backgrounds/src/BackgroundPanel.js b/addons/ondevice-backgrounds/src/BackgroundPanel.js index 30800f7ca8e..379f8947028 100644 --- a/addons/ondevice-backgrounds/src/BackgroundPanel.js +++ b/addons/ondevice-backgrounds/src/BackgroundPanel.js @@ -56,7 +56,7 @@ export default class BackgroundPanel extends Component { render() { const { active, api } = this.props; - if (!active) { + if (!active || !this.state) { return null; } diff --git a/addons/ondevice-backgrounds/src/constants.js b/addons/ondevice-backgrounds/src/constants.js index 8e876dace84..d28430f5e05 100644 --- a/addons/ondevice-backgrounds/src/constants.js +++ b/addons/ondevice-backgrounds/src/constants.js @@ -1,4 +1,4 @@ -export const PARAM_KEY = 'background'; +export const PARAM_KEY = 'backgrounds'; export const ADDON_ID = 'storybook-addon-background'; export const PANEL_ID = `${ADDON_ID}/background-panel`; diff --git a/addons/ondevice-knobs/package.json b/addons/ondevice-knobs/package.json index a6e266e2fbf..15719a1ff95 100644 --- a/addons/ondevice-knobs/package.json +++ b/addons/ondevice-knobs/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-ondevice-knobs", - "version": "5.2.0-beta.0", + "version": "5.2.0-beta.1", "description": "Display storybook story knobs on your deviced.", "keywords": [ "addon", @@ -21,8 +21,8 @@ "prepare": "node ../../scripts/prepare.js" }, "dependencies": { - "@storybook/addons": "5.2.0-beta.0", - "@storybook/core-events": "5.2.0-beta.0", + "@storybook/addons": "5.2.0-beta.1", + "@storybook/core-events": "5.2.0-beta.1", "core-js": "^3.0.1", "deep-equal": "^1.0.1", "prop-types": "^15.7.2", diff --git a/addons/ondevice-notes/package.json b/addons/ondevice-notes/package.json index de8fe2f9dc9..1f2162ce908 100644 --- a/addons/ondevice-notes/package.json +++ b/addons/ondevice-notes/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-ondevice-notes", - "version": "5.2.0-beta.0", + "version": "5.2.0-beta.1", "description": "Write notes for your react-native Storybook stories.", "keywords": [ "addon", @@ -20,8 +20,8 @@ "prepare": "node ../../scripts/prepare.js" }, "dependencies": { - "@storybook/addons": "5.2.0-beta.0", - "@storybook/client-logger": "5.2.0-beta.0", + "@storybook/addons": "5.2.0-beta.1", + "@storybook/client-logger": "5.2.0-beta.1", "core-js": "^3.0.1", "prop-types": "^15.7.2", "react-native-simple-markdown": "^1.1.0" diff --git a/addons/options/package.json b/addons/options/package.json index afcd44c44cd..50510f3c76b 100644 --- a/addons/options/package.json +++ b/addons/options/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-options", - "version": "5.2.0-beta.0", + "version": "5.2.0-beta.1", "description": "Options addon for storybook", "keywords": [ "addon", @@ -22,7 +22,7 @@ "prepare": "node ../../scripts/prepare.js" }, "dependencies": { - "@storybook/addons": "5.2.0-beta.0", + "@storybook/addons": "5.2.0-beta.1", "core-js": "^3.0.1", "util-deprecate": "^1.0.2" }, diff --git a/addons/queryparams/package.json b/addons/queryparams/package.json index b130853d755..324eb3ceed3 100644 --- a/addons/queryparams/package.json +++ b/addons/queryparams/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-queryparams", - "version": "5.2.0-beta.0", + "version": "5.2.0-beta.1", "description": "parameter addon for storybook", "keywords": [ "addon", @@ -23,12 +23,12 @@ "prepare": "node ../../scripts/prepare.js" }, "dependencies": { - "@storybook/addons": "5.2.0-beta.0", - "@storybook/api": "5.2.0-beta.0", - "@storybook/client-logger": "5.2.0-beta.0", - "@storybook/components": "5.2.0-beta.0", - "@storybook/core-events": "5.2.0-beta.0", - "@storybook/theming": "5.2.0-beta.0", + "@storybook/addons": "5.2.0-beta.1", + "@storybook/api": "5.2.0-beta.1", + "@storybook/client-logger": "5.2.0-beta.1", + "@storybook/components": "5.2.0-beta.1", + "@storybook/core-events": "5.2.0-beta.1", + "@storybook/theming": "5.2.0-beta.1", "common-tags": "^1.8.0", "core-js": "^3.0.1", "global": "^4.3.2", diff --git a/addons/storyshots/storyshots-core/package.json b/addons/storyshots/storyshots-core/package.json index 7b5dad91979..3bff8fd32f2 100644 --- a/addons/storyshots/storyshots-core/package.json +++ b/addons/storyshots/storyshots-core/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-storyshots", - "version": "5.2.0-beta.0", + "version": "5.2.0-beta.1", "description": "StoryShots is a Jest Snapshot Testing Addon for Storybook.", "keywords": [ "addon", @@ -25,7 +25,7 @@ "storybook": "start-storybook -p 6006" }, "dependencies": { - "@storybook/addons": "5.2.0-beta.0", + "@storybook/addons": "5.2.0-beta.1", "core-js": "^3.0.1", "glob": "^7.1.3", "global": "^4.3.2", diff --git a/addons/storyshots/storyshots-core/src/frameworks/frameworkLoader.js b/addons/storyshots/storyshots-core/src/frameworks/frameworkLoader.js index 137cc61e282..c9af2d0cb67 100644 --- a/addons/storyshots/storyshots-core/src/frameworks/frameworkLoader.js +++ b/addons/storyshots/storyshots-core/src/frameworks/frameworkLoader.js @@ -23,7 +23,7 @@ function loadFramework(options) { if (!loader) { throw new Error( - "Couldn't find an appropriate framework loader -- do you need to set the `frameowrk` option?" + "Couldn't find an appropriate framework loader -- do you need to set the `framework` option?" ); } diff --git a/addons/storyshots/storyshots-puppeteer/package.json b/addons/storyshots/storyshots-puppeteer/package.json index 1c1fdfcefd7..d03b69b7ea3 100644 --- a/addons/storyshots/storyshots-puppeteer/package.json +++ b/addons/storyshots/storyshots-puppeteer/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-storyshots-puppeteer", - "version": "5.2.0-beta.0", + "version": "5.2.0-beta.1", "description": "Image snappshots addition to StoryShots base on puppeteer", "keywords": [ "addon", @@ -22,8 +22,8 @@ "prepare": "node ../../../scripts/prepare.js" }, "dependencies": { - "@storybook/node-logger": "5.2.0-beta.0", - "@storybook/router": "5.2.0-beta.0", + "@storybook/node-logger": "5.2.0-beta.1", + "@storybook/router": "5.2.0-beta.1", "core-js": "^3.0.1", "jest-image-snapshot": "^2.8.2", "regenerator-runtime": "^0.12.1" diff --git a/addons/storysource/package.json b/addons/storysource/package.json index b52ec90b7e1..0c184fb8cda 100644 --- a/addons/storysource/package.json +++ b/addons/storysource/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-storysource", - "version": "5.2.0-beta.0", + "version": "5.2.0-beta.1", "description": "Stories addon for storybook", "keywords": [ "addon", @@ -22,10 +22,10 @@ "prepare": "node ../../scripts/prepare.js" }, "dependencies": { - "@storybook/addons": "5.2.0-beta.0", - "@storybook/components": "5.2.0-beta.0", - "@storybook/router": "5.2.0-beta.0", - "@storybook/theming": "5.2.0-beta.0", + "@storybook/addons": "5.2.0-beta.1", + "@storybook/components": "5.2.0-beta.1", + "@storybook/router": "5.2.0-beta.1", + "@storybook/theming": "5.2.0-beta.1", "core-js": "^3.0.1", "estraverse": "^4.2.0", "loader-utils": "^1.2.3", diff --git a/addons/viewport/package.json b/addons/viewport/package.json index 12efeea45fb..203c0797fde 100644 --- a/addons/viewport/package.json +++ b/addons/viewport/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-viewport", - "version": "5.2.0-beta.0", + "version": "5.2.0-beta.1", "description": "Storybook addon to change the viewport size to mobile", "keywords": [ "addon", @@ -21,12 +21,12 @@ "prepare": "node ../../scripts/prepare.js" }, "dependencies": { - "@storybook/addons": "5.2.0-beta.0", - "@storybook/api": "5.2.0-beta.0", - "@storybook/client-logger": "5.2.0-beta.0", - "@storybook/components": "5.2.0-beta.0", - "@storybook/core-events": "5.2.0-beta.0", - "@storybook/theming": "5.2.0-beta.0", + "@storybook/addons": "5.2.0-beta.1", + "@storybook/api": "5.2.0-beta.1", + "@storybook/client-logger": "5.2.0-beta.1", + "@storybook/components": "5.2.0-beta.1", + "@storybook/core-events": "5.2.0-beta.1", + "@storybook/theming": "5.2.0-beta.1", "core-js": "^3.0.1", "global": "^4.3.2", "memoizerific": "^1.11.3", diff --git a/app/angular/package.json b/app/angular/package.json index fb0192ed3d4..cd5051651d7 100644 --- a/app/angular/package.json +++ b/app/angular/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/angular", - "version": "5.2.0-beta.0", + "version": "5.2.0-beta.1", "description": "Storybook for Angular: Develop Angular Components in isolation with Hot Reloading.", "keywords": [ "storybook" @@ -26,9 +26,9 @@ "prepare": "node ../../scripts/prepare.js" }, "dependencies": { - "@storybook/addons": "5.2.0-beta.0", - "@storybook/core": "5.2.0-beta.0", - "@storybook/node-logger": "5.2.0-beta.0", + "@storybook/addons": "5.2.0-beta.1", + "@storybook/core": "5.2.0-beta.1", + "@storybook/node-logger": "5.2.0-beta.1", "angular2-template-loader": "^0.6.2", "core-js": "^3.0.1", "fork-ts-checker-webpack-plugin": "^1.3.4", diff --git a/app/ember/package.json b/app/ember/package.json index 98d4726dc30..f65f30316f3 100644 --- a/app/ember/package.json +++ b/app/ember/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/ember", - "version": "5.2.0-beta.0", + "version": "5.2.0-beta.1", "description": "Storybook for Ember: Develop Ember Component in isolation with Hot Reloading.", "homepage": "https://github.com/storybookjs/storybook/tree/master/app/ember", "bugs": { @@ -24,7 +24,7 @@ }, "dependencies": { "@ember/test-helpers": "^1.5.0", - "@storybook/core": "5.2.0-beta.0", + "@storybook/core": "5.2.0-beta.1", "common-tags": "^1.8.0", "core-js": "^3.0.1", "global": "^4.3.2", diff --git a/app/html/package.json b/app/html/package.json index e5f37d66565..5d30420f047 100644 --- a/app/html/package.json +++ b/app/html/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/html", - "version": "5.2.0-beta.0", + "version": "5.2.0-beta.1", "description": "Storybook for HTML: View HTML snippets in isolation with Hot Reloading.", "keywords": [ "storybook" @@ -26,8 +26,8 @@ "prepare": "node ../../scripts/prepare.js" }, "dependencies": { - "@storybook/addons": "5.2.0-beta.0", - "@storybook/core": "5.2.0-beta.0", + "@storybook/addons": "5.2.0-beta.1", + "@storybook/core": "5.2.0-beta.1", "common-tags": "^1.8.0", "core-js": "^3.0.1", "global": "^4.3.2", diff --git a/app/marko/package.json b/app/marko/package.json index 47ca38c4732..0e352be1ca5 100644 --- a/app/marko/package.json +++ b/app/marko/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/marko", - "version": "5.2.0-beta.0", + "version": "5.2.0-beta.1", "description": "Storybook for Marko: Develop Marko Component in isolation with Hot Reloading.", "keywords": [ "storybook" @@ -26,7 +26,7 @@ "prepare": "node ../../scripts/prepare.js" }, "dependencies": { - "@storybook/core": "5.2.0-beta.0", + "@storybook/core": "5.2.0-beta.1", "common-tags": "^1.8.0", "core-js": "^3.0.1", "global": "^4.3.2", diff --git a/app/mithril/package.json b/app/mithril/package.json index d759550449d..d9160029d67 100644 --- a/app/mithril/package.json +++ b/app/mithril/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/mithril", - "version": "5.2.0-beta.0", + "version": "5.2.0-beta.1", "description": "Storybook for Mithril: Develop Mithril Component in isolation.", "keywords": [ "storybook" @@ -27,7 +27,7 @@ }, "dependencies": { "@babel/plugin-transform-react-jsx": "^7.3.0", - "@storybook/core": "5.2.0-beta.0", + "@storybook/core": "5.2.0-beta.1", "common-tags": "^1.8.0", "core-js": "^3.0.1", "global": "^4.3.2", diff --git a/app/polymer/package.json b/app/polymer/package.json index accdc093f34..41e3d0bcdd4 100644 --- a/app/polymer/package.json +++ b/app/polymer/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/polymer", - "version": "5.2.0-beta.0", + "version": "5.2.0-beta.1", "description": "Storybook for Polymer: Develop Polymer components in isolation with Hot Reloading.", "keywords": [ "storybook" @@ -25,7 +25,7 @@ "prepare": "node ../../scripts/prepare.js" }, "dependencies": { - "@storybook/core": "5.2.0-beta.0", + "@storybook/core": "5.2.0-beta.1", "@webcomponents/webcomponentsjs": "^1.2.0", "common-tags": "^1.8.0", "core-js": "^3.0.1", diff --git a/app/preact/package.json b/app/preact/package.json index 92bcb0333ac..83c813b7d72 100644 --- a/app/preact/package.json +++ b/app/preact/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preact", - "version": "5.2.0-beta.0", + "version": "5.2.0-beta.1", "description": "Storybook for Preact: Develop Preact Component in isolation.", "keywords": [ "storybook" @@ -27,7 +27,7 @@ }, "dependencies": { "@babel/plugin-transform-react-jsx": "^7.3.0", - "@storybook/core": "5.2.0-beta.0", + "@storybook/core": "5.2.0-beta.1", "common-tags": "^1.8.0", "core-js": "^3.0.1", "global": "^4.3.2", diff --git a/app/rax/package.json b/app/rax/package.json index 41543d89bdf..af6359612fa 100644 --- a/app/rax/package.json +++ b/app/rax/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/rax", - "version": "5.2.0-beta.0", + "version": "5.2.0-beta.1", "description": "Storybook for Rax: Develop Rax Component in isolation.", "keywords": [ "storybook", @@ -27,7 +27,7 @@ "prepare": "node ../../scripts/prepare.js" }, "dependencies": { - "@storybook/core": "5.2.0-beta.0", + "@storybook/core": "5.2.0-beta.1", "babel-preset-rax": "^1.0.0-beta.0", "common-tags": "^1.8.0", "core-js": "^2.6.2", diff --git a/app/react-native-server/package.json b/app/react-native-server/package.json index a8102eaeb93..f5cb06f1f72 100644 --- a/app/react-native-server/package.json +++ b/app/react-native-server/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/react-native-server", - "version": "5.2.0-beta.0", + "version": "5.2.0-beta.1", "description": "A better way to develop React Native Components for your app", "keywords": [ "react", @@ -24,12 +24,12 @@ "prepare": "node ../../scripts/prepare.js" }, "dependencies": { - "@storybook/addons": "5.2.0-beta.0", - "@storybook/api": "5.2.0-beta.0", - "@storybook/channel-websocket": "5.2.0-beta.0", - "@storybook/core": "5.2.0-beta.0", - "@storybook/core-events": "5.2.0-beta.0", - "@storybook/ui": "5.2.0-beta.0", + "@storybook/addons": "5.2.0-beta.1", + "@storybook/api": "5.2.0-beta.1", + "@storybook/channel-websocket": "5.2.0-beta.1", + "@storybook/core": "5.2.0-beta.1", + "@storybook/core-events": "5.2.0-beta.1", + "@storybook/ui": "5.2.0-beta.1", "commander": "^2.19.0", "core-js": "^3.0.1", "global": "^4.3.2", diff --git a/app/react-native/package.json b/app/react-native/package.json index a30b92882e6..2e052a5f42e 100644 --- a/app/react-native/package.json +++ b/app/react-native/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/react-native", - "version": "5.2.0-beta.0", + "version": "5.2.0-beta.1", "description": "A better way to develop React Native Components for your app", "keywords": [ "react", @@ -24,11 +24,11 @@ "dependencies": { "@emotion/core": "^10.0.14", "@emotion/native": "^10.0.14", - "@storybook/addons": "5.2.0-beta.0", - "@storybook/channel-websocket": "5.2.0-beta.0", - "@storybook/channels": "5.2.0-beta.0", - "@storybook/client-api": "5.2.0-beta.0", - "@storybook/core-events": "5.2.0-beta.0", + "@storybook/addons": "5.2.0-beta.1", + "@storybook/channel-websocket": "5.2.0-beta.1", + "@storybook/channels": "5.2.0-beta.1", + "@storybook/client-api": "5.2.0-beta.1", + "@storybook/core-events": "5.2.0-beta.1", "core-js": "^3.0.1", "emotion-theming": "^10.0.14", "react-native-swipe-gestures": "^1.0.3", diff --git a/app/react-native/src/preview/components/StoryView/index.tsx b/app/react-native/src/preview/components/StoryView/index.tsx index 5b75ecaf704..83c8576ebff 100644 --- a/app/react-native/src/preview/components/StoryView/index.tsx +++ b/app/react-native/src/preview/components/StoryView/index.tsx @@ -25,6 +25,16 @@ export default class StoryView extends Component { channel.on(Events.FORCE_RE_RENDER, this.forceReRender); } + componentDidUpdate() { + const channel = addons.getChannel(); + const { stories } = this.props; + const { storyId } = stories.getSelection(); + + if (storyId) { + channel.emit(Events.STORY_RENDERED); + } + } + componentWillUnmount() { const channel = addons.getChannel(); channel.removeListener(Events.STORY_RENDER, this.forceReRender); diff --git a/app/react/package.json b/app/react/package.json index 9b8e6d4c109..4133e613b43 100644 --- a/app/react/package.json +++ b/app/react/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/react", - "version": "5.2.0-beta.0", + "version": "5.2.0-beta.1", "description": "Storybook for React: Develop React Component in isolation with Hot Reloading.", "keywords": [ "storybook" @@ -29,9 +29,9 @@ "@babel/plugin-transform-react-constant-elements": "^7.2.0", "@babel/preset-flow": "^7.0.0", "@babel/preset-react": "^7.0.0", - "@storybook/addons": "5.2.0-beta.0", - "@storybook/core": "5.2.0-beta.0", - "@storybook/node-logger": "5.2.0-beta.0", + "@storybook/addons": "5.2.0-beta.1", + "@storybook/core": "5.2.0-beta.1", + "@storybook/node-logger": "5.2.0-beta.1", "@svgr/webpack": "^4.0.3", "babel-plugin-add-react-displayname": "^0.0.5", "babel-plugin-named-asset-import": "^0.3.1", diff --git a/app/riot/package.json b/app/riot/package.json index 93fc82e8a8e..4855f799d62 100644 --- a/app/riot/package.json +++ b/app/riot/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/riot", - "version": "5.2.0-beta.0", + "version": "5.2.0-beta.1", "description": "Storybook for riot.js: View riot snippets in isolation with Hot Reloading.", "keywords": [ "storybook" @@ -25,7 +25,7 @@ "prepare": "node ../../scripts/prepare.js" }, "dependencies": { - "@storybook/core": "5.2.0-beta.0", + "@storybook/core": "5.2.0-beta.1", "common-tags": "^1.8.0", "core-js": "^3.0.1", "global": "^4.3.2", diff --git a/app/svelte/package.json b/app/svelte/package.json index 4eef5a06f48..5eefaf1534d 100644 --- a/app/svelte/package.json +++ b/app/svelte/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/svelte", - "version": "5.2.0-beta.0", + "version": "5.2.0-beta.1", "description": "Storybook for Svelte: Develop Svelte Component in isolation with Hot Reloading.", "keywords": [ "storybook" @@ -26,7 +26,7 @@ "prepare": "node ../../scripts/prepare.js" }, "dependencies": { - "@storybook/core": "5.2.0-beta.0", + "@storybook/core": "5.2.0-beta.1", "common-tags": "^1.8.0", "core-js": "^3.0.1", "global": "^4.3.2", diff --git a/app/vue/package.json b/app/vue/package.json index 16447c556c5..10890509fee 100644 --- a/app/vue/package.json +++ b/app/vue/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/vue", - "version": "5.2.0-beta.0", + "version": "5.2.0-beta.1", "description": "Storybook for Vue: Develop Vue Component in isolation with Hot Reloading.", "keywords": [ "storybook" @@ -26,7 +26,7 @@ "prepare": "node ../../scripts/prepare.js" }, "dependencies": { - "@storybook/core": "5.2.0-beta.0", + "@storybook/core": "5.2.0-beta.1", "common-tags": "^1.8.0", "core-js": "^3.0.1", "global": "^4.3.2", diff --git a/dev-kits/addon-decorator/package.json b/dev-kits/addon-decorator/package.json index 7445f47392b..13e9568c75b 100644 --- a/dev-kits/addon-decorator/package.json +++ b/dev-kits/addon-decorator/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-decorator", - "version": "5.2.0-beta.0", + "version": "5.2.0-beta.1", "description": "decorator addon for storybook", "keywords": [ "devkit", @@ -24,8 +24,8 @@ "prepare": "node ../../scripts/prepare.js" }, "dependencies": { - "@storybook/addons": "5.2.0-beta.0", - "@storybook/client-api": "5.2.0-beta.0", + "@storybook/addons": "5.2.0-beta.1", + "@storybook/client-api": "5.2.0-beta.1", "core-js": "^3.0.1", "global": "^3.0.1" }, diff --git a/dev-kits/addon-parameter/package.json b/dev-kits/addon-parameter/package.json index bf04206e8d7..0087f7945e0 100644 --- a/dev-kits/addon-parameter/package.json +++ b/dev-kits/addon-parameter/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-parameter", - "version": "5.2.0-beta.0", + "version": "5.2.0-beta.1", "description": "parameter addon for storybook", "keywords": [ "devkit", @@ -24,12 +24,12 @@ "prepare": "node ../../scripts/prepare.js" }, "dependencies": { - "@storybook/addons": "5.2.0-beta.0", - "@storybook/api": "5.2.0-beta.0", - "@storybook/client-logger": "5.2.0-beta.0", - "@storybook/components": "5.2.0-beta.0", - "@storybook/core-events": "5.2.0-beta.0", - "@storybook/theming": "5.2.0-beta.0", + "@storybook/addons": "5.2.0-beta.1", + "@storybook/api": "5.2.0-beta.1", + "@storybook/client-logger": "5.2.0-beta.1", + "@storybook/components": "5.2.0-beta.1", + "@storybook/core-events": "5.2.0-beta.1", + "@storybook/theming": "5.2.0-beta.1", "common-tags": "^1.8.0", "core-js": "^3.0.1", "global": "^4.3.2", diff --git a/dev-kits/addon-roundtrip/package.json b/dev-kits/addon-roundtrip/package.json index 4245a9ae96a..6f536ef2208 100644 --- a/dev-kits/addon-roundtrip/package.json +++ b/dev-kits/addon-roundtrip/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-roundtrip", - "version": "5.2.0-beta.0", + "version": "5.2.0-beta.1", "description": "roundtrip addon for storybook", "keywords": [ "devkit", @@ -24,13 +24,13 @@ "prepare": "node ../../scripts/prepare.js" }, "dependencies": { - "@storybook/addons": "5.2.0-beta.0", - "@storybook/api": "5.2.0-beta.0", - "@storybook/client-api": "5.2.0-beta.0", - "@storybook/client-logger": "5.2.0-beta.0", - "@storybook/components": "5.2.0-beta.0", - "@storybook/core-events": "5.2.0-beta.0", - "@storybook/theming": "5.2.0-beta.0", + "@storybook/addons": "5.2.0-beta.1", + "@storybook/api": "5.2.0-beta.1", + "@storybook/client-api": "5.2.0-beta.1", + "@storybook/client-logger": "5.2.0-beta.1", + "@storybook/components": "5.2.0-beta.1", + "@storybook/core-events": "5.2.0-beta.1", + "@storybook/theming": "5.2.0-beta.1", "common-tags": "^1.8.0", "core-js": "^3.0.1", "global": "^4.3.2", diff --git a/docs/src/versions/next.json b/docs/src/versions/next.json index a0d98c29af8..bdab3e78fd1 100644 --- a/docs/src/versions/next.json +++ b/docs/src/versions/next.json @@ -1 +1 @@ -{"version":"5.2.0-beta.0","info":{"plain":"### Features\n\n* Codemod: Convert module format to MDX ([#7418](https://github.com/storybookjs/storybook/pull/7418))"}} \ No newline at end of file +{"version":"5.2.0-beta.1","info":{"plain":"### Features\n\n* React native: Emit event when story is rendered ([#7449](https://github.com/storybookjs/storybook/pull/7449))\n\n### Bug Fixes\n\n* Addon-knobs: improve types via generics and readonlyarray ([#7411](https://github.com/storybookjs/storybook/pull/7411))\n* Ondevice-backgrounds: use same param key as addon-backgrounds ([#7437](https://github.com/storybookjs/storybook/pull/7437))"}} \ No newline at end of file diff --git a/examples-native/crna-kitchen-sink/package.json b/examples-native/crna-kitchen-sink/package.json index 0aa8c8980bc..3872d963861 100644 --- a/examples-native/crna-kitchen-sink/package.json +++ b/examples-native/crna-kitchen-sink/package.json @@ -1,6 +1,6 @@ { "name": "crna-kitchen-sink", - "version": "5.2.0-beta.0", + "version": "5.2.0-beta.1", "private": true, "main": "node_modules/expo/AppEntry.js", "scripts": { @@ -24,14 +24,14 @@ "devDependencies": { "@babel/core": "^7.2.2", "@babel/plugin-transform-react-jsx-source": "^7.2.0", - "@storybook/addon-actions": "5.2.0-beta.0", - "@storybook/addon-knobs": "5.2.0-beta.0", - "@storybook/addon-ondevice-actions": "5.2.0-beta.0", - "@storybook/addon-ondevice-backgrounds": "5.2.0-beta.0", - "@storybook/addon-ondevice-knobs": "5.2.0-beta.0", - "@storybook/addon-ondevice-notes": "5.2.0-beta.0", - "@storybook/addons": "5.2.0-beta.0", - "@storybook/react-native": "5.2.0-beta.0", + "@storybook/addon-actions": "5.2.0-beta.1", + "@storybook/addon-knobs": "5.2.0-beta.1", + "@storybook/addon-ondevice-actions": "5.2.0-beta.1", + "@storybook/addon-ondevice-backgrounds": "5.2.0-beta.1", + "@storybook/addon-ondevice-knobs": "5.2.0-beta.1", + "@storybook/addon-ondevice-notes": "5.2.0-beta.1", + "@storybook/addons": "5.2.0-beta.1", + "@storybook/react-native": "5.2.0-beta.1", "babel-loader": "^8.0.4", "babel-plugin-module-resolver": "^3.2.0", "babel-preset-expo": "^5.1.1", diff --git a/examples/angular-cli/package.json b/examples/angular-cli/package.json index f2eaeb0574a..6a4e53f947d 100644 --- a/examples/angular-cli/package.json +++ b/examples/angular-cli/package.json @@ -1,6 +1,6 @@ { "name": "angular-cli", - "version": "5.2.0-beta.0", + "version": "5.2.0-beta.1", "private": true, "license": "MIT", "scripts": { @@ -34,21 +34,21 @@ "@angular-devkit/build-angular": "^0.13.4", "@angular/cli": "^7.3.6", "@angular/compiler-cli": "^7.2.6", - "@storybook/addon-a11y": "5.2.0-beta.0", - "@storybook/addon-actions": "5.2.0-beta.0", - "@storybook/addon-backgrounds": "5.2.0-beta.0", - "@storybook/addon-centered": "5.2.0-beta.0", - "@storybook/addon-docs": "5.2.0-beta.0", - "@storybook/addon-jest": "5.2.0-beta.0", - "@storybook/addon-knobs": "5.2.0-beta.0", - "@storybook/addon-links": "5.2.0-beta.0", - "@storybook/addon-notes": "5.2.0-beta.0", - "@storybook/addon-options": "5.2.0-beta.0", - "@storybook/addon-storyshots": "5.2.0-beta.0", - "@storybook/addon-storysource": "5.2.0-beta.0", - "@storybook/addons": "5.2.0-beta.0", - "@storybook/angular": "5.2.0-beta.0", - "@storybook/source-loader": "5.2.0-beta.0", + "@storybook/addon-a11y": "5.2.0-beta.1", + "@storybook/addon-actions": "5.2.0-beta.1", + "@storybook/addon-backgrounds": "5.2.0-beta.1", + "@storybook/addon-centered": "5.2.0-beta.1", + "@storybook/addon-docs": "5.2.0-beta.1", + "@storybook/addon-jest": "5.2.0-beta.1", + "@storybook/addon-knobs": "5.2.0-beta.1", + "@storybook/addon-links": "5.2.0-beta.1", + "@storybook/addon-notes": "5.2.0-beta.1", + "@storybook/addon-options": "5.2.0-beta.1", + "@storybook/addon-storyshots": "5.2.0-beta.1", + "@storybook/addon-storysource": "5.2.0-beta.1", + "@storybook/addons": "5.2.0-beta.1", + "@storybook/angular": "5.2.0-beta.1", + "@storybook/source-loader": "5.2.0-beta.1", "@types/core-js": "^2.5.0", "@types/jest": "^24.0.11", "@types/node": "~12.0.2", diff --git a/examples/cra-kitchen-sink/package.json b/examples/cra-kitchen-sink/package.json index 0f577fd7f8e..7d7a66f0e6c 100644 --- a/examples/cra-kitchen-sink/package.json +++ b/examples/cra-kitchen-sink/package.json @@ -1,6 +1,6 @@ { "name": "cra-kitchen-sink", - "version": "5.2.0-beta.0", + "version": "5.2.0-beta.1", "private": true, "scripts": { "build": "react-scripts build", @@ -19,22 +19,22 @@ "react-lifecycles-compat": "^3.0.4" }, "devDependencies": { - "@storybook/addon-a11y": "5.2.0-beta.0", - "@storybook/addon-actions": "5.2.0-beta.0", - "@storybook/addon-backgrounds": "5.2.0-beta.0", - "@storybook/addon-centered": "5.2.0-beta.0", - "@storybook/addon-events": "5.2.0-beta.0", - "@storybook/addon-info": "5.2.0-beta.0", - "@storybook/addon-jest": "5.2.0-beta.0", - "@storybook/addon-knobs": "5.2.0-beta.0", - "@storybook/addon-links": "5.2.0-beta.0", - "@storybook/addon-notes": "5.2.0-beta.0", - "@storybook/addon-options": "5.2.0-beta.0", - "@storybook/addon-storyshots": "5.2.0-beta.0", - "@storybook/addons": "5.2.0-beta.0", - "@storybook/client-logger": "5.2.0-beta.0", - "@storybook/react": "5.2.0-beta.0", - "@storybook/theming": "5.2.0-beta.0", + "@storybook/addon-a11y": "5.2.0-beta.1", + "@storybook/addon-actions": "5.2.0-beta.1", + "@storybook/addon-backgrounds": "5.2.0-beta.1", + "@storybook/addon-centered": "5.2.0-beta.1", + "@storybook/addon-events": "5.2.0-beta.1", + "@storybook/addon-info": "5.2.0-beta.1", + "@storybook/addon-jest": "5.2.0-beta.1", + "@storybook/addon-knobs": "5.2.0-beta.1", + "@storybook/addon-links": "5.2.0-beta.1", + "@storybook/addon-notes": "5.2.0-beta.1", + "@storybook/addon-options": "5.2.0-beta.1", + "@storybook/addon-storyshots": "5.2.0-beta.1", + "@storybook/addons": "5.2.0-beta.1", + "@storybook/client-logger": "5.2.0-beta.1", + "@storybook/react": "5.2.0-beta.1", + "@storybook/theming": "5.2.0-beta.1", "react-scripts": "^3.0.1" } } diff --git a/examples/cra-react15/package.json b/examples/cra-react15/package.json index f12410fc057..38501cba434 100644 --- a/examples/cra-react15/package.json +++ b/examples/cra-react15/package.json @@ -1,6 +1,6 @@ { "name": "cra-react15", - "version": "5.2.0-beta.0", + "version": "5.2.0-beta.1", "private": true, "dependencies": { "babel-loader": "8.0.6", @@ -19,10 +19,10 @@ "build-storybook": "build-storybook -s public" }, "devDependencies": { - "@storybook/addon-actions": "5.2.0-beta.0", - "@storybook/addon-links": "5.2.0-beta.0", - "@storybook/react": "5.2.0-beta.0", - "@storybook/theming": "5.2.0-beta.0", + "@storybook/addon-actions": "5.2.0-beta.1", + "@storybook/addon-links": "5.2.0-beta.1", + "@storybook/react": "5.2.0-beta.1", + "@storybook/theming": "5.2.0-beta.1", "babel-core": "6", "babel-runtime": "6" } diff --git a/examples/cra-ts-kitchen-sink/package.json b/examples/cra-ts-kitchen-sink/package.json index 0adeb3569f2..681ee20e00b 100644 --- a/examples/cra-ts-kitchen-sink/package.json +++ b/examples/cra-ts-kitchen-sink/package.json @@ -1,6 +1,6 @@ { "name": "cra-ts-kitchen-sink", - "version": "5.2.0-beta.0", + "version": "5.2.0-beta.1", "private": true, "scripts": { "build-storybook": "build-storybook -s public", @@ -14,12 +14,12 @@ "react-dom": "^16.8.3" }, "devDependencies": { - "@storybook/addon-a11y": "5.2.0-beta.0", - "@storybook/addon-actions": "5.2.0-beta.0", - "@storybook/addon-info": "5.2.0-beta.0", - "@storybook/addon-options": "5.2.0-beta.0", - "@storybook/addons": "5.2.0-beta.0", - "@storybook/react": "5.2.0-beta.0", + "@storybook/addon-a11y": "5.2.0-beta.1", + "@storybook/addon-actions": "5.2.0-beta.1", + "@storybook/addon-info": "5.2.0-beta.1", + "@storybook/addon-options": "5.2.0-beta.1", + "@storybook/addons": "5.2.0-beta.1", + "@storybook/react": "5.2.0-beta.1", "@types/enzyme": "^3.9.0", "@types/react": "^16.8.3", "@types/react-dom": "^16.8.2", diff --git a/examples/dev-kits/package.json b/examples/dev-kits/package.json index b205c0c8a28..e2d0d682db3 100644 --- a/examples/dev-kits/package.json +++ b/examples/dev-kits/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/example-devkits", - "version": "5.2.0-beta.0", + "version": "5.2.0-beta.1", "private": true, "scripts": { "build-storybook": "build-storybook -c ./ -s built-storybooks", @@ -8,15 +8,15 @@ "storybook": "start-storybook -p 9011 -c ./" }, "devDependencies": { - "@storybook/addon-decorator": "5.2.0-beta.0", - "@storybook/addon-parameter": "5.2.0-beta.0", - "@storybook/addon-roundtrip": "5.2.0-beta.0", - "@storybook/addons": "5.2.0-beta.0", - "@storybook/components": "5.2.0-beta.0", - "@storybook/core-events": "5.2.0-beta.0", - "@storybook/node-logger": "5.2.0-beta.0", - "@storybook/react": "5.2.0-beta.0", - "@storybook/theming": "5.2.0-beta.0", + "@storybook/addon-decorator": "5.2.0-beta.1", + "@storybook/addon-parameter": "5.2.0-beta.1", + "@storybook/addon-roundtrip": "5.2.0-beta.1", + "@storybook/addons": "5.2.0-beta.1", + "@storybook/components": "5.2.0-beta.1", + "@storybook/core-events": "5.2.0-beta.1", + "@storybook/node-logger": "5.2.0-beta.1", + "@storybook/react": "5.2.0-beta.1", + "@storybook/theming": "5.2.0-beta.1", "cors": "^2.8.5", "cross-env": "^5.2.0", "enzyme-to-json": "^3.3.5", diff --git a/examples/ember-cli/package.json b/examples/ember-cli/package.json index cb7fcd15edd..946366fc839 100644 --- a/examples/ember-cli/package.json +++ b/examples/ember-cli/package.json @@ -1,6 +1,6 @@ { "name": "ember-example", - "version": "5.2.0-beta.0", + "version": "5.2.0-beta.1", "private": true, "scripts": { "build": "ember build", @@ -15,19 +15,19 @@ }, "devDependencies": { "@babel/core": "^7.3.4", - "@storybook/addon-a11y": "5.2.0-beta.0", - "@storybook/addon-actions": "5.2.0-beta.0", - "@storybook/addon-backgrounds": "5.2.0-beta.0", - "@storybook/addon-centered": "5.2.0-beta.0", - "@storybook/addon-knobs": "5.2.0-beta.0", - "@storybook/addon-links": "5.2.0-beta.0", - "@storybook/addon-notes": "5.2.0-beta.0", - "@storybook/addon-options": "5.2.0-beta.0", - "@storybook/addon-storysource": "5.2.0-beta.0", - "@storybook/addon-viewport": "5.2.0-beta.0", - "@storybook/addons": "5.2.0-beta.0", - "@storybook/ember": "5.2.0-beta.0", - "@storybook/source-loader": "5.2.0-beta.0", + "@storybook/addon-a11y": "5.2.0-beta.1", + "@storybook/addon-actions": "5.2.0-beta.1", + "@storybook/addon-backgrounds": "5.2.0-beta.1", + "@storybook/addon-centered": "5.2.0-beta.1", + "@storybook/addon-knobs": "5.2.0-beta.1", + "@storybook/addon-links": "5.2.0-beta.1", + "@storybook/addon-notes": "5.2.0-beta.1", + "@storybook/addon-options": "5.2.0-beta.1", + "@storybook/addon-storysource": "5.2.0-beta.1", + "@storybook/addon-viewport": "5.2.0-beta.1", + "@storybook/addons": "5.2.0-beta.1", + "@storybook/ember": "5.2.0-beta.1", + "@storybook/source-loader": "5.2.0-beta.1", "babel-loader": "^8", "broccoli-asset-rev": "^3.0.0", "cross-env": "^5.2.0", diff --git a/examples/html-kitchen-sink/.storybook/config.js b/examples/html-kitchen-sink/.storybook/config.js index eeb82641683..cc92d650156 100644 --- a/examples/html-kitchen-sink/.storybook/config.js +++ b/examples/html-kitchen-sink/.storybook/config.js @@ -1,5 +1,6 @@ import { load, addParameters, addDecorator } from '@storybook/html'; import { withA11y } from '@storybook/addon-a11y'; +import { DocsPage } from '@storybook/addon-docs/blocks'; addDecorator(withA11y); @@ -13,7 +14,12 @@ addParameters({ }, options: { hierarchyRootSeparator: /\|/, + docs: { + iframeHeight: '200px', + }, }, + docs: DocsPage, }); load(require.context('../stories', true, /\.stories\.js$/), module); +load(require.context('../stories', true, /\.stories\.mdx$/), module); diff --git a/examples/html-kitchen-sink/.storybook/presets.js b/examples/html-kitchen-sink/.storybook/presets.js new file mode 100644 index 00000000000..183ad7f73f8 --- /dev/null +++ b/examples/html-kitchen-sink/.storybook/presets.js @@ -0,0 +1,8 @@ +module.exports = [ + { + name: '@storybook/addon-docs/html/preset', + options: { + configureJSX: true, + }, + }, +]; diff --git a/examples/html-kitchen-sink/package.json b/examples/html-kitchen-sink/package.json index 2a4c1cee337..1d206f168a0 100644 --- a/examples/html-kitchen-sink/package.json +++ b/examples/html-kitchen-sink/package.json @@ -1,6 +1,6 @@ { "name": "html-kitchen-sink", - "version": "5.2.0-beta.0", + "version": "5.2.0-beta.1", "private": true, "description": "", "keywords": [], @@ -14,25 +14,26 @@ "storybook": "start-storybook -p 9006 --no-dll" }, "devDependencies": { - "@storybook/addon-a11y": "5.2.0-beta.0", - "@storybook/addon-actions": "5.2.0-beta.0", - "@storybook/addon-backgrounds": "5.2.0-beta.0", - "@storybook/addon-centered": "5.2.0-beta.0", - "@storybook/addon-events": "5.2.0-beta.0", - "@storybook/addon-jest": "5.2.0-beta.0", - "@storybook/addon-knobs": "5.2.0-beta.0", - "@storybook/addon-links": "5.2.0-beta.0", - "@storybook/addon-notes": "5.2.0-beta.0", - "@storybook/addon-options": "5.2.0-beta.0", - "@storybook/addon-storyshots": "5.2.0-beta.0", - "@storybook/addon-storysource": "5.2.0-beta.0", - "@storybook/addon-viewport": "5.2.0-beta.0", - "@storybook/addons": "5.2.0-beta.0", - "@storybook/client-api": "5.2.0-beta.0", - "@storybook/core": "5.2.0-beta.0", - "@storybook/core-events": "5.2.0-beta.0", - "@storybook/html": "5.2.0-beta.0", - "@storybook/source-loader": "5.2.0-beta.0", + "@storybook/addon-a11y": "5.2.0-beta.1", + "@storybook/addon-actions": "5.2.0-beta.1", + "@storybook/addon-backgrounds": "5.2.0-beta.1", + "@storybook/addon-centered": "5.2.0-beta.1", + "@storybook/addon-docs": "5.2.0-beta.1", + "@storybook/addon-events": "5.2.0-beta.1", + "@storybook/addon-jest": "5.2.0-beta.1", + "@storybook/addon-knobs": "5.2.0-beta.1", + "@storybook/addon-links": "5.2.0-beta.1", + "@storybook/addon-notes": "5.2.0-beta.1", + "@storybook/addon-options": "5.2.0-beta.1", + "@storybook/addon-storyshots": "5.2.0-beta.1", + "@storybook/addon-storysource": "5.2.0-beta.1", + "@storybook/addon-viewport": "5.2.0-beta.1", + "@storybook/addons": "5.2.0-beta.1", + "@storybook/client-api": "5.2.0-beta.1", + "@storybook/core": "5.2.0-beta.1", + "@storybook/core-events": "5.2.0-beta.1", + "@storybook/html": "5.2.0-beta.1", + "@storybook/source-loader": "5.2.0-beta.1", "eventemitter3": "^3.1.0", "format-json": "^1.0.3", "global": "^4.3.2" diff --git a/examples/html-kitchen-sink/stories/addon-docs.stories.mdx b/examples/html-kitchen-sink/stories/addon-docs.stories.mdx new file mode 100644 index 00000000000..c0dc6c7b68f --- /dev/null +++ b/examples/html-kitchen-sink/stories/addon-docs.stories.mdx @@ -0,0 +1,20 @@ +import { Story, Preview, Meta } from '@storybook/addon-docs/blocks'; + +# Storybook Docs for HTML + + + +## Story definition + +Hallelujah! HTML is working out of the box without modification. +How you like them apples?! + + + {'

Hello World

'} +
+ +## Story reference + +You can also reference an existing story from within your MDX file. + + diff --git a/examples/marko-cli/package.json b/examples/marko-cli/package.json index ff296007dee..fde4e30a4bc 100644 --- a/examples/marko-cli/package.json +++ b/examples/marko-cli/package.json @@ -1,6 +1,6 @@ { "name": "marko-cli", - "version": "5.2.0-beta.0", + "version": "5.2.0-beta.1", "private": true, "description": "Demo of how to build an app using marko-starter", "repository": { @@ -24,14 +24,14 @@ "marko-starter": "^2.0.4" }, "devDependencies": { - "@storybook/addon-a11y": "5.2.0-beta.0", - "@storybook/addon-actions": "5.2.0-beta.0", - "@storybook/addon-knobs": "5.2.0-beta.0", - "@storybook/addon-options": "5.2.0-beta.0", - "@storybook/addon-storysource": "5.2.0-beta.0", - "@storybook/addons": "5.2.0-beta.0", - "@storybook/marko": "5.2.0-beta.0", - "@storybook/source-loader": "5.2.0-beta.0", + "@storybook/addon-a11y": "5.2.0-beta.1", + "@storybook/addon-actions": "5.2.0-beta.1", + "@storybook/addon-knobs": "5.2.0-beta.1", + "@storybook/addon-options": "5.2.0-beta.1", + "@storybook/addon-storysource": "5.2.0-beta.1", + "@storybook/addons": "5.2.0-beta.1", + "@storybook/marko": "5.2.0-beta.1", + "@storybook/source-loader": "5.2.0-beta.1", "prettier": "^1.16.4", "webpack": "^4.33.0" } diff --git a/examples/mithril-kitchen-sink/package.json b/examples/mithril-kitchen-sink/package.json index f1790f7dfef..af25554fcb4 100644 --- a/examples/mithril-kitchen-sink/package.json +++ b/examples/mithril-kitchen-sink/package.json @@ -1,6 +1,6 @@ { "name": "mithril-example", - "version": "5.2.0-beta.0", + "version": "5.2.0-beta.1", "private": true, "scripts": { "build-storybook": "build-storybook", @@ -11,20 +11,20 @@ "mithril": "^1.1.6" }, "devDependencies": { - "@storybook/addon-a11y": "5.2.0-beta.0", - "@storybook/addon-actions": "5.2.0-beta.0", - "@storybook/addon-backgrounds": "5.2.0-beta.0", - "@storybook/addon-centered": "5.2.0-beta.0", - "@storybook/addon-knobs": "5.2.0-beta.0", - "@storybook/addon-links": "5.2.0-beta.0", - "@storybook/addon-notes": "5.2.0-beta.0", - "@storybook/addon-options": "5.2.0-beta.0", - "@storybook/addon-storyshots": "5.2.0-beta.0", - "@storybook/addon-storysource": "5.2.0-beta.0", - "@storybook/addon-viewport": "5.2.0-beta.0", - "@storybook/addons": "5.2.0-beta.0", - "@storybook/mithril": "5.2.0-beta.0", - "@storybook/source-loader": "5.2.0-beta.0", + "@storybook/addon-a11y": "5.2.0-beta.1", + "@storybook/addon-actions": "5.2.0-beta.1", + "@storybook/addon-backgrounds": "5.2.0-beta.1", + "@storybook/addon-centered": "5.2.0-beta.1", + "@storybook/addon-knobs": "5.2.0-beta.1", + "@storybook/addon-links": "5.2.0-beta.1", + "@storybook/addon-notes": "5.2.0-beta.1", + "@storybook/addon-options": "5.2.0-beta.1", + "@storybook/addon-storyshots": "5.2.0-beta.1", + "@storybook/addon-storysource": "5.2.0-beta.1", + "@storybook/addon-viewport": "5.2.0-beta.1", + "@storybook/addons": "5.2.0-beta.1", + "@storybook/mithril": "5.2.0-beta.1", + "@storybook/source-loader": "5.2.0-beta.1", "webpack": "^4.33.0" } } diff --git a/examples/official-storybook/package.json b/examples/official-storybook/package.json index 1ce2abc9874..27b8f38e1bb 100644 --- a/examples/official-storybook/package.json +++ b/examples/official-storybook/package.json @@ -1,6 +1,6 @@ { "name": "official-storybook", - "version": "5.2.0-beta.0", + "version": "5.2.0-beta.1", "private": true, "scripts": { "build-storybook": "build-storybook -c ./ -s built-storybooks", @@ -15,34 +15,34 @@ }, "devDependencies": { "@packtracker/webpack-plugin": "^2.0.1", - "@storybook/addon-a11y": "5.2.0-beta.0", - "@storybook/addon-actions": "5.2.0-beta.0", - "@storybook/addon-backgrounds": "5.2.0-beta.0", - "@storybook/addon-centered": "5.2.0-beta.0", - "@storybook/addon-contexts": "5.2.0-beta.0", - "@storybook/addon-cssresources": "5.2.0-beta.0", - "@storybook/addon-design-assets": "5.2.0-beta.0", - "@storybook/addon-docs": "5.2.0-beta.0", - "@storybook/addon-events": "5.2.0-beta.0", - "@storybook/addon-graphql": "5.2.0-beta.0", - "@storybook/addon-info": "5.2.0-beta.0", - "@storybook/addon-jest": "5.2.0-beta.0", - "@storybook/addon-knobs": "5.2.0-beta.0", - "@storybook/addon-links": "5.2.0-beta.0", - "@storybook/addon-notes": "5.2.0-beta.0", - "@storybook/addon-options": "5.2.0-beta.0", - "@storybook/addon-queryparams": "5.2.0-beta.0", - "@storybook/addon-storyshots": "5.2.0-beta.0", - "@storybook/addon-storyshots-puppeteer": "5.2.0-beta.0", - "@storybook/addon-storysource": "5.2.0-beta.0", - "@storybook/addon-viewport": "5.2.0-beta.0", - "@storybook/addons": "5.2.0-beta.0", - "@storybook/components": "5.2.0-beta.0", - "@storybook/core-events": "5.2.0-beta.0", - "@storybook/node-logger": "5.2.0-beta.0", - "@storybook/react": "5.2.0-beta.0", - "@storybook/source-loader": "5.2.0-beta.0", - "@storybook/theming": "5.2.0-beta.0", + "@storybook/addon-a11y": "5.2.0-beta.1", + "@storybook/addon-actions": "5.2.0-beta.1", + "@storybook/addon-backgrounds": "5.2.0-beta.1", + "@storybook/addon-centered": "5.2.0-beta.1", + "@storybook/addon-contexts": "5.2.0-beta.1", + "@storybook/addon-cssresources": "5.2.0-beta.1", + "@storybook/addon-design-assets": "5.2.0-beta.1", + "@storybook/addon-docs": "5.2.0-beta.1", + "@storybook/addon-events": "5.2.0-beta.1", + "@storybook/addon-graphql": "5.2.0-beta.1", + "@storybook/addon-info": "5.2.0-beta.1", + "@storybook/addon-jest": "5.2.0-beta.1", + "@storybook/addon-knobs": "5.2.0-beta.1", + "@storybook/addon-links": "5.2.0-beta.1", + "@storybook/addon-notes": "5.2.0-beta.1", + "@storybook/addon-options": "5.2.0-beta.1", + "@storybook/addon-queryparams": "5.2.0-beta.1", + "@storybook/addon-storyshots": "5.2.0-beta.1", + "@storybook/addon-storyshots-puppeteer": "5.2.0-beta.1", + "@storybook/addon-storysource": "5.2.0-beta.1", + "@storybook/addon-viewport": "5.2.0-beta.1", + "@storybook/addons": "5.2.0-beta.1", + "@storybook/components": "5.2.0-beta.1", + "@storybook/core-events": "5.2.0-beta.1", + "@storybook/node-logger": "5.2.0-beta.1", + "@storybook/react": "5.2.0-beta.1", + "@storybook/source-loader": "5.2.0-beta.1", + "@storybook/theming": "5.2.0-beta.1", "cors": "^2.8.5", "cross-env": "^5.2.0", "enzyme-to-json": "^3.3.5", diff --git a/examples/polymer-cli/package.json b/examples/polymer-cli/package.json index 202b686682e..af1d23a5e91 100644 --- a/examples/polymer-cli/package.json +++ b/examples/polymer-cli/package.json @@ -1,6 +1,6 @@ { "name": "polymer-cli", - "version": "5.2.0-beta.0", + "version": "5.2.0-beta.1", "private": true, "scripts": { "build-storybook": "build-storybook", @@ -10,17 +10,17 @@ }, "dependencies": { "@polymer/polymer": "^2.6.0", - "@storybook/addon-a11y": "5.2.0-beta.0", - "@storybook/addon-actions": "5.2.0-beta.0", - "@storybook/addon-backgrounds": "5.2.0-beta.0", - "@storybook/addon-knobs": "5.2.0-beta.0", - "@storybook/addon-links": "5.2.0-beta.0", - "@storybook/addon-notes": "5.2.0-beta.0", - "@storybook/addon-options": "5.2.0-beta.0", - "@storybook/addon-storysource": "5.2.0-beta.0", - "@storybook/addon-viewport": "5.2.0-beta.0", - "@storybook/polymer": "5.2.0-beta.0", - "@storybook/source-loader": "5.2.0-beta.0", + "@storybook/addon-a11y": "5.2.0-beta.1", + "@storybook/addon-actions": "5.2.0-beta.1", + "@storybook/addon-backgrounds": "5.2.0-beta.1", + "@storybook/addon-knobs": "5.2.0-beta.1", + "@storybook/addon-links": "5.2.0-beta.1", + "@storybook/addon-notes": "5.2.0-beta.1", + "@storybook/addon-options": "5.2.0-beta.1", + "@storybook/addon-storysource": "5.2.0-beta.1", + "@storybook/addon-viewport": "5.2.0-beta.1", + "@storybook/polymer": "5.2.0-beta.1", + "@storybook/source-loader": "5.2.0-beta.1", "@webcomponents/webcomponentsjs": "^1.2.0", "global": "^4.3.2", "lit-html": "^1.0.0", diff --git a/examples/preact-kitchen-sink/package.json b/examples/preact-kitchen-sink/package.json index ba1a70aa0b7..8df48a24d95 100644 --- a/examples/preact-kitchen-sink/package.json +++ b/examples/preact-kitchen-sink/package.json @@ -1,6 +1,6 @@ { "name": "preact-example", - "version": "5.2.0-beta.0", + "version": "5.2.0-beta.1", "private": true, "scripts": { "build": "cross-env NODE_ENV=production webpack --progress --hide-modules", @@ -16,21 +16,21 @@ "devDependencies": { "@babel/core": "^7.3.4", "@babel/plugin-transform-runtime": "^7.2.0", - "@storybook/addon-a11y": "5.2.0-beta.0", - "@storybook/addon-actions": "5.2.0-beta.0", - "@storybook/addon-backgrounds": "5.2.0-beta.0", - "@storybook/addon-centered": "5.2.0-beta.0", - "@storybook/addon-contexts": "5.2.0-beta.0", - "@storybook/addon-knobs": "5.2.0-beta.0", - "@storybook/addon-links": "5.2.0-beta.0", - "@storybook/addon-notes": "5.2.0-beta.0", - "@storybook/addon-options": "5.2.0-beta.0", - "@storybook/addon-storyshots": "5.2.0-beta.0", - "@storybook/addon-storysource": "5.2.0-beta.0", - "@storybook/addon-viewport": "5.2.0-beta.0", - "@storybook/addons": "5.2.0-beta.0", - "@storybook/preact": "5.2.0-beta.0", - "@storybook/source-loader": "5.2.0-beta.0", + "@storybook/addon-a11y": "5.2.0-beta.1", + "@storybook/addon-actions": "5.2.0-beta.1", + "@storybook/addon-backgrounds": "5.2.0-beta.1", + "@storybook/addon-centered": "5.2.0-beta.1", + "@storybook/addon-contexts": "5.2.0-beta.1", + "@storybook/addon-knobs": "5.2.0-beta.1", + "@storybook/addon-links": "5.2.0-beta.1", + "@storybook/addon-notes": "5.2.0-beta.1", + "@storybook/addon-options": "5.2.0-beta.1", + "@storybook/addon-storyshots": "5.2.0-beta.1", + "@storybook/addon-storysource": "5.2.0-beta.1", + "@storybook/addon-viewport": "5.2.0-beta.1", + "@storybook/addons": "5.2.0-beta.1", + "@storybook/preact": "5.2.0-beta.1", + "@storybook/source-loader": "5.2.0-beta.1", "babel-loader": "^8.0.4", "cross-env": "^5.2.0", "file-loader": "^3.0.1", diff --git a/examples/rax-kitchen-sink/package.json b/examples/rax-kitchen-sink/package.json index 4ceb898df37..c45bfe10266 100644 --- a/examples/rax-kitchen-sink/package.json +++ b/examples/rax-kitchen-sink/package.json @@ -1,6 +1,6 @@ { "name": "rax-kitchen-sink", - "version": "5.2.0-beta.0", + "version": "5.2.0-beta.1", "private": true, "scripts": { "test:generate-output": "jest --json --outputFile=jest-test-results.json --config=./jest-addon.config.js", @@ -24,23 +24,23 @@ "rax-view": "^0.6.5" }, "devDependencies": { - "@storybook/addon-a11y": "5.2.0-beta.0", - "@storybook/addon-actions": "5.2.0-beta.0", - "@storybook/addon-backgrounds": "5.2.0-beta.0", - "@storybook/addon-centered": "5.2.0-beta.0", - "@storybook/addon-events": "5.2.0-beta.0", - "@storybook/addon-info": "5.2.0-beta.0", - "@storybook/addon-jest": "5.2.0-beta.0", - "@storybook/addon-knobs": "5.2.0-beta.0", - "@storybook/addon-links": "5.2.0-beta.0", - "@storybook/addon-notes": "5.2.0-beta.0", - "@storybook/addon-options": "5.2.0-beta.0", - "@storybook/addon-storyshots": "5.2.0-beta.0", - "@storybook/addon-storysource": "5.2.0-beta.0", - "@storybook/addon-viewport": "5.2.0-beta.0", - "@storybook/addons": "5.2.0-beta.0", - "@storybook/rax": "5.2.0-beta.0", - "@storybook/source-loader": "5.2.0-beta.0", + "@storybook/addon-a11y": "5.2.0-beta.1", + "@storybook/addon-actions": "5.2.0-beta.1", + "@storybook/addon-backgrounds": "5.2.0-beta.1", + "@storybook/addon-centered": "5.2.0-beta.1", + "@storybook/addon-events": "5.2.0-beta.1", + "@storybook/addon-info": "5.2.0-beta.1", + "@storybook/addon-jest": "5.2.0-beta.1", + "@storybook/addon-knobs": "5.2.0-beta.1", + "@storybook/addon-links": "5.2.0-beta.1", + "@storybook/addon-notes": "5.2.0-beta.1", + "@storybook/addon-options": "5.2.0-beta.1", + "@storybook/addon-storyshots": "5.2.0-beta.1", + "@storybook/addon-storysource": "5.2.0-beta.1", + "@storybook/addon-viewport": "5.2.0-beta.1", + "@storybook/addons": "5.2.0-beta.1", + "@storybook/rax": "5.2.0-beta.1", + "@storybook/source-loader": "5.2.0-beta.1", "babel-eslint": "^8.2.2", "babel-preset-rax": "^1.0.0-beta.0", "rax-scripts": "^1.0.0-beta.10", diff --git a/examples/riot-kitchen-sink/package.json b/examples/riot-kitchen-sink/package.json index 89a72c0cef8..b0257557fa4 100644 --- a/examples/riot-kitchen-sink/package.json +++ b/examples/riot-kitchen-sink/package.json @@ -1,6 +1,6 @@ { "name": "riot-example", - "version": "5.2.0-beta.0", + "version": "5.2.0-beta.1", "private": true, "scripts": { "build": "cross-env NODE_ENV=production webpack --progress --hide-modules", @@ -16,20 +16,20 @@ }, "devDependencies": { "@babel/core": "^7.3.4", - "@storybook/addon-a11y": "5.2.0-beta.0", - "@storybook/addon-actions": "5.2.0-beta.0", - "@storybook/addon-backgrounds": "5.2.0-beta.0", - "@storybook/addon-centered": "5.2.0-beta.0", - "@storybook/addon-knobs": "5.2.0-beta.0", - "@storybook/addon-links": "5.2.0-beta.0", - "@storybook/addon-notes": "5.2.0-beta.0", - "@storybook/addon-options": "5.2.0-beta.0", - "@storybook/addon-storyshots": "5.2.0-beta.0", - "@storybook/addon-storysource": "5.2.0-beta.0", - "@storybook/addon-viewport": "5.2.0-beta.0", - "@storybook/addons": "5.2.0-beta.0", - "@storybook/riot": "5.2.0-beta.0", - "@storybook/source-loader": "5.2.0-beta.0", + "@storybook/addon-a11y": "5.2.0-beta.1", + "@storybook/addon-actions": "5.2.0-beta.1", + "@storybook/addon-backgrounds": "5.2.0-beta.1", + "@storybook/addon-centered": "5.2.0-beta.1", + "@storybook/addon-knobs": "5.2.0-beta.1", + "@storybook/addon-links": "5.2.0-beta.1", + "@storybook/addon-notes": "5.2.0-beta.1", + "@storybook/addon-options": "5.2.0-beta.1", + "@storybook/addon-storyshots": "5.2.0-beta.1", + "@storybook/addon-storysource": "5.2.0-beta.1", + "@storybook/addon-viewport": "5.2.0-beta.1", + "@storybook/addons": "5.2.0-beta.1", + "@storybook/riot": "5.2.0-beta.1", + "@storybook/source-loader": "5.2.0-beta.1", "babel-loader": "^8.0.4", "cross-env": "^5.2.0", "file-loader": "^3.0.1", diff --git a/examples/standalone-preview/package.json b/examples/standalone-preview/package.json index b7bcfe9723c..fe06d1f35d1 100644 --- a/examples/standalone-preview/package.json +++ b/examples/standalone-preview/package.json @@ -1,6 +1,6 @@ { "name": "standalone-preview", - "version": "5.2.0-beta.0", + "version": "5.2.0-beta.1", "private": true, "scripts": { "storybook": "parcel ./storybook.html --port 1337" diff --git a/examples/svelte-kitchen-sink/package.json b/examples/svelte-kitchen-sink/package.json index 63bc793dd3f..9d3358ce667 100644 --- a/examples/svelte-kitchen-sink/package.json +++ b/examples/svelte-kitchen-sink/package.json @@ -1,6 +1,6 @@ { "name": "svelte-example", - "version": "5.2.0-beta.0", + "version": "5.2.0-beta.1", "private": true, "scripts": { "build-storybook": "build-storybook -s public", @@ -11,19 +11,19 @@ "global": "^4.3.2" }, "devDependencies": { - "@storybook/addon-a11y": "5.2.0-beta.0", - "@storybook/addon-actions": "5.2.0-beta.0", - "@storybook/addon-backgrounds": "5.2.0-beta.0", - "@storybook/addon-centered": "5.2.0-beta.0", - "@storybook/addon-knobs": "5.2.0-beta.0", - "@storybook/addon-links": "5.2.0-beta.0", - "@storybook/addon-notes": "5.2.0-beta.0", - "@storybook/addon-options": "5.2.0-beta.0", - "@storybook/addon-storyshots": "5.2.0-beta.0", - "@storybook/addon-storysource": "5.2.0-beta.0", - "@storybook/addon-viewport": "5.2.0-beta.0", - "@storybook/addons": "5.2.0-beta.0", - "@storybook/source-loader": "5.2.0-beta.0", - "@storybook/svelte": "5.2.0-beta.0" + "@storybook/addon-a11y": "5.2.0-beta.1", + "@storybook/addon-actions": "5.2.0-beta.1", + "@storybook/addon-backgrounds": "5.2.0-beta.1", + "@storybook/addon-centered": "5.2.0-beta.1", + "@storybook/addon-knobs": "5.2.0-beta.1", + "@storybook/addon-links": "5.2.0-beta.1", + "@storybook/addon-notes": "5.2.0-beta.1", + "@storybook/addon-options": "5.2.0-beta.1", + "@storybook/addon-storyshots": "5.2.0-beta.1", + "@storybook/addon-storysource": "5.2.0-beta.1", + "@storybook/addon-viewport": "5.2.0-beta.1", + "@storybook/addons": "5.2.0-beta.1", + "@storybook/source-loader": "5.2.0-beta.1", + "@storybook/svelte": "5.2.0-beta.1" } } diff --git a/examples/vue-kitchen-sink/package.json b/examples/vue-kitchen-sink/package.json index 8a1c4b8760d..3cc0fcb2fe1 100644 --- a/examples/vue-kitchen-sink/package.json +++ b/examples/vue-kitchen-sink/package.json @@ -1,6 +1,6 @@ { "name": "vue-example", - "version": "5.2.0-beta.0", + "version": "5.2.0-beta.1", "private": true, "scripts": { "build": "cross-env NODE_ENV=production webpack --progress --hide-modules", @@ -15,22 +15,22 @@ }, "devDependencies": { "@babel/core": "^7.3.4", - "@storybook/addon-a11y": "5.2.0-beta.0", - "@storybook/addon-actions": "5.2.0-beta.0", - "@storybook/addon-backgrounds": "5.2.0-beta.0", - "@storybook/addon-centered": "5.2.0-beta.0", - "@storybook/addon-contexts": "5.2.0-beta.0", - "@storybook/addon-docs": "5.2.0-beta.0", - "@storybook/addon-knobs": "5.2.0-beta.0", - "@storybook/addon-links": "5.2.0-beta.0", - "@storybook/addon-notes": "5.2.0-beta.0", - "@storybook/addon-options": "5.2.0-beta.0", - "@storybook/addon-storyshots": "5.2.0-beta.0", - "@storybook/addon-storysource": "5.2.0-beta.0", - "@storybook/addon-viewport": "5.2.0-beta.0", - "@storybook/addons": "5.2.0-beta.0", - "@storybook/source-loader": "5.2.0-beta.0", - "@storybook/vue": "5.2.0-beta.0", + "@storybook/addon-a11y": "5.2.0-beta.1", + "@storybook/addon-actions": "5.2.0-beta.1", + "@storybook/addon-backgrounds": "5.2.0-beta.1", + "@storybook/addon-centered": "5.2.0-beta.1", + "@storybook/addon-contexts": "5.2.0-beta.1", + "@storybook/addon-docs": "5.2.0-beta.1", + "@storybook/addon-knobs": "5.2.0-beta.1", + "@storybook/addon-links": "5.2.0-beta.1", + "@storybook/addon-notes": "5.2.0-beta.1", + "@storybook/addon-options": "5.2.0-beta.1", + "@storybook/addon-storyshots": "5.2.0-beta.1", + "@storybook/addon-storysource": "5.2.0-beta.1", + "@storybook/addon-viewport": "5.2.0-beta.1", + "@storybook/addons": "5.2.0-beta.1", + "@storybook/source-loader": "5.2.0-beta.1", + "@storybook/vue": "5.2.0-beta.1", "babel-core": "^7.0.0-bridge.0", "babel-loader": "^8.0.5", "cross-env": "^5.2.0", diff --git a/lerna.json b/lerna.json index 1e9756abe31..50ad8df9bea 100644 --- a/lerna.json +++ b/lerna.json @@ -2,5 +2,5 @@ "npmClient": "yarn", "useWorkspaces": true, "registry": "https://registry.npmjs.org", - "version": "5.2.0-beta.0" + "version": "5.2.0-beta.1" } diff --git a/lib/addons/package.json b/lib/addons/package.json index 1ed4297a460..66a1b083ca1 100644 --- a/lib/addons/package.json +++ b/lib/addons/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addons", - "version": "5.2.0-beta.0", + "version": "5.2.0-beta.1", "description": "Storybook addons store", "keywords": [ "storybook" @@ -21,9 +21,9 @@ "prepare": "node ../../scripts/prepare.js" }, "dependencies": { - "@storybook/api": "5.2.0-beta.0", - "@storybook/channels": "5.2.0-beta.0", - "@storybook/client-logger": "5.2.0-beta.0", + "@storybook/api": "5.2.0-beta.1", + "@storybook/channels": "5.2.0-beta.1", + "@storybook/client-logger": "5.2.0-beta.1", "core-js": "^3.0.1", "global": "^4.3.2", "util-deprecate": "^1.0.2" diff --git a/lib/api/package.json b/lib/api/package.json index e5157588dc9..dbba0bd9c5c 100644 --- a/lib/api/package.json +++ b/lib/api/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/api", - "version": "5.2.0-beta.0", + "version": "5.2.0-beta.1", "description": "Core Storybook API & Context", "keywords": [ "storybook" @@ -20,11 +20,11 @@ "prepare": "node ./scripts/generateVersion.js && node ../../scripts/prepare.js" }, "dependencies": { - "@storybook/channels": "5.2.0-beta.0", - "@storybook/client-logger": "5.2.0-beta.0", - "@storybook/core-events": "5.2.0-beta.0", - "@storybook/router": "5.2.0-beta.0", - "@storybook/theming": "5.2.0-beta.0", + "@storybook/channels": "5.2.0-beta.1", + "@storybook/client-logger": "5.2.0-beta.1", + "@storybook/core-events": "5.2.0-beta.1", + "@storybook/router": "5.2.0-beta.1", + "@storybook/theming": "5.2.0-beta.1", "core-js": "^3.0.1", "fast-deep-equal": "^2.0.1", "global": "^4.3.2", diff --git a/lib/api/src/version.ts b/lib/api/src/version.ts index b96f37a0f72..ab84b3e0254 100644 --- a/lib/api/src/version.ts +++ b/lib/api/src/version.ts @@ -1 +1 @@ -export const version = '5.2.0-beta.0'; +export const version = '5.2.0-beta.1'; diff --git a/lib/channel-postmessage/package.json b/lib/channel-postmessage/package.json index f9f7758f9e0..3cc246e0840 100644 --- a/lib/channel-postmessage/package.json +++ b/lib/channel-postmessage/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/channel-postmessage", - "version": "5.2.0-beta.0", + "version": "5.2.0-beta.1", "description": "", "keywords": [ "storybook" @@ -21,8 +21,8 @@ "prepare": "node ../../scripts/prepare.js" }, "dependencies": { - "@storybook/channels": "5.2.0-beta.0", - "@storybook/client-logger": "5.2.0-beta.0", + "@storybook/channels": "5.2.0-beta.1", + "@storybook/client-logger": "5.2.0-beta.1", "core-js": "^3.0.1", "global": "^4.3.2", "telejson": "^2.2.1" diff --git a/lib/channel-websocket/package.json b/lib/channel-websocket/package.json index 7c28ab9e381..7a6beec79b2 100644 --- a/lib/channel-websocket/package.json +++ b/lib/channel-websocket/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/channel-websocket", - "version": "5.2.0-beta.0", + "version": "5.2.0-beta.1", "description": "", "keywords": [ "storybook" @@ -21,7 +21,7 @@ "prepare": "node ../../scripts/prepare.js" }, "dependencies": { - "@storybook/channels": "5.2.0-beta.0", + "@storybook/channels": "5.2.0-beta.1", "core-js": "^3.0.1", "global": "^4.3.2", "json-fn": "^1.1.1" diff --git a/lib/channels/package.json b/lib/channels/package.json index 45d369ef61e..5bdee229ff9 100644 --- a/lib/channels/package.json +++ b/lib/channels/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/channels", - "version": "5.2.0-beta.0", + "version": "5.2.0-beta.1", "description": "", "keywords": [ "storybook" diff --git a/lib/cli/bin/generate.js b/lib/cli/bin/generate.js index c9fddf3d1fc..2752b350ae0 100644 --- a/lib/cli/bin/generate.js +++ b/lib/cli/bin/generate.js @@ -22,7 +22,7 @@ if (process.argv[1].includes('getstorybook')) { .option('-f --force', 'Forcely add storybook') .option('-s --skip-install', 'Skip installing deps') .option('-N --use-npm', 'Use npm to install deps') - .option('-p --parser ', 'jscodeshift parser') + .option('-p --parser ', 'jscodeshift parser') .option('-t --type ', 'Add Storybook for a specific project type') .option('-y --yes', 'Answer yes to all prompts') .action(options => initiate(options, pkg)); @@ -53,6 +53,7 @@ if (process.argv[1].includes('getstorybook')) { .description('Run a storybook codemod migration on your source files') .option('-l --list', 'List available migrations') .option('-g --glob ', 'Glob for files upon which to apply the migration', '**/*.js') + .option('-p --parser ', 'jscodeshift parser') .option( '-n --dry-run', 'Dry run: verify the migration exists and show the files to which it will be applied' @@ -61,8 +62,8 @@ if (process.argv[1].includes('getstorybook')) { '-r --rename ', 'Rename suffix of matching files after codemod has been applied, e.g. ".js:.ts"' ) - .action((migration, { configDir, glob, dryRun, list, rename }) => { - migrate(migration, { configDir, glob, dryRun, list, rename, logger }).catch(err => { + .action((migration, { configDir, glob, dryRun, list, rename, parser }) => { + migrate(migration, { configDir, glob, dryRun, list, rename, parser, logger }).catch(err => { logger.error(err); process.exit(1); }); diff --git a/lib/cli/package.json b/lib/cli/package.json index 38de7fbb2c9..10ff9b9b0f8 100644 --- a/lib/cli/package.json +++ b/lib/cli/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/cli", - "version": "5.2.0-beta.0", + "version": "5.2.0-beta.1", "description": "Storybook's CLI - easiest method of adding storybook to your projects", "keywords": [ "cli", @@ -30,7 +30,7 @@ "@babel/core": "^7.4.5", "@babel/preset-env": "^7.4.5", "@babel/register": "^7.0.0", - "@storybook/codemod": "5.2.0-beta.0", + "@storybook/codemod": "5.2.0-beta.1", "chalk": "^2.4.1", "commander": "^2.19.0", "core-js": "^3.0.1", @@ -46,33 +46,33 @@ "update-notifier": "^3.0.0" }, "devDependencies": { - "@storybook/addon-actions": "5.2.0-beta.0", - "@storybook/addon-centered": "5.2.0-beta.0", - "@storybook/addon-graphql": "5.2.0-beta.0", - "@storybook/addon-info": "5.2.0-beta.0", - "@storybook/addon-knobs": "5.2.0-beta.0", - "@storybook/addon-links": "5.2.0-beta.0", - "@storybook/addon-notes": "5.2.0-beta.0", - "@storybook/addon-options": "5.2.0-beta.0", - "@storybook/addon-storyshots": "5.2.0-beta.0", - "@storybook/addons": "5.2.0-beta.0", - "@storybook/angular": "5.2.0-beta.0", - "@storybook/channel-postmessage": "5.2.0-beta.0", - "@storybook/channel-websocket": "5.2.0-beta.0", - "@storybook/channels": "5.2.0-beta.0", - "@storybook/ember": "5.2.0-beta.0", - "@storybook/html": "5.2.0-beta.0", - "@storybook/marko": "5.2.0-beta.0", - "@storybook/mithril": "5.2.0-beta.0", - "@storybook/polymer": "5.2.0-beta.0", - "@storybook/preact": "5.2.0-beta.0", - "@storybook/rax": "5.2.0-beta.0", - "@storybook/react": "5.2.0-beta.0", - "@storybook/react-native": "5.2.0-beta.0", - "@storybook/riot": "5.2.0-beta.0", - "@storybook/svelte": "5.2.0-beta.0", - "@storybook/ui": "5.2.0-beta.0", - "@storybook/vue": "5.2.0-beta.0" + "@storybook/addon-actions": "5.2.0-beta.1", + "@storybook/addon-centered": "5.2.0-beta.1", + "@storybook/addon-graphql": "5.2.0-beta.1", + "@storybook/addon-info": "5.2.0-beta.1", + "@storybook/addon-knobs": "5.2.0-beta.1", + "@storybook/addon-links": "5.2.0-beta.1", + "@storybook/addon-notes": "5.2.0-beta.1", + "@storybook/addon-options": "5.2.0-beta.1", + "@storybook/addon-storyshots": "5.2.0-beta.1", + "@storybook/addons": "5.2.0-beta.1", + "@storybook/angular": "5.2.0-beta.1", + "@storybook/channel-postmessage": "5.2.0-beta.1", + "@storybook/channel-websocket": "5.2.0-beta.1", + "@storybook/channels": "5.2.0-beta.1", + "@storybook/ember": "5.2.0-beta.1", + "@storybook/html": "5.2.0-beta.1", + "@storybook/marko": "5.2.0-beta.1", + "@storybook/mithril": "5.2.0-beta.1", + "@storybook/polymer": "5.2.0-beta.1", + "@storybook/preact": "5.2.0-beta.1", + "@storybook/rax": "5.2.0-beta.1", + "@storybook/react": "5.2.0-beta.1", + "@storybook/react-native": "5.2.0-beta.1", + "@storybook/riot": "5.2.0-beta.1", + "@storybook/svelte": "5.2.0-beta.1", + "@storybook/ui": "5.2.0-beta.1", + "@storybook/vue": "5.2.0-beta.1" }, "publishConfig": { "access": "public" diff --git a/lib/client-api/package.json b/lib/client-api/package.json index d7610209120..0a27a12bff9 100644 --- a/lib/client-api/package.json +++ b/lib/client-api/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/client-api", - "version": "5.2.0-beta.0", + "version": "5.2.0-beta.1", "description": "Storybook Client API", "keywords": [ "storybook" @@ -21,12 +21,12 @@ "prepare": "node ../../scripts/prepare.js" }, "dependencies": { - "@storybook/addons": "5.2.0-beta.0", - "@storybook/channel-postmessage": "5.2.0-beta.0", - "@storybook/channels": "5.2.0-beta.0", - "@storybook/client-logger": "5.2.0-beta.0", - "@storybook/core-events": "5.2.0-beta.0", - "@storybook/router": "5.2.0-beta.0", + "@storybook/addons": "5.2.0-beta.1", + "@storybook/channel-postmessage": "5.2.0-beta.1", + "@storybook/channels": "5.2.0-beta.1", + "@storybook/client-logger": "5.2.0-beta.1", + "@storybook/core-events": "5.2.0-beta.1", + "@storybook/router": "5.2.0-beta.1", "common-tags": "^1.8.0", "core-js": "^3.0.1", "eventemitter3": "^3.1.0", diff --git a/lib/client-logger/package.json b/lib/client-logger/package.json index a0a9888f8cc..11516df8263 100644 --- a/lib/client-logger/package.json +++ b/lib/client-logger/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/client-logger", - "version": "5.2.0-beta.0", + "version": "5.2.0-beta.1", "description": "", "keywords": [ "storybook" diff --git a/lib/codemod/README.md b/lib/codemod/README.md index e5c517d2de2..ff7657fc05e 100644 --- a/lib/codemod/README.md +++ b/lib/codemod/README.md @@ -13,10 +13,10 @@ To get a list of available codemods: npx -p @storybook/cli sb migrate --list ``` -To run a codemod: +To run a codemod ``: ``` -npx -p @storybook/cli sb migrate name-of-codemod --glob "**/*.stories.js" +npx -p @storybook/cli sb migrate --glob "**/*.stories.js" ``` ## Installation diff --git a/lib/codemod/package.json b/lib/codemod/package.json index d88a9405493..55183077182 100644 --- a/lib/codemod/package.json +++ b/lib/codemod/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/codemod", - "version": "5.2.0-beta.0", + "version": "5.2.0-beta.1", "description": "A collection of codemod scripts written with JSCodeshift", "keywords": [ "storybook" @@ -22,7 +22,7 @@ }, "dependencies": { "@mdx-js/mdx": "^1.0.0", - "@storybook/node-logger": "5.2.0-beta.0", + "@storybook/node-logger": "5.2.0-beta.1", "core-js": "^3.0.1", "cross-spawn": "^6.0.5", "globby": "^10.0.1", diff --git a/lib/codemod/src/index.js b/lib/codemod/src/index.js index 0b2726471a8..a78536fb76b 100644 --- a/lib/codemod/src/index.js +++ b/lib/codemod/src/index.js @@ -25,7 +25,7 @@ async function renameFile(file, from, to, { logger }) { return fs.rename(file, newFile); } -export async function runCodemod(codemod, { glob, logger, dryRun, rename, hasYarn }) { +export async function runCodemod(codemod, { glob, logger, dryRun, rename, hasYarn, parser }) { const codemods = listCodemods(); if (!codemods.includes(codemod)) { throw new Error(`Unknown codemod ${codemod}. Run --list for options.`); @@ -42,10 +42,15 @@ export async function runCodemod(codemod, { glob, logger, dryRun, rename, hasYar const files = await globby([glob, '!node_modules', '!dist']); logger.log(`=> Applying ${codemod}: ${files.length} files`); if (!dryRun) { - const runner = hasYarn ? 'yarn' : 'npm'; - spawnSync(runner, ['run', 'jscodeshift', '-t', `${TRANSFORM_DIR}/${codemod}.js`, ...files], { - stdio: 'inherit', - }); + const runner = hasYarn ? 'yarn' : 'npx'; + const parserArgs = parser ? ['--parser', parser] : []; + spawnSync( + runner, + ['jscodeshift', '-t', `${TRANSFORM_DIR}/${codemod}.js`, ...parserArgs, ...files], + { + stdio: 'inherit', + } + ); } if (renameParts) { diff --git a/lib/components/package.json b/lib/components/package.json index e9a4e0a0f1a..b1f23198a75 100644 --- a/lib/components/package.json +++ b/lib/components/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/components", - "version": "5.2.0-beta.0", + "version": "5.2.0-beta.1", "description": "Core Storybook Components", "keywords": [ "storybook" @@ -21,8 +21,8 @@ "prepare": "node ../../scripts/prepare.js" }, "dependencies": { - "@storybook/client-logger": "5.2.0-beta.0", - "@storybook/theming": "5.2.0-beta.0", + "@storybook/client-logger": "5.2.0-beta.1", + "@storybook/theming": "5.2.0-beta.1", "@types/react-syntax-highlighter": "10.1.0", "core-js": "^3.0.1", "global": "^4.3.2", diff --git a/lib/core-events/package.json b/lib/core-events/package.json index e9cf9e1b514..3455d3bf956 100644 --- a/lib/core-events/package.json +++ b/lib/core-events/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/core-events", - "version": "5.2.0-beta.0", + "version": "5.2.0-beta.1", "description": "Event names used in storybook core", "keywords": [ "storybook" diff --git a/lib/core/package.json b/lib/core/package.json index d7ab88ae5b5..07258dc4390 100644 --- a/lib/core/package.json +++ b/lib/core/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/core", - "version": "5.2.0-beta.0", + "version": "5.2.0-beta.1", "description": "Storybook framework-agnostic API", "keywords": [ "storybook" @@ -25,15 +25,15 @@ "@babel/plugin-syntax-dynamic-import": "^7.2.0", "@babel/plugin-transform-react-constant-elements": "^7.2.0", "@babel/preset-env": "^7.4.5", - "@storybook/addons": "5.2.0-beta.0", - "@storybook/channel-postmessage": "5.2.0-beta.0", - "@storybook/client-api": "5.2.0-beta.0", - "@storybook/client-logger": "5.2.0-beta.0", - "@storybook/core-events": "5.2.0-beta.0", - "@storybook/node-logger": "5.2.0-beta.0", - "@storybook/router": "5.2.0-beta.0", - "@storybook/theming": "5.2.0-beta.0", - "@storybook/ui": "5.2.0-beta.0", + "@storybook/addons": "5.2.0-beta.1", + "@storybook/channel-postmessage": "5.2.0-beta.1", + "@storybook/client-api": "5.2.0-beta.1", + "@storybook/client-logger": "5.2.0-beta.1", + "@storybook/core-events": "5.2.0-beta.1", + "@storybook/node-logger": "5.2.0-beta.1", + "@storybook/router": "5.2.0-beta.1", + "@storybook/theming": "5.2.0-beta.1", + "@storybook/ui": "5.2.0-beta.1", "airbnb-js-shims": "^1 || ^2", "ansi-to-html": "^0.6.11", "autoprefixer": "^9.4.9", diff --git a/lib/node-logger/package.json b/lib/node-logger/package.json index f622e9cfa7f..d282e5f06a0 100644 --- a/lib/node-logger/package.json +++ b/lib/node-logger/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/node-logger", - "version": "5.2.0-beta.0", + "version": "5.2.0-beta.1", "description": "", "keywords": [ "storybook" diff --git a/lib/router/package.json b/lib/router/package.json index 5cfcecfc863..78deaa2a6f9 100644 --- a/lib/router/package.json +++ b/lib/router/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/router", - "version": "5.2.0-beta.0", + "version": "5.2.0-beta.1", "description": "Core Storybook Router", "keywords": [ "storybook" diff --git a/lib/source-loader/package.json b/lib/source-loader/package.json index 277cc693830..c620e5c1cd5 100644 --- a/lib/source-loader/package.json +++ b/lib/source-loader/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/source-loader", - "version": "5.2.0-beta.0", + "version": "5.2.0-beta.1", "description": "Source loader", "keywords": [ "lib", @@ -22,8 +22,8 @@ "prepare": "node ../../scripts/prepare.js" }, "dependencies": { - "@storybook/addons": "5.2.0-beta.0", - "@storybook/router": "5.2.0-beta.0", + "@storybook/addons": "5.2.0-beta.1", + "@storybook/router": "5.2.0-beta.1", "core-js": "^3.0.1", "estraverse": "^4.2.0", "global": "^4.3.2", diff --git a/lib/theming/package.json b/lib/theming/package.json index d714a9bd2dc..7b0680186a5 100644 --- a/lib/theming/package.json +++ b/lib/theming/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/theming", - "version": "5.2.0-beta.0", + "version": "5.2.0-beta.1", "description": "Core Storybook Components", "keywords": [ "storybook" @@ -23,7 +23,7 @@ "dependencies": { "@emotion/core": "^10.0.14", "@emotion/styled": "^10.0.14", - "@storybook/client-logger": "5.2.0-beta.0", + "@storybook/client-logger": "5.2.0-beta.1", "common-tags": "^1.8.0", "core-js": "^3.0.1", "deep-object-diff": "^1.1.0", diff --git a/lib/ui/package.json b/lib/ui/package.json index fd8e2b1a07b..7606b45a3ea 100644 --- a/lib/ui/package.json +++ b/lib/ui/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/ui", - "version": "5.2.0-beta.0", + "version": "5.2.0-beta.1", "description": "Core Storybook UI", "keywords": [ "storybook" @@ -22,14 +22,14 @@ "prepare": "node ../../scripts/prepare.js" }, "dependencies": { - "@storybook/addons": "5.2.0-beta.0", - "@storybook/api": "5.2.0-beta.0", - "@storybook/channels": "5.2.0-beta.0", - "@storybook/client-logger": "5.2.0-beta.0", - "@storybook/components": "5.2.0-beta.0", - "@storybook/core-events": "5.2.0-beta.0", - "@storybook/router": "5.2.0-beta.0", - "@storybook/theming": "5.2.0-beta.0", + "@storybook/addons": "5.2.0-beta.1", + "@storybook/api": "5.2.0-beta.1", + "@storybook/channels": "5.2.0-beta.1", + "@storybook/client-logger": "5.2.0-beta.1", + "@storybook/components": "5.2.0-beta.1", + "@storybook/core-events": "5.2.0-beta.1", + "@storybook/router": "5.2.0-beta.1", + "@storybook/theming": "5.2.0-beta.1", "copy-to-clipboard": "^3.0.8", "core-js": "^3.0.1", "core-js-pure": "^3.0.1",