Support engine selection for Playwright Check Suites [RED-428]#1319
Merged
sorccu merged 13 commits intoMay 27, 2026
Merged
Conversation
Adds Engine.node('24') and Engine.bun('1.3') static factory methods
for selecting the JavaScript runtime engine. Also accepts plain
{ name, version } objects in checkly.config.ts.
Omitting the engine property sends null to the backend (auto-detect).
Detects the JavaScript engine from .node-version, .nvmrc, .tool-versions, .bun-version, or package.json engines field. No hardcoded version list — extracted versions are passed through to the backend, which validates them. Detection is cached per session via a shared promise on Session, so concurrent bundle() calls only read version files once.
Resolves detected and explicit engine versions through semver-based rules. EOL/unavailable versions are remapped with WarningDiagnostic notices. Denied versions (e.g. Bun 2.x) clear the engine selection. Rules are inlined as TypeScript constants (canonical source: monorepo/engines.json). The loader has an async signature to support future API-based rule loading.
Uses a dedicated diagnostic class for substituted property values. Auto-detected substitutions include a hint about version files and how to override with explicit Engine.node() / Engine.bun().
When a version is denied (e.g. Bun 2.0), the notices were silently discarded because resolveNode/resolveBun returned undefined. Now denied results propagate notices so warnings are shown to the user.
Denied versions (e.g. Bun 2.x) now produce an error diagnostic instead of a warning, while substituted versions (e.g. Node 18 → 22) remain as warnings.
Unit tests (15): verify all rule matching, follow chains, remapping, and deny behavior for both Node and Bun. Sandbox integration tests (3): verify engine diagnostics flow end-to-end through parse-project — EOL warning, denied error, and clean pass for valid versions.
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.
Summary
Adds support for selecting the JavaScript engine (Node.js or Bun) and version for Playwright Check Suites, with manual configuration, automatic detection, and rule-based version resolution.
Manual selection
Automatic detection
When
engineis not set, auto-detects from project version files (in priority order):.node-version.nvmrc(skips lts aliases).tool-versions(nodejs/bunentries).bun-versionpackage.jsonengines.node/engines.bun(semver range viaminVersion)Version resolution
Both auto-detected and explicit versions are resolved through inlined
engines.jsonrules:SubstitutedPropertyValueDiagnosticwarning (e.g., Node 18 → 22)InvalidPropertyValueDiagnosticerror (e.g., Bun 2.x)Changes
Engineclass —Engine.node()/Engine.bun()static factories with autocomplete hints for known versionsengine-resolver.tswith semver range matching, follow chains, deny actionsengine-rules-loader.tswith inlined rules (canonical source:monorepo/engines.json)engine-detector.tswith rule resolution, cached per sessionSubstitutedPropertyValueDiagnosticfor remapped versions,InvalidPropertyValueDiagnosticfor deniedDepends on
Test plan