Skip to main content
All commands below are run from the repository root unless otherwise noted. The root package.json uses npm workspaces to delegate workspace-specific scripts.

Development servers

Start all dev servers

Starts the Astro app and Sanity Studio concurrently using concurrently --kill-others. Either server exiting kills the other.

Start with Storybook

Starts all three servers concurrently: Astro app, Sanity Studio, and Storybook.
Use dev:storybook when working on new UI components or block variants. Storybook provides hot reload and isolated rendering without needing a Sanity connection.

Start Storybook alone

Launches only Storybook on port 6006. Useful when you only need to work on components without running the full stack.

Preview production SSR build

Builds the Astro app and serves it via 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

Builds the Astro app for production as static HTML into astro-app/dist/. Tailwind CSS is purged, and all Sanity content is baked into the output.

Deploy build to Cloudflare

Runs astro build && wrangler pages deploy dist/. Requires Wrangler authentication and appropriate Cloudflare Pages permissions.

Deploy Sanity Studio

Deploys the Studio to Sanity’s hosted URL (e.g., https://ywcccapstone.sanity.studio).

Testing

Run all tests

Runs Vitest unit tests followed by Playwright E2E tests. The E2E suite builds the Astro app first.

Unit tests (Vitest)

Unit tests live in 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)

Playwright tests live in 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:
They validate schema imports, block registry conventions, and module resolution — no network or browser launch required.

Code quality

TypeScript check

Runs astro check to type-check all .astro, .ts, and .tsx files.

Generate Sanity types

Runs 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 root package.json:

Port assignments