From 95c9666213d9bebb69c0d7f07becc9dbc793183a Mon Sep 17 00:00:00 2001 From: Jannis Braun <151788261+TheZwiss@users.noreply.github.com> Date: Tue, 21 Apr 2026 22:27:51 +0200 Subject: [PATCH] build(server): drop stale project reference to @backspace/shared The three typecheck failures in ws/events.ts for DmCallUndeliverable{Failure,Reason} and 'dm_call_undeliverable' looked like missing exports from @backspace/shared, but the types are fully defined and exported in packages/shared/src/types.ts (lines 361, 367, 429). The real cause was architectural. packages/server/tsconfig.json declared: "references": [{ "path": "../shared" }] TypeScript project references make the dependent project's typecheck consume the referenced project's *build output* (dist/*.d.ts), not its sources. The shared package's dist is gitignored, is not rebuilt by any script before `pnpm -r typecheck` or `pnpm --filter @backspace/server typecheck`, and the referenced-project-stale failure mode surfaces as TS6305 in the server, or (when the dist is present but older) as "no exported member" for types that were added after the last shared build. The #16 merge (which added DmCallUndeliverableFailure/Reason and the dm_call_undeliverable event variant) landed the types in src but the local dist was never refreshed, so server's typecheck started failing against the stale .d.ts. packages/web/tsconfig.json already resolved @backspace/shared via `moduleResolution: "bundler"` + the package.json `exports` field, which points directly at ./src/types.ts. That path has no build-ordering dependency, never goes stale, and already typecheck-passes cleanly. Fix: remove the server-side project reference so server matches web's bundler-style resolution. Server still emits its own dist on `tsc` (its rootDir confines emission to its own src/); the runtime already reads TS directly via tsx, so nothing in the dev or prod run path changes. The Dockerfile/root build scripts that build shared explicitly are also unaffected. Verified: `pnpm -r typecheck` passes for shared and server; standalone `pnpm exec tsc --noEmit` in packages/web passes; `pnpm build` completes all three packages. Fixes #24 (pre-existing typecheck failure on main). --- packages/server/tsconfig.json | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/server/tsconfig.json b/packages/server/tsconfig.json index 631be638..8f24167a 100644 --- a/packages/server/tsconfig.json +++ b/packages/server/tsconfig.json @@ -4,8 +4,5 @@ "outDir": "./dist", "rootDir": "./src" }, - "include": ["src/**/*"], - "references": [ - { "path": "../shared" } - ] + "include": ["src/**/*"] }