diff --git a/scripts/check-plugin-sdk-wildcard-reexports.mjs b/scripts/check-plugin-sdk-wildcard-reexports.mjs index e37dcb9c689..4ee967317ce 100644 --- a/scripts/check-plugin-sdk-wildcard-reexports.mjs +++ b/scripts/check-plugin-sdk-wildcard-reexports.mjs @@ -9,7 +9,7 @@ const repoRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), ".." const extensionsRoot = path.join(repoRoot, "extensions"); const WILDCARD_PLUGIN_SDK_REEXPORT_PATTERN = - /^\s*export\s+(?:type\s+)?\*\s+from\s+["']openclaw\/plugin-sdk\//u; + /^\s*export\s+(?:type\s+)?\*\s+(?:as\s+[$\w]+\s+)?from\s+["']openclaw\/plugin-sdk\//u; async function listExtensionApiFiles(rootDir = extensionsRoot) { const entries = await fs.readdir(rootDir, { withFileTypes: true }); diff --git a/test/scripts/check-plugin-sdk-wildcard-reexports.test.ts b/test/scripts/check-plugin-sdk-wildcard-reexports.test.ts index e0f9eacba06..2f18adcc65f 100644 --- a/test/scripts/check-plugin-sdk-wildcard-reexports.test.ts +++ b/test/scripts/check-plugin-sdk-wildcard-reexports.test.ts @@ -8,13 +8,17 @@ describe("check-plugin-sdk-wildcard-reexports", () => { findPluginSdkWildcardReexports( [ 'export * from "openclaw/plugin-sdk/foo";', + 'export * as sdk from "openclaw/plugin-sdk/foo";', 'export type * from "openclaw/plugin-sdk/bar";', + 'export type * as sdkTypes from "openclaw/plugin-sdk/bar";', 'export { named } from "openclaw/plugin-sdk/foo";', ].join("\n"), ), ).toEqual([ { line: 1, text: 'export * from "openclaw/plugin-sdk/foo";' }, - { line: 2, text: 'export type * from "openclaw/plugin-sdk/bar";' }, + { line: 2, text: 'export * as sdk from "openclaw/plugin-sdk/foo";' }, + { line: 3, text: 'export type * from "openclaw/plugin-sdk/bar";' }, + { line: 4, text: 'export type * as sdkTypes from "openclaw/plugin-sdk/bar";' }, ]); }); @@ -25,6 +29,7 @@ describe("check-plugin-sdk-wildcard-reexports", () => { 'export { named } from "openclaw/plugin-sdk/foo";', 'export type { Named } from "openclaw/plugin-sdk/foo";', 'export * from "./src/runtime-api.js";', + 'export * as runtime from "./src/runtime-api.js";', ].join("\n"), ), ).toStrictEqual([]);