feat(cli): add prdy, quality-rails, and wizard subcommands
Wires @mosaic/prdy, @mosaic/quality-rails, and @mosaic/mosaic into the unified CLI binary. The wizard subcommand uses dynamic import to avoid loading heavy wizard deps for other commands. Adds @types/node to cli devDependencies and guards @mosaic/mosaic index.ts program.parse() so the module is safely importable without auto-executing. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
#!/usr/bin/env node
|
||||
import { resolve } from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
|
||||
import { Command } from 'commander';
|
||||
import { ClackPrompter } from './prompter/clack-prompter.js';
|
||||
import { HeadlessPrompter } from './prompter/headless-prompter.js';
|
||||
@@ -8,7 +11,12 @@ import { WizardCancelledError } from './errors.js';
|
||||
import { VERSION, DEFAULT_MOSAIC_HOME } from './constants.js';
|
||||
import type { CommunicationStyle } from './types.js';
|
||||
|
||||
export { VERSION };
|
||||
export { VERSION, DEFAULT_MOSAIC_HOME };
|
||||
export { runWizard } from './wizard.js';
|
||||
export { ClackPrompter } from './prompter/clack-prompter.js';
|
||||
export { HeadlessPrompter } from './prompter/headless-prompter.js';
|
||||
export { createConfigService } from './config/config-service.js';
|
||||
export { WizardCancelledError } from './errors.js';
|
||||
|
||||
const program = new Command()
|
||||
.name('mosaic-wizard')
|
||||
@@ -70,4 +78,7 @@ program
|
||||
}
|
||||
});
|
||||
|
||||
program.parse();
|
||||
const entryPath = process.argv[1] ? resolve(process.argv[1]) : '';
|
||||
if (entryPath.length > 0 && entryPath === fileURLToPath(import.meta.url)) {
|
||||
program.parse();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user