Playground Development
The typstyle playground is an interactive web application for trying typstyle formatting in the browser.
- 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
Prerequisites: Node.js 18+ and pnpm
cd playground# Developmentpnpm install # Install dependenciespnpm dev # Start development server with hot reloadpnpm preview # Preview production build locally# Buildingpnpm build # Production buildpnpm build:wasm # Build Typstyle WASM module# Code Qualitypnpm check # Run linter and formatter
cd playground# Developmentpnpm install # Install dependenciespnpm dev # Start development server with hot reloadpnpm preview # Preview production build locally# Buildingpnpm build # Production buildpnpm build:wasm # Build Typstyle WASM module# Code Qualitypnpm check # Run linter and formatter
- 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:wasmpnpm dev:wasm or pnpm build:wasmpnpm build:wasm) after changes to typstyle-coretypstyle-core or typstyle-wasmtypstyle-wasm crates.- Code changes: Modify TypeScript/React code in
src/src/ - WASM changes: Rebuild WASM if Rust code changed
- Test: Use
pnpm devpnpm devfor development server - Deploy: Build with
pnpm buildpnpm buildand deploydist/dist/as static site