From 118b05add1e5a12d8beed2db9e1eeb06be348770 Mon Sep 17 00:00:00 2001 From: pengzhanbo Date: Wed, 4 May 2022 14:26:47 +0800 Subject: [PATCH] ci: update scripts/create MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 添加说明文档 --- scripts/README.md | 24 ++++++++++++++++++++++++ scripts/create/getHelp.ts | 15 +++++++-------- 2 files changed, 31 insertions(+), 8 deletions(-) create mode 100644 scripts/README.md diff --git a/scripts/README.md b/scripts/README.md new file mode 100644 index 00000000..28d22d0d --- /dev/null +++ b/scripts/README.md @@ -0,0 +1,24 @@ +## scripts/autoInstall + +检查各个 workspace package 中的 vuepress 相关依赖,并更新到最新版本。 + +``` sh +pnpm autoUpdate +``` + +## scripts/create + +在 `packages/` 目录下生成一个新的 插件包 + +``` sh +pnpm pkg [--option] +``` + +- `package-name` 插件名称 + +### Option + +- `--client,-c` 是否生成 `client` 目录及其文件,默认不生成 +- `--shared,-s` 是否生成 `shared` 目录及其文件,默认不生成 + +- `--help,-h` 显示帮助信息 diff --git a/scripts/create/getHelp.ts b/scripts/create/getHelp.ts index 9b644559..73f31c22 100644 --- a/scripts/create/getHelp.ts +++ b/scripts/create/getHelp.ts @@ -1,19 +1,18 @@ import chalk from 'chalk' export const getHelp = (): void => { - console.log(` - this command will generator a package to ${chalk.cyan('packages')}. + console.log(` this command will generator a package to ${chalk.cyan('packages')}. + command: ${chalk.green('pnpm pkg [--options]')} - command: ${chalk.green('pnpm pkg [-p]')} + ${chalk.green('package-name')}: 包名 options: - ${chalk.green('package-name')}: 包名 - ${chalk.green('--client, -c')}: 是否生成 ${chalk.cyan('client/')} 目录 - ${chalk.green('--shared, -s')}: 是否生成 ${chalk.cyan('shared/')} 目录 + ${chalk.green('--client, -c')}: 是否生成 ${chalk.cyan('client/')} 目录 + ${chalk.green('--shared, -s')}: 是否生成 ${chalk.cyan('shared/')} 目录 - ${chalk.green('--help, -h')}: show help message. + ${chalk.green('--help, -h')}: show help message. - exp: ${chalk.green('pnpm pkg caniuse -p')} + exp: ${chalk.green('pnpm pkg caniuse -c -s')} It will generator to ${chalk.cyan('packages/plugin-caniuse')} `) }