Skip to content

Commit

Permalink
Improve: Make techor the main command entry
Browse files Browse the repository at this point in the history
  • Loading branch information
1aron committed Jul 4, 2023
1 parent 7d8b945 commit 53dc383
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 57 deletions.
6 changes: 4 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 0 additions & 44 deletions packages/conventional-changelog-config/.dev/CHANGELOG.md

This file was deleted.

3 changes: 0 additions & 3 deletions packages/conventional-changelog-config/.dev/CHANGELOG.more.md

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import initFakeGit from '../../../utils/init-fake-git'
const config = require('../')
const conventionalChangelogCore = require('conventional-changelog-core')

if (!fs.existsSync(path.join(__dirname, '../.dev'))) {
fs.mkdirSync(path.join(__dirname, '../.dev'))
if (!fs.existsSync(path.join(__dirname, '../changelog-dist'))) {
fs.mkdirSync(path.join(__dirname, '../changelog-dist'))
}

describe('techor preset', () => {
Expand Down Expand Up @@ -97,7 +97,7 @@ export function testAronChangelog(commits, handle: (changelog: string) => void,
})
.on('data', changelogChunk => {
const changelog = changelogChunk.toString()
fs.writeFileSync(path.join(__dirname, '../.dev', changelogFileName), dedent(changelog))
fs.writeFileSync(path.join(__dirname, '../changelog-dist', changelogFileName), dedent(changelog))
handle(changelog)
})
.on('error', (error) => {
Expand Down
3 changes: 2 additions & 1 deletion packages/pack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"access": "public"
},
"dependencies": {
"techor": "",
"@techor/extend": "",
"@techor/fs": "",
"@techor/log": "",
Expand All @@ -62,4 +63,4 @@
"pkg-types": "^1.0.1",
"pretty-bytes": "^6.1.0"
}
}
}
2 changes: 2 additions & 0 deletions packages/repo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
"typescript": ""
},
"dependencies": {
"@techor/pack": "",
"@techor/version": "",
"@techor/jest": "",
"commitlint-config-techor": "",
"conventional-changelog-techor": "",
Expand Down
2 changes: 0 additions & 2 deletions packages/techor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@
},
"dependencies": {
"@techor/fs": "",
"@techor/pack": "",
"@techor/version": "",
"commander": "^10.0.0"
}
}
7 changes: 5 additions & 2 deletions packages/techor/src/bin/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@

import { program } from 'commander'
import { readFileAsJSON } from '@techor/fs'
import { execSync } from 'child_process'

const { version, name, description } = readFileAsJSON('./package.json')
const args = process.argv.slice(4)

program.command('pack', 'Alias for techor-pack')
program.command('version', 'Alias for techor-version')
program.command('pack', 'Alias for techor-pack').action(() => { execSync('techor-pack ' + args.join(' '), { stdio: 'inherit' }) })
program.command('version', 'Alias for techor-version').action(() => { execSync('techor-version ' + args.join(' '), { stdio: 'inherit' }) })
program.parse(process.argv)
program.name(name)
program.description(description)
Expand Down
1 change: 1 addition & 0 deletions packages/version/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"access": "public"
},
"dependencies": {
"techor": "",
"@techor/extend": "",
"@techor/fs": "",
"@techor/log": "",
Expand Down

0 comments on commit 53dc383

Please sign in to comment.