refactor: consolidate CLI entry points into dedicated cli/ directory

Move `database` and `setup` CLI scripts from their respective feature
directories into a unified `src/cli/` directory. Update `tsup.config.js`
build entries and `package.json` bin paths to reflect the new locations.
This commit is contained in:
2026-04-12 14:39:17 -04:00
parent 54c4ad058d
commit 390133808b
4 changed files with 16 additions and 18 deletions
+2 -2
View File
@@ -23,8 +23,8 @@
"prepublishOnly": "npm run build"
},
"bin": {
"zen-db": "./dist/core/database/cli.js",
"zen-setup": "./dist/features/setup/cli.js"
"zen-db": "./dist/cli/database.js",
"zen-setup": "./dist/cli/setup.js"
},
"dependencies": {
"@headlessui/react": "^2.0.0",
@@ -16,7 +16,7 @@ dotenv.config({ path: resolve(process.cwd(), '.env.local') });
// The CLI always runs locally, so default to development to use ZEN_DATABASE_URL_DEV if set
process.env.NODE_ENV = process.env.NODE_ENV || 'development';
import { initDatabase, dropAuthTables, testConnection, closePool } from './index.js';
import { initDatabase, dropAuthTables, testConnection, closePool } from '../core/database/index.js';
import readline from 'readline';
async function runCLI() {
@@ -64,7 +64,6 @@ Example:
console.log('⚠️ WARNING: This will delete all authentication tables!\n');
console.log('Type "yes" to confirm or Ctrl+C to cancel...');
// Simple confirmation (in production, you'd use a proper readline)
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout
@@ -124,4 +123,3 @@ if (isMainModule) {
}
export { runCLI };
+2 -2
View File
@@ -16,9 +16,9 @@ export default defineConfig([
'src/core/api/index.js',
'src/core/api/nx-route.js',
'src/core/database/index.js',
'src/core/database/cli.js',
'src/features/setup/index.js',
'src/features/setup/cli.js',
'src/cli/database.js',
'src/cli/setup.js',
'src/core/email/index.js',
'src/core/email/templates/index.js',
'src/core/storage/index.js',