Repository navigation
Commit 1484571
fix: make
Two problems that a maintainer hits on a clean checkout.
1. `npm test` needed a build before it, and it did not say so.
`tests/bundle.test.ts` imports the package root (`import esmLibrary from
'..'`), which package.json resolves to `release/`. On a checkout where
`release/` is absent, that one suite fails:
Error: Cannot find module '..' imported from tests/bundle.test.ts
The test workflow hid the problem, because it runs `npm run build` before
`npm test`. A maintainer who runs `npm ci && npm test` sees the failure.
A `pretest` script now builds first, so `npm test` is correct in any order.
`npm ci && npm test` passes on a clean clone.
2. npm 11 blocked esbuild's postinstall, and every install printed a warning:
npm warn install-scripts 1 package has install scripts not yet covered
npm warn install-scripts esbuild@0.19.7 (postinstall: node install.js)
esbuild still worked here, because @esbuild/win32-x64 and its siblings carry
the binary, and the postinstall is a fallback. The warning is still noise on
every install, and the fallback matters on a platform whose binary package
npm does not select. `allowScripts` now approves that one package, pinned to
the version that `overrides.tsup.esbuild` holds, so a change of the pin asks
for the approval again.
Verified in linux containers on node 20, 22 and 24, and on windows: `npm ci`
then `npm test` gives 11 test files and 54 tests passed, no install warning,
and release/cjs/lossless.cjs and release/cjs/lossless.cjs.map stay
byte-identical to the files that cornerstonejs/codecs vendors.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>npm test build first, and approve esbuild's install script1 parent ab62b35 commit 1484571
1 file changed
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
| |||
63 | 64 | | |
64 | 65 | | |
65 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
66 | 70 | | |
67 | 71 | | |
0 commit comments