aws-amplify / amplify-codegen-ui

Generate React components for use in an AWS Amplify project.
Apache License 2.0
32 stars 26 forks source link

fix: use non-aliased name when importing custom components #1146

Closed awinberg-aws closed 7 months ago

awinberg-aws commented 7 months ago

Problem

References to custom components that have been aliased as part of the Figma import are not being generated with the correct component names or import paths.

Solution

Update custom component handling to use the non-aliased component name for imports instead of the node name, which matches the codegen output for the custom component itself.

Additional Notes

Links

Ticket

GitHub issue:

Other links

Verification

Manual tests

Automated tests

Housekeeping

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

codecov-commenter commented 7 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (e855cc8) 93.86% compared to head (9901df0) 93.86%.

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/aws-amplify/amplify-codegen-ui/pull/1146/graphs/tree.svg?width=650&height=150&src=pr&token=opw1LYK6Jn&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aws-amplify)](https://app.codecov.io/gh/aws-amplify/amplify-codegen-ui/pull/1146?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aws-amplify) ```diff @@ Coverage Diff @@ ## main #1146 +/- ## ======================================= Coverage 93.86% 93.86% ======================================= Files 150 150 Lines 6114 6114 Branches 1838 1838 ======================================= Hits 5739 5739 Misses 357 357 Partials 18 18 ``` | [Files](https://app.codecov.io/gh/aws-amplify/amplify-codegen-ui/pull/1146?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aws-amplify) | Coverage Δ | | |---|---|---| | [...-react/lib/amplify-ui-renderers/customComponent.ts](https://app.codecov.io/gh/aws-amplify/amplify-codegen-ui/pull/1146?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aws-amplify#diff-cGFja2FnZXMvY29kZWdlbi11aS1yZWFjdC9saWIvYW1wbGlmeS11aS1yZW5kZXJlcnMvY3VzdG9tQ29tcG9uZW50LnRz) | `100.00% <100.00%> (ø)` | | ------ [Continue to review full report in Codecov by Sentry](https://app.codecov.io/gh/aws-amplify/amplify-codegen-ui/pull/1146?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aws-amplify). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aws-amplify) > `Δ = absolute (impact)`, `ø = not affected`, `? = missing data` > Powered by [Codecov](https://app.codecov.io/gh/aws-amplify/amplify-codegen-ui/pull/1146?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aws-amplify). Last update [e855cc8...9901df0](https://app.codecov.io/gh/aws-amplify/amplify-codegen-ui/pull/1146?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aws-amplify). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aws-amplify).