Skip to content

feat: add github registry support#409

Merged
harishsundar-okta merged 7 commits into
mainfrom
feat/github-registry-hybrid
Jul 27, 2026
Merged

feat: add github registry support#409
harishsundar-okta merged 7 commits into
mainfrom
feat/github-registry-hybrid

Conversation

@harishsundar-okta

@harishsundar-okta harishsundar-okta commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Summary

Implement shadcn GitHub Registries as the primary distribution path for new consumers (hybrid Option 2 from the RAPID), while keeping the Vercel-hosted registry as a backwards-compatible fallback.

Why

shadcn released GitHub Registries (June 2026) which allows any public repo with a registry.json to be directly installable — no server, no build step, no custom URL configuration. This simplifies consumer DX significantly while letting us maintain backwards compatibility for existing consumers.

What

  • Add root registry.json with include directive pointing to packages/react/registry.json
  • Add HTTP deprecation headers (Deprecation, Sunset, Link) to the Vercel registry API
  • Add unified v{VERSION} git tag creation to the publish workflow for consumer ref pinning
  • Add shadcn registry validate to the CI pipeline
  • Pin all npm dependencies to exact versions (no ^/~ ranges) for deterministic installs
  • Add framework namespace scoping (react/) to registry items for future multi-framework support
  • New consumer install path:
    npx shadcn add auth0/auth0-ui-components/react/my-account/user-mfa-management#v3.0.0

Packages

  • packages/core
  • packages/react

References

Testing

Screenshot 2026-07-14 at 11 18 39 AM

Checklist

  • Breaking change
  • Requires docs update
  • Backward compatible

Contributing

Summary by CodeRabbit

  • New Features
    • Added a Shadcn UI component registry entry for React components via a new registry.json.
  • Documentation
    • Updated the JSON API response headers with deprecation, sunset, and successor information.
  • Chores
    • Standardized React registry metadata (including framework info) and pinned key dependency versions.
    • Updated automated registry regeneration/validation in CI.
    • Enhanced the release process with an additional unified v{VERSION} Git tag.

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 2943f1a6-f4c4-43d9-aff6-8a10737e123b

📥 Commits

Reviewing files that changed from the base of the PR and between 6cf4c98 and fa51b99.

📒 Files selected for processing (1)
  • packages/react/registry.json

📝 Walkthrough

Walkthrough

The PR adds Shadcn registry configuration and validation, updates React registry generation and entries for core version 3.0.2, adds a unified release tag, and includes deprecation metadata in JSON API responses.

Changes

Shadcn React registry

Layer / File(s) Summary
Registry configuration and generation
registry.json, packages/react/scripts/generate-registry.mjs
Adds the root Shadcn registry configuration and emits React-prefixed names, framework metadata, and exact-pinned dependencies.
Core and organization registry entries
packages/react/registry.json
Updates My Account and My Organization blocks to core version 3.0.2 with exact-pinned dependencies and revised file lists.
SSO registry entries
packages/react/registry.json
Updates SSO provider blocks to core version 3.0.2 with exact-pinned dependencies, React metadata, and service hook paths.
Registry validation and release tagging
.github/workflows/ci-cd.yml, .github/workflows/publish-public-npm.yml
Regenerates and validates the registry in CI and creates the unified v${VERSION} Git tag.

API deprecation metadata

Layer / File(s) Summary
JSON response deprecation headers
docs-site/api/r.ts
Adds Deprecation, Sunset, and successor-version Link headers to JSON responses.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Generator as generate-registry.mjs
  participant Registry as packages/react/registry.json
  participant CI as ci-cd.yml
  participant Release as publish-public-npm.yml
  Generator->>Registry: generate React registry entries
  CI->>Registry: regenerate and validate registry
  Release->>Release: create and push v${VERSION} tag
Loading

Possibly related PRs

Suggested labels: github_actions

Suggested reviewers: chakrihacker, rax7389

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: adding GitHub registry support for shadcn-based component distribution.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/github-registry-hybrid

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@harishsundar-okta harishsundar-okta changed the title feat: add github registry support (hybrid option 2) feat: add github registry support Jul 14, 2026
@harishsundar-okta harishsundar-okta added the enhancement New feature or request label Jul 14, 2026
@github-actions

github-actions Bot commented Jul 14, 2026

Copy link
Copy Markdown

🚀 Preview deployment

Branch: refs/pull/409/merge
Commit: 2e174e6

📝 Preview URL: https://auth0-universal-components-o1jo7lt0y-ui-components-217de888.vercel.app


Updated at 2026-07-27T12:45:13.439Z

@codecov-commenter

codecov-commenter commented Jul 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.80%. Comparing base (478dcf1) to head (fa51b99).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #409   +/-   ##
=======================================
  Coverage   89.80%   89.80%           
=======================================
  Files         236      236           
  Lines       17632    17632           
  Branches     2019     2019           
=======================================
  Hits        15835    15835           
  Misses       1797     1797           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@rax7389 rax7389 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.

Please resolve the conflicts

@rax7389

rax7389 commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

@coderabbitai Review the PR changes

@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

@rax7389 The PR description image shows a successful terminal installation via:

npx shadcn add auth0/auth0-ui-components/react/my-account/user-mfa-management#feat/github-registry-hybrid

It installs shadcn@4.13.0, completes registry and dependency checks, confirms overwriting existing button.tsx and utils.ts, and creates 60 files including the MFA-management component tree. I’ll review the PR changes.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai 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.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/ci-cd.yml:
- Around line 57-58: Update the “Validate shadcn registry” workflow step to
invoke a reviewed, fixed shadcn release instead of the mutable latest tag, and
restrict the job’s token permissions to contents: read. Keep the existing
registry validation command and apply the permission setting at the job scope.

In @.github/workflows/publish-public-npm.yml:
- Around line 311-322: Update the release-tag flow around UNIFIED_TAG to
preserve tag immutability: remove the local and remote deletion logic, check
whether the tag already exists remotely, and fail the workflow before creating
or pushing it. Continue creating and pushing the tag only when it does not
already exist.

In `@docs-site/api/r.ts`:
- Around line 79-80: Update the deprecation headers in the response setup:
change the Deprecation value to an RFC 9745 date format using the applicable
Unix timestamp, and correct the Sunset header’s weekday from Sat to Thu while
preserving its intended date and time.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 9f142a53-94c4-4095-96b2-6921f7da3464

📥 Commits

Reviewing files that changed from the base of the PR and between 25c419c and 4d764c7.

📒 Files selected for processing (6)
  • .github/workflows/ci-cd.yml
  • .github/workflows/publish-public-npm.yml
  • docs-site/api/r.ts
  • packages/react/registry.json
  • packages/react/scripts/generate-registry.mjs
  • registry.json

Comment thread .github/workflows/ci-cd.yml Outdated
Comment on lines +311 to +322
if git rev-parse "$UNIFIED_TAG" >/dev/null 2>&1; then
echo "Tag $UNIFIED_TAG exists locally, deleting..."
git tag -d "$UNIFIED_TAG"
fi

if git ls-remote --tags origin | grep -q "refs/tags/$UNIFIED_TAG"; then
echo "Tag $UNIFIED_TAG exists remotely, deleting..."
git push origin ":refs/tags/$UNIFIED_TAG" || true
fi

git tag -a "$UNIFIED_TAG" -m "Release v${VERSION} — GitHub Registry ref"
git push origin "$UNIFIED_TAG"

@coderabbitai coderabbitai Bot Jul 18, 2026

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.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Keep GitHub Registry version tags immutable.

Deleting and recreating v${VERSION} can make the same installation ref resolve to different source. Fail if the release tag already exists instead of moving it.

Proposed fix
-          if git rev-parse "$UNIFIED_TAG" >/dev/null 2>&1; then
-            echo "Tag $UNIFIED_TAG exists locally, deleting..."
-            git tag -d "$UNIFIED_TAG"
-          fi
-
-          if git ls-remote --tags origin | grep -q "refs/tags/$UNIFIED_TAG"; then
-            echo "Tag $UNIFIED_TAG exists remotely, deleting..."
-            git push origin ":refs/tags/$UNIFIED_TAG" || true
+          if git rev-parse "$UNIFIED_TAG" >/dev/null 2>&1 ||
+             git ls-remote --exit-code --tags origin "refs/tags/$UNIFIED_TAG" >/dev/null 2>&1; then
+            echo "::error::Release tag $UNIFIED_TAG already exists; refusing to move it."
+            exit 1
           fi
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if git rev-parse "$UNIFIED_TAG" >/dev/null 2>&1; then
echo "Tag $UNIFIED_TAG exists locally, deleting..."
git tag -d "$UNIFIED_TAG"
fi
if git ls-remote --tags origin | grep -q "refs/tags/$UNIFIED_TAG"; then
echo "Tag $UNIFIED_TAG exists remotely, deleting..."
git push origin ":refs/tags/$UNIFIED_TAG" || true
fi
git tag -a "$UNIFIED_TAG" -m "Release v${VERSION} — GitHub Registry ref"
git push origin "$UNIFIED_TAG"
if git rev-parse "$UNIFIED_TAG" >/dev/null 2>&1 ||
git ls-remote --exit-code --tags origin "refs/tags/$UNIFIED_TAG" >/dev/null 2>&1; then
echo "::error::Release tag $UNIFIED_TAG already exists; refusing to move it."
exit 1
fi
git tag -a "$UNIFIED_TAG" -m "Release v${VERSION} — GitHub Registry ref"
git push origin "$UNIFIED_TAG"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/publish-public-npm.yml around lines 311 - 322, Update the
release-tag flow around UNIFIED_TAG to preserve tag immutability: remove the
local and remote deletion logic, check whether the tag already exists remotely,
and fail the workflow before creating or pushing it. Continue creating and
pushing the tag only when it does not already exist.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Intentional design — the delete-and-recreate behavior is needed because our publish workflow can be re-run on failure (e.g. partial npm publish). If the tag were immutable, a retry after a transient failure would require manual tag cleanup before the workflow could succeed. Since the tag always points to the same commit within a single workflow run, consumers installing by tag still get deterministic resolution for any given release.

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.

The PR description image shows a dark terminal running:

npx shadcn add auth0/auth0-ui-components/react/my-account/user-mfa-management#feat/github-registry-hybrid

It installs shadcn@4.13.0, reports successful registry and dependency checks, confirms overwriting button.tsx and utils.ts, and lists “Created 60 files”, including src/components/auth/my-account/user-mfa-management.tsx and multiple MFA-related components.

@harishsundar-okta, thanks for clarifying the retry requirement. I agree that avoiding manual cleanup after a failed release is valuable.

However, a rerun is not necessarily the same workflow run or the same commit: workflow_dispatch may be invoked from a different ref, while retaining the same package version. The current delete-and-recreate flow would then move v${VERSION}, so consumers using that tag could receive different registry content over time.

The finding therefore still applies as an intentional tradeoff rather than an accidental behavior. If mutable tags are the accepted release policy, no change is needed here; documenting that policy near this block would help make the consumer-facing contract explicit.


✏️ Learnings added
Learnt from: harishsundar-okta
Repo: auth0/auth0-ui-components PR: 409
File: .github/workflows/publish-public-npm.yml:311-322
Timestamp: 2026-07-27T10:26:18.285Z
Learning: In `.github/workflows/publish-public-npm.yml`, the unified `v${VERSION}` Git tag is intentionally deleted and recreated to support rerunning a failed public NPM publish workflow without manual tag cleanup. This intentionally trades release-tag immutability for retry convenience.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

Comment thread docs-site/api/r.ts Outdated

return {
name: blockName,
name: `react/${blockName}`,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@harishsundar-okta
The recent generator updates (adding the react/ prefix, framework metadata, and 3.0.1 version bumps) aren't reflected in the checked-in packages/react/registry.json yet.

Before merging, can you:

  • Regenerate and commit the updated catalog.
  • Add a CI drift check that runs the generator and fails if registry.json changes. This will keep the catalog and generator perfectly in sync going forward.
  • Test the release command from a clean consumer project to make sure it works as expected.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done — regenerated registry.json and added a CI drift check that runs the generator and fails if the catalog is stale. Will test the install command from a clean consumer project separately.

@harishsundar-okta
harishsundar-okta merged commit bf4ed46 into main Jul 27, 2026
8 checks passed
@harishsundar-okta
harishsundar-okta deleted the feat/github-registry-hybrid branch July 27, 2026 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants