Problem
The engine build script (src/engine/build.sh) deletes the output directories lib/ and lib.browser/ before running incremental TypeScript compilation (line 39). However, it does not delete the corresponding TypeScript incremental cache files: tsconfig.tsbuildinfo and tsconfig.browser.tsbuildinfo.
This causes TypeScript's incremental mode to incorrectly believe the outputs are up-to-date (because the cache still points to the deleted files), so the compiler skips compilation entirely. The output directories remain empty (except for WASM files copied later), causing downstream packages like @simlin/core to fail with missing type declarations.
Why it matters
The incremental build is designed to speed up builds by skipping unchanged files. But when outputs are deleted without clearing the cache, incremental mode becomes inconsistent with reality. This leads to:
- Silent build failures with confusing error messages downstream
- Broken CI/local builds after cache corruption
- Harder debugging (appears to be a missing dependency, not a build issue)
Affected component
src/engine/build.sh (build script)
- Downstream:
@simlin/core and any package depending on @simlin/engine type declarations
Solution
Delete the tsbuildinfo cache files when deleting the output directories, so incremental compilation knows to rebuild from scratch:
# Before: just deletes outputs
rm -rf lib lib.browser
# After: also deletes incremental cache
rm -rf lib lib.browser tsconfig.tsbuildinfo tsconfig.browser.tsbuildinfo
This ensures incremental mode is consistent with the file system state.
Context
Identified while debugging build failures in the engine package after commit 876f4ee.
Problem
The engine build script (
src/engine/build.sh) deletes the output directorieslib/andlib.browser/before running incremental TypeScript compilation (line 39). However, it does not delete the corresponding TypeScript incremental cache files:tsconfig.tsbuildinfoandtsconfig.browser.tsbuildinfo.This causes TypeScript's incremental mode to incorrectly believe the outputs are up-to-date (because the cache still points to the deleted files), so the compiler skips compilation entirely. The output directories remain empty (except for WASM files copied later), causing downstream packages like
@simlin/coreto fail with missing type declarations.Why it matters
The incremental build is designed to speed up builds by skipping unchanged files. But when outputs are deleted without clearing the cache, incremental mode becomes inconsistent with reality. This leads to:
Affected component
src/engine/build.sh(build script)@simlin/coreand any package depending on@simlin/enginetype declarationsSolution
Delete the tsbuildinfo cache files when deleting the output directories, so incremental compilation knows to rebuild from scratch:
This ensures incremental mode is consistent with the file system state.
Context
Identified while debugging build failures in the engine package after commit 876f4ee.