Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: improve npm scripts to update package-lock.json upon install #2596

Merged
merged 1 commit into from Mar 19, 2019

Conversation

raymondfeng
Copy link
Contributor

@raymondfeng raymondfeng commented Mar 15, 2019

This is a follow-up improvement to #2593 and #2583:

  1. Add update-package-locks script
  2. Add update-packages to update greenkeeper.json and package-lock.json for individual packages.
  3. The release script uses npm run ci to capture potential package-lock issues.

Checklist

馃憠 Read and sign the CLA (Contributor License Agreement) 馃憟

  • npm test passes on your machine
  • New tests added or existing tests modified to cover all changes
  • Code conforms with the style guide
  • API Documentation in code was updated
  • Documentation in /docs/site was updated
  • Affected artifact templates in packages/cli were updated
  • Affected example projects in examples/* were updated

package.json Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
@bajtos
Copy link
Member

bajtos commented Mar 19, 2019

@raymondfeng What happened to ci and postci scripts? You have removed them as part of the changes made from 8a4e887 to e5cb985.

  "ci": "npm ci --ignore-scripts && npm run -s postci",
  "postci": "lerna bootstrap --ci",

I really want to preserve fast install for local development. It was my understanding that the two lines above were ensuring that npm ci always runs fast npm ci in individual packages too. Without them, npm ci calls postinstall script which triggers slow clean & full reinstall.

@bajtos
Copy link
Member

bajtos commented Mar 19, 2019

I measured time to install dependencies to see how bad the difference actually is.

Your feature branch as of e5cb985:

$ time npm i

> loopback-next@0.1.0 postinstall /Users/bajtos/src/loopback/next
> lerna bootstrap

(...)

real	0m5.613s
user	0m6.447s
sys	0m1.190s

Current master as of a56e911

$ time npm i

> loopback-next@0.1.0 postinstall /Users/bajtos/src/loopback/next
> lerna bootstrap && npm run -s update-greenkeeper-json

real	0m5.978s
user	0m6.823s
sys	0m1.261s

Just now I realized that you have actually reworked postinstall script to invoke lerna bootstrap, not the full clean+reinstall 馃檲

Copy link
Member

@bajtos bajtos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@raymondfeng raymondfeng merged commit a6ebb4d into master Mar 19, 2019
@bajtos bajtos deleted the fix-update-package-lock branch March 25, 2019 07:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants