@mypaas/hcm-cli
Version:
Vant Cli 是一个 Vue 组件库构建工具,通过 Vant Cli 可以快速搭建一套功能完备的 Vue 组件库。
60 lines (59 loc) • 3.27 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const commander_1 = require("commander");
// @ts-ignore
const package_json_1 = __importDefault(require("../package.json"));
// commands
const dev_1 = require("./commands/dev");
const lint_1 = require("./commands/lint");
const jest_1 = require("./commands/jest");
const clean_1 = require("./commands/clean");
const build_1 = require("./commands/build");
const release_1 = require("./commands/release");
const changelog_1 = require("./commands/changelog");
const build_site_1 = require("./commands/build-site");
const commit_lint_1 = require("./commands/commit-lint");
const upload_1 = require("./commands/upload");
commander_1.version(`@vant/cli ${package_json_1.default.version}`);
process.env.VANT_CLI_VERSION = package_json_1.default.version;
commander_1.command('dev').description('Run webpack dev server').action(dev_1.dev);
commander_1.command('lint').description('Run eslint and stylelint').action(lint_1.lint);
commander_1.command('test')
.description('Run unit tests through jest')
.option('--watch', 'Watch files for changes and rerun tests related to changed files')
.option('--clearCache', 'Clears the configured Jest cache directory and then exits')
.option('--changedSince <changedSince>', 'Runs tests related to the changes since the provided branch or commit hash')
.option('--logHeapUsage', 'Logs the heap usage after every test. Useful to debug memory leaks')
.option('--runInBand', 'Run all tests serially in the current process, rather than creating a worker pool of child processes that run tests')
.option('--only <only>', 'Run the tests in the specified directory')
.option('--debug', 'Print debugging info about your Jest config')
.action(jest_1.test);
commander_1.command('clean').description('Clean all dist files').action(clean_1.clean);
commander_1.command('build')
.description('Compile components in production mode')
.option('--watch', 'Watch file change')
.option('--dev', 'Watch file change with development mode')
.option('--registry [registry]', 'Install dependencies with custom registry')
.action(build_1.build);
commander_1.command('release')
.description('Compile components and release it')
.option('--tag <tag>', 'Release tag')
.action(release_1.release);
commander_1.command('build-site')
.description('Compile site in production mode')
.action(build_site_1.buildSite);
commander_1.command('changelog').description('Generate changelog').action(changelog_1.changelog);
commander_1.command('commit-lint').description('Lint commit message').action(commit_lint_1.commitLint);
commander_1.command('upload')
.requiredOption('--access-key <string>', 'Oss Access key')
.requiredOption('--access-secret <string>', 'Oss Access secret')
.option('--region <string>', 'Oss region', 'oss-cn-hangzhou')
.option('--bucket <string>', 'Oss bucket', 'app-resource-internal')
.option('--env <string>', 'Oss env', 'local')
.description('Upload dist to oss')
.action(upload_1.upload);
commander_1.parse();