chore(build): split the liveshare protocol compiler faces

The package carried one Host-based tsconfig that both aggregates registered, so the browser carrier
was compiled under the Host face while the wire codecs that use Buffer were compiled under the same
config. It now follows the repository's double-face template: a solution-only package root, a Host
leaf (wire codecs, identity contract, shared vocabulary, and the root barrel that re-exports the
carrier), and a browser leaf for the viewer carrier and the pure types it shares. The two repository
aggregates register the matching leaf, and the carrier stays in the Host file list because the root
barrel re-exports it for the Relay's script generation.

The tsdown comment now states the two compiler faces and why only the Host face publishes runtime
modules.
This commit is contained in:
mektpoy committed 2026-10-23 16:13:23 +08:00
1 parent 202c196e00
commit ddd9cbc243
6 files changed
+47 -13

No files matched your search

@@ -0,0 +1,13 @@
{
"extends": "../../../tsconfig.base.client.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "lib/types",
"tsBuildInfoFile": "lib/tsconfig.client.tsbuildinfo"
},
"files": [
"src/viewer-carrier.ts",
"src/viewer-states.ts",
"src/identity/types.ts"
]
}
@@ -0,0 +1,23 @@
{
"extends": "../../../tsconfig.base.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "lib/types",
"tsBuildInfoFile": "lib/tsconfig.host.tsbuildinfo"
},
"files": [
"src/index.ts",
"src/tunnel-protocol.ts",
"src/viewer-carrier.ts",
"src/viewer-states.ts",
"src/identity/index.ts",
"src/identity/keys.ts",
"src/identity/mock.ts",
"src/identity/types.ts"
],
"references": [
{
"path": "../../util/brand"
}
]
}
@@ -1,14 +1,7 @@
{
"extends": "../../../tsconfig.base.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "lib/types",
"tsBuildInfoFile": "lib/tsconfig.tsbuildinfo"
},
"include": [
"src"
],
"files": [],
"references": [
{ "path": "../../util/brand" }
{ "path": "./tsconfig.host.json" },
{ "path": "./tsconfig.client.json" }
]
}
@@ -1,7 +1,12 @@
import type { UserConfig } from 'tsdown'
import { defineConfig } from 'tsdown'
/** Dependency-free Host code shared by the owner bundle and the Relay: no browser face. */
/**
* Dependency-free code shared by the owner bundle and the Relay. The package carries two compiler
* faces — a Host leaf for the wire codecs and identity contract, and a browser leaf for the viewer
* carrier — but only the Host face publishes runtime modules; the carrier reaches a browser as
* generated source text, so it needs no client bundle.
*/
export default defineConfig(({ env }) => {
if (env?.DSH_BUILD_FACE === 'client') return { entry: '' } satisfies UserConfig
return {
+1 -1
View File
@@ -89,7 +89,7 @@
{ "path": "./packages/client/ui-primitives" },
{ "path": "./packages/client/modules" },
{ "path": "./packages/experimental/inspector/tsconfig.client.json" },
{ "path": "./packages/experimental/liveshare-protocol" },
{ "path": "./packages/experimental/liveshare-protocol/tsconfig.client.json" },
{ "path": "./packages/experimental/session-inspector" },
{ "path": "./packages/client/hmr" },
{ "path": "./packages/client/connection/tsconfig.client.json" },
+1 -1
View File
@@ -528,7 +528,7 @@
{ "path": "./packages/experimental/agent-team" },
{ "path": "./packages/experimental/agent-team-profile" },
{ "path": "./packages/experimental/inspector-profile" },
{ "path": "./packages/experimental/liveshare-protocol" },
{ "path": "./packages/experimental/liveshare-protocol/tsconfig.host.json" },
{ "path": "./packages/experimental/tool-agent-team" },
{ "path": "./packages/workflow/workflow" },
{ "path": "./packages/workflow/workflow-ptc" },