Skip to content

Commit

Permalink
chore: adjust changelog gen
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbbreuer committed Feb 22, 2024
1 parent fc1792b commit 84b1a90
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 3 deletions.
Binary file modified bun.lockb
Binary file not shown.
21 changes: 21 additions & 0 deletions changelog.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { execSync, log, parseOptions, runCommand } from '@stacksjs/cli'
import { projectPath } from '@stacksjs/path'

// when log.debug is used, only log to file in production
log.debug('Generating changelog')
const fromRevision = await execSync('git describe --abbrev=0 --tags HEAD^')
log.debug('FromRevision', fromRevision)
const toRevision = await execSync('git describe')
log.debug('ToRevision', toRevision)
const options = parseOptions()
log.debug('Changelog Options', options)

const command = options?.dryRun
? `bunx changelogen --no-output --from ${fromRevision} --to ${toRevision}`
: `bunx changelogen --output CHANGELOG.md --from ${fromRevision} --to ${toRevision}`

await runCommand(command, {
cwd: projectPath(),
quiet: options?.quiet,
verbose: options?.verbose,
})
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "bun-plugin-env",
"type": "module",
"version": "0.1.2",
"version": "0.1.1",
"description": "",
"author": "Chris Breuer <[email protected]>",
"license": "MIT",
Expand Down Expand Up @@ -43,12 +43,14 @@
"commit": "git cz",
"changelog": "bunx changelogen",
"prepublishOnly": "bun --bun run build",
"release": "bunx changelogen --release",
"release": "bunx bumpp package.json --all && bun run changelog",
"test": "bun test",
"typecheck": "tsc --noEmit"
},
"devDependencies": {
"@stacksjs/cli": "^0.58.73",
"@stacksjs/eslint-config": "^0.58.73",
"@stacksjs/path": "^0.58.73",
"@types/bun": "^1.0.6",
"@types/node": "^20.11.19",
"changelogen": "^0.5.5",
Expand All @@ -71,4 +73,4 @@
"path": "node_modules/cz-git"
}
}
}
}

0 comments on commit 84b1a90

Please sign in to comment.