API to work with chast
Since v3.0 this module is ESM only.
npm install @geut/chan-core
import toVFile from 'to-vfile'
import { initialize, addChanges, addRelease, getMarkdownRelease } from '@geut/chan-core'
const file = toVFile.readSync('CHANGELOG.md')
await initialize(file)
await addChanges(file, {
changes: [
{ action: 'Security', value: 'alguna cosa' },
{
action: 'Changed',
value: 'vaaamos',
group: 'package2'
},
{
version: '0.0.1',
action: 'Fixed',
value: 'fixed algo viejo',
group: 'package1'
}
]
})
await addRelease(file, {
version: '0.0.2',
gitTemplate: 'https://github.com/geut/chan/compare/[prev]...[next]',
gitBranch: 'HEAD',
mergePrerelease: true,
releasePrefix: 'v'
})
await getMarkdownRelease(file, { version: '0.0.1' })
true to overwrite if file already exists. Default to false
chast representation for a set of changes.
addRelease (from, { version, date, yanked, gitTemplate, gitBranch, allowYanked, allowPrerelease, mergePrerelease, releasePrefix })
The version to extract from file.