Compare commits

...

2 Commits
v5.0.0 ... v4

Author SHA1 Message Date
wasita
59b5807601
🐛 fix(cli): use 'gray' instead of 'grey' in styleText calls (#2321)
Some checks failed
Build and Test / build-and-test (ubuntu-latest) (push) Has been skipped
Build and Test / publish-tag (push) Has been skipped
Docker build & push image / build (push) Has been skipped
Build and Test / build-and-test (macos-latest) (push) Has been cancelled
Build and Test / build-and-test (windows-latest) (push) Has been cancelled
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.
2026-03-04 16:42:49 +01:00
Andrew G. Dunn
9576701d85
fix: await micromorph() to prevent race condition with nav event handlers (#2323)
Some checks failed
Build and Test / build-and-test (ubuntu-latest) (push) Has been skipped
Build and Test / publish-tag (push) Has been skipped
Docker build & push image / build (push) Has been skipped
Build and Test / build-and-test (macos-latest) (push) Has been cancelled
Build and Test / build-and-test (windows-latest) (push) Has been cancelled
micromorph() returns Promise<void> because its internal patch() function
is async and uses Promise.all for recursive child patching. Without
await, the DOM morph may still be in progress when the nav event fires
and downstream handlers attempt to rebuild dynamic content.

Fixes #2322
2026-03-02 08:31:53 -08:00
2 changed files with 5 additions and 5 deletions

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"))
} }
} }

View File

@ -102,7 +102,7 @@ async function _navigate(url: URL, isBack: boolean = false) {
html.body.appendChild(announcer) html.body.appendChild(announcer)
// morph body // morph body
micromorph(document.body, html.body) await micromorph(document.body, html.body)
// scroll into place and add history // scroll into place and add history
if (!isBack) { if (!isBack) {