Skip to content

Commit

Permalink
Merge branch 'master' into contributing-reviewer-policy
Browse files Browse the repository at this point in the history
  • Loading branch information
ndelangen authored Apr 23, 2017
2 parents 588dba4 + d919b03 commit 1a1a3f9
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Storybook is a development environment for React UI components. It allows you to

Storybook runs outside of your app. This allows you to develop UI components in isolation, which can improve component reuse, testability, and development speed. You can build quickly without having to worry about application-specific dependencies.

Storybook comes with a lot of [addons](https://storybooks.js.org) for component design, documentation, testing, interactivity, and so on. Storybook's easy-to-use API makes it easy to configure and extend in various ways. It has even been extended to support React Native development for mobile.
Storybook comes with a lot of [addons](https://storybooks.js.org/docs/react-storybook/addons/introduction) for component design, documentation, testing, interactivity, and so on. Storybook's easy-to-use API makes it easy to configure and extend in various ways. It has even been extended to support React Native development for mobile.

## Getting Started

Expand Down
17 changes: 16 additions & 1 deletion packages/react-storybook/config/storybook.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
declare var module: any; // dangerous

type RenderFunction = Function;

interface StoryDecorator {
(story: Function, context: { kind: string, story: string }): Object | null;
(story: RenderFunction, context: { kind: string, story: string }): Object | null;
}

interface Story {
Expand All @@ -10,6 +12,19 @@ interface Story {
}

export function addDecorator(decorator: StoryDecorator): void;
export function configure(fn: Function, module: any): void;
export function linkTo(name: string, ...params: any[]): void;
export function storiesOf(name: string, module: any): Story;
export function action(name: string, ...params: any[]): any;

type StoryObject = {
name: string,
render: RenderFunction,
};

type StoryBucket = {
kind: string,
stories: StoryObject[],
};

export function getStorybook(): StoryBucket[];
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import webpack from 'webpack';
import autoprefixer from 'autoprefixer';
import { includePaths } from '../utils';
import { includePaths, excludePaths } from '../utils';

// Add a default custom config which is similar to what React Create App does.
module.exports = storybookBaseConfig => {
Expand Down Expand Up @@ -57,12 +58,6 @@ module.exports = storybookBaseConfig => {
},
];

newConfig.postcss = () => [
autoprefixer({
browsers: ['>1%', 'last 4 versions', 'Firefox ESR', 'not ie < 9'],
}),
];

newConfig.resolve.alias = {
...storybookBaseConfig.resolve.alias,
// This is to support NPM2
Expand Down

0 comments on commit 1a1a3f9

Please sign in to comment.