nucleus-ui-builder
Version:
37 lines (36 loc) • 1.38 kB
JavaScript
function _define_property(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
}
import yargs from "yargs";
import { hideBin } from "yargs/helpers";
import CommandProcessor from "../commands/processor/command.processor.js";
import CommandScaffold from "../commands/scaffold/command.scaffold.js";
import TemplateLoader from "../loader/template.loader.js";
class CLI {
run() {
console.log(`🚀 Running CLI...`);
yargs(hideBin(process.argv)).command({
...this.scaffoldCommand,
builder: this.scaffoldCommand.builder.bind(this.scaffoldCommand),
handler: this.scaffoldCommand.handler.bind(this.scaffoldCommand)
}).completion(`completion`, `Generate completion script`).demandCommand(3, `You need at least three commands before moving on`).help().parse();
}
constructor(){
_define_property(this, "processor", void 0);
_define_property(this, "scaffoldCommand", void 0);
this.processor = new CommandProcessor(TemplateLoader.getInstance());
this.scaffoldCommand = new CommandScaffold(this.processor);
}
}
export { CLI as default };
//# sourceMappingURL=cli.js.map