Skip to content
Strata

Scripts

Every pnpm script in package.json, grouped by purpose.

Development#

Script Description
pnpm dev Astro dev server on http://localhost:4321 (Node runtime)
pnpm dev:cloudflare Dev server inside workerd; requires a local libSQL server
pnpm start Runs the built Node server (dist/server/entry.mjs)
pnpm preview Astro preview of the last build

Build#

Script Description
pnpm build Builds for the auto-detected target (Node by default)
pnpm build:node · build:vercel · build:netlify · build:cloudflare Builds for a specific target
pnpm clean Removes build output and caches

Quality#

Script Description
pnpm check astro check: TypeScript and Astro diagnostics
pnpm lint / pnpm lint:fix ESLint
pnpm format / pnpm format:check Prettier
pnpm test / test:watch / test:coverage Vitest
pnpm test:e2e / test:e2e:ui / test:a11y Playwright (build with build:node first)
pnpm lhci Lighthouse CI against the Node build

Database and auth#

Script Description
pnpm db:generate Create a migration from schema changes
pnpm db:migrate Apply migrations (in production the Migrate database workflow runs this from GitHub Actions)
pnpm db:push Push schema without a migration (prototyping)
pnpm db:studio Drizzle Studio
pnpm db:seed Create demo accounts (demo@example.com, admin@example.com)
pnpm db:reset Delete the local database and re-migrate
pnpm db:prune Delete archived messages past CONTACT_RETENTION_DAYS, any message past CONTACT_MAX_AGE_DAYS (when set) and expired throttle counters
pnpm admin:promote Grant (or --revoke) the admin role for an existing account; revoking the last admin needs --force
pnpm auth:generate Regenerate src/db/schema/auth.ts from the Better Auth config

Releases#

Script Description
pnpm changeset Add a changeset describing a change
pnpm changeset:version Apply changesets: bump version and update CHANGELOG.md
pnpm changeset:tag Create Git tags for the current version

Utilities#

Script Description
node scripts/generate-icons.ts Regenerate PNG icons from public/favicon.svg
node scripts/migrate.ts Apply migrations without dev dependencies (used by the Docker image)