[chore]: fix ts package boundaries
Merged
SE
3mo ago+317+317+012345678901234567890123456789-265-265-012345678901234567890123456789
why
the protocol package previously owned a repository-wide TypeScript config that also checked SDK TS, extension, & root tooling files. Turbo was still running that typecheck as a protocol package task, so changes outside the protocol package could reuse a stale cached result
giving each package ownership of its own TypeScript program makes the check graph match the source graph, closes gaps in the old umbrella config, & lets Turbo invalidate checks through declared workspace dependencies
what changed
- added package-owned TypeScript configs & typecheck scripts for the extension, SDK TS, & selected root tooling
- narrowed the protocol TypeScript config to protocol-owned source, tests, schema generation, & type tests
- added internal protocol source exports & declared the private protocol workspace package as an SDK TS and extension development dependency
- replaced SDK TS & extension filesystem imports into the protocol package with explicit package subpath imports
- moved RPC client tests from protocol to SDK TS, moved the fake-WebSocket CDP transport test to extension, & moved the full client/extension browser smoke test to SDK TS
- removed the now-empty protocol browser test script & Turbo task
- replaced cross-package Turbo input globs with package-owned typecheck tasks & workspace dependency edges
- scoped the root tooling task to
rules/ast-grep&scripts/release - removed cross-package unit-test cache inputs now covered by the workspace graph
test plan
- Run protocol, extension, SDK TS, & root tooling typechecks directly.
- Verify Turbo's dry typecheck graph has protocol as the upstream dependency of SDK TS & extension, with no package task owning source outside its package.
- Verify Turbo's dry unit-test graph derives protocol invalidation through workspace build dependencies & no protocol browser task remains.
- Run protocol unit tests & the moved SDK TS and extension tests.
- Build protocol, extension, & SDK TS and regenerate repository artifacts.
- Verify SDK JavaScript & declaration output contain no unresolved private protocol imports.
Summary by cubic
Fixes stale Turbo typecheck caching by giving each package ownership of its own TypeScript config. The protocol package previously ran a repository-wide typecheck, so changes outside it could reuse a stale cached result.
What changed
- Added package-owned typecheck scripts and tsconfigs for the extension, SDK TS, and root tooling, and narrowed the protocol tsconfig to protocol-owned source.
- Replaced filesystem imports into
packages/protocolwith@browserbasehq/stagehand-protocolsubpath imports and declared the private protocol package as a dev dependency of SDK TS and the extension. - Moved RPC client tests to SDK TS, the fake-WebSocket CDP transport test to the extension, and the browser smoke test to SDK TS; removed the protocol browser test task.
- Replaced cross-package Turbo input globs with workspace dependency edges so typecheck and unit-test invalidation follows the source graph.