@vue/conventional-changelog

0.1.1 • Public • Published

@vue/conventional-changelog

Custom preset for conventional-changelog which groups changes by package (packages/@vue/xxx). It works by getting the package which has the highest number of changed files in each commit.

yarn add -D @vue/conventional-changelog

Example usage:

const execa = require('execa')
const cc = require('conventional-changelog')
const config = require('@vue/conventional-changelog')

const gen = module.exports = version => {
  const fileStream = require('fs').createWriteStream(`CHANGELOG.md`)

  cc({
    config,
    releaseCount: 0,
    pkg: {
      transform (pkg) {
        pkg.version = `v${version}`
        return pkg
      }
    }
  }).pipe(fileStream).on('close', async () => {
    delete process.env.PREFIX
    await execa('git', ['add', '-A'], { stdio: 'inherit' })
    await execa('git', ['commit', '-m', `chore: ${version} changelog [ci skip]`], { stdio: 'inherit' })
  })
}

if (process.argv[2] === 'run') {
  const version = require('../lerna.json').version
  gen(version)
}

Result example

/@vue/conventional-changelog/

    Package Sidebar

    Install

    npm i @vue/conventional-changelog

    Weekly Downloads

    18

    Version

    0.1.1

    License

    MIT

    Unpacked Size

    12.2 kB

    Total Files

    11

    Last publish

    Collaborators

    • kiaking
    • yyx990803
    • soda
    • pikax
    • posva
    • antfu
    • akryum