Skip to content

Commit

Permalink
chore: 不再将 Command 实例导出,而仅导出逻辑部分
Browse files Browse the repository at this point in the history
  • Loading branch information
rxliuli committed Aug 29, 2021
1 parent 06165d3 commit ca27f54
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 12 deletions.
1 change: 1 addition & 0 deletions libs/monorepo-changelog/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@ lerna-debug.log*
!.vscode/launch.json
!.vscode/extensions.json
**/i18n/index.d.ts
docs
3 changes: 2 additions & 1 deletion libs/monorepo-changelog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
11 changes: 9 additions & 2 deletions libs/monorepo-changelog/src/bin.ts
Original file line number Diff line number Diff line change
@@ -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()
9 changes: 0 additions & 9 deletions libs/monorepo-changelog/src/index.ts
Original file line number Diff line number Diff line change
@@ -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()
})
1 change: 1 addition & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ca27f54

Please sign in to comment.