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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[chore] Configure lerna to use npm instead of yarn #740

Merged
merged 2 commits into from
Apr 18, 2018
Merged

Conversation

bjoerge
Copy link
Member

@bjoerge bjoerge commented Apr 17, 2018

Looks like hoisting in lerna works with npm again, so I've switched back to using npm as npmClient. Hopefully this will improve overall stability and reduce the daily time spent waiting for the package manager to finish. I'm suspecting we may see a reduction in build times too, as hoisting means better deduping, but haven't tested.

Also tweaked a few other flags, e.g. using npm ci when applicable.

Some unscientific tests from running on my mac:

Bootstrapping after git clone (no lockfiles)

⑂ next$ time yarn
8.12s user 11.56s system 127% cpu 15.458 total
⑂ lerna-use-npm$ time npm i
33.79s user 18.62s system 201% cpu 26.017 total
⑂ next$ time yarn run bootstrap
174.65s user 272.09s system 170% cpu 4:21.27 total
⑂ lerna-use-npm$ time npm run bootstrap
75.83s user 56.97s system 209% cpu 1:03.49 total

Cleaning

⑂ next$ time yarn run clean
54.27s user 510.33s system 569% cpu 1:39.17 total
⑂ lerna-use-npm$ time npm run clean
18.45s user 5.35s system 325% cpu 7.310 total

(note: this reduction is largely due to dependencies being hoisted to root node_modules)

⑂ next$ time rm -Rf node_modules
0.05s user 1.88s system 99% cpu 1.942 total
⑂ lerna-use-npm$ time rm -Rf node_modules
0.18s user 8.33s system 94% cpu 8.993 total

After repo has been cleaned

⑂ next$ time yarn
5.82s user 11.60s system 236% cpu 7.381 total
⑂ lerna-use-npm$ time npm i
25.51s user 26.28s system 167% cpu 30.946 total
⑂ lerna-use-npm$ time npm ci
7.34s user 13.22s system 240% cpu 8.538 total

(npm ci can safely be run when there's a lockfile)

⑂ next$ time yarn run bootstrap
175.29s user 271.84s system 172% cpu 4:19.28 total
⑂ lerna-use-npm$ time npm run bootstrap
73.41s user 54.27s system 206% cpu 1:01.71 total

Bootstrap after add new dependency in a package

⑂ next$ time yarn run bootstrap
7.98s user 1.81s system 55% cpu 17.635 total
⑂ lerna-use-npm$ time npm run bootstrap
30.25s user 3.29s system 100% cpu 33.305 total

@bjoerge bjoerge requested a review from rexxars April 17, 2018 19:55
@bjoerge bjoerge changed the title Lerna use npm [chore] Configure lerna to use npm instead of yarn Apr 17, 2018
Copy link
Member

@rexxars rexxars left a comment

Choose a reason for hiding this comment

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

👍

@bjoerge bjoerge merged commit 982fedf into next Apr 18, 2018
@bjoerge bjoerge deleted the lerna-use-npm branch April 18, 2018 13:06
bjoerge added a commit that referenced this pull request Apr 19, 2018
* [chore] Upgrade lerna, use npm and hoist deps

* [chore] Change Travis CI setup to use npm instead of yarn
bjoerge added a commit that referenced this pull request Apr 23, 2018
* [chore] Upgrade lerna, use npm and hoist deps

* [chore] Change Travis CI setup to use npm instead of yarn
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

2 participants