Skip to content

Phase 0: scaffold — Next.js on Node and Cloudflare, SQLite on D1 and libsql - #1

Merged
erikgoins merged 5 commits into
mainfrom
feature/scaffold
Oct 15, 2026
Merged

erikgoins merged 5 commits into
mainfrom
feature/scaffold

Conversation

@erikgoins

Copy link
Copy Markdown
Contributor

What

Phase 0 from docs/spec.md. The stack every later phase builds on:

  • pnpm monorepo: apps/web (Next.js), packages/core, packages/db.
  • One async Db type over D1 (Workers) and libsql (Node). batch() is the only atomic write (decision 016).
  • Build-time driver split: the Worker bundle gets only the D1 runtime.
  • GET /api/v1/health proves a DB round trip and reports the driver.
  • Vitest (DB contract on both drivers), Playwright, scripts/smoke.sh (both runtimes end to end + Worker bundle scan), CI.
  • AGPL-3.0-only license, README, decision 016, feature doc docs/features/scaffold.md.

Verification

The full CI sequence passes in a fresh local clone: install, lint, typecheck, 9 unit tests, 2 E2E tests, smoke (Node → sqlite, Worker → d1). Each guard in the smoke script was proven to fail.

Known pins

Next 16.3.8 + OpenNext 1.20.11: newer releases are under pnpm's one-day minimumReleaseAge, and OpenNext 1.20.11 fails on Next 16.4. Upgrade is a chore in docs/STATE.md.

🤖 Generated with Claude Code

https://claude.ai/code/session_01GnDXTQ6MVbAXETYsq6fvqg

erikgoins and others added 5 commits October 15, 2026 18:29
Spike step 2 of Phase 0: Next.js 16.4.1 renders under
`opennextjs-cloudflare preview` (workerd) with HTTP 200.
cacheComponents is off because it hangs requests under workerd.
Next 16.4.2 is pinned down to 16.4.1: pnpm 12's minimumReleaseAge
policy rejects packages published in the last day.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GnDXTQ6MVbAXETYsq6fvqg
packages/db exposes one async Db type over D1 (Workers) and libsql
(Node). The Worker bundle gets only the D1 runtime via a turbopack
alias keyed on GITWORK_TARGET. /api/v1/health proves a DB round trip
on both runtimes; scripts/smoke.sh checks both end to end and fails if
libsql code reaches the Worker bundle.

Pins Next 16.3.8 + OpenNext 1.20.11: newer releases are under pnpm's
one-day minimumReleaseAge policy, and 1.20.11 does not run Next 16.4.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GnDXTQ6MVbAXETYsq6fvqg
Playwright smoke test against the Node runtime, a CI workflow that
runs lint, typecheck, unit tests (both DB drivers), E2E, and the
dual-runtime smoke script. AGPL-3.0 license, README, .env.example,
real commands in CLAUDE.md. Phase 0 feature doc replaces the WIP doc.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GnDXTQ6MVbAXETYsq6fvqg
smoke.sh refuses to run when its ports are busy and stops servers by
process group. The bundle scan moves to scan-worker-bundle.sh; both of
its checks and the port guard were proven to fail. Decision 016 records
libsql, batch-only atomic writes, and the build-time driver split.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GnDXTQ6MVbAXETYsq6fvqg
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GnDXTQ6MVbAXETYsq6fvqg
@erikgoins
erikgoins merged commit 64f2cc4 into main Oct 15, 2026
1 check passed
@erikgoins
erikgoins deleted the feature/scaffold branch October 15, 2026 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant