Skip to content

Commit a19fd92

Browse files
chore(release): harden npm packaging for first publish
- Fix release.yml duplicate-publish guard (was querying the dead pre-rename package name @onramper/react-native, so it never fired) - Add scripts/slim-xcframework.js (wired into release.yml after checksum verify) to drop .abi.json/.swiftsourceinfo/private+package interfaces; dSYMs kept for downstream symbolication - Make package.json `files` precise (ios/*.swift + the xcframework dir) so ios/Tests sources and the intermediate .xcframework.zip no longer ship; tarball 11.9MB -> 5.8MB packed (29.3MB -> 20.8MB unpacked) - Drop the dead Expo-based Android module (broke bare-RN Gradle); add a Platform.OS guard in OnramperNative that throws a clear iOS-only error, with a react-native Jest mock; update README - Add publishConfig.access=public and a prepack guard that aborts if the vendored xcframework is missing (gitignored; CI fetches it) - Fix podspec license UNLICENSED -> MIT to match package.json/LICENSE - Update bundled OnramperSDK checksum to the refreshed v1.0.0 artifact; example Podfile.lock checksums follow the podspec change Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 0671555 commit a19fd92

16 files changed

Lines changed: 162 additions & 80 deletions

File tree

.github/workflows/release.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
env:
5353
VERSION: ${{ steps.ver.outputs.version }}
5454
run: |
55-
if npm view "@onramper/react-native@${VERSION}" version 2>/dev/null; then
55+
if npm view "@onramper/onramper-react-native@${VERSION}" version 2>/dev/null; then
5656
echo "Version ${VERSION} already on npm."; exit 1
5757
fi
5858
@@ -68,6 +68,9 @@ jobs:
6868
- name: Verify checksum recorded
6969
run: npm run verify-version
7070

71+
- name: Slim xcframework for npm
72+
run: npm run slim-xcframework
73+
7174
- name: Test + build
7275
run: |
7376
npm run lint

.gitignore

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,10 @@ yarn-debug.log
77
yarn-error.log
88

99
# Native
10-
ios/Frameworks/OnramperSDK.xcframework/
11-
ios/Frameworks/OnramperSDK.xcframework.zip
10+
# Fetched at build/publish time (npm `files` force-includes the xcframework); never tracked
11+
ios/Frameworks/
1212
ios/build/
1313
ios/Pods/
14-
android/build/
15-
android/.gradle/
1614

1715
# Expo example app
1816
example-expo/node_modules/

.npmignore

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,26 @@
1-
# Exclude all top-level hidden directories by convention
1+
# Inclusion is driven by the `files` allowlist in package.json (which lists the
2+
# exact ios/*.swift sources + the xcframework directory, so ios/Tests and the
3+
# fetched .xcframework.zip are excluded by construction). This file only trims
4+
# stray dev artifacts that could otherwise slip in.
5+
6+
# Top-level hidden directories
27
/.*/
38

4-
# Exclude tarballs generated by `npm pack`
9+
# Tarballs generated by `npm pack`
510
/*.tgz
611

7-
# Tests and mocks not in published package
12+
# Tests and mocks
813
__mocks__
914
__tests__
1015
*.test.ts
1116
*.test.tsx
1217

13-
# Source xcframework is gitignored but MUST be in npm tarball
14-
!ios/Frameworks/OnramperSDK.xcframework/
15-
!ios/Frameworks/
16-
17-
# Exclude example + native test bundles + docs/ci
18+
# Dev/CI/docs/example
1819
/babel.config.js
19-
/android/src/androidTest/
20-
/android/src/test/
21-
/android/build/
2220
/example/
23-
/ios/Tests/
2421
/docs/
2522
/.github/
23+
24+
# Defensive: never ship native test sources or the intermediate framework zip
25+
ios/Tests/
26+
ios/Frameworks/*.zip

OnramperReactNative.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Pod::Spec.new do |s|
77
s.version = package['version']
88
s.summary = package['description']
99
s.description = package['description']
10-
s.license = { :type => 'UNLICENSED' }
10+
s.license = { :type => 'MIT', :file => 'LICENSE' }
1111
s.author = package['author']
1212
s.homepage = package['homepage']
1313
s.platforms = { :ios => '16.0' }

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
React Native wrapper for the Onramper iOS SDK.
44

5-
> **iOS only.** Android calls throw `platformUnsupported`. A native Android SDK is not part of this release.
5+
> **iOS only.** Constructing an `OnramperClient` on a non-iOS platform throws immediately with a clear "iOS-only in this release" error. A native Android SDK is not part of this release, and no Android native code is shipped.
66
77
## Install
88

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// Minimal `react-native` mock for the node/ts-jest environment. The real module
2+
// can't load outside a RN runtime; tests only need `Platform`. Defaults to 'ios'
3+
// so the iOS-only native-creation guard in OnramperNative passes.
4+
export const Platform = {
5+
OS: 'ios' as 'ios' | 'android' | 'web',
6+
select: <T,>(specifics: { ios?: T; android?: T; default?: T }): T | undefined =>
7+
specifics.ios ?? specifics.default,
8+
};

android/build.gradle

Lines changed: 0 additions & 18 deletions
This file was deleted.

android/src/main/AndroidManifest.xml

Lines changed: 0 additions & 2 deletions
This file was deleted.

android/src/main/java/com/onramper/reactnative/OnramperReactNativeModule.kt

Lines changed: 0 additions & 33 deletions
This file was deleted.

example-expo/ios/Podfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2265,7 +2265,7 @@ SPEC CHECKSUMS:
22652265
FBLazyVector: 24e62c765683b8d89006a88a2c8f5cf019f0074d
22662266
hermes-engine: 1e3480e747c85101d73438cb3a6199150e345f9f
22672267
NitroModules: 16bc17a076b12304d608f7c915b9d321f56dfc19
2268-
OnramperReactNative: a0f6d570fce3d918cd5b1b3ab019bfabefb21c8f
2268+
OnramperReactNative: b9e09079bec3395b7eae69a8eb11a9286309cc59
22692269
RCTDeprecation: a4c521821fab57cbb125b36effe84d897d0dfa12
22702270
RCTRequired: 9f3a7e5645d4bc3f551593de7550bb66ab6e42bc
22712271
RCTSwiftUI: 239ed2eb9e73de5a6f518810630f0c95e01c8702

0 commit comments

Comments
 (0)