build: move bootstrap to postinstall hook#1264
Conversation
ec5e1df to
2bd3135
Compare
Run "npm lint:fix" to apply the new formatting introduced by the recent prettier version.
Rework setup/build scripts to run "lerna bootstrap" as part
of "npm install".
The new setup simplifies our development workflow when changing
branches. Instead of having to remember and type multiple npm scripts,
one can run a single command:
npm install-test # abbreviated as: npm it
Under the hood, a new "postinstall" script is calling "lerna bootstrap"
to install dependencies in individual packages.
|
A downside of my proposal: The commit linting phase run by Travis CI is going to unnecessary run |
| depth: 300 | ||
|
|
||
| before_script: | ||
| - npm run bootstrap |
There was a problem hiding this comment.
Travis automatically runs npm install before running any before_script entries. There is no need to run npm install again!
|
|
||
| async function deleteSandbox() { | ||
| if (!await pathExists(path)) return; | ||
| if (!(await pathExists(path))) return; |
There was a problem hiding this comment.
This change is needed to fix the CI after a recent prettier version changed the formatting of await statements. It comes in a standalone commit.
There was a problem hiding this comment.
Please also upgrade to "prettier": "^1.12.1" so that the new code won't fail with existing checkout which still uses prettier@1.11.x.
6cf9855 to
373c1ba
Compare
Rework setup/build scripts to run "lerna bootstrap" as part
of "npm install".
The new setup simplifies our development workflow when changing
branches. Instead of having to remember and type multiple npm scripts,
one can run a single command:
npm install-test # abbreviated as: npm it
Under the hood, a new "postinstall" script is calling "lerna bootstrap"
to install dependencies in individual packages.
|
I configured the linting step to run |
| - npm run bootstrap | ||
|
|
||
| script: | ||
| - npm test |
There was a problem hiding this comment.
npm test is the default build script for Node.js projects, no need to explicitly specify it in our Travis config.
|
Need to fix one of the commit messages! |
|
For the record, there is an overhead (a few secs) to run |
raymondfeng
left a comment
There was a problem hiding this comment.
Please investigate the misbehaving npm it.
| "clean:lerna": "lerna clean", | ||
| "build": "node bin/run-lerna run build", | ||
| "build:full": "npm run clean:lerna && npm run bootstrap && npm test", | ||
| "build:full": "npm run clean:lerna && npm install-test", |
There was a problem hiding this comment.
I'm seeing very strange behavior of npm install-test. It triggers two runs of install and test. The package-lock.json is also generated even with .npmrc that disables package-lock.
There was a problem hiding this comment.
Interesting. Let's hold on my pull request until npm/npm#20358 is resolved.
8bcef81 to
2f8e522
Compare
Rework setup/build scripts to run "lerna bootstrap" as part
of "npm install".
The new setup simplifies our development workflow when changing
branches. Instead of having to remember and type multiple npm scripts,
one can run a single command:
npm install-test # abbreviated as: npm it
Under the hood, a new "postinstall" script is calling "lerna bootstrap"
to install dependencies in individual packages.
b-admike
left a comment
There was a problem hiding this comment.
LGTM once npm/npm#20358 is resolved
|
@bajtos If you want to land this PR sooner, use |
|
I personally use |
|
Please note npm/npm#20358 has been merged but it will take some time to be released. Even we get a new release of |
Good point. I am going to rework this pull request to use |
2f8e522 to
5bb6ce7
Compare
Rework setup/build scripts to run "lerna bootstrap" as part
of "npm install".
The new setup simplifies our development workflow when changing
branches. Instead of having to remember and type multiple npm scripts,
one can run a single command:
npm install-test # abbreviated as: npm it
Under the hood, a new "postinstall" script is calling "lerna bootstrap"
to install dependencies in individual packages.
5bb6ce7 to
367d587
Compare
Rework setup/build scripts to run "lerna bootstrap" as part
of "npm install".
The new setup simplifies our development workflow when changing
branches. Instead of having to remember and type multiple npm scripts,
one can run a single command:
npm install-test # abbreviated as: npm it
Under the hood, a new "postinstall" script is calling "lerna bootstrap"
to install dependencies in individual packages.
Rework setup/build scripts to run "lerna bootstrap" as part
of "npm install".
The new setup simplifies our development workflow when changing
branches. Instead of having to remember and type multiple npm scripts,
one can run a single command:
npm install-test # abbreviated as: npm it
Under the hood, a new "postinstall" script is calling "lerna bootstrap"
to install dependencies in individual packages.
367d587 to
415910a
Compare
Rework setup/build scripts to run
lerna bootstrapas part ofnpm install.The new setup simplifies our development workflow when changing branches. Instead of having to remember and type multiple npm scripts, one can run a single command:
Or even shorter:
Under the hood, a new "postinstall" script is calling "lerna bootstrap" to install dependencies in individual packages after the top-level monorepo dependencies were installed first.
Checklist
npm testpasses on your machinepackages/cliwere updatedexamples/*were updated