Skip to content

fix(packaging): peerDependencies, types/exports map, files whitelist - #8

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

fix(packaging): peerDependencies, types/exports map, files whitelist#8
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 pass (same pattern as react-native-bouncy-checkbox #822). No source changes.

What was wrong

  • No peerDependencies — react/react-native were implicit.
  • No types field and no exports map, so TypeScript moduleResolution: "bundler"/"node16" and modern bundlers could not resolve the package cleanly.
  • No files whitelist: the published tarball ships .idea/, .husky/, .github/, dotfiles, tsconfig.json, package-lock-era junk, and raw lib/ sources.

Fixes

  • Added "peerDependencies": { "react": ">=17.0.0", "react-native": ">=0.64.0" }.
  • Added "types": "./build/dist/index.d.ts" and an exports map matching the published tarball layout (verified via npm pack react-native-tooltip-2@latest): . → types ./build/dist/index.d.ts, default ./build/dist/index.js, plus ./package.json.
  • Added "files": ["build/dist", "README.md", "LICENSE"].
  • Bumped version 0.1.3 → 0.1.4.

Note: react-fast-compare stays in dependencies — it is genuinely imported in lib/Tooltip.tsx.

Publish after npm account migration.

…hitelist

- Declare react (>=17.0.0) and react-native (>=0.64.0) as peerDependencies
  so package managers stop treating them as implicit/missing deps.
- Add an explicit "types" field pointing at build/dist/index.d.ts, matching
  the published tarball layout.
- Add an "exports" map with a "types" condition and a "./package.json"
  subpath so modern bundlers and TypeScript moduleResolution "bundler"/
  "node16" resolve the package correctly.
- Add a "files" whitelist (build/dist, README, LICENSE) so the published
  tarball no longer ships .idea/, .husky/, .github/, dotfiles, and raw
  lib/ sources.
- Bump version to 0.1.4.

No source changes. react-fast-compare stays in dependencies: it is
imported by lib/Tooltip.tsx.
@kuraydev
kuraydev force-pushed the fix/packaging-hygiene branch from b31fa2b to 6409c0c 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