[WIP] feat(shadcn): add downstream registry publish scripts#1398
[WIP] feat(shadcn): add downstream registry publish scripts#1398thomasyuill-livekit wants to merge 3 commits into
Conversation
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>
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
size-limit report 📦
|
1egoman
left a comment
There was a problem hiding this comment.
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 Still working on this tho. |
- 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>
Issue
No Linear ticket linked — this work wasn't tracked against a ticket.
Overview
Publishing a registry update to
livekit-examples/agent-starter-reactorlivekit/webwas 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
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 PRgit diff --stat, then requires ay/Nanswer — declining skips the commit/push/PR entirelyregistry:*→shadcn:*for consistency (registry:update→shadcn:deploy, to avoid colliding with the existingshadcn:update)build:deps+pretest(packages/shadcn) andbuild:deps+predev(docs/storybook) so workspace deps are always built before tests orpnpm dev:storybookupdate.tsexecSynccalls withfsAPIs, plus a guard that refuses to clean an unsafeDEST_REGISTRY_PATHpnpm shadcn:publish:allat the repo root, wired throughturbo(cache: falseso 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 testinpackages/shadcnpasses (22/22 files) after wipingpackages/react/packages/coredist/to confirmpretestrebuilds thempnpm run predevindocs/storybookrebuilds deps without triggering a fullstorybook buildturbo run shadcn:publish:all --filter=@livekit/agents-ui... --dry-runresolves to the correct commandn) leaves the working tree untouched; confirming (y) commits and pushes correctlyeslint,prettier, andtsc --noEmit --strictall pass on the new/changed scripts