Closed SokratisVidros closed 5 hours ago
Hi @SokratisVidros, I would recommend:
nx release --skip-publish # or let it prompt you and say no
nx release publish --otp=...
The versioning and changelog steps are potentially quite involved when optionally resolving versions from custom registries or manually editing changelogs in an interactive editor is done, so by the time OTP would be consumed it could have easily expired.
In general it is not a design goal of nx release
to support all options for all subcommands, because that would scale horribly. --first-release
is not a good comparison because it genuinely applies to multiple subcommands, --otp
is specific to only publishing.
The alternative recommendation I would have is creating a release.js/release.ts script which you invoke with node/ts-node/tsx etc which leverages our first class programmatic API. You could then take in an --otp arg to your custom script and control how it is passed to await releasePublish({ otp: '...', ... })
Here is an example of using the programmatic API: https://nx.dev/features/manage-releases#using-the-programmatic-api-for-nx-release
Current Behavior
Running
nx release --otp
returns anUnknown argument: otp
error. As a result, the user is forced to run nxversion
,changelog
, andrelease
subcommands independently.Expected Behavior
The expected behavior is for
nx release
to allow the specification of CLI arguments for each subcommand. That is--otp
to be passed directly to thepublish
subcommand.Since other subcommand CLI options have the same name, it is expected for the CLI options to apply to all subcommands. For example, passing
--first-release
should apply toversion
,changelog
, and `publish.GitHub Repo
No response
Steps to Reproduce
1.In an NX powered monorepo try
pnpm nx publish --otp 123456
.Nx Report
Failure Logs
Package Manager Version
pnpm@9.11.0
Operating System
Additional Information
No response