From 508537ee2abc85863056dc4483537db0f621cc2b Mon Sep 17 00:00:00 2001 From: Kevin Brown Date: Wed, 22 Mar 2017 05:01:15 +1100 Subject: [PATCH] Contributing Guide for 1.0 (#727) * Added Lerna instructions and updated contributing guide for 1.0. * Added link command for gatsby specifically. * Yarn install needs to be run in project root as well. * Symlinked CONTRIBUTING.md to how-to-contribute.md so this shows up on the docs site. * Updated standard steps for getting started. * Updating heading styles to match the docs site. * Added 'run' to commands and made the purpose of the initial 'build' command more apparent. --- CONTRIBUTING.md | 25 ++++++++++++++----------- docs/docs/how-to-contribute.md | 6 +----- 2 files changed, 15 insertions(+), 16 deletions(-) mode change 100644 => 120000 docs/docs/how-to-contribute.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3e9c7b273410d..1c24b586a3395 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,4 +1,6 @@ -# Filing an issue +# How to contribute + +## Filing an issue If you want your issue to be resolved quickly, please include in your issue: @@ -6,16 +8,16 @@ issue: * Gatsby version, node.js version, OS version * The contents of your `gatsby-node.js`, `gatsby-browser.js`, and `package.json`. -# Contributing +## Contributing You can install the latest `master` version of Gatsby by following these simple steps: * Clone the repo, navigate to its directory. -* Execute `npm install` to install packages. -* Execute `npm uninstall -g gatsby && npm link` +* Install Lerna if you don't have it already: `yarn global add lerna@^2.0.0-beta.0` +* Execute `yarn && lerna bootstrap` to install dependencies and cross link all the packages. * Use `git pull` to update to latest Gatsby. -Test suite can be run via `npm test`. +Test suite can be run via `yarn test`. This project uses [FlowType](https://flowtype.org/) for static type checking. @@ -23,12 +25,13 @@ The usual contributing steps are: * Fork the [official repository](https://github.com/gatsbyjs/gatsby). * Clone your fork: git clone `git@github.com:/gatsby.git` -* Make sure tests are passing for you: npm install && npm test -* Create a topic branch: git checkout -b topics/new-feature-name -* Run `npm run watch` to watch code and compile your changes. -* Clone one of the official repositories and "link" your fork of Gatsby - to it (run `npm link gatsby`). +* Install dependencies: `yarn && lerna bootstrap` +* Make sure tests are passing for you: `lerna run test` +* Create a topic branch: `git checkout -b topics/new-feature-name` +* Run `yarn run build` to do an initial build and ensure there are no errors. +* Run `yarn run watch` to watch code and compile your changes on the fly as you work. +* Symlink the built file from whatever plugin you're trying to modify (will be in `packages/package-name`) into your project's `node_modules/package-name` directory to avoid getting the node_modules folder coming across to your site. * Add tests and code for your changes. -* Once you‘re done, make sure all tests still pass: npm install && npm test +* Once you‘re done, make sure all tests still pass: `yarn test` * Commit and push to your fork. * Create an pull request from your branch. diff --git a/docs/docs/how-to-contribute.md b/docs/docs/how-to-contribute.md deleted file mode 100644 index d1a7015045a00..0000000000000 --- a/docs/docs/how-to-contribute.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -title: How to Contribute ---- - -Coming soon. diff --git a/docs/docs/how-to-contribute.md b/docs/docs/how-to-contribute.md new file mode 120000 index 0000000000000..f939e75f21a8b --- /dev/null +++ b/docs/docs/how-to-contribute.md @@ -0,0 +1 @@ +../../CONTRIBUTING.md \ No newline at end of file