feat(registry): enrich schema with repo, homepage, license metadata#12
Merged
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Shared function that auto-generates a github strategy from `repo` field when `strategies` is empty, enabling simpler registry entries. Includes unit tests covering all expansion paths.
…fields strategies is now optional (defaults to []) with a refinement requiring at least one of strategies or repo. This enables simpler registry entries that only specify a repo.
Custom Nitro server route replaces Nuxt Content auto-API for registry entries, ensuring strategies are always populated in responses even when the entry only specifies a repo field.
CLI now expands strategies client-side as a fallback, ensuring entries with only a repo field still resolve correctly even if the server hasn't applied expansion.
zod simplified to repo-only (no strategies array needed). Other entries retain their strategies but gain repo/homepage/license metadata for richer registry browsing.
- Add debug logging to fetchRegistryEntry catch block - Wrap expandStrategies in try-catch in resolveFromRegistry - Use createError(422) instead of plain throw in server route - Add empty array guard to selectBestStrategy
Contributor
There was a problem hiding this comment.
1 issue found across 13 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="apps/registry/server/api/registry/[ecosystem]/[name].get.ts">
<violation number="1" location="apps/registry/server/api/registry/[ecosystem]/[name].get.ts:19">
P2: `expandStrategies` is duplicated instead of reusing the existing shared implementation, which can cause API/CLI behavior drift.</violation>
</file>
Architecture diagram
sequenceDiagram
participant User as User / CLI
participant API as Registry API
participant Content as Content Storage
participant Expand as expandStrategies()
Note over User,Content: Registry Lookup & Metadata Enrichment Flow
User->>API: GET /api/registry/:ecosystem/:name
API->>Content: Query markdown frontmatter
alt Entry Not Found
Content-->>API: empty
API-->>User: 404 Not Found
else Entry Found
Content-->>API: return frontmatter (name, repo, strategies, etc.)
API->>Expand: NEW: Call with (repo, docsPath, strategies)
alt strategies list provided
Expand-->>API: Return strategies as-is
else strategies empty AND repo exists
Expand-->>API: NEW: Generate default GitHub strategy from repo
else Neither provided
Expand-->>API: Throw configuration error
API-->>User: 422 Unprocessable Entity
end
API-->>User: 200 OK (Enriched JSON with license, homepage, and strategies)
end
Note over User,API: CLI Resolution Logic
User->>User: CHANGED: Fetch JSON response
alt Fetch Successful
User->>Expand: NEW: Secondary expansion/validation
Expand-->>User: List of strategies
User->>User: CHANGED: selectBestStrategy()
Note right of User: Now handles empty strategy lists<br/>and prioritization
else Fetch Failed (Network/4xx/5xx)
User->>User: Log debug error & return null
end
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
Add a comment to apps/registry server route explaining that the local expandStrategies is an intentional copy of packages/cli/src/registry-schema.ts. The Nitro build cannot resolve cross-package workspace imports, so sharing via workspace is not feasible; the comment directs maintainers to keep both in sync.
…server The #content/server alias does not exist in Nuxt Content v3. queryCollection is auto-imported in Nitro server routes via addServerImports, so no explicit import is needed. Fixes Cloudflare Pages build failure.
Contributor
There was a problem hiding this comment.
0 issues found across 2 files (changes from recent commits).
Requires human review: This PR introduces core logic changes to registry resolution, updates the schema with a refinement, and adds a new API route with duplicated logic due to build constraints.
This was referenced Apr 8, 2026
Merged
Merged
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
repo,homepage,license,docsPathoptional fields to registry schemaexpandStrategiesto auto-generate strategies fromrepowhenstrategiesis emptyRelated
Closes #5
Test plan
expandStrategies(repo only / strategies only / both / neither)bun run --cwd apps/registry build)Summary by cubic
Enriches the registry with
repo,homepage,license, anddocsPathmetadata, auto‑generates strategies fromrepo, improves API/CLI error handling, and fixes server imports to unblock Cloudflare Pages builds (documented inCLAUDE.md). Migrates six entries (e.g.,zodnow repo‑only) and closes #5.New Features
strategiesis optional (defaults to []) with a refine requiringrepoorstrategies.strategies; returns 422 for misconfigured entries; uses auto‑importedqueryCollectionto fix Nuxt Content/Cloudflare Pages build and documents the import gotcha inCLAUDE.md; notes intentional duplication ofexpandStrategiesdue to Nitro constraints.expandStrategiesas a fallback; adds try/catch with debug logging and guards empty strategy lists.Migration
next,nuxt,nuxt-ui,tailwindcss,zod,fastapi.Written for commit 8c231fe. Summary will update on new commits.