From 970a4ddd6937b34bc0d33f7812c4c32883380c9a Mon Sep 17 00:00:00 2001 From: Thomas Marek Date: Thu, 16 Feb 2017 02:47:42 -0500 Subject: [PATCH] Update contributing docs to use yarn (#2897) --- CONTRIBUTING.md | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ecd3ce53ba50..961976966ae0 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -28,31 +28,37 @@ The core team will be monitoring for pull requests. When we get one, we'll run s git checkout -b my_branch ``` -2. Run `npm install`. We recommend that you use `npm` version 3 or later. +2. Jest uses [Yarn](https://code.facebook.com/posts/1840075619545360) + for running development scripts. If you haven't already done so, + please [install yarn](https://yarnpkg.com/en/docs/install). + +3. Run `yarn install`. ```sh - npm install + yarn install ``` -3. If you've added code that should be tested, add tests. You +4. If you've added code that should be tested, add tests. You can use watch mode that continuously transforms changed files to make your life easier. ```sh # in the background - npm run watch + yarn run watch ``` -4. If you've changed APIs, update the documentation. -5. Ensure the test suite passes via `npm test`. To run the test suite you +5. If you've changed APIs, update the documentation. + +6. Ensure the test suite passes via `yarn test`. To run the test suite you may need to install Mercurial (`hg`). On macOS, this can be done using [homebrew](http://brew.sh/): `brew install hg`. ```sh brew install hg # maybe - npm test + yarn test ``` -6. If you haven't already, complete the CLA. + +7. If you haven't already, complete the CLA. ### Contributor License Agreement (CLA) @@ -66,7 +72,7 @@ To link `jest` on the command line to `jest-cli/bin/jest.js` in a development bu ```sh cd /path/to/your/Jest_clone/packages/jest-cli -npm link +yarn link ``` To build Jest: @@ -77,10 +83,10 @@ cd /path/to/your/Jest_clone # Do one of the following: # Check out a commit from another contributor, and then -npm run build +yarn run build -# Save your changes to Jest, and then -npm test # which also builds Jest +# Or, save your changes to Jest, and then +yarn test # which also builds Jest ``` To run tests in another project with the development build of Jest: @@ -95,7 +101,7 @@ jest [options] # run jest-cli/bin/jest.js in the development build To unlink `jest` on the command line from `jest-cli/bin/jest.js` in a development build: ```sh -npm unlink --global jest-cli +yarn unlink jest-cli ``` ## Bugs