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(@angular/cli): handle format path in invoked schematics #23198

Closed
wants to merge 1 commit into from

Conversation

alan-agius4
Copy link
Collaborator

With this change we change the how we handle "format": "path" schematic property option. Previously, in version 14 this format was only being applied on parent schematics that were registered as commands. With this change we apply the formatter on all options, even those who are called programmatically using APIs like externalSchematic.

@alan-agius4 alan-agius4 added the target: rc This PR is targeted for the next release-candidate label May 23, 2022
@alan-agius4 alan-agius4 requested a review from clydin May 23, 2022 12:22
@alan-agius4 alan-agius4 marked this pull request as ready for review May 23, 2022 12:22
@alan-agius4 alan-agius4 added the action: review The PR is still awaiting reviews from at least one requested reviewer label May 23, 2022
@alan-agius4 alan-agius4 added this to the v14 milestone May 23, 2022
Comment on lines 176 to 178
if (property['format'] === 'path') {
(options as Record<string, unknown>)[key] = workingDir;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like the logic previously set the default to the workingDir for only properties named path but this overrides the value with the workDir for all properties with a path format. I think we might want to keep the path name condition to prevent accidentally breaking third-party schematics that could be using the path format for other purposes.

We should probably add in a Schematics specific workingDirectory concept (on the context maybe?) so we can avoid this whole workaround in the future.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#23212 is a different approach to this change.

With this change we change the how we handle `"format": "path"` schematic property option. Previously, in version 14 this format was only being applied on parent schematics that were registered as commands. With this change we apply the formatter on all options, even those who are called programmatically using APIs like `externalSchematic`.
@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 Jun 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: review The PR is still awaiting reviews from at least one requested reviewer target: rc This PR is targeted for the next release-candidate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants