Astro SSR portfolio deployed to Cloudflare Workers.
/
├── messages/
├── public/
├── src/
├── tests/
│ ├── e2e/
│ └── typewriterTiming.test.ts
├── astro.config.mjs
├── playwright.config.ts
└── wrangler.jsonc
Run these from the project root:
| Command | Action |
|---|---|
pnpm install |
Install dependencies |
pnpm dev |
Start the Astro dev server at localhost:4321 |
pnpm build |
Build the Cloudflare Workers SSR output to ./dist/ |
pnpm preview |
Preview the built Worker locally with Wrangler |
pnpm check |
Run Astro checks and vite-plus format/lint checks |
pnpm test |
Run unit tests |
pnpm test:e2e |
Preview the current build and run Playwright E2E tests |
pnpm exec playwright install |
Install Playwright browsers outside the Nix dev shell |
pnpm exec playwright install-deps |
Install OS packages needed by Playwright browsers |
pnpm deploy |
Build and deploy with Wrangler |
The E2E suite uses Playwright against the production-like Wrangler preview. The
Playwright config starts pnpm preview automatically unless PLAYWRIGHT_BASE_URL
is set. Run pnpm build before the first E2E run and after changes that affect
the built output.
The Nix dev shell provides Chromium and configures Playwright to use it:
nix develop
pnpm build
pnpm test:e2eOutside the Nix dev shell, install Playwright's browser bundle first:
pnpm exec playwright install chromium
pnpm build
pnpm test:e2eIf the downloaded Chromium cannot run in the local environment, point Playwright at an existing Chrome-compatible browser:
PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH="$(which google-chrome)" pnpm test:e2e