-
Notifications
You must be signed in to change notification settings - Fork 257
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(infra): Upgrade monorepo to use npm@7 and enable engine-strict
#708
Conversation
For those stuck between two lands of npm: If using |
3423869
to
75a1bb3
Compare
75a1bb3
to
68a9b55
Compare
This also updates the docs repository. The `engines-strict` setting in the `.npmrc` will enforce that the operators of this repository are using the right version. Someone who wishes to circumvent this can pass `--ignore-engines` when running `npm install`, much like someone circumventing a library's own `engines` requirements.
engines-strict
engines-strict
engines-strict
So I'll have to rebase this PR on Monday after Renovate updates with npm 6 all weekend, but that's easy. Worth noting that the review shouldn't focus on the lockfile contents itself though, because that will change. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems reasonable enough to me, especially if we land #713 soon so the easy way of "make sure to run with npm v7 locally" is "just use Node 16".
Can you add a motivation for enabling engines-strict
somewhere (even just a comment on the PR)? I assume something like "so we can feel the pain of users who have it enabled or use other tools with that default".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! (Assuming we land this together with #713, so engines-strict
doesn't prevent running on Node >= 15.)
engines-strict
engine-strict
Inspired by apollographql/federation#708 This also fixes engines declarations in the individual packages which should have been done in #5137.
Inspired by apollographql/federation#708 as well as the Netlify change in apollographql/federation#713 This also fixes engines declarations in the individual packages which should have been done in #5137.
Inspired by apollographql/federation#708 as well as the Netlify change in apollographql/federation#713 This also fixes engines declarations in the individual packages which should have been done in #5137.
Inspired by apollographql/federation#708 as well as the Netlify change in apollographql/federation#713 This also fixes engines declarations in the individual packages which should have been done in #5137. Also fix a weird problem related to `@apollo/protobufjs`. For some reason, Node 12 and 14 with npm 7 (but not Node 16!) was running into an issue where the fact that `@apollo/protobufjs` doesn't actually depend on a bunch of packages like `espree` that its CLI needs caused the `apollo-pbjs` calls to fail. I think when we forked, protobuf.js was midway through a refactor to make the CLI into a separate package, but we haven't set that up to work in our fork. Adding all those big packages as dependencies of `@apollo/protobufjs` didn't seem great because that would make them non-dev dependencies of apollo-server themselves. Splitting the packages (and making the CLI package a devDep of apollo-reporting-protobuf) is the best long-term solution but for now adding the CLI deps as devDependencies of apollo-reporting-protobuf appears to work?
Essentially, the same updates as apollographql/federation#708 The intent of introducing `engine-strict` is to make sure that the users of this monorepo are not led astray into using an unsupported version of Node.js or npm that might cause unexpected side-effects. (Running the wrong version of `npm` is the most motivating reason today!) Users who wish to run this monorepo with a version of Node.js and npm that are not specified in the `engines` range may still do so by running `npm install --no-engine-strict` to acknowledge that there might be unexpected/untested results/outcomes from their actions.
Essentially, the same updates as apollographql/federation#708 The intent of introducing `engine-strict` is to make sure that the users of this monorepo are not led astray into using an unsupported version of Node.js or npm that might cause unexpected side-effects. (Running the wrong version of `npm` is the most motivating reason today!) Users who wish to run this monorepo with a version of Node.js and npm that are not specified in the `engines` range may still do so by running `npm install --no-engine-strict` to acknowledge that there might be unexpected/untested results/outcomes from their actions.
Essentially, the same updates as apollographql/federation#708 The intent of introducing `engine-strict` is to make sure that the users of this monorepo are not led astray into using an unsupported version of Node.js or npm that might cause unexpected side-effects. (Running the wrong version of `npm` is the most motivating reason today!) Users who wish to run this monorepo with a version of Node.js and npm that are not specified in the `engines` range may still do so by running `npm install --no-engine-strict` to acknowledge that there might be unexpected/untested results/outcomes from their actions.
#2302) * chore(deps): Update to npm v7 and enable `engine-strict` Essentially, the same updates as apollographql/federation#708 The intent of introducing `engine-strict` is to make sure that the users of this monorepo are not led astray into using an unsupported version of Node.js or npm that might cause unexpected side-effects. (Running the wrong version of `npm` is the most motivating reason today!) Users who wish to run this monorepo with a version of Node.js and npm that are not specified in the `engines` range may still do so by running `npm install --no-engine-strict` to acknowledge that there might be unexpected/untested results/outcomes from their actions. * Stop testing Node.js 10 Node.js 10 is officially end-of-life as of the end of April 2021. While these packages may and should continue to work for those that are stuck on old versions, those versions are no longer receiving security updates and should be prioritized in terms of getting upgraded to newer versions. * chore: Update to `cimg` images, in preparation for Node.js 16 testing. The newer images are smaller and suggested to be widely cached. In practice, the older images are widely cached because they're still more prevalent but happy to use the newer images, particularly since the older images aren't getting as much in the way of updates anymore (e.g., there are not any Node.js 16 images for it.) Similar in spirit to apollographql/federation@a46cdec * chore: Start testing Node.js 16 * chore: install npm@7 and Node.js 14 on Windows in the easiest way I know how Completely copied from the federation repository. We might want to make an Orb.
Inspired by apollographql/federation#708 as well as the Netlify change in apollographql/federation#713 This also fixes engines declarations in the individual packages which should have been done in #5137. Also fix a weird problem related to `@apollo/protobufjs`. For some reason, Node 12 and 14 with npm 7 (but not Node 16!) was running into an issue where the fact that `@apollo/protobufjs` doesn't actually depend on a bunch of packages like `espree` that its CLI needs caused the `apollo-pbjs` calls to fail. I think when we forked, protobuf.js was midway through a refactor to make the CLI into a separate package, but we haven't set that up to work in our fork. Adding all those big packages as dependencies of `@apollo/protobufjs` didn't seem great because that would make them non-dev dependencies of apollo-server themselves. Splitting the packages (and making the CLI package a devDep of apollo-reporting-protobuf) is the best long-term solution but for now adding the CLI deps as devDependencies of apollo-reporting-protobuf appears to work?
This upgrades us to use
npm@7
at both the root and indocs/
and enablesengine-strict
via a root-level.npmrc
file in this repository.The intent of introducing
engine-strict
is to make sure that the users of this monorepo are not led astray into using an unsupported version of Node.js or npm that might cause unexpected side-effects. (Running the wrong version ofnpm
is the most motivating reason today!)Users who wish to run this monorepo with a version of Node.js and npm that are not specified in the
engines
range may still do so by runningnpm install --no-engine-strict
to acknowledge that there might be unexpected/untested results/outcomes from their actions.