




















@@ -11,7 +11,6 @@ import {
1111closeSync,
1212existsSync,
1313lstatSync,
14-mkdirSync,
1514openSync,
1615readdirSync,
1716readFileSync,
@@ -35,18 +34,6 @@ const DISABLE_POSTINSTALL_ENV = "OPENCLAW_DISABLE_BUNDLED_PLUGIN_POSTINSTALL";
3534const DISABLE_PLUGIN_REGISTRY_MIGRATION_ENV = "OPENCLAW_DISABLE_PLUGIN_REGISTRY_MIGRATION";
3635const EAGER_BUNDLED_PLUGIN_DEPS_ENV = "OPENCLAW_EAGER_BUNDLED_PLUGIN_DEPS";
3736const DIST_INVENTORY_PATH = "dist/postinstall-inventory.json";
38-const LEGACY_QA_CHANNEL_DIR = ["qa", "channel"].join("-");
39-const LEGACY_QA_LAB_DIR = ["qa", "lab"].join("-");
40-const LEGACY_UPDATE_COMPAT_SIDECARS = [
41-{
42-path: `dist/extensions/${LEGACY_QA_CHANNEL_DIR}/runtime-api.js`,
43-content: "export {};\n",
44-},
45-{
46-path: `dist/extensions/${LEGACY_QA_LAB_DIR}/runtime-api.js`,
47-content: "export {};\n",
48-},
49-];
5037const BAILEYS_MEDIA_FILE = join(
5138"node_modules",
5239"@whiskeysockets",
@@ -329,29 +316,6 @@ export function pruneInstalledPackageDist(params = {}) {
329316return removed;
330317}
331318332-export function restoreLegacyUpdaterCompatSidecars(params = {}) {
333-const packageRoot = params.packageRoot ?? DEFAULT_PACKAGE_ROOT;
334-const writeFile = params.writeFileSync ?? writeFileSync;
335-const makeDirectory = params.mkdirSync ?? mkdirSync;
336-const log = params.log ?? console;
337-const restored = [];
338-339-for (const sidecar of LEGACY_UPDATE_COMPAT_SIDECARS) {
340-// Older npm updater builds verify these exact sidecars after npm has
341-// already replaced the package, so generate them independently of prune
342-// results.
343-const sidecarPath = join(packageRoot, sidecar.path);
344-makeDirectory(dirname(sidecarPath), { recursive: true });
345-writeFile(sidecarPath, sidecar.content, "utf8");
346-restored.push(sidecar.path);
347-}
348-349-if (restored.length > 0) {
350-log.log(`[postinstall] restored legacy updater compat sidecars: ${restored.join(", ")}`);
351-}
352-return restored;
353-}
354-355319function dependencySentinelPath(depName) {
356320return join("node_modules", ...depName.split("/"), "package.json");
357321}
@@ -781,21 +745,14 @@ export function runBundledPluginPostinstall(params = {}) {
781745});
782746return;
783747}
784-const prunedDistFiles = pruneInstalledPackageDist({
748+pruneInstalledPackageDist({
785749 packageRoot,
786750existsSync: pathExists,
787751readFileSync: params.readFileSync,
788752readdirSync: params.readdirSync,
789753rmSync: params.rmSync,
790754 log,
791755});
792-restoreLegacyUpdaterCompatSidecars({
793- packageRoot,
794-removedFiles: prunedDistFiles,
795-mkdirSync: params.mkdirSync,
796-writeFileSync: params.writeFileSync,
797- log,
798-});
799756if (
800757!shouldRunBundledPluginPostinstall({
801758 env,
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。