Skip to content

Commit

Permalink
CHANGE folder structure && CHANGE package-names
Browse files Browse the repository at this point in the history
  • Loading branch information
ndelangen committed May 14, 2017
1 parent 13f9c48 commit 3c0fde5
Show file tree
Hide file tree
Showing 430 changed files with 187 additions and 185 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Uncomment to register defaults
// import '@storybook/storybook/addons';
// import '@storybook/addons';

// Use the line below to register this addon
// import '@storybook/storybook-addon-hello/register';
// import '@storybook/addon-actions/register';
import '../register';
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
import * as storybook from '@storybook/storybook';
import * as storybook from '@storybook/react';
storybook.configure(() => require('./stories'), module);
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { storiesOf } from '@storybook/storybook';
import { storiesOf } from '@storybook/react';
import { action, decorateAction } from '../src';

const pickFirst = decorateAction([
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions packages/addon-actions/README.md → addons/actions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ Import the `action` function and use it to create actions handlers. When creatin
> *Note: Make sure NOT to use reserved words as function names. [issues#29](https://github.com/storybooks/storybook-addon-actions/issues/29#issuecomment-288274794)*
```js
import { storiesOf, action } from '@storybook/storybook'
// or import { action } from '@storybook/storybook-addon-actions'
import { storiesOf, action } from '@storybook/react'
// or import { action } from '@storybook/addon-actions'

storiesOf('Button', module)
.add('default view', () => (
Expand All @@ -31,7 +31,7 @@ If you wish to process action data before sending them over to the logger, you c
`decorateAction` takes an array of decorator functions. Each decorator function is passed an array of arguments, and should return a new arguments array to use. `decorateAction` returns a function that can be used like `action` but will log the modified arguments instead of the original arguments.

```js
import { action, decorateAction } from '@storybook/storybook-addon-actions'
import { action, decorateAction } from '@storybook/addon-actions'

const firstArgAction = decorateAction([
args => args.slice(0, 1)
Expand Down
File renamed without changes
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
},
"homepage": "https://github.com/storybooks/storybook/tree/master/packages/addon-actions",
"devDependencies": {
"@storybook/storybook": "*",
"@storybook/storybook-addons": "*",
"@storybook/storybook-ui": "*",
"@storybook/react": "*",
"@storybook/addons": "*",
"@storybook/ui": "*",
"react": "^15.5.4",
"react-dom": "^15.5.4",
"react-test-renderer": "^15.5.4",
Expand All @@ -36,7 +36,7 @@
"react-inspector": "^1.1.0"
},
"peerDependencies": {
"@storybook/storybook-addons": "*",
"@storybook/addons": "*",
"react": "*",
"react-dom": "*"
}
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import addons from '@storybook/storybook-addons';
import addons from '@storybook/addons';
import ActionLogger from './containers/ActionLogger';
import { ADDON_ID, PANEL_ID } from './';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import addons from '@storybook/storybook-addons';
import addons from '@storybook/addons';
import stringify from 'json-stringify-safe';
import { EVENT_ID } from './';

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Uncomment to register defaults
// import '@storybook/storybook/addons';
// import '@storybook/addons';

// Use the line below to register this addon
// import '@storybook/storybook-addon-comments/register';
import '@storybook/storybook-addon-actions/register';
// import '@storybook/addon-comments/register';
import '@storybook/addon-actions/register';
import '@storybook/storybook-database-cloud/register';
import { init } from '../src/manager';
init();
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// This is an auto generated file with React CDK.
// Do not modify this file.

import { configure } from '@storybook/storybook';
import { configure } from '@storybook/react';

function loadStories() {
require('../src/stories');
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ This Storybook addon allows you to add comments for your stories. This addon wor
First, install the addon

```shell
npm install -D @storybook/storybook-addon-comments
npm install -D @storybook/addon-comments
```

Add this line to your `addons.js` file (create this file inside your storybook config directory if needed).

```js
import '@storybook/storybook-addon-comments/register';
import '@storybook/addon-comments/register';
```
File renamed without changes
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,19 @@
"react-textarea-autosize": "^4.0.5"
},
"devDependencies": {
"@storybook/storybook": "*",
"@storybook/storybook-addons": "*",
"@storybook/react": "*",
"@storybook/addons": "*",
"@storybook/storybook-database-cloud": "*",
"@storybook/storybook-deployer": "*",
"@storybook/storybook-ui": "*",
"@storybook/ui": "*",
"git-url-parse": "^6.0.1",
"react": "^15.5.4",
"react-dom": "^15.5.4",
"react-test-renderer": "^15.5.4",
"shelljs": "^0.7.4"
},
"peerDependencies": {
"@storybook/storybook-addons": "*",
"@storybook/addons": "*",
"react": "*",
"react-dom": "*"
}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import PropTypes from 'prop-types';
import React, { Component } from 'react';
import addons from '@storybook/storybook-addons';
import addons from '@storybook/addons';
import CommentsPanel from '../../components/CommentsPanel/';
import DataStore from './dataStore';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint import/prefer-default-export:0 */

import React from 'react';
import addons from '@storybook/storybook-addons';
import addons from '@storybook/addons';
import CommentsPanel from './containers/CommentsPanel';
import { ADDON_ID, PANEL_ID } from '../shared';

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { storiesOf, action } from '@storybook/storybook';
import { storiesOf, action } from '@storybook/react';
import Button from '../index';
import CommentForm from '../manager/components/CommentForm';
import CommentList from '../manager/components/CommentList';
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ You can set the decorator locally:

```js
import React from 'react';
import { storiesOf } from '@storybook/storybook';
import { storiesOf } from '@storybook/react';
import MyComponent from '../my_component';
import centered from '@storybook/react-storybook-decorator-centered';

Expand All @@ -26,7 +26,7 @@ storiesOf('MyComponent', module)
Or you can also add this decorator globally:

```js
import { configure, addDecorator } from '@storybook/storybook';
import { configure, addDecorator } from '@storybook/react';
import centered from '@storybook/react-storybook-decorator-centered';

addDecorator(centered);
Expand All @@ -41,7 +41,7 @@ configure(function () {

```js
import React from 'react';
import { configure, setAddon } from '@storybook/storybook';
import { configure, setAddon } from '@storybook/react';
import centered from '@storybook/react-storybook-decorator-centered';

setAddon({
Expand All @@ -61,7 +61,7 @@ configure(function () {

```js
import React from 'react';
import { storiesOf } from '@storybook/storybook';
import { storiesOf } from '@storybook/react';
import MyComponent from '../my_component';

storiesOf('MyComponent', module)
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@storybook/react-storybook-decorator-centered",
"name": "@storybook/decorator-centered",
"version": "1.1.2",
"description": "React Storybook decorator to center components",
"main": "build/index.js",
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
import * as storybook from '@storybook/storybook';
import * as storybook from '@storybook/react';
storybook.configure(() => require('./stories'), module);
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { storiesOf } from '@storybook/storybook'
import { storiesOf } from '@storybook/react'
import { setupGraphiQL } from '../src'

// setup the graphiql helper which can be used with the add method later
Expand Down
File renamed without changes.
10 changes: 5 additions & 5 deletions packages/addon-graphql/README.md → addons/graphql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ The GraphiQL addon can be used to display the GraphiQL IDE with example queries.
First, install the addon

```shell
npm install -D @storybook/storybook-addon-graphql
npm install -D @storybook/addon-graphql
```

Import the `setupGraphiQL` function and use it to create the graphiql helper with a base url.

```js
import { storiesOf } from '@storybook/storybook'
import { setupGraphiQL } from '@storybook/storybook-addon-graphql'
import { storiesOf } from '@storybook/react'
import { setupGraphiQL } from '@storybook/addon-graphql'

// setup the graphiql helper which can be used with the add method later
const graphiql = setupGraphiQL({ url: 'http://localhost:3000/graphql' });
Expand All @@ -36,8 +36,8 @@ storiesOf('GraphQL Demo', module)
The `setupGraphiQL` function also accepts a fetcher parameter which can be used to change how graphiql gets data. If the fetcher parameter is not given, it'll create a fetcher which uses the `fetch` api to make requests. The above example can also be written using a custom fetcher.

```js
import { storiesOf } from '@storybook/storybook'
import { setupGraphiQL } from '@storybook/storybook-addon-graphql'
import { storiesOf } from '@storybook/react'
import { setupGraphiQL } from '@storybook/addon-graphql'

const fetcher = function (params) {
const options = {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
},
"homepage": "https://github.com/storybooks/storybook/tree/master/packages/addon-graphql",
"devDependencies": {
"@storybook/storybook": "*",
"@storybook/react": "*",
"react": "^15.5.4",
"react-dom": "^15.5.4",
"shelljs": "^0.7.3"
},
"peerDependencies": {
"@storybook/storybook-addons": "*",
"@storybook/addons": "*",
"react": "*"
},
"dependencies": {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
import '@storybook/storybook/addons';
import '@storybook/addons';
import 'react-storybook-addon-backgrounds/register';
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { configure, setAddon, addDecorator } from '@storybook/storybook';
import { configure, setAddon, addDecorator } from '@storybook/react';
import InfoAddon from '../src/';

addDecorator((story) => (
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions packages/addon-info/README.md → addons/info/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ npm i -D @storybook/react-storybook-addon-info
Then set the addon in the place you configure storybook like this:

```js
import { configure, setAddon } from '@storybook/storybook';
import { configure, setAddon } from '@storybook/react';
import infoAddon from '@storybook/react-storybook-addon-info';

setAddon(infoAddon);
Expand All @@ -30,7 +30,7 @@ Then create your stories with the `.addWithInfo` API.
```js
import React from 'react';
import Button from './Button';
import { storiesOf, action } from '@storybook/storybook';
import { storiesOf, action } from '@storybook/react';

storiesOf('Button')
.addWithInfo(
Expand Down
File renamed without changes
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import Button from './Button';
import { storiesOf, action } from '@storybook/storybook';
import { storiesOf, action } from '@storybook/react';
import backgrounds from 'react-storybook-addon-backgrounds';

storiesOf('Button').addWithInfo(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"publish-storybook": "bash .scripts/publish_storybook.sh"
},
"devDependencies": {
"@storybook/storybook": "*",
"@storybook/react": "*",
"git-url-parse": "^6.0.1",
"react": "^15.5.4",
"react-dom": "^15.5.4",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions addons/knobs/.storybook/addons.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import '../src/register';
import '@storybook/addons'
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// This is an auto generated file with React CDK.
// Do not modify this file.

import { configure } from '@storybook/storybook';
import { configure } from '@storybook/react';

function loadStories() {
require('../example/stories');
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
14 changes: 7 additions & 7 deletions packages/addon-knobs/README.md → addons/knobs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,24 @@ This is how Knobs look like:
First of all, you need to install knobs into your project as a dev dependency.

```js
npm i -D @storybook/storybook-addon-knobs
npm i -D @storybook/addon-knobs
```

Then, configure it as an addon by adding it to your `addons.js` file (located in the Storybook config directory).

```js
// To get our default addons (actions and links)
import '@storybook/storybook/addons';
import '@storybook/addons';
// To add the knobs addon
import '@storybook/storybook-addon-knobs/register'
import '@storybook/addon-knobs/register'
```

Now, write your stories with knobs.

```js
import React from 'react';
import { storiesOf } from '@storybook/storybook';
import { withKnobs, text, boolean, number } from '@storybook/storybook-addon-knobs';
import { storiesOf } from '@storybook/react';
import { withKnobs, text, boolean, number } from '@storybook/addon-knobs';

const stories = storiesOf('Storybook Knobs', module);

Expand Down Expand Up @@ -71,11 +71,11 @@ You can see your Knobs in a Storybook panel as shown below.

## Available Knobs

These are the knobs available for you to use. You can import these Knobs from the `@storybook/storybook-addon-knobs` module.
These are the knobs available for you to use. You can import these Knobs from the `@storybook/addon-knobs` module.
Here's how to import the **text** Knob.

```js
import { text } from '@storybook/storybook-addon-knobs';
import { text } from '@storybook/addon-knobs';
```

Just like that, you can import any other following Knobs:
Expand Down
File renamed without changes
File renamed without changes
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { storiesOf } from '@storybook/storybook';
import { storiesOf } from '@storybook/react';
import moment from 'moment';
import { withKnobs, number, object, boolean, text, select, date, array, color } from '../../src';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import { storiesOf } from '@storybook/storybook';
import { storiesOf } from '@storybook/react';
import * as moment from 'moment';
import {
withKnobs,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"publish-storybook": "bash .scripts/publish_storybook.sh"
},
"devDependencies": {
"@storybook/storybook": "*",
"@storybook/react": "*",
"@types/node": "^7.0.12",
"@types/react": "^15.0.21",
"git-url-parse": "^6.2.2",
Expand All @@ -26,7 +26,7 @@
"typescript-definition-tester": "^0.0.5"
},
"peerDependencies": {
"@storybook/storybook-addons": "*",
"@storybook/addons": "*",
"react": "*",
"react-dom": "*"
},
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import addons from '@storybook/storybook-addons';
import addons from '@storybook/addons';
import KnobManager from './KnobManager';

const manager = new KnobManager();
Expand Down
Loading

0 comments on commit 3c0fde5

Please sign in to comment.