This page documents the build orchestration, versioning, and release infrastructure for the shadcn/ui monorepo. The system uses Turborepo for parallel build execution, pnpm workspaces for dependency management, Changesets for versioning, and GitHub Actions for automated releases, prereleases, and template validation.
The repository employs two primary GitHub Actions workflows for distributing packages: a stable release workflow for official versions and a prerelease workflow for testing pull requests.
main branch .github/workflows/release.yml12-14changesets/action@v1 manages release versioning and publication .github/workflows/release.yml168-174pnpm build:packages to build all publishable packages (e.g., shadcn, @shadcn/react, @shadcn/helpers) .github/workflows/release.yml155-156.github/changeset-version.js script that executes changeset version followed by pnpm install --lockfile-only to keep the lockfile in sync .github/changeset-version.js1-13Sources: .github/workflows/release.yml120-178 .github/changeset-version.js1-13
release: beta or release: rc .github/workflows/release.yml8-11 .github/workflows/release.yml18latest tag.beta or rc) from the PR label .github/workflows/release.yml27-51.changeset/ .github/workflows/release.yml78-89pnpm exec changeset version --snapshot to generate timestamped versions .github/workflows/release.yml97-99--tag beta) .github/workflows/release.yml105-107prerelease-info.json artifact containing package names and versions .github/workflows/release.yml109-119A separate workflow, prerelease-comment.yml, provides feedback to developers after the release job completes.
Sources: .github/workflows/release.yml17-119 .github/workflows/prerelease-comment.yml1-95
The repository includes an extensive template validation system to ensure that the CLI can correctly scaffold and initialize projects across different frameworks and package managers.
The templates.yml workflow uses a matrix strategy to test combinations of:
next, vite, astro, start, react-router .github/workflows/templates.yml29pnpm (v10 & v11), bun, npm, yarn .github/workflows/templates.yml30-31The workflow builds the CLI (pnpm --filter=shadcn build) and the registry (pnpm --filter=v4 registry:build) .github/workflows/templates.yml88-92 It then executes a bash script that:
templates/ .github/workflows/templates.yml119-122package.json for correct package manager fields and workspace configurations .github/workflows/templates.yml152-194pnpm artifacts (like pnpm-lock.yaml) exist in non-pnpm projects .github/workflows/templates.yml146-147Sources: .github/workflows/templates.yml1-152 templates/next-app/pnpm-workspace.yaml1-8
The CLI includes utilities for managing .env files, ensuring that components requiring environment variables (like AI SDK keys) are configured correctly during installation.
findExistingEnvFile: Locates the appropriate environment file (e.g., .env.local) packages/shadcn/src/utils/env-helpers.ts51-78mergeEnvContent: Merges new variables into existing content without duplicates packages/shadcn/src/utils/env-helpers.ts80-114updateEnvVars: The high-level updater that reads, merges, and writes the environment file packages/shadcn/src/utils/updaters/update-env-vars.ts15-108Sources: packages/shadcn/src/utils/updaters/update-env-vars.ts1-108 packages/shadcn/src/utils/env-helpers.ts1-114
| Task | Workflow / Script | Tooling |
|---|---|---|
| Stable Release | release.yml | Changesets, GPG, pnpm |
| Snapshot Release | release.yml | Changesets Snapshot mode |
| PR Feedback | prerelease-comment.yml | GitHub Script, Sticky Comments |
| Template Testing | templates.yml | Matrix testing, multi-pkg managers |
| Lockfile Sync | changeset-version.js | pnpm install --lockfile-only |
Sources: .github/workflows/release.yml1-178 .github/workflows/templates.yml1-100 .github/changeset-version.js1-13
Refresh this wiki
This wiki was recently refreshed. Please wait 2 days to refresh again.