mindbox-expo-plugin 1.0.8-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.
@@ -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 withMindboxPodfile = (config) => {
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
- return [
70
+ function applyPodfileTransformations(podfile, props) {
71
+ const transformations = [
64
72
  insertMindboxNotificationsTarget,
65
73
  insertMindboxContentTarget,
66
- insertMindboxPods
67
- ].reduce((content, transform) => transform(content), podfile);
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,15 @@ 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+\|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
+ }
@@ -22,4 +22,5 @@ export type MindboxPluginProps = {
22
22
  iosAppGroupId?: string;
23
23
  nativeRequestPermission?: boolean;
24
24
  usedExpoNotification?: boolean;
25
+ iosSkipResourceSigning?: boolean;
25
26
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mindbox-expo-plugin",
3
- "version": "1.0.8-rc",
4
- "target-version": "1.0.8-rc",
3
+ "version": "1.0.9-rc",
4
+ "target-version": "1.0.9-rc",
5
5
  "main": "app.plugin.js",
6
6
  "react-native": "build/runtime/index.js",
7
7
  "types": "build/index.d.ts",