diff --git a/.github/workflows/format.yaml b/.github/workflows/format.yaml index 5f052770b..b53771d7b 100644 --- a/.github/workflows/format.yaml +++ b/.github/workflows/format.yaml @@ -20,4 +20,4 @@ jobs: run: npm ci - name: Run Prettier check - run: npx prettier --check './**/*.{js,ts,tsx,vue}' \ No newline at end of file + run: npm run format:check \ No newline at end of file diff --git a/.prettierrc b/.prettierrc index f36bb1cd2..9bed0b8e2 100644 --- a/.prettierrc +++ b/.prettierrc @@ -3,5 +3,8 @@ "tabWidth": 2, "semi": false, "trailingComma": "none", - "printWidth": 80 + "printWidth": 80, + "importOrder": ["^@core/(.*)$", "", "^@/(.*)$", "^[./]"], + "importOrderSeparation": true, + "importOrderSortSpecifiers": true } \ No newline at end of file diff --git a/browser_tests/actionbar.spec.ts b/browser_tests/actionbar.spec.ts index b85e284f8..690d4be76 100644 --- a/browser_tests/actionbar.spec.ts +++ b/browser_tests/actionbar.spec.ts @@ -1,6 +1,7 @@ import type { Response } from '@playwright/test' -import type { StatusWsMessage } from '../src/types/apiTypes.ts' import { expect, mergeTests } from '@playwright/test' + +import type { StatusWsMessage } from '../src/types/apiTypes.ts' import { comfyPageFixture } from './fixtures/ComfyPage' import { webSocketFixture } from './fixtures/ws.ts' diff --git a/browser_tests/browserTabTitle.spec.ts b/browser_tests/browserTabTitle.spec.ts index 068963eab..af7f568e6 100644 --- a/browser_tests/browserTabTitle.spec.ts +++ b/browser_tests/browserTabTitle.spec.ts @@ -1,4 +1,5 @@ import { expect } from '@playwright/test' + import { comfyPageFixture as test } from './fixtures/ComfyPage' test.describe('Browser tab title', () => { diff --git a/browser_tests/changeTracker.spec.ts b/browser_tests/changeTracker.spec.ts index e21a105c0..87c3e78bb 100644 --- a/browser_tests/changeTracker.spec.ts +++ b/browser_tests/changeTracker.spec.ts @@ -1,7 +1,7 @@ import { ComfyPage, - comfyPageFixture as test, - comfyExpect as expect + comfyExpect as expect, + comfyPageFixture as test } from './fixtures/ComfyPage' async function beforeChange(comfyPage: ComfyPage) { diff --git a/browser_tests/colorPalette.spec.ts b/browser_tests/colorPalette.spec.ts index b16f08498..aa5f30f9a 100644 --- a/browser_tests/colorPalette.spec.ts +++ b/browser_tests/colorPalette.spec.ts @@ -1,4 +1,5 @@ import { expect } from '@playwright/test' + import { comfyPageFixture as test } from './fixtures/ComfyPage' const customColorPalettes = { diff --git a/browser_tests/commands.spec.ts b/browser_tests/commands.spec.ts index 65a30e648..f15ad2475 100644 --- a/browser_tests/commands.spec.ts +++ b/browser_tests/commands.spec.ts @@ -1,4 +1,5 @@ import { expect } from '@playwright/test' + import { comfyPageFixture as test } from './fixtures/ComfyPage' test.describe('Keybindings', () => { diff --git a/browser_tests/copyPaste.spec.ts b/browser_tests/copyPaste.spec.ts index 3394b19bf..7ebc56dbd 100644 --- a/browser_tests/copyPaste.spec.ts +++ b/browser_tests/copyPaste.spec.ts @@ -1,4 +1,5 @@ import { expect } from '@playwright/test' + import { comfyPageFixture as test } from './fixtures/ComfyPage' test.describe('Copy Paste', () => { diff --git a/browser_tests/dialog.spec.ts b/browser_tests/dialog.spec.ts index 0cff88ccb..d7dcfda2e 100644 --- a/browser_tests/dialog.spec.ts +++ b/browser_tests/dialog.spec.ts @@ -1,4 +1,5 @@ import { expect } from '@playwright/test' + import { comfyPageFixture as test } from './fixtures/ComfyPage' test.describe('Load workflow warning', () => { diff --git a/browser_tests/extensionAPI.spec.ts b/browser_tests/extensionAPI.spec.ts index d4e638156..9e95e31df 100644 --- a/browser_tests/extensionAPI.spec.ts +++ b/browser_tests/extensionAPI.spec.ts @@ -1,4 +1,5 @@ import { expect } from '@playwright/test' + import { comfyPageFixture as test } from './fixtures/ComfyPage' test.describe('Topbar commands', () => { diff --git a/browser_tests/fixtures/ComfyPage.ts b/browser_tests/fixtures/ComfyPage.ts index e3d886626..b0bc69816 100644 --- a/browser_tests/fixtures/ComfyPage.ts +++ b/browser_tests/fixtures/ComfyPage.ts @@ -1,24 +1,26 @@ -import type { Page, Locator, APIRequestContext } from '@playwright/test' +import type { APIRequestContext, Locator, Page } from '@playwright/test' import { expect } from '@playwright/test' import { test as base } from '@playwright/test' -import { ComfyActionbar } from '../helpers/actionbar' import dotenv from 'dotenv' -dotenv.config() import * as fs from 'fs' -import { NodeBadgeMode } from '../../src/types/nodeSource' + +import type { useWorkspaceStore } from '../../src/stores/workspaceStore' import type { NodeId } from '../../src/types/comfyWorkflow' import type { KeyCombo } from '../../src/types/keyBindingTypes' +import { NodeBadgeMode } from '../../src/types/nodeSource' +import { ComfyActionbar } from '../helpers/actionbar' import { ComfyTemplates } from '../helpers/templates' import { ComfyNodeSearchBox } from './components/ComfyNodeSearchBox' +import { SettingDialog } from './components/SettingDialog' import { NodeLibrarySidebarTab, WorkflowsSidebarTab } from './components/SidebarTab' import { Topbar } from './components/Topbar' -import { NodeReference } from './utils/litegraphUtils' import type { Position, Size } from './types' -import type { useWorkspaceStore } from '../../src/stores/workspaceStore' -import { SettingDialog } from './components/SettingDialog' +import { NodeReference } from './utils/litegraphUtils' + +dotenv.config() type WorkspaceStore = ReturnType diff --git a/browser_tests/fixtures/UserSelectPage.ts b/browser_tests/fixtures/UserSelectPage.ts index 4b78076ca..c0d4c90d3 100644 --- a/browser_tests/fixtures/UserSelectPage.ts +++ b/browser_tests/fixtures/UserSelectPage.ts @@ -1,5 +1,5 @@ -import { Page } from 'playwright' import { test as base } from '@playwright/test' +import { Page } from 'playwright' export class UserSelectPage { constructor( diff --git a/browser_tests/fixtures/utils/litegraphUtils.ts b/browser_tests/fixtures/utils/litegraphUtils.ts index 8736c5440..6e6011b64 100644 --- a/browser_tests/fixtures/utils/litegraphUtils.ts +++ b/browser_tests/fixtures/utils/litegraphUtils.ts @@ -1,6 +1,7 @@ -import { ManageGroupNode } from '../../helpers/manageGroupNode' -import type { NodeId } from '../../../src/types/comfyWorkflow' import type { Page } from '@playwright/test' + +import type { NodeId } from '../../../src/types/comfyWorkflow' +import { ManageGroupNode } from '../../helpers/manageGroupNode' import type { ComfyPage } from '../ComfyPage' import type { Position, Size } from '../types' diff --git a/browser_tests/globalSetup.ts b/browser_tests/globalSetup.ts index 86626480f..12033fce3 100644 --- a/browser_tests/globalSetup.ts +++ b/browser_tests/globalSetup.ts @@ -1,7 +1,8 @@ import { FullConfig } from '@playwright/test' -import { backupPath } from './utils/backupUtils' import dotenv from 'dotenv' +import { backupPath } from './utils/backupUtils' + dotenv.config() export default function globalSetup(config: FullConfig) { diff --git a/browser_tests/globalTeardown.ts b/browser_tests/globalTeardown.ts index 8ebb71339..47bab3db9 100644 --- a/browser_tests/globalTeardown.ts +++ b/browser_tests/globalTeardown.ts @@ -1,7 +1,8 @@ import { FullConfig } from '@playwright/test' -import { restorePath } from './utils/backupUtils' import dotenv from 'dotenv' +import { restorePath } from './utils/backupUtils' + dotenv.config() export default function globalTeardown(config: FullConfig) { diff --git a/browser_tests/graphCanvasMenu.spec.ts b/browser_tests/graphCanvasMenu.spec.ts index ca934af40..331d72204 100644 --- a/browser_tests/graphCanvasMenu.spec.ts +++ b/browser_tests/graphCanvasMenu.spec.ts @@ -1,4 +1,5 @@ import { expect } from '@playwright/test' + import { comfyPageFixture as test } from './fixtures/ComfyPage' test.describe('Graph Canvas Menu', () => { diff --git a/browser_tests/groupNode.spec.ts b/browser_tests/groupNode.spec.ts index 831c1cb43..7e44ec7ab 100644 --- a/browser_tests/groupNode.spec.ts +++ b/browser_tests/groupNode.spec.ts @@ -1,4 +1,5 @@ import { expect } from '@playwright/test' + import { ComfyPage, comfyPageFixture as test } from './fixtures/ComfyPage' import type { NodeReference } from './fixtures/utils/litegraphUtils' diff --git a/browser_tests/helpers/actionbar.ts b/browser_tests/helpers/actionbar.ts index 674979e59..f37de855a 100644 --- a/browser_tests/helpers/actionbar.ts +++ b/browser_tests/helpers/actionbar.ts @@ -1,4 +1,5 @@ -import type { Page, Locator } from '@playwright/test' +import type { Locator, Page } from '@playwright/test' + import type { AutoQueueMode } from '../../src/stores/queueStore' export class ComfyActionbar { diff --git a/browser_tests/helpers/manageGroupNode.ts b/browser_tests/helpers/manageGroupNode.ts index beebabd69..a444a97c6 100644 --- a/browser_tests/helpers/manageGroupNode.ts +++ b/browser_tests/helpers/manageGroupNode.ts @@ -1,4 +1,5 @@ import { Locator, Page } from '@playwright/test' + export class ManageGroupNode { footer: Locator header: Locator diff --git a/browser_tests/helpers/templates.ts b/browser_tests/helpers/templates.ts index d4f4ad716..3eee39128 100644 --- a/browser_tests/helpers/templates.ts +++ b/browser_tests/helpers/templates.ts @@ -1,4 +1,5 @@ import { Locator, Page } from '@playwright/test' + export class ComfyTemplates { readonly content: Locator diff --git a/browser_tests/interaction.spec.ts b/browser_tests/interaction.spec.ts index c4b695682..6730bf50c 100644 --- a/browser_tests/interaction.spec.ts +++ b/browser_tests/interaction.spec.ts @@ -1,4 +1,5 @@ import { expect } from '@playwright/test' + import { comfyPageFixture as test } from './fixtures/ComfyPage' test.describe('Item Interaction', () => { diff --git a/browser_tests/keybindings.spec.ts b/browser_tests/keybindings.spec.ts index e7a26dc8e..7c7d556e2 100644 --- a/browser_tests/keybindings.spec.ts +++ b/browser_tests/keybindings.spec.ts @@ -1,4 +1,5 @@ import { expect } from '@playwright/test' + import { comfyPageFixture as test } from './fixtures/ComfyPage' test.describe('Keybindings', () => { diff --git a/browser_tests/litegraphEvent.spec.ts b/browser_tests/litegraphEvent.spec.ts index b00db91be..26b95e07f 100644 --- a/browser_tests/litegraphEvent.spec.ts +++ b/browser_tests/litegraphEvent.spec.ts @@ -1,4 +1,5 @@ import { expect } from '@playwright/test' + import { comfyPageFixture as test } from './fixtures/ComfyPage' function listenForEvent(): Promise { diff --git a/browser_tests/loadWorkflowInMedia.spec.ts b/browser_tests/loadWorkflowInMedia.spec.ts index 05511386d..e4a89b270 100644 --- a/browser_tests/loadWorkflowInMedia.spec.ts +++ b/browser_tests/loadWorkflowInMedia.spec.ts @@ -1,4 +1,5 @@ import { expect } from '@playwright/test' + import { comfyPageFixture as test } from './fixtures/ComfyPage' test.describe('Load Workflow in Media', () => { diff --git a/browser_tests/menu.spec.ts b/browser_tests/menu.spec.ts index ded2772ec..3c5997c94 100644 --- a/browser_tests/menu.spec.ts +++ b/browser_tests/menu.spec.ts @@ -1,4 +1,5 @@ import { expect } from '@playwright/test' + import { comfyPageFixture as test } from './fixtures/ComfyPage' test.describe('Menu', () => { diff --git a/browser_tests/nodeBadge.spec.ts b/browser_tests/nodeBadge.spec.ts index 78785f84b..897037536 100644 --- a/browser_tests/nodeBadge.spec.ts +++ b/browser_tests/nodeBadge.spec.ts @@ -1,7 +1,8 @@ import { expect } from '@playwright/test' -import { comfyPageFixture as test } from './fixtures/ComfyPage' + import type { ComfyApp } from '../src/scripts/app' import { NodeBadgeMode } from '../src/types/nodeSource' +import { comfyPageFixture as test } from './fixtures/ComfyPage' test.describe('Node Badge', () => { test('Can add badge', async ({ comfyPage }) => { diff --git a/browser_tests/nodeDisplay.spec.ts b/browser_tests/nodeDisplay.spec.ts index 937263d23..95fc58311 100644 --- a/browser_tests/nodeDisplay.spec.ts +++ b/browser_tests/nodeDisplay.spec.ts @@ -1,4 +1,5 @@ import { expect } from '@playwright/test' + import { comfyPageFixture as test } from './fixtures/ComfyPage' // If an input is optional by node definition, it should be shown as diff --git a/browser_tests/nodeSearchBox.spec.ts b/browser_tests/nodeSearchBox.spec.ts index f02c588ee..f6c2feacc 100644 --- a/browser_tests/nodeSearchBox.spec.ts +++ b/browser_tests/nodeSearchBox.spec.ts @@ -1,6 +1,6 @@ import { - comfyPageFixture as test, - comfyExpect as expect + comfyExpect as expect, + comfyPageFixture as test } from './fixtures/ComfyPage' test.describe('Node search box', () => { diff --git a/browser_tests/primitiveNode.spec.ts b/browser_tests/primitiveNode.spec.ts index 6ac3ef8a2..65ea7af6c 100644 --- a/browser_tests/primitiveNode.spec.ts +++ b/browser_tests/primitiveNode.spec.ts @@ -1,4 +1,5 @@ import { expect } from '@playwright/test' + import { comfyPageFixture as test } from './fixtures/ComfyPage' import type { NodeReference } from './fixtures/utils/litegraphUtils' diff --git a/browser_tests/propertiesPanel.spec.ts b/browser_tests/propertiesPanel.spec.ts index 964dc6f3f..866ae0015 100644 --- a/browser_tests/propertiesPanel.spec.ts +++ b/browser_tests/propertiesPanel.spec.ts @@ -1,4 +1,5 @@ import { expect } from '@playwright/test' + import { comfyPageFixture as test } from './fixtures/ComfyPage' test.describe('Properties Panel', () => { diff --git a/browser_tests/rerouteNode.spec.ts b/browser_tests/rerouteNode.spec.ts index 2ebb7b8f6..ea0345f70 100644 --- a/browser_tests/rerouteNode.spec.ts +++ b/browser_tests/rerouteNode.spec.ts @@ -1,4 +1,5 @@ import { expect } from '@playwright/test' + import { comfyPageFixture as test } from './fixtures/ComfyPage' test.describe('Reroute Node', () => { diff --git a/browser_tests/rightClickMenu.spec.ts b/browser_tests/rightClickMenu.spec.ts index a7a28b21f..389d07104 100644 --- a/browser_tests/rightClickMenu.spec.ts +++ b/browser_tests/rightClickMenu.spec.ts @@ -1,6 +1,7 @@ import { expect } from '@playwright/test' -import { comfyPageFixture as test } from './fixtures/ComfyPage' + import { NodeBadgeMode } from '../src/types/nodeSource' +import { comfyPageFixture as test } from './fixtures/ComfyPage' test.describe('Canvas Right Click Menu', () => { // See https://github.com/comfyanonymous/ComfyUI/issues/3883 diff --git a/browser_tests/templates.spec.ts b/browser_tests/templates.spec.ts index ea5101a1e..78ba800d6 100644 --- a/browser_tests/templates.spec.ts +++ b/browser_tests/templates.spec.ts @@ -1,4 +1,5 @@ import { expect } from '@playwright/test' + import { comfyPageFixture as test } from './fixtures/ComfyPage' test.describe('Templates', () => { diff --git a/browser_tests/textWidgetTruncate.spec.ts b/browser_tests/textWidgetTruncate.spec.ts index 772b7c417..0d90f42d7 100644 --- a/browser_tests/textWidgetTruncate.spec.ts +++ b/browser_tests/textWidgetTruncate.spec.ts @@ -1,4 +1,5 @@ import { expect } from '@playwright/test' + import { comfyPageFixture as test } from './fixtures/ComfyPage' test.describe('Combo text widget', () => { diff --git a/browser_tests/userSelectView.spec.ts b/browser_tests/userSelectView.spec.ts index 68d822b84..a3a846f7c 100644 --- a/browser_tests/userSelectView.spec.ts +++ b/browser_tests/userSelectView.spec.ts @@ -1,4 +1,5 @@ import { expect } from '@playwright/test' + import { userSelectPageFixture as test } from './fixtures/UserSelectPage' /** diff --git a/browser_tests/utils/backupUtils.ts b/browser_tests/utils/backupUtils.ts index 0d2ae1f4d..0e969c706 100644 --- a/browser_tests/utils/backupUtils.ts +++ b/browser_tests/utils/backupUtils.ts @@ -1,5 +1,5 @@ -import path from 'path' import fs from 'fs-extra' +import path from 'path' type PathParts = readonly [string, ...string[]] diff --git a/eslint.config.js b/eslint.config.js index f65f862eb..660f911d1 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -1,8 +1,8 @@ -import globals from 'globals' import pluginJs from '@eslint/js' -import tseslint from 'typescript-eslint' -import pluginVue from 'eslint-plugin-vue' import unusedImports from 'eslint-plugin-unused-imports' +import pluginVue from 'eslint-plugin-vue' +import globals from 'globals' +import tseslint from 'typescript-eslint' export default [ { diff --git a/lint-staged.config.js b/lint-staged.config.js index a62f5669d..10205624f 100644 --- a/lint-staged.config.js +++ b/lint-staged.config.js @@ -11,7 +11,7 @@ export default { function formatAndEslint(fileNames) { return [ - `prettier --write ${fileNames.join(' ')}`, + `prettier --write ${fileNames.join(' ')} --plugin @trivago/prettier-plugin-sort-imports`, `eslint --fix ${fileNames.join(' ')}` ] } diff --git a/package-lock.json b/package-lock.json index 163887916..0b7b3e512 100644 --- a/package-lock.json +++ b/package-lock.json @@ -48,6 +48,7 @@ "@lobehub/i18n-cli": "^1.20.0", "@pinia/testing": "^0.1.5", "@playwright/test": "^1.44.1", + "@trivago/prettier-plugin-sort-imports": "^5.2.0", "@types/jest": "^29.5.12", "@types/lodash": "^4.17.6", "@types/node": "^20.14.8", @@ -197,12 +198,14 @@ } }, "node_modules/@babel/code-frame": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.24.7.tgz", - "integrity": "sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA==", + "version": "7.26.2", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.2.tgz", + "integrity": "sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/highlight": "^7.24.7", + "@babel/helper-validator-identifier": "^7.25.9", + "js-tokens": "^4.0.0", "picocolors": "^1.0.0" }, "engines": { @@ -249,15 +252,17 @@ } }, "node_modules/@babel/generator": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.24.7.tgz", - "integrity": "sha512-oipXieGC3i45Y1A41t4tAqpnEZWgB/lC6Ehh6+rOviR5XWpTtMmLN+fGjz9vOiNRt0p6RtO6DtD0pdU3vpqdSA==", + "version": "7.26.3", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.26.3.tgz", + "integrity": "sha512-6FF/urZvD0sTeO7k6/B15pMLC4CHUv1426lzr3N01aHJTl046uCAh9LXW/fzeXXjPNCJ6iABW5XaWOsIZB93aQ==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/types": "^7.24.7", + "@babel/parser": "^7.26.3", + "@babel/types": "^7.26.3", "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.25", - "jsesc": "^2.5.1" + "jsesc": "^3.0.2" }, "engines": { "node": ">=6.9.0" @@ -590,42 +595,13 @@ "node": ">=6.9.0" } }, - "node_modules/@babel/highlight": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.7.tgz", - "integrity": "sha512-EStJpq4OuY8xYfhGVXngigBJRWxftKX9ksiGDnmlY3o7B/V7KIAc9X4oiK87uPJSc/vs5L869bem5fhZa8caZw==", - "dev": true, - "dependencies": { - "@babel/helper-validator-identifier": "^7.24.7", - "chalk": "^2.4.2", - "js-tokens": "^4.0.0", - "picocolors": "^1.0.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/highlight/node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/@babel/parser": { - "version": "7.26.2", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.26.2.tgz", - "integrity": "sha512-DWMCZH9WA4Maitz2q21SRKHo9QXZxkDsbNZoVD62gusNtNBBqDg9i7uOhASfTfIGNzW+O+r7+jAlM8dwphcJKQ==", + "version": "7.26.3", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.26.3.tgz", + "integrity": "sha512-WJ/CvmY8Mea8iDXo6a7RK2wbmJITT5fN3BEkRuFlxVyNx8jOKIIhmC4fSkTcPcf8JyavbBwIe6OpiCOBXt/IcA==", "license": "MIT", "dependencies": { - "@babel/types": "^7.26.0" + "@babel/types": "^7.26.3" }, "bin": { "parser": "bin/babel-parser.js" @@ -1895,33 +1871,32 @@ } }, "node_modules/@babel/template": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.24.7.tgz", - "integrity": "sha512-jYqfPrU9JTF0PmPy1tLYHW4Mp4KlgxJD9l2nP9fD6yT/ICi554DmrWBAEYpIelzjHf1msDP3PxJIRt/nFNfBig==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.25.9.tgz", + "integrity": "sha512-9DGttpmPvIxBb/2uwpVo3dqJ+O6RooAFOS+lB+xDqoE2PVCE8nfoHMdZLpfCQRLwvohzXISPZcgxt80xLfsuwg==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/code-frame": "^7.24.7", - "@babel/parser": "^7.24.7", - "@babel/types": "^7.24.7" + "@babel/code-frame": "^7.25.9", + "@babel/parser": "^7.25.9", + "@babel/types": "^7.25.9" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/traverse": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.24.7.tgz", - "integrity": "sha512-yb65Ed5S/QAcewNPh0nZczy9JdYXkkAbIsEo+P7BE7yO3txAY30Y/oPa3QkQ5It3xVG2kpKMg9MsdxZaO31uKA==", + "version": "7.26.4", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.26.4.tgz", + "integrity": "sha512-fH+b7Y4p3yqvApJALCPJcwb0/XaOSgtK4pzV6WVjPR5GLFQBRI7pfoX2V2iM48NXvX07NUxxm1Vw98YjqTcU5w==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/code-frame": "^7.24.7", - "@babel/generator": "^7.24.7", - "@babel/helper-environment-visitor": "^7.24.7", - "@babel/helper-function-name": "^7.24.7", - "@babel/helper-hoist-variables": "^7.24.7", - "@babel/helper-split-export-declaration": "^7.24.7", - "@babel/parser": "^7.24.7", - "@babel/types": "^7.24.7", + "@babel/code-frame": "^7.26.2", + "@babel/generator": "^7.26.3", + "@babel/parser": "^7.26.3", + "@babel/template": "^7.25.9", + "@babel/types": "^7.26.3", "debug": "^4.3.1", "globals": "^11.1.0" }, @@ -1940,9 +1915,9 @@ } }, "node_modules/@babel/types": { - "version": "7.26.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.26.0.tgz", - "integrity": "sha512-Z/yiTPj+lDVnF7lWeKCIJzaIkI0vYO87dMpZ4bg4TDrFe4XXLFWL1TbXU27gBP3QccxV9mZICCrnjnYlJjXHOA==", + "version": "7.26.3", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.26.3.tgz", + "integrity": "sha512-vN5p+1kl59GVKMvTHt55NzzmYVxprfJD+ql7U9NFIfKCBkYE55LYtS+WtPlaYOyzydrKI8Nezd+aZextrd+FMA==", "license": "MIT", "dependencies": { "@babel/helper-string-parser": "^7.25.9", @@ -4917,6 +4892,41 @@ "node": ">= 10" } }, + "node_modules/@trivago/prettier-plugin-sort-imports": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@trivago/prettier-plugin-sort-imports/-/prettier-plugin-sort-imports-5.2.0.tgz", + "integrity": "sha512-yEIJ7xMKYQwyNRjxSdi4Gs37iszikAjxfky+3hu9bn24u8eHLJNDMAoOTyowp8p6EpSl8IQMdkfBx+WnJTttsw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@babel/generator": "^7.26.2", + "@babel/parser": "^7.26.2", + "@babel/traverse": "^7.25.9", + "@babel/types": "^7.26.0", + "javascript-natural-sort": "^0.7.1", + "lodash": "^4.17.21" + }, + "engines": { + "node": ">18.12" + }, + "peerDependencies": { + "@vue/compiler-sfc": "3.x", + "prettier": "2.x - 3.x", + "prettier-plugin-svelte": "3.x", + "svelte": "4.x" + }, + "peerDependenciesMeta": { + "@vue/compiler-sfc": { + "optional": true + }, + "prettier-plugin-svelte": { + "optional": true + }, + "svelte": { + "optional": true + } + } + }, "node_modules/@tsconfig/node10": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.11.tgz", @@ -6937,9 +6947,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001640", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001640.tgz", - "integrity": "sha512-lA4VMpW0PSUrFnkmVuEKBUovSWKhj7puyCg8StBChgu298N1AtuF1sKWEvfDuimSEDbhlb/KqPKC3fs1HbuQUA==", + "version": "1.0.30001690", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001690.tgz", + "integrity": "sha512-5ExiE3qQN6oF8Clf8ifIDcMRCRE/dMGcETG/XGMD8/XiXm6HXQgQTh1yZYLXXpSOsEUlJm1Xr7kGULZTuGtP/w==", "dev": true, "funding": [ { @@ -6954,7 +6964,8 @@ "type": "github", "url": "https://github.com/sponsors/ai" } - ] + ], + "license": "CC-BY-4.0" }, "node_modules/ccount": { "version": "2.0.1", @@ -10353,6 +10364,13 @@ "@pkgjs/parseargs": "^0.11.0" } }, + "node_modules/javascript-natural-sort": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/javascript-natural-sort/-/javascript-natural-sort-0.7.1.tgz", + "integrity": "sha512-nO6jcEfZWQXDhOiBtG2KvKyEptz7RVbpGP4vTD2hLBdmNQSsCiicO2Ioinv6UI4y9ukqnBpy+XZ9H6uLNgJTlw==", + "dev": true, + "license": "MIT" + }, "node_modules/jest": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest/-/jest-29.7.0.tgz", @@ -12106,15 +12124,16 @@ } }, "node_modules/jsesc": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", - "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", + "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", "dev": true, + "license": "MIT", "bin": { "jsesc": "bin/jsesc" }, "engines": { - "node": ">=4" + "node": ">=6" } }, "node_modules/json-buffer": { diff --git a/package.json b/package.json index 4ad620964..7b1485400 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,8 @@ "update-litegraph": "node scripts/update-litegraph.js", "zipdist": "node scripts/zipdist.js", "typecheck": "vue-tsc --noEmit && tsc --noEmit && tsc-strict", - "format": "prettier --write './**/*.{js,ts,tsx,vue}'", + "format": "prettier --write './**/*.{js,ts,tsx,vue,mts}' --plugin @trivago/prettier-plugin-sort-imports", + "format:check": "prettier --check './**/*.{js,ts,tsx,vue,mts}' --plugin @trivago/prettier-plugin-sort-imports", "test:jest": "jest --config jest.config.ts", "test:generate": "npx tsx tests-ui/setup", "test:browser": "npx playwright test", @@ -37,6 +38,7 @@ "@lobehub/i18n-cli": "^1.20.0", "@pinia/testing": "^0.1.5", "@playwright/test": "^1.44.1", + "@trivago/prettier-plugin-sort-imports": "^5.2.0", "@types/jest": "^29.5.12", "@types/lodash": "^4.17.6", "@types/node": "^20.14.8", diff --git a/scripts/collect-i18n.ts b/scripts/collect-i18n.ts index 5148ea238..5e6fe53ec 100644 --- a/scripts/collect-i18n.ts +++ b/scripts/collect-i18n.ts @@ -1,12 +1,13 @@ import * as fs from 'fs' + import { comfyPageFixture as test } from '../browser_tests/fixtures/ComfyPage' import { CORE_MENU_COMMANDS } from '../src/constants/coreMenuCommands' import { SERVER_CONFIG_ITEMS } from '../src/constants/serverConfig' -import { formatCamelCase, normalizeI18nKey } from '../src/utils/formatUtil' -import { ComfyNodeDefImpl } from '../src/stores/nodeDefStore' -import type { ComfyCommandImpl } from '../src/stores/commandStore' -import type { FormItem, SettingParams } from '../src/types/settingTypes' import type { ComfyApi } from '../src/scripts/api' +import type { ComfyCommandImpl } from '../src/stores/commandStore' +import { ComfyNodeDefImpl } from '../src/stores/nodeDefStore' +import type { FormItem, SettingParams } from '../src/types/settingTypes' +import { formatCamelCase, normalizeI18nKey } from '../src/utils/formatUtil' const localePath = './src/locales/en/main.json' const nodeDefsPath = './src/locales/en/nodeDefs.json' diff --git a/scripts/deploy.js b/scripts/deploy.js index 1e2a49447..5d77e7ae6 100644 --- a/scripts/deploy.js +++ b/scripts/deploy.js @@ -1,8 +1,10 @@ -import { copy } from 'fs-extra' import { config } from 'dotenv' +import { copy } from 'fs-extra' + config() const sourceDir = './dist' +// eslint-disable-next-line no-undef const targetDir = process.env.DEPLOY_COMFYUI_DIR copy(sourceDir, targetDir) diff --git a/scripts/diff-i18n.ts b/scripts/diff-i18n.ts index b365bf45a..331333367 100644 --- a/scripts/diff-i18n.ts +++ b/scripts/diff-i18n.ts @@ -1,12 +1,12 @@ import { - readFileSync, - writeFileSync, - readdirSync, - mkdirSync, existsSync, - rmSync + mkdirSync, + readFileSync, + readdirSync, + rmSync, + writeFileSync } from 'fs' -import { join, dirname } from 'path' +import { dirname, join } from 'path' // Ensure directories exist function ensureDir(dir: string) { diff --git a/src/App.vue b/src/App.vue index 73222bd14..2a8bae885 100644 --- a/src/App.vue +++ b/src/App.vue @@ -9,13 +9,15 @@ diff --git a/src/components/sidebar/tabs/modelLibrary/ModelTreeLeaf.vue b/src/components/sidebar/tabs/modelLibrary/ModelTreeLeaf.vue index c47228bd7..3635059d4 100644 --- a/src/components/sidebar/tabs/modelLibrary/ModelTreeLeaf.vue +++ b/src/components/sidebar/tabs/modelLibrary/ModelTreeLeaf.vue @@ -21,19 +21,21 @@ diff --git a/src/components/topbar/CommandMenubar.vue b/src/components/topbar/CommandMenubar.vue index 49bfb17c4..5319c9fa5 100644 --- a/src/components/topbar/CommandMenubar.vue +++ b/src/components/topbar/CommandMenubar.vue @@ -29,14 +29,15 @@