Skip to content

Commit c6c3e21

Browse files
jaredwrayclaude
andauthored
chore: adding in build validation (#1651)
* chore: adding in build validation * fix(scripts): harden CJS export introspection in build validation Guard the CJS runtime check against modules that resolve to null, undefined, or a primitive (avoiding a TypeError on `Object.keys`/`in`), and correctly treat a bare function export (`module.exports = fn`) as a valid export rather than flagging "exposes no exports". Addresses review feedback on PR #1651. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 069f734 commit c6c3e21

4 files changed

Lines changed: 587 additions & 10 deletions

File tree

.github/workflows/tests.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,8 @@ jobs:
4141
- name: Build
4242
run: pnpm build
4343

44+
- name: Validate Build Output
45+
run: node scripts/test-build.mjs
46+
4447
- name: Test
4548
run: pnpm test:ci

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"test": "pnpm -r test",
88
"test:list": "pnpm -r --workspace-concurrency 1 test",
99
"test:ci": "pnpm -r test:ci",
10+
"test:build": "pnpm build && node scripts/test-build.mjs",
1011
"test:services:start": "docker compose up -d",
1112
"test:services:stop": "docker compose down",
1213
"website:build": "pnpm recursive --filter @cacheable/website run website:build",
@@ -19,13 +20,15 @@
1920
"keywords": [],
2021
"author": "Jared Wray <me@jaredwray.com>",
2122
"license": "MIT",
22-
"packageManager": "pnpm@11.3.0",
23+
"packageManager": "pnpm@11.5.1+sha512.93f7b57422ea7068257235b4c16eb60762eb68e1dc23723199cc739043ea9be2c4143274a399d8c6defa2b1176226d9ca1c4b63482d6200c1a8fbaa78c1d1485",
2324
"devDependencies": {
25+
"@arethetypeswrong/cli": "^0.18.3",
2426
"@biomejs/biome": "^2.4.14",
2527
"@faker-js/faker": "^10.4.0",
2628
"@types/node": "^24.12.2",
2729
"@vitest/coverage-v8": "^4.1.5",
2830
"@vitest/spy": "^4.1.5",
31+
"publint": "^0.3.21",
2932
"rimraf": "^6.1.3",
3033
"vitest": "^4.1.5",
3134
"wrangler": "^4.87.0"

0 commit comments

Comments
 (0)