Skip to content

feat: ship TypeScript types for every package - #122

Merged
bnb merged 5 commits into
mainfrom
bnb/types
Oct 29, 2026
Merged

bnb merged 5 commits into
mainfrom
bnb/types

Conversation

@botandbang

Copy link
Copy Markdown
Contributor

Adds JSDoc types to every package's public API and publishes .d.ts files generated from them. Core defines the shared data types (Data, ReleaseLine, Release, Support, Security, Options and more), and the other packages import them. static lists @nodevu/core as an optional peer dependency for those types, and core depends on @types/luxon because now accepts a Luxon DateTime.

Each package has a tsconfig.json extending tsconfig.base.json, which type-checks the JavaScript in strict mode. npm run types (tsc -b) builds them in dependency order into <package>/types/, and each package gets a types field and ships that folder. The declarations are committed because releases pack without installing dependencies, and a new types CI job rebuilds them and fails when they're stale. test/types.mts checks the published types the way a TypeScript project would use them, including inputs they must reject.

Source changes are annotations plus a few rewrites with the same results: core iterates the index with versions.keys(), converts values to strings explicitly where it relied on implicit conversion, and ranges reads support.lts with ?.. Generated types are excluded from coverage and linting.

@socket-security

socket-security Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​@​types/​semver@​7.8.01001007481100
Addednpm/​@​types/​luxon@​3.7.61001007787100
Addednpm/​@​types/​node@​22.20.51001008196100
Addednpm/​typescript@​7.0.29910089100100

View full report

Base automatically changed from bnb/core-parsefiles to main October 29, 2026 13:41
@bnb
bnb merged commit 29029a2 into main Oct 29, 2026
40 checks passed
@bnb
bnb deleted the bnb/types branch October 29, 2026 13:50
@nodevu-ci nodevu-ci Bot mentioned this pull request Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants