Skip to content

Commit

Permalink
dev: Improve prod build and monorepo scripts (#165)
Browse files Browse the repository at this point in the history
* dev: Improve prod build and monorepo scripts

 - Add more root-directory usability to monorepo scripts
 - Add `npm run watch:all` mode that:
   - Simultaneously builds buildpack, peregrine, and venia
   - Hot reloads venia if either peregrine or venia change on disk
   - Fully restarts dev server if buildpack changes on disk
   - Interleaves and prefixes output
   - Doesn't use lerna to do this, because lerna's parallelizing console
   mode is not customizable enough
 - Fix production builds (by pegging them to very new browsers)

* Fixup
  • Loading branch information
zetlen committed Aug 1, 2018
1 parent fa8a773 commit 4ad172a
Show file tree
Hide file tree
Showing 14 changed files with 10,403 additions and 9,834 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -9,3 +9,4 @@ storybook-dist
test-report.xml
lerna-debug.log
.env
packages/venia-concept/web/js
3 changes: 3 additions & 0 deletions README.md
Expand Up @@ -27,6 +27,9 @@ To ease local development, testing, and versioning, the PWA Studio project uses
1. Clone the repository
2. Navigate to the root of the repository from the command line
3. Run `npm install`
4. Watch the bootstrapping take place.
5. To run the Venia theme development experience, run `npm run watch:venia` from package root.
6. To run the full PWA Studio deeloper experience, with Venia hot-reloading and concurrent Buildpack/Peregrine rebuilds, run `npm run watch:all` from package root.

## Things not to do

Expand Down
18,929 changes: 9,582 additions & 9,347 deletions package-lock.json

Large diffs are not rendered by default.

23 changes: 19 additions & 4 deletions package.json
Expand Up @@ -12,8 +12,8 @@
},
"scripts": {
"bootstrap": "lerna bootstrap",
"build": "lerna --scope '@magento/{pwa-buildpack,peregrine}' exec -- npm run build",
"clean": "lerna --scope '@magento/{pwa-buildpack,peregrine}' exec -- npm run clean",
"build": "lerna --stream --scope '{@magento/pwa-buildpack,@magento/peregrine,theme-frontend-venia}' exec -- npm run build",
"clean": "lerna run clean && lerna clean --yes && rimraf ./node_modules",
"coveralls": "cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js",
"danger": "danger-ci",
"lint": "eslint 'packages/**/*.js' --ignore-pattern node_modules",
Expand All @@ -22,12 +22,25 @@
"prettier:check": "prettier --list-different 'packages/**/*.@(js|css)' '*.js'",
"test": "jest",
"test:debug": "node --inspect-brk node_modules/.bin/jest -i --watch",
"test:dev": "jest --watch"
"test:dev": "jest --watch",
"watch:all": "concurrently -c yellow.dim,green.dim,cyan.dim -n ␢,℗,☄︎ 'npm run watch:buildpack' 'npm run watch:peregrine' 'npm run watch:venia-dev-server'",
"watch:buildpack": "cd packages/pwa-buildpack && npm run -s watch; cd - >/dev/null",
"watch:peregrine": "cd packages/peregrine && npm run -s watch; cd - >/dev/null",
"watch:venia": "cd packages/venia-concept && npm run -s watch; cd -",
"watch:venia-dev-server": "nodemon --exec npm --cwd packages/venia-concept start"
},
"nodemonConfig": {
"watch": [
"packages/pwa-buildpack/dist",
"packages/venia-concept/webpack.config.js"
],
"delay": 1000
},
"devDependencies": {
"@magento/eslint-config": "^1.0.0",
"babel-eslint": "^8.2.3",
"babel-plugin-syntax-dynamic-import": "^6.18.0",
"concurrently": "^3.6.0",
"coveralls": "^3.0.1",
"danger": "^3.7.18",
"eslint": "^5.2.0",
Expand All @@ -39,7 +52,9 @@
"greenkeeper-lockfile": "^2.4.0",
"jest": "^23.4.0",
"lerna": "^3.0.0-beta.21",
"nodemon": "^1.18.3",
"prettier": "^1.13.5",
"prettier-check": "^2.0.0"
"prettier-check": "^2.0.0",
"rimraf": "^2.6.2"
}
}
2 changes: 1 addition & 1 deletion packages/peregrine/.babelrc
Expand Up @@ -12,7 +12,7 @@
"presets": [
["env", {
"targets": {
"browsers": ["last 2 versions", "ie 11"]
"browsers": ["> 5%"]
},
"modules": false
}]
Expand Down

0 comments on commit 4ad172a

Please sign in to comment.