fix(release): allow preid option in release command (#29264)

This commit is contained in:
Alejandro Forero 2025-02-17 06:17:15 -05:00 committed by GitHub
parent 804df721a7
commit d8345147ed
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 9 additions and 0 deletions

View File

@ -43,6 +43,7 @@ nx release [specifier]
| ----------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--first-release` | boolean | Indicates that this is the first release for the selected release group. If the current version cannot be determined as usual, the version on disk will be used as a fallback. This is useful when using git or the registry to determine the current version of packages, since those sources are only available after the first release. Also indicates that changelog generation should not assume a previous git tag exists and that publishing should not check for the existence of the package before running. |
| `--help` | boolean | Show help. |
| `--preid` | string | 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: ``) |
| `--skip-publish` | boolean | Skip publishing by automatically answering no to the confirmation prompt for publishing. |
| `--specifier` | string | Exact version or semver keyword to apply to the selected release group. |
| `--version` | boolean | Show version number. |

View File

@ -43,6 +43,7 @@ nx release [specifier]
| ----------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--first-release` | boolean | Indicates that this is the first release for the selected release group. If the current version cannot be determined as usual, the version on disk will be used as a fallback. This is useful when using git or the registry to determine the current version of packages, since those sources are only available after the first release. Also indicates that changelog generation should not assume a previous git tag exists and that publishing should not check for the existence of the package before running. |
| `--help` | boolean | Show help. |
| `--preid` | string | 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: ``) |
| `--skip-publish` | boolean | Skip publishing by automatically answering no to the confirmation prompt for publishing. |
| `--specifier` | string | Exact version or semver keyword to apply to the selected release group. |
| `--version` | boolean | Show version number. |

View File

@ -86,6 +86,7 @@ export type ReleaseOptions = NxReleaseArgs &
FirstReleaseArgs & {
specifier?: string;
yes?: boolean;
preid?: VersionOptions['preid'];
skipPublish?: boolean;
};
@ -186,6 +187,12 @@ const releaseCommand: CommandModule<NxReleaseArgs, ReleaseOptions> = {
describe:
'Exact version or semver keyword to apply to the selected release group.',
})
.option('preid', {
type: 'string',
describe:
'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('yes', {
type: 'boolean',
alias: 'y',