fix(engines): declare the Node floor the CLI actually starts on, >=20.12.0 (PHARN-06) - #200
Merged
Merged
Conversation
….12.0 (PHARN-06) `engines.node` said ">=20", but @clack/prompts and @clack/core (runtime deps) declare ">= 20.12.0" and import `styleText` from node:util, so on Node 20.0-20.11 even `pharn --version` died at load time with a SyntaxError. - engines.node -> ">=20.12.0" (package.json + the lockfile root entry). - tests/engines.test.ts fails if any runtime dependency declares a higher floor than ours, and pins the README badge to it. - New, separately-named workflow node-floor.yml (`Smoke (node 20.12.0)`): build on 24, pack, install the tarball on exactly 20.12.0 and run --version/--help. ci.yml's six required contexts are untouched. - check-run-pins.test.mjs: live count of lockfile/path installs 7 -> 9. - README badge/scope, getting-started, troubleshooting, contributing, SECURITY.md, CLAUDE.md, ci.yml comment corrected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TvcuVhk8hTeDskp5pAJhnc
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What this changes
package.jsondeclaredengines.node: ">=20", but the CLI does not start on Node 20.0–20.11. Two runtime dependencies,@clack/promptsand@clack/core, declare">= 20.12.0"and importstyleTextfromnode:util. On older Node 20 releases evenpharn --versionfails while loading, withSyntaxError: … does not provide an export named 'styleText'. npm only printsEBADENGINEwarnings during install, so users end up with a CLI that cannot run.engines.nodeis now">=20.12.0", inpackage.jsonand in the root entry ofpackage-lock.json.tests/engines.test.ts: reads the installed runtime dependencies (including their own dependencies) and fails if any of them requires a newer Node than we declare. It fails on the old>=20. It also checks that the README badge shows the same version..github/workflows/node-floor.yml: a job namedSmoke (node 20.12.0). It builds the package on Node 24, packs it withnpm pack, installs the result on exactly Node 20.12.0, and runspharn --versionandpharn --help. It is a separate workflow so the six required jobs inci.ymlkeep their names, asdocs/contributing.mdrequires. This job is not a required check..dev/floor/check-run-pins.test.mjscounts how many workflow steps install packages from a lockfile or a local path. The count goes from 7 to 9 because of the new workflow, and the test records why.>=20corrected in the README badge and "Current scope",docs/getting-started.md,docs/troubleshooting.md,docs/contributing.md,SECURITY.md,CLAUDE.md, and the header comment inci.yml.Built with
/pharn-dev-ship; stage artifacts are in.dev/features/engines-node-floor/. Results:no-regressionsPASSThe first regress/verify run was red, and I fixed both causes before pushing:
npx pharn, so the workflow now runs./node_modules/.bin/pharndirectly.Type of change
feat— new stack option, wizard step, or command capabilityfix— bug fixdocs— docs-only changechore/refactor— tooling or internal restructure, no behavior changeArea(s) touched
package metadata | tests | repo tooling (new workflow) | docs
Checklist
.js-extension import convention.>=20.docs/pages.contents: readand uses the same pinned action SHAs asfloor.yml.Quality gates
npm run checkpasses locally (1335/1335; non-root user, node 22).npm run buildsucceeds, and the packed CLI started on local Node 20.20.2 (0.5.0).npm run test:coveragepasses (left to CI).Notes for the reviewer
package-lock.jsonchanges (the rootengines). The only npm available locally is npm 10, which would also have rewritten unrelatedlibcfields, so I edited that single line directly.Smoke (node 20.12.0)to themainruleset's required checks.🤖 Generated with Claude Code
https://claude.ai/code/session_01TvcuVhk8hTeDskp5pAJhnc
Generated by Claude Code