Ensure node_modules is up to date before gulp [default | css | build | dist] - #12586
Conversation
|
@erwinmombay @choumx @cramforce with this, we can ensure that all developers are running with the latest dependency versions. Do you think the check is reasonable? Or do you think it's too stringent? |
|
Could we just run yarn in the failure case? |
|
@cramforce that would be one step more aggressive than what I'm doing in the PR so far. Can do if you're okay with the contents of |
|
I see no downside. You can also merge this first, of course. |
|
@cramforce PR updated with a call to |
| /** | ||
| * Does a yarn check on node_modules, and if it is outdated, runs yarn. | ||
| */ | ||
| function yarnCheck() { |
There was a problem hiding this comment.
Should the task now be updated to reflect it no longer just checks.
|
Tested locally on linux with:
Looking good. |
|
@cramforce Tested on mac os as well. Times are slightly slower than on linux, but nothing out of the ordinary. Once you approve, this is ready to be merged. |
|
And on Travis, since |
|
Tested
|
|
Bumping this to the top. All comments addressed. |
|
We could skip this on CI. |
|
We have had instances in the past where people checked in mismatched versions of |
This PR adds a new
gulp update-packagestask that's run as a prerequisite to:It does the following:
yarn check --integrityto check ifnode_modulesis in sync with the contents ofpackage.jsonandyarn.lock. Typically, this will fail whengit pull/git fetchcauses an update to the set of dependencies.yarn check -- verify-treeto print a list of packages that need to be upgraded.yarnto bring all packages innode_modulesup to date withpackage.json.In the normal case, where
node_modulesis up to date (step 1 passes), this task adds less than 1 second to the gulp execution time. In the exceptional case, it takes a couple of seconds to enumerate all the packages that are out of date, and a fraction of a minute to runyarn, after which it will execute thegulp [default | css | build | dist]task that was initially invoked.Partial fix for #12181