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
# 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
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
- 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
pnpm dev:wasm
or pnpm build:wasm
pnpm build:wasm
) after changes to typstyle-core
typstyle-core
or typstyle-wasm
typstyle-wasm
crates.- Code changes: Modify TypeScript/React code in
src/
src/
- WASM changes: Rebuild WASM if Rust code changed
- Test: Use
pnpm dev
pnpm dev
for development server - Deploy: Build with
pnpm build
pnpm build
and deploydist/
dist/
as static site