From e614fca7a3b0285918422622c229f603e68d9bf2 Mon Sep 17 00:00:00 2001 From: qiqi Date: Wed, 25 Nov 2026 15:55:46 +0800 Subject: [PATCH] =?UTF-8?q?chore(tests):=20=E6=B5=8B=E8=AF=95=E8=84=9A?= =?UTF-8?q?=E6=9C=AC=E4=BE=9D=E8=B5=96=E6=9F=A5=E6=89=BE=E8=B7=AF=E5=BE=84?= =?UTF-8?q?=E4=BB=8E=E7=BD=91=E9=A1=B5=E7=AB=AF=E4=BB=93=E6=94=B9=E5=88=B0?= =?UTF-8?q?=E6=A1=8C=E9=9D=A2=E7=AB=AF=E4=BB=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 本仓只服务桌面宿主 image-workbench-desktop,与网页端无限画布工具无关。 14 个测试/工具脚本里共 15 处仍把 image-workbench-web 当 playwright/esbuild 的依赖后备目录(含 path.resolve、报错文案、album viewer-e2e 的多余候选), 全部改为 image-workbench-desktop;album 里重复的 web 仓候选直接删掉。 这些常量只用于找 node_modules,不参与任何插件逻辑,行为零变化。 桌面仓已确认有 playwright 1.64.1 / esbuild 0.28.2,改后依赖解析有效。 本轮不动 6 处 test.image-workbench-web.pages.dev 网址(属于网页端 e2e 脚本的废弃处理,另案);插件源码与版本未动,不需要发市场。 --- album/tools/viewer-e2e.mjs | 3 +-- batch-export/tools/e2e-site.mjs | 2 +- batch-export/tools/harness.mjs | 2 +- image-annotate/tools/e2e-site.mjs | 2 +- image-annotate/tools/harness.mjs | 2 +- image-vectorize/tools/bundle-engine.mjs | 2 +- image-vectorize/tools/e2e-site.mjs | 2 +- image-vectorize/tools/harness.mjs | 2 +- image-vectorize/tools/trace-cli.mjs | 2 +- style-source/tools/e2e-real.mjs | 2 +- style-source/tools/e2e-test-site.mjs | 4 ++-- style-source/tools/harness.mjs | 2 +- white-bg-800/tools/e2e-site.mjs | 2 +- white-bg-800/tools/harness.mjs | 2 +- 14 files changed, 15 insertions(+), 16 deletions(-) diff --git a/album/tools/viewer-e2e.mjs b/album/tools/viewer-e2e.mjs index 39d2ad2..b4fc995 100644 --- a/album/tools/viewer-e2e.mjs +++ b/album/tools/viewer-e2e.mjs @@ -21,8 +21,7 @@ const css = readFileSync(path.join(ROOT, 'styles.css'), 'utf8') let chromium = null for (const base of [process.env.IWB_PLAYWRIGHT_ROOT, - '/Users/qiqi/open/github/image-workbench-desktop', - '/Users/qiqi/open/github/image-workbench-web', ROOT]) { + '/Users/qiqi/open/github/image-workbench-desktop', ROOT]) { if (!base) continue try { chromium = createRequire(path.join(base, 'package.json'))('playwright').chromium; break } catch (e) { /* 试下一个 */ } } diff --git a/batch-export/tools/e2e-site.mjs b/batch-export/tools/e2e-site.mjs index 3ff8b28..c72fced 100644 --- a/batch-export/tools/e2e-site.mjs +++ b/batch-export/tools/e2e-site.mjs @@ -19,7 +19,7 @@ import { fileURLToPath } from 'node:url' const HERE = path.dirname(fileURLToPath(import.meta.url)) // /batch-export/tools const REPO = path.resolve(HERE, '../..') // -const HOST_REPO = '/Users/qiqi/open/github/image-workbench-web' +const HOST_REPO = '/Users/qiqi/open/github/image-workbench-desktop' let chromium = null for (const base of [process.env.IWB_PLAYWRIGHT_ROOT, REPO, HOST_REPO, process.cwd()].filter(Boolean)) { diff --git a/batch-export/tools/harness.mjs b/batch-export/tools/harness.mjs index a3ee991..7993a7a 100644 --- a/batch-export/tools/harness.mjs +++ b/batch-export/tools/harness.mjs @@ -16,7 +16,7 @@ import { fileURLToPath } from 'node:url' const HERE = path.dirname(fileURLToPath(import.meta.url)) // /batch-export/tools const REPO = path.resolve(HERE, '../..') -const HOST_REPO = '/Users/qiqi/open/github/image-workbench-web' +const HOST_REPO = '/Users/qiqi/open/github/image-workbench-desktop' const PLUGIN_ENTRY = path.resolve(HERE, '../src/index.js') let chromium = null diff --git a/image-annotate/tools/e2e-site.mjs b/image-annotate/tools/e2e-site.mjs index 60c0a7e..7fc6a13 100644 --- a/image-annotate/tools/e2e-site.mjs +++ b/image-annotate/tools/e2e-site.mjs @@ -15,7 +15,7 @@ import { fileURLToPath } from 'node:url' const HERE = path.dirname(fileURLToPath(import.meta.url)) // /image-annotate/tools const REPO = path.resolve(HERE, '../..') // -const HOST_REPO = '/Users/qiqi/open/github/image-workbench-web' +const HOST_REPO = '/Users/qiqi/open/github/image-workbench-desktop' let chromium = null for (const base of [process.env.IWB_PLAYWRIGHT_ROOT, REPO, HOST_REPO, process.cwd()].filter(Boolean)) { diff --git a/image-annotate/tools/harness.mjs b/image-annotate/tools/harness.mjs index d00532d..af72c01 100644 --- a/image-annotate/tools/harness.mjs +++ b/image-annotate/tools/harness.mjs @@ -13,7 +13,7 @@ import { fileURLToPath } from 'node:url' const HERE = path.dirname(fileURLToPath(import.meta.url)) const REPO = path.resolve(HERE, '../..') -const HOST_REPO = '/Users/qiqi/open/github/image-workbench-web' +const HOST_REPO = '/Users/qiqi/open/github/image-workbench-desktop' const PLUGIN_ENTRY = path.resolve(HERE, '../src/index.js') // 版本真源是 package.json(构建时注入 manifest),探针不再硬编码,免得每次发版都要改测试 const PKG_VERSION = JSON.parse(readFileSync(path.resolve(HERE, '../package.json'), 'utf8')).version diff --git a/image-vectorize/tools/bundle-engine.mjs b/image-vectorize/tools/bundle-engine.mjs index 01de46d..91ed12e 100644 --- a/image-vectorize/tools/bundle-engine.mjs +++ b/image-vectorize/tools/bundle-engine.mjs @@ -7,7 +7,7 @@ import { createRequire } from 'node:module' const HERE = path.dirname(fileURLToPath(import.meta.url)) const PLUGIN = path.resolve(HERE, '../plugin') -const HOST_REPO = '/Users/qiqi/open/github/image-workbench-web' +const HOST_REPO = '/Users/qiqi/open/github/image-workbench-desktop' const REPO = path.resolve(HERE, '../..') export function esbuildModule() { diff --git a/image-vectorize/tools/e2e-site.mjs b/image-vectorize/tools/e2e-site.mjs index bba42eb..d9ec5c7 100644 --- a/image-vectorize/tools/e2e-site.mjs +++ b/image-vectorize/tools/e2e-site.mjs @@ -15,7 +15,7 @@ import { fileURLToPath } from 'node:url' const HERE = path.dirname(fileURLToPath(import.meta.url)) const REPO = path.resolve(HERE, '../..') -const HOST_REPO = '/Users/qiqi/open/github/image-workbench-web' +const HOST_REPO = '/Users/qiqi/open/github/image-workbench-desktop' let chromium = null for (const base of [process.env.IWB_PLAYWRIGHT_ROOT, REPO, HOST_REPO, process.cwd()].filter(Boolean)) { diff --git a/image-vectorize/tools/harness.mjs b/image-vectorize/tools/harness.mjs index 637bcb5..95c723b 100644 --- a/image-vectorize/tools/harness.mjs +++ b/image-vectorize/tools/harness.mjs @@ -16,7 +16,7 @@ import { fileURLToPath } from 'node:url' const HERE = path.dirname(fileURLToPath(import.meta.url)) const REPO = path.resolve(HERE, '../..') -const HOST_REPO = '/Users/qiqi/open/github/image-workbench-web' +const HOST_REPO = '/Users/qiqi/open/github/image-workbench-desktop' const PLUGIN_ENTRY = path.resolve(HERE, '../src/index.js') const WANT_VERSION = JSON.parse(readFileSync(path.join(HERE, '../package.json'), 'utf8')).version diff --git a/image-vectorize/tools/trace-cli.mjs b/image-vectorize/tools/trace-cli.mjs index b19fa46..42af96a 100644 --- a/image-vectorize/tools/trace-cli.mjs +++ b/image-vectorize/tools/trace-cli.mjs @@ -16,7 +16,7 @@ import { bundleEngine } from './bundle-engine.mjs' const HERE = path.dirname(fileURLToPath(import.meta.url)) const REPO = path.resolve(HERE, '../..') -const HOST_REPO = '/Users/qiqi/open/github/image-workbench-web' +const HOST_REPO = '/Users/qiqi/open/github/image-workbench-desktop' let chromium = null for (const base of [HOST_REPO, REPO, process.cwd()]) { diff --git a/style-source/tools/e2e-real.mjs b/style-source/tools/e2e-real.mjs index 952a6ac..f9dd116 100644 --- a/style-source/tools/e2e-real.mjs +++ b/style-source/tools/e2e-real.mjs @@ -15,7 +15,7 @@ import { fileURLToPath } from 'node:url' const HERE = path.dirname(fileURLToPath(import.meta.url)) const REPO = path.resolve(HERE, '../..') -const HOST_REPO = '/Users/qiqi/open/github/image-workbench-web' +const HOST_REPO = '/Users/qiqi/open/github/image-workbench-desktop' const PLUGIN_ENTRY = path.resolve(HERE, '../src/index.js') let chromium = null diff --git a/style-source/tools/e2e-test-site.mjs b/style-source/tools/e2e-test-site.mjs index d0d2645..9891324 100644 --- a/style-source/tools/e2e-test-site.mjs +++ b/style-source/tools/e2e-test-site.mjs @@ -19,13 +19,13 @@ import fs from 'node:fs' const HERE = path.dirname(new URL(import.meta.url).pathname) let chromium = null -for (const base of [path.resolve(HERE, '../..'), path.resolve(HERE, '../../../image-workbench-web'), process.cwd()]) { +for (const base of [path.resolve(HERE, '../..'), path.resolve(HERE, '../../../image-workbench-desktop'), process.cwd()]) { const pkg = path.join(base, 'package.json') if (!fs.existsSync(pkg)) continue try { chromium = createRequire(pkg)('playwright').chromium; break } catch { /* 换下一个 */ } } if (!chromium) { - console.error('找不到 playwright:请在插件仓根目录或宿主仓(image-workbench-web)里跑') + console.error('找不到 playwright:请在插件仓根目录或宿主仓(image-workbench-desktop)里跑') process.exit(2) } diff --git a/style-source/tools/harness.mjs b/style-source/tools/harness.mjs index bace789..6f82bda 100644 --- a/style-source/tools/harness.mjs +++ b/style-source/tools/harness.mjs @@ -18,7 +18,7 @@ import { fileURLToPath } from 'node:url' const HERE = path.dirname(fileURLToPath(import.meta.url)) // /style-source/tools const REPO = path.resolve(HERE, '../..') -const HOST_REPO = '/Users/qiqi/open/github/image-workbench-web' +const HOST_REPO = '/Users/qiqi/open/github/image-workbench-desktop' const PLUGIN_ENTRY = path.resolve(HERE, '../src/index.js') const STYLES_JSON = '/Users/qiqi/open/github/style-source/data/styles.json' diff --git a/white-bg-800/tools/e2e-site.mjs b/white-bg-800/tools/e2e-site.mjs index 152362b..3b8ef0d 100644 --- a/white-bg-800/tools/e2e-site.mjs +++ b/white-bg-800/tools/e2e-site.mjs @@ -16,7 +16,7 @@ import { fileURLToPath } from 'node:url' const HERE = path.dirname(fileURLToPath(import.meta.url)) // /white-bg-800/tools const REPO = path.resolve(HERE, '../..') // -const HOST_REPO = '/Users/qiqi/open/github/image-workbench-web' +const HOST_REPO = '/Users/qiqi/open/github/image-workbench-desktop' let chromium = null for (const base of [process.env.IWB_PLAYWRIGHT_ROOT, REPO, HOST_REPO, process.cwd()].filter(Boolean)) { diff --git a/white-bg-800/tools/harness.mjs b/white-bg-800/tools/harness.mjs index b5b8e7e..89fbdb5 100644 --- a/white-bg-800/tools/harness.mjs +++ b/white-bg-800/tools/harness.mjs @@ -15,7 +15,7 @@ import { fileURLToPath } from 'node:url' const HERE = path.dirname(fileURLToPath(import.meta.url)) // /white-bg-800/tools const REPO = path.resolve(HERE, '../..') // -const HOST_REPO = '/Users/qiqi/open/github/image-workbench-web' +const HOST_REPO = '/Users/qiqi/open/github/image-workbench-desktop' const PLUGIN_ENTRY = path.resolve(HERE, '../src/index.js') let chromium = null