fix: tighten plugin-sdk guard scripts

This commit is contained in:
Gustavo Madeira Santana
2026-03-03 20:46:25 -05:00
parent f729e0853b
commit c30387a65b
2 changed files with 5 additions and 3 deletions

View File

@@ -2,7 +2,7 @@ import fs from "node:fs";
import path from "node:path";
import { discoverOpenClawPlugins } from "../src/plugins/discovery.js";
const ROOT_IMPORT_PATTERN = /\b(?:import|export)\b[\s\S]*?\bfrom\s+["']openclaw\/plugin-sdk["']/g;
const ROOT_IMPORT_PATTERN = /\b(?:import|export)\b[\s\S]*?\bfrom\s+["']openclaw\/plugin-sdk["']/;
function main() {
const discovery = discoverOpenClawPlugins({});

View File

@@ -102,9 +102,11 @@ for (const entry of requiredSubpathEntries) {
}
if (missing > 0) {
console.error(`\nERROR: ${missing} required export(s) missing from dist/plugin-sdk/index.js.`);
console.error(
`\nERROR: ${missing} required plugin-sdk artifact(s) missing (named exports or subpath files).`,
);
console.error("This will break channel extension plugins at runtime.");
console.error("Check src/plugin-sdk/index.ts and rebuild.");
console.error("Check src/plugin-sdk/index.ts, subpath entries, and rebuild.");
process.exit(1);
}