fix(dashboard): harden Node engine alignment checks

This commit is contained in:
fangliquanflq
2026-08-18 17:28:29 +08:00
committed by Teknium
parent 7d61b6701e
commit bb06a8d414
4 changed files with 15 additions and 9 deletions
@@ -0,0 +1 @@
momomojo
+4 -4
View File
@@ -1643,10 +1643,10 @@ function Set-GitBashEnvVar {
Write-Info "If needed, set HERMES_GIT_BASH_PATH manually to your bash.exe path."
}
# The dependency tree supports Node 22.22+, 24, and 26+. nanoid 6 deliberately
# excludes odd-numbered Node releases, so accepting Node 23/25 here only defers
# the failure to `npm ci` under engine-strict. Keep this in sync with the root
# package.json.
# The dependency tree supports Node 22.22+, 24, and 26+. nanoid 6 excludes
# Node 23 and 25 while its >=26 arm accepts later releases, so accepting 23/25
# only defers the failure to `npm ci` under engine-strict. Keep this in sync
# with the root package.json.
function Test-NodeVersionOk {
param([string]$Version)
try {
+5 -5
View File
@@ -882,11 +882,11 @@ check_cxx_compiler() {
return 1
}
# The dependency tree supports Node 22.22+, 24, and 26+. nanoid 6 deliberately
# excludes odd-numbered Node releases, so accepting Node 23/25 here only defers
# the failure to `npm ci` under engine-strict. Keep this in sync with the root
# package.json. Anything outside the supported lines is replaced with the
# Hermes-managed Node $NODE_VERSION.
# The dependency tree supports Node 22.22+, 24, and 26+. nanoid 6 excludes
# Node 23 and 25 while its >=26 arm accepts later releases, so accepting 23/25
# here only defers the failure to `npm ci` under engine-strict. Keep this in
# sync with the root package.json. Anything outside the supported lines is
# replaced with the Hermes-managed Node $NODE_VERSION.
node_satisfies_build() {
local ver="${1#v}"
local major="${ver%%.*}"
+5
View File
@@ -36,6 +36,11 @@ function compare(left: string, right: string): number {
}
function satisfiesClause(version: string, clause: string): boolean {
assert.match(
clause,
/^(?:\^|>=|<=|>|<|=)?\d+(?:\.\d+){0,2}$/,
`unsupported semver clause: ${clause}`
)
if (clause.startsWith('^')) {
const bound = clause.slice(1)
return parseVersion(version)[0] === parseVersion(bound)[0] && compare(version, bound) >= 0