Skip to content

feat(cli): local: registryDeps#1913

Merged
huntabyte merged 14 commits into
next-tailwind-4from
tw4-local-registry-deps
May 17, 2025
Merged

feat(cli): local: registryDeps#1913
huntabyte merged 14 commits into
next-tailwind-4from
tw4-local-registry-deps

Conversation

@huntabyte
Copy link
Copy Markdown
Owner

Enables custom registries to reference their own components as registryDependencies using the local:<item_name> shorthand, which resolves to a relative path that we use to grab it.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 17, 2025

⚠️ No Changeset found

Latest commit: 8161061

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

@huntabyte huntabyte requested review from AdrianGonz97 and Copilot May 17, 2025 04:08
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 adds support for using the shorthand "local:" in registryDependencies to reference local registry components via a relative path. Key changes include updating file paths and type designations in registry-template/registry.json, introducing a remoteUrl parameter and extended resolution logic in packages/cli/src/utils/registry/index.ts, and adding a transformation for local registryDependencies in packages/cli/src/commands/registry/build.ts.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
registry-template/registry.json Updates file paths and alters component type designations
packages/cli/src/utils/registry/index.ts Adds remoteUrl handling and adjusts item resolution logic
packages/cli/src/commands/registry/build.ts Introduces local: shorthand transformation to relative JSON paths
Comments suppressed due to low confidence (1)

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

  • Consider removing the extra period at the end of the error message to improve its clarity.
throw error(`Component item '${item}' does not exist in the registry, nor is it a valid URL/local:registryDep..`);

if (isUrl(item)) {
const [result] = await fetchRegistry([item]);
resolvedItem = schemas.registryItemSchema.parse(result);
remoteUrl = new URL(item);
Copy link

Copilot AI May 17, 2025

Choose a reason for hiding this comment

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

[nitpick] Consider using a new local variable instead of reassigning the remoteUrl parameter. This avoids potential confusion regarding its scope and lifetime in subsequent iterations.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

fine

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 17, 2025

built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

Name Status Preview Last Commit
scn-svelte-v4 ✅ Ready (View Log) Visit Preview 9f5628e
shadcn-svelte ✅ Ready (View Log) Visit Preview a542c72

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