Parent: #508 (discovered while fixing #584)
Summary
Of the 5 npm packages published at 0.17.1, only hydra-kernel has a working bare-specifier entry
(main + exports["."] → hydra/core.js). The other four — hydra-build, hydra-rdf, hydra-pg,
hydra-typescript — have main: null and no exports["."] in their generated package.json, so a
consumer's import ... from 'hydra-rdf' does not resolve. Only subpath imports work (e.g.
import 'hydra-rdf/hydra/rdf/syntax.js').
History
An earlier form of this (fixed under #584) was worse: main_module() in
bin/lib/generate-typescript-package-build.py guessed an entry path (hydra/rdf, etc.) that pointed at
a nonexistent file, crashing imports. That broken guess was removed — but the fix left these four
packages with no . entry at all rather than a correct one.
Root cause
These four are multi-module namespace packages (hydra/rdf/{syntax,serde,utils}.ts,
hydra/pg/{coder,model,...}.ts, etc.) with no single umbrella module, so there is no obvious file for
main. PKG_MAIN_MODULE in the generator only hand-maps hydra-kernel → hydra/core.
Fix direction
Either (1) generate an umbrella index.ts per package that re-exports its namespace and point
main/exports["."] at it, or (2) explicitly design these as subpath-only packages with a clean
exports map.
Impact
Affects consumers of the 0.17.1 npm packages (bare imports of 4 of 5 fail). Not CI-gated (npm
consumption is not tested). Candidate for a 0.17.1.x patch or 0.18.
Verification
Confirmed live against current main + the published 0.17.1 packages: hydra-kernel package.json has
main/exports["."]; the other four have main: null and no . export.
Parent: #508 (discovered while fixing #584)
Summary
Of the 5 npm packages published at 0.17.1, only
hydra-kernelhas a working bare-specifier entry(
main+exports["."]→hydra/core.js). The other four —hydra-build,hydra-rdf,hydra-pg,hydra-typescript— havemain: nulland noexports["."]in their generatedpackage.json, so aconsumer's
import ... from 'hydra-rdf'does not resolve. Only subpath imports work (e.g.import 'hydra-rdf/hydra/rdf/syntax.js').History
An earlier form of this (fixed under #584) was worse:
main_module()inbin/lib/generate-typescript-package-build.pyguessed an entry path (hydra/rdf, etc.) that pointed ata nonexistent file, crashing imports. That broken guess was removed — but the fix left these four
packages with no
.entry at all rather than a correct one.Root cause
These four are multi-module namespace packages (
hydra/rdf/{syntax,serde,utils}.ts,hydra/pg/{coder,model,...}.ts, etc.) with no single umbrella module, so there is no obvious file formain.PKG_MAIN_MODULEin the generator only hand-mapshydra-kernel→hydra/core.Fix direction
Either (1) generate an umbrella
index.tsper package that re-exports its namespace and pointmain/exports["."]at it, or (2) explicitly design these as subpath-only packages with a cleanexportsmap.Impact
Affects consumers of the 0.17.1 npm packages (bare imports of 4 of 5 fail). Not CI-gated (npm
consumption is not tested). Candidate for a 0.17.1.x patch or 0.18.
Verification
Confirmed live against current
main+ the published 0.17.1 packages:hydra-kernelpackage.json hasmain/exports["."]; the other four havemain: nulland no.export.