Skip to content

feat: enforce .nvmrc#52

Open
justandras wants to merge 3 commits into
mainfrom
feat/enforce-nvmrc
Open

feat: enforce .nvmrc#52
justandras wants to merge 3 commits into
mainfrom
feat/enforce-nvmrc

Conversation

@justandras
Copy link
Copy Markdown
Member

About the Contributor

This pull request is posted on behalf of SuperflyTV

Type of Contribution

This is a: Feature / Code improvement

Current Behaviour

The required node version has to be manually selected in environments with multiple available versions.

New Behaviour

Added .nvmrc and a script to enforce that it aligns with the required version by the package.

Testing Instructions

  • I have added one or more unit tests for this PR
  • I have updated the relevant unit tests
  • No unit test changes are needed for this PR

Affected areas

  • This PR affects CI workflows

Time Frame

Not urgent, but we would like to get this merged into the in-development release.

Status

  • PR is ready to be reviewed.
  • The functionality has been tested by the author.
  • Relevant unit tests have been added / updated.
  • Relevant documentation (code comments, system documentation) has been added / updated.

@justandras justandras requested review from Julusian and rjmunro May 7, 2026 09:50
@justandras justandras self-assigned this May 7, 2026
@justandras justandras added the enhancement New feature or request label May 7, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 7, 2026

Review Change Stack

Warning

Rate limit exceeded

@justandras has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 35 minutes and 12 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 32399ce1-196b-4e2b-9103-498dc957c144

📥 Commits

Reviewing files that changed from the base of the PR and between ee3b1c3 and 77facea.

📒 Files selected for processing (1)
  • bin/ensureNvmrc.mjs

Walkthrough

This PR pins Node to 22.12.0 in .nvmrc, adds bin/ensureNvmrc.mjs to derive/validate/sync .nvmrc from package.json#engines.node, exposes npm scripts to run it, and updates GitHub Actions workflows to install Node from .nvmrc and run the validation step.

Changes

Node Version Management Infrastructure

Layer / File(s) Summary
Node Version Declaration
.nvmrc, bin/ensureNvmrc.mjs
.nvmrc pins Node to 22.12.0. Script parses package.json#engines.node and derives the expected .nvmrc value.
Validation and Sync Logic
bin/ensureNvmrc.mjs
Normalization strips leading v, compares .nvmrc to derived value, writes .nvmrc when --fix is provided, and sets a non-zero exit code on mismatch.
Package Scripts
package.json
Adds lint:nvmrc (validate) and lint:nvmrc:fix (auto-sync) npm scripts invoking the script.
CI Workflow Integration
.github/workflows/node.yaml, .github/workflows/publish.yaml
Jobs now use actions/setup-node@v6 with node-version-file: .nvmrc and run node ./bin/ensureNvmrc.mjs before proceeding.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • rjmunro
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat: enforce .nvmrc' directly and clearly summarizes the main change: adding enforcement of the .nvmrc file to match package Node version requirements.
Description check ✅ Passed The description is clearly related to the changeset, explaining the problem (manual Node version selection), the solution (adding .nvmrc and an enforcement script), and the affected areas (CI workflows).
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/enforce-nvmrc

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Comment thread package.json Outdated
@justandras justandras requested a review from rjmunro May 7, 2026 12:49
Comment thread bin/ensureNvmrc.mjs Outdated
`Expected: ${expected}`,
`Derived from package.json engines.node: ${range}`,
'',
'Fix: yarn fix:nvmrc',
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This says yarn fix:nvmrc but package.json says lint:nvmrc:fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants