initial migration to TS

This commit is contained in:
2026-03-31 22:16:52 -07:00
parent 75167454d0
commit cef5eafa9f
61 changed files with 831 additions and 85 deletions

View File

@@ -6,7 +6,7 @@ import {
getAngleLabelPosition,
measureAngleDegrees,
moveAngleWidget,
} from '../src/angleMeasureGeometry.js';
} from '../src/angleMeasureGeometry.ts';
test('measureAngleDegrees returns the included angle', () => {
assert.equal(measureAngleDegrees(0, 1, 0, 0, 1, 0), 90);

View File

@@ -6,7 +6,7 @@ import {
canStartCanvasRightDragZoomTarget,
isEditableInteractionTarget,
isSecondaryCanvasContextEvent,
} from '../src/canvasInteractionTargets.js';
} from '../src/canvasInteractionTargets.ts';
function makeTarget(activeSelectors = []) {
const selectorSet = new Set(activeSelectors);

View File

@@ -14,7 +14,7 @@ import {
outputTypeCanConnectToTarget,
resolveOutputTypeForTarget,
checkConnectionValid,
} from '../src/connectionUtils.js';
} from '../src/connectionUtils.ts';
// ── Handle ID helpers ─────────────────────────────────────────────────

View File

@@ -6,7 +6,7 @@ import {
getAcceptedSocketTypes,
isDataSocketSpec,
socketSpecAcceptsType,
} from '../src/constants.js';
} from '../src/constants.ts';
test('intrinsic socket compatibility still allows INT to connect to FLOAT sockets', () => {
assert.equal(socketSpecAcceptsType('INT', 'FLOAT'), true);

View File

@@ -1,8 +1,8 @@
import test from 'node:test';
import assert from 'node:assert/strict';
import { embedWorkflow } from '../src/pngMetadata.js';
import { loadDefaultWorkflowAsset } from '../src/defaultWorkflow.js';
import { embedWorkflow } from '../src/pngMetadata.ts';
import { loadDefaultWorkflowAsset } from '../src/defaultWorkflow.ts';
const PNG_BASE64 = 'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+aF9sAAAAASUVORK5CYII=';

View File

@@ -5,7 +5,7 @@ import {
serializeExecutionGraph,
getAutoRunnableNodes,
hasBlockingAutoRunInput,
} from '../src/executionGraph.js';
} from '../src/executionGraph.ts';
test('serializeExecutionGraph excludes isolated nodes from the backend prompt', () => {
const nodes = [

View File

@@ -5,7 +5,7 @@ import {
GROUP_DRAG_RELEASE_DISTANCE,
getPointDistanceOutsideRect,
shouldReleaseFromGroup,
} from '../src/groupDrag.js';
} from '../src/groupDrag.ts';
test('getPointDistanceOutsideRect returns zero inside the rect', () => {
const rect = { left: 10, top: 20, right: 110, bottom: 120 };

View File

@@ -1,7 +1,7 @@
import test from 'node:test';
import assert from 'node:assert/strict';
import { getGroupMinimumSize } from '../src/groupSizing.js';
import { getGroupMinimumSize } from '../src/groupSizing.ts';
test('getGroupMinimumSize keeps the base minimum for empty groups', () => {
assert.deepEqual(getGroupMinimumSize([]), { width: 260, height: 180 });

View File

@@ -5,7 +5,7 @@ import {
beginTrackedNodeRequest,
isTrackedNodeRequestCurrent,
resolveLoadNodeChannelPath,
} from '../src/loadNodeOutputs.js';
} from '../src/loadNodeOutputs.ts';
test('resolveLoadNodeChannelPath can resolve a new ImageDemo node from its explicit selection before mount', () => {
const resolvedPath = resolveLoadNodeChannelPath({

View File

@@ -8,7 +8,7 @@ import {
getMarkupPreviewStrokeWidth,
sanitizeMarkupColor,
sanitizeMarkupShape,
} from '../src/markupShapeGeometry.js';
} from '../src/markupShapeGeometry.ts';
test('markup defaults use arrow and red', () => {
assert.equal(MARKUP_DEFAULT_SHAPE, 'arrow');

View File

@@ -7,7 +7,7 @@ import {
instantiateNodeClipboardPayload,
NODE_CLIPBOARD_KIND,
parseNodeClipboardPayload,
} from '../src/nodeClipboard.js';
} from '../src/nodeClipboard.ts';
test('buildNodeClipboardPayload keeps only selected nodes and internal edges', () => {
const nodes = [

View File

@@ -1,9 +1,9 @@
import test from 'node:test';
import assert from 'node:assert/strict';
import { sortNodesForParentOrder } from '../src/nodeHierarchy.js';
import { hydrateWorkflowState } from '../src/workflowHydration.js';
import { instantiateNodeClipboardPayload, NODE_CLIPBOARD_KIND } from '../src/nodeClipboard.js';
import { sortNodesForParentOrder } from '../src/nodeHierarchy.ts';
import { hydrateWorkflowState } from '../src/workflowHydration.ts';
import { instantiateNodeClipboardPayload, NODE_CLIPBOARD_KIND } from '../src/nodeClipboard.ts';
test('sortNodesForParentOrder places parents before descendants', () => {
const nodes = [

View File

@@ -1,7 +1,7 @@
import test from 'node:test';
import assert from 'node:assert/strict';
import { buildDefaultWidgetValues, getDefaultWidgetValue } from '../src/nodeWidgetDefaults.js';
import { buildDefaultWidgetValues, getDefaultWidgetValue } from '../src/nodeWidgetDefaults.ts';
test('enum widget defaults honor opts.default instead of the first option', () => {
assert.equal(

View File

@@ -4,7 +4,7 @@ import assert from 'node:assert/strict';
import {
buildCombinedInputNameByWidgetName,
getWidgetCombinedInputName,
} from '../src/nodeWidgetLayout.js';
} from '../src/nodeWidgetLayout.ts';
test('getWidgetCombinedInputName pairs same-label hide_when_input_connected widgets with their matching input', () => {
const dataInputByName = new Map([

View File

@@ -1,7 +1,7 @@
import test from 'node:test';
import assert from 'node:assert/strict';
import { embedWorkflow, extractWorkflow } from '../src/pngMetadata.js';
import { embedWorkflow, extractWorkflow } from '../src/pngMetadata.ts';
const PNG_BASE64 = 'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+aF9sAAAAASUVORK5CYII=';

View File

@@ -6,7 +6,7 @@ import {
formatDisplayUnit,
formatTableRowCell,
getTableColumns,
} from '../src/valueFormatting.js';
} from '../src/valueFormatting.ts';
test('getTableColumns hides companion record-table unit columns', () => {
const columns = getTableColumns([

View File

@@ -1,7 +1,7 @@
import test from 'node:test';
import assert from 'node:assert/strict';
import { OVERLAY_CAPTURE_SELECTORS, captureViewportBlob } from '../src/workflowCapture.js';
import { OVERLAY_CAPTURE_SELECTORS, captureViewportBlob } from '../src/workflowCapture.ts';
function makeElement(name, { tagName = 'DIV', width = 160, height = 90, src = '' } = {}) {
return {

View File

@@ -1,8 +1,8 @@
import test from 'node:test';
import assert from 'node:assert/strict';
import { hydrateWorkflowState } from '../src/workflowHydration.js';
import { serializeWorkflowState } from '../src/workflowSerialization.js';
import { hydrateWorkflowState } from '../src/workflowHydration.ts';
import { serializeWorkflowState } from '../src/workflowSerialization.ts';
test('serializeWorkflowState keeps only stable workflow fields needed for reload', () => {
const nodes = [