diff --git a/.gitignore b/.gitignore index 42bf175..bbe05b0 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,7 @@ npm-debug.log* node_modules .npm /coverage -/.vscode \ No newline at end of file +/.vscode + +# The static storybook build created by build-storybook +storybook-static diff --git a/.storybook/config.js b/.storybook/config.js index 4c2433a..241268c 100644 --- a/.storybook/config.js +++ b/.storybook/config.js @@ -1,4 +1,4 @@ -import { configure } from '@kadira/storybook'; +import { configure, getStorybook } from '@kadira/storybook'; // automatically import all story.js files, excluding buffer components const req = require.context('../', true, /^(?!.*@bufferapp\/components).*(story\.jsx)$/); @@ -8,3 +8,5 @@ function loadStories() { } configure(loadStories, module); + +if (typeof window === 'object') window.__storybook_stories__ = getStorybook(); diff --git a/package.json b/package.json index 2de350b..07c8bb1 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "start": "start-storybook -p 9002", "deploy-storybook": "storybook-to-ghpages", "lint": "./node_modules/eslint/bin/eslint.js . --ignore-pattern coverage .storybook node_modules", + "percy-snapshot": "build-storybook && percy-storybook", "test": "npm run lint && jest --coverage", "test-watch": "jest --watch", "test-update": "jest -u" @@ -49,6 +50,7 @@ "@kadira/storybook": "2.35.3", "@kadira/storybook-addon-links": "1.0.1", "@kadira/storybook-deployer": "1.2.0", + "@percy-io/react-percy-storybook": "0.1.4", "babel-cli": "6.24.0", "babel-eslint": "7.2.1", "babel-jest": "19.0.0",