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

feat(@angular-devkit/architect): merge object options from CLI #28398

Merged
merged 1 commit into from
Sep 12, 2024

Conversation

jkrems
Copy link
Contributor

@jkrems jkrems commented Sep 11, 2024

We recently introduced the ability to pass object values from the command line (#28362). @clydin noticed that the initial behavior didn't work well for --define: It completely replaced all values even if just one of multiple defines is specified.

This updates the architect to support merging of object options. If both the base option (e.g. from angular.json) and the override (e.g. from a CLI --flag) are objects, the objects are merged.

See: #28362

PR Checklist

Please check to confirm your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

What is the current behavior?

Issue Number: N/A

With multiple defines in angular.json, passing any define via the --define flag will ignore all existing defines.

What is the new behavior?

Only defines specified via the --define flag will be replaced. All others retain the value specified in angular.json.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

We recently introduced the ability to pass object values from the
command line (angular#28362). @clydin noticed that the initial behavior
didn't work well for `--define`: It completely replaced all values
even if just one of multiple defines is specified.

This updates the architect to support merging of object options.
If both the base option (e.g. from `angular.json`) and the override
(e.g. from a CLI `--flag`) are objects, the objects are merged.

See: angular#28362
@jkrems jkrems added the target: minor This PR is targeted for the next minor release label Sep 11, 2024
@alan-agius4 alan-agius4 added the action: merge The PR is ready for merge by the caretaker label Sep 12, 2024
@alan-agius4 alan-agius4 merged commit 78f7648 into angular:main Sep 12, 2024
32 of 33 checks passed
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Oct 13, 2024
@jkrems jkrems deleted the jk-merge-options branch November 6, 2024 15:29
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker area: @angular-devkit/architect detected: feature PR contains a feature commit target: minor This PR is targeted for the next minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants