Merge branch 'next' into core/options-in-config

This commit is contained in:
Norbert de Langen 2019-11-25 17:21:45 +01:00
commit 1ec4dd8b7c
140 changed files with 2662 additions and 2090 deletions

View File

@ -1,3 +1,49 @@
## 5.3.0-beta.7 (November 26, 2019)
### Features
* Storyshots-puppeteer: Add afterScreenshot handler ([#8092](https://github.com/storybookjs/storybook/pull/8092))
### Bug Fixes
* Core: Upgrade telejson to fix cross-origin frame error ([#8940](https://github.com/storybookjs/storybook/pull/8940))
### Maintenance
* Build: Fix image snapshots setup in official-storybook ([#8932](https://github.com/storybookjs/storybook/pull/8932))
### Dependency Upgrades
* Core: Add @babel/core peer dependency to @storybook/core ([#8933](https://github.com/storybookjs/storybook/pull/8933))
## 5.3.0-beta.6 (November 24, 2019)
### Features
* Presets: dynamic preset injection ([#8921](https://github.com/storybookjs/storybook/pull/8921))
### Bug Fixes
* Revert "feat: use `puppeteer-core` instead of `puppeteer`" ([#8925](https://github.com/storybookjs/storybook/pull/8925))
* Addon-docs: Fix props detail tooltip to prevent cutting end of content ([#8923](https://github.com/storybookjs/storybook/pull/8923))
### Maintenance
* Addon-docs: Base code to improve the props table for TS ([#8905](https://github.com/storybookjs/storybook/pull/8905))
* Build: Fix now deploy ([#8929](https://github.com/storybookjs/storybook/pull/8929))
### Dependency Upgrades
* Miscellaneous upgrades ([#8912](https://github.com/storybookjs/storybook/pull/8912))
## 5.3.0-beta.5 (November 23, 2019)
Failed npm publish
## 5.3.0-beta.4 (November 23, 2019)
Failed npm publish
## 5.3.0-beta.3 (November 21, 2019) ## 5.3.0-beta.3 (November 21, 2019)
### Features ### Features

View File

@ -187,7 +187,7 @@ If you've made a change to storybook's codebase and would want this change to be
### Updating Tests ### Updating Tests
Before any contributes are submitted in a PR, make sure to add or update meaningful tests. A PR that has failing tests will be regarded as a “Work in Progress” and will not be merged until all tests pass. Before any contributions are submitted in a PR, make sure to add or update meaningful tests. A PR that has failing tests will be regarded as a “Work in Progress” and will not be merged until all tests pass.
When creating new unit test files, the tests should adhere to a particular folder structure and naming convention, as defined below. When creating new unit test files, the tests should adhere to a particular folder structure and naming convention, as defined below.
```sh ```sh
@ -205,7 +205,7 @@ Before you submit a new PR, make sure you run `yarn test`. Do not submit a PR if
### Reviewing PRs ### Reviewing PRs
**As a PR submitter**, you should reference the issue if there is one, include a short description of what you contributed and, if it is a code change, instructions for how to manually test out the change. This is informally enforced by our [PR template](https://github.com/storybookjs/storybook/blob/master/.github/PULL_REQUEST_TEMPLATE.md). If your PR is reviewed as only needing trivial changes (e.g. small typos etc), and you have commit access, then you can merge the PR after making those changes. **As a PR submitter**, you should reference the issue if there is one, include a short description of what you contributed and, if it is a code change, instructions for how to manually test out the change. This is informally enforced by our [PR template](https://github.com/storybookjs/storybook/blob/master/.github/PULL_REQUEST_TEMPLATE.md). If your PR is reviewed as only needing trivial changes (e.g. small typos etc), and you have commit access then you can merge the PR after making those changes.
**As a PR reviewer**, you should read through the changes and comment on any potential problems. If you see something cool, a kind word never hurts either! Additionally, you should follow the testing instructions and manually test the changes. If the instructions are missing, unclear, or overly complex, feel free to request better instructions from the submitter. Unless the PR is tagged with the `do not merge` label, if you approve the review and there is no other required discussion or changes, you should also go ahead and merge the PR. **As a PR reviewer**, you should read through the changes and comment on any potential problems. If you see something cool, a kind word never hurts either! Additionally, you should follow the testing instructions and manually test the changes. If the instructions are missing, unclear, or overly complex, feel free to request better instructions from the submitter. Unless the PR is tagged with the `do not merge` label, if you approve the review and there is no other required discussion or changes, you should also go ahead and merge the PR.
@ -215,7 +215,7 @@ If you are looking for a way to help the project, triaging issues is a great pla
### Responding to issues ### Responding to issues
Issues that are tagged `question / support` or `needs reproduction` are great places to help. If you can answer a question, it will help the asker as well as anyone searching. If an issue needs reproduction, you may be able to guide the reporter toward one, or even reproduce it yourself using [this technique](https://github.com/storybookjs/storybook/blob/master/CONTRIBUTING.md#reproductions). Issues that are tagged `question / support` or `needs reproduction` are great places to help. If you can answer a question, it will help the asker as well as anyone who has a similar question. Also in the future if anyone has that same question they can easily find it by searching. If an issue needs reproduction, you may be able to guide the reporter toward one, or even reproduce it yourself using [this technique](https://github.com/storybookjs/storybook/blob/master/CONTRIBUTING.md#reproductions).
### Triaging issues ### Triaging issues

View File

@ -1,6 +1,6 @@
{ {
"name": "@storybook/addon-a11y", "name": "@storybook/addon-a11y",
"version": "5.3.0-beta.3", "version": "5.3.0-beta.7",
"description": "a11y addon for storybook", "description": "a11y addon for storybook",
"keywords": [ "keywords": [
"a11y", "a11y",
@ -33,12 +33,12 @@
"prepare": "node ../../scripts/prepare.js" "prepare": "node ../../scripts/prepare.js"
}, },
"dependencies": { "dependencies": {
"@storybook/addons": "5.3.0-beta.3", "@storybook/addons": "5.3.0-beta.7",
"@storybook/api": "5.3.0-beta.3", "@storybook/api": "5.3.0-beta.7",
"@storybook/client-logger": "5.3.0-beta.3", "@storybook/client-logger": "5.3.0-beta.7",
"@storybook/components": "5.3.0-beta.3", "@storybook/components": "5.3.0-beta.7",
"@storybook/core-events": "5.3.0-beta.3", "@storybook/core-events": "5.3.0-beta.7",
"@storybook/theming": "5.3.0-beta.3", "@storybook/theming": "5.3.0-beta.7",
"axe-core": "^3.3.2", "axe-core": "^3.3.2",
"core-js": "^3.0.1", "core-js": "^3.0.1",
"global": "^4.3.2", "global": "^4.3.2",

View File

@ -1,6 +1,6 @@
{ {
"name": "@storybook/addon-actions", "name": "@storybook/addon-actions",
"version": "5.3.0-beta.3", "version": "5.3.0-beta.7",
"description": "Action Logger addon for storybook", "description": "Action Logger addon for storybook",
"keywords": [ "keywords": [
"storybook" "storybook"
@ -28,12 +28,12 @@
"prepare": "node ../../scripts/prepare.js" "prepare": "node ../../scripts/prepare.js"
}, },
"dependencies": { "dependencies": {
"@storybook/addons": "5.3.0-beta.3", "@storybook/addons": "5.3.0-beta.7",
"@storybook/api": "5.3.0-beta.3", "@storybook/api": "5.3.0-beta.7",
"@storybook/client-api": "5.3.0-beta.3", "@storybook/client-api": "5.3.0-beta.7",
"@storybook/components": "5.3.0-beta.3", "@storybook/components": "5.3.0-beta.7",
"@storybook/core-events": "5.3.0-beta.3", "@storybook/core-events": "5.3.0-beta.7",
"@storybook/theming": "5.3.0-beta.3", "@storybook/theming": "5.3.0-beta.7",
"core-js": "^3.0.1", "core-js": "^3.0.1",
"fast-deep-equal": "^2.0.1", "fast-deep-equal": "^2.0.1",
"global": "^4.3.2", "global": "^4.3.2",
@ -44,7 +44,7 @@
"uuid": "^3.3.2" "uuid": "^3.3.2"
}, },
"devDependencies": { "devDependencies": {
"@types/lodash": "^4.14.129", "@types/lodash": "^4.14.149",
"@types/uuid": "^3.4.4" "@types/uuid": "^3.4.4"
}, },
"publishConfig": { "publishConfig": {

View File

@ -1,6 +1,6 @@
{ {
"name": "@storybook/addon-backgrounds", "name": "@storybook/addon-backgrounds",
"version": "5.3.0-beta.3", "version": "5.3.0-beta.7",
"description": "A storybook addon to show different backgrounds for your preview", "description": "A storybook addon to show different backgrounds for your preview",
"keywords": [ "keywords": [
"addon", "addon",
@ -32,12 +32,12 @@
"prepare": "node ../../scripts/prepare.js" "prepare": "node ../../scripts/prepare.js"
}, },
"dependencies": { "dependencies": {
"@storybook/addons": "5.3.0-beta.3", "@storybook/addons": "5.3.0-beta.7",
"@storybook/api": "5.3.0-beta.3", "@storybook/api": "5.3.0-beta.7",
"@storybook/client-logger": "5.3.0-beta.3", "@storybook/client-logger": "5.3.0-beta.7",
"@storybook/components": "5.3.0-beta.3", "@storybook/components": "5.3.0-beta.7",
"@storybook/core-events": "5.3.0-beta.3", "@storybook/core-events": "5.3.0-beta.7",
"@storybook/theming": "5.3.0-beta.3", "@storybook/theming": "5.3.0-beta.7",
"core-js": "^3.0.1", "core-js": "^3.0.1",
"memoizerific": "^1.11.3", "memoizerific": "^1.11.3",
"react": "^16.8.3", "react": "^16.8.3",

View File

@ -1,6 +1,6 @@
{ {
"name": "@storybook/addon-centered", "name": "@storybook/addon-centered",
"version": "5.3.0-beta.3", "version": "5.3.0-beta.7",
"description": "Storybook decorator to center components", "description": "Storybook decorator to center components",
"keywords": [ "keywords": [
"addon", "addon",
@ -29,7 +29,7 @@
"prepare": "node ../../scripts/prepare.js" "prepare": "node ../../scripts/prepare.js"
}, },
"dependencies": { "dependencies": {
"@storybook/addons": "5.3.0-beta.3", "@storybook/addons": "5.3.0-beta.7",
"core-js": "^3.0.1", "core-js": "^3.0.1",
"global": "^4.3.2", "global": "^4.3.2",
"util-deprecate": "^1.0.2" "util-deprecate": "^1.0.2"

View File

@ -1,6 +1,6 @@
{ {
"name": "@storybook/addon-contexts", "name": "@storybook/addon-contexts",
"version": "5.3.0-beta.3", "version": "5.3.0-beta.7",
"description": "Storybook Addon Contexts", "description": "Storybook Addon Contexts",
"keywords": [ "keywords": [
"preact", "preact",
@ -27,10 +27,10 @@
"prepare": "node ../../scripts/prepare.js" "prepare": "node ../../scripts/prepare.js"
}, },
"dependencies": { "dependencies": {
"@storybook/addons": "5.3.0-beta.3", "@storybook/addons": "5.3.0-beta.7",
"@storybook/api": "5.3.0-beta.3", "@storybook/api": "5.3.0-beta.7",
"@storybook/components": "5.3.0-beta.3", "@storybook/components": "5.3.0-beta.7",
"@storybook/core-events": "5.3.0-beta.3", "@storybook/core-events": "5.3.0-beta.7",
"core-js": "^3.0.1", "core-js": "^3.0.1",
"global": "^4.3.2", "global": "^4.3.2",
"qs": "^6.6.0" "qs": "^6.6.0"

View File

@ -1,6 +1,6 @@
{ {
"name": "@storybook/addon-cssresources", "name": "@storybook/addon-cssresources",
"version": "5.3.0-beta.3", "version": "5.3.0-beta.7",
"description": "A storybook addon to switch between css resources at runtime for your story", "description": "A storybook addon to switch between css resources at runtime for your story",
"keywords": [ "keywords": [
"addon", "addon",
@ -32,10 +32,10 @@
"prepare": "node ../../scripts/prepare.js" "prepare": "node ../../scripts/prepare.js"
}, },
"dependencies": { "dependencies": {
"@storybook/addons": "5.3.0-beta.3", "@storybook/addons": "5.3.0-beta.7",
"@storybook/api": "5.3.0-beta.3", "@storybook/api": "5.3.0-beta.7",
"@storybook/components": "5.3.0-beta.3", "@storybook/components": "5.3.0-beta.7",
"@storybook/core-events": "5.3.0-beta.3", "@storybook/core-events": "5.3.0-beta.7",
"core-js": "^3.0.1", "core-js": "^3.0.1",
"global": "^4.3.2", "global": "^4.3.2",
"react": "^16.8.3" "react": "^16.8.3"

View File

@ -1,6 +1,6 @@
{ {
"name": "@storybook/addon-design-assets", "name": "@storybook/addon-design-assets",
"version": "5.3.0-beta.3", "version": "5.3.0-beta.7",
"description": "Design asset preview for storybook", "description": "Design asset preview for storybook",
"keywords": [ "keywords": [
"addon", "addon",
@ -34,12 +34,12 @@
"prepare": "node ../../scripts/prepare.js" "prepare": "node ../../scripts/prepare.js"
}, },
"dependencies": { "dependencies": {
"@storybook/addons": "5.3.0-beta.3", "@storybook/addons": "5.3.0-beta.7",
"@storybook/api": "5.3.0-beta.3", "@storybook/api": "5.3.0-beta.7",
"@storybook/client-logger": "5.3.0-beta.3", "@storybook/client-logger": "5.3.0-beta.7",
"@storybook/components": "5.3.0-beta.3", "@storybook/components": "5.3.0-beta.7",
"@storybook/core-events": "5.3.0-beta.3", "@storybook/core-events": "5.3.0-beta.7",
"@storybook/theming": "5.3.0-beta.3", "@storybook/theming": "5.3.0-beta.7",
"core-js": "^3.0.1", "core-js": "^3.0.1",
"global": "^4.3.2", "global": "^4.3.2",
"react": "^16.8.3", "react": "^16.8.3",

View File

@ -1,6 +1,6 @@
{ {
"name": "@storybook/addon-docs", "name": "@storybook/addon-docs",
"version": "5.3.0-beta.3", "version": "5.3.0-beta.7",
"description": "Superior documentation for your components", "description": "Superior documentation for your components",
"keywords": [ "keywords": [
"addon", "addon",
@ -45,13 +45,13 @@
"@mdx-js/loader": "^1.1.0", "@mdx-js/loader": "^1.1.0",
"@mdx-js/mdx": "^1.1.0", "@mdx-js/mdx": "^1.1.0",
"@mdx-js/react": "^1.0.27", "@mdx-js/react": "^1.0.27",
"@storybook/addons": "5.3.0-beta.3", "@storybook/addons": "5.3.0-beta.7",
"@storybook/api": "5.3.0-beta.3", "@storybook/api": "5.3.0-beta.7",
"@storybook/components": "5.3.0-beta.3", "@storybook/components": "5.3.0-beta.7",
"@storybook/postinstall": "5.3.0-beta.3", "@storybook/postinstall": "5.3.0-beta.7",
"@storybook/router": "5.3.0-beta.3", "@storybook/router": "5.3.0-beta.7",
"@storybook/source-loader": "5.3.0-beta.3", "@storybook/source-loader": "5.3.0-beta.7",
"@storybook/theming": "5.3.0-beta.3", "@storybook/theming": "5.3.0-beta.7",
"acorn": "^7.1.0", "acorn": "^7.1.0",
"acorn-jsx": "^5.1.0", "acorn-jsx": "^5.1.0",
"acorn-walk": "^7.0.0", "acorn-walk": "^7.0.0",

View File

@ -4,6 +4,7 @@ import { PropDef } from '@storybook/components';
import { hasDocgen, extractComponentProps, PropsExtractor, TypeSystem } from '../../lib/docgen'; import { hasDocgen, extractComponentProps, PropsExtractor, TypeSystem } from '../../lib/docgen';
import { Component } from '../../blocks/shared'; import { Component } from '../../blocks/shared';
import { enhancePropTypesProps } from './propTypes/handleProp'; import { enhancePropTypesProps } from './propTypes/handleProp';
import { enhanceTypeScriptProps } from './typeScript/handleProp';
export interface PropDefMap { export interface PropDefMap {
[p: string]: PropDef; [p: string]: PropDef;
@ -37,11 +38,14 @@ function getPropDefs(component: Component, section: string): PropDef[] {
return []; return [];
} }
if (extractedProps[0].typeSystem === TypeSystem.JAVASCRIPT) { switch (extractedProps[0].typeSystem) {
return enhancePropTypesProps(extractedProps, component); case TypeSystem.JAVASCRIPT:
return enhancePropTypesProps(extractedProps, component);
case TypeSystem.TYPESCRIPT:
return enhanceTypeScriptProps(extractedProps);
default:
return extractedProps.map(x => x.propDef);
} }
return extractedProps.map(x => x.propDef);
} }
export const extractProps: PropsExtractor = component => ({ export const extractProps: PropsExtractor = component => ({

View File

@ -1,79 +0,0 @@
export enum InspectionType {
IDENTIFIER = 'Identifier',
LITERAL = 'Literal',
OBJECT = 'Object',
ARRAY = 'Array',
FUNCTION = 'Function',
CLASS = 'Class',
ELEMENT = 'Element',
UNKNOWN = 'Unknown',
}
export interface BaseInspectionInferedType {
type: InspectionType;
}
// TODO: Fix this.
// export interface OptionalIdentifierInspectionType extends BaseInspectionInferedType {
// identifier?: string;
// }
// export interface RequiredIdentifierInspectionType extends BaseInspectionInferedType {
// identifier: string;
// }
// export type IdentifiableInspectionType =
// | OptionalIdentifierInspectionType
// | RequiredIdentifierInspectionType;
export interface InspectionIdentifier extends BaseInspectionInferedType {
type: InspectionType.IDENTIFIER;
identifier: string;
}
export interface InspectionLiteral extends BaseInspectionInferedType {
type: InspectionType.LITERAL;
}
export interface InspectionObject extends BaseInspectionInferedType {
type: InspectionType.OBJECT;
}
export interface InspectionArray extends BaseInspectionInferedType {
type: InspectionType.ARRAY;
}
export interface InspectionClass extends BaseInspectionInferedType {
type: InspectionType.CLASS;
identifier: string;
}
export interface InspectionFunction extends BaseInspectionInferedType {
type: InspectionType.FUNCTION;
identifier?: string;
hasArguments: boolean;
}
export interface InspectionElement extends BaseInspectionInferedType {
type: InspectionType.ELEMENT;
identifier?: string;
}
export interface InspectionUnknown extends BaseInspectionInferedType {
type: InspectionType.UNKNOWN;
}
export type InspectionInferedType =
| InspectionIdentifier
| InspectionLiteral
| InspectionObject
| InspectionArray
| InspectionClass
| InspectionFunction
| InspectionElement
| InspectionUnknown;
export interface InspectionResult {
inferedType: InspectionInferedType;
ast?: any;
}

View File

@ -1,25 +1,32 @@
import { isNil } from 'lodash'; import { isNil } from 'lodash';
// @ts-ignore // @ts-ignore
import { PropDefaultValue } from '@storybook/components'; import { PropDefaultValue } from '@storybook/components';
import { inspectValue } from '../inspection/inspectValue'; import {
import { OBJECT_CAPTION, FUNCTION_CAPTION, ELEMENT_CAPTION, ARRAY_CAPTION } from './captions'; OBJECT_CAPTION,
FUNCTION_CAPTION,
ELEMENT_CAPTION,
ARRAY_CAPTION,
} from '../propTypes/captions';
import { generateCode } from './generateCode'; import { generateCode } from './generateCode';
import { import {
InspectionFunction, InspectionFunction,
InspectionResult, InspectionResult,
InspectionType, InspectionType,
InspectionElement, InspectionElement,
} from '../inspection/types'; InspectionIdentifiableInferedType,
inspectValue,
} from './inspection';
import { isHtmlTag } from './isHtmlTag'; import { isHtmlTag } from './isHtmlTag';
import { createSummaryValue, isTooLongForDefaultValueSummary } from '../../../lib'; import { createSummaryValue, isTooLongForDefaultValueSummary } from '../../../lib';
// TODO: Fix this any type. function getPrettyIdentifier(inferedType: InspectionIdentifiableInferedType): string {
function getPrettyIdentifier(inferedType: any): string {
const { type, identifier } = inferedType; const { type, identifier } = inferedType;
switch (type) { switch (type) {
case InspectionType.FUNCTION: case InspectionType.FUNCTION:
return inferedType.hasArguments ? `${identifier}( ... )` : `${identifier}()`; return (inferedType as InspectionFunction).hasArguments
? `${identifier}( ... )`
: `${identifier}()`;
case InspectionType.ELEMENT: case InspectionType.ELEMENT:
return `<${identifier} />`; return `<${identifier} />`;
default: default:
@ -45,7 +52,10 @@ function generateFunc({ inferedType, ast }: InspectionResult): PropDefaultValue
const { identifier } = inferedType as InspectionFunction; const { identifier } = inferedType as InspectionFunction;
if (!isNil(identifier)) { if (!isNil(identifier)) {
return createSummaryValue(getPrettyIdentifier(inferedType), generateCode(ast)); return createSummaryValue(
getPrettyIdentifier(inferedType as InspectionIdentifiableInferedType),
generateCode(ast)
);
} }
const prettyCaption = generateCode(ast, true); const prettyCaption = generateCode(ast, true);
@ -66,7 +76,9 @@ function generateElement(
if (!isNil(identifier)) { if (!isNil(identifier)) {
if (!isHtmlTag(identifier)) { if (!isHtmlTag(identifier)) {
const prettyIdentifier = getPrettyIdentifier(inferedType); const prettyIdentifier = getPrettyIdentifier(
inferedType as InspectionIdentifiableInferedType
);
return createSummaryValue( return createSummaryValue(
prettyIdentifier, prettyIdentifier,

View File

@ -7,7 +7,6 @@ import estree from 'estree';
import * as acornWalk from 'acorn-walk'; import * as acornWalk from 'acorn-walk';
import { import {
InspectionType, InspectionType,
InspectionInferedType,
InspectionLiteral, InspectionLiteral,
InspectionElement, InspectionElement,
InspectionFunction, InspectionFunction,
@ -16,6 +15,7 @@ import {
InspectionUnknown, InspectionUnknown,
InspectionIdentifier, InspectionIdentifier,
InspectionArray, InspectionArray,
InspectionInferedType,
} from './types'; } from './types';
interface ParsingResult<T> { interface ParsingResult<T> {

View File

@ -0,0 +1,2 @@
export * from './types';
export * from './inspectValue';

View File

@ -0,0 +1,62 @@
export enum InspectionType {
IDENTIFIER = 'Identifier',
LITERAL = 'Literal',
OBJECT = 'Object',
ARRAY = 'Array',
FUNCTION = 'Function',
CLASS = 'Class',
ELEMENT = 'Element',
UNKNOWN = 'Unknown',
}
export interface InspectionInferedType {
type: InspectionType;
}
export interface InspectionIdentifier extends InspectionInferedType {
type: InspectionType.IDENTIFIER;
identifier: string;
}
export interface InspectionLiteral extends InspectionInferedType {
type: InspectionType.LITERAL;
}
export interface InspectionObject extends InspectionInferedType {
type: InspectionType.OBJECT;
}
export interface InspectionArray extends InspectionInferedType {
type: InspectionType.ARRAY;
}
export interface InspectionClass extends InspectionInferedType {
type: InspectionType.CLASS;
identifier: string;
}
export interface InspectionFunction extends InspectionInferedType {
type: InspectionType.FUNCTION;
identifier?: string;
hasArguments: boolean;
}
export interface InspectionElement extends InspectionInferedType {
type: InspectionType.ELEMENT;
identifier?: string;
}
export interface InspectionUnknown extends InspectionInferedType {
type: InspectionType.UNKNOWN;
}
export type InspectionIdentifiableInferedType =
| InspectionIdentifier
| InspectionClass
| InspectionFunction
| InspectionElement;
export interface InspectionResult {
inferedType: InspectionInferedType;
ast?: any;
}

View File

@ -2,8 +2,7 @@ import { isNil } from 'lodash';
import { PropSummaryValue, PropType } from '@storybook/components'; import { PropSummaryValue, PropType } from '@storybook/components';
import { createSummaryValue, isTooLongForTypeSummary } from '../../../lib'; import { createSummaryValue, isTooLongForTypeSummary } from '../../../lib';
import { ExtractedProp, DocgenPropType } from '../../../lib/docgen'; import { ExtractedProp, DocgenPropType } from '../../../lib/docgen';
import { inspectValue } from '../inspection/inspectValue'; import { generateCode } from '../lib/generateCode';
import { generateCode } from './generateCode';
import { generateFuncSignature } from './generateFuncSignature'; import { generateFuncSignature } from './generateFuncSignature';
import { import {
OBJECT_CAPTION, OBJECT_CAPTION,
@ -13,8 +12,8 @@ import {
ELEMENT_CAPTION, ELEMENT_CAPTION,
CUSTOM_CAPTION, CUSTOM_CAPTION,
} from './captions'; } from './captions';
import { InspectionType } from '../inspection/types'; import { InspectionType, inspectValue } from '../lib/inspection';
import { isHtmlTag } from './isHtmlTag'; import { isHtmlTag } from '../lib/isHtmlTag';
enum PropTypesType { enum PropTypesType {
CUSTOM = 'custom', CUSTOM = 'custom',

View File

@ -712,7 +712,7 @@ describe('enhancePropTypesProp', () => {
docgenInfo: { docgenInfo: {
...createDocgenProp({ ...createDocgenProp({
name: 'prop', name: 'prop',
type: { name: 'custom' }, type: { name: 'anything-is-fine' },
defaultValue: { value: defaultValue }, defaultValue: { value: defaultValue },
}), }),
}, },

View File

@ -2,7 +2,7 @@ import { isNil } from 'lodash';
import { PropDef } from '@storybook/components'; import { PropDef } from '@storybook/components';
import { ExtractedProp } from '../../../lib/docgen'; import { ExtractedProp } from '../../../lib/docgen';
import { createType } from './createType'; import { createType } from './createType';
import { createDefaultValue } from './createDefaultValue'; import { createDefaultValue } from '../lib/createDefaultValue';
import { Component } from '../../../blocks/shared'; import { Component } from '../../../blocks/shared';
import { keepOriginalDefinitionOrder } from './sortProps'; import { keepOriginalDefinitionOrder } from './sortProps';

View File

@ -0,0 +1,223 @@
/* eslint-disable no-underscore-dangle */
import { PropDef } from '@storybook/components';
import { Component } from '../../../blocks/shared';
import { extractComponentProps, DocgenInfo } from '../../../lib/docgen';
import { enhanceTypeScriptProp } from './handleProp';
const DOCGEN_SECTION = 'props';
function createDocgenSection(docgenInfo: DocgenInfo): Record<string, any> {
return {
[DOCGEN_SECTION]: {
...docgenInfo,
},
};
}
function createDocgenProp({
name,
tsType,
...others
}: Partial<DocgenInfo> & { name: string }): Record<string, any> {
return {
[name]: {
tsType,
required: false,
...others,
},
};
}
// eslint-disable-next-line react/forbid-foreign-prop-types
function createComponent({ propTypes = {}, defaultProps = {}, docgenInfo = {} }): Component {
const component = () => {};
component.propTypes = propTypes;
component.defaultProps = defaultProps;
// @ts-ignore
component.__docgenInfo = createDocgenSection(docgenInfo);
return component;
}
function extractPropDef(component: Component): PropDef {
return enhanceTypeScriptProp(extractComponentProps(component, DOCGEN_SECTION)[0]);
}
describe('enhanceTypeScriptProp', () => {
describe('defaultValue', () => {
function createTestComponent(defaultValue: string): Component {
return createComponent({
docgenInfo: {
...createDocgenProp({
name: 'prop',
tsType: { name: 'anything-is-fine' },
defaultValue: { value: defaultValue },
}),
},
});
}
it('should support short object', () => {
const component = createTestComponent("{ foo: 'foo', bar: 'bar' }");
const { defaultValue } = extractPropDef(component);
const expectedSummary = "{ foo: 'foo', bar: 'bar' }";
expect(defaultValue.summary.replace(/\s/g, '')).toBe(expectedSummary.replace(/\s/g, ''));
expect(defaultValue.detail).toBeUndefined();
});
it('should support long object', () => {
const component = createTestComponent("{ foo: 'foo', bar: 'bar', another: 'another' }");
const { defaultValue } = extractPropDef(component);
expect(defaultValue.summary).toBe('object');
const expectedDetail = `{
foo: 'foo',
bar: 'bar',
another: 'another'
}`;
expect(defaultValue.detail.replace(/\s/g, '')).toBe(expectedDetail.replace(/\s/g, ''));
});
it('should support short function', () => {
const component = createTestComponent('() => {}');
const { defaultValue } = extractPropDef(component);
expect(defaultValue.summary).toBe('() => {}');
expect(defaultValue.detail).toBeUndefined();
});
it('should support long function', () => {
const component = createTestComponent(
'(foo, bar) => {\n const concat = foo + bar;\n const append = concat + " hey!";\n \n return append;\n}'
);
const { defaultValue } = extractPropDef(component);
expect(defaultValue.summary).toBe('func');
const expectedDetail = `(foo, bar) => {
const concat = foo + bar;
const append = concat + ' hey!';
return append
}`;
expect(defaultValue.detail.replace(/\s/g, '')).toBe(expectedDetail.replace(/\s/g, ''));
});
it('should use the name of function when available and indicate that args are present', () => {
const component = createTestComponent('function concat(a, b) {\n return a + b;\n}');
const { defaultValue } = extractPropDef(component);
expect(defaultValue.summary).toBe('concat( ... )');
const expectedDetail = `function concat(a, b) {
return a + b
}`;
expect(defaultValue.detail.replace(/\s/g, '')).toBe(expectedDetail.replace(/\s/g, ''));
});
it('should use the name of function when available', () => {
const component = createTestComponent('function hello() {\n return "hello";\n}');
const { defaultValue } = extractPropDef(component);
expect(defaultValue.summary).toBe('hello()');
const expectedDetail = `function hello() {
return 'hello'
}`;
expect(defaultValue.detail.replace(/\s/g, '')).toBe(expectedDetail.replace(/\s/g, ''));
});
it('should support short element', () => {
const component = createTestComponent('<div>Hey!</div>');
const { defaultValue } = extractPropDef(component);
expect(defaultValue.summary).toBe('<div>Hey!</div>');
expect(defaultValue.detail).toBeUndefined();
});
it('should support long element', () => {
const component = createTestComponent(
'() => {\n return <div>Inlined FunctionnalComponent!</div>;\n}'
);
const { defaultValue } = extractPropDef(component);
expect(defaultValue.summary).toBe('element');
const expectedDetail = `() => {
return <div>Inlined FunctionnalComponent!</div>;
}`;
expect(defaultValue.detail.replace(/\s/g, '')).toBe(expectedDetail.replace(/\s/g, ''));
});
it("should use the name of the React component when it's available", () => {
const component = createTestComponent(
'function InlinedFunctionalComponent() {\n return <div>Inlined FunctionnalComponent!</div>;\n}'
);
const { defaultValue } = extractPropDef(component);
expect(defaultValue.summary).toBe('<InlinedFunctionalComponent />');
const expectedDetail = `function InlinedFunctionalComponent() {
return <div>Inlined FunctionnalComponent!</div>;
}`;
expect(defaultValue.detail.replace(/\s/g, '')).toBe(expectedDetail.replace(/\s/g, ''));
});
it('should not use the name of an HTML element', () => {
const component = createTestComponent('<div>Hey!</div>');
const { defaultValue } = extractPropDef(component);
expect(defaultValue.summary).not.toBe('<div />');
});
it('should support short array', () => {
const component = createTestComponent('[1]');
const { defaultValue } = extractPropDef(component);
expect(defaultValue.summary).toBe('[1]');
expect(defaultValue.detail).toBeUndefined();
});
it('should support long array', () => {
const component = createTestComponent(
'[\n {\n thing: {\n id: 2,\n func: () => {},\n arr: [],\n },\n },\n]'
);
const { defaultValue } = extractPropDef(component);
expect(defaultValue.summary).toBe('array');
const expectedDetail = `[{
thing: {
id: 2,
func: () => {
},
arr: []
}
}]`;
expect(defaultValue.detail.replace(/\s/g, '')).toBe(expectedDetail.replace(/\s/g, ''));
});
});
});

View File

@ -0,0 +1,22 @@
import { isNil } from 'lodash';
import { PropDef } from '@storybook/components';
import { ExtractedProp } from '../../../lib/docgen';
import { createDefaultValue } from '../lib/createDefaultValue';
export function enhanceTypeScriptProp(extractedProp: ExtractedProp): PropDef {
const { propDef } = extractedProp;
const { defaultValue } = extractedProp.docgenInfo;
if (!isNil(defaultValue)) {
const newDefaultValue = createDefaultValue(defaultValue.value);
if (!isNil(newDefaultValue)) {
propDef.defaultValue = newDefaultValue;
}
}
return propDef;
}
export function enhanceTypeScriptProps(extractedProps: ExtractedProp[]): PropDef[] {
return extractedProps.map(enhanceTypeScriptProp);
}

View File

@ -5,6 +5,7 @@ import { JsDocParsingResult } from '../jsdocParser';
import { createSummaryValue } from '../utils'; import { createSummaryValue } from '../utils';
import { createFlowPropDef } from './flow/createPropDef'; import { createFlowPropDef } from './flow/createPropDef';
import { isDefaultValueBlacklisted } from './utils/defaultValue'; import { isDefaultValueBlacklisted } from './utils/defaultValue';
import { createTsPropDef } from './typeScript/createPropDef';
export type PropDefFactory = ( export type PropDefFactory = (
propName: string, propName: string,
@ -69,7 +70,7 @@ export const javaScriptFactory: PropDefFactory = (propName, docgenInfo, jsDocPar
}; };
export const tsFactory: PropDefFactory = (propName, docgenInfo, jsDocParsingResult) => { export const tsFactory: PropDefFactory = (propName, docgenInfo, jsDocParsingResult) => {
const propDef = createBasicPropDef(propName, docgenInfo.tsType, docgenInfo); const propDef = createTsPropDef(propName, docgenInfo);
return applyJsDocResult(propDef, jsDocParsingResult); return applyJsDocResult(propDef, jsDocParsingResult);
}; };

View File

@ -1,22 +1,13 @@
import { isNil } from 'lodash';
import { createFlowPropDef } from './createPropDef'; import { createFlowPropDef } from './createPropDef';
import { DocgenInfo, DocgenFlowType } from '../types'; import { DocgenInfo } from '../types';
const PROP_NAME = 'propName'; const PROP_NAME = 'propName';
function createDocgenInfo({ function createDocgenInfo({ flowType, ...others }: Partial<DocgenInfo>): DocgenInfo {
type,
defaultValue,
...rest
}: {
type: DocgenFlowType;
defaultValue?: string;
}): DocgenInfo {
return { return {
flowType: type, flowType,
defaultValue: !isNil(defaultValue) ? { value: defaultValue } : undefined,
required: false, required: false,
...rest, ...others,
}; };
} }
@ -25,7 +16,7 @@ describe('type', () => {
x => { x => {
it(`should support ${x}`, () => { it(`should support ${x}`, () => {
const docgenInfo = createDocgenInfo({ const docgenInfo = createDocgenInfo({
type: { name: x }, flowType: { name: x },
}); });
const { type } = createFlowPropDef(PROP_NAME, docgenInfo); const { type } = createFlowPropDef(PROP_NAME, docgenInfo);
@ -39,7 +30,7 @@ describe('type', () => {
['Array', 'Class', 'MyClass'].forEach(x => { ['Array', 'Class', 'MyClass'].forEach(x => {
it(`should support untyped ${x}`, () => { it(`should support untyped ${x}`, () => {
const docgenInfo = createDocgenInfo({ const docgenInfo = createDocgenInfo({
type: { name: x }, flowType: { name: x },
}); });
const { type } = createFlowPropDef(PROP_NAME, docgenInfo); const { type } = createFlowPropDef(PROP_NAME, docgenInfo);
@ -50,7 +41,7 @@ describe('type', () => {
it(`should support typed ${x}`, () => { it(`should support typed ${x}`, () => {
const docgenInfo = createDocgenInfo({ const docgenInfo = createDocgenInfo({
type: { flowType: {
name: x, name: x,
elements: [ elements: [
{ {
@ -70,7 +61,7 @@ describe('type', () => {
it('should support short object signature', () => { it('should support short object signature', () => {
const docgenInfo = createDocgenInfo({ const docgenInfo = createDocgenInfo({
type: { flowType: {
name: 'signature', name: 'signature',
type: 'object', type: 'object',
raw: '{ foo: string, bar?: mixed }', raw: '{ foo: string, bar?: mixed }',
@ -103,7 +94,7 @@ describe('type', () => {
it('should support long object signature', () => { it('should support long object signature', () => {
const docgenInfo = createDocgenInfo({ const docgenInfo = createDocgenInfo({
type: { flowType: {
name: 'signature', name: 'signature',
type: 'object', type: 'object',
raw: '{ (x: string): void, prop: string }', raw: '{ (x: string): void, prop: string }',
@ -147,7 +138,7 @@ describe('type', () => {
it('should support func signature', () => { it('should support func signature', () => {
const docgenInfo = createDocgenInfo({ const docgenInfo = createDocgenInfo({
type: { flowType: {
name: 'signature', name: 'signature',
type: 'function', type: 'function',
raw: '(x: string) => void', raw: '(x: string) => void',
@ -175,7 +166,7 @@ describe('type', () => {
it('should support tuple', () => { it('should support tuple', () => {
const docgenInfo = createDocgenInfo({ const docgenInfo = createDocgenInfo({
type: { flowType: {
name: 'tuple', name: 'tuple',
raw: '[foo, "value", number]', raw: '[foo, "value", number]',
elements: [ elements: [
@ -200,7 +191,7 @@ describe('type', () => {
it('should support union', () => { it('should support union', () => {
const docgenInfo = createDocgenInfo({ const docgenInfo = createDocgenInfo({
type: { flowType: {
name: 'union', name: 'union',
raw: 'number | string', raw: 'number | string',
elements: [ elements: [
@ -221,7 +212,7 @@ describe('type', () => {
it('should support intersection', () => { it('should support intersection', () => {
const docgenInfo = createDocgenInfo({ const docgenInfo = createDocgenInfo({
type: { flowType: {
name: 'intersection', name: 'intersection',
raw: 'number & string', raw: 'number & string',
elements: [ elements: [

View File

@ -0,0 +1,17 @@
import { PropDefaultValue } from '@storybook/components';
import { isNil } from 'lodash';
import { DocgenInfo } from '../types';
import { createSummaryValue } from '../../utils';
import { isDefaultValueBlacklisted } from '../utils/defaultValue';
export function createDefaultValue({ tsType, defaultValue }: DocgenInfo): PropDefaultValue {
if (!isNil(defaultValue)) {
const { value } = defaultValue;
if (!isDefaultValueBlacklisted(value)) {
return createSummaryValue(value);
}
}
return null;
}

View File

@ -0,0 +1,26 @@
import { createTsPropDef } from './createPropDef';
import { DocgenInfo } from '../types';
const PROP_NAME = 'propName';
function createDocgenInfo({ tsType, ...others }: Partial<DocgenInfo>): DocgenInfo {
return {
tsType,
required: true,
...others,
};
}
describe('type', () => {
it("should remove ' | undefined' from optional props type", () => {
const docgenInfo = createDocgenInfo({
tsType: { name: 'string | undefined' },
required: false,
});
const { type } = createTsPropDef(PROP_NAME, docgenInfo);
expect(type.summary).toBe('string');
expect(type.detail).toBeUndefined();
});
});

View File

@ -0,0 +1,15 @@
import { PropDefFactory } from '../createPropDef';
import { createType } from './createType';
import { createDefaultValue } from './createDefaultValue';
export const createTsPropDef: PropDefFactory = (propName, docgenInfo) => {
const { description, required } = docgenInfo;
return {
name: propName,
type: createType(docgenInfo),
required,
description,
defaultValue: createDefaultValue(docgenInfo),
};
};

View File

@ -0,0 +1,11 @@
import { PropType } from '@storybook/components';
import { DocgenInfo } from '../types';
import { createSummaryValue } from '../../utils';
export function createType({ tsType, required }: DocgenInfo): PropType {
if (!required) {
return createSummaryValue(tsType.name.replace(' | undefined', ''));
}
return createSummaryValue(tsType.name);
}

View File

@ -3,19 +3,19 @@ import { Component } from '../../blocks/shared';
export type PropsExtractor = (component: Component) => PropsTableProps | null; export type PropsExtractor = (component: Component) => PropsTableProps | null;
export interface DocgenBaseType { export interface DocgenType {
name: string; name: string;
description?: string; description?: string;
require?: boolean; required?: boolean;
} }
export interface DocgenPropType extends DocgenBaseType { export interface DocgenPropType extends DocgenType {
value?: any; value?: any;
raw?: string; raw?: string;
computed?: boolean; computed?: boolean;
} }
export interface DocgenFlowType extends DocgenBaseType { export interface DocgenFlowType extends DocgenType {
type?: string; type?: string;
raw?: string; raw?: string;
signature?: any; signature?: any;
@ -23,9 +23,9 @@ export interface DocgenFlowType extends DocgenBaseType {
} }
// eslint-disable-next-line @typescript-eslint/no-empty-interface // eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface DocgenTypeScriptType extends DocgenBaseType {} export interface DocgenTypeScriptType extends DocgenType {}
export type DocgenType = DocgenPropType | DocgenFlowType | DocgenTypeScriptType; // export type DocgenType = DocgenPropType | DocgenFlowType | DocgenTypeScriptType;
export interface DocgenPropDefaultValue { export interface DocgenPropDefaultValue {
value: string; value: string;

View File

@ -1,6 +1,6 @@
{ {
"name": "@storybook/addon-events", "name": "@storybook/addon-events",
"version": "5.3.0-beta.3", "version": "5.3.0-beta.7",
"description": "Add events to your Storybook stories.", "description": "Add events to your Storybook stories.",
"keywords": [ "keywords": [
"addon", "addon",
@ -31,11 +31,11 @@
"prepare": "node ../../scripts/prepare.js" "prepare": "node ../../scripts/prepare.js"
}, },
"dependencies": { "dependencies": {
"@storybook/addons": "5.3.0-beta.3", "@storybook/addons": "5.3.0-beta.7",
"@storybook/api": "5.3.0-beta.3", "@storybook/api": "5.3.0-beta.7",
"@storybook/client-api": "5.3.0-beta.3", "@storybook/client-api": "5.3.0-beta.7",
"@storybook/core-events": "5.3.0-beta.3", "@storybook/core-events": "5.3.0-beta.7",
"@storybook/theming": "5.3.0-beta.3", "@storybook/theming": "5.3.0-beta.7",
"core-js": "^3.0.1", "core-js": "^3.0.1",
"format-json": "^1.0.3", "format-json": "^1.0.3",
"lodash": "^4.17.15", "lodash": "^4.17.15",

View File

@ -1,6 +1,6 @@
{ {
"name": "@storybook/addon-google-analytics", "name": "@storybook/addon-google-analytics",
"version": "5.3.0-beta.3", "version": "5.3.0-beta.7",
"description": "Storybook addon for google analytics", "description": "Storybook addon for google analytics",
"keywords": [ "keywords": [
"addon", "addon",
@ -20,8 +20,8 @@
"prepare": "node ../../scripts/prepare.js" "prepare": "node ../../scripts/prepare.js"
}, },
"dependencies": { "dependencies": {
"@storybook/addons": "5.3.0-beta.3", "@storybook/addons": "5.3.0-beta.7",
"@storybook/core-events": "5.3.0-beta.3", "@storybook/core-events": "5.3.0-beta.7",
"core-js": "^3.0.1", "core-js": "^3.0.1",
"global": "^4.3.2", "global": "^4.3.2",
"react-ga": "^2.5.7" "react-ga": "^2.5.7"

View File

@ -1,6 +1,6 @@
{ {
"name": "@storybook/addon-graphql", "name": "@storybook/addon-graphql",
"version": "5.3.0-beta.3", "version": "5.3.0-beta.7",
"description": "Storybook addon to display the GraphiQL IDE", "description": "Storybook addon to display the GraphiQL IDE",
"keywords": [ "keywords": [
"addon", "addon",
@ -29,8 +29,8 @@
"prepare": "node ../../scripts/prepare.js" "prepare": "node ../../scripts/prepare.js"
}, },
"dependencies": { "dependencies": {
"@storybook/addons": "5.3.0-beta.3", "@storybook/addons": "5.3.0-beta.7",
"@storybook/api": "5.3.0-beta.3", "@storybook/api": "5.3.0-beta.7",
"core-js": "^3.0.1", "core-js": "^3.0.1",
"global": "^4.3.2", "global": "^4.3.2",
"graphiql": "^0.16.0", "graphiql": "^0.16.0",

View File

@ -1,6 +1,6 @@
{ {
"name": "@storybook/addon-info", "name": "@storybook/addon-info",
"version": "5.3.0-beta.3", "version": "5.3.0-beta.7",
"description": "A Storybook addon to show additional information for your stories.", "description": "A Storybook addon to show additional information for your stories.",
"keywords": [ "keywords": [
"addon", "addon",
@ -28,10 +28,10 @@
"prepare": "node ../../scripts/prepare.js" "prepare": "node ../../scripts/prepare.js"
}, },
"dependencies": { "dependencies": {
"@storybook/addons": "5.3.0-beta.3", "@storybook/addons": "5.3.0-beta.7",
"@storybook/client-logger": "5.3.0-beta.3", "@storybook/client-logger": "5.3.0-beta.7",
"@storybook/components": "5.3.0-beta.3", "@storybook/components": "5.3.0-beta.7",
"@storybook/theming": "5.3.0-beta.3", "@storybook/theming": "5.3.0-beta.7",
"core-js": "^3.0.1", "core-js": "^3.0.1",
"global": "^4.3.2", "global": "^4.3.2",
"marksy": "^7.0.0", "marksy": "^7.0.0",

View File

@ -1,6 +1,6 @@
{ {
"name": "@storybook/addon-jest", "name": "@storybook/addon-jest",
"version": "5.3.0-beta.3", "version": "5.3.0-beta.7",
"description": "React storybook addon that show component jest report", "description": "React storybook addon that show component jest report",
"keywords": [ "keywords": [
"addon", "addon",
@ -35,11 +35,11 @@
"prepare": "node ../../scripts/prepare.js" "prepare": "node ../../scripts/prepare.js"
}, },
"dependencies": { "dependencies": {
"@storybook/addons": "5.3.0-beta.3", "@storybook/addons": "5.3.0-beta.7",
"@storybook/api": "5.3.0-beta.3", "@storybook/api": "5.3.0-beta.7",
"@storybook/components": "5.3.0-beta.3", "@storybook/components": "5.3.0-beta.7",
"@storybook/core-events": "5.3.0-beta.3", "@storybook/core-events": "5.3.0-beta.7",
"@storybook/theming": "5.3.0-beta.3", "@storybook/theming": "5.3.0-beta.7",
"core-js": "^3.0.1", "core-js": "^3.0.1",
"global": "^4.3.2", "global": "^4.3.2",
"react": "^16.8.3", "react": "^16.8.3",

View File

@ -1,6 +1,6 @@
{ {
"name": "@storybook/addon-knobs", "name": "@storybook/addon-knobs",
"version": "5.3.0-beta.3", "version": "5.3.0-beta.7",
"description": "Storybook Addon Prop Editor Component", "description": "Storybook Addon Prop Editor Component",
"keywords": [ "keywords": [
"addon", "addon",
@ -29,12 +29,12 @@
"prepare": "node ../../scripts/prepare.js" "prepare": "node ../../scripts/prepare.js"
}, },
"dependencies": { "dependencies": {
"@storybook/addons": "5.3.0-beta.3", "@storybook/addons": "5.3.0-beta.7",
"@storybook/api": "5.3.0-beta.3", "@storybook/api": "5.3.0-beta.7",
"@storybook/client-api": "5.3.0-beta.3", "@storybook/client-api": "5.3.0-beta.7",
"@storybook/components": "5.3.0-beta.3", "@storybook/components": "5.3.0-beta.7",
"@storybook/core-events": "5.3.0-beta.3", "@storybook/core-events": "5.3.0-beta.7",
"@storybook/theming": "5.3.0-beta.3", "@storybook/theming": "5.3.0-beta.7",
"@types/react-color": "^3.0.1", "@types/react-color": "^3.0.1",
"copy-to-clipboard": "^3.0.8", "copy-to-clipboard": "^3.0.8",
"core-js": "^3.0.1", "core-js": "^3.0.1",

View File

@ -1,6 +1,6 @@
{ {
"name": "@storybook/addon-links", "name": "@storybook/addon-links",
"version": "5.3.0-beta.3", "version": "5.3.0-beta.7",
"description": "Story Links addon for storybook", "description": "Story Links addon for storybook",
"keywords": [ "keywords": [
"addon", "addon",
@ -29,10 +29,10 @@
"prepare": "node ../../scripts/prepare.js" "prepare": "node ../../scripts/prepare.js"
}, },
"dependencies": { "dependencies": {
"@storybook/addons": "5.3.0-beta.3", "@storybook/addons": "5.3.0-beta.7",
"@storybook/client-logger": "5.3.0-beta.3", "@storybook/client-logger": "5.3.0-beta.7",
"@storybook/core-events": "5.3.0-beta.3", "@storybook/core-events": "5.3.0-beta.7",
"@storybook/router": "5.3.0-beta.3", "@storybook/router": "5.3.0-beta.7",
"core-js": "^3.0.1", "core-js": "^3.0.1",
"global": "^4.3.2", "global": "^4.3.2",
"prop-types": "^15.7.2", "prop-types": "^15.7.2",

View File

@ -1,6 +1,6 @@
{ {
"name": "@storybook/addon-notes", "name": "@storybook/addon-notes",
"version": "5.3.0-beta.3", "version": "5.3.0-beta.7",
"description": "Write notes for your Storybook stories.", "description": "Write notes for your Storybook stories.",
"keywords": [ "keywords": [
"addon", "addon",
@ -30,13 +30,13 @@
"prepare": "node ../../scripts/prepare.js" "prepare": "node ../../scripts/prepare.js"
}, },
"dependencies": { "dependencies": {
"@storybook/addons": "5.3.0-beta.3", "@storybook/addons": "5.3.0-beta.7",
"@storybook/api": "5.3.0-beta.3", "@storybook/api": "5.3.0-beta.7",
"@storybook/client-logger": "5.3.0-beta.3", "@storybook/client-logger": "5.3.0-beta.7",
"@storybook/components": "5.3.0-beta.3", "@storybook/components": "5.3.0-beta.7",
"@storybook/core-events": "5.3.0-beta.3", "@storybook/core-events": "5.3.0-beta.7",
"@storybook/router": "5.3.0-beta.3", "@storybook/router": "5.3.0-beta.7",
"@storybook/theming": "5.3.0-beta.3", "@storybook/theming": "5.3.0-beta.7",
"core-js": "^3.0.1", "core-js": "^3.0.1",
"global": "^4.3.2", "global": "^4.3.2",
"markdown-to-jsx": "^6.10.3", "markdown-to-jsx": "^6.10.3",

View File

@ -1,6 +1,6 @@
{ {
"name": "@storybook/addon-ondevice-actions", "name": "@storybook/addon-ondevice-actions",
"version": "5.3.0-beta.3", "version": "5.3.0-beta.7",
"description": "Action Logger addon for react-native storybook", "description": "Action Logger addon for react-native storybook",
"keywords": [ "keywords": [
"storybook" "storybook"
@ -26,13 +26,13 @@
"prepare": "node ../../scripts/prepare.js" "prepare": "node ../../scripts/prepare.js"
}, },
"dependencies": { "dependencies": {
"@storybook/addons": "5.3.0-beta.3", "@storybook/addons": "5.3.0-beta.7",
"@storybook/core-events": "5.3.0-beta.3", "@storybook/core-events": "5.3.0-beta.7",
"core-js": "^3.0.1", "core-js": "^3.0.1",
"fast-deep-equal": "^2.0.1" "fast-deep-equal": "^2.0.1"
}, },
"devDependencies": { "devDependencies": {
"@storybook/addon-actions": "5.3.0-beta.3" "@storybook/addon-actions": "5.3.0-beta.7"
}, },
"peerDependencies": { "peerDependencies": {
"@storybook/addon-actions": "*", "@storybook/addon-actions": "*",

View File

@ -1,6 +1,6 @@
{ {
"name": "@storybook/addon-ondevice-backgrounds", "name": "@storybook/addon-ondevice-backgrounds",
"version": "5.3.0-beta.3", "version": "5.3.0-beta.7",
"description": "A react-native storybook addon to show different backgrounds for your preview", "description": "A react-native storybook addon to show different backgrounds for your preview",
"keywords": [ "keywords": [
"addon", "addon",
@ -31,9 +31,9 @@
"prepare": "node ../../scripts/prepare.js" "prepare": "node ../../scripts/prepare.js"
}, },
"dependencies": { "dependencies": {
"@storybook/addons": "5.3.0-beta.3", "@storybook/addons": "5.3.0-beta.7",
"@storybook/api": "5.3.0-beta.3", "@storybook/api": "5.3.0-beta.7",
"@storybook/client-api": "5.3.0-beta.3", "@storybook/client-api": "5.3.0-beta.7",
"core-js": "^3.0.1", "core-js": "^3.0.1",
"prop-types": "^15.7.2" "prop-types": "^15.7.2"
}, },

View File

@ -1,6 +1,6 @@
{ {
"name": "@storybook/addon-ondevice-knobs", "name": "@storybook/addon-ondevice-knobs",
"version": "5.3.0-beta.3", "version": "5.3.0-beta.7",
"description": "Display storybook story knobs on your deviced.", "description": "Display storybook story knobs on your deviced.",
"keywords": [ "keywords": [
"addon", "addon",
@ -28,8 +28,8 @@
}, },
"dependencies": { "dependencies": {
"@emotion/native": "^10.0.14", "@emotion/native": "^10.0.14",
"@storybook/addons": "5.3.0-beta.3", "@storybook/addons": "5.3.0-beta.7",
"@storybook/core-events": "5.3.0-beta.3", "@storybook/core-events": "5.3.0-beta.7",
"core-js": "^3.0.1", "core-js": "^3.0.1",
"deep-equal": "^1.0.1", "deep-equal": "^1.0.1",
"prop-types": "^15.7.2", "prop-types": "^15.7.2",

View File

@ -1,6 +1,6 @@
{ {
"name": "@storybook/addon-ondevice-notes", "name": "@storybook/addon-ondevice-notes",
"version": "5.3.0-beta.3", "version": "5.3.0-beta.7",
"description": "Write notes for your react-native Storybook stories.", "description": "Write notes for your react-native Storybook stories.",
"keywords": [ "keywords": [
"addon", "addon",
@ -28,11 +28,11 @@
}, },
"dependencies": { "dependencies": {
"@emotion/core": "^10.0.20", "@emotion/core": "^10.0.20",
"@storybook/addons": "5.3.0-beta.3", "@storybook/addons": "5.3.0-beta.7",
"@storybook/api": "5.3.0-beta.3", "@storybook/api": "5.3.0-beta.7",
"@storybook/client-api": "5.3.0-beta.3", "@storybook/client-api": "5.3.0-beta.7",
"@storybook/client-logger": "5.3.0-beta.3", "@storybook/client-logger": "5.3.0-beta.7",
"@storybook/core-events": "5.3.0-beta.3", "@storybook/core-events": "5.3.0-beta.7",
"core-js": "^3.0.1", "core-js": "^3.0.1",
"prop-types": "^15.7.2", "prop-types": "^15.7.2",
"react-native-simple-markdown": "^1.1.0" "react-native-simple-markdown": "^1.1.0"

View File

@ -1,6 +1,6 @@
{ {
"name": "@storybook/addon-options", "name": "@storybook/addon-options",
"version": "5.3.0-beta.3", "version": "5.3.0-beta.7",
"description": "Options addon for storybook", "description": "Options addon for storybook",
"keywords": [ "keywords": [
"addon", "addon",
@ -29,7 +29,7 @@
"prepare": "node ../../scripts/prepare.js" "prepare": "node ../../scripts/prepare.js"
}, },
"dependencies": { "dependencies": {
"@storybook/addons": "5.3.0-beta.3", "@storybook/addons": "5.3.0-beta.7",
"core-js": "^3.0.1", "core-js": "^3.0.1",
"util-deprecate": "^1.0.2" "util-deprecate": "^1.0.2"
}, },

View File

@ -1,6 +1,6 @@
{ {
"name": "@storybook/addon-queryparams", "name": "@storybook/addon-queryparams",
"version": "5.3.0-beta.3", "version": "5.3.0-beta.7",
"description": "parameter addon for storybook", "description": "parameter addon for storybook",
"keywords": [ "keywords": [
"addon", "addon",
@ -30,12 +30,12 @@
"prepare": "node ../../scripts/prepare.js" "prepare": "node ../../scripts/prepare.js"
}, },
"dependencies": { "dependencies": {
"@storybook/addons": "5.3.0-beta.3", "@storybook/addons": "5.3.0-beta.7",
"@storybook/api": "5.3.0-beta.3", "@storybook/api": "5.3.0-beta.7",
"@storybook/client-logger": "5.3.0-beta.3", "@storybook/client-logger": "5.3.0-beta.7",
"@storybook/components": "5.3.0-beta.3", "@storybook/components": "5.3.0-beta.7",
"@storybook/core-events": "5.3.0-beta.3", "@storybook/core-events": "5.3.0-beta.7",
"@storybook/theming": "5.3.0-beta.3", "@storybook/theming": "5.3.0-beta.7",
"core-js": "^3.0.1", "core-js": "^3.0.1",
"global": "^4.3.2", "global": "^4.3.2",
"qs": "^6.6.0", "qs": "^6.6.0",

View File

@ -1,6 +1,6 @@
{ {
"name": "@storybook/addon-storyshots", "name": "@storybook/addon-storyshots",
"version": "5.3.0-beta.3", "version": "5.3.0-beta.7",
"description": "StoryShots is a Jest Snapshot Testing Addon for Storybook.", "description": "StoryShots is a Jest Snapshot Testing Addon for Storybook.",
"keywords": [ "keywords": [
"addon", "addon",
@ -33,11 +33,13 @@
}, },
"dependencies": { "dependencies": {
"@jest/transform": "^24.9.0", "@jest/transform": "^24.9.0",
"@storybook/addons": "5.3.0-beta.3", "@storybook/addons": "5.3.0-beta.7",
"@storybook/client-api": "5.3.0-beta.3", "@storybook/client-api": "5.3.0-beta.7",
"@storybook/core": "5.3.0-beta.7",
"@types/glob": "^7.1.1", "@types/glob": "^7.1.1",
"@types/jest": "^24.0.16", "@types/jest": "^24.0.16",
"@types/jest-specific-snapshot": "^0.5.3", "@types/jest-specific-snapshot": "^0.5.3",
"babel-plugin-require-context-hook": "^1.0.0",
"core-js": "^3.0.1", "core-js": "^3.0.1",
"glob": "^7.1.3", "glob": "^7.1.3",
"global": "^4.3.2", "global": "^4.3.2",
@ -47,8 +49,8 @@
"ts-dedent": "^1.1.0" "ts-dedent": "^1.1.0"
}, },
"devDependencies": { "devDependencies": {
"@storybook/addon-docs": "5.3.0-beta.3", "@storybook/addon-docs": "5.3.0-beta.7",
"@storybook/react": "5.3.0-beta.3", "@storybook/react": "5.3.0-beta.7",
"babel-loader": "^8.0.6", "babel-loader": "^8.0.6",
"enzyme-to-json": "^3.4.1", "enzyme-to-json": "^3.4.1",
"jest-emotion": "^10.0.17", "jest-emotion": "^10.0.17",

View File

@ -12,11 +12,11 @@ type TestMethod = 'beforeAll' | 'beforeEach' | 'afterEach' | 'afterAll';
const methods: TestMethod[] = ['beforeAll', 'beforeEach', 'afterEach', 'afterAll']; const methods: TestMethod[] = ['beforeAll', 'beforeEach', 'afterEach', 'afterAll'];
function callTestMethodGlobals( function callTestMethodGlobals(
testMethod: { [key in TestMethod]?: Function } & { [key in string]: any } testMethod: { [key in TestMethod]?: Function & { timeout?: number } } & { [key in string]: any }
) { ) {
methods.forEach(method => { methods.forEach(method => {
if (typeof testMethod[method] === 'function') { if (typeof testMethod[method] === 'function') {
global[method](testMethod[method]); global[method](testMethod[method], testMethod[method].timeout);
} }
}); });
} }

View File

@ -18,15 +18,19 @@ function snapshotTest({ item, asyncJest, framework, testMethod, testMethodParams
context, context,
...testMethodParams, ...testMethodParams,
}) })
) ),
testMethod.timeout
); );
} else { } else {
it(name, () => it(
testMethod({ name,
story: item, () =>
context, testMethod({
...testMethodParams, story: item,
}) context,
...testMethodParams,
}),
testMethod.timeout
); );
} }
} }

View File

@ -1,9 +1,13 @@
import fs from 'fs'; import fs from 'fs';
import path from 'path'; import path from 'path';
import glob from 'glob'; import { toRequireContext } from '@storybook/core/server';
import registerRequireContextHook from 'babel-plugin-require-context-hook/register';
import global from 'global';
import { ClientApi } from './Loader'; import { ClientApi } from './Loader';
import { StoryshotsOptions } from '../api/StoryshotsOptions'; import { StoryshotsOptions } from '../api/StoryshotsOptions';
registerRequireContextHook();
const isFile = (file: string): boolean => { const isFile = (file: string): boolean => {
try { try {
return fs.lstatSync(file).isFile(); return fs.lstatSync(file).isFile();
@ -64,9 +68,18 @@ function getConfigPathParts(input: string): Output {
if (main) { if (main) {
const { stories = [] } = require.requireActual(main); const { stories = [] } = require.requireActual(main);
const result = stories.reduce((acc: string[], i: string) => [...acc, ...glob.sync(i)], []); output.stories = stories.map(
(pattern: string | { path: string; recursive: boolean; match: string }) => {
output.stories = result; const { path: basePath, recursive, match } = toRequireContext(pattern);
// eslint-disable-next-line no-underscore-dangle
return global.__requireContext(
configDir,
basePath,
recursive,
new RegExp(match.slice(1, -1))
);
}
);
} }
return output; return output;
@ -94,8 +107,7 @@ function configure(
}); });
if (stories && stories.length) { if (stories && stories.length) {
// eslint-disable-next-line global-require, import/no-dynamic-require storybook.configure(stories, false);
storybook.configure(() => stories.map(f => require(f)), false);
} }
} }

View File

@ -2,3 +2,5 @@ declare module 'global';
declare module 'jest-preset-angular/*'; declare module 'jest-preset-angular/*';
declare module 'preact-render-to-json'; declare module 'preact-render-to-json';
declare module 'react-test-renderer*'; declare module 'react-test-renderer*';
declare module '@storybook/core/server';
declare module 'babel-plugin-require-context-hook/register';

View File

@ -67,7 +67,7 @@ initStoryshots({
### Specifying options to _jest-image-snapshots_ ### Specifying options to _jest-image-snapshots_
If you wish to customize [jest-image-snapshot](https://github.com/americanexpress/jest-image-snapshot), then you can provide a `getMatchOptions` parameter that should return the options config object. Additionally, you can provide `beforeScreenshot` which is called before the screenshot is captured. If you wish to customize [jest-image-snapshot](https://github.com/americanexpress/jest-image-snapshot), then you can provide a `getMatchOptions` parameter that should return the options config object. Additionally, you can provide `beforeScreenshot` which is called before the screenshot is captured and a `afterScreenshot` handler which is called after the screenshot and receives the just created image.
```js ```js
import initStoryshots from '@storybook/addon-storyshots'; import initStoryshots from '@storybook/addon-storyshots';
@ -85,9 +85,16 @@ const beforeScreenshot = (page, { context: { kind, story }, url }) => {
}, 600) }, 600)
); );
}; };
const afterScreenshot = ({ image, context }) => {
return new Promise(resolve =>
setTimeout(() => {
resolve();
}, 600)
);
};
initStoryshots({ initStoryshots({
suite: 'Image storyshots', suite: 'Image storyshots',
test: imageSnapshot({ storybookUrl: 'http://localhost:6006', getMatchOptions, beforeScreenshot }), test: imageSnapshot({ storybookUrl: 'http://localhost:6006', getMatchOptions, beforeScreenshot, afterScreenshot }),
}); });
``` ```
@ -95,6 +102,8 @@ initStoryshots({
`beforeScreenshot` receives the [Puppeteer page instance](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#class-page) and an object: `{ context: {kind, story}, url}`. _kind_ is the kind of the story and the _story_ its name. _url_ is the URL the browser will use to screenshot. `beforeScreenshot` is part of the promise chain and is called after the browser navigation is completed but before the screenshot is taken. It allows for triggering events on the page elements and delaying the screenshot and can be used avoid regressions due to mounting animations. `beforeScreenshot` receives the [Puppeteer page instance](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#class-page) and an object: `{ context: {kind, story}, url}`. _kind_ is the kind of the story and the _story_ its name. _url_ is the URL the browser will use to screenshot. `beforeScreenshot` is part of the promise chain and is called after the browser navigation is completed but before the screenshot is taken. It allows for triggering events on the page elements and delaying the screenshot and can be used avoid regressions due to mounting animations.
`afterScreenshot` receives the created image from puppeteer.
### Specifying options to _goto()_ (puppeteer API) ### Specifying options to _goto()_ (puppeteer API)
You might use `getGotoOptions` to specify options when the storybook is navigating to a story (using the `goto` method). Will be passed to [Puppeteer .goto() fn](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#pagegotourl-options) You might use `getGotoOptions` to specify options when the storybook is navigating to a story (using the `goto` method). Will be passed to [Puppeteer .goto() fn](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#pagegotourl-options)
@ -196,6 +205,11 @@ initStoryshots({
}); });
``` ```
### Specifying setup and tests timeout
By default, `@storybook/addon-storyshots-puppeteer` uses 15 second timeouts for browser setup and test functions.
Those can be customized with `setupTimeout` and `testTimeout` parameters.
### Integrate image storyshots with regular app ### Integrate image storyshots with regular app
You may want to use another Jest project to run your image snapshots as they require more resources: Chrome and Storybook built/served. You may want to use another Jest project to run your image snapshots as they require more resources: Chrome and Storybook built/served.

View File

@ -1,6 +1,6 @@
{ {
"name": "@storybook/addon-storyshots-puppeteer", "name": "@storybook/addon-storyshots-puppeteer",
"version": "5.3.0-beta.3", "version": "5.3.0-beta.7",
"description": "Image snapshots addition to StoryShots based on puppeteer", "description": "Image snapshots addition to StoryShots based on puppeteer",
"keywords": [ "keywords": [
"addon", "addon",
@ -29,19 +29,26 @@
"prepare": "node ../../../scripts/prepare.js" "prepare": "node ../../../scripts/prepare.js"
}, },
"dependencies": { "dependencies": {
"@storybook/node-logger": "5.3.0-beta.3", "@storybook/node-logger": "5.3.0-beta.7",
"@storybook/router": "5.3.0-beta.3", "@storybook/router": "5.3.0-beta.7",
"@types/jest-image-snapshot": "^2.8.0", "@types/jest-image-snapshot": "^2.8.0",
"@types/puppeteer-core": "^1.9.0",
"core-js": "^3.0.1", "core-js": "^3.0.1",
"jest-image-snapshot": "^2.8.2", "jest-image-snapshot": "^2.8.2",
"puppeteer-core": "^2.0.0",
"regenerator-runtime": "^0.13.3" "regenerator-runtime": "^0.13.3"
}, },
"devDependencies": {
"@types/puppeteer": "^2.0.0"
},
"peerDependencies": { "peerDependencies": {
"@storybook/addon-storyshots": "5.3.0-beta.1" "@storybook/addon-storyshots": "5.3.0-beta.3",
"puppeteer": "^1.12.2 || ^2.0.0"
}, },
"publishConfig": { "publishConfig": {
"access": "public" "access": "public"
},
"peerDependenciesMeta": {
"puppeteer": {
"optional": true
}
} }
} }

View File

@ -1,5 +1,5 @@
import { MatchImageSnapshotOptions } from 'jest-image-snapshot'; import { MatchImageSnapshotOptions } from 'jest-image-snapshot';
import { Base64ScreenShotOptions, Browser, DirectNavigationOptions, Page } from 'puppeteer-core'; import { Base64ScreenShotOptions, Browser, DirectNavigationOptions, Page } from 'puppeteer';
export interface Context { export interface Context {
kind: string; kind: string;
@ -11,8 +11,11 @@ export interface ImageSnapshotConfig {
chromeExecutablePath: string; chromeExecutablePath: string;
getMatchOptions: (options: { context: Context; url: string }) => MatchImageSnapshotOptions; getMatchOptions: (options: { context: Context; url: string }) => MatchImageSnapshotOptions;
getScreenshotOptions: (options: { context: Context; url: string }) => Base64ScreenShotOptions; getScreenshotOptions: (options: { context: Context; url: string }) => Base64ScreenShotOptions;
afterScreenshot: (options: { image: string; context: Context }) => void;
beforeScreenshot: (page: Page, options: { context: Context; url: string }) => void; beforeScreenshot: (page: Page, options: { context: Context; url: string }) => void;
getGotoOptions: (options: { context: Context; url: string }) => DirectNavigationOptions; getGotoOptions: (options: { context: Context; url: string }) => DirectNavigationOptions;
customizePage: (page: Page) => Promise<void>; customizePage: (page: Page) => Promise<void>;
getCustomBrowser: () => Promise<Browser>; getCustomBrowser: () => Promise<Browser>;
setupTimeout: number;
testTimeout: number;
} }

View File

@ -1,4 +1,4 @@
import puppeteer, { Browser, Page } from 'puppeteer-core'; import { Browser, Page } from 'puppeteer';
import { toMatchImageSnapshot } from 'jest-image-snapshot'; import { toMatchImageSnapshot } from 'jest-image-snapshot';
import { logger } from '@storybook/node-logger'; import { logger } from '@storybook/node-logger';
import { constructUrl } from './url'; import { constructUrl } from './url';
@ -18,9 +18,12 @@ const defaultConfig: ImageSnapshotConfig = {
getMatchOptions: noop, getMatchOptions: noop,
getScreenshotOptions: defaultScreenshotOptions, getScreenshotOptions: defaultScreenshotOptions,
beforeScreenshot: noop, beforeScreenshot: noop,
afterScreenshot: noop,
getGotoOptions: noop, getGotoOptions: noop,
customizePage: asyncNoop, customizePage: asyncNoop,
getCustomBrowser: undefined, getCustomBrowser: undefined,
setupTimeout: 15000,
testTimeout: 15000,
}; };
export const imageSnapshot = (customConfig: Partial<ImageSnapshotConfig> = {}) => { export const imageSnapshot = (customConfig: Partial<ImageSnapshotConfig> = {}) => {
@ -30,9 +33,12 @@ export const imageSnapshot = (customConfig: Partial<ImageSnapshotConfig> = {}) =
getMatchOptions, getMatchOptions,
getScreenshotOptions, getScreenshotOptions,
beforeScreenshot, beforeScreenshot,
afterScreenshot,
getGotoOptions, getGotoOptions,
customizePage, customizePage,
getCustomBrowser, getCustomBrowser,
setupTimeout,
testTimeout,
} = { ...defaultConfig, ...customConfig }; } = { ...defaultConfig, ...customConfig };
let browser: Browser; // holds ref to browser. (ie. Chrome) let browser: Browser; // holds ref to browser. (ie. Chrome)
@ -66,6 +72,7 @@ export const imageSnapshot = (customConfig: Partial<ImageSnapshotConfig> = {}) =
await page.goto(url, getGotoOptions({ context, url })); await page.goto(url, getGotoOptions({ context, url }));
await beforeScreenshot(page, { context, url }); await beforeScreenshot(page, { context, url });
image = await page.screenshot(getScreenshotOptions({ context, url })); image = await page.screenshot(getScreenshotOptions({ context, url }));
await afterScreenshot({ image, context });
} catch (e) { } catch (e) {
logger.error( logger.error(
`Error when connecting to ${url}, did you start or build the storybook first? A storybook instance should be running or a static version should be built when using image snapshot feature.` `Error when connecting to ${url}, did you start or build the storybook first? A storybook instance should be running or a static version should be built when using image snapshot feature.`
@ -75,19 +82,22 @@ export const imageSnapshot = (customConfig: Partial<ImageSnapshotConfig> = {}) =
expect(image).toMatchImageSnapshot(getMatchOptions({ context, url })); expect(image).toMatchImageSnapshot(getMatchOptions({ context, url }));
}; };
testFn.timeout = testTimeout;
testFn.afterAll = () => { testFn.afterAll = async () => {
if (getCustomBrowser && page) { if (getCustomBrowser && page) {
return page.close(); await page.close();
} else if (browser) {
await browser.close();
} }
return browser.close();
}; };
testFn.beforeAll = async () => { const beforeAll = async () => {
if (getCustomBrowser) { if (getCustomBrowser) {
browser = await getCustomBrowser(); browser = await getCustomBrowser();
} else { } else {
// eslint-disable-next-line global-require
const puppeteer = require('puppeteer');
// add some options "no-sandbox" to make it work properly on some Linux systems as proposed here: https://github.com/Googlechrome/puppeteer/issues/290#issuecomment-322851507 // add some options "no-sandbox" to make it work properly on some Linux systems as proposed here: https://github.com/Googlechrome/puppeteer/issues/290#issuecomment-322851507
browser = await puppeteer.launch({ browser = await puppeteer.launch({
args: ['--no-sandbox ', '--disable-setuid-sandbox', '--disable-dev-shm-usage'], args: ['--no-sandbox ', '--disable-setuid-sandbox', '--disable-dev-shm-usage'],
@ -97,6 +107,8 @@ export const imageSnapshot = (customConfig: Partial<ImageSnapshotConfig> = {}) =
page = await browser.newPage(); page = await browser.newPage();
}; };
beforeAll.timeout = setupTimeout;
testFn.beforeAll = beforeAll;
return testFn; return testFn;
}; };

View File

@ -1,6 +1,6 @@
{ {
"name": "@storybook/addon-storysource", "name": "@storybook/addon-storysource",
"version": "5.3.0-beta.3", "version": "5.3.0-beta.7",
"description": "Stories addon for storybook", "description": "Stories addon for storybook",
"keywords": [ "keywords": [
"addon", "addon",
@ -28,11 +28,11 @@
"prepare": "node ../../scripts/prepare.js" "prepare": "node ../../scripts/prepare.js"
}, },
"dependencies": { "dependencies": {
"@storybook/addons": "5.3.0-beta.3", "@storybook/addons": "5.3.0-beta.7",
"@storybook/components": "5.3.0-beta.3", "@storybook/components": "5.3.0-beta.7",
"@storybook/router": "5.3.0-beta.3", "@storybook/router": "5.3.0-beta.7",
"@storybook/source-loader": "5.3.0-beta.3", "@storybook/source-loader": "5.3.0-beta.7",
"@storybook/theming": "5.3.0-beta.3", "@storybook/theming": "5.3.0-beta.7",
"core-js": "^3.0.1", "core-js": "^3.0.1",
"estraverse": "^4.2.0", "estraverse": "^4.2.0",
"loader-utils": "^1.2.3", "loader-utils": "^1.2.3",

View File

@ -1,6 +1,6 @@
{ {
"name": "@storybook/addon-viewport", "name": "@storybook/addon-viewport",
"version": "5.3.0-beta.3", "version": "5.3.0-beta.7",
"description": "Storybook addon to change the viewport size to mobile", "description": "Storybook addon to change the viewport size to mobile",
"keywords": [ "keywords": [
"addon", "addon",
@ -29,12 +29,12 @@
"prepare": "node ../../scripts/prepare.js" "prepare": "node ../../scripts/prepare.js"
}, },
"dependencies": { "dependencies": {
"@storybook/addons": "5.3.0-beta.3", "@storybook/addons": "5.3.0-beta.7",
"@storybook/api": "5.3.0-beta.3", "@storybook/api": "5.3.0-beta.7",
"@storybook/client-logger": "5.3.0-beta.3", "@storybook/client-logger": "5.3.0-beta.7",
"@storybook/components": "5.3.0-beta.3", "@storybook/components": "5.3.0-beta.7",
"@storybook/core-events": "5.3.0-beta.3", "@storybook/core-events": "5.3.0-beta.7",
"@storybook/theming": "5.3.0-beta.3", "@storybook/theming": "5.3.0-beta.7",
"core-js": "^3.0.1", "core-js": "^3.0.1",
"global": "^4.3.2", "global": "^4.3.2",
"memoizerific": "^1.11.3", "memoizerific": "^1.11.3",

View File

@ -1,6 +1,6 @@
{ {
"name": "@storybook/angular", "name": "@storybook/angular",
"version": "5.3.0-beta.3", "version": "5.3.0-beta.7",
"description": "Storybook for Angular: Develop Angular Components in isolation with Hot Reloading.", "description": "Storybook for Angular: Develop Angular Components in isolation with Hot Reloading.",
"keywords": [ "keywords": [
"storybook" "storybook"
@ -33,9 +33,9 @@
"prepare": "node ../../scripts/prepare.js" "prepare": "node ../../scripts/prepare.js"
}, },
"dependencies": { "dependencies": {
"@storybook/addons": "5.3.0-beta.3", "@storybook/addons": "5.3.0-beta.7",
"@storybook/core": "5.3.0-beta.3", "@storybook/core": "5.3.0-beta.7",
"@storybook/node-logger": "5.3.0-beta.3", "@storybook/node-logger": "5.3.0-beta.7",
"core-js": "^3.0.1", "core-js": "^3.0.1",
"fork-ts-checker-webpack-plugin": "^3.0.1", "fork-ts-checker-webpack-plugin": "^3.0.1",
"global": "^4.3.2", "global": "^4.3.2",

View File

@ -1,6 +1,6 @@
{ {
"name": "@storybook/ember", "name": "@storybook/ember",
"version": "5.3.0-beta.3", "version": "5.3.0-beta.7",
"description": "Storybook for Ember: Develop Ember Component in isolation with Hot Reloading.", "description": "Storybook for Ember: Develop Ember Component in isolation with Hot Reloading.",
"homepage": "https://github.com/storybookjs/storybook/tree/master/app/ember", "homepage": "https://github.com/storybookjs/storybook/tree/master/app/ember",
"bugs": { "bugs": {
@ -31,7 +31,7 @@
}, },
"dependencies": { "dependencies": {
"@ember/test-helpers": "^1.5.0", "@ember/test-helpers": "^1.5.0",
"@storybook/core": "5.3.0-beta.3", "@storybook/core": "5.3.0-beta.7",
"core-js": "^3.0.1", "core-js": "^3.0.1",
"global": "^4.3.2", "global": "^4.3.2",
"regenerator-runtime": "^0.13.3", "regenerator-runtime": "^0.13.3",

View File

@ -1,6 +1,6 @@
{ {
"name": "@storybook/html", "name": "@storybook/html",
"version": "5.3.0-beta.3", "version": "5.3.0-beta.7",
"description": "Storybook for HTML: View HTML snippets in isolation with Hot Reloading.", "description": "Storybook for HTML: View HTML snippets in isolation with Hot Reloading.",
"keywords": [ "keywords": [
"storybook" "storybook"
@ -33,8 +33,8 @@
"prepare": "node ../../scripts/prepare.js" "prepare": "node ../../scripts/prepare.js"
}, },
"dependencies": { "dependencies": {
"@storybook/addons": "5.3.0-beta.3", "@storybook/addons": "5.3.0-beta.7",
"@storybook/core": "5.3.0-beta.3", "@storybook/core": "5.3.0-beta.7",
"@types/webpack-env": "^1.13.9", "@types/webpack-env": "^1.13.9",
"core-js": "^3.0.1", "core-js": "^3.0.1",
"global": "^4.3.2", "global": "^4.3.2",

View File

@ -1,6 +1,6 @@
{ {
"name": "@storybook/marko", "name": "@storybook/marko",
"version": "5.3.0-beta.3", "version": "5.3.0-beta.7",
"description": "Storybook for Marko: Develop Marko Component in isolation with Hot Reloading.", "description": "Storybook for Marko: Develop Marko Component in isolation with Hot Reloading.",
"keywords": [ "keywords": [
"storybook" "storybook"
@ -33,8 +33,8 @@
}, },
"dependencies": { "dependencies": {
"@marko/webpack": "^2.0.0", "@marko/webpack": "^2.0.0",
"@storybook/client-logger": "5.3.0-beta.3", "@storybook/client-logger": "5.3.0-beta.7",
"@storybook/core": "5.3.0-beta.3", "@storybook/core": "5.3.0-beta.7",
"core-js": "^3.0.1", "core-js": "^3.0.1",
"global": "^4.3.2", "global": "^4.3.2",
"regenerator-runtime": "^0.13.3", "regenerator-runtime": "^0.13.3",

View File

@ -1,6 +1,6 @@
{ {
"name": "@storybook/mithril", "name": "@storybook/mithril",
"version": "5.3.0-beta.3", "version": "5.3.0-beta.7",
"description": "Storybook for Mithril: Develop Mithril Component in isolation.", "description": "Storybook for Mithril: Develop Mithril Component in isolation.",
"keywords": [ "keywords": [
"storybook" "storybook"
@ -35,8 +35,8 @@
"dependencies": { "dependencies": {
"@babel/core": "^7.6.2", "@babel/core": "^7.6.2",
"@babel/plugin-transform-react-jsx": "^7.3.0", "@babel/plugin-transform-react-jsx": "^7.3.0",
"@storybook/addons": "5.3.0-beta.3", "@storybook/addons": "5.3.0-beta.7",
"@storybook/core": "5.3.0-beta.3", "@storybook/core": "5.3.0-beta.7",
"@types/mithril": "^2.0.0", "@types/mithril": "^2.0.0",
"core-js": "^3.0.1", "core-js": "^3.0.1",
"global": "^4.3.2", "global": "^4.3.2",

View File

@ -1,6 +1,6 @@
{ {
"name": "@storybook/polymer", "name": "@storybook/polymer",
"version": "5.3.0-beta.3", "version": "5.3.0-beta.7",
"description": "Storybook for Polymer: Develop Polymer components in isolation with Hot Reloading.", "description": "Storybook for Polymer: Develop Polymer components in isolation with Hot Reloading.",
"keywords": [ "keywords": [
"storybook" "storybook"
@ -32,7 +32,7 @@
"prepare": "node ../../scripts/prepare.js" "prepare": "node ../../scripts/prepare.js"
}, },
"dependencies": { "dependencies": {
"@storybook/core": "5.3.0-beta.3", "@storybook/core": "5.3.0-beta.7",
"@webcomponents/webcomponentsjs": "^1.2.0", "@webcomponents/webcomponentsjs": "^1.2.0",
"core-js": "^3.0.1", "core-js": "^3.0.1",
"global": "^4.3.2", "global": "^4.3.2",

View File

@ -1,6 +1,6 @@
{ {
"name": "@storybook/preact", "name": "@storybook/preact",
"version": "5.3.0-beta.3", "version": "5.3.0-beta.7",
"description": "Storybook for Preact: Develop Preact Component in isolation.", "description": "Storybook for Preact: Develop Preact Component in isolation.",
"keywords": [ "keywords": [
"storybook" "storybook"
@ -34,8 +34,8 @@
}, },
"dependencies": { "dependencies": {
"@babel/plugin-transform-react-jsx": "^7.3.0", "@babel/plugin-transform-react-jsx": "^7.3.0",
"@storybook/addons": "5.3.0-beta.3", "@storybook/addons": "5.3.0-beta.7",
"@storybook/core": "5.3.0-beta.3", "@storybook/core": "5.3.0-beta.7",
"@types/webpack-env": "^1.13.9", "@types/webpack-env": "^1.13.9",
"core-js": "^3.0.1", "core-js": "^3.0.1",
"global": "^4.3.2", "global": "^4.3.2",

View File

@ -1,6 +1,6 @@
{ {
"name": "@storybook/rax", "name": "@storybook/rax",
"version": "5.3.0-beta.3", "version": "5.3.0-beta.7",
"description": "Storybook for Rax: Develop Rax Component in isolation.", "description": "Storybook for Rax: Develop Rax Component in isolation.",
"keywords": [ "keywords": [
"rax", "rax",
@ -33,7 +33,7 @@
"prepare": "node ../../scripts/prepare.js" "prepare": "node ../../scripts/prepare.js"
}, },
"dependencies": { "dependencies": {
"@storybook/core": "5.3.0-beta.3", "@storybook/core": "5.3.0-beta.7",
"babel-preset-rax": "^1.0.0-beta.0", "babel-preset-rax": "^1.0.0-beta.0",
"core-js": "^3.0.1", "core-js": "^3.0.1",
"driver-dom": "^2.0.0", "driver-dom": "^2.0.0",
@ -42,7 +42,7 @@
"ts-dedent": "^1.1.0" "ts-dedent": "^1.1.0"
}, },
"devDependencies": { "devDependencies": {
"rax": "^1.0.0" "rax": "^1.1.0"
}, },
"peerDependencies": { "peerDependencies": {
"babel-loader": "^7.0.0 || ^8.0.0", "babel-loader": "^7.0.0 || ^8.0.0",

View File

@ -1,6 +1,6 @@
{ {
"name": "@storybook/react-native-server", "name": "@storybook/react-native-server",
"version": "5.3.0-beta.3", "version": "5.3.0-beta.7",
"description": "A better way to develop React Native Components for your app", "description": "A better way to develop React Native Components for your app",
"keywords": [ "keywords": [
"react", "react",
@ -31,12 +31,12 @@
"prepare": "node ../../scripts/prepare.js" "prepare": "node ../../scripts/prepare.js"
}, },
"dependencies": { "dependencies": {
"@storybook/addons": "5.3.0-beta.3", "@storybook/addons": "5.3.0-beta.7",
"@storybook/api": "5.3.0-beta.3", "@storybook/api": "5.3.0-beta.7",
"@storybook/channel-websocket": "5.3.0-beta.3", "@storybook/channel-websocket": "5.3.0-beta.7",
"@storybook/core": "5.3.0-beta.3", "@storybook/core": "5.3.0-beta.7",
"@storybook/core-events": "5.3.0-beta.3", "@storybook/core-events": "5.3.0-beta.7",
"@storybook/ui": "5.3.0-beta.3", "@storybook/ui": "5.3.0-beta.7",
"commander": "^4.0.1", "commander": "^4.0.1",
"core-js": "^3.0.1", "core-js": "^3.0.1",
"global": "^4.3.2", "global": "^4.3.2",

View File

@ -1,6 +1,6 @@
{ {
"name": "@storybook/react-native", "name": "@storybook/react-native",
"version": "5.3.0-beta.3", "version": "5.3.0-beta.7",
"description": "A better way to develop React Native Components for your app", "description": "A better way to develop React Native Components for your app",
"keywords": [ "keywords": [
"react", "react",
@ -31,11 +31,11 @@
"dependencies": { "dependencies": {
"@emotion/core": "^10.0.20", "@emotion/core": "^10.0.20",
"@emotion/native": "^10.0.14", "@emotion/native": "^10.0.14",
"@storybook/addons": "5.3.0-beta.3", "@storybook/addons": "5.3.0-beta.7",
"@storybook/channel-websocket": "5.3.0-beta.3", "@storybook/channel-websocket": "5.3.0-beta.7",
"@storybook/channels": "5.3.0-beta.3", "@storybook/channels": "5.3.0-beta.7",
"@storybook/client-api": "5.3.0-beta.3", "@storybook/client-api": "5.3.0-beta.7",
"@storybook/core-events": "5.3.0-beta.3", "@storybook/core-events": "5.3.0-beta.7",
"core-js": "^3.0.1", "core-js": "^3.0.1",
"emotion-theming": "^10.0.19", "emotion-theming": "^10.0.19",
"react-native-swipe-gestures": "^1.0.4" "react-native-swipe-gestures": "^1.0.4"

View File

@ -1,6 +1,6 @@
{ {
"name": "@storybook/react", "name": "@storybook/react",
"version": "5.3.0-beta.3", "version": "5.3.0-beta.7",
"description": "Storybook for React: Develop React Component in isolation with Hot Reloading.", "description": "Storybook for React: Develop React Component in isolation with Hot Reloading.",
"keywords": [ "keywords": [
"storybook" "storybook"
@ -36,9 +36,9 @@
"@babel/plugin-transform-react-constant-elements": "^7.2.0", "@babel/plugin-transform-react-constant-elements": "^7.2.0",
"@babel/preset-flow": "^7.0.0", "@babel/preset-flow": "^7.0.0",
"@babel/preset-react": "^7.0.0", "@babel/preset-react": "^7.0.0",
"@storybook/addons": "5.3.0-beta.3", "@storybook/addons": "5.3.0-beta.7",
"@storybook/core": "5.3.0-beta.3", "@storybook/core": "5.3.0-beta.7",
"@storybook/node-logger": "5.3.0-beta.3", "@storybook/node-logger": "5.3.0-beta.7",
"@svgr/webpack": "^4.0.3", "@svgr/webpack": "^4.0.3",
"@types/webpack-env": "^1.13.7", "@types/webpack-env": "^1.13.7",
"babel-plugin-add-react-displayname": "^0.0.5", "babel-plugin-add-react-displayname": "^0.0.5",
@ -57,8 +57,8 @@
}, },
"devDependencies": { "devDependencies": {
"@types/mini-css-extract-plugin": "^0.8.0", "@types/mini-css-extract-plugin": "^0.8.0",
"@types/node": "^12.7.9", "@types/node": "^12.12.11",
"@types/webpack": "^4.4.32" "@types/webpack": "^4.41.0"
}, },
"peerDependencies": { "peerDependencies": {
"@babel/core": "^7.0.1", "@babel/core": "^7.0.1",

View File

@ -191,6 +191,7 @@ export function applyCRAWebpackConfig(baseConfig: Configuration, configDir: stri
// Add css minification for production // Add css minification for production
const plugins = [...baseConfig.plugins]; const plugins = [...baseConfig.plugins];
if (baseConfig.mode === 'production') { if (baseConfig.mode === 'production') {
// @ts-ignore
plugins.push(new MiniCssExtractPlugin()); plugins.push(new MiniCssExtractPlugin());
} }

View File

@ -1,6 +1,6 @@
{ {
"name": "@storybook/riot", "name": "@storybook/riot",
"version": "5.3.0-beta.3", "version": "5.3.0-beta.7",
"description": "Storybook for riot.js: View riot snippets in isolation with Hot Reloading.", "description": "Storybook for riot.js: View riot snippets in isolation with Hot Reloading.",
"keywords": [ "keywords": [
"storybook" "storybook"
@ -33,7 +33,7 @@
"prepare": "node ../../scripts/prepare.js" "prepare": "node ../../scripts/prepare.js"
}, },
"dependencies": { "dependencies": {
"@storybook/core": "5.3.0-beta.3", "@storybook/core": "5.3.0-beta.7",
"core-js": "^3.0.1", "core-js": "^3.0.1",
"global": "^4.3.2", "global": "^4.3.2",
"raw-loader": "^3.1.0", "raw-loader": "^3.1.0",

View File

@ -1,6 +1,6 @@
{ {
"name": "@storybook/svelte", "name": "@storybook/svelte",
"version": "5.3.0-beta.3", "version": "5.3.0-beta.7",
"description": "Storybook for Svelte: Develop Svelte Component in isolation with Hot Reloading.", "description": "Storybook for Svelte: Develop Svelte Component in isolation with Hot Reloading.",
"keywords": [ "keywords": [
"storybook" "storybook"
@ -33,8 +33,8 @@
"prepare": "node ../../scripts/prepare.js" "prepare": "node ../../scripts/prepare.js"
}, },
"dependencies": { "dependencies": {
"@storybook/addons": "5.3.0-beta.3", "@storybook/addons": "5.3.0-beta.7",
"@storybook/core": "5.3.0-beta.3", "@storybook/core": "5.3.0-beta.7",
"core-js": "^3.0.1", "core-js": "^3.0.1",
"global": "^4.3.2", "global": "^4.3.2",
"regenerator-runtime": "^0.13.3", "regenerator-runtime": "^0.13.3",

View File

@ -1,6 +1,6 @@
{ {
"name": "@storybook/vue", "name": "@storybook/vue",
"version": "5.3.0-beta.3", "version": "5.3.0-beta.7",
"description": "Storybook for Vue: Develop Vue Component in isolation with Hot Reloading.", "description": "Storybook for Vue: Develop Vue Component in isolation with Hot Reloading.",
"keywords": [ "keywords": [
"storybook" "storybook"
@ -33,8 +33,8 @@
"prepare": "node ../../scripts/prepare.js" "prepare": "node ../../scripts/prepare.js"
}, },
"dependencies": { "dependencies": {
"@storybook/addons": "5.3.0-beta.3", "@storybook/addons": "5.3.0-beta.7",
"@storybook/core": "5.3.0-beta.3", "@storybook/core": "5.3.0-beta.7",
"@types/webpack-env": "^1.13.9", "@types/webpack-env": "^1.13.9",
"core-js": "^3.0.1", "core-js": "^3.0.1",
"global": "^4.3.2", "global": "^4.3.2",
@ -44,8 +44,8 @@
}, },
"devDependencies": { "devDependencies": {
"@types/mini-css-extract-plugin": "^0.8.0", "@types/mini-css-extract-plugin": "^0.8.0",
"@types/node": "^12.7.9", "@types/node": "^12.12.11",
"@types/webpack": "^4.4.32", "@types/webpack": "^4.41.0",
"babel-preset-vue": "^2.0.2", "babel-preset-vue": "^2.0.2",
"vue": "^2.6.8", "vue": "^2.6.8",
"vue-loader": "^15.7.0", "vue-loader": "^15.7.0",

View File

@ -1,6 +1,6 @@
{ {
"name": "@storybook/web-components", "name": "@storybook/web-components",
"version": "5.3.0-beta.3", "version": "5.3.0-beta.7",
"description": "Storybook for web-components: View web components snippets in isolation with Hot Reloading.", "description": "Storybook for web-components: View web components snippets in isolation with Hot Reloading.",
"keywords": [ "keywords": [
"lit-html", "lit-html",
@ -37,8 +37,8 @@
"dependencies": { "dependencies": {
"@babel/plugin-syntax-dynamic-import": "^7.2.0", "@babel/plugin-syntax-dynamic-import": "^7.2.0",
"@babel/plugin-syntax-import-meta": "^7.2.0", "@babel/plugin-syntax-import-meta": "^7.2.0",
"@storybook/addons": "5.3.0-beta.3", "@storybook/addons": "5.3.0-beta.7",
"@storybook/core": "5.3.0-beta.3", "@storybook/core": "5.3.0-beta.7",
"@types/webpack-env": "^1.13.9", "@types/webpack-env": "^1.13.9",
"babel-plugin-bundled-import-meta": "^0.3.1", "babel-plugin-bundled-import-meta": "^0.3.1",
"core-js": "^3.0.1", "core-js": "^3.0.1",

View File

@ -1,6 +1,6 @@
{ {
"name": "@storybook/addon-decorator", "name": "@storybook/addon-decorator",
"version": "5.3.0-beta.3", "version": "5.3.0-beta.7",
"description": "decorator addon for storybook", "description": "decorator addon for storybook",
"keywords": [ "keywords": [
"addon", "addon",
@ -24,8 +24,8 @@
"prepare": "node ../../scripts/prepare.js" "prepare": "node ../../scripts/prepare.js"
}, },
"dependencies": { "dependencies": {
"@storybook/addons": "5.3.0-beta.3", "@storybook/addons": "5.3.0-beta.7",
"@storybook/client-api": "5.3.0-beta.3", "@storybook/client-api": "5.3.0-beta.7",
"core-js": "^3.0.1", "core-js": "^3.0.1",
"global": "^4.4.0" "global": "^4.4.0"
}, },

View File

@ -1,6 +1,6 @@
{ {
"name": "@storybook/addon-parameter", "name": "@storybook/addon-parameter",
"version": "5.3.0-beta.3", "version": "5.3.0-beta.7",
"description": "parameter addon for storybook", "description": "parameter addon for storybook",
"keywords": [ "keywords": [
"addon", "addon",
@ -24,12 +24,12 @@
"prepare": "node ../../scripts/prepare.js" "prepare": "node ../../scripts/prepare.js"
}, },
"dependencies": { "dependencies": {
"@storybook/addons": "5.3.0-beta.3", "@storybook/addons": "5.3.0-beta.7",
"@storybook/api": "5.3.0-beta.3", "@storybook/api": "5.3.0-beta.7",
"@storybook/client-logger": "5.3.0-beta.3", "@storybook/client-logger": "5.3.0-beta.7",
"@storybook/components": "5.3.0-beta.3", "@storybook/components": "5.3.0-beta.7",
"@storybook/core-events": "5.3.0-beta.3", "@storybook/core-events": "5.3.0-beta.7",
"@storybook/theming": "5.3.0-beta.3", "@storybook/theming": "5.3.0-beta.7",
"core-js": "^3.0.1", "core-js": "^3.0.1",
"global": "^4.3.2", "global": "^4.3.2",
"react": "^16.8.3", "react": "^16.8.3",

View File

@ -1,6 +1,6 @@
{ {
"name": "@storybook/addon-preview-wrapper", "name": "@storybook/addon-preview-wrapper",
"version": "5.3.0-beta.3", "version": "5.3.0-beta.7",
"description": "preview wrapper addon for storybook", "description": "preview wrapper addon for storybook",
"keywords": [ "keywords": [
"addon", "addon",
@ -24,7 +24,7 @@
"prepare": "node ../../scripts/prepare.js" "prepare": "node ../../scripts/prepare.js"
}, },
"dependencies": { "dependencies": {
"@storybook/addons": "5.3.0-beta.3", "@storybook/addons": "5.3.0-beta.7",
"react": "^16.8.3" "react": "^16.8.3"
}, },
"publishConfig": { "publishConfig": {

View File

@ -1,6 +1,6 @@
{ {
"name": "@storybook/addon-roundtrip", "name": "@storybook/addon-roundtrip",
"version": "5.3.0-beta.3", "version": "5.3.0-beta.7",
"description": "roundtrip addon for storybook", "description": "roundtrip addon for storybook",
"keywords": [ "keywords": [
"addon", "addon",
@ -24,13 +24,13 @@
"prepare": "node ../../scripts/prepare.js" "prepare": "node ../../scripts/prepare.js"
}, },
"dependencies": { "dependencies": {
"@storybook/addons": "5.3.0-beta.3", "@storybook/addons": "5.3.0-beta.7",
"@storybook/api": "5.3.0-beta.3", "@storybook/api": "5.3.0-beta.7",
"@storybook/client-api": "5.3.0-beta.3", "@storybook/client-api": "5.3.0-beta.7",
"@storybook/client-logger": "5.3.0-beta.3", "@storybook/client-logger": "5.3.0-beta.7",
"@storybook/components": "5.3.0-beta.3", "@storybook/components": "5.3.0-beta.7",
"@storybook/core-events": "5.3.0-beta.3", "@storybook/core-events": "5.3.0-beta.7",
"@storybook/theming": "5.3.0-beta.3", "@storybook/theming": "5.3.0-beta.7",
"core-js": "^3.0.1", "core-js": "^3.0.1",
"global": "^4.3.2", "global": "^4.3.2",
"react": "^16.8.3", "react": "^16.8.3",

View File

@ -9,7 +9,7 @@ Storybook is theme-able!
It's possible to theme Storybook globally. It's possible to theme Storybook globally.
We've created two basic themes that look good of the box: "normal" (a light theme) and "dark" (a dark theme). Unless you've set your preferred color scheme as dark Storybook will use the light theme as default. We've created two basic themes that look good out of the box: "normal" (a light theme) and "dark" (a dark theme). Unless you've set your preferred color scheme as dark Storybook will use the light theme as default.
As an example, you can tell Storybook to use the "dark" theme by modifying `.storybook/manager.js`: As an example, you can tell Storybook to use the "dark" theme by modifying `.storybook/manager.js`:

View File

@ -1 +1 @@
{"version":"5.3.0-beta.3","info":{"plain":"### Features\n\n* Addon-docs: Rich props table UI ([#8887](https://github.com/storybookjs/storybook/pull/8887))\n* Addon-docs: Improve basic support for Flow props ([#8890](https://github.com/storybookjs/storybook/pull/8890))\n* CLI: Avoid id changes after `storiesof-to-csf` migration ([#8856](https://github.com/storybookjs/storybook/pull/8856))\n\n### Bug Fixes\n\n* Addon-docs: Fix props table for sections props ([#8904](https://github.com/storybookjs/storybook/pull/8904))\n* Addon-docs: Fix Description block when no component provided ([#8902](https://github.com/storybookjs/storybook/pull/8902))\n* Angular: Fix project without `architect.build` option ([#6737](https://github.com/storybookjs/storybook/pull/6737))\n\n### Maintenance\n\n* Addon-docs: Docgen lib maintenance ([#8896](https://github.com/storybookjs/storybook/pull/8896))\n* Examples: Fix stories glob in official-storybook ([#8888](https://github.com/storybookjs/storybook/pull/8888))"}} {"version":"5.3.0-beta.6","info":{"plain":"### Features\n\n* Presets: dynamic preset injection ([#8921](https://github.com/storybookjs/storybook/pull/8921))\n\n### Bug Fixes\n\n* Revert \"feat: use `puppeteer-core` instead of `puppeteer`\" ([#8925](https://github.com/storybookjs/storybook/pull/8925))\n* Addon-docs: Fix props detail tooltip to prevent cutting end of content ([#8923](https://github.com/storybookjs/storybook/pull/8923))\n\n### Maintenance\n\n* Addon-docs: Base code to improve the props table for TS ([#8905](https://github.com/storybookjs/storybook/pull/8905))\n* Build: Fix now deploy ([#8929](https://github.com/storybookjs/storybook/pull/8929))\n\n### Dependency Upgrades\n\n* Miscellaneous upgrades ([#8912](https://github.com/storybookjs/storybook/pull/8912))"}}

View File

@ -1,6 +1,6 @@
{ {
"name": "crna-kitchen-sink", "name": "crna-kitchen-sink",
"version": "5.3.0-beta.3", "version": "5.3.0-beta.7",
"private": true, "private": true,
"main": "node_modules/expo/AppEntry.js", "main": "node_modules/expo/AppEntry.js",
"workspaces": { "workspaces": {
@ -24,22 +24,22 @@
"dependencies": { "dependencies": {
"expo": "^33.0.7", "expo": "^33.0.7",
"prop-types": "^15.6.2", "prop-types": "^15.6.2",
"react": "16.10.1", "react": "16.12.0",
"react-native": "https://github.com/expo/react-native/archive/sdk-33.0.0.tar.gz", "react-native": "https://github.com/expo/react-native/archive/sdk-33.0.0.tar.gz",
"whatwg-fetch": "^3.0.0" "whatwg-fetch": "^3.0.0"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.2.2", "@babel/core": "^7.2.2",
"@babel/plugin-transform-react-jsx-source": "^7.2.0", "@babel/plugin-transform-react-jsx-source": "^7.2.0",
"@storybook/addon-actions": "5.3.0-beta.3", "@storybook/addon-actions": "5.3.0-beta.7",
"@storybook/addon-knobs": "5.3.0-beta.3", "@storybook/addon-knobs": "5.3.0-beta.7",
"@storybook/addon-links": "5.3.0-beta.3", "@storybook/addon-links": "5.3.0-beta.7",
"@storybook/addon-ondevice-actions": "5.3.0-beta.3", "@storybook/addon-ondevice-actions": "5.3.0-beta.7",
"@storybook/addon-ondevice-backgrounds": "5.3.0-beta.3", "@storybook/addon-ondevice-backgrounds": "5.3.0-beta.7",
"@storybook/addon-ondevice-knobs": "5.3.0-beta.3", "@storybook/addon-ondevice-knobs": "5.3.0-beta.7",
"@storybook/addon-ondevice-notes": "5.3.0-beta.3", "@storybook/addon-ondevice-notes": "5.3.0-beta.7",
"@storybook/addons": "5.3.0-beta.3", "@storybook/addons": "5.3.0-beta.7",
"@storybook/react-native": "5.3.0-beta.3", "@storybook/react-native": "5.3.0-beta.7",
"babel-loader": "^8.0.4", "babel-loader": "^8.0.4",
"babel-plugin-module-resolver": "^3.2.0", "babel-plugin-module-resolver": "^3.2.0",
"babel-preset-expo": "^7.0.0", "babel-preset-expo": "^7.0.0",

View File

@ -1,6 +1,6 @@
{ {
"name": "angular-cli", "name": "angular-cli",
"version": "5.3.0-beta.3", "version": "5.3.0-beta.7",
"private": true, "private": true,
"license": "MIT", "license": "MIT",
"scripts": { "scripts": {
@ -37,24 +37,24 @@
"@angular/cli": "^8.3.6", "@angular/cli": "^8.3.6",
"@angular/compiler-cli": "^8.2.8", "@angular/compiler-cli": "^8.2.8",
"@compodoc/compodoc": "^1.1.11", "@compodoc/compodoc": "^1.1.11",
"@storybook/addon-a11y": "5.3.0-beta.3", "@storybook/addon-a11y": "5.3.0-beta.7",
"@storybook/addon-actions": "5.3.0-beta.3", "@storybook/addon-actions": "5.3.0-beta.7",
"@storybook/addon-backgrounds": "5.3.0-beta.3", "@storybook/addon-backgrounds": "5.3.0-beta.7",
"@storybook/addon-centered": "5.3.0-beta.3", "@storybook/addon-centered": "5.3.0-beta.7",
"@storybook/addon-docs": "5.3.0-beta.3", "@storybook/addon-docs": "5.3.0-beta.7",
"@storybook/addon-jest": "5.3.0-beta.3", "@storybook/addon-jest": "5.3.0-beta.7",
"@storybook/addon-knobs": "5.3.0-beta.3", "@storybook/addon-knobs": "5.3.0-beta.7",
"@storybook/addon-links": "5.3.0-beta.3", "@storybook/addon-links": "5.3.0-beta.7",
"@storybook/addon-notes": "5.3.0-beta.3", "@storybook/addon-notes": "5.3.0-beta.7",
"@storybook/addon-options": "5.3.0-beta.3", "@storybook/addon-options": "5.3.0-beta.7",
"@storybook/addon-storyshots": "5.3.0-beta.3", "@storybook/addon-storyshots": "5.3.0-beta.7",
"@storybook/addon-storysource": "5.3.0-beta.3", "@storybook/addon-storysource": "5.3.0-beta.7",
"@storybook/addons": "5.3.0-beta.3", "@storybook/addons": "5.3.0-beta.7",
"@storybook/angular": "5.3.0-beta.3", "@storybook/angular": "5.3.0-beta.7",
"@storybook/source-loader": "5.3.0-beta.3", "@storybook/source-loader": "5.3.0-beta.7",
"@types/core-js": "^2.5.0", "@types/core-js": "^2.5.0",
"@types/jest": "^24.0.11", "@types/jest": "^24.0.11",
"@types/node": "^12.7.9", "@types/node": "^12.12.11",
"@types/webpack-env": "^1.14.0", "@types/webpack-env": "^1.14.0",
"babel-plugin-require-context-hook": "^1.0.0", "babel-plugin-require-context-hook": "^1.0.0",
"global": "^4.3.2", "global": "^4.3.2",

View File

@ -1,6 +1,6 @@
{ {
"name": "cra-kitchen-sink", "name": "cra-kitchen-sink",
"version": "5.3.0-beta.3", "version": "5.3.0-beta.7",
"private": true, "private": true,
"scripts": { "scripts": {
"build": "react-scripts build", "build": "react-scripts build",
@ -18,23 +18,23 @@
"react-lifecycles-compat": "^3.0.4" "react-lifecycles-compat": "^3.0.4"
}, },
"devDependencies": { "devDependencies": {
"@storybook/addon-a11y": "5.3.0-beta.3", "@storybook/addon-a11y": "5.3.0-beta.7",
"@storybook/addon-actions": "5.3.0-beta.3", "@storybook/addon-actions": "5.3.0-beta.7",
"@storybook/addon-backgrounds": "5.3.0-beta.3", "@storybook/addon-backgrounds": "5.3.0-beta.7",
"@storybook/addon-centered": "5.3.0-beta.3", "@storybook/addon-centered": "5.3.0-beta.7",
"@storybook/addon-docs": "5.3.0-beta.3", "@storybook/addon-docs": "5.3.0-beta.7",
"@storybook/addon-events": "5.3.0-beta.3", "@storybook/addon-events": "5.3.0-beta.7",
"@storybook/addon-info": "5.3.0-beta.3", "@storybook/addon-info": "5.3.0-beta.7",
"@storybook/addon-jest": "5.3.0-beta.3", "@storybook/addon-jest": "5.3.0-beta.7",
"@storybook/addon-knobs": "5.3.0-beta.3", "@storybook/addon-knobs": "5.3.0-beta.7",
"@storybook/addon-links": "5.3.0-beta.3", "@storybook/addon-links": "5.3.0-beta.7",
"@storybook/addon-notes": "5.3.0-beta.3", "@storybook/addon-notes": "5.3.0-beta.7",
"@storybook/addon-options": "5.3.0-beta.3", "@storybook/addon-options": "5.3.0-beta.7",
"@storybook/addon-storyshots": "5.3.0-beta.3", "@storybook/addon-storyshots": "5.3.0-beta.7",
"@storybook/addons": "5.3.0-beta.3", "@storybook/addons": "5.3.0-beta.7",
"@storybook/client-logger": "5.3.0-beta.3", "@storybook/client-logger": "5.3.0-beta.7",
"@storybook/react": "5.3.0-beta.3", "@storybook/react": "5.3.0-beta.7",
"@storybook/theming": "5.3.0-beta.3", "@storybook/theming": "5.3.0-beta.7",
"react-scripts": "^3.0.1" "react-scripts": "^3.0.1"
} }
} }

View File

@ -1,6 +1,6 @@
{ {
"name": "cra-react15", "name": "cra-react15",
"version": "5.3.0-beta.3", "version": "5.3.0-beta.7",
"private": true, "private": true,
"scripts": { "scripts": {
"build": "react-scripts build", "build": "react-scripts build",
@ -18,10 +18,10 @@
"react-scripts": "3.0.1" "react-scripts": "3.0.1"
}, },
"devDependencies": { "devDependencies": {
"@storybook/addon-actions": "5.3.0-beta.3", "@storybook/addon-actions": "5.3.0-beta.7",
"@storybook/addon-links": "5.3.0-beta.3", "@storybook/addon-links": "5.3.0-beta.7",
"@storybook/react": "5.3.0-beta.3", "@storybook/react": "5.3.0-beta.7",
"@storybook/theming": "5.3.0-beta.3", "@storybook/theming": "5.3.0-beta.7",
"babel-core": "6", "babel-core": "6",
"babel-runtime": "6" "babel-runtime": "6"
} }

View File

@ -1,6 +1,6 @@
{ {
"name": "cra-ts-kitchen-sink", "name": "cra-ts-kitchen-sink",
"version": "5.3.0-beta.3", "version": "5.3.0-beta.7",
"private": true, "private": true,
"scripts": { "scripts": {
"build": "react-scripts build", "build": "react-scripts build",
@ -23,26 +23,26 @@
] ]
}, },
"dependencies": { "dependencies": {
"@types/jest": "24.0.19", "@types/jest": "24.0.23",
"@types/node": "12.11.1", "@types/node": "12.12.11",
"@types/react": "16.9.9", "@types/react": "16.9.11",
"@types/react-dom": "16.9.2", "@types/react-dom": "16.9.4",
"prop-types": "^15.7.2", "prop-types": "^15.7.2",
"react": "^16.10.2", "react": "^16.10.2",
"react-dom": "^16.10.2", "react-dom": "^16.10.2",
"react-scripts": "3.2.0", "react-scripts": "3.2.0",
"typescript": "3.6.4" "typescript": "3.7.2"
}, },
"devDependencies": { "devDependencies": {
"@storybook/addon-a11y": "5.3.0-beta.3", "@storybook/addon-a11y": "5.3.0-beta.7",
"@storybook/addon-actions": "5.3.0-beta.3", "@storybook/addon-actions": "5.3.0-beta.7",
"@storybook/addon-info": "5.3.0-beta.3", "@storybook/addon-info": "5.3.0-beta.7",
"@storybook/addon-knobs": "5.3.0-beta.3", "@storybook/addon-knobs": "5.3.0-beta.7",
"@storybook/addon-links": "5.3.0-beta.3", "@storybook/addon-links": "5.3.0-beta.7",
"@storybook/addon-options": "5.3.0-beta.3", "@storybook/addon-options": "5.3.0-beta.7",
"@storybook/addons": "5.3.0-beta.3", "@storybook/addons": "5.3.0-beta.7",
"@storybook/preset-create-react-app": "^1.3.1", "@storybook/preset-create-react-app": "^1.3.1",
"@storybook/react": "5.3.0-beta.3", "@storybook/react": "5.3.0-beta.7",
"@types/enzyme": "^3.9.0", "@types/enzyme": "^3.9.0",
"@types/react": "^16.8.14", "@types/react": "^16.8.14",
"@types/react-dom": "^16.8.2", "@types/react-dom": "^16.8.2",

View File

@ -65,6 +65,7 @@ PropTypesProps.propTypes = {
classElementInline: PropTypes.element, classElementInline: PropTypes.element,
functionalElementType: PropTypes.elementType, functionalElementType: PropTypes.elementType,
classElementType: PropTypes.elementType, classElementType: PropTypes.elementType,
elementWithProps: PropTypes.elementType,
/** /**
* `instanceOf` is also supported and the custom type will be shown instead of `instanceOf` * `instanceOf` is also supported and the custom type will be shown instead of `instanceOf`
*/ */
@ -298,6 +299,7 @@ PropTypesProps.defaultProps = {
}, },
functionalElementType: FunctionalComponent, functionalElementType: FunctionalComponent,
classElementType: ClassComponent, classElementType: ClassComponent,
elementWithProps: <ClassComponent className="w8 h8 fill-marine-500" />,
instanceOf: new Set(), instanceOf: new Set(),
oneOfString: 'News', oneOfString: 'News',
oneOfNumeric: 1, oneOfNumeric: 1,

View File

@ -12,4 +12,4 @@ import { TypeScriptProps, TypeScriptHtmlComponent } from './ts-types';
<Props of={TypeScriptProps} /> <Props of={TypeScriptProps} />
<Props of={TypeScriptHtmlComponent} /> <Props of={TypeScriptHtmlComponent} />

View File

@ -1,22 +1,22 @@
{ {
"name": "@storybook/example-devkits", "name": "@storybook/example-devkits",
"version": "5.3.0-beta.3", "version": "5.3.0-beta.7",
"private": true, "private": true,
"scripts": { "scripts": {
"build-storybook": "build-storybook -c ./", "build-storybook": "build-storybook -c ./",
"storybook": "start-storybook -p 9011 -c ./" "storybook": "start-storybook -p 9011 -c ./"
}, },
"devDependencies": { "devDependencies": {
"@storybook/addon-decorator": "5.3.0-beta.3", "@storybook/addon-decorator": "5.3.0-beta.7",
"@storybook/addon-parameter": "5.3.0-beta.3", "@storybook/addon-parameter": "5.3.0-beta.7",
"@storybook/addon-preview-wrapper": "5.3.0-beta.3", "@storybook/addon-preview-wrapper": "5.3.0-beta.7",
"@storybook/addon-roundtrip": "5.3.0-beta.3", "@storybook/addon-roundtrip": "5.3.0-beta.7",
"@storybook/addons": "5.3.0-beta.3", "@storybook/addons": "5.3.0-beta.7",
"@storybook/components": "5.3.0-beta.3", "@storybook/components": "5.3.0-beta.7",
"@storybook/core-events": "5.3.0-beta.3", "@storybook/core-events": "5.3.0-beta.7",
"@storybook/node-logger": "5.3.0-beta.3", "@storybook/node-logger": "5.3.0-beta.7",
"@storybook/react": "5.3.0-beta.3", "@storybook/react": "5.3.0-beta.7",
"@storybook/theming": "5.3.0-beta.3", "@storybook/theming": "5.3.0-beta.7",
"cors": "^2.8.5", "cors": "^2.8.5",
"cross-env": "^6.0.3", "cross-env": "^6.0.3",
"enzyme-to-json": "^3.4.1", "enzyme-to-json": "^3.4.1",

View File

@ -1,6 +1,6 @@
{ {
"name": "ember-example", "name": "ember-example",
"version": "5.3.0-beta.3", "version": "5.3.0-beta.7",
"private": true, "private": true,
"scripts": { "scripts": {
"build": "ember build", "build": "ember build",
@ -15,19 +15,19 @@
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.3.4", "@babel/core": "^7.3.4",
"@storybook/addon-a11y": "5.3.0-beta.3", "@storybook/addon-a11y": "5.3.0-beta.7",
"@storybook/addon-actions": "5.3.0-beta.3", "@storybook/addon-actions": "5.3.0-beta.7",
"@storybook/addon-backgrounds": "5.3.0-beta.3", "@storybook/addon-backgrounds": "5.3.0-beta.7",
"@storybook/addon-centered": "5.3.0-beta.3", "@storybook/addon-centered": "5.3.0-beta.7",
"@storybook/addon-knobs": "5.3.0-beta.3", "@storybook/addon-knobs": "5.3.0-beta.7",
"@storybook/addon-links": "5.3.0-beta.3", "@storybook/addon-links": "5.3.0-beta.7",
"@storybook/addon-notes": "5.3.0-beta.3", "@storybook/addon-notes": "5.3.0-beta.7",
"@storybook/addon-options": "5.3.0-beta.3", "@storybook/addon-options": "5.3.0-beta.7",
"@storybook/addon-storysource": "5.3.0-beta.3", "@storybook/addon-storysource": "5.3.0-beta.7",
"@storybook/addon-viewport": "5.3.0-beta.3", "@storybook/addon-viewport": "5.3.0-beta.7",
"@storybook/addons": "5.3.0-beta.3", "@storybook/addons": "5.3.0-beta.7",
"@storybook/ember": "5.3.0-beta.3", "@storybook/ember": "5.3.0-beta.7",
"@storybook/source-loader": "5.3.0-beta.3", "@storybook/source-loader": "5.3.0-beta.7",
"babel-loader": "^8", "babel-loader": "^8",
"broccoli-asset-rev": "^3.0.0", "broccoli-asset-rev": "^3.0.0",
"cross-env": "^6.0.3", "cross-env": "^6.0.3",

View File

@ -1,6 +1,6 @@
{ {
"name": "html-kitchen-sink", "name": "html-kitchen-sink",
"version": "5.3.0-beta.3", "version": "5.3.0-beta.7",
"private": true, "private": true,
"description": "", "description": "",
"keywords": [], "keywords": [],
@ -13,26 +13,26 @@
"storybook": "start-storybook -p 9006" "storybook": "start-storybook -p 9006"
}, },
"devDependencies": { "devDependencies": {
"@storybook/addon-a11y": "5.3.0-beta.3", "@storybook/addon-a11y": "5.3.0-beta.7",
"@storybook/addon-actions": "5.3.0-beta.3", "@storybook/addon-actions": "5.3.0-beta.7",
"@storybook/addon-backgrounds": "5.3.0-beta.3", "@storybook/addon-backgrounds": "5.3.0-beta.7",
"@storybook/addon-centered": "5.3.0-beta.3", "@storybook/addon-centered": "5.3.0-beta.7",
"@storybook/addon-docs": "5.3.0-beta.3", "@storybook/addon-docs": "5.3.0-beta.7",
"@storybook/addon-events": "5.3.0-beta.3", "@storybook/addon-events": "5.3.0-beta.7",
"@storybook/addon-jest": "5.3.0-beta.3", "@storybook/addon-jest": "5.3.0-beta.7",
"@storybook/addon-knobs": "5.3.0-beta.3", "@storybook/addon-knobs": "5.3.0-beta.7",
"@storybook/addon-links": "5.3.0-beta.3", "@storybook/addon-links": "5.3.0-beta.7",
"@storybook/addon-notes": "5.3.0-beta.3", "@storybook/addon-notes": "5.3.0-beta.7",
"@storybook/addon-options": "5.3.0-beta.3", "@storybook/addon-options": "5.3.0-beta.7",
"@storybook/addon-storyshots": "5.3.0-beta.3", "@storybook/addon-storyshots": "5.3.0-beta.7",
"@storybook/addon-storysource": "5.3.0-beta.3", "@storybook/addon-storysource": "5.3.0-beta.7",
"@storybook/addon-viewport": "5.3.0-beta.3", "@storybook/addon-viewport": "5.3.0-beta.7",
"@storybook/addons": "5.3.0-beta.3", "@storybook/addons": "5.3.0-beta.7",
"@storybook/client-api": "5.3.0-beta.3", "@storybook/client-api": "5.3.0-beta.7",
"@storybook/core": "5.3.0-beta.3", "@storybook/core": "5.3.0-beta.7",
"@storybook/core-events": "5.3.0-beta.3", "@storybook/core-events": "5.3.0-beta.7",
"@storybook/html": "5.3.0-beta.3", "@storybook/html": "5.3.0-beta.7",
"@storybook/source-loader": "5.3.0-beta.3", "@storybook/source-loader": "5.3.0-beta.7",
"eventemitter3": "^4.0.0", "eventemitter3": "^4.0.0",
"format-json": "^1.0.3", "format-json": "^1.0.3",
"global": "^4.3.2", "global": "^4.3.2",

View File

@ -1,6 +1,6 @@
{ {
"name": "marko-cli", "name": "marko-cli",
"version": "5.3.0-beta.3", "version": "5.3.0-beta.7",
"private": true, "private": true,
"description": "Demo of how to build an app using marko-starter", "description": "Demo of how to build an app using marko-starter",
"repository": { "repository": {
@ -19,18 +19,18 @@
"test": "npm run lint" "test": "npm run lint"
}, },
"dependencies": { "dependencies": {
"marko": "^4.16.15", "marko": "^4.18.25",
"marko-starter": "^2.0.4" "marko-starter": "^2.1.0"
}, },
"devDependencies": { "devDependencies": {
"@storybook/addon-a11y": "5.3.0-beta.3", "@storybook/addon-a11y": "5.3.0-beta.7",
"@storybook/addon-actions": "5.3.0-beta.3", "@storybook/addon-actions": "5.3.0-beta.7",
"@storybook/addon-knobs": "5.3.0-beta.3", "@storybook/addon-knobs": "5.3.0-beta.7",
"@storybook/addon-options": "5.3.0-beta.3", "@storybook/addon-options": "5.3.0-beta.7",
"@storybook/addon-storysource": "5.3.0-beta.3", "@storybook/addon-storysource": "5.3.0-beta.7",
"@storybook/addons": "5.3.0-beta.3", "@storybook/addons": "5.3.0-beta.7",
"@storybook/marko": "5.3.0-beta.3", "@storybook/marko": "5.3.0-beta.7",
"@storybook/source-loader": "5.3.0-beta.3", "@storybook/source-loader": "5.3.0-beta.7",
"prettier": "^1.16.4", "prettier": "^1.16.4",
"webpack": "^4.33.0" "webpack": "^4.33.0"
} }

View File

@ -1,6 +1,6 @@
{ {
"name": "mithril-example", "name": "mithril-example",
"version": "5.3.0-beta.3", "version": "5.3.0-beta.7",
"private": true, "private": true,
"scripts": { "scripts": {
"build-storybook": "build-storybook", "build-storybook": "build-storybook",
@ -10,20 +10,20 @@
"mithril": "^1.1.6" "mithril": "^1.1.6"
}, },
"devDependencies": { "devDependencies": {
"@storybook/addon-a11y": "5.3.0-beta.3", "@storybook/addon-a11y": "5.3.0-beta.7",
"@storybook/addon-actions": "5.3.0-beta.3", "@storybook/addon-actions": "5.3.0-beta.7",
"@storybook/addon-backgrounds": "5.3.0-beta.3", "@storybook/addon-backgrounds": "5.3.0-beta.7",
"@storybook/addon-centered": "5.3.0-beta.3", "@storybook/addon-centered": "5.3.0-beta.7",
"@storybook/addon-knobs": "5.3.0-beta.3", "@storybook/addon-knobs": "5.3.0-beta.7",
"@storybook/addon-links": "5.3.0-beta.3", "@storybook/addon-links": "5.3.0-beta.7",
"@storybook/addon-notes": "5.3.0-beta.3", "@storybook/addon-notes": "5.3.0-beta.7",
"@storybook/addon-options": "5.3.0-beta.3", "@storybook/addon-options": "5.3.0-beta.7",
"@storybook/addon-storyshots": "5.3.0-beta.3", "@storybook/addon-storyshots": "5.3.0-beta.7",
"@storybook/addon-storysource": "5.3.0-beta.3", "@storybook/addon-storysource": "5.3.0-beta.7",
"@storybook/addon-viewport": "5.3.0-beta.3", "@storybook/addon-viewport": "5.3.0-beta.7",
"@storybook/addons": "5.3.0-beta.3", "@storybook/addons": "5.3.0-beta.7",
"@storybook/mithril": "5.3.0-beta.3", "@storybook/mithril": "5.3.0-beta.7",
"@storybook/source-loader": "5.3.0-beta.3", "@storybook/source-loader": "5.3.0-beta.7",
"webpack": "^4.33.0" "webpack": "^4.33.0"
} }
} }

View File

@ -20,7 +20,7 @@ if (!fs.existsSync(pathToStorybookStatic)) {
} else { } else {
initStoryshots({ initStoryshots({
suite: 'Image snapshots', suite: 'Image snapshots',
storyKindRegex: /^Addons\|Storyshots/, storyKindRegex: /^Addons\/Storyshots/,
framework: 'react', framework: 'react',
configPath: path.join(__dirname, '..'), configPath: path.join(__dirname, '..'),
test: imageSnapshot({ test: imageSnapshot({

View File

@ -1,6 +1,6 @@
{ {
"name": "official-storybook", "name": "official-storybook",
"version": "5.3.0-beta.3", "version": "5.3.0-beta.7",
"private": true, "private": true,
"scripts": { "scripts": {
"build-storybook": "cross-env STORYBOOK_DISPLAY_WARNING=true DISPLAY_WARNING=true build-storybook -c ./", "build-storybook": "cross-env STORYBOOK_DISPLAY_WARNING=true DISPLAY_WARNING=true build-storybook -c ./",
@ -13,34 +13,34 @@
}, },
"devDependencies": { "devDependencies": {
"@packtracker/webpack-plugin": "^2.0.1", "@packtracker/webpack-plugin": "^2.0.1",
"@storybook/addon-a11y": "5.3.0-beta.3", "@storybook/addon-a11y": "5.3.0-beta.7",
"@storybook/addon-actions": "5.3.0-beta.3", "@storybook/addon-actions": "5.3.0-beta.7",
"@storybook/addon-backgrounds": "5.3.0-beta.3", "@storybook/addon-backgrounds": "5.3.0-beta.7",
"@storybook/addon-centered": "5.3.0-beta.3", "@storybook/addon-centered": "5.3.0-beta.7",
"@storybook/addon-contexts": "5.3.0-beta.3", "@storybook/addon-contexts": "5.3.0-beta.7",
"@storybook/addon-cssresources": "5.3.0-beta.3", "@storybook/addon-cssresources": "5.3.0-beta.7",
"@storybook/addon-design-assets": "5.3.0-beta.3", "@storybook/addon-design-assets": "5.3.0-beta.7",
"@storybook/addon-docs": "5.3.0-beta.3", "@storybook/addon-docs": "5.3.0-beta.7",
"@storybook/addon-events": "5.3.0-beta.3", "@storybook/addon-events": "5.3.0-beta.7",
"@storybook/addon-graphql": "5.3.0-beta.3", "@storybook/addon-graphql": "5.3.0-beta.7",
"@storybook/addon-info": "5.3.0-beta.3", "@storybook/addon-info": "5.3.0-beta.7",
"@storybook/addon-jest": "5.3.0-beta.3", "@storybook/addon-jest": "5.3.0-beta.7",
"@storybook/addon-knobs": "5.3.0-beta.3", "@storybook/addon-knobs": "5.3.0-beta.7",
"@storybook/addon-links": "5.3.0-beta.3", "@storybook/addon-links": "5.3.0-beta.7",
"@storybook/addon-notes": "5.3.0-beta.3", "@storybook/addon-notes": "5.3.0-beta.7",
"@storybook/addon-options": "5.3.0-beta.3", "@storybook/addon-options": "5.3.0-beta.7",
"@storybook/addon-queryparams": "5.3.0-beta.3", "@storybook/addon-queryparams": "5.3.0-beta.7",
"@storybook/addon-storyshots": "5.3.0-beta.3", "@storybook/addon-storyshots": "5.3.0-beta.7",
"@storybook/addon-storyshots-puppeteer": "5.3.0-beta.3", "@storybook/addon-storyshots-puppeteer": "5.3.0-beta.7",
"@storybook/addon-storysource": "5.3.0-beta.3", "@storybook/addon-storysource": "5.3.0-beta.7",
"@storybook/addon-viewport": "5.3.0-beta.3", "@storybook/addon-viewport": "5.3.0-beta.7",
"@storybook/addons": "5.3.0-beta.3", "@storybook/addons": "5.3.0-beta.7",
"@storybook/components": "5.3.0-beta.3", "@storybook/components": "5.3.0-beta.7",
"@storybook/core-events": "5.3.0-beta.3", "@storybook/core-events": "5.3.0-beta.7",
"@storybook/node-logger": "5.3.0-beta.3", "@storybook/node-logger": "5.3.0-beta.7",
"@storybook/react": "5.3.0-beta.3", "@storybook/react": "5.3.0-beta.7",
"@storybook/source-loader": "5.3.0-beta.3", "@storybook/source-loader": "5.3.0-beta.7",
"@storybook/theming": "5.3.0-beta.3", "@storybook/theming": "5.3.0-beta.7",
"cors": "^2.8.5", "cors": "^2.8.5",
"cross-env": "^6.0.3", "cross-env": "^6.0.3",
"enzyme-to-json": "^3.4.1", "enzyme-to-json": "^3.4.1",
@ -61,5 +61,8 @@
"ts-loader": "^6.0.0", "ts-loader": "^6.0.0",
"uuid": "^3.3.2", "uuid": "^3.3.2",
"webpack": "^4.33.0" "webpack": "^4.33.0"
},
"optionalDependencies": {
"puppeteer": "^2.0.0"
} }
} }

View File

@ -88,6 +88,10 @@ export const nonStory2 = () => <Button>Not a story</Button>; // another one
<>This is an iframe!</> <>This is an iframe!</>
</Story> </Story>
<Story name="decorator story" decorators={[storyFn => <div style={{ backgroundColor: 'pink' }}>{storyFn()}</div>]}>
<>Story decorators</>
</Story>
<Story name="theme"> <Story name="theme">
<h1 className="text-lg">Hello Hugh</h1> <h1 className="text-lg">Hello Hugh</h1>
</Story> </Story>

View File

@ -1,6 +1,6 @@
{ {
"name": "polymer-cli", "name": "polymer-cli",
"version": "5.3.0-beta.3", "version": "5.3.0-beta.7",
"private": true, "private": true,
"scripts": { "scripts": {
"build-storybook": "build-storybook", "build-storybook": "build-storybook",
@ -9,17 +9,17 @@
}, },
"dependencies": { "dependencies": {
"@polymer/polymer": "^2.6.0", "@polymer/polymer": "^2.6.0",
"@storybook/addon-a11y": "5.3.0-beta.3", "@storybook/addon-a11y": "5.3.0-beta.7",
"@storybook/addon-actions": "5.3.0-beta.3", "@storybook/addon-actions": "5.3.0-beta.7",
"@storybook/addon-backgrounds": "5.3.0-beta.3", "@storybook/addon-backgrounds": "5.3.0-beta.7",
"@storybook/addon-knobs": "5.3.0-beta.3", "@storybook/addon-knobs": "5.3.0-beta.7",
"@storybook/addon-links": "5.3.0-beta.3", "@storybook/addon-links": "5.3.0-beta.7",
"@storybook/addon-notes": "5.3.0-beta.3", "@storybook/addon-notes": "5.3.0-beta.7",
"@storybook/addon-options": "5.3.0-beta.3", "@storybook/addon-options": "5.3.0-beta.7",
"@storybook/addon-storysource": "5.3.0-beta.3", "@storybook/addon-storysource": "5.3.0-beta.7",
"@storybook/addon-viewport": "5.3.0-beta.3", "@storybook/addon-viewport": "5.3.0-beta.7",
"@storybook/polymer": "5.3.0-beta.3", "@storybook/polymer": "5.3.0-beta.7",
"@storybook/source-loader": "5.3.0-beta.3", "@storybook/source-loader": "5.3.0-beta.7",
"@webcomponents/webcomponentsjs": "^1.2.0", "@webcomponents/webcomponentsjs": "^1.2.0",
"global": "^4.3.2", "global": "^4.3.2",
"lit-html": "^1.0.0", "lit-html": "^1.0.0",

View File

@ -1,6 +1,6 @@
{ {
"name": "preact-example", "name": "preact-example",
"version": "5.3.0-beta.3", "version": "5.3.0-beta.7",
"private": true, "private": true,
"scripts": { "scripts": {
"build": "cross-env NODE_ENV=production webpack --progress --hide-modules", "build": "cross-env NODE_ENV=production webpack --progress --hide-modules",
@ -15,21 +15,21 @@
"devDependencies": { "devDependencies": {
"@babel/core": "^7.3.4", "@babel/core": "^7.3.4",
"@babel/plugin-transform-runtime": "^7.2.0", "@babel/plugin-transform-runtime": "^7.2.0",
"@storybook/addon-a11y": "5.3.0-beta.3", "@storybook/addon-a11y": "5.3.0-beta.7",
"@storybook/addon-actions": "5.3.0-beta.3", "@storybook/addon-actions": "5.3.0-beta.7",
"@storybook/addon-backgrounds": "5.3.0-beta.3", "@storybook/addon-backgrounds": "5.3.0-beta.7",
"@storybook/addon-centered": "5.3.0-beta.3", "@storybook/addon-centered": "5.3.0-beta.7",
"@storybook/addon-contexts": "5.3.0-beta.3", "@storybook/addon-contexts": "5.3.0-beta.7",
"@storybook/addon-knobs": "5.3.0-beta.3", "@storybook/addon-knobs": "5.3.0-beta.7",
"@storybook/addon-links": "5.3.0-beta.3", "@storybook/addon-links": "5.3.0-beta.7",
"@storybook/addon-notes": "5.3.0-beta.3", "@storybook/addon-notes": "5.3.0-beta.7",
"@storybook/addon-options": "5.3.0-beta.3", "@storybook/addon-options": "5.3.0-beta.7",
"@storybook/addon-storyshots": "5.3.0-beta.3", "@storybook/addon-storyshots": "5.3.0-beta.7",
"@storybook/addon-storysource": "5.3.0-beta.3", "@storybook/addon-storysource": "5.3.0-beta.7",
"@storybook/addon-viewport": "5.3.0-beta.3", "@storybook/addon-viewport": "5.3.0-beta.7",
"@storybook/addons": "5.3.0-beta.3", "@storybook/addons": "5.3.0-beta.7",
"@storybook/preact": "5.3.0-beta.3", "@storybook/preact": "5.3.0-beta.7",
"@storybook/source-loader": "5.3.0-beta.3", "@storybook/source-loader": "5.3.0-beta.7",
"babel-loader": "^8.0.4", "babel-loader": "^8.0.4",
"cross-env": "^6.0.3", "cross-env": "^6.0.3",
"file-loader": "^4.2.0", "file-loader": "^4.2.0",

View File

@ -1,6 +1,6 @@
{ {
"name": "rax-kitchen-sink", "name": "rax-kitchen-sink",
"version": "5.3.0-beta.3", "version": "5.3.0-beta.7",
"private": true, "private": true,
"scripts": { "scripts": {
"build": "rax-scripts build", "build": "rax-scripts build",
@ -14,30 +14,30 @@
}, },
"dependencies": { "dependencies": {
"event-emitter": "^0.3.5", "event-emitter": "^0.3.5",
"rax": "^1.0.0", "rax": "^1.1.0",
"rax-image": "^1.0.0", "rax-image": "^1.0.0",
"rax-link": "^1.0.0", "rax-link": "^1.0.0",
"rax-text": "^1.0.0", "rax-text": "^1.1.2",
"rax-view": "^1.0.0" "rax-view": "^1.0.0"
}, },
"devDependencies": { "devDependencies": {
"@storybook/addon-a11y": "5.3.0-beta.3", "@storybook/addon-a11y": "5.3.0-beta.7",
"@storybook/addon-actions": "5.3.0-beta.3", "@storybook/addon-actions": "5.3.0-beta.7",
"@storybook/addon-backgrounds": "5.3.0-beta.3", "@storybook/addon-backgrounds": "5.3.0-beta.7",
"@storybook/addon-centered": "5.3.0-beta.3", "@storybook/addon-centered": "5.3.0-beta.7",
"@storybook/addon-events": "5.3.0-beta.3", "@storybook/addon-events": "5.3.0-beta.7",
"@storybook/addon-info": "5.3.0-beta.3", "@storybook/addon-info": "5.3.0-beta.7",
"@storybook/addon-jest": "5.3.0-beta.3", "@storybook/addon-jest": "5.3.0-beta.7",
"@storybook/addon-knobs": "5.3.0-beta.3", "@storybook/addon-knobs": "5.3.0-beta.7",
"@storybook/addon-links": "5.3.0-beta.3", "@storybook/addon-links": "5.3.0-beta.7",
"@storybook/addon-notes": "5.3.0-beta.3", "@storybook/addon-notes": "5.3.0-beta.7",
"@storybook/addon-options": "5.3.0-beta.3", "@storybook/addon-options": "5.3.0-beta.7",
"@storybook/addon-storyshots": "5.3.0-beta.3", "@storybook/addon-storyshots": "5.3.0-beta.7",
"@storybook/addon-storysource": "5.3.0-beta.3", "@storybook/addon-storysource": "5.3.0-beta.7",
"@storybook/addon-viewport": "5.3.0-beta.3", "@storybook/addon-viewport": "5.3.0-beta.7",
"@storybook/addons": "5.3.0-beta.3", "@storybook/addons": "5.3.0-beta.7",
"@storybook/rax": "5.3.0-beta.3", "@storybook/rax": "5.3.0-beta.7",
"@storybook/source-loader": "5.3.0-beta.3", "@storybook/source-loader": "5.3.0-beta.7",
"babel-eslint": "^10.0.3", "babel-eslint": "^10.0.3",
"babel-preset-rax": "^1.0.0-beta.0", "babel-preset-rax": "^1.0.0-beta.0",
"rax-scripts": "^2.0.0", "rax-scripts": "^2.0.0",

View File

@ -13,7 +13,7 @@ Object {
"children": Array [ "children": Array [
Object { Object {
"attributes": Object { "attributes": Object {
"class": "rax-text", "class": "rax-text ",
}, },
"children": Array [ "children": Array [
"Welcome to Rax", "Welcome to Rax",
@ -28,7 +28,7 @@ Object {
}, },
Object { Object {
"attributes": Object { "attributes": Object {
"class": "rax-text", "class": "rax-text ",
}, },
"children": Array [ "children": Array [
"To get started, edit src/components/App.js and save to reload.", "To get started, edit src/components/App.js and save to reload.",

View File

@ -8,7 +8,7 @@ Object {
"children": Array [ "children": Array [
Object { Object {
"attributes": Object { "attributes": Object {
"class": "rax-text", "class": "rax-text ",
}, },
"children": Array [ "children": Array [
"Welcome to storybook for Rax", "Welcome to storybook for Rax",
@ -49,7 +49,7 @@ Object {
"children": Array [ "children": Array [
Object { Object {
"attributes": Object { "attributes": Object {
"class": "rax-text", "class": "rax-text ",
}, },
"children": Array [ "children": Array [
"This is a UI component dev environment for your Rax app.", "This is a UI component dev environment for your Rax app.",
@ -73,7 +73,7 @@ Object {
"children": Array [ "children": Array [
Object { Object {
"attributes": Object { "attributes": Object {
"class": "rax-text", "class": "rax-text ",
}, },
"children": Array [ "children": Array [
"We&#x27;ve added some basic stories inside the &#x27;src/stories&#x27; directory. A story is a single state of one or more UI components. You can have as many stories as you want. (Basically a story is like a visual test case.)", "We&#x27;ve added some basic stories inside the &#x27;src/stories&#x27; directory. A story is a single state of one or more UI components. You can have as many stories as you want. (Basically a story is like a visual test case.)",
@ -97,7 +97,7 @@ Object {
"children": Array [ "children": Array [
Object { Object {
"attributes": Object { "attributes": Object {
"class": "rax-text", "class": "rax-text ",
}, },
"children": Array [ "children": Array [
"See these sample", "See these sample",
@ -126,7 +126,7 @@ Object {
"children": Array [ "children": Array [
Object { Object {
"attributes": Object { "attributes": Object {
"class": "rax-text", "class": "rax-text ",
}, },
"children": Array [ "children": Array [
"button", "button",
@ -153,7 +153,7 @@ Object {
"children": Array [ "children": Array [
Object { Object {
"attributes": Object { "attributes": Object {
"class": "rax-text", "class": "rax-text ",
}, },
"children": Array [ "children": Array [
"for a component called &#x27;Button&#x27;.", "for a component called &#x27;Button&#x27;.",
@ -177,7 +177,7 @@ Object {
"children": Array [ "children": Array [
Object { Object {
"attributes": Object { "attributes": Object {
"class": "rax-text", "class": "rax-text ",
}, },
"children": Array [ "children": Array [
"Just like that, you can add your own components as stories. You can also edit those components and see changes right away. (Try editing the &#x27;Button&#x27; stories located at &#x27;src/stories/index.js&#x27; .)", "Just like that, you can add your own components as stories. You can also edit those components and see changes right away. (Try editing the &#x27;Button&#x27; stories located at &#x27;src/stories/index.js&#x27; .)",

View File

@ -1,6 +1,6 @@
{ {
"name": "riot-example", "name": "riot-example",
"version": "5.3.0-beta.3", "version": "5.3.0-beta.7",
"private": true, "private": true,
"scripts": { "scripts": {
"build": "cross-env NODE_ENV=production webpack --progress --hide-modules", "build": "cross-env NODE_ENV=production webpack --progress --hide-modules",
@ -15,20 +15,20 @@
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.3.4", "@babel/core": "^7.3.4",
"@storybook/addon-a11y": "5.3.0-beta.3", "@storybook/addon-a11y": "5.3.0-beta.7",
"@storybook/addon-actions": "5.3.0-beta.3", "@storybook/addon-actions": "5.3.0-beta.7",
"@storybook/addon-backgrounds": "5.3.0-beta.3", "@storybook/addon-backgrounds": "5.3.0-beta.7",
"@storybook/addon-centered": "5.3.0-beta.3", "@storybook/addon-centered": "5.3.0-beta.7",
"@storybook/addon-knobs": "5.3.0-beta.3", "@storybook/addon-knobs": "5.3.0-beta.7",
"@storybook/addon-links": "5.3.0-beta.3", "@storybook/addon-links": "5.3.0-beta.7",
"@storybook/addon-notes": "5.3.0-beta.3", "@storybook/addon-notes": "5.3.0-beta.7",
"@storybook/addon-options": "5.3.0-beta.3", "@storybook/addon-options": "5.3.0-beta.7",
"@storybook/addon-storyshots": "5.3.0-beta.3", "@storybook/addon-storyshots": "5.3.0-beta.7",
"@storybook/addon-storysource": "5.3.0-beta.3", "@storybook/addon-storysource": "5.3.0-beta.7",
"@storybook/addon-viewport": "5.3.0-beta.3", "@storybook/addon-viewport": "5.3.0-beta.7",
"@storybook/addons": "5.3.0-beta.3", "@storybook/addons": "5.3.0-beta.7",
"@storybook/riot": "5.3.0-beta.3", "@storybook/riot": "5.3.0-beta.7",
"@storybook/source-loader": "5.3.0-beta.3", "@storybook/source-loader": "5.3.0-beta.7",
"babel-loader": "^8.0.4", "babel-loader": "^8.0.4",
"cross-env": "^6.0.3", "cross-env": "^6.0.3",
"file-loader": "^4.2.0", "file-loader": "^4.2.0",

Some files were not shown because too many files have changed in this diff Show More