changelog-guru
Version:
Git changelog generator
34 lines (33 loc) • 891 B
JavaScript
import dotenv from 'dotenv';
import TaskTree from 'tasktree-cli';
import Builder from './core/Builder.js';
import { Config } from './core/Config.js';
import { Linter } from './core/Linter.js';
export class Changelog {
constructor() {
dotenv.config();
}
async generate(options) {
try {
const config = new Config(options);
const builder = new Builder(config);
await builder.build();
}
catch (error) {
TaskTree.fail(error);
}
}
async lint(options) {
try {
const config = new Config();
const linter = new Linter(config, options?.maxLength);
if (options?.message) {
await linter.lint(options.message);
}
}
catch (error) {
TaskTree.fail(error);
}
}
}
export default Changelog;