ci: add minimal CI floor (lint + typecheck + build) - #2
Conversation
Establishes a green baseline so the repo can't silently rot, without
adding a test suite (out of scope for a demo app).
- package.json: add `typecheck` (tsc --noEmit) and `verify`
(lint + typecheck) scripts.
- tsconfig.json: exclude the stale, self-contained `app/` duplicate tree
(it has its own tsconfig + node_modules). Compiling it into the root
program pulled a second copy of @base-ui/react's types into the graph,
producing spurious "not assignable" errors across the shared ui/*
components. Excluding it makes the root typecheck green.
- Fix two real react-hooks/set-state-in-effect lint errors (AppShell,
surface page) by adjusting state during render against a remembered
previous value ("you might not need an effect") — mirrors the fix
already present in the app/ copy.
- .github/workflows/ci.yml: on push/PR, npm ci -> npm run verify ->
npm run build. The build statically prerenders pages that construct a
Supabase browser client, so CI supplies fake, non-secret placeholder
NEXT_PUBLIC_ values so the client can be constructed (no DB needed).
Verified locally: verify exit 0 (lint 0 errors/22 warnings, typecheck 0
errors) and build exit 0 with placeholder env.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
851c352 to
a7a6e2d
Compare
db5e5ef ("dedicated printcraft schema") landed entirely inside the duplicate app/ tree, so none of it reached the tree that CI builds and deploy.sh ships: - Supabase clients queried the default `public` schema; printcraft's tables live in the `printcraft` schema on the shared self-hosted stack, so every query hit nonexistent tables. Schema name is now a single constant. - next.config had no output:"standalone" — scripts/hetzner/deploy.sh aborts with "no standalone output" before it can rsync anything. - next/image still allow-listed the decommissioned managed Supabase host, so every stored image failed to load. - seed-roli-project.ts still pointed at that host and printed a Vercel URL; it also re-hardcoded GUEST_USER_ID instead of importing it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The repo carried two complete copies of the Next.js app: the live tree at the repo root (what CI builds, what deploy.sh ships, what README documents) and a byte-identical stale copy under app/. Nothing referenced app/ — but its mere existence broke the live build: Next resolves the app directory as ./app or ./src/app, preferring ./app. With app/ present it picked that, so every route was emitted one level deep — /src/app/login, /src/app/projects, /src/app/project/[id]/compose. The deployed site served nothing at its real URLs. Post-removal the build emits /login, /projects, /project/[id]/... as intended. Keeping two copies was also how db5e5ef's self-hosted config got stranded (see 169d801) and why 3da51e5's lint fix had to be hand-copied in a7a6e2d. One tree is the source of truth; the duplicate is deleted, and tsconfig no longer needs to exclude it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
The premise in the description, "Root is canonical (README + deploy build from root)", is inverted. 90 of the 101 files this PR removes are under
Merging this would break the next deploy (or ship the stale March tree against a dead Supabase project). The CI floor is re-done correctly in #4, scoped to |
|
Adding the precise mechanism, because the earlier comment's framing ("root is canonical is false") is right in effect but understates why this is dangerous — and the diff genuinely does look like a reasonable consolidation. This branch is not merely deleting production code. It moves The breakage is cross-repo and invisible from inside this PR. The deploy registry lives in a different repository:
So this is not close-or-merge — it's a two-repo change that must land together:
Merging either alone breaks the deploy. Two more facts worth having before anyone sequences this:
Not closing this — the work looks salvageable and is worth landing properly, just not as a single-repo merge. |
|
Closing as superseded. This PR assumed the repo root was the canonical Next.js
Merging this now would reintroduce a superseded assumption into an already |
What
Adds a minimal CI floor so this demo repo can't silently rot — no test suite (out of scope / YAGNI for a demo).
Scripts (
package.json)typecheck:tsc --noEmitverify:lint && typecheckCI (
.github/workflows/ci.yml)On push/PR:
npm ci->npm run verify->npm run build(Node 22, npm cache).Supporting fixes (required to make the floor green)
tsconfig.json— exclude the stale, self-containedapp/duplicate tree (it has its owntsconfig.json+node_modules). Compiling it into the root program pulled a second copy of@base-ui/react's types into the graph, producing spuriousTS2322 "not assignable"errors across the sharedui/*components. Excluding it makes the root typecheck green (0 errors).react-hooks/set-state-in-effectlint errors (AppShell.tsx,surface/page.tsx) fixed by adjusting state during render against a remembered previous value ("you might not need an effect") — mirrors the fix already present in theapp/copy.Build hermeticity
next buildcompiles + typechecks fine with no DB, but statically prerenders pages that construct a Supabase browser client, which throws ifNEXT_PUBLIC_SUPABASE_URL/NEXT_PUBLIC_SUPABASE_ANON_KEYare absent. CI supplies fake, non-secret placeholderNEXT_PUBLIC_values (the anon key is a public client value by design) so the client can be constructed. No live database or real secret is needed.Verified locally
npm run verify-> exit 0 (lint: 0 errors, 22 warnings; typecheck: 0 errors)npm run build(placeholder env) -> exit 0For a human to decide (not addressed here)
app/directory is a ~90-file committed duplicate of the whole app (its ownpackage.json,src/,supabase/,node_modules). Root is canonical (README + deploy build from root). It should probably be deleted; this PR only excludes it from the root compile.<img>vsnext/image) — left non-blocking; not worth churning a demo.ui/*components import@base-ui/react— worth confirming that's the intended package/version before hardening typecheck further.🤖 Generated with Claude Code