Skip to content

[WIP] feat(shadcn): add downstream registry publish scripts#1398

Draft
thomasyuill-livekit wants to merge 3 commits into
mainfrom
ty/shadcn-package-update-script
Draft

[WIP] feat(shadcn): add downstream registry publish scripts#1398
thomasyuill-livekit wants to merge 3 commits into
mainfrom
ty/shadcn-package-update-script

Conversation

@thomasyuill-livekit

Copy link
Copy Markdown
Contributor

Issue

No Linear ticket linked — this work wasn't tracked against a ticket.

Overview

Publishing a registry update to livekit-examples/agent-starter-react or livekit/web was a fully manual process (clone, hand-edit config, run installs, hand-craft a PR). This adds maintainer scripts that automate the whole flow end-to-end, with a confirmation gate before anything is pushed publicly.

Summary of changes

Area Change
New publish scripts publish-agent-starter-react.ts, publish-livekit-web.ts, publish-downstream.ts — clone each downstream repo into a tmp dir, point it at a freshly built local registry, run the existing install/update mechanism, and open a PR
Confirmation gate Before any PR is opened, prints repo, branch, title, body, and git diff --stat, then requires a y/N answer — declining skips the commit/push/PR entirely
Script renames registry:*shadcn:* for consistency (registry:updateshadcn:deploy, to avoid colliding with the existing shadcn:update)
Dependency-build hooks build:deps + pretest (packages/shadcn) and build:deps + predev (docs/storybook) so workspace deps are always built before tests or pnpm dev:storybook
Safer update.ts Replaced shell execSync calls with fs APIs, plus a guard that refuses to clean an unsafe DEST_REGISTRY_PATH
Root entry point pnpm shadcn:publish:all at the repo root, wired through turbo (cache: false so it's never skipped)

Testing

This PR only touches maintainer tooling/scripts (no app or UI code), so there's no Vercel preview relevant to it. Verified locally instead:

  • pnpm test in packages/shadcn passes (22/22 files) after wiping packages/react/packages/core dist/ to confirm pretest rebuilds them
  • pnpm run predev in docs/storybook rebuilds deps without triggering a full storybook build
  • turbo run shadcn:publish:all --filter=@livekit/agents-ui... --dry-run resolves to the correct command
  • Smoke-tested the confirm/commit/push logic against a scratch local git repo + bare remote: declining (n) leaves the working tree untouched; confirming (y) commits and pushes correctly
  • eslint, prettier, and tsc --noEmit --strict all pass on the new/changed scripts

Adds maintainer scripts to sync the @agents-ui shadcn registry into
livekit-examples/agent-starter-react and livekit/web via PRs, so a
registry rebuild doesn't require manually cloning, branching, and
opening PRs against both downstream repos by hand.

- publish-agent-starter-react.ts / publish-livekit-web.ts / publish-downstream.ts:
  clone each repo into a tmp dir, point it at a freshly built local
  registry, run the existing install/update mechanism, and open a PR
  only after the user confirms a printed summary (repo, branch, title,
  body, diffstat) with a y/n prompt
- Rename registry:* package scripts to shadcn:* for consistency
  (registry:update -> shadcn:deploy, to avoid colliding with the
  existing shadcn:update script)
- Add build:deps/pretest (packages/shadcn) and build:deps/predev
  (docs/storybook) hooks so workspace dependencies are always built
  before tests or the storybook dev server run
- Harden scripts/update.ts to use fs APIs instead of shelling out, and
  guard against cleaning an unsafe DEST_REGISTRY_PATH
- Add a root-level pnpm shadcn:publish:all script wired through turbo

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Jul 23, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: d832012

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

@vercel

vercel Bot commented Jul 23, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
components-js-storybook-5kld Ready Ready Preview, Comment Jul 24, 2026 8:10pm

Request Review

@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size
LiveKitRoom only 7.89 KB (0%)
LiveKitRoom with VideoConference 32.52 KB (0%)
All exports 44.13 KB (0%)

@1egoman 1egoman 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.

High level this makes sense, but I wonder if it would be better for these types of scripts to be run in ci rather than manually? From my understanding of reading this, if that was done, then it looks like it would be a fairly changesets like process where a pull request would get created and somebody would approve it before the deployment would happen.

Maybe there's a reason why this has to happen manually though, idk.

@thomasyuill-livekit thomasyuill-livekit changed the title feat(shadcn): add downstream registry publish scripts [WIP] feat(shadcn): add downstream registry publish scripts Jul 24, 2026
@thomasyuill-livekit

thomasyuill-livekit commented Jul 24, 2026

Copy link
Copy Markdown
Contributor Author

High level this makes sense, but I wonder if it would be better for these types of scripts to be run in ci rather than manually? From my understanding of reading this, if that was done, then it looks like it would be a fairly changesets like process where a pull request would get created and somebody would approve it before the deployment would happen.

Maybe there's a reason why this has to happen manually though, idk.

That's a great call-out and where we should move towards.

This was a first attempt to automate the process for myself, so I could test and iron out the kinks
I think once I feel confident that this works reliably we can move this into CI

Still working on this tho.
I'll let you know when I get this in a stable/reliable.

- Mark the root shadcn:publish:all turbo task interactive so stdin is
  forwarded to the confirmation prompt (turbo disconnects stdin by
  default, which previously made the prompt hang indefinitely)
- Drop the unused --env-file=.env.local flag from shadcn:doc-gen —
  doc-gen.ts never reads process.env, but the flag made Node hard-fail
  whenever .env.local didn't exist, breaking shadcn:build for
  publish-agent-starter-react.ts
- Add an onInterrupt helper that registers SIGINT/SIGTERM handlers so
  Ctrl-C during the confirmation prompt still restores .env.local,
  kills the local registry server, and removes the tmp clone, instead
  of leaking state past the bypassed finally block

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.

2 participants