@elsikora/setup-wizard
Version:
Setup Wizard - CLI scaffolding utility
47 lines (42 loc) • 1.71 kB
JavaScript
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 will check is project has all instruments from Setup-Wizard.
Options:
-e, --hasEslint Checks for ESLint configuration
-p, --hasPrettier Checks for Prettier configuration`)
.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