From 25c96fadac7f7c2297a126afdc9eb47ab41e5d8f Mon Sep 17 00:00:00 2001 From: Kuray Date: Sat, 15 Aug 2026 19:42:47 +0300 Subject: [PATCH] fix(packaging): put types condition first in exports, expose package.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. --- package.json | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index e9af0ea..1557261 100644 --- a/package.json +++ b/package.json @@ -1,21 +1,26 @@ { "name": "react-native-segmented-control-2", - "version": "2.2.0", + "version": "2.2.1", "description": "\ud83d\ude80 React Native Segmented Control, Pure Javascript for iOS and Android", "main": "lib/commonjs/index.js", "module": "lib/module/index.js", "types": "lib/typescript/src/index.d.ts", "exports": { ".": { + "types": "./lib/typescript/src/index.d.ts", "import": "./lib/module/index.js", "require": "./lib/commonjs/index.js", - "types": "./lib/typescript/src/index.d.ts" - } + "default": "./lib/commonjs/index.js" + }, + "./package.json": "./package.json" }, "source": "src/index.ts", "files": [ "src", - "lib" + "lib", + "!src/__tests__", + "README.md", + "LICENSE" ], "repository": { "type": "git",