From c3ce0cdde39f9fd3d1d77d0b0ece0156791994b3 Mon Sep 17 00:00:00 2001 From: Douglas Wade Date: Fri, 15 Jul 2016 12:29:29 -0700 Subject: [PATCH] Add getting started to contributing.md (#349) --- CONTRIBUTING.md | 55 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 425428ae6..48e5cfce1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -14,6 +14,61 @@ You could: Not sure where to start? Join us [on gitter](https://gitter.im/redfin/react-server) and ask! +## Getting started + +React Server uses a tool called [lerna](https://www.npmjs.com/package/lerna) to +manage the entire React Server ecosystem in a single repository. This allows +maintainers to know that everything works together well, without having to know +all of the inner workings of each package in the monorepo. It does present some +challenges to new developers, since the idea is relatively new. If you want to +know more about why we chose a monorepo, check out the [babel monorepo design +doc](https://github.com/babel/babel/blob/master/doc/design/monorepo.md), +especially the [previous discussion](https://github.com/babel/babel/blob/master/doc/design/monorepo.md#previous-discussion). + +To get your local clone into working order, run an + +``` +npm run bootstrap +``` + +If things get hairy and you have errors that you don't understand, you can get +a clean install of all the dependencies + +``` +npm run nuke +npm run bootstrap +``` + +If you've been running `bootstrap` to track down build errors a lot, and have a +lot of debug files lying around, you can clean them up + +``` +npm run clean +``` + +Most commands have a corresponding `lerna` command; if you want to find out more, +you can look at the `scripts` hash in the root `package.json`, check out the +[lerna docs](lernajs.io), and run the lerna commands yourself + +``` +npm i -g lerna david +lerna clean +lerna bootstrap +lerna run lint +lerna exec -- david u +``` + +You can also work on a single package by `cd`-ing into that module, and using +normal `npm` scripts + +``` +cd packages/generator-react-server +npm i +npm test +``` + +but you should still run a full monorepo build and test before submitting a pr. + ## Testing Yeah! Do it!