mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-24 00:34:09 +00:00
refactor: extract CONFIG/GET_CONFIG symbols to constants file
- Create src/lib/litegraph/constants.ts with CONFIG and GET_CONFIG symbols - Update extension files to import from constants - Re-export from litegraphService for backward compatibility Part of Phase 1 circular dependency fixes. Amp-Thread-ID: https://ampcode.com/threads/T-019bfe05-7da5-736f-bff0-34743c003b34 Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
@@ -19,7 +19,7 @@ import {
|
||||
addValueControlWidgets,
|
||||
isValidWidgetType
|
||||
} from '@/scripts/widgets'
|
||||
import { CONFIG, GET_CONFIG } from '@/services/litegraphService'
|
||||
import { CONFIG, GET_CONFIG } from '@/lib/litegraph/constants'
|
||||
import { mergeInputSpec } from '@/utils/nodeDefUtil'
|
||||
import { applyTextReplacements } from '@/utils/searchAndReplace'
|
||||
import { isPrimitiveNode } from '@/renderer/utils/nodeTypeGuards'
|
||||
|
||||
14
src/lib/litegraph/constants.ts
Normal file
14
src/lib/litegraph/constants.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
/**
|
||||
* Symbols used for widget configuration in litegraph nodes.
|
||||
* Extracted to break circular dependencies between litegraphService and extensions.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Symbol used to access the config object on a widget.
|
||||
*/
|
||||
export const CONFIG = Symbol('CONFIG')
|
||||
|
||||
/**
|
||||
* Symbol used to access the config getter function on a widget.
|
||||
*/
|
||||
export const GET_CONFIG = Symbol('GET_CONFIG')
|
||||
@@ -1,5 +1,7 @@
|
||||
import _ from 'es-toolkit/compat'
|
||||
|
||||
import { CONFIG, GET_CONFIG } from '@/lib/litegraph/constants'
|
||||
export { CONFIG, GET_CONFIG }
|
||||
import { downloadFile } from '@/base/common/downloadUtil'
|
||||
import { useSelectedLiteGraphItems } from '@/composables/canvas/useSelectedLiteGraphItems'
|
||||
import { useSubgraphOperations } from '@/composables/graph/useSubgraphOperations'
|
||||
@@ -68,9 +70,6 @@ export interface HasInitialMinSize {
|
||||
_initialMinSize: { width: number; height: number }
|
||||
}
|
||||
|
||||
export const CONFIG = Symbol()
|
||||
export const GET_CONFIG = Symbol()
|
||||
|
||||
/**
|
||||
* Service that augments litegraph with ComfyUI specific functionality.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user