From f0858e4dbb0613f4f2bffbe1366add6a3f6e5c49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CJamesHenry=E2=80=9D?= Date: Wed, 12 Jun 2024 16:15:53 +0400 Subject: [PATCH 1/4] fix(release): ensure given preid modifies conventional commits specifier --- .../js/src/generators/release-version/release-version.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/js/src/generators/release-version/release-version.ts b/packages/js/src/generators/release-version/release-version.ts index fb0be31d6a573..a5045a3cb78b4 100644 --- a/packages/js/src/generators/release-version/release-version.ts +++ b/packages/js/src/generators/release-version/release-version.ts @@ -205,7 +205,7 @@ To fix this you will either need to add a package.json file at that location, or )}Resolving the current version for tag "${tag}" on ${registry}` ); spinner.color = - color.spinnerColor as (typeof colors)[number]['spinnerColor']; + color.spinnerColor as typeof colors[number]['spinnerColor']; spinner.start(); try { @@ -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; From 92fc8701ad53ec4ef138346856602f7c3793d2dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CJamesHenry=E2=80=9D?= Date: Wed, 12 Jun 2024 16:18:38 +0400 Subject: [PATCH 2/4] chore(release): format --- packages/js/src/generators/release-version/release-version.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/js/src/generators/release-version/release-version.ts b/packages/js/src/generators/release-version/release-version.ts index a5045a3cb78b4..6eb5084b673e5 100644 --- a/packages/js/src/generators/release-version/release-version.ts +++ b/packages/js/src/generators/release-version/release-version.ts @@ -205,7 +205,7 @@ To fix this you will either need to add a package.json file at that location, or )}Resolving the current version for tag "${tag}" on ${registry}` ); spinner.color = - color.spinnerColor as typeof colors[number]['spinnerColor']; + color.spinnerColor as (typeof colors)[number]['spinnerColor']; spinner.start(); try { From eeb009b176f0b79cfc55123663c4989a7dc5e484 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CJamesHenry=E2=80=9D?= Date: Wed, 12 Jun 2024 18:44:41 +0400 Subject: [PATCH 3/4] fix(release): improve description of preid --- packages/nx/src/command-line/release/command-object.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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', { From f52e2882bd7fc09ad4feb6dcc68f44b298579715 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CJamesHenry=E2=80=9D?= Date: Wed, 12 Jun 2024 18:46:15 +0400 Subject: [PATCH 4/4] fix(release): improve description of preid --- docs/generated/cli/release.md | 2 +- docs/generated/packages/nx/documents/release.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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