Development
Run the tablecn monorepo locally.
Project structure
The docs site lives in the same monorepo as the packages:
tablecn/
├── apps/web/ # this site (Next.js + Fumadocs)
│ ├── content/docs/ # MDX docs pages
│ ├── registry/{radix,base,aria} # table and filter UI, one folder per primitive library
│ ├── registry.json # shadcn registry definition
│ └── public/r/ # built registry
└── packages/
├── filter-core/ # @querycn/filter-core
├── filter-react/ # @querycn/filter-react
├── filter-next/ # @querycn/filter-next
├── table-react/ # @querycn/table-react
└── ui/ # shared shadcn/ui components for this siteRequirements
- Node.js 20.6 or later
- pnpm 10 (the repo pins it in
packageManager)
Install dependencies
pnpm installStart the dev server
pnpm devOpen http://localhost:3000 for the app and /docs for the documentation. pnpm dev builds the shadcn registry into apps/web/public/r first.
Checks
Run these from the repository root:
pnpm typecheck
pnpm lint
pnpm testRegistry
The table and filter UI live in apps/web/registry/{radix,base,aria}/{table,filter}, described once in apps/web/registry.json. Rebuild the registry after changing either:
pnpm registry:buildThis writes apps/web/public/r/{radix,base,aria}/*.json: one JSON file per block and primitive library, each holding the component sources and their dependencies. Next.js serves them at /r/<base>/<name>.json, and at /r/{style}/<name>.json for the @tablecn namespace, which is what npx shadcn add downloads.
The folder is committed, so the registry can also be read straight from GitHub. After changing a registry component, run pnpm --filter web registry:build and commit public/r with it; CI fails when it's out of date. pnpm dev and pnpm build rebuild it too.
Releases
- For a change to a package, add a changeset:
pnpm changeset. The Release workflow keeps a Version Packages pull request open; merging it publishes to npm. - When a block starts using a new package version, raise that package's range in
apps/web/registry.json(on 0.x,^0.3.0doesn't accept0.4.0), and rebuild the registry. - Add what users will notice to the Changelog: what's new, changed or fixed, and what to do when updating. Changes to the blocks belong there too, even without a package release.
- pnpm installs a version only a day after it's published. When a block needs a new package version, publish the packages first and push the block changes a day later, or pnpm users can't add the block until then.
Build for production
pnpm build