@ima/plugin-cli
Version:
IMA.js Plugin CLI tool to build, link, develop IMA.js plugins.
64 lines • 2.38 kB
JavaScript
#!/usr/bin/env node
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const chalk_1 = __importDefault(require("chalk"));
const yargs_1 = __importDefault(require("yargs"));
const commands_1 = require("../utils/commands");
yargs_1.default
.scriptName(chalk_1.default.green.bold('ima-plugin'))
// .description('CLI helper to build ima plugins')
.usage('Usage: $0 <command>')
.demandCommand(1, 'You need to run at least one command to move on')
.help()
.updateStrings({
'Examples:': chalk_1.default.bold.cyan('Examples:'),
'Options:': chalk_1.default.bold.cyan('Options:'),
'Commands:': chalk_1.default.bold.cyan('Commands:'),
})
.updateLocale({
choices: chalk_1.default.gray('choices'),
count: chalk_1.default.gray('count'),
boolean: chalk_1.default.gray('boolean'),
number: chalk_1.default.gray('number'),
string: chalk_1.default.gray('string'),
aliases: chalk_1.default.gray('aliases'),
'generated-value': chalk_1.default.gray('generated-value'),
default: chalk_1.default.magenta('default'),
required: chalk_1.default.yellow('required'),
})
.option('clientServerConfig', {
desc: 'Use client/server build configuration instead of the default one',
type: 'boolean',
default: false,
})
.option('nodeConfig', {
desc: 'Use node build configuration instead of the default one',
type: 'boolean',
default: false,
})
.option('silent', {
alias: 's',
desc: 'Disable logging status messages',
type: 'boolean',
default: false,
})
.option('jsxRuntime', {
alias: 'j',
desc: 'Override JSX runtime option',
type: 'string',
choices: ['classic', 'automatic'],
default: 'automatic',
})
.option('additionalWatchPaths', {
alias: 'w',
desc: 'Array of additional watch paths to use when linking package.',
type: 'array',
})
.command('build', 'Build ima plugin at current directory', {}, commands_1.build)
.command('dev', 'Watch ima plugin at current directory', {}, commands_1.watch)
.command('link <path>', 'Link ima plugin at current directory to ima application at given path', {}, commands_1.watch)
.wrap(null).argv;
//# sourceMappingURL=ima-plugin.js.map