From 6409c0c5a34c8527d4e21d6e903cd64eac064dca Mon Sep 17 00:00:00 2001 From: Kuray Date: Sat, 15 Aug 2026 19:41:28 +0300 Subject: [PATCH] fix(packaging): add peerDependencies, types, exports map, and files whitelist - 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. --- package.json | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index f9f6435..d189d2c 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,21 @@ { "name": "react-native-tooltip-2", - "version": "0.1.3", + "version": "0.1.4", "description": "Customizable, easy to use tooltip for React Native", "main": "./build/dist/index.js", + "types": "./build/dist/index.d.ts", + "exports": { + ".": { + "types": "./build/dist/index.d.ts", + "default": "./build/dist/index.js" + }, + "./package.json": "./package.json" + }, + "files": [ + "build/dist", + "README.md", + "LICENSE" + ], "repository": "git@github.com:WrathChaos/react-native-tooltip-2.git", "author": "FreakyCoder ", "license": "MIT", @@ -25,6 +38,10 @@ "dependencies": { "react-fast-compare": ">= 3.2.0" }, + "peerDependencies": { + "react": ">=17.0.0", + "react-native": ">=0.64.0" + }, "devDependencies": { "@commitlint/cli": "^15.0.0", "@commitlint/config-conventional": "^15.0.0",