docs/plans/2026-04-25-slate-v2-source-first-typecheck-plan.md
Make Slate v2 local typecheck behave like Plate: source-first during development, no package rebuild required just to typecheck edited source.
src with explicit paths.typecheck depend on package build, which forces rebuilds even for source checks.lib declarations during package typecheck; source-first aliases must own local workspace resolution instead.composite and declaration output belong in tsconfig.build.json.typecheck scripts must use source tsconfig.json; tsconfig.build.json remains artifact-only.createEditor must construct the base editor internally and cast at the boundary; source-first package programs can include consumer augmentations without forcing core construction to satisfy plugin-specific editor shapes.slate-react must not override the shared package aliases with local ../slate paths. That reintroduced ../slate/dist into the package typecheck graph.CustomTypes pollute package internals when package source is compiled inside the site program. That is a separate source-first site hardening pass, not a package typecheck prerequisite.typecheck.bunx turbo typecheck --filter=./packages/slate --filter=./packages/slate-history --filter=./packages/slate-dom --filter=./packages/slate-react --filter=./packages/slate-browser --filter=./packages/slate-hyperscript --force passed without build tasks.bun run lint passed in .tmp/slate-v2.bun typecheck package phase ran only Turbo typecheck tasks and no package builds, then stopped in site because site still typechecks against package contract/dist.bun typecheck:site with temporary source aliases failed because site custom CustomTypes forced package source internals to satisfy app-specific Editor, Element, and Text shapes. The temporary site alias experiment was reverted..agents/AGENTS.md and generated AGENTS.md now default to source-first typecheck and reserve builds for artifact-facing checks or packages that lack a source-first path.tsc on the package contract until the app/package type boundary is split.