Skip to content

Migrate peterp.org to RedwoodSDK on Cloudflare Workers#24

Draft
peterp wants to merge 25 commits into
masterfrom
kindling/2026-04-16-1508-work-on-github-issue-number-one-fc93
Draft

Migrate peterp.org to RedwoodSDK on Cloudflare Workers#24
peterp wants to merge 25 commits into
masterfrom
kindling/2026-04-16-1508-work-on-github-issue-number-one-fc93

Conversation

@peterp
Copy link
Copy Markdown
Owner

@peterp peterp commented Apr 16, 2026

Context

This PR is scaffolding a new deployment architecture for peterp.org using RedwoodSDK (Vite + React + Cloudflare Workers) to replace the current static HTML setup. This enables future CI/CD, component-driven development, and a path toward dynamic features while keeping the site static-content-only for now.

What's being worked on

  • Scaffolding RedwoodSDK app structure with Vite-based SSR and Cloudflare Workers routing
  • Porting existing content and inline styles into React server components (HomePage, Document)
  • Setting up global CSS, worker routing, HTTP headers, and shared link data
  • Adding GitHub Actions deploy workflow with 15-min timeout
  • Documenting architecture decisions, learnings, and build lifecycle
  • Adding unit/component tests via Vitest (HTTP routing tests deferred)

Key constraints

  • CNAME file untouched — traffic cutover is a separate concern
  • pnpm-only — all scripts use pnpm exec, no npm/npx
  • Client hydration preserved — scaffold-generated src/client.tsx pattern retained verbatim
  • Global CSS via ?url — body-level styles require global file, not CSS Modules

Files

31 files added (no deletions): full stack including wrangler.jsonc, vite.config.mts, pnpm-lock.yaml, tests, docs, and CI workflow.

@peterp
Copy link
Copy Markdown
Owner Author

peterp commented Apr 16, 2026

kindlingtask complete

Phases (7/7)

  • 1. Architecture Blueprint
  • 2. Blueprint Review
  • 3. Implementation
  • 4. Adherence Review
  • 5. Spec Derivation and Test Writing
  • 6. Test Run and Fix
  • 7. Finalization

Completion report

Status: Done

What happened

A static personal homepage was migrated to a RedwoodSDK application on Cloudflare Workers across seven gated phases: architecture blueprint, blueprint review, implementation, adherence review, test writing, test run, and finalization. All gates passed. The pull request was opened during implementation and updated with a finalization summary at close.

What was delivered

  • Full project scaffold with React components, worker entry point, and Cloudflare configuration
  • Continuous deployment pipeline for pushes to main, plus a local workflow validation toolchain
  • Two pre-existing content defects in the original source corrected during migration
  • Twelve behavioral tests passing, covering heading, all links, layout, and tab title
  • Two HTTP routing tests deferred as documented stubs pending a worker-level test harness
  • Architecture blueprint, decisions record, and learnings document committed alongside the code
  • Original homepage file and domain configuration file left untouched throughout

Decisions made

  • Routing tests deferred as explicit stubs rather than skipped, keeping the gap visible for follow-up
  • Content defects corrected during migration rather than left as separate issues
  • Strict boundary enforced from the blueprint phase: no changes to the live site configuration files

Worth noting

  • Open question: The package name for the local workflow validation tool was flagged as unverified against official documentation during blueprint review -- not confirmed as resolved in the report.

Last updated: 2026-04-16T14:17:20.283Z

@peterp peterp changed the title Work on GitHub Issue Number One Migrate peterp.org to RedwoodSDK on Cloudflare Workers Apr 16, 2026
peterp and others added 21 commits April 16, 2026 13:20
Covers all seven sub-issues (#4-#9, #20): project structure after
scaffold, component design for the single HomePage, global CSS styling
strategy for body-level rules, exact content mapping from index.html
including fix for malformed Machinen anchor tag, wrangler.jsonc
configuration, GitHub Actions deploy workflow design, and agent-ci
integration for local workflow validation.

Documents rejected approaches (CSS Modules for body styles, Tailwind,
inline React styles, wrangler.toml format) with rationale. Includes
Gherkin behavioral specs for QA phase covering title, heading, social
links, side projects list, layout constraints, and 404 behavior.
Runs pnpx create-rwsdk v1.1.0 with --force into the repo root.
CNAME (peterp.org) and index.html remain untouched.
Scaffold produces standard rwsdk starter: worker entry point,
Document wrapper, home page, headers middleware, client hydration,
wrangler.jsonc, vite config, and TypeScript config.
Replaces scaffold Welcome component with HomePage containing the full
peterp.org personal site content: bio paragraph, social links (Twitter,
GitHub), and Side Projects ordered list (RedwoodJS, Machinen, Blackspace,
Billable).

Fixes two issues from the original HTML:
- Corrects malformed Machinen anchor (<a></a><i>Machinen</i></a>)
- Replaces invalid &dash; entity with Unicode en dash {" – "}

Removes scaffold welcome.tsx and welcome.module.css (not needed).
Updates package.json scripts to use pnpm run instead of npm run internally.
Creates src/app/styles.css with the three body-level declarations from the
original index.html (max-width: 480px, line-height: 1.6, padding: 20px).

Updates Document component to:
- Import styles via Vite ?url suffix (resolves to content-hashed asset URL)
- Set page title to "Peter Pistorius"
- Add <link rel="stylesheet"> in <head>
- Retain scaffold hydration script unchanged
Sets worker name to peterp-org (was __change_me__ scaffold placeholder).
All other fields remain as scaffolded: main=src/worker.tsx,
compatibility_date=2025-08-21, nodejs_compat flag, ASSETS binding,
observability enabled. No routes or custom_domains configured —
traffic cutover to Workers is deferred to issue #2.
Deploys to Cloudflare Workers on push to main.
Pipeline: checkout → pnpm setup → Node 20 → pnpm install --frozen-lockfile
→ pnpm run build → pnpm exec wrangler deploy.

Uses pnpm/action-setup@v4 and pnpm exec (not npx) for consistent pnpm-only
execution. Requires CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID as
GitHub repository secrets (documented in workflow header comment).
Installs @redwoodjs/agent-ci@0.10.7 as a dev dependency.
Package name verified against https://agent-ci.dev installation docs.

Adds "agent-ci" convenience script to package.json so
`pnpm agent-ci run --all --quiet` works without full path.

Adds .env.agent-ci to .gitignore to prevent local Cloudflare
credentials from being committed when using agent-ci for local
workflow runs.
Installs vitest + @testing-library/react + happy-dom as dev dependencies
and wires a "test" script (pnpm test).

Test coverage maps directly to the blueprint's observable-contract scenarios:

- home.test.tsx: 8 tests — main heading, Twitter/GitHub social links (text +
  href), Side Projects heading, all four project links (RedwoodJS, Machinen,
  Blackspace, Billable) with correct destinations
- layout.test.ts: 3 tests — max-width 480px, line-height 1.6, padding 20px
  verified against the deployed stylesheet source
- document.test.tsx: 1 test — page title "Peter Pistorius" via server render
- routing.test.ts: 2 it.todo stubs — HTTP 200/404 routing behavior noted as
  requiring a worker-aware test pool (e.g. @cloudflare/vitest-pool-workers)

All 12 runnable tests pass; 2 routing todos document the E2E gap.
Learnings: scaffold --force behavior, wrangler.jsonc format choice, global
CSS with ?url import pattern, client hydration script retention, pnpm exec
usage, agent-ci package name verification, HTTP test infrastructure gap.

Decisions: rationale for global CSS over modules, wrangler.jsonc format
retention, single HomePage server component, deferred HTTP routing tests,
pnpm-exclusive package management, CNAME boundary respect.

Both files use 2026-04-16 date prefix per project conventions.
@peterp peterp changed the title Migrate peterp.org to RedwoodSDK on Cloudflare Workers Verify local dev environment boots cleanly Apr 16, 2026
@peterp peterp changed the title Verify local dev environment boots cleanly Migrate peterp.org to RedwoodSDK on Cloudflare Workers Apr 16, 2026
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