Skip to content

Commit

Permalink
Merge branch 'next' into add-yarn-2-compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
ndelangen authored Feb 3, 2020
2 parents f938709 + 212e1fb commit 33864ca
Show file tree
Hide file tree
Showing 110 changed files with 4,046 additions and 938 deletions.
4 changes: 2 additions & 2 deletions addons/a11y/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@
"react-redux": "^7.0.2",
"react-sizeme": "^2.5.2",
"redux": "^4.0.1",
"ts-dedent": "^1.1.0",
"ts-dedent": "^1.1.1",
"util-deprecate": "^1.0.2"
},
"devDependencies": {
"@types/react-redux": "^7.0.6",
"@types/webpack-env": "^1.15.0"
"@types/webpack-env": "^1.15.1"
},
"peerDependencies": {
"react-dom": "*",
Expand Down
8 changes: 4 additions & 4 deletions addons/actions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,18 @@
"@storybook/core-events": "6.0.0-alpha.3",
"@storybook/theming": "6.0.0-alpha.3",
"core-js": "^3.0.1",
"fast-deep-equal": "^2.0.1",
"fast-deep-equal": "^3.1.1",
"global": "^4.3.2",
"polished": "^3.3.1",
"polished": "^3.4.4",
"prop-types": "^15.7.2",
"react": "^16.8.3",
"react-inspector": "^4.0.0",
"uuid": "^3.3.2"
},
"devDependencies": {
"@types/lodash": "^4.14.149",
"@types/uuid": "^3.4.4",
"@types/webpack-env": "^1.15.0"
"@types/uuid": "^3.4.7",
"@types/webpack-env": "^1.15.1"
},
"peerDependencies": {
"react-dom": "*",
Expand Down
2 changes: 1 addition & 1 deletion addons/backgrounds/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
},
"devDependencies": {
"@types/util-deprecate": "^1.0.0",
"@types/webpack-env": "^1.15.0"
"@types/webpack-env": "^1.15.1"
},
"peerDependencies": {
"react-dom": "*",
Expand Down
2 changes: 1 addition & 1 deletion addons/centered/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
},
"devDependencies": {
"@types/mithril": "^1.1.16",
"@types/webpack-env": "^1.15.0",
"@types/webpack-env": "^1.15.1",
"mithril": "*",
"preact": "*",
"react": "*"
Expand Down
11 changes: 11 additions & 0 deletions addons/centered/src/react.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@ import parameters from './parameters';
import styles from './styles';

function centered(storyFn: () => ReactNode) {
/* eslint-disable no-undef */
if (window) {
const params = new URL(window.location.href).search;
const isInDocsView = params.includes('viewMode=docs');

if (isInDocsView) {
return storyFn();
}
}
/* eslint-enable no-undef */

return (
<div style={styles.style}>
<div style={styles.innerStyle}>{storyFn()}</div>
Expand Down
2 changes: 1 addition & 1 deletion addons/cssresources/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"react": "^16.8.3"
},
"devDependencies": {
"@types/webpack-env": "^1.15.0"
"@types/webpack-env": "^1.15.1"
},
"peerDependencies": {
"react": "*",
Expand Down
2 changes: 1 addition & 1 deletion addons/design-assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"core-js": "^3.0.1",
"global": "^4.3.2",
"react": "^16.8.3",
"ts-dedent": "^1.1.0",
"ts-dedent": "^1.1.1",
"use-image": "^1.0.3"
},
"peerDependencies": {
Expand Down
10 changes: 5 additions & 5 deletions addons/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@babel/generator": "^7.4.0",
"@babel/parser": "^7.4.2",
"@babel/generator": "^7.8.4",
"@babel/parser": "^7.8.4",
"@babel/plugin-transform-react-jsx": "^7.3.0",
"@egoist/vue-to-react": "^1.1.0",
"@jest/transform": "^24.9.0",
"@jest/transform": "^25.1.0",
"@mdx-js/loader": "^1.5.1",
"@mdx-js/mdx": "^1.5.1",
"@mdx-js/react": "^1.5.1",
Expand All @@ -67,15 +67,15 @@
"react-element-to-jsx-string": "^14.1.0",
"remark-external-links": "^5.0.0",
"remark-slug": "^5.1.2",
"ts-dedent": "^1.1.0",
"ts-dedent": "^1.1.1",
"util-deprecate": "^1.0.2",
"vue-docgen-api": "^4.1.0",
"vue-docgen-loader": "^1.3.0-beta.0"
},
"devDependencies": {
"@types/doctrine": "^0.0.3",
"@types/enzyme": "^3.10.3",
"@types/jest": "^24.0.11",
"@types/jest": "^25.1.1",
"@types/prop-types": "^15.5.9",
"@types/util-deprecate": "^1.0.0",
"jest-specific-snapshot": "^2.0.0"
Expand Down
4 changes: 2 additions & 2 deletions addons/essentials/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@
"@storybook/addons": "6.0.0-alpha.3",
"@storybook/api": "6.0.0-alpha.3",
"@storybook/node-logger": "6.0.0-alpha.3",
"ts-dedent": "^1.1.0"
"ts-dedent": "^1.1.1"
},
"devDependencies": {
"@types/jest": "^24.0.11"
"@types/jest": "^25.1.1"
},
"peerDependencies": {
"babel-loader": "^8.0.0",
Expand Down
2 changes: 1 addition & 1 deletion addons/events/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"util-deprecate": "^1.0.2"
},
"devDependencies": {
"@types/webpack-env": "^1.15.0"
"@types/webpack-env": "^1.15.1"
},
"peerDependencies": {
"react": "*",
Expand Down
4 changes: 2 additions & 2 deletions addons/graphql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
"@storybook/api": "6.0.0-alpha.3",
"core-js": "^3.0.1",
"global": "^4.3.2",
"graphiql": "^0.16.0",
"graphql": "^14.2.1",
"graphiql": "^0.17.5",
"graphql": "^14.6.0",
"prop-types": "^15.7.2"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion addons/jest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"util-deprecate": "^1.0.2"
},
"devDependencies": {
"@types/webpack-env": "^1.15.0"
"@types/webpack-env": "^1.15.1"
},
"peerDependencies": {
"react": "*",
Expand Down
4 changes: 2 additions & 2 deletions addons/knobs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"copy-to-clipboard": "^3.0.8",
"core-js": "^3.0.1",
"escape-html": "^1.0.3",
"fast-deep-equal": "^2.0.1",
"fast-deep-equal": "^3.1.1",
"global": "^4.3.2",
"lodash": "^4.17.15",
"prop-types": "^15.7.2",
Expand All @@ -51,7 +51,7 @@
"@types/escape-html": "0.0.20",
"@types/react-lifecycles-compat": "^3.0.1",
"@types/react-select": "^2.0.19",
"@types/webpack-env": "^1.15.0"
"@types/webpack-env": "^1.15.1"
},
"peerDependencies": {
"react": "*",
Expand Down
4 changes: 2 additions & 2 deletions addons/links/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@
"global": "^4.3.2",
"prop-types": "^15.7.2",
"qs": "^6.6.0",
"ts-dedent": "^1.1.0"
"ts-dedent": "^1.1.1"
},
"devDependencies": {
"@types/webpack-env": "^1.15.0"
"@types/webpack-env": "^1.15.1"
},
"peerDependencies": {
"react": "*",
Expand Down
58 changes: 58 additions & 0 deletions addons/notes/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"name": "@storybook/addon-notes",
"version": "6.0.0-alpha.3",
"description": "Write notes for your Storybook stories.",
"keywords": [
"addon",
"notes",
"storybook"
],
"homepage": "https://github.com/storybookjs/storybook/tree/master/addons/notes",
"bugs": {
"url": "https://github.com/storybookjs/storybook/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/storybookjs/storybook.git",
"directory": "addons/notes"
},
"license": "MIT",
"files": [
"dist/**/*",
"README.md",
"*.js",
"*.d.ts"
],
"main": "dist/public_api.js",
"types": "dist/public_api.d.ts",
"scripts": {
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/addons": "6.0.0-alpha.3",
"@storybook/api": "6.0.0-alpha.3",
"@storybook/client-logger": "6.0.0-alpha.3",
"@storybook/components": "6.0.0-alpha.3",
"@storybook/core-events": "6.0.0-alpha.3",
"@storybook/router": "6.0.0-alpha.3",
"@storybook/theming": "6.0.0-alpha.3",
"core-js": "^3.0.1",
"global": "^4.3.2",
"markdown-to-jsx": "^6.10.3",
"memoizerific": "^1.11.3",
"prop-types": "^15.7.2",
"util-deprecate": "^1.0.2"
},
"devDependencies": {
"@types/prop-types": "^15.5.9",
"@types/util-deprecate": "^1.0.0",
"@types/webpack-env": "^1.15.1"
},
"peerDependencies": {
"react": "*"
},
"publishConfig": {
"access": "public"
},
"gitHead": "4b9d901add9452525135caae98ae5f78dd8da9ff"
}
2 changes: 1 addition & 1 deletion addons/options/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"util-deprecate": "^1.0.2"
},
"devDependencies": {
"@types/webpack-env": "^1.15.0"
"@types/webpack-env": "^1.15.1"
},
"peerDependencies": {
"react": "*",
Expand Down
4 changes: 2 additions & 2 deletions addons/queryparams/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@
"global": "^4.3.2",
"qs": "^6.6.0",
"react": "^16.8.3",
"ts-dedent": "^1.1.0"
"ts-dedent": "^1.1.1"
},
"devDependencies": {
"@types/webpack-env": "^1.15.0"
"@types/webpack-env": "^1.15.1"
},
"peerDependencies": {
"react-dom": "*",
Expand Down
21 changes: 20 additions & 1 deletion addons/storyshots/storyshots-core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ NOTICE that When using the `asyncJest: true` option, you also must specify a `te

This is a really powerful technique to write stories of Relay components because it integrates data fetching with component rendering. So instead of passing data props manually, we can let Relay do the job for us as it does in our application.

Whenever you change you're data requirements by adding (and rendering) or (accidentally) deleting fields in your graphql query fragments, you'll get a different snapshot and thus an error in the StoryShot test.
Whenever you change your data requirements by adding (and rendering) or (accidentally) deleting fields in your graphql query fragments, you'll get a different snapshot and thus an error in the StoryShot test.

## Options

Expand Down Expand Up @@ -677,3 +677,22 @@ initStoryshots({
### `asyncJest`

Enables Jest `done()` callback in the StoryShots tests for async testing. See [StoryShots for async rendered components](#storyshots-for-async-rendered-components) for more info.


## Story Parameters

### `disable`

Some stories are difficult or impossible to snapshot, such as those covering components that use external DOM-modifying libraries, and those that deliberately throw errors. It is possible to skip stories like these by giving them a parameter of `storyshots: {disable: true}`. There is also a shorthand for this, `storyshots: false`.

```js
export const Exception = () => {
throw new Error('storyFn threw an error! WHOOPS');
};
Exception.story = {
name: 'story throws exception',
parameters: {
storyshots: { disable: true },
},
};
```
7 changes: 4 additions & 3 deletions addons/storyshots/storyshots-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,22 @@
"storybook": "start-storybook -p 6006"
},
"dependencies": {
"@jest/transform": "^24.9.0",
"@jest/transform": "^25.1.0",
"@storybook/addons": "6.0.0-alpha.3",
"@storybook/client-api": "6.0.0-alpha.3",
"@storybook/core": "6.0.0-alpha.3",
"@types/glob": "^7.1.1",
"@types/jest": "^24.0.16",
"@types/jest": "^25.1.1",
"@types/jest-specific-snapshot": "^0.5.3",
"babel-plugin-require-context-hook": "^1.0.0",
"core-js": "^3.0.1",
"glob": "^7.1.3",
"global": "^4.3.2",
"jest-specific-snapshot": "^2.0.0",
"pretty-format": "^25.1.0",
"read-pkg-up": "^7.0.0",
"regenerator-runtime": "^0.13.3",
"ts-dedent": "^1.1.0"
"ts-dedent": "^1.1.1"
},
"devDependencies": {
"@storybook/addon-docs": "6.0.0-alpha.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ function getIntegrityOptions({ integrityOptions }: StoryshotsOptions) {
};
}

// @ts-ignore
function ensureOptionsDefaults(options: StoryshotsOptions) {
const {
suite = 'Storyshots',
Expand All @@ -49,7 +50,7 @@ function ensureOptionsDefaults(options: StoryshotsOptions) {
testMethod,
snapshotSerializers,
integrityOptions,
};
} as any;
}

export default ensureOptionsDefaults;
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,6 @@ import glob from 'glob';
import { describe, it } from 'global';
import dedent from 'ts-dedent';

declare global {
// eslint-disable-next-line @typescript-eslint/no-namespace,no-redeclare
namespace jest {
interface Matchers<R, T> {
notToBeAbandoned(stories2snapsConverter: any): R;
}
}
}

expect.extend({
notToBeAbandoned(storyshots, stories2snapsConverter) {
const abandonedStoryshots = storyshots.filter((fileName: string) => {
Expand Down Expand Up @@ -59,6 +50,7 @@ function integrityTest(integrityOptions: any, stories2snapsConverter: any) {
const snapshotExtension = stories2snapsConverter.getSnapshotExtension();
const storyshots = glob.sync(`**/*${snapshotExtension}`, integrityOptions);

// @ts-ignore
expect(storyshots).notToBeAbandoned(stories2snapsConverter);
});
});
Expand Down
2 changes: 1 addition & 1 deletion addons/storysource/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"util-deprecate": "^1.0.2"
},
"devDependencies": {
"@types/react": "^16.9.17",
"@types/react": "^16.9.19",
"@types/react-syntax-highlighter": "^11.0.4"
},
"peerDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions app/angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@
"@storybook/addons": "6.0.0-alpha.3",
"@storybook/core": "6.0.0-alpha.3",
"@storybook/node-logger": "6.0.0-alpha.3",
"@types/webpack-env": "^1.15.0",
"@types/webpack-env": "^1.15.1",
"core-js": "^3.0.1",
"fork-ts-checker-webpack-plugin": "^3.0.1",
"fork-ts-checker-webpack-plugin": "^4.0.3",
"global": "^4.3.2",
"regenerator-runtime": "^0.13.3",
"sass-loader": "^8.0.0",
Expand Down
Loading

0 comments on commit 33864ca

Please sign in to comment.