Full common split: composite tsconfigs and target-* modules

- Add composite TypeScript projects for common/primitives and common/runtime
- Decouple primitives from runtime (buffer service interfaces, UnicodeProperties, CellTypes, etc.)
- Move Types.ts to runtime; re-export primitive types from runtime/Types
- Rename src/browser -> src/target-browser, src/headless -> src/target-headless
- Update import paths (target-browser/*, target-headless/*) across repo
- Fix esbuild outbase so common/* and target-* resolve under out-esbuild/
- Point unicode addons at primitives for UnicodeTypes/UnicodeProperties
- Update ARCHITECTURE.md and AGENTS.md

Co-authored-by: Daniel Imms <Tyriar@users.noreply.github.com>
This commit is contained in:
Cursor Agent
2026-05-31 00:19:43 +00:00
co-authored by Daniel Imms
parent 9a65429a30
commit c569e5ab19
188 changed files with 879 additions and 729 deletions
@@ -7,7 +7,7 @@ import { perfContext, before, ThroughputRuntimeCase } from 'xterm-benchmark';
import { spawn } from 'node-pty';
import { Utf8ToUtf32, stringFromCodePoint } from 'common/input/TextDecoder';
import { Terminal } from 'browser/public/Terminal';
import { Terminal } from 'target-browser/public/Terminal';
import { SerializeAddon } from 'SerializeAddon';
class TestTerminal extends Terminal {
@@ -17,7 +17,7 @@
"../../../src/common/runtime/*",
"../../../src/common/*"
],
"browser/*": ["../../../src/browser/*"],
"target-browser/*": ["../../../src/target-browser/*"],
"SerializeAddon": ["../src/SerializeAddon"],
"@xterm/addon-serialize": [
"../typings/addon-serialize.d.ts"
@@ -28,6 +28,6 @@
"exclude": ["../../../**/*test.ts", "../../**/*api.ts"],
"references": [
{ "path": "../../../src/common" },
{ "path": "../../../src/browser" }
{ "path": "../../../src/target-browser" }
]
}
@@ -6,10 +6,10 @@
import jsdom = require('jsdom');
import { assert } from 'chai';
import { SerializeAddon } from './SerializeAddon';
import { Terminal } from 'browser/public/Terminal';
import { SelectionModel } from 'browser/selection/SelectionModel';
import { Terminal } from 'target-browser/public/Terminal';
import { SelectionModel } from 'target-browser/selection/SelectionModel';
import { IBufferService } from 'common/services/Services';
import { ThemeService } from 'browser/services/ThemeService';
import { ThemeService } from 'target-browser/services/ThemeService';
function sgr(...seq: string[]): string {
return `\x1b[${seq.join(';')}m`;
+1 -1
View File
@@ -8,7 +8,7 @@
import type { IBuffer, IBufferCell, IBufferRange, ITerminalAddon, Terminal } from '@xterm/xterm';
import type { IHTMLSerializeOptions, SerializeAddon as ISerializeApi, ISerializeOptions, ISerializeRange } from '@xterm/addon-serialize';
import { IAttributeData, IColor } from 'common/Types';
import { DEFAULT_ANSI_COLORS } from 'browser/Types';
import { DEFAULT_ANSI_COLORS } from 'target-browser/Types';
import { UnderlineStyle } from 'common/buffer/Constants';
function constrain(value: number, low: number, high: number): number {
+3 -3
View File
@@ -16,8 +16,8 @@
"../../../src/common/runtime/*",
"../../../src/common/*"
],
"browser/*": [
"../../../src/browser/*"
"target-browser/*": [
"../../../src/target-browser/*"
],
"@xterm/addon-serialize": [
"../typings/addon-serialize.d.ts"
@@ -38,7 +38,7 @@
"path": "../../../src/common"
},
{
"path": "../../../src/browser"
"path": "../../../src/target-browser"
}
]
}
+3 -3
View File
@@ -15,8 +15,8 @@
"../../../src/common/runtime/*",
"../../../src/common/*"
],
"browser/*": [
"../../../src/browser/*"
"target-browser/*": [
"../../../src/target-browser/*"
]
},
"strict": true,
@@ -33,7 +33,7 @@
"path": "../../../src/common"
},
{
"path": "../../../src/browser"
"path": "../../../src/target-browser"
},
{
"path": "../../../test/playwright"
+1 -1
View File
@@ -26,7 +26,7 @@ module.exports = {
extensions: [ '.js' ],
alias: {
common: path.resolve('../../out/common'),
browser: path.resolve('../../out/browser')
browser: path.resolve('../../out/target-browser')
}
},
output: {