From 47fcd7f957dfb2ad699913d3905f95e55644f3a2 Mon Sep 17 00:00:00 2001 From: Devid Farinelli Date: Fri, 1 Mar 2019 20:18:14 +0100 Subject: [PATCH 1/2] docs(contributing): improve formatting --- .github/CONTRIBUTING.md | 55 ++++++++++++++++++++++++++++------------- 1 file changed, 38 insertions(+), 17 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 6dbdeefa266..abce4d64774 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -36,11 +36,11 @@ In case you are suggesting a new feature, we will match your idea with our curre * Install the dependencies and link them: - ```bash -npm install -npm link -npm link webpack-cli -``` + ```bash + npm install + npm link + npm link webpack-cli + ``` * Bootstrap all the submodules before building for the first time @@ -50,10 +50,16 @@ npm link webpack-cli ``` * Run all the tests with: - - `npm run test` + + ```bash + npm run test + ``` * To test a single CLI (flag) test case: - - `BIN_TEST_CASES_GREP=/myCase jest test/BinTestCases.test.js` + + ```bash + BIN_TEST_CASES_GREP=/myCase jest test/BinTestCases.test.js` + ``` * To test a single CLI (other type of) test case: - `npx jest path/to/my-test.js` @@ -63,18 +69,24 @@ npm link webpack-cli - `jest path/to/my-test.js` * To test linting: - - `npm run lint && npm run tslint` + ```bash + npm run lint && npm run tslint + ``` ### Setup with yarn * If you don't have yarn yet: - - `npm install -g yarn` + + ```bash + npm install -g yarn + ``` + * Install the dependencies and link them -```bash -yarn -yarn link -yarn link webpack-cli -``` + ```bash + yarn + yarn link + yarn link webpack-cli + ``` * Bootstrap all the submodules before building for the first time @@ -84,16 +96,25 @@ yarn link webpack-cli ``` * Run all the tests with: - - `yarn test` + + ```bash + yarn test + ``` * To test a single CLI (flag) test case: - - `BIN_TEST_CASES_GREP=/myCase jest test/BinTestCases.test.js` + + ```bash + BIN_TEST_CASES_GREP=/myCase jest test/BinTestCases.test.js + ``` * To test a single CLI (other type of) test case: - `yarn jest path/to/my-test.js` * To test linting: - - `yarn lint && yarn tslint` + + ```bash + yarn lint && yarn tslint + ``` ## Editor Config From 1042cb2d08ff27c04b63849c3760a91d149c598f Mon Sep 17 00:00:00 2001 From: "devid.farinelli@gmail.com" Date: Sun, 10 Mar 2019 16:45:15 +0100 Subject: [PATCH 2/2] docs(contributing): refactor & formatting --- .github/CONTRIBUTING.md | 71 ++++++++++++++++++++++++----------------- 1 file changed, 42 insertions(+), 29 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index abce4d64774..4ed7f17ccba 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -32,7 +32,7 @@ In case you are suggesting a new feature, we will match your idea with our curre * Fork the **webpack-cli** repo at [https://github.com/webpack/webpack-cli](https://github.com/webpack/webpack-cli). * `git clone && cd webpack-cli` -### Setup with npm +### Using npm * Install the dependencies and link them: @@ -49,68 +49,81 @@ In case you are suggesting a new feature, we will match your idea with our curre npm run build ``` -* Run all the tests with: +### Using yarn + +* If you don't have yarn yet: ```bash - npm run test + npm install -g yarn ``` - -* To test a single CLI (flag) test case: +* Install the dependencies and link them + ```bash - BIN_TEST_CASES_GREP=/myCase jest test/BinTestCases.test.js` + yarn + yarn link + yarn link webpack-cli ``` -* To test a single CLI (other type of) test case: - - `npx jest path/to/my-test.js` - - You can also install jest globally and run tests without npx: - - `npm i -g jest` - - If you have jest installed globally: - - `jest path/to/my-test.js` +* Bootstrap all the submodules before building for the first time -* To test linting: ```bash - npm run lint && npm run tslint + yarn bootstrap + yarn build ``` -### Setup with yarn -* If you don't have yarn yet: + +## Testing + +### Using npm + +* Run all the tests with: ```bash - npm install -g yarn + npm run test ``` + +* Test a single CLI test case: -* Install the dependencies and link them + ```bash + npx jest path/to/my-test.js + ``` + +* You can also install jest globally and run tests without npx: ```bash - yarn - yarn link - yarn link webpack-cli + npm i -g jest + jest path/to/my-test.js ``` -* Bootstrap all the submodules before building for the first time +* You can run the linters: ```bash - yarn bootstrap - yarn build + npm run lint && npm run tslint ``` +### Using yarn + * Run all the tests with: ```bash yarn test ``` -* To test a single CLI (flag) test case: +* Test a single CLI test case: ```bash - BIN_TEST_CASES_GREP=/myCase jest test/BinTestCases.test.js + yarn jest path/to/my-test.js ``` + +* You can also install jest globally and run tests: -* To test a single CLI (other type of) test case: - - `yarn jest path/to/my-test.js` + ```bash + yarn global add jest + jest path/to/my-test.js + ``` -* To test linting: +* You can run the linters: ```bash yarn lint && yarn tslint