Repository navigation
feat(cli): warn that the next major will require Node 20+ - #2411
Conversation
Nothing currently tells users the next major release raises the minimum to Node 20. Print a heads up on every run, naming both ways out: pin @percy/cli to its current major, or get the setup onto Node 20+. Warning only. The current major still supports Node 14+, so `engines` stays at ">=14" — that bump belongs to the major release itself. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
4ef410f to
f15541e
Compare
aryanku-dev
left a comment
There was a problem hiding this comment.
Claude Code Review (automated) — 2 inline finding(s). Full report in the PR comment below. Verdict: Passed.
| } | ||
|
|
||
| // heads up ahead of the next major release, which raises the minimum to Node 20 | ||
| console.warn('Heads up! The next major version of @percy/cli will require Node 20+. ' + ( |
There was a problem hiding this comment.
[Medium] Warning has no mute switch and prints on every invocation
Every other user-facing warning in this codebase can be silenced — checkForUpdate() honours PERCY_SKIP_UPDATE_CHECK, and logger output honours PERCY_LOGLEVEL. This one runs before @percy/logger is loaded and has no env gate, so it prints on every command (percy --version, percy --help, every subcommand, every CI matrix job) for the whole life of the current major. The blast radius is every Percy SDK's CI logs.
Suggestion: Called out as intentional in the PR description, so not blocking — but it is a product decision with wide reach and deserves an explicit second sign-off. If the noise proves excessive, update.js's CACHE_FILE / CACHE_MAX_AGE pattern is a ready-made template for "print at most once per N days" without adding an opt-out flag.
Reviewer: stack-code-reviewer
| process.exit(1); | ||
| } | ||
|
|
||
| // heads up ahead of the next major release, which raises the minimum to Node 20 |
There was a problem hiding this comment.
[Low] No tracking reference for removal, and no note on why console.warn
Two small things this comment could carry:
- Nothing guarantees this block is deleted when the next major bumps
engines.nodeto>=20. If forgotten it becomes permanently wrong — telling Node 20+ users that "the next major" will require Node 20+, which they are already past. - The raw
console.warnis correct here (@percy/loggeronly exists after the dynamicimport('../dist/index.js')resolves), but nothing says so — a future contributor "cleaning this up" intologger.warn(...)would introduce a load-order bug.
Suggestion: // TODO(PER-XXXX): remove once vX ships with engines.node >=20. Uses console.warn because @percy/logger is not loaded until the import below.
Reviewer: stack-code-reviewer
Claude Code PR ReviewPR: #2411 • Head: f15541e • Reviewers: stack-code-reviewer SummaryAdds an unconditional Review Table
Findings1. Warning has no mute switch and prints on every invocation
2. No tracking reference for removing the warning when the major ships
3. "Heads up!" lead-in duplicates the update-check warnings
4. Comment does not explain why
Confirmed as correct
Verdict: PASS — no High or Critical findings. One Medium worth an explicit product sign-off (unconditional, unmutable output on every invocation across every consumer's CI) and three Low polish items. |
What
Tells every user that the next major version of
@percy/cliwill require Node 20+, so they can pin or get their setup ready before it lands.Why
Nothing currently announces the upcoming minimum-version bump. Without a heads up, the first signal users get is a broken pipeline the day the major lands.
How
Five lines in
packages/cli/bin/run.cjs, after the existing Node < 14 gate (which is untouched):Shown to everyone, not just users below Node 20 — the announcement matters to anyone who might upgrade across the major, whatever Node they are on today.
Notes
enginesstays">=14"— that bump belongs to the major release itself.dist/index.jsimport, so it fires for every command and never on programmatic use of the package.Testing
Verified by hand on Node v18.20.8 — the warning prints ahead of the command. Lint passes. No unit test:
bin/run.cjsis the pre-distbootstrap and isn't covered by the jasmine suite, same as the existing< 14gate.🤖 Generated with Claude Code