Skip to content

Commit

Permalink
CHANGE docs (CONTRIBUTIONS) to reflect changed to test script && CHAN…
Browse files Browse the repository at this point in the history
…GE to use yarn
  • Loading branch information
ndelangen committed Aug 28, 2017
1 parent 21cefb1 commit f6ca7dc
Showing 1 changed file with 43 additions and 19 deletions.
62 changes: 43 additions & 19 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,44 @@ No software is bug free. So, if you got an issue, follow these steps:

To test your project against the current latest version of storybook, you can clone the repository and link it with `npm`. Try following these steps:

1. Download the latest version of this project, and build it:
#### 1. Download the latest version of this project, and build it:

```sh
git clone https://github.com/storybooks/storybook.git
cd storybook
npm install
npm run bootstrap -- --core
yarn install
yarn bootstrap
```

2. Link `storybook` and any other required dependencies:
The bootstrap command will ask which sections of the codebase you want to bootstrap. Unless you're going to work with ReactNative or the Documentation, you can keep the default.

You can also pick directly from CLI:

yarn bootstrap -- --core

#### 2a. Run unit tests

You can use one of the example projects in `examples/` to develop on.

This command will list all the suites and options for running tests.

```sh
yarn test
```

_Note that in order to run the tests fro ReactNative, you must have bootstrapped with ReactNative enabled_

You can also pick suites from CLI:

```sh
yarn test -- --core
```

In order to run ALL unit tests, you must have bootstrapped the react-native

#### 2b. Link `storybook` and any other required dependencies:

If you want to test your own existing project using the github version of storybook, you need to `link` the packages you use in your project.

```sh
cd app/react
Expand All @@ -51,13 +79,12 @@ A good way to do that is using the example `cra-kitchen-sink` app embedded in th
# Download and build this repository:
git clone https://github.com/storybooks/storybook.git
cd storybook
npm install
npm run bootstrap -- --core

cd examples/cra-kitchen-sink
yarn install
yarn bootstrap

# make changes to try and reproduce the problem, such as adding components + stories
npm start storybook
cd examples/cra-kitchen-sink
yarn storybook

# see if you can see the problem, if so, commit it:
git checkout "branch-describing-issue"
Expand Down Expand Up @@ -136,7 +163,7 @@ This project written in ES2016+ syntax so, we need to transpile it before use.
So run the following command:

```sh
npm run dev
yarn dev
```

This will watch files and transpile in watch mode.
Expand Down Expand Up @@ -193,12 +220,9 @@ First, build the release:
git checkout master
git status

# clean out extra files
# clean out extra files & build all the packages
# WARNING: destructive if you have extra files lying around!
git clean -fdx && yarn

# build all the packages
npm run bootstrap -- --all
yarn bootstrap -- --reset --all
```

From here there are different procedures for prerelease (e.g. alpha/beta/rc) and proper release.
Expand All @@ -209,7 +233,7 @@ From here there are different procedures for prerelease (e.g. alpha/beta/rc) and

```sh
# publish and tag the release
npm run publish -- --concurrency 1 --npm-tag=alpha
yarn publish -- --concurrency 1 --npm-tag=alpha

# push the tags
git push --tags
Expand All @@ -219,14 +243,14 @@ git push --tags

```sh
# publish but don't commit to git
npm run publish -- --concurrency 1 --skip-git
yarn publish -- --concurrency 1 --skip-git

# Update `CHANGELOG.md`
# - Edit PR titles/labels on github until output is good
# - Optionally, edit a handwritten description in `CHANGELOG.md`
npm run changelog
yarn changelog

# tag the release and push `CHANGELOG.md` and tags
# FIXME: not end-to-end tested!
npm run github-release
yarn github-release
```

0 comments on commit f6ca7dc

Please sign in to comment.