Repository navigation
fix: stop publishing build output and local machine paths to npm - #85
Merged
Merged
Conversation
The "files" allowlist included "android/" wholesale. npm's allowlist takes precedence over .gitignore for explicitly included directories, so every local build artifact was published even though .gitignore already covers them and git does not track them. The 1.9.2 tarball shipped 245 files (912 kB), of which 214 were junk: - android/build/ (166 files): compiled .class, .dex, Gradle transform caches - android/.gradle/ (31) and android/.idea/ (17): local tool state - android/local.properties: contains an absolute SDK path from the publisher's machine (sdk.dir=/Users/<name>/Library/Android/sdk), in a file whose own header says it must not be checked in - ios/**/xcuserdata/: Xcode UI state including the publisher's username Narrow "files" to the sources consumers actually build against, and add explicit negations so this cannot regress if the directory patterns are widened again. Also drop react-native.config.js from the list; no such file exists in the repo. Result: 245 files / 912 kB -> 24 files / 20.9 kB. The gradle wrapper and settings.gradle were also dropped: those build the library standalone and are unused by consumers, which the verification below confirms. Verified by installing the repacked tarball into a fresh Expo SDK 57 app (RN 0.86) and running expo prebuild: - Android: BUILD SUCCESSFUL; RNRefinerPackage autolinked into PackageList; NativeRNRefinerSpec, RNRefinerTurboModule, RNRefinerPackage all present in the APK dex (codegen regenerates the spec from src/, so removing the prebuilt android/build/ output costs nothing) - iOS: BUILD SUCCEEDED; pod resolved and linked from Podfile.lock Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Collaborator
Author
|
Reviewed & verified |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What it does
The
filesallowlist inpackage.jsonincludedandroid/wholesale. npm's allowlist takes precedence over.gitignorefor explicitly included directories, so every local build artifact was published even though.gitignorealready covers them and git doesn't track them.The 1.9.2 tarball currently on npm ships 245 files (912 kB), of which 214 are junk:
android/build/(166 files): compiled.class,.dex, Gradle transform cachesandroid/.gradle/(31) andandroid/.idea/(17): local tool stateandroid/local.properties: contains an absolute SDK path from the publisher's own machine (sdk.dir=/Users/<name>/Library/Android/sdk), in a file whose own header says it must not be checked inios/**/xcuserdata/: Xcode UI state including the publisher's usernameNarrows
filesto the sources consumers actually build against, with explicit negations so this can't regress if the directory patterns are widened again. Also dropsreact-native.config.jsfrom the list — no such file exists in the repo, and the gradle wrapper /settings.gradle, which build the library standalone and aren't used by consumers.Result: 245 files / 912 kB → 24 files / 20.9 kB.
How to test it
npm pack --dry-run(ornpm publish --dry-run) from the repo root and confirm the file list is limited tosrc/,android/src/,android/build.gradle,android/gradle.properties,ios/(minusxcuserdata/),index.js,index.d.ts,refiner-react-native.podspec,README.md,package.json.expo prebuildfor both platforms — confirmed already (see below).Acceptance criteria
android/build/,android/.gradle/,android/.idea/,local.properties, orios/**/xcuserdata/.src/, so dropping the prebuiltandroid/build/output costs nothing.Link to ticket
No Trello card — found and fixed directly.
Verification (from the commit)
Installed the repacked tarball into a fresh Expo SDK 57 app (RN 0.86) and ran
expo prebuild:RNRefinerPackageautolinked intoPackageList;NativeRNRefinerSpec,RNRefinerTurboModule,RNRefinerPackageall present in the APK dex.Podfile.lock.Rebased onto current
develop(post Dependabot-fix commit92dc945) — same single-file diff, no conflicts.🤖 Generated with Claude Code