mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-05 07:30:11 +00:00
refactor: move missing node error utils to manager domain
- Move MissingNodeTypeExtraInfo to manager/types/missingNodeErrorTypes.ts - Move utility functions to manager/utils/missingNodeErrorUtil.ts - Move tests alongside utilities - Update import in app.ts Amp-Thread-ID: https://ampcode.com/threads/T-019c1678-4c59-758a-ab49-bec5ff8e98da Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
@@ -70,10 +70,8 @@ import type { ComfyExtension, MissingNodeType } from '@/types/comfy'
|
||||
import { type ExtensionManager } from '@/types/extensionTypes'
|
||||
import type { NodeExecutionId } from '@/types/nodeIdentification'
|
||||
import { graphToPrompt } from '@/utils/executionUtil'
|
||||
import {
|
||||
createMissingNodeTypeFromError,
|
||||
type MissingNodeTypeExtraInfo
|
||||
} from '@/utils/missingNodeUtil'
|
||||
import type { MissingNodeTypeExtraInfo } from '@/workbench/extensions/manager/types/missingNodeErrorTypes'
|
||||
import { createMissingNodeTypeFromError } from '@/workbench/extensions/manager/utils/missingNodeErrorUtil'
|
||||
import { anyItemOverlapsRect } from '@/utils/mathUtil'
|
||||
import { collectAllNodes, forEachNode } from '@/utils/graphTraversalUtil'
|
||||
import {
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
/**
|
||||
* Extra info returned by the backend for missing_node_type errors
|
||||
* from the /prompt endpoint validation.
|
||||
*/
|
||||
export interface MissingNodeTypeExtraInfo {
|
||||
class_type?: string | null
|
||||
node_title?: string | null
|
||||
node_id?: string
|
||||
}
|
||||
@@ -3,7 +3,7 @@ import { describe, expect, it } from 'vitest'
|
||||
import {
|
||||
buildMissingNodeHint,
|
||||
createMissingNodeTypeFromError
|
||||
} from './missingNodeUtil'
|
||||
} from './missingNodeErrorUtil'
|
||||
|
||||
describe('buildMissingNodeHint', () => {
|
||||
it('returns hint with title and node ID when both available', () => {
|
||||
@@ -1,13 +1,6 @@
|
||||
import type { MissingNodeType } from '@/types/comfy'
|
||||
|
||||
/**
|
||||
* Extra info returned by the backend for missing_node_type errors
|
||||
*/
|
||||
export interface MissingNodeTypeExtraInfo {
|
||||
class_type?: string | null
|
||||
node_title?: string | null
|
||||
node_id?: string
|
||||
}
|
||||
import type { MissingNodeTypeExtraInfo } from '../types/missingNodeErrorTypes'
|
||||
|
||||
/**
|
||||
* Builds a hint string from missing node metadata.
|
||||
Reference in New Issue
Block a user