Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…#1736)-Ability-to-force-redender-a-story
  • Loading branch information
dangreenisrael committed Dec 28, 2017
2 parents 31a68d7 + 587d74f commit 293bb7a
Show file tree
Hide file tree
Showing 91 changed files with 1,154 additions and 467 deletions.
45 changes: 29 additions & 16 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,29 +137,19 @@ jobs:
steps:
- checkout
- restore_cache:
name: "Restore core dependencies cache"
keys:
- core-dependencies-{{ checksum "yarn.lock" }}
- restore_cache:
name: "Restore docs dependencies cache"
name: "Restore dependencies cache"
keys:
- docs-dependencies-{{ checksum "docs/yarn.lock" }}
- run:
name: "Install core dependencies"
command: |
yarn install
- run:
name: "Install dependencies"
command: |
yarn bootstrap --docs
cd docs
yarn install --frozen-lockfile
- run:
name: "Dirty check"
command: |
yarn repo-dirty-check
- run:
name: "Run docs"
name: "Build docs"
command: |
yarn docs:build
cd docs
yarn build
- save_cache:
name: "Cache dependencies"
key: docs-dependencies-{{ checksum "docs/yarn.lock" }}
Expand Down Expand Up @@ -210,6 +200,26 @@ jobs:
command: |
yarn test --coverage --runInBand --core
yarn coverage
storybook:
<<: *defaults
steps:
- checkout
- restore_cache:
name: "Restore core dependencies cache"
keys:
- core-dependencies-{{ checksum "yarn.lock" }}
- restore_cache:
name: "Restore core dist cache"
keys:
- core-dist-{{ .Revision }}
- run:
name: "Link packages"
command: |
yarn install
- run:
name: "Visually test storybook"
command: |
yarn chromatic
cli:
working_directory: /tmp/storybook
docker:
Expand Down Expand Up @@ -275,6 +285,9 @@ workflows:
- unit-test:
requires:
- build
- storybook:
requires:
- build
- cli:
requires:
- build
Expand Down
4 changes: 4 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ module.exports = {
},
settings: {
'import/core-modules': ['enzyme'],
'import/ignore': ['node_modules\\/(?!@storybook)'],
},
rules: {
strict: [error, 'never'],
Expand Down Expand Up @@ -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,
Expand Down
34 changes: 34 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
10 changes: 0 additions & 10 deletions MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -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!
Expand Down
5 changes: 3 additions & 2 deletions addons/a11y/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-a11y",
"version": "3.3.1",
"version": "3.3.2",
"description": "a11y addon for storybook",
"keywords": [
"a11y",
Expand All @@ -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"
Expand All @@ -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"
},
Expand Down
5 changes: 3 additions & 2 deletions addons/actions/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-actions",
"version": "3.3.1",
"version": "3.3.2",
"description": "Action Logger addon for storybook",
"keywords": [
"storybook"
Expand All @@ -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"
Expand All @@ -21,7 +22,7 @@
"dependencies": {
"deep-equal": "^1.0.1",
"global": "^4.3.2",
"make-error": "^1.3.0",
"make-error": "^1.3.2",
"prop-types": "^15.6.0",
"react-inspector": "^2.2.2",
"uuid": "^3.1.0"
Expand Down
3 changes: 2 additions & 1 deletion addons/background/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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"
Expand Down
3 changes: 2 additions & 1 deletion addons/centered/package.json
Original file line number Diff line number Diff line change
@@ -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 <mnmtanish@gmail.com>",
"main": "dist/index.js",
"jsnext:main": "src/index.js",
"scripts": {
"prepare": "node ../../scripts/prepare.js"
},
Expand Down
3 changes: 2 additions & 1 deletion addons/events/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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"
Expand Down
3 changes: 2 additions & 1 deletion addons/graphql/package.json
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion addons/info/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ setDefaults({
inline: true, // Displays info inline vs click button to view
source: true, // Displays the source of story Component
propTables: [/* Components used in story */], // displays Prop Tables with this components
propTablesExclude: [], // Exclude Components from being shown in Prop Tables section
propTablesExclude: [], // Exclude Components from being shown in Prop Tables section. Accepts an array of component classes or functions.
styles: {}, // Overrides styles of addon. The object should follow this shape: https://github.com/storybooks/storybook/blob/master/addons/info/src/components/Story.js#L19. This prop can also accept a function which has the default stylesheet passed as an argument.
components: {}, // Overrides components used to display markdown
maxPropsIntoLine: 1, // Max props to display per line in source code
Expand Down
7 changes: 4 additions & 3 deletions addons/info/package.json
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion addons/info/src/components/markdown/index.js
Original file line number Diff line number Diff line change
@@ -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';
2 changes: 1 addition & 1 deletion addons/info/src/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import deprecate from 'util-deprecate';
import nestedObjectAssign from 'nested-object-assign';
import logger from '@storybook/client-logger';
import { logger } from '@storybook/client-logger';
import Story from './components/Story';
import PropTable from './components/PropTable';
import makeTableComponent from './components/makeTableComponent';
Expand Down
5 changes: 3 additions & 2 deletions addons/jest/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -16,6 +16,7 @@
"license": "MIT",
"author": "Renaud Tertrais <renaud.tertrais@gmail.com> (https://github.com/renaudtertrais)",
"main": "dist/index.js",
"jsnext:main": "src/index.js",
"repository": {
"type": "git",
"url": "git+https://github.com/storybooks/storybook"
Expand All @@ -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",
Expand Down
5 changes: 3 additions & 2 deletions addons/knobs/package.json
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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",
Expand Down
12 changes: 11 additions & 1 deletion addons/knobs/src/angular/utils.js
Original file line number Diff line number Diff line change
@@ -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) {
Expand Down Expand Up @@ -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;
}
2 changes: 1 addition & 1 deletion addons/knobs/src/components/Panel.js
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
Loading

0 comments on commit 293bb7a

Please sign in to comment.