Changie
Changie configuration file
| Type | object |
|---|---|
| File match |
.changie.yaml
.changie.yml
|
| Schema URL | https://catalog.lintel.tools/schemas/schemastore/changie/latest.json |
| Source | https://changie.dev/schema.json |
Validate with Lintel
npx @lintel/lintel check
Config handles configuration for a project.
Properties
Directory for change files, header file and unreleased files. Relative to project root. example: yaml changesDir: .changes
Directory for all unreleased change files. Relative to changesDir. example: yaml unreleasedDir: unreleased
Header content included at the top of the merged changelog. A default header file is created when initializing that follows "Keep a Changelog".
Filepath for your changelog header file. Relative to changesDir. example: yaml headerPath: header.tpl.md
Filepath for the generated changelog file. Relative to project root. ChangelogPath is not required if you are using projects. example: yaml changelogPath: CHANGELOG.md
File extension for generated version files. This should probably match your changelog path file. Must not include the period. example: yaml
for markdown changelogs
versionExt: md
Template used to generate change lines in version files and changelog. Custom values are created through custom choices and can be accessible through the Custom argument. example: yaml changeFormat: '* #{{.Custom.Issue}} {{.Body}}'
Filepath for your version header file relative to unreleasedDir. It is also possible to use the '--header-path' parameter when using the batch command.
Customize the file name generated for new versions or release note files.
The file is placed in the changesDir, so the full path is:
{{.ChangesDir}}/{{.VersionFileFormat}}
Customize the file name generated for new fragments. The default uses the component and kind only if configured for your project. The file is placed in the unreleased directory, so the full path is:
{{.ChangesDir}}/{{.UnreleasedDir}}/{{.FragmentFileFormat}}.yaml
example: yaml
fragmentFileFormat: "{{.Kind}}-{{.Custom.Issue}}"
Template used to generate version headers.
Template used to generate component headers. If format is empty no header will be included. If components are disabled, the format is unused.
Template used to generate kind headers. If format is empty no header will be included. If kinds are disabled, the format is unused.
Template used to generate a version header.
Body config allows you to customize the default body prompt
3 nested properties
Min length specifies the minimum body length
Max length specifies the maximum body length
Block allows multiline text inputs for body messages
Components are an additional layer of organization suited for projects that want to split change fragments by an area or tag of the project. An example could be splitting your changelogs by packages for a monorepo. If no components are listed then the component prompt will be skipped and no component header included. By default no components are configured. example: yaml components:
- API
- CLI
- Frontend
Kinds are another optional layer of changelogs suited for specifying what type of change we are making. If configured, developers will be prompted to select a kind.
The default list comes from keep a changelog and includes; added, changed, removed, deprecated, fixed, and security. example: yaml kinds:
- label: Added
- label: Changed
- label: Deprecated
- label: Removed
- label: Fixed
- label: Security
Custom choices allow you to ask for additional information when creating a new change fragment. These custom choices are included in the change custom value. example: yaml
github issue and author name
custom:
- key: Issue type: int minInt: 1
- key: Author label: GitHub Name type: string minLength: 3
Replacements to run when merging a changelog. example: yaml
nodejs package.json replacement
replacements:
- path: package.json find: ' "version": ".*",' replace: ' "version": "{{.VersionNoPrefix}}",'
Configuration options for newlines before and after different elements.
21 nested properties
Add newlines after change fragment
Add newlines after the header file in the merged changelog
Add newlines after adding a version to the changelog
Add newlines after component
Add newlines after footer file
Add newlines after footer template
Add newlines after header file
Add newlines after header template
Add newlines after kind
Add newlines after release notes
Add newlines after version
Add newlines before change fragment
Add newlines before adding a version to the changelog
Add newlines before component
Add newlines before footer file
Add newlines before footer template
Add newlines before header file
Add newlines before header template
Add newlines before kind
Add newlines before version
Add newlines at the end of the version file
Post process options when saving a new change fragment. example: yaml
build a GitHub link from author choice
post:
- key: AuthorLink value: "https://github.com/{{.Custom.Author}} changeFormat: "* {{.Body}} by {{.Custom.Author}}"
Prefix of environment variables to load for templates. The prefix is removed from resulting key map. example: yaml
if we have an environment variable like so:
export CHANGIE_PROJECT=changie
we can use that in our templates if we set the prefix
envPrefix: "CHANGIE_" versionFormat: "New release for {{.Env.PROJECT}}"
Projects allow you to specify child projects as part of a monorepo setup. example: yaml projects:
- label: UI key: ui changelog: ui/CHANGELOG.md
- label: Email Sender key: email_sender changelog: services/email/CHANGELOG.md
ProjectsVersionSeparator is used to determine the final version when using projects. The result is: project key + projectVersionSeparator + latest/next version. example: yaml projectsVersionSeparator: "_"
Definitions
Body config allows you to customize the default body prompt
Min length specifies the minimum body length
Max length specifies the maximum body length
Block allows multiline text inputs for body messages
Custom defines a custom choice that is asked when using 'changie new'.
Value used as the key in the custom map for the change format. This should only contain alpha numeric characters, usually starting with a capital. example: yaml key: Issue
If true, an empty value will not fail validation. The optional check is handled before min so you can specify that the value is optional but if it is used it must have a minimum length or value depending on type.
When building templates that allow for optional values you can compare the custom choice to an empty string to check for a value or empty.
example: yaml custom:
- key: TicketNumber type: int optional: true changeFormat: >- {{- if not (eq .Custom.TicketNumber "")}} PROJ-{{.Custom.TicketNumber}} {{- end}} {{.Body}}
Description used in the prompt when asking for the choice. If empty key is used instead. example: yaml label: GitHub Username
If specified the input value must be greater than or equal to minInt.
If specified the input value must be less than or equal to maxInt.
If specified the string input must be at least this long
If specified string input must be no more than this long
When using the enum type, you must also specify what possible options to allow. Users will be given a selection list to select the value they want.
Kind config allows you to customize the options depending on what kind was selected.
Key is the value used for lookups and file names for kinds. By default it will use label if no key is provided. example: yaml key: feature
Label is the value used in the prompt when selecting a kind. example: yaml label: Feature
Format will override the root kind format when building the kind header. example: yaml format: '### {{.Kind}} Breaking Changes'
Change format will override the root change format when building changes specific to this kind. example: yaml changeFormat: 'Breaking: {{.Custom.Body}}
Additional choices allows adding choices per kind
Post process options when saving a new change fragment specific to this kind.
Skip global choices allows skipping the parent choices options.
Skip body allows skipping the parent body prompt.
Skip global post allows skipping the parent post processing.
Auto determines what value to bump when using batch auto or next auto.
Possible values are major, minor, patch or none and the highest one is used if
multiple changes are found. none will not bump the version.
Only none changes is not a valid bump and will fail to batch.
example: yaml
auto: minor
Configuration options for newlines before and after different elements.
Add newlines after change fragment
Add newlines after the header file in the merged changelog
Add newlines after adding a version to the changelog
Add newlines after component
Add newlines after footer file
Add newlines after footer template
Add newlines after header file
Add newlines after header template
Add newlines after kind
Add newlines after release notes
Add newlines after version
Add newlines before change fragment
Add newlines before adding a version to the changelog
Add newlines before component
Add newlines before footer file
Add newlines before footer template
Add newlines before header file
Add newlines before header template
Add newlines before kind
Add newlines before version
Add newlines at the end of the version file
PostProcessConfig allows adding additional custom values to a change fragment after all the other inputs are complete.
Key to save the custom value with
Value of the custom value as a go template
ProjectConfig extends changie to support multiple changelog files for different projects inside one repository.
Label is the value used in the prompt when selecting a project. example: yaml label: Frontend
Key is the value used for unreleased and version output paths. example: yaml key: frontend
ChangelogPath is the path to the changelog for this project. example: yaml changelog: src/frontend/CHANGELOG.md
Replacements to run when merging a changelog for our project. example: yaml
nodejs package.json replacement
replacements:
- path: ui/package.json find: ' "version": ".*",' replace: ' "version": "{{.VersionNoPrefix}}",'
Replacement handles the finding and replacing values when merging the changelog.
Path of the file to find and replace in. Also supports Go filepath globs. example: yaml
Will match any .json file in the current directory
replacements:
- path: .json find: ' "version": ".",' replace: ' "version": "{{.VersionNoPrefix}}",'
Regular expression to search for in the file. Capture groups are supported and can be used in the replace value.
Template string to replace the line with.
Optional regular expression mode flags. Defaults to the m flag for multiline such that ^ and $ will match the start and end of each line and not just the start and end of the string.
For more details on regular expression flags in Go view the regexp/syntax.