Excalidraw is a monorepo with a clear separation between the core library and the application:
packages/excalidraw/- Main React component library published to npm as@excalidraw/excalidrawexcalidraw-app/- Full-featured web application (excalidraw.com) that uses the librarypackages/- Core packages:@excalidraw/common,@excalidraw/element,@excalidraw/math,@excalidraw/utilsexamples/- Integration examples (NextJS, browser script)
- Package Development: Work in
packages/*for editor features - App Development: Work in
excalidraw-app/for app-specific features - Testing: Always run
yarn test:updatebefore committing - Type Safety: Use
yarn test:typecheckto verify TypeScript
Run the development server to test changes in real-time and monitor for errors:
# Start the local development server (runs on http://localhost:5173)
yarn startImportant: Run the dev server in the background during implementation to catch runtime errors early. Monitor the console output for:
- TypeScript compilation errors
- React component errors
- Vite HMR (Hot Module Replacement) issues
- Runtime exceptions
To run the server in the background and monitor logs:
# Start server in background and tail logs
yarn start 2>&1 | tee /tmp/excalidraw-dev.log &
# Or simply run in a separate terminal and watch for errors
yarn startWhen errors appear in the console during development:
- Fix TypeScript/compilation errors immediately before proceeding
- Check browser DevTools console for runtime errors
- Vite will auto-reload on file changes - watch for HMR errors
yarn test:typecheck # TypeScript type checking
yarn test:update # Run all tests (with snapshot updates)
yarn fix # Auto-fix formatting and linting issues- Uses Yarn workspaces for monorepo management
- Internal packages use path aliases (see
vitest.config.mts) - Build system uses esbuild for packages, Vite for the app
- TypeScript throughout with strict configuration
- Test Driven Development: I want to follow TDD to implement new features, and make incremental commits.