Skip to content

fix(v4): Re-enable remote dependencies#1807

Merged
AdrianGonz97 merged 10 commits into
huntabyte:next-tailwind-4from
ieedan:fix-remote-dependencies
Apr 3, 2025
Merged

fix(v4): Re-enable remote dependencies#1807
AdrianGonz97 merged 10 commits into
huntabyte:next-tailwind-4from
ieedan:fix-remote-dependencies

Conversation

@ieedan
Copy link
Copy Markdown
Collaborator

@ieedan ieedan commented Mar 31, 2025

Noticed this when reading through https://ui.shadcn.com/docs/registry/examples.

Some of the examples have urls in their registry dependencies. I broke support for this when #1781 got merged.

This PR re-adds support by expecting callers of fetchRegistry to supply a url instead of a name. It also modifies some of the other functions to conform with that expectation. This also allows you to pass registry items into fetchRegistry that don't belong to the same registry without both of them using the same base url.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Mar 31, 2025

⚠️ No Changeset found

Latest commit: 2af9822

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Comment thread packages/cli/src/utils/registry/index.ts
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 31, 2025

built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

Name Status Preview Last Commit
shadcn-svelte ✅ Ready (View Log) Visit Preview 2af9822

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR re-enables support for remote dependencies by updating the functions to utilize URLs instead of names when fetching registry data.

  • Updates fetchRegistry calls to expect an array of URL strings instead of a base URL and path segments.
  • Modifies helper functions (e.g., getRegistryIndex, getRegistryBaseColor, resolveTree, fetchTree) accordingly.
Comments suppressed due to low confidence (2)

packages/cli/src/utils/registry/index.ts:148

  • [nitpick] Consider renaming the parameter 'items' to 'urls' to more clearly indicate that each element is a URL.
async function fetchRegistry(items: string[]) {

packages/cli/src/utils/registry/index.ts:178

  • The updated error message no longer includes the base URL, which might make it harder to diagnose which registry URL failed. Consider including additional context if possible.
throw error(`Failed to fetch registry. Error: ${e}`);

@AdrianGonz97 AdrianGonz97 merged commit 8132b07 into huntabyte:next-tailwind-4 Apr 3, 2025
6 checks passed
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.

3 participants