| name | update-heerich |
|---|---|
| description | Updates heerich library to the latest version and migrates all sketch files to match the new API. Use when the user wants to upgrade heerich, mentions "update heerich", or needs to fix heerich API breaking changes. |
| license | MIT |
| allowed-tools | Bash, Read, Edit, Glob, Grep |
Upgrade the heerich npm package to its latest version and migrate all sketch files in the project that use it.
node -e "const p = require('./node_modules/heerich/package.json'); console.log('installed:', p.version)"
npm info heerich versiongrep -rl "from 'heerich'" src/npm install heerich@latestRead the new bundle to understand what changed:
head -200 node_modules/heerich/dist/heerich.jsAlso read src/global.d.ts to see the existing hand-written type declarations for heerich. Diff the old vs new API surface to identify every breaking change before touching any file.
The file contains hand-written heerich type declarations inside declare module 'heerich' { ... }. Rewrite those declarations to match the new API. Key interfaces to check:
HeerichOptions(constructor options:tile,camera)ApplyGeometryOptions(fields:type,position,size,style,mode, etc.)Face(fields:type,points,style,depth,voxel)CameraOptions,BoxStyle,StyleObject,ToSVGOptions,ViewBoxBounds
Update only the declare module 'heerich' block — leave all other declarations in the file untouched.
For each file identified in step 2, read it and apply the necessary API changes. Common migration patterns between versions:
- Constructor options renamed: e.g.
tile→tileSize,camera.distance→camera.zoom - Method renames: e.g.
getFaces()→render(),applyGeometry()→addBox() - Face shape changes: e.g.
face.points.data→face.vertices,face.type === 'content'guard may change - Style API changes: top-level
stylestructure or per-face keys may change
Confirm which patterns apply by checking the actual new bundle before editing any file.
npx tsc --noEmitFix any remaining type errors. Do not change logic — only update API call sites to match the new interface.