Skip to content

Commit e67e9ba

Browse files
committed
Force a single TypeScript identity for vendored @intx/types
Bun overrides already point install-time resolution at vendor/intx-types, but a nested published @intx/types@0.2.2 under @intx/agent can still give tsc a second type identity (missing PendingOperation.kind and related shapes). Pin tsconfig paths at the vendor source so local typecheck matches CI regardless of that layout, and document both layers.
1 parent b9a1c8b commit e67e9ba

2 files changed

Lines changed: 30 additions & 1 deletion

File tree

docs/VENDORING.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,33 @@ Root `package.json`:
7070
- The package's own entry in root `dependencies` reads `"workspace:*"`
7171
rather than a version string.
7272

73+
A clean `bun install` under those overrides links every consumer —
74+
including nested Bun package layouts such as
75+
`node_modules/.bun/@intx+agent@…/node_modules/@intx/types` — at the
76+
vendored tree. That is the runtime and install-time story.
77+
78+
TypeScript needs a second pin. Published packages such as `@intx/agent@0.2.2`
79+
ship `dist/*.d.ts` that import `@intx/types/runtime`. When a stale or
80+
partial install leaves a nested published `@intx/types@0.2.2` (with its
81+
older `dist/` shapes, missing fields such as `PendingOperation.kind`),
82+
`tsc` treats that nested copy as a second type identity: first-party
83+
code and vendored inference resolve the vendor source, while agent
84+
declaration files resolve the nested publish, and assignability fails
85+
even though both packages share the name `@intx/types`. Root
86+
`tsconfig.json` therefore forces a single TypeScript-visible identity:
87+
88+
```json
89+
"paths": {
90+
"@intx/types": ["./vendor/intx-types/src/index.ts"],
91+
"@intx/types/*": ["./vendor/intx-types/src/*"]
92+
}
93+
```
94+
95+
Overrides keep the filesystem install on vendor; paths keep `tsc` on
96+
vendor even if a nested published copy reappears. Do not remove either
97+
layer without re-checking `bun run typecheck` against a layout that
98+
still has nested `@intx/types` under a published `@intx/*` package.
99+
73100
This is also what collapses a duplicate-dependency problem: before
74101
`@intx/types` was vendored, every published `@intx/*` package we consumed
75102
carried its own nested `arktype` install (pinned to whatever `arktype` minor

tsconfig.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
"baseUrl": ".",
77
"paths": {
88
"@corbits/provider-opencode-go": ["./packages/opencode-go/src/index.ts"],
9-
"@corbits/first-class-providers": ["./packages/first-class-providers/src/index.ts"]
9+
"@corbits/first-class-providers": ["./packages/first-class-providers/src/index.ts"],
10+
"@intx/types": ["./vendor/intx-types/src/index.ts"],
11+
"@intx/types/*": ["./vendor/intx-types/src/*"]
1012
}
1113
},
1214
"include": ["src/**/*.ts", "packages/**/*.ts"]

0 commit comments

Comments
 (0)