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 b5d2e21 commit 69b91f6
Show file tree
Hide file tree
Showing 457 changed files with 303 additions and 229 deletions.
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Expand Up @@ -33,16 +33,16 @@ To test your project against the current latest version of storybook, you can cl
```
cd packages/react-storybook
npm link
cd <your-project>
npm link @kadira/storybook
# repeat with whichever other parts of the monorepo you are using.
```

### Reproductions

The best way to help figure out an issue you are having is to produce a minimal reproduction against the `master` branch.
The best way to help figure out an issue you are having is to produce a minimal reproduction against the `master` branch.

A good way to do that is using the example `test-cra` app embedded in this repository:

Expand Down Expand Up @@ -155,7 +155,7 @@ getstorybook
Then link storybook inside the sample project with:

```sh
npm link @storybook/storybook
npm link @storybook/react
```

### Getting Changes
Expand Down
1 change: 1 addition & 0 deletions addons/actions/.storybook/addons.js
@@ -0,0 +1 @@
import '../register';
@@ -1,2 +1,2 @@
import * as storybook from '@storybook/storybook';
import * as storybook from '@storybook/react';
storybook.configure(() => require('./stories'), module);
@@ -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.
4 changes: 2 additions & 2 deletions packages/addon-actions/README.md → addons/actions/README.md
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/addon-actions'
import { storiesOf } from '@storybook/react'
import { action } from '@storybook/addon-actions'

storiesOf('Button', module)
.add('default view', () => (
Expand Down
File renamed without changes
Expand Up @@ -21,9 +21,9 @@
},
"homepage": "https://github.com/storybooks/storybook/tree/master/packages/addon-actions",
"devDependencies": {
"@storybook/storybook": "*",
"@storybook/react": "*",
"@storybook/addons": "*",
"@storybook/storybook-ui": "*",
"@storybook/ui": "*",
"react": "^15.5.4",
"react-dom": "^15.5.4",
"react-test-renderer": "^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.
@@ -1,6 +1,7 @@
// Use the line below to register this addon
// import '@storybook/storybook-addon-comments/register';
// import '@storybook/addon-comments/register';
import '@storybook/addon-actions/register';
import '@kadira/storybook-database-cloud/register';

import { init } from '../src/manager';
init();
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.
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.
Expand Up @@ -34,11 +34,11 @@
"react-textarea-autosize": "^4.3.0"
},
"devDependencies": {
"@storybook/storybook": "*",
"@storybook/react": "*",
"@storybook/addons": "*",
"@kadira/storybook-database-cloud": "*",
"@kadira/storybook-deployer": "*",
"@storybook/storybook-ui": "*",
"@storybook/ui": "*",
"git-url-parse": "^6.2.2",
"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.
@@ -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.
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.
@@ -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.
@@ -1,2 +1,2 @@
import * as storybook from '@storybook/storybook';
import * as storybook from '@storybook/react';
storybook.configure(() => require('./stories'), module);
@@ -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
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
Expand Up @@ -21,7 +21,7 @@
},
"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.7"
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.
@@ -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
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.
@@ -1,14 +1,13 @@
import React from 'react';
import Button from './Button';
import { storiesOf } from '@storybook/storybook';

import { storiesOf, action } from '@storybook/react';
import { action } from '@storybook/addon-actions';
import backgrounds from 'react-storybook-addon-backgrounds';

storiesOf('Button').addWithInfo(
'simple usage',
`
This is the basic usage with the button with providing a label to show the text.
`,
`This is the basic usage with the button with providing a label to show the text.`,
() => (
<div>
<Button label="The Button" onClick={action('onClick')} />
Expand Down
Expand Up @@ -13,7 +13,7 @@
"publish-storybook": "bash .scripts/publish_storybook.sh"
},
"devDependencies": {
"@storybook/storybook": "*",
"@storybook/react": "*",
"git-url-parse": "^6.2.2",
"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.
File renamed without changes.
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.
12 changes: 6 additions & 6 deletions packages/addon-knobs/README.md → addons/knobs/README.md
Expand Up @@ -14,21 +14,21 @@ 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
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 @@ -68,11 +68,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
@@ -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
@@ -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
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 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.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions addons/links/.storybook/addons.js
@@ -0,0 +1 @@
import '../register';
@@ -1,2 +1,2 @@
import * as storybook from '@storybook/storybook';
import * as storybook from '@storybook/react';
storybook.configure(() => require('./stories'), module);
@@ -1,5 +1,5 @@
import React from 'react';
import { storiesOf } from '@storybook/storybook';
import { storiesOf } from '@storybook/react';
import { linkTo } from '../src';

storiesOf('Button', module)
Expand All @@ -12,7 +12,7 @@ storiesOf('Button', module)
.add('Multiple Selection', () => (
<MultipleStories onClick={linkTo('Button', (filter) => {
return filter === 'First' ? 'First Story' : 'Second Story';
})}/>
})}/>
));

const MultipleStories = ({onClick}) => {
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions packages/addon-links/README.md → addons/links/README.md
Expand Up @@ -7,8 +7,8 @@ The Story Links addon can be used to create links between stories. This addon wo
You can use this addon without installing it.

```js
import { storiesOf } from '@storybook/storybook'
import { linkTo } from '@storybook/storybook-addon-links'
import { storiesOf } from '@storybook/react'
import { linkTo } from '@storybook/addon-links'

storiesOf('Button', module)
.add('First', () => (
Expand Down
@@ -1,5 +1,5 @@
{
"name": "@storybook/storybook-addon-links",
"name": "@storybook/addon-links",
"version": "1.0.1",
"description": "Story Links addon for storybook",
"main": "dist/index.js",
Expand All @@ -21,9 +21,9 @@
},
"homepage": "https://github.com/kadirahq/storybook-addon-links#readme",
"devDependencies": {
"@storybook/storybook": "^*",
"@storybook/react": "^*",
"@storybook/addons": "*",
"@storybook/storybook-ui": "*",
"@storybook/ui": "*",
"react": "^15.5.4",
"react-dom": "^15.5.4",
"shelljs": "^0.7.7"
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.
1 change: 1 addition & 0 deletions addons/notes/.storybook/addons.js
@@ -0,0 +1 @@
import '../src/register';
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.

0 comments on commit 69b91f6

Please sign in to comment.