package.json uses npm workspaces to delegate workspace-specific scripts.
Development servers
Start all dev servers
concurrently --kill-others. Either server exiting kills the other.
Start with Storybook
Start Storybook alone
Preview production SSR build
wrangler pages dev on port 4321. This simulates the Cloudflare Pages SSR environment locally, including Cloudflare bindings (D1 database, KV, Durable Objects).
The preview command requires Wrangler to be installed and authenticated. Run
npx wrangler login if you haven’t already.Build commands
Production build
astro-app/dist/. Tailwind CSS is purged, and all Sanity content is baked into the output.
Deploy build to Cloudflare
astro build && wrangler pages deploy dist/. Requires Wrangler authentication and appropriate Cloudflare Pages permissions.
Deploy Sanity Studio
https://ywcccapstone.sanity.studio).
Testing
Run all tests
Unit tests (Vitest)
astro-app/src/**/*.test.ts and cover utilities, GROQ query helpers, mock data, and DOM scripts. Vitest uses jsdom for browser-like test execution.
E2E tests (Playwright)
tests/ and run across 5 device configurations. axe-core accessibility checks are included in every E2E run.
E2E tests build the Astro app before running. The first run will be slower — subsequent runs reuse the cached build if no source files have changed.
Integration tests
Integration tests use Playwright without a browser. Run them directly with:Code quality
TypeScript check
astro check to type-check all .astro, .ts, and .tsx files.
Generate Sanity types
sanity typegen generate in the studio workspace to regenerate TypeScript types from the Sanity schema and GROQ queries. Run this after modifying any schema file or GROQ projection.
Command reference
The full list of scripts from the rootpackage.json: