Fix addon and dist builds after path mapping removal

Import shared core from ../../../out/common|browser in addons so tsc
and runtime agree. Enable preserveConstEnums so const enums remain in
compiled out/ for addon consumers.

Build xterm esbuild before addons so out-esbuild exists for parallel
addon jobs. Verified: npm run setup, esbuild-demo-client, package.

Co-authored-by: Daniel Imms <Tyriar@users.noreply.github.com>
This commit is contained in:
Cursor Agent
2026-05-28 01:08:32 +00:00
co-authored by Daniel Imms
parent 9a96b27566
commit 584954b4fb
38 changed files with 139 additions and 127 deletions
+8 -8
View File
@@ -1,12 +1,12 @@
import { ISelectionRenderModel } from '../../../out-esbuild/browser/renderer/shared/Types';
import { ICoreBrowserService, IThemeService } from '../../../out-esbuild/browser/services/Services';
import { ReadonlyColorSet } from '../../../out-esbuild/browser/Types';
import { Attributes, BgFlags, ExtFlags, FgFlags, NULL_CELL_CODE, UnderlineStyle } from '../../../out-esbuild/common/buffer/Constants';
import { IDecorationService, IOptionsService } from '../../../out-esbuild/common/services/Services';
import { ICellData } from '../../../out-esbuild/common/Types';
import { ISelectionRenderModel } from '../../../out/browser/renderer/shared/Types';
import { ICoreBrowserService, IThemeService } from '../../../out/browser/services/Services';
import { ReadonlyColorSet } from '../../../out/browser/Types';
import { Attributes, BgFlags, ExtFlags, FgFlags, NULL_CELL_CODE, UnderlineStyle } from '../../../out/common/buffer/Constants';
import { IDecorationService, IOptionsService } from '../../../out/common/services/Services';
import { ICellData } from '../../../out/common/Types';
import { Terminal } from '@xterm/xterm';
import { rgba } from '../../../out-esbuild/common/Color';
import { treatGlyphAsBackgroundColor } from '../../../out-esbuild/browser/renderer/shared/RendererUtils';
import { rgba } from '../../../out/common/Color';
import { treatGlyphAsBackgroundColor } from '../../../out/browser/renderer/shared/RendererUtils';
import { blockPatternCodepoints } from './customGlyphs/CustomGlyphDefinitions';
// Work variables to avoid garbage collection
+2 -2
View File
@@ -5,10 +5,10 @@
import { TextureAtlas } from './TextureAtlas';
import { ITerminalOptions, Terminal } from '@xterm/xterm';
import { ITerminal, ReadonlyColorSet } from '../../../out-esbuild/browser/Types';
import { ITerminal, ReadonlyColorSet } from '../../../out/browser/Types';
import { ICharAtlasConfig, ITextureAtlas } from './Types';
import { generateConfig, configEquals } from './CharAtlasUtils';
import type { ILogService } from '../../../out-esbuild/common/services/Services';
import type { ILogService } from '../../../out/common/services/Services';
interface ITextureAtlasCacheEntry {
atlas: ITextureAtlas;
@@ -6,8 +6,8 @@
import { assert } from 'chai';
import { configEquals } from './CharAtlasUtils';
import { ICharAtlasConfig } from './Types';
import { NULL_COLOR } from '../../../out-esbuild/common/Color';
import { IColor } from '../../../out-esbuild/common/Types';
import { NULL_COLOR } from '../../../out/common/Color';
import { IColor } from '../../../out/common/Types';
function createTestConfig(overrides: Partial<ICharAtlasConfig> = {}): ICharAtlasConfig {
const color: IColor = { css: '#ffffff', rgba: 0xffffffff };
+3 -3
View File
@@ -4,10 +4,10 @@
*/
import { ICharAtlasConfig } from './Types';
import { Attributes } from '../../../out-esbuild/common/buffer/Constants';
import { Attributes } from '../../../out/common/buffer/Constants';
import { ITerminalOptions } from '@xterm/xterm';
import { IColorSet, ReadonlyColorSet } from '../../../out-esbuild/browser/Types';
import { NULL_COLOR } from '../../../out-esbuild/common/Color';
import { IColorSet, ReadonlyColorSet } from '../../../out/browser/Types';
import { NULL_COLOR } from '../../../out/common/Color';
export function generateConfig(deviceCellWidth: number, deviceCellHeight: number, deviceCharWidth: number, deviceCharHeight: number, options: Required<ITerminalOptions>, colors: ReadonlyColorSet, devicePixelRatio: number, deviceMaxTextureSize: number, customGlyphs: boolean = true): ICharAtlasConfig {
// null out some fields that don't matter
+1 -1
View File
@@ -3,7 +3,7 @@
* @license MIT
*/
import { isFirefox, isLegacyEdge } from '../../../out-esbuild/common/Platform';
import { isFirefox, isLegacyEdge } from '../../../out/common/Platform';
export const DIM_OPACITY = 0.5;
// The text baseline is set conditionally by browser. Using 'ideographic' for Firefox or Legacy Edge
@@ -3,8 +3,8 @@
* @license MIT
*/
import { RendererConstants } from '../../../out-esbuild/browser/renderer/shared/Constants';
import { ICoreBrowserService } from '../../../out-esbuild/browser/services/Services';
import { RendererConstants } from '../../../out/browser/renderer/shared/Constants';
import { ICoreBrowserService } from '../../../out/browser/services/Services';
const enum Constants {
/**
@@ -3,7 +3,7 @@
* @license MIT
*/
import { toDisposable, IDisposable } from '../../../out-esbuild/common/Lifecycle';
import { toDisposable, IDisposable } from '../../../out/common/Lifecycle';
export function observeDevicePixelDimensions(element: HTMLElement, parentWindow: Window & typeof globalThis, callback: (deviceWidth: number, deviceHeight: number) => void): IDisposable {
// Observe any resizes to the element and extract the actual pixel size of the element if the
+5 -5
View File
@@ -3,14 +3,14 @@
* @license MIT
*/
import { TextureAtlas } from './TextureAtlas';
import { IRenderDimensions } from '../../../out-esbuild/browser/renderer/shared/Types';
import { NULL_CELL_CODE } from '../../../out-esbuild/common/buffer/Constants';
import { Disposable, toDisposable } from '../../../out-esbuild/common/Lifecycle';
import { IRenderDimensions } from '../../../out/browser/renderer/shared/Types';
import { NULL_CELL_CODE } from '../../../out/common/buffer/Constants';
import { Disposable, toDisposable } from '../../../out/common/Lifecycle';
import { Terminal } from '@xterm/xterm';
import { IRenderModel, IWebGL2RenderingContext, IWebGLVertexArrayObject, type IRasterizedGlyph, type ITextureAtlas } from './Types';
import { createProgram, GLTexture, PROJECTION_MATRIX } from './WebglUtils';
import type { ILogService, IOptionsService } from '../../../out-esbuild/common/services/Services';
import { allowRescaling, throwIfFalsy } from '../../../out-esbuild/browser/renderer/shared/RendererUtils';
import type { ILogService, IOptionsService } from '../../../out/common/services/Services';
import { allowRescaling, throwIfFalsy } from '../../../out/browser/renderer/shared/RendererUtils';
interface IVertices {
attributes: Float32Array;
+8 -8
View File
@@ -3,18 +3,18 @@
* @license MIT
*/
import { IRenderDimensions } from '../../../out-esbuild/browser/renderer/shared/Types';
import { IThemeService } from '../../../out-esbuild/browser/services/Services';
import { ReadonlyColorSet } from '../../../out-esbuild/browser/Types';
import { Attributes, FgFlags } from '../../../out-esbuild/common/buffer/Constants';
import { Disposable, toDisposable } from '../../../out-esbuild/common/Lifecycle';
import { IColor } from '../../../out-esbuild/common/Types';
import { IRenderDimensions } from '../../../out/browser/renderer/shared/Types';
import { IThemeService } from '../../../out/browser/services/Services';
import { ReadonlyColorSet } from '../../../out/browser/Types';
import { Attributes, FgFlags } from '../../../out/common/buffer/Constants';
import { Disposable, toDisposable } from '../../../out/common/Lifecycle';
import { IColor } from '../../../out/common/Types';
import { Terminal } from '@xterm/xterm';
import { RenderModelConstants } from './RenderModel';
import { IRenderModel, IWebGL2RenderingContext, IWebGLVertexArrayObject } from './Types';
import { createProgram, expandFloat32Array, PROJECTION_MATRIX } from './WebglUtils';
import { throwIfFalsy } from '../../../out-esbuild/browser/renderer/shared/RendererUtils';
import type { ILogService } from '../../../out-esbuild/common/services/Services';
import { throwIfFalsy } from '../../../out/browser/renderer/shared/RendererUtils';
import type { ILogService } from '../../../out/common/services/Services';
const enum VertexAttribLocations {
POSITION = 0,
+2 -2
View File
@@ -4,8 +4,8 @@
*/
import { ICursorRenderModel, IRenderModel } from './Types';
import { ISelectionRenderModel } from '../../../out-esbuild/browser/renderer/shared/Types';
import { createSelectionRenderModel } from '../../../out-esbuild/browser/renderer/shared/SelectionRenderModel';
import { ISelectionRenderModel } from '../../../out/browser/renderer/shared/Types';
import { createSelectionRenderModel } from '../../../out/browser/renderer/shared/SelectionRenderModel';
export const enum RenderModelConstants {
INDICIES_PER_CELL = 4,
+10 -10
View File
@@ -3,19 +3,19 @@
* @license MIT
*/
import { IColorContrastCache } from '../../../out-esbuild/browser/Types';
import { IColorContrastCache } from '../../../out/browser/Types';
import { DIM_OPACITY, TEXT_BASELINE } from './Constants';
import { tryDrawCustomGlyph } from './customGlyphs/CustomGlyphRasterizer';
import { computeNextVariantOffset, treatGlyphAsBackgroundColor, isPowerlineGlyph, isRestrictedPowerlineGlyph, throwIfFalsy } from '../../../out-esbuild/browser/renderer/shared/RendererUtils';
import { computeNextVariantOffset, treatGlyphAsBackgroundColor, isPowerlineGlyph, isRestrictedPowerlineGlyph, throwIfFalsy } from '../../../out/browser/renderer/shared/RendererUtils';
import { IBoundingBox, ICharAtlasConfig, IRasterizedGlyph, ITextureAtlas } from './Types';
import { NULL_COLOR, channels, color, rgba } from '../../../out-esbuild/common/Color';
import { FourKeyMap } from '../../../out-esbuild/common/MultiKeyMap';
import { IdleTaskQueue } from '../../../out-esbuild/common/TaskQueue';
import { IColor } from '../../../out-esbuild/common/Types';
import { AttributeData } from '../../../out-esbuild/common/buffer/AttributeData';
import { Attributes, DEFAULT_COLOR, DEFAULT_EXT, UnderlineStyle } from '../../../out-esbuild/common/buffer/Constants';
import { ILogService, IUnicodeService } from '../../../out-esbuild/common/services/Services';
import { Emitter } from '../../../out-esbuild/common/Event';
import { NULL_COLOR, channels, color, rgba } from '../../../out/common/Color';
import { FourKeyMap } from '../../../out/common/MultiKeyMap';
import { IdleTaskQueue } from '../../../out/common/TaskQueue';
import { IColor } from '../../../out/common/Types';
import { AttributeData } from '../../../out/common/buffer/AttributeData';
import { Attributes, DEFAULT_COLOR, DEFAULT_EXT, UnderlineStyle } from '../../../out/common/buffer/Constants';
import { ILogService, IUnicodeService } from '../../../out/common/services/Services';
import { Emitter } from '../../../out/common/Event';
/**
* A shared object which is used to draw nothing for a particular cell.
+4 -4
View File
@@ -4,10 +4,10 @@
*/
import { FontWeight } from '@xterm/xterm';
import { IColorSet } from '../../../out-esbuild/browser/Types';
import { ISelectionRenderModel } from '../../../out-esbuild/browser/renderer/shared/Types';
import { CursorInactiveStyle, CursorStyle, type IDisposable } from '../../../out-esbuild/common/Types';
import type { IEvent } from '../../../out-esbuild/common/Event';
import { IColorSet } from '../../../out/browser/Types';
import { ISelectionRenderModel } from '../../../out/browser/renderer/shared/Types';
import { CursorInactiveStyle, CursorStyle, type IDisposable } from '../../../out/common/Types';
import type { IEvent } from '../../../out/common/Event';
export interface IRenderModel {
cells: Uint32Array;
+6 -6
View File
@@ -5,14 +5,14 @@
import type { ITerminalAddon, Terminal } from '@xterm/xterm';
import type { IWebglAddonOptions, WebglAddon as IWebglApi } from '@xterm/addon-webgl';
import { ICharacterJoinerService, ICharSizeService, ICoreBrowserService, IRenderService, IThemeService } from '../../../out-esbuild/browser/services/Services';
import { ITerminal } from '../../../out-esbuild/browser/Types';
import { Disposable, toDisposable } from '../../../out-esbuild/common/Lifecycle';
import { getSafariVersion, isSafari } from '../../../out-esbuild/common/Platform';
import { ICoreService, IDecorationService, ILogService, IOptionsService } from '../../../out-esbuild/common/services/Services';
import { ICharacterJoinerService, ICharSizeService, ICoreBrowserService, IRenderService, IThemeService } from '../../../out/browser/services/Services';
import { ITerminal } from '../../../out/browser/Types';
import { Disposable, toDisposable } from '../../../out/common/Lifecycle';
import { getSafariVersion, isSafari } from '../../../out/common/Platform';
import { ICoreService, IDecorationService, ILogService, IOptionsService } from '../../../out/common/services/Services';
import { IWebGL2RenderingContext } from './Types';
import { WebglRenderer } from './WebglRenderer';
import { Emitter, EventUtils } from '../../../out-esbuild/common/Event';
import { Emitter, EventUtils } from '../../../out/common/Event';
export class WebglAddon extends Disposable implements ITerminalAddon, IWebglApi {
private _terminal?: Terminal;
+13 -13
View File
@@ -3,19 +3,19 @@
* @license MIT
*/
import { ITerminal } from '../../../out-esbuild/browser/Types';
import { ITerminal } from '../../../out/browser/Types';
import { CellColorResolver } from './CellColorResolver';
import { acquireTextureAtlas, removeTerminalFromCache } from './CharAtlasCache';
import { CursorBlinkStateManager } from './CursorBlinkStateManager';
import { observeDevicePixelDimensions } from './DevicePixelObserver';
import { IRenderDimensions, IRenderer, IRequestRedrawEvent } from '../../../out-esbuild/browser/renderer/shared/Types';
import { ICharSizeService, ICharacterJoinerService, ICoreBrowserService, IThemeService } from '../../../out-esbuild/browser/services/Services';
import { CharData, IBufferLine, ICellData } from '../../../out-esbuild/common/Types';
import { AttributeData } from '../../../out-esbuild/common/buffer/AttributeData';
import { CellData } from '../../../out-esbuild/common/buffer/CellData';
import { Attributes, Content, FgFlags, NULL_CELL_CHAR, NULL_CELL_CODE } from '../../../out-esbuild/common/buffer/Constants';
import { TextBlinkStateManager } from '../../../out-esbuild/browser/renderer/shared/TextBlinkStateManager';
import { ICoreService, IDecorationService, ILogService, IOptionsService } from '../../../out-esbuild/common/services/Services';
import { IRenderDimensions, IRenderer, IRequestRedrawEvent } from '../../../out/browser/renderer/shared/Types';
import { ICharSizeService, ICharacterJoinerService, ICoreBrowserService, IThemeService } from '../../../out/browser/services/Services';
import { CharData, IBufferLine, ICellData } from '../../../out/common/Types';
import { AttributeData } from '../../../out/common/buffer/AttributeData';
import { CellData } from '../../../out/common/buffer/CellData';
import { Attributes, Content, FgFlags, NULL_CELL_CHAR, NULL_CELL_CODE } from '../../../out/common/buffer/Constants';
import { TextBlinkStateManager } from '../../../out/browser/renderer/shared/TextBlinkStateManager';
import { ICoreService, IDecorationService, ILogService, IOptionsService } from '../../../out/common/services/Services';
import { Terminal } from '@xterm/xterm';
import { GlyphRenderer } from './GlyphRenderer';
import { RectangleRenderer } from './RectangleRenderer';
@@ -23,10 +23,10 @@ import { COMBINED_CHAR_BIT_MASK, RenderModel, RenderModelConstants } from './Ren
import { IWebGL2RenderingContext, type ITextureAtlas } from './Types';
import { LinkRenderLayer } from './renderLayer/LinkRenderLayer';
import { IRenderLayer } from './renderLayer/Types';
import { Emitter, EventUtils } from '../../../out-esbuild/common/Event';
import { addDisposableListener } from '../../../out-esbuild/browser/Dom';
import { combinedDisposable, Disposable, MutableDisposable, toDisposable } from '../../../out-esbuild/common/Lifecycle';
import { createRenderDimensions } from '../../../out-esbuild/browser/renderer/shared/RendererUtils';
import { Emitter, EventUtils } from '../../../out/common/Event';
import { addDisposableListener } from '../../../out/browser/Dom';
import { combinedDisposable, Disposable, MutableDisposable, toDisposable } from '../../../out/common/Lifecycle';
import { createRenderDimensions } from '../../../out/browser/renderer/shared/RendererUtils';
const enum Constants {
MERGE_RETRY_LIMIT = 32
+2 -2
View File
@@ -3,8 +3,8 @@
* @license MIT
*/
import { throwIfFalsy } from '../../../out-esbuild/browser/renderer/shared/RendererUtils';
import type { ILogService } from '../../../out-esbuild/common/services/Services';
import { throwIfFalsy } from '../../../out/browser/renderer/shared/RendererUtils';
import type { ILogService } from '../../../out/common/services/Services';
/**
* A matrix that when multiplies will translate 0-1 coordinates (left to right,
@@ -3,8 +3,8 @@
* @license MIT
*/
import { throwIfFalsy } from '../../../../out-esbuild/browser/renderer/shared/RendererUtils';
import type { ILogService } from '../../../../out-esbuild/common/services/Services';
import { throwIfFalsy } from '../../../../out/browser/renderer/shared/RendererUtils';
import type { ILogService } from '../../../../out/common/services/Services';
import { customGlyphDefinitions } from './CustomGlyphDefinitions';
import { CustomGlyphDefinitionType, CustomGlyphScaleType, CustomGlyphVectorType, type CustomGlyphDefinitionPart, type CustomGlyphPathDrawFunctionDefinition, type CustomGlyphPatternDefinition, type ICustomGlyphSolidOctantBlockVector, type ICustomGlyphVectorShape } from './Types';
@@ -3,16 +3,16 @@
* @license MIT
*/
import { ReadonlyColorSet } from '../../../../out-esbuild/browser/Types';
import { ReadonlyColorSet } from '../../../../out/browser/Types';
import { acquireTextureAtlas } from '../CharAtlasCache';
import { IRenderDimensions } from '../../../../out-esbuild/browser/renderer/shared/Types';
import { ICoreBrowserService, IThemeService } from '../../../../out-esbuild/browser/services/Services';
import { Disposable, toDisposable } from '../../../../out-esbuild/common/Lifecycle';
import { CellData } from '../../../../out-esbuild/common/buffer/CellData';
import { IOptionsService } from '../../../../out-esbuild/common/services/Services';
import { IRenderDimensions } from '../../../../out/browser/renderer/shared/Types';
import { ICoreBrowserService, IThemeService } from '../../../../out/browser/services/Services';
import { Disposable, toDisposable } from '../../../../out/common/Lifecycle';
import { CellData } from '../../../../out/common/buffer/CellData';
import { IOptionsService } from '../../../../out/common/services/Services';
import { Terminal } from '@xterm/xterm';
import { IRenderLayer } from './Types';
import { throwIfFalsy } from '../../../../out-esbuild/browser/renderer/shared/RendererUtils';
import { throwIfFalsy } from '../../../../out/browser/renderer/shared/RendererUtils';
import { TEXT_BASELINE } from '../Constants';
import type { ITextureAtlas } from '../Types';
@@ -4,11 +4,11 @@
*/
import { is256Color } from '../CharAtlasUtils';
import { INVERTED_DEFAULT_COLOR } from '../../../../out-esbuild/browser/renderer/shared/Constants';
import { IRenderDimensions } from '../../../../out-esbuild/browser/renderer/shared/Types';
import { ICoreBrowserService, IThemeService } from '../../../../out-esbuild/browser/services/Services';
import { ILinkifier2, ILinkifierEvent } from '../../../../out-esbuild/browser/Types';
import { IOptionsService } from '../../../../out-esbuild/common/services/Services';
import { INVERTED_DEFAULT_COLOR } from '../../../../out/browser/renderer/shared/Constants';
import { IRenderDimensions } from '../../../../out/browser/renderer/shared/Types';
import { ICoreBrowserService, IThemeService } from '../../../../out/browser/services/Services';
import { ILinkifier2, ILinkifierEvent } from '../../../../out/browser/Types';
import { IOptionsService } from '../../../../out/common/services/Services';
import { Terminal } from '@xterm/xterm';
import { BaseRenderLayer } from './BaseRenderLayer';
+1 -1
View File
@@ -4,7 +4,7 @@
*/
import { IDisposable, Terminal } from '@xterm/xterm';
import { IRenderDimensions } from '../../../../out-esbuild/browser/renderer/shared/Types';
import { IRenderDimensions } from '../../../../out/browser/renderer/shared/Types';
export interface IRenderLayer extends IDisposable {
/**