mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-03 06:47:33 +00:00
- Add proper type guards for all widget input specs (Color, TreeSelect, MultiSelect, FileUpload, Galleria) - Enhance schemas with missing properties (format, placeholder, accept, extensions, tooltip) - Fix widgets to honor runtime props like disabled while accessing spec metadata - Eliminate all 'as any' usage in widget components with proper TypeScript types - Clean separation: widget.spec.options for metadata, widget.options for runtime state - Refactor devtools into modular structure with vue_widgets showcase nodes
42 lines
1.1 KiB
TypeScript
42 lines
1.1 KiB
TypeScript
import fs from 'fs-extra'
|
|
import path from 'path'
|
|
import { fileURLToPath } from 'url'
|
|
|
|
export function syncDevtools(targetComfyDir: string) {
|
|
if (!targetComfyDir) {
|
|
console.warn('syncDevtools skipped: TEST_COMFYUI_DIR not set')
|
|
return
|
|
}
|
|
|
|
const moduleDir =
|
|
typeof __dirname !== 'undefined'
|
|
? __dirname
|
|
: path.dirname(fileURLToPath(import.meta.url))
|
|
|
|
const devtoolsSrc = path.resolve(moduleDir, '..', '..', 'tools', 'devtools')
|
|
|
|
if (!fs.pathExistsSync(devtoolsSrc)) {
|
|
console.warn(
|
|
`syncDevtools skipped: source directory not found at ${devtoolsSrc}`
|
|
)
|
|
return
|
|
}
|
|
|
|
const devtoolsDest = path.resolve(
|
|
targetComfyDir,
|
|
'custom_nodes',
|
|
'ComfyUI_devtools'
|
|
)
|
|
|
|
console.warn(`syncDevtools: copying ${devtoolsSrc} -> ${devtoolsDest}`)
|
|
|
|
try {
|
|
fs.removeSync(devtoolsDest)
|
|
fs.ensureDirSync(devtoolsDest)
|
|
fs.copySync(devtoolsSrc, devtoolsDest, { overwrite: true })
|
|
console.warn('syncDevtools: copy complete')
|
|
} catch (error) {
|
|
console.error(`Failed to sync DevTools to ${devtoolsDest}:`, error)
|
|
}
|
|
}
|