Skip to content

Commit

Permalink
Use "npm-run-all" to run scripts (#3797)
Browse files Browse the repository at this point in the history
* Use "npm-run-all" to run scripts

[npm-run-all](https://github.com/mysticatea/npm-run-all) is a cross-browser approach to running npm tasks in series (`-s`) or parallel (`-p`). Rather than using a platform specific method to run scripts (e.g. `&&`), npm-run-all will work on all platforms and supports using Yarn if running with Yarn. I made a guess as to whether certain scripts should be run in series or parallel but feel free to change if my choices aren't optimal.

* Add yarn.lock and fix some scripts.

* Move npm-run-all to dev dep.

* Fix bootstrap script.
  • Loading branch information
danawoodman authored and KyleAMathews committed Feb 8, 2018
1 parent ee5aa89 commit 82f7643
Show file tree
Hide file tree
Showing 2 changed files with 498 additions and 15 deletions.
11 changes: 7 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"jest": "^20.0.4",
"jest-cli": "^20.0.4",
"lerna": "^2.1.1",
"npm-run-all": "4.1.2",
"plop": "^1.8.1",
"prettier": "^1.9.2",
"prettier-eslint-cli": "4.2.x",
Expand All @@ -41,9 +42,10 @@
},
"private": true,
"scripts": {
"bootstrap": "yarn && npm run check-versions && lerna run prepublish",
"bootstrap": "npm-run-all -s check-versions lerna-prepublish",
"prebootstrap": "yarn",
"check-versions": "babel-node scripts/check-versions.js",
"format": "npm run format-packages && npm run format-cache-dir && npm run format-www && npm run format-examples && npm run format-scripts && npm run format-markdown",
"format": "npm-run-all -p format-packages format-cache-dir format-www format-examples format-scripts format-markdown",
"format-cache-dir": "prettier-eslint --write \"packages/gatsby/cache-dir/*.js\"",
"format-examples": "prettier-eslint --write \"examples/**/gatsby-node.js\" \"examples/**/gatsby-config.js\" \"examples/**/src/**/*.js\"",
"format-packages": "prettier-eslint --write \"packages/*/src/**/*.js\"",
Expand All @@ -52,17 +54,18 @@
"format-www": "prettier-eslint --write \"www/*.js\" \"www/src/**/*.js\"",
"jest": "jest",
"lerna": "lerna",
"lerna-prepublish": "lerna run prepublish",
"lint": "eslint --ext .js,.jsx packages/**/src",
"lint:flow": "babel-node scripts/flow-check.js",
"plop": "plop",
"publish": "lerna publish",
"publish-canary": "lerna publish --canary --yes",
"publish-next": "lerna publish --npm-tag=next",
"remotedev": "remotedev --hostname=localhost --port=19999",
"test": "yarn lint && yarn jest",
"test": "npm-run-all -s lint jest",
"test:update": "jest --updateSnapshot",
"test:watch": "jest --watch",
"test_bkup": "npm run lint && npm run test-node && npm run test-integration",
"test_bkup": "npm-run-all -s lint test-node test-integration",
"watch": "lerna run watch --no-sort --stream --concurrency 999"
},
"workspaces": [
Expand Down
Loading

0 comments on commit 82f7643

Please sign in to comment.