Skip to content

Four TypeScript npm packages have no bare-specifier export — import 'hydra-rdf' doesn't resolve #600

Description

@joshsh

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-kernelhydra/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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions