diff --git a/.eslintrc.js b/.eslintrc.js index 4fa3bf4ddff..ec55d7a4630 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -17,6 +17,7 @@ module.exports = { }, settings: { 'import/core-modules': ['enzyme'], + 'import/ignore': ['node_modules\\/(?!@storybook)'], }, rules: { strict: [error, 'never'], @@ -60,6 +61,9 @@ module.exports = { }, ], 'import/prefer-default-export': ignore, + 'import/default': error, + 'import/named': error, + 'import/namespace': error, 'react/jsx-wrap-multilines': ignore, 'react/jsx-indent': ignore, 'react/jsx-indent-props': ignore, diff --git a/CHANGELOG.md b/CHANGELOG.md index d06adb45d12..b8f708103cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,37 @@ +# 3.3.2 + +2017-December-28 + +#### Bug Fixes + +- Use store revisions to ensure that stories re-render on HMR. [#2588](https://github.com/storybooks/storybook/pull/2588) +- Fix @storybook/client-logger import [#2576](https://github.com/storybooks/storybook/pull/2576) +- Fixed react peer dependency [#2584](https://github.com/storybooks/storybook/pull/2584) + +#### Documentation + +- Docs: fix logos display & add babelrc [#2585](https://github.com/storybooks/storybook/pull/2585) +- add guide for Angular [#2574](https://github.com/storybooks/storybook/pull/2574) +- Update custom webpack config docs [#2578](https://github.com/storybooks/storybook/pull/2578) +- Attempt to make propTablesExclude usage clearer [#2568](https://github.com/storybooks/storybook/pull/2568) + +#### Maintenance + +- Add chromatic visual tests [#2505](https://github.com/storybooks/storybook/pull/2505) +- Update snapshots to fix tests [#2579](https://github.com/storybooks/storybook/pull/2579) + +#### Dependency Upgrades + +- Upgraded `make-error` in `addons/actions` from "1.3.0" to "1.3.2" [#2586](https://github.com/storybooks/storybook/pull/2586) +- Upgraded `zone.js` in `app/angular` from "0.8.18" to "0.8.19" [#2586](https://github.com/storybooks/storybook/pull/2586) +- Upgraded `zone.js` in `examples/angular-cli` from "0.8.18" to "0.8.19" [#2586](https://github.com/storybooks/storybook/pull/2586) +- Upgraded `@angular/cli` in `examples/angular-cli` from "1.6.2" to "1.6.3" [#2586](https://github.com/storybooks/storybook/pull/2586) +- Upgraded `uglifyjs-webpack-plugin` in `app/react` from "1.1.4" to "1.1.5" [#2581](https://github.com/storybooks/storybook/pull/2581) +- Upgraded `uglifyjs-webpack-plugin` in `app/angular` from "1.1.4" to "1.1.5" [#2581](https://github.com/storybooks/storybook/pull/2581) +- Upgraded `uglifyjs-webpack-plugin` in `app/react-native` from "1.1.4" to "1.1.5" [#2581](https://github.com/storybooks/storybook/pull/2581) +- Upgraded `uglifyjs-webpack-plugin` in `app/vue` from "1.1.4" to "1.1.5" [#2581](https://github.com/storybooks/storybook/pull/2581) +- Upgraded `karma-coverage-istanbul-reporter` in `examples/angular-cli` from "1.3.1" to "1.3.3" [#2581](https://github.com/storybooks/storybook/pull/2581) + # 3.3.1 2017-December-26 diff --git a/MIGRATION.md b/MIGRATION.md index 531ceec06b9..e331a988902 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -34,16 +34,6 @@ In the case of Vue: `import { ... } from '@storybook/addon-knobs/vue';` In the case of Angular: `import { ... } from '@storybook/addon-knobs/angular';` -### Storyshots Jest configuration - -Storyshots users will need to add a line to their `jest.config.js`: - -```js - transformIgnorePatterns: ['/node_modules/(?!lodash-es/.*)'], -``` - -We are working to resolve the issue that requires this: https://github.com/storybooks/storybook/issues/2570 - ## From version 3.1.x to 3.2.x **NOTE:** technically this is a breaking change, but only if you use TypeScript. Sorry people! diff --git a/addons/a11y/package.json b/addons/a11y/package.json index 2658ccf8a03..e71b9484c7c 100644 --- a/addons/a11y/package.json +++ b/addons/a11y/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-a11y", - "version": "3.3.1", + "version": "3.3.2", "description": "a11y addon for storybook", "keywords": [ "a11y", @@ -16,6 +16,7 @@ }, "license": "MIT", "main": "dist/index.js", + "jsnext:main": "src/index.js", "repository": { "type": "git", "url": "git+https://github.com/storybooks/storybook.git" @@ -24,7 +25,7 @@ "prepare": "node ../../scripts/prepare.js" }, "dependencies": { - "@storybook/components": "^3.3.1", + "@storybook/components": "^3.3.2", "axe-core": "^2.6.0", "prop-types": "^15.6.0" }, diff --git a/addons/actions/package.json b/addons/actions/package.json index b669a48bc3e..c3418bec040 100644 --- a/addons/actions/package.json +++ b/addons/actions/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-actions", - "version": "3.3.1", + "version": "3.3.2", "description": "Action Logger addon for storybook", "keywords": [ "storybook" @@ -11,6 +11,7 @@ }, "license": "MIT", "main": "dist/index.js", + "jsnext:main": "src/index.js", "repository": { "type": "git", "url": "https://github.com/storybooks/storybook.git" diff --git a/addons/background/package.json b/addons/background/package.json index 96b3e2ee0ff..0737cc9ade1 100644 --- a/addons/background/package.json +++ b/addons/background/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-backgrounds", - "version": "3.3.1", + "version": "3.3.2", "description": "A storybook addon to show different backgrounds for your preview", "keywords": [ "addon", @@ -15,6 +15,7 @@ "license": "MIT", "author": "jbaxleyiii", "main": "dist/index.js", + "jsnext:main": "src/index.js", "repository": { "type": "git", "url": "https://github.com/storybooks/storybook.git" diff --git a/addons/centered/package.json b/addons/centered/package.json index ff8901e9e47..d5b4235b7f8 100644 --- a/addons/centered/package.json +++ b/addons/centered/package.json @@ -1,10 +1,11 @@ { "name": "@storybook/addon-centered", - "version": "3.3.1", + "version": "3.3.2", "description": "Storybook decorator to center components", "license": "MIT", "author": "Muhammed Thanish ", "main": "dist/index.js", + "jsnext:main": "src/index.js", "scripts": { "prepare": "node ../../scripts/prepare.js" }, diff --git a/addons/events/package.json b/addons/events/package.json index d367af74369..e90c5c850c4 100644 --- a/addons/events/package.json +++ b/addons/events/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-events", - "version": "3.3.1", + "version": "3.3.2", "description": "Add events to your Storybook stories.", "keywords": [ "addon", @@ -10,6 +10,7 @@ ], "license": "MIT", "main": "dist/index.js", + "jsnext:main": "src/index.js", "repository": { "type": "git", "url": "git@github.com:storybooks/storybook.git" diff --git a/addons/graphql/package.json b/addons/graphql/package.json index ca16705375e..579c92860fd 100644 --- a/addons/graphql/package.json +++ b/addons/graphql/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-graphql", - "version": "3.3.1", + "version": "3.3.2", "description": "Storybook addon to display the GraphiQL IDE", "keywords": [ "storybook" @@ -11,6 +11,7 @@ }, "license": "MIT", "main": "dist/index.js", + "jsnext:main": "src/index.js", "repository": { "type": "git", "url": "https://github.com/storybooks/storybook.git" diff --git a/addons/info/package.json b/addons/info/package.json index 1d80fa218df..a24066f0e97 100644 --- a/addons/info/package.json +++ b/addons/info/package.json @@ -1,9 +1,10 @@ { "name": "@storybook/addon-info", - "version": "3.3.1", + "version": "3.3.2", "description": "A Storybook addon to show additional information for your stories.", "license": "MIT", "main": "dist/index.js", + "jsnext:main": "src/index.js", "repository": { "type": "git", "url": "https://github.com/storybooks/storybook.git" @@ -14,8 +15,8 @@ "storybook": "start-storybook -p 9010" }, "dependencies": { - "@storybook/client-logger": "^3.3.1", - "@storybook/components": "^3.3.1", + "@storybook/client-logger": "^3.3.2", + "@storybook/components": "^3.3.2", "babel-runtime": "^6.26.0", "global": "^4.3.2", "marksy": "^6.0.1", diff --git a/addons/info/src/components/markdown/index.js b/addons/info/src/components/markdown/index.js index e3a39005f78..2c9ff6ea306 100644 --- a/addons/info/src/components/markdown/index.js +++ b/addons/info/src/components/markdown/index.js @@ -1,3 +1,3 @@ export { H1, H2, H3, H4, H5, H6 } from './htags'; export { Code, Pre } from './code'; -export { P, Small, A, LI, UL } from './text'; +export { P, A, LI, UL } from './text'; diff --git a/addons/jest/package.json b/addons/jest/package.json index 148a6653ada..0ba83af5cd7 100644 --- a/addons/jest/package.json +++ b/addons/jest/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-jest", - "version": "3.3.1", + "version": "3.3.2", "description": "React storybook addon that show component jest report", "keywords": [ "addon", @@ -16,6 +16,7 @@ "license": "MIT", "author": "Renaud Tertrais (https://github.com/renaudtertrais)", "main": "dist/index.js", + "jsnext:main": "src/index.js", "repository": { "type": "git", "url": "git+https://github.com/storybooks/storybook" @@ -24,7 +25,7 @@ "prepare": "node ../../scripts/prepare.js" }, "dependencies": { - "@storybook/components": "^3.3.1", + "@storybook/components": "^3.3.2", "glamor": "^2.20.40", "glamorous": "^4.11.2", "global": "^4.3.2", diff --git a/addons/knobs/package.json b/addons/knobs/package.json index 776ab9a9c2a..60b2b8a80df 100644 --- a/addons/knobs/package.json +++ b/addons/knobs/package.json @@ -1,9 +1,10 @@ { "name": "@storybook/addon-knobs", - "version": "3.3.1", + "version": "3.3.2", "description": "Storybook Addon Prop Editor Component", "license": "MIT", "main": "dist/index.js", + "jsnext:main": "src/index.js", "repository": { "type": "git", "url": "https://github.com/storybooks/storybook.git" @@ -18,7 +19,7 @@ "deep-equal": "^1.0.1", "global": "^4.3.2", "insert-css": "^2.0.0", - "lodash-es": "^4.17.4", + "lodash.debounce": "^4.0.8", "moment": "^2.20.1", "prop-types": "^15.6.0", "react-color": "^2.11.4", diff --git a/addons/knobs/src/angular/utils.js b/addons/knobs/src/angular/utils.js index 03a810a8d7e..0d463b4ce0f 100644 --- a/addons/knobs/src/angular/utils.js +++ b/addons/knobs/src/angular/utils.js @@ -1,5 +1,9 @@ /* eslint-disable no-param-reassign */ /* globals window */ +import { ɵReflectionCapabilities } from '@angular/core'; + +// eslint-disable-next-line new-cap +const reflectionCapabilities = new ɵReflectionCapabilities(); function getMeta(component, [name1, name2], defaultValue) { if (!name2) { @@ -27,5 +31,11 @@ export function getPropMetadata(component) { } export function getParameters(component) { - return getMeta(component, ['parameters'], []); + const params = reflectionCapabilities.parameters(component); + + if (!params || !params[0]) { + return getMeta(component, ['parameters'], []); + } + + return params; } diff --git a/addons/knobs/src/components/Panel.js b/addons/knobs/src/components/Panel.js index 141fc4e3374..062f660c23a 100644 --- a/addons/knobs/src/components/Panel.js +++ b/addons/knobs/src/components/Panel.js @@ -1,6 +1,6 @@ import React from 'react'; import PropTypes from 'prop-types'; -import debounce from 'lodash-es/debounce'; +import debounce from 'lodash.debounce'; import PropForm from './PropForm'; import Types from './types'; diff --git a/addons/links/package.json b/addons/links/package.json index f631c0c789c..a5720000b31 100644 --- a/addons/links/package.json +++ b/addons/links/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-links", - "version": "3.3.1", + "version": "3.3.2", "description": "Story Links addon for storybook", "keywords": [ "storybook" @@ -11,6 +11,7 @@ }, "license": "MIT", "main": "dist/index.js", + "jsnext:main": "src/index.js", "repository": { "type": "git", "url": "https://github.com/storybooks/storybook.git" @@ -21,7 +22,7 @@ "storybook": "start-storybook -p 9001" }, "dependencies": { - "@storybook/components": "^3.3.1", + "@storybook/components": "^3.3.2", "global": "^4.3.2", "prop-types": "^15.5.10" }, diff --git a/addons/notes/package.json b/addons/notes/package.json index 09aa14b27d7..5a585fad2a4 100644 --- a/addons/notes/package.json +++ b/addons/notes/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-notes", - "version": "3.3.1", + "version": "3.3.2", "description": "Write notes for your Storybook stories.", "keywords": [ "addon", @@ -9,6 +9,7 @@ ], "license": "MIT", "main": "dist/index.js", + "jsnext:main": "src/index.js", "repository": { "type": "git", "url": "https://github.com/storybooks/storybook.git" diff --git a/addons/options/package.json b/addons/options/package.json index 4307bc6755b..8f80ddeb525 100644 --- a/addons/options/package.json +++ b/addons/options/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-options", - "version": "3.3.1", + "version": "3.3.2", "description": "Options addon for storybook", "keywords": [ "storybook" diff --git a/addons/storyshots/package.json b/addons/storyshots/package.json index c6364f6bbcc..9974b6838de 100644 --- a/addons/storyshots/package.json +++ b/addons/storyshots/package.json @@ -1,9 +1,10 @@ { "name": "@storybook/addon-storyshots", - "version": "3.3.1", + "version": "3.3.2", "description": "StoryShots is a Jest Snapshot Testing Addon for Storybook.", "license": "MIT", "main": "dist/index.js", + "jsnext:main": "src/index.js", "repository": { "type": "git", "url": "https://github.com/storybooks/storybook.git" @@ -15,7 +16,7 @@ "example": "jest storyshot.test" }, "dependencies": { - "@storybook/channels": "^3.3.1", + "@storybook/channels": "^3.3.2", "babel-runtime": "^6.26.0", "glob": "^7.1.2", "global": "^4.3.2", @@ -24,8 +25,8 @@ "read-pkg-up": "^3.0.0" }, "devDependencies": { - "@storybook/addons": "^3.3.1", - "@storybook/react": "^3.3.1", + "@storybook/addons": "^3.3.2", + "@storybook/react": "^3.3.2", "babel-cli": "^6.26.0", "babel-jest": "^20.0.3", "babel-plugin-transform-runtime": "^6.23.0", @@ -39,7 +40,7 @@ "react-dom": "^16.1.0" }, "peerDependencies": { - "@storybook/addons": "^3.3.1", + "@storybook/addons": "^3.3.2", "babel-core": "^6.26.0 | ^7.0.0-0", "react": "*", "react-test-renderer": "*" diff --git a/addons/viewport/package.json b/addons/viewport/package.json index 90c89fd9a89..8490db975a1 100644 --- a/addons/viewport/package.json +++ b/addons/viewport/package.json @@ -1,8 +1,8 @@ { "name": "@storybook/addon-viewport", - "version": "3.3.1", + "version": "3.3.2", "description": "Storybook addon to change the viewport size to mobile", - "main": "dist/index.js", + "main": "register.js", "keywords": [ "storybook" ], @@ -11,7 +11,7 @@ }, "license": "MIT", "dependencies": { - "@storybook/components": "^3.3.1", + "@storybook/components": "^3.3.2", "global": "^4.3.2", "prop-types": "^15.5.10" }, diff --git a/addons/viewport/src/index.js b/addons/viewport/src/index.js deleted file mode 100644 index d3da40ad919..00000000000 --- a/addons/viewport/src/index.js +++ /dev/null @@ -1 +0,0 @@ -export { register } from './manager'; diff --git a/app/angular/package.json b/app/angular/package.json index ff0d3ace8b5..054edc091dc 100644 --- a/app/angular/package.json +++ b/app/angular/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/angular", - "version": "3.3.1", + "version": "3.3.2", "description": "Storybook for Anglar: Develop Angular Components in isolation with Hot Reloading.", "homepage": "https://github.com/storybooks/storybook/tree/master/apps/angular", "bugs": { @@ -8,6 +8,7 @@ }, "license": "MIT", "main": "dist/client/index.js", + "jsnext:main": "src/client/index.js", "bin": { "build-storybook": "./bin/build.js", "start-storybook": "./bin/index.js", @@ -22,11 +23,11 @@ "prepare": "node ../../scripts/prepare.js" }, "dependencies": { - "@storybook/addon-actions": "^3.3.1", - "@storybook/addon-links": "^3.3.1", - "@storybook/addons": "^3.3.1", - "@storybook/channel-postmessage": "^3.3.1", - "@storybook/ui": "^3.3.1", + "@storybook/addon-actions": "^3.3.2", + "@storybook/addon-links": "^3.3.2", + "@storybook/addons": "^3.3.2", + "@storybook/channel-postmessage": "^3.3.2", + "@storybook/ui": "^3.3.2", "airbnb-js-shims": "^1.1.1", "angular2-template-loader": "^0.6.2", "autoprefixer": "^7.1.1", @@ -54,7 +55,7 @@ "json-loader": "^0.5.4", "json-stringify-safe": "^5.0.1", "json5": "^0.5.1", - "lodash-es": "^4.17.4", + "lodash.pick": "^4.4.0", "postcss-flexbugs-fixes": "^3.0.0", "postcss-loader": "^2.0.5", "prop-types": "^15.5.10", @@ -80,7 +81,6 @@ "zone.js": "^0.8.19" }, "devDependencies": { - "@types/lodash-es": "^4.17.0", "babel-cli": "^6.26.0", "babel-plugin-transform-decorators": "^6.24.1", "babel-plugin-transform-decorators-legacy": "^1.3.4", diff --git a/app/angular/src/client/preview/angular/components/app.component.ts b/app/angular/src/client/preview/angular/components/app.component.ts index f8a6f636f2f..5f9dffe3534 100644 --- a/app/angular/src/client/preview/angular/components/app.component.ts +++ b/app/angular/src/client/preview/angular/components/app.component.ts @@ -2,16 +2,7 @@ // to provide @Inputs and subscribe to @Outputs, see // https://github.com/angular/angular/issues/15360 // For the time being, the ViewContainerRef approach works pretty well. - -import has from 'lodash-es/has'; -import get from 'lodash-es/get'; -import set from 'lodash-es/set'; -import isFunction from 'lodash-es/isFunction'; -import isUndefined from 'lodash-es/isUndefined'; -import isEmpty from 'lodash-es/isEmpty'; -import forEach from 'lodash-es/forEach'; -import invoke from 'lodash-es/invoke'; - +import * as _ from 'lodash'; import { Component, Inject, @@ -24,12 +15,9 @@ import { SimpleChanges, SimpleChange } from '@angular/core'; - import { STORY } from '../app.token'; import { NgStory, ICollection } from '../types'; -const _ = { has, get, set, isFunction, isUndefined, isEmpty , forEach, invoke }; - @Component({ selector: 'app-root', template: '' @@ -37,7 +25,6 @@ const _ = { has, get, set, isFunction, isUndefined, isEmpty , forEach, invoke }; export class AppComponent implements AfterViewInit, OnDestroy { @ViewChild('target', { read: ViewContainerRef }) target: ViewContainerRef; - constructor( private cfr: ComponentFactoryResolver, @Inject(STORY) private data: NgStory @@ -103,7 +90,7 @@ export class AppComponent implements AfterViewInit, OnDestroy { } if (_.isFunction(props.ngModelChange)) { - _.invoke(instance, 'registerOnChange', props.ngModelChange); + _.invoke(instance, 'registerOnChange', props.ngModelChange); } } } diff --git a/app/angular/src/client/preview/angular/helpers.ts b/app/angular/src/client/preview/angular/helpers.ts index 1c10dbbc98b..4870f525ff1 100644 --- a/app/angular/src/client/preview/angular/helpers.ts +++ b/app/angular/src/client/preview/angular/helpers.ts @@ -7,8 +7,6 @@ import { } from '@angular/core'; import {FormsModule} from '@angular/forms' -import _debounce from 'lodash-es/debounce'; - import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; import { BrowserModule } from '@angular/platform-browser'; import { AppComponent } from './components/app.component'; @@ -33,7 +31,28 @@ interface IComponent extends Type { propsMetadata: any[] } -const debounce = (func: IRenderStoryFn | IRenderErrorFn) => _debounce(func, 100); +// Taken from https://davidwalsh.name/javascript-debounce-function +// We don't want to pull underscore +const debounce = (func: IRenderStoryFn | IRenderErrorFn, + wait: number = 100, + immediate: boolean = false): () => void => { + let timeout: any; + return function () { + const context = this, args = arguments; + const later = function () { + timeout = null; + if (!immediate) { + func.apply(context, args); + } + }; + const callNow = immediate && !timeout; + clearTimeout(timeout); + timeout = setTimeout(later, wait); + if (callNow) { + func.apply(context, args); + } + }; +}; const getComponentMetadata = ( { component, props = {}, propsMeta = {}, moduleMetadata = { diff --git a/app/angular/src/client/preview/angular/utils.ts b/app/angular/src/client/preview/angular/utils.ts index 1ec935cd6e9..fe83324fa0d 100644 --- a/app/angular/src/client/preview/angular/utils.ts +++ b/app/angular/src/client/preview/angular/utils.ts @@ -1,3 +1,7 @@ +import { ɵReflectionCapabilities } from '@angular/core'; + +const reflectionCapabilities = new ɵReflectionCapabilities(); + function getMeta(component: any, [name1, name2]: any, defaultValue: any) { if (!name2) { name2 = name1; @@ -24,5 +28,11 @@ export function getPropMetadata(component: any) { } export function getParameters(component: any) { - return getMeta(component, ['parameters'], []); + const params = reflectionCapabilities.parameters(component); + + if (!params || !params[0]) { + return getMeta(component, ['parameters'], []); + } + + return params; } \ No newline at end of file diff --git a/app/react-native/package.json b/app/react-native/package.json index 39e7b6180b8..35a6e6b8948 100644 --- a/app/react-native/package.json +++ b/app/react-native/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/react-native", - "version": "3.3.1", + "version": "3.3.2", "description": "A better way to develop React Native Components for your app", "keywords": [ "react", @@ -13,6 +13,7 @@ }, "license": "MIT", "main": "dist/index.js", + "jsnext:main": "src/index.js", "bin": { "storybook": "dist/bin/storybook.js" }, @@ -24,11 +25,11 @@ "prepare": "node ../../scripts/prepare.js" }, "dependencies": { - "@storybook/addon-actions": "^3.3.1", - "@storybook/addon-links": "^3.3.1", - "@storybook/addons": "^3.3.1", - "@storybook/channel-websocket": "^3.3.1", - "@storybook/ui": "^3.3.1", + "@storybook/addon-actions": "^3.3.2", + "@storybook/addon-links": "^3.3.2", + "@storybook/addons": "^3.3.2", + "@storybook/channel-websocket": "^3.3.2", + "@storybook/ui": "^3.3.2", "autoprefixer": "^7.2.3", "babel-loader": "^7.1.2", "babel-plugin-syntax-async-functions": "^6.13.0", diff --git a/app/react/package.json b/app/react/package.json index 7cbe9736388..86841427026 100644 --- a/app/react/package.json +++ b/app/react/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/react", - "version": "3.3.1", + "version": "3.3.2", "description": "Storybook for React: Develop React Component in isolation with Hot Reloading.", "homepage": "https://github.com/storybooks/storybook/tree/master/app/react", "bugs": { @@ -8,6 +8,7 @@ }, "license": "MIT", "main": "dist/client/index.js", + "jsnext:main": "src/client/index.js", "bin": { "build-storybook": "./bin/build.js", "start-storybook": "./bin/index.js", @@ -22,13 +23,13 @@ "prepare": "node ../../scripts/prepare.js" }, "dependencies": { - "@storybook/addon-actions": "^3.3.1", - "@storybook/addon-links": "^3.3.1", - "@storybook/addons": "^3.3.1", - "@storybook/channel-postmessage": "^3.3.1", - "@storybook/client-logger": "^3.3.1", - "@storybook/node-logger": "^3.3.1", - "@storybook/ui": "^3.3.1", + "@storybook/addon-actions": "^3.3.2", + "@storybook/addon-links": "^3.3.2", + "@storybook/addons": "^3.3.2", + "@storybook/channel-postmessage": "^3.3.2", + "@storybook/client-logger": "^3.3.2", + "@storybook/node-logger": "^3.3.2", + "@storybook/ui": "^3.3.2", "airbnb-js-shims": "^1.4.0", "autoprefixer": "^7.2.3", "babel-loader": "^7.1.2", @@ -60,7 +61,7 @@ "json-loader": "^0.5.7", "json-stringify-safe": "^5.0.1", "json5": "^0.5.1", - "lodash-es": "^4.17.4", + "lodash.flattendeep": "^4.4.0", "markdown-loader": "^2.0.1", "npmlog": "^4.1.2", "postcss-flexbugs-fixes": "^3.2.0", diff --git a/app/react/src/client/preview/client_api.js b/app/react/src/client/preview/client_api.js index e9834495173..9ffd4ee36ad 100644 --- a/app/react/src/client/preview/client_api.js +++ b/app/react/src/client/preview/client_api.js @@ -41,6 +41,7 @@ export default class ClientApi { if (m && m.hot) { m.hot.dispose(() => { this._storyStore.removeStoryKind(kind); + this._storyStore.incrementRevision(); }); } diff --git a/app/react/src/client/preview/element_check.js b/app/react/src/client/preview/element_check.js index fdfa3168ab9..cbcb2f518da 100644 --- a/app/react/src/client/preview/element_check.js +++ b/app/react/src/client/preview/element_check.js @@ -1,5 +1,5 @@ import React from 'react'; -import flattenDeep from 'lodash-es/flattenDeep'; +import flattenDeep from 'lodash.flattendeep'; // return true if the element is renderable with react fiber export const isValidFiberElement = element => diff --git a/app/react/src/client/preview/render.js b/app/react/src/client/preview/render.js index 1e16b7b1068..6ee916ac793 100644 --- a/app/react/src/client/preview/render.js +++ b/app/react/src/client/preview/render.js @@ -13,6 +13,7 @@ const isBrowser = typeof window !== 'undefined'; let rootEl = null; let previousKind = ''; let previousStory = ''; +let previousRevision = -1; if (isBrowser) { rootEl = document.getElementById('root'); @@ -45,6 +46,7 @@ export function renderMain(data, storyStore) { const noPreview = ; const { selectedKind, selectedStory } = data; + const revision = storyStore.getRevision(); const story = storyStore.getStory(selectedKind, selectedStory); if (!story) { ReactDOM.render(noPreview, rootEl); @@ -55,7 +57,13 @@ export function renderMain(data, storyStore) { // renderMain() gets executed after each action. Actions will cause the whole // story to re-render without this check. // https://github.com/storybooks/react-storybook/issues/116 - if (selectedKind === previousKind && previousStory === selectedStory) { + // However, we do want the story to re-render if the store itself has changed + // (which happens at the moment when HMR occurs) + if ( + revision === previousRevision && + selectedKind === previousKind && + previousStory === selectedStory + ) { return null; } @@ -63,6 +71,7 @@ export function renderMain(data, storyStore) { // Otherwise, React may not recrease instances for every story run. // This could leads to issues like below: // https://github.com/storybooks/react-storybook/issues/81 + previousRevision = revision; previousKind = selectedKind; previousStory = selectedStory; ReactDOM.unmountComponentAtNode(rootEl); diff --git a/app/react/src/client/preview/story_store.js b/app/react/src/client/preview/story_store.js index a82bba34d24..677fefd1a6d 100644 --- a/app/react/src/client/preview/story_store.js +++ b/app/react/src/client/preview/story_store.js @@ -10,6 +10,18 @@ function getId() { export default class StoryStore { constructor() { this._data = {}; + // This number is incremented on every HMR. + // In theory it could also be incremented if stories were dynamically + // changed in the store + this._revision = 0; + } + + getRevision() { + return this._revision; + } + + incrementRevision() { + this._revision += 1; } addStory(kind, name, fn, fileName) { diff --git a/app/vue/package.json b/app/vue/package.json index 313f3a1a18f..6afc6be0502 100644 --- a/app/vue/package.json +++ b/app/vue/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/vue", - "version": "3.3.1", + "version": "3.3.2", "description": "Storybook for Vue: Develop Vue Component in isolation with Hot Reloading.", "homepage": "https://github.com/storybooks/storybook/tree/master/apps/vue", "bugs": { @@ -8,6 +8,7 @@ }, "license": "MIT", "main": "dist/client/index.js", + "jsnext:main": "src/client/index.js", "bin": { "build-storybook": "./bin/build.js", "start-storybook": "./bin/index.js", @@ -22,11 +23,11 @@ "prepare": "node ../../scripts/prepare.js" }, "dependencies": { - "@storybook/addon-actions": "^3.3.1", - "@storybook/addon-links": "^3.3.1", - "@storybook/addons": "^3.3.1", - "@storybook/channel-postmessage": "^3.3.1", - "@storybook/ui": "^3.3.1", + "@storybook/addon-actions": "^3.3.2", + "@storybook/addon-links": "^3.3.2", + "@storybook/addons": "^3.3.2", + "@storybook/channel-postmessage": "^3.3.2", + "@storybook/ui": "^3.3.2", "airbnb-js-shims": "^1.4.0", "autoprefixer": "^7.2.3", "babel-loader": "^7.1.2", diff --git a/dangerfile.js b/dangerfile.js index 39f30cd6fd3..6b8c437802c 100644 --- a/dangerfile.js +++ b/dangerfile.js @@ -1,5 +1,5 @@ import { fail, danger } from 'danger'; -import { flatten, intersection, isEmpty, includes } from 'lodash-es'; +import { flatten, intersection, isEmpty, includes } from 'lodash'; const pkg = require('./package.json'); // eslint-disable-line import/newline-after-import const prLogConfig = pkg['pr-log']; diff --git a/docs/src/stories/index.js b/docs/src/stories/index.js index 66d0b46edde..f9d8240f38a 100644 --- a/docs/src/stories/index.js +++ b/docs/src/stories/index.js @@ -1,3 +1,5 @@ +// TODO reenable when @storybook/react with jsnext:main is published +// eslint-disable-next-line import/named import { storiesOf } from '@storybook/react'; import implementations from './implementations'; diff --git a/examples/angular-cli/package.json b/examples/angular-cli/package.json index 4a01cd71024..f2fddc02995 100644 --- a/examples/angular-cli/package.json +++ b/examples/angular-cli/package.json @@ -1,6 +1,6 @@ { "name": "angular-cli", - "version": "3.3.1", + "version": "3.3.2", "license": "MIT", "scripts": { "ng": "ng", @@ -31,11 +31,11 @@ "@angular/cli": "1.6.3", "@angular/compiler-cli": "^5.0.0-beta.7", "@angular/language-service": "^5.0.0-beta.7", - "@storybook/addon-actions": "^3.3.1", - "@storybook/addon-links": "^3.3.1", - "@storybook/addon-notes": "^3.3.1", - "@storybook/addons": "^3.3.1", - "@storybook/angular": "^3.3.1", + "@storybook/addon-actions": "^3.3.2", + "@storybook/addon-links": "^3.3.2", + "@storybook/addon-notes": "^3.3.2", + "@storybook/addons": "^3.3.2", + "@storybook/angular": "^3.3.2", "@types/jasmine": "~2.8.2", "@types/node": "~6.0.60", "codelyzer": "^3.1.2", diff --git a/examples/angular-cli/src/stories/component-with-di/di.component.html b/examples/angular-cli/src/stories/component-with-di/di.component.html new file mode 100644 index 00000000000..fc6c74c42ea --- /dev/null +++ b/examples/angular-cli/src/stories/component-with-di/di.component.html @@ -0,0 +1,7 @@ +
+
All dependencies are defined: {{isAllDeps()}}
+
Title: {{title}}
+
Injector: {{injector.constructor.toString()}}
+
ElementRef: {{elRefStr()}}
+
TestToken: {{testToken}}
+
diff --git a/examples/angular-cli/src/stories/component-with-di/di.component.stories.ts b/examples/angular-cli/src/stories/component-with-di/di.component.stories.ts new file mode 100644 index 00000000000..e3bb1396b8a --- /dev/null +++ b/examples/angular-cli/src/stories/component-with-di/di.component.stories.ts @@ -0,0 +1,19 @@ +import { storiesOf } from '@storybook/angular'; +import { withKnobs, text } from '@storybook/addon-knobs/angular'; +import { DiComponent } from './di.component'; + +storiesOf('Component dependencies', module) + .add('inputs and inject dependencies', () => ({ + component: DiComponent, + props: { + title: 'Component dependencies' + } + })) + .addDecorator(withKnobs) + .add('inputs and inject dependencies with knobs', () => ({ + component: DiComponent, + props: { + title: text('title', 'Component dependencies') + } + })); + diff --git a/examples/angular-cli/src/stories/component-with-di/di.component.ts b/examples/angular-cli/src/stories/component-with-di/di.component.ts new file mode 100644 index 00000000000..e3bb5df5dec --- /dev/null +++ b/examples/angular-cli/src/stories/component-with-di/di.component.ts @@ -0,0 +1,28 @@ +import { Component, Input, InjectionToken, Injector, ElementRef, Inject } from '@angular/core'; + +export const TEST_TOKEN = new InjectionToken('test'); + +@Component({ + selector: 'di-component', + templateUrl: './di.component.html', + providers: [ + { provide: TEST_TOKEN, useValue: 123} + ] +}) +export class DiComponent { + @Input() title: string; + + constructor( + protected injector: Injector, + protected elRef: ElementRef, + @Inject(TEST_TOKEN) protected testToken: number + ) {} + + isAllDeps(): boolean { + return Boolean(this.testToken && this.elRef && this.injector && this.title); + } + + elRefStr(): string { + return JSON.stringify(this.elRef); + } +} diff --git a/examples/cra-kitchen-sink/package.json b/examples/cra-kitchen-sink/package.json index e99cc24ce68..9fb266b7d0a 100644 --- a/examples/cra-kitchen-sink/package.json +++ b/examples/cra-kitchen-sink/package.json @@ -1,6 +1,6 @@ { "name": "cra-kitchen-sink", - "version": "3.3.1", + "version": "3.3.2", "scripts": { "build": "react-scripts build", "build-storybook": "build-storybook -s public", @@ -19,23 +19,23 @@ "react-dom": "^16.2.0" }, "devDependencies": { - "@storybook/addon-a11y": "^3.3.1", - "@storybook/addon-actions": "^3.3.1", - "@storybook/addon-backgrounds": "^3.3.1", - "@storybook/addon-centered": "^3.3.1", - "@storybook/addon-events": "^3.3.1", - "@storybook/addon-info": "^3.3.1", - "@storybook/addon-jest": "^3.3.1", - "@storybook/addon-knobs": "^3.3.1", - "@storybook/addon-links": "^3.3.1", - "@storybook/addon-notes": "^3.3.1", - "@storybook/addon-options": "^3.3.1", - "@storybook/addon-storyshots": "^3.3.1", - "@storybook/addon-viewport": "^3.3.1", - "@storybook/addons": "^3.3.1", - "@storybook/client-logger": "^3.3.1", - "@storybook/components": "^3.3.1", - "@storybook/react": "^3.3.1", + "@storybook/addon-a11y": "^3.3.2", + "@storybook/addon-actions": "^3.3.2", + "@storybook/addon-backgrounds": "^3.3.2", + "@storybook/addon-centered": "^3.3.2", + "@storybook/addon-events": "^3.3.2", + "@storybook/addon-info": "^3.3.2", + "@storybook/addon-jest": "^3.3.2", + "@storybook/addon-knobs": "^3.3.2", + "@storybook/addon-links": "^3.3.2", + "@storybook/addon-notes": "^3.3.2", + "@storybook/addon-options": "^3.3.2", + "@storybook/addon-storyshots": "^3.3.2", + "@storybook/addon-viewport": "^3.3.2", + "@storybook/addons": "^3.3.2", + "@storybook/client-logger": "^3.3.2", + "@storybook/components": "^3.3.2", + "@storybook/react": "^3.3.2", "babel-jest": "^22.0.4", "enzyme": "^3.2.0", "enzyme-adapter-react-16": "^1.1.0", diff --git a/examples/cra-kitchen-sink/src/stories/index.stories.js b/examples/cra-kitchen-sink/src/stories/index.stories.js index 075f25bb704..cebb63b19ae 100644 --- a/examples/cra-kitchen-sink/src/stories/index.stories.js +++ b/examples/cra-kitchen-sink/src/stories/index.stories.js @@ -3,6 +3,7 @@ import React from 'react'; import { storiesOf } from '@storybook/react'; import { setOptions } from '@storybook/addon-options'; import { action } from '@storybook/addon-actions'; +// eslint-disable-next-line import/named import { withNotes, WithNotes } from '@storybook/addon-notes'; import centered from '@storybook/addon-centered'; import { withInfo } from '@storybook/addon-info'; diff --git a/examples/official-storybook/package.json b/examples/official-storybook/package.json index 3891ad5c5e8..b2919cc61f5 100644 --- a/examples/official-storybook/package.json +++ b/examples/official-storybook/package.json @@ -1,29 +1,28 @@ { "name": "official-storybook", - "version": "3.3.1", + "version": "3.3.2", "scripts": { "build-storybook": "build-storybook -c ./", "storybook": "start-storybook -p 9010 -c ./", - "chromatic": - "chromatic test --storybook-addon --exit-zero-on-changes --app-code $CHROMATIC_APP_CODE" + "chromatic": "chromatic test --storybook-addon --exit-zero-on-changes --app-code $CHROMATIC_APP_CODE" }, "devDependencies": { - "@storybook/addon-a11y": "^3.3.1", - "@storybook/addon-actions": "^3.3.1", - "@storybook/addon-backgrounds": "^3.3.1", - "@storybook/addon-centered": "^3.3.1", - "@storybook/addon-events": "^3.3.1", - "@storybook/addon-info": "^3.3.1", - "@storybook/addon-jest": "^3.3.1", - "@storybook/addon-knobs": "^3.3.1", - "@storybook/addon-links": "^3.3.1", - "@storybook/addon-notes": "^3.3.1", - "@storybook/addon-options": "^3.3.1", - "@storybook/addon-storyshots": "^3.3.1", - "@storybook/addon-viewport": "^3.3.1", - "@storybook/addons": "^3.3.1", - "@storybook/components": "^3.3.1", - "@storybook/react": "^3.3.1", + "@storybook/addon-a11y": "^3.3.2", + "@storybook/addon-actions": "^3.3.2", + "@storybook/addon-backgrounds": "^3.3.2", + "@storybook/addon-centered": "^3.3.2", + "@storybook/addon-events": "^3.3.2", + "@storybook/addon-info": "^3.3.2", + "@storybook/addon-jest": "^3.3.2", + "@storybook/addon-knobs": "^3.3.2", + "@storybook/addon-links": "^3.3.2", + "@storybook/addon-notes": "^3.3.2", + "@storybook/addon-options": "^3.3.2", + "@storybook/addon-storyshots": "^3.3.2", + "@storybook/addon-viewport": "^3.3.2", + "@storybook/addons": "^3.3.2", + "@storybook/components": "^3.3.2", + "@storybook/react": "^3.3.2", "babel-jest": "^21.2.0", "enzyme": "^3.2.0", "enzyme-adapter-react-16": "^1.1.0", diff --git a/examples/official-storybook/stories/addon-notes.stories.js b/examples/official-storybook/stories/addon-notes.stories.js index f6c850dddfe..b4b67686fd3 100644 --- a/examples/official-storybook/stories/addon-notes.stories.js +++ b/examples/official-storybook/stories/addon-notes.stories.js @@ -1,6 +1,7 @@ import React from 'react'; import { storiesOf } from '@storybook/react'; +// eslint-disable-next-line import/named import { withNotes, WithNotes } from '@storybook/addon-notes'; import { action } from '@storybook/addon-actions'; import BaseButton from '../components/BaseButton'; diff --git a/examples/vue-kitchen-sink/package.json b/examples/vue-kitchen-sink/package.json index 7347f7c7119..b3f0e8c34a8 100644 --- a/examples/vue-kitchen-sink/package.json +++ b/examples/vue-kitchen-sink/package.json @@ -1,16 +1,16 @@ { "name": "vue-example", - "version": "3.3.1", + "version": "3.3.2", "private": true, "devDependencies": { - "@storybook/addon-actions": "^3.3.1", - "@storybook/addon-centered": "^3.3.1", - "@storybook/addon-knobs": "^3.3.1", - "@storybook/addon-links": "^3.3.1", - "@storybook/addon-notes": "^3.3.1", - "@storybook/addon-viewport": "^3.3.1", - "@storybook/addons": "^3.3.1", - "@storybook/vue": "^3.3.1", + "@storybook/addon-actions": "^3.3.2", + "@storybook/addon-centered": "^3.3.2", + "@storybook/addon-knobs": "^3.3.2", + "@storybook/addon-links": "^3.3.2", + "@storybook/addon-notes": "^3.3.2", + "@storybook/addon-viewport": "^3.3.2", + "@storybook/addons": "^3.3.2", + "@storybook/vue": "^3.3.2", "babel-core": "^6.26.0", "babel-loader": "^7.1.2", "babel-preset-env": "^1.6.0", diff --git a/jest.config.js b/jest.config.js index 62bfa9a4eff..5cbca1678f6 100644 --- a/jest.config.js +++ b/jest.config.js @@ -14,7 +14,6 @@ module.exports = { '/examples/cra-kitchen-sink', '/examples/official-storybook', ], - transformIgnorePatterns: ['/node_modules/(?!lodash-es/.*)'], testPathIgnorePatterns: ['/node_modules/', 'addon-jest.test.js', '/cli/test/'], collectCoverage: false, collectCoverageFrom: [ diff --git a/lerna.json b/lerna.json index 7cc94e017b0..13da7c38a70 100644 --- a/lerna.json +++ b/lerna.json @@ -8,5 +8,5 @@ } }, "concurrency": 1, - "version": "3.3.1" + "version": "3.3.2" } diff --git a/lib/addons/package.json b/lib/addons/package.json index 0f623bfda44..e36bb52d36c 100644 --- a/lib/addons/package.json +++ b/lib/addons/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addons", - "version": "3.3.1", + "version": "3.3.2", "description": "Storybook addons store", "keywords": [ "storybook" @@ -11,6 +11,7 @@ }, "license": "MIT", "main": "dist/index.js", + "jsnext:main": "src/index.js", "repository": { "type": "git", "url": "https://github.com/storybooks/storybook.git" diff --git a/lib/channel-postmessage/package.json b/lib/channel-postmessage/package.json index e20e4316e45..eef0f106947 100644 --- a/lib/channel-postmessage/package.json +++ b/lib/channel-postmessage/package.json @@ -1,14 +1,15 @@ { "name": "@storybook/channel-postmessage", - "version": "3.3.1", + "version": "3.3.2", "description": "", "license": "MIT", "main": "dist/index.js", + "jsnext:main": "src/index.js", "scripts": { "prepare": "node ../../scripts/prepare.js" }, "dependencies": { - "@storybook/channels": "^3.3.1", + "@storybook/channels": "^3.3.2", "global": "^4.3.2", "json-stringify-safe": "^5.0.1" } diff --git a/lib/channel-websocket/package.json b/lib/channel-websocket/package.json index b48a9132ba1..428b95a389a 100644 --- a/lib/channel-websocket/package.json +++ b/lib/channel-websocket/package.json @@ -1,14 +1,15 @@ { "name": "@storybook/channel-websocket", - "version": "3.3.1", + "version": "3.3.2", "description": "", "license": "MIT", "main": "dist/index.js", + "jsnext:main": "src/index.js", "scripts": { "prepare": "node ../../scripts/prepare.js" }, "dependencies": { - "@storybook/channels": "^3.3.1", + "@storybook/channels": "^3.3.2", "global": "^4.3.2" } } diff --git a/lib/channels/package.json b/lib/channels/package.json index b51a6d5c33b..4543d24afb1 100644 --- a/lib/channels/package.json +++ b/lib/channels/package.json @@ -1,9 +1,10 @@ { "name": "@storybook/channels", - "version": "3.3.1", + "version": "3.3.2", "description": "", "license": "MIT", "main": "dist/index.js", + "jsnext:main": "src/index.js", "scripts": { "prepare": "node ../../scripts/prepare.js" } diff --git a/lib/cli/package.json b/lib/cli/package.json index b5e8e8e6fa4..9cab1f9e33e 100644 --- a/lib/cli/package.json +++ b/lib/cli/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/cli", - "version": "3.3.1", + "version": "3.3.2", "description": "Storybook's CLI - easiest method of adding storybook to your projects", "keywords": [ "cli", @@ -25,7 +25,7 @@ "test": "cd test && ./run_tests.sh" }, "dependencies": { - "@storybook/codemod": "^3.3.1", + "@storybook/codemod": "^3.3.2", "babel-plugin-transform-runtime": "^6.23.0", "babel-preset-env": "^1.6.0", "babel-register": "^6.26.0", @@ -43,24 +43,24 @@ "update-notifier": "^2.3.0" }, "devDependencies": { - "@storybook/addon-actions": "^3.3.1", - "@storybook/addon-centered": "^3.3.1", - "@storybook/addon-graphql": "^3.3.1", - "@storybook/addon-info": "^3.3.1", - "@storybook/addon-knobs": "^3.3.1", - "@storybook/addon-links": "^3.3.1", - "@storybook/addon-notes": "^3.3.1", - "@storybook/addon-options": "^3.3.1", - "@storybook/addon-storyshots": "^3.3.1", - "@storybook/addons": "^3.3.1", - "@storybook/angular": "^3.3.1", - "@storybook/channel-postmessage": "^3.3.1", - "@storybook/channel-websocket": "^3.3.1", - "@storybook/channels": "^3.3.1", - "@storybook/react": "^3.3.1", - "@storybook/react-native": "^3.3.1", - "@storybook/ui": "^3.3.1", - "@storybook/vue": "^3.3.1", + "@storybook/addon-actions": "^3.3.2", + "@storybook/addon-centered": "^3.3.2", + "@storybook/addon-graphql": "^3.3.2", + "@storybook/addon-info": "^3.3.2", + "@storybook/addon-knobs": "^3.3.2", + "@storybook/addon-links": "^3.3.2", + "@storybook/addon-notes": "^3.3.2", + "@storybook/addon-options": "^3.3.2", + "@storybook/addon-storyshots": "^3.3.2", + "@storybook/addons": "^3.3.2", + "@storybook/angular": "^3.3.2", + "@storybook/channel-postmessage": "^3.3.2", + "@storybook/channel-websocket": "^3.3.2", + "@storybook/channels": "^3.3.2", + "@storybook/react": "^3.3.2", + "@storybook/react-native": "^3.3.2", + "@storybook/ui": "^3.3.2", + "@storybook/vue": "^3.3.2", "check-node-version": "2.1.0", "npx": "9.7.1" } diff --git a/lib/cli/test/snapshots/angular-cli/package.json b/lib/cli/test/snapshots/angular-cli/package.json index 786b15ddcb0..b9637133840 100644 --- a/lib/cli/test/snapshots/angular-cli/package.json +++ b/lib/cli/test/snapshots/angular-cli/package.json @@ -44,10 +44,10 @@ "ts-node": "1.2.1", "tslint": "^4.3.0", "typescript": "~2.4.0", - "@storybook/angular": "^3.3.1", - "@storybook/addon-notes": "^3.3.1", - "@storybook/addon-actions": "^3.3.1", - "@storybook/addon-links": "^3.3.1", + "@storybook/angular": "^3.3.2", + "@storybook/addon-notes": "^3.3.2", + "@storybook/addon-actions": "^3.3.2", + "@storybook/addon-links": "^3.3.2", "@types/lodash-es": "^4.17.0" } } diff --git a/lib/cli/test/snapshots/meteor/package.json b/lib/cli/test/snapshots/meteor/package.json index c882804a44e..cf7110e91b7 100644 --- a/lib/cli/test/snapshots/meteor/package.json +++ b/lib/cli/test/snapshots/meteor/package.json @@ -18,8 +18,8 @@ "babel-preset-react": "^6.24.1", "babel-preset-stage-1": "^6.24.1", "babel-root-slash-import": "^1.1.0", - "@storybook/react": "^3.3.1", - "@storybook/addon-actions": "^3.3.1", - "@storybook/addon-links": "^3.3.1" + "@storybook/react": "^3.3.2", + "@storybook/addon-actions": "^3.3.2", + "@storybook/addon-links": "^3.3.2" } } diff --git a/lib/cli/test/snapshots/react/package.json b/lib/cli/test/snapshots/react/package.json index 0201f6e4498..e02419d7ee2 100644 --- a/lib/cli/test/snapshots/react/package.json +++ b/lib/cli/test/snapshots/react/package.json @@ -20,8 +20,8 @@ "rollup-plugin-commonjs": "^8.2.0", "rollup-plugin-node-resolve": "^3.0.0", "rollup-plugin-replace": "^1.1.1", - "@storybook/react": "^3.3.1", - "@storybook/addon-actions": "^3.3.1", - "@storybook/addon-links": "^3.3.1" + "@storybook/react": "^3.3.2", + "@storybook/addon-actions": "^3.3.2", + "@storybook/addon-links": "^3.3.2" } } diff --git a/lib/cli/test/snapshots/react_native/package.json b/lib/cli/test/snapshots/react_native/package.json index 3481aa26689..5c03396a03c 100644 --- a/lib/cli/test/snapshots/react_native/package.json +++ b/lib/cli/test/snapshots/react_native/package.json @@ -16,9 +16,9 @@ "babel-preset-react-native": "3.0.1", "jest": "20.0.4", "react-test-renderer": "16.0.0-alpha.12", - "@storybook/react-native": "^3.3.1", - "@storybook/addon-actions": "^3.3.1", - "@storybook/addon-links": "^3.3.1", + "@storybook/react-native": "^3.3.2", + "@storybook/addon-actions": "^3.3.2", + "@storybook/addon-links": "^3.3.2", "react-dom": "16.0.0-alpha.12", "prop-types": "^15.6.0" }, diff --git a/lib/cli/test/snapshots/react_native_scripts/package.json b/lib/cli/test/snapshots/react_native_scripts/package.json index 60906b12344..26f95edc6f4 100644 --- a/lib/cli/test/snapshots/react_native_scripts/package.json +++ b/lib/cli/test/snapshots/react_native_scripts/package.json @@ -6,9 +6,9 @@ "react-native-scripts": "1.3.1", "jest-expo": "~20.0.0", "react-test-renderer": "16.0.0-alpha.12", - "@storybook/react-native": "^3.3.1", - "@storybook/addon-actions": "^3.3.1", - "@storybook/addon-links": "^3.3.1", + "@storybook/react-native": "^3.3.2", + "@storybook/addon-actions": "^3.3.2", + "@storybook/addon-links": "^3.3.2", "react-dom": "16.0.0-alpha.12", "prop-types": "^15.6.0" }, diff --git a/lib/cli/test/snapshots/react_project/package.json b/lib/cli/test/snapshots/react_project/package.json index 52a18a81d4d..d7d25e77f7c 100644 --- a/lib/cli/test/snapshots/react_project/package.json +++ b/lib/cli/test/snapshots/react_project/package.json @@ -13,9 +13,9 @@ "babel-preset-react": "^6.24.1", "react": "^15.6.1", "react-dom": "^15.6.1", - "@storybook/react": "^3.3.1", - "@storybook/addon-actions": "^3.3.1", - "@storybook/addon-links": "^3.3.1" + "@storybook/react": "^3.3.2", + "@storybook/addon-actions": "^3.3.2", + "@storybook/addon-links": "^3.3.2" }, "peerDependencies": { "react": "*", diff --git a/lib/cli/test/snapshots/react_scripts/package.json b/lib/cli/test/snapshots/react_scripts/package.json index 46ecf7798fc..38fe333c681 100644 --- a/lib/cli/test/snapshots/react_scripts/package.json +++ b/lib/cli/test/snapshots/react_scripts/package.json @@ -16,8 +16,8 @@ "build-storybook": "build-storybook -s public" }, "devDependencies": { - "@storybook/react": "^3.3.1", - "@storybook/addon-actions": "^3.3.1", - "@storybook/addon-links": "^3.3.1" + "@storybook/react": "^3.3.2", + "@storybook/addon-actions": "^3.3.2", + "@storybook/addon-links": "^3.3.2" } } diff --git a/lib/cli/test/snapshots/sfc_vue/package.json b/lib/cli/test/snapshots/sfc_vue/package.json index 8065219ea38..ef83a9354cb 100644 --- a/lib/cli/test/snapshots/sfc_vue/package.json +++ b/lib/cli/test/snapshots/sfc_vue/package.json @@ -49,9 +49,9 @@ "webpack-dev-middleware": "^1.10.0", "webpack-hot-middleware": "^2.18.0", "webpack-merge": "^4.1.0", - "@storybook/vue": "^3.3.1", - "@storybook/addon-actions": "^3.3.1", - "@storybook/addon-links": "^3.3.1", + "@storybook/vue": "^3.3.2", + "@storybook/addon-actions": "^3.3.2", + "@storybook/addon-links": "^3.3.2", "babel-preset-vue": "^2.0.0" }, "engines": { diff --git a/lib/cli/test/snapshots/update_package_organisations/package.json b/lib/cli/test/snapshots/update_package_organisations/package.json index 541d861ce8a..8820999a136 100644 --- a/lib/cli/test/snapshots/update_package_organisations/package.json +++ b/lib/cli/test/snapshots/update_package_organisations/package.json @@ -8,7 +8,7 @@ "react-scripts": "0.9.x" }, "devDependencies": { - "@storybook/react": "^3.3.1" + "@storybook/react": "^3.3.2" }, "scripts": { "start": "react-scripts start", diff --git a/lib/cli/test/snapshots/vue/package.json b/lib/cli/test/snapshots/vue/package.json index a7bc9a57a43..c7c4b903a5f 100644 --- a/lib/cli/test/snapshots/vue/package.json +++ b/lib/cli/test/snapshots/vue/package.json @@ -34,9 +34,9 @@ "rollup-plugin-serve": "^0.4.0", "rollup-plugin-vue": "^2.4.0", "rollup-watch": "^4.0.0", - "@storybook/vue": "^3.3.1", - "@storybook/addon-actions": "^3.3.1", - "@storybook/addon-links": "^3.3.1", + "@storybook/vue": "^3.3.2", + "@storybook/addon-actions": "^3.3.2", + "@storybook/addon-links": "^3.3.2", "babel-preset-vue": "^2.0.0" } } diff --git a/lib/cli/test/snapshots/webpack_react/package.json b/lib/cli/test/snapshots/webpack_react/package.json index ef47ab91d1c..33bf7d1385d 100644 --- a/lib/cli/test/snapshots/webpack_react/package.json +++ b/lib/cli/test/snapshots/webpack_react/package.json @@ -17,8 +17,8 @@ "babel-loader": "^7.1.2", "babel-preset-react": "^6.24.1", "webpack": "^3.5.5", - "@storybook/react": "^3.3.1", - "@storybook/addon-actions": "^3.3.1", - "@storybook/addon-links": "^3.3.1" + "@storybook/react": "^3.3.2", + "@storybook/addon-actions": "^3.3.2", + "@storybook/addon-links": "^3.3.2" } } diff --git a/lib/client-logger/package.json b/lib/client-logger/package.json index 827a45d3497..c0168ec0078 100644 --- a/lib/client-logger/package.json +++ b/lib/client-logger/package.json @@ -1,9 +1,10 @@ { "name": "@storybook/client-logger", - "version": "3.3.1", + "version": "3.3.2", "description": "", "license": "MIT", "main": "dist/index.js", + "jsnext:main": "src/index.js", "scripts": { "prepare": "node ../../scripts/prepare.js" } diff --git a/lib/codemod/package.json b/lib/codemod/package.json index 9fca264145c..9a4418a0d11 100644 --- a/lib/codemod/package.json +++ b/lib/codemod/package.json @@ -1,9 +1,10 @@ { "name": "@storybook/codemod", - "version": "3.3.1", + "version": "3.3.2", "description": "A collection of codemod scripts written with JSCodeshift", "license": "MIT", "main": "dist/index.js", + "jsnext:main": "src/index.js", "repository": { "type": "git", "url": "https://github.com/storybooks/storybook.git" diff --git a/lib/components/package.json b/lib/components/package.json index 54ef66ab318..db35ee7b2a9 100644 --- a/lib/components/package.json +++ b/lib/components/package.json @@ -1,9 +1,10 @@ { "name": "@storybook/components", - "version": "3.3.1", + "version": "3.3.2", "description": "Core Storybook Components", "license": "MIT", "main": "dist/index.js", + "jsnext:main": "src/index.js", "repository": { "type": "git", "url": "https://github.com/storybooks/storybook.git" @@ -23,8 +24,8 @@ "react-dom": "*" }, "devDependencies": { - "@storybook/addon-actions": "^3.3.1", - "@storybook/addon-knobs": "^3.3.1", - "@storybook/react": "^3.3.1" + "@storybook/addon-actions": "^3.3.2", + "@storybook/addon-knobs": "^3.3.2", + "@storybook/react": "^3.3.2" } } diff --git a/lib/node-logger/package.json b/lib/node-logger/package.json index a6b379dff7d..bf58f43b96d 100644 --- a/lib/node-logger/package.json +++ b/lib/node-logger/package.json @@ -1,9 +1,10 @@ { "name": "@storybook/node-logger", - "version": "3.3.1", + "version": "3.3.2", "description": "", "license": "MIT", "main": "dist/index.js", + "jsnext:main": "src/index.js", "scripts": { "prepare": "node ../../scripts/prepare.js" }, diff --git a/lib/ui/package.json b/lib/ui/package.json index fcca24c6ee8..d8e62cebafe 100644 --- a/lib/ui/package.json +++ b/lib/ui/package.json @@ -1,9 +1,10 @@ { "name": "@storybook/ui", - "version": "3.3.1", + "version": "3.3.2", "description": "Core Storybook UI", "license": "MIT", "main": "dist/index.js", + "jsnext:main": "src/index.js", "repository": { "type": "git", "url": "https://github.com/storybooks/storybook.git" @@ -14,7 +15,7 @@ "storybook": "start-storybook -p 9010" }, "dependencies": { - "@storybook/components": "^3.3.1", + "@storybook/components": "^3.3.2", "@storybook/mantra-core": "^1.7.2", "@storybook/react-komposer": "^2.0.3", "babel-runtime": "^6.26.0", @@ -24,7 +25,9 @@ "global": "^4.3.2", "json-stringify-safe": "^5.0.1", "keycode": "^2.1.9", - "lodash-es": "^4.17.4", + "lodash.debounce": "^4.0.8", + "lodash.pick": "^4.4.0", + "lodash.sortby": "^4.7.0", "podda": "^1.2.2", "prop-types": "^15.6.0", "qs": "^6.5.1", @@ -41,7 +44,7 @@ "react-dom": "*" }, "devDependencies": { - "@storybook/addon-actions": "^3.3.1", - "@storybook/react": "^3.3.1" + "@storybook/addon-actions": "^3.3.2", + "@storybook/react": "^3.3.2" } } diff --git a/lib/ui/src/modules/api/actions/api.js b/lib/ui/src/modules/api/actions/api.js index 0a36f30bc4a..d871a3d9bcf 100755 --- a/lib/ui/src/modules/api/actions/api.js +++ b/lib/ui/src/modules/api/actions/api.js @@ -1,4 +1,4 @@ -import pick from 'lodash-es/pick'; +import pick from 'lodash.pick'; export function jumpToStory(storyKinds, selectedKind, selectedStory, direction) { const flatteredStories = []; diff --git a/lib/ui/src/modules/shortcuts/actions/shortcuts.js b/lib/ui/src/modules/shortcuts/actions/shortcuts.js index cc7e130bce5..1920b154e01 100755 --- a/lib/ui/src/modules/shortcuts/actions/shortcuts.js +++ b/lib/ui/src/modules/shortcuts/actions/shortcuts.js @@ -1,4 +1,4 @@ -import pick from 'lodash-es/pick'; +import pick from 'lodash.pick'; import { features } from '../../../libs/key_events'; import apiActions from '../../api/actions'; diff --git a/lib/ui/src/modules/ui/components/stories_panel/index.js b/lib/ui/src/modules/ui/components/stories_panel/index.js index 6e1bc12615a..e8282889dd5 100755 --- a/lib/ui/src/modules/ui/components/stories_panel/index.js +++ b/lib/ui/src/modules/ui/components/stories_panel/index.js @@ -1,6 +1,6 @@ import PropTypes from 'prop-types'; import React, { Component } from 'react'; -import pick from 'lodash-es/pick'; +import pick from 'lodash.pick'; import Header from './header'; import Stories from './stories_tree'; import TextFilter from './text_filter'; diff --git a/lib/ui/src/modules/ui/components/stories_panel/text_filter.js b/lib/ui/src/modules/ui/components/stories_panel/text_filter.js index d30aa58c2c3..0e88d0ffdc3 100755 --- a/lib/ui/src/modules/ui/components/stories_panel/text_filter.js +++ b/lib/ui/src/modules/ui/components/stories_panel/text_filter.js @@ -1,6 +1,6 @@ import PropTypes from 'prop-types'; import React from 'react'; -import debounce from 'lodash-es/debounce'; +import debounce from 'lodash.debounce'; import { baseFonts } from '@storybook/components'; const defaultTextValue = ''; diff --git a/lib/ui/src/modules/ui/components/stories_panel/text_filter.test.js b/lib/ui/src/modules/ui/components/stories_panel/text_filter.test.js index bbb564fe131..aa03026f0c8 100755 --- a/lib/ui/src/modules/ui/components/stories_panel/text_filter.test.js +++ b/lib/ui/src/modules/ui/components/stories_panel/text_filter.test.js @@ -2,7 +2,7 @@ import { shallow, mount } from 'enzyme'; import React from 'react'; import TextFilter from './text_filter'; -jest.mock('lodash-es/debounce', () => jest.fn(fn => fn)); +jest.mock('lodash.debounce', () => jest.fn(fn => fn)); describe('manager.ui.components.stories_panel.test_filter', () => { describe('render', () => { diff --git a/lib/ui/src/modules/ui/containers/layout.js b/lib/ui/src/modules/ui/containers/layout.js index 4c65c72479d..cb89879735e 100755 --- a/lib/ui/src/modules/ui/containers/layout.js +++ b/lib/ui/src/modules/ui/containers/layout.js @@ -1,4 +1,4 @@ -import pick from 'lodash-es/pick'; +import pick from 'lodash.pick'; import Layout from '../components/layout'; import genPoddaLoader from '../libs/gen_podda_loader'; import compose from '../../../compose'; diff --git a/lib/ui/src/modules/ui/libs/filters.js b/lib/ui/src/modules/ui/libs/filters.js index 947f67f5d9a..358b2a3f645 100755 --- a/lib/ui/src/modules/ui/libs/filters.js +++ b/lib/ui/src/modules/ui/libs/filters.js @@ -1,5 +1,5 @@ import Fuse from 'fuse.js'; -import sortBy from 'lodash-es/sortBy'; +import sortBy from 'lodash.sortby'; const searchOptions = { shouldSort: false, diff --git a/package.json b/package.json index 358d59a195e..39c817fe2d2 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,7 @@ "lint:js": "cross-env NODE_ENV=production eslint --cache --cache-location=.cache/eslint --ext .js,.jsx,.json", "lint:md": "remark", "publish": "lerna publish", + "postpublish": "yarn test --cli --update", "repo-dirty-check": "node ./scripts/repo-dirty-check", "start": "npm --prefix examples/cra-kitchen-sink run storybook", "test": "node ./scripts/test.js", @@ -32,6 +33,7 @@ "chromatic": "npm --prefix examples/official-storybook run chromatic" }, "devDependencies": { + "@types/lodash": "^4.14.91", "babel-cli": "^6.26.0", "babel-core": "^6.26.0", "babel-eslint": "^8.1.2", @@ -72,7 +74,7 @@ "jest-jasmine2": "^22.0.4", "lerna": "^2.5.1", "lint-staged": "^6.0.0", - "lodash-es": "^4.17.4", + "lodash": "^4.17.4", "nodemon": "^1.14.3", "npmlog": "^4.1.2", "prettier": "^1.9.2", diff --git a/yarn.lock b/yarn.lock index 3f5ca04b7bc..d73951260eb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -287,13 +287,7 @@ version "2.8.2" resolved "https://registry.yarnpkg.com/@types/jasmine/-/jasmine-2.8.2.tgz#6ae4d8740c0da5d5a627df725b4eed71b8e36668" -"@types/lodash-es@^4.17.0": - version "4.17.0" - resolved "https://registry.yarnpkg.com/@types/lodash-es/-/lodash-es-4.17.0.tgz#ed9044d62ee36a93e0650b112701986b1c74c766" - dependencies: - "@types/lodash" "*" - -"@types/lodash@*": +"@types/lodash@^4.14.91": version "4.14.91" resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.91.tgz#794611b28056d16b5436059c6d800b39d573cd3a" @@ -8438,7 +8432,7 @@ lockfile@~1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/lockfile/-/lockfile-1.0.3.tgz#2638fc39a0331e9cac1a04b71799931c9c50df79" -lodash-es@^4.17.4, lodash-es@^4.2.1: +lodash-es@^4.2.1: version "4.17.4" resolved "https://registry.yarnpkg.com/lodash-es/-/lodash-es-4.17.4.tgz#dcc1d7552e150a0640073ba9cb31d70f032950e7" @@ -8517,6 +8511,10 @@ lodash.cond@^4.3.0: version "4.5.2" resolved "https://registry.yarnpkg.com/lodash.cond/-/lodash.cond-4.5.2.tgz#f471a1da486be60f6ab955d17115523dd1d255d5" +lodash.debounce@^4.0.8: + version "4.0.8" + resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" + lodash.defaults@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/lodash.defaults/-/lodash.defaults-4.2.0.tgz#d09178716ffea4dde9e5fb7b37f6f0802274580c"