diff --git a/packages/changelog/package.json b/packages/changelog/package.json index 9cd8cf6..8cf7d2b 100644 --- a/packages/changelog/package.json +++ b/packages/changelog/package.json @@ -53,7 +53,6 @@ "@esm2cjs/execa": "6.1.1-cjs.1", "c12": "^1.11.1", "changelogen": "0.5.5", - "commander": "^12.1.0", "convert-gitmoji": "^0.1.5", "ofetch": "^1.3.4", "semver": "^7.6.2" diff --git a/packages/changelog/src/core/changelog.ts b/packages/changelog/src/core/changelog.ts index 6d072e9..478ca73 100644 --- a/packages/changelog/src/core/changelog.ts +++ b/packages/changelog/src/core/changelog.ts @@ -1,8 +1,7 @@ /* eslint-disable no-console */ import process from 'node:process' -import { Command } from 'commander' import { getGitDiff, parseGitCommit } from 'changelogen' -import { vipColor } from '@142vip/utils' +import { VipCommander, vipColor } from '@142vip/utils' import { name as packageName, version as packageVersion } from '../../package.json' import { generateMarkdown, @@ -18,10 +17,7 @@ import { sendRelease, updateChangelog, } from '../utils' -import type { - ChangelogOptions, - ResolvedChangelogOptions, -} from '../types' +import type { ChangelogOptions, ResolvedChangelogOptions } from '../types' import { ChangelogDefaultConfig } from './config' /** @@ -170,10 +166,7 @@ async function dealChangelog(args: ChangelogOptions) { * cli 入口 */ export function changelogMain() { - const program = new Command(packageName) - - // 查看版本 - program.version(packageVersion, '-v --version', 'Package Version') + const program = new VipCommander(packageName, packageVersion) // cli参数 program diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f26a880..1b3f01a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -108,9 +108,6 @@ importers: changelogen: specifier: 0.5.5 version: 0.5.5 - commander: - specifier: ^12.1.0 - version: 12.1.0 convert-gitmoji: specifier: ^0.1.5 version: 0.1.5