From 051262a489fd72d499483d874e423670234c7383 Mon Sep 17 00:00:00 2001 From: ackness Date: Sat, 1 Aug 2026 22:50:38 +0800 Subject: [PATCH] fix(desktop): exclude top-level _ dirs from sidecar staging plugins/_archive (retired plugins) rode the wholesale plugins/ copy into the packaged app, and CI's unpacked-resource verifier treated it as a bundled plugin and failed the v0.0.24 release on its missing package.json. Staging now skips _-prefixed dirs at the resource root (worlds/_archive stops shipping as dead weight too), and the verifier tolerates one slipping through an older build. Third member of the _archive family after the release-preflight and workspace-glob cases. --- apps/desktop/scripts/build.mjs | 9 ++++++++- apps/desktop/scripts/verify-release.mjs | 4 +++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/apps/desktop/scripts/build.mjs b/apps/desktop/scripts/build.mjs index 19208563e..cba01edfd 100644 --- a/apps/desktop/scripts/build.mjs +++ b/apps/desktop/scripts/build.mjs @@ -331,7 +331,14 @@ for (const entry of sideCarResources) { } fs.cpSync(src, dest, { recursive: true, - filter: (source) => !EXCLUDE_DIRS.has(path.basename(source)), + filter: (source) => { + const base = path.basename(source); + if (EXCLUDE_DIRS.has(base)) return false; + // Top-level `_` dirs are non-content conventions (plugins/_archive, + // worlds/_archive): never loaded at runtime, dead weight in the app. + if (base.startsWith("_") && path.dirname(source) === src) return false; + return true; + }, }); } console.log(" ✓ plugins/prompts/worlds copied (node_modules/dist excluded)"); diff --git a/apps/desktop/scripts/verify-release.mjs b/apps/desktop/scripts/verify-release.mjs index e767b48f2..5cadd3f91 100644 --- a/apps/desktop/scripts/verify-release.mjs +++ b/apps/desktop/scripts/verify-release.mjs @@ -68,7 +68,9 @@ function mustHaveBundledPlugins(resourcesDir) { } const pluginDirs = fs .readdirSync(pluginsDir, { withFileTypes: true }) - .filter((e) => e.isDirectory()); + // `_`-prefixed dirs (plugins/_archive) are excluded from staging; tolerate + // one slipping through an older build rather than failing the release. + .filter((e) => e.isDirectory() && !e.name.startsWith("_")); if (pluginDirs.length === 0) { throw new Error(`No bundled plugins present under ${pluginsDir} `); }