[Lint] Sort imports (#2104)

This commit is contained in:
Chenlei Hu
2024-12-30 17:26:37 -05:00
committed by GitHub
parent e88817ea36
commit d8f074fea0
254 changed files with 1226 additions and 943 deletions

View File

@@ -1,10 +1,12 @@
import { AboutPageBadge } from '@/types/comfy'
import { defineStore } from 'pinia'
import { computed } from 'vue'
import { useSystemStatsStore } from './systemStatsStore'
import { useExtensionStore } from './extensionStore'
import { AboutPageBadge } from '@/types/comfy'
import { electronAPI, isElectron } from '@/utils/envUtil'
import { useExtensionStore } from './extensionStore'
import { useSystemStatsStore } from './systemStatsStore'
export const useAboutPanelStore = defineStore('aboutPanel', () => {
const frontendVersion = __COMFYUI_FRONTEND_VERSION__
const extensionStore = useExtensionStore()

View File

@@ -1,7 +1,9 @@
import { defineStore } from 'pinia'
import { computed, ref } from 'vue'
import type { ComfyExtension } from '@/types/comfy'
import { useErrorHandling } from '@/hooks/errorHooks'
import type { ComfyExtension } from '@/types/comfy'
import { type KeybindingImpl, useKeybindingStore } from './keybindingStore'
export interface ComfyCommand {

View File

@@ -1,8 +1,7 @@
// We should consider moving to https://primevue.org/dynamicdialog/ once everything is in Vue.
// Currently we need to bridge between legacy app code and Vue app with a Pinia store.
import { defineStore } from 'pinia'
import { ref, type Component, markRaw } from 'vue'
import { type Component, markRaw, ref } from 'vue'
interface DialogComponentProps {
maximizable?: boolean

View File

@@ -1,10 +1,11 @@
import { computed, ref } from 'vue'
import { defineStore } from 'pinia'
import { isElectron, electronAPI } from '@/utils/envUtil'
import {
type DownloadState,
DownloadStatus
} from '@comfyorg/comfyui-electron-types'
import { defineStore } from 'pinia'
import { computed, ref } from 'vue'
import { electronAPI, isElectron } from '@/utils/envUtil'
export interface ElectronDownload
extends Pick<DownloadState, 'url' | 'filename'> {

View File

@@ -1,8 +1,7 @@
import { ref, computed } from 'vue'
import { defineStore } from 'pinia'
import { computed, ref } from 'vue'
import { api } from '@/scripts/api'
import { ComfyWorkflow } from './workflowStore'
import type { ComfyNode, ComfyWorkflowJSON } from '@/types/comfyWorkflow'
import type {
ExecutedWsMessage,
ExecutingWsMessage,
@@ -11,6 +10,9 @@ import type {
ProgressWsMessage,
StatusWsMessage
} from '@/types/apiTypes'
import type { ComfyNode, ComfyWorkflowJSON } from '@/types/comfyWorkflow'
import { ComfyWorkflow } from './workflowStore'
export interface QueuedPrompt {
nodes: Record<string, boolean>

View File

@@ -1,5 +1,6 @@
import { ref, computed, markRaw } from 'vue'
import { defineStore } from 'pinia'
import { computed, markRaw, ref } from 'vue'
import type { ComfyExtension } from '@/types/comfy'
/**

View File

@@ -1,4 +1,4 @@
import { LGraphNode, LGraphGroup, LGraphCanvas } from '@comfyorg/litegraph'
import { LGraphCanvas, LGraphGroup, LGraphNode } from '@comfyorg/litegraph'
import { defineStore } from 'pinia'
import { shallowRef } from 'vue'

View File

@@ -1,6 +1,7 @@
import { defineStore } from 'pinia'
import { computed, Ref, ref, toRaw } from 'vue'
import { Keybinding, KeyCombo } from '@/types/keyBindingTypes'
import { Ref, computed, ref, toRaw } from 'vue'
import { KeyCombo, Keybinding } from '@/types/keyBindingTypes'
export class KeybindingImpl implements Keybinding {
commandId: string

View File

@@ -1,9 +1,11 @@
import { defineStore } from 'pinia'
import type { MenuItem } from 'primevue/menuitem'
import { ref } from 'vue'
import { useCommandStore } from './commandStore'
import { ComfyExtension } from '@/types/comfy'
import { CORE_MENU_COMMANDS } from '@/constants/coreMenuCommands'
import { ComfyExtension } from '@/types/comfy'
import { useCommandStore } from './commandStore'
export const useMenuItemStore = defineStore('menuItem', () => {
const commandStore = useCommandStore()

View File

@@ -1,5 +1,6 @@
import { computed, ref } from 'vue'
import { defineStore } from 'pinia'
import { computed, ref } from 'vue'
import { api } from '@/scripts/api'
/** (Internal helper) finds a value in a metadata object from any of a list of keys. */

View File

@@ -1,5 +1,6 @@
import { ref } from 'vue'
import { defineStore } from 'pinia'
import { ref } from 'vue'
import { ComfyNodeDefImpl, useNodeDefStore } from '@/stores/nodeDefStore'
/** Helper class that defines how to construct a node from a model. */

View File

@@ -1,12 +1,14 @@
import _ from 'lodash'
import { defineStore } from 'pinia'
import type { TreeNode } from 'primevue/treenode'
import { computed } from 'vue'
import { useSettingStore } from './settingStore'
import type { BookmarkCustomization } from '@/types/apiTypes'
import { useNodeDefStore } from './nodeDefStore'
import { ComfyNodeDefImpl, createDummyFolderNodeDef } from './nodeDefStore'
import { buildNodeDefTree } from './nodeDefStore'
import type { TreeNode } from 'primevue/treenode'
import _ from 'lodash'
import type { BookmarkCustomization } from '@/types/apiTypes'
import { useSettingStore } from './settingStore'
export const BOOKMARK_SETTING_ID = 'Comfy.NodeLibrary.Bookmarks.V2'

View File

@@ -1,24 +1,25 @@
import type { LGraphNode } from '@comfyorg/litegraph'
import axios from 'axios'
import { defineStore } from 'pinia'
import type { TreeNode } from 'primevue/treenode'
import { computed, ref } from 'vue'
import {
NodeSearchService,
type SearchAuxScore
} from '@/services/nodeSearchService'
import {
type ComfyNodeDef,
type ComfyInputsSpec as ComfyInputsSpecSchema,
type ComfyNodeDef,
type ComfyOutputTypesSpec as ComfyOutputTypesSpecSchema,
type InputSpec
} from '@/types/apiTypes'
import { defineStore } from 'pinia'
import type { TreeNode } from 'primevue/treenode'
import { buildTree } from '@/utils/treeUtil'
import { computed, ref } from 'vue'
import axios from 'axios'
import {
type NodeSource,
NodeSourceType,
getNodeSource
} from '@/types/nodeSource'
import type { LGraphNode } from '@comfyorg/litegraph'
import { buildTree } from '@/utils/treeUtil'
export interface BaseInputSpec<T = any> {
name: string

View File

@@ -1,19 +1,20 @@
import { api } from '@/scripts/api'
import type { ComfyApp } from '@/scripts/app'
import type {
TaskItem,
TaskType,
TaskPrompt,
TaskStatus,
StatusWsMessageStatus,
TaskOutput,
ResultItem
} from '@/types/apiTypes'
import type { ComfyWorkflowJSON, NodeId } from '@/types/comfyWorkflow'
import _ from 'lodash'
import { defineStore } from 'pinia'
import { toRaw } from 'vue'
import { ref, computed } from 'vue'
import { computed, ref } from 'vue'
import { api } from '@/scripts/api'
import type { ComfyApp } from '@/scripts/app'
import type {
ResultItem,
StatusWsMessageStatus,
TaskItem,
TaskOutput,
TaskPrompt,
TaskStatus,
TaskType
} from '@/types/apiTypes'
import type { ComfyWorkflowJSON, NodeId } from '@/types/comfyWorkflow'
// Task type used in the API.
export type APITaskType = 'queue' | 'history'

View File

@@ -1,7 +1,8 @@
import { ServerConfig, ServerConfigValue } from '@/constants/serverConfig'
import { defineStore } from 'pinia'
import { computed, ref } from 'vue'
import { ServerConfig, ServerConfigValue } from '@/constants/serverConfig'
export type ServerConfigWithValue<T> = ServerConfig<T> & {
/**
* Current value.

View File

@@ -1,11 +1,12 @@
import { ref, computed } from 'vue'
import { defineStore } from 'pinia'
import type { Settings } from '@/types/apiTypes'
import type { SettingParams } from '@/types/settingTypes'
import type { TreeNode } from 'primevue/treenode'
import { buildTree } from '@/utils/treeUtil'
import { computed, ref } from 'vue'
import { api } from '@/scripts/api'
import { app } from '@/scripts/app'
import type { Settings } from '@/types/apiTypes'
import type { SettingParams } from '@/types/settingTypes'
import { buildTree } from '@/utils/treeUtil'
export const getSettingInfo = (setting: SettingParams) => {
const parts = setting.category || setting.id.split('.')

View File

@@ -1,5 +1,6 @@
import { defineStore } from 'pinia'
import { ref } from 'vue'
import { api } from '@/scripts/api'
import type { SystemStats } from '@/types/apiTypes'

View File

@@ -2,8 +2,8 @@
// instead of going through the store.
// The store is useful when you need to call it from outside the Vue component context.
import { defineStore } from 'pinia'
import { ref } from 'vue'
import type { ToastMessageOptions } from 'primevue/toast'
import { ref } from 'vue'
export const useToastStore = defineStore('toast', () => {
const messagesToAdd = ref<ToastMessageOptions[]>([])

View File

@@ -1,11 +1,12 @@
import { defineStore } from 'pinia'
import { api } from '@/scripts/api'
import { buildTree } from '@/utils/treeUtil'
import { computed, ref } from 'vue'
import { TreeExplorerNode } from '@/types/treeExplorerTypes'
import { api } from '@/scripts/api'
import { UserDataFullInfo } from '@/types/apiTypes'
import { syncEntities } from '@/utils/syncUtil'
import { TreeExplorerNode } from '@/types/treeExplorerTypes'
import { getPathDetails } from '@/utils/formatUtil'
import { syncEntities } from '@/utils/syncUtil'
import { buildTree } from '@/utils/treeUtil'
/**
* Represents a file in the user's data directory.

View File

@@ -1,6 +1,7 @@
import { api } from '@/scripts/api'
import { defineStore } from 'pinia'
import { computed, ref, watchEffect } from 'vue'
import { api } from '@/scripts/api'
import type { User as UserConfig } from '@/types/apiTypes'
export interface User {

View File

@@ -1,6 +1,8 @@
import { ComfyWidgets, ComfyWidgetConstructor } from '@/scripts/widgets'
import { defineStore } from 'pinia'
import { ref, computed } from 'vue'
import { computed, ref } from 'vue'
import { ComfyWidgetConstructor, ComfyWidgets } from '@/scripts/widgets'
import type { BaseInputSpec } from './nodeDefStore'
export const useWidgetStore = defineStore('widget', () => {

View File

@@ -1,13 +1,15 @@
import { defineStore } from 'pinia'
import { computed, markRaw, ref } from 'vue'
import { api } from '@/scripts/api'
import { UserFile } from './userFileStore'
import { ChangeTracker } from '@/scripts/changeTracker'
import { defaultGraphJSON } from '@/scripts/defaultGraph'
import { ComfyWorkflowJSON } from '@/types/comfyWorkflow'
import { getPathDetails } from '@/utils/formatUtil'
import { defaultGraphJSON } from '@/scripts/defaultGraph'
import { syncEntities } from '@/utils/syncUtil'
import { UserFile } from './userFileStore'
export class ComfyWorkflow extends UserFile {
static readonly basePath = 'workflows/'

View File

@@ -1,5 +1,6 @@
import { defineStore } from 'pinia'
import { ref } from 'vue'
import { api } from '@/scripts/api'
export const useWorkflowTemplatesStore = defineStore(

View File

@@ -1,12 +1,13 @@
import type { BottomPanelExtension } from '@/types/extensionTypes'
import { defineStore } from 'pinia'
import { computed, ref } from 'vue'
import { useCommandStore } from '@/stores/commandStore'
import {
useLogsTerminalTab,
useCommandTerminalTab
useCommandTerminalTab,
useLogsTerminalTab
} from '@/hooks/bottomPanelTabs/terminalTabs'
import { useCommandStore } from '@/stores/commandStore'
import { ComfyExtension } from '@/types/comfy'
import type { BottomPanelExtension } from '@/types/extensionTypes'
import { isElectron } from '@/utils/envUtil'
export const useBottomPanelStore = defineStore('bottomPanel', () => {

View File

@@ -1,14 +1,15 @@
import { defineStore } from 'pinia'
import { ref, computed } from 'vue'
import { computed, ref } from 'vue'
import {
CORE_COLOR_PALETTES,
DEFAULT_COLOR_PALETTE
} from '@/constants/coreColorPalettes'
import type {
ColorPalettes,
CompletedPalette,
Palette
} from '@/types/colorPaletteTypes'
import {
CORE_COLOR_PALETTES,
DEFAULT_COLOR_PALETTE
} from '@/constants/coreColorPalettes'
export const useColorPaletteStore = defineStore('colorPalette', () => {
const customPalettes = ref<ColorPalettes>({})

View File

@@ -1,11 +1,12 @@
import { defineStore } from 'pinia'
import { computed, ref } from 'vue'
import { useModelLibrarySidebarTab } from '@/hooks/sidebarTabs/modelLibrarySidebarTab'
import { useNodeLibrarySidebarTab } from '@/hooks/sidebarTabs/nodeLibrarySidebarTab'
import { useQueueSidebarTab } from '@/hooks/sidebarTabs/queueSidebarTab'
import { useWorkflowsSidebarTab } from '@/hooks/sidebarTabs/workflowsSidebarTab'
import { SidebarTabExtension } from '@/types/extensionTypes'
import { defineStore } from 'pinia'
import { computed, ref } from 'vue'
import { useCommandStore } from '@/stores/commandStore'
import { SidebarTabExtension } from '@/types/extensionTypes'
export const useSidebarTabStore = defineStore('sidebarTab', () => {
const sidebarTabs = ref<SidebarTabExtension[]>([])

View File

@@ -1,13 +1,15 @@
import { ref, computed } from 'vue'
import { defineStore } from 'pinia'
import type { SidebarTabExtension, ToastManager } from '@/types/extensionTypes'
import { useToastStore } from './toastStore'
import { useQueueSettingsStore } from './queueStore'
import { useCommandStore } from './commandStore'
import { useSidebarTabStore } from './workspace/sidebarTabStore'
import { useSettingStore } from './settingStore'
import { useWorkflowStore } from './workflowStore'
import { computed, ref } from 'vue'
import { useColorPaletteService } from '@/services/colorPaletteService'
import type { SidebarTabExtension, ToastManager } from '@/types/extensionTypes'
import { useCommandStore } from './commandStore'
import { useQueueSettingsStore } from './queueStore'
import { useSettingStore } from './settingStore'
import { useToastStore } from './toastStore'
import { useWorkflowStore } from './workflowStore'
import { useSidebarTabStore } from './workspace/sidebarTabStore'
export const useWorkspaceStore = defineStore('workspace', () => {
const spinner = ref(false)