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): handle newProjectRoot correctly when generating apps and libs #9255

Merged

Conversation

leosvelperez
Copy link
Member

Current Behavior

In workspaces where the newProjectRoot config might be specified in the angular.json (v1 format), there are issues creating applications and libraries. The @schematics/angular:application or @schematics/angular:library generator use that property if present to create the projects and then, the @nrwl/* generators move the projects to the final destination.

Most workspaces won't have this issue since that option doesn't get generated in new Nx workspaces and it gets deleted when migrating an Angular CLI workspace to an Nx workspace. However, if an Angular CLI workspace is migrated preserving the Angular CLI layout, the option is not meant to be removed and therefore it still needs to be handled correctly. In that scenario, the Angular CLI schematics need to work as usual, and for that, the option needs to be present.

A recent PR #8865 made a change to always remove the option when updating the configuration which is not something desired when a workspace preserves the Angular CLI layout.

Expected Behavior

In workspaces where the newProjectRoot option is set in the configuration, the @nrwl/angular:app and @nrwl/angular:lib should handle it and work correctly. The newProjectRoot option shouldn't be deleted when updating the configuration if it's not meant to be deleted.

Related Issue(s)

Fixes #

@nx-cloud
Copy link

nx-cloud bot commented Mar 9, 2022

☁️ Nx Cloud Report

CI ran the following commands for commit 34740f0. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch


✅ Successfully ran 7 targets

Sent with 💌 from NxCloud.

@vercel
Copy link

vercel bot commented Mar 9, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/nrwl/nx-dev/BNB61DPJHCCyoZk5PAmDyRKQuNT1
✅ Preview: Canceled

@leosvelperez leosvelperez self-assigned this Mar 9, 2022
@leosvelperez leosvelperez marked this pull request as ready for review March 10, 2022 10:34
Copy link
Contributor

@Coly010 Coly010 left a comment

Choose a reason for hiding this comment

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

LGTM! 🎉

@leosvelperez leosvelperez merged commit 081ff42 into nrwl:master Mar 10, 2022
@leosvelperez leosvelperez deleted the angular/handle-new-project-root branch March 10, 2022 13:09
@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants