From c29372b1142655fdcdbf87484d230740e250aed9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=98=89=E6=B6=B5?= Date: Mon, 13 Jan 2020 15:07:37 +0800 Subject: [PATCH] feat(cli): add command description --- packages/vant-cli/src/index.ts | 46 +++++++++++++++++++++++++--------- 1 file changed, 34 insertions(+), 12 deletions(-) diff --git a/packages/vant-cli/src/index.ts b/packages/vant-cli/src/index.ts index 294ed4f7c..cf3dd4f7c 100755 --- a/packages/vant-cli/src/index.ts +++ b/packages/vant-cli/src/index.ts @@ -11,27 +11,49 @@ import { changelog } from './commands/changelog'; import { buildSite } from './commands/build-site'; import { commitLint } from './commands/commit-lint'; -command('dev').action(dev); +command('dev') + .description('Run webpack dev server') + .action(dev); -command('lint').action(lint); +command('lint') + .description('Run eslint and stylelint') + .action(lint); -command('clean').action(clean); +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' + ) + .action(test); + +command('clean') + .description('Clean all dist files') + .action(clean); command('build') + .description('Compile components in production mode') .option('--watch', 'Watch file change') .action(build); -command('release').action(release); +command('release') + .description('Compile components and release it') + .action(release); -command('changelog').action(changelog); +command('build-site') + .description('Compile site in production mode') + .action(buildSite); -command('build-site').action(buildSite); +command('changelog') + .description('Generate changelog') + .action(changelog); -command('commit-lint').action(commitLint); - -command('test') - .option('--watch') - .option('--clearCache') - .action(test); +command('commit-lint') + .description('Lint commit message') + .action(commitLint); parse(process.argv);