From 49c8270b1c0555a1611a1172ae6f021a34db9052 Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Sun, 26 May 2019 11:46:58 -0700 Subject: [PATCH] Use absolute paths for modules in root project --- .vscode/tasks.json | 2 +- src/AccessibilityManager.ts | 10 ++++----- src/Buffer.test.ts | 4 ++-- src/Buffer.ts | 10 ++++----- src/BufferSet.ts | 4 ++-- src/CharMeasure.ts | 2 +- src/CharWidth.test.ts | 2 +- src/CharWidth.ts | 2 +- src/EscapeSequenceParser.test.ts | 2 +- src/EscapeSequenceParser.ts | 4 ++-- src/InputHandler.test.ts | 4 ++-- src/InputHandler.ts | 14 ++++++------ src/Linkifier.test.ts | 6 ++--- src/Linkifier.ts | 2 +- src/MouseZoneManager.ts | 4 ++-- src/SelectionManager.test.ts | 4 ++-- src/SelectionManager.ts | 8 +++---- src/Terminal.integration.ts | 2 +- src/Terminal.test.ts | 2 +- src/Terminal.ts | 22 +++++++++---------- src/TestUtils.test.ts | 10 ++++----- src/Types.ts | 8 +++---- src/Viewport.ts | 6 ++--- src/WindowsMode.ts | 2 +- src/handlers/AltClickHandler.ts | 6 ++--- src/public/Terminal.ts | 4 ++-- src/renderer/BaseRenderLayer.ts | 8 +++---- src/renderer/CharacterJoinerRegistry.test.ts | 6 ++--- src/renderer/CharacterJoinerRegistry.ts | 4 ++-- src/renderer/CursorRenderLayer.ts | 6 ++--- src/renderer/LinkRenderLayer.ts | 2 +- src/renderer/RenderCoordinator.ts | 12 +++++----- src/renderer/Renderer.ts | 4 ++-- src/renderer/SelectionRenderLayer.ts | 2 +- src/renderer/TextRenderLayer.ts | 6 ++--- src/renderer/Types.ts | 2 +- src/renderer/atlas/CharAtlasCache.ts | 2 +- src/renderer/atlas/CharAtlasGenerator.ts | 4 ++-- src/renderer/atlas/CharAtlasUtils.ts | 4 ++-- src/renderer/atlas/DynamicCharAtlas.ts | 6 ++--- src/renderer/atlas/StaticCharAtlas.ts | 2 +- src/renderer/atlas/Types.ts | 2 +- src/renderer/dom/DomRenderer.ts | 4 ++-- .../dom/DomRendererRowFactory.test.ts | 4 ++-- src/tsconfig.json | 6 +++++ 45 files changed, 119 insertions(+), 113 deletions(-) diff --git a/.vscode/tasks.json b/.vscode/tasks.json index b0a8a68c7..2f752faf0 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -36,7 +36,7 @@ }, { "label": "Start demo", - "dependsOn": ["npm: watch", "npm: package", "npm: start"], + "dependsOn": ["npm: watch", "npm: start"], "group": { "kind": "build", "isDefault": true diff --git a/src/AccessibilityManager.ts b/src/AccessibilityManager.ts index cf6dbddac..a2a6209c3 100644 --- a/src/AccessibilityManager.ts +++ b/src/AccessibilityManager.ts @@ -5,11 +5,11 @@ import * as Strings from './Strings'; import { ITerminal, IBuffer } from './Types'; -import { isMac } from './common/Platform'; -import { RenderDebouncer } from './ui/RenderDebouncer'; -import { addDisposableDomListener } from './ui/Lifecycle'; -import { Disposable } from './common/Lifecycle'; -import { ScreenDprMonitor } from './ui/ScreenDprMonitor'; +import { isMac } from 'common/Platform'; +import { RenderDebouncer } from 'ui/RenderDebouncer'; +import { addDisposableDomListener } from 'ui/Lifecycle'; +import { Disposable } from 'common/Lifecycle'; +import { ScreenDprMonitor } from 'ui/ScreenDprMonitor'; import { IRenderDimensions } from './renderer/Types'; const MAX_ROWS_TO_READ = 20; diff --git a/src/Buffer.test.ts b/src/Buffer.test.ts index 087d0ae52..205e2a439 100644 --- a/src/Buffer.test.ts +++ b/src/Buffer.test.ts @@ -6,9 +6,9 @@ import { assert, expect } from 'chai'; import { ITerminal } from './Types'; import { Buffer } from './Buffer'; -import { CircularList } from './common/CircularList'; +import { CircularList } from 'common/CircularList'; import { MockTerminal, TestTerminal } from './TestUtils.test'; -import { BufferLine, CellData, DEFAULT_ATTR_DATA } from './core/buffer/BufferLine'; +import { BufferLine, CellData, DEFAULT_ATTR_DATA } from 'core/buffer/BufferLine'; const INIT_COLS = 80; const INIT_ROWS = 24; diff --git a/src/Buffer.ts b/src/Buffer.ts index 37d61d888..82a9780c6 100644 --- a/src/Buffer.ts +++ b/src/Buffer.ts @@ -3,12 +3,12 @@ * @license MIT */ -import { CircularList, IInsertEvent } from './common/CircularList'; +import { CircularList, IInsertEvent } from 'common/CircularList'; import { ITerminal, IBuffer, BufferIndex, IBufferStringIterator, IBufferStringIteratorResult } from './Types'; -import { IBufferLine, ICellData, IAttributeData } from './core/Types'; -import { BufferLine, CellData, NULL_CELL_CHAR, NULL_CELL_WIDTH, NULL_CELL_CODE, WHITESPACE_CELL_CHAR, WHITESPACE_CELL_WIDTH, WHITESPACE_CELL_CODE, CHAR_DATA_WIDTH_INDEX, CHAR_DATA_CHAR_INDEX, DEFAULT_ATTR_DATA } from './core/buffer/BufferLine'; -import { reflowLargerApplyNewLayout, reflowLargerCreateNewLayout, reflowLargerGetLinesToRemove, reflowSmallerGetNewLineLengths, getWrappedLineTrimmedLength } from './core/buffer/BufferReflow'; -import { Marker } from './core/buffer/Marker'; +import { IBufferLine, ICellData, IAttributeData } from 'core/Types'; +import { BufferLine, CellData, NULL_CELL_CHAR, NULL_CELL_WIDTH, NULL_CELL_CODE, WHITESPACE_CELL_CHAR, WHITESPACE_CELL_WIDTH, WHITESPACE_CELL_CODE, CHAR_DATA_WIDTH_INDEX, CHAR_DATA_CHAR_INDEX, DEFAULT_ATTR_DATA } from 'core/buffer/BufferLine'; +import { reflowLargerApplyNewLayout, reflowLargerCreateNewLayout, reflowLargerGetLinesToRemove, reflowSmallerGetNewLineLengths, getWrappedLineTrimmedLength } from 'core/buffer/BufferReflow'; +import { Marker } from 'core/buffer/Marker'; export const MAX_BUFFER_SIZE = 4294967295; // 2^32 - 1 diff --git a/src/BufferSet.ts b/src/BufferSet.ts index f22b92dca..c2aee6a7f 100644 --- a/src/BufferSet.ts +++ b/src/BufferSet.ts @@ -4,9 +4,9 @@ */ import { ITerminal, IBufferSet, IBuffer } from './Types'; -import { IAttributeData } from './core/Types'; +import { IAttributeData } from 'core/Types'; import { Buffer } from './Buffer'; -import { EventEmitter2, IEvent } from './common/EventEmitter2'; +import { EventEmitter2, IEvent } from 'common/EventEmitter2'; /** * The BufferSet represents the set of two buffers used by xterm terminals (normal and alt) and diff --git a/src/CharMeasure.ts b/src/CharMeasure.ts index efee89729..9ef22b63d 100644 --- a/src/CharMeasure.ts +++ b/src/CharMeasure.ts @@ -4,7 +4,7 @@ */ import { ICharMeasure, ITerminalOptions } from './Types'; -import { EventEmitter2, IEvent } from './common/EventEmitter2'; +import { EventEmitter2, IEvent } from 'common/EventEmitter2'; /** * Utility class that measures the size of a character. Measurements are done in diff --git a/src/CharWidth.test.ts b/src/CharWidth.test.ts index 17822fa28..4aec39953 100644 --- a/src/CharWidth.test.ts +++ b/src/CharWidth.test.ts @@ -7,7 +7,7 @@ import { TestTerminal } from './TestUtils.test'; import { assert } from 'chai'; import { getStringCellWidth, wcwidth } from './CharWidth'; import { IBuffer } from './Types'; -import { CellData, CHAR_DATA_WIDTH_INDEX, CHAR_DATA_CHAR_INDEX } from './core/buffer/BufferLine'; +import { CellData, CHAR_DATA_WIDTH_INDEX, CHAR_DATA_CHAR_INDEX } from 'core/buffer/BufferLine'; describe('getStringCellWidth', function(): void { diff --git a/src/CharWidth.ts b/src/CharWidth.ts index 43cd948ec..24f53450f 100644 --- a/src/CharWidth.ts +++ b/src/CharWidth.ts @@ -3,7 +3,7 @@ * @license MIT */ -import { fill } from './common/TypedArrayUtils'; +import { fill } from 'common/TypedArrayUtils'; export const wcwidth = (function(opts: {nul: number, control: number}): (ucs: number) => number { // extracted from https://www.cl.cam.ac.uk/%7Emgk25/ucs/wcwidth.c diff --git a/src/EscapeSequenceParser.test.ts b/src/EscapeSequenceParser.test.ts index 135cc393e..fec56b625 100644 --- a/src/EscapeSequenceParser.test.ts +++ b/src/EscapeSequenceParser.test.ts @@ -6,7 +6,7 @@ import { ParserState, IDcsHandler, IParsingState } from './Types'; import { EscapeSequenceParser, TransitionTable, VT500_TRANSITION_TABLE } from './EscapeSequenceParser'; import * as chai from 'chai'; -import { StringToUtf32, stringFromCodePoint } from './core/input/TextDecoder'; +import { StringToUtf32, stringFromCodePoint } from 'core/input/TextDecoder'; function r(a: number, b: number): string[] { let c = b - a; diff --git a/src/EscapeSequenceParser.ts b/src/EscapeSequenceParser.ts index 197a36570..09ffc8d60 100644 --- a/src/EscapeSequenceParser.ts +++ b/src/EscapeSequenceParser.ts @@ -5,8 +5,8 @@ import { ParserState, ParserAction, IParsingState, IDcsHandler, IEscapeSequenceParser } from './Types'; import { IDisposable } from 'xterm'; -import { Disposable } from './common/Lifecycle'; -import { utf32ToString } from './core/input/TextDecoder'; +import { Disposable } from 'common/Lifecycle'; +import { utf32ToString } from 'core/input/TextDecoder'; interface IHandlerCollection { [key: string]: T[]; diff --git a/src/InputHandler.test.ts b/src/InputHandler.test.ts index b9a494f9e..f3a217a13 100644 --- a/src/InputHandler.test.ts +++ b/src/InputHandler.test.ts @@ -7,8 +7,8 @@ import { assert, expect } from 'chai'; import { InputHandler } from './InputHandler'; import { MockInputHandlingTerminal, TestTerminal } from './TestUtils.test'; import { Terminal } from './Terminal'; -import { IBufferLine } from './core/Types'; -import { CellData, Attributes, AttributeData, DEFAULT_ATTR_DATA } from './core/buffer/BufferLine'; +import { IBufferLine } from 'core/Types'; +import { CellData, Attributes, AttributeData, DEFAULT_ATTR_DATA } from 'core/buffer/BufferLine'; describe('InputHandler', () => { describe('save and restore cursor', () => { diff --git a/src/InputHandler.ts b/src/InputHandler.ts index 94c7e96b2..b75b89bd4 100644 --- a/src/InputHandler.ts +++ b/src/InputHandler.ts @@ -5,16 +5,16 @@ */ import { IInputHandler, IDcsHandler, IEscapeSequenceParser, IInputHandlingTerminal } from './Types'; -import { C0, C1 } from './common/data/EscapeSequences'; -import { CHARSETS, DEFAULT_CHARSET } from './core/data/Charsets'; +import { C0, C1 } from 'common/data/EscapeSequences'; +import { CHARSETS, DEFAULT_CHARSET } from 'core/data/Charsets'; import { wcwidth } from './CharWidth'; import { EscapeSequenceParser } from './EscapeSequenceParser'; import { IDisposable } from 'xterm'; -import { Disposable } from './common/Lifecycle'; -import { concat } from './common/TypedArrayUtils'; -import { StringToUtf32, stringFromCodePoint, utf32ToString, Utf8ToUtf32 } from './core/input/TextDecoder'; -import { CellData, Attributes, FgFlags, BgFlags, AttributeData, NULL_CELL_WIDTH, NULL_CELL_CODE, DEFAULT_ATTR_DATA } from './core/buffer/BufferLine'; -import { EventEmitter2, IEvent } from './common/EventEmitter2'; +import { Disposable } from 'common/Lifecycle'; +import { concat } from 'common/TypedArrayUtils'; +import { StringToUtf32, stringFromCodePoint, utf32ToString, Utf8ToUtf32 } from 'core/input/TextDecoder'; +import { CellData, Attributes, FgFlags, BgFlags, AttributeData, NULL_CELL_WIDTH, NULL_CELL_CODE, DEFAULT_ATTR_DATA } from 'core/buffer/BufferLine'; +import { EventEmitter2, IEvent } from 'common/EventEmitter2'; /** * Map collect to glevel. Used in `selectCharset`. diff --git a/src/Linkifier.test.ts b/src/Linkifier.test.ts index 6a2f0ee92..e02105d85 100644 --- a/src/Linkifier.test.ts +++ b/src/Linkifier.test.ts @@ -5,11 +5,11 @@ import { assert } from 'chai'; import { IMouseZoneManager, IMouseZone, ILinkMatcher, ITerminal } from './Types'; -import { IBufferLine } from './core/Types'; +import { IBufferLine } from 'core/Types'; import { Linkifier } from './Linkifier'; import { MockBuffer, MockTerminal, TestTerminal } from './TestUtils.test'; -import { CircularList } from './common/CircularList'; -import { BufferLine, CellData } from './core/buffer/BufferLine'; +import { CircularList } from 'common/CircularList'; +import { BufferLine, CellData } from 'core/buffer/BufferLine'; class TestLinkifier extends Linkifier { constructor(terminal: ITerminal) { diff --git a/src/Linkifier.ts b/src/Linkifier.ts index 9744929e1..ae9a0734b 100644 --- a/src/Linkifier.ts +++ b/src/Linkifier.ts @@ -6,7 +6,7 @@ import { ILinkifierEvent, ILinkMatcher, LinkMatcherHandler, ILinkMatcherOptions, ILinkifier, ITerminal, IBufferStringIteratorResult, IMouseZoneManager } from './Types'; import { MouseZone } from './MouseZoneManager'; import { getStringCellWidth } from './CharWidth'; -import { EventEmitter2, IEvent } from './common/EventEmitter2'; +import { EventEmitter2, IEvent } from 'common/EventEmitter2'; /** * The Linkifier applies links to rows shortly after they have been refreshed. diff --git a/src/MouseZoneManager.ts b/src/MouseZoneManager.ts index 2f293df14..737bfc91a 100644 --- a/src/MouseZoneManager.ts +++ b/src/MouseZoneManager.ts @@ -4,8 +4,8 @@ */ import { ITerminal, IMouseZoneManager, IMouseZone } from './Types'; -import { Disposable } from './common/Lifecycle'; -import { addDisposableDomListener } from './ui/Lifecycle'; +import { Disposable } from 'common/Lifecycle'; +import { addDisposableDomListener } from 'ui/Lifecycle'; const HOVER_DURATION = 500; diff --git a/src/SelectionManager.test.ts b/src/SelectionManager.test.ts index 24ba01005..77a1612f4 100644 --- a/src/SelectionManager.test.ts +++ b/src/SelectionManager.test.ts @@ -9,9 +9,9 @@ import { SelectionManager, SelectionMode } from './SelectionManager'; import { SelectionModel } from './SelectionModel'; import { BufferSet } from './BufferSet'; import { ITerminal, IBuffer } from './Types'; -import { IBufferLine } from './core/Types'; +import { IBufferLine } from 'core/Types'; import { MockTerminal } from './TestUtils.test'; -import { BufferLine, CellData } from './core/buffer/BufferLine'; +import { BufferLine, CellData } from 'core/buffer/BufferLine'; class TestMockTerminal extends MockTerminal { emit(event: string, data: any): void {} diff --git a/src/SelectionManager.ts b/src/SelectionManager.ts index 39d6c3a4c..21283b8fa 100644 --- a/src/SelectionManager.ts +++ b/src/SelectionManager.ts @@ -4,15 +4,15 @@ */ import { ITerminal, ISelectionManager, IBuffer, ISelectionRedrawRequestEvent } from './Types'; -import { IBufferLine } from './core/Types'; +import { IBufferLine } from 'core/Types'; import { MouseHelper } from './MouseHelper'; -import * as Browser from './common/Platform'; +import * as Browser from 'common/Platform'; import { CharMeasure } from './CharMeasure'; import { SelectionModel } from './SelectionModel'; import { AltClickHandler } from './handlers/AltClickHandler'; -import { CellData } from './core/buffer/BufferLine'; +import { CellData } from 'core/buffer/BufferLine'; import { IDisposable } from 'xterm'; -import { EventEmitter2, IEvent } from './common/EventEmitter2'; +import { EventEmitter2, IEvent } from 'common/EventEmitter2'; /** * The number of pixels the mouse needs to be above or below the viewport in diff --git a/src/Terminal.integration.ts b/src/Terminal.integration.ts index 6464e7de5..596745866 100644 --- a/src/Terminal.integration.ts +++ b/src/Terminal.integration.ts @@ -14,7 +14,7 @@ import * as pty from 'node-pty'; import { assert } from 'chai'; import { Terminal } from './Terminal'; import { IViewport } from './Types'; -import { CellData, WHITESPACE_CELL_CHAR } from './core/buffer/BufferLine'; +import { CellData, WHITESPACE_CELL_CHAR } from 'core/buffer/BufferLine'; class TestTerminal extends Terminal { innerWrite(): void { this._innerWrite(); } diff --git a/src/Terminal.test.ts b/src/Terminal.test.ts index 5d54e6f26..56e84da78 100644 --- a/src/Terminal.test.ts +++ b/src/Terminal.test.ts @@ -6,7 +6,7 @@ import { assert, expect } from 'chai'; import { Terminal } from './Terminal'; import { MockViewport, MockCompositionHelper, MockRenderer } from './TestUtils.test'; -import { CellData, DEFAULT_ATTR_DATA } from './core/buffer/BufferLine'; +import { CellData, DEFAULT_ATTR_DATA } from 'core/buffer/BufferLine'; const INIT_COLS = 80; const INIT_ROWS = 24; diff --git a/src/Terminal.ts b/src/Terminal.ts index ff28ab02f..a6903ef71 100644 --- a/src/Terminal.ts +++ b/src/Terminal.ts @@ -26,17 +26,17 @@ import { IRenderer } from './renderer/Types'; import { BufferSet } from './BufferSet'; import { Buffer, MAX_BUFFER_SIZE } from './Buffer'; import { CompositionHelper } from './CompositionHelper'; -import { EventEmitter } from './common/EventEmitter'; +import { EventEmitter } from 'common/EventEmitter'; import { Viewport } from './Viewport'; import { rightClickHandler, moveTextAreaUnderMouseCursor, pasteHandler, copyHandler } from './Clipboard'; -import { C0 } from './common/data/EscapeSequences'; +import { C0 } from 'common/data/EscapeSequences'; import { InputHandler } from './InputHandler'; import { Renderer } from './renderer/Renderer'; import { Linkifier } from './Linkifier'; import { SelectionManager } from './SelectionManager'; import { CharMeasure } from './CharMeasure'; -import * as Browser from './common/Platform'; -import { addDisposableDomListener } from './ui/Lifecycle'; +import * as Browser from 'common/Platform'; +import { addDisposableDomListener } from 'ui/Lifecycle'; import * as Strings from './Strings'; import { MouseHelper } from './MouseHelper'; import { DEFAULT_BELL_SOUND, SoundManager } from './SoundManager'; @@ -45,14 +45,14 @@ import { AccessibilityManager } from './AccessibilityManager'; import { ITheme, IMarker, IDisposable, ISelectionPosition } from 'xterm'; import { removeTerminalFromCache } from './renderer/atlas/CharAtlasCache'; import { DomRenderer } from './renderer/dom/DomRenderer'; -import { IKeyboardEvent } from './common/Types'; -import { evaluateKeyboardEvent } from './core/input/Keyboard'; -import { KeyboardResultType, ICharset, IBufferLine, IAttributeData } from './core/Types'; -import { clone } from './common/Clone'; -import { EventEmitter2, IEvent } from './common/EventEmitter2'; -import { Attributes, DEFAULT_ATTR_DATA } from './core/buffer/BufferLine'; +import { IKeyboardEvent } from 'common/Types'; +import { evaluateKeyboardEvent } from 'core/input/Keyboard'; +import { KeyboardResultType, ICharset, IBufferLine, IAttributeData } from 'core/Types'; +import { clone } from 'common/Clone'; +import { EventEmitter2, IEvent } from 'common/EventEmitter2'; +import { Attributes, DEFAULT_ATTR_DATA } from 'core/buffer/BufferLine'; import { applyWindowsMode } from './WindowsMode'; -import { ColorManager } from './ui/ColorManager'; +import { ColorManager } from 'ui/ColorManager'; import { RenderCoordinator } from './renderer/RenderCoordinator'; // Let it work inside Node.js for automated testing purposes. diff --git a/src/TestUtils.test.ts b/src/TestUtils.test.ts index f83e7d224..11e972b4f 100644 --- a/src/TestUtils.test.ts +++ b/src/TestUtils.test.ts @@ -5,14 +5,14 @@ import { IRenderer, IRenderDimensions } from './renderer/Types'; import { IInputHandlingTerminal, IViewport, ICompositionHelper, ITerminal, IBuffer, IBufferSet, IBrowser, ICharMeasure, ISelectionManager, ITerminalOptions, ILinkifier, IMouseHelper, ILinkMatcherOptions, CharacterJoinerHandler, IBufferStringIterator } from './Types'; -import { IBufferLine, ICellData, IAttributeData } from './core/Types'; -import { ICircularList, XtermListener } from './common/Types'; +import { IBufferLine, ICellData, IAttributeData } from 'core/Types'; +import { ICircularList, XtermListener } from 'common/Types'; import { Buffer } from './Buffer'; -import * as Browser from './common/Platform'; +import * as Browser from 'common/Platform'; import { IDisposable, IMarker, IEvent, ISelectionPosition } from 'xterm'; import { Terminal } from './Terminal'; -import { AttributeData } from './core/buffer/BufferLine'; -import { IColorManager, IColorSet } from './ui/Types'; +import { AttributeData } from 'core/buffer/BufferLine'; +import { IColorManager, IColorSet } from 'ui/Types'; export class TestTerminal extends Terminal { writeSync(data: string): void { diff --git a/src/Types.ts b/src/Types.ts index 4ab165c1f..5c121bada 100644 --- a/src/Types.ts +++ b/src/Types.ts @@ -4,10 +4,10 @@ */ import { ITerminalOptions as IPublicTerminalOptions, IEventEmitter, IDisposable, IMarker, ISelectionPosition } from 'xterm'; -import { ICharset, IAttributeData, ICellData, IBufferLine, CharData } from './core/Types'; -import { ICircularList } from './common/Types'; -import { IEvent } from './common/EventEmitter2'; -import { IColorSet } from './ui/Types'; +import { ICharset, IAttributeData, ICellData, IBufferLine, CharData } from 'core/Types'; +import { ICircularList } from 'common/Types'; +import { IEvent } from 'common/EventEmitter2'; +import { IColorSet } from 'ui/Types'; export type CustomKeyEventHandler = (event: KeyboardEvent) => boolean; diff --git a/src/Viewport.ts b/src/Viewport.ts index e53c99ed7..a7afdb9e3 100644 --- a/src/Viewport.ts +++ b/src/Viewport.ts @@ -5,9 +5,9 @@ import { ITerminal, IViewport } from './Types'; import { CharMeasure } from './CharMeasure'; -import { Disposable } from './common/Lifecycle'; -import { addDisposableDomListener } from './ui/Lifecycle'; -import { IColorSet } from './ui/Types'; +import { Disposable } from 'common/Lifecycle'; +import { addDisposableDomListener } from 'ui/Lifecycle'; +import { IColorSet } from 'ui/Types'; import { IRenderDimensions } from './renderer/Types'; const FALLBACK_SCROLL_BAR_WIDTH = 15; diff --git a/src/WindowsMode.ts b/src/WindowsMode.ts index d7b4bcaec..3bfa2a16d 100644 --- a/src/WindowsMode.ts +++ b/src/WindowsMode.ts @@ -5,7 +5,7 @@ import { IDisposable } from 'xterm'; import { ITerminal } from './Types'; -import { CHAR_DATA_CODE_INDEX, NULL_CELL_CODE, WHITESPACE_CELL_CODE } from './core/buffer/BufferLine'; +import { CHAR_DATA_CODE_INDEX, NULL_CELL_CODE, WHITESPACE_CELL_CODE } from 'core/buffer/BufferLine'; export function applyWindowsMode(terminal: ITerminal): IDisposable { // Winpty does not support wraparound mode which means that lines will never diff --git a/src/handlers/AltClickHandler.ts b/src/handlers/AltClickHandler.ts index 5cf60fa62..43c26498d 100644 --- a/src/handlers/AltClickHandler.ts +++ b/src/handlers/AltClickHandler.ts @@ -4,9 +4,9 @@ */ import { ITerminal } from '../Types'; -import { IBufferLine } from '../core/Types'; -import { ICircularList } from '../common/Types'; -import { C0 } from '../common/data/EscapeSequences'; +import { IBufferLine } from 'core/Types'; +import { ICircularList } from 'common/Types'; +import { C0 } from 'common/data/EscapeSequences'; const enum Direction { UP = 'A', diff --git a/src/public/Terminal.ts b/src/public/Terminal.ts index f1874a3f2..346e514eb 100644 --- a/src/public/Terminal.ts +++ b/src/public/Terminal.ts @@ -5,10 +5,10 @@ import { Terminal as ITerminalApi, ITerminalOptions, IMarker, IDisposable, ILinkMatcherOptions, ITheme, ILocalizableStrings, ITerminalAddon, ISelectionPosition, IBuffer as IBufferApi, IBufferLine as IBufferLineApi, IBufferCell as IBufferCellApi } from 'xterm'; import { ITerminal, IBuffer } from '../Types'; -import { IBufferLine } from '../core/Types'; +import { IBufferLine } from 'core/Types'; import { Terminal as TerminalCore } from '../Terminal'; import * as Strings from '../Strings'; -import { IEvent } from '../common/EventEmitter2'; +import { IEvent } from 'common/EventEmitter2'; import { AddonManager } from './AddonManager'; export class Terminal implements ITerminalApi { diff --git a/src/renderer/BaseRenderLayer.ts b/src/renderer/BaseRenderLayer.ts index bae96d723..c59a4f249 100644 --- a/src/renderer/BaseRenderLayer.ts +++ b/src/renderer/BaseRenderLayer.ts @@ -5,13 +5,13 @@ import { IRenderLayer, IRenderDimensions } from './Types'; import { ITerminal } from '../Types'; -import { ICellData } from '../core/Types'; -import { DEFAULT_COLOR } from '../common/Types'; +import { ICellData } from 'core/Types'; +import { DEFAULT_COLOR } from 'common/Types'; import { DIM_OPACITY, INVERTED_DEFAULT_COLOR, IGlyphIdentifier } from './atlas/Types'; import BaseCharAtlas from './atlas/BaseCharAtlas'; import { acquireCharAtlas } from './atlas/CharAtlasCache'; -import { CellData, AttributeData, WHITESPACE_CELL_CHAR, WHITESPACE_CELL_CODE } from '../core/buffer/BufferLine'; -import { IColorSet } from '../ui/Types'; +import { CellData, AttributeData, WHITESPACE_CELL_CHAR, WHITESPACE_CELL_CODE } from 'core/buffer/BufferLine'; +import { IColorSet } from 'ui/Types'; export abstract class BaseRenderLayer implements IRenderLayer { private _canvas: HTMLCanvasElement; diff --git a/src/renderer/CharacterJoinerRegistry.test.ts b/src/renderer/CharacterJoinerRegistry.test.ts index 948985a46..1ce02b76b 100644 --- a/src/renderer/CharacterJoinerRegistry.test.ts +++ b/src/renderer/CharacterJoinerRegistry.test.ts @@ -6,12 +6,12 @@ import { assert } from 'chai'; import { MockTerminal, MockBuffer } from '../TestUtils.test'; -import { CircularList } from '../common/CircularList'; +import { CircularList } from 'common/CircularList'; import { ICharacterJoinerRegistry } from './Types'; import { CharacterJoinerRegistry } from './CharacterJoinerRegistry'; -import { BufferLine, CellData } from '../core/buffer/BufferLine'; -import { IBufferLine } from '../core/Types'; +import { BufferLine, CellData } from 'core/buffer/BufferLine'; +import { IBufferLine } from 'core/Types'; describe('CharacterJoinerRegistry', () => { let registry: ICharacterJoinerRegistry; diff --git a/src/renderer/CharacterJoinerRegistry.ts b/src/renderer/CharacterJoinerRegistry.ts index 3302c3121..1432e8050 100644 --- a/src/renderer/CharacterJoinerRegistry.ts +++ b/src/renderer/CharacterJoinerRegistry.ts @@ -4,9 +4,9 @@ */ import { ITerminal } from '../Types'; -import { IBufferLine, ICellData, CharData } from '../core/Types'; +import { IBufferLine, ICellData, CharData } from 'core/Types'; import { ICharacterJoinerRegistry, ICharacterJoiner } from './Types'; -import { CellData, Content, AttributeData, WHITESPACE_CELL_CHAR } from '../core/buffer/BufferLine'; +import { CellData, Content, AttributeData, WHITESPACE_CELL_CHAR } from 'core/buffer/BufferLine'; export class JoinedCellData extends AttributeData implements ICellData { private _width: number; diff --git a/src/renderer/CursorRenderLayer.ts b/src/renderer/CursorRenderLayer.ts index 7b5747000..4534603ea 100644 --- a/src/renderer/CursorRenderLayer.ts +++ b/src/renderer/CursorRenderLayer.ts @@ -6,9 +6,9 @@ import { IRenderDimensions } from './Types'; import { BaseRenderLayer } from './BaseRenderLayer'; import { ITerminal } from '../Types'; -import { ICellData } from '../core/Types'; -import { CellData } from '../core/buffer/BufferLine'; -import { IColorSet } from '../ui/Types'; +import { ICellData } from 'core/Types'; +import { CellData } from 'core/buffer/BufferLine'; +import { IColorSet } from 'ui/Types'; interface ICursorState { x: number; diff --git a/src/renderer/LinkRenderLayer.ts b/src/renderer/LinkRenderLayer.ts index c92b10dc6..38dcf4b13 100644 --- a/src/renderer/LinkRenderLayer.ts +++ b/src/renderer/LinkRenderLayer.ts @@ -8,7 +8,7 @@ import { IRenderDimensions } from './Types'; import { BaseRenderLayer } from './BaseRenderLayer'; import { INVERTED_DEFAULT_COLOR } from './atlas/Types'; import { is256Color } from './atlas/CharAtlasUtils'; -import { IColorSet } from '../ui/Types'; +import { IColorSet } from 'ui/Types'; export class LinkRenderLayer extends BaseRenderLayer { private _state: ILinkifierEvent = null; diff --git a/src/renderer/RenderCoordinator.ts b/src/renderer/RenderCoordinator.ts index 251af38f3..b4bc673c1 100644 --- a/src/renderer/RenderCoordinator.ts +++ b/src/renderer/RenderCoordinator.ts @@ -4,12 +4,12 @@ */ import { IRenderer, IRenderDimensions } from './Types'; -import { RenderDebouncer } from '../ui/RenderDebouncer'; -import { EventEmitter2, IEvent } from '../common/EventEmitter2'; -import { Disposable } from '../common/Lifecycle'; -import { ScreenDprMonitor } from '../ui/ScreenDprMonitor'; -import { addDisposableDomListener } from '../ui/Lifecycle'; -import { IColorSet } from '..//ui/Types'; +import { RenderDebouncer } from 'ui/RenderDebouncer'; +import { EventEmitter2, IEvent } from 'common/EventEmitter2'; +import { Disposable } from 'common/Lifecycle'; +import { ScreenDprMonitor } from 'ui/ScreenDprMonitor'; +import { addDisposableDomListener } from 'ui/Lifecycle'; +import { IColorSet } from 'ui/Types'; import { CharacterJoinerHandler } from '../Types'; export class RenderCoordinator extends Disposable { diff --git a/src/renderer/Renderer.ts b/src/renderer/Renderer.ts index b3b93ca70..2fa09824a 100644 --- a/src/renderer/Renderer.ts +++ b/src/renderer/Renderer.ts @@ -10,8 +10,8 @@ import { IRenderLayer, IRenderer, IRenderDimensions, ICharacterJoinerRegistry } import { ITerminal, CharacterJoinerHandler } from '../Types'; import { LinkRenderLayer } from './LinkRenderLayer'; import { CharacterJoinerRegistry } from '../renderer/CharacterJoinerRegistry'; -import { Disposable } from '../common/Lifecycle'; -import { IColorSet } from '../ui/Types'; +import { Disposable } from 'common/Lifecycle'; +import { IColorSet } from 'ui/Types'; export class Renderer extends Disposable implements IRenderer { private _renderLayers: IRenderLayer[]; diff --git a/src/renderer/SelectionRenderLayer.ts b/src/renderer/SelectionRenderLayer.ts index 81e6afbb9..96bf6ec3a 100644 --- a/src/renderer/SelectionRenderLayer.ts +++ b/src/renderer/SelectionRenderLayer.ts @@ -6,7 +6,7 @@ import { ITerminal } from '../Types'; import { IRenderDimensions } from './Types'; import { BaseRenderLayer } from './BaseRenderLayer'; -import { IColorSet } from '../ui/Types'; +import { IColorSet } from 'ui/Types'; interface ISelectionState { start: [number, number]; diff --git a/src/renderer/TextRenderLayer.ts b/src/renderer/TextRenderLayer.ts index b3baad31c..b3b963f2e 100644 --- a/src/renderer/TextRenderLayer.ts +++ b/src/renderer/TextRenderLayer.ts @@ -5,12 +5,12 @@ import { IRenderDimensions, ICharacterJoinerRegistry } from './Types'; import { ITerminal } from '../Types'; -import { CharData, ICellData } from '../core/Types'; +import { CharData, ICellData } from 'core/Types'; import { GridCache } from './GridCache'; import { BaseRenderLayer } from './BaseRenderLayer'; -import { CellData, AttributeData, Content, NULL_CELL_CODE } from '../core/buffer/BufferLine'; +import { CellData, AttributeData, Content, NULL_CELL_CODE } from 'core/buffer/BufferLine'; import { JoinedCellData } from './CharacterJoinerRegistry'; -import { IColorSet } from '../ui/Types'; +import { IColorSet } from 'ui/Types'; /** * This CharData looks like a null character, which will forc a clear and render diff --git a/src/renderer/Types.ts b/src/renderer/Types.ts index 4a4afbf07..d8f637ebf 100644 --- a/src/renderer/Types.ts +++ b/src/renderer/Types.ts @@ -5,7 +5,7 @@ import { ITerminal, CharacterJoinerHandler } from '../Types'; import { IDisposable } from 'xterm'; -import { IColorSet } from '../ui/Types'; +import { IColorSet } from 'ui/Types'; /** * Flags used to render terminal text properly. diff --git a/src/renderer/atlas/CharAtlasCache.ts b/src/renderer/atlas/CharAtlasCache.ts index 30826d5b5..1ac568cf0 100644 --- a/src/renderer/atlas/CharAtlasCache.ts +++ b/src/renderer/atlas/CharAtlasCache.ts @@ -10,7 +10,7 @@ import DynamicCharAtlas from './DynamicCharAtlas'; import NoneCharAtlas from './NoneCharAtlas'; import StaticCharAtlas from './StaticCharAtlas'; import { ICharAtlasConfig } from './Types'; -import { IColorSet } from '../../ui/Types'; +import { IColorSet } from 'ui/Types'; const charAtlasImplementations = { 'none': NoneCharAtlas, diff --git a/src/renderer/atlas/CharAtlasGenerator.ts b/src/renderer/atlas/CharAtlasGenerator.ts index 4452cadb8..d6e3fb0ce 100644 --- a/src/renderer/atlas/CharAtlasGenerator.ts +++ b/src/renderer/atlas/CharAtlasGenerator.ts @@ -4,9 +4,9 @@ */ import { FontWeight } from 'xterm'; -import { isFirefox, isSafari } from '../../common/Platform'; +import { isFirefox, isSafari } from 'common/Platform'; import { ICharAtlasConfig, CHAR_ATLAS_CELL_SPACING } from './Types'; -import { IColor } from '../../ui/Types'; +import { IColor } from 'ui/Types'; /** * Generates a char atlas. diff --git a/src/renderer/atlas/CharAtlasUtils.ts b/src/renderer/atlas/CharAtlasUtils.ts index 762e81418..cc137b3c5 100644 --- a/src/renderer/atlas/CharAtlasUtils.ts +++ b/src/renderer/atlas/CharAtlasUtils.ts @@ -5,8 +5,8 @@ import { ITerminal } from '../../Types'; import { ICharAtlasConfig } from './Types'; -import { DEFAULT_COLOR } from '../../common/Types'; -import { IColorSet } from '../../ui/Types'; +import { DEFAULT_COLOR } from 'common/Types'; +import { IColorSet } from 'ui/Types'; export function generateConfig(scaledCharWidth: number, scaledCharHeight: number, terminal: ITerminal, colors: IColorSet): ICharAtlasConfig { // null out some fields that don't matter diff --git a/src/renderer/atlas/DynamicCharAtlas.ts b/src/renderer/atlas/DynamicCharAtlas.ts index 3239facc9..3acf1b9ae 100644 --- a/src/renderer/atlas/DynamicCharAtlas.ts +++ b/src/renderer/atlas/DynamicCharAtlas.ts @@ -5,11 +5,11 @@ import { DIM_OPACITY, IGlyphIdentifier, INVERTED_DEFAULT_COLOR, ICharAtlasConfig } from './Types'; import BaseCharAtlas from './BaseCharAtlas'; -import { DEFAULT_ANSI_COLORS } from '../../ui/ColorManager'; +import { DEFAULT_ANSI_COLORS } from 'ui/ColorManager'; import { clearColor } from './CharAtlasGenerator'; import LRUMap from './LRUMap'; -import { isFirefox, isSafari } from '../../common/Platform'; -import { IColor } from '../../ui/Types'; +import { isFirefox, isSafari } from 'common/Platform'; +import { IColor } from 'ui/Types'; // In practice we're probably never going to exhaust a texture this large. For debugging purposes, // however, it can be useful to set this to a really tiny value, to verify that LRU eviction works. diff --git a/src/renderer/atlas/StaticCharAtlas.ts b/src/renderer/atlas/StaticCharAtlas.ts index 66beb363f..a806abd85 100644 --- a/src/renderer/atlas/StaticCharAtlas.ts +++ b/src/renderer/atlas/StaticCharAtlas.ts @@ -7,7 +7,7 @@ import { DIM_OPACITY, IGlyphIdentifier, ICharAtlasConfig, CHAR_ATLAS_CELL_SPACIN import { generateStaticCharAtlasTexture } from './CharAtlasGenerator'; import BaseCharAtlas from './BaseCharAtlas'; import { is256Color } from './CharAtlasUtils'; -import { DEFAULT_COLOR } from '../../common/Types'; +import { DEFAULT_COLOR } from 'common/Types'; export default class StaticCharAtlas extends BaseCharAtlas { private _texture: HTMLCanvasElement | ImageBitmap; diff --git a/src/renderer/atlas/Types.ts b/src/renderer/atlas/Types.ts index eabdf1419..f09a2b950 100644 --- a/src/renderer/atlas/Types.ts +++ b/src/renderer/atlas/Types.ts @@ -4,7 +4,7 @@ */ import { FontWeight } from 'xterm'; -import { IColorSet } from '../../ui/Types'; +import { IColorSet } from 'ui/Types'; export const INVERTED_DEFAULT_COLOR = 257; export const DIM_OPACITY = 0.5; diff --git a/src/renderer/dom/DomRenderer.ts b/src/renderer/dom/DomRenderer.ts index 81cc02303..9a800de2f 100644 --- a/src/renderer/dom/DomRenderer.ts +++ b/src/renderer/dom/DomRenderer.ts @@ -7,8 +7,8 @@ import { IRenderer, IRenderDimensions } from '../Types'; import { ILinkifierEvent, ITerminal, CharacterJoinerHandler } from '../../Types'; import { BOLD_CLASS, ITALIC_CLASS, CURSOR_CLASS, CURSOR_STYLE_BLOCK_CLASS, CURSOR_BLINK_CLASS, CURSOR_STYLE_BAR_CLASS, CURSOR_STYLE_UNDERLINE_CLASS, DomRendererRowFactory } from './DomRendererRowFactory'; import { INVERTED_DEFAULT_COLOR } from '../atlas/Types'; -import { Disposable } from '../../common/Lifecycle'; -import { IColorSet } from '../../ui/Types'; +import { Disposable } from 'common/Lifecycle'; +import { IColorSet } from 'ui/Types'; const TERMINAL_CLASS_PREFIX = 'xterm-dom-renderer-owner-'; const ROW_CONTAINER_CLASS = 'xterm-rows'; diff --git a/src/renderer/dom/DomRendererRowFactory.test.ts b/src/renderer/dom/DomRendererRowFactory.test.ts index b25305952..5747eeb25 100644 --- a/src/renderer/dom/DomRendererRowFactory.test.ts +++ b/src/renderer/dom/DomRendererRowFactory.test.ts @@ -6,9 +6,9 @@ import jsdom = require('jsdom'); import { assert } from 'chai'; import { DomRendererRowFactory } from './DomRendererRowFactory'; -import { BufferLine, CellData, FgFlags, BgFlags, Attributes, NULL_CELL_CODE, NULL_CELL_WIDTH, NULL_CELL_CHAR, DEFAULT_ATTR, DEFAULT_ATTR_DATA } from '../../core/buffer/BufferLine'; +import { BufferLine, CellData, FgFlags, BgFlags, Attributes, NULL_CELL_CODE, NULL_CELL_WIDTH, NULL_CELL_CHAR, DEFAULT_ATTR, DEFAULT_ATTR_DATA } from 'core/buffer/BufferLine'; import { ITerminalOptions } from '../../Types'; -import { IBufferLine } from '../../core/Types'; +import { IBufferLine } from 'core/Types'; describe('DomRendererRowFactory', () => { let dom: jsdom.JSDOM; diff --git a/src/tsconfig.json b/src/tsconfig.json index 8acea77ea..a42c83381 100644 --- a/src/tsconfig.json +++ b/src/tsconfig.json @@ -11,6 +11,12 @@ ], "rootDir": ".", "outDir": "../out", + "baseUrl": ".", + "paths": { + "common/*": [ "./common/*" ], + "core/*": [ "./core/*" ], + "ui/*": [ "./ui/*" ] + }, "noUnusedLocals": true, "noImplicitAny": true