mindbox-expo-plugin 1.0.8-rc → 1.0.10-rc
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/build/ios/withPodfile.js
CHANGED
|
@@ -41,7 +41,15 @@ const errorUtils_1 = require("../utils/errorUtils");
|
|
|
41
41
|
const TARGET_REGEX = /^target\s+'[^']+'\s+do\s*\n/m;
|
|
42
42
|
const USE_EXPO_MODULES_REGEX = /^\s*use_expo_modules!\s*$/m;
|
|
43
43
|
const USE_FRAMEWORKS_REGEX = /^\s*use_frameworks!.*$/m;
|
|
44
|
-
const
|
|
44
|
+
const RESOURCE_BUNDLE_SIGNING_FIX = `
|
|
45
|
+
installer.pods_project.targets.each do |target|
|
|
46
|
+
if target.respond_to?(:product_type) and target.product_type == "com.apple.product-type.bundle"
|
|
47
|
+
target.build_configurations.each do |config|
|
|
48
|
+
config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end`;
|
|
52
|
+
const withMindboxPodfile = (config, props = {}) => {
|
|
45
53
|
return (0, config_plugins_1.withDangerousMod)(config, [
|
|
46
54
|
"ios",
|
|
47
55
|
async (c) => {
|
|
@@ -49,7 +57,7 @@ const withMindboxPodfile = (config) => {
|
|
|
49
57
|
if (!fs.existsSync(podfilePath))
|
|
50
58
|
return c;
|
|
51
59
|
const source = fs.readFileSync(podfilePath, "utf8");
|
|
52
|
-
const updated = applyPodfileTransformations(source);
|
|
60
|
+
const updated = applyPodfileTransformations(source, props);
|
|
53
61
|
if (updated !== source) {
|
|
54
62
|
fs.writeFileSync(podfilePath, updated, "utf8");
|
|
55
63
|
(0, errorUtils_1.logSuccess)("configure Podfile for Mindbox");
|
|
@@ -59,12 +67,16 @@ const withMindboxPodfile = (config) => {
|
|
|
59
67
|
]);
|
|
60
68
|
};
|
|
61
69
|
exports.default = withMindboxPodfile;
|
|
62
|
-
function applyPodfileTransformations(podfile) {
|
|
63
|
-
|
|
70
|
+
function applyPodfileTransformations(podfile, props) {
|
|
71
|
+
const transformations = [
|
|
64
72
|
insertMindboxNotificationsTarget,
|
|
65
73
|
insertMindboxContentTarget,
|
|
66
|
-
insertMindboxPods
|
|
67
|
-
]
|
|
74
|
+
insertMindboxPods,
|
|
75
|
+
];
|
|
76
|
+
if (!props.iosSkipResourceSigning) {
|
|
77
|
+
transformations.push(insertResourceBundleSigningFix);
|
|
78
|
+
}
|
|
79
|
+
return transformations.reduce((content, transform) => transform(content), podfile);
|
|
68
80
|
}
|
|
69
81
|
function insertTargetIfMissing(podfile, targetName, podLine, logMessage) {
|
|
70
82
|
const targetHeader = `target '${targetName}' do`;
|
|
@@ -124,3 +136,19 @@ function insertMindboxNotificationsTarget(podfile) {
|
|
|
124
136
|
function insertMindboxContentTarget(podfile) {
|
|
125
137
|
return insertTargetIfMissing(podfile, iosConstants_1.IOS_TARGET_NCE_NAME, iosConstants_1.POD_MINDBOX_NOTIFICATIONS_LINE, "add NCE target to Podfile as separate target");
|
|
126
138
|
}
|
|
139
|
+
function insertResourceBundleSigningFix(podfile) {
|
|
140
|
+
if (podfile.includes("CODE_SIGNING_ALLOWED'] = 'NO'")) {
|
|
141
|
+
return podfile;
|
|
142
|
+
}
|
|
143
|
+
const postInstallRegex = /post_install\s+do\s+\|([^|]+)\|/;
|
|
144
|
+
const match = podfile.match(postInstallRegex);
|
|
145
|
+
if (match) {
|
|
146
|
+
(0, errorUtils_1.logSuccess)("add resource bundle signing fix to existing post_install");
|
|
147
|
+
const installerVarName = match[1];
|
|
148
|
+
// Replace 'installer' in our fix with the actual variable name used in the Podfile
|
|
149
|
+
const fixWithCorrectVar = RESOURCE_BUNDLE_SIGNING_FIX.replace(/installer/g, installerVarName);
|
|
150
|
+
return podfile.replace(match[0], `${match[0]}\n${fixWithCorrectVar}`);
|
|
151
|
+
}
|
|
152
|
+
(0, errorUtils_1.logSuccess)("add resource bundle signing fix to new post_install");
|
|
153
|
+
return `${podfile}\n\npost_install do |installer|\n${RESOURCE_BUNDLE_SIGNING_FIX}\nend`;
|
|
154
|
+
}
|
package/build/mindboxTypes.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ const MINDBOX_PLUGIN_PROPS = [
|
|
|
19
19
|
"iosDeploymentTarget",
|
|
20
20
|
"iosDevTeam",
|
|
21
21
|
"usedExpoNotification",
|
|
22
|
+
"iosSkipResourceSigning",
|
|
22
23
|
];
|
|
23
24
|
const VALID_ANDROID_PROVIDERS = ["firebase", "huawei", "rustore"];
|
|
24
25
|
const VALID_IOS_MODES = ["development", "production"];
|
|
@@ -79,6 +80,7 @@ function validatePluginProps(props) {
|
|
|
79
80
|
validateStringProp(props.smallIconAccentColor, "smallIconAccentColor");
|
|
80
81
|
validateBooleanProp(props.nativeRequestPermission, "nativeRequestPermission");
|
|
81
82
|
validateBooleanProp(props.usedExpoNotification, "usedExpoNotification");
|
|
83
|
+
validateBooleanProp(props.iosSkipResourceSigning, "iosSkipResourceSigning");
|
|
82
84
|
validateStringProp(props.iosNseFilePath, "iosNseFilePath");
|
|
83
85
|
validateStringProp(props.iosNceFilePath, "iosNceFilePath");
|
|
84
86
|
validateStringProp(props.iosAppGroupId, "iosAppGroupId");
|
package/package.json
CHANGED