Migrate peterp.org to RedwoodSDK on Cloudflare Workers#24
Draft
peterp wants to merge 25 commits into
Draft
Conversation
Owner
Author
|
kindling — task complete Phases (7/7)
Completion reportStatus: Done What happenedA 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
Decisions made
Worth noting
Last updated: 2026-04-16T14:17:20.283Z |
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 ‐ 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
HomePage,Document)Key constraints
pnpm exec, no npm/npxsrc/client.tsxpattern retained verbatim?url— body-level styles require global file, not CSS ModulesFiles
31 files added (no deletions): full stack including
wrangler.jsonc,vite.config.mts,pnpm-lock.yaml, tests, docs, and CI workflow.