Skip to content
Merged
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
22 changes: 20 additions & 2 deletions packages/nx/src/command-line/migrate/command-object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,32 @@ function withMigrationOptions(yargs: Argv) {
type: 'boolean',
default: false,
})
.option('mode', {
describe:
"Restrict which packages to migrate. Only applies when migrating Nx itself. 'first-party' processes only Nx and its plugins (the target package plus its nx.packageGroup); 'third-party' processes only the third-party dependencies referenced by Nx packageJsonUpdates entries, catching up on any updates that may have been skipped previously; 'all' processes everything. Defaults to 'all' (or prompts in an interactive terminal when targeting Nx).",
type: 'string',
choices: ['first-party', 'third-party', 'all'],
})
.option('multiMajorMode', {
describe:
"Skip the multi-major migration prompt/warning and pick how to handle the jump. 'direct' migrates straight to the requested target. 'gradual' migrates to the smallest recommended step (re-run `nx migrate` to continue toward the original target). Equivalent env var: NX_MULTI_MAJOR_MODE=direct|gradual.",
type: 'string',
choices: ['direct', 'gradual'],
})
.check(
({ createCommits, commitPrefix, from, excludeAppliedMigrations }) => {
({
createCommits,
commitPrefix,
from,
excludeAppliedMigrations,
mode,
}) => {
if (!createCommits && commitPrefix !== defaultCommitPrefix) {
throw new Error(
'Error: Providing a custom commit prefix requires --create-commits to be enabled'
);
}
if (excludeAppliedMigrations && !from) {
if (excludeAppliedMigrations && !from && mode !== 'third-party') {
throw new Error(
'Error: Excluding migrations that should have been previously applied requires --from to be set'
);
Expand Down
Loading
Loading