From 692e28e9f7e757132bbea5d295c28436e8cd57d9 Mon Sep 17 00:00:00 2001 From: Jakub Kasprzyk Date: Mon, 19 Oct 2026 20:45:50 +0200 Subject: [PATCH] fix(package): stop running tsc in consumer projects on install The published package.json had `"postinstall": "tsc || exit 0;"`. The package does not ship its tsconfig.json, so in a consumer's node_modules tsc resolved the app's own tsconfig.json: it type-checked the whole app on every install and, with an emitting config, wrote .js files next to the app's sources. npm 11 also flags the package under allowScripts. Remove the script from the published manifest. Contributors still need lib/ after a fresh clone (example/app.plugin.js requires lib/plugin/index.js), so build it from the private monorepo root's postinstall instead. A `prepare` script was not enough: npm still lists it as an install script for tarball installs. Also drop the root `trustedDependencies` entry: it named `react-native-pay`, which matches no package, so it had no effect. Closes #9 --- CHANGELOG.md | 9 +++++++++ package.json | 4 +--- package/package.json | 1 - 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d42f1dd..88066c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,15 @@ All notable changes to this project are documented in this file. ## Unreleased +### Fixed + +- **Installing the package no longer runs `tsc` in your project.** 0.0.17 and earlier shipped a + `postinstall` script (`tsc || exit 0`). The package does not include its own `tsconfig.json`, so + `tsc` picked up the app's `tsconfig.json` and type-checked the whole app on every install; with a + config that emits, it also wrote `.js` files next to the app's sources. The published package now + has no install scripts. The contributor build of `lib/` moved to the private monorepo root, so + `bun install` in this repository still builds it. + ## 0.0.17 — 2026-09-16 ### Fixed diff --git a/package.json b/package.json index 50c8e55..6fbe467 100644 --- a/package.json +++ b/package.json @@ -6,11 +6,9 @@ "example", "docs" ], - "trustedDependencies": [ - "react-native-pay" - ], "version": "1.0.0", "scripts": { + "postinstall": "cd package && tsc || exit 0", "android": "expo run:android", "ios": "expo run:ios", "docs:start": "cd docs && bun run start", diff --git a/package/package.json b/package/package.json index 46380ed..05e326d 100644 --- a/package/package.json +++ b/package/package.json @@ -119,7 +119,6 @@ "scripts": { "prepack": "rm -rf lib tsconfig.tsbuildinfo && tsc && cp ../README.md ./README.md", "postpack": "rm ./README.md", - "postinstall": "tsc || exit 0;", "typecheck": "tsc --noEmit", "test": "jest", "test:watch": "jest --watch",