What is conventional-changelog-config-spec?
The conventional-changelog-config-spec npm package provides a specification for configuring conventional changelog tools. It helps standardize the configuration options for generating changelogs based on conventional commit messages.
What are conventional-changelog-config-spec's main functionalities?
Define Configuration Schema
This feature allows you to define a JSON schema for the configuration of conventional changelog tools. The schema includes properties like 'types', which is an array of objects specifying the type of commit, the section it belongs to, and whether it should be hidden.
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Conventional Changelog Config",
"type": "object",
"properties": {
"types": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": { "type": "string" },
"section": { "type": "string" },
"hidden": { "type": "boolean" }
},
"required": ["type", "section"]
}
}
},
"required": ["types"]
}
Validate Configuration
This feature allows you to validate a configuration object against the defined schema using a JSON schema validator like Ajv. It ensures that the configuration adheres to the specified structure and required fields.
const Ajv = require('ajv');
const ajv = new Ajv();
const schema = require('conventional-changelog-config-spec');
const validate = ajv.compile(schema);
const config = {
types: [
{ type: 'feat', section: 'Features' },
{ type: 'fix', section: 'Bug Fixes' }
]
};
const valid = validate(config);
if (!valid) console.log(validate.errors);
Other packages similar to conventional-changelog-config-spec
conventional-changelog
The conventional-changelog package generates a changelog from git metadata following the Conventional Commits specification. It is more focused on the actual generation of changelogs rather than defining a configuration schema.
standard-version
The standard-version package automates versioning and changelog generation based on conventional commit messages. It provides a higher-level abstraction that includes version bumping, changelog generation, and git tagging.
commitizen
Commitizen helps you write commit messages that follow the Conventional Commits specification. It provides a command-line interface for crafting commit messages, ensuring they adhere to the defined standards.