From ca27f54052240ac3a68ff3dbbe171107b8c4dc37 Mon Sep 17 00:00:00 2001 From: rxliuli Date: Sun, 29 Aug 2021 11:57:19 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E4=B8=8D=E5=86=8D=E5=B0=86=20Command?= =?UTF-8?q?=20=E5=AE=9E=E4=BE=8B=E5=AF=BC=E5=87=BA=EF=BC=8C=E8=80=8C?= =?UTF-8?q?=E4=BB=85=E5=AF=BC=E5=87=BA=E9=80=BB=E8=BE=91=E9=83=A8=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libs/monorepo-changelog/.gitignore | 1 + libs/monorepo-changelog/package.json | 3 ++- libs/monorepo-changelog/src/bin.ts | 11 +++++++++-- libs/monorepo-changelog/src/index.ts | 9 --------- yarn.lock | 1 + 5 files changed, 13 insertions(+), 12 deletions(-) diff --git a/libs/monorepo-changelog/.gitignore b/libs/monorepo-changelog/.gitignore index 0ebac2d4..e3928ff6 100644 --- a/libs/monorepo-changelog/.gitignore +++ b/libs/monorepo-changelog/.gitignore @@ -31,3 +31,4 @@ lerna-debug.log* !.vscode/launch.json !.vscode/extensions.json **/i18n/index.d.ts +docs diff --git a/libs/monorepo-changelog/package.json b/libs/monorepo-changelog/package.json index 2f3e8bd4..c7caaacf 100644 --- a/libs/monorepo-changelog/package.json +++ b/libs/monorepo-changelog/package.json @@ -13,7 +13,7 @@ "docs:server": "live-server docs", "docs:dev": "typedoc --watch", "docs:build": "rimraf docs && typedoc", - "docs:deploy": "yarn build && gh-pages -d docs/ -e / -a" + "docs:deploy": "yarn docs:build && gh-pages -d docs/ -e /monorepo-changelog -a" }, "publishConfig": { "access": "public", @@ -42,6 +42,7 @@ "@types/jest": "^26.0.23", "@types/lodash": "^4.14.168", "@types/node": "^12.20.6", + "gh-pages": "^3.2.3", "jest": "^26.6.3", "rimraf": "^3.0.2", "ts-jest": "^26.5.6", diff --git a/libs/monorepo-changelog/src/bin.ts b/libs/monorepo-changelog/src/bin.ts index 8ee453e9..2bab757a 100644 --- a/libs/monorepo-changelog/src/bin.ts +++ b/libs/monorepo-changelog/src/bin.ts @@ -1,3 +1,10 @@ -import { changelogCommand } from './' +import { Command } from 'commander' +import path from 'path' +import { ChangelogProgram } from './cli/ChangelogProgram' -changelogCommand.parse() +new Command('changelog') + .action(async () => { + const changelogProgram = new ChangelogProgram(path.resolve()) + await changelogProgram.generate() + }) + .parse() diff --git a/libs/monorepo-changelog/src/index.ts b/libs/monorepo-changelog/src/index.ts index 5802325a..c8bf1a90 100644 --- a/libs/monorepo-changelog/src/index.ts +++ b/libs/monorepo-changelog/src/index.ts @@ -1,12 +1,3 @@ -import { Command } from 'commander' -import { ChangelogProgram } from './cli/ChangelogProgram' -import path from 'path' - export * from './service/Generator' export * from './service/Scanner' export * from './cli/ChangelogProgram' - -export const changelogCommand = new Command('changelog').action(async () => { - const changelogProgram = new ChangelogProgram(path.resolve()) - await changelogProgram.generate() -}) diff --git a/yarn.lock b/yarn.lock index acdc70da..921ef200 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1284,6 +1284,7 @@ __metadata: "@types/node": ^12.20.6 commander: ^7.0.0 fs-extra: ^10.0.0 + gh-pages: ^3.2.3 jest: ^26.6.3 lodash: ^4.17.21 rimraf: ^3.0.2