1515# Start development server (runs both dev app and library watch)
1616yarn start
1717
18- # Run tests
18+ # Run all tests
1919yarn test
2020
21+ # Run tests in watch mode
22+ yarn test:watch
23+
24+ # Run a single test file
25+ yarn test packages/perfect-freehand/src/test/getStroke.spec.ts
26+
27+ # Run benchmarks
28+ yarn bench
29+
2130# Build the library
2231yarn build:packages
2332
@@ -39,7 +48,7 @@ cd packages/perfect-freehand && yarn docs
3948This is a ** yarn workspaces monorepo** with two packages:
4049
4150- ` packages/perfect-freehand/ ` - The published npm library
42- - ` packages/dev/ ` - Development/example React app
51+ - ` packages/dev/ ` - Development/example React app (Vite, runs on port 5420)
4352
4453### Library Core (` packages/perfect-freehand/src/ ` )
4554
@@ -66,78 +75,10 @@ The `StrokeOptions` interface controls stroke appearance:
6675- ` simulatePressure ` - Auto-calculate pressure from velocity
6776- ` start ` /` end ` - Tapering and cap options
6877
69- ## Current Tooling & Configuration
70-
71- ### Configuration Files
72-
73- | File | Purpose |
74- | ----------------------------------------------- | ------------------------------------------------- |
75- | ` tsconfig.base.json ` | Shared TypeScript config (extended by packages) |
76- | ` tsconfig.json ` | Root TypeScript config |
77- | ` eslint.config.mjs ` | ESLint configuration (flat config format) |
78- | ` lazy.config.js ` | lazyrepo task orchestration config |
79- | ` vitest.config.ts ` | Vitest test runner configuration |
80- | ` packages/perfect-freehand/rolldown.config.mjs ` | Rolldown bundler config for library |
81- | ` packages/perfect-freehand/typedoc.json ` | TypeDoc API documentation config |
82- | ` packages/dev/vite.config.ts ` | Vite config for dev app |
83- | ` .prettierrc ` | Prettier formatting configuration |
84- | ` .prettierignore ` | Files/directories to exclude from Prettier |
85- | ` .editorconfig ` | Editor settings for consistent formatting |
86- | ` .nvmrc ` | Pins Node.js version (20.x LTS) |
87- | ` package.json ` | Workspace definitions, scripts, and engines field |
88- | ` .github/workflows/main.yml ` | CI pipeline (audit, build, test on Node 18/20/22) |
89- | ` .github/workflows/publish.yml ` | Automated npm publish on GitHub release |
90- | ` .github/dependabot.yml ` | Automated dependency updates via Dependabot |
91- | ` .husky/pre-commit ` | Git pre-commit hook (runs lint-staged) |
92- | ` .husky/pre-push ` | Git pre-push hook (runs tests) |
93- | ` .husky/commit-msg ` | Git commit-msg hook (runs commitlint) |
94- | ` commitlint.config.js ` | Commitlint configuration (conventional commits) |
95-
96- ### Build System
97-
98- ** Library (` packages/perfect-freehand/ ` ):**
99-
100- - Uses ** Rolldown** (` rolldown.config.mjs ` ) - Rust-based bundler with Rollup-compatible API
101- - Outputs dual CJS/ESM formats with minification and source maps
102- - Outputs to ` dist/ ` directory (cjs/, esm/, types/)
103-
104- ** Dev App (` packages/dev/ ` ):**
105-
106- - Uses ** Vite** (` vite.config.ts ` ) - Fast dev server with HMR
107- - Built-in CSS modules support (files ending in ` .module.css ` )
108- - React plugin via ` @vitejs/plugin-react `
109- - Dev server runs on port 5420
110-
111- ### Current Dependency Versions (as of last audit)
112-
113- | Tool | Version | Notes |
114- | ----------- | -------------- | ------------------------------------------------------------------- |
115- | TypeScript | 5.7.0 | ` strict: true ` in tsconfig |
116- | lazyrepo | 0.0.0-alpha.27 | Task orchestration and caching |
117- | ESLint | 9.x | Flat config ` eslint.config.mjs ` with typescript-eslint |
118- | Vitest | 3.x | Native ESM and TypeScript support |
119- | Rolldown | 1.0.0-rc.2 | Rust-based bundler for library builds |
120- | Vite | 6.x | Dev server and build tool for dev app |
121- | TypeDoc | 0.28.x | API documentation generator |
122- | Husky | 9.1.x | Pre-commit (lint-staged), pre-push (tests), commit-msg (commitlint) |
123- | lint-staged | 15.x | Fast pre-commit checks on changed files only |
124- | commitlint | 19.x | Conventional commit message linting |
125- | @types/node | 20.11.0 | Updated |
126-
127- ## Modernization
128-
129- See ` todo.md ` for the full modernization roadmap. Key changes:
130-
131- - ~~ Replace Lerna with lazyrepo (keep yarn workspaces)~~ Done
132- - ~~ Migrate Jest → Vitest~~ Done
133- - ~~ Migrate esbuild scripts → Rolldown (library)~~ Done
134- - ~~ Migrate dev app esbuild → Vite~~ Done
135- - ~~ Upgrade TypeScript to 5.x with ` strict: true ` ~~ Done
136- - ~~ Upgrade ESLint to 9.x with flat config~~ Done
137- - ~~ Modernize CI/CD pipeline (actions v4, Node matrix, caching, publish workflow)~~ Done
138- - ~~ Extract Prettier config, add format scripts, integrate into CI~~ Done
139- - ~~ Upgrade TypeDoc to 0.28.x with modern config and CI integration~~ Done
140- - ~~ Add missing configuration files (.editorconfig, .nvmrc, engines, Dependabot)~~ Done
141- - ~~ Improve Git Hooks (Husky 9.x, lint-staged, pre-push tests, commitlint)~~ Done
142- - ~~ Update dev app dependencies (zustand 5.x, Radix UI latest, @testing-library/react 16.x)~~ Done
143- - ~~ Package.json cleanup (unused deps, packageManager field for Corepack)~~ Done
78+ ## Build & Tooling
79+
80+ - ** Library build** : Rolldown (` packages/perfect-freehand/rolldown.config.mjs ` ) - outputs dual CJS/ESM to ` dist/ `
81+ - ** Dev app** : Vite with React plugin
82+ - ** Task orchestration** : lazyrepo (` lazy.config.js ` )
83+ - ** Testing** : Vitest with jsdom environment
84+ - ** Git hooks** : Husky (pre-commit runs lint-staged, pre-push runs tests, commit-msg runs commitlint for conventional commits)
0 commit comments