From 3be33014770b7a5fce6127ea1a5b368a019f27fa Mon Sep 17 00:00:00 2001 From: Steven Nance Date: Thu, 20 Feb 2025 16:03:13 +0100 Subject: [PATCH] docs(release): document __INVALID__ conventional commit type Co-authored-by: James Henry --- .../customize-conventional-commit-types.md | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/docs/shared/recipes/nx-release/customize-conventional-commit-types.md b/docs/shared/recipes/nx-release/customize-conventional-commit-types.md index 28ee037411ed3..d56e8b8976de2 100644 --- a/docs/shared/recipes/nx-release/customize-conventional-commit-types.md +++ b/docs/shared/recipes/nx-release/customize-conventional-commit-types.md @@ -148,3 +148,32 @@ If you want to use custom, non-standard conventional commit types, you can defin } } ``` + +## Including Invalid Commits in the Changelog + +Nx only includes commits in the changelog that match either the [default conventional commit types](https://github.com/nrwl/nx/blob/master/packages/nx/src/command-line/release/config/conventional-commits.ts) or types you've [added to your configuration](#defining-non-standard-commit-types). + +You can configure Nx to include non-matching commits by adding the special `__INVALID__` type. + +This can also be useful in cases where you have not managed to be consistent with your use of the Conventional Commits standard (e.g. when applying it retroactively to an existing codebase) but still want a changelog to be generated with the contents of each commit message and/or for invalid commits to still affect project versioning. + +{% callout type="note" title="Alternative to Conventional Commits" %} +If you don't plan on using Conventional Commits, file based versioning via Version Plans is the recommended alternative for managing releases. See our docs on [File Based Versioning](/recipes/nx-release/file-based-versioning-version-plans) for more information. +{% /callout %} + +```json {% fileName="nx.json" %} +{ + "release": { + "conventionalCommits": { + "types": { + "__INVALID__": { + "semverBump": "paths", // Note: the default is "none" + "changelog": { + "title": "Uncategorized changes" + } + } + } + } + } +} +```