cookpete / auto-changelog

Command line tool for generating a changelog from git tags and commit history
MIT License
1.28k stars 157 forks source link

Feature request: allow to use JS configuration of auto-changelog #245

Open trycontrolmymind opened 2 years ago

trycontrolmymind commented 2 years ago

Allow to use JS configuration of auto-changelog.

We have several projects with same auto-changelog configuration, so we want to re-use them using like .auto-changelog.config.js.

const common = require("common-config-auto-changelog");

module.exports = {
...common,
};

Is it possible?

ljharb commented 2 years ago

I have hundreds of projects that would benefit from a way to share configs - but rather than allowing it to be logicful, I’d prefer adding an “extends” key that points to a requireable path (which could be json from a package).

webketje commented 1 year ago

FWIW it's already possible to do this by creating a small wrapper script:

/** @file ./merge-configs.js */

const { writeFileSync } = require('fs')
const common = require('common-config-auto-changelog')
const overrides = require('.auto-changelog.json')

writeFileSync('.auto-changelog', JSON.stringify(Object.assign({}, common, overrides), null, 2))
node ./merge-configs.js && auto-changelog
# .gitignore
.auto-changelog