mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 20:00:42 +00:00
ci: guard plugin sdk wildcard reexports
This commit is contained in:
@@ -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"],
|
||||
},
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
31
test/scripts/check-plugin-sdk-wildcard-reexports.test.ts
Normal file
31
test/scripts/check-plugin-sdk-wildcard-reexports.test.ts
Normal 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([]);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user