From b64af7b06cbc44e28748e7c0ff8dd5d4f34ce54b Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Mon, 28 Aug 2017 20:46:13 +0200 Subject: [PATCH] CHANGE docs (CONTRIBUTIONS) to reflect changed to test script && CHANGE to use yarn --- CONTRIBUTING.md | 55 +++++++++++++++++++++++++++++++++++-------------- 1 file changed, 40 insertions(+), 15 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a8cb6cf223e3..041f55e68f62 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -22,17 +22,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 `yarn`. 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 +yarn install +yarn bootstrap +``` + +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: - ```sh - git clone https://github.com/storybooks/storybook.git - cd storybook - yarn 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. -2. Link `storybook` and any other required dependencies: +```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 @@ -54,11 +81,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 -yarn -yarn bootstrap -- --core +yarn install +yarn bootstrap # make changes to try and reproduce the problem, such as adding components + stories -yarn start +cd examples/cra-kitchen-sink +yarn storybook # see if you can see the problem, if so, commit it: git checkout "branch-describing-issue" @@ -194,12 +222,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 -yarn bootstrap -- --all +yarn bootstrap -- --reset --all ``` From here there are different procedures for prerelease (e.g. alpha/beta/rc) and proper release.