refactor(doctor): share the runtime check result (#17361)

This commit is contained in:
Vincent Koc
2026-12-06 10:33:43 +08:00
committed by GitHub
parent 72d0ebdeba
commit a545387d46
+11 -16
View File
@@ -226,28 +226,23 @@ export const nodeCheck = ({
remediation: `Install ${SUPPORTED_NODE_VERSION_PROSE}.`,
classification: "missing_dependency",
} as const;
if (runtime.id === "node")
return {
...check(
"node",
supportsJavaScriptRuntime(runtime),
runtime.version,
failure,
),
details: { runtime: "node", version: runtime.version },
};
const isNode = runtime.id === "node";
return {
...check(
"node",
supportsJavaScriptRuntime(runtime),
`Bun ${runtime.version} (Node.js ${runtime.nodeCompatibilityVersion} compatibility)`,
isNode
? runtime.version
: `Bun ${runtime.version} (Node.js ${runtime.nodeCompatibilityVersion} compatibility)`,
failure,
),
details: {
runtime: "bun",
version: runtime.version,
node_compatibility_version: runtime.nodeCompatibilityVersion,
},
details: isNode
? { runtime: "node", version: runtime.version }
: {
runtime: "bun",
version: runtime.version,
node_compatibility_version: runtime.nodeCompatibilityVersion,
},
};
};