Skip to content

feat(shadcn): add skip registry dependency flag #7395

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

lloydrichards
Copy link
Contributor

Goal/Scope

I had a request to add a registry item that would add all item: lloydrichards/shadcn-storybook-registry#2 but in the process was looking for a way to be selective about what dependencies to add. At the moment with the registry item (json) i have a long list of registry dependencies that add basically all the items. This means that if someone already has items that they need to select no (N) to prevent override each time.

I wanted to have a look at if it would be easy to add a new flag that would just skip over the registryDependencies items when adding a new components.

Description

I tried to be as minimal as possible so added a new flag --skip-registry-deps to the add command that will cause the resolveRegistryItems() to only return the initial components rather than the expanded list with the registryDependencies.

This required some prop drilling in addProjectComponents() but was simple enough addWorkspaceComponents()

Let me know if you prefer this done another way.

Copy link

vercel bot commented May 16, 2025

@lloydrichards is attempting to deploy a commit to the shadcn-pro Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

vercel bot commented May 19, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
v4 ✅ Ready (Inspect) Visit Preview May 19, 2025 7:34am
1 Skipped Deployment
Name Status Preview Updated (UTC)
ui ⬜️ Ignored (Inspect) Visit Preview May 19, 2025 7:34am

@shadcn
Copy link
Collaborator

shadcn commented May 29, 2025

@lloydrichards Would a better comparison check (and auto-skip) work? I wonder if we can improve the file comparison and automatically skip (no prompt) if same?

@lloydrichards
Copy link
Contributor Author

Would certainly achieve the same effect. I guess the file comparisons function could just check for value equality between the incoming and current file? But this might not work perfectly if the local version has different formatting (prettier, biome etc). If you would prefer this over the new flag then we can close this PR and I'll try again with the comparison function

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants