Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/cli/bin/run.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ if (parseInt(process.version.split('.')[0].substring(1), 10) < 14) {
process.exit(1);
}

// heads up ahead of the next major release, which raises the minimum to Node 20

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

[Low] No tracking reference for removal, and no note on why console.warn

Two small things this comment could carry:

  1. Nothing guarantees this block is deleted when the next major bumps engines.node to >=20. If forgotten it becomes permanently wrong — telling Node 20+ users that "the next major" will require Node 20+, which they are already past.
  2. The raw console.warn is correct here (@percy/logger only exists after the dynamic import('../dist/index.js') resolves), but nothing says so — a future contributor "cleaning this up" into logger.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

console.warn('Heads up! The next major version of @percy/cli will require Node 20+. ' + (

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

[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

'Either pin @percy/cli to its current major version, or make sure your setup runs ' +
'on Node 20+, before the next major release.'));

import('../dist/index.js')
.then(async ({ percy, checkForUpdate }) => {
await checkForUpdate();
Expand Down
Loading