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

Infrastructure cleanup #568

Merged
merged 16 commits into from
Aug 31, 2018
Merged

Infrastructure cleanup #568

merged 16 commits into from
Aug 31, 2018

Conversation

martijnwalraven
Copy link
Contributor

This PR cleans up the build and testing infrastructure, similar to apollographql/apollo-server#1521.

  • It updates Lerna to 3.x and converts links between packages to use file: specifiers, as recommended by the Lerna author. This requires moving all devDependencies to the top-level package. The big benefit of this is that hoisting and linking no longer relies on lerna bootstrap, but uses native npm mechanisms. Among other things, this gives us a consistent package-lock.json for the entire monorepo.
  • As a consequence, in CI we can now use the much faster npm ci(which depends on package-lock.json).
  • We also switch from Travis to Circle CI, using the package-lock.json checksum to cache the npm cache dir.
  • Instead of invoking a separate Jest runner per package with lerna run test, we now use a single top-level Jest runner. This makes tests run a lot faster, and works really well in combination with file watching.
  • To fix Jest in CI, we run with --maxWorkers=2. It turns out Jest by default uses the number of cores, which is way too much when running in a container, and leads to bad performance and failing tests.
  • I've also cleaned up the package scripts and various other things I ran into to give us a more consistent environment.

Copy link
Member

@abernix abernix left a comment

Choose a reason for hiding this comment

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

This is amazing!

Due to the massiveness of the package-lock.json changes, I've merely skimmed over those changes, but I'm confident that the scope of those changes were neceesary due to various npm version updates (which change the format of the file) and the overall shifting of modules.

LGTM! :shipit:

@martijnwalraven martijnwalraven merged commit 41b2198 into master Aug 31, 2018
@martijnwalraven martijnwalraven deleted the infrastructure-cleanup branch August 31, 2018 11:56
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