Skip to content

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

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

[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

@thomasyuill-livekit thomasyuill-livekit commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Issue

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

Overview

This adds maintainer tooling for publishing @agents-ui registry updates into downstream repos and hardens the flow so generated PRs are based on the latest downstream main, formatted with repo-local dependencies installed, and reviewed before anything is pushed.

Summary of changes

Area Change
Downstream publish scripts Adds publish-agent-starter-react.ts, publish-livekit-web.ts, and publish-downstream.ts to clone downstream repos, apply the freshly built registry, and open PRs
Latest downstream base Each downstream clone explicitly fetches the latest origin/main and creates its publish branch from that fetched ref
Formatting before PRs Generated downstream changes run pnpm format before diff detection/commit/PR creation
Dependency install before format Fresh downstream clones install dependencies before formatting so repo-local binaries like oxfmt are available
Confirmation gate Before pushing/opening a PR, the script prints repo, branch, title, body, and diff stat, then requires confirmation
Publish robustness Adds cleanup/interrupt handling and avoids committing/pushing when no downstream diff is produced
Script rename and entry points Renames registry:* scripts to shadcn:*, adds pnpm shadcn:publish:all, and wires the Turbo task as uncached/interactive
Safer deploy copy Replaces shell copy/clean commands in update.ts with fs APIs and refuses unsafe registry clean targets
Build hooks Adds dependency-build hooks for packages/shadcn tests and Storybook dev

Testing

  • pnpm --filter @livekit/agents-ui format
  • node --experimental-strip-types -e "import('./packages/shadcn/scripts/publish-downstream.ts').then(()=>console.log('ok'))"
  • pnpm --filter @livekit/agents-ui test
  • pnpm --filter @livekit/agents-ui exec tsc --noEmit --pretty false no longer reports the new script .ts import errors; it still reports pre-existing registry component/template type errors.

I did not run the actual publish scripts because they can push branches and open PRs.

@changeset-bot

changeset-bot Bot commented Jul 23, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: bc6817b

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 29, 2026 6: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.

thomasyuill-livekit and others added 3 commits July 29, 2026 14:09
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>
- 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