Skip to main content

Run Locally

This guide walks through running the @toastwrite/editor demo app from the toastwrite/editor monorepo on your machine.

1. Clone and install

Make sure you have met the Prerequisites, then:

git clone https://github.com/toastwrite/editor.git
cd editor
pnpm install

2. Build packages

Build all workspace packages before starting the demo:

pnpm build

This compiles @toastwrite/parser, @toastwrite/editor, and the demo app via Turborepo.

3. Start the demo

pnpm dev

Open http://localhost:5454 in your browser. The demo page includes:

  • An Editor instance with vertical split preview, toolbar, and scroll sync
  • A Viewer instance that updates when the editor content changes

The demo source lives in apps/demo/src/main.ts and uses sample Markdown from apps/demo/src/demo-markdown.ts.

Useful scripts

CommandDescription
pnpm buildBuild all packages
pnpm devStart the demo dev server (port 5454)
pnpm test:ciRun all tests
pnpm lintRun ESLint
pnpm typecheckType-check all packages

Per-package commands

pnpm --filter @toastwrite/editor test
pnpm --filter @toastwrite/parser test:ci
pnpm --filter @toastwrite/demo dev

Troubleshooting

Port already in use

The demo Vite server defaults to port 5454. Change it in apps/demo/vite.config.ts if needed.

Build errors after pulling

Run a clean install and rebuild:

pnpm install
pnpm build

Node version mismatch

The repo requires Node 22+. Use nvm or fnm to switch versions.

Next step

When you are ready to use the editor in your own project, see Installation.