fix: improve CLI error handling and user guidance

- Add Node.js >= 22 runtime version check before any imports
- Add EADDRINUSE error handlers for HTTP and WebSocket servers
- Fix misleading 'Couldn't parse Quartz configuration' error message
- Add actionable guidance to sync/upgrade/push failure messages
- Add --concurrency validation (must be >= 1)
This commit is contained in:
saberzero1
2026-05-24 17:09:56 +02:00
parent caa55037f7
commit 7f00400ad2
2 changed files with 48 additions and 5 deletions
+8
View File
@@ -1,4 +1,12 @@
#!/usr/bin/env -S node --no-deprecation
const [major] = process.versions.node.split(".").map(Number)
if (major < 22) {
console.error(
`\nQuartz requires Node.js >= 22, but you are running Node.js ${process.version}.\n` +
`Please upgrade: https://nodejs.org/\n`,
)
process.exit(1)
}
import yargs from "yargs"
import { hideBin } from "yargs/helpers"
import {