fix(angular): import paths for child components#1208
Open
sean-perkins wants to merge 3 commits intoBuilderIO:mainfrom
Open
fix(angular): import paths for child components#1208sean-perkins wants to merge 3 commits intoBuilderIO:mainfrom
sean-perkins wants to merge 3 commits intoBuilderIO:mainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
☁️ Nx Cloud ReportCI is running/has finished running commands for commit 3e4b8a7. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this branch ✅ Successfully ran 4 targetsSent with 💌 from NxCloud. |
samijaber
reviewed
Jun 21, 2023
Contributor
samijaber
left a comment
There was a problem hiding this comment.
Awesome! Make sure to:
- run
yarn snapupdateinpackages/coreto update snapshots. - run
yarn fmt:prettierin the root dir to format the PR.
samijaber
reviewed
Jun 22, 2023
| .join(', '); | ||
| } | ||
|
|
||
| return `import ${importValue} from '${importPath}';`; |
Contributor
There was a problem hiding this comment.
I think you're missing wrapping brackets { }, right now the PR imports the same default output, just under a different name. I don't think this is what you want?
Is this what's needed instead?
Suggested change
| return `import ${importValue} from '${importPath}';`; | |
| return `import {${importValue}} from '${importPath}';`; |
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.
Description
Provides a default
importMapperto the Angular generator to generate valid import statements for Angular module projects.For example, when importing a child component called
ChildComponent, the import path will be generated as:I opted against assigning the
importMapperto theDEFAULT_OPTIONS, since the function needs context to whether the user has selected to generate for standalone components or not. With standalone enabled, the import mapper should not rewrite the import value to include theModulepostfix.Resolves #1205