mindbox-expo-plugin 1.0.7-rc → 1.0.9-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.
|
@@ -16,18 +16,12 @@ const addMindboxDependencies = (config, props = {}) => {
|
|
|
16
16
|
const providersToAdd = shouldRemoveFirebaseStarter
|
|
17
17
|
? props.androidPushProviders.filter(provider => provider !== "firebase")
|
|
18
18
|
: props.androidPushProviders;
|
|
19
|
-
|
|
20
|
-
if (providersToAdd.length === 0 && !shouldAddWorkaround) {
|
|
19
|
+
if (providersToAdd.length === 0) {
|
|
21
20
|
return config;
|
|
22
21
|
}
|
|
23
22
|
return (0, config_plugins_1.withAppBuildGradle)(config, (buildGradle) => {
|
|
24
23
|
const contents = buildGradle.modResults.contents;
|
|
25
|
-
const
|
|
26
|
-
if (props.workRuntimeWorkaround === true) {
|
|
27
|
-
extraDependencies.push(` ${androidConstants_1.ANDROID_CONSTANTS.IMPLEMENTATION} 'androidx.work:work-runtime-ktx:${androidConstants_1.ANDROID_CONSTANTS.WORK_RUNTIME_KTX_VERSION}'`);
|
|
28
|
-
}
|
|
29
|
-
const mindboxDependencies = providersToAdd.map(provider => ` ${androidConstants_1.ANDROID_CONSTANTS.IMPLEMENTATION} '${libraryMap[provider]}'`);
|
|
30
|
-
const dependencies = [...extraDependencies, ...mindboxDependencies].join('\n');
|
|
24
|
+
const dependencies = providersToAdd.map(provider => ` ${androidConstants_1.ANDROID_CONSTANTS.IMPLEMENTATION} '${libraryMap[provider]}'`).join('\n');
|
|
31
25
|
buildGradle.modResults.contents = buildGradle.modResults.contents.replace(/(\s*)dependencies\s*\{/, `$1dependencies {\n${dependencies}`);
|
|
32
26
|
return buildGradle;
|
|
33
27
|
});
|
|
@@ -14,7 +14,6 @@ export declare const ANDROID_CONSTANTS: {
|
|
|
14
14
|
readonly RUSTORE_MAVEN_URL: "https://artifactory-external.vkpartner.ru/artifactory/maven";
|
|
15
15
|
readonly RUSTORE_MAVEN_REPO: " maven { url = uri(\"https://artifactory-external.vkpartner.ru/artifactory/maven\") }";
|
|
16
16
|
readonly RUSTORE_PROJECT_ID_META_DATA_NAME: "ru.rustore.sdk.pushclient.project_id";
|
|
17
|
-
readonly WORK_RUNTIME_KTX_VERSION: "2.8.1";
|
|
18
17
|
};
|
|
19
18
|
export declare const REGEX_CAPTURE_GROUPS: {
|
|
20
19
|
readonly FIRST: 1;
|
|
@@ -5,7 +5,6 @@ const VERSIONS = {
|
|
|
5
5
|
GOOGLE_SERVICES: "4.4.0",
|
|
6
6
|
HUAWEI_AGCP: "1.9.1.300",
|
|
7
7
|
HUAWEI_PUSH: "6.11.0.300",
|
|
8
|
-
WORK_RUNTIME_KTX: "2.8.1",
|
|
9
8
|
};
|
|
10
9
|
exports.ANDROID_CONSTANTS = {
|
|
11
10
|
IMPLEMENTATION: "implementation",
|
|
@@ -23,7 +22,6 @@ exports.ANDROID_CONSTANTS = {
|
|
|
23
22
|
RUSTORE_MAVEN_URL: "https://artifactory-external.vkpartner.ru/artifactory/maven",
|
|
24
23
|
RUSTORE_MAVEN_REPO: " maven { url = uri(\"https://artifactory-external.vkpartner.ru/artifactory/maven\") }",
|
|
25
24
|
RUSTORE_PROJECT_ID_META_DATA_NAME: "ru.rustore.sdk.pushclient.project_id",
|
|
26
|
-
WORK_RUNTIME_KTX_VERSION: VERSIONS.WORK_RUNTIME_KTX,
|
|
27
25
|
};
|
|
28
26
|
exports.REGEX_CAPTURE_GROUPS = {
|
|
29
27
|
FIRST: 1,
|
package/build/ios/withPodfile.js
CHANGED
|
@@ -40,7 +40,16 @@ const iosConstants_1 = require("../helpers/iosConstants");
|
|
|
40
40
|
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
|
-
const
|
|
43
|
+
const USE_FRAMEWORKS_REGEX = /^\s*use_frameworks!.*$/m;
|
|
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 = {}) => {
|
|
44
53
|
return (0, config_plugins_1.withDangerousMod)(config, [
|
|
45
54
|
"ios",
|
|
46
55
|
async (c) => {
|
|
@@ -48,7 +57,7 @@ const withMindboxPodfile = (config) => {
|
|
|
48
57
|
if (!fs.existsSync(podfilePath))
|
|
49
58
|
return c;
|
|
50
59
|
const source = fs.readFileSync(podfilePath, "utf8");
|
|
51
|
-
const updated = applyPodfileTransformations(source);
|
|
60
|
+
const updated = applyPodfileTransformations(source, props);
|
|
52
61
|
if (updated !== source) {
|
|
53
62
|
fs.writeFileSync(podfilePath, updated, "utf8");
|
|
54
63
|
(0, errorUtils_1.logSuccess)("configure Podfile for Mindbox");
|
|
@@ -58,12 +67,16 @@ const withMindboxPodfile = (config) => {
|
|
|
58
67
|
]);
|
|
59
68
|
};
|
|
60
69
|
exports.default = withMindboxPodfile;
|
|
61
|
-
function applyPodfileTransformations(podfile) {
|
|
62
|
-
|
|
70
|
+
function applyPodfileTransformations(podfile, props) {
|
|
71
|
+
const transformations = [
|
|
63
72
|
insertMindboxNotificationsTarget,
|
|
64
73
|
insertMindboxContentTarget,
|
|
65
|
-
insertMindboxPods
|
|
66
|
-
]
|
|
74
|
+
insertMindboxPods,
|
|
75
|
+
];
|
|
76
|
+
if (!props.iosSkipResourceSigning) {
|
|
77
|
+
transformations.push(insertResourceBundleSigningFix);
|
|
78
|
+
}
|
|
79
|
+
return transformations.reduce((content, transform) => transform(content), podfile);
|
|
67
80
|
}
|
|
68
81
|
function insertTargetIfMissing(podfile, targetName, podLine, logMessage) {
|
|
69
82
|
const targetHeader = `target '${targetName}' do`;
|
|
@@ -78,7 +91,9 @@ function insertTargetIfMissing(podfile, targetName, podLine, logMessage) {
|
|
|
78
91
|
if (headerIdx === -1) {
|
|
79
92
|
return podfile;
|
|
80
93
|
}
|
|
81
|
-
const
|
|
94
|
+
const frameworksMatch = podfile.match(USE_FRAMEWORKS_REGEX);
|
|
95
|
+
const frameworksLine = frameworksMatch ? ` ${frameworksMatch[0].trim()}\n` : "";
|
|
96
|
+
const insertion = `target '${targetName}' do\n${frameworksLine} ${podLine}\nend\n\n`;
|
|
82
97
|
(0, errorUtils_1.logSuccess)(logMessage);
|
|
83
98
|
return podfile.slice(0, headerIdx) + insertion + podfile.slice(headerIdx);
|
|
84
99
|
}
|
|
@@ -121,3 +136,15 @@ function insertMindboxNotificationsTarget(podfile) {
|
|
|
121
136
|
function insertMindboxContentTarget(podfile) {
|
|
122
137
|
return insertTargetIfMissing(podfile, iosConstants_1.IOS_TARGET_NCE_NAME, iosConstants_1.POD_MINDBOX_NOTIFICATIONS_LINE, "add NCE target to Podfile as separate target");
|
|
123
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+\|installer\|/;
|
|
144
|
+
if (postInstallRegex.test(podfile)) {
|
|
145
|
+
(0, errorUtils_1.logSuccess)("add resource bundle signing fix to existing post_install");
|
|
146
|
+
return podfile.replace(postInstallRegex, `post_install do |installer|\n${RESOURCE_BUNDLE_SIGNING_FIX}`);
|
|
147
|
+
}
|
|
148
|
+
(0, errorUtils_1.logSuccess)("add resource bundle signing fix to new post_install");
|
|
149
|
+
return `${podfile}\n\npost_install do |installer|\n${RESOURCE_BUNDLE_SIGNING_FIX}\nend`;
|
|
150
|
+
}
|
package/build/mindboxTypes.d.ts
CHANGED
|
@@ -19,7 +19,6 @@ const MINDBOX_PLUGIN_PROPS = [
|
|
|
19
19
|
"iosDeploymentTarget",
|
|
20
20
|
"iosDevTeam",
|
|
21
21
|
"usedExpoNotification",
|
|
22
|
-
"workRuntimeWorkaround",
|
|
23
22
|
];
|
|
24
23
|
const VALID_ANDROID_PROVIDERS = ["firebase", "huawei", "rustore"];
|
|
25
24
|
const VALID_IOS_MODES = ["development", "production"];
|
|
@@ -80,7 +79,6 @@ function validatePluginProps(props) {
|
|
|
80
79
|
validateStringProp(props.smallIconAccentColor, "smallIconAccentColor");
|
|
81
80
|
validateBooleanProp(props.nativeRequestPermission, "nativeRequestPermission");
|
|
82
81
|
validateBooleanProp(props.usedExpoNotification, "usedExpoNotification");
|
|
83
|
-
validateBooleanProp(props.workRuntimeWorkaround, "workRuntimeWorkaround");
|
|
84
82
|
validateStringProp(props.iosNseFilePath, "iosNseFilePath");
|
|
85
83
|
validateStringProp(props.iosNceFilePath, "iosNceFilePath");
|
|
86
84
|
validateStringProp(props.iosAppGroupId, "iosAppGroupId");
|
package/package.json
CHANGED