Check: avoid duplicate boundary prep

Rely on the lint wrapper to prepare extension package-boundary artifacts during pnpm check instead of invoking the same prep script again at the end.

Add a script regression so the duplicate check path does not return.
This commit is contained in:
Gustavo Madeira Santana
2026-04-16 21:35:39 -04:00
parent 3a59eddd07
commit baf11b83d7
2 changed files with 13 additions and 1 deletions

View File

@@ -1,3 +1,4 @@
import { readFileSync } from "node:fs";
import { describe, expect, it } from "vitest";
import { shouldPrepareExtensionPackageBoundaryArtifacts } from "../../scripts/run-oxlint.mjs";
@@ -14,4 +15,15 @@ describe("run-oxlint", () => {
expect(shouldPrepareExtensionPackageBoundaryArtifacts(["--print-config"])).toBe(false);
expect(shouldPrepareExtensionPackageBoundaryArtifacts(["--rules"])).toBe(false);
});
it("does not run package-boundary artifact prep twice in pnpm check", () => {
const packageJson = JSON.parse(readFileSync("package.json", "utf8")) as {
scripts: Record<string, string>;
};
expect(packageJson.scripts.check).toContain("pnpm lint");
expect(packageJson.scripts.check).not.toContain(
"node scripts/prepare-extension-package-boundary-artifacts.mjs",
);
});
});