A functional toolkit for authoring resource-leveling algorithms — compose constraint and scoring blocks, enumerate feasible schedules

feat(model): replace enums with erasable const objects master

TimeUnit, RelationType, ResourceType, ConstraintType and Priority were TypeScript enums — one of the handful of non-erasable constructs, which emit runtime code instead of vanishing when types are stripped. Every type-stripping toolchain (node's built-in stripping, bun, esbuild, oxc/Vite, the Convex bundler) has to special-case them, and node refuses them outright. A downstream workspace consumes this library as source with `erasableSyntaxOnly` set, where these five made it fail to typecheck. Each becomes a const object plus a derived type of the same name, so the value namespace (`TimeUnit.Days`) and the type name both survive. The types become structural unions rather than nominal enums (a loosening), the identifiers can no longer be namespaces or be declaration-merged, and Priority loses its numeric reverse mapping. Nothing in the repo used any of those; checked with greps for `typeof X`, `X[`, `Object.values(X)` and namespace-position uses. `z.enum()` in src/schema/types.ts already accepts a const object under zod 4, so the four schemas are unchanged. Public API: all five are re-exported from src/index.ts, so this is documented in a new CHANGELOG.md. bun test: 584 pass / 12 skip / 1 fail (the pre-existing XlsxWriter named-range failure); bun run typecheck clean; generated/block-meta.json unchanged after regeneration.


+41 -36
1 changed file