ci: guard plugin sdk wildcard reexports

This commit is contained in:
Peter Steinberger
2026-04-27 14:52:12 +01:00
parent 877b5a14f1
commit 1ed6d04014
6 changed files with 132 additions and 0 deletions

View File

@@ -259,6 +259,7 @@ describe("scripts/changed-lanes", () => {
expect(plan.commands.map((command) => command.name)).toEqual([
"conflict markers",
"changelog attributions",
"plugin-sdk wildcard re-exports",
"typecheck core tests",
"lint core",
"lint scripts",
@@ -546,6 +547,7 @@ describe("scripts/changed-lanes", () => {
expect(plan.commands.map((command) => command.args[0])).toEqual([
"check:no-conflict-markers",
"check:changelog-attributions",
"lint:extensions:no-plugin-sdk-wildcard-reexports",
"release-metadata:check",
"ios:version:check",
"config:schema:check",
@@ -677,6 +679,10 @@ describe("scripts/changed-lanes", () => {
expect(plan.commands).toEqual([
{ name: "conflict markers", args: ["check:no-conflict-markers"] },
{ name: "changelog attributions", args: ["check:changelog-attributions"] },
{
name: "plugin-sdk wildcard re-exports",
args: ["lint:extensions:no-plugin-sdk-wildcard-reexports"],
},
]);
});
@@ -688,6 +694,10 @@ describe("scripts/changed-lanes", () => {
expect(plan.commands).toEqual([
{ name: "conflict markers", args: ["check:no-conflict-markers"] },
{ name: "changelog attributions", args: ["check:changelog-attributions"] },
{
name: "plugin-sdk wildcard re-exports",
args: ["lint:extensions:no-plugin-sdk-wildcard-reexports"],
},
]);
});
});

View File

@@ -0,0 +1,31 @@
import { describe, expect, it } from "vitest";
import { findPluginSdkWildcardReexports } from "../../scripts/check-plugin-sdk-wildcard-reexports.mjs";
describe("check-plugin-sdk-wildcard-reexports", () => {
it("flags wildcard re-exports from plugin-sdk subpaths", () => {
expect(
findPluginSdkWildcardReexports(
[
'export * from "openclaw/plugin-sdk/foo";',
'export type * 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";' },
]);
});
it("allows explicit SDK exports and local wildcard barrels", () => {
expect(
findPluginSdkWildcardReexports(
[
'export { named } from "openclaw/plugin-sdk/foo";',
'export type { Named } from "openclaw/plugin-sdk/foo";',
'export * from "./src/runtime-api.js";',
].join("\n"),
),
).toEqual([]);
});
});