@tryheliumai/paywall-sdk-react-native 0.1.20 → 0.1.22
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.
|
@@ -16,7 +16,7 @@ Pod::Spec.new do |s|
|
|
|
16
16
|
|
|
17
17
|
s.source_files = "ios/**/*.{h,m,mm,swift}"
|
|
18
18
|
|
|
19
|
-
s.dependency '
|
|
19
|
+
s.dependency 'HeliumC', '~> 1.6.6'
|
|
20
20
|
|
|
21
21
|
# Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.
|
|
22
22
|
# See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79.
|
|
@@ -25,4 +25,4 @@ Pod::Spec.new do |s|
|
|
|
25
25
|
else
|
|
26
26
|
s.dependency "React-Core"
|
|
27
27
|
end
|
|
28
|
-
end
|
|
28
|
+
end
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tryheliumai/paywall-sdk-react-native",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.22",
|
|
4
4
|
"description": "Paywall SDK Helium",
|
|
5
5
|
"source": "./src/index.ts",
|
|
6
6
|
"main": "./lib/commonjs/index.js",
|
|
@@ -43,8 +43,7 @@
|
|
|
43
43
|
"!**/__tests__",
|
|
44
44
|
"!**/__fixtures__",
|
|
45
45
|
"!**/__mocks__",
|
|
46
|
-
"!**/.*"
|
|
47
|
-
"withModularHeaders.js"
|
|
46
|
+
"!**/.*"
|
|
48
47
|
],
|
|
49
48
|
"scripts": {
|
|
50
49
|
"example": "yarn workspace paywall-sdk-react-native-example",
|
|
@@ -87,8 +86,8 @@
|
|
|
87
86
|
"eslint-plugin-prettier": "^5.0.1",
|
|
88
87
|
"jest": "^29.7.0",
|
|
89
88
|
"prettier": "^3.0.3",
|
|
90
|
-
"react": "
|
|
91
|
-
"react-native": "
|
|
89
|
+
"react": "18.3.1",
|
|
90
|
+
"react-native": "0.74.0",
|
|
92
91
|
"react-native-builder-bob": "^0.37.0",
|
|
93
92
|
"release-it": "^17.10.0",
|
|
94
93
|
"turbo": "^1.10.7",
|
|
@@ -198,8 +197,5 @@
|
|
|
198
197
|
"type": "legacy-module",
|
|
199
198
|
"languages": "kotlin-swift",
|
|
200
199
|
"version": "0.48.1"
|
|
201
|
-
},
|
|
202
|
-
"dependencies": {
|
|
203
|
-
"@expo/config-plugins": "^9.0.17"
|
|
204
200
|
}
|
|
205
201
|
}
|
package/withModularHeaders.js
DELETED
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
// withModularHeaders.js
|
|
2
|
-
const { withDangerousMod } = require('@expo/config-plugins');
|
|
3
|
-
const { resolve } = require('path');
|
|
4
|
-
const fs = require('fs');
|
|
5
|
-
|
|
6
|
-
const withModularHeadersPods = (config) => {
|
|
7
|
-
return withDangerousMod(config, [
|
|
8
|
-
'ios',
|
|
9
|
-
async (config) => {
|
|
10
|
-
try {
|
|
11
|
-
const podfilePath = resolve(
|
|
12
|
-
config.modRequest.platformProjectRoot,
|
|
13
|
-
'Podfile'
|
|
14
|
-
);
|
|
15
|
-
|
|
16
|
-
if (!fs.existsSync(podfilePath)) {
|
|
17
|
-
console.warn('Podfile not found at path:', podfilePath);
|
|
18
|
-
return config;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
let podfileContent = fs.readFileSync(podfilePath, 'utf8');
|
|
22
|
-
|
|
23
|
-
// Check for existing pod declarations with any quote style
|
|
24
|
-
const heliumRegex =
|
|
25
|
-
/pod\s+(['"])Helium\1\s*,?\s*:modular_headers\s*=>\s*true/;
|
|
26
|
-
const analyticsRegex =
|
|
27
|
-
/pod\s+(['"])Analytics\1\s*,?\s*:modular_headers\s*=>\s*true/;
|
|
28
|
-
|
|
29
|
-
const heliumExists = heliumRegex.test(podfileContent);
|
|
30
|
-
const analyticsExists = analyticsRegex.test(podfileContent);
|
|
31
|
-
|
|
32
|
-
// Remove existing declarations without modular_headers
|
|
33
|
-
if (!heliumExists) {
|
|
34
|
-
const existingHeliumRegex =
|
|
35
|
-
/pod\s+(['"])Helium\1(?!\s*,\s*:modular_headers\s*=>)/;
|
|
36
|
-
if (existingHeliumRegex.test(podfileContent)) {
|
|
37
|
-
podfileContent = podfileContent.replace(
|
|
38
|
-
/pod\s+(['"])Helium\1[^,\n]*(?!:modular_headers)/g,
|
|
39
|
-
"pod 'Helium', :modular_headers => true"
|
|
40
|
-
);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
if (!analyticsExists) {
|
|
45
|
-
const existingAnalyticsRegex =
|
|
46
|
-
/pod\s+(['"])Analytics\1(?!\s*,\s*:modular_headers\s*=>)/;
|
|
47
|
-
if (existingAnalyticsRegex.test(podfileContent)) {
|
|
48
|
-
podfileContent = podfileContent.replace(
|
|
49
|
-
/pod\s+(['"])Analytics\1[^,\n]*(?!:modular_headers)/g,
|
|
50
|
-
"pod 'Analytics', :modular_headers => true"
|
|
51
|
-
);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
// If pods don't exist at all, add them
|
|
56
|
-
if (
|
|
57
|
-
(!heliumExists && !podfileContent.includes("pod 'Helium'")) ||
|
|
58
|
-
(!analyticsExists && !podfileContent.includes("pod 'Analytics'"))
|
|
59
|
-
) {
|
|
60
|
-
const podsToAdd = [];
|
|
61
|
-
|
|
62
|
-
if (!heliumExists && !podfileContent.includes("pod 'Helium'")) {
|
|
63
|
-
podsToAdd.push(" pod 'Helium', :modular_headers => true");
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
if (!analyticsExists && !podfileContent.includes("pod 'Analytics'")) {
|
|
67
|
-
podsToAdd.push(" pod 'Analytics', :modular_headers => true");
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
// Look for the main app target (usually has the app name)
|
|
71
|
-
const appName = config.modRequest.projectName || '';
|
|
72
|
-
const mainTargetRegex = new RegExp(
|
|
73
|
-
`target\\s+(['"])${appName}\\1\\s+do`
|
|
74
|
-
);
|
|
75
|
-
const mainTargetMatch = podfileContent.match(mainTargetRegex);
|
|
76
|
-
|
|
77
|
-
// Fall back to first target if main target not found
|
|
78
|
-
const targetMatch =
|
|
79
|
-
mainTargetMatch || podfileContent.match(/target\s+['"].*['"]\s+do/);
|
|
80
|
-
|
|
81
|
-
if (targetMatch && targetMatch.index !== undefined) {
|
|
82
|
-
// Find the position right after the target line
|
|
83
|
-
const targetPos =
|
|
84
|
-
podfileContent.indexOf('\n', targetMatch.index) + 1;
|
|
85
|
-
|
|
86
|
-
// Insert the new pods after the target line
|
|
87
|
-
podfileContent =
|
|
88
|
-
podfileContent.substring(0, targetPos) +
|
|
89
|
-
podsToAdd.join('\n') +
|
|
90
|
-
'\n' +
|
|
91
|
-
podfileContent.substring(targetPos);
|
|
92
|
-
} else {
|
|
93
|
-
// If no target block found, add at the end
|
|
94
|
-
podfileContent += '\n' + podsToAdd.join('\n') + '\n';
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
fs.writeFileSync(podfilePath, podfileContent);
|
|
99
|
-
} catch (error) {
|
|
100
|
-
console.error('Error in withModularHeadersPods plugin:', error);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
return config;
|
|
104
|
-
},
|
|
105
|
-
]);
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
module.exports = withModularHeadersPods;
|