feat(cli)!: Scope project/workspace yargs options per command#1434
Open
matz3 wants to merge 1 commit into
Open
feat(cli)!: Scope project/workspace yargs options per command#1434matz3 wants to merge 1 commit into
matz3 wants to merge 1 commit into
Conversation
The yargs options --config / -c, --dependency-definition, --workspace-config, and --workspace / -w were previously registered globally in base.js and shown in --help for every command. Several commands silently ignored them: * ui5 config / init / versions did not load a project at all * ui5 add / remove / use only operate on ui5.yaml without workspace context Move the option definitions into a new options.js helper module that exposes applyProjectConfigOptions() and applyWorkspaceOptions(). Each command builder now opts in to the option groups it actually consumes, and yargs' existing strict mode rejects the options on commands that no longer accept them. The shared last-value-wins dedupe coerce is exported as dedupeArray() so commands can apply it to their own non-global options (framework-version, dest, port, etc.) instead of relying on a central coerce list in base.js that referenced options yargs only sees per-command. BREAKING CHANGE: ui5 versions, ui5 init, and ui5 config no longer accept --config, --dependency-definition, --workspace, or --workspace-config. ui5 add, ui5 remove, and ui5 use no longer accept --workspace or --workspace-config. Passing any of these to a command that does not support them now fails with 'Unknown argument: <option>'.
RandomByte
approved these changes
Jun 25, 2026
Member
|
Regarding the commit message, it might be worth explicitly stating that the no longer accepted arguments already didn't have any effect in the past |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The yargs options --config / -c, --dependency-definition, --workspace-config,
and --workspace / -w were previously registered globally in base.js and shown
in --help for every command. Several commands silently ignored them:
Move the option definitions into a new options.js helper module that exposes
applyProjectConfigOptions() and applyWorkspaceOptions(). Each command builder
now opts in to the option groups it actually consumes, and yargs' existing
strict mode rejects the options on commands that no longer accept them.
The shared last-value-wins dedupe coerce is exported as dedupeArray() so
commands can apply it to their own non-global options (framework-version,
dest, port, etc.) instead of relying on a central coerce list in base.js
that referenced options yargs only sees per-command.
BREAKING CHANGE: ui5 versions, ui5 init, and ui5 config no longer accept
--config, --dependency-definition, --workspace, or --workspace-config.
ui5 add, ui5 remove, and ui5 use no longer accept --workspace or
--workspace-config. Passing any of these to a command that does not
support them now fails with 'Unknown argument: '.