chore(dev): pin Node 22 for local work with .nvmrc, matching CI

Node 26 on a contributor Mac failed ~15 Electron tests that pass on CI's
Node 22. .nvmrc lets nvm/fnm/Volta select 22; a test keeps every
workflow's node-version on the same major; CONTRIBUTING says why.
This commit is contained in:
debpalash committed 2026-11-08 22:40:16 +05:30
1 parent 0b9cbc6269
commit 30ea8252fe
3 files changed
+26 -1

No files matched your search

+1 -1
View File
@@ -37,7 +37,7 @@ Read it before opening a proposal; the licence check in particular ends most of
- [Git](https://git-scm.com/)
- `curl` (used by the Bun / uv / rustup install one-liners on macOS and Linux)
- [Node.js 22.12.0 or newer](https://nodejs.org/) (Electron development and validation scripts)
- [Node.js 22](https://nodejs.org/), 22.12.0 or newer (Electron development and validation scripts). CI runs Node 22 and `.nvmrc` pins it for nvm, fnm and Volta; newer majors change some error messages and fail tests that pass on CI.
- [Bun](https://bun.sh/) (frontend package manager)
- [uv](https://docs.astral.sh/uv/) (Python environment manager)
- [ffmpeg](https://ffmpeg.org/) (audio/video processing)
+1
View File
@@ -0,0 +1 @@
22
+24
View File
@@ -0,0 +1,24 @@
"""Local tooling and CI run the same Node major (single source: .nvmrc).
Node 26 on a contributor machine failed ~15 Electron tests that pass on CI's
Node 22 (error messages from rejected promises differ), which reads as a real
regression. `.nvmrc` lets nvm/fnm/volta pick 22; this test keeps every
workflow's `node-version` on the same major.
"""
import re
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
def test_workflows_use_the_nvmrc_node_major():
pinned = (ROOT / ".nvmrc").read_text(encoding="utf-8").strip()
assert re.fullmatch(r"\d+", pinned), ".nvmrc must hold a bare Node major"
drift = []
for workflow in sorted((ROOT / ".github" / "workflows").glob("*.yml")):
for number, line in enumerate(workflow.read_text(encoding="utf-8").splitlines(), 1):
match = re.search(r"node-version:\s*['\"]?([0-9]+)", line)
if match and match.group(1) != pinned:
drift.append(f"{workflow.name}:{number} node {match.group(1)}")
assert not drift, f"Workflows must use Node {pinned} like .nvmrc: {drift}"