This document outlines infrastructure and tooling improvements for the perfect-freehand repository. These changes do not affect the core algorithm source code.
- Update
typescriptto^5.3.0or later - Enable
strict: trueintsconfig.base.json(currently disabled) - Review and update any deprecated compiler options
- Update
@types/nodefrom^15.0.1to^20.x
- Remove Lerna (it's 4+ major versions behind)
- Keep Yarn workspaces for dependency management (already configured)
- Add lazyrepo for task orchestration and caching
- Simpler than Turborepo/Nx
- Works well with yarn workspaces
- Reference: tldraw/tldraw uses this setup
- Create
lazy.config.jsfor build/test task definitions - Remove
lerna.json - Remove
lernadependency
- Upgrade
eslintto^9.x - Upgrade
@typescript-eslint/parserand@typescript-eslint/eslint-pluginto^7.xor^8.x - Migrate from
.eslintrc.jsto flat config (eslint.config.js) - Consider adding
eslint-config-prettierto avoid conflicts
- Replace Jest with Vitest
- Native ESM and TypeScript support (no ts-jest needed)
- Compatible with Jest syntax (minimal test changes)
- Integrates with Vite for fast HMR in watch mode
- Remove Jest dependencies:
jest,ts-jest,@types/jest - Remove
@testing-library/jest-dom(use@testing-library/jest-dom/vitest) - Create
vitest.config.ts - Update test scripts in
package.json - Remove Babel dependencies if no longer needed (Vitest handles TS natively)
- Replace custom esbuild scripts with Rolldown (https://rolldown.rs/)
- Rust-based bundler with Rollup-compatible API
- Built-in transforms, minification, and source maps
- Significantly faster than Rollup (1.6s vs 40s in benchmarks)
- Create
rolldown.config.mjsfor library builds - Configure dual CJS/ESM output formats
- Remove
packages/perfect-freehand/scripts/build.jsanddev.js
- Replace custom esbuild dev server with Vite
- Fast HMR, native ESM, excellent DX
- Vite 6+ uses Rolldown under the hood
- Create
packages/dev/vite.config.ts - Remove
packages/dev/esbuild.config.mjs - Remove
esbuildandesbuild-css-modules-plugindependencies - Vite has built-in CSS modules support
-
Update all@babel/*packages from^7.15.0to^7.23.x -
Consider if Babel is still needed (esbuild handles transpilation) -
If only used for Jest, Vitest would eliminate this dependency - Note: Babel dependencies were only used for Jest/ts-jest. With Vitest migration complete, Babel has been removed.
- Update
actions/checkoutandactions/setup-nodeto v4 - Replace
mattallty/jest-github-action@v1.0.3with Vitest (native GitHub Actions reporter) - Add Node.js version matrix testing (18.x, 20.x, 22.x)
- Add caching for
node_modulesto speed up CI - Consider adding a publish workflow for automated npm releases
- Extract Prettier config from
package.jsonto.prettierrc - Add
.prettierignorefile - Add
formatandformat:checkscripts - Integrate Prettier check into CI pipeline
- Update
typedocto latest version (0.28.x) - Review TypeDoc configuration options (added
typedoc.jsonwith modern options) - Consider adding a docs generation step to CI (added to
main.yml)
- Add
.editorconfigfor consistent editor settings - Add
.nvmrcor.node-versionto pin Node.js version - Add
enginesfield topackage.jsonto specify supported Node versions - Consider adding
renovate.jsonor Dependabot for automated dependency updates
- Update
huskyto^9.x - Add
lint-stagedfor faster pre-commit checks (only lint changed files) - Add a pre-push hook for running tests before push
- Consider adding commit message linting with
commitlint
- Update
zustandfrom^4.0.0-rc.1to stable^4.xor^5.x - Update
@testing-library/reactfrom^12.0.0to^16.x - Update Radix UI components to latest versions
- Audit and remove unused dependencies
- Standardize version specifiers (prefer
^for flexibility) - Add
packageManagerfield for Corepack support - Review and update
peerDependenciesif any
- Consider upgrading to Yarn 4.x (Berry) with PnP or node_modules linker
- Add
packageManagerfield to rootpackage.jsonfor Corepack - Configure
.yarnrc.ymlif using Yarn 4
- Add
npm auditoryarn auditto CI pipeline - Consider adding
socket.devor similar for supply chain security- Note: Dependabot is already configured (
.github/dependabot.yml) for automated dependency updates, which provides similar supply chain security benefits
- Note: Dependabot is already configured (
- Review and update any dependencies with known vulnerabilities
- Audit run on 2026-01-30: No vulnerabilities found
| Category | Items | Effort | Impact |
|---|---|---|---|
| TypeScript upgrade | 4 | Medium | High |
| Lerna → Lazyrepo | 6 | Low-Medium | High |
| ESLint upgrade | 4 | Medium | Medium |
| Vitest migration | 6 | Medium | High |
| Rolldown (library) | 4 | Medium | High |
| Vite (dev app) | 5 | Done | Medium |
| CI/CD improvements | 5 | Low | Medium |
| Configuration files | 4 | Low | Low |
| Tool | Current | Latest | Gap |
|---|---|---|---|
| TypeScript | 5.7.0 | 5.7+ | Up to date |
| lazyrepo | 0.0.0-alpha.27 | alpha | Up to date |
| ESLint | 9.x | 9.x | Up to date |
| Vitest | 3.0.0 | 3.x | Up to date |
| Rolldown | 1.0.0-rc.2 | 1.x RC | Up to date |
| Vite | 6.0.0+ | 6.x | Up to date |
| TypeDoc | 0.28.x | 0.28.x | Up to date |
| Husky | 9.1.x | 9.x | Up to date |
| @types/node | 20.11.0 | 20.x | Up to date |