-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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): handle projects with no targets in angular migration #15940
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
forEachExecutorOptions( | ||
tree, | ||
'@nrwl/angular:file-server', | ||
(currentValue, project, target, configuration) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are not updating options and configurations. Using forEachExecutorOptions
would needlessly execute the callback for every configuration and once for the options, but we only need it once per target.
We could have a different utility like forEachTargetWithExecutor
for these use cases, but while we don't have it, it's better here to just change the existing code like:
- for (const [targetName, target] of Object.entries(project.targets)) {
+ for (const [targetName, target] of Object.entries(project.targets ?? {})) {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I concur. I had originally wrote this with forEachExecutorOptions, but as Leo has mentioned, it runs needlessly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, we can do that.
@@ -64,4 +64,22 @@ describe('updateFileServerExecutor', () => { | |||
'@nrwl/web:file-server' | |||
); | |||
}); | |||
|
|||
it('it should change the executor correctly in nx.json', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it('it should change the executor correctly in nx.json', async () => { | |
it('it should handle projects with no targets', async () => { |
7e87395
to
d161e82
Compare
This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request. |
Current Behavior
Angular file-server migration errors when there is a project with no targets.
Expected Behavior
Angular file-server migration skips over projects with no targets and does not error.
Related Issue(s)
Fixes #