The problem
package.json pins the runtime dependency as
"xlsx": "https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz"
A non-registry URL in dependencies makes installing this package impossible in
any environment that restricts remote tarball fetches. Two independent reports so
far:
Why the obvious workarounds do not help
Both consumer-side theories floated so far are wrong, and worth writing down so
nobody implements them:
- "Commit
dist/ (like @correlaid/cdl-design)." That removes the need to
run our prepare script, but xlsx is a runtime dependency — the consumer's
installer still has to fetch that tarball. A committed dist/ does not change
the failure.
- "Ship a release artifact." Same reasoning. Unless the artifact bundles
xlsx, the dependency still resolves from the CDN at install time.
So this is not a packaging problem; it is a dependency-source problem.
Options
- Move to the npm-registry
xlsx. SheetJS stopped publishing to npm after
0.18.5, so this means pinning xlsx@^0.18.5 — an older SheetJS. Cheapest fix,
restores plain npm install, and CorrelAid/formtransform-app and
CorrelAid/formulaid already depend on xlsx@^0.18.5 themselves, so they would
also stop carrying two copies. Risk: a behavioural difference between 0.18.5
and 0.20.3 in workbook parsing. The contract suite (npm run test:contract)
plus the blessed snapshots should catch that — if all 707 vitest tests and the
pyxform oracle pass on 0.18.5, the risk is close to zero for our read paths
(XLSX.read, XLSX.write).
- Vendor the SheetJS tarball into the repo and depend on a
file: path.
Keeps 0.20.3, works offline, but adds ~1 MB of binary to git and a manual
update path.
- Make it a peer dependency and let each consumer bring its own
xlsx. Honest
about the fact that consumers already have one, but it pushes the CDN problem
onto them and breaks the CLI's standalone install.
- Do nothing, document it. Consumers pass
--allow-remote=all (npm) or the
bun equivalent. Cheapest today, but every new consumer rediscovers it, and it
will keep breaking locked-down CI.
Recommendation
Option 1, gated on the test suite. Concretely: switch the pin to xlsx@^0.18.5,
run npm test (707 tests), npm run test:py and npm run bless with no diff
expected in the blessed snapshots. If any snapshot moves, stop and reconsider —
that difference is exactly what we would be shipping to consumers.
Whoever picks this up: report the test results before changing the pin
permanently, and update the install instructions in README.md either way.
The problem
package.jsonpins the runtime dependency asA non-registry URL in
dependenciesmakes installing this package impossible inany environment that restricts remote tarball fetches. Two independent reports so
far:
CorrelAid/formulaid(its issue [survey2ddi 2/6] Port normalize_responses: the LimeSurvey response-data path #11, wiring upXLSValidator) could notnpm installthe package at all; it needed--allow-remote=all, and workedaround it by building locally and installing a tarball.
fixing tsc build does not emit dist/generated/conventions.json —
preparescript leaves dist incomplete #1 —npm error code EALLOWREMOTE ... Refusing to fetch "xlsx@https://cdn.sheetjs.com/...".Why the obvious workarounds do not help
Both consumer-side theories floated so far are wrong, and worth writing down so
nobody implements them:
dist/(like@correlaid/cdl-design)." That removes the need torun our
preparescript, butxlsxis a runtime dependency — the consumer'sinstaller still has to fetch that tarball. A committed
dist/does not changethe failure.
xlsx, the dependency still resolves from the CDN at install time.So this is not a packaging problem; it is a dependency-source problem.
Options
xlsx. SheetJS stopped publishing to npm after0.18.5, so this means pinningxlsx@^0.18.5— an older SheetJS. Cheapest fix,restores plain
npm install, andCorrelAid/formtransform-appandCorrelAid/formulaidalready depend onxlsx@^0.18.5themselves, so they wouldalso stop carrying two copies. Risk: a behavioural difference between 0.18.5
and 0.20.3 in workbook parsing. The contract suite (
npm run test:contract)plus the blessed snapshots should catch that — if all 707 vitest tests and the
pyxform oracle pass on 0.18.5, the risk is close to zero for our read paths
(
XLSX.read,XLSX.write).file:path.Keeps 0.20.3, works offline, but adds ~1 MB of binary to git and a manual
update path.
xlsx. Honestabout the fact that consumers already have one, but it pushes the CDN problem
onto them and breaks the CLI's standalone install.
--allow-remote=all(npm) or thebun equivalent. Cheapest today, but every new consumer rediscovers it, and it
will keep breaking locked-down CI.
Recommendation
Option 1, gated on the test suite. Concretely: switch the pin to
xlsx@^0.18.5,run
npm test(707 tests),npm run test:pyandnpm run blesswith no diffexpected in the blessed snapshots. If any snapshot moves, stop and reconsider —
that difference is exactly what we would be shipping to consumers.
Whoever picks this up: report the test results before changing the pin
permanently, and update the install instructions in
README.mdeither way.