@expo/config-plugins 55.0.6 → 55.0.7-canary-20260429-a5e59cf

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 (169) hide show
  1. package/build/Plugin.types.d.ts +11 -9
  2. package/build/Plugin.types.js +0 -32
  3. package/build/Plugin.types.js.map +1 -1
  4. package/build/android/AllowBackup.d.ts +2 -2
  5. package/build/android/AllowBackup.js.map +1 -1
  6. package/build/android/BuildProperties.d.ts +1 -1
  7. package/build/android/BuildProperties.js.map +1 -1
  8. package/build/android/Colors.d.ts +1 -1
  9. package/build/android/Colors.js.map +1 -1
  10. package/build/android/EasBuild.js +1 -2
  11. package/build/android/EasBuild.js.map +1 -1
  12. package/build/android/GoogleMapsApiKey.d.ts +2 -2
  13. package/build/android/GoogleMapsApiKey.js.map +1 -1
  14. package/build/android/GoogleServices.d.ts +2 -2
  15. package/build/android/GoogleServices.js.map +1 -1
  16. package/build/android/IntentFilters.d.ts +2 -2
  17. package/build/android/IntentFilters.js.map +1 -1
  18. package/build/android/Locales.d.ts +3 -3
  19. package/build/android/Locales.js.map +1 -1
  20. package/build/android/Manifest.js +3 -4
  21. package/build/android/Manifest.js.map +1 -1
  22. package/build/android/Name.d.ts +2 -2
  23. package/build/android/Name.js.map +1 -1
  24. package/build/android/Orientation.d.ts +2 -2
  25. package/build/android/Orientation.js.map +1 -1
  26. package/build/android/Package.d.ts +2 -2
  27. package/build/android/Package.js.map +1 -1
  28. package/build/android/Paths.d.ts +1 -1
  29. package/build/android/Paths.js +1 -2
  30. package/build/android/Paths.js.map +1 -1
  31. package/build/android/Permissions.d.ts +3 -3
  32. package/build/android/Permissions.js.map +1 -1
  33. package/build/android/PredictiveBackGesture.d.ts +3 -3
  34. package/build/android/PredictiveBackGesture.js.map +1 -1
  35. package/build/android/PrimaryColor.d.ts +2 -2
  36. package/build/android/PrimaryColor.js.map +1 -1
  37. package/build/android/Properties.js +12 -10
  38. package/build/android/Properties.js.map +1 -1
  39. package/build/android/Resources.d.ts +1 -1
  40. package/build/android/Resources.js.map +1 -1
  41. package/build/android/Scheme.d.ts +2 -2
  42. package/build/android/Scheme.js.map +1 -1
  43. package/build/android/Strings.d.ts +1 -1
  44. package/build/android/Strings.js.map +1 -1
  45. package/build/android/Styles.d.ts +1 -1
  46. package/build/android/Styles.js.map +1 -1
  47. package/build/android/SystemBars.d.ts +4 -0
  48. package/build/android/SystemBars.js +59 -0
  49. package/build/android/SystemBars.js.map +1 -0
  50. package/build/android/Updates.d.ts +5 -6
  51. package/build/android/Updates.js.map +1 -1
  52. package/build/android/Version.d.ts +2 -2
  53. package/build/android/Version.js.map +1 -1
  54. package/build/android/WindowSoftInputMode.d.ts +3 -3
  55. package/build/android/WindowSoftInputMode.js.map +1 -1
  56. package/build/android/codeMod.d.ts +1 -1
  57. package/build/android/codeMod.js.map +1 -1
  58. package/build/android/index.d.ts +2 -2
  59. package/build/android/index.js +15 -16
  60. package/build/android/index.js.map +1 -1
  61. package/build/index.js +1 -2
  62. package/build/index.js.map +1 -1
  63. package/build/ios/Bitcode.d.ts +3 -3
  64. package/build/ios/Bitcode.js.map +1 -1
  65. package/build/ios/BuildProperties.d.ts +1 -1
  66. package/build/ios/BuildProperties.js.map +1 -1
  67. package/build/ios/BuildScheme.js +2 -2
  68. package/build/ios/BuildScheme.js.map +1 -1
  69. package/build/ios/BundleIdentifier.d.ts +3 -3
  70. package/build/ios/BundleIdentifier.js.map +1 -1
  71. package/build/ios/DeploymentTarget.d.ts +19 -0
  72. package/build/ios/DeploymentTarget.js +80 -0
  73. package/build/ios/DeploymentTarget.js.map +1 -0
  74. package/build/ios/DeviceFamily.d.ts +3 -3
  75. package/build/ios/DeviceFamily.js.map +1 -1
  76. package/build/ios/Entitlements.d.ts +2 -2
  77. package/build/ios/Entitlements.js.map +1 -1
  78. package/build/ios/Google.d.ts +4 -4
  79. package/build/ios/Google.js.map +1 -1
  80. package/build/ios/IosConfig.types.d.ts +2 -1
  81. package/build/ios/IosConfig.types.js.map +1 -1
  82. package/build/ios/Locales.d.ts +4 -4
  83. package/build/ios/Locales.js.map +1 -1
  84. package/build/ios/Maps.d.ts +3 -3
  85. package/build/ios/Maps.js.map +1 -1
  86. package/build/ios/Name.d.ts +4 -4
  87. package/build/ios/Name.js.map +1 -1
  88. package/build/ios/Orientation.d.ts +2 -2
  89. package/build/ios/Orientation.js.map +1 -1
  90. package/build/ios/Paths.js +4 -5
  91. package/build/ios/Paths.js.map +1 -1
  92. package/build/ios/Permissions.d.ts +2 -2
  93. package/build/ios/Permissions.js.map +1 -1
  94. package/build/ios/PrivacyInfo.d.ts +2 -2
  95. package/build/ios/PrivacyInfo.js.map +1 -1
  96. package/build/ios/ProvisioningProfile.d.ts +2 -1
  97. package/build/ios/ProvisioningProfile.js +3 -2
  98. package/build/ios/ProvisioningProfile.js.map +1 -1
  99. package/build/ios/RequiresFullScreen.d.ts +2 -2
  100. package/build/ios/RequiresFullScreen.js.map +1 -1
  101. package/build/ios/Scheme.d.ts +2 -2
  102. package/build/ios/Scheme.js.map +1 -1
  103. package/build/ios/Target.d.ts +2 -2
  104. package/build/ios/Target.js +1 -1
  105. package/build/ios/Target.js.map +1 -1
  106. package/build/ios/Updates.d.ts +3 -3
  107. package/build/ios/Updates.js.map +1 -1
  108. package/build/ios/UsesNonExemptEncryption.d.ts +2 -2
  109. package/build/ios/UsesNonExemptEncryption.js.map +1 -1
  110. package/build/ios/Version.d.ts +2 -2
  111. package/build/ios/Version.js.map +1 -1
  112. package/build/ios/XcodeProjectFile.d.ts +1 -1
  113. package/build/ios/XcodeProjectFile.js.map +1 -1
  114. package/build/ios/codeMod.d.ts +1 -1
  115. package/build/ios/codeMod.js +2 -2
  116. package/build/ios/codeMod.js.map +1 -1
  117. package/build/ios/index.d.ts +26 -27
  118. package/build/ios/index.js +87 -96
  119. package/build/ios/index.js.map +1 -1
  120. package/build/ios/utils/Xcodeproj.d.ts +3 -3
  121. package/build/ios/utils/Xcodeproj.js +2 -3
  122. package/build/ios/utils/Xcodeproj.js.map +1 -1
  123. package/build/ios/utils/getInfoPlistPath.d.ts +1 -1
  124. package/build/ios/utils/getInfoPlistPath.js.map +1 -1
  125. package/build/plugins/android-plugins.d.ts +2 -2
  126. package/build/plugins/android-plugins.js.map +1 -1
  127. package/build/plugins/createBaseMod.d.ts +2 -2
  128. package/build/plugins/createBaseMod.js.map +1 -1
  129. package/build/plugins/mod-compiler.d.ts +2 -2
  130. package/build/plugins/mod-compiler.js +1 -2
  131. package/build/plugins/mod-compiler.js.map +1 -1
  132. package/build/plugins/withAndroidBaseMods.d.ts +3 -3
  133. package/build/plugins/withAndroidBaseMods.js.map +1 -1
  134. package/build/plugins/withDangerousMod.d.ts +1 -1
  135. package/build/plugins/withDangerousMod.js.map +1 -1
  136. package/build/plugins/withFinalizedMod.d.ts +1 -1
  137. package/build/plugins/withFinalizedMod.js.map +1 -1
  138. package/build/plugins/withIosBaseMods.d.ts +7 -7
  139. package/build/plugins/withIosBaseMods.js +1 -2
  140. package/build/plugins/withIosBaseMods.js.map +1 -1
  141. package/build/plugins/withMod.d.ts +1 -1
  142. package/build/plugins/withMod.js +1 -1
  143. package/build/plugins/withMod.js.map +1 -1
  144. package/build/plugins/withPlugins.d.ts +1 -1
  145. package/build/plugins/withPlugins.js.map +1 -1
  146. package/build/plugins/withRunOnce.d.ts +2 -2
  147. package/build/plugins/withRunOnce.js.map +1 -1
  148. package/build/plugins/withStaticPlugin.d.ts +1 -1
  149. package/build/plugins/withStaticPlugin.js.map +1 -1
  150. package/build/ts-declarations/xcode/index.d.js +2 -0
  151. package/build/ts-declarations/xcode/index.d.js.map +1 -0
  152. package/build/utils/Updates.d.ts +1 -1
  153. package/build/utils/Updates.js +1 -2
  154. package/build/utils/Updates.js.map +1 -1
  155. package/build/utils/history.d.ts +2 -2
  156. package/build/utils/history.js.map +1 -1
  157. package/build/utils/locales.d.ts +1 -1
  158. package/build/utils/locales.js.map +1 -1
  159. package/build/utils/plugin-resolver.d.ts +1 -1
  160. package/build/utils/plugin-resolver.js +1 -2
  161. package/build/utils/plugin-resolver.js.map +1 -1
  162. package/build/utils/sortObject.js +3 -1
  163. package/build/utils/sortObject.js.map +1 -1
  164. package/build/utils/warnings.d.ts +1 -1
  165. package/build/utils/warnings.js.map +1 -1
  166. package/package.json +10 -9
  167. package/build/android/StatusBar.d.ts +0 -6
  168. package/build/android/StatusBar.js +0 -76
  169. package/build/android/StatusBar.js.map +0 -1
@@ -1,12 +1,15 @@
1
- import { ExpoConfig } from '@expo/config-types';
2
- import { JSONObject } from '@expo/json-file';
1
+ import type { ExpoConfig } from '@expo/config-types';
2
+ import type { JSONObject } from '@expo/json-file';
3
3
  import { XcodeProject } from 'xcode';
4
- import { Properties } from './android';
5
- import { AndroidManifest } from './android/Manifest';
6
- import * as AndroidPaths from './android/Paths';
7
- import { ResourceXML } from './android/Resources';
8
- import { ExpoPlist, InfoPlist } from './ios/IosConfig.types';
9
- import { AppDelegateProjectFile } from './ios/Paths';
4
+ import type { Properties } from './android';
5
+ import type { AndroidManifest } from './android/Manifest';
6
+ import type * as AndroidPaths from './android/Paths';
7
+ import type { ResourceXML } from './android/Resources';
8
+ import type { InfoPlist } from './ios/IosConfig.types';
9
+ import type { AppDelegateProjectFile } from './ios/Paths';
10
+ export { XcodeProject } from 'xcode';
11
+ export type { ExpoPlist, InfoPlist } from './ios/IosConfig.types';
12
+ export type { AndroidManifest } from './android/Manifest';
10
13
  type OptionalPromise<T> = Promise<T> | T;
11
14
  type Plist = JSONObject;
12
15
  export interface ModProps<T = any> {
@@ -174,4 +177,3 @@ export interface ModConfig {
174
177
  };
175
178
  }
176
179
  export type ModPlatform = keyof ModConfig;
177
- export { XcodeProject, InfoPlist, ExpoPlist, AndroidManifest };
@@ -3,24 +3,6 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- Object.defineProperty(exports, "AndroidManifest", {
7
- enumerable: true,
8
- get: function () {
9
- return _Manifest().AndroidManifest;
10
- }
11
- });
12
- Object.defineProperty(exports, "ExpoPlist", {
13
- enumerable: true,
14
- get: function () {
15
- return _IosConfig().ExpoPlist;
16
- }
17
- });
18
- Object.defineProperty(exports, "InfoPlist", {
19
- enumerable: true,
20
- get: function () {
21
- return _IosConfig().InfoPlist;
22
- }
23
- });
24
6
  Object.defineProperty(exports, "XcodeProject", {
25
7
  enumerable: true,
26
8
  get: function () {
@@ -34,18 +16,4 @@ function _xcode() {
34
16
  };
35
17
  return data;
36
18
  }
37
- function _Manifest() {
38
- const data = require("./android/Manifest");
39
- _Manifest = function () {
40
- return data;
41
- };
42
- return data;
43
- }
44
- function _IosConfig() {
45
- const data = require("./ios/IosConfig.types");
46
- _IosConfig = function () {
47
- return data;
48
- };
49
- return data;
50
- }
51
19
  //# sourceMappingURL=Plugin.types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Plugin.types.js","names":["_xcode","data","require","_Manifest","_IosConfig"],"sources":["../src/Plugin.types.ts"],"sourcesContent":["import { ExpoConfig } from '@expo/config-types';\nimport { JSONObject } from '@expo/json-file';\nimport { XcodeProject } from 'xcode';\n\nimport { Properties } from './android';\nimport { AndroidManifest } from './android/Manifest';\nimport * as AndroidPaths from './android/Paths';\nimport { ResourceXML } from './android/Resources';\nimport { ExpoPlist, InfoPlist } from './ios/IosConfig.types';\nimport { AppDelegateProjectFile } from './ios/Paths';\n\ntype OptionalPromise<T> = Promise<T> | T;\n\ntype Plist = JSONObject;\n\nexport interface ModProps<T = any> {\n /**\n * Project root directory for the universal app.\n */\n readonly projectRoot: string;\n\n /**\n * Project root for the specific platform.\n */\n readonly platformProjectRoot: string;\n\n /**\n * Name of the mod.\n */\n readonly modName: string;\n\n /**\n * Name of the platform used in the mods config.\n */\n readonly platform: ModPlatform;\n\n /**\n * If the mod is being evaluated in introspection mode.\n * No file system modifications should be made when introspect is `true`.\n */\n readonly introspect: boolean;\n\n /**\n * [iOS]: The path component used for querying project files.\n *\n * @example projectRoot/ios/[projectName]/\n */\n readonly projectName?: string;\n\n /**\n * Ignore any of the user's local native files and solely rely on the generated files.\n * This makes prebuild data, like entitlements, more aligned to what users expects.\n * When enabling this, users must be informed and have a way to disable this exclusion.\n */\n readonly ignoreExistingNativeFiles?: boolean;\n\n nextMod?: Mod<T>;\n}\n\n// TODO: Migrate ProjectConfig to using expo instead if exp\nexport interface ExportedConfig extends ExpoConfig {\n mods?: ModConfig | null;\n}\n\nexport interface ExportedConfigWithProps<Data = any> extends ExportedConfig {\n /**\n * The Object representation of a complex file type.\n */\n modResults: Data;\n modRequest: ModProps<Data>;\n /**\n * A frozen representation of the original file contents,\n * this can be used as a reference into the user's original intent.\n *\n * For example, you could infer that the user defined a certain\n * value explicitly and disable any automatic changes.\n */\n readonly modRawConfig: ExpoConfig;\n}\n\n/**\n * A helper type to get the properties of a plugin.\n */\nexport type PluginParameters<T extends ConfigPlugin<any>> = T extends (\n config: any,\n props: infer P\n) => any\n ? P\n : never;\n\nexport type ConfigPlugin<Props = void> = (config: ExpoConfig, props: Props) => ExpoConfig;\n\nexport type StaticPlugin<T = any> = [string | ConfigPlugin<T>, T];\n\nexport type Mod<Props = any> = ((\n config: ExportedConfigWithProps<Props>\n) => OptionalPromise<ExportedConfigWithProps<Props>>) & {\n /**\n * Indicates that the mod provides data upstream to other mods.\n * This mod should always be the last one added.\n */\n isProvider?: boolean;\n /**\n * If the mod supports introspection, and avoids making any filesystem modifications during compilation.\n * By enabling, this mod, and all of its descendants will be run in introspection mode.\n * This should only be used for static files like JSON or XML, and not for application files that require regexes,\n * or complex static files that require other files to be generated like Xcode `.pbxproj`.\n */\n isIntrospective?: boolean;\n};\n\nexport interface ModConfig {\n android?: {\n /**\n * Dangerously make a modification before any other platform mods have been run.\n */\n dangerous?: Mod<unknown>;\n /**\n * Dangerously make a modification after all the other platform mods have been run.\n */\n finalized?: Mod<unknown>;\n /**\n * Modify the `android/app/src/main/AndroidManifest.xml` as JSON (parsed with [`xml2js`](https://www.npmjs.com/package/xml2js)).\n */\n manifest?: Mod<AndroidManifest>;\n /**\n * Modify the `android/app/src/main/res/values/strings.xml` as JSON (parsed with [`xml2js`](https://www.npmjs.com/package/xml2js)).\n */\n strings?: Mod<ResourceXML>;\n /**\n * Modify the `android/app/src/main/res/values/colors.xml` as JSON (parsed with [`xml2js`](https://www.npmjs.com/package/xml2js)).\n */\n colors?: Mod<ResourceXML>;\n /**\n * Modify the `android/app/src/main/res/values-night/colors.xml` as JSON (parsed with [`xml2js`](https://www.npmjs.com/package/xml2js)).\n */\n colorsNight?: Mod<ResourceXML>;\n /**\n * Modify the `android/app/src/main/res/values/styles.xml` as JSON (parsed with [`xml2js`](https://www.npmjs.com/package/xml2js)).\n */\n styles?: Mod<ResourceXML>;\n /**\n * Modify the `android/app/src/main/<package>/MainActivity.java` as a string.\n */\n mainActivity?: Mod<AndroidPaths.ApplicationProjectFile>;\n /**\n * Modify the `android/app/src/main/<package>/MainApplication.java` as a string.\n */\n mainApplication?: Mod<AndroidPaths.ApplicationProjectFile>;\n /**\n * Modify the `android/app/build.gradle` as a string.\n */\n appBuildGradle?: Mod<AndroidPaths.GradleProjectFile>;\n /**\n * Modify the `android/build.gradle` as a string.\n */\n projectBuildGradle?: Mod<AndroidPaths.GradleProjectFile>;\n /**\n * Modify the `android/settings.gradle` as a string.\n */\n settingsGradle?: Mod<AndroidPaths.GradleProjectFile>;\n /**\n * Modify the `android/gradle.properties` as a `Properties.PropertiesItem[]`.\n */\n gradleProperties?: Mod<Properties.PropertiesItem[]>;\n };\n ios?: {\n /**\n * Dangerously make a modification before any other platform mods have been run.\n */\n dangerous?: Mod<unknown>;\n /**\n * Dangerously make a modification after all the other platform mods have been run.\n */\n finalized?: Mod<unknown>;\n /**\n * Modify the `ios/<name>/Info.plist` as JSON (parsed with [`@expo/plist`](https://www.npmjs.com/package/@expo/plist)).\n */\n infoPlist?: Mod<InfoPlist>;\n /**\n * Modify the `ios/<name>/<product-name>.entitlements` as JSON (parsed with [`@expo/plist`](https://www.npmjs.com/package/@expo/plist)).\n */\n entitlements?: Mod<Plist>;\n /**\n * Modify the `ios/<name>/Expo.plist` as JSON (Expo updates config for iOS) (parsed with [`@expo/plist`](https://www.npmjs.com/package/@expo/plist)).\n */\n expoPlist?: Mod<Plist>;\n /**\n * Modify the `ios/<name>.xcodeproj` as an `XcodeProject` (parsed with [`xcode`](https://www.npmjs.com/package/xcode))\n */\n xcodeproj?: Mod<XcodeProject>;\n /**\n * Modify the `ios/<name>/AppDelegate.m` as a string (dangerous)\n */\n appDelegate?: Mod<AppDelegateProjectFile>;\n /**\n * Modify the `ios/Podfile.properties.json` as key-value pairs\n */\n podfileProperties?: Mod<Record<string, string>>;\n };\n}\n\nexport type ModPlatform = keyof ModConfig;\n\nexport { XcodeProject, InfoPlist, ExpoPlist, AndroidManifest };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAE,UAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,SAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAG,WAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,UAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA","ignoreList":[]}
1
+ {"version":3,"file":"Plugin.types.js","names":["_xcode","data","require"],"sources":["../src/Plugin.types.ts"],"sourcesContent":["import type { ExpoConfig } from '@expo/config-types';\nimport type { JSONObject } from '@expo/json-file';\nimport { XcodeProject } from 'xcode';\n\nimport type { Properties } from './android';\nimport type { AndroidManifest } from './android/Manifest';\nimport type * as AndroidPaths from './android/Paths';\nimport type { ResourceXML } from './android/Resources';\nimport type { InfoPlist } from './ios/IosConfig.types';\nimport type { AppDelegateProjectFile } from './ios/Paths';\n\nexport { XcodeProject } from 'xcode';\nexport type { ExpoPlist, InfoPlist } from './ios/IosConfig.types';\nexport type { AndroidManifest } from './android/Manifest';\n\ntype OptionalPromise<T> = Promise<T> | T;\n\ntype Plist = JSONObject;\n\nexport interface ModProps<T = any> {\n /**\n * Project root directory for the universal app.\n */\n readonly projectRoot: string;\n\n /**\n * Project root for the specific platform.\n */\n readonly platformProjectRoot: string;\n\n /**\n * Name of the mod.\n */\n readonly modName: string;\n\n /**\n * Name of the platform used in the mods config.\n */\n readonly platform: ModPlatform;\n\n /**\n * If the mod is being evaluated in introspection mode.\n * No file system modifications should be made when introspect is `true`.\n */\n readonly introspect: boolean;\n\n /**\n * [iOS]: The path component used for querying project files.\n *\n * @example projectRoot/ios/[projectName]/\n */\n readonly projectName?: string;\n\n /**\n * Ignore any of the user's local native files and solely rely on the generated files.\n * This makes prebuild data, like entitlements, more aligned to what users expects.\n * When enabling this, users must be informed and have a way to disable this exclusion.\n */\n readonly ignoreExistingNativeFiles?: boolean;\n\n nextMod?: Mod<T>;\n}\n\n// TODO: Migrate ProjectConfig to using expo instead if exp\nexport interface ExportedConfig extends ExpoConfig {\n mods?: ModConfig | null;\n}\n\nexport interface ExportedConfigWithProps<Data = any> extends ExportedConfig {\n /**\n * The Object representation of a complex file type.\n */\n modResults: Data;\n modRequest: ModProps<Data>;\n /**\n * A frozen representation of the original file contents,\n * this can be used as a reference into the user's original intent.\n *\n * For example, you could infer that the user defined a certain\n * value explicitly and disable any automatic changes.\n */\n readonly modRawConfig: ExpoConfig;\n}\n\n/**\n * A helper type to get the properties of a plugin.\n */\nexport type PluginParameters<T extends ConfigPlugin<any>> = T extends (\n config: any,\n props: infer P\n) => any\n ? P\n : never;\n\nexport type ConfigPlugin<Props = void> = (config: ExpoConfig, props: Props) => ExpoConfig;\n\nexport type StaticPlugin<T = any> = [string | ConfigPlugin<T>, T];\n\nexport type Mod<Props = any> = ((\n config: ExportedConfigWithProps<Props>\n) => OptionalPromise<ExportedConfigWithProps<Props>>) & {\n /**\n * Indicates that the mod provides data upstream to other mods.\n * This mod should always be the last one added.\n */\n isProvider?: boolean;\n /**\n * If the mod supports introspection, and avoids making any filesystem modifications during compilation.\n * By enabling, this mod, and all of its descendants will be run in introspection mode.\n * This should only be used for static files like JSON or XML, and not for application files that require regexes,\n * or complex static files that require other files to be generated like Xcode `.pbxproj`.\n */\n isIntrospective?: boolean;\n};\n\nexport interface ModConfig {\n android?: {\n /**\n * Dangerously make a modification before any other platform mods have been run.\n */\n dangerous?: Mod<unknown>;\n /**\n * Dangerously make a modification after all the other platform mods have been run.\n */\n finalized?: Mod<unknown>;\n /**\n * Modify the `android/app/src/main/AndroidManifest.xml` as JSON (parsed with [`xml2js`](https://www.npmjs.com/package/xml2js)).\n */\n manifest?: Mod<AndroidManifest>;\n /**\n * Modify the `android/app/src/main/res/values/strings.xml` as JSON (parsed with [`xml2js`](https://www.npmjs.com/package/xml2js)).\n */\n strings?: Mod<ResourceXML>;\n /**\n * Modify the `android/app/src/main/res/values/colors.xml` as JSON (parsed with [`xml2js`](https://www.npmjs.com/package/xml2js)).\n */\n colors?: Mod<ResourceXML>;\n /**\n * Modify the `android/app/src/main/res/values-night/colors.xml` as JSON (parsed with [`xml2js`](https://www.npmjs.com/package/xml2js)).\n */\n colorsNight?: Mod<ResourceXML>;\n /**\n * Modify the `android/app/src/main/res/values/styles.xml` as JSON (parsed with [`xml2js`](https://www.npmjs.com/package/xml2js)).\n */\n styles?: Mod<ResourceXML>;\n /**\n * Modify the `android/app/src/main/<package>/MainActivity.java` as a string.\n */\n mainActivity?: Mod<AndroidPaths.ApplicationProjectFile>;\n /**\n * Modify the `android/app/src/main/<package>/MainApplication.java` as a string.\n */\n mainApplication?: Mod<AndroidPaths.ApplicationProjectFile>;\n /**\n * Modify the `android/app/build.gradle` as a string.\n */\n appBuildGradle?: Mod<AndroidPaths.GradleProjectFile>;\n /**\n * Modify the `android/build.gradle` as a string.\n */\n projectBuildGradle?: Mod<AndroidPaths.GradleProjectFile>;\n /**\n * Modify the `android/settings.gradle` as a string.\n */\n settingsGradle?: Mod<AndroidPaths.GradleProjectFile>;\n /**\n * Modify the `android/gradle.properties` as a `Properties.PropertiesItem[]`.\n */\n gradleProperties?: Mod<Properties.PropertiesItem[]>;\n };\n ios?: {\n /**\n * Dangerously make a modification before any other platform mods have been run.\n */\n dangerous?: Mod<unknown>;\n /**\n * Dangerously make a modification after all the other platform mods have been run.\n */\n finalized?: Mod<unknown>;\n /**\n * Modify the `ios/<name>/Info.plist` as JSON (parsed with [`@expo/plist`](https://www.npmjs.com/package/@expo/plist)).\n */\n infoPlist?: Mod<InfoPlist>;\n /**\n * Modify the `ios/<name>/<product-name>.entitlements` as JSON (parsed with [`@expo/plist`](https://www.npmjs.com/package/@expo/plist)).\n */\n entitlements?: Mod<Plist>;\n /**\n * Modify the `ios/<name>/Expo.plist` as JSON (Expo updates config for iOS) (parsed with [`@expo/plist`](https://www.npmjs.com/package/@expo/plist)).\n */\n expoPlist?: Mod<Plist>;\n /**\n * Modify the `ios/<name>.xcodeproj` as an `XcodeProject` (parsed with [`xcode`](https://www.npmjs.com/package/xcode))\n */\n xcodeproj?: Mod<XcodeProject>;\n /**\n * Modify the `ios/<name>/AppDelegate.m` as a string (dangerous)\n */\n appDelegate?: Mod<AppDelegateProjectFile>;\n /**\n * Modify the `ios/Podfile.properties.json` as key-value pairs\n */\n podfileProperties?: Mod<Record<string, string>>;\n };\n}\n\nexport type ModPlatform = keyof ModConfig;\n"],"mappings":";;;;;;;;;;;AAWA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA","ignoreList":[]}
@@ -1,5 +1,5 @@
1
- import { ExpoConfig } from '@expo/config-types';
2
- import { AndroidManifest } from './Manifest';
1
+ import type { ExpoConfig } from '@expo/config-types';
2
+ import type { AndroidManifest } from './Manifest';
3
3
  export declare const withAllowBackup: import("..").ConfigPlugin;
4
4
  export declare function getAllowBackup(config: Pick<ExpoConfig, 'android'>): boolean;
5
5
  export declare function setAllowBackup(config: Pick<ExpoConfig, 'android'>, androidManifest: AndroidManifest): AndroidManifest;
@@ -1 +1 @@
1
- {"version":3,"file":"AllowBackup.js","names":["_Manifest","data","require","_androidPlugins","withAllowBackup","exports","createAndroidManifestPlugin","setAllowBackup","getAllowBackup","config","android","allowBackup","androidManifest","mainApplication","getMainApplication","$","String","getAllowBackupFromManifest"],"sources":["../../src/android/AllowBackup.ts"],"sourcesContent":["import { ExpoConfig } from '@expo/config-types';\n\nimport { AndroidManifest, getMainApplication, StringBoolean } from './Manifest';\nimport { createAndroidManifestPlugin } from '../plugins/android-plugins';\n\nexport const withAllowBackup = createAndroidManifestPlugin(setAllowBackup, 'withAllowBackup');\n\nexport function getAllowBackup(config: Pick<ExpoConfig, 'android'>) {\n // Defaults to true.\n // https://docs.expo.dev/versions/latest/config/app/#allowbackup\n return config.android?.allowBackup ?? true;\n}\n\nexport function setAllowBackup(\n config: Pick<ExpoConfig, 'android'>,\n androidManifest: AndroidManifest\n) {\n const allowBackup = getAllowBackup(config);\n\n const mainApplication = getMainApplication(androidManifest);\n if (mainApplication?.$) {\n mainApplication.$['android:allowBackup'] = String(allowBackup) as StringBoolean;\n }\n\n return androidManifest;\n}\n\nexport function getAllowBackupFromManifest(androidManifest: AndroidManifest): boolean | null {\n const mainApplication = getMainApplication(androidManifest);\n\n if (mainApplication?.$) {\n return String(mainApplication.$['android:allowBackup']) === 'true';\n }\n\n return null;\n}\n"],"mappings":";;;;;;;;;AAEA,SAAAA,UAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,SAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,gBAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,eAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,MAAMG,eAAe,GAAAC,OAAA,CAAAD,eAAA,GAAG,IAAAE,6CAA2B,EAACC,cAAc,EAAE,iBAAiB,CAAC;AAEtF,SAASC,cAAcA,CAACC,MAAmC,EAAE;EAClE;EACA;EACA,OAAOA,MAAM,CAACC,OAAO,EAAEC,WAAW,IAAI,IAAI;AAC5C;AAEO,SAASJ,cAAcA,CAC5BE,MAAmC,EACnCG,eAAgC,EAChC;EACA,MAAMD,WAAW,GAAGH,cAAc,CAACC,MAAM,CAAC;EAE1C,MAAMI,eAAe,GAAG,IAAAC,8BAAkB,EAACF,eAAe,CAAC;EAC3D,IAAIC,eAAe,EAAEE,CAAC,EAAE;IACtBF,eAAe,CAACE,CAAC,CAAC,qBAAqB,CAAC,GAAGC,MAAM,CAACL,WAAW,CAAkB;EACjF;EAEA,OAAOC,eAAe;AACxB;AAEO,SAASK,0BAA0BA,CAACL,eAAgC,EAAkB;EAC3F,MAAMC,eAAe,GAAG,IAAAC,8BAAkB,EAACF,eAAe,CAAC;EAE3D,IAAIC,eAAe,EAAEE,CAAC,EAAE;IACtB,OAAOC,MAAM,CAACH,eAAe,CAACE,CAAC,CAAC,qBAAqB,CAAC,CAAC,KAAK,MAAM;EACpE;EAEA,OAAO,IAAI;AACb","ignoreList":[]}
1
+ {"version":3,"file":"AllowBackup.js","names":["_Manifest","data","require","_androidPlugins","withAllowBackup","exports","createAndroidManifestPlugin","setAllowBackup","getAllowBackup","config","android","allowBackup","androidManifest","mainApplication","getMainApplication","$","String","getAllowBackupFromManifest"],"sources":["../../src/android/AllowBackup.ts"],"sourcesContent":["import type { ExpoConfig } from '@expo/config-types';\n\nimport type { AndroidManifest, StringBoolean } from './Manifest';\nimport { getMainApplication } from './Manifest';\nimport { createAndroidManifestPlugin } from '../plugins/android-plugins';\n\nexport const withAllowBackup = createAndroidManifestPlugin(setAllowBackup, 'withAllowBackup');\n\nexport function getAllowBackup(config: Pick<ExpoConfig, 'android'>) {\n // Defaults to true.\n // https://docs.expo.dev/versions/latest/config/app/#allowbackup\n return config.android?.allowBackup ?? true;\n}\n\nexport function setAllowBackup(\n config: Pick<ExpoConfig, 'android'>,\n androidManifest: AndroidManifest\n) {\n const allowBackup = getAllowBackup(config);\n\n const mainApplication = getMainApplication(androidManifest);\n if (mainApplication?.$) {\n mainApplication.$['android:allowBackup'] = String(allowBackup) as StringBoolean;\n }\n\n return androidManifest;\n}\n\nexport function getAllowBackupFromManifest(androidManifest: AndroidManifest): boolean | null {\n const mainApplication = getMainApplication(androidManifest);\n\n if (mainApplication?.$) {\n return String(mainApplication.$['android:allowBackup']) === 'true';\n }\n\n return null;\n}\n"],"mappings":";;;;;;;;;AAGA,SAAAA,UAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,SAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,gBAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,eAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,MAAMG,eAAe,GAAAC,OAAA,CAAAD,eAAA,GAAG,IAAAE,6CAA2B,EAACC,cAAc,EAAE,iBAAiB,CAAC;AAEtF,SAASC,cAAcA,CAACC,MAAmC,EAAE;EAClE;EACA;EACA,OAAOA,MAAM,CAACC,OAAO,EAAEC,WAAW,IAAI,IAAI;AAC5C;AAEO,SAASJ,cAAcA,CAC5BE,MAAmC,EACnCG,eAAgC,EAChC;EACA,MAAMD,WAAW,GAAGH,cAAc,CAACC,MAAM,CAAC;EAE1C,MAAMI,eAAe,GAAG,IAAAC,8BAAkB,EAACF,eAAe,CAAC;EAC3D,IAAIC,eAAe,EAAEE,CAAC,EAAE;IACtBF,eAAe,CAACE,CAAC,CAAC,qBAAqB,CAAC,GAAGC,MAAM,CAACL,WAAW,CAAkB;EACjF;EAEA,OAAOC,eAAe;AACxB;AAEO,SAASK,0BAA0BA,CAACL,eAAgC,EAAkB;EAC3F,MAAMC,eAAe,GAAG,IAAAC,8BAAkB,EAACF,eAAe,CAAC;EAE3D,IAAIC,eAAe,EAAEE,CAAC,EAAE;IACtB,OAAOC,MAAM,CAACH,eAAe,CAACE,CAAC,CAAC,qBAAqB,CAAC,CAAC,KAAK,MAAM;EACpE;EAEA,OAAO,IAAI;AACb","ignoreList":[]}
@@ -1,7 +1,7 @@
1
1
  import type { ExpoConfig } from '@expo/config-types';
2
2
  import type { PropertiesItem } from './Properties';
3
3
  import type { ConfigPlugin } from '../Plugin.types';
4
- import { BuildPropertiesConfig, ConfigToPropertyRuleType } from '../utils/BuildProperties.types';
4
+ import type { BuildPropertiesConfig, ConfigToPropertyRuleType } from '../utils/BuildProperties.types';
5
5
  /**
6
6
  * Creates a `withGradleProperties` config-plugin based on given config to property mapping rules.
7
7
  *
@@ -1 +1 @@
1
- {"version":3,"file":"BuildProperties.js","names":["_androidPlugins","data","require","createBuildGradlePropsConfigPlugin","configToPropertyRules","name","withUnknown","config","sourceConfig","withGradleProperties","modResults","updateAndroidBuildPropertiesFromConfig","Object","defineProperty","value","withJsEngineGradleProps","exports","propName","propValueGetter","android","jsEngine","toString","gradleProperties","configToProperty","updateAndroidBuildProperty","options","oldPropIndex","findIndex","prop","type","key","oldProp","newProp","prevValue","JSON","parse","newValue","Array","isArray","prevArrayWithStringifiedValues","map","v","stringify","newArrayWithStringifiedValues","mergedValues","Set","push","removePropWhenValueIsNull","splice"],"sources":["../../src/android/BuildProperties.ts"],"sourcesContent":["import type { ExpoConfig } from '@expo/config-types';\n\nimport type { PropertiesItem } from './Properties';\nimport type { ConfigPlugin } from '../Plugin.types';\nimport { withGradleProperties } from '../plugins/android-plugins';\nimport { BuildPropertiesConfig, ConfigToPropertyRuleType } from '../utils/BuildProperties.types';\n\n/**\n * Creates a `withGradleProperties` config-plugin based on given config to property mapping rules.\n *\n * The factory supports two modes from generic type inference\n * ```ts\n * // config-plugin without `props`, it will implicitly use the expo config as source config.\n * createBuildGradlePropsConfigPlugin<ExpoConfig>(): ConfigPlugin<void>;\n *\n * // config-plugin with a parameter `props: CustomType`, it will use the `props` as source config.\n * createBuildGradlePropsConfigPlugin<CustomType>(): ConfigPlugin<CustomType>;\n * ```\n *\n * @param configToPropertyRules config to property mapping rules\n * @param name the config plugin name\n */\nexport function createBuildGradlePropsConfigPlugin<SourceConfigType extends BuildPropertiesConfig>(\n configToPropertyRules: ConfigToPropertyRuleType<SourceConfigType>[],\n name?: string\n) {\n const withUnknown: ConfigPlugin<SourceConfigType extends ExpoConfig ? void : SourceConfigType> = (\n config,\n sourceConfig\n ) =>\n withGradleProperties(config, (config) => {\n config.modResults = updateAndroidBuildPropertiesFromConfig(\n (sourceConfig ?? config) as SourceConfigType,\n config.modResults,\n configToPropertyRules\n );\n return config;\n });\n if (name) {\n Object.defineProperty(withUnknown, 'name', {\n value: name,\n });\n }\n return withUnknown;\n}\n\n/**\n * A config-plugin to update `android/gradle.properties` from the `jsEngine` in expo config\n */\nexport const withJsEngineGradleProps = createBuildGradlePropsConfigPlugin<ExpoConfig>(\n [\n {\n propName: 'hermesEnabled',\n propValueGetter: (config) =>\n ((config.android?.jsEngine ?? config.jsEngine ?? 'hermes') === 'hermes').toString(),\n },\n ],\n 'withJsEngineGradleProps'\n);\n\nexport function updateAndroidBuildPropertiesFromConfig<\n SourceConfigType extends BuildPropertiesConfig,\n>(\n config: SourceConfigType,\n gradleProperties: PropertiesItem[],\n configToPropertyRules: ConfigToPropertyRuleType<SourceConfigType>[]\n) {\n for (const configToProperty of configToPropertyRules) {\n const value = configToProperty.propValueGetter(config);\n updateAndroidBuildProperty(gradleProperties, configToProperty.propName, value);\n }\n\n return gradleProperties;\n}\n\nexport function updateAndroidBuildProperty(\n gradleProperties: PropertiesItem[],\n name: string,\n value: string | null | undefined,\n options?: { removePropWhenValueIsNull?: boolean }\n) {\n const oldPropIndex = gradleProperties.findIndex(\n (prop) => prop.type === 'property' && prop.key === name\n );\n const oldProp = oldPropIndex >= 0 ? gradleProperties[oldPropIndex] : null;\n if (value) {\n // found the matched value, add or merge new property\n const newProp: PropertiesItem = {\n type: 'property',\n key: name,\n value,\n };\n\n if (oldProp && oldProp.type === 'property') {\n try {\n const prevValue = JSON.parse(oldProp.value);\n const newValue = JSON.parse(value);\n if (Array.isArray(prevValue) && Array.isArray(newValue)) {\n const prevArrayWithStringifiedValues = prevValue.map((v) => JSON.stringify(v));\n const newArrayWithStringifiedValues = newValue.map((v) => JSON.stringify(v));\n const mergedValues = [\n ...new Set([...prevArrayWithStringifiedValues, ...newArrayWithStringifiedValues]),\n ].map((v) => JSON.parse(v));\n oldProp.value = JSON.stringify(mergedValues);\n return gradleProperties;\n }\n } catch {}\n oldProp.value = value;\n return gradleProperties;\n }\n\n gradleProperties.push(newProp);\n return gradleProperties;\n }\n if (options?.removePropWhenValueIsNull && oldPropIndex >= 0) {\n gradleProperties.splice(oldPropIndex, 1);\n return gradleProperties;\n }\n\n return gradleProperties;\n}\n"],"mappings":";;;;;;;;;AAIA,SAAAA,gBAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,eAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASE,kCAAkCA,CAChDC,qBAAmE,EACnEC,IAAa,EACb;EACA,MAAMC,WAAwF,GAAGA,CAC/FC,MAAM,EACNC,YAAY,KAEZ,IAAAC,sCAAoB,EAACF,MAAM,EAAGA,MAAM,IAAK;IACvCA,MAAM,CAACG,UAAU,GAAGC,sCAAsC,CACvDH,YAAY,IAAID,MAAM,EACvBA,MAAM,CAACG,UAAU,EACjBN,qBACF,CAAC;IACD,OAAOG,MAAM;EACf,CAAC,CAAC;EACJ,IAAIF,IAAI,EAAE;IACRO,MAAM,CAACC,cAAc,CAACP,WAAW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AS,GAAGC,IAAI,CAACC,KAAK,CAACJ,OAAO,CAACjB,KAAK,CAAC;QAC3C,MAAMsB,QAAQ,GAAGF,IAAI,CAACC,KAAK,CAACrB,KAAK,CAAC;QAClC,IAAIuB,KAAK,CAACC,OAAO,CAACL,SAAS,CAAC,IAAII,KAAK,CAACC,OAAO,CAACF,QAAQ,CAAC,EAAE;UACvD,MAAMG,8BAA8B,GAAGN,SAAS,CAACO,GAAG,CAAEC,CAAC,IAAKP,IAAI,CAACQ,SAAS,CAACD,CAAC,CAAC,CAAC;UAC9E,MAAME,6BAA6B,GAAGP,QAAQ,CAACI,GAAG,CAAEC,CAAC,IAAKP,IAAI,CAACQ,SAAS,CAACD,CAAC,CAAC,CAAC;UAC5E,MAAMG,YAAY,GAAG,CACnB,GAAG,IAAIC,GAAG,CAAC,CAAC,GAAGN,8BAA8B,EAAE,GAAGI,6BAA6B,CAAC,CAAC,CAClF,CAACH,GAAG,CAAEC,CAAC,IAAKP,IAAI,CAACC,KAAK,CAACM,CAAC,CAAC,CAAC;UAC3BV,OAAO,CAACjB,KAAK,GAAGoB,IAAI,CAACQ,SAAS,CAACE,YAAY,CAAC;UAC5C,OAAOtB,gBAAgB;QACzB;MACF,CAAC,CAAC,MAAM,CAAC;MACTS,OAAO,CAACjB,KAAK,GAAGA,KAAK;MACrB,OAAOQ,gBAAgB;IACzB;IAEAA,gBAAgB,CAACwB,IAAI,CAACd,OAAO,CAAC;IAC9B,OAAOV,gBAAgB;EACzB;EACA,IAAIG,OAAO,EAAEsB,yBAAyB,IAAIrB,YAAY,IAAI,CAAC,EAAE;IAC3DJ,gBAAgB,CAAC0B,MAAM,CAACtB,YAAY,EAAE,CAAC,CAAC;IACxC,OAAOJ,gBAAgB;EACzB;EAEA,OAAOA,gBAAgB;AACzB","ignoreList":[]}
1
+ {"version":3,"file":"BuildProperties.js","names":["_androidPlugins","data","require","createBuildGradlePropsConfigPlugin","configToPropertyRules","name","withUnknown","config","sourceConfig","withGradleProperties","modResults","updateAndroidBuildPropertiesFromConfig","Object","defineProperty","value","withJsEngineGradleProps","exports","propName","propValueGetter","android","jsEngine","toString","gradleProperties","configToProperty","updateAndroidBuildProperty","options","oldPropIndex","findIndex","prop","type","key","oldProp","newProp","prevValue","JSON","parse","newValue","Array","isArray","prevArrayWithStringifiedValues","map","v","stringify","newArrayWithStringifiedValues","mergedValues","Set","push","removePropWhenValueIsNull","splice"],"sources":["../../src/android/BuildProperties.ts"],"sourcesContent":["import type { ExpoConfig } from '@expo/config-types';\n\nimport type { PropertiesItem } from './Properties';\nimport type { ConfigPlugin } from '../Plugin.types';\nimport { withGradleProperties } from '../plugins/android-plugins';\nimport type {\n BuildPropertiesConfig,\n ConfigToPropertyRuleType,\n} from '../utils/BuildProperties.types';\n\n/**\n * Creates a `withGradleProperties` config-plugin based on given config to property mapping rules.\n *\n * The factory supports two modes from generic type inference\n * ```ts\n * // config-plugin without `props`, it will implicitly use the expo config as source config.\n * createBuildGradlePropsConfigPlugin<ExpoConfig>(): ConfigPlugin<void>;\n *\n * // config-plugin with a parameter `props: CustomType`, it will use the `props` as source config.\n * createBuildGradlePropsConfigPlugin<CustomType>(): ConfigPlugin<CustomType>;\n * ```\n *\n * @param configToPropertyRules config to property mapping rules\n * @param name the config plugin name\n */\nexport function createBuildGradlePropsConfigPlugin<SourceConfigType extends BuildPropertiesConfig>(\n configToPropertyRules: ConfigToPropertyRuleType<SourceConfigType>[],\n name?: string\n) {\n const withUnknown: ConfigPlugin<SourceConfigType extends ExpoConfig ? void : SourceConfigType> = (\n config,\n sourceConfig\n ) =>\n withGradleProperties(config, (config) => {\n config.modResults = updateAndroidBuildPropertiesFromConfig(\n (sourceConfig ?? config) as SourceConfigType,\n config.modResults,\n configToPropertyRules\n );\n return config;\n });\n if (name) {\n Object.defineProperty(withUnknown, 'name', {\n value: name,\n });\n }\n return withUnknown;\n}\n\n/**\n * A config-plugin to update `android/gradle.properties` from the `jsEngine` in expo config\n */\nexport const withJsEngineGradleProps = createBuildGradlePropsConfigPlugin<ExpoConfig>(\n [\n {\n propName: 'hermesEnabled',\n propValueGetter: (config) =>\n (\n ((config.android as any)?.jsEngine ?? (config as any).jsEngine ?? 'hermes') === 'hermes'\n ).toString(),\n },\n ],\n 'withJsEngineGradleProps'\n);\n\nexport function updateAndroidBuildPropertiesFromConfig<\n SourceConfigType extends BuildPropertiesConfig,\n>(\n config: SourceConfigType,\n gradleProperties: PropertiesItem[],\n configToPropertyRules: ConfigToPropertyRuleType<SourceConfigType>[]\n) {\n for (const configToProperty of configToPropertyRules) {\n const value = configToProperty.propValueGetter(config);\n updateAndroidBuildProperty(gradleProperties, configToProperty.propName, value);\n }\n\n return gradleProperties;\n}\n\nexport function updateAndroidBuildProperty(\n gradleProperties: PropertiesItem[],\n name: string,\n value: string | null | undefined,\n options?: { removePropWhenValueIsNull?: boolean }\n) {\n const oldPropIndex = gradleProperties.findIndex(\n (prop) => prop.type === 'property' && prop.key === name\n );\n const oldProp = oldPropIndex >= 0 ? gradleProperties[oldPropIndex] : null;\n if (value) {\n // found the matched value, add or merge new property\n const newProp: PropertiesItem = {\n type: 'property',\n key: name,\n value,\n };\n\n if (oldProp && oldProp.type === 'property') {\n try {\n const prevValue = JSON.parse(oldProp.value);\n const newValue = JSON.parse(value);\n if (Array.isArray(prevValue) && Array.isArray(newValue)) {\n const prevArrayWithStringifiedValues = prevValue.map((v) => JSON.stringify(v));\n const newArrayWithStringifiedValues = newValue.map((v) => JSON.stringify(v));\n const mergedValues = [\n ...new Set([...prevArrayWithStringifiedValues, ...newArrayWithStringifiedValues]),\n ].map((v) => JSON.parse(v));\n oldProp.value = JSON.stringify(mergedValues);\n return gradleProperties;\n }\n } catch {}\n oldProp.value = value;\n return gradleProperties;\n }\n\n gradleProperties.push(newProp);\n return gradleProperties;\n }\n if (options?.removePropWhenValueIsNull && oldPropIndex >= 0) {\n gradleProperties.splice(oldPropIndex, 1);\n return gradleProperties;\n }\n\n return gradleProperties;\n}\n"],"mappings":";;;;;;;;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ACjB,KAAK,GAAGoB,IAAI,CAACQ,SAAS,CAACE,YAAY,CAAC;UAC5C,OAAOtB,gBAAgB;QACzB;MACF,CAAC,CAAC,MAAM,CAAC;MACTS,OAAO,CAACjB,KAAK,GAAGA,KAAK;MACrB,OAAOQ,gBAAgB;IACzB;IAEAA,gBAAgB,CAACwB,IAAI,CAACd,OAAO,CAAC;IAC9B,OAAOV,gBAAgB;EACzB;EACA,IAAIG,OAAO,EAAEsB,yBAAyB,IAAIrB,YAAY,IAAI,CAAC,EAAE;IAC3DJ,gBAAgB,CAAC0B,MAAM,CAACtB,YAAY,EAAE,CAAC,CAAC;IACxC,OAAOJ,gBAAgB;EACzB;EAEA,OAAOA,gBAAgB;AACzB","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- import { ResourceItemXML, ResourceKind, ResourceXML } from './Resources';
1
+ import type { ResourceItemXML, ResourceKind, ResourceXML } from './Resources';
2
2
  export declare function getProjectColorsXMLPathAsync(projectRoot: string, { kind }?: {
3
3
  kind?: ResourceKind;
4
4
  }): Promise<string>;
@@ -1 +1 @@
1
- {"version":3,"file":"Colors.js","names":["_Paths","data","require","_Resources","getProjectColorsXMLPathAsync","projectRoot","kind","getResourceXMLPathAsync","name","setColorItem","itemToAdd","colorFileContentsJSON","resources","color","colorNameExists","filter","e","$","_","push","removeColorItem","named","contents","index","findIndex","splice","assignColorValue","xml","value","buildResourceItem","getColorsAsObject","getResourceItemsAsObject","getObjectAsColorsXml","obj","getObjectAsResourceItems"],"sources":["../../src/android/Colors.ts"],"sourcesContent":["import { getResourceXMLPathAsync } from './Paths';\nimport {\n buildResourceItem,\n getObjectAsResourceItems,\n getResourceItemsAsObject,\n ResourceItemXML,\n ResourceKind,\n ResourceXML,\n} from './Resources';\n\nexport function getProjectColorsXMLPathAsync(\n projectRoot: string,\n { kind }: { kind?: ResourceKind } = {}\n) {\n return getResourceXMLPathAsync(projectRoot, { kind, name: 'colors' });\n}\n\nexport function setColorItem(itemToAdd: ResourceItemXML, colorFileContentsJSON: ResourceXML) {\n if (colorFileContentsJSON.resources?.color) {\n const colorNameExists = colorFileContentsJSON.resources.color.filter(\n (e: ResourceItemXML) => e.$.name === itemToAdd.$.name\n )[0];\n if (colorNameExists) {\n colorNameExists._ = itemToAdd._;\n } else {\n colorFileContentsJSON.resources.color.push(itemToAdd);\n }\n } else {\n if (!colorFileContentsJSON.resources || typeof colorFileContentsJSON.resources === 'string') {\n //file was empty and JSON is `{resources : ''}`\n colorFileContentsJSON.resources = {};\n }\n colorFileContentsJSON.resources.color = [itemToAdd];\n }\n return colorFileContentsJSON;\n}\n\nexport function removeColorItem(named: string, contents: ResourceXML) {\n if (contents.resources?.color) {\n const index = contents.resources.color.findIndex((e: ResourceItemXML) => e.$.name === named);\n if (index > -1) {\n // replace the previous value\n contents.resources.color.splice(index, 1);\n }\n }\n return contents;\n}\n\n/**\n * Set or remove value in XML based on nullish factor of the `value` property.\n */\nexport function assignColorValue(\n xml: ResourceXML,\n {\n value,\n name,\n }: {\n value?: string | null;\n name: string;\n }\n) {\n if (value) {\n return setColorItem(\n buildResourceItem({\n name,\n value,\n }),\n xml\n );\n }\n\n return removeColorItem(name, xml);\n}\n\n/**\n * Helper to convert a basic XML object into a simple k/v pair.\n * `colors.xml` is a very basic XML file so this is pretty safe to do.\n * Added for testing purposes.\n *\n * @param xml\n * @returns\n */\nexport function getColorsAsObject(xml: ResourceXML): Record<string, string> | null {\n if (!xml?.resources?.color) {\n return null;\n }\n\n return getResourceItemsAsObject(xml.resources.color);\n}\n\n/**\n * Helper to convert a basic k/v object to a colors XML object.\n *\n * @param xml\n * @returns\n */\nexport function getObjectAsColorsXml(obj: Record<string, string>): ResourceXML {\n return {\n resources: {\n color: getObjectAsResourceItems(obj),\n },\n };\n}\n"],"mappings":";;;;;;;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA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B,IAAKA,CAAC,CAACC,CAAC,CAACT,IAAI,KAAKa,KAAK,CAAC;IAC5F,IAAIE,KAAK,GAAG,CAAC,CAAC,EAAE;MACd;MACAD,QAAQ,CAACV,SAAS,CAACC,KAAK,CAACY,MAAM,CAACF,KAAK,EAAE,CAAC,CAAC;IAC3C;EACF;EACA,OAAOD,QAAQ;AACjB;;AAEA;AACA;AACA;AACO,SAASI,gBAAgBA,CAC9BC,GAAgB,EAChB;EACEC,KAAK;EACLpB;AAIF,CAAC,EACD;EACA,IAAIoB,KAAK,EAAE;IACT,OAAOnB,YAAY,CACjB,IAAAoB,8BAAiB,EAAC;MAChBrB,IAAI;MACJoB;IACF,CAAC,CAAC,EACFD,GACF,CAAC;EACH;EAEA,OAAOP,eAAe,CAACZ,IAAI,EAAEmB,GAAG,CAAC;AACnC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASG,iBAAiBA,CAACH,GAAgB,EAAiC;EACjF,IAAI,CAACA,GAAG,EAAEf,SAAS,EAAEC,KAAK,EAAE;IAC1B,OAAO,IAAI;EACb;EAEA,OAAO,IAAAkB,qCAAwB,EAACJ,GAAG,CAACf,SAAS,CAACC,KAAK,CAAC;AACtD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,SAASmB,oBAAoBA,CAACC,GAA2B,EAAe;EAC7E,OAAO;IACLrB,SAAS,EAAE;MACTC,KAAK,EAAE,IAAAqB,qCAAwB,EAACD,GAAG;IACrC;EACF,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"file":"Colors.js","names":["_Paths","data","require","_Resources","getProjectColorsXMLPathAsync","projectRoot","kind","getResourceXMLPathAsync","name","setColorItem","itemToAdd","colorFileContentsJSON","resources","color","colorNameExists","filter","e","$","_","push","removeColorItem","named","contents","index","findIndex","splice","assignColorValue","xml","value","buildResourceItem","getColorsAsObject","getResourceItemsAsObject","getObjectAsColorsXml","obj","getObjectAsResourceItems"],"sources":["../../src/android/Colors.ts"],"sourcesContent":["import { getResourceXMLPathAsync } from './Paths';\nimport type { ResourceItemXML, ResourceKind, ResourceXML } from './Resources';\nimport { buildResourceItem, getObjectAsResourceItems, getResourceItemsAsObject } from './Resources';\n\nexport function getProjectColorsXMLPathAsync(\n projectRoot: string,\n { kind }: { kind?: ResourceKind } = {}\n) {\n return getResourceXMLPathAsync(projectRoot, { kind, name: 'colors' });\n}\n\nexport function setColorItem(itemToAdd: ResourceItemXML, colorFileContentsJSON: ResourceXML) {\n if (colorFileContentsJSON.resources?.color) {\n const colorNameExists = colorFileContentsJSON.resources.color.filter(\n (e: ResourceItemXML) => e.$.name === itemToAdd.$.name\n )[0];\n if (colorNameExists) {\n colorNameExists._ = itemToAdd._;\n } else {\n colorFileContentsJSON.resources.color.push(itemToAdd);\n }\n } else {\n if (!colorFileContentsJSON.resources || typeof colorFileContentsJSON.resources === 'string') {\n //file was empty and JSON is `{resources : ''}`\n colorFileContentsJSON.resources = {};\n }\n colorFileContentsJSON.resources.color = [itemToAdd];\n }\n return colorFileContentsJSON;\n}\n\nexport function removeColorItem(named: string, contents: ResourceXML) {\n if (contents.resources?.color) {\n const index = contents.resources.color.findIndex((e: ResourceItemXML) => e.$.name === named);\n if (index > -1) {\n // replace the previous value\n contents.resources.color.splice(index, 1);\n }\n }\n return contents;\n}\n\n/**\n * Set or remove value in XML based on nullish factor of the `value` property.\n */\nexport function assignColorValue(\n xml: ResourceXML,\n {\n value,\n name,\n }: {\n value?: string | null;\n name: string;\n }\n) {\n if (value) {\n return setColorItem(\n buildResourceItem({\n name,\n value,\n }),\n xml\n );\n }\n\n return removeColorItem(name, xml);\n}\n\n/**\n * Helper to convert a basic XML object into a simple k/v pair.\n * `colors.xml` is a very basic XML file so this is pretty safe to do.\n * Added for testing purposes.\n *\n * @param xml\n * @returns\n */\nexport function getColorsAsObject(xml: ResourceXML): Record<string, string> | null {\n if (!xml?.resources?.color) {\n return null;\n }\n\n return getResourceItemsAsObject(xml.resources.color);\n}\n\n/**\n * Helper to convert a basic k/v object to a colors XML object.\n *\n * @param xml\n * @returns\n */\nexport function getObjectAsColorsXml(obj: Record<string, string>): ResourceXML {\n return {\n resources: {\n color: getObjectAsResourceItems(obj),\n },\n };\n}\n"],"mappings":";;;;;;;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAE,WAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,UAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,SAASG,4BAA4BA,CAC1CC,WAAmB,EACnB;EAAEC;AAA8B,CAAC,GAAG,CAAC,CAAC,EACtC;EACA,OAAO,IAAAC,gCAAuB,EAACF,WAAW,EAAE;IAAEC,IAAI;IAAEE,IAAI,EAAE;EAAS,CAAC,CAAC;AACvE;AAEO,SAASC,YAAYA,CAACC,SAA0B,EAAEC,qBAAkC,EAAE;EAC3F,IAAIA,qBAAqB,CAACC,SAAS,EAAEC,KAAK,EAAE;IAC1C,MAAMC,eAAe,GAAGH,qBAAqB,CAACC,SAAS,CAACC,KAAK,CAACE,MAAM,CACjEC,CAAkB,IAAKA,CAAC,CAACC,CAAC,CAACT,IAAI,KAAKE,SAAS,CAACO,CAAC,CAACT,IACnD,CAAC,CAAC,CAAC,CAAC;IACJ,IAAIM,eAAe,EAAE;MACnBA,eAAe,CAACI,CAAC,GAAGR,SAAS,CAACQ,CAAC;IACjC,CAAC,MAAM;MACLP,qBAAqB,CAACC,SAAS,CAACC,KAAK,CAACM,IAAI,CAACT,SAAS,CAAC;IACvD;EACF,CAAC,MAAM;IACL,IAAI,CAACC,qBAAqB,CAACC,SAAS,IAAI,OAAOD,qBAAqB,CAACC,SAAS,KAAK,QAAQ,EAAE;MAC3F;MACAD,qBAAqB,CAACC,SAAS,GAAG,CAAC,CAAC;IACtC;IACAD,qBA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paths() {
34
34
  };
35
35
  return data;
36
36
  }
37
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
38
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
37
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
39
38
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
40
39
  const APPLY_EAS_GRADLE = 'apply from: "./eas-build.gradle"';
41
40
  function hasApplyLine(content, applyLine) {
@@ -1 +1 @@
1
- {"version":3,"file":"EasBuild.js","names":["_fs","data","_interopRequireDefault","require","_path","_EasBuildGradleScript","Paths","_interopRequireWildcard","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","APPLY_EAS_GRADLE","hasApplyLine","content","applyLine","replace","split","some","line","getEasBuildGradlePath","projectRoot","path","join","configureEasBuildAsync","buildGradlePath","getAppBuildGradleFilePath","easGradlePath","fs","promises","writeFile","gradleScript","buildGradleContent","readFile","hasEasGradleApply","trim","isEasBuildGradleConfiguredAsync","hasEasGradleFile","existsSync"],"sources":["../../src/android/EasBuild.ts"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\n\nimport gradleScript from './EasBuildGradleScript';\nimport * as Paths from './Paths';\n\nconst APPLY_EAS_GRADLE = 'apply from: \"./eas-build.gradle\"';\n\nfunction hasApplyLine(content: string, applyLine: string): boolean {\n return (\n content\n .replace(/\\r\\n/g, '\\n')\n .split('\\n')\n // Check for both single and double quotes\n .some((line) => line === applyLine || line === applyLine.replace(/\"/g, \"'\"))\n );\n}\n\nexport function getEasBuildGradlePath(projectRoot: string): string {\n return path.join(projectRoot, 'android', 'app', 'eas-build.gradle');\n}\n\nexport async function configureEasBuildAsync(projectRoot: string): Promise<void> {\n const buildGradlePath = Paths.getAppBuildGradleFilePath(projectRoot);\n const easGradlePath = getEasBuildGradlePath(projectRoot);\n\n await fs.promises.writeFile(easGradlePath, gradleScript);\n\n const buildGradleContent = await fs.promises.readFile(path.join(buildGradlePath), 'utf8');\n\n const hasEasGradleApply = hasApplyLine(buildGradleContent, APPLY_EAS_GRADLE);\n\n if (!hasEasGradleApply) {\n await fs.promises.writeFile(\n buildGradlePath,\n `${buildGradleContent.trim()}\\n${APPLY_EAS_GRADLE}\\n`\n );\n }\n}\n\nexport async function isEasBuildGradleConfiguredAsync(projectRoot: string): Promise<boolean> {\n const buildGradlePath = Paths.getAppBuildGradleFilePath(projectRoot);\n const easGradlePath = getEasBuildGradlePath(projectRoot);\n\n const hasEasGradleFile = await fs.existsSync(easGradlePath);\n\n const buildGradleContent = await fs.promises.readFile(path.join(buildGradlePath), 'utf8');\n const hasEasGradleApply = hasApplyLine(buildGradleContent, APPLY_EAS_GRADLE);\n\n return hasEasGradleApply && hasEasGradleFile;\n}\n"],"mappings":";;;;;;;;AAAA,SAAAA,IAAA;EAAA,MAAAC,IAAA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J,aAAE,CAACC,QAAQ,CAACI,QAAQ,CAACX,eAAI,CAACC,IAAI,CAACE,eAAe,CAAC,EAAE,MAAM,CAAC;EAEzF,MAAMS,iBAAiB,GAAGrB,YAAY,CAACmB,kBAAkB,EAAEpB,gBAAgB,CAAC;EAE5E,IAAI,CAACsB,iBAAiB,EAAE;IACtB,MAAMN,aAAE,CAACC,QAAQ,CAACC,SAAS,CACzBL,eAAe,EACf,GAAGO,kBAAkB,CAACG,IAAI,CAAC,CAAC,KAAKvB,gBAAgB,IACnD,CAAC;EACH;AACF;AAEO,eAAewB,+BAA+BA,CAACf,WAAmB,EAAoB;EAC3F,MAAMI,eAAe,GAAGnC,KAAK,CAAD,CAAC,CAACoC,yBAAyB,CAACL,WAAW,CAAC;EACpE,MAAMM,aAAa,GAAGP,qBAAqB,CAACC,WAAW,CAAC;EAExD,MAAMgB,gBAAgB,GAAG,MAAMT,aAAE,CAACU,UAAU,CAACX,aAAa,CAAC;EAE3D,MAAMK,kBAAkB,GAAG,MAAMJ,aAAE,CAACC,QAAQ,CAACI,QAAQ,CAACX,eAAI,CAACC,IAAI,CAACE,eAAe,CAAC,EAAE,MAAM,CAAC;EACzF,MAAMS,iBAAiB,GAAGrB,YAAY,CAACmB,kBAAkB,EAAEpB,gBAAgB,CAAC;EAE5E,OAAOsB,iBAAiB,IAAIG,gBAAgB;AAC9C","ignoreList":[]}
1
+ {"version":3,"file":"EasBuild.js","names":["_fs","data","_interopRequireDefault","require","_path","_EasBuildGradleScript","Paths","_interopRequireWildcard","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","APPLY_EAS_GRADLE","hasApplyLine","content","applyLine","replace","split","some","line","getEasBuildGradlePath","projectRoot","path","join","configureEasBuildAsync","buildGradlePath","getAppBuildGradleFilePath","easGradlePath","fs","promises","writeFile","gradleScript","buildGradleContent","readFile","hasEasGradleApply","trim","isEasBuildGradleConfiguredAsync","hasEasGradleFile","existsSync"],"sources":["../../src/android/EasBuild.ts"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\n\nimport gradleScript from './EasBuildGradleScript';\nimport * as Paths from './Paths';\n\nconst APPLY_EAS_GRADLE = 'apply from: \"./eas-build.gradle\"';\n\nfunction hasApplyLine(content: string, applyLine: string): boolean {\n return (\n content\n .replace(/\\r\\n/g, '\\n')\n .split('\\n')\n // Check for both single and double quotes\n .some((line) => line === applyLine || line === applyLine.replace(/\"/g, \"'\"))\n );\n}\n\nexport function getEasBuildGradlePath(projectRoot: string): string {\n return path.join(projectRoot, 'android', 'app', 'eas-build.gradle');\n}\n\nexport async function configureEasBuildAsync(projectRoot: string): Promise<void> {\n const buildGradlePath = Paths.getAppBuildGradleFilePath(projectRoot);\n const easGradlePath = getEasBuildGradlePath(projectRoot);\n\n await fs.promises.writeFile(easGradlePath, gradleScript);\n\n const buildGradleContent = await fs.promises.readFile(path.join(buildGradlePath), 'utf8');\n\n const hasEasGradleApply = hasApplyLine(buildGradleContent, APPLY_EAS_GRADLE);\n\n if (!hasEasGradleApply) {\n await fs.promises.writeFile(\n buildGradlePath,\n `${buildGradleContent.trim()}\\n${APPLY_EAS_GRADLE}\\n`\n );\n }\n}\n\nexport async function isEasBuildGradleConfiguredAsync(projectRoot: string): Promise<boolean> {\n const buildGradlePath = Paths.getAppBuildGradleFilePath(projectRoot);\n const easGradlePath = getEasBuildGradlePath(projectRoot);\n\n const hasEasGradleFile = await fs.existsSync(easGradlePath);\n\n const buildGradleContent = await fs.promises.readFile(path.join(buildGradlePath), 'utf8');\n const hasEasGradleApply = hasApplyLine(buildGradleContent, APPLY_EAS_GRADLE);\n\n return hasEasGradleApply && hasEasGradleFile;\n}\n"],"mappings":";;;;;;;;AAAA,SAAAA,IAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,GAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,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,CAACC,SAAS,CACzBL,eAAe,EACf,GAAGO,kBAAkB,CAACG,IAAI,CAAC,CAAC,KAAKvB,gBAAgB,IACnD,CAAC;EACH;AACF;AAEO,eAAewB,+BAA+BA,CAACf,WAAmB,EAAoB;EAC3F,MAAMI,eAAe,GAAGlC,KAAK,CAAD,CAAC,CAACmC,yBAAyB,CAACL,WAAW,CAAC;EACpE,MAAMM,aAAa,GAAGP,qBAAqB,CAACC,WAAW,CAAC;EAExD,MAAMgB,gBAAgB,GAAG,MAAMT,aAAE,CAACU,UAAU,CAACX,aAAa,CAAC;EAE3D,MAAMK,kBAAkB,GAAG,MAAMJ,aAAE,CAACC,QAAQ,CAACI,QAAQ,CAACX,eAAI,CAACC,IAAI,CAACE,eAAe,CAAC,EAAE,MAAM,CAAC;EACzF,MAAMS,iBAAiB,GAAGrB,YAAY,CAACmB,kBAAkB,EAAEpB,gBAAgB,CAAC;EAE5E,OAAOsB,iBAAiB,IAAIG,gBAAgB;AAC9C","ignoreList":[]}
@@ -1,5 +1,5 @@
1
- import { ExpoConfig } from '@expo/config-types';
2
- import { AndroidManifest } from './Manifest';
1
+ import type { ExpoConfig } from '@expo/config-types';
2
+ import type { AndroidManifest } from './Manifest';
3
3
  export declare const withGoogleMapsApiKey: import("..").ConfigPlugin;
4
4
  export declare function getGoogleMapsApiKey(config: Pick<ExpoConfig, 'android'>): string | null;
5
5
  export declare function setGoogleMapsApiKey(config: Pick<ExpoConfig, 'android'>, androidManifest: AndroidManifest): AndroidManifest;
@@ -1 +1 @@
1
- {"version":3,"file":"GoogleMapsApiKey.js","names":["_Manifest","data","require","_androidPlugins","META_API_KEY","LIB_HTTP","withGoogleMapsApiKey","exports","createAndroidManifestPlugin","setGoogleMapsApiKey","getGoogleMapsApiKey","config","android","googleMaps","apiKey","androidManifest","mainApplication","getMainApplicationOrThrow","addMetaDataItemToMainApplication","addUsesLibraryItemToMainApplication","name","required","removeMetaDataItemFromMainApplication","removeUsesLibraryItemFromMainApplication"],"sources":["../../src/android/GoogleMapsApiKey.ts"],"sourcesContent":["import { ExpoConfig } from '@expo/config-types';\n\nimport {\n addMetaDataItemToMainApplication,\n addUsesLibraryItemToMainApplication,\n AndroidManifest,\n getMainApplicationOrThrow,\n removeMetaDataItemFromMainApplication,\n removeUsesLibraryItemFromMainApplication,\n} from './Manifest';\nimport { createAndroidManifestPlugin } from '../plugins/android-plugins';\n\nconst META_API_KEY = 'com.google.android.geo.API_KEY';\nconst LIB_HTTP = 'org.apache.http.legacy';\n\nexport const withGoogleMapsApiKey = createAndroidManifestPlugin(\n setGoogleMapsApiKey,\n 'withGoogleMapsApiKey'\n);\n\nexport function getGoogleMapsApiKey(config: Pick<ExpoConfig, 'android'>) {\n return config.android?.config?.googleMaps?.apiKey ?? null;\n}\n\nexport function setGoogleMapsApiKey(\n config: Pick<ExpoConfig, 'android'>,\n androidManifest: AndroidManifest\n) {\n const apiKey = getGoogleMapsApiKey(config);\n const mainApplication = getMainApplicationOrThrow(androidManifest);\n\n if (apiKey) {\n // If the item exists, add it back\n addMetaDataItemToMainApplication(mainApplication, META_API_KEY, apiKey);\n addUsesLibraryItemToMainApplication(mainApplication, {\n name: LIB_HTTP,\n required: false,\n });\n } else {\n // Remove any existing item\n removeMetaDataItemFromMainApplication(mainApplication, META_API_KEY);\n removeUsesLibraryItemFromMainApplication(mainApplication, LIB_HTTP);\n }\n\n return androidManifest;\n}\n"],"mappings":";;;;;;;;AAEA,SAAAA,UAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,SAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAQA,SAAAE,gBAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,eAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,MAAMG,YAAY,GAAG,gCAAgC;AACrD,MAAMC,QAAQ,GAAG,wBAAwB;AAElC,MAAMC,oBAAoB,GAAAC,OAAA,CAAAD,oBAAA,GAAG,IAAAE,6CAA2B,EAC7DC,mBAAmB,EACnB,sBACF,CAAC;AAEM,SAASC,mBAAmBA,CAACC,MAAmC,EAAE;EACvE,OAAOA,MAAM,CAACC,OAAO,EAAED,MAAM,EAAEE,UAAU,EAAEC,MAAM,IAAI,IAAI;AAC3D;AAEO,SAASL,mBAAmBA,CACjCE,MAAmC,EACnCI,eAAgC,EAChC;EACA,MAAMD,MAAM,GAAGJ,mBAAmB,CAACC,MAAM,CAAC;EAC1C,MAAMK,eAAe,GAAG,IAAAC,qCAAyB,EAACF,eAAe,CAAC;EAElE,IAAID,MAAM,EAAE;IACV;IACA,IAAAI,4CAAgC,EAACF,eAAe,EAAEZ,YAAY,EAAEU,MAAM,CAAC;IACvE,IAAAK,+CAAmC,EAACH,eAAe,EAAE;MACnDI,IAAI,EAAEf,QAAQ;MACdgB,QAAQ,EAAE;IACZ,CAAC,CAAC;EACJ,CAAC,MAAM;IACL;IACA,IAAAC,iDAAqC,EAACN,eAAe,EAAEZ,YAAY,CAAC;IACpE,IAAAmB,oDAAwC,EAACP,eAAe,EAAEX,QAAQ,CAAC;EACrE;EAEA,OAAOU,eAAe;AACxB","ignoreList":[]}
1
+ {"version":3,"file":"GoogleMapsApiKey.js","names":["_Manifest","data","require","_androidPlugins","META_API_KEY","LIB_HTTP","withGoogleMapsApiKey","exports","createAndroidManifestPlugin","setGoogleMapsApiKey","getGoogleMapsApiKey","config","android","googleMaps","apiKey","androidManifest","mainApplication","getMainApplicationOrThrow","addMetaDataItemToMainApplication","addUsesLibraryItemToMainApplication","name","required","removeMetaDataItemFromMainApplication","removeUsesLibraryItemFromMainApplication"],"sources":["../../src/android/GoogleMapsApiKey.ts"],"sourcesContent":["import type { ExpoConfig } from '@expo/config-types';\n\nimport type { AndroidManifest } from './Manifest';\nimport {\n addMetaDataItemToMainApplication,\n addUsesLibraryItemToMainApplication,\n getMainApplicationOrThrow,\n removeMetaDataItemFromMainApplication,\n removeUsesLibraryItemFromMainApplication,\n} from './Manifest';\nimport { createAndroidManifestPlugin } from '../plugins/android-plugins';\n\nconst META_API_KEY = 'com.google.android.geo.API_KEY';\nconst LIB_HTTP = 'org.apache.http.legacy';\n\nexport const withGoogleMapsApiKey = createAndroidManifestPlugin(\n setGoogleMapsApiKey,\n 'withGoogleMapsApiKey'\n);\n\nexport function getGoogleMapsApiKey(config: Pick<ExpoConfig, 'android'>) {\n return config.android?.config?.googleMaps?.apiKey ?? null;\n}\n\nexport function setGoogleMapsApiKey(\n config: Pick<ExpoConfig, 'android'>,\n androidManifest: AndroidManifest\n) {\n const apiKey = getGoogleMapsApiKey(config);\n const mainApplication = getMainApplicationOrThrow(androidManifest);\n\n if (apiKey) {\n // If the item exists, add it back\n addMetaDataItemToMainApplication(mainApplication, META_API_KEY, apiKey);\n addUsesLibraryItemToMainApplication(mainApplication, {\n name: LIB_HTTP,\n required: false,\n });\n } else {\n // Remove any existing item\n removeMetaDataItemFromMainApplication(mainApplication, META_API_KEY);\n removeUsesLibraryItemFromMainApplication(mainApplication, LIB_HTTP);\n }\n\n return androidManifest;\n}\n"],"mappings":";;;;;;;;AAGA,SAAAA,UAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,SAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAOA,SAAAE,gBAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,eAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,MAAMG,YAAY,GAAG,gCAAgC;AACrD,MAAMC,QAAQ,GAAG,wBAAwB;AAElC,MAAMC,oBAAoB,GAAAC,OAAA,CAAAD,oBAAA,GAAG,IAAAE,6CAA2B,EAC7DC,mBAAmB,EACnB,sBACF,CAAC;AAEM,SAASC,mBAAmBA,CAACC,MAAmC,EAAE;EACvE,OAAOA,MAAM,CAACC,OAAO,EAAED,MAAM,EAAEE,UAAU,EAAEC,MAAM,IAAI,IAAI;AAC3D;AAEO,SAASL,mBAAmBA,CACjCE,MAAmC,EACnCI,eAAgC,EAChC;EACA,MAAMD,MAAM,GAAGJ,mBAAmB,CAACC,MAAM,CAAC;EAC1C,MAAMK,eAAe,GAAG,IAAAC,qCAAyB,EAACF,eAAe,CAAC;EAElE,IAAID,MAAM,EAAE;IACV;IACA,IAAAI,4CAAgC,EAACF,eAAe,EAAEZ,YAAY,EAAEU,MAAM,CAAC;IACvE,IAAAK,+CAAmC,EAACH,eAAe,EAAE;MACnDI,IAAI,EAAEf,QAAQ;MACdgB,QAAQ,EAAE;IACZ,CAAC,CAAC;EACJ,CAAC,MAAM;IACL;IACA,IAAAC,iDAAqC,EAACN,eAAe,EAAEZ,YAAY,CAAC;IACpE,IAAAmB,oDAAwC,EAACP,eAAe,EAAEX,QAAQ,CAAC;EACrE;EAEA,OAAOU,eAAe;AACxB","ignoreList":[]}
@@ -1,5 +1,5 @@
1
- import { ExpoConfig } from '@expo/config-types';
2
- import { ConfigPlugin } from '../Plugin.types';
1
+ import type { ExpoConfig } from '@expo/config-types';
2
+ import type { ConfigPlugin } from '../Plugin.types';
3
3
  export declare const withClassPath: ConfigPlugin;
4
4
  export declare const withApplyPlugin: ConfigPlugin;
5
5
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"GoogleServices.js","names":["_path","data","_interopRequireDefault","require","_androidPlugins","_withDangerousMod","_fs","_warnings","e","__esModule","default","DEFAULT_TARGET_PATH","googleServicesClassPath","googleServicesPlugin","googleServicesVersion","withClassPath","config","withProjectBuildGradle","modResults","language","contents","setClassPath","addWarningAndroid","exports","withApplyPlugin","withAppBuildGradle","applyPlugin","withGoogleServicesFile","withDangerousMod","setGoogleServicesFile","modRequest","projectRoot","getGoogleServicesFilePath","android","googleServicesFile","targetPath","partialSourcePath","completeSourcePath","path","resolve","destinationPath","copyFilePathToPathAsync","console","log","Error","buildGradle","includes","replace","appBuildGradle","pattern","RegExp","match"],"sources":["../../src/android/GoogleServices.ts"],"sourcesContent":["import { ExpoConfig } from '@expo/config-types';\nimport path from 'path';\n\nimport { ConfigPlugin } from '../Plugin.types';\nimport { withAppBuildGradle, withProjectBuildGradle } from '../plugins/android-plugins';\nimport { withDangerousMod } from '../plugins/withDangerousMod';\nimport { copyFilePathToPathAsync } from '../utils/fs';\nimport { addWarningAndroid } from '../utils/warnings';\n\nconst DEFAULT_TARGET_PATH = './android/app/google-services.json';\n\nconst googleServicesClassPath = 'com.google.gms:google-services';\nconst googleServicesPlugin = 'com.google.gms.google-services';\n\n// NOTE(brentvatne): This may be annoying to keep up to date...\nconst googleServicesVersion = '4.4.1';\n\nexport const withClassPath: ConfigPlugin = (config) => {\n return withProjectBuildGradle(config, (config) => {\n if (config.modResults.language === 'groovy') {\n config.modResults.contents = setClassPath(config, config.modResults.contents);\n } else {\n addWarningAndroid(\n 'android.googleServicesFile',\n `Cannot automatically configure project build.gradle if it's not groovy`\n );\n }\n return config;\n });\n};\n\nexport const withApplyPlugin: ConfigPlugin = (config) => {\n return withAppBuildGradle(config, (config) => {\n if (config.modResults.language === 'groovy') {\n config.modResults.contents = applyPlugin(config, config.modResults.contents);\n } else {\n addWarningAndroid(\n 'android.googleServicesFile',\n `Cannot automatically configure app build.gradle if it's not groovy`\n );\n }\n return config;\n });\n};\n\n/**\n * Add `google-services.json` to project\n */\nexport const withGoogleServicesFile: ConfigPlugin = (config) => {\n return withDangerousMod(config, [\n 'android',\n async (config) => {\n await setGoogleServicesFile(config, config.modRequest.projectRoot);\n return config;\n },\n ]);\n};\n\nexport function getGoogleServicesFilePath(config: Pick<ExpoConfig, 'android'>) {\n return config.android?.googleServicesFile ?? null;\n}\n\nexport async function setGoogleServicesFile(\n config: Pick<ExpoConfig, 'android'>,\n projectRoot: string,\n targetPath: string = DEFAULT_TARGET_PATH\n) {\n const partialSourcePath = getGoogleServicesFilePath(config);\n if (!partialSourcePath) {\n return false;\n }\n\n const completeSourcePath = path.resolve(projectRoot, partialSourcePath);\n const destinationPath = path.resolve(projectRoot, targetPath);\n\n try {\n await copyFilePathToPathAsync(completeSourcePath, destinationPath);\n } catch (e) {\n console.log(e);\n throw new Error(\n `Cannot copy google-services.json from ${completeSourcePath} to ${destinationPath}. Ensure the source and destination paths exist.`\n );\n }\n return true;\n}\n\n/**\n * Adding the Google Services plugin\n * NOTE(brentvatne): string replacement is a fragile approach! we need a\n * better solution than this.\n */\nexport function setClassPath(config: Pick<ExpoConfig, 'android'>, buildGradle: string) {\n const googleServicesFile = getGoogleServicesFilePath(config);\n if (!googleServicesFile) {\n return buildGradle;\n }\n\n if (buildGradle.includes(googleServicesClassPath)) {\n return buildGradle;\n }\n\n //\n return buildGradle.replace(\n /dependencies\\s?{/,\n `dependencies {\n classpath '${googleServicesClassPath}:${googleServicesVersion}'`\n );\n}\n\nexport function applyPlugin(config: Pick<ExpoConfig, 'android'>, appBuildGradle: string) {\n const googleServicesFile = getGoogleServicesFilePath(config);\n if (!googleServicesFile) {\n return appBuildGradle;\n }\n\n // Make sure the project does not have the plugin already\n const pattern = new RegExp(`apply\\\\s+plugin:\\\\s+['\"]${googleServicesPlugin}['\"]`);\n if (appBuildGradle.match(pattern)) {\n return appBuildGradle;\n }\n\n // Add it to the end of the file\n return appBuildGradle + `\\napply plugin: '${googleServicesPlugin}'`;\n}\n"],"mappings":";;;;;;;;;;AACA,SAAAA,MAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,KAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAG,gBAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,eAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,kBAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,iBAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,O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A;AACA;AACO,SAASnB,YAAYA,CAACL,MAAmC,EAAE6B,WAAmB,EAAE;EACrF,MAAMX,kBAAkB,GAAGF,yBAAyB,CAAChB,MAAM,CAAC;EAC5D,IAAI,CAACkB,kBAAkB,EAAE;IACvB,OAAOW,WAAW;EACpB;EAEA,IAAIA,WAAW,CAACC,QAAQ,CAAClC,uBAAuB,CAAC,EAAE;IACjD,OAAOiC,WAAW;EACpB;;EAEA;EACA,OAAOA,WAAW,CAACE,OAAO,CACxB,kBAAkB,EAClB;AACJ,qBAAqBnC,uBAAuB,IAAIE,qBAAqB,GACnE,CAAC;AACH;AAEO,SAASY,WAAWA,CAACV,MAAmC,EAAEgC,cAAsB,EAAE;EACvF,MAAMd,kBAAkB,GAAGF,yBAAyB,CAAChB,MAAM,CAAC;EAC5D,IAAI,CAACkB,kBAAkB,EAAE;IACvB,OAAOc,cAAc;EACvB;;EAEA;EACA,MAAMC,OAAO,GAAG,IAAIC,MAAM,CAAC,2BAA2BrC,oBAAoB,MAAM,CAAC;EACjF,IAAImC,cAAc,CAACG,KAAK,CAACF,OAAO,CAAC,EAAE;IACjC,OAAOD,cAAc;EACvB;;EAEA;EACA,OAAOA,cAAc,GAAG,oBAAoBnC,oBAAoB,GAAG;AACrE","ignoreList":[]}
1
+ {"version":3,"file":"GoogleServices.js","names":["_path","data","_interopRequireDefault","require","_androidPlugins","_withDangerousMod","_fs","_warnings","e","__esModule","default","DEFAULT_TARGET_PATH","googleServicesClassPath","googleServicesPlugin","googleServicesVersion","withClassPath","config","withProjectBuildGradle","modResults","language","contents","setClassPath","addWarningAndroid","exports","withApplyPlugin","withAppBuildGradle","applyPlugin","withGoogleServicesFile","withDangerousMod","setGoogleServicesFile","modRequest","projectRoot","getGoogleServicesFilePath","android","googleServicesFile","targetPath","partialSourcePath","completeSourcePath","path","resolve","destinationPath","copyFilePathToPathAsync","console","log","Error","buildGradle","includes","replace","appBuildGradle","pattern","RegExp","match"],"sources":["../../src/android/GoogleServices.ts"],"sourcesContent":["import type { ExpoConfig } from '@expo/config-types';\nimport path from 'path';\n\nimport type { ConfigPlugin } from '../Plugin.types';\nimport { withAppBuildGradle, withProjectBuildGradle } from '../plugins/android-plugins';\nimport { withDangerousMod } from '../plugins/withDangerousMod';\nimport { copyFilePathToPathAsync } from '../utils/fs';\nimport { addWarningAndroid } from '../utils/warnings';\n\nconst DEFAULT_TARGET_PATH = './android/app/google-services.json';\n\nconst googleServicesClassPath = 'com.google.gms:google-services';\nconst googleServicesPlugin = 'com.google.gms.google-services';\n\n// NOTE(brentvatne): This may be annoying to keep up to date...\nconst googleServicesVersion = '4.4.1';\n\nexport const withClassPath: ConfigPlugin = (config) => {\n return withProjectBuildGradle(config, (config) => {\n if (config.modResults.language === 'groovy') {\n config.modResults.contents = setClassPath(config, config.modResults.contents);\n } else {\n addWarningAndroid(\n 'android.googleServicesFile',\n `Cannot automatically configure project build.gradle if it's not groovy`\n );\n }\n return config;\n });\n};\n\nexport const withApplyPlugin: ConfigPlugin = (config) => {\n return withAppBuildGradle(config, (config) => {\n if (config.modResults.language === 'groovy') {\n config.modResults.contents = applyPlugin(config, config.modResults.contents);\n } else {\n addWarningAndroid(\n 'android.googleServicesFile',\n `Cannot automatically configure app build.gradle if it's not groovy`\n );\n }\n return config;\n });\n};\n\n/**\n * Add `google-services.json` to project\n */\nexport const withGoogleServicesFile: ConfigPlugin = (config) => {\n return withDangerousMod(config, [\n 'android',\n async (config) => {\n await setGoogleServicesFile(config, config.modRequest.projectRoot);\n return config;\n },\n ]);\n};\n\nexport function getGoogleServicesFilePath(config: Pick<ExpoConfig, 'android'>) {\n return config.android?.googleServicesFile ?? null;\n}\n\nexport async function setGoogleServicesFile(\n config: Pick<ExpoConfig, 'android'>,\n projectRoot: string,\n targetPath: string = DEFAULT_TARGET_PATH\n) {\n const partialSourcePath = getGoogleServicesFilePath(config);\n if (!partialSourcePath) {\n return false;\n }\n\n const completeSourcePath = path.resolve(projectRoot, partialSourcePath);\n const destinationPath = path.resolve(projectRoot, targetPath);\n\n try {\n await copyFilePathToPathAsync(completeSourcePath, destinationPath);\n } catch (e) {\n console.log(e);\n throw new Error(\n `Cannot copy google-services.json from ${completeSourcePath} to ${destinationPath}. Ensure the source and destination paths exist.`\n );\n }\n return true;\n}\n\n/**\n * Adding the Google Services plugin\n * NOTE(brentvatne): string replacement is a fragile approach! we need a\n * better solution than this.\n */\nexport function setClassPath(config: Pick<ExpoConfig, 'android'>, buildGradle: string) {\n const googleServicesFile = getGoogleServicesFilePath(config);\n if (!googleServicesFile) {\n return buildGradle;\n }\n\n if (buildGradle.includes(googleServicesClassPath)) {\n return buildGradle;\n }\n\n //\n return buildGradle.replace(\n /dependencies\\s?{/,\n `dependencies {\n classpath '${googleServicesClassPath}:${googleServicesVersion}'`\n );\n}\n\nexport function applyPlugin(config: Pick<ExpoConfig, 'android'>, appBuildGradle: string) {\n const googleServicesFile = getGoogleServicesFilePath(config);\n if (!googleServicesFile) {\n return appBuildGradle;\n }\n\n // Make sure the project does not have the plugin already\n const pattern = new RegExp(`apply\\\\s+plugin:\\\\s+['\"]${googleServicesPlugin}['\"]`);\n if (appBuildGradle.match(pattern)) {\n return appBuildGradle;\n }\n\n // Add it to the end of the file\n return appBuildGradle + `\\napply plugin: '${googleServicesPlugin}'`;\n}\n"],"mappings":";;;;;;;;;;AACA,SAAAA,MAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,KAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAG,gBAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,eAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,kBAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,iBAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK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ACL,MAAmC,EAAE6B,WAAmB,EAAE;EACrF,MAAMX,kBAAkB,GAAGF,yBAAyB,CAAChB,MAAM,CAAC;EAC5D,IAAI,CAACkB,kBAAkB,EAAE;IACvB,OAAOW,WAAW;EACpB;EAEA,IAAIA,WAAW,CAACC,QAAQ,CAAClC,uBAAuB,CAAC,EAAE;IACjD,OAAOiC,WAAW;EACpB;;EAEA;EACA,OAAOA,WAAW,CAACE,OAAO,CACxB,kBAAkB,EAClB;AACJ,qBAAqBnC,uBAAuB,IAAIE,qBAAqB,GACnE,CAAC;AACH;AAEO,SAASY,WAAWA,CAACV,MAAmC,EAAEgC,cAAsB,EAAE;EACvF,MAAMd,kBAAkB,GAAGF,yBAAyB,CAAChB,MAAM,CAAC;EAC5D,IAAI,CAACkB,kBAAkB,EAAE;IACvB,OAAOc,cAAc;EACvB;;EAEA;EACA,MAAMC,OAAO,GAAG,IAAIC,MAAM,CAAC,2BAA2BrC,oBAAoB,MAAM,CAAC;EACjF,IAAImC,cAAc,CAACG,KAAK,CAACF,OAAO,CAAC,EAAE;IACjC,OAAOD,cAAc;EACvB;;EAEA;EACA,OAAOA,cAAc,GAAG,oBAAoBnC,oBAAoB,GAAG;AACrE","ignoreList":[]}
@@ -1,5 +1,5 @@
1
- import { Android, ExpoConfig } from '@expo/config-types';
2
- import { AndroidManifest, ManifestIntentFilter } from './Manifest';
1
+ import type { Android, ExpoConfig } from '@expo/config-types';
2
+ import type { AndroidManifest, ManifestIntentFilter } from './Manifest';
3
3
  type AndroidIntentFilters = NonNullable<Android['intentFilters']>;
4
4
  export declare const withAndroidIntentFilters: import("..").ConfigPlugin;
5
5
  export declare function getIntentFilters(config: Pick<ExpoConfig, 'android'>): AndroidIntentFilters;
@@ -1 +1 @@
1
- {"version":3,"file":"IntentFilters.js","names":["_Manifest","data","require","_androidPlugins","GENERATED_TAG","withAndroidIntentFilters","exports","createAndroidManifestPlugin","setAndroidIntentFilters","getIntentFilters","config","android","intentFilters","androidManifest","mainActivity","getMainActivityOrThrow","length","filter","value","$","concat","renderIntentFilters","map","intentFilter","autoVerify","undefined","action","renderIntentFilterData","category","renderIntentFilterCategory","Array","isArray","Boolean","datum","Object","entries","reduce","prev","key","cat"],"sources":["../../src/android/IntentFilters.ts"],"sourcesContent":["import { Android, AndroidIntentFiltersData, ExpoConfig } from '@expo/config-types';\n\nimport { AndroidManifest, getMainActivityOrThrow, ManifestIntentFilter } from './Manifest';\nimport { createAndroidManifestPlugin } from '../plugins/android-plugins';\n\ntype AndroidIntentFilters = NonNullable<Android['intentFilters']>;\n\nconst GENERATED_TAG = 'data-generated';\n\nexport const withAndroidIntentFilters = createAndroidManifestPlugin(\n setAndroidIntentFilters,\n 'withAndroidIntentFilters'\n);\n\nexport function getIntentFilters(config: Pick<ExpoConfig, 'android'>): AndroidIntentFilters {\n return config.android?.intentFilters ?? [];\n}\n\nexport function setAndroidIntentFilters(\n config: Pick<ExpoConfig, 'android'>,\n androidManifest: AndroidManifest\n): AndroidManifest {\n // Always ensure old tags are removed.\n const mainActivity = getMainActivityOrThrow(androidManifest);\n // Remove all generated tags from previous runs...\n if (mainActivity['intent-filter']?.length) {\n mainActivity['intent-filter'] = mainActivity['intent-filter'].filter(\n (value) => value.$?.[GENERATED_TAG] !== 'true'\n );\n }\n\n const intentFilters = getIntentFilters(config);\n if (!intentFilters.length) {\n return androidManifest;\n }\n\n mainActivity['intent-filter'] = mainActivity['intent-filter']?.concat(\n renderIntentFilters(intentFilters)\n );\n\n return androidManifest;\n}\n\nexport default function renderIntentFilters(\n intentFilters: AndroidIntentFilters\n): ManifestIntentFilter[] {\n return intentFilters.map((intentFilter) => {\n // <intent-filter>\n return {\n $: {\n 'android:autoVerify': intentFilter.autoVerify ? 'true' : undefined,\n // Add a custom \"generated\" tag that we can query later to remove.\n [GENERATED_TAG]: 'true',\n },\n action: [\n // <action android:name=\"android.intent.action.VIEW\"/>\n {\n $: {\n 'android:name': `android.intent.action.${intentFilter.action}`,\n },\n },\n ],\n data: renderIntentFilterData(intentFilter.data),\n category: renderIntentFilterCategory(intentFilter.category),\n };\n });\n}\n\n/** Like `<data android:scheme=\"exp\"/>` */\nfunction renderIntentFilterData(data?: AndroidIntentFiltersData | AndroidIntentFiltersData[]) {\n return (Array.isArray(data) ? data : [data]).filter(Boolean).map((datum) => ({\n $: Object.entries(datum ?? {}).reduce(\n (prev, [key, value]) => ({ ...prev, [`android:${key}`]: value }),\n {}\n ),\n }));\n}\n\n/** Like `<category android:name=\"android.intent.category.DEFAULT\"/>` */\nfunction renderIntentFilterCategory(category?: string | string[]) {\n return (Array.isArray(category) ? category : [category]).filter(Boolean).map((cat) => ({\n $: {\n 'android:name': `android.intent.category.${cat}`,\n },\n }));\n}\n"],"mappings":";;;;;;;;;AAEA,SAAAA,UAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,SAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,gBAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,eAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAIA,MAAMG,aAAa,GAAG,gBAAgB;AAE/B,MAAMC,wBAAwB,GAAAC,OAAA,CAAAD,wBAAA,GAAG,IAAAE,6CAA2B,EACjEC,uBAAuB,EACvB,0BACF,CAAC;AAEM,SAASC,gBAAgBA,CAACC,MAAmC,EAAwB;EAC1F,OAAOA,MAAM,CAACC,OAAO,EAAEC,aAAa,IAAI,EAAE;AAC5C;AAEO,SAASJ,uBAAuBA,CACrCE,MAAmC,EACnCG,eAAgC,EACf;EACjB;EACA,MAAMC,YAAY,GAAG,IAAAC,kCAAsB,EAACF,eAAe,CAAC;EAC5D;EACA,IAAIC,YAAY,CAAC,eAAe,CAAC,EAAEE,MAAM,EAAE;IACzCF,YAAY,CAAC,eAAe,CAAC,GAAGA,YAAY,CAAC,eAAe,CAAC,CAACG,MAAM,CACjEC,K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AC,WAAWC,GAAG,EAAE,GAAGpB;IAAM,CAAC,CAAC,EAChE,CAAC,CACH;EACF,CAAC,CAAC,CAAC;AACL;;AAEA;AACA,SAASW,0BAA0BA,CAACD,QAA4B,EAAE;EAChE,OAAO,CAACE,KAAK,CAACC,OAAO,CAACH,QAAQ,CAAC,GAAGA,QAAQ,GAAG,CAACA,QAAQ,CAAC,EAAEX,MAAM,CAACe,OAAO,CAAC,CAACV,GAAG,CAAEiB,GAAG,KAAM;IACrFpB,CAAC,EAAE;MACD,cAAc,EAAE,2BAA2BoB,GAAG;IAChD;EACF,CAAC,CAAC,CAAC;AACL","ignoreList":[]}
1
+ {"version":3,"file":"IntentFilters.js","names":["_Manifest","data","require","_androidPlugins","GENERATED_TAG","withAndroidIntentFilters","exports","createAndroidManifestPlugin","setAndroidIntentFilters","getIntentFilters","config","android","intentFilters","androidManifest","mainActivity","getMainActivityOrThrow","length","filter","value","$","concat","renderIntentFilters","map","intentFilter","autoVerify","undefined","action","renderIntentFilterData","category","renderIntentFilterCategory","Array","isArray","Boolean","datum","Object","entries","reduce","prev","key","cat"],"sources":["../../src/android/IntentFilters.ts"],"sourcesContent":["import type { Android, AndroidIntentFiltersData, ExpoConfig } from '@expo/config-types';\n\nimport type { AndroidManifest, ManifestIntentFilter } from './Manifest';\nimport { getMainActivityOrThrow } from './Manifest';\nimport { createAndroidManifestPlugin } from '../plugins/android-plugins';\n\ntype AndroidIntentFilters = NonNullable<Android['intentFilters']>;\n\nconst GENERATED_TAG = 'data-generated';\n\nexport const withAndroidIntentFilters = createAndroidManifestPlugin(\n setAndroidIntentFilters,\n 'withAndroidIntentFilters'\n);\n\nexport function getIntentFilters(config: Pick<ExpoConfig, 'android'>): AndroidIntentFilters {\n return config.android?.intentFilters ?? [];\n}\n\nexport function setAndroidIntentFilters(\n config: Pick<ExpoConfig, 'android'>,\n androidManifest: AndroidManifest\n): AndroidManifest {\n // Always ensure old tags are removed.\n const mainActivity = getMainActivityOrThrow(androidManifest);\n // Remove all generated tags from previous runs...\n if (mainActivity['intent-filter']?.length) {\n mainActivity['intent-filter'] = mainActivity['intent-filter'].filter(\n (value) => value.$?.[GENERATED_TAG] !== 'true'\n );\n }\n\n const intentFilters = getIntentFilters(config);\n if (!intentFilters.length) {\n return androidManifest;\n }\n\n mainActivity['intent-filter'] = mainActivity['intent-filter']?.concat(\n renderIntentFilters(intentFilters)\n );\n\n return androidManifest;\n}\n\nexport default function renderIntentFilters(\n intentFilters: AndroidIntentFilters\n): ManifestIntentFilter[] {\n return intentFilters.map((intentFilter) => {\n // <intent-filter>\n return {\n $: {\n 'android:autoVerify': intentFilter.autoVerify ? 'true' : undefined,\n // Add a custom \"generated\" tag that we can query later to remove.\n [GENERATED_TAG]: 'true',\n },\n action: [\n // <action android:name=\"android.intent.action.VIEW\"/>\n {\n $: {\n 'android:name': `android.intent.action.${intentFilter.action}`,\n },\n },\n ],\n data: renderIntentFilterData(intentFilter.data),\n category: renderIntentFilterCategory(intentFilter.category),\n };\n });\n}\n\n/** Like `<data android:scheme=\"exp\"/>` */\nfunction renderIntentFilterData(data?: AndroidIntentFiltersData | AndroidIntentFiltersData[]) {\n return (Array.isArray(data) ? data : [data]).filter(Boolean).map((datum) => ({\n $: Object.entries(datum ?? {}).reduce(\n (prev, [key, value]) => ({ ...prev, [`android:${key}`]: value }),\n {}\n ),\n }));\n}\n\n/** Like `<category android:name=\"android.intent.category.DEFAULT\"/>` */\nfunction renderIntentFilterCategory(category?: string | string[]) {\n return (Array.isArray(category) ? category : [category]).filter(Boolean).map((cat) => ({\n $: {\n 'android:name': `android.intent.category.${cat}`,\n },\n }));\n}\n"],"mappings":";;;;;;;;;AAGA,SAAAA,UAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,SAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,gBAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,eAAA,YAAAA,CA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9D;MACF,CAAC,CACF;MACDzB,IAAI,EAAE0B,sBAAsB,CAACJ,YAAY,CAACtB,IAAI,CAAC;MAC/C2B,QAAQ,EAAEC,0BAA0B,CAACN,YAAY,CAACK,QAAQ;IAC5D,CAAC;EACH,CAAC,CAAC;AACJ;;AAEA;AACA,SAASD,sBAAsBA,CAAC1B,IAA4D,EAAE;EAC5F,OAAO,CAAC6B,KAAK,CAACC,OAAO,CAAC9B,IAAI,CAAC,GAAGA,IAAI,GAAG,CAACA,IAAI,CAAC,EAAEgB,MAAM,CAACe,OAAO,CAAC,CAACV,GAAG,CAAEW,KAAK,KAAM;IAC3Ed,CAAC,EAAEe,MAAM,CAACC,OAAO,CAACF,KAAK,IAAI,CAAC,CAAC,CAAC,CAACG,MAAM,CACnC,CAACC,IAAI,EAAE,CAACC,GAAG,EAAEpB,KAAK,CAAC,MAAM;MAAE,GAAGmB,IAAI;MAAE,CAAC,WAAWC,GAAG,EAAE,GAAGpB;IAAM,CAAC,CAAC,EAChE,CAAC,CACH;EACF,CAAC,CAAC,CAAC;AACL;;AAEA;AACA,SAASW,0BAA0BA,CAACD,QAA4B,EAAE;EAChE,OAAO,CAACE,KAAK,CAACC,OAAO,CAACH,QAAQ,CAAC,GAAGA,QAAQ,GAAG,CAACA,QAAQ,CAAC,EAAEX,MAAM,CAACe,OAAO,CAAC,CAACV,GAAG,CAAEiB,GAAG,KAAM;IACrFpB,CAAC,EAAE;MACD,cAAc,EAAE,2BAA2BoB,GAAG;IAChD;EACF,CAAC,CAAC,CAAC;AACL","ignoreList":[]}
@@ -1,6 +1,6 @@
1
- import { ExpoConfig } from '@expo/config-types';
2
- import { ConfigPlugin } from '../Plugin.types';
3
- import { LocaleJson } from '../utils/locales';
1
+ import type { ExpoConfig } from '@expo/config-types';
2
+ import type { ConfigPlugin } from '../Plugin.types';
3
+ import type { LocaleJson } from '../utils/locales';
4
4
  export declare const withLocales: ConfigPlugin;
5
5
  export declare function getLocales(config: Pick<ExpoConfig, 'locales'>): Record<string, string | LocaleJson> | null;
6
6
  export declare function setLocalesAsync(config: Pick<ExpoConfig, 'locales'>, { projectRoot }: {
@@ -1 +1 @@
1
- {"version":3,"file":"Locales.js","names":["_path","data","_interopRequireDefault","require","_","_XML","_locales","e","__esModule","default","withLocales","config","withDangerousMod","modResults","setLocalesAsync","projectRoot","modRequest","exports","getLocales","locales","localesMap","getResolvedLocalesAsync","lang","localizationObj","Object","entries","stringsFilePath","path","join","AndroidConfig","Paths","getResourceFolderAsync","replaceAll","writeXMLAsync","xml","resources","map","k","v","string","$","name"],"sources":["../../src/android/Locales.ts"],"sourcesContent":["import { ExpoConfig } from '@expo/config-types';\nimport path from 'path';\n\nimport { AndroidConfig, withDangerousMod } from '..';\nimport { ConfigPlugin } from '../Plugin.types';\nimport { writeXMLAsync } from '../utils/XML';\nimport { getResolvedLocalesAsync, LocaleJson } from '../utils/locales';\n\nexport const withLocales: ConfigPlugin = (config) => {\n return withDangerousMod(config, [\n 'android',\n async (config) => {\n config.modResults = await setLocalesAsync(config, {\n projectRoot: config.modRequest.projectRoot,\n });\n return config;\n },\n ]);\n};\n\nexport function getLocales(\n config: Pick<ExpoConfig, 'locales'>\n): Record<string, string | LocaleJson> | null {\n return config.locales ?? null;\n}\n\nexport async function setLocalesAsync(\n config: Pick<ExpoConfig, 'locales'>,\n { projectRoot }: { projectRoot: string }\n): Promise<unknown> {\n const locales = getLocales(config);\n if (!locales) {\n return config;\n }\n const { localesMap } = await getResolvedLocalesAsync(projectRoot, locales, 'android');\n for (const [lang, localizationObj] of Object.entries(localesMap)) {\n const stringsFilePath = path.join(\n await AndroidConfig.Paths.getResourceFolderAsync(projectRoot),\n `values-b+${lang.replaceAll('-', '+')}`,\n 'strings.xml'\n );\n writeXMLAsync({\n path: stringsFilePath,\n xml: {\n resources: Object.entries(localizationObj).map(([k, v]) => ({\n string: {\n $: {\n name: k,\n },\n _: `\"${v}\"`,\n },\n })),\n },\n });\n }\n\n return config;\n}\n"],"mappings":";;;;;;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AOR,MAAM;EACf;EACA,MAAM;IAAES;EAAW,CAAC,GAAG,MAAM,IAAAC,kCAAuB,EAACN,WAAW,EAAEI,OAAO,EAAE,SAAS,CAAC;EACrF,KAAK,MAAM,CAACG,IAAI,EAAEC,eAAe,CAAC,IAAIC,MAAM,CAACC,OAAO,CAACL,UAAU,CAAC,EAAE;IAChE,MAAMM,eAAe,GAAGC,eAAI,CAACC,IAAI,CAC/B,MAAMC,iBAAa,CAACC,KAAK,CAACC,sBAAsB,CAAChB,WAAW,CAAC,EAC7D,YAAYO,IAAI,CAACU,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,EACvC,aACF,CAAC;IACD,IAAAC,oBAAa,EAAC;MACZN,IAAI,EAAED,eAAe;MACrBQ,GAAG,EAAE;QACHC,SAAS,EAAEX,MAAM,CAACC,OAAO,CAACF,eAAe,CAAC,CAACa,GAAG,CAAC,CAAC,CAACC,CAAC,EAAEC,CAAC,CAAC,MAAM;UAC1DC,MAAM,EAAE;YACNC,CAAC,EAAE;cACDC,IAAI,EAAEJ;YACR,CAAC;YACDjC,CAAC,EAAE,IAAIkC,CAAC;UACV;QACF,CAAC,CAAC;MACJ;IACF,CAAC,CAAC;EACJ;EAEA,OAAO3B,MAAM;AACf","ignoreList":[]}
1
+ {"version":3,"file":"Locales.js","names":["_path","data","_interopRequireDefault","require","_","_XML","_locales","e","__esModule","default","withLocales","config","withDangerousMod","modResults","setLocalesAsync","projectRoot","modRequest","exports","getLocales","locales","localesMap","getResolvedLocalesAsync","lang","localizationObj","Object","entries","stringsFilePath","path","join","AndroidConfig","Paths","getResourceFolderAsync","replaceAll","writeXMLAsync","xml","resources","map","k","v","string","$","name"],"sources":["../../src/android/Locales.ts"],"sourcesContent":["import type { ExpoConfig } from '@expo/config-types';\nimport path from 'path';\n\nimport { AndroidConfig, withDangerousMod } from '..';\nimport type { ConfigPlugin } from '../Plugin.types';\nimport { writeXMLAsync } from '../utils/XML';\nimport type { LocaleJson } from '../utils/locales';\nimport { getResolvedLocalesAsync } from '../utils/locales';\n\nexport const withLocales: ConfigPlugin = (config) => {\n return withDangerousMod(config, [\n 'android',\n async (config) => {\n config.modResults = await setLocalesAsync(config, {\n projectRoot: config.modRequest.projectRoot,\n });\n return config;\n },\n ]);\n};\n\nexport function getLocales(\n config: Pick<ExpoConfig, 'locales'>\n): Record<string, string | LocaleJson> | null {\n return config.locales ?? null;\n}\n\nexport async function setLocalesAsync(\n config: Pick<ExpoConfig, 'locales'>,\n { projectRoot }: { projectRoot: string }\n): Promise<unknown> {\n const locales = getLocales(config);\n if (!locales) {\n return config;\n }\n const { localesMap } = await getResolvedLocalesAsync(projectRoot, locales, 'android');\n for (const [lang, localizationObj] of Object.entries(localesMap)) {\n const stringsFilePath = path.join(\n await AndroidConfig.Paths.getResourceFolderAsync(projectRoot),\n `values-b+${lang.replaceAll('-', '+')}`,\n 'strings.xml'\n );\n writeXMLAsync({\n path: stringsFilePath,\n xml: {\n resources: Object.entries(localizationObj).map(([k, v]) => ({\n string: {\n $: {\n name: k,\n },\n _: `\"${v}\"`,\n },\n })),\n },\n });\n }\n\n return config;\n}\n"],"mappings":";;;;;;;;AACA,SAAAA,MAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,KAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAG,EAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,CAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAI,KAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,IAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAK,SAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,QAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAA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,CAACF,eAAe,CAAC,CAACa,GAAG,CAAC,CAAC,CAACC,CAAC,EAAEC,CAAC,CAAC,MAAM;UAC1DC,MAAM,EAAE;YACNC,CAAC,EAAE;cACDC,IAAI,EAAEJ;YACR,CAAC;YACDjC,CAAC,EAAE,IAAIkC,CAAC;UACV;QACF,CAAC,CAAC;MACJ;IACF,CAAC,CAAC;EACJ;EAEA,OAAO3B,MAAM;AACf","ignoreList":[]}
@@ -47,8 +47,7 @@ function XML() {
47
47
  };
48
48
  return data;
49
49
  }
50
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
51
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
50
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
52
51
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
53
52
  // https://developer.android.com/guide/topics/manifest/activity-alias-element
54
53
 
@@ -147,7 +146,7 @@ function addMetaDataItemToMainApplication(mainApplication, itemName, itemValue,
147
146
  };
148
147
  if (mainApplication['meta-data']) {
149
148
  existingMetaDataItem = mainApplication['meta-data'].filter(e => e.$['android:name'] === itemName);
150
- if (existingMetaDataItem.length) {
149
+ if (existingMetaDataItem[0] != null) {
151
150
  existingMetaDataItem[0].$[`android:${itemType}`] = itemValue;
152
151
  } else {
153
152
  mainApplication['meta-data'].push(newItem);
@@ -193,7 +192,7 @@ function addUsesLibraryItemToMainApplication(mainApplication, item) {
193
192
  };
194
193
  if (mainApplication['uses-library']) {
195
194
  existingMetaDataItem = mainApplication['uses-library'].filter(e => e.$['android:name'] === item.name);
196
- if (existingMetaDataItem.length) {
195
+ if (existingMetaDataItem[0] != null) {
197
196
  existingMetaDataItem[0].$ = newItem.$;
198
197
  } else {
199
198
  mainApplication['uses-library'].push(newItem);