[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
|
|
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. |
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>
d9333da to
bc6817b
Compare
Issue
No Linear ticket linked - this work wasn't tracked against a ticket.
Overview
This adds maintainer tooling for publishing
@agents-uiregistry updates into downstream repos and hardens the flow so generated PRs are based on the latest downstreammain, formatted with repo-local dependencies installed, and reviewed before anything is pushed.Summary of changes
publish-agent-starter-react.ts,publish-livekit-web.ts, andpublish-downstream.tsto clone downstream repos, apply the freshly built registry, and open PRsorigin/mainand creates its publish branch from that fetched refpnpm formatbefore diff detection/commit/PR creationoxfmtare availableregistry:*scripts toshadcn:*, addspnpm shadcn:publish:all, and wires the Turbo task as uncached/interactiveupdate.tswithfsAPIs and refuses unsafe registry clean targetspackages/shadcntests and Storybook devTesting
pnpm --filter @livekit/agents-ui formatnode --experimental-strip-types -e "import('./packages/shadcn/scripts/publish-downstream.ts').then(()=>console.log('ok'))"pnpm --filter @livekit/agents-ui testpnpm --filter @livekit/agents-ui exec tsc --noEmit --pretty falseno longer reports the new script.tsimport 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.