🐛 fix(cli): use 'gray' instead of 'grey' in styleText calls (#2321)

Node.js util.styleText does not accept 'grey' as a format name.
While util.inspect.colors defines 'grey' as a non-enumerable alias
for 'gray', styleText validates against Object.keys(inspect.colors)
which only includes enumerable properties — so 'grey' has never
been a valid styleText format and throws ERR_INVALID_ARG_VALUE.
This commit is contained in:
wasita
2026-03-04 10:42:49 -05:00
committed by GitHub
parent 9576701d85
commit 59b5807601

View File

@@ -318,7 +318,7 @@ export async function handleBuild(argv) {
const result = await ctx.rebuild().catch((err) => { const result = await ctx.rebuild().catch((err) => {
console.error(`${styleText("red", "Couldn't parse Quartz configuration:")} ${fp}`) console.error(`${styleText("red", "Couldn't parse Quartz configuration:")} ${fp}`)
console.log(`Reason: ${styleText("grey", err)}`) console.log(`Reason: ${styleText("gray", err)}`)
process.exit(1) process.exit(1)
}) })
release() release()
@@ -395,7 +395,7 @@ export async function handleBuild(argv) {
status >= 200 && status < 300 status >= 200 && status < 300
? styleText("green", `[${status}]`) ? styleText("green", `[${status}]`)
: styleText("red", `[${status}]`) : styleText("red", `[${status}]`)
console.log(statusString + styleText("grey", ` ${argv.baseDir}${req.url}`)) console.log(statusString + styleText("gray", ` ${argv.baseDir}${req.url}`))
release() release()
} }
@@ -406,7 +406,7 @@ export async function handleBuild(argv) {
}) })
console.log( console.log(
styleText("yellow", "[302]") + styleText("yellow", "[302]") +
styleText("grey", ` ${argv.baseDir}${req.url} -> ${newFp}`), styleText("gray", ` ${argv.baseDir}${req.url} -> ${newFp}`),
) )
res.end() res.end()
} }
@@ -482,7 +482,7 @@ export async function handleBuild(argv) {
.on("change", () => build(clientRefresh)) .on("change", () => build(clientRefresh))
.on("unlink", () => build(clientRefresh)) .on("unlink", () => build(clientRefresh))
console.log(styleText("grey", "hint: exit with ctrl+c")) console.log(styleText("gray", "hint: exit with ctrl+c"))
} }
} }