nucleus-ui-builder
Version:
51 lines (50 loc) • 1.91 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "default", {
enumerable: true,
get: function() {
return CLI;
}
});
const _yargs = /*#__PURE__*/ _interop_require_default(require("yargs"));
const _helpers = require("yargs/helpers");
const _commandprocessor = /*#__PURE__*/ _interop_require_default(require("../commands/processor/command.processor.js"));
const _commandscaffold = /*#__PURE__*/ _interop_require_default(require("../commands/scaffold/command.scaffold.js"));
const _templateloader = /*#__PURE__*/ _interop_require_default(require("../loader/template.loader.js"));
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;
}
function _interop_require_default(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
class CLI {
run() {
console.log(`🚀 Running CLI...`);
(0, _yargs.default)((0, _helpers.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.default(_templateloader.default.getInstance());
this.scaffoldCommand = new _commandscaffold.default(this.processor);
}
}
//# sourceMappingURL=cli.js.map