@forge/cli
12.23.0-next.7-experimental-44b7a1213.0.0-next.11
out/command-line/register-module-commands.js~
out/command-line/register-module-commands.jsModified+19−14
Index: package/out/command-line/register-module-commands.js
===================================================================
--- package/out/command-line/register-module-commands.js
+++ package/out/command-line/register-module-commands.js
@@ -1,10 +1,10 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
-exports.registerCommands = void 0;
+exports.registerCommands = registerCommands;
const cli_shared_1 = require("@forge/cli-shared");
function registerModuleAddCommand(parent, deps) {
- const { controllers: { moduleController } } = deps;
+ const { controllers: { moduleAddController } } = deps;
parent
.command('add')
.description(cli_shared_1.Text.module.add.description)
.option('-t, --module-type <type>', cli_shared_1.Text.module.add.optionModuleType)
@@ -14,34 +14,39 @@
.option('--force', cli_shared_1.Text.module.add.optionForce)
.option('--no-install', cli_shared_1.Text.module.add.optionNoInstall)
.requireManifestFile()
.action(async (options) => {
- return await moduleController.run(options);
+ return await moduleAddController.run(options);
});
}
function registerModuleListCommand(parent, deps) {
+ const { controllers: { moduleListController } } = deps;
parent
.command('list')
.description(cli_shared_1.Text.module.list.description)
+ .option('-f, --prefix <prefix>', cli_shared_1.Text.module.list.optionPrefix)
.option('-p, --product <product>', cli_shared_1.Text.module.list.optionProduct)
.option('-u, --ui-type <ui-kit|custom-ui>', cli_shared_1.Text.module.list.optionUiType)
- .action(async (_options) => {
+ .nonInteractiveOption()
+ .action(async (options) => {
+ return await moduleListController.run(options);
});
}
-function registerModuleInfoCommand(parent, deps) {
+function registerModuleShowCommand(parent, deps) {
+ const { controllers: { moduleShowController } } = deps;
parent
- .command('info')
- .description(cli_shared_1.Text.module.info.description)
- .option('-t, --module-type <type>', cli_shared_1.Text.module.info.optionModuleType)
- .option('-p, --product <product>', cli_shared_1.Text.module.info.optionProduct)
- .option('-u, --ui-type <ui-kit|custom-ui>', cli_shared_1.Text.module.info.optionUiType)
- .action(async (_options) => {
+ .command('show [moduleType]')
+ .description(cli_shared_1.Text.module.show.description)
+ .action(async (moduleType, options) => {
+ return await moduleShowController.run({
+ ...options,
+ moduleType
+ });
});
}
async function registerCommands(deps) {
- const moduleCommand = deps.cmd.command('module', { hidden: true }).description(cli_shared_1.Text.module.cmd.description);
+ const moduleCommand = deps.cmd.command('module').description(cli_shared_1.Text.module.cmd.description);
registerModuleAddCommand(moduleCommand, deps);
registerModuleListCommand(moduleCommand, deps);
- registerModuleInfoCommand(moduleCommand, deps);
+ registerModuleShowCommand(moduleCommand, deps);
}
-exports.registerCommands = registerCommands;
//# sourceMappingURL=register-module-commands.js.map
\ No newline at end of file