Move common primitives to src/common/primitives/

Phase 1 of #5963: reorganize building blocks (buffer, parser, input,
data, and shared utilities) under common/primitives/. Runtime code
(services, public API, CoreTerminal, InputHandler) stays in place.

Update import paths across browser, headless, addons, and tests.
Add TypeScript path mappings so common/* aliases resolve primitives
first, then the common root.

Co-authored-by: Daniel Imms <Tyriar@users.noreply.github.com>
This commit is contained in:
Cursor Agent
2026-06-06 18:21:03 +00:00
co-authored by Daniel Imms
parent 3cdbc77386
commit 701c0affd5
187 changed files with 320 additions and 284 deletions
@@ -6,7 +6,7 @@
import { perfContext, before, ThroughputRuntimeCase } from 'xterm-benchmark';
import { spawn } from 'node-pty';
import { Utf8ToUtf32, stringFromCodePoint } from 'common/input/TextDecoder';
import { Utf8ToUtf32, stringFromCodePoint } from 'common/primitives/input/TextDecoder';
import { Terminal } from 'browser/public/Terminal';
import { SerializeAddon } from 'SerializeAddon';
@@ -12,7 +12,8 @@
"target": "es2021",
"module": "nodenext",
"paths": {
"common/*": ["../../../src/common/*"],
"common/*": ["../../../src/common/primitives/*",
"../../../src/common/*"],
"browser/*": ["../../../src/browser/*"],
"SerializeAddon": ["../src/SerializeAddon"],
"@xterm/addon-serialize": [
+2 -2
View File
@@ -8,9 +8,9 @@
import type { IBuffer, IBufferCell, IBufferRange, ITerminalAddon, Terminal } from '@xterm/xterm';
import type { IHTMLSerializeOptions, SerializeAddon as ISerializeApi, ISerializeOptions, ISerializeRange } from '@xterm/addon-serialize';
import { IColor } from 'common/Types';
import { IAttributeData } from 'common/buffer/Types';
import { IAttributeData } from 'common/primitives/buffer/Types';
import { DEFAULT_ANSI_COLORS } from 'browser/Types';
import { UnderlineStyle } from 'common/buffer/Constants';
import { UnderlineStyle } from 'common/primitives/buffer/Constants';
function constrain(value: number, low: number, high: number): number {
return Math.max(low, Math.min(value, high));
+1
View File
@@ -12,6 +12,7 @@
"removeComments": true,
"paths": {
"common/*": [
"../../../src/common/primitives/*",
"../../../src/common/*"
],
"browser/*": [
@@ -11,6 +11,7 @@
"removeComments": true,
"paths": {
"common/*": [
"../../../src/common/primitives/*",
"../../../src/common/*"
],
"browser/*": [