fix(build): build every dist-types a filtered mobile typecheck needs

Merged
SA
2mo ago
+5-1

Summary

Mobile's typecheck reads the host-service router types from generated dist-types. There were two gaps in how those get built.

  1. build:types only depended on ^build. Host-service emitted its declarations, but port-scanner, pty-daemon and workspace-fs never built theirs. Their exports.types pointed at missing files, so mobile typechecked their Node source files instead (Property 'unref' does not exist on type 'number'). CI passes only because it checks the whole repo, and desktop's typecheck happens to build those packages' types first. bunx turbo typecheck --filter=@superset/mobile from a clean checkout fails every time. Fix: dependsOn: ["^build", "^build:types"].
  2. build:types shared the base config's incremental tsbuildinfo. Once a build had written it, a rebuild after dist-types went missing emitted 0 files, because tsc trusted the build-info file. Everything in the missing declarations then resolved to any (ChangesetFile, HostWorkspaceItem). That's how my main checkout ended up with 324 of 507 host-service .d.ts files. Fix: "incremental": false in the four tsconfig.types.json files. build:types is turbo-cached, so this costs little.

Test plan

  • Clean dist-types and .cache in all four packages, main's config: turbo typecheck --filter=@superset/mobile fails (2/3 tasks, three packages never built)
  • Same with this change: 6/6 pass
  • Host-service build:types, delete dist-types, build:types again: main's config emits 0 .d.ts, this change emits 507
  • bun run lint

Summary by cubic

Fixes turbo typecheck --filter=@superset/mobile failing from a clean checkout because the dist-types it typechecks against were never built or silently went stale.

  • build:types now also depends on ^build:types, so host-service, port-scanner, pty-daemon, and workspace-fs all emit their declarations before mobile typechecks.
  • Declaration builds are no longer incremental, so a rebuild after dist-types is deleted still emits all .d.ts files. The cost is negligible because build:types is turbo-cached.

Summary by CodeRabbit

  • Chores
    • Updated build settings across several components. Type-generation tasks now follow upstream build and type-generation tasks in the build pipeline, keeping these tasks aligned across the project. These changes affect the development and build process; no user-facing features or behavior have changed.