mirror of
https://github.com/excalidraw/excalidraw.git
synced 2026-12-05 18:55:28 +03:00
* fix: Undeclared dependencies Signed-off-by: Mark Tolmacs <mark@lazycat.hu> * chore: Rationalize package versions Signed-off-by: Mark Tolmacs <mark@lazycat.hu> * chore: Remove old react app remnants Signed-off-by: Mark Tolmacs <mark@lazycat.hu> * feat: Conversion to pnpm Signed-off-by: Mark Tolmacs <mark@lazycat.hu> * fix: Circular deps #0 Signed-off-by: Mark Tolmacs <mark@lazycat.hu> * fix: common package circular dependencies Signed-off-by: Mark Tolmacs <mark@lazycat.hu> * chore: Move history and undo/redo to excalidraw/excalidraw Signed-off-by: Mark Tolmacs <mark@lazycat.hu> * feat: AppState broken up across package boundaries Signed-off-by: Mark Tolmacs <mark@lazycat.hu> * fix: renderElement and binding type racionalization Signed-off-by: Mark Tolmacs <mark@lazycat.hu> * fix: Refactor linearElementEditor to not use types outside the package Signed-off-by: Mark Tolmacs <mark@lazycat.hu> * chore: Do not import self barrel file Signed-off-by: Mark Tolmacs <mark@lazycat.hu> * fix: All circular dependencies except core Signed-off-by: Mark Tolmacs <mark@lazycat.hu> * feat: Bump pnpm to 11 Signed-off-by: Mark Tolmacs <mark@lazycat.hu> * fix: SASS deprecation warnings Signed-off-by: Mark Tolmacs <mark@lazycat.hu> * fix: Polynomial regular expression used on uncontrolled data Signed-off-by: Mark Tolmacs <mark@lazycat.hu> * fix: Vercel deploy Signed-off-by: Mark Tolmacs <mark@lazycat.hu> * feat: excalidraw/history package Signed-off-by: Mark Tolmacs <mark@lazycat.hu> * fix: Polynomial regex in SVG payload decoding Signed-off-by: Mark Tolmacs <mark@lazycat.hu> * fix: emit the internal packages' types from the editor again The editor advertises ./common/*, ./element/*, ./history/*, ./math/* and ./utils/* type subpaths, but without the path aliases tsc treats those packages as external libraries and no longer emits them. Include their sources in the editor's type build, and drop the relative cross-package import that made element/ come out half-emitted. * feat: export the history classes of the editor's API from the entry onIncrement hands out StoreIncrement subclasses and applyDeltas takes StoreDelta, so export them next to CaptureUpdateAction. Hosts then need no dependency of their own on @excalidraw/history. * chore: refuse to publish packages with npm or yarn Only pnpm publish rewrites workspace:* dependencies and applies publishConfig.exports, so a package published with another client can't be installed. --------- Signed-off-by: Mark Tolmacs <mark@lazycat.hu> Co-authored-by: dwelle <5153846+dwelle@users.noreply.github.com>
1.6 KiB
1.6 KiB
CLAUDE.md
Project Structure
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/history,@excalidraw/math,@excalidraw/utilsexamples/- Integration examples (NextJS, browser script)
Development Workflow
- Package Development: Work in
packages/*for editor features - App Development: Work in
excalidraw-app/for app-specific features - Testing: Always run
pnpm test:updatebefore committing - Type Safety: Use
pnpm test:typecheckto verify TypeScript
Development Commands
pnpm test:typecheck # TypeScript type checking
pnpm test:update # Run all tests (with snapshot updates)
pnpm fix # Auto-fix formatting and linting issues
Architecture Notes
Package System
- Uses pnpm workspaces for monorepo management
- Internal packages depend on each other via
workspace:*and resolve to their sources through theexcalidraw-sourceexport condition (enabled in tsconfig, Vite, Vitest and the esbuild scripts);publishConfig.exportsholds the published dist exports - A package can't import itself by name: use relative imports inside a package
- Build system uses esbuild for packages, Vite for the app
- TypeScript throughout with strict configuration