feat(cli): local: registryDeps#1913
Conversation
|
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
[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.
built with Refined Cloudflare Pages Action⚡ Cloudflare Pages Deployment
|
…-svelte into tw4-local-registry-deps
Enables custom registries to reference their own components as
registryDependenciesusing thelocal:<item_name>shorthand, which resolves to a relative path that we use to grab it.