Skip to content

fix(packaging): react/react-native peerDependencies, types/exports map, files whitelist - #17

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

fix(packaging): react/react-native peerDependencies, types/exports map, files whitelist#17
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

  • peerDependencies listed only @freakycoder/react-native-bounceable; 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/, dotfiles, tsconfig.json, and raw lib/ sources.

Fixes

  • Added react (>=17.0.0) and react-native (>=0.64.0) to peerDependencies.
  • Kept @freakycoder/react-native-bounceable as a peer dependency: it IS actually imported (lib/components/RNPollItem.tsx), so it is not a bogus entry.
  • Added "types": "./build/dist/RNPoll.d.ts" and an exports map matching the published tarball layout (verified via npm pack react-native-poll@latest): . → types ./build/dist/RNPoll.d.ts, default ./build/dist/RNPoll.js, plus ./package.json.
  • Added "files": ["build/dist", "README.md"] (this repo has no LICENSE file; the license field says MIT — worth adding a LICENSE file separately).
  • Bumped version 1.0.0 → 1.0.1.

Publish after npm account migration.

🤖 Generated with Claude Code

…ts map, and files whitelist

- Add react (>=17.0.0) and react-native (>=0.64.0) to peerDependencies
  alongside the existing @freakycoder/react-native-bounceable peer, which
  stays because it is imported by lib/RNPoll.tsx.
- Add an explicit "types" field pointing at build/dist/RNPoll.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) so the published tarball
  no longer ships .idea/, .husky/, dotfiles, and raw lib/ sources.
- Bump version to 1.0.1.

No source changes.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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