Replace brocli framework with Node's built-in util.parseArgs and a declarative command registry. The CLI no longer hangs after completing because: - DB connections are lazily created and explicitly closed - Winston/Redis logging is excluded from the bundle entirely - process.exit() is always called with proper exit codes Additional improvements: - Bundle size reduced from 5.3MB to 1.2MB (native drivers externalized) - Proper column-aligned table output for list commands - --json flag on list commands for scripting/automation - Per-command --help with usage examples - Execution timing shown on success - Consistent exit codes (0=success, 1=error, 2=usage) - Docker wrapper sets DISABLE_REDIS_LOGS and uses exec
48 lines
1.4 KiB
JSON
48 lines
1.4 KiB
JSON
{
|
|
"name": "@homarr/cli",
|
|
"version": "0.1.0",
|
|
"private": true,
|
|
"license": "Apache-2.0",
|
|
"type": "module",
|
|
"exports": {
|
|
".": "./index.ts"
|
|
},
|
|
"typesVersions": {
|
|
"*": {
|
|
"*": [
|
|
"src/*"
|
|
]
|
|
}
|
|
},
|
|
"scripts": {
|
|
"build": "esbuild src/index.ts --bundle --platform=node --outfile=cli.cjs --external:bcrypt --external:cpu-features --external:better-sqlite3 --external:mysql2 --external:pg --loader:.html=text --loader:.node=text",
|
|
"clean": "rm -rf .turbo node_modules",
|
|
"format": "prettier --check . --ignore-path ../../.gitignore",
|
|
"lint": "eslint",
|
|
"run": "pnpm with-env node cli.cjs",
|
|
"typecheck": "tsc --noEmit",
|
|
"with-env": "dotenv -e .env --"
|
|
},
|
|
"prettier": "@homarr/prettier-config",
|
|
"dependencies": {
|
|
"@homarr/auth": "workspace:^0.1.0",
|
|
"@homarr/common": "workspace:^0.1.0",
|
|
"@homarr/core": "workspace:^0.1.0",
|
|
"@homarr/db": "workspace:^0.1.0",
|
|
"@homarr/validation": "workspace:^0.1.0",
|
|
"better-sqlite3": "catalog:",
|
|
"dotenv": "catalog:",
|
|
"drizzle-orm": "catalog:",
|
|
"mysql2": "catalog:",
|
|
"pg": "catalog:"
|
|
},
|
|
"devDependencies": {
|
|
"@homarr/eslint-config": "workspace:^0.2.0",
|
|
"@homarr/prettier-config": "workspace:^0.1.0",
|
|
"@homarr/tsconfig": "workspace:^0.1.0",
|
|
"esbuild": "catalog:",
|
|
"eslint": "catalog:",
|
|
"typescript": "catalog:"
|
|
}
|
|
}
|