UNPKG

@elsikora/setup-wizard

Version:

Setup Wizard - CLI scaffolding utility

43 lines (39 loc) 1.6 kB
#!/usr/bin/env node import { ECommand } from '../../infrastructure/enum/command.enum.js'; /** * Registrar for the 'analyze' command. * Configures and registers the command that analyzes project structure and dependencies. */ class AnalyzeCommandRegistrar { /** The command factory used to create command instances */ COMMAND_FACTORY; /** The root Commander program instance */ PROGRAM; /** * Initializes a new instance of the AnalyzeCommandRegistrar. * @param program - The Commander program to attach the command to * @param commandFactory - Factory for creating command instances */ constructor(program, commandFactory) { this.PROGRAM = program; this.COMMAND_FACTORY = commandFactory; } /** * Configures and registers the 'analyze' command. * Sets up command description, options, and action handler. * @returns The configured Commander command instance */ execute() { return this.PROGRAM.command(ECommand.ANALYZE) .description(`Analyze project structure and dependencies. This command checks whether the project has all Setup-Wizard tools configured.`) .option("-e, --hasEslint", "Checks for ESLint configuration") .option("-p, --hasPrettier", "Checks for Prettier configuration") .action(async (options) => { const command = this.COMMAND_FACTORY.createCommand(ECommand.ANALYZE, options); await command.execute(); }); } } export { AnalyzeCommandRegistrar }; //# sourceMappingURL=analyze.registrar.js.map