Move common primitives to src/common/primitives/ (phase 1 of #5963)#6008
Draft
Tyriar wants to merge 6 commits into
Draft
Move common primitives to src/common/primitives/ (phase 1 of #5963)#6008Tyriar wants to merge 6 commits into
Tyriar wants to merge 6 commits into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:Async,CircularList,Color,Event,Lifecycle,MultiKeyMap,Platform,SortedList,StringBuilder,TaskQueue,Versionbuffer/— buffer, cells, lines, markers, reflowdata/—Charsets,EscapeSequencesinput/— keyboard, text decoding, write buffer, color parsingparser/— escape sequence parser and sub-parsersWhat stayed in place (runtime layer, for a follow-up)
CoreTerminal,InputHandler,WindowsMode,Types.ts,TestUtils.test.tsservices/,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 undersrc/common/, so existingcommon/*→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— passnpm run test-unit— 3475 passing