Skip to content
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

feat(cli): add support for multiple registries #5775

Closed
wants to merge 4 commits into from

Conversation

smithgeek
Copy link

@smithgeek smithgeek commented Nov 8, 2024

Added a new registry command with add and remove subcommands that can add named registries to the components.json file. The add, diff, info and migrate commands were also updated to take a -r --registry my-registry option to specify what registry to use. If none is specified it will default to the shadcn registry. Registries can override the style and aliases used by the main config, but if not specified the main config values will still be used.

The init command now also prompts the user for the primary registry to use (defaulting to shadcn). This adds a url property to the config that if set will be used as the primary registry. If not set shadcn will be used.

This adds a new section to the components.json file for named registries

{
  ...
  "url": "http://new-default-registry",
  "registries": {
    "my-registry": {
      "url": "http://localhost:3001/registry",
      "style": "default",
      "aliases": {
        "components": "@/my-registry/components",
	"utils": "@/my-registry/lib/cn",
	"ui": "@/my-registry/components/ui",
	"lib": "@/my-registry/lib",
	"hooks": "@/my-registry/hooks"
      }
    }
  }
}

Then when running other shadcn commands if you provide a -r my-registry option the cli will use the new registry while defaulting to shadcn if no registry is provided.

Added a new `registry` command with `add` and `remove` subcommands that can add named registries to the components.json file.
The `add`, `diff`, and `migrate` commands were also updated to take a `--registry` option to specify what registry to use. If none is specified it will default to the shadcn registry.
Copy link

vercel bot commented Nov 8, 2024

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

A member of the Team first needs to authorize it.

@shadcn
Copy link
Collaborator

shadcn commented Nov 13, 2024

@smithgeek how similar is the implementation to #4950?

Copy link

vercel bot commented Nov 13, 2024

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

Name Status Preview Updated (UTC)
ui ✅ Ready (Inspect) Visit Preview Nov 13, 2024 11:31am

@smithgeek
Copy link
Author

looks similar, but that one has more features.

@smithgeek smithgeek closed this Nov 13, 2024
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