Skip to content

fix(@schematics/angular): infer app component name and path in server schematic #30028

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

Merged
merged 1 commit into from
Apr 7, 2025

Conversation

crisbeto
Copy link
Member

@crisbeto crisbeto commented Apr 4, 2025

Currently the server schematic assumes that the app component is called App and it's places in ./app/app. This will fail if the user renamed it or moved it to a different file.

These changes add a utility function to resolve the component name and path from the source the source code, and they use the new function to produce a more accurate result.

@crisbeto crisbeto requested a review from clydin April 4, 2025 11:52
@crisbeto crisbeto added the action: review The PR is still awaiting reviews from at least one requested reviewer label Apr 4, 2025
@crisbeto crisbeto marked this pull request as ready for review April 4, 2025 11:52
@clydin clydin added the target: major This PR is targeted for the next major release label Apr 4, 2025
@crisbeto crisbeto force-pushed the server-schematic-name branch from 597af7f to 2397b22 Compare April 4, 2025 18:28
@crisbeto
Copy link
Member Author

crisbeto commented Apr 4, 2025

I've pushed some more code to properly handle NgModule-based apps as well. It's ready for another review.

@crisbeto crisbeto force-pushed the server-schematic-name branch from 2397b22 to 75f1500 Compare April 7, 2025 07:25
… schematic

Currently the `server` schematic assumes that the app component is called `App` and it's places in `./app/app`. This will fail if the user renamed it or moved it to a different file.

These changes add a utility function to resolve the component name and path from the source the source code, and they use the new function to produce a more accurate result.
@crisbeto crisbeto force-pushed the server-schematic-name branch from 75f1500 to d9af817 Compare April 7, 2025 07:27
Copy link
Collaborator

@alan-agius4 alan-agius4 left a comment

Choose a reason for hiding this comment

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

LGTM

@alan-agius4 alan-agius4 removed the request for review from clydin April 7, 2025 11:53
@alan-agius4 alan-agius4 added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Apr 7, 2025
@clydin clydin merged commit ea1143d into angular:main Apr 7, 2025
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action: merge The PR is ready for merge by the caretaker area: @schematics/angular target: major This PR is targeted for the next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants