From a0d22eada3e71d13b09ebeb26a809a3f40b6c2be Mon Sep 17 00:00:00 2001 From: chufan Date: Sun, 19 Jan 2025 18:23:08 +0800 Subject: [PATCH] =?UTF-8?q?feat(@142vip/utils):=20`vipColor`=E3=80=81`vipS?= =?UTF-8?q?ymbols`=E9=87=8D=E5=91=BD=E5=90=8D=EF=BC=8C=E5=A4=A7=E9=A9=BC?= =?UTF-8?q?=E5=B3=B0=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 6 +++--- packages/changelog/src/core/changelog.ts | 20 +++++++++---------- packages/changelog/src/utils/github.ts | 12 +++++------ packages/fairy-cli/src/commands/release.ts | 8 ++++---- .../fairy-cli/src/shared/release-package.ts | 8 ++++---- packages/release-version/CHANGELOG.md | 2 +- .../release-version/src/core/version-bump.ts | 12 +++++------ .../release-version/src/utils/progress.ts | 14 ++++++------- packages/utils/CHANGELOG.md | 2 +- packages/utils/src/core/color.ts | 18 ++++++++--------- packages/utils/src/core/docker.ts | 14 ++++++------- packages/utils/src/core/logger.ts | 8 ++++---- packages/utils/src/core/shell.ts | 4 ++-- verify-commit.js | 18 ++++++++--------- 14 files changed, 73 insertions(+), 73 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cf69a38..d3cef5f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -438,14 +438,14 @@ All notable changes to this project will be documented in this file. See [commit - 使用`VipProjectTable`组件,优化首页显示效果,`首页-趋势`支持暗夜模式  -  by **chufan** [(4e1b0)](https://github.com/142vip/core-x/commit/4e1b0d6) - 使用`VipTeam`组件,优化首页展示  -  by **chufan** [(f2e9f)](https://github.com/142vip/core-x/commit/f2e9f7a) -- 移除全局`chalk`模块,使用`vipColor`变量处理日志格式  -  by **chufan** [(51156)](https://github.com/142vip/core-x/commit/5115623) +- 移除全局`chalk`模块,使用`VipColor`变量处理日志格式  -  by **chufan** [(51156)](https://github.com/142vip/core-x/commit/5115623) - **@142vip/fairy-cli**: - 移除`log-symbols`模块,优化`check`命令的日志输出  -  by **chufan** [(47635)](https://github.com/142vip/core-x/commit/4763593) - `release`发布命令增加`--filter`可选参数,支持多次调用,用于指定模块路径  -  by **chufan** [(d0cc1)](https://github.com/142vip/core-x/commit/d0cc1e7) - **@142vip/release-version**: - - 移除`log-symbols`模块,替换为`vipSymbols`变量  -  by **chufan** [(6347b)](https://github.com/142vip/core-x/commit/6347bc5) + - 移除`log-symbols`模块,替换为`VipSymbols`变量  -  by **chufan** [(6347b)](https://github.com/142vip/core-x/commit/6347bc5) - **@142vip/utils**: - - 移除`chalk`,使用`ansi-colors`模块,新增`vipColor`和`vipSymbols`常用终端日志输出变量  -  by **chufan** [(55ae6)](https://github.com/142vip/core-x/commit/55ae636) + - 移除`chalk`,使用`ansi-colors`模块,新增`VipColor`和`VipSymbols`常用终端日志输出变量  -  by **chufan** [(55ae6)](https://github.com/142vip/core-x/commit/55ae636) - **@142vip/vitepress**: - 封装`VipBackTop`组件,优化`VipProjectTable`组件显示样式  -  by **chufan** [(0392e)](https://github.com/142vip/core-x/commit/0392e18) - 拓展项目表格和团队介绍组件封装,优化使用  -  by **chufan** [(854ab)](https://github.com/142vip/core-x/commit/854ab43) diff --git a/packages/changelog/src/core/changelog.ts b/packages/changelog/src/core/changelog.ts index 501aed0..cf0830b 100644 --- a/packages/changelog/src/core/changelog.ts +++ b/packages/changelog/src/core/changelog.ts @@ -1,6 +1,6 @@ import process from 'node:process' import { getGitDiff, parseGitCommit } from 'changelogen' -import { VipCommander, VipJSON, vipColor } from '@142vip/utils' +import { VipColor, VipCommander, VipJSON } from '@142vip/utils' import { name as packageName, version as packageVersion } from '../../package.json' import { generateMarkdown, @@ -105,20 +105,20 @@ async function dealChangelog(args: ChangelogOptions): Promise { try { console.log() - console.log(vipColor.dim(`${vipColor.bold(packageName)} `) + vipColor.dim(`v${packageVersion}`)) + console.log(VipColor.dim(`${VipColor.bold(packageName)} `) + VipColor.dim(`v${packageVersion}`)) const { config, markdown, commits } = await generate(args) webUrl = generateWebUrl(config, markdown) - console.log(vipColor.cyan(config.from) + vipColor.dim(' -> ') + vipColor.blue(config.to) + vipColor.dim(` (${commits.length} commits)`)) - console.log(vipColor.dim('--------------')) + console.log(VipColor.cyan(config.from) + VipColor.dim(' -> ') + VipColor.blue(config.to) + VipColor.dim(` (${commits.length} commits)`)) + console.log(VipColor.dim('--------------')) console.log() console.log(markdown.replace(/ /g, '')) console.log() - console.log(vipColor.dim('--------------')) + console.log(VipColor.dim('--------------')) if (config.dry) { - console.log(vipColor.yellow('试运行。已跳过版本发布。')) + console.log(VipColor.yellow('试运行。已跳过版本发布。')) printUrl(webUrl) return } @@ -131,14 +131,14 @@ async function dealChangelog(args: ChangelogOptions): Promise { // 带token上传 if (!config.tokens) { - console.error(vipColor.red('未找到 GitHub 令牌,请通过 GITHUB_TOKEN 环境变量指定。已跳过版本发布。')) + console.error(VipColor.red('未找到 GitHub 令牌,请通过 GITHUB_TOKEN 环境变量指定。已跳过版本发布。')) printUrl(webUrl) process.exitCode = 1 return } if (!commits.length && await isRepoShallow()) { - console.error(vipColor.yellow('存储库似乎克隆得很浅,这使得更改日志无法生成。您可能希望在 CI 配置中指定 \'fetch-depth: 0\'。')) + console.error(VipColor.yellow('存储库似乎克隆得很浅,这使得更改日志无法生成。您可能希望在 CI 配置中指定 \'fetch-depth: 0\'。')) printUrl(webUrl) process.exitCode = 1 return @@ -148,9 +148,9 @@ async function dealChangelog(args: ChangelogOptions): Promise { await sendRelease(config, markdown) } catch (e: any) { - console.error(vipColor.red(String(e))) + console.error(VipColor.red(String(e))) if (e?.stack) - console.error(vipColor.dim(e.stack?.split('\n').slice(1).join('\n'))) + console.error(VipColor.dim(e.stack?.split('\n').slice(1).join('\n'))) // 手动执行,创建release if (webUrl) { diff --git a/packages/changelog/src/utils/github.ts b/packages/changelog/src/utils/github.ts index d1b1e14..676b837 100644 --- a/packages/changelog/src/utils/github.ts +++ b/packages/changelog/src/utils/github.ts @@ -1,5 +1,5 @@ import { $fetch } from 'ofetch' -import { vipColor, vipQs } from '@142vip/utils' +import { VipColor, vipQs } from '@142vip/utils' import type { AuthorInfo, ChangelogOptions, @@ -32,7 +32,7 @@ export async function sendRelease(options: ChangelogOptions, content: string): P prerelease: options.prerelease, tag_name: options.to, } - console.log(vipColor.cyan(method === 'POST' + console.log(VipColor.cyan(method === 'POST' ? 'Creating release notes...' : 'Updating release notes...'), ) @@ -41,7 +41,7 @@ export async function sendRelease(options: ChangelogOptions, content: string): P body: JSON.stringify(body), headers, }) - console.log(vipColor.green(`Released on ${res.html_url}`)) + console.log(VipColor.green(`Released on ${res.html_url}`)) } function getHeaders(options: ChangelogOptions) { @@ -162,8 +162,8 @@ export function generateWebUrl(config: any, markdown: string): string { */ export function printUrl(webUrl: string, success: boolean = true): void { const errMsg = success - ? `\n${vipColor.yellow('使用以下链接手动发布新的版本:')}\n` - : `\n${vipColor.red('无法创建发布。使用以下链接手动创建:')}\n` + ? `\n${VipColor.yellow('使用以下链接手动发布新的版本:')}\n` + : `\n${VipColor.red('无法创建发布。使用以下链接手动创建:')}\n` - console.error(`${errMsg}${vipColor.yellow(webUrl)}\n`) + console.error(`${errMsg}${VipColor.yellow(webUrl)}\n`) } diff --git a/packages/fairy-cli/src/commands/release.ts b/packages/fairy-cli/src/commands/release.ts index 730796e..ab69936 100644 --- a/packages/fairy-cli/src/commands/release.ts +++ b/packages/fairy-cli/src/commands/release.ts @@ -2,7 +2,7 @@ import process from 'node:process' import type { VersionBumpOptions } from '@142vip/release-version' import { versionBump } from '@142vip/release-version' import type { VipCommander } from '@142vip/utils' -import { promptConfirm, promptList, vipColor } from '@142vip/utils' +import { VipColor, promptConfirm, promptList } from '@142vip/utils' import { CliCommandEnum, getBranchName, @@ -87,13 +87,13 @@ function execVipRelease(args: VipReleaseExtraOptions) { defaultRepoName, ...packageNames, ] - promptList(choices, `选择需要使用${vipColor.red('Release')}命令发布的模块名称:`) + promptList(choices, `选择需要使用${VipColor.red('Release')}命令发布的模块名称:`) .then(async (packageName) => { // 确认框 - const isRelease = await promptConfirm(`将对模块${vipColor.green(packageName)}进行版本迭代,是否继续操作?`) + const isRelease = await promptConfirm(`将对模块${VipColor.green(packageName)}进行版本迭代,是否继续操作?`) if (!isRelease) { - console.log(vipColor.yellow('用户取消发布操作!!')) + console.log(VipColor.yellow('用户取消发布操作!!')) process.exit(0) } diff --git a/packages/fairy-cli/src/shared/release-package.ts b/packages/fairy-cli/src/shared/release-package.ts index 90e8899..baafbb8 100644 --- a/packages/fairy-cli/src/shared/release-package.ts +++ b/packages/fairy-cli/src/shared/release-package.ts @@ -1,7 +1,7 @@ import { execSync } from 'node:child_process' import process from 'node:process' import { versionBump } from '@142vip/release-version' -import { vipColor, vipSymbols } from '@142vip/utils' +import { VipColor, VipSymbols } from '@142vip/utils' import { getCommitLogs, getLatestTagName } from './git' interface PackageJSON { @@ -68,10 +68,10 @@ export function printPreCheckRelease(packageNames: string[]) { console.log('\n对仓库各模块进行版本变更校验,结果如下:\n') for (const pkg of packages) { if (pkg.release) { - console.log(vipColor.red(`${vipSymbols.error} ${pkg.name}`)) + console.log(VipColor.red(`${VipSymbols.error} ${pkg.name}`)) } else { - console.log(vipColor.green(`${vipSymbols.success} ${pkg.name}`)) + console.log(VipColor.green(`${VipSymbols.success} ${pkg.name}`)) } } @@ -79,7 +79,7 @@ export function printPreCheckRelease(packageNames: string[]) { console.log() if (!isRootRelease) { - console.log(`${vipColor.yellow(`${vipSymbols.warning} 存在未发布的模块,请先进行模块的版本变更,再更新仓库版本!!!`)}`) + console.log(`${VipColor.yellow(`${VipSymbols.warning} 存在未发布的模块,请先进行模块的版本变更,再更新仓库版本!!!`)}`) } } diff --git a/packages/release-version/CHANGELOG.md b/packages/release-version/CHANGELOG.md index f2b2342..74e5743 100644 --- a/packages/release-version/CHANGELOG.md +++ b/packages/release-version/CHANGELOG.md @@ -6,7 +6,7 @@ All notable changes to this project will be documented in this file. See [commit ### ✨ Features -- 移除`log-symbols`模块,替换为`vipSymbols`变量  -  by **chufan** [(6347b)](https://github.com/142vip/core-x/commit/6347bc5) +- 移除`log-symbols`模块,替换为`VipSymbols`变量  -  by **chufan** [(6347b)](https://github.com/142vip/core-x/commit/6347bc5) **Release New Version v0.0.1-alpha.9 [👉 View New Package On NPM](https://www.npmjs.com/package/@142vip/release-version)** diff --git a/packages/release-version/src/core/version-bump.ts b/packages/release-version/src/core/version-bump.ts index 78279c5..bbee23c 100644 --- a/packages/release-version/src/core/version-bump.ts +++ b/packages/release-version/src/core/version-bump.ts @@ -2,7 +2,7 @@ import process from 'node:process' import path from 'node:path' import prompts from 'prompts' import { bold, cyan, green } from 'kolorist' -import { execShell, vipSymbols } from '@142vip/utils' +import { VipSymbols, execShell } from '@142vip/utils' import type { VersionBumpOptions, VersionBumpResults } from '../types' import { NpmScript } from '../types' import { getNewVersion } from './get-new-version' @@ -46,7 +46,7 @@ export async function versionBump(arg: (VersionBumpOptions) | string = {}): Prom await updateFiles(operation) if (operation.options.changelog) { - console.log(vipSymbols.info, 'Generate CHANGELOG.md By @142vip/changelog', operation.options.execute) + console.log(VipSymbols.info, 'Generate CHANGELOG.md By @142vip/changelog', operation.options.execute) try { const filePath = path.join(operation.options.cwd, 'CHANGELOG.md') const baseCommand = `changelog --output "${filePath}" --name v${operation.state.newVersion}` @@ -56,18 +56,18 @@ export async function versionBump(arg: (VersionBumpOptions) | string = {}): Prom : { command: baseCommand, description: '普通模式,生成CHANGELOG文档' }) } catch (e) { - console.log(vipSymbols.error, 'Happen Error In Generate CHANGELOG!!!') + console.log(VipSymbols.error, 'Happen Error In Generate CHANGELOG!!!') console.log(e) process.exit(1) } - console.log(vipSymbols.success, 'Generate CHANGELOG.md Finished') + console.log(VipSymbols.success, 'Generate CHANGELOG.md Finished') } // 执行命令 if (operation.options.execute) { - console.log(vipSymbols.info, 'Executing Script', operation.options.execute) + console.log(VipSymbols.info, 'Executing Script', operation.options.execute) await execShell({ command: operation.options.execute, description: '执行execute提供的命令' }) - console.log(vipSymbols.success, 'Script Finished') + console.log(VipSymbols.success, 'Script Finished') } // 运行version钩子函数 diff --git a/packages/release-version/src/utils/progress.ts b/packages/release-version/src/utils/progress.ts index 969be05..7d1b566 100644 --- a/packages/release-version/src/utils/progress.ts +++ b/packages/release-version/src/utils/progress.ts @@ -1,4 +1,4 @@ -import { vipSymbols } from '@142vip/utils' +import { VipSymbols } from '@142vip/utils' import type { VersionBumpProgress } from '../types' import { ProgressEvent } from '../types' @@ -9,27 +9,27 @@ import { ProgressEvent } from '../types' export function showProgress(progress: VersionBumpProgress) { switch (progress.event) { case ProgressEvent.FileUpdated: - console.log(vipSymbols.success, `Updated ${progress.updatedFiles.pop()} to ${progress.newVersion}`) + console.log(VipSymbols.success, `Updated ${progress.updatedFiles.pop()} to ${progress.newVersion}`) break case ProgressEvent.FileSkipped: - console.log(vipSymbols.info, `${progress.skippedFiles.pop()} did not need to be updated`) + console.log(VipSymbols.info, `${progress.skippedFiles.pop()} did not need to be updated`) break case ProgressEvent.GitCommit: - console.log(vipSymbols.success, 'Git commit') + console.log(VipSymbols.success, 'Git commit') break case ProgressEvent.GitTag: - console.log(vipSymbols.success, 'Git tag') + console.log(VipSymbols.success, 'Git tag') break case ProgressEvent.GitPush: - console.log(vipSymbols.success, 'Git push') + console.log(VipSymbols.success, 'Git push') break case ProgressEvent.NpmScript: - console.log(vipSymbols.success, `Npm run ${progress.script}`) + console.log(VipSymbols.success, `Npm run ${progress.script}`) break } } diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md index c1cd6f4..2e28886 100644 --- a/packages/utils/CHANGELOG.md +++ b/packages/utils/CHANGELOG.md @@ -111,7 +111,7 @@ All notable changes to this project will be documented in this file. See [commit ### ✨ Features -- 移除`chalk`,使用`ansi-colors`模块,新增`vipColor`和`vipSymbols`常用终端日志输出变量  -  by **chufan** [(55ae6)](https://github.com/142vip/core-x/commit/55ae636) +- 移除`chalk`,使用`ansi-colors`模块,新增`VipColor`和`VipSymbols`常用终端日志输出变量  -  by **chufan** [(55ae6)](https://github.com/142vip/core-x/commit/55ae636) **Release New Version v0.0.1-alpha.2 [👉 View New Package On NPM](https://www.npmjs.com/package/@142vip/utils)** diff --git a/packages/utils/src/core/color.ts b/packages/utils/src/core/color.ts index b2eca76..70f124c 100644 --- a/packages/utils/src/core/color.ts +++ b/packages/utils/src/core/color.ts @@ -7,17 +7,17 @@ import { create } from 'ansi-colors' /** * 终端修改颜色 */ -export const vipColor = create() +export const VipColor = create() /** * 终端标记 */ -export const vipSymbols = { - success: vipColor.symbols.check, - error: vipColor.symbols.cross, - warning: vipColor.symbols.warning, - info: vipColor.symbols.info, - question: vipColor.symbols.question, - heart: vipColor.symbols.heart, - mark: vipColor.symbols.mark, +export const VipSymbols = { + success: VipColor.symbols.check, + error: VipColor.symbols.cross, + warning: VipColor.symbols.warning, + info: VipColor.symbols.info, + question: VipColor.symbols.question, + heart: VipColor.symbols.heart, + mark: VipColor.symbols.mark, } diff --git a/packages/utils/src/core/docker.ts b/packages/utils/src/core/docker.ts index 2d43854..d4fb4d9 100644 --- a/packages/utils/src/core/docker.ts +++ b/packages/utils/src/core/docker.ts @@ -1,7 +1,7 @@ import * as process from 'node:process' import { commandStandardExecutor, execCommand } from './exec' import { VipLogger } from './logger' -import { vipSymbols } from './color' +import { VipSymbols } from './color' const vipLog = new VipLogger() @@ -73,11 +73,11 @@ export async function isInstallDocker(args?: DockerOptions) { if (args?.logger) { const vipLog = new VipLogger() if (code === 0) { - vipLog.log(`检测到docker,版本信息:\n`, { startLabel: vipSymbols.success }) + vipLog.log(`检测到docker,版本信息:\n`, { startLabel: VipSymbols.success }) vipLog.log(stdout) } else { - vipLog.log(`未检测到docker,请先安装!!\n`, { startLabel: vipSymbols.error }) + vipLog.log(`未检测到docker,请先安装!!\n`, { startLabel: VipSymbols.error }) vipLog.error(stderr) } } @@ -94,11 +94,11 @@ export async function isInstallDockerCompose(args?: DockerOptions) { // 打印日志 if (args?.logger) { if (code === 0) { - vipLog.log(`检测到docker-compose,版本信息:\n`, { startLabel: vipSymbols.success }) + vipLog.log(`检测到docker-compose,版本信息:\n`, { startLabel: VipSymbols.success }) vipLog.log(stdout) } else { - vipLog.log(`未检测到docker-compose,请先安装!!\n`, { startLabel: vipSymbols.error }) + vipLog.log(`未检测到docker-compose,请先安装!!\n`, { startLabel: VipSymbols.error }) vipLog.error(stderr) } } @@ -139,8 +139,8 @@ export async function buildImage(args: BuildImageDockerOptions) { const command = `docker build ${buildArg} ${targetParams} ${memoryParams} -t '${args.imageName}' .` if (args.logger) { - vipLog.log(`执行的命令:\n`, { startLabel: vipSymbols.success }) - vipLog.log(`${command}\n`, { startLabel: vipSymbols.success }) + vipLog.log(`执行的命令:\n`, { startLabel: VipSymbols.success }) + vipLog.log(`${command}\n`, { startLabel: VipSymbols.success }) } vipLog.log(args.imageName, { startLabel: '构建镜像' }) diff --git a/packages/utils/src/core/logger.ts b/packages/utils/src/core/logger.ts index 57d8b8b..11ca5f0 100644 --- a/packages/utils/src/core/logger.ts +++ b/packages/utils/src/core/logger.ts @@ -1,4 +1,4 @@ -import { vipColor } from './color' +import { VipColor } from './color' export interface LoggerOptions { startLabel?: string @@ -32,17 +32,17 @@ export class VipLogger { } public info(msg: string, opts?: LoggerOptions) { - const infoText = `${vipColor.green(opts?.startLabel ?? '')} ${vipColor.magenta(msg)} ${vipColor.yellow(opts?.endLabel ?? '')}` + const infoText = `${VipColor.green(opts?.startLabel ?? '')} ${VipColor.magenta(msg)} ${VipColor.yellow(opts?.endLabel ?? '')}` console.info(infoText) } public log(msg: string, opts?: LoggerOptions) { - const logText = `${vipColor.blue(opts?.startLabel ?? '')} ${vipColor.magenta(msg)} ${vipColor.yellow(opts?.endLabel ?? '')}` + const logText = `${VipColor.blue(opts?.startLabel ?? '')} ${VipColor.magenta(msg)} ${VipColor.yellow(opts?.endLabel ?? '')}` console.log(logText) } public error(msg: string, opts?: LoggerOptions) { - const text = `${vipColor.red(opts?.startLabel ?? '')} ${vipColor.magenta(msg)} ${vipColor.yellow(opts?.endLabel ?? '')}` + const text = `${VipColor.red(opts?.startLabel ?? '')} ${VipColor.magenta(msg)} ${VipColor.yellow(opts?.endLabel ?? '')}` console.error(text) } } diff --git a/packages/utils/src/core/shell.ts b/packages/utils/src/core/shell.ts index 96a926b..292051c 100644 --- a/packages/utils/src/core/shell.ts +++ b/packages/utils/src/core/shell.ts @@ -1,7 +1,7 @@ import { name, version } from '../../package.json' import { execCommand } from './exec' import { VipLogger } from './logger' -import { vipColor } from './color' +import { VipColor } from './color' export interface ShellCommand { command: string @@ -10,7 +10,7 @@ export interface ShellCommand { // 全局日志 const vipLog = VipLogger.getInstance() -const projectName = vipColor.greenBright(`[${name}@${version}]`) +const projectName = VipColor.greenBright(`[${name}@${version}]`) /** * 脚本执行器,执行shell命令 diff --git a/verify-commit.js b/verify-commit.js index 0509f36..233e602 100755 --- a/verify-commit.js +++ b/verify-commit.js @@ -1,5 +1,5 @@ import process from 'node:process' -import { vipColor } from '@142vip/utils' +import { VipColor } from '@142vip/utils' import { getReleasePkgJSON, verifyCommit, @@ -11,17 +11,17 @@ const { isSuccess, message, type, scope } = verifyRes if (!isSuccess) { console.error( - `\n${vipColor.white(vipColor.bgRed(' Git Commit Message ERROR '))} ${vipColor.red( + `\n${VipColor.white(VipColor.bgRed(' Git Commit Message ERROR '))} ${VipColor.red( `invalid commit message format.`, )}\n\n${ - vipColor.red( + VipColor.red( ` Proper commit message format is required for automated changelog generation. Examples:\n\n`, ) - } ${vipColor.green(`feat(Github Actions): add CI/CD option`)}\n` - + ` ${vipColor.green( + } ${VipColor.green(`feat(Github Actions): add CI/CD option`)}\n` + + ` ${VipColor.green( `docs: update wbe site (close #28)`, )}\n\n${ - vipColor.red(` See .github/commit-convention.md for more details.\n`)}`, + VipColor.red(` See .github/commit-convention.md for more details.\n`)}`, ) process.exit(1) } @@ -43,7 +43,7 @@ const typeList = [ // 校验类型 if (type == null || !typeList.includes(type)) { console.error( - `${vipColor.white(vipColor.bgRed('Git Commit Message ERROR '))} ${vipColor.red( + `${VipColor.white(VipColor.bgRed('Git Commit Message ERROR '))} ${VipColor.red( `invalid commit type , support ${typeList.join('|')}`, )}`, ) @@ -62,7 +62,7 @@ const scopeList = [ // scope范围不支持 if (scope != null && !scopeList.includes(scope)) { console.error( - `${vipColor.white(vipColor.bgRed('Git Commit Message ERROR '))} ${vipColor.red( + `${VipColor.white(VipColor.bgRed('Git Commit Message ERROR '))} ${VipColor.red( `invalid commit scope name , Examples:\n${scopeList.join('\n')}`, )}`, ) @@ -72,7 +72,7 @@ if (scope != null && !scopeList.includes(scope)) { // 判断message长度 if (message == null || message.length > 80) { console.error( - ` ${vipColor.white(vipColor.bgRed('Git Commit Message ERROR '))} ${vipColor.red( + ` ${VipColor.white(VipColor.bgRed('Git Commit Message ERROR '))} ${VipColor.red( `invalid commit message length , max length is 80`, )}`, )