Skip to content

fix(packaging): types-first exports condition, package.json export, trim tarball - #18

Open
kuraydev wants to merge 1 commit into
masterfrom
fix/packaging-hygiene
Open

fix(packaging): types-first exports condition, package.json export, trim tarball#18
kuraydev wants to merge 1 commit into
masterfrom
fix/packaging-hygiene

Conversation

@kuraydev

@kuraydev kuraydev commented Aug 15, 2026

Copy link
Copy Markdown
Owner

Packaging hygiene

Same pattern as react-native-bouncy-checkbox #822. No source changes — package.json only.

This repo was already in the best shape of the batch (peer deps declared, files whitelist present, no bogus dependencies), but the exports map had a real defect.

What was wrong

  • In the exports map the types condition was listed last, after import/require. Export conditions are order-sensitive, so TypeScript under node16/bundler module resolution matched import/require first and never reached the declaration files.
  • No ./package.json subpath export for tooling that reads package metadata.
  • Published tarball ships src/__tests__/.

Fixes

  • Reordered exports so types comes first; added a default fallback and "./package.json": "./package.json" (layout verified against the npm pack of 2.2.0).
  • Excluded src/__tests__ from the tarball; explicitly whitelisted README/LICENSE.
  • Version bumped to 2.2.1.

Publish after npm account migration.

…json, trim tarball

- Reorder the "exports" map so the "types" condition comes first:
  export conditions are order-sensitive, so with types listed after
  import/require, TypeScript under node16/bundler module resolution
  never reached the declaration files.
- Add an explicit "default" fallback condition and a
  "./package.json" subpath export for tools that read package
  metadata.
- Exclude src/__tests__ from the published tarball and explicitly
  whitelist README/LICENSE.
- Bump version to 2.2.1.
@kuraydev
kuraydev force-pushed the fix/packaging-hygiene branch from 3ff70ab to 25c96fa Compare August 16, 2026 18:38
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