Admin CI: local-first, GitHub only on the trunk
The admin app (admin/) has its own canonical gate, the same way frontend/
and patient/ do (#2329). Run it before you open a feature PR that touches
admin/ or frontend/packages/:
cd admin
pnpm run ci # the same as bin/ciWhat it runs
| Step | Gate |
|---|---|
pnpm install --frozen-lockfile | Must pass. A stale admin/pnpm-lock.yaml fails here, which is also what fails the Cloudflare Pages build. |
Build the linked @kulcare/* packages | Admin reads their types from each package's dist/. |
pnpm run lint | Must pass (it is clean). |
Typecheck of tsconfig.app.json | Ratcheted to admin/.ci-baselines/typecheck.txt. The count may only go down. |
Typecheck of tsconfig.node.json | Must pass. |
vitest run | Must pass. |
tsc --noEmit against admin/tsconfig.json checks nothing, because that file
has "files": [] and lists only references. The gate names both projects.
The lockfiles must agree with shared packages
Admin's pnpm workspace includes ../frontend/packages/*. When you add a
dependency to a shared package, run pnpm install in admin/ and in
patient/ as well as in frontend/, and commit all three lockfiles. If you
do not, the frozen install fails in both apps.
Package links
The admin install relinks frontend/packages/*/node_modules into admin's own
package store. Frontend tests then load two copies of React and fail with
"Cannot read properties of null (reading 'useRef')". To prevent this,
admin/bin/ci reinstalls frontend/ when it exits, whether it passes or
fails. If you ran a plain pnpm install in admin/, run pnpm install in
frontend/ before the next frontend test run.
The master gate
.github/workflows/admin-ci.yml runs admin/bin/ci on pull requests into
master that change admin/** or frontend/packages/**.