Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/generated/cli/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -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. |
Expand Down
1 change: 1 addition & 0 deletions docs/generated/packages/nx/documents/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -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. |
Expand Down
7 changes: 7 additions & 0 deletions packages/nx/src/command-line/release/command-object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ export type ReleaseOptions = NxReleaseArgs &
FirstReleaseArgs & {
specifier?: string;
yes?: boolean;
preid?: VersionOptions['preid'];
skipPublish?: boolean;
};

Expand Down Expand Up @@ -185,6 +186,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',
Expand Down