Skip to content

Move common primitives to src/common/primitives/ (phase 1 of #5963)#6008

Draft
Tyriar wants to merge 6 commits into
masterfrom
cursor/primitives-folder-phase1-86d8
Draft

Move common primitives to src/common/primitives/ (phase 1 of #5963)#6008
Tyriar wants to merge 6 commits into
masterfrom
cursor/primitives-folder-phase1-86d8

Conversation

@Tyriar

@Tyriar Tyriar commented Jun 6, 2026

Copy link
Copy Markdown
Member

Phase 1 of #5963: mechanical folder restructure that moves building-block code under src/common/primitives/, per the primitives/runtime separation.

What moved

src/common/primitives/ now contains:

  • Root utilities: Async, CircularList, Color, Event, Lifecycle, MultiKeyMap, Platform, SortedList, StringBuilder, TaskQueue, Version
  • buffer/ — buffer, cells, lines, markers, reflow
  • data/Charsets, EscapeSequences
  • input/ — keyboard, text decoding, write buffer, color parsing
  • parser/ — escape sequence parser and sub-parsers

What stayed in place (runtime layer, for a follow-up)

  • CoreTerminal, InputHandler, WindowsMode, Types.ts, TestUtils.test.ts
  • services/, public/

Imports

Source imports were updated to the new paths (e.g. common/primitives/buffer/Buffer, ../../common/primitives/Lifecycle). No tsconfig path mapping changes — primitives remain under src/common/, so existing common/*src/common/* aliases work as before.

Interdependencies between primitives and the rest of common/ are intentionally unchanged for this phase.

Testing

  • npm run build && npm run esbuild — pass
  • npm run test-unit — 3475 passing
Open in Web Open in Cursor 

cursoragent and others added 6 commits June 6, 2026 18:21
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>
Primitives remain under src/common/, so common/* aliases do not need
a separate primitives entry. Restore original tsconfig paths.

Co-authored-by: Daniel Imms <Tyriar@users.noreply.github.com>
src/common/**/*.ts already covers primitives since they remain under
common/. No build configuration changes are needed for this move.

Co-authored-by: Daniel Imms <Tyriar@users.noreply.github.com>
Extract low-level types (IParams, ParamsArray, IDisposable, color,
keyboard, mouse, charset, etc.) into primitives/Types.ts. Keep
runtime/integration types (ITerminalOptions, IInputHandler, terminal
modes) in common/Types.ts. Lifecycle re-exports IDisposable from
primitives/Types.ts.

Co-authored-by: Daniel Imms <Tyriar@users.noreply.github.com>
Co-authored-by: Daniel Imms <Tyriar@users.noreply.github.com>
Co-authored-by: Daniel Imms <Tyriar@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants