Playground Development
The typstyle playground is an interactive web application for trying typstyle formatting in the browser.
Tech Stack
- React 19 + TypeScript + Vite
- TailwindCSS 4.x + DaisyUI for styling
- Monaco Editor with custom Typst language support
- Typstyle WASM for client-side formatting
- pnpm for package management
Quick Start
Prerequisites: Node.js 18+ and pnpm
cd playground
# Development
pnpm install # Install dependencies
pnpm dev # Start development server with hot reload
pnpm preview # Preview production build locally
# Building
pnpm build # Production build
pnpm build:wasm # Build Typstyle WASM module
# Code Quality
pnpm check # Run linter and formatter
Key Components
- WASM Integration: Typstyle compiled to WebAssembly for client-side formatting
- Monaco Editor: Custom Typst language support with TextMate grammar from Tinymist
❗ Important
Rebuild WASM bindings (
pnpm dev:wasm
or pnpm build:wasm
) after changes to typstyle-core
or typstyle-wasm
crates.Development Workflow
- Code changes: Modify TypeScript/React code in
src/
- WASM changes: Rebuild WASM if Rust code changed
- Test: Use
pnpm dev
for development server - Deploy: Build with
pnpm build
and deploydist/
as static site