The published package currently ships no TypeScript types and has no exports field, leaving the API surface undefined. This issue tracks three small, low-risk changes to package.json:
-
Add prepublishOnly script — runs tsc -b . before every npm publish to ensure .d.ts files are always generated and up-to-date.
-
Add files array — add relevant modules and build/*.d.ts so the public modules and the generated type declarations are included in the package. Dev artefacts (scripts, tests, csaf_2_1, etc.) are explicitly excluded.
-
Add exports map — declare the public sub-path entry points (e.g. "./validate.js", "./basic.js") each with a types condition pointing to build/*.d.ts and an import condition pointing to the source .js. This formalises the API surface and prevents consumers from reaching into lib or schemas directly.
The published package currently ships no TypeScript types and has no
exportsfield, leaving the API surface undefined. This issue tracks three small, low-risk changes to package.json:Add
prepublishOnlyscript — runstsc -b .before everynpm publishto ensure.d.tsfiles are always generated and up-to-date.Add
filesarray — add relevant modules andbuild/*.d.tsso the public modules and the generated type declarations are included in the package. Dev artefacts (scripts, tests, csaf_2_1, etc.) are explicitly excluded.Add
exportsmap — declare the public sub-path entry points (e.g."./validate.js","./basic.js") each with atypescondition pointing tobuild/*.d.tsand animportcondition pointing to the source.js. This formalises the API surface and prevents consumers from reaching into lib or schemas directly.