mergn-react-native 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +44 -0
- package/README.md +131 -0
- package/android/build.gradle +66 -0
- package/android/src/main/java/com/mergn/reactnative/MergnModule.java +152 -0
- package/android/src/main/java/com/mergn/reactnative/MergnPackage.java +31 -0
- package/app.plugin.js +2 -0
- package/docs/ANDROID.md +147 -0
- package/docs/IOS.md +156 -0
- package/docs/MIGRATION.md +365 -0
- package/ios/MergnModule.swift +149 -0
- package/ios/MergnModuleBridge.m +14 -0
- package/ios/MergnNotificationHandler.swift +160 -0
- package/ios/NotificationService/Info.plist +31 -0
- package/ios/NotificationService/NotificationService.swift +82 -0
- package/mergn-react-native.podspec +32 -0
- package/package.json +49 -0
- package/plugin/index.js +219 -0
- package/react-native.config.js +19 -0
- package/scripts/release-ios.sh +79 -0
- package/scripts/verify-package.js +58 -0
- package/sdk/MergnSDK.podspec +28 -0
- package/sdk/mergn_ios.xcframework/Info.plist +44 -0
- package/sdk/mergn_ios.xcframework/ios-arm64/mergn_ios.framework/Info.plist +0 -0
- package/sdk/mergn_ios.xcframework/ios-arm64/mergn_ios.framework/Modules/mergn_ios.swiftmodule/arm64-apple-ios.abi.json +2517 -0
- package/sdk/mergn_ios.xcframework/ios-arm64/mergn_ios.framework/Modules/mergn_ios.swiftmodule/arm64-apple-ios.private.swiftinterface +82 -0
- package/sdk/mergn_ios.xcframework/ios-arm64/mergn_ios.framework/Modules/mergn_ios.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/sdk/mergn_ios.xcframework/ios-arm64/mergn_ios.framework/Modules/mergn_ios.swiftmodule/arm64-apple-ios.swiftinterface +82 -0
- package/sdk/mergn_ios.xcframework/ios-arm64/mergn_ios.framework/mergn_ios +0 -0
- package/sdk/mergn_ios.xcframework/ios-arm64_x86_64-simulator/mergn_ios.framework/Info.plist +0 -0
- package/sdk/mergn_ios.xcframework/ios-arm64_x86_64-simulator/mergn_ios.framework/Modules/mergn_ios.swiftmodule/arm64-apple-ios-simulator.abi.json +2517 -0
- package/sdk/mergn_ios.xcframework/ios-arm64_x86_64-simulator/mergn_ios.framework/Modules/mergn_ios.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +82 -0
- package/sdk/mergn_ios.xcframework/ios-arm64_x86_64-simulator/mergn_ios.framework/Modules/mergn_ios.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/sdk/mergn_ios.xcframework/ios-arm64_x86_64-simulator/mergn_ios.framework/Modules/mergn_ios.swiftmodule/arm64-apple-ios-simulator.swiftinterface +82 -0
- package/sdk/mergn_ios.xcframework/ios-arm64_x86_64-simulator/mergn_ios.framework/Modules/mergn_ios.swiftmodule/x86_64-apple-ios-simulator.abi.json +2517 -0
- package/sdk/mergn_ios.xcframework/ios-arm64_x86_64-simulator/mergn_ios.framework/Modules/mergn_ios.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +82 -0
- package/sdk/mergn_ios.xcframework/ios-arm64_x86_64-simulator/mergn_ios.framework/Modules/mergn_ios.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
- package/sdk/mergn_ios.xcframework/ios-arm64_x86_64-simulator/mergn_ios.framework/Modules/mergn_ios.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +82 -0
- package/sdk/mergn_ios.xcframework/ios-arm64_x86_64-simulator/mergn_ios.framework/_CodeSignature/CodeResources +101 -0
- package/sdk/mergn_ios.xcframework/ios-arm64_x86_64-simulator/mergn_ios.framework/mergn_ios +0 -0
- package/src/index.d.ts +37 -0
- package/src/index.js +34 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Runs on `npm pack`/`npm publish` (prepack). Fails the publish if anything a
|
|
3
|
+
// client needs is missing — most importantly the native binaries, which are the
|
|
4
|
+
// easiest thing to lose to a stray .npmignore or a bad `files` entry.
|
|
5
|
+
const fs = require("fs");
|
|
6
|
+
const path = require("path");
|
|
7
|
+
|
|
8
|
+
const root = path.join(__dirname, "..");
|
|
9
|
+
const required = [
|
|
10
|
+
"src/index.js",
|
|
11
|
+
"src/index.d.ts",
|
|
12
|
+
"app.plugin.js",
|
|
13
|
+
"plugin/index.js",
|
|
14
|
+
"react-native.config.js",
|
|
15
|
+
"mergn-react-native.podspec",
|
|
16
|
+
"ios/MergnModule.swift",
|
|
17
|
+
"ios/MergnNotificationHandler.swift",
|
|
18
|
+
"sdk/MergnSDK.podspec",
|
|
19
|
+
"ios/MergnModuleBridge.m",
|
|
20
|
+
"android/build.gradle",
|
|
21
|
+
"android/src/main/java/com/mergn/reactnative/MergnModule.java",
|
|
22
|
+
"android/src/main/java/com/mergn/reactnative/MergnPackage.java",
|
|
23
|
+
"README.md",
|
|
24
|
+
];
|
|
25
|
+
|
|
26
|
+
const missing = required.filter((rel) => !fs.existsSync(path.join(root, rel)));
|
|
27
|
+
|
|
28
|
+
// Android resolves from JitPack, so no .aar should ship. iOS IS bundled (see
|
|
29
|
+
// the podspec) because a vendored framework fetched at install time does not
|
|
30
|
+
// reliably link.
|
|
31
|
+
if (fs.existsSync(path.join(root, "android", "libs"))) {
|
|
32
|
+
missing.push("android/libs should not ship - the Android SDK resolves from JitPack");
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// Both xcframework slices are required: a device-only framework fails to link
|
|
36
|
+
// for the simulator, and vice versa.
|
|
37
|
+
for (const slice of ["ios-arm64", "ios-arm64_x86_64-simulator"]) {
|
|
38
|
+
const bin = path.join(root, "sdk", "mergn_ios.xcframework", slice,
|
|
39
|
+
"mergn_ios.framework", "mergn_ios");
|
|
40
|
+
if (!fs.existsSync(bin)) missing.push(`xcframework slice missing: ${slice}`);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (missing.length) {
|
|
44
|
+
console.error("\nmergn-react-native: package is incomplete, refusing to publish:");
|
|
45
|
+
for (const m of missing) console.error(` missing ${m}`);
|
|
46
|
+
console.error(
|
|
47
|
+
"\nFix the above before publishing: a client's native build depends on " +
|
|
48
|
+
"these files or coordinates being correct.\n"
|
|
49
|
+
);
|
|
50
|
+
process.exit(1);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// Both xcframework slices are required: device-only fails to link for the
|
|
54
|
+
// simulator, and vice versa.
|
|
55
|
+
console.log(
|
|
56
|
+
"mergn-react-native: package verified " +
|
|
57
|
+
"(Android SDK from JitPack, iOS xcframework bundled)"
|
|
58
|
+
);
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# The Mergn iOS SDK, as its own pod.
|
|
2
|
+
#
|
|
3
|
+
# This lives in a directory containing ONLY the podspec and the framework, which
|
|
4
|
+
# matters twice over:
|
|
5
|
+
# - CocoaPods resolves vendored_frameworks relative to the podspec and
|
|
6
|
+
# silently ignores paths that escape it
|
|
7
|
+
# - `pod 'MergnSDK', :path => '<dir>'` matches the podspec filename to the pod
|
|
8
|
+
# name, so a second podspec in the same directory breaks resolution
|
|
9
|
+
#
|
|
10
|
+
# Declared as a separate pod rather than folded into mergn-react-native.podspec
|
|
11
|
+
# because a vendored framework on an autolinked pod does not produce link flags
|
|
12
|
+
# (the app builds without -framework "mergn_ios" and then fails with
|
|
13
|
+
# "Unable to resolve module dependency: 'mergn_ios'").
|
|
14
|
+
Pod::Spec.new do |s|
|
|
15
|
+
s.name = 'MergnSDK'
|
|
16
|
+
s.version = '19.0.0'
|
|
17
|
+
s.summary = 'Mergn iOS SDK (binary distribution)'
|
|
18
|
+
s.description = 'Closed-source Mergn iOS SDK, vendored as an xcframework.'
|
|
19
|
+
s.homepage = 'https://mergn.com'
|
|
20
|
+
s.license = { :type => 'Commercial' }
|
|
21
|
+
s.author = 'Mergn'
|
|
22
|
+
s.source = { :path => '.' }
|
|
23
|
+
|
|
24
|
+
# Must match the framework's own minimum (see its .swiftinterface flags).
|
|
25
|
+
s.platforms = { :ios => '14.0' }
|
|
26
|
+
|
|
27
|
+
s.vendored_frameworks = 'mergn_ios.xcframework'
|
|
28
|
+
end
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
+
<plist version="1.0">
|
|
4
|
+
<dict>
|
|
5
|
+
<key>AvailableLibraries</key>
|
|
6
|
+
<array>
|
|
7
|
+
<dict>
|
|
8
|
+
<key>BinaryPath</key>
|
|
9
|
+
<string>mergn_ios.framework/mergn_ios</string>
|
|
10
|
+
<key>LibraryIdentifier</key>
|
|
11
|
+
<string>ios-arm64</string>
|
|
12
|
+
<key>LibraryPath</key>
|
|
13
|
+
<string>mergn_ios.framework</string>
|
|
14
|
+
<key>SupportedArchitectures</key>
|
|
15
|
+
<array>
|
|
16
|
+
<string>arm64</string>
|
|
17
|
+
</array>
|
|
18
|
+
<key>SupportedPlatform</key>
|
|
19
|
+
<string>ios</string>
|
|
20
|
+
</dict>
|
|
21
|
+
<dict>
|
|
22
|
+
<key>BinaryPath</key>
|
|
23
|
+
<string>mergn_ios.framework/mergn_ios</string>
|
|
24
|
+
<key>LibraryIdentifier</key>
|
|
25
|
+
<string>ios-arm64_x86_64-simulator</string>
|
|
26
|
+
<key>LibraryPath</key>
|
|
27
|
+
<string>mergn_ios.framework</string>
|
|
28
|
+
<key>SupportedArchitectures</key>
|
|
29
|
+
<array>
|
|
30
|
+
<string>arm64</string>
|
|
31
|
+
<string>x86_64</string>
|
|
32
|
+
</array>
|
|
33
|
+
<key>SupportedPlatform</key>
|
|
34
|
+
<string>ios</string>
|
|
35
|
+
<key>SupportedPlatformVariant</key>
|
|
36
|
+
<string>simulator</string>
|
|
37
|
+
</dict>
|
|
38
|
+
</array>
|
|
39
|
+
<key>CFBundlePackageType</key>
|
|
40
|
+
<string>XFWK</string>
|
|
41
|
+
<key>XCFrameworkFormatVersion</key>
|
|
42
|
+
<string>1.0</string>
|
|
43
|
+
</dict>
|
|
44
|
+
</plist>
|