@expo/prebuild-config 3.1.5 → 4.0.1

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.
@@ -51,6 +51,16 @@ function _path() {
51
51
  return data;
52
52
  }
53
53
 
54
+ function _withAndroidManifestIcons() {
55
+ const data = require("./withAndroidManifestIcons");
56
+
57
+ _withAndroidManifestIcons = function () {
58
+ return data;
59
+ };
60
+
61
+ return data;
62
+ }
63
+
54
64
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
55
65
 
56
66
  const {
@@ -102,8 +112,9 @@ const withAndroidIcons = config => {
102
112
 
103
113
  if (!icon) {
104
114
  return config;
105
- } // Apply colors.xml changes
115
+ }
106
116
 
117
+ config = (0, _withAndroidManifestIcons().withAndroidManifestIcons)(config); // Apply colors.xml changes
107
118
 
108
119
  config = withAndroidAdaptiveIconColors(config, backgroundColor);
109
120
  return (0, _configPlugins().withDangerousMod)(config, ['android', async config => {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/plugins/icons/withAndroidIcons.ts"],"names":["Colors","AndroidConfig","dpiValues","mdpi","folderName","scale","hdpi","xhdpi","xxhdpi","xxxhdpi","BASELINE_PIXEL_SIZE","ANDROID_RES_PATH","MIPMAP_ANYDPI_V26","ICON_BACKGROUND","IC_LAUNCHER_PNG","IC_LAUNCHER_ROUND_PNG","IC_LAUNCHER_BACKGROUND_PNG","IC_LAUNCHER_FOREGROUND_PNG","IC_LAUNCHER_XML","IC_LAUNCHER_ROUND_XML","withAndroidIcons","config","foregroundImage","backgroundColor","backgroundImage","getAdaptiveIcon","icon","getIcon","withAndroidAdaptiveIconColors","setIconAsync","modRequest","projectRoot","isAdaptive","android","adaptiveIcon","modResults","setBackgroundColor","configureLegacyIconAsync","configureAdaptiveIconAsync","Promise","all","Object","values","map","dpiFolderPath","path","resolve","iconSizePx","squareIconImage","cacheType","src","width","height","resizeMode","source","roundIconImage","borderRadius","squareBackgroundLayer","roundBackgroundLayer","foreground","background","fs","ensureDir","writeFile","adpativeIconForeground","adpativeIconBackground","removeBackgroundImageFilesAsync","e","Error","icLauncherXmlString","createAdaptiveIconXmlString","createAdaptiveIconXmlFiles","colors","assignColorValue","value","name","add","anyDpiV26Directory","launcherPath","launcherRoundPath","existsSync","remove"],"mappings":";;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAQA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;AAEA,MAAM;AAAEA,EAAAA;AAAF,IAAaC,8BAAnB;;AAKO,MAAMC,SAAiB,GAAG;AAC/BC,EAAAA,IAAI,EAAE;AAAEC,IAAAA,UAAU,EAAE,aAAd;AAA6BC,IAAAA,KAAK,EAAE;AAApC,GADyB;AAE/BC,EAAAA,IAAI,EAAE;AAAEF,IAAAA,UAAU,EAAE,aAAd;AAA6BC,IAAAA,KAAK,EAAE;AAApC,GAFyB;AAG/BE,EAAAA,KAAK,EAAE;AAAEH,IAAAA,UAAU,EAAE,cAAd;AAA8BC,IAAAA,KAAK,EAAE;AAArC,GAHwB;AAI/BG,EAAAA,MAAM,EAAE;AAAEJ,IAAAA,UAAU,EAAE,eAAd;AAA+BC,IAAAA,KAAK,EAAE;AAAtC,GAJuB;AAK/BI,EAAAA,OAAO,EAAE;AAAEL,IAAAA,UAAU,EAAE,gBAAd;AAAgCC,IAAAA,KAAK,EAAE;AAAvC;AALsB,CAA1B;;AAOP,MAAMK,mBAAmB,GAAG,EAA5B;AACO,MAAMC,gBAAgB,GAAG,2BAAzB;;AACP,MAAMC,iBAAiB,GAAG,mBAA1B;AACA,MAAMC,eAAe,GAAG,gBAAxB;AACA,MAAMC,eAAe,GAAG,iBAAxB;AACA,MAAMC,qBAAqB,GAAG,uBAA9B;AACA,MAAMC,0BAA0B,GAAG,4BAAnC;A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CAAN;AAOD;AACF;;AAED,eAAeqB,+BAAf,CAA+CnC,WAA/C,EAAoE;AAClE,SAAO,MAAMQ,OAAO,CAACC,GAAR,CACXC,MAAM,CAACC,MAAP,CAAcxC,SAAd,EAAyByC,GAAzB,CAA6B,OAAO;AAAEvC,IAAAA;AAAF,GAAP,KAA0B;AACrD,UAAMwC,aAAa,GAAGC,gBAAKC,OAAL,CAAaf,WAAb,EAA0BpB,gBAA1B,EAA4CP,UAA5C,CAAtB;;AACA,UAAMyD,mBAAGoB,MAAH,CAAUpC,gBAAKC,OAAL,CAAaF,aAAb,EAA4B5B,0BAA5B,CAAV,CAAN;AACD,GAHD,CADW,CAAb;AAMD","sourcesContent":["import {\n AndroidConfig,\n ConfigPlugin,\n withAndroidColors,\n withDangerousMod,\n} from '@expo/config-plugins';\nimport { ResourceXML } from '@expo/config-plugins/build/android/Resources';\nimport { ExpoConfig } from '@expo/config-types';\nimport { compositeImagesAsync, generateImageAsync } from '@expo/image-utils';\nimport fs from 'fs-extra';\nimport path from 'path';\n\nconst { Colors } = AndroidConfig;\n\ntype DPIString = 'mdpi' | 'hdpi' | 'xhdpi' | 'xxhdpi' | 'xxxhdpi';\ntype dpiMap = Record<DPIString, { folderName: string; scale: number }>;\n\nexport const dpiValues: dpiMap = {\n mdpi: { folderName: 'mipmap-mdpi', scale: 1 },\n hdpi: { folderName: 'mipmap-hdpi', scale: 1.5 },\n xhdpi: { folderName: 'mipmap-xhdpi', scale: 2 },\n xxhdpi: { folderName: 'mipmap-xxhdpi', scale: 3 },\n xxxhdpi: { folderName: 'mipmap-xxxhdpi', scale: 4 },\n};\nconst BASELINE_PIXEL_SIZE = 48;\nexport const ANDROID_RES_PATH = 'android/app/src/main/res/';\nconst MIPMAP_ANYDPI_V26 = 'mipmap-anydpi-v26';\nconst ICON_BACKGROUND = 'iconBackground';\nconst IC_LAUNCHER_PNG = 'ic_launcher.png';\nconst IC_LAUNCHER_ROUND_PNG = 'ic_launcher_round.png';\nconst IC_LAUNCHER_BACKGROUND_PNG = 'ic_launcher_background.png';\nconst IC_LAUNCHER_FOREGROUND_PNG = 'ic_launcher_foreground.png';\nconst IC_LAUNCHER_XML = 'ic_launcher.xml';\nconst IC_LAUNCHER_ROUND_XML = 'ic_launcher_round.xml';\n\nexport const withAndroidIcons: ConfigPlugin = config => {\n const { foregroundImage, backgroundColor, backgroundImage } = getAdaptiveIcon(config);\n const icon = foregroundImage ?? getIcon(config);\n\n if (!icon) {\n return config;\n }\n\n // Apply colors.xml changes\n config = withAndroidAdaptiveIconColors(config, backgroundColor);\n return withDangerousMod(config, [\n 'android',\n async config => {\n await setIconAsync(config.modRequest.projectRoot, {\n icon,\n backgroundColor,\n backgroundImage,\n isAdaptive: !!config.android?.adaptiveIcon,\n });\n return config;\n },\n ]);\n};\n\nconst withAndroidAdaptiveIconColors: ConfigPlugin<string | null> = (config, backgroundColor) => {\n return withAndroidColors(config, config => {\n config.modResults = setBackgroundColor(backgroundColor ?? '#FFFFFF', config.modResults);\n return config;\n });\n};\n\nexport function getIcon(config: ExpoConfig) {\n return config.android?.icon || config.icon || null;\n}\n\nexport function getAdaptiveIcon(config: ExpoConfig) {\n return {\n foregroundImage: config.android?.adaptiveIcon?.foregroundImage ?? null,\n backgroundColor: config.android?.adaptiveIcon?.backgroundColor ?? null,\n backgroundImage: config.android?.adaptiveIcon?.backgroundImage ?? null,\n };\n}\n\n/**\n * Resizes the user-provided icon to create a set of legacy icon files in\n * their respective \"mipmap\" directories for <= Android 7, and creates a set of adaptive\n * icon files for > Android 7 from the adaptive icon files (if provided).\n */\nexport async function setIconAsync(\n projectRoot: string,\n {\n icon,\n backgroundColor,\n backgroundImage,\n isAdaptive,\n }: {\n icon: string | null;\n backgroundColor: string | null;\n backgroundImage: string | null;\n isAdaptive: boolean;\n }\n) {\n if (!icon) {\n return null;\n }\n\n await configureLegacyIconAsync(projectRoot, icon, backgroundImage, backgroundColor);\n\n await configureAdaptiveIconAsync(projectRoot, icon, backgroundImage, isAdaptive);\n\n return true;\n}\n\n/**\n * Configures legacy icon files to be used on Android 7 and earlier. If adaptive icon configuration\n * was provided, we create a pseudo-adaptive icon by layering the provided files (or background\n * color if no backgroundImage is provided. If no backgroundImage and no backgroundColor are provided,\n * the background is set to transparent.)\n */\nasync function configureLegacyIconAsync(\n projectRoot: string,\n icon: string,\n backgroundImage: string | null,\n backgroundColor: string | null\n) {\n await Promise.all(\n Object.values(dpiValues).map(async ({ folderName, scale }) => {\n const dpiFolderPath = path.resolve(projectRoot, ANDROID_RES_PATH, folderName);\n const iconSizePx = BASELINE_PIXEL_SIZE * scale;\n\n // backgroundImage overrides backgroundColor\n backgroundColor = backgroundImage ? 'transparent' : backgroundColor ?? 'transparent';\n\n let squareIconImage: Buffer = (\n await generateImageAsync(\n { projectRoot, cacheType: 'android-standard-square' },\n {\n src: icon,\n width: iconSizePx,\n height: iconSizePx,\n resizeMode: 'cover',\n backgroundColor,\n }\n )\n ).source;\n let roundIconImage: Buffer = (\n await generateImageAsync(\n { projectRoot, cacheType: 'android-standard-circle' },\n {\n src: icon,\n width: iconSizePx,\n height: iconSizePx,\n resizeMode: 'cover',\n backgroundColor,\n borderRadius: iconSizePx / 2,\n }\n )\n ).source;\n\n if (backgroundImage) {\n // Layer the buffers we just created on top of the background image that's provided\n const squareBackgroundLayer = (\n await generateImageAsync(\n { projectRoot, cacheType: 'android-standard-square-background' },\n {\n src: backgroundImage,\n width: iconSizePx,\n height: iconSizePx,\n resizeMode: 'cover',\n backgroundColor: 'transparent',\n }\n )\n ).source;\n const roundBackgroundLayer = (\n await generateImageAsync(\n { projectRoot, cacheType: 'android-standard-round-background' },\n {\n src: backgroundImage,\n width: iconSizePx,\n height: iconSizePx,\n resizeMode: 'cover',\n backgroundColor: 'transparent',\n borderRadius: iconSizePx / 2,\n }\n )\n ).source;\n squareIconImage = await compositeImagesAsync({\n foreground: squareIconImage,\n background: squareBackgroundLayer,\n });\n roundIconImage = await compositeImagesAsync({\n foreground: roundIconImage,\n background: roundBackgroundLayer,\n });\n }\n\n await fs.ensureDir(dpiFolderPath);\n await fs.writeFile(path.resolve(dpiFolderPath, IC_LAUNCHER_PNG), squareIconImage);\n await fs.writeFile(path.resolve(dpiFolderPath, IC_LAUNCHER_ROUND_PNG), roundIconImage);\n })\n );\n}\n\n/**\n * Configures adaptive icon files to be used on Android 8 and up. A foreground image must be provided,\n * and will have a transparent background unless:\n * - A backgroundImage is provided, or\n * - A backgroundColor was specified\n */\nexport async function configureAdaptiveIconAsync(\n projectRoot: string,\n foregroundImage: string,\n backgroundImage: string | null,\n isAdaptive: boolean\n) {\n await Promise.all(\n Object.values(dpiValues).map(async ({ folderName, scale }) => {\n const dpiFolderPath = path.resolve(projectRoot, ANDROID_RES_PATH, folderName);\n const iconSizePx = BASELINE_PIXEL_SIZE * scale;\n\n try {\n const adpativeIconForeground = (\n await generateImageAsync(\n { projectRoot, cacheType: 'android-adaptive-foreground' },\n {\n src: foregroundImage,\n width: iconSizePx,\n height: iconSizePx,\n resizeMode: 'cover',\n backgroundColor: 'transparent',\n }\n )\n ).source;\n await fs.writeFile(\n path.resolve(dpiFolderPath, IC_LAUNCHER_FOREGROUND_PNG),\n adpativeIconForeground\n );\n\n if (backgroundImage) {\n const adpativeIconBackground = (\n await generateImageAsync(\n { projectRoot, cacheType: 'android-adaptive-background' },\n {\n src: backgroundImage,\n width: iconSizePx,\n height: iconSizePx,\n resizeMode: 'cover',\n backgroundColor: 'transparent',\n }\n )\n ).source;\n await fs.writeFile(\n path.resolve(dpiFolderPath, IC_LAUNCHER_BACKGROUND_PNG),\n adpativeIconBackground\n );\n } else {\n // Remove any instances of ic_launcher_background.png that are there from previous icons\n await removeBackgroundImageFilesAsync(projectRoot);\n }\n } catch (e) {\n throw new Error('Encountered an issue resizing adaptive app icon: ' + e);\n }\n })\n );\n\n // create ic_launcher.xml and ic_launcher_round.xml\n const icLauncherXmlString = createAdaptiveIconXmlString(backgroundImage);\n await createAdaptiveIconXmlFiles(\n projectRoot,\n icLauncherXmlString,\n // If the user only defined icon and not android.adaptiveIcon, then skip enabling the layering system\n // this will scale the image down and present it uncropped.\n isAdaptive\n );\n}\n\nfunction setBackgroundColor(backgroundColor: string | null, colors: ResourceXML) {\n return Colors.assignColorValue(colors, {\n value: backgroundColor,\n name: ICON_BACKGROUND,\n });\n}\n\nexport const createAdaptiveIconXmlString = (backgroundImage: string | null) => {\n let background = `<background android:drawable=\"@color/iconBackground\"/>`;\n if (backgroundImage) {\n background = `<background android:drawable=\"@mipmap/ic_launcher_background\"/>`;\n }\n\n return `<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<adaptive-icon xmlns:android=\"http://schemas.android.com/apk/res/android\">\n ${background}\n <foreground android:drawable=\"@mipmap/ic_launcher_foreground\"/>\n</adaptive-icon>`;\n};\n\nasync function createAdaptiveIconXmlFiles(\n projectRoot: string,\n icLauncherXmlString: string,\n add: boolean\n) {\n const anyDpiV26Directory = path.resolve(projectRoot, ANDROID_RES_PATH, MIPMAP_ANYDPI_V26);\n await fs.ensureDir(anyDpiV26Directory);\n const launcherPath = path.resolve(anyDpiV26Directory, IC_LAUNCHER_XML);\n const launcherRoundPath = path.resolve(anyDpiV26Directory, IC_LAUNCHER_ROUND_XML);\n if (add) {\n await fs.writeFile(launcherPath, icLauncherXmlString);\n await fs.writeFile(launcherRoundPath, icLauncherXmlString);\n } else {\n // Remove the xml if the icon switches from adaptive to standard.\n await Promise.all(\n [launcherPath, launcherRoundPath].map(async path => {\n if (fs.existsSync(path)) {\n return await fs.remove(path);\n }\n })\n );\n }\n}\n\nasync function removeBackgroundImageFilesAsync(projectRoot: string) {\n return await Promise.all(\n Object.values(dpiValues).map(async ({ folderName }) => {\n const dpiFolderPath = path.resolve(projectRoot, ANDROID_RES_PATH, folderName);\n await fs.remove(path.resolve(dpiFolderPath, IC_LAUNCHER_BACKGROUND_PNG));\n })\n );\n}\n"],"file":"withAndroidIcons.js"}
1
+ {"version":3,"sources":["../../../src/plugins/icons/withAndroidIcons.ts"],"names":["Colors","AndroidConfig","dpiValues","mdpi","folderName","scale","hdpi","xhdpi","xxhdpi","xxxhdpi","BASELINE_PIXEL_SIZE","ANDROID_RES_PATH","MIPMAP_ANYDPI_V26","ICON_BACKGROUND","IC_LAUNCHER_PNG","IC_LAUNCHER_ROUND_PNG","IC_LAUNCHER_BACKGROUND_PNG","IC_LAUNCHER_FOREGROUND_PNG","IC_LAUNCHER_XML","IC_LAUNCHER_ROUND_XML","withAndroidIcons","config","foregroundImage","backgroundColor","backgroundImage","getAdaptiveIcon","icon","getIcon","withAndroidAdaptiveIconColors","setIconAsync","modRequest","projectRoot","isAdaptive","android","adaptiveIcon","modResults","setBackgroundColor","configureLegacyIconAsync","configureAdaptiveIconAsync","Promise","all","Object","values","map","dpiFolderPath","path","resolve","iconSizePx","squareIconImage","cacheType","src","width","height","resizeMode","source","roundIconImage","borderRadius","squareBackgroundLayer","roundBackgroundLayer","foreground","background","fs","ensureDir","writeFile","adpativeIconForeground","adpativeIconBackground","removeBackgroundImageFilesAsync","e","Error","icLauncherXmlString","createAdaptiveIconXmlString","createAdaptiveIconXmlFiles","colors","assignColorValue","value","name","add","anyDpiV26Directory","launcherPath","launcherRoundPath","existsSync","remove"],"mappings":";;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAQA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;AAEA,MAAM;AAAEA,EAAAA;AAAF,IAAaC,8BAAnB;;AAKO,MAAMC,SAAiB,GAAG;AAC/BC,EAAAA,IAAI,EAAE;AAAEC,IAAAA,UAAU,EAAE,aAAd;AAA6BC,IAAAA,KAAK,EAAE;AAApC,GADyB;AAE/BC,EAAAA,IAAI,EAAE;AAAEF,IAAAA,UAAU,EAAE,aAA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iBAA5C,CAA3B;;AACA,QAAMiD,mBAAGC,SAAH,CAAae,kBAAb,CAAN;;AACA,QAAMC,YAAY,GAAGjC,gBAAKC,OAAL,CAAa+B,kBAAb,EAAiC3D,eAAjC,CAArB;;AACA,QAAM6D,iBAAiB,GAAGlC,gBAAKC,OAAL,CAAa+B,kBAAb,EAAiC1D,qBAAjC,CAA1B;;AACA,MAAIyD,GAAJ,EAAS;AACP,UAAMf,mBAAGE,SAAH,CAAae,YAAb,EAA2BT,mBAA3B,CAAN;AACA,UAAMR,mBAAGE,SAAH,CAAagB,iBAAb,EAAgCV,mBAAhC,CAAN;AACD,GAHD,MAGO;AACL;AACA,UAAM9B,OAAO,CAACC,GAAR,CACJ,CAACsC,YAAD,EAAeC,iBAAf,EAAkCpC,GAAlC,CAAsC,MAAME,IAAN,IAAc;AAClD,UAAIgB,mBAAGmB,UAAH,CAAcnC,IAAd,CAAJ,EAAyB;AACvB,eAAO,MAAMgB,mBAAGoB,MAAH,CAAUpC,IAAV,CAAb;AACD;AACF,KAJD,CADI,CAAN;AAOD;AACF;;AAED,eAAeqB,+BAAf,CAA+CnC,WAA/C,EAAoE;AAClE,SAAO,MAAMQ,OAAO,CAACC,GAAR,CACXC,MAAM,CAACC,MAAP,CAAcxC,SAAd,EAAyByC,GAAzB,CAA6B,OAAO;AAAEvC,IAAAA;AAAF,GAAP,KAA0B;AACrD,UAAMwC,aAAa,GAAGC,gBAAKC,OAAL,CAAaf,WAAb,EAA0BpB,gBAA1B,EAA4CP,UAA5C,CAAtB;;AACA,UAAMyD,mBAAGoB,MAAH,CAAUpC,gBAAKC,OAAL,CAAaF,aAAb,EAA4B5B,0BAA5B,CAAV,CAAN;AACD,GAHD,CADW,CAAb;AAMD","sourcesContent":["import {\n AndroidConfig,\n ConfigPlugin,\n withAndroidColors,\n withDangerousMod,\n} from '@expo/config-plugins';\nimport { ResourceXML } from '@expo/config-plugins/build/android/Resources';\nimport { ExpoConfig } from '@expo/config-types';\nimport { compositeImagesAsync, generateImageAsync } from '@expo/image-utils';\nimport fs from 'fs-extra';\nimport path from 'path';\n\nimport { withAndroidManifestIcons } from './withAndroidManifestIcons';\n\nconst { Colors } = AndroidConfig;\n\ntype DPIString = 'mdpi' | 'hdpi' | 'xhdpi' | 'xxhdpi' | 'xxxhdpi';\ntype dpiMap = Record<DPIString, { folderName: string; scale: number }>;\n\nexport const dpiValues: dpiMap = {\n mdpi: { folderName: 'mipmap-mdpi', scale: 1 },\n hdpi: { folderName: 'mipmap-hdpi', scale: 1.5 },\n xhdpi: { folderName: 'mipmap-xhdpi', scale: 2 },\n xxhdpi: { folderName: 'mipmap-xxhdpi', scale: 3 },\n xxxhdpi: { folderName: 'mipmap-xxxhdpi', scale: 4 },\n};\nconst BASELINE_PIXEL_SIZE = 48;\nexport const ANDROID_RES_PATH = 'android/app/src/main/res/';\nconst MIPMAP_ANYDPI_V26 = 'mipmap-anydpi-v26';\nconst ICON_BACKGROUND = 'iconBackground';\nconst IC_LAUNCHER_PNG = 'ic_launcher.png';\nconst IC_LAUNCHER_ROUND_PNG = 'ic_launcher_round.png';\nconst IC_LAUNCHER_BACKGROUND_PNG = 'ic_launcher_background.png';\nconst IC_LAUNCHER_FOREGROUND_PNG = 'ic_launcher_foreground.png';\nconst IC_LAUNCHER_XML = 'ic_launcher.xml';\nconst IC_LAUNCHER_ROUND_XML = 'ic_launcher_round.xml';\n\nexport const withAndroidIcons: ConfigPlugin = config => {\n const { foregroundImage, backgroundColor, backgroundImage } = getAdaptiveIcon(config);\n const icon = foregroundImage ?? getIcon(config);\n\n if (!icon) {\n return config;\n }\n\n config = withAndroidManifestIcons(config);\n // Apply colors.xml changes\n config = withAndroidAdaptiveIconColors(config, backgroundColor);\n return withDangerousMod(config, [\n 'android',\n async config => {\n await setIconAsync(config.modRequest.projectRoot, {\n icon,\n backgroundColor,\n backgroundImage,\n isAdaptive: !!config.android?.adaptiveIcon,\n });\n return config;\n },\n ]);\n};\n\nconst withAndroidAdaptiveIconColors: ConfigPlugin<string | null> = (config, backgroundColor) => {\n return withAndroidColors(config, config => {\n config.modResults = setBackgroundColor(backgroundColor ?? '#FFFFFF', config.modResults);\n return config;\n });\n};\n\nexport function getIcon(config: ExpoConfig) {\n return config.android?.icon || config.icon || null;\n}\n\nexport function getAdaptiveIcon(config: ExpoConfig) {\n return {\n foregroundImage: config.android?.adaptiveIcon?.foregroundImage ?? null,\n backgroundColor: config.android?.adaptiveIcon?.backgroundColor ?? null,\n backgroundImage: config.android?.adaptiveIcon?.backgroundImage ?? null,\n };\n}\n\n/**\n * Resizes the user-provided icon to create a set of legacy icon files in\n * their respective \"mipmap\" directories for <= Android 7, and creates a set of adaptive\n * icon files for > Android 7 from the adaptive icon files (if provided).\n */\nexport async function setIconAsync(\n projectRoot: string,\n {\n icon,\n backgroundColor,\n backgroundImage,\n isAdaptive,\n }: {\n icon: string | null;\n backgroundColor: string | null;\n backgroundImage: string | null;\n isAdaptive: boolean;\n }\n) {\n if (!icon) {\n return null;\n }\n\n await configureLegacyIconAsync(projectRoot, icon, backgroundImage, backgroundColor);\n\n await configureAdaptiveIconAsync(projectRoot, icon, backgroundImage, isAdaptive);\n\n return true;\n}\n\n/**\n * Configures legacy icon files to be used on Android 7 and earlier. If adaptive icon configuration\n * was provided, we create a pseudo-adaptive icon by layering the provided files (or background\n * color if no backgroundImage is provided. If no backgroundImage and no backgroundColor are provided,\n * the background is set to transparent.)\n */\nasync function configureLegacyIconAsync(\n projectRoot: string,\n icon: string,\n backgroundImage: string | null,\n backgroundColor: string | null\n) {\n await Promise.all(\n Object.values(dpiValues).map(async ({ folderName, scale }) => {\n const dpiFolderPath = path.resolve(projectRoot, ANDROID_RES_PATH, folderName);\n const iconSizePx = BASELINE_PIXEL_SIZE * scale;\n\n // backgroundImage overrides backgroundColor\n backgroundColor = backgroundImage ? 'transparent' : backgroundColor ?? 'transparent';\n\n let squareIconImage: Buffer = (\n await generateImageAsync(\n { projectRoot, cacheType: 'android-standard-square' },\n {\n src: icon,\n width: iconSizePx,\n height: iconSizePx,\n resizeMode: 'cover',\n backgroundColor,\n }\n )\n ).source;\n let roundIconImage: Buffer = (\n await generateImageAsync(\n { projectRoot, cacheType: 'android-standard-circle' },\n {\n src: icon,\n width: iconSizePx,\n height: iconSizePx,\n resizeMode: 'cover',\n backgroundColor,\n borderRadius: iconSizePx / 2,\n }\n )\n ).source;\n\n if (backgroundImage) {\n // Layer the buffers we just created on top of the background image that's provided\n const squareBackgroundLayer = (\n await generateImageAsync(\n { projectRoot, cacheType: 'android-standard-square-background' },\n {\n src: backgroundImage,\n width: iconSizePx,\n height: iconSizePx,\n resizeMode: 'cover',\n backgroundColor: 'transparent',\n }\n )\n ).source;\n const roundBackgroundLayer = (\n await generateImageAsync(\n { projectRoot, cacheType: 'android-standard-round-background' },\n {\n src: backgroundImage,\n width: iconSizePx,\n height: iconSizePx,\n resizeMode: 'cover',\n backgroundColor: 'transparent',\n borderRadius: iconSizePx / 2,\n }\n )\n ).source;\n squareIconImage = await compositeImagesAsync({\n foreground: squareIconImage,\n background: squareBackgroundLayer,\n });\n roundIconImage = await compositeImagesAsync({\n foreground: roundIconImage,\n background: roundBackgroundLayer,\n });\n }\n\n await fs.ensureDir(dpiFolderPath);\n await fs.writeFile(path.resolve(dpiFolderPath, IC_LAUNCHER_PNG), squareIconImage);\n await fs.writeFile(path.resolve(dpiFolderPath, IC_LAUNCHER_ROUND_PNG), roundIconImage);\n })\n );\n}\n\n/**\n * Configures adaptive icon files to be used on Android 8 and up. A foreground image must be provided,\n * and will have a transparent background unless:\n * - A backgroundImage is provided, or\n * - A backgroundColor was specified\n */\nexport async function configureAdaptiveIconAsync(\n projectRoot: string,\n foregroundImage: string,\n backgroundImage: string | null,\n isAdaptive: boolean\n) {\n await Promise.all(\n Object.values(dpiValues).map(async ({ folderName, scale }) => {\n const dpiFolderPath = path.resolve(projectRoot, ANDROID_RES_PATH, folderName);\n const iconSizePx = BASELINE_PIXEL_SIZE * scale;\n\n try {\n const adpativeIconForeground = (\n await generateImageAsync(\n { projectRoot, cacheType: 'android-adaptive-foreground' },\n {\n src: foregroundImage,\n width: iconSizePx,\n height: iconSizePx,\n resizeMode: 'cover',\n backgroundColor: 'transparent',\n }\n )\n ).source;\n await fs.writeFile(\n path.resolve(dpiFolderPath, IC_LAUNCHER_FOREGROUND_PNG),\n adpativeIconForeground\n );\n\n if (backgroundImage) {\n const adpativeIconBackground = (\n await generateImageAsync(\n { projectRoot, cacheType: 'android-adaptive-background' },\n {\n src: backgroundImage,\n width: iconSizePx,\n height: iconSizePx,\n resizeMode: 'cover',\n backgroundColor: 'transparent',\n }\n )\n ).source;\n await fs.writeFile(\n path.resolve(dpiFolderPath, IC_LAUNCHER_BACKGROUND_PNG),\n adpativeIconBackground\n );\n } else {\n // Remove any instances of ic_launcher_background.png that are there from previous icons\n await removeBackgroundImageFilesAsync(projectRoot);\n }\n } catch (e) {\n throw new Error('Encountered an issue resizing adaptive app icon: ' + e);\n }\n })\n );\n\n // create ic_launcher.xml and ic_launcher_round.xml\n const icLauncherXmlString = createAdaptiveIconXmlString(backgroundImage);\n await createAdaptiveIconXmlFiles(\n projectRoot,\n icLauncherXmlString,\n // If the user only defined icon and not android.adaptiveIcon, then skip enabling the layering system\n // this will scale the image down and present it uncropped.\n isAdaptive\n );\n}\n\nfunction setBackgroundColor(backgroundColor: string | null, colors: ResourceXML) {\n return Colors.assignColorValue(colors, {\n value: backgroundColor,\n name: ICON_BACKGROUND,\n });\n}\n\nexport const createAdaptiveIconXmlString = (backgroundImage: string | null) => {\n let background = `<background android:drawable=\"@color/iconBackground\"/>`;\n if (backgroundImage) {\n background = `<background android:drawable=\"@mipmap/ic_launcher_background\"/>`;\n }\n\n return `<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<adaptive-icon xmlns:android=\"http://schemas.android.com/apk/res/android\">\n ${background}\n <foreground android:drawable=\"@mipmap/ic_launcher_foreground\"/>\n</adaptive-icon>`;\n};\n\nasync function createAdaptiveIconXmlFiles(\n projectRoot: string,\n icLauncherXmlString: string,\n add: boolean\n) {\n const anyDpiV26Directory = path.resolve(projectRoot, ANDROID_RES_PATH, MIPMAP_ANYDPI_V26);\n await fs.ensureDir(anyDpiV26Directory);\n const launcherPath = path.resolve(anyDpiV26Directory, IC_LAUNCHER_XML);\n const launcherRoundPath = path.resolve(anyDpiV26Directory, IC_LAUNCHER_ROUND_XML);\n if (add) {\n await fs.writeFile(launcherPath, icLauncherXmlString);\n await fs.writeFile(launcherRoundPath, icLauncherXmlString);\n } else {\n // Remove the xml if the icon switches from adaptive to standard.\n await Promise.all(\n [launcherPath, launcherRoundPath].map(async path => {\n if (fs.existsSync(path)) {\n return await fs.remove(path);\n }\n })\n );\n }\n}\n\nasync function removeBackgroundImageFilesAsync(projectRoot: string) {\n return await Promise.all(\n Object.values(dpiValues).map(async ({ folderName }) => {\n const dpiFolderPath = path.resolve(projectRoot, ANDROID_RES_PATH, folderName);\n await fs.remove(path.resolve(dpiFolderPath, IC_LAUNCHER_BACKGROUND_PNG));\n })\n );\n}\n"],"file":"withAndroidIcons.js"}
@@ -0,0 +1,4 @@
1
+ import { AndroidConfig, ConfigPlugin } from '@expo/config-plugins';
2
+ import { ExpoConfig } from '@expo/config-types';
3
+ export declare const withAndroidManifestIcons: ConfigPlugin;
4
+ export declare function setRoundIconManifest(config: Pick<ExpoConfig, 'android'>, manifest: AndroidConfig.Manifest.AndroidManifest): AndroidConfig.Manifest.AndroidManifest;
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.setRoundIconManifest = setRoundIconManifest;
7
+ exports.withAndroidManifestIcons = void 0;
8
+
9
+ function _configPlugins() {
10
+ const data = require("@expo/config-plugins");
11
+
12
+ _configPlugins = function () {
13
+ return data;
14
+ };
15
+
16
+ return data;
17
+ }
18
+
19
+ const withAndroidManifestIcons = config => (0, _configPlugins().withAndroidManifest)(config, config => {
20
+ config.modResults = setRoundIconManifest(config, config.modResults);
21
+ return config;
22
+ });
23
+
24
+ exports.withAndroidManifestIcons = withAndroidManifestIcons;
25
+
26
+ function setRoundIconManifest(config, manifest) {
27
+ var _config$android;
28
+
29
+ const isAdaptive = !!((_config$android = config.android) !== null && _config$android !== void 0 && _config$android.adaptiveIcon);
30
+
31
+ const application = _configPlugins().AndroidConfig.Manifest.getMainApplicationOrThrow(manifest);
32
+
33
+ if (isAdaptive) {
34
+ application.$['android:roundIcon'] = '@mipmap/ic_launcher_round';
35
+ } else {
36
+ delete application.$['android:roundIcon'];
37
+ }
38
+
39
+ return manifest;
40
+ }
41
+ //# sourceMappingURL=withAndroidManifestIcons.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/plugins/icons/withAndroidManifestIcons.ts"],"names":["withAndroidManifestIcons","config","modResults","setRoundIconManifest","manifest","isAdaptive","android","adaptiveIcon","application","AndroidConfig","Manifest","getMainApplicationOrThrow","$"],"mappings":";;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAGO,MAAMA,wBAAsC,GAAGC,MAAM,IAC1D,0CAAoBA,MAApB,EAA4BA,MAAM,IAAI;AACpCA,EAAAA,MAAM,CAACC,UAAP,GAAoBC,oBAAoB,CAACF,MAAD,EAASA,MAAM,CAACC,UAAhB,CAAxC;AACA,SAAOD,MAAP;AACD,CAHD,CADK;;;;AAMA,SAASE,oBAAT,CACLF,MADK,EAELG,QAFK,EAGmC;AAAA;;AACxC,QAAMC,UAAU,GAAG,CAAC,qBAACJ,MAAM,CAACK,OAAR,4CAAC,gBAAgBC,YAAjB,CAApB;;AACA,QAAMC,WAAW,GAAGC,+BAAcC,QAAd,CAAuBC,yBAAvB,CAAiDP,QAAjD,CAApB;;AAEA,MAAIC,UAAJ,EAAgB;AACdG,IAAAA,WAAW,CAACI,CAAZ,CAAc,mBAAd,IAAqC,2BAArC;AACD,GAFD,MAEO;AACL,WAAOJ,WAAW,CAACI,CAAZ,CAAc,mBAAd,CAAP;AACD;;AACD,SAAOR,QAAP;AACD","sourcesContent":["import { AndroidConfig, ConfigPlugin, withAndroidManifest } from '@expo/config-plugins';\nimport { ExpoConfig } from '@expo/config-types';\n\nexport const withAndroidManifestIcons: ConfigPlugin = config =>\n withAndroidManifest(config, config => {\n config.modResults = setRoundIconManifest(config, config.modResults);\n return config;\n });\n\nexport function setRoundIconManifest(\n config: Pick<ExpoConfig, 'android'>,\n manifest: AndroidConfig.Manifest.AndroidManifest\n): AndroidConfig.Manifest.AndroidManifest {\n const isAdaptive = !!config.android?.adaptiveIcon;\n const application = AndroidConfig.Manifest.getMainApplicationOrThrow(manifest);\n\n if (isAdaptive) {\n application.$['android:roundIcon'] = '@mipmap/ic_launcher_round';\n } else {\n delete application.$['android:roundIcon'];\n }\n return manifest;\n}\n"],"file":"withAndroidManifestIcons.js"}
@@ -198,7 +198,7 @@ const withIosExpoPlugins = (config, {
198
198
  config.ios.bundleIdentifier = bundleIdentifier;
199
199
  return (0, _configPlugins().withPlugins)(config, [[_configPlugins().IOSConfig.BundleIdentifier.withBundleIdentifier, {
200
200
  bundleIdentifier
201
- }], _configPlugins().IOSConfig.Swift.withSwiftBridgingHeader, _configPlugins().IOSConfig.Swift.withNoopSwiftFile, _configPlugins().IOSConfig.Google.withGoogle, _configPlugins().IOSConfig.Name.withDisplayName, _configPlugins().IOSConfig.Name.withProductName, _configPlugins().IOSConfig.Orientation.withOrientation, _configPlugins().IOSConfig.RequiresFullScreen.withRequiresFullScreen, _configPlugins().IOSConfig.Scheme.withScheme, _configPlugins().IOSConfig.UsesNonExemptEncryption.withUsesNonExemptEncryption, _configPlugins().IOSConfig.Version.withBuildNumber, _configPlugins().IOSConfig.Version.withVersion, _configPlugins().IOSConfig.Google.withGoogleServicesFile, _configPlugins().IOSConfig.JsEngine.withJsEnginePodfileProps, // Entitlements
201
+ }], _configPlugins().IOSConfig.Swift.withSwiftBridgingHeader, _configPlugins().IOSConfig.Swift.withNoopSwiftFile, _configPlugins().IOSConfig.Google.withGoogle, _configPlugins().IOSConfig.Name.withDisplayName, _configPlugins().IOSConfig.Name.withProductName, _configPlugins().IOSConfig.Orientation.withOrientation, _configPlugins().IOSConfig.RequiresFullScreen.withRequiresFullScreen, _configPlugins().IOSConfig.Scheme.withScheme, _configPlugins().IOSConfig.UsesNonExemptEncryption.withUsesNonExemptEncryption, _configPlugins().IOSConfig.Version.withBuildNumber, _configPlugins().IOSConfig.Version.withVersion, _configPlugins().IOSConfig.Google.withGoogleServicesFile, _configPlugins().IOSConfig.BuildProperties.withJsEnginePodfileProps, // Entitlements
202
202
  _configPlugins().IOSConfig.Entitlements.withAssociatedDomains, // XcodeProject
203
203
  _configPlugins().IOSConfig.DeviceFamily.withDeviceFamily, _configPlugins().IOSConfig.Bitcode.withBitcode, _configPlugins().IOSConfig.Locales.withLocales, // Dangerous
204
204
  _withIosIcons().withIosIcons]);
@@ -216,13 +216,13 @@ const withAndroidExpoPlugins = (config, props) => {
216
216
  if (!config.android) config.android = {};
217
217
  config.android.package = props.package;
218
218
  return (0, _configPlugins().withPlugins)(config, [// gradle.properties
219
- _configPlugins().AndroidConfig.JsEngine.withJsEngineGradleProps, // settings.gradle
219
+ _configPlugins().AndroidConfig.BuildProperties.withJsEngineGradleProps, // settings.gradle
220
220
  _configPlugins().AndroidConfig.Name.withNameSettingsGradle, // project build.gradle
221
221
  _configPlugins().AndroidConfig.GoogleServices.withClassPath, // app/build.gradle
222
222
  _configPlugins().AndroidConfig.GoogleServices.withApplyPlugin, _configPlugins().AndroidConfig.Package.withPackageGradle, _configPlugins().AndroidConfig.Version.withVersion, // AndroidManifest.xml
223
223
  _configPlugins().AndroidConfig.Package.withPackageManifest, _configPlugins().AndroidConfig.AllowBackup.withAllowBackup, _configPlugins().AndroidConfig.WindowSoftInputMode.withWindowSoftInputMode, // Note: The withAndroidIntentFilters plugin must appear before the withScheme
224
224
  // plugin or withScheme will override the output of withAndroidIntentFilters.
225
- _configPlugins().AndroidConfig.IntentFilters.withAndroidIntentFilters, _configPlugins().AndroidConfig.Scheme.withScheme, _configPlugins().AndroidConfig.Orientation.withOrientation, _configPlugins().AndroidConfig.Permissions.withPermissions, // strings.xml
225
+ _configPlugins().AndroidConfig.IntentFilters.withAndroidIntentFilters, _configPlugins().AndroidConfig.Scheme.withScheme, _configPlugins().AndroidConfig.Orientation.withOrientation, _configPlugins().AndroidConfig.Permissions.withInternalBlockedPermissions, _configPlugins().AndroidConfig.Permissions.withPermissions, // strings.xml
226
226
  _configPlugins().AndroidConfig.Name.withName, // Dangerous -- these plugins run in reverse order.
227
227
  _configPlugins().AndroidConfig.GoogleServices.withGoogleServicesFile, // Modify colors.xml and styles.xml
228
228
  _configPlugins().AndroidConfig.StatusBar.withStatusBar, _configPlugins().AndroidConfig.PrimaryColor.withPrimaryColor, _withAndroidIcons().withAndroidIcons, // If we renamed the package, we should also move it around and rename it in source files
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/plugins/withDefaultPlugins.ts"],"names":["debug","withIosExpoPlugins","config","bundleIdentifier","ios","IOSConfig","BundleIdentifier","withBundleIdentifier","Swift","withSwiftBridgingHeader","withNoopSwiftFile","Google","withGoogle","Name","withDisplayName","withProductName","Orientation","withOrientation","RequiresFullScreen","withRequiresFullScreen","Scheme","withScheme","UsesNonExemptEncryption","withUsesNonExemptEncryption","Version","withBuildNumber","withVersion","withGoogleServicesFile","JsEngine","withJsEnginePodfileProps","Entitlements","withAssociatedDomains","DeviceFamily","withDeviceFamily","Bitcode","withBitcode","Locales","withLocales","withIosIcons","withAndroidExpoPlugins","props","android","package","AndroidConfig","withJsEngineGradleProps","withNameSettingsGradle","GoogleServices","withClassPath","withApplyPlugin","Package","withPackageGradle","withPackageManifest","AllowBackup","withAllowBackup","WindowSoftInputMode","withWindowSoftInputMode","IntentFilters","withAndroidIntentFilters","Permissions","withPermissions","withName","StatusBar","withStatusBar","PrimaryColor","withPrimaryColor","withAndroidIcons","withPackageRefactor","versionedExpoSDKPackages","withVersionedExpoSDKPlugins","expoUsername","withMaps","withAdMob","withAppleAuthentication","withContacts","withNotifications","withUpdates","withBranch","withDocumentPicker","withFacebook","withSystemUI","withSplashScreen","withNavigationBar","getAutoPlugins","concat","legacyExpoPlugins","expoManagedVersionedPlugins","getLegacyExpoPlugins","withOptionalLegacyPlugins","plugins","reduce","prev","plugin","_isLegacyPlugin","fallback","withLegacyExpoPlugins","Set"],"mappings":";;;;;;;;;;;AAGA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AASA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;AA5BA;AACA;AACA;AA4BA,MAAMA,KAAK,GAAG,sBAAM,sBAAN,CAAd;AAEA;AACA;AACA;AACA;;AACO,MAAMC,kBAEX,GAAG,CAACC,MAAD,EAAS;AAAEC,EAAAA;AAAF,CAAT,KAAkC;AACrC;AACA,MAAI,CAACD,MAAM,CAACE,GAAZ,EAAiBF,MAAM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AAE3F,MAAM,IAAIA;AALQ,KAAvB,CAAP;AAOD,GAbM,EAaJA,MAbI,CAAP;AAcD,CAfD;;AAiBO,SAAS4F,qBAAT,CAA+B5F,MAA/B,EAAmD;AACxD,SAAOqF,yBAAyB,CAACrF,MAAD,EAAS,CACvC,GAAG,IAAI6F,GAAJ,CAAQV,2BAA2B,CAACF,MAA5B,CAAmCC,iBAAnC,CAAR,CADoC,CAAT,CAAhC;AAGD","sourcesContent":["/**\n * These are the versioned first-party plugins with some of the future third-party plugins mixed in for legacy support.\n */\nimport {\n AndroidConfig,\n ConfigPlugin,\n IOSConfig,\n StaticPlugin,\n withPlugins,\n withStaticPlugin,\n} from '@expo/config-plugins';\nimport { ExpoConfig } from '@expo/config-types';\nimport Debug from 'debug';\n\nimport { shouldSkipAutoPlugin } from '../getAutolinkedPackages';\nimport { withAndroidIcons } from './icons/withAndroidIcons';\nimport { withIosIcons } from './icons/withIosIcons';\nimport withAdMob from './unversioned/expo-ads-admob/expo-ads-admob';\nimport withAppleAuthentication from './unversioned/expo-apple-authentication';\nimport withBranch from './unversioned/expo-branch/expo-branch';\nimport withContacts from './unversioned/expo-contacts';\nimport withDocumentPicker from './unversioned/expo-document-picker';\nimport withFacebook from './unversioned/expo-facebook/expo-facebook';\nimport withNavigationBar from './unversioned/expo-navigation-bar/expo-navigation-bar';\nimport withNotifications from './unversioned/expo-notifications/expo-notifications';\nimport withSplashScreen from './unversioned/expo-splash-screen/expo-splash-screen';\nimport withSystemUI from './unversioned/expo-system-ui/expo-system-ui';\nimport withUpdates from './unversioned/expo-updates';\nimport withMaps from './unversioned/react-native-maps';\n\nconst debug = Debug('expo:prebuild-config');\n\n/**\n * Config plugin to apply all of the custom Expo iOS config plugins we support by default.\n * TODO: In the future most of this should go into versioned packages like expo-facebook, expo-updates, etc...\n */\nexport const withIosExpoPlugins: ConfigPlugin<{\n bundleIdentifier: string;\n}> = (config, { bundleIdentifier }) => {\n // Set the bundle ID ahead of time.\n if (!config.ios) config.ios = {};\n config.ios.bundleIdentifier = bundleIdentifier;\n\n return withPlugins(config, [\n [IOSConfig.BundleIdentifier.withBundleIdentifier, { bundleIdentifier }],\n IOSConfig.Swift.withSwiftBridgingHeader,\n IOSConfig.Swift.withNoopSwiftFile,\n IOSConfig.Google.withGoogle,\n IOSConfig.Name.withDisplayName,\n IOSConfig.Name.withProductName,\n IOSConfig.Orientation.withOrientation,\n IOSConfig.RequiresFullScreen.withRequiresFullScreen,\n IOSConfig.Scheme.withScheme,\n IOSConfig.UsesNonExemptEncryption.withUsesNonExemptEncryption,\n IOSConfig.Version.withBuildNumber,\n IOSConfig.Version.withVersion,\n IOSConfig.Google.withGoogleServicesFile,\n IOSConfig.JsEngine.withJsEnginePodfileProps,\n // Entitlements\n IOSConfig.Entitlements.withAssociatedDomains,\n // XcodeProject\n IOSConfig.DeviceFamily.withDeviceFamily,\n IOSConfig.Bitcode.withBitcode,\n IOSConfig.Locales.withLocales,\n // Dangerous\n withIosIcons,\n ]);\n};\n\n/**\n * Config plugin to apply all of the custom Expo Android config plugins we support by default.\n * TODO: In the future most of this should go into versioned packages like expo-facebook, expo-updates, etc...\n */\nexport const withAndroidExpoPlugins: ConfigPlugin<{\n package: string;\n}> = (config, props) => {\n // Set the package name ahead of time.\n if (!config.android) config.android = {};\n config.android.package = props.package;\n\n return withPlugins(config, [\n // gradle.properties\n AndroidConfig.JsEngine.withJsEngineGradleProps,\n\n // settings.gradle\n AndroidConfig.Name.withNameSettingsGradle,\n\n // project build.gradle\n AndroidConfig.GoogleServices.withClassPath,\n\n // app/build.gradle\n AndroidConfig.GoogleServices.withApplyPlugin,\n AndroidConfig.Package.withPackageGradle,\n AndroidConfig.Version.withVersion,\n\n // AndroidManifest.xml\n AndroidConfig.Package.withPackageManifest,\n AndroidConfig.AllowBackup.withAllowBackup,\n AndroidConfig.WindowSoftInputMode.withWindowSoftInputMode,\n // Note: The withAndroidIntentFilters plugin must appear before the withScheme\n // plugin or withScheme will override the output of withAndroidIntentFilters.\n AndroidConfig.IntentFilters.withAndroidIntentFilters,\n AndroidConfig.Scheme.withScheme,\n AndroidConfig.Orientation.withOrientation,\n AndroidConfig.Permissions.withPermissions,\n\n // strings.xml\n AndroidConfig.Name.withName,\n\n // Dangerous -- these plugins run in reverse order.\n AndroidConfig.GoogleServices.withGoogleServicesFile,\n\n // Modify colors.xml and styles.xml\n AndroidConfig.StatusBar.withStatusBar,\n AndroidConfig.PrimaryColor.withPrimaryColor,\n\n withAndroidIcons,\n // If we renamed the package, we should also move it around and rename it in source files\n // Added last to ensure this plugin runs first. Out of tree solutions will mistakenly resolve the package incorrectly otherwise.\n AndroidConfig.Package.withPackageRefactor,\n ]);\n};\n\n// Must keep in sync with `withVersionedExpoSDKPlugins`\nconst versionedExpoSDKPackages: string[] = [\n 'react-native-maps',\n 'expo-ads-admob',\n 'expo-apple-authentication',\n 'expo-contacts',\n 'expo-notifications',\n 'expo-updates',\n 'expo-branch',\n 'expo-navigation-bar',\n 'expo-document-picker',\n 'expo-facebook',\n 'expo-splash-screen',\n 'expo-system-ui',\n];\n\nexport const withVersionedExpoSDKPlugins: ConfigPlugin<{ expoUsername: string | null }> = (\n config,\n { expoUsername }\n) => {\n return withPlugins(config, [\n withMaps,\n withAdMob,\n withAppleAuthentication,\n withContacts,\n withNotifications,\n [withUpdates, { expoUsername }],\n withBranch,\n withDocumentPicker,\n withFacebook,\n // System UI must come before splash screen as they overlap\n // and splash screen will warn about conflicting rules.\n withSystemUI,\n withSplashScreen,\n withNavigationBar,\n ]);\n};\n\nexport function getAutoPlugins() {\n return versionedExpoSDKPackages.concat(legacyExpoPlugins).concat(expoManagedVersionedPlugins);\n}\n\nexport function getLegacyExpoPlugins() {\n return legacyExpoPlugins;\n}\n\n// Expo managed packages that require extra update.\n// These get applied automatically to create parity with expo build in eas build.\nconst legacyExpoPlugins = [\n 'expo-app-auth',\n 'expo-av',\n 'expo-background-fetch',\n 'expo-barcode-scanner',\n 'expo-brightness',\n 'expo-calendar',\n 'expo-camera',\n 'expo-cellular',\n 'expo-dev-menu',\n 'expo-dev-launcher',\n 'expo-dev-client',\n 'expo-image-picker',\n 'expo-file-system',\n 'expo-ads-facebook',\n 'expo-location',\n 'expo-media-library',\n 'expo-screen-orientation',\n 'expo-sensors',\n 'expo-task-manager',\n 'expo-local-authentication',\n];\n\n// Plugins that need to be automatically applied, but also get applied by expo-cli if the versioned plugin isn't available.\n// These are split up because the user doesn't need to be prompted to setup these packages.\nconst expoManagedVersionedPlugins = [\n 'expo-firebase-analytics',\n 'expo-firebase-core',\n 'expo-google-sign-in',\n];\n\nconst withOptionalLegacyPlugins: ConfigPlugin<(StaticPlugin | string)[]> = (config, plugins) => {\n return plugins.reduce((prev, plugin) => {\n if (shouldSkipAutoPlugin(config, plugin)) {\n debug('Skipping unlinked auto plugin:', plugin);\n return prev;\n }\n\n return withStaticPlugin(prev, {\n // hide errors\n _isLegacyPlugin: true,\n plugin,\n // If a plugin doesn't exist, do nothing.\n fallback: config => config,\n });\n }, config);\n};\n\nexport function withLegacyExpoPlugins(config: ExpoConfig) {\n return withOptionalLegacyPlugins(config, [\n ...new Set(expoManagedVersionedPlugins.concat(legacyExpoPlugins)),\n ]);\n}\n"],"file":"withDefaultPlugins.js"}
1
+ {"version":3,"sources":["../../src/plugins/withDefaultPlugins.ts"],"names":["debug","withIosExpoPlugins","config","bundleIdentifier","ios","IOSConfig","BundleIdentifier","withBundleIdentifier","Swift","withSwiftBridgingHeader","withNoopSwiftFile","Google","withGoogle","Name","withDisplayName","withProductName","Orientation","withOrientation","RequiresFullScreen","withRequiresFullScreen","Scheme","withScheme","UsesNonExemptEncryption","withUsesNonExemptEncryption","Version","withBuildNumber","withVersion","withGoogleServicesFile","BuildProperties","withJsEnginePodfileProps","Entitlements","withAssociatedDomains","DeviceFamily","withDeviceFamily","Bitcode","withBitcode","Locales","withLocales","withIosIcons","withAndroidExpoPlugins","props","android","package","AndroidConfig","withJsEngineGradleProps","withNameSettingsGradle","GoogleServices","withClassPath","withApplyPlugin","Package","withPackageGradle","withPackageManifest","AllowBackup","withAllowBackup","WindowSoftInputMode","withWindowSoftInputMode","IntentFilters","withAndroidIntentFilters","Permissions","withInternalBlockedPermissions","withPermissions","withName","StatusBar","withStatusBar","PrimaryColor","withPrimaryColor","withAndroidIcons","withPackageRefactor","versionedExpoSDKPackages","withVersionedExpoSDKPlugins","expoUsername","withMaps","withAdMob","withAppleAuthentication","withContacts","withNotifications","withUpdates","withBranch","withDocumentPicker","withFacebook","withSystemUI","withSplashScreen","withNavigationBar","getAutoPlugins","concat","legacyExpoPlugins","expoManagedVersionedPlugins","getLegacyExpoPlugins","withOptionalLegacyPlugins","plugins","reduce","prev","plugin","_isLegacyPlugin","fallback","withLegacyExpoPlugins","Set"],"mappings":";;;;;;;;;;;AAGA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AASA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AA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AAkB;AACtC,QAAI,mDAAqB1F,MAArB,EAA6B0F,MAA7B,CAAJ,EAA0C;AACxC5F,MAAAA,KAAK,CAAC,gCAAD,EAAmC4F,MAAnC,CAAL;AACA,aAAOD,IAAP;AACD;;AAED,WAAO,uCAAiBA,IAAjB,EAAuB;AAC5B;AACAE,MAAAA,eAAe,EAAE,IAFW;AAG5BD,MAAAA,MAH4B;AAI5B;AACAE,MAAAA,QAAQ,EAAE5F,MAAM,IAAIA;AALQ,KAAvB,CAAP;AAOD,GAbM,EAaJA,MAbI,CAAP;AAcD,CAfD;;AAiBO,SAAS6F,qBAAT,CAA+B7F,MAA/B,EAAmD;AACxD,SAAOsF,yBAAyB,CAACtF,MAAD,EAAS,CACvC,GAAG,IAAI8F,GAAJ,CAAQV,2BAA2B,CAACF,MAA5B,CAAmCC,iBAAnC,CAAR,CADoC,CAAT,CAAhC;AAGD","sourcesContent":["/**\n * These are the versioned first-party plugins with some of the future third-party plugins mixed in for legacy support.\n */\nimport {\n AndroidConfig,\n ConfigPlugin,\n IOSConfig,\n StaticPlugin,\n withPlugins,\n withStaticPlugin,\n} from '@expo/config-plugins';\nimport { ExpoConfig } from '@expo/config-types';\nimport Debug from 'debug';\n\nimport { shouldSkipAutoPlugin } from '../getAutolinkedPackages';\nimport { withAndroidIcons } from './icons/withAndroidIcons';\nimport { withIosIcons } from './icons/withIosIcons';\nimport withAdMob from './unversioned/expo-ads-admob/expo-ads-admob';\nimport withAppleAuthentication from './unversioned/expo-apple-authentication';\nimport withBranch from './unversioned/expo-branch/expo-branch';\nimport withContacts from './unversioned/expo-contacts';\nimport withDocumentPicker from './unversioned/expo-document-picker';\nimport withFacebook from './unversioned/expo-facebook/expo-facebook';\nimport withNavigationBar from './unversioned/expo-navigation-bar/expo-navigation-bar';\nimport withNotifications from './unversioned/expo-notifications/expo-notifications';\nimport withSplashScreen from './unversioned/expo-splash-screen/expo-splash-screen';\nimport withSystemUI from './unversioned/expo-system-ui/expo-system-ui';\nimport withUpdates from './unversioned/expo-updates';\nimport withMaps from './unversioned/react-native-maps';\n\nconst debug = Debug('expo:prebuild-config');\n\n/**\n * Config plugin to apply all of the custom Expo iOS config plugins we support by default.\n * TODO: In the future most of this should go into versioned packages like expo-facebook, expo-updates, etc...\n */\nexport const withIosExpoPlugins: ConfigPlugin<{\n bundleIdentifier: string;\n}> = (config, { bundleIdentifier }) => {\n // Set the bundle ID ahead of time.\n if (!config.ios) config.ios = {};\n config.ios.bundleIdentifier = bundleIdentifier;\n\n return withPlugins(config, [\n [IOSConfig.BundleIdentifier.withBundleIdentifier, { bundleIdentifier }],\n IOSConfig.Swift.withSwiftBridgingHeader,\n IOSConfig.Swift.withNoopSwiftFile,\n IOSConfig.Google.withGoogle,\n IOSConfig.Name.withDisplayName,\n IOSConfig.Name.withProductName,\n IOSConfig.Orientation.withOrientation,\n IOSConfig.RequiresFullScreen.withRequiresFullScreen,\n IOSConfig.Scheme.withScheme,\n IOSConfig.UsesNonExemptEncryption.withUsesNonExemptEncryption,\n IOSConfig.Version.withBuildNumber,\n IOSConfig.Version.withVersion,\n IOSConfig.Google.withGoogleServicesFile,\n IOSConfig.BuildProperties.withJsEnginePodfileProps,\n // Entitlements\n IOSConfig.Entitlements.withAssociatedDomains,\n // XcodeProject\n IOSConfig.DeviceFamily.withDeviceFamily,\n IOSConfig.Bitcode.withBitcode,\n IOSConfig.Locales.withLocales,\n // Dangerous\n withIosIcons,\n ]);\n};\n\n/**\n * Config plugin to apply all of the custom Expo Android config plugins we support by default.\n * TODO: In the future most of this should go into versioned packages like expo-facebook, expo-updates, etc...\n */\nexport const withAndroidExpoPlugins: ConfigPlugin<{\n package: string;\n}> = (config, props) => {\n // Set the package name ahead of time.\n if (!config.android) config.android = {};\n config.android.package = props.package;\n\n return withPlugins(config, [\n // gradle.properties\n AndroidConfig.BuildProperties.withJsEngineGradleProps,\n\n // settings.gradle\n AndroidConfig.Name.withNameSettingsGradle,\n\n // project build.gradle\n AndroidConfig.GoogleServices.withClassPath,\n\n // app/build.gradle\n AndroidConfig.GoogleServices.withApplyPlugin,\n AndroidConfig.Package.withPackageGradle,\n AndroidConfig.Version.withVersion,\n\n // AndroidManifest.xml\n AndroidConfig.Package.withPackageManifest,\n AndroidConfig.AllowBackup.withAllowBackup,\n AndroidConfig.WindowSoftInputMode.withWindowSoftInputMode,\n // Note: The withAndroidIntentFilters plugin must appear before the withScheme\n // plugin or withScheme will override the output of withAndroidIntentFilters.\n AndroidConfig.IntentFilters.withAndroidIntentFilters,\n AndroidConfig.Scheme.withScheme,\n AndroidConfig.Orientation.withOrientation,\n AndroidConfig.Permissions.withInternalBlockedPermissions,\n AndroidConfig.Permissions.withPermissions,\n\n // strings.xml\n AndroidConfig.Name.withName,\n\n // Dangerous -- these plugins run in reverse order.\n AndroidConfig.GoogleServices.withGoogleServicesFile,\n\n // Modify colors.xml and styles.xml\n AndroidConfig.StatusBar.withStatusBar,\n AndroidConfig.PrimaryColor.withPrimaryColor,\n\n withAndroidIcons,\n // If we renamed the package, we should also move it around and rename it in source files\n // Added last to ensure this plugin runs first. Out of tree solutions will mistakenly resolve the package incorrectly otherwise.\n AndroidConfig.Package.withPackageRefactor,\n ]);\n};\n\n// Must keep in sync with `withVersionedExpoSDKPlugins`\nconst versionedExpoSDKPackages: string[] = [\n 'react-native-maps',\n 'expo-ads-admob',\n 'expo-apple-authentication',\n 'expo-contacts',\n 'expo-notifications',\n 'expo-updates',\n 'expo-branch',\n 'expo-navigation-bar',\n 'expo-document-picker',\n 'expo-facebook',\n 'expo-splash-screen',\n 'expo-system-ui',\n];\n\nexport const withVersionedExpoSDKPlugins: ConfigPlugin<{ expoUsername: string | null }> = (\n config,\n { expoUsername }\n) => {\n return withPlugins(config, [\n withMaps,\n withAdMob,\n withAppleAuthentication,\n withContacts,\n withNotifications,\n [withUpdates, { expoUsername }],\n withBranch,\n withDocumentPicker,\n withFacebook,\n // System UI must come before splash screen as they overlap\n // and splash screen will warn about conflicting rules.\n withSystemUI,\n withSplashScreen,\n withNavigationBar,\n ]);\n};\n\nexport function getAutoPlugins() {\n return versionedExpoSDKPackages.concat(legacyExpoPlugins).concat(expoManagedVersionedPlugins);\n}\n\nexport function getLegacyExpoPlugins() {\n return legacyExpoPlugins;\n}\n\n// Expo managed packages that require extra update.\n// These get applied automatically to create parity with expo build in eas build.\nconst legacyExpoPlugins = [\n 'expo-app-auth',\n 'expo-av',\n 'expo-background-fetch',\n 'expo-barcode-scanner',\n 'expo-brightness',\n 'expo-calendar',\n 'expo-camera',\n 'expo-cellular',\n 'expo-dev-menu',\n 'expo-dev-launcher',\n 'expo-dev-client',\n 'expo-image-picker',\n 'expo-file-system',\n 'expo-ads-facebook',\n 'expo-location',\n 'expo-media-library',\n 'expo-screen-orientation',\n 'expo-sensors',\n 'expo-task-manager',\n 'expo-local-authentication',\n];\n\n// Plugins that need to be automatically applied, but also get applied by expo-cli if the versioned plugin isn't available.\n// These are split up because the user doesn't need to be prompted to setup these packages.\nconst expoManagedVersionedPlugins = [\n 'expo-firebase-analytics',\n 'expo-firebase-core',\n 'expo-google-sign-in',\n];\n\nconst withOptionalLegacyPlugins: ConfigPlugin<(StaticPlugin | string)[]> = (config, plugins) => {\n return plugins.reduce((prev, plugin) => {\n if (shouldSkipAutoPlugin(config, plugin)) {\n debug('Skipping unlinked auto plugin:', plugin);\n return prev;\n }\n\n return withStaticPlugin(prev, {\n // hide errors\n _isLegacyPlugin: true,\n plugin,\n // If a plugin doesn't exist, do nothing.\n fallback: config => config,\n });\n }, config);\n};\n\nexport function withLegacyExpoPlugins(config: ExpoConfig) {\n return withOptionalLegacyPlugins(config, [\n ...new Set(expoManagedVersionedPlugins.concat(legacyExpoPlugins)),\n ]);\n}\n"],"file":"withDefaultPlugins.js"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@expo/prebuild-config",
3
- "version": "3.1.5",
3
+ "version": "4.0.1",
4
4
  "description": "Get the prebuild config",
5
5
  "main": "build/index.js",
6
6
  "scripts": {
@@ -35,13 +35,13 @@
35
35
  "@types/xml2js": "^0.4.5"
36
36
  },
37
37
  "dependencies": {
38
- "@expo/config": "6.0.20",
39
- "@expo/config-plugins": "~4.0.18",
40
- "@expo/config-types": "^44.0.0",
41
- "@expo/image-utils": "0.3.19",
42
- "@expo/json-file": "8.2.35",
38
+ "@expo/config": "6.0.24",
39
+ "@expo/config-plugins": "4.1.5",
40
+ "@expo/config-types": "^45.0.0",
41
+ "@expo/image-utils": "0.3.20",
42
+ "@expo/json-file": "8.2.36",
43
43
  "debug": "^4.3.1",
44
- "expo-modules-autolinking": "~0.5.1",
44
+ "expo-modules-autolinking": "~0.7.0",
45
45
  "fs-extra": "^9.0.0",
46
46
  "resolve-from": "^5.0.0",
47
47
  "semver": "7.3.2",