Skip to content

Commit

Permalink
chore: create changelog config ts
Browse files Browse the repository at this point in the history
  • Loading branch information
productdevbook committed May 19, 2023
1 parent 49e11ac commit e8e4d19
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 21 deletions.
27 changes: 27 additions & 0 deletions changelog.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import type { ChangelogConfig } from 'changelogen'

function getDefaultConfig() {
return <Partial<ChangelogConfig>>{
types: {
version: { title: '🔖 Version', semver: 'patch' },
feat: { title: '🚀 Enhancements', semver: 'minor' },
perf: { title: '🔥 Performance', semver: 'patch' },
fix: { title: '🩹 Fixes', semver: 'patch' },
refactor: { title: '💅 Refactors', semver: 'patch' },
docs: { title: '📖 Documentation', semver: 'patch' },
build: { title: '📦 Build', semver: 'patch' },
types: { title: '🌊 Types', semver: 'patch' },
chore: { title: '🏡 Chore' },
examples: { title: '🏀 Examples' },
test: { title: '✅ Tests' },
style: { title: '🎨 Styles' },
ci: { title: '🤖 CI' },
},
repo: {
repo: 'oku-ui/primitives',
provider: 'github',
},
}
}

export default getDefaultConfig
22 changes: 1 addition & 21 deletions scripts/update-changelog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,7 @@ import { determineBumpType, getLatestCommits, loadWorkspace } from './_utils'

async function main() {
const workspace = await loadWorkspace(process.cwd())
const config = await loadChangelogConfig(process.cwd(), {
types: {
version: { title: '🔖 Version', semver: 'patch' },
feat: { title: '🚀 Enhancements', semver: 'minor' },
perf: { title: '🔥 Performance', semver: 'patch' },
fix: { title: '🩹 Fixes', semver: 'patch' },
refactor: { title: '💅 Refactors', semver: 'patch' },
docs: { title: '📖 Documentation', semver: 'patch' },
build: { title: '📦 Build', semver: 'patch' },
types: { title: '🌊 Types', semver: 'patch' },
chore: { title: '🏡 Chora' },
examples: { title: '🏀 Examples' },
test: { title: '✅ Tests' },
style: { title: '🎨 Styles' },
ci: { title: '🤖 CI' },
},
repo: {
provider: 'github',
repo: 'oku-ui/primitives',
},
})
const config = await loadChangelogConfig(process.cwd())

const commits = await getLatestCommits().then(commits => commits.filter(
c => config.types[c.type] && !(c.type === 'chore' && c.scope === 'deps' && !c.isBreaking),
Expand Down

0 comments on commit e8e4d19

Please sign in to comment.