Skip to content

feat: recursive add, simpler sync#21

Merged
teamdandelion merged 1 commit into
mainfrom
recursive-add
Jun 3, 2025
Merged

feat: recursive add, simpler sync#21
teamdandelion merged 1 commit into
mainfrom
recursive-add

Conversation

@teamdandelion
Copy link
Copy Markdown
Collaborator

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 sync when adding components so that everything gets re-installed. Now that add handles removing and re-adding deps, sync is basically a sugar for "re add everything".

Under the hood, add keeps 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.

- add command now auto removes then adds, and adds deps recursively.
- sync is basically an alias for adding things (or adding everything)
@teamdandelion teamdandelion requested a review from brenkao June 3, 2025 23:41
@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
ui-storybook e7ca011 Visit preview Jun 03 2025, 11:38 PM

@teamdandelion teamdandelion merged commit f673a7a into main Jun 3, 2025
3 checks passed
@teamdandelion teamdandelion deleted the recursive-add branch June 3, 2025 23:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants