From 50993af017c5ec9299a1ee20de1b36f87a906830 Mon Sep 17 00:00:00 2001 From: Christian Crowhurst Date: Mon, 24 Oct 2016 13:16:55 +0100 Subject: [PATCH] chore(build): improve developer workflow --- CONTRIBUTING.md | 15 +++++++++++---- package.json | 6 +++--- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9a72fb30..7836c951 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -5,19 +5,26 @@ CONTRIBUTING 2. In locally cloned repo: `npm install && npm run setup` 3. Prove existing code: * Run the unit tests: `npm test` - * Run the end-to-end tests: - * In one terminal window: `npm run e2e-server` - * In another terminal window: `npm run e2e` + * Run the end-to-end tests (see section below) 4. Make changes in `src` folder * **Tip**: use `npm run test:w` to verify your changes on save 5. Add additional unit tests in `test` folder. These should cover your changes 6. *Optionally* add end-to-end tests in `e2e` folder -7. Prove changes (run step 3 above) +7. Prove changes: + * Run the unit tests: `npm test` + * Run the end-to-end tests (see section below) 8. Commit changes: `npm run cm` - why use **npm** and not **git** to commit? See "Conventional commit message" section below 9. Push your changes to your fork and submit a pull request +## Running end-to-end tests + +* In one terminal window: `npm run e2e-server` +* In another terminal window: `npm run e2e` + * **Tip**: use `npm run e2e-only` if you already have built source code (ie you've `npm run setup` or `npm run build:all`) + + ## Conventional commit message This project uses the structure of the commit message to: diff --git a/package.json b/package.json index 5d6f666c..a8fc2d52 100644 --- a/package.json +++ b/package.json @@ -102,14 +102,14 @@ "doc": "typedoc --options typedoc.json index.ts", "e2e-server": "http-server demo-apps -c-1", "e2e-server:ci": "http-server demo-apps -s -c-1 &", - "e2e": "protractor e2e/protractor.config.js", + "e2e": "npm run build:all && npm run e2e-only", "e2e:ci": "protractor e2e/protractor-travis.config", - "poste2e": "node ./scripts/open-e2e-report", + "e2e-only": "protractor e2e/protractor.config.js", + "poste2e-only": "node ./scripts/open-e2e-report", "install:demo-apps": "shx ls -d demo-apps/*/ | bulk -c \"npm install\"", "link:demo-apps": "shx ls -d demo-apps/*/ | bulk -c \"npm run linklocal\"", "precommit": "npm run tsc", "semantic-release": "semantic-release pre && npm publish && semantic-release post", - "serve:api-docs": "http-server demo-site/api-docs -o -c-1", "serve:demo": "cd demo-apps/es5 && npm start", "serve:docs-site": "http-server demo-site -o -c-1", "_setup:common": "npm-run-all --parallel build:full tsc --serial install:demo-apps link:demo-apps",