feat: polish workflow studio and workspace assets

This commit is contained in:
boos
2026-05-25 20:42:38 +08:00
parent cb35d5fc6e
commit 1ba293c262
29 changed files with 2299 additions and 158 deletions
+9 -3
View File
@@ -4,7 +4,7 @@ import { spawn } from 'child_process';
const ROOT = process.cwd();
const REPO = process.env.BOOSAPI_WORKFLOW_UI_REPO || 'https://github.com/Comfy-Org/ComfyUI_frontend.git';
const REF = process.env.BOOSAPI_WORKFLOW_UI_REF || 'v1.9.19';
const REF = process.env.BOOSAPI_WORKFLOW_UI_REF || 'v1.46.1';
const DIR = path.join(ROOT, '.cache', 'comfyui-frontend');
const DIST = path.join(ROOT, 'dist', 'workflow-ui');
@@ -27,8 +27,14 @@ function run(command, args, options = {}) {
await fs.mkdir(path.dirname(DIR), { recursive: true });
await fs.rm(DIR, { recursive: true, force: true });
await run('git', ['clone', '--depth', '1', '--branch', REF, REPO, DIR]);
await run('npm', ['ci'], { cwd: DIR });
await run('npm', ['run', 'build'], { cwd: DIR });
const hasPnpmLock = await fs.access(path.join(DIR, 'pnpm-lock.yaml')).then(() => true, () => false);
if (hasPnpmLock) {
await run('pnpm', ['install', '--frozen-lockfile'], { cwd: DIR });
await run('pnpm', ['exec', 'vite', 'build', '--config', 'vite.config.mts'], { cwd: DIR });
} else {
await run('npm', ['ci'], { cwd: DIR });
await run('npm', ['run', 'build'], { cwd: DIR });
}
await fs.rm(DIST, { recursive: true, force: true });
await fs.cp(path.join(DIR, 'dist'), DIST, { recursive: true });
console.log(`workflow-ui installed to ${DIST}`);