🐛 fix: rewrite flattened import paths after component install#89
Merged
renardeinside merged 1 commit intomainfrom Feb 18, 2026
Merged
🐛 fix: rewrite flattened import paths after component install#89renardeinside merged 1 commit intomainfrom
renardeinside merged 1 commit intomainfrom
Conversation
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.
Summary
add_component: internal imports not rewritten to match flattened file paths #88: cross-file imports inside installed components were left pointing at the original nested registry paths (e.g.@/components/animate-ui/icons/icon) after file flattening flipped the saved name toicons-icon.tsxbuild_path_mapto compare each file's original registry path against its saved (flattened) path and collect the differencesrewrite_flattened_pathsto apply that map to file content, anchored on the trailing quote to prevent partial-prefix matches; longest paths winHow it works
When
plan_addresolves a component closure it now:original → savedpath map across all resolved filesrewrite_flattened_pathsafterrewrite_registry_importswhen writing each fileHelper functions added:
determine_output_rootmatch file_typein the loopcompute_saved_import_path@/components/{registry}/{resolved.name}etc.original_registry_import_path@/tofile.pathbuild_path_maprewrite_flattened_pathsTest plan
components::tests(component rewrite, hook rewrite, deeply-nested rewrite, no partial-match, empty map, path stripping, map building, integration scenario)apx-corelib tests passcargo fmt --checkpassescargo checkpasses🤖 Generated with Claude Code