Commit a2433b1
Modernize build tooling and dev infrastructure for 2026 (#96)
* Add CLAUDE.md and modernization todo list
Introduced CLAUDE.md to provide guidance for Claude Code and added todo.md outlining infrastructure and tooling improvements for the repository. These additions document project architecture and planned modernization tasks without affecting core algorithm code.
* Upgrade TypeScript from 4.4.2 to 5.7.0 with strict mode
- Update typescript to ^5.7.0 in all packages
- Update @types/node from ^15.0.1 to ^20.11.0
- Enable strict: true in tsconfig.base.json
- Remove deprecated importsNotUsedAsValues option
- Update target to ES2020 and lib to ES2021
- Fix type errors in controls.tsx for strict mode compatibility
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Replace Lerna with lazyrepo for task orchestration
- Remove lerna dependency and lerna.json configuration
- Add lazyrepo (0.0.0-alpha.27) for task orchestration and caching
- Create lazy.config.js with build, test, lint, and start tasks
- Update start script to use lazy run
- Update publish script to use npm publish directly
- Add .lazy to .gitignore
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Upgrade ESLint from 7.32.0 to 9.19.0 with flat config
- Update eslint to ^9.19.0
- Replace @typescript-eslint/parser and plugin with typescript-eslint ^8.23.0
- Migrate from .eslintrc.js to eslint.config.mjs (flat config)
- Add eslint-config-prettier to avoid formatting conflicts
- Fix unused import and expression issues in test file
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Migrate from Jest to Vitest for testing
- Replace Jest with Vitest ^3.0.0 for native ESM and TypeScript support
- Remove Jest, ts-jest, babel-jest, and all Babel dependencies
- Update @testing-library/jest-dom to ^6.6.0 (Vitest compatible)
- Add jsdom ^26.0.0 for DOM testing environment
- Create vitest.config.ts with jsdom environment and globals
- Update setupTests.ts to import from @testing-library/jest-dom/vitest
- Remove Jest types from tsconfig.base.json
- Update test snapshots to Vitest format
Tests now run in ~1.8s vs previous ~3s with Jest/ts-jest
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Migrate library build from esbuild to Rolldown
- Replace custom esbuild scripts with Rolldown ^1.0.0-beta.1
- Create rolldown.config.mjs with dual CJS/ESM output
- Enable minification and source maps for both builds
- Add custom plugin to report bundle sizes
- Remove packages/perfect-freehand/scripts/build.js and dev.js
- Update lazy.config.js cache inputs
Build time: ~11ms, output: 3.73kb ESM (1.74kb gzipped)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Migrate dev app from esbuild to Vite
- Replace custom esbuild dev server with Vite ^6.0.0
- Create packages/dev/vite.config.ts with React plugin
- Configure path aliases for bare imports (components, hooks, state)
- Set dev server port to 5420 (same as original)
- Remove esbuild.config.mjs and related dependencies
- Update index.html to use Vite-style script imports
Dev server starts in ~100ms with instant HMR
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Modernize CI/CD pipeline with v4 actions and Node matrix
- Update actions/checkout and actions/setup-node to v4
- Replace Jest GitHub Action with direct Vitest execution
- Add Node.js version matrix testing (18.x, 20.x, 22.x)
- Add dependency caching via setup-node cache option
- Add branch filtering for main branch only
- Create publish.yml workflow for automated npm releases on GitHub release
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Extract Prettier config and add format scripts
- Move Prettier config from package.json to .prettierrc
- Add .prettierignore for dist, node_modules, lock files, etc.
- Add prettier ^3.4.0 as devDependency
- Add format and format:check scripts to package.json
- Add formatting check step to CI pipeline
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Upgrade TypeDoc from 0.21.9 to 0.28.0
- Update typedoc to ^0.28.0 in root and library package.json
- Create packages/perfect-freehand/typedoc.json with modern config
- Configure TypeDoc with navigation, sorting, and visibility options
- Add docs generation step to CI (runs on Node 20.x only)
- Simplify docs script to use config file
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Add missing configuration files
- Add .editorconfig for consistent editor settings (2-space indent, UTF-8)
- Add .nvmrc pinning Node.js to version 20 (LTS)
- Add engines field to package.json (>=18.0.0)
- Add .github/dependabot.yml for automated dependency updates
- Weekly schedule with grouped dependencies
- Monitors both npm and GitHub Actions
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* build: upgrade Husky to 9.x with lint-staged and commitlint
- Update husky from ^7.0.0 to ^9.1.0
- Change postinstall to prepare script (Husky 9 syntax)
- Add lint-staged ^15.4.0 for faster pre-commit checks
- Add @commitlint/cli and @commitlint/config-conventional ^19.7.0
- Update pre-commit hook to run lint-staged instead of full test
- Add pre-push hook to run tests before push
- Add commit-msg hook for conventional commit linting
- Create commitlint.config.js extending conventional config
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* chore: update dev app dependencies to latest versions
- Update zustand from ^4.0.0-rc.1 to ^5.0.0
- Update @testing-library/react from ^12.0.0 to ^16.0.0
- Update @radix-ui/react-checkbox from ^0.1.0 to ^1.1.0
- Update @radix-ui/react-icons from ^1.0.3 to ^1.3.0
- Update @radix-ui/react-label from ^0.1.0 to ^2.1.0
- Update @radix-ui/react-slider from ^0.1.0 to ^1.2.0
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* chore: clean up package.json files and remove unused dependencies
- Remove unused dependencies: cac, fake-indexeddb, tslib, @modulz/radix-icons
- Add packageManager field (yarn@4.12.0) for Corepack support
- Disable importHelpers since tslib was removed
- Remove unused fake-indexeddb import from setupTests.ts
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* ci: add security audit job to CI pipeline
- Add separate audit job running yarn npm audit on Node 20.x
- Job runs in parallel with build matrix for efficiency
- No vulnerabilities found in current dependencies
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* chore: add Yarn 4 configuration with node-modules linker
- Add .yarnrc.yml configuring node-modules linker
- Add .yarn/install-state.gz to .gitignore
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* docs: update README for Dart port and fix API naming
Highlight the Dart port of the library and correct the API name from
getOutlinePoints to getStrokeOutlinePoints. Simplified the community
ports section.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* chore: add tsbuildinfo to gitignore
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix(ci): enable Corepack before setup-node for Yarn 4
The setup-node action with cache: 'yarn' runs yarn internally before
any other steps, which fails when packageManager field specifies Yarn 4.
Enable Corepack first and use manual caching instead.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: exclude test files from library tsconfig
Test files use Vitest globals which TypeScript doesn't know about.
Vitest handles type-checking for test files separately.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* chore: add dev script to package.json
Introduces a 'dev' script that runs 'lazy run start' for development purposes.
* style: fix formatting and lint issues
- Format 16 files with Prettier
- Fix unused variable in rolldown config
- Add global console directive for ESLint flat config
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix(ci): require Node.js 20+ for rolldown compatibility
Rolldown uses `styleText` from `node:util` which was added in Node.js
20.1.0. Update CI matrix and engines field accordingly.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* refactor(getStrokePoints): extract default pressure constants
Extract magic pressure values (0.25 and 0.5) to named constants
DEFAULT_FIRST_PRESSURE and DEFAULT_PRESSURE in constants.ts.
Documents why first point uses lower pressure (prevents fat starts).
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* refactor(getStrokePoints): extract unit offset constant
Extract magic vector [1, 1] to UNIT_OFFSET constant in constants.ts.
Used as placeholder for initial vector and for creating a second
point when only one input point is provided.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* refactor(getStrokePoints): add explicit pressure validation helper
Add isValidPressure() type guard function that explicitly checks for
undefined, NaN, and negative pressure values. Makes the intent clearer
compared to the implicit `>= 0` check which returns false for undefined.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* perf(getStrokePoints): use mutable vector operation in hot loop
Use subInto with a scratch buffer for the vector difference calculation
in the main loop to reduce array allocations. The intermediate result
from sub() was being discarded after uni() normalized it.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* refactor: use Vec2 type and optimize vector operations
* refactor(getStrokeOutlinePoints): rename cryptic variables
Improve readability by renaming single-letter and abbreviated variables:
- ts, te → taperStartStrength, taperEndStrength
- pl, pr → prevLeftPoint, prevRightPoint
- tl, tr → tempLeftPoint, tempRightPoint
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* refactor(getStrokeOutlinePoints): extract cap generation helpers
Extract cap drawing logic into dedicated helper functions for clarity:
- drawDot(): generates circular dot for single-point strokes
- drawRoundStartCap(): generates rounded start cap
- drawFlatStartCap(): generates squared-off start cap
- drawRoundEndCap(): generates rounded end cap (1.5 turns)
- drawFlatEndCap(): generates squared-off end cap
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* refactor(getStrokeOutlinePoints): extract taper distance calculation
Replace nested ternary expressions for taper calculation with a
dedicated computeTaperDistance() helper function. Improves readability
and documents the three possible taper option values (false, true, number).
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* refactor(getStrokeOutlinePoints): extract initial pressure and add isLastPoint
- Add computeInitialPressure() helper to encapsulate the pressure
averaging logic that prevents fat starts
- Add isLastPoint variable in loop to replace repeated i === points.length - 1
checks, improving readability
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat: add Vitest benchmark support and stroke benchmarks
Introduces 'bench' scripts to root and perfect-freehand package.json files and configures Vitest to include benchmark files. Adds a comprehensive stroke.bench.ts for benchmarking stroke-related functions with various datasets and options.
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>1 parent e8f132b commit a2433b1
File tree
58 files changed
+16263
-37336
lines changed- .github
- workflows
- .husky
- packages
- dev
- src
- components
- controls
- panel
- state
- perfect-freehand
- scripts
- src
- bench
- test
- __snapshots__
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
58 files changed
+16263
-37336
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
3 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
4 | 42 | | |
5 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
6 | 49 | | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
12 | 77 | | |
13 | 78 | | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
4 | | - | |
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
0 commit comments