From b243219461fc40516a0e1391d62a82098bff16fb Mon Sep 17 00:00:00 2001 From: Jonas Galvez Date: Fri, 10 Aug 2018 08:08:01 -0300 Subject: [PATCH] Update CONTRIBUTING.md (#3674) Following my own experience getting set up to do Nuxt work recently, I've updated `CONTRIBUTING.md` in a way would have helped me greatly. --- CONTRIBUTING.md | 46 ++++++++++++++++++++++++++++++++++++++++------ README.md | 5 ----- 2 files changed, 40 insertions(+), 11 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d30b087dbf..5369f4b690 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,11 +2,45 @@ 1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your own GitHub account and then [clone](https://help.github.com/articles/cloning-a-repository/) it to your local device. 2. Run `npm install` to install the dependencies. -3. Run `npm link` to link the local repository to NPM. -4. Then npm links this repository inside any nuxt example app with `npm link nuxt`. -5. Run `npm run build` or `npm run dev` inside your example app, if you created it with [nuxt starter template](https://github.com/nuxt-community/starter-template). -6. Then you can run your example app with the local version of Nuxt.js (You may need to re-run the example app as you change server side code in the Nuxt.js repository). -_Note that both npm and yarn have been seen to miss installing dependencies. To remedy that, you can either delete the node_modules folder in your example app and install again or do a local install of the missing dependencies._ +> _Note that both **npm** and **yarn** have been seen to miss installing dependencies. To remedy that, you can either delete the `node_modules` folder in your example app and install again or do a local install of the missing dependencies._ -Make sure to add tests into `test/` directory and try them with `npm test` before making a pull request. +3. Add an example app to `examples/` before writing any code. +4. Create a fixture app under `test/fixtures/`. See others for examples. + +To run an example or fixture app with your copy of Nuxt, do: + +```sh +bin/nuxt examples/your-app +bin/nuxt test/fixtures/your-fixture-app +``` + +> `npm link` could also (and does, to some extent) work for this, but it has been known to exhibit some issues. That is why we recommend calling `bin/nuxt` directly to run examples. + +Once you've modified Nuxt and seen your modifications reflected correctly in your example app and fixture, add `unit` and, if necessary, `e2e` tests that can ensure its functionality and future maintanability. Study other tests carefully for reference. + +## Running specific tests + +```sh +npm install jest -g +jest test/unit/test.js +``` + +## Running test suites + +```sh +yarn test +``` + +Or, per group: + +```sh +yarn test:fixtures +yarn test:unit +yarn test:e2e +``` + +## Opening PRs + +- Please make sure your PR passes the lint test (`npm run lint`). +- Please wait for tests to run and verify potential failures. diff --git a/README.md b/README.md index ce8ec432ec..6e57899edc 100644 --- a/README.md +++ b/README.md @@ -276,11 +276,6 @@ Thank you to all our [contributors](https://github.com/nuxt/nuxt.js/graphs/contr Please see our [CONTRIBUTING.md](./CONTRIBUTING.md) - -## Roadmap - -https://trello.com/b/lgy93IOl/nuxtjs-10 - ## License [MIT](https://github.com/nuxt/nuxt.js/blob/dev/LICENSE.md)