mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-29 10:42:44 +00:00
[i18n] Ignore devtools nodes for i18n (#2835)
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
import * as fs from 'fs'
|
import * as fs from 'fs'
|
||||||
|
|
||||||
import { comfyPageFixture as test } from '../browser_tests/fixtures/ComfyPage'
|
import { comfyPageFixture as test } from '../browser_tests/fixtures/ComfyPage'
|
||||||
|
import type { ComfyNodeDef } from '../src/schemas/nodeDefSchema'
|
||||||
import type { ComfyApi } from '../src/scripts/api'
|
import type { ComfyApi } from '../src/scripts/api'
|
||||||
import { ComfyNodeDefImpl } from '../src/stores/nodeDefStore'
|
import { ComfyNodeDefImpl } from '../src/stores/nodeDefStore'
|
||||||
import { normalizeI18nKey } from '../src/utils/formatUtil'
|
import { normalizeI18nKey } from '../src/utils/formatUtil'
|
||||||
@@ -16,12 +17,17 @@ test('collect-i18n-node-defs', async ({ comfyPage }) => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
const nodeDefs: ComfyNodeDefImpl[] = Object.values(
|
const nodeDefs: ComfyNodeDefImpl[] = (
|
||||||
await comfyPage.page.evaluate(async () => {
|
Object.values(
|
||||||
const api = window['app'].api as ComfyApi
|
await comfyPage.page.evaluate(async () => {
|
||||||
return await api.getNodeDefs()
|
const api = window['app'].api as ComfyApi
|
||||||
})
|
return await api.getNodeDefs()
|
||||||
).map((def) => new ComfyNodeDefImpl(def))
|
})
|
||||||
|
) as ComfyNodeDef[]
|
||||||
|
)
|
||||||
|
// Ignore DevTools nodes (used for internal testing)
|
||||||
|
.filter((def) => !def.name.startsWith('DevTools'))
|
||||||
|
.map((def) => new ComfyNodeDefImpl(def))
|
||||||
|
|
||||||
console.log(`Collected ${nodeDefs.length} node definitions`)
|
console.log(`Collected ${nodeDefs.length} node definitions`)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user