Fix unnecessary module loading for type imports (#1053)

This commit is contained in:
filtered
2025-05-16 09:16:27 +10:00
committed by GitHub
parent b035c95cc0
commit de21f5ccd3
9 changed files with 10 additions and 15 deletions

View File

@@ -25,7 +25,7 @@ import { LGraphNode, type NodeId } from "./LGraphNode"
import { LiteGraph } from "./litegraph"
import { type LinkId, LLink } from "./LLink"
import { MapProxyHandler } from "./MapProxyHandler"
import { Reroute, RerouteId } from "./Reroute"
import { Reroute, type RerouteId } from "./Reroute"
import { stringOrEmpty } from "./strings"
import { LGraphEventMode } from "./types/globalEnums"
import { getAllNestedItems } from "./utils/collections"

View File

@@ -1,4 +1,4 @@
import { LGraphIcon, LGraphIconOptions } from "./LGraphIcon"
import { LGraphIcon, type LGraphIconOptions } from "./LGraphIcon"
export enum BadgePosition {
TopLeft = "top-left",

View File

@@ -1,4 +1,5 @@
import type { RenderLink } from "./RenderLink"
import type { LinkConnectorEventMap } from "@/infrastructure/LinkConnectorEventMap"
import type { ConnectingLink, ItemLocator, LinkNetwork, LinkSegment } from "@/interfaces"
import type { INodeInputSlot, INodeOutputSlot } from "@/interfaces"
import type { LGraphNode } from "@/LGraphNode"
@@ -7,7 +8,6 @@ import type { CanvasPointerEvent } from "@/types/events"
import type { IBaseWidget } from "@/types/widgets"
import { CustomEventTarget } from "@/infrastructure/CustomEventTarget"
import { LinkConnectorEventMap } from "@/infrastructure/LinkConnectorEventMap"
import { LLink } from "@/LLink"
import { LinkDirection } from "@/types/globalEnums"

View File

@@ -10,7 +10,7 @@ import type { CanvasEventDetail } from "./types/events"
import type { RenderShape, TitleMode } from "./types/globalEnums"
// Must remain above LiteGraphGlobal (circular dependency due to abstract factory behaviour in `configure`)
export type { Subgraph } from "./subgraph/Subgraph"
export { Subgraph } from "./subgraph/Subgraph"
import { LiteGraphGlobal } from "./LiteGraphGlobal"
import { loadPolyfills } from "./polyfills"

View File

@@ -1,8 +1,7 @@
import type { CanvasColour, Point, RequiredProps, Size } from "../interfaces"
import type { CanvasPointer, LGraphCanvas, LGraphNode } from "../litegraph"
import type { CanvasMouseEvent, CanvasPointerEvent } from "./events"
import { CanvasColour, Point, type RequiredProps, Size } from "../interfaces"
export interface IWidgetOptions<TValues = unknown[]> {
on?: string
off?: string

View File

@@ -1,10 +1,10 @@
import type { Point } from "@/interfaces"
import type { CanvasPointer, LGraphCanvas, LGraphNode, Size } from "@/litegraph"
import type { CanvasMouseEvent, CanvasPointerEvent } from "@/types/events"
import type { IBaseWidget } from "@/types/widgets"
import { drawTextInArea } from "@/draw"
import { Rectangle } from "@/infrastructure/Rectangle"
import { Point } from "@/interfaces"
import { LiteGraph } from "@/litegraph"
export interface DrawWidgetOptions {

View File

@@ -3,10 +3,7 @@ import type { CanvasPointerEvent } from "@/types/events"
import { afterEach, describe, expect, vi } from "vitest"
import { LinkConnector } from "@/canvas/LinkConnector"
import { LGraph } from "@/LGraph"
import { LGraphNode } from "@/LGraphNode"
import { LLink } from "@/LLink"
import { Reroute, type RerouteId } from "@/Reroute"
import { LGraph, LGraphNode, LLink, Reroute, type RerouteId } from "@/litegraph"
import { test as baseTest } from "./testExtensions"

View File

@@ -6,10 +6,7 @@ import { describe, expect, test as baseTest, vi } from "vitest"
import { LinkConnector } from "@/canvas/LinkConnector"
import { ToInputRenderLink } from "@/canvas/ToInputRenderLink"
import { LGraph } from "@/LGraph"
import { LGraphNode } from "@/LGraphNode"
import { LLink } from "@/LLink"
import { Reroute, type RerouteId } from "@/Reroute"
import { LGraph, LGraphNode, LLink, Reroute, type RerouteId } from "@/litegraph"
import { LinkDirection } from "@/types/globalEnums"
interface TestContext {
@@ -30,6 +27,7 @@ const test = baseTest.extend<TestContext>({
links: new Map<number, LLink>(),
reroutes,
floatingLinks,
getLink: graph.getLink.bind(graph),
getNodeById: (id: number) => graph.getNodeById(id),
addFloatingLink: (link: LLink) => {
floatingLinks.set(link.id, link)

View File

@@ -21,6 +21,7 @@
"downlevelIteration": true,
"noImplicitOverride": true,
"noPropertyAccessFromIndexSignature": true,
"verbatimModuleSyntax": true,
/* AllowJs during migration phase */
"allowJs": true,