mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 10:50:44 +00:00
ci: guard extension 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",
|
||||
"guarded extension wildcard re-exports",
|
||||
"plugin-sdk wildcard re-exports",
|
||||
"typecheck core tests",
|
||||
"lint core",
|
||||
@@ -547,6 +548,7 @@ describe("scripts/changed-lanes", () => {
|
||||
expect(plan.commands.map((command) => command.args[0])).toEqual([
|
||||
"check:no-conflict-markers",
|
||||
"check:changelog-attributions",
|
||||
"lint:extensions:no-guarded-wildcard-reexports",
|
||||
"lint:extensions:no-plugin-sdk-wildcard-reexports",
|
||||
"release-metadata:check",
|
||||
"ios:version:check",
|
||||
@@ -679,6 +681,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: "guarded extension wildcard re-exports",
|
||||
args: ["lint:extensions:no-guarded-wildcard-reexports"],
|
||||
},
|
||||
{
|
||||
name: "plugin-sdk wildcard re-exports",
|
||||
args: ["lint:extensions:no-plugin-sdk-wildcard-reexports"],
|
||||
@@ -694,6 +700,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: "guarded extension wildcard re-exports",
|
||||
args: ["lint:extensions:no-guarded-wildcard-reexports"],
|
||||
},
|
||||
{
|
||||
name: "plugin-sdk wildcard re-exports",
|
||||
args: ["lint:extensions:no-plugin-sdk-wildcard-reexports"],
|
||||
|
||||
31
test/scripts/check-extension-wildcard-reexports.test.ts
Normal file
31
test/scripts/check-extension-wildcard-reexports.test.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { findLocalWildcardReexports } from "../../scripts/check-extension-wildcard-reexports.mjs";
|
||||
|
||||
describe("check-extension-wildcard-reexports", () => {
|
||||
it("flags local wildcard re-exports", () => {
|
||||
expect(
|
||||
findLocalWildcardReexports(
|
||||
[
|
||||
'export * from "./src/runtime-api.js";',
|
||||
'export type * from "../api.js";',
|
||||
'export { named } from "./src/runtime-api.js";',
|
||||
].join("\n"),
|
||||
),
|
||||
).toEqual([
|
||||
{ line: 1, text: 'export * from "./src/runtime-api.js";' },
|
||||
{ line: 2, text: 'export type * from "../api.js";' },
|
||||
]);
|
||||
});
|
||||
|
||||
it("allows explicit local exports and external wildcard barrels", () => {
|
||||
expect(
|
||||
findLocalWildcardReexports(
|
||||
[
|
||||
'export { named } from "./src/runtime-api.js";',
|
||||
'export type { Named } from "../api.js";',
|
||||
'export * from "external-package";',
|
||||
].join("\n"),
|
||||
),
|
||||
).toEqual([]);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user