Skip to content

Commit 75332a2

Browse files
authored
fix(tooling): fail deadcode report on scan errors (#122847)
1 parent adf8e25 commit 75332a2

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1551,7 +1551,7 @@
15511551
"deadcode:exports": "node --import tsx scripts/check-deadcode-exports.mts",
15521552
"deadcode:full": "pnpm --config.minimum-release-age=0 dlx --package [email protected] knip --config config/knip.config.ts --production --no-progress --reporter compact --no-config-hints --exclude duplicates && pnpm --config.minimum-release-age=0 dlx --package [email protected] knip --config config/knip.all-exports.config.ts --no-progress --reporter compact --no-config-hints --exports --exclude duplicates",
15531553
"deadcode:knip": "pnpm --config.minimum-release-age=0 dlx --package [email protected] knip --config config/knip.config.ts --production --no-progress --reporter compact --files --dependencies",
1554-
"deadcode:report": "pnpm deadcode:full; pnpm deadcode:exports",
1554+
"deadcode:report": "pnpm deadcode:full && pnpm deadcode:exports",
15551555
"deadcode:unused-files": "node --import tsx scripts/check-deadcode-unused-files.mts",
15561556
"deps:root-ownership": "node --import tsx scripts/root-dependency-ownership-audit.mts",
15571557
"deps:root-ownership:check": "node --import tsx scripts/root-dependency-ownership-audit.mts --check",

‎test/package-scripts.test.ts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,12 @@ describe("package scripts", () => {
152152
);
153153
});
154154

155+
it("runs dead-code reports fail-fast", () => {
156+
expect(readPackageJson().scripts["deadcode:report"]).toBe(
157+
"pnpm deadcode:full && pnpm deadcode:exports",
158+
);
159+
});
160+
155161
it("runs runtime postbuild before plugin SDK strict export checks", () => {
156162
expect(readPackageJson().scripts["build:plugin-sdk:strict-smoke"]).toBe(
157163
"node --import tsx scripts/tsdown-build.mts && node scripts/runtime-postbuild.mjs && node --import tsx scripts/run-with-env.mts OPENCLAW_PLUGIN_SDK_CANONICAL_DTS=1 -- node --import tsx scripts/write-plugin-sdk-entry-dts.ts && node --import tsx scripts/check-plugin-sdk-exports.mts",

0 commit comments

Comments
 (0)