[vtadmin-web] Enforce node + npm versions with .npmrc #9336
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Signed-off-by: Sara Bee 855595+doeg@users.noreply.github.com
Description
This closes #9321 by enforcing installed node/npm versions match the semvers specified in the package.json's
engines
property. We do this with npm'sengine-strict
flag.(Rant about "why does this even require a separate, special flag and yet another got-dang repo dotfile arghhhh" has been redacted.)
🚨 Going forward,
make vtadmin_web_proto_types
will fail if a developer's local node/npm install is too old. Here's what it looks like:(Should probably do an
npm audit
soon... 🤔 Also, I'm not convinced this output is super... approachable? But it's better than nothing.)This check also runs (and is enforced in) CI, since
npm install
is a prerequisite for... well, all of our front-end tests/linters/formatters/etc. :) Here's what that looks like when I intentionally downgrade the GitHub Action's node version:(Note: the linters/formatters running even if
npm install
fails is "by design" (ugh), described invtadmin_web_lint.yml
below.)Finally, I ran
make vtadmin_web_proto_types
and committed the changes. The chonky package-lock.json diff is due to the thing described in #9321.Related Issue(s)
Checklist
Deployment Notes
Anyone running VTAdmin will now be required to have the local node version (on their machine, in the Dockerfile, etc.) match the versions specified in the package.json file. (I added the "release notes" tag in case this is worth mentioning.)