Skip to content

build(typescript): move root project references into tsconfig.typecheck.json - #3688

Merged
thymikee merged 3 commits into
mainfrom
build/root-tsconfig-without-references
Oct 15, 2026
Merged

thymikee merged 3 commits into
mainfrom
build/root-tsconfig-without-references

Conversation

@thymikee

@thymikee thymikee commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

Summary

fallow ≥3.20 walks the root tsconfig's references on every import. Since #3289 gave the root tsconfig 28 references, every fallow gate has slowed down: on CI, "Run Fallow audit" went from 6–9s to 440–850s.

This PR moves the references into tsconfig.typecheck.json, which extends tsconfig.json and is now what pnpm typecheck builds with tsc -b. extends does not inherit references, so fallow, freerange, editors and tsdown now read a reference-free root config. The scripts/freerange/tsconfig.json wrapper existed only to hide the references from freerange, so it is deleted. A test pins that tsconfig.json has no references. 6 files changed.

Going back to fallow 3.19 was rejected. Its --fail-on-issues exits 0 on warn findings (checked with a planted unused export), and on main it reports 79 unused production exports where 3.32 reports 0.

Validation

Tested at 5904480.

  • Typecheck: tsc -b --verbose builds the same 30 projects, and --listFiles gives the same 16,156 files. Errors planted in a package, in src/ and in test/ are all caught.
  • fallow output: identical JSON before and after for dead-code, production-exports, health (with and without --coverage/--diff-stdin) and audit --base. Only the entry-point bookkeeping differs, by +1 for the new tsconfig.
  • Cold local timings (12-core Mac):
command base head
dead-code 10.0–11.9s 2.0–2.3s
production-exports 3.4–4.5s 0.9–1.1s
health with coverage 10.0–12.8s 2.3–2.4s
audit --base 15.6–30.6s 5.9–7.9s
  • freerange: run from the root, 0 findings in 111s.
  • pnpm check:affected --run: passed except daemon-client-transport.test.ts > auto health probing…, a timing test that failed while a Rust build loaded the machine. It passed 3 of 3 runs alone.
  • Risk: on this PR, audit --base still analyses the base with references, so the full CI gain shows on PRs opened after this merges.

View guided diff Turn on auto-fix

…ck.json

fallow >=3.20 walks the references of each file's tsconfig on every import,
which made its resolve stage ~14x slower once the root tsconfig gained 28
references (#3289). tsc -b now builds the root program through
tsconfig.typecheck.json, which extends tsconfig.json and carries the
references; extends does not inherit them, so fallow, editors, and tsdown
read a reference-free root config.
The scripts/freerange wrapper existed only to hand fr a tsconfig without
references; tsconfig.json no longer has any.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 6 files

View guided diff | Turn on auto-fix | Re-trigger cubic

@github-actions

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://callstack.github.io/agent-device/pr-preview/pr-3688/

Built to branch gh-pages at 2026-10-15 18:29 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@thymikee

Copy link
Copy Markdown
Member Author

This PR is ready at 5904480. Moving the project references into tsconfig.typecheck.json looks right, and the layering test covers the ownership split.

Not blocking: the test in scripts/layering/project-references.test.ts pins the contents of tsconfig.typecheck.json and the absence of references in tsconfig.json, but nothing pins that the typecheck script in package.json builds tsconfig.typecheck.json. If the script pointed back at tsconfig.json, tsc -b would build only the root program and the per-package checks would stop running while the test still passed, so an assertion on that script name in the same test would close the gap. You can take or leave it.

I read the head's tsconfigs and scripts only. I did not run tsc -b, --listFiles, fallow or fr, so the 30-project and 16,156-file equivalence and the fallow speedup rest on your numbers. I also did not check editor tsserver behavior, though tsconfig.json keeps the same include and options.

CI is still running: 18 of 25 checks are queued or in progress, and none have failed. The Typecheck & Package, Repo Guards (layering) and fallow audit jobs exercise this diff, so merge should wait for those to pass.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Oct 15, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Size Report

Metric Base Current Diff
Installed (including dependencies) 5.24 MB 5.24 MB -14 B
Package (unpacked) 5.24 MB 5.24 MB -14 B
Package (download) 1.57 MB 1.57 MB -6 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 28.2 ms 28.3 ms +0.1 ms
CLI --help 78.6 ms 78.7 ms +0.1 ms

@thymikee
thymikee merged commit d2bafc0 into main Oct 15, 2026
26 checks passed
@thymikee
thymikee deleted the build/root-tsconfig-without-references branch October 15, 2026 18:40
thymikee added a commit that referenced this pull request Oct 16, 2026
…ctions-1

* origin/main:
  feat(react-devtools): inspect React components and profile renders through the Metro inspector (#3613)
  refactor(daemon-contracts): drop the registration and claims fixture exports (#3689)
  refactor(test-kit): drop the daemon-contracts dependency (#3686)
  refactor(test-kit): drop command-registry by making the replay-script generator a root fixture (#3687)
  fix(ios): handle delayed launch confirmations without stopping XCTest (#3682)
  refactor(test-kit): move the dispatch-disclosure harness out of contracts (#3690)
  refactor(test-kit): host the target classification capture fixture (#3691)
  ci: fold six CI jobs into four with parallel and background steps; cancel superseded and closed-PR runs (#3658)
  build(typescript): move root project references into tsconfig.typecheck.json (#3688)
  chore(daemon): declare @agent-device/proxy as a devDependency, since only a test imports it (#3685)
  refactor(settings): declare settings once and admit them per setting (#3662)

# Conflicts:
#	packages/platform-android/src/alert.ts
#	website/docs/docs/limrun.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant