@expo/prebuild-config 5.0.7 → 6.0.0

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 (113) hide show
  1. package/build/getAutolinkedPackages.js +3 -13
  2. package/build/getAutolinkedPackages.js.map +1 -1
  3. package/build/getPrebuildConfig.js +9 -24
  4. package/build/getPrebuildConfig.js.map +1 -1
  5. package/build/importExpoModulesAutolinking.d.ts +3 -3
  6. package/build/importExpoModulesAutolinking.js +0 -5
  7. package/build/importExpoModulesAutolinking.js.map +1 -1
  8. package/build/index.js +0 -5
  9. package/build/index.js.map +1 -1
  10. package/build/plugins/icons/AssetContents.d.ts +3 -3
  11. package/build/plugins/icons/AssetContents.js +1 -10
  12. package/build/plugins/icons/AssetContents.js.map +1 -1
  13. package/build/plugins/icons/withAndroidIcons.d.ts +7 -5
  14. package/build/plugins/icons/withAndroidIcons.js +52 -71
  15. package/build/plugins/icons/withAndroidIcons.js.map +1 -1
  16. package/build/plugins/icons/withAndroidManifestIcons.js +0 -10
  17. package/build/plugins/icons/withAndroidManifestIcons.js.map +1 -1
  18. package/build/plugins/icons/withIosIcons.js +24 -48
  19. package/build/plugins/icons/withIosIcons.js.map +1 -1
  20. package/build/plugins/unversioned/createLegacyPlugin.js +0 -11
  21. package/build/plugins/unversioned/createLegacyPlugin.js.map +1 -1
  22. package/build/plugins/unversioned/expo-ads-admob/expo-ads-admob.js +0 -11
  23. package/build/plugins/unversioned/expo-ads-admob/expo-ads-admob.js.map +1 -1
  24. package/build/plugins/unversioned/expo-ads-admob/withAndroidAdMob.js +0 -14
  25. package/build/plugins/unversioned/expo-ads-admob/withAndroidAdMob.js.map +1 -1
  26. package/build/plugins/unversioned/expo-ads-admob/withIosAdMob.js +5 -14
  27. package/build/plugins/unversioned/expo-ads-admob/withIosAdMob.js.map +1 -1
  28. package/build/plugins/unversioned/expo-apple-authentication.js +0 -11
  29. package/build/plugins/unversioned/expo-apple-authentication.js.map +1 -1
  30. package/build/plugins/unversioned/expo-branch/expo-branch.js +4 -13
  31. package/build/plugins/unversioned/expo-branch/expo-branch.js.map +1 -1
  32. package/build/plugins/unversioned/expo-branch/withAndroidBranch.js +0 -12
  33. package/build/plugins/unversioned/expo-branch/withAndroidBranch.js.map +1 -1
  34. package/build/plugins/unversioned/expo-branch/withIosBranch.js +2 -11
  35. package/build/plugins/unversioned/expo-branch/withIosBranch.js.map +1 -1
  36. package/build/plugins/unversioned/expo-contacts.js +2 -13
  37. package/build/plugins/unversioned/expo-contacts.js.map +1 -1
  38. package/build/plugins/unversioned/expo-document-picker.js +2 -12
  39. package/build/plugins/unversioned/expo-document-picker.js.map +1 -1
  40. package/build/plugins/unversioned/expo-navigation-bar/expo-navigation-bar.js +2 -9
  41. package/build/plugins/unversioned/expo-navigation-bar/expo-navigation-bar.js.map +1 -1
  42. package/build/plugins/unversioned/expo-navigation-bar/withAndroidNavigationBar.js +0 -20
  43. package/build/plugins/unversioned/expo-navigation-bar/withAndroidNavigationBar.js.map +1 -1
  44. package/build/plugins/unversioned/expo-notifications/expo-notifications.js +4 -14
  45. package/build/plugins/unversioned/expo-notifications/expo-notifications.js.map +1 -1
  46. package/build/plugins/unversioned/expo-notifications/withAndroidNotifications.d.ts +1 -1
  47. package/build/plugins/unversioned/expo-notifications/withAndroidNotifications.js +1 -44
  48. package/build/plugins/unversioned/expo-notifications/withAndroidNotifications.js.map +1 -1
  49. package/build/plugins/unversioned/expo-splash-screen/InterfaceBuilder.d.ts +20 -20
  50. package/build/plugins/unversioned/expo-splash-screen/InterfaceBuilder.js +14 -33
  51. package/build/plugins/unversioned/expo-splash-screen/InterfaceBuilder.js.map +1 -1
  52. package/build/plugins/unversioned/expo-splash-screen/expo-splash-screen.js +0 -11
  53. package/build/plugins/unversioned/expo-splash-screen/expo-splash-screen.js.map +1 -1
  54. package/build/plugins/unversioned/expo-splash-screen/getAndroidSplashConfig.d.ts +1 -1
  55. package/build/plugins/unversioned/expo-splash-screen/getAndroidSplashConfig.js +2 -11
  56. package/build/plugins/unversioned/expo-splash-screen/getAndroidSplashConfig.js.map +1 -1
  57. package/build/plugins/unversioned/expo-splash-screen/getIosSplashConfig.d.ts +1 -2
  58. package/build/plugins/unversioned/expo-splash-screen/getIosSplashConfig.js +0 -26
  59. package/build/plugins/unversioned/expo-splash-screen/getIosSplashConfig.js.map +1 -1
  60. package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashDrawables.js +4 -9
  61. package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashDrawables.js.map +1 -1
  62. package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashImages.js +9 -36
  63. package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashImages.js.map +1 -1
  64. package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashLegacyMainActivity.js +13 -34
  65. package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashLegacyMainActivity.js.map +1 -1
  66. package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashScreen.js +4 -46
  67. package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashScreen.js.map +1 -1
  68. package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashStrings.js +0 -13
  69. package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashStrings.js.map +1 -1
  70. package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashStyles.js +2 -23
  71. package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashStyles.js.map +1 -1
  72. package/build/plugins/unversioned/expo-splash-screen/withIosSplashAssets.js +16 -54
  73. package/build/plugins/unversioned/expo-splash-screen/withIosSplashAssets.js.map +1 -1
  74. package/build/plugins/unversioned/expo-splash-screen/withIosSplashInfoPlist.js +6 -22
  75. package/build/plugins/unversioned/expo-splash-screen/withIosSplashInfoPlist.js.map +1 -1
  76. package/build/plugins/unversioned/expo-splash-screen/withIosSplashScreen.js +7 -35
  77. package/build/plugins/unversioned/expo-splash-screen/withIosSplashScreen.js.map +1 -1
  78. package/build/plugins/unversioned/expo-splash-screen/withIosSplashScreenStoryboard.js +9 -33
  79. package/build/plugins/unversioned/expo-splash-screen/withIosSplashScreenStoryboard.js.map +1 -1
  80. package/build/plugins/unversioned/expo-splash-screen/withIosSplashXcodeProject.js +1 -18
  81. package/build/plugins/unversioned/expo-splash-screen/withIosSplashXcodeProject.js.map +1 -1
  82. package/build/plugins/unversioned/expo-splash-screen/wtihIosSplashScreenStoryboardImage.js +2 -15
  83. package/build/plugins/unversioned/expo-splash-screen/wtihIosSplashScreenStoryboardImage.js.map +1 -1
  84. package/build/plugins/unversioned/expo-system-ui/expo-system-ui.js +0 -17
  85. package/build/plugins/unversioned/expo-system-ui/expo-system-ui.js.map +1 -1
  86. package/build/plugins/unversioned/expo-system-ui/withAndroidRootViewBackgroundColor.js +0 -14
  87. package/build/plugins/unversioned/expo-system-ui/withAndroidRootViewBackgroundColor.js.map +1 -1
  88. package/build/plugins/unversioned/expo-system-ui/withAndroidUserInterfaceStyle.js +2 -9
  89. package/build/plugins/unversioned/expo-system-ui/withAndroidUserInterfaceStyle.js.map +1 -1
  90. package/build/plugins/unversioned/expo-system-ui/withIosRootViewBackgroundColor.js +2 -27
  91. package/build/plugins/unversioned/expo-system-ui/withIosRootViewBackgroundColor.js.map +1 -1
  92. package/build/plugins/unversioned/expo-system-ui/withIosUserInterfaceStyle.js +2 -14
  93. package/build/plugins/unversioned/expo-system-ui/withIosUserInterfaceStyle.js.map +1 -1
  94. package/build/plugins/unversioned/expo-updates.js +1 -8
  95. package/build/plugins/unversioned/expo-updates.js.map +1 -1
  96. package/build/plugins/unversioned/react-native-maps.js +4 -19
  97. package/build/plugins/unversioned/react-native-maps.js.map +1 -1
  98. package/build/plugins/withDefaultPlugins.d.ts +2 -2
  99. package/build/plugins/withDefaultPlugins.js +41 -94
  100. package/build/plugins/withDefaultPlugins.js.map +1 -1
  101. package/package.json +6 -6
  102. package/build/plugins/unversioned/expo-facebook/expo-facebook.d.ts +0 -2
  103. package/build/plugins/unversioned/expo-facebook/expo-facebook.js +0 -57
  104. package/build/plugins/unversioned/expo-facebook/expo-facebook.js.map +0 -1
  105. package/build/plugins/unversioned/expo-facebook/withAndroidFacebook.d.ts +0 -13
  106. package/build/plugins/unversioned/expo-facebook/withAndroidFacebook.js +0 -235
  107. package/build/plugins/unversioned/expo-facebook/withAndroidFacebook.js.map +0 -1
  108. package/build/plugins/unversioned/expo-facebook/withIosFacebook.d.ts +0 -26
  109. package/build/plugins/unversioned/expo-facebook/withIosFacebook.js +0 -233
  110. package/build/plugins/unversioned/expo-facebook/withIosFacebook.js.map +0 -1
  111. package/build/plugins/unversioned/expo-facebook/withSKAdNetworkIdentifiers.d.ts +0 -9
  112. package/build/plugins/unversioned/expo-facebook/withSKAdNetworkIdentifiers.js +0 -69
  113. package/build/plugins/unversioned/expo-facebook/withSKAdNetworkIdentifiers.js.map +0 -1
@@ -7,76 +7,57 @@ exports.ICON_CONTENTS = void 0;
7
7
  exports.getIcons = getIcons;
8
8
  exports.setIconsAsync = setIconsAsync;
9
9
  exports.withIosIcons = void 0;
10
-
11
10
  function _configPlugins() {
12
11
  const data = require("@expo/config-plugins");
13
-
14
12
  _configPlugins = function () {
15
13
  return data;
16
14
  };
17
-
18
15
  return data;
19
16
  }
20
-
21
17
  function _imageUtils() {
22
18
  const data = require("@expo/image-utils");
23
-
24
19
  _imageUtils = function () {
25
20
  return data;
26
21
  };
27
-
28
22
  return data;
29
23
  }
30
-
31
24
  function fs() {
32
25
  const data = _interopRequireWildcard(require("fs-extra"));
33
-
34
26
  fs = function () {
35
27
  return data;
36
28
  };
37
-
38
29
  return data;
39
30
  }
40
-
41
31
  function _path() {
42
32
  const data = require("path");
43
-
44
33
  _path = function () {
45
34
  return data;
46
35
  };
47
-
48
36
  return data;
49
37
  }
50
-
51
38
  function _AssetContents() {
52
39
  const data = require("./AssetContents");
53
-
54
40
  _AssetContents = function () {
55
41
  return data;
56
42
  };
57
-
58
43
  return data;
59
44
  }
60
-
61
45
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
62
-
63
46
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
64
-
65
47
  const {
66
48
  getProjectName
67
49
  } = _configPlugins().IOSConfig.XcodeUtils;
68
-
69
50
  const withIosIcons = config => {
70
51
  return (0, _configPlugins().withDangerousMod)(config, ['ios', async config => {
71
52
  await setIconsAsync(config, config.modRequest.projectRoot);
72
53
  return config;
73
54
  }]);
74
55
  };
75
-
76
56
  exports.withIosIcons = withIosIcons;
77
57
  const IMAGE_CACHE_NAME = 'icons';
78
- const IMAGESET_PATH = 'Images.xcassets/AppIcon.appiconset'; // Hard-coding seemed like the clearest and safest way to implement the sizes.
58
+ const IMAGESET_PATH = 'Images.xcassets/AppIcon.appiconset';
79
59
 
60
+ // Hard-coding seemed like the clearest and safest way to implement the sizes.
80
61
  const ICON_CONTENTS = [{
81
62
  idiom: 'iphone',
82
63
  sizes: [{
@@ -91,7 +72,8 @@ const ICON_CONTENTS = [{
91
72
  }, {
92
73
  size: 60,
93
74
  scales: [2, 3]
94
- } // TODO: 76x76@2x seems unused now
75
+ }
76
+ // TODO: 76x76@2x seems unused now
95
77
  // {
96
78
  // size: 76,
97
79
  // scales: [2],
@@ -123,47 +105,44 @@ const ICON_CONTENTS = [{
123
105
  }]
124
106
  }];
125
107
  exports.ICON_CONTENTS = ICON_CONTENTS;
126
-
127
108
  function getIcons(config) {
128
109
  var _config$ios;
129
-
130
110
  // No support for empty strings.
131
111
  return ((_config$ios = config.ios) === null || _config$ios === void 0 ? void 0 : _config$ios.icon) || config.icon || null;
132
112
  }
133
-
134
113
  async function setIconsAsync(config, projectRoot) {
135
114
  const icon = getIcons(config);
136
-
137
115
  if (!icon) {
138
116
  _configPlugins().WarningAggregator.addWarningIOS('icon', 'This is the image that your app uses on your home screen, you will need to configure it manually.');
139
-
140
117
  return;
141
- } // Something like projectRoot/ios/MyApp/
118
+ }
142
119
 
120
+ // Something like projectRoot/ios/MyApp/
121
+ const iosNamedProjectRoot = getIosNamedProjectPath(projectRoot);
143
122
 
144
- const iosNamedProjectRoot = getIosNamedProjectPath(projectRoot); // Ensure the Images.xcassets/AppIcon.appiconset path exists
123
+ // Ensure the Images.xcassets/AppIcon.appiconset path exists
124
+ await fs().ensureDir((0, _path().join)(iosNamedProjectRoot, IMAGESET_PATH));
145
125
 
146
- await fs().ensureDir((0, _path().join)(iosNamedProjectRoot, IMAGESET_PATH)); // Store the image JSON data for assigning via the Contents.json
147
-
148
- const imagesJson = []; // keep track of icons that have been generated so we can reuse them in the Contents.json
126
+ // Store the image JSON data for assigning via the Contents.json
127
+ const imagesJson = [];
149
128
 
129
+ // keep track of icons that have been generated so we can reuse them in the Contents.json
150
130
  const generatedIcons = {};
151
-
152
131
  for (const platform of ICON_CONTENTS) {
153
132
  const isMarketing = platform.idiom === 'ios-marketing';
154
-
155
133
  for (const {
156
134
  size,
157
135
  scales
158
136
  } of platform.sizes) {
159
137
  for (const scale of scales) {
160
138
  // The marketing icon is special because it makes no sense.
161
- const filename = isMarketing ? 'ItunesArtwork@2x.png' : getAppleIconName(size, scale); // Only create an image that hasn't already been generated.
162
-
139
+ const filename = isMarketing ? 'ItunesArtwork@2x.png' : getAppleIconName(size, scale);
140
+ // Only create an image that hasn't already been generated.
163
141
  if (!(filename in generatedIcons)) {
164
- const iconSizePx = size * scale; // Using this method will cache the images in `.expo` based on the properties used to generate them.
165
- // this method also supports remote URLs and using the global sharp instance.
142
+ const iconSizePx = size * scale;
166
143
 
144
+ // Using this method will cache the images in `.expo` based on the properties used to generate them.
145
+ // this method also supports remote URLs and using the global sharp instance.
167
146
  const {
168
147
  source
169
148
  } = await (0, _imageUtils().generateImageAsync)({
@@ -180,14 +159,13 @@ async function setIconsAsync(config, projectRoot) {
180
159
  // Force the background color to solid white to prevent any transparency.
181
160
  // TODO: Maybe use a more adaptive option based on the icon color?
182
161
  backgroundColor: '#ffffff'
183
- }); // Write image buffer to the file system.
184
-
162
+ });
163
+ // Write image buffer to the file system.
185
164
  const assetPath = (0, _path().join)(iosNamedProjectRoot, IMAGESET_PATH, filename);
186
- await fs().writeFile(assetPath, source); // Save a reference to the generated image so we don't create a duplicate.
187
-
165
+ await fs().writeFile(assetPath, source);
166
+ // Save a reference to the generated image so we don't create a duplicate.
188
167
  generatedIcons[filename] = true;
189
168
  }
190
-
191
169
  imagesJson.push({
192
170
  idiom: platform.idiom,
193
171
  size: `${size}x${size}`,
@@ -197,25 +175,23 @@ async function setIconsAsync(config, projectRoot) {
197
175
  });
198
176
  }
199
177
  }
200
- } // Finally, write the Config.json
201
-
178
+ }
202
179
 
180
+ // Finally, write the Config.json
203
181
  await (0, _AssetContents().writeContentsJsonAsync)((0, _path().join)(iosNamedProjectRoot, IMAGESET_PATH), {
204
182
  images: imagesJson
205
183
  });
206
184
  }
185
+
207
186
  /**
208
187
  * Return the project's named iOS path: ios/MyProject/
209
188
  *
210
189
  * @param projectRoot Expo project root path.
211
190
  */
212
-
213
-
214
191
  function getIosNamedProjectPath(projectRoot) {
215
192
  const projectName = getProjectName(projectRoot);
216
193
  return (0, _path().join)(projectRoot, 'ios', projectName);
217
194
  }
218
-
219
195
  function getAppleIconName(size, scale) {
220
196
  return `App-Icon-${size}x${size}@${scale}x.png`;
221
197
  }
@@ -1 +1 @@
1
- {"version":3,"file":"withIosIcons.js","names":["getProjectName","IOSConfig","XcodeUtils","withIosIcons","config","withDangerousMod","setIconsAsync","modRequest","projectRoot","IMAGE_CACHE_NAME","IMAGESET_PATH","ICON_CONTENTS","idiom","sizes","size","scales","getIcons","ios","icon","WarningAggregator","addWarningIOS","iosNamedProjectRoot","getIosNamedProjectPath","fs","ensureDir","join","imagesJson","generatedIcons","platform","isMarketing","scale","filename","getAppleIconName","iconSizePx","source","generateImageAsync","cacheType","src","name","width","height","removeTransparency","resizeMode","backgroundColor","assetPath","writeFile","push","writeContentsJsonAsync","images","projectName"],"sources":["../../../src/plugins/icons/withIosIcons.ts"],"sourcesContent":["import { ConfigPlugin, IOSConfig, WarningAggregator, withDangerousMod } from '@expo/config-plugins';\nimport { ExpoConfig } from '@expo/config-types';\nimport { generateImageAsync } from '@expo/image-utils';\nimport * as fs from 'fs-extra';\nimport { join } from 'path';\n\nimport { ContentsJson, ContentsJsonImageIdiom, writeContentsJsonAsync } from './AssetContents';\n\nconst { getProjectName } = IOSConfig.XcodeUtils;\n\nexport const withIosIcons: ConfigPlugin = (config) => {\n return withDangerousMod(config, [\n 'ios',\n async (config) => {\n await setIconsAsync(config, config.modRequest.projectRoot);\n return config;\n },\n ]);\n};\n\nconst IMAGE_CACHE_NAME = 'icons';\nconst IMAGESET_PATH = 'Images.xcassets/AppIcon.appiconset';\n\n// Hard-coding seemed like the clearest and safest way to implement the sizes.\nexport const ICON_CONTENTS: {\n idiom: ContentsJsonImageIdiom;\n sizes: { size: number; scales: (1 | 2 | 3)[] }[];\n}[] = [\n {\n idiom: 'iphone',\n sizes: [\n {\n size: 20,\n scales: [2, 3],\n },\n {\n size: 29,\n scales: [1, 2, 3],\n },\n {\n size: 40,\n scales: [2, 3],\n },\n {\n size: 60,\n scales: [2, 3],\n },\n // TODO: 76x76@2x seems unused now\n // {\n // size: 76,\n // scales: [2],\n // },\n ],\n },\n {\n idiom: 'ipad',\n sizes: [\n {\n size: 20,\n scales: [1, 2],\n },\n {\n size: 29,\n scales: [1, 2],\n },\n {\n size: 40,\n scales: [1, 2],\n },\n {\n size: 76,\n scales: [1, 2],\n },\n {\n size: 83.5,\n scales: [2],\n },\n ],\n },\n {\n idiom: 'ios-marketing',\n sizes: [\n {\n size: 1024,\n scales: [1],\n },\n ],\n },\n];\n\nexport function getIcons(config: Pick<ExpoConfig, 'icon' | 'ios'>): string | null {\n // No support for empty strings.\n return config.ios?.icon || config.icon || null;\n}\n\nexport async function setIconsAsync(config: ExpoConfig, projectRoot: string) {\n const icon = getIcons(config);\n if (!icon) {\n WarningAggregator.addWarningIOS(\n 'icon',\n 'This is the image that your app uses on your home screen, you will need to configure it manually.'\n );\n return;\n }\n\n // Something like projectRoot/ios/MyApp/\n const iosNamedProjectRoot = getIosNamedProjectPath(projectRoot);\n\n // Ensure the Images.xcassets/AppIcon.appiconset path exists\n await fs.ensureDir(join(iosNamedProjectRoot, IMAGESET_PATH));\n\n // Store the image JSON data for assigning via the Contents.json\n const imagesJson: ContentsJson['images'] = [];\n\n // keep track of icons that have been generated so we can reuse them in the Contents.json\n const generatedIcons: Record<string, boolean> = {};\n\n for (const platform of ICON_CONTENTS) {\n const isMarketing = platform.idiom === 'ios-marketing';\n for (const { size, scales } of platform.sizes) {\n for (const scale of scales) {\n // The marketing icon is special because it makes no sense.\n const filename = isMarketing ? 'ItunesArtwork@2x.png' : getAppleIconName(size, scale);\n // Only create an image that hasn't already been generated.\n if (!(filename in generatedIcons)) {\n const iconSizePx = size * scale;\n\n // Using this method will cache the images in `.expo` based on the properties used to generate them.\n // this method also supports remote URLs and using the global sharp instance.\n const { source } = await generateImageAsync(\n { projectRoot, cacheType: IMAGE_CACHE_NAME },\n {\n src: icon,\n name: filename,\n width: iconSizePx,\n height: iconSizePx,\n removeTransparency: true,\n // The icon should be square, but if it's not then it will be cropped.\n resizeMode: 'cover',\n // Force the background color to solid white to prevent any transparency.\n // TODO: Maybe use a more adaptive option based on the icon color?\n backgroundColor: '#ffffff',\n }\n );\n // Write image buffer to the file system.\n const assetPath = join(iosNamedProjectRoot, IMAGESET_PATH, filename);\n await fs.writeFile(assetPath, source);\n // Save a reference to the generated image so we don't create a duplicate.\n generatedIcons[filename] = true;\n }\n imagesJson.push({\n idiom: platform.idiom,\n size: `${size}x${size}`,\n // @ts-ignore: template types not supported in TS yet\n scale: `${scale}x`,\n filename,\n });\n }\n }\n }\n\n // Finally, write the Config.json\n await writeContentsJsonAsync(join(iosNamedProjectRoot, IMAGESET_PATH), { images: imagesJson });\n}\n\n/**\n * Return the project's named iOS path: ios/MyProject/\n *\n * @param projectRoot Expo project root path.\n */\nfunction getIosNamedProjectPath(projectRoot: string): string {\n const projectName = getProjectName(projectRoot);\n return join(projectRoot, 'ios', projectName);\n}\n\nfunction getAppleIconName(size: number, scale: number): string {\n return `App-Icon-${size}x${size}@${scale}x.png`;\n}\n"],"mappings":";;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;;;;;AAEA,MAAM;EAAEA;AAAF,IAAqBC,0BAAA,CAAUC,UAArC;;AAEO,MAAMC,YAA0B,GAAIC,MAAD,IAAY;EACpD,OAAO,IAAAC,iCAAA,EAAiBD,MAAjB,EAAyB,CAC9B,KAD8B,EAE9B,MAAOA,MAAP,IAAkB;IAChB,MAAME,aAAa,CAACF,MAAD,EAASA,MAAM,CAACG,UAAP,CAAkBC,WAA3B,CAAnB;IACA,OAAOJ,MAAP;EACD,CAL6B,CAAzB,CAAP;AAOD,CARM;;;AAUP,MAAMK,gBAAgB,GAAG,OAAzB;AACA,MAAMC,aAAa,GA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BAAkB,EAAE,IALtB;YAME;YACAC,UAAU,EAAE,OAPd;YAQE;YACA;YACAC,eAAe,EAAE;UAVnB,CAFuB,CAAzB,CALiC,CAoBjC;;UACA,MAAMC,SAAS,GAAG,IAAAnB,YAAA,EAAKJ,mBAAL,EAA0BX,aAA1B,EAAyCqB,QAAzC,CAAlB;UACA,MAAMR,EAAE,GAACsB,SAAH,CAAaD,SAAb,EAAwBV,MAAxB,CAAN,CAtBiC,CAuBjC;;UACAP,cAAc,CAACI,QAAD,CAAd,GAA2B,IAA3B;QACD;;QACDL,UAAU,CAACoB,IAAX,CAAgB;UACdlC,KAAK,EAAEgB,QAAQ,CAAChB,KADF;UAEdE,IAAI,EAAG,GAAEA,IAAK,IAAGA,IAAK,EAFR;UAGd;UACAgB,KAAK,EAAG,GAAEA,KAAM,GAJF;UAKdC;QALc,CAAhB;MAOD;IACF;EACF,CAhE0E,CAkE3E;;;EACA,MAAM,IAAAgB,uCAAA,EAAuB,IAAAtB,YAAA,EAAKJ,mBAAL,EAA0BX,aAA1B,CAAvB,EAAiE;IAAEsC,MAAM,EAAEtB;EAAV,CAAjE,CAAN;AACD;AAED;AACA;AACA;AACA;AACA;;;AACA,SAASJ,sBAAT,CAAgCd,WAAhC,EAA6D;EAC3D,MAAMyC,WAAW,GAAGjD,cAAc,CAACQ,WAAD,CAAlC;EACA,OAAO,IAAAiB,YAAA,EAAKjB,WAAL,EAAkB,KAAlB,EAAyByC,WAAzB,CAAP;AACD;;AAED,SAASjB,gBAAT,CAA0BlB,IAA1B,EAAwCgB,KAAxC,EAA+D;EAC7D,OAAQ,YAAWhB,IAAK,IAAGA,IAAK,IAAGgB,KAAM,OAAzC;AACD"}
1
+ {"version":3,"file":"withIosIcons.js","names":["getProjectName","IOSConfig","XcodeUtils","withIosIcons","config","withDangerousMod","setIconsAsync","modRequest","projectRoot","IMAGE_CACHE_NAME","IMAGESET_PATH","ICON_CONTENTS","idiom","sizes","size","scales","getIcons","ios","icon","WarningAggregator","addWarningIOS","iosNamedProjectRoot","getIosNamedProjectPath","fs","ensureDir","join","imagesJson","generatedIcons","platform","isMarketing","scale","filename","getAppleIconName","iconSizePx","source","generateImageAsync","cacheType","src","name","width","height","removeTransparency","resizeMode","backgroundColor","assetPath","writeFile","push","writeContentsJsonAsync","images","projectName"],"sources":["../../../src/plugins/icons/withIosIcons.ts"],"sourcesContent":["import { ConfigPlugin, IOSConfig, WarningAggregator, withDangerousMod } from '@expo/config-plugins';\nimport { ExpoConfig } from '@expo/config-types';\nimport { generateImageAsync } from '@expo/image-utils';\nimport * as fs from 'fs-extra';\nimport { join } from 'path';\n\nimport { ContentsJson, ContentsJsonImageIdiom, writeContentsJsonAsync } from './AssetContents';\n\nconst { getProjectName } = IOSConfig.XcodeUtils;\n\nexport const withIosIcons: ConfigPlugin = (config) => {\n return withDangerousMod(config, [\n 'ios',\n async (config) => {\n await setIconsAsync(config, config.modRequest.projectRoot);\n return config;\n },\n ]);\n};\n\nconst IMAGE_CACHE_NAME = 'icons';\nconst IMAGESET_PATH = 'Images.xcassets/AppIcon.appiconset';\n\n// Hard-coding seemed like the clearest and safest way to implement the sizes.\nexport const ICON_CONTENTS: {\n idiom: ContentsJsonImageIdiom;\n sizes: { size: number; scales: (1 | 2 | 3)[] }[];\n}[] = [\n {\n idiom: 'iphone',\n sizes: [\n {\n size: 20,\n scales: [2, 3],\n },\n {\n size: 29,\n scales: [1, 2, 3],\n },\n {\n size: 40,\n scales: [2, 3],\n },\n {\n size: 60,\n scales: [2, 3],\n },\n // TODO: 76x76@2x seems unused now\n // {\n // size: 76,\n // scales: [2],\n // },\n ],\n },\n {\n idiom: 'ipad',\n sizes: [\n {\n size: 20,\n scales: [1, 2],\n },\n {\n size: 29,\n scales: [1, 2],\n },\n {\n size: 40,\n scales: [1, 2],\n },\n {\n size: 76,\n scales: [1, 2],\n },\n {\n size: 83.5,\n scales: [2],\n },\n ],\n },\n {\n idiom: 'ios-marketing',\n sizes: [\n {\n size: 1024,\n scales: [1],\n },\n ],\n },\n];\n\nexport function getIcons(config: Pick<ExpoConfig, 'icon' | 'ios'>): string | null {\n // No support for empty strings.\n return config.ios?.icon || config.icon || null;\n}\n\nexport async function setIconsAsync(config: ExpoConfig, projectRoot: string) {\n const icon = getIcons(config);\n if (!icon) {\n WarningAggregator.addWarningIOS(\n 'icon',\n 'This is the image that your app uses on your home screen, you will need to configure it manually.'\n );\n return;\n }\n\n // Something like projectRoot/ios/MyApp/\n const iosNamedProjectRoot = getIosNamedProjectPath(projectRoot);\n\n // Ensure the Images.xcassets/AppIcon.appiconset path exists\n await fs.ensureDir(join(iosNamedProjectRoot, IMAGESET_PATH));\n\n // Store the image JSON data for assigning via the Contents.json\n const imagesJson: ContentsJson['images'] = [];\n\n // keep track of icons that have been generated so we can reuse them in the Contents.json\n const generatedIcons: Record<string, boolean> = {};\n\n for (const platform of ICON_CONTENTS) {\n const isMarketing = platform.idiom === 'ios-marketing';\n for (const { size, scales } of platform.sizes) {\n for (const scale of scales) {\n // The marketing icon is special because it makes no sense.\n const filename = isMarketing ? 'ItunesArtwork@2x.png' : getAppleIconName(size, scale);\n // Only create an image that hasn't already been generated.\n if (!(filename in generatedIcons)) {\n const iconSizePx = size * scale;\n\n // Using this method will cache the images in `.expo` based on the properties used to generate them.\n // this method also supports remote URLs and using the global sharp instance.\n const { source } = await generateImageAsync(\n { projectRoot, cacheType: IMAGE_CACHE_NAME },\n {\n src: icon,\n name: filename,\n width: iconSizePx,\n height: iconSizePx,\n removeTransparency: true,\n // The icon should be square, but if it's not then it will be cropped.\n resizeMode: 'cover',\n // Force the background color to solid white to prevent any transparency.\n // TODO: Maybe use a more adaptive option based on the icon color?\n backgroundColor: '#ffffff',\n }\n );\n // Write image buffer to the file system.\n const assetPath = join(iosNamedProjectRoot, IMAGESET_PATH, filename);\n await fs.writeFile(assetPath, source);\n // Save a reference to the generated image so we don't create a duplicate.\n generatedIcons[filename] = true;\n }\n imagesJson.push({\n idiom: platform.idiom,\n size: `${size}x${size}`,\n // @ts-ignore: template types not supported in TS yet\n scale: `${scale}x`,\n filename,\n });\n }\n }\n }\n\n // Finally, write the Config.json\n await writeContentsJsonAsync(join(iosNamedProjectRoot, IMAGESET_PATH), { images: imagesJson });\n}\n\n/**\n * Return the project's named iOS path: ios/MyProject/\n *\n * @param projectRoot Expo project root path.\n */\nfunction getIosNamedProjectPath(projectRoot: string): string {\n const projectName = getProjectName(projectRoot);\n return join(projectRoot, 'ios', projectName);\n}\n\nfunction getAppleIconName(size: number, scale: number): string {\n return `App-Icon-${size}x${size}@${scale}x.png`;\n}\n"],"mappings":";;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAA+F;AAAA;AAE/F,MAAM;EAAEA;AAAe,CAAC,GAAGC,0BAAS,CAACC,UAAU;AAExC,MAAMC,YAA0B,GAAIC,MAAM,IAAK;EACpD,OAAO,IAAAC,iCAAgB,EAACD,MAAM,EAAE,CAC9B,KAAK,EACL,MAAOA,MAAM,IAAK;IAChB,MAAME,aAAa,CAACF,MAAM,EAAEA,MAAM,CAACG,UAAU,CAACC,WAAW,CAAC;IAC1D,OAAOJ,MAAM;EACf,CAAC,CACF,CAAC;AACJ,CAAC;AAAC;AAEF,MAAMK,gBAAgB,GAAG,OAAO;AAChC,MAAMC,aAAa,GAAG,oCAAoC;;AAE1D;AACO,MAAMC,aAGV,GAAG,CACJ;EACEC,KAAK,EAAE,QAAQ;EACfC,KAAK,EAAE,CACL;IACEC,IAAI,EAAE,EAAE;IACRC,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC;EACf,CAAC,EACD;IACED,IAAI,EAAE,EAAE;IACRC,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;EAClB,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B,QAAQ,CAAChB,KAAK;UACrBE,IAAI,EAAG,GAAEA,IAAK,IAAGA,IAAK,EAAC;UACvB;UACAgB,KAAK,EAAG,GAAEA,KAAM,GAAE;UAClBC;QACF,CAAC,CAAC;MACJ;IACF;EACF;;EAEA;EACA,MAAM,IAAAgB,uCAAsB,EAAC,IAAAtB,YAAI,EAACJ,mBAAmB,EAAEX,aAAa,CAAC,EAAE;IAAEsC,MAAM,EAAEtB;EAAW,CAAC,CAAC;AAChG;;AAEA;AACA;AACA;AACA;AACA;AACA,SAASJ,sBAAsB,CAACd,WAAmB,EAAU;EAC3D,MAAMyC,WAAW,GAAGjD,cAAc,CAACQ,WAAW,CAAC;EAC/C,OAAO,IAAAiB,YAAI,EAACjB,WAAW,EAAE,KAAK,EAAEyC,WAAW,CAAC;AAC9C;AAEA,SAASjB,gBAAgB,CAAClB,IAAY,EAAEgB,KAAa,EAAU;EAC7D,OAAQ,YAAWhB,IAAK,IAAGA,IAAK,IAAGgB,KAAM,OAAM;AACjD"}
@@ -4,46 +4,36 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.createLegacyPlugin = createLegacyPlugin;
7
-
8
7
  function _configPlugins() {
9
8
  const data = require("@expo/config-plugins");
10
-
11
9
  _configPlugins = function () {
12
10
  return data;
13
11
  };
14
-
15
12
  return data;
16
13
  }
17
-
18
14
  const toCamelCase = s => s.replace(/-./g, x => x.toUpperCase()[1]);
19
-
20
15
  function isModuleExcluded(config, packageName) {
21
16
  var _config$_internal;
22
-
23
17
  // Skip using the versioned plugin when autolinking is enabled
24
18
  // and doesn't link the native module.
25
19
  return ((_config$_internal = config._internal) === null || _config$_internal === void 0 ? void 0 : _config$_internal.autolinkedModules) && !config._internal.autolinkedModules.includes(packageName);
26
20
  }
27
-
28
21
  function createLegacyPlugin({
29
22
  packageName,
30
23
  fallback
31
24
  }) {
32
25
  let withFallback;
33
-
34
26
  if (Array.isArray(fallback)) {
35
27
  withFallback = config => (0, _configPlugins().withPlugins)(config, fallback);
36
28
  } else {
37
29
  withFallback = fallback;
38
30
  }
39
-
40
31
  const withUnknown = config => {
41
32
  // Skip using the versioned plugin when autolinking is enabled
42
33
  // and doesn't link the native module.
43
34
  if (isModuleExcluded(config, packageName)) {
44
35
  return (0, _configPlugins().createRunOncePlugin)(withFallback, packageName)(config);
45
36
  }
46
-
47
37
  return (0, _configPlugins().withStaticPlugin)(config, {
48
38
  _isLegacyPlugin: true,
49
39
  plugin: packageName,
@@ -51,7 +41,6 @@ function createLegacyPlugin({
51
41
  fallback: (0, _configPlugins().createRunOncePlugin)(withFallback, packageName)
52
42
  });
53
43
  };
54
-
55
44
  const methodName = toCamelCase(`with-${packageName}`);
56
45
  Object.defineProperty(withUnknown, 'name', {
57
46
  value: methodName
@@ -1 +1 @@
1
- {"version":3,"file":"createLegacyPlugin.js","names":["toCamelCase","s","replace","x","toUpperCase","isModuleExcluded","config","packageName","_internal","autolinkedModules","includes","createLegacyPlugin","fallback","withFallback","Array","isArray","withPlugins","withUnknown","createRunOncePlugin","withStaticPlugin","_isLegacyPlugin","plugin","methodName","Object","defineProperty","value"],"sources":["../../../src/plugins/unversioned/createLegacyPlugin.ts"],"sourcesContent":["import {\n ConfigPlugin,\n createRunOncePlugin,\n PluginParameters,\n withPlugins,\n withStaticPlugin,\n} from '@expo/config-plugins';\nimport { ExpoConfig } from '@expo/config-types';\n\nconst toCamelCase = (s: string) => s.replace(/-./g, (x) => x.toUpperCase()[1]);\n\nfunction isModuleExcluded(config: Pick<ExpoConfig, '_internal'>, packageName: string): boolean {\n // Skip using the versioned plugin when autolinking is enabled\n // and doesn't link the native module.\n return (\n config._internal?.autolinkedModules && !config._internal.autolinkedModules.includes(packageName)\n );\n}\n\nexport function createLegacyPlugin({\n packageName,\n fallback,\n}: {\n packageName: string;\n fallback: ConfigPlugin | PluginParameters<typeof withPlugins>;\n}): ConfigPlugin {\n let withFallback: ConfigPlugin;\n\n if (Array.isArray(fallback)) {\n withFallback = (config) => withPlugins(config, fallback);\n } else {\n withFallback = fallback;\n }\n\n const withUnknown: ConfigPlugin = (config) => {\n // Skip using the versioned plugin when autolinking is enabled\n // and doesn't link the native module.\n if (isModuleExcluded(config, packageName)) {\n return createRunOncePlugin(withFallback, packageName)(config);\n }\n\n return withStaticPlugin(config, {\n _isLegacyPlugin: true,\n plugin: packageName,\n // If the static plugin isn't found, use the unversioned one.\n fallback: createRunOncePlugin(withFallback, packageName),\n });\n };\n\n const methodName = toCamelCase(`with-${packageName}`);\n Object.defineProperty(withUnknown, 'name', {\n value: methodName,\n });\n\n return withUnknown;\n}\n"],"mappings":";;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AASA,MAAMA,WAAW,GAAIC,CAAD,IAAeA,CAAC,CAACC,OAAF,CAAU,KAAV,EAAkBC,CAAD,IAAOA,CAAC,CAACC,WAAF,GAAgB,CAAhB,CAAxB,CAAnC;;AAEA,SAASC,gBAAT,CAA0BC,MAA1B,EAAiEC,WAAjE,EAA+F;EAAA;;EAC7F;EACA;EACA,OACE,sBAAAD,MAAM,CAACE,SAAP,wEAAkBC,iBAAlB,KAAuC,CAACH,MAAM,CAACE,SAAP,CAAiBC,iBAAjB,CAAmCC,QAAnC,CAA4CH,WAA5C,CAD1C;AAGD;;AAEM,SAASI,kBAAT,CAA4B;EACjCJ,WADiC;EAEjCK;AAFiC,CAA5B,EAMU;EACf,IAAIC,YAAJ;;EAEA,IAAIC,KAAK,CAACC,OAAN,CAAcH,QAAd,CAAJ,EAA6B;IAC3BC,YAAY,GAAIP,MAAD,IAAY,IAAAU,4BAAA,EAAYV,MAAZ,EAAoBM,QAApB,CAA3B;EACD,CAFD,MAEO;IACLC,YAAY,GAAGD,QAAf;EACD;;EAED,MAAMK,WAAyB,GAAIX,MAAD,IAAY;IAC5C;IACA;IACA,IAAID,gBAAgB,CAACC,MAAD,EAASC,WAAT,CAApB,EAA2C;MACzC,OAAO,IAAAW,oCAAA,EAAoBL,YAApB,EAAkCN,WAAlC,EAA+CD,MAA/C,CAAP;IACD;;IAED,OAAO,IAAAa,iCAAA,EAAiBb,MAAjB,EAAyB;MAC9Bc,eAAe,EAAE,IADa;MAE9BC,MAAM,EAAEd,WAFsB;MAG9B;MACAK,QAAQ,EAAE,IAAAM,oCAAA,EAAoBL,YAApB,EAAkCN,WAAlC;IAJoB,CAAzB,CAAP;EAMD,CAbD;;EAeA,MAAMe,UAAU,GAAGtB,WAAW,CAAE,QAAOO,WAAY,EAArB,CAA9B;EACAgB,MAAM,CAACC,cAAP,CAAsBP,WAAtB,EAAmC,MAAnC,EAA2C;IACzCQ,KAAK,EAAEH;EADkC,CAA3C;EAIA,OAAOL,WAAP;AACD"}
1
+ {"version":3,"file":"createLegacyPlugin.js","names":["toCamelCase","s","replace","x","toUpperCase","isModuleExcluded","config","packageName","_internal","autolinkedModules","includes","createLegacyPlugin","fallback","withFallback","Array","isArray","withPlugins","withUnknown","createRunOncePlugin","withStaticPlugin","_isLegacyPlugin","plugin","methodName","Object","defineProperty","value"],"sources":["../../../src/plugins/unversioned/createLegacyPlugin.ts"],"sourcesContent":["import {\n ConfigPlugin,\n createRunOncePlugin,\n PluginParameters,\n withPlugins,\n withStaticPlugin,\n} from '@expo/config-plugins';\nimport { ExpoConfig } from '@expo/config-types';\n\nconst toCamelCase = (s: string) => s.replace(/-./g, (x) => x.toUpperCase()[1]);\n\nfunction isModuleExcluded(config: Pick<ExpoConfig, '_internal'>, packageName: string): boolean {\n // Skip using the versioned plugin when autolinking is enabled\n // and doesn't link the native module.\n return (\n config._internal?.autolinkedModules && !config._internal.autolinkedModules.includes(packageName)\n );\n}\n\nexport function createLegacyPlugin({\n packageName,\n fallback,\n}: {\n packageName: string;\n fallback: ConfigPlugin | PluginParameters<typeof withPlugins>;\n}): ConfigPlugin {\n let withFallback: ConfigPlugin;\n\n if (Array.isArray(fallback)) {\n withFallback = (config) => withPlugins(config, fallback);\n } else {\n withFallback = fallback;\n }\n\n const withUnknown: ConfigPlugin = (config) => {\n // Skip using the versioned plugin when autolinking is enabled\n // and doesn't link the native module.\n if (isModuleExcluded(config, packageName)) {\n return createRunOncePlugin(withFallback, packageName)(config);\n }\n\n return withStaticPlugin(config, {\n _isLegacyPlugin: true,\n plugin: packageName,\n // If the static plugin isn't found, use the unversioned one.\n fallback: createRunOncePlugin(withFallback, packageName),\n });\n };\n\n const methodName = toCamelCase(`with-${packageName}`);\n Object.defineProperty(withUnknown, 'name', {\n value: methodName,\n });\n\n return withUnknown;\n}\n"],"mappings":";;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AASA,MAAMA,WAAW,GAAIC,CAAS,IAAKA,CAAC,CAACC,OAAO,CAAC,KAAK,EAAGC,CAAC,IAAKA,CAAC,CAACC,WAAW,EAAE,CAAC,CAAC,CAAC,CAAC;AAE9E,SAASC,gBAAgB,CAACC,MAAqC,EAAEC,WAAmB,EAAW;EAAA;EAC7F;EACA;EACA,OACE,sBAAAD,MAAM,CAACE,SAAS,sDAAhB,kBAAkBC,iBAAiB,KAAI,CAACH,MAAM,CAACE,SAAS,CAACC,iBAAiB,CAACC,QAAQ,CAACH,WAAW,CAAC;AAEpG;AAEO,SAASI,kBAAkB,CAAC;EACjCJ,WAAW;EACXK;AAIF,CAAC,EAAgB;EACf,IAAIC,YAA0B;EAE9B,IAAIC,KAAK,CAACC,OAAO,CAACH,QAAQ,CAAC,EAAE;IAC3BC,YAAY,GAAIP,MAAM,IAAK,IAAAU,4BAAW,EAACV,MAAM,EAAEM,QAAQ,CAAC;EAC1D,CAAC,MAAM;IACLC,YAAY,GAAGD,QAAQ;EACzB;EAEA,MAAMK,WAAyB,GAAIX,MAAM,IAAK;IAC5C;IACA;IACA,IAAID,gBAAgB,CAACC,MAAM,EAAEC,WAAW,CAAC,EAAE;MACzC,OAAO,IAAAW,oCAAmB,EAACL,YAAY,EAAEN,WAAW,CAAC,CAACD,MAAM,CAAC;IAC/D;IAEA,OAAO,IAAAa,iCAAgB,EAACb,MAAM,EAAE;MAC9Bc,eAAe,EAAE,IAAI;MACrBC,MAAM,EAAEd,WAAW;MACnB;MACAK,QAAQ,EAAE,IAAAM,oCAAmB,EAACL,YAAY,EAAEN,WAAW;IACzD,CAAC,CAAC;EACJ,CAAC;EAED,MAAMe,UAAU,GAAGtB,WAAW,CAAE,QAAOO,WAAY,EAAC,CAAC;EACrDgB,MAAM,CAACC,cAAc,CAACP,WAAW,EAAE,MAAM,EAAE;IACzCQ,KAAK,EAAEH;EACT,CAAC,CAAC;EAEF,OAAOL,WAAW;AACpB"}
@@ -4,41 +4,30 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  function _createLegacyPlugin() {
9
8
  const data = require("../createLegacyPlugin");
10
-
11
9
  _createLegacyPlugin = function () {
12
10
  return data;
13
11
  };
14
-
15
12
  return data;
16
13
  }
17
-
18
14
  function _withAndroidAdMob() {
19
15
  const data = require("./withAndroidAdMob");
20
-
21
16
  _withAndroidAdMob = function () {
22
17
  return data;
23
18
  };
24
-
25
19
  return data;
26
20
  }
27
-
28
21
  function _withIosAdMob() {
29
22
  const data = require("./withIosAdMob");
30
-
31
23
  _withIosAdMob = function () {
32
24
  return data;
33
25
  };
34
-
35
26
  return data;
36
27
  }
37
-
38
28
  var _default = (0, _createLegacyPlugin().createLegacyPlugin)({
39
29
  packageName: 'expo-ads-admob',
40
30
  fallback: [_withAndroidAdMob().withAndroidAdMob, _withIosAdMob().withIosAdMob]
41
31
  });
42
-
43
32
  exports.default = _default;
44
33
  //# sourceMappingURL=expo-ads-admob.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"expo-ads-admob.js","names":["createLegacyPlugin","packageName","fallback","withAndroidAdMob","withIosAdMob"],"sources":["../../../../src/plugins/unversioned/expo-ads-admob/expo-ads-admob.ts"],"sourcesContent":["import { createLegacyPlugin } from '../createLegacyPlugin';\nimport { withAndroidAdMob } from './withAndroidAdMob';\nimport { withIosAdMob } from './withIosAdMob';\n\nexport default createLegacyPlugin({\n packageName: 'expo-ads-admob',\n fallback: [withAndroidAdMob, withIosAdMob],\n});\n"],"mappings":";;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;eAEe,IAAAA,wCAAA,EAAmB;EAChCC,WAAW,EAAE,gBADmB;EAEhCC,QAAQ,EAAE,CAACC,oCAAD,EAAmBC,4BAAnB;AAFsB,CAAnB,C"}
1
+ {"version":3,"file":"expo-ads-admob.js","names":["createLegacyPlugin","packageName","fallback","withAndroidAdMob","withIosAdMob"],"sources":["../../../../src/plugins/unversioned/expo-ads-admob/expo-ads-admob.ts"],"sourcesContent":["import { createLegacyPlugin } from '../createLegacyPlugin';\nimport { withAndroidAdMob } from './withAndroidAdMob';\nimport { withIosAdMob } from './withIosAdMob';\n\nexport default createLegacyPlugin({\n packageName: 'expo-ads-admob',\n fallback: [withAndroidAdMob, withIosAdMob],\n});\n"],"mappings":";;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAA8C,eAE/B,IAAAA,wCAAkB,EAAC;EAChCC,WAAW,EAAE,gBAAgB;EAC7BC,QAAQ,EAAE,CAACC,oCAAgB,EAAEC,4BAAY;AAC3C,CAAC,CAAC;AAAA"}
@@ -7,52 +7,39 @@ exports.getGoogleMobileAdsAppId = getGoogleMobileAdsAppId;
7
7
  exports.getGoogleMobileAdsAutoInit = getGoogleMobileAdsAutoInit;
8
8
  exports.setAdMobConfig = setAdMobConfig;
9
9
  exports.withAndroidAdMob = void 0;
10
-
11
10
  function _configPlugins() {
12
11
  const data = require("@expo/config-plugins");
13
-
14
12
  _configPlugins = function () {
15
13
  return data;
16
14
  };
17
-
18
15
  return data;
19
16
  }
20
-
21
17
  const {
22
18
  addMetaDataItemToMainApplication,
23
19
  getMainApplicationOrThrow,
24
20
  removeMetaDataItemFromMainApplication
25
21
  } = _configPlugins().AndroidConfig.Manifest;
26
-
27
22
  const META_APPLICATION_ID = 'com.google.android.gms.ads.APPLICATION_ID';
28
23
  const META_DELAY_APP_MEASUREMENT_INIT = 'com.google.android.gms.ads.DELAY_APP_MEASUREMENT_INIT';
29
-
30
24
  const withAndroidAdMob = config => {
31
25
  return (0, _configPlugins().withAndroidManifest)(config, config => {
32
26
  config.modResults = setAdMobConfig(config, config.modResults);
33
27
  return config;
34
28
  });
35
29
  };
36
-
37
30
  exports.withAndroidAdMob = withAndroidAdMob;
38
-
39
31
  function getGoogleMobileAdsAppId(config) {
40
32
  var _config$android$confi, _config$android, _config$android$confi2;
41
-
42
33
  return (_config$android$confi = (_config$android = config.android) === null || _config$android === void 0 ? void 0 : (_config$android$confi2 = _config$android.config) === null || _config$android$confi2 === void 0 ? void 0 : _config$android$confi2.googleMobileAdsAppId) !== null && _config$android$confi !== void 0 ? _config$android$confi : null;
43
34
  }
44
-
45
35
  function getGoogleMobileAdsAutoInit(config) {
46
36
  var _config$android$confi3, _config$android2, _config$android2$conf;
47
-
48
37
  return (_config$android$confi3 = (_config$android2 = config.android) === null || _config$android2 === void 0 ? void 0 : (_config$android2$conf = _config$android2.config) === null || _config$android2$conf === void 0 ? void 0 : _config$android2$conf.googleMobileAdsAutoInit) !== null && _config$android$confi3 !== void 0 ? _config$android$confi3 : false;
49
38
  }
50
-
51
39
  function setAdMobConfig(config, androidManifest) {
52
40
  const appId = getGoogleMobileAdsAppId(config);
53
41
  const autoInit = getGoogleMobileAdsAutoInit(config);
54
42
  const mainApplication = getMainApplicationOrThrow(androidManifest);
55
-
56
43
  if (appId) {
57
44
  addMetaDataItemToMainApplication(mainApplication, META_APPLICATION_ID, appId);
58
45
  addMetaDataItemToMainApplication(mainApplication, META_DELAY_APP_MEASUREMENT_INIT, String(!autoInit));
@@ -60,7 +47,6 @@ function setAdMobConfig(config, androidManifest) {
60
47
  removeMetaDataItemFromMainApplication(mainApplication, META_APPLICATION_ID);
61
48
  removeMetaDataItemFromMainApplication(mainApplication, META_DELAY_APP_MEASUREMENT_INIT);
62
49
  }
63
-
64
50
  return androidManifest;
65
51
  }
66
52
  //# sourceMappingURL=withAndroidAdMob.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"withAndroidAdMob.js","names":["addMetaDataItemToMainApplication","getMainApplicationOrThrow","removeMetaDataItemFromMainApplication","AndroidConfig","Manifest","META_APPLICATION_ID","META_DELAY_APP_MEASUREMENT_INIT","withAndroidAdMob","config","withAndroidManifest","modResults","setAdMobConfig","getGoogleMobileAdsAppId","android","googleMobileAdsAppId","getGoogleMobileAdsAutoInit","googleMobileAdsAutoInit","androidManifest","appId","autoInit","mainApplication","String"],"sources":["../../../../src/plugins/unversioned/expo-ads-admob/withAndroidAdMob.ts"],"sourcesContent":["import { AndroidConfig, ConfigPlugin, withAndroidManifest } from '@expo/config-plugins';\nimport { ExpoConfig } from '@expo/config-types';\n\nconst {\n addMetaDataItemToMainApplication,\n getMainApplicationOrThrow,\n removeMetaDataItemFromMainApplication,\n} = AndroidConfig.Manifest;\n\nconst META_APPLICATION_ID = 'com.google.android.gms.ads.APPLICATION_ID';\nconst META_DELAY_APP_MEASUREMENT_INIT = 'com.google.android.gms.ads.DELAY_APP_MEASUREMENT_INIT';\n\nexport const withAndroidAdMob: ConfigPlugin = (config) => {\n return withAndroidManifest(config, (config) => {\n config.modResults = setAdMobConfig(config, config.modResults);\n return config;\n });\n};\n\nexport function getGoogleMobileAdsAppId(config: Pick<ExpoConfig, 'android'>) {\n return config.android?.config?.googleMobileAdsAppId ?? null;\n}\n\nexport function getGoogleMobileAdsAutoInit(config: Pick<ExpoConfig, 'android'>) {\n return config.android?.config?.googleMobileAdsAutoInit ?? false;\n}\n\nexport function setAdMobConfig(\n config: Pick<ExpoConfig, 'android'>,\n androidManifest: AndroidConfig.Manifest.AndroidManifest\n) {\n const appId = getGoogleMobileAdsAppId(config);\n const autoInit = getGoogleMobileAdsAutoInit(config);\n const mainApplication = getMainApplicationOrThrow(androidManifest);\n\n if (appId) {\n addMetaDataItemToMainApplication(mainApplication, META_APPLICATION_ID, appId);\n addMetaDataItemToMainApplication(\n mainApplication,\n META_DELAY_APP_MEASUREMENT_INIT,\n String(!autoInit)\n );\n } else {\n removeMetaDataItemFromMainApplication(mainApplication, META_APPLICATION_ID);\n removeMetaDataItemFromMainApplication(mainApplication, META_DELAY_APP_MEASUREMENT_INIT);\n }\n\n return androidManifest;\n}\n"],"mappings":";;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAGA,MAAM;EACJA,gCADI;EAEJC,yBAFI;EAGJC;AAHI,IAIFC,8BAAA,CAAcC,QAJlB;;AAMA,MAAMC,mBAAmB,GAAG,2CAA5B;AACA,MAAMC,+BAA+B,GAAG,uDAAxC;;AAEO,MAAMC,gBAA8B,GAAIC,MAAD,IAAY;EACxD,OAAO,IAAAC,oCAAA,EAAoBD,MAApB,EAA6BA,MAAD,IAAY;IAC7CA,MAAM,CAACE,UAAP,GAAoBC,cAAc,CAACH,MAAD,EAASA,MAAM,CAACE,UAAhB,CAAlC;IACA,OAAOF,MAAP;EACD,CAHM,CAAP;AAID,CALM;;;;AAOA,SAASI,uBAAT,CAAiCJ,MAAjC,EAAsE;EAAA;;EAC3E,mDAAOA,MAAM,CAACK,OAAd,8EAAO,gBAAgBL,MAAvB,2DAAO,uBAAwBM,oBAA/B,yEAAuD,IAAvD;AACD;;AAEM,SAASC,0BAAT,CAAoCP,MAApC,EAAyE;EAAA;;EAC9E,qDAAOA,MAAM,CAACK,OAAd,8EAAO,iBAAgBL,MAAvB,0DAAO,sBAAwBQ,uBAA/B,2EAA0D,KAA1D;AACD;;AAEM,SAASL,cAAT,CACLH,MADK,EAELS,eAFK,EAGL;EACA,MAAMC,KAAK,GAAGN,uBAAuB,CAACJ,MAAD,CAArC;EACA,MAAMW,QAAQ,GAAGJ,0BAA0B,CAACP,MAAD,CAA3C;EACA,MAAMY,eAAe,GAAGnB,yBAAyB,CAACgB,eAAD,CAAjD;;EAEA,IAAIC,KAAJ,EAAW;IACTlB,gCAAgC,CAACoB,eAAD,EAAkBf,mBAAlB,EAAuCa,KAAvC,CAAhC;IACAlB,gCAAgC,CAC9BoB,eAD8B,EAE9Bd,+BAF8B,EAG9Be,MAAM,CAAC,CAACF,QAAF,CAHwB,CAAhC;EAKD,CAPD,MAOO;IACLjB,qCAAqC,CAACkB,eAAD,EAAkBf,mBAAlB,CAArC;IACAH,qCAAqC,CAACkB,eAAD,EAAkBd,+BAAlB,CAArC;EACD;;EAED,OAAOW,eAAP;AACD"}
1
+ {"version":3,"file":"withAndroidAdMob.js","names":["addMetaDataItemToMainApplication","getMainApplicationOrThrow","removeMetaDataItemFromMainApplication","AndroidConfig","Manifest","META_APPLICATION_ID","META_DELAY_APP_MEASUREMENT_INIT","withAndroidAdMob","config","withAndroidManifest","modResults","setAdMobConfig","getGoogleMobileAdsAppId","android","googleMobileAdsAppId","getGoogleMobileAdsAutoInit","googleMobileAdsAutoInit","androidManifest","appId","autoInit","mainApplication","String"],"sources":["../../../../src/plugins/unversioned/expo-ads-admob/withAndroidAdMob.ts"],"sourcesContent":["import { AndroidConfig, ConfigPlugin, withAndroidManifest } from '@expo/config-plugins';\nimport { ExpoConfig } from '@expo/config-types';\n\nconst {\n addMetaDataItemToMainApplication,\n getMainApplicationOrThrow,\n removeMetaDataItemFromMainApplication,\n} = AndroidConfig.Manifest;\n\nconst META_APPLICATION_ID = 'com.google.android.gms.ads.APPLICATION_ID';\nconst META_DELAY_APP_MEASUREMENT_INIT = 'com.google.android.gms.ads.DELAY_APP_MEASUREMENT_INIT';\n\nexport const withAndroidAdMob: ConfigPlugin = (config) => {\n return withAndroidManifest(config, (config) => {\n config.modResults = setAdMobConfig(config, config.modResults);\n return config;\n });\n};\n\nexport function getGoogleMobileAdsAppId(config: Pick<ExpoConfig, 'android'>) {\n return config.android?.config?.googleMobileAdsAppId ?? null;\n}\n\nexport function getGoogleMobileAdsAutoInit(config: Pick<ExpoConfig, 'android'>) {\n return config.android?.config?.googleMobileAdsAutoInit ?? false;\n}\n\nexport function setAdMobConfig(\n config: Pick<ExpoConfig, 'android'>,\n androidManifest: AndroidConfig.Manifest.AndroidManifest\n) {\n const appId = getGoogleMobileAdsAppId(config);\n const autoInit = getGoogleMobileAdsAutoInit(config);\n const mainApplication = getMainApplicationOrThrow(androidManifest);\n\n if (appId) {\n addMetaDataItemToMainApplication(mainApplication, META_APPLICATION_ID, appId);\n addMetaDataItemToMainApplication(\n mainApplication,\n META_DELAY_APP_MEASUREMENT_INIT,\n String(!autoInit)\n );\n } else {\n removeMetaDataItemFromMainApplication(mainApplication, META_APPLICATION_ID);\n removeMetaDataItemFromMainApplication(mainApplication, META_DELAY_APP_MEASUREMENT_INIT);\n }\n\n return androidManifest;\n}\n"],"mappings":";;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAGA,MAAM;EACJA,gCAAgC;EAChCC,yBAAyB;EACzBC;AACF,CAAC,GAAGC,8BAAa,CAACC,QAAQ;AAE1B,MAAMC,mBAAmB,GAAG,2CAA2C;AACvE,MAAMC,+BAA+B,GAAG,uDAAuD;AAExF,MAAMC,gBAA8B,GAAIC,MAAM,IAAK;EACxD,OAAO,IAAAC,oCAAmB,EAACD,MAAM,EAAGA,MAAM,IAAK;IAC7CA,MAAM,CAACE,UAAU,GAAGC,cAAc,CAACH,MAAM,EAAEA,MAAM,CAACE,UAAU,CAAC;IAC7D,OAAOF,MAAM;EACf,CAAC,CAAC;AACJ,CAAC;AAAC;AAEK,SAASI,uBAAuB,CAACJ,MAAmC,EAAE;EAAA;EAC3E,mDAAOA,MAAM,CAACK,OAAO,8EAAd,gBAAgBL,MAAM,2DAAtB,uBAAwBM,oBAAoB,yEAAI,IAAI;AAC7D;AAEO,SAASC,0BAA0B,CAACP,MAAmC,EAAE;EAAA;EAC9E,qDAAOA,MAAM,CAACK,OAAO,8EAAd,iBAAgBL,MAAM,0DAAtB,sBAAwBQ,uBAAuB,2EAAI,KAAK;AACjE;AAEO,SAASL,cAAc,CAC5BH,MAAmC,EACnCS,eAAuD,EACvD;EACA,MAAMC,KAAK,GAAGN,uBAAuB,CAACJ,MAAM,CAAC;EAC7C,MAAMW,QAAQ,GAAGJ,0BAA0B,CAACP,MAAM,CAAC;EACnD,MAAMY,eAAe,GAAGnB,yBAAyB,CAACgB,eAAe,CAAC;EAElE,IAAIC,KAAK,EAAE;IACTlB,gCAAgC,CAACoB,eAAe,EAAEf,mBAAmB,EAAEa,KAAK,CAAC;IAC7ElB,gCAAgC,CAC9BoB,eAAe,EACfd,+BAA+B,EAC/Be,MAAM,CAAC,CAACF,QAAQ,CAAC,CAClB;EACH,CAAC,MAAM;IACLjB,qCAAqC,CAACkB,eAAe,EAAEf,mBAAmB,CAAC;IAC3EH,qCAAqC,CAACkB,eAAe,EAAEd,+BAA+B,CAAC;EACzF;EAEA,OAAOW,eAAe;AACxB"}
@@ -6,54 +6,45 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.getGoogleMobileAdsAppId = getGoogleMobileAdsAppId;
7
7
  exports.setGoogleMobileAdsAppId = setGoogleMobileAdsAppId;
8
8
  exports.withIosAdMob = void 0;
9
-
10
9
  function _configPlugins() {
11
10
  const data = require("@expo/config-plugins");
12
-
13
11
  _configPlugins = function () {
14
12
  return data;
15
13
  };
16
-
17
14
  return data;
18
15
  }
19
-
20
16
  const withIosAdMob = config => {
21
17
  return (0, _configPlugins().withInfoPlist)(config, config => {
22
18
  config.modResults = setAdMobConfig(config, config.modResults);
23
19
  return config;
24
20
  });
25
- }; // NOTE(brentvatne): if the developer has installed the google ads sdk and does
21
+ };
22
+
23
+ // NOTE(brentvatne): if the developer has installed the google ads sdk and does
26
24
  // not provide an app id their app will crash. Standalone apps get around this by
27
25
  // providing some default value, we will instead here assume that the user can
28
26
  // do the right thing if they have installed the package. This is a slight discrepancy
29
27
  // that arises in ejecting because it's possible for the package to be installed and
30
28
  // not crashing in the managed workflow, then you eject and the app crashes because
31
29
  // you don't have an id to fall back to.
32
-
33
-
34
30
  exports.withIosAdMob = withIosAdMob;
35
-
36
31
  function getGoogleMobileAdsAppId(config) {
37
32
  var _config$ios$config$go, _config$ios, _config$ios$config;
38
-
39
33
  return (_config$ios$config$go = (_config$ios = config.ios) === null || _config$ios === void 0 ? void 0 : (_config$ios$config = _config$ios.config) === null || _config$ios$config === void 0 ? void 0 : _config$ios$config.googleMobileAdsAppId) !== null && _config$ios$config$go !== void 0 ? _config$ios$config$go : null;
40
34
  }
41
-
42
35
  function setGoogleMobileAdsAppId(config, {
43
36
  GADApplicationIdentifier,
44
37
  ...infoPlist
45
38
  }) {
46
39
  const appId = getGoogleMobileAdsAppId(config);
47
-
48
40
  if (appId === null) {
49
41
  return infoPlist;
50
42
  }
51
-
52
- return { ...infoPlist,
43
+ return {
44
+ ...infoPlist,
53
45
  GADApplicationIdentifier: appId
54
46
  };
55
47
  }
56
-
57
48
  function setAdMobConfig(config, infoPlist) {
58
49
  infoPlist = setGoogleMobileAdsAppId(config, infoPlist);
59
50
  return infoPlist;
@@ -1 +1 @@
1
- {"version":3,"file":"withIosAdMob.js","names":["withIosAdMob","config","withInfoPlist","modResults","setAdMobConfig","getGoogleMobileAdsAppId","ios","googleMobileAdsAppId","setGoogleMobileAdsAppId","GADApplicationIdentifier","infoPlist","appId"],"sources":["../../../../src/plugins/unversioned/expo-ads-admob/withIosAdMob.ts"],"sourcesContent":["import { ConfigPlugin, InfoPlist, withInfoPlist } from '@expo/config-plugins';\nimport { ExpoConfig } from '@expo/config-types';\n\nexport const withIosAdMob: ConfigPlugin = (config) => {\n return withInfoPlist(config, (config) => {\n config.modResults = setAdMobConfig(config, config.modResults);\n return config;\n });\n};\n\n// NOTE(brentvatne): if the developer has installed the google ads sdk and does\n// not provide an app id their app will crash. Standalone apps get around this by\n// providing some default value, we will instead here assume that the user can\n// do the right thing if they have installed the package. This is a slight discrepancy\n// that arises in ejecting because it's possible for the package to be installed and\n// not crashing in the managed workflow, then you eject and the app crashes because\n// you don't have an id to fall back to.\nexport function getGoogleMobileAdsAppId(config: Pick<ExpoConfig, 'ios'>) {\n return config.ios?.config?.googleMobileAdsAppId ?? null;\n}\n\nexport function setGoogleMobileAdsAppId(\n config: Pick<ExpoConfig, 'ios'>,\n { GADApplicationIdentifier, ...infoPlist }: InfoPlist\n): InfoPlist {\n const appId = getGoogleMobileAdsAppId(config);\n\n if (appId === null) {\n return infoPlist;\n }\n\n return {\n ...infoPlist,\n GADApplicationIdentifier: appId,\n };\n}\n\nfunction setAdMobConfig(config: Pick<ExpoConfig, 'ios'>, infoPlist: InfoPlist): InfoPlist {\n infoPlist = setGoogleMobileAdsAppId(config, infoPlist);\n return infoPlist;\n}\n"],"mappings":";;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAGO,MAAMA,YAA0B,GAAIC,MAAD,IAAY;EACpD,OAAO,IAAAC,8BAAA,EAAcD,MAAd,EAAuBA,MAAD,IAAY;IACvCA,MAAM,CAACE,UAAP,GAAoBC,cAAc,CAACH,MAAD,EAASA,MAAM,CAACE,UAAhB,CAAlC;IACA,OAAOF,MAAP;EACD,CAHM,CAAP;AAID,CALM,C,CAOP;AACA;AACA;AACA;AACA;AACA;AACA;;;;;AACO,SAASI,uBAAT,CAAiCJ,MAAjC,EAAkE;EAAA;;EACvE,+CAAOA,MAAM,CAACK,GAAd,sEAAO,YAAYL,MAAnB,uDAAO,mBAAoBM,oBAA3B,yEAAmD,IAAnD;AACD;;AAEM,SAASC,uBAAT,CACLP,MADK,EAEL;EAAEQ,wBAAF;EAA4B,GAAGC;AAA/B,CAFK,EAGM;EACX,MAAMC,KAAK,GAAGN,uBAAuB,CAACJ,MAAD,CAArC;;EAEA,IAAIU,KAAK,KAAK,IAAd,EAAoB;IAClB,OAAOD,SAAP;EACD;;EAED,OAAO,EACL,GAAGA,SADE;IAELD,wBAAwB,EAAEE;EAFrB,CAAP;AAID;;AAED,SAASP,cAAT,CAAwBH,MAAxB,EAAyDS,SAAzD,EAA0F;EACxFA,SAAS,GAAGF,uBAAuB,CAACP,MAAD,EAASS,SAAT,CAAnC;EACA,OAAOA,SAAP;AACD"}
1
+ {"version":3,"file":"withIosAdMob.js","names":["withIosAdMob","config","withInfoPlist","modResults","setAdMobConfig","getGoogleMobileAdsAppId","ios","googleMobileAdsAppId","setGoogleMobileAdsAppId","GADApplicationIdentifier","infoPlist","appId"],"sources":["../../../../src/plugins/unversioned/expo-ads-admob/withIosAdMob.ts"],"sourcesContent":["import { ConfigPlugin, InfoPlist, withInfoPlist } from '@expo/config-plugins';\nimport { ExpoConfig } from '@expo/config-types';\n\nexport const withIosAdMob: ConfigPlugin = (config) => {\n return withInfoPlist(config, (config) => {\n config.modResults = setAdMobConfig(config, config.modResults);\n return config;\n });\n};\n\n// NOTE(brentvatne): if the developer has installed the google ads sdk and does\n// not provide an app id their app will crash. Standalone apps get around this by\n// providing some default value, we will instead here assume that the user can\n// do the right thing if they have installed the package. This is a slight discrepancy\n// that arises in ejecting because it's possible for the package to be installed and\n// not crashing in the managed workflow, then you eject and the app crashes because\n// you don't have an id to fall back to.\nexport function getGoogleMobileAdsAppId(config: Pick<ExpoConfig, 'ios'>) {\n return config.ios?.config?.googleMobileAdsAppId ?? null;\n}\n\nexport function setGoogleMobileAdsAppId(\n config: Pick<ExpoConfig, 'ios'>,\n { GADApplicationIdentifier, ...infoPlist }: InfoPlist\n): InfoPlist {\n const appId = getGoogleMobileAdsAppId(config);\n\n if (appId === null) {\n return infoPlist;\n }\n\n return {\n ...infoPlist,\n GADApplicationIdentifier: appId,\n };\n}\n\nfunction setAdMobConfig(config: Pick<ExpoConfig, 'ios'>, infoPlist: InfoPlist): InfoPlist {\n infoPlist = setGoogleMobileAdsAppId(config, infoPlist);\n return infoPlist;\n}\n"],"mappings":";;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAGO,MAAMA,YAA0B,GAAIC,MAAM,IAAK;EACpD,OAAO,IAAAC,8BAAa,EAACD,MAAM,EAAGA,MAAM,IAAK;IACvCA,MAAM,CAACE,UAAU,GAAGC,cAAc,CAACH,MAAM,EAAEA,MAAM,CAACE,UAAU,CAAC;IAC7D,OAAOF,MAAM;EACf,CAAC,CAAC;AACJ,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACO,SAASI,uBAAuB,CAACJ,MAA+B,EAAE;EAAA;EACvE,+CAAOA,MAAM,CAACK,GAAG,sEAAV,YAAYL,MAAM,uDAAlB,mBAAoBM,oBAAoB,yEAAI,IAAI;AACzD;AAEO,SAASC,uBAAuB,CACrCP,MAA+B,EAC/B;EAAEQ,wBAAwB;EAAE,GAAGC;AAAqB,CAAC,EAC1C;EACX,MAAMC,KAAK,GAAGN,uBAAuB,CAACJ,MAAM,CAAC;EAE7C,IAAIU,KAAK,KAAK,IAAI,EAAE;IAClB,OAAOD,SAAS;EAClB;EAEA,OAAO;IACL,GAAGA,SAAS;IACZD,wBAAwB,EAAEE;EAC5B,CAAC;AACH;AAEA,SAASP,cAAc,CAACH,MAA+B,EAAES,SAAoB,EAAa;EACxFA,SAAS,GAAGF,uBAAuB,CAACP,MAAM,EAAES,SAAS,CAAC;EACtD,OAAOA,SAAS;AAClB"}
@@ -4,43 +4,32 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  function _configPlugins() {
9
8
  const data = require("@expo/config-plugins");
10
-
11
9
  _configPlugins = function () {
12
10
  return data;
13
11
  };
14
-
15
12
  return data;
16
13
  }
17
-
18
14
  function _createLegacyPlugin() {
19
15
  const data = require("./createLegacyPlugin");
20
-
21
16
  _createLegacyPlugin = function () {
22
17
  return data;
23
18
  };
24
-
25
19
  return data;
26
20
  }
27
-
28
21
  const withAppleSignInWarning = config => {
29
22
  return (0, _configPlugins().withEntitlementsPlist)(config, config => {
30
23
  var _config$ios;
31
-
32
24
  if ((_config$ios = config.ios) !== null && _config$ios !== void 0 && _config$ios.usesAppleSignIn) {
33
25
  _configPlugins().WarningAggregator.addWarningIOS('ios.usesAppleSignIn', 'Install expo-apple-authentication to enable this feature', 'https://docs.expo.dev/versions/latest/sdk/apple-authentication/#eas-build');
34
26
  }
35
-
36
27
  return config;
37
28
  });
38
29
  };
39
-
40
30
  var _default = (0, _createLegacyPlugin().createLegacyPlugin)({
41
31
  packageName: 'expo-apple-authentication',
42
32
  fallback: withAppleSignInWarning
43
33
  });
44
-
45
34
  exports.default = _default;
46
35
  //# sourceMappingURL=expo-apple-authentication.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"expo-apple-authentication.js","names":["withAppleSignInWarning","config","withEntitlementsPlist","ios","usesAppleSignIn","WarningAggregator","addWarningIOS","createLegacyPlugin","packageName","fallback"],"sources":["../../../src/plugins/unversioned/expo-apple-authentication.ts"],"sourcesContent":["import { ConfigPlugin, WarningAggregator, withEntitlementsPlist } from '@expo/config-plugins';\n\nimport { createLegacyPlugin } from './createLegacyPlugin';\n\nconst withAppleSignInWarning: ConfigPlugin = (config) => {\n return withEntitlementsPlist(config, (config) => {\n if (config.ios?.usesAppleSignIn) {\n WarningAggregator.addWarningIOS(\n 'ios.usesAppleSignIn',\n 'Install expo-apple-authentication to enable this feature',\n 'https://docs.expo.dev/versions/latest/sdk/apple-authentication/#eas-build'\n );\n }\n\n return config;\n });\n};\n\nexport default createLegacyPlugin({\n packageName: 'expo-apple-authentication',\n fallback: withAppleSignInWarning,\n});\n"],"mappings":";;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA,MAAMA,sBAAoC,GAAIC,MAAD,IAAY;EACvD,OAAO,IAAAC,sCAAA,EAAsBD,MAAtB,EAA+BA,MAAD,IAAY;IAAA;;IAC/C,mBAAIA,MAAM,CAACE,GAAX,wCAAI,YAAYC,eAAhB,EAAiC;MAC/BC,kCAAA,CAAkBC,aAAlB,CACE,qBADF,EAEE,0DAFF,EAGE,2EAHF;IAKD;;IAED,OAAOL,MAAP;EACD,CAVM,CAAP;AAWD,CAZD;;eAce,IAAAM,wCAAA,EAAmB;EAChCC,WAAW,EAAE,2BADmB;EAEhCC,QAAQ,EAAET;AAFsB,CAAnB,C"}
1
+ {"version":3,"file":"expo-apple-authentication.js","names":["withAppleSignInWarning","config","withEntitlementsPlist","ios","usesAppleSignIn","WarningAggregator","addWarningIOS","createLegacyPlugin","packageName","fallback"],"sources":["../../../src/plugins/unversioned/expo-apple-authentication.ts"],"sourcesContent":["import { ConfigPlugin, WarningAggregator, withEntitlementsPlist } from '@expo/config-plugins';\n\nimport { createLegacyPlugin } from './createLegacyPlugin';\n\nconst withAppleSignInWarning: ConfigPlugin = (config) => {\n return withEntitlementsPlist(config, (config) => {\n if (config.ios?.usesAppleSignIn) {\n WarningAggregator.addWarningIOS(\n 'ios.usesAppleSignIn',\n 'Install expo-apple-authentication to enable this feature',\n 'https://docs.expo.dev/versions/latest/sdk/apple-authentication/#eas-build'\n );\n }\n\n return config;\n });\n};\n\nexport default createLegacyPlugin({\n packageName: 'expo-apple-authentication',\n fallback: withAppleSignInWarning,\n});\n"],"mappings":";;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA,MAAMA,sBAAoC,GAAIC,MAAM,IAAK;EACvD,OAAO,IAAAC,sCAAqB,EAACD,MAAM,EAAGA,MAAM,IAAK;IAAA;IAC/C,mBAAIA,MAAM,CAACE,GAAG,wCAAV,YAAYC,eAAe,EAAE;MAC/BC,kCAAiB,CAACC,aAAa,CAC7B,qBAAqB,EACrB,0DAA0D,EAC1D,2EAA2E,CAC5E;IACH;IAEA,OAAOL,MAAM;EACf,CAAC,CAAC;AACJ,CAAC;AAAC,eAEa,IAAAM,wCAAkB,EAAC;EAChCC,WAAW,EAAE,2BAA2B;EACxCC,QAAQ,EAAET;AACZ,CAAC,CAAC;AAAA"}