diff --git a/docs/generated/cli/release.md b/docs/generated/cli/release.md index 1c71fe5a69e83..71f0569719296 100644 --- a/docs/generated/cli/release.md +++ b/docs/generated/cli/release.md @@ -165,7 +165,7 @@ Show help Type: `string` -The optional prerelease identifier to apply to the version, in the case that the specifier argument has been set to `prerelease`. +The optional prerelease identifier to apply to the version. This will only be applied in the case that the specifier argument has been set to `prerelease` OR when conventional commits are enabled, in which case it will modify the resolved specifier from conventional commits to be its prerelease equivalent. E.g. minor -> preminor ##### specifier diff --git a/docs/generated/packages/nx/documents/release.md b/docs/generated/packages/nx/documents/release.md index 1c71fe5a69e83..71f0569719296 100644 --- a/docs/generated/packages/nx/documents/release.md +++ b/docs/generated/packages/nx/documents/release.md @@ -165,7 +165,7 @@ Show help Type: `string` -The optional prerelease identifier to apply to the version, in the case that the specifier argument has been set to `prerelease`. +The optional prerelease identifier to apply to the version. This will only be applied in the case that the specifier argument has been set to `prerelease` OR when conventional commits are enabled, in which case it will modify the resolved specifier from conventional commits to be its prerelease equivalent. E.g. minor -> preminor ##### specifier diff --git a/packages/js/src/generators/release-version/release-version.ts b/packages/js/src/generators/release-version/release-version.ts index fb0be31d6a573..6eb5084b673e5 100644 --- a/packages/js/src/generators/release-version/release-version.ts +++ b/packages/js/src/generators/release-version/release-version.ts @@ -406,8 +406,13 @@ To fix this you will either need to add a package.json file at that location, or `📄 Resolved the specifier as "${specifier}" since the current version is a prerelease.` ); } else { + let extraText = ''; + if (options.preid && !specifier.startsWith('pre')) { + specifier = `pre${specifier}`; + extraText = `, combined with your given preid "${options.preid}"`; + } log( - `📄 Resolved the specifier as "${specifier}" using git history and the conventional commits standard.` + `📄 Resolved the specifier as "${specifier}" using git history and the conventional commits standard${extraText}.` ); } break; diff --git a/packages/nx/src/command-line/release/command-object.ts b/packages/nx/src/command-line/release/command-object.ts index dd70f7ef4025e..9ccce78640359 100644 --- a/packages/nx/src/command-line/release/command-object.ts +++ b/packages/nx/src/command-line/release/command-object.ts @@ -203,7 +203,7 @@ const versionCommand: CommandModule = { .option('preid', { type: 'string', describe: - 'The optional prerelease identifier to apply to the version, in the case that the specifier argument has been set to `prerelease`.', + 'The optional prerelease identifier to apply to the version. This will only be applied in the case that the specifier argument has been set to `prerelease` OR when conventional commits are enabled, in which case it will modify the resolved specifier from conventional commits to be its prerelease equivalent. E.g. minor -> preminor', default: '', }) .option('stage-changes', {