Skip to content

feat(registry): enrich schema with repo, homepage, license metadata#12

Merged
amondnet merged 11 commits into
mainfrom
amondnet/chatter-sauce
Apr 7, 2026
Merged

feat(registry): enrich schema with repo, homepage, license metadata#12
amondnet merged 11 commits into
mainfrom
amondnet/chatter-sauce

Conversation

@amondnet

@amondnet amondnet commented Apr 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add repo, homepage, license, docsPath optional fields to registry schema
  • Implement expandStrategies to auto-generate strategies from repo when strategies is empty
  • Migrate existing 6 registry entries to use new metadata fields

Related

Closes #5

Test plan

  • Unit tests for expandStrategies (repo only / strategies only / both / neither)
  • Registry build passes (bun run --cwd apps/registry build)
  • CLI regression — existing entries still resolve

Summary by cubic

Enriches the registry with repo, homepage, license, and docsPath metadata, auto‑generates strategies from repo, improves API/CLI error handling, and fixes server imports to unblock Cloudflare Pages builds (documented in CLAUDE.md). Migrates six entries (e.g., zod now repo‑only) and closes #5.

  • New Features

    • Schema: strategies is optional (defaults to []) with a refine requiring repo or strategies.
    • API: custom server route returns expanded strategies; returns 422 for misconfigured entries; uses auto‑imported queryCollection to fix Nuxt Content/Cloudflare Pages build and documents the import gotcha in CLAUDE.md; notes intentional duplication of expandStrategies due to Nitro constraints.
    • CLI: uses shared expandStrategies as a fallback; adds try/catch with debug logging and guards empty strategy lists.
  • Migration

    • Updated entries: next, nuxt, nuxt-ui, tailwindcss, zod, fastapi.

Written for commit 8c231fe. Summary will update on new commits.

@codecov

codecov Bot commented Apr 7, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 41.17647% with 20 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
packages/cli/src/registry.ts 4.76% 20 Missing ⚠️

📢 Thoughts on this report? Let us know!

amondnet added 5 commits April 8, 2026 02:48
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.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Apr 7, 2026

Copy link
Copy Markdown

Deploying ask-registry with  Cloudflare Pages  Cloudflare Pages

Latest commit: 8c231fe
Status:⚡️  Build in progress...

View logs

- 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
@amondnet amondnet marked this pull request as ready for review April 7, 2026 18:07

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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
Loading

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread apps/registry/server/api/registry/[ecosystem]/[name].get.ts

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

0 issues found across 3 files (changes from recent commits).

Requires human review: Auto-approval blocked by 1 unresolved issue from previous reviews.

@amondnet amondnet self-assigned this Apr 7, 2026
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.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

0 issues found across 1 file (changes from recent commits).

Requires human review: This PR introduces schema changes, a new API endpoint, and duplicated logic across packages in the core registry resolution path.

amondnet added 2 commits April 8, 2026 03:23
…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.
@amondnet amondnet merged commit 5000570 into main Apr 7, 2026
2 of 3 checks passed

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

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.

track: registry-meta-20260407

1 participant