Skip to content

Fix package entry points and rename lib to src - #103

Merged
borgar merged 2 commits into
masterfrom
fix-build
Oct 22, 2026
Merged

borgar merged 2 commits into
masterfrom
fix-build

Conversation

@borgar

@borgar borgar commented Oct 22, 2026

Copy link
Copy Markdown
Owner

The package.json entry points didn't match the files that tsdown builds. require('numfmt') failed, TypeScript users got no types, and import resolved to the CommonJS build. 😱

Changes

  • Add "type": "module". tsdown now writes index.js (ESM), index.cjs, index.d.ts, and index.d.cts, which match main, module, and types.
  • Split exports into import and require conditions, each with its own types.
  • Add dist to .gitignore.
  • Remove the leftover rollup.config.mjs and the nested lib/package.json and test/package.json files, which the root "type" now covers.
  • Rename lib to src, and update the paths in package.json, tsconfig.json, typedoc.json, and the test imports.

Fixes #102

We're now building from source, not exposing the js directly and this better reflects that.
@borgar
borgar merged commit 6d45a05 into master Oct 22, 2026
3 checks passed
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.

require('numfmt') fails in 4.x: package.json points at dist/index.cjs, which is not published

1 participant