Contributing workflow
This page is the how-to for changing VexCMS itself. What needs an issue or an accepted idea first, review times, and licensing are in CONTRIBUTING.md.
Set up
Section titled “Set up”You need Node.js 22.18 or later and pnpm 10. corepack enable gives you the pnpm version the
repo pins in package.json.
git clone https://github.com/<you>/vex.gitcd vexgit remote add upstream https://github.com/ianyimi/vex.gitgit fetch upstreampnpm installTurborepo runs the root scripts across the workspace:
| Command | What it does |
|---|---|
pnpm build |
Builds every package and app |
pnpm typecheck |
Typechecks the whole workspace |
pnpm test |
Runs Vitest in every package that has tests |
pnpm lint / pnpm lint:fix |
ESLint over packages/*/src/**/*.{ts,tsx} |
pnpm changeset |
Records a changeset for your change |
apps/www and apps/test need their own Convex deployment to run or build, so pnpm build
fails on them in a fresh clone. Working on packages/* doesn’t need one:
pnpm build --filter='./packages/*' builds just the packages.
One package at a time
Section titled “One package at a time”Packages import each other’s built dist/, so a package’s tests and typecheck need its
dependencies built first. pnpm turbo run builds them for you:
pnpm turbo run test typecheck --filter=@vexcms/reactOnce the dependencies are built, pnpm --filter <package> exec vitest run <path> runs a subset
of tests without rebuilding anything:
pnpm --filter @vexcms/react exec vitest run src/mediaRun the admin panel
Section titled “Run the admin panel”UI changes need a browser check, so you need apps/test running against a Convex deployment of
your own:
- Copy
apps/test/.env.exampletoapps/test/.env.local, then follow the quickstart’s Stand up your deployment from insideapps/test, with port3020. - From the repo root, in two terminals:
pnpm test:dev:vex(regenerates the schema and runsconvex dev) andpnpm test:dev(Next.js onhttp://localhost:3020). - Optionally seed the demo content, from
apps/test:npx convex run seed:init. - Sign up. The first account becomes the admin.
Make the change
Section titled “Make the change”Branch off the upstream dev branch:
git switch -c fix/upload-error-toast upstream/devBranch names are up to you. Keep the diff to the issue you’re fixing.
Check it
Section titled “Check it”Run what CI runs, for the packages you touched:
pnpm turbo run build typecheck test --filter=@vexcms/reactpnpm lintCI also checks import cost and the packed manifests of every published package. On pull
requests from the main repo it also builds apps/test for production and checks its bundle
budget. Fork pull requests get no secrets, so those two steps are skipped there.
- A bug fix comes with a regression test. Run it without your fix and watch it fail, then with your fix and watch it pass. Say so in the pull request.
- A UI change gets a browser check in
apps/testat 375, 390, and 1280 px wide, in light and dark mode. Unit tests run in jsdom, which has no layout: a test that finds amin-h-11class doesn’t prove a tap target is 44 px tall. - Testing and code style covers where tests go and what reviews check.
Add a changeset
Section titled “Add a changeset”A pull request that changes the behavior or types of a published package (anything under
packages/* that users install) needs a changeset. Docs-only and apps/*-only changes don’t.
pnpm changesetPick the packages you changed and patch. Every change is a patch, including breaking ones,
and I set the final version bump when releasing. The summary becomes a line in the package’s
CHANGELOG, so write it for someone upgrading:
---"@vexcms/react": patch---
Show an error toast when a media upload fails, instead of only logging it to the console.For a breaking change, add a Breaking: paragraph that says what changed and a Migration: paragraph that says what to do about it.
Open the pull request
Section titled “Open the pull request”Push your branch to your fork and open the pull request against ianyimi/vex’s dev branch.
GitHub suggests master; change it to dev.
- Title:
type(scope): description, for examplefix(react): show a toast when a media upload fails. ThePR titlecheck runs on every edit. - Description: fill in the template, including
Fixes #123or the link to the accepted idea. - Leave Allow edits by maintainers on.
Path-based area: and adapter: labels are added automatically.
From merge to release
Section titled “From merge to release”- I squash-merge your pull request into
dev. Your title becomes the commit subject and your description its body. - When
devis ready to ship, I merge it intomasterthrough a pull request. That pull request runs CI again, plus theaxeand Lighthouse checks against a Vercel preview. Once it merges, theFixes #123in your commit closes the issue. - The merge to
masterstarts the Release workflow, which opens achore: version packages (alpha)pull request from the queued changesets. - Merging that pull request publishes the packages to npm under the
alphatag.
Repo map
Section titled “Repo map”| Path | What’s there |
|---|---|
packages/core |
Field system, collections, access control, schema and type generation |
packages/react |
The admin panel UI |
packages/next |
The Next.js framework adapter |
packages/cli |
vex: dev, deploy, generate |
packages/better-auth |
The Better Auth integration |
packages/file-storage-convex |
The Convex file-storage adapter |
packages/richtext-plate |
The richtext field’s Plate.js editor |
packages/create-vexcms |
pnpm create vexcms and its templates |
packages/telemetry |
Build-time telemetry shared by vex and create-vexcms (private, not published) |
apps/test |
The admin panel host used for development, on port 3020 |
apps/www |
vexcms.dev, built on VexCMS itself |
apps/docs |
docs.vexcms.dev (Astro + Starlight) |
scripts/ |
Repo-wide checks and sync scripts, run from the root package.json |
Project structure explains how packages, apps, and templates depend on each other.