ReviewOS

home-lang/home

fix(ts): resolve explicit project files from the config directory

#483
Closed chris opened this 8 days ago ·
8 days ago

Found while adding explicit file-order controls for #480 (benchmark admission #473, tracker #416).

From a working directory outside the project, run home-tsc -p /absolute/project/tsconfig.json with a config containing "files": ["src/lib.d.ts", "src/app.ts"]. The files exist relative to the config directory. TS 6.0.3 and native TS 7.0.2 resolve both; Home instead prints error reading src/lib.d.ts: FileNotFound.

tsc_main.zig copies loaded_cfg.files directly into the input-file list, unlike the include-glob path which is anchored at the config directory. Other build paths join the project directory but do not consistently preserve absolute file entries.

Resolve config-file entries against the config directory, preserving absolute paths and declared root ordering, for normal and build-mode discovery. Positional command-line files remain relative to the working directory. Add unit and shared CLI checks; do not change working directories or rewrite audit paths to avoid the bug. This does not resolve the separately missing cross-file type information in #480.

8 days ago

Fixed in 8a737cd. Normal project discovery and build/clean path collection share config-relative resolution, preserving absolute entries and input order. Positional paths remain working-directory-relative.

All 69 CLI tests pass. Eighteen shared CLI checks across TS 6.0.3, native TS 7.0.2, and Home pass for valid/invalid inputs in normal project mode, forced build mode, and positional mode with --ignoreConfig. The projects mix relative, parent-relative, and absolute roots and are invoked from outside their directory. #486 separately tracks the missing TS5112 when positional mode omits --ignoreConfig.

Results: https://github.com/home-lang/home/blob/2e146e71e/docs/docs/TS_PERFORMANCE.md#global-declaration-and-graph-admission-audit-untimed .

Sign in to comment on this issue.