Skip to content

Feature/package exports#66

Merged
estherbrunner merged 4 commits into
nextfrom
feature/package-exports
Jul 10, 2026
Merged

Feature/package exports#66
estherbrunner merged 4 commits into
nextfrom
feature/package-exports

Conversation

@estherbrunner

Copy link
Copy Markdown
Member

No description provided.

…er-dep metadata

Rewrite distribution metadata so the package resolves correctly and
tree-shakes in all supported toolchains:

- Add explicit `exports` map (`.`: types -> bun -> default, plus
  `./package.json`); the `bun` condition lets Bun consumers resolve TS
  source directly, `default` serves the bundled index.js
- Remove `"module": "index.ts"` — it pointed at raw TypeScript, breaking
  webpack and older Rollup configs
- Publish the unminified ESM bundle as index.js (~50 KB readable) instead
  of the minified artifact; consumers' bundlers minify anyway
- Make TypeScript an optional peer dependency
  (`peerDependenciesMeta`) so JS-only consumers don't get an
  unresolvable-peer warning
- Replace fragile `.npmignore` negation patterns with a `files` allowlist
- Remove unused index.dev.js artifact

Note: `sideEffects: false` from the original plan was dropped because it
breaks `bun build` — Bun tree-shakes the barrel re-exports away during
the package's own build, producing a broken 827-byte output. Tree-shaking
for consumers is preserved because the published index.js is a single
inlined ESM file (verified: bundleCoreGzipped stays at 2476B).

This is a minor (not patch) version bump: the exports map intentionally
blocks deep imports into package internals.
@estherbrunner estherbrunner merged commit e12e350 into next Jul 10, 2026
2 checks passed
@estherbrunner estherbrunner deleted the feature/package-exports branch July 10, 2026 17:42
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.

1 participant