@expo/config-plugins 4.0.7 → 4.0.11

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.
Files changed (104) hide show
  1. package/build/Plugin.types.js +6 -6
  2. package/build/android/AllowBackup.js +1 -1
  3. package/build/android/Colors.js +3 -3
  4. package/build/android/EasBuild.js +1 -1
  5. package/build/android/GoogleServices.js +3 -3
  6. package/build/android/IntentFilters.d.ts +3 -3
  7. package/build/android/IntentFilters.js +45 -49
  8. package/build/android/IntentFilters.js.map +1 -1
  9. package/build/android/JsEngine.js +2 -1
  10. package/build/android/JsEngine.js.map +1 -1
  11. package/build/android/Manifest.d.ts +5 -1
  12. package/build/android/Manifest.js +10 -10
  13. package/build/android/Manifest.js.map +1 -1
  14. package/build/android/Name.d.ts +2 -1
  15. package/build/android/Name.js +7 -4
  16. package/build/android/Name.js.map +1 -1
  17. package/build/android/Orientation.js +2 -1
  18. package/build/android/Orientation.js.map +1 -1
  19. package/build/android/Package.js +4 -4
  20. package/build/android/Package.js.map +1 -1
  21. package/build/android/Paths.js +9 -9
  22. package/build/android/Permissions.js +6 -6
  23. package/build/android/Resources.js +5 -5
  24. package/build/android/Scheme.js +3 -3
  25. package/build/android/StatusBar.js +3 -3
  26. package/build/android/Strings.js +1 -1
  27. package/build/android/Styles.js +5 -5
  28. package/build/android/Updates.d.ts +2 -7
  29. package/build/android/Updates.js +34 -27
  30. package/build/android/Updates.js.map +1 -1
  31. package/build/android/Version.d.ts +9 -0
  32. package/build/android/Version.js +39 -3
  33. package/build/android/Version.js.map +1 -1
  34. package/build/android/WindowSoftInputMode.js +1 -1
  35. package/build/android/codeMod.js +2 -2
  36. package/build/index.d.ts +1 -1
  37. package/build/index.js +57 -49
  38. package/build/index.js.map +1 -1
  39. package/build/ios/Bitcode.js +1 -1
  40. package/build/ios/BuildScheme.js +2 -2
  41. package/build/ios/BundleIdentifier.js +14 -4
  42. package/build/ios/BundleIdentifier.js.map +1 -1
  43. package/build/ios/DeviceFamily.js +3 -3
  44. package/build/ios/Entitlements.js +2 -2
  45. package/build/ios/Entitlements.js.map +1 -1
  46. package/build/ios/Google.js +2 -2
  47. package/build/ios/JsEngine.d.ts +2 -1
  48. package/build/ios/JsEngine.js +2 -1
  49. package/build/ios/JsEngine.js.map +1 -1
  50. package/build/ios/Locales.js +1 -1
  51. package/build/ios/Maps.js +32 -18
  52. package/build/ios/Maps.js.map +1 -1
  53. package/build/ios/Orientation.js +2 -1
  54. package/build/ios/Orientation.js.map +1 -1
  55. package/build/ios/Paths.js +14 -14
  56. package/build/ios/Paths.js.map +1 -1
  57. package/build/ios/Permissions.js +1 -1
  58. package/build/ios/Permissions.js.map +1 -1
  59. package/build/ios/ProvisioningProfile.js +11 -2
  60. package/build/ios/ProvisioningProfile.js.map +1 -1
  61. package/build/ios/Scheme.js +4 -4
  62. package/build/ios/Swift.js +2 -2
  63. package/build/ios/Target.js +34 -15
  64. package/build/ios/Target.js.map +1 -1
  65. package/build/ios/Updates.d.ts +2 -7
  66. package/build/ios/Updates.js +34 -27
  67. package/build/ios/Updates.js.map +1 -1
  68. package/build/ios/Version.js +3 -3
  69. package/build/ios/codeMod.js +2 -2
  70. package/build/ios/index.js +3 -1
  71. package/build/ios/index.js.map +1 -1
  72. package/build/ios/utils/Xcodeproj.js +9 -9
  73. package/build/ios/utils/string.d.ts +1 -0
  74. package/build/ios/utils/string.js +11 -0
  75. package/build/ios/utils/string.js.map +1 -0
  76. package/build/plugins/android-plugins.js +1 -1
  77. package/build/plugins/createBaseMod.js +2 -2
  78. package/build/plugins/createBaseMod.js.map +1 -1
  79. package/build/plugins/ios-plugins.d.ts +2 -2
  80. package/build/plugins/ios-plugins.js +2 -2
  81. package/build/plugins/ios-plugins.js.map +1 -1
  82. package/build/plugins/mod-compiler.js +3 -3
  83. package/build/plugins/mod-compiler.js.map +1 -1
  84. package/build/plugins/withAndroidBaseMods.js +1 -1
  85. package/build/plugins/withIosBaseMods.d.ts +3 -3
  86. package/build/plugins/withIosBaseMods.js +1 -1
  87. package/build/plugins/withIosBaseMods.js.map +1 -1
  88. package/build/utils/Updates.d.ts +2 -0
  89. package/build/utils/Updates.js +58 -1
  90. package/build/utils/Updates.js.map +1 -1
  91. package/build/utils/XML.d.ts +6 -0
  92. package/build/utils/XML.js +57 -10
  93. package/build/utils/XML.js.map +1 -1
  94. package/build/utils/errors.js +1 -1
  95. package/build/utils/generateCode.js +2 -2
  96. package/build/utils/history.js +1 -1
  97. package/build/utils/modules.js +1 -1
  98. package/build/utils/plugin-resolver.js +4 -4
  99. package/build/utils/sortObject.js +2 -2
  100. package/build/utils/warnings.js +1 -1
  101. package/package.json +4 -3
  102. package/build/utils/resolvePackageRootFolder.d.ts +0 -1
  103. package/build/utils/resolvePackageRootFolder.js +0 -57
  104. package/build/utils/resolvePackageRootFolder.js.map +0 -1
package/build/index.js CHANGED
@@ -22,6 +22,7 @@ var _exportNames = {
22
22
  withEntitlementsPlist: true,
23
23
  withExpoPlist: true,
24
24
  withXcodeProject: true,
25
+ withPodfileProperties: true,
25
26
  withAndroidManifest: true,
26
27
  withStringsXml: true,
27
28
  withAndroidColors: true,
@@ -39,16 +40,18 @@ var _exportNames = {
39
40
  evalModsAsync: true,
40
41
  PluginError: true
41
42
  };
42
- Object.defineProperty(exports, "withPlugins", {
43
+ exports.IOSConfig = exports.History = exports.BaseMods = exports.AndroidConfig = void 0;
44
+ Object.defineProperty(exports, "PluginError", {
43
45
  enumerable: true,
44
46
  get: function () {
45
- return _withPlugins().withPlugins;
47
+ return _errors().PluginError;
46
48
  }
47
49
  });
48
- Object.defineProperty(exports, "withRunOnce", {
50
+ exports.XML = exports.WarningAggregator = exports.Updates = void 0;
51
+ Object.defineProperty(exports, "compileModsAsync", {
49
52
  enumerable: true,
50
53
  get: function () {
51
- return _withRunOnce().withRunOnce;
54
+ return _modCompiler().compileModsAsync;
52
55
  }
53
56
  });
54
57
  Object.defineProperty(exports, "createRunOncePlugin", {
@@ -57,82 +60,88 @@ Object.defineProperty(exports, "createRunOncePlugin", {
57
60
  return _withRunOnce().createRunOncePlugin;
58
61
  }
59
62
  });
60
- Object.defineProperty(exports, "withDangerousMod", {
63
+ Object.defineProperty(exports, "evalModsAsync", {
61
64
  enumerable: true,
62
65
  get: function () {
63
- return _withDangerousMod().withDangerousMod;
66
+ return _modCompiler().evalModsAsync;
64
67
  }
65
68
  });
66
- Object.defineProperty(exports, "withMod", {
69
+ Object.defineProperty(exports, "withAndroidColors", {
67
70
  enumerable: true,
68
71
  get: function () {
69
- return _withMod().withMod;
72
+ return _androidPlugins().withAndroidColors;
70
73
  }
71
74
  });
72
- Object.defineProperty(exports, "withBaseMod", {
75
+ Object.defineProperty(exports, "withAndroidColorsNight", {
73
76
  enumerable: true,
74
77
  get: function () {
75
- return _withMod().withBaseMod;
78
+ return _androidPlugins().withAndroidColorsNight;
76
79
  }
77
80
  });
78
- Object.defineProperty(exports, "withAppDelegate", {
81
+ Object.defineProperty(exports, "withAndroidManifest", {
79
82
  enumerable: true,
80
83
  get: function () {
81
- return _iosPlugins().withAppDelegate;
84
+ return _androidPlugins().withAndroidManifest;
82
85
  }
83
86
  });
84
- Object.defineProperty(exports, "withInfoPlist", {
87
+ Object.defineProperty(exports, "withAndroidStyles", {
85
88
  enumerable: true,
86
89
  get: function () {
87
- return _iosPlugins().withInfoPlist;
90
+ return _androidPlugins().withAndroidStyles;
88
91
  }
89
92
  });
90
- Object.defineProperty(exports, "withEntitlementsPlist", {
93
+ Object.defineProperty(exports, "withAppBuildGradle", {
91
94
  enumerable: true,
92
95
  get: function () {
93
- return _iosPlugins().withEntitlementsPlist;
96
+ return _androidPlugins().withAppBuildGradle;
94
97
  }
95
98
  });
96
- Object.defineProperty(exports, "withExpoPlist", {
99
+ Object.defineProperty(exports, "withAppDelegate", {
97
100
  enumerable: true,
98
101
  get: function () {
99
- return _iosPlugins().withExpoPlist;
102
+ return _iosPlugins().withAppDelegate;
100
103
  }
101
104
  });
102
- Object.defineProperty(exports, "withXcodeProject", {
105
+ Object.defineProperty(exports, "withBaseMod", {
103
106
  enumerable: true,
104
107
  get: function () {
105
- return _iosPlugins().withXcodeProject;
108
+ return _withMod().withBaseMod;
106
109
  }
107
110
  });
108
- Object.defineProperty(exports, "withAndroidManifest", {
111
+ Object.defineProperty(exports, "withDangerousMod", {
109
112
  enumerable: true,
110
113
  get: function () {
111
- return _androidPlugins().withAndroidManifest;
114
+ return _withDangerousMod().withDangerousMod;
112
115
  }
113
116
  });
114
- Object.defineProperty(exports, "withStringsXml", {
117
+ Object.defineProperty(exports, "withDefaultBaseMods", {
115
118
  enumerable: true,
116
119
  get: function () {
117
- return _androidPlugins().withStringsXml;
120
+ return _modCompiler().withDefaultBaseMods;
118
121
  }
119
122
  });
120
- Object.defineProperty(exports, "withAndroidColors", {
123
+ Object.defineProperty(exports, "withEntitlementsPlist", {
121
124
  enumerable: true,
122
125
  get: function () {
123
- return _androidPlugins().withAndroidColors;
126
+ return _iosPlugins().withEntitlementsPlist;
124
127
  }
125
128
  });
126
- Object.defineProperty(exports, "withAndroidColorsNight", {
129
+ Object.defineProperty(exports, "withExpoPlist", {
127
130
  enumerable: true,
128
131
  get: function () {
129
- return _androidPlugins().withAndroidColorsNight;
132
+ return _iosPlugins().withExpoPlist;
130
133
  }
131
134
  });
132
- Object.defineProperty(exports, "withAndroidStyles", {
135
+ Object.defineProperty(exports, "withGradleProperties", {
133
136
  enumerable: true,
134
137
  get: function () {
135
- return _androidPlugins().withAndroidStyles;
138
+ return _androidPlugins().withGradleProperties;
139
+ }
140
+ });
141
+ Object.defineProperty(exports, "withInfoPlist", {
142
+ enumerable: true,
143
+ get: function () {
144
+ return _iosPlugins().withInfoPlist;
136
145
  }
137
146
  });
138
147
  Object.defineProperty(exports, "withMainActivity", {
@@ -147,61 +156,60 @@ Object.defineProperty(exports, "withMainApplication", {
147
156
  return _androidPlugins().withMainApplication;
148
157
  }
149
158
  });
150
- Object.defineProperty(exports, "withProjectBuildGradle", {
159
+ Object.defineProperty(exports, "withMod", {
151
160
  enumerable: true,
152
161
  get: function () {
153
- return _androidPlugins().withProjectBuildGradle;
162
+ return _withMod().withMod;
154
163
  }
155
164
  });
156
- Object.defineProperty(exports, "withAppBuildGradle", {
165
+ Object.defineProperty(exports, "withPlugins", {
157
166
  enumerable: true,
158
167
  get: function () {
159
- return _androidPlugins().withAppBuildGradle;
168
+ return _withPlugins().withPlugins;
160
169
  }
161
170
  });
162
- Object.defineProperty(exports, "withSettingsGradle", {
171
+ Object.defineProperty(exports, "withPodfileProperties", {
163
172
  enumerable: true,
164
173
  get: function () {
165
- return _androidPlugins().withSettingsGradle;
174
+ return _iosPlugins().withPodfileProperties;
166
175
  }
167
176
  });
168
- Object.defineProperty(exports, "withGradleProperties", {
177
+ Object.defineProperty(exports, "withProjectBuildGradle", {
169
178
  enumerable: true,
170
179
  get: function () {
171
- return _androidPlugins().withGradleProperties;
180
+ return _androidPlugins().withProjectBuildGradle;
172
181
  }
173
182
  });
174
- Object.defineProperty(exports, "withStaticPlugin", {
183
+ Object.defineProperty(exports, "withRunOnce", {
175
184
  enumerable: true,
176
185
  get: function () {
177
- return _withStaticPlugin().withStaticPlugin;
186
+ return _withRunOnce().withRunOnce;
178
187
  }
179
188
  });
180
- Object.defineProperty(exports, "compileModsAsync", {
189
+ Object.defineProperty(exports, "withSettingsGradle", {
181
190
  enumerable: true,
182
191
  get: function () {
183
- return _modCompiler().compileModsAsync;
192
+ return _androidPlugins().withSettingsGradle;
184
193
  }
185
194
  });
186
- Object.defineProperty(exports, "withDefaultBaseMods", {
195
+ Object.defineProperty(exports, "withStaticPlugin", {
187
196
  enumerable: true,
188
197
  get: function () {
189
- return _modCompiler().withDefaultBaseMods;
198
+ return _withStaticPlugin().withStaticPlugin;
190
199
  }
191
200
  });
192
- Object.defineProperty(exports, "evalModsAsync", {
201
+ Object.defineProperty(exports, "withStringsXml", {
193
202
  enumerable: true,
194
203
  get: function () {
195
- return _modCompiler().evalModsAsync;
204
+ return _androidPlugins().withStringsXml;
196
205
  }
197
206
  });
198
- Object.defineProperty(exports, "PluginError", {
207
+ Object.defineProperty(exports, "withXcodeProject", {
199
208
  enumerable: true,
200
209
  get: function () {
201
- return _errors().PluginError;
210
+ return _iosPlugins().withXcodeProject;
202
211
  }
203
212
  });
204
- exports.Updates = exports.WarningAggregator = exports.History = exports.XML = exports.IOSConfig = exports.AndroidConfig = exports.BaseMods = void 0;
205
213
 
206
214
  function AndroidConfig() {
207
215
  const data = _interopRequireWildcard(require("./android"));
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":["BaseMods","withGeneratedBaseMods","provider","withAndroidBaseMods","getAndroidModFileProviders","withIosBaseMods","getIosModFileProviders"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;AAaA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAQA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAcA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;;;AA1DA;AACA;AACA;AAUA;;AAOA;AACA;AACA;AAuCO,MAAMA,QAAQ,GAAG;AACtBC,EAAAA,qBAAqB,EAArBA,sCADsB;AAEtBC,EAAAA,QAAQ,EAARA,yBAFsB;AAGtBC,EAAAA,mBAAmB,EAAnBA,0CAHsB;AAItBC,EAAAA,0BAA0B,EAA1BA,iDAJsB;AAKtBC,EAAAA,eAAe,EAAfA,kCALsB;AAMtBC,EAAAA,sBAAsB,EAAtBA;AANsB,CAAjB","sourcesContent":["/**\n * For internal use in Expo CLI\n */\nimport * as AndroidConfig from './android';\nimport * as IOSConfig from './ios';\nimport { provider, withGeneratedBaseMods } from './plugins/createBaseMod';\nimport { getAndroidModFileProviders, withAndroidBaseMods } from './plugins/withAndroidBaseMods';\nimport { getIosModFileProviders, withIosBaseMods } from './plugins/withIosBaseMods';\nimport * as XML from './utils/XML';\nimport * as History from './utils/history';\nimport * as WarningAggregator from './utils/warnings';\n\n// TODO: Remove\nexport * as Updates from './utils/Updates';\n\nexport { IOSConfig, AndroidConfig };\n\nexport { WarningAggregator, History, XML };\n\n/**\n * These are the \"config-plugins\"\n */\n\nexport * from './Plugin.types';\n\nexport { withPlugins } from './plugins/withPlugins';\n\nexport { withRunOnce, createRunOncePlugin } from './plugins/withRunOnce';\n\nexport { withDangerousMod } from './plugins/withDangerousMod';\nexport { withMod, withBaseMod } from './plugins/withMod';\n\nexport {\n withAppDelegate,\n withInfoPlist,\n withEntitlementsPlist,\n withExpoPlist,\n withXcodeProject,\n} from './plugins/ios-plugins';\n\nexport {\n withAndroidManifest,\n withStringsXml,\n withAndroidColors,\n withAndroidColorsNight,\n withAndroidStyles,\n withMainActivity,\n withMainApplication,\n withProjectBuildGradle,\n withAppBuildGradle,\n withSettingsGradle,\n withGradleProperties,\n} from './plugins/android-plugins';\n\nexport { withStaticPlugin } from './plugins/withStaticPlugin';\n\nexport { compileModsAsync, withDefaultBaseMods, evalModsAsync } from './plugins/mod-compiler';\n\nexport { PluginError } from './utils/errors';\n\nexport const BaseMods = {\n withGeneratedBaseMods,\n provider,\n withAndroidBaseMods,\n getAndroidModFileProviders,\n withIosBaseMods,\n getIosModFileProviders,\n};\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../src/index.ts"],"names":["BaseMods","withGeneratedBaseMods","provider","withAndroidBaseMods","getAndroidModFileProviders","withIosBaseMods","getIosModFileProviders"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;AAaA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AASA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAcA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;;;AA3DA;AACA;AACA;AAUA;;AAOA;AACA;AACA;AAwCO,MAAMA,QAAQ,GAAG;AACtBC,EAAAA,qBAAqB,EAArBA,sCADsB;AAEtBC,EAAAA,QAAQ,EAARA,yBAFsB;AAGtBC,EAAAA,mBAAmB,EAAnBA,0CAHsB;AAItBC,EAAAA,0BAA0B,EAA1BA,iDAJsB;AAKtBC,EAAAA,eAAe,EAAfA,kCALsB;AAMtBC,EAAAA,sBAAsB,EAAtBA;AANsB,CAAjB","sourcesContent":["/**\n * For internal use in Expo CLI\n */\nimport * as AndroidConfig from './android';\nimport * as IOSConfig from './ios';\nimport { provider, withGeneratedBaseMods } from './plugins/createBaseMod';\nimport { getAndroidModFileProviders, withAndroidBaseMods } from './plugins/withAndroidBaseMods';\nimport { getIosModFileProviders, withIosBaseMods } from './plugins/withIosBaseMods';\nimport * as XML from './utils/XML';\nimport * as History from './utils/history';\nimport * as WarningAggregator from './utils/warnings';\n\n// TODO: Remove\nexport * as Updates from './utils/Updates';\n\nexport { IOSConfig, AndroidConfig };\n\nexport { WarningAggregator, History, XML };\n\n/**\n * These are the \"config-plugins\"\n */\n\nexport * from './Plugin.types';\n\nexport { withPlugins } from './plugins/withPlugins';\n\nexport { withRunOnce, createRunOncePlugin } from './plugins/withRunOnce';\n\nexport { withDangerousMod } from './plugins/withDangerousMod';\nexport { withMod, withBaseMod } from './plugins/withMod';\n\nexport {\n withAppDelegate,\n withInfoPlist,\n withEntitlementsPlist,\n withExpoPlist,\n withXcodeProject,\n withPodfileProperties,\n} from './plugins/ios-plugins';\n\nexport {\n withAndroidManifest,\n withStringsXml,\n withAndroidColors,\n withAndroidColorsNight,\n withAndroidStyles,\n withMainActivity,\n withMainApplication,\n withProjectBuildGradle,\n withAppBuildGradle,\n withSettingsGradle,\n withGradleProperties,\n} from './plugins/android-plugins';\n\nexport { withStaticPlugin } from './plugins/withStaticPlugin';\n\nexport { compileModsAsync, withDefaultBaseMods, evalModsAsync } from './plugins/mod-compiler';\n\nexport { PluginError } from './utils/errors';\n\nexport const BaseMods = {\n withGeneratedBaseMods,\n provider,\n withAndroidBaseMods,\n getAndroidModFileProviders,\n withIosBaseMods,\n getIosModFileProviders,\n};\n"],"file":"index.js"}
@@ -4,8 +4,8 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.getBitcode = getBitcode;
7
- exports.setBitcodeWithConfig = setBitcodeWithConfig;
8
7
  exports.setBitcode = setBitcode;
8
+ exports.setBitcodeWithConfig = setBitcodeWithConfig;
9
9
  exports.withCustomBitcode = exports.withBitcode = void 0;
10
10
 
11
11
  function _iosPlugins() {
@@ -3,10 +3,10 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.getSchemesFromXcodeproj = getSchemesFromXcodeproj;
7
- exports.getRunnableSchemesFromXcodeproj = getRunnableSchemesFromXcodeproj;
8
6
  exports.getApplicationTargetNameForSchemeAsync = getApplicationTargetNameForSchemeAsync;
9
7
  exports.getArchiveBuildConfigurationForSchemeAsync = getArchiveBuildConfigurationForSchemeAsync;
8
+ exports.getRunnableSchemesFromXcodeproj = getRunnableSchemesFromXcodeproj;
9
+ exports.getSchemesFromXcodeproj = getSchemesFromXcodeproj;
10
10
 
11
11
  function _XML() {
12
12
  const data = require("../utils/XML");
@@ -4,12 +4,12 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.getBundleIdentifier = getBundleIdentifier;
7
- exports.setBundleIdentifier = setBundleIdentifier;
8
7
  exports.getBundleIdentifierFromPbxproj = getBundleIdentifierFromPbxproj;
9
- exports.updateBundleIdentifierForPbxproj = updateBundleIdentifierForPbxproj;
10
- exports.setBundleIdentifierForPbxproj = setBundleIdentifierForPbxproj;
11
8
  exports.resetAllPlistBundleIdentifiers = resetAllPlistBundleIdentifiers;
12
9
  exports.resetPlistBundleIdentifier = resetPlistBundleIdentifier;
10
+ exports.setBundleIdentifier = setBundleIdentifier;
11
+ exports.setBundleIdentifierForPbxproj = setBundleIdentifierForPbxproj;
12
+ exports.updateBundleIdentifierForPbxproj = updateBundleIdentifierForPbxproj;
13
13
  exports.withBundleIdentifier = void 0;
14
14
 
15
15
  function _plist() {
@@ -92,6 +92,16 @@ function _Xcodeproj() {
92
92
  return data;
93
93
  }
94
94
 
95
+ function _string() {
96
+ const data = require("./utils/string");
97
+
98
+ _string = function () {
99
+ return data;
100
+ };
101
+
102
+ return data;
103
+ }
104
+
95
105
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
96
106
 
97
107
  const withBundleIdentifier = (config, {
@@ -179,7 +189,7 @@ function getProductBundleIdentifierFromBuildConfiguration(xcBuildConfiguration)
179
189
  const bundleIdentifierRaw = xcBuildConfiguration.buildSettings.PRODUCT_BUNDLE_IDENTIFIER;
180
190
 
181
191
  if (bundleIdentifierRaw) {
182
- const bundleIdentifier = bundleIdentifierRaw[0] === '"' ? bundleIdentifierRaw.slice(1, -1) : bundleIdentifierRaw; // it's possible to use interpolation for the bundle identifier
192
+ const bundleIdentifier = (0, _string().trimQuotes)(bundleIdentifierRaw); // it's possible to use interpolation for the bundle identifier
183
193
  // the most common case is when the last part of the id is set to `$(PRODUCT_NAME:rfc1034identifier)`
184
194
  // in this case, PRODUCT_NAME should be replaced with its value
185
195
  // the `rfc1034identifier` modifier replaces all non-alphanumeric characters with dashes
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/ios/BundleIdentifier.ts"],"names":["withBundleIdentifier","config","bundleIdentifier","bundleId","ios","setBundleIdentifierForPbxproj","modRequest","projectRoot","getBundleIdentifier","setBundleIdentifier","infoPlist","CFBundleIdentifier","getBundleIdentifierFromPbxproj","targetName","buildConfiguration","pbxprojPath","project","xcode","parseSync","xcBuildConfiguration","getProductBundleIdentifierFromBuildConfiguration","bundleIdentifierRaw","buildSettings","PRODUCT_BUNDLE_IDENTIFIER","slice","bundleIdentifierParts","split","length","PRODUCT_NAME","replace","join","updateBundleIdentifierForPbxproj","updateProductName","nativeTarget","buildConfigurationList","forEach","item","productName","pop","includes","fs","writeFileSync","writeSync","pbxprojPaths","defaultBundleId","resetAllPlistBundleIdentifiers","infoPlistPaths","plistPath","resetPlistBundleIdentifier","rawPlist","readFileSync","plistObject","plist","parse","format","pretty","indent","xml","build"],"mappings":";;;;;;;;;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAGA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;AAEO,MAAMA,oBAAiE,GAAG,CAC/EC,MAD+E,EAE/E;AAAEC,EAAAA;AAAF,CAF+E,KAG5E;AACH,SAAO,0CAAiBD,MAAjB,EAAyB,C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AAED,SAASC,0BAAT,CAAoCD,SAApC,EAA6D;AAC3D,QAAME,QAAQ,GAAGT,mBAAGU,YAAH,CAAgBH,SAAhB,EAA2B,MAA3B,CAAjB;;AACA,QAAMI,WAAW,GAAGC,iBAAMC,KAAN,CAAYJ,QAAZ,CAApB;;AAEA,MAAIE,WAAW,CAACxC,kBAAhB,EAAoC;AAClC,QAAIwC,WAAW,CAACxC,kBAAZ,KAAmCiC,eAAvC,EAAwD,OADtB,CAGlC;;AACA,UAAMU,MAAM,GAAG;AAAEC,MAAAA,MAAM,EAAE,IAAV;AAAgBC,MAAAA,MAAM,EAAG;AAAzB,KAAf;;AAEA,UAAMC,GAAG,GAAGL,iBAAMM,KAAN,CACV,EACE,GAAGP,WADL;AAEExC,MAAAA,kBAAkB,EAAEiC;AAFtB,KADU,EAKVU,MALU,CAAZ;;AAQA,QAAIG,GAAG,KAAKR,QAAZ,EAAsB;AACpBT,yBAAGC,aAAH,CAAiBM,SAAjB,EAA4BU,GAA5B;AACD;AACF;AACF","sourcesContent":["import { ExpoConfig } from '@expo/config-types';\nimport plist, { PlistObject } from '@expo/plist';\nimport assert from 'assert';\nimport fs from 'fs-extra';\nimport xcode, { XCBuildConfiguration } from 'xcode';\n\nimport { ConfigPlugin } from '../Plugin.types';\nimport { withDangerousMod } from '../plugins/withDangerousMod';\nimport { InfoPlist } from './IosConfig.types';\nimport { getAllInfoPlistPaths, getAllPBXProjectPaths, getPBXProjectPath } from './Paths';\nimport { findFirstNativeTarget, getXCBuildConfigurationFromPbxproj } from './Target';\nimport { ConfigurationSectionEntry, getBuildConfigurationsForListId } from './utils/Xcodeproj';\n\nexport const withBundleIdentifier: ConfigPlugin<{ bundleIdentifier?: string }> = (\n config,\n { bundleIdentifier }\n) => {\n return withDangerousMod(config, [\n 'ios',\n async config => {\n const bundleId = bundleIdentifier ?? config.ios?.bundleIdentifier;\n assert(\n bundleId,\n '`bundleIdentifier` must be defined in the app config (`expo.ios.bundleIdentifier`) or passed to the plugin `withBundleIdentifier`.'\n );\n await setBundleIdentifierForPbxproj(config.modRequest.projectRoot, bundleId!);\n return config;\n },\n ]);\n};\n\nfunction getBundleIdentifier(config: Pick<ExpoConfig, 'ios'>): string | null {\n return config.ios?.bundleIdentifier ?? null;\n}\n\n/**\n * In Turtle v1 we set the bundleIdentifier directly on Info.plist rather\n * than in pbxproj\n */\nfunction setBundleIdentifier(config: ExpoConfig, infoPlist: InfoPlist): InfoPlist {\n const bundleIdentifier = getBundleIdentifier(config);\n\n if (!bundleIdentifier) {\n return infoPlist;\n }\n\n return {\n ...infoPlist,\n CFBundleIdentifier: bundleIdentifier,\n };\n}\n\n/**\n * Gets the bundle identifier defined in the Xcode project found in the project directory.\n *\n * A bundle identifier is stored as a value in XCBuildConfiguration entry.\n * Those entries exist for every pair (build target, build configuration).\n * Unless target name is passed, the first target defined in the pbxproj is used\n * (to keep compatibility with the inaccurate legacy implementation of this function).\n * The build configuration is usually 'Release' or 'Debug'. However, it could be any arbitrary string.\n * Defaults to 'Release'.\n *\n * @param {string} projectRoot Path to project root containing the ios directory\n * @param {string} targetName Target name\n * @param {string} buildConfiguration Build configuration. Defaults to 'Release'.\n * @returns {string | null} bundle identifier of the Xcode project or null if the project is not configured\n */\nfunction getBundleIdentifierFromPbxproj(\n projectRoot: string,\n {\n targetName,\n buildConfiguration = 'Release',\n }: { targetName?: string; buildConfiguration?: string } = {}\n): string | null {\n let pbxprojPath: string;\n try {\n pbxprojPath = getPBXProjectPath(projectRoot);\n } catch {\n return null;\n }\n const project = xcode.project(pbxprojPath);\n project.parseSync();\n\n const xcBuildConfiguration = getXCBuildConfigurationFromPbxproj(project, {\n targetName,\n buildConfiguration,\n });\n if (!xcBuildConfiguration) {\n return null;\n }\n return getProductBundleIdentifierFromBuildConfiguration(xcBuildConfiguration);\n}\n\nfunction getProductBundleIdentifierFromBuildConfiguration(\n xcBuildConfiguration: XCBuildConfiguration\n): string | null {\n const bundleIdentifierRaw = xcBuildConfiguration.buildSettings.PRODUCT_BUNDLE_IDENTIFIER;\n if (bundleIdentifierRaw) {\n const bundleIdentifier =\n bundleIdentifierRaw[0] === '\"' ? bundleIdentifierRaw.slice(1, -1) : bundleIdentifierRaw;\n // it's possible to use interpolation for the bundle identifier\n // the most common case is when the last part of the id is set to `$(PRODUCT_NAME:rfc1034identifier)`\n // in this case, PRODUCT_NAME should be replaced with its value\n // the `rfc1034identifier` modifier replaces all non-alphanumeric characters with dashes\n const bundleIdentifierParts = bundleIdentifier.split('.');\n if (\n bundleIdentifierParts[bundleIdentifierParts.length - 1] ===\n '$(PRODUCT_NAME:rfc1034identifier)' &&\n xcBuildConfiguration.buildSettings.PRODUCT_NAME\n ) {\n bundleIdentifierParts[\n bundleIdentifierParts.length - 1\n ] = xcBuildConfiguration.buildSettings.PRODUCT_NAME.replace(/[^a-zA-Z0-9]/g, '-');\n }\n return bundleIdentifierParts.join('.');\n } else {\n return null;\n }\n}\n\n/**\n * Updates the bundle identifier for a given pbxproj\n *\n * @param {string} pbxprojPath Path to pbxproj file\n * @param {string} bundleIdentifier Bundle identifier to set in the pbxproj\n * @param {boolean} [updateProductName=true] Whether to update PRODUCT_NAME\n */\nfunction updateBundleIdentifierForPbxproj(\n pbxprojPath: string,\n bundleIdentifier: string,\n updateProductName: boolean = true\n): void {\n const project = xcode.project(pbxprojPath);\n project.parseSync();\n\n const [, nativeTarget] = findFirstNativeTarget(project);\n\n getBuildConfigurationsForListId(project, nativeTarget.buildConfigurationList).forEach(\n ([, item]: ConfigurationSectionEntry) => {\n if (item.buildSettings.PRODUCT_BUNDLE_IDENTIFIER === bundleIdentifier) {\n return;\n }\n\n item.buildSettings.PRODUCT_BUNDLE_IDENTIFIER = `\"${bundleIdentifier}\"`;\n\n if (updateProductName) {\n const productName = bundleIdentifier.split('.').pop();\n if (!productName?.includes('$')) {\n item.buildSettings.PRODUCT_NAME = productName;\n }\n }\n }\n );\n fs.writeFileSync(pbxprojPath, project.writeSync());\n}\n\n/**\n * Updates the bundle identifier for pbx projects inside the ios directory of the given project root\n *\n * @param {string} projectRoot Path to project root containing the ios directory\n * @param {string} bundleIdentifier Desired bundle identifier\n * @param {boolean} [updateProductName=true] Whether to update PRODUCT_NAME\n */\nfunction setBundleIdentifierForPbxproj(\n projectRoot: string,\n bundleIdentifier: string,\n updateProductName: boolean = true\n): void {\n // Get all pbx projects in the ${projectRoot}/ios directory\n let pbxprojPaths: string[] = [];\n try {\n pbxprojPaths = getAllPBXProjectPaths(projectRoot);\n } catch {}\n\n for (const pbxprojPath of pbxprojPaths) {\n updateBundleIdentifierForPbxproj(pbxprojPath, bundleIdentifier, updateProductName);\n }\n}\n\n/**\n * Reset bundle identifier field in Info.plist to use PRODUCT_BUNDLE_IDENTIFIER, as recommended by Apple.\n */\n\nconst defaultBundleId = '$(PRODUCT_BUNDLE_IDENTIFIER)';\n\nfunction resetAllPlistBundleIdentifiers(projectRoot: string): void {\n const infoPlistPaths = getAllInfoPlistPaths(projectRoot);\n\n for (const plistPath of infoPlistPaths) {\n resetPlistBundleIdentifier(plistPath);\n }\n}\n\nfunction resetPlistBundleIdentifier(plistPath: string): void {\n const rawPlist = fs.readFileSync(plistPath, 'utf8');\n const plistObject = plist.parse(rawPlist) as PlistObject;\n\n if (plistObject.CFBundleIdentifier) {\n if (plistObject.CFBundleIdentifier === defaultBundleId) return;\n\n // attempt to match default Info.plist format\n const format = { pretty: true, indent: `\\t` };\n\n const xml = plist.build(\n {\n ...plistObject,\n CFBundleIdentifier: defaultBundleId,\n },\n format\n );\n\n if (xml !== rawPlist) {\n fs.writeFileSync(plistPath, xml);\n }\n }\n}\n\nexport {\n getBundleIdentifier,\n setBundleIdentifier,\n getBundleIdentifierFromPbxproj,\n updateBundleIdentifierForPbxproj,\n setBundleIdentifierForPbxproj,\n resetAllPlistBundleIdentifiers,\n resetPlistBundleIdentifier,\n};\n"],"file":"BundleIdentifier.js"}
1
+ {"version":3,"sources":["../../src/ios/BundleIdentifier.ts"],"names":["withBundleIdentifier","config","bundleIdentifier","bundleId","ios","setBundleIdentifierForPbxproj","modRequest","projectRoot","getBundleIdentifier","setBundleIdentifier","infoPlist","CFBundleIdentifier","getBundleIdentifierFromPbxproj","targetName","buildConfiguration","pbxprojPath","project","xcode","parseSync","xcBuildConfiguration","getProductBundleIdentifierFromBuildConfiguration","bundleIdentifierRaw","buildSettings","PRODUCT_BUNDLE_IDENTIFIER","bundleIdentifierParts","split","length","PRODUCT_NAME","replace","join","updateBundleIdentifierForPbxproj","updateProductName","nativeTarget","buildConfigurationList","forEach","item","productName","pop","includes","fs","writeFileSync","writeSync","pbxprojPaths","defaultBundleId","resetAllPlistBundleIdentifiers","infoPlistPaths","plistPath","resetPlistBundleIdentifier","rawPlist","readFileSync","plistObject","plist","parse","format","pretty","indent","xml","build"],"mappings":";;;;;;;;;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAGA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;AAEO,MAAMA,oBAAiE,GAAG,CAC/EC,MAD+E,EAE/E;AAAEC,EAAAA;AAAF,CAF+E,KAG5E;AACH,SAAO,0CAAiBD,MAAjB,EAAyB,CAC9B,KAD8B,EAE9B,MAAMA,MAAN,IAAgB;AAAA;;AACd,UAAME,QAAQ,GAAGD,gBAAH,aAAGA,gBAAH,cAAGA,gBAAH,kBAAuBD,MAAM,CAACG,GAA9B,gDAAuB,YAAYF,gBAAjD;AACA,2BACEC,QADF,EAEE,oIAFF;AAIA,UAAME,6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GAAG;AAAEC,MAAAA,MAAM,EAAE,IAAV;AAAgBC,MAAAA,MAAM,EAAG;AAAzB,KAAf;;AAEA,UAAMC,GAAG,GAAGL,iBAAMM,KAAN,CACV,EACE,GAAGP,WADL;AAEEvC,MAAAA,kBAAkB,EAAEgC;AAFtB,KADU,EAKVU,MALU,CAAZ;;AAQA,QAAIG,GAAG,KAAKR,QAAZ,EAAsB;AACpBT,yBAAGC,aAAH,CAAiBM,SAAjB,EAA4BU,GAA5B;AACD;AACF;AACF","sourcesContent":["import { ExpoConfig } from '@expo/config-types';\nimport plist, { PlistObject } from '@expo/plist';\nimport assert from 'assert';\nimport fs from 'fs-extra';\nimport xcode, { XCBuildConfiguration } from 'xcode';\n\nimport { ConfigPlugin } from '../Plugin.types';\nimport { withDangerousMod } from '../plugins/withDangerousMod';\nimport { InfoPlist } from './IosConfig.types';\nimport { getAllInfoPlistPaths, getAllPBXProjectPaths, getPBXProjectPath } from './Paths';\nimport { findFirstNativeTarget, getXCBuildConfigurationFromPbxproj } from './Target';\nimport { ConfigurationSectionEntry, getBuildConfigurationsForListId } from './utils/Xcodeproj';\nimport { trimQuotes } from './utils/string';\n\nexport const withBundleIdentifier: ConfigPlugin<{ bundleIdentifier?: string }> = (\n config,\n { bundleIdentifier }\n) => {\n return withDangerousMod(config, [\n 'ios',\n async config => {\n const bundleId = bundleIdentifier ?? config.ios?.bundleIdentifier;\n assert(\n bundleId,\n '`bundleIdentifier` must be defined in the app config (`expo.ios.bundleIdentifier`) or passed to the plugin `withBundleIdentifier`.'\n );\n await setBundleIdentifierForPbxproj(config.modRequest.projectRoot, bundleId!);\n return config;\n },\n ]);\n};\n\nfunction getBundleIdentifier(config: Pick<ExpoConfig, 'ios'>): string | null {\n return config.ios?.bundleIdentifier ?? null;\n}\n\n/**\n * In Turtle v1 we set the bundleIdentifier directly on Info.plist rather\n * than in pbxproj\n */\nfunction setBundleIdentifier(config: ExpoConfig, infoPlist: InfoPlist): InfoPlist {\n const bundleIdentifier = getBundleIdentifier(config);\n\n if (!bundleIdentifier) {\n return infoPlist;\n }\n\n return {\n ...infoPlist,\n CFBundleIdentifier: bundleIdentifier,\n };\n}\n\n/**\n * Gets the bundle identifier defined in the Xcode project found in the project directory.\n *\n * A bundle identifier is stored as a value in XCBuildConfiguration entry.\n * Those entries exist for every pair (build target, build configuration).\n * Unless target name is passed, the first target defined in the pbxproj is used\n * (to keep compatibility with the inaccurate legacy implementation of this function).\n * The build configuration is usually 'Release' or 'Debug'. However, it could be any arbitrary string.\n * Defaults to 'Release'.\n *\n * @param {string} projectRoot Path to project root containing the ios directory\n * @param {string} targetName Target name\n * @param {string} buildConfiguration Build configuration. Defaults to 'Release'.\n * @returns {string | null} bundle identifier of the Xcode project or null if the project is not configured\n */\nfunction getBundleIdentifierFromPbxproj(\n projectRoot: string,\n {\n targetName,\n buildConfiguration = 'Release',\n }: { targetName?: string; buildConfiguration?: string } = {}\n): string | null {\n let pbxprojPath: string;\n try {\n pbxprojPath = getPBXProjectPath(projectRoot);\n } catch {\n return null;\n }\n const project = xcode.project(pbxprojPath);\n project.parseSync();\n\n const xcBuildConfiguration = getXCBuildConfigurationFromPbxproj(project, {\n targetName,\n buildConfiguration,\n });\n if (!xcBuildConfiguration) {\n return null;\n }\n return getProductBundleIdentifierFromBuildConfiguration(xcBuildConfiguration);\n}\n\nfunction getProductBundleIdentifierFromBuildConfiguration(\n xcBuildConfiguration: XCBuildConfiguration\n): string | null {\n const bundleIdentifierRaw = xcBuildConfiguration.buildSettings.PRODUCT_BUNDLE_IDENTIFIER;\n if (bundleIdentifierRaw) {\n const bundleIdentifier = trimQuotes(bundleIdentifierRaw);\n // it's possible to use interpolation for the bundle identifier\n // the most common case is when the last part of the id is set to `$(PRODUCT_NAME:rfc1034identifier)`\n // in this case, PRODUCT_NAME should be replaced with its value\n // the `rfc1034identifier` modifier replaces all non-alphanumeric characters with dashes\n const bundleIdentifierParts = bundleIdentifier.split('.');\n if (\n bundleIdentifierParts[bundleIdentifierParts.length - 1] ===\n '$(PRODUCT_NAME:rfc1034identifier)' &&\n xcBuildConfiguration.buildSettings.PRODUCT_NAME\n ) {\n bundleIdentifierParts[\n bundleIdentifierParts.length - 1\n ] = xcBuildConfiguration.buildSettings.PRODUCT_NAME.replace(/[^a-zA-Z0-9]/g, '-');\n }\n return bundleIdentifierParts.join('.');\n } else {\n return null;\n }\n}\n\n/**\n * Updates the bundle identifier for a given pbxproj\n *\n * @param {string} pbxprojPath Path to pbxproj file\n * @param {string} bundleIdentifier Bundle identifier to set in the pbxproj\n * @param {boolean} [updateProductName=true] Whether to update PRODUCT_NAME\n */\nfunction updateBundleIdentifierForPbxproj(\n pbxprojPath: string,\n bundleIdentifier: string,\n updateProductName: boolean = true\n): void {\n const project = xcode.project(pbxprojPath);\n project.parseSync();\n\n const [, nativeTarget] = findFirstNativeTarget(project);\n\n getBuildConfigurationsForListId(project, nativeTarget.buildConfigurationList).forEach(\n ([, item]: ConfigurationSectionEntry) => {\n if (item.buildSettings.PRODUCT_BUNDLE_IDENTIFIER === bundleIdentifier) {\n return;\n }\n\n item.buildSettings.PRODUCT_BUNDLE_IDENTIFIER = `\"${bundleIdentifier}\"`;\n\n if (updateProductName) {\n const productName = bundleIdentifier.split('.').pop();\n if (!productName?.includes('$')) {\n item.buildSettings.PRODUCT_NAME = productName;\n }\n }\n }\n );\n fs.writeFileSync(pbxprojPath, project.writeSync());\n}\n\n/**\n * Updates the bundle identifier for pbx projects inside the ios directory of the given project root\n *\n * @param {string} projectRoot Path to project root containing the ios directory\n * @param {string} bundleIdentifier Desired bundle identifier\n * @param {boolean} [updateProductName=true] Whether to update PRODUCT_NAME\n */\nfunction setBundleIdentifierForPbxproj(\n projectRoot: string,\n bundleIdentifier: string,\n updateProductName: boolean = true\n): void {\n // Get all pbx projects in the ${projectRoot}/ios directory\n let pbxprojPaths: string[] = [];\n try {\n pbxprojPaths = getAllPBXProjectPaths(projectRoot);\n } catch {}\n\n for (const pbxprojPath of pbxprojPaths) {\n updateBundleIdentifierForPbxproj(pbxprojPath, bundleIdentifier, updateProductName);\n }\n}\n\n/**\n * Reset bundle identifier field in Info.plist to use PRODUCT_BUNDLE_IDENTIFIER, as recommended by Apple.\n */\n\nconst defaultBundleId = '$(PRODUCT_BUNDLE_IDENTIFIER)';\n\nfunction resetAllPlistBundleIdentifiers(projectRoot: string): void {\n const infoPlistPaths = getAllInfoPlistPaths(projectRoot);\n\n for (const plistPath of infoPlistPaths) {\n resetPlistBundleIdentifier(plistPath);\n }\n}\n\nfunction resetPlistBundleIdentifier(plistPath: string): void {\n const rawPlist = fs.readFileSync(plistPath, 'utf8');\n const plistObject = plist.parse(rawPlist) as PlistObject;\n\n if (plistObject.CFBundleIdentifier) {\n if (plistObject.CFBundleIdentifier === defaultBundleId) return;\n\n // attempt to match default Info.plist format\n const format = { pretty: true, indent: `\\t` };\n\n const xml = plist.build(\n {\n ...plistObject,\n CFBundleIdentifier: defaultBundleId,\n },\n format\n );\n\n if (xml !== rawPlist) {\n fs.writeFileSync(plistPath, xml);\n }\n }\n}\n\nexport {\n getBundleIdentifier,\n setBundleIdentifier,\n getBundleIdentifierFromPbxproj,\n updateBundleIdentifierForPbxproj,\n setBundleIdentifierForPbxproj,\n resetAllPlistBundleIdentifiers,\n resetPlistBundleIdentifier,\n};\n"],"file":"BundleIdentifier.js"}
@@ -3,10 +3,10 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.getSupportsTablet = getSupportsTablet;
7
- exports.getIsTabletOnly = getIsTabletOnly;
8
- exports.getDeviceFamilies = getDeviceFamilies;
9
6
  exports.formatDeviceFamilies = formatDeviceFamilies;
7
+ exports.getDeviceFamilies = getDeviceFamilies;
8
+ exports.getIsTabletOnly = getIsTabletOnly;
9
+ exports.getSupportsTablet = getSupportsTablet;
10
10
  exports.setDeviceFamily = setDeviceFamily;
11
11
  exports.withDeviceFamily = void 0;
12
12
 
@@ -3,8 +3,8 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.setAssociatedDomains = setAssociatedDomains;
7
6
  exports.getEntitlementsPath = getEntitlementsPath;
7
+ exports.setAssociatedDomains = setAssociatedDomains;
8
8
  exports.withAssociatedDomains = void 0;
9
9
 
10
10
  function _fsExtra() {
@@ -137,7 +137,7 @@ function getEntitlementsPath(projectRoot) {
137
137
  buildSettings
138
138
  }
139
139
  }) => {
140
- buildSettings.CODE_SIGN_ENTITLEMENTS = entitlementsRelativePath;
140
+ buildSettings.CODE_SIGN_ENTITLEMENTS = `"${entitlementsRelativePath}"`;
141
141
  });
142
142
 
143
143
  _fsExtra().default.writeFileSync(project.filepath, project.writeSync());
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/ios/Entitlements.ts"],"names":["withAssociatedDomains","setAssociatedDomains","config","_","entitlementsPlist","ios","associatedDomains","getEntitlementsPath","projectRoot","paths","Paths","getAllEntitlementsPaths","targetPath","project","projectName","productName","entitlementsRelativePath","path","join","entitlementsPath","normalize","pathsToDelete","length","last","pop","push","template","ENTITLEMENTS_TEMPLATE","fs","readFileSync","ensureDirSync","dirname","writeFileSync","Object","entries","pbxXCBuildConfigurationSection","filter","isNotComment","isBuildConfig","isNotTestHost","forEach","buildSettings","CODE_SIGN_ENTITLEMENTS","filepath","writeSync","deleteEntitlementsFiles","entitlementsPaths","removeSync"],"mappings":";;;;;;;;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;;;;;AASO,MAAMA,qBAAqB,GAAG,4CACnCC,oBADmC,EAEnC,uBAFmC,CAA9B;;;AAKA,SAASA,oBAAT,CACLC,MADK,EA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qBAAf,CAJe,CAMf;;AACA,QAAIN,aAAa,CAACC,MAAlB,EAA0B;AACxB;AACA,YAAMC,IAAI,GAAGF,aAAa,CAACA,aAAa,CAACC,MAAd,GAAuB,CAAxB,CAA1B;AACAI,MAAAA,QAAQ,GAAGE,mBAAGC,YAAH,CAAgBN,IAAhB,EAAsB,MAAtB,CAAX;AACD;;AAEDK,uBAAGE,aAAH,CAAiBb,gBAAKc,OAAL,CAAaZ,gBAAb,CAAjB;;AACAS,uBAAGI,aAAH,CAAiBb,gBAAjB,EAAmCO,QAAnC;;AAEAO,IAAAA,MAAM,CAACC,OAAP,CAAerB,OAAO,CAACsB,8BAAR,EAAf,EACGC,MADH,CACUC,yBADV,EAEGD,MAFH,CAEUE,0BAFV,EAGGF,MAHH,CAGUG,0BAHV,EAIGC,OAJH,CAIW,CAAC;AAAE,SAAG;AAAEC,QAAAA;AAAF;AAAL,KAAD,KAAmC;AAC1CA,MAAAA,aAAa,CAACC,sBAAd,GAAuC1B,wBAAvC;AACD,KANH;;AAOAY,uBAAGI,aAAH,CAAiBnB,OAAO,CAAC8B,QAAzB,EAAmC9B,OAAO,CAAC+B,SAAR,EAAnC;AACD,GArD8D,CAuD/D;;;AACAC,EAAAA,uBAAuB,CAACxB,aAAD,CAAvB;AAEA,SAAOF,gBAAP;AACD;;AAED,SAAS0B,uBAAT,CAAiCC,iBAAjC,EAA8D;AAC5D,OAAK,MAAM7B,IAAX,IAAmB6B,iBAAnB,EAAsC;AACpClB,uBAAGmB,UAAH,CAAc9B,IAAd;AACD;AACF;;AAED,MAAMU,qBAAqB,GAAI;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA,CAPA","sourcesContent":["import { ExpoConfig } from '@expo/config-types';\nimport { JSONObject } from '@expo/json-file';\nimport fs from 'fs-extra';\nimport path from 'path';\nimport slash from 'slash';\n\nimport { createEntitlementsPlugin } from '../plugins/ios-plugins';\nimport * as Paths from './Paths';\nimport {\n getPbxproj,\n getProductName,\n getProjectName,\n isBuildConfig,\n isNotComment,\n isNotTestHost,\n} from './utils/Xcodeproj';\n\nexport const withAssociatedDomains = createEntitlementsPlugin(\n setAssociatedDomains,\n 'withAssociatedDomains'\n);\n\nexport function setAssociatedDomains(\n config: ExpoConfig,\n { 'com.apple.developer.associated-domains': _, ...entitlementsPlist }: JSONObject\n): JSONObject {\n if (config.ios?.associatedDomains) {\n return {\n ...entitlementsPlist,\n 'com.apple.developer.associated-domains': config.ios.associatedDomains,\n };\n }\n\n return entitlementsPlist;\n}\n\nexport function getEntitlementsPath(projectRoot: string): string {\n const paths = Paths.getAllEntitlementsPaths(projectRoot);\n let targetPath: string | null = null;\n\n /**\n * Add file to pbxproj under CODE_SIGN_ENTITLEMENTS\n */\n const project = getPbxproj(projectRoot);\n const projectName = getProjectName(projectRoot);\n const productName = getProductName(project);\n\n // Use posix formatted path, even on Windows\n const entitlementsRelativePath = slash(path.join(projectName, `${productName}.entitlements`));\n const entitlementsPath = slash(\n path.normalize(path.join(projectRoot, 'ios', entitlementsRelativePath))\n );\n\n const pathsToDelete: string[] = [];\n\n while (paths.length) {\n const last = slash(path.normalize(paths.pop()!));\n if (last !== entitlementsPath) {\n pathsToDelete.push(last);\n } else {\n targetPath = last;\n }\n }\n\n // Create a new entitlements file\n if (!targetPath) {\n targetPath = entitlementsPath;\n\n // Use the default template\n let template = ENTITLEMENTS_TEMPLATE;\n\n // If an old entitlements file exists, copy it's contents into the new file.\n if (pathsToDelete.length) {\n // Get the last entitlements file and use it as the template\n const last = pathsToDelete[pathsToDelete.length - 1]!;\n template = fs.readFileSync(last, 'utf8');\n }\n\n fs.ensureDirSync(path.dirname(entitlementsPath));\n fs.writeFileSync(entitlementsPath, template);\n\n Object.entries(project.pbxXCBuildConfigurationSection())\n .filter(isNotComment)\n .filter(isBuildConfig)\n .filter(isNotTestHost)\n .forEach(({ 1: { buildSettings } }: any) => {\n buildSettings.CODE_SIGN_ENTITLEMENTS = entitlementsRelativePath;\n });\n fs.writeFileSync(project.filepath, project.writeSync());\n }\n\n // Clean up others\n deleteEntitlementsFiles(pathsToDelete);\n\n return entitlementsPath;\n}\n\nfunction deleteEntitlementsFiles(entitlementsPaths: string[]) {\n for (const path of entitlementsPaths) {\n fs.removeSync(path);\n }\n}\n\nconst ENTITLEMENTS_TEMPLATE = `\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n</dict>\n</plist>\n`;\n"],"file":"Entitlements.js"}
1
+ {"version":3,"sources":["../../src/ios/Entitlements.ts"],"names":["withAssociatedDomains","setAssociatedDomains","config","_","entitlementsPlist","ios","associatedDomains","getEntitlementsPath","projectRoot","paths","Paths","getAllEntitlementsPaths","targetPath","project","projectName","productName","entitlementsRelativePath","path","join","entitlementsPath","normalize","pathsToDelete","length","last","pop","push","template","ENTITLEMENTS_TEMPLATE","fs","readFileSync","ensureDirSync","dirname","writeFileSync","Object","entries","pbxXCBuildConfigurationSection","filter","isNotComment","isBuildConfig","isNotTestHost","forEach","buildSettings","CODE_SIGN_ENTITLEMENTS","filepath","writeSync","deleteEntitlementsFiles","entitlementsPaths","removeSync"],"mappings":";;;;;;;;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;;;;;AASO,MAAMA,qBAAqB,GAAG,4CACnCC,oBADmC,EAEnC,uBAFmC,CAA9B;;;AAKA,SAASA,oBAAT,CACLC,MADK,EAEL;AAAE,4CAA0CC,CAA5C;AAA+C,KAAGC;AAAlD,CAFK,EAGO;A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xB;AACA,YAAMC,IAAI,GAAGF,aAAa,CAACA,aAAa,CAACC,MAAd,GAAuB,CAAxB,CAA1B;AACAI,MAAAA,QAAQ,GAAGE,mBAAGC,YAAH,CAAgBN,IAAhB,EAAsB,MAAtB,CAAX;AACD;;AAEDK,uBAAGE,aAAH,CAAiBb,gBAAKc,OAAL,CAAaZ,gBAAb,CAAjB;;AACAS,uBAAGI,aAAH,CAAiBb,gBAAjB,EAAmCO,QAAnC;;AAEAO,IAAAA,MAAM,CAACC,OAAP,CAAerB,OAAO,CAACsB,8BAAR,EAAf,EACGC,MADH,CACUC,yBADV,EAEGD,MAFH,CAEUE,0BAFV,EAGGF,MAHH,CAGUG,0BAHV,EAIGC,OAJH,CAIW,CAAC;AAAE,SAAG;AAAEC,QAAAA;AAAF;AAAL,KAAD,KAAmC;AAC1CA,MAAAA,aAAa,CAACC,sBAAd,GAAwC,IAAG1B,wBAAyB,GAApE;AACD,KANH;;AAOAY,uBAAGI,aAAH,CAAiBnB,OAAO,CAAC8B,QAAzB,EAAmC9B,OAAO,CAAC+B,SAAR,EAAnC;AACD,GArD8D,CAuD/D;;;AACAC,EAAAA,uBAAuB,CAACxB,aAAD,CAAvB;AAEA,SAAOF,gBAAP;AACD;;AAED,SAAS0B,uBAAT,CAAiCC,iBAAjC,EAA8D;AAC5D,OAAK,MAAM7B,IAAX,IAAmB6B,iBAAnB,EAAsC;AACpClB,uBAAGmB,UAAH,CAAc9B,IAAd;AACD;AACF;;AAED,MAAMU,qBAAqB,GAAI;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA,CAPA","sourcesContent":["import { ExpoConfig } from '@expo/config-types';\nimport { JSONObject } from '@expo/json-file';\nimport fs from 'fs-extra';\nimport path from 'path';\nimport slash from 'slash';\n\nimport { createEntitlementsPlugin } from '../plugins/ios-plugins';\nimport * as Paths from './Paths';\nimport {\n getPbxproj,\n getProductName,\n getProjectName,\n isBuildConfig,\n isNotComment,\n isNotTestHost,\n} from './utils/Xcodeproj';\n\nexport const withAssociatedDomains = createEntitlementsPlugin(\n setAssociatedDomains,\n 'withAssociatedDomains'\n);\n\nexport function setAssociatedDomains(\n config: ExpoConfig,\n { 'com.apple.developer.associated-domains': _, ...entitlementsPlist }: JSONObject\n): JSONObject {\n if (config.ios?.associatedDomains) {\n return {\n ...entitlementsPlist,\n 'com.apple.developer.associated-domains': config.ios.associatedDomains,\n };\n }\n\n return entitlementsPlist;\n}\n\nexport function getEntitlementsPath(projectRoot: string): string {\n const paths = Paths.getAllEntitlementsPaths(projectRoot);\n let targetPath: string | null = null;\n\n /**\n * Add file to pbxproj under CODE_SIGN_ENTITLEMENTS\n */\n const project = getPbxproj(projectRoot);\n const projectName = getProjectName(projectRoot);\n const productName = getProductName(project);\n\n // Use posix formatted path, even on Windows\n const entitlementsRelativePath = slash(path.join(projectName, `${productName}.entitlements`));\n const entitlementsPath = slash(\n path.normalize(path.join(projectRoot, 'ios', entitlementsRelativePath))\n );\n\n const pathsToDelete: string[] = [];\n\n while (paths.length) {\n const last = slash(path.normalize(paths.pop()!));\n if (last !== entitlementsPath) {\n pathsToDelete.push(last);\n } else {\n targetPath = last;\n }\n }\n\n // Create a new entitlements file\n if (!targetPath) {\n targetPath = entitlementsPath;\n\n // Use the default template\n let template = ENTITLEMENTS_TEMPLATE;\n\n // If an old entitlements file exists, copy it's contents into the new file.\n if (pathsToDelete.length) {\n // Get the last entitlements file and use it as the template\n const last = pathsToDelete[pathsToDelete.length - 1]!;\n template = fs.readFileSync(last, 'utf8');\n }\n\n fs.ensureDirSync(path.dirname(entitlementsPath));\n fs.writeFileSync(entitlementsPath, template);\n\n Object.entries(project.pbxXCBuildConfigurationSection())\n .filter(isNotComment)\n .filter(isBuildConfig)\n .filter(isNotTestHost)\n .forEach(({ 1: { buildSettings } }: any) => {\n buildSettings.CODE_SIGN_ENTITLEMENTS = `\"${entitlementsRelativePath}\"`;\n });\n fs.writeFileSync(project.filepath, project.writeSync());\n }\n\n // Clean up others\n deleteEntitlementsFiles(pathsToDelete);\n\n return entitlementsPath;\n}\n\nfunction deleteEntitlementsFiles(entitlementsPaths: string[]) {\n for (const path of entitlementsPaths) {\n fs.removeSync(path);\n }\n}\n\nconst ENTITLEMENTS_TEMPLATE = `\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n</dict>\n</plist>\n`;\n"],"file":"Entitlements.js"}
@@ -3,11 +3,11 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.getGoogleSignInReservedClientId = getGoogleSignInReservedClientId;
7
6
  exports.getGoogleServicesFile = getGoogleServicesFile;
8
- exports.setGoogleSignInReservedClientId = setGoogleSignInReservedClientId;
7
+ exports.getGoogleSignInReservedClientId = getGoogleSignInReservedClientId;
9
8
  exports.setGoogleConfig = setGoogleConfig;
10
9
  exports.setGoogleServicesFile = setGoogleServicesFile;
10
+ exports.setGoogleSignInReservedClientId = setGoogleSignInReservedClientId;
11
11
  exports.withGoogleServicesFile = exports.withGoogle = void 0;
12
12
 
13
13
  function _fsExtra() {
@@ -1,7 +1,8 @@
1
1
  import type { ExpoConfig } from '@expo/config-types';
2
+ import { JSONValue } from '@expo/json-file';
2
3
  import type { ConfigPlugin } from '../Plugin.types';
3
4
  export declare const JS_ENGINE_PROP_KEY = "expo.jsEngine";
4
5
  export declare const DEFAULT_JS_ENGINE = "jsc";
5
6
  export declare const withJsEnginePodfileProps: ConfigPlugin;
6
7
  export declare function getJsEngine(config: Pick<ExpoConfig, 'ios' | 'jsEngine'>): "hermes" | "jsc";
7
- export declare function setJsEngine(config: Pick<ExpoConfig, 'ios' | 'jsEngine'>, podfileProperties: Record<string, string>): Record<string, string>;
8
+ export declare function setJsEngine(config: Pick<ExpoConfig, 'ios' | 'jsEngine'>, podfileProperties: Record<string, JSONValue>): Record<string, JSONValue>;
@@ -3,9 +3,10 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ exports.JS_ENGINE_PROP_KEY = exports.DEFAULT_JS_ENGINE = void 0;
6
7
  exports.getJsEngine = getJsEngine;
7
8
  exports.setJsEngine = setJsEngine;
8
- exports.withJsEnginePodfileProps = exports.DEFAULT_JS_ENGINE = exports.JS_ENGINE_PROP_KEY = void 0;
9
+ exports.withJsEnginePodfileProps = void 0;
9
10
 
10
11
  function _iosPlugins() {
11
12
  const data = require("../plugins/ios-plugins");
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/ios/JsEngine.ts"],"names":["JS_ENGINE_PROP_KEY","DEFAULT_JS_ENGINE","withJsEnginePodfileProps","config","modResults","setJsEngine","getJsEngine","ios","jsEngine","podfileProperties"],"mappings":";;;;;;;;;AAGA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEO,MAAMA,kBAAkB,GAAG,eAA3B;;AACA,MAAMC,iBAAiB,GAAG,KAA1B;;;AAEA,MAAMC,wBAAsC,GAAGC,MAAM,IAAI;AAC9D,SAAO,yCAAsBA,MAAtB,EAA8BA,MAAM,IAAI;AAC7CA,IAAAA,MAAM,CAACC,UAAP,GAAoBC,WAAW,CAACF,MAAD,EAASA,MAAM,CAACC,UAAhB,CAA/B;AACA,WAAOD,MAAP;AACD,GAHM,CAAP;AAID,CALM;;;;AAOA,SAASG,WAAT,CAAqBH,MAArB,EAAmE;AAAA;;AACxE,wDAAOA,MAAM,CAACI,GAAd,gDAAO,YAAYC,QAAnB,uEAA+BL,MAAM,CAACK,QAAtC,uCAAkDP,iBAAlD;AACD;;AAEM,SAASI,WAAT,CACLF,MADK,EAELM,iBAFK,EAGmB;AAAA;;AACxBA,EAAAA,iBAAiB,CAACT,kBAAD,CAAjB,qDACEG,MAAM,CAACI,GADT,iDACE,aAAYC,QADd,yEAC0BL,MAAM,CAACK,QADjC,yCAC6CP,iBAD7C;AAEA,SAAOQ,iBAAP;AACD","sourcesContent":["import type { ExpoConfig } from '@expo/config-types';\n\nimport type { ConfigPlugin } from '../Plugin.types';\nimport { withPodfileProperties } from '../plugins/ios-plugins';\n\nexport const JS_ENGINE_PROP_KEY = 'expo.jsEngine';\nexport const DEFAULT_JS_ENGINE = 'jsc';\n\nexport const withJsEnginePodfileProps: ConfigPlugin = config => {\n return withPodfileProperties(config, config => {\n config.modResults = setJsEngine(config, config.modResults);\n return config;\n });\n};\n\nexport function getJsEngine(config: Pick<ExpoConfig, 'ios' | 'jsEngine'>) {\n return config.ios?.jsEngine ?? config.jsEngine ?? DEFAULT_JS_ENGINE;\n}\n\nexport function setJsEngine(\n config: Pick<ExpoConfig, 'ios' | 'jsEngine'>,\n podfileProperties: Record<string, string>\n): Record<string, string> {\n podfileProperties[JS_ENGINE_PROP_KEY] =\n config.ios?.jsEngine ?? config.jsEngine ?? DEFAULT_JS_ENGINE;\n return podfileProperties;\n}\n"],"file":"JsEngine.js"}
1
+ {"version":3,"sources":["../../src/ios/JsEngine.ts"],"names":["JS_ENGINE_PROP_KEY","DEFAULT_JS_ENGINE","withJsEnginePodfileProps","config","modResults","setJsEngine","getJsEngine","ios","jsEngine","podfileProperties"],"mappings":";;;;;;;;;;AAIA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEO,MAAMA,kBAAkB,GAAG,eAA3B;;AACA,MAAMC,iBAAiB,GAAG,KAA1B;;;AAEA,MAAMC,wBAAsC,GAAGC,MAAM,IAAI;AAC9D,SAAO,yCAAsBA,MAAtB,EAA8BA,MAAM,IAAI;AAC7CA,IAAAA,MAAM,CAACC,UAAP,GAAoBC,WAAW,CAACF,MAAD,EAASA,MAAM,CAACC,UAAhB,CAA/B;AACA,WAAOD,MAAP;AACD,GAHM,CAAP;AAID,CALM;;;;AAOA,SAASG,WAAT,CAAqBH,MAArB,EAAmE;AAAA;;AACxE,wDAAOA,MAAM,CAACI,GAAd,gDAAO,YAAYC,QAAnB,uEAA+BL,MAAM,CAACK,QAAtC,uCAAkDP,iBAAlD;AACD;;AAEM,SAASI,WAAT,CACLF,MADK,EAELM,iBAFK,EAGsB;AAAA;;AAC3BA,EAAAA,iBAAiB,CAACT,kBAAD,CAAjB,qDACEG,MAAM,CAACI,GADT,iDACE,aAAYC,QADd,yEAC0BL,MAAM,CAACK,QADjC,yCAC6CP,iBAD7C;AAEA,SAAOQ,iBAAP;AACD","sourcesContent":["import type { ExpoConfig } from '@expo/config-types';\nimport { JSONValue } from '@expo/json-file';\n\nimport type { ConfigPlugin } from '../Plugin.types';\nimport { withPodfileProperties } from '../plugins/ios-plugins';\n\nexport const JS_ENGINE_PROP_KEY = 'expo.jsEngine';\nexport const DEFAULT_JS_ENGINE = 'jsc';\n\nexport const withJsEnginePodfileProps: ConfigPlugin = config => {\n return withPodfileProperties(config, config => {\n config.modResults = setJsEngine(config, config.modResults);\n return config;\n });\n};\n\nexport function getJsEngine(config: Pick<ExpoConfig, 'ios' | 'jsEngine'>) {\n return config.ios?.jsEngine ?? config.jsEngine ?? DEFAULT_JS_ENGINE;\n}\n\nexport function setJsEngine(\n config: Pick<ExpoConfig, 'ios' | 'jsEngine'>,\n podfileProperties: Record<string, JSONValue>\n): Record<string, JSONValue> {\n podfileProperties[JS_ENGINE_PROP_KEY] =\n config.ios?.jsEngine ?? config.jsEngine ?? DEFAULT_JS_ENGINE;\n return podfileProperties;\n}\n"],"file":"JsEngine.js"}
@@ -4,8 +4,8 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.getLocales = getLocales;
7
- exports.setLocalesAsync = setLocalesAsync;
8
7
  exports.getResolvedLocalesAsync = getResolvedLocalesAsync;
8
+ exports.setLocalesAsync = setLocalesAsync;
9
9
  exports.withLocales = void 0;
10
10
 
11
11
  function _jsonFile() {
package/build/ios/Maps.js CHANGED
@@ -3,15 +3,16 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.getGoogleMapsApiKey = getGoogleMapsApiKey;
7
- exports.setGoogleMapsApiKey = setGoogleMapsApiKey;
6
+ exports.MATCH_INIT = void 0;
8
7
  exports.addGoogleMapsAppDelegateImport = addGoogleMapsAppDelegateImport;
9
- exports.removeGoogleMapsAppDelegateImport = removeGoogleMapsAppDelegateImport;
10
8
  exports.addGoogleMapsAppDelegateInit = addGoogleMapsAppDelegateInit;
11
- exports.removeGoogleMapsAppDelegateInit = removeGoogleMapsAppDelegateInit;
12
9
  exports.addMapsCocoaPods = addMapsCocoaPods;
10
+ exports.getGoogleMapsApiKey = getGoogleMapsApiKey;
11
+ exports.removeGoogleMapsAppDelegateImport = removeGoogleMapsAppDelegateImport;
12
+ exports.removeGoogleMapsAppDelegateInit = removeGoogleMapsAppDelegateInit;
13
13
  exports.removeMapsCocoaPods = removeMapsCocoaPods;
14
- exports.withMaps = exports.MATCH_INIT = void 0;
14
+ exports.setGoogleMapsApiKey = setGoogleMapsApiKey;
15
+ exports.withMaps = void 0;
15
16
 
16
17
  function _fsExtra() {
17
18
  const data = _interopRequireDefault(require("fs-extra"));
@@ -33,6 +34,16 @@ function _path() {
33
34
  return data;
34
35
  }
35
36
 
37
+ function _resolveFrom() {
38
+ const data = _interopRequireDefault(require("resolve-from"));
39
+
40
+ _resolveFrom = function () {
41
+ return data;
42
+ };
43
+
44
+ return data;
45
+ }
46
+
36
47
  function _iosPlugins() {
37
48
  const data = require("../plugins/ios-plugins");
38
49
 
@@ -63,19 +74,11 @@ function _generateCode() {
63
74
  return data;
64
75
  }
65
76
 
66
- function _resolvePackageRootFolder() {
67
- const data = require("../utils/resolvePackageRootFolder");
68
-
69
- _resolvePackageRootFolder = function () {
70
- return data;
71
- };
77
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
72
78
 
73
- return data;
74
- }
79
+ const debug = require('debug')('expo:config-plugins:ios:maps'); // Match against `UMModuleRegistryAdapter` (unimodules), and React Native without unimodules (Expo Modules).
75
80
 
76
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
77
81
 
78
- // Match against `UMModuleRegistryAdapter` (unimodules), and React Native without unimodules (Expo Modules).
79
82
  const MATCH_INIT = /(?:(self\.|_)(\w+)\s?=\s?\[\[UMModuleRegistryAdapter alloc\])|(?:RCTBridge\s?\*\s?(\w+)\s?=\s?\[\[RCTBridge alloc\])/g;
80
83
  exports.MATCH_INIT = MATCH_INIT;
81
84
  const withGoogleMapsKey = (0, _iosPlugins().createInfoPlistPlugin)(setGoogleMapsApiKey, 'withGoogleMapsKey');
@@ -84,6 +87,7 @@ const withMaps = config => {
84
87
  config = withGoogleMapsKey(config);
85
88
  const apiKey = getGoogleMapsApiKey(config); // Technically adds react-native-maps (Apple maps) and google maps.
86
89
 
90
+ debug('Google Maps API Key:', apiKey);
87
91
  config = withMapsCocoaPods(config, {
88
92
  useGoogleMaps: !!apiKey
89
93
  }); // Adds/Removes AppDelegate setup for Google Maps API on iOS
@@ -183,7 +187,14 @@ function removeMapsCocoaPods(src) {
183
187
  }
184
188
 
185
189
  function isReactNativeMapsInstalled(projectRoot) {
186
- return (0, _resolvePackageRootFolder().resolvePackageRootFolder)(projectRoot, 'react-native-maps');
190
+ const resolved = _resolveFrom().default.silent(projectRoot, 'react-native-maps/package.json');
191
+
192
+ return resolved ? _path().default.dirname(resolved) : null;
193
+ }
194
+
195
+ function isReactNativeMapsAutolinked(config) {
196
+ // TODO: Detect autolinking
197
+ return true;
187
198
  }
188
199
 
189
200
  const withMapsCocoaPods = (config, {
@@ -197,8 +208,11 @@ const withMapsCocoaPods = (config, {
197
208
  // Generally prebuild runs after a yarn install so this should always work as expected.
198
209
 
199
210
  const googleMapsPath = isReactNativeMapsInstalled(config.modRequest.projectRoot);
211
+ const isLinked = isReactNativeMapsAutolinked(config);
212
+ debug('Is Expo Autolinked:', isLinked);
213
+ debug('react-native-maps path:', googleMapsPath);
200
214
 
201
- if (googleMapsPath && useGoogleMaps) {
215
+ if (isLinked && googleMapsPath && useGoogleMaps) {
202
216
  // Make the pod path relative to the ios folder.
203
217
  const googleMapsPodPath = _path().default.relative(config.modRequest.platformProjectRoot, googleMapsPath);
204
218
 
@@ -229,7 +243,7 @@ const withGoogleMapsAppDelegate = (config, {
229
243
  }) => {
230
244
  return (0, _iosPlugins().withAppDelegate)(config, config => {
231
245
  if (config.modResults.language === 'objc') {
232
- if (apiKey && isReactNativeMapsInstalled(config.modRequest.projectRoot)) {
246
+ if (apiKey && isReactNativeMapsAutolinked(config) && isReactNativeMapsInstalled(config.modRequest.projectRoot)) {
233
247
  try {
234
248
  config.modResults.contents = addGoogleMapsAppDelegateImport(config.modResults.contents).contents;
235
249
  config.modResults.contents = addGoogleMapsAppDelegateInit(config.modResults.contents, apiKey).contents;