Wasp is a full-stack web framework that compiles TypeScript config (main.wasp.ts) files into React + Node.js applications. The compiler is written in Haskell.
waspc/— Haskell compiler, CLI, and LSP server (the core of Wasp)src/— Main compiler library (Analyzer, Generator, AppSpec, Psl)cli/src/— CLI commands (start, build, new, deploy, etc.)data/packages/— TypeScript packages called by the CLI when compiling projects as FFIdata/Generator/libs/— TypeScript libraries embedded into generated project codedata/Generator/templates/— Mustache templates for code generatione2e-tests/— Golden file snapshot testsrun— Main development script (run./runwith no args to see all commands)
wasp-app-runner/— Node.js CLI for running Wasp apps in e2e testsweb/— Documentation website (Docusaurus), deployed to wasp.shexamples/— Tutorial and example apps (kitchen-sink, waspello, etc.)scripts/— Monorepo-level build/packaging scripts
All waspc development commands run from the waspc/ directory via the ./run script. Run ./run with no arguments to see the full list of available commands (build, test, format, lint, etc.).
Key things to know:
- Two-phase build: TS packages in
data/packages/and libs indata/Generator/libs/compile first, then Haskell (which embeds them). Use./run buildfor the full build. - Run the dev CLI with
./run wasp-cli <args>. - Toolchain versions are specified in
mise.toml.
- Simple, readable Haskell — no complicated features. See
CONTRIBUTING.md. - Default extensions are listed in
waspc/waspc.cabal. - CamelCase for types/modules, camelCase for functions/values.
- Qualified imports preferred.
- Formatting: Ormolu (
./run check:ormolu/./run format:ormolu). Linting: HLint (./run hlint, config inwaspc/.hlint.yaml). - Tests use
tasty+hspec+QuickCheck, mirroring source module paths with aTestsuffix.
- Prettier-formatted (config in
prettier.config.mjs). Check/fix with./run check:prettier/./run format:prettier. - camelCase for files/functions, PascalCase for components/types.
- TypeScript config (
main.wasp.ts) is read byWasp.Project.WaspFile.TypeScript→ AppSpec (IR) → Generator produces React/Node.js code. The Analyzer derives entity declarations from the Prisma schema. - Code generation uses a file draft system and Mustache templates in
data/Generator/templates/.
- E2E snapshots (
waspc/e2e-tests/test-outputs/snapshots/) must never be manually edited. Regenerate them by runningcd waspc && ./run build && ./run test:waspc:e2e:accept-all. - Documentation: Only edit
web/docs/(the latest version). Do not modifyweb/versioned_docs/— those are auto-generated snapshots of previous versions. - Markdown snapshots (
web/markdown-snapshots/) must never be manually edited. After changing docs, blog, or resources content (or the LLM files plugin), regenerate them by runningcd web && npm run build-dev && npm run markdown-snapshots:update, then review the diff before committing. CI checks them withnpm run markdown-snapshots:check. - Pull requests: Always use the repo's
PULL_REQUEST_TEMPLATE.md. Never delete any checkbox from the template — leave irrelevant ones unchecked.