Skip to content

Commit

Permalink
CHANGE to use yarn everywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
ndelangen committed Dec 21, 2018
1 parent 362e41b commit 8f895f3
Show file tree
Hide file tree
Showing 20 changed files with 45 additions and 49 deletions.
8 changes: 4 additions & 4 deletions MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,8 @@ Also read on if you're using `addon-knobs`: we advise an update to your code for

This affects you if you don't use babel in your project. You may need to add `babel-core` as dev dependency:

```
npm install --save-dev babel-core
```sh
yarn add babel-core --dev
```

This was done to support different major versions of babel.
Expand Down Expand Up @@ -261,7 +261,7 @@ In the case of Angular: `import { ... } from '@storybook/addon-knobs/angular';`
TypeScript users: we've moved the rest of our addons type definitions into [DefinitelyTyped](http://definitelytyped.org/). Starting in 3.2.0 make sure to use the right addons types:

```sh
npm install @types/storybook__addon-notes @types/storybook__addon-options @types/storybook__addon-knobs @types/storybook__addon-links --save-dev
yarn add @types/storybook__addon-notes @types/storybook__addon-options @types/storybook__addon-knobs @types/storybook__addon-links --dev
```

See also [TypeScript definitions in 3.1.x](#moved-typescript-definitions).
Expand Down Expand Up @@ -294,7 +294,7 @@ It's not beautiful, but we'll be adding a more convenient/idiomatic way of using
TypeScript users: we are in the process of moving our typescript definitions into [DefinitelyTyped](http://definitelytyped.org/). If you're using TypeScript, starting in 3.1.0 you need to make sure your type definitions are installed:

```sh
npm install @types/node @types/react @types/storybook__react --save-dev
yarn add @types/node @types/react @types/storybook__react --dev
```

### Deprecated head.html
Expand Down
2 changes: 1 addition & 1 deletion addons/centered/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Storybook Centered Decorator can be used to center components inside the preview
### Usage

```sh
npm install @storybook/addon-centered --save-dev
yarn add @storybook/addon-centered --dev
```

#### As a decorator
Expand Down
2 changes: 1 addition & 1 deletion addons/graphql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Storybook GraphQL Addon can be used to display the GraphiQL IDE with example que
First, install the addon

```sh
npm install -D @storybook/addon-graphql
yarn add @storybook/addon-graphql --dev
```

Import the `setupGraphiQL` function and use it to create the graphiql helper with a base url.
Expand Down
2 changes: 1 addition & 1 deletion addons/jest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Brings Jest results in storybook.

### Install

`npm install --save-dev @storybook/addon-jest`
`yarn add --save-dev @storybook/addon-jest --dev`

or

Expand Down
10 changes: 8 additions & 2 deletions addons/knobs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ This is how Knobs look like:
First of all, you need to install knobs into your project as a dev dependency.

```sh
npm install @storybook/addon-knobs --save-dev
yarn add @storybook/addon-knobs --dev
```

Then, configure it as an addon by adding it to your `addons.js` file (located in the Storybook config directory).
Expand Down Expand Up @@ -418,4 +418,10 @@ If you are using typescript, make sure you have the type definitions installed f
- node
- react

You can install them using `npm install -save @types/node @types/react`, assuming you are using Typescript >2.0.
You can install them using:
*assuming you are using Typescript >2.0.*

```sh
yarn add @types/node @types/react --dev
```

2 changes: 1 addition & 1 deletion addons/ondevice-knobs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Refer to its documentation to understand how to use knobs**
First of all, you need to install knobs into your project.

```sh
npm install @storybook/addon-ondevice-knobs
yarn add @storybook/addon-ondevice-knobs --dev
```

Then create a file called `rn-addons.js` in your storybook config.
Expand Down
2 changes: 1 addition & 1 deletion addons/options/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The Options addon can be used to (re-)configure the [Storybook](https://storyboo
First, install the addon

```sh
npm install -D @storybook/addon-options
yarn add @storybook/addon-options --dev
```

Add this line to your `addons.js` file (create this file inside your storybook config directory if needed).
Expand Down
22 changes: 11 additions & 11 deletions addons/storyshots/storyshots-core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ To use StoryShots, you must use your existing Storybook stories as the input for
Add the following module into your app.

```sh
npm install --save-dev @storybook/addon-storyshots
yarn add @storybook/addon-storyshots --dev
```

## Configure your app for Jest
Expand Down Expand Up @@ -59,7 +59,7 @@ You can do this with a Babel [plugin](https://github.com/smrq/babel-plugin-requi
First, install it:

```sh
npm install --save-dev babel-plugin-require-context-hook
yarn add babel-plugin-require-context-hook --dev
```

Next, it needs to be registered and loaded before each test. To register it, create a file with the following register function `.jest/register-context.js`:
Expand Down Expand Up @@ -93,7 +93,7 @@ The plugin is only added to the test environment otherwise it could replace webp
First, install it:

```sh
npm install --save-dev require-context.macro
yarn add require-context.macro --dev
```

Now, inside of your Storybook config file, simply import the macro and run it in place of `require.context`, like so:
Expand All @@ -110,15 +110,15 @@ StoryShots addon for React is dependent on [react-test-renderer](https://github.
[doesn't](#deps-issue) install it, so you need to install it separately.

```sh
npm install --save-dev react-test-renderer
yarn add react-test-renderer --dev
```

### Configure Jest for Angular
StoryShots addon for Angular is dependent on [jest-preset-angular](https://github.com/thymikee/jest-preset-angular), but
[doesn't](#deps-issue) install it, so you need to install it separately.

```sh
npm install --save-dev jest-preset-angular
yarn add jest-preset-angular
```

If you already use Jest for testing your angular app - probably you already have the needed jest configuration.
Expand All @@ -139,9 +139,9 @@ module.exports = {
StoryShots addon for Vue is dependent on [jest-vue-preprocessor](https://github.com/vire/jest-vue-preprocessor), but
[doesn't](#deps-issue) install it, so you need to install it separately.

```sh
npm install --save-dev jest-vue-preprocessor
```
```sh
yarn add jest-vue-preprocessor
```

If you already use Jest for testing your vue app - probably you already have the needed jest configuration.
Anyway you can add these lines to your jest config:
Expand All @@ -162,9 +162,9 @@ module.exports = {
StoryShots addon for Preact is dependent on [preact-render-to-json](https://github.com/nathancahill/preact-render-to-json), but
[doesn't](#deps-issue) install it, so you need to install it separately.

```sh
npm install --save-dev preact-render-to-json
```
```sh
yarn add preact-render-to-json --dev
```

### <a name="deps-issue"></a>Why don't we install dependencies of each framework ?
Storyshots addon is currently supporting React, Angular and Vue. Each framework needs its own packages to be integrated with Jest. We don't want people that use only React will need to bring other dependencies that do not make sense for them.
Expand Down
4 changes: 2 additions & 2 deletions addons/storyshots/storyshots-puppeteer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

Add the following module into your app.

```sh
npm install --save-dev @storybook/addon-storyshots-puppeteer
```sh
yarn add @storybook/addon-storyshots-puppeteer --dev
```

## Configure Storyshots for image snapshots
Expand Down
2 changes: 1 addition & 1 deletion addons/storysource/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ This addon is used to show stories source in the addon panel.
First, install the addon

```sh
npm install -D @storybook/addon-storysource
yarn add @storybook/addon-storysource --dev
```

Add this line to your `addons.js` file
Expand Down
2 changes: 1 addition & 1 deletion app/react-native/docs/manual-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
First, install the `@storybook/react-native` module

```sh
npm install @storybook/react-native
yarn add @storybook/react-native --dev
```

Create a new directory called `storybook` in your project root and create an entry file (index.js) as given below.
Expand Down
17 changes: 4 additions & 13 deletions docs/src/pages/basics/exporting-storybook/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,20 @@ Simply add the following NPM script:
```json
{
"scripts": {
"storybook": "build-storybook -c .storybook -o .out"
"build-storybook": "build-storybook -c .storybook -o .out"
}
}
```

Then run `npm run storybook`.
Then run `yarn build-storybook`.

This will build the storybook configured in the Storybook directory into a static web app and place it inside the `.out` directory.
Now you can deploy the content in the `.out` directory wherever you want.

To test it locally, simply run the following commands with Python HTTP Server:
To test it locally:

```sh
cd .out
python -m SimpleHTTPServer
```

or Node HTTP Server:

```sh
npm install http-server -g
cd .out
http-server
npx serve .
```

## Deploying to GitHub Pages
Expand Down
4 changes: 2 additions & 2 deletions docs/src/pages/testing/automated-visual-testing/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ For this example, we're going to use a number of packages:
Let's go ahead and add all of these:

```
npm install --save-dev jest puppeteer jest-puppeteer jest-image-snapshot start-server-and-test
```sh
yarn add jest puppeteer jest-puppeteer jest-image-snapshot start-server-and-test --dev
```

There's a bit of setup code that needs to run before your tests, so we'll need to configure a Jest setup file to run first, if you haven't already. This is done with the [`setupTestFrameworkScriptFile` config property](https://jestjs.io/docs/en/configuration.html#setuptestframeworkscriptfile-string), either in your package.json or in your `jest.config.js`. We'll also set `"preset": "jest-puppeteer"` so that we get the nice integration from jest-puppeteer.
Expand Down
2 changes: 1 addition & 1 deletion examples/ember-cli/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Storybook Demo

This is a demo app to test Ember integration with Storybook. Run `npm install` to sync Storybook module with the source code and run `npm run storybook` to start the Storybook.
This is a demo app to test Ember integration with Storybook. Run `yarn install` to sync Storybook module with the source code and run `yarn storybook` to start the Storybook.
2 changes: 1 addition & 1 deletion examples/mithril-kitchen-sink/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Storybook Demo

This is a demo app to test Mithril integration with Storybook. Run `npm install` or `yarn install` to sync Storybook module with the source code and run `npm run storybook` or `yarn storybook` to start the Storybook.
This is a demo app to test Mithril integration with Storybook. Run `yarn install` to sync Storybook module with the source code and run `yarn storybook` to start the Storybook.
2 changes: 1 addition & 1 deletion examples/preact-kitchen-sink/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Storybook Demo

This is a demo app to test `preact` integration with Storybook. Run `npm install` to sync Storybook module with the source code and run `npm run storybook` to start the Storybook.
This is a demo app to test `preact` integration with Storybook. Run `yarn install` to sync Storybook module with the source code and run `yarn storybook` to start the Storybook.
2 changes: 1 addition & 1 deletion examples/riot-kitchen-sink/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Storybook Demo

This is a demo app to test riot.js integration with Storybook. Run `npm install` to sync Storybook module with the source code and run `npm run storybook` to start the Storybook.
This is a demo app to test riot.js integration with Storybook. Run `yarn install` to sync Storybook module with the source code and run `yarn storybook` to start the Storybook.
2 changes: 1 addition & 1 deletion examples/vue-kitchen-sink/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Storybook Demo

This is a demo app to test VueJs integration with Storybook. Run `npm install` to sync Storybook module with the source code and run `npm run storybook` to start the Storybook.
This is a demo app to test VueJs integration with Storybook. Run `yarn install` to sync Storybook module with the source code and run `yarn storybook` to start the Storybook.
3 changes: 1 addition & 2 deletions lib/codemod/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ It will help you migrate breaking changes & deprecations.
## Installation

```sh
npm install jscodeshift
npm install @storybook/codemod
yarn add jscodeshift @storybook/codemod --dev
```

- `@storybook/codemod` is our collection of codemod scripts.
Expand Down
2 changes: 1 addition & 1 deletion lib/ui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ You can configure it by providing a provider API.
First you need to install `@storybook/ui` into your app.

```sh
npm install --save @storybook/ui
yarn add @storybook/ui --dev
```

Then you need to create a Provider class like this:
Expand Down

0 comments on commit 8f895f3

Please sign in to comment.