feat: recursive add, simpler sync#21
Merged
Merged
Conversation
- add command now auto removes then adds, and adds deps recursively. - sync is basically an alias for adding things (or adding everything)
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
ui-storybook | e7ca011 | Visit preview | Jun 03 2025, 11:38 PM |
brenkao
approved these changes
Jun 3, 2025
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.
Current add command has a bug in that it doesn't operate recursively - so if A depends on B, and B depends on C, then add will install B but not C
This PR re-implements add so that it operates recursively. Also, it now does the better behavior of doing a full sync under the hood - i.e. removing the component and then re-adding it. It does this recursively, which means if A depends on B, and B depends on C, and you have an older version of C installed, it will re-install C, thus ensuring that B has the latest version of the dependency. Of course, this may affect other other components — and there is an edge case where you could have some other dependency X, also depending on C, which should be re-installed in case it needed any compatibility changes for the latest version of X.
For that reason, it's still best to use
mirascope-ui syncwhen adding components so that everything gets re-installed. Now that add handles removing and re-adding deps,syncis basically a sugar for "re add everything".Under the hood,
addkeeps track of which components have already been removed and re-added, so there is no potential exponential blowup with common dependencies getting repeatedly removed and re-installed.Docs and tests updated to reflect this change. There is now also a sanity check that the command will not install components into the registry repo itself — which has no possible benefit, and the possible downside of removing components from the source repository, which is undesirable.