@expo/prebuild-config 3.0.12 → 3.0.16
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.
- package/build/getAutolinkedPackages.js +6 -1
- package/build/getAutolinkedPackages.js.map +1 -1
- package/build/plugins/icons/withAndroidIcons.js +1 -1
- package/build/plugins/icons/withAndroidIcons.js.map +1 -1
- package/build/plugins/withDefaultPlugins.js +1 -1
- package/build/plugins/withDefaultPlugins.js.map +1 -1
- package/package.json +4 -4
|
@@ -43,8 +43,13 @@ function resolvePackagesList(platformPaths) {
|
|
|
43
43
|
function shouldSkipAutoPlugin(config, plugin) {
|
|
44
44
|
var _config$_internal;
|
|
45
45
|
|
|
46
|
-
//
|
|
46
|
+
// Hack workaround because expo-dev-client doesn't use expo modules.
|
|
47
|
+
if (plugin === 'expo-dev-client') {
|
|
48
|
+
return false;
|
|
49
|
+
} // Only perform the check if `autolinkedModules` is defined, otherwise we assume
|
|
47
50
|
// this is a legacy runner which doesn't support autolinking.
|
|
51
|
+
|
|
52
|
+
|
|
48
53
|
if (Array.isArray((_config$_internal = config._internal) === null || _config$_internal === void 0 ? void 0 : _config$_internal.autolinkedModules)) {
|
|
49
54
|
// Resolve the pluginId as a string.
|
|
50
55
|
const pluginId = Array.isArray(plugin) ? plugin[0] : plugin;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/getAutolinkedPackages.ts"],"names":["getAutolinkedPackagesAsync","projectRoot","platforms","searchPaths","platformPaths","Promise","all","map","platform","silent","resolvePackagesList","allPlatformPaths","paths","Object","keys","flat","uniquePaths","Set","sort","shouldSkipAutoPlugin","config","plugin","Array","isArray","_internal","autolinkedModules","pluginId","isIncluded","includes"],"mappings":";;;;;;;;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,eAAeA,0BAAf,CACLC,WADK,EAELC,SAAwB,GAAG,CAAC,KAAD,EAAQ,SAAR,CAFtB,EAGL;AACA,QAAMC,WAAW,GAAG,MAAM,4CAAwB,IAAxB,EAA8BF,WAA9B,CAA1B;AAEA,QAAMG,aAAa,GAAG,MAAMC,OAAO,CAACC,GAAR,CAC1BJ,SAAS,CAACK,GAAV,CAAcC,QAAQ,IACpB,qCAAiB;AACfA,IAAAA,QADe;AAEfL,IAAAA,WAFe;AAGfM,IAAAA,MAAM,EAAE;AAHO,GAAjB,CADF,CAD0B,CAA5B;AAUA,SAAOC,mBAAmB,CAACN,aAAD,CAA1B;AACD;;AAEM,SAASM,mBAAT,CAA6BN,aAA7B,EAAmE;AACxE,QAAMO,gBAAgB,GAAGP,aAAa,CAACG,GAAd,CAAkBK,KAAK,IAAIC,MAAM,CAACC,IAAP,CAAYF,KAAZ,CAA3B,EAA+CG,IAA/C,EAAzB;AAEA,QAAMC,WAAW,GAAG,CAAC,GAAG,IAAIC,GAAJ,CAAQN,gBAAR,CAAJ,CAApB;AAEA,SAAOK,WAAW,CAACE,IAAZ,EAAP;AACD;;AAEM,SAASC,oBAAT,CACLC,MADK,EAELC,MAFK,EAGL;AAAA;;AACA;AACA;AACA,MAAIC,KAAK,CAACC,OAAN,sBAAcH,MAAM,CAACI,SAArB,sDAAc,kBAAkBC,iBAAhC,CAAJ,EAAwD;AACtD;AACA,UAAMC,QAAQ,GAAGJ,KAAK,CAACC,OAAN,CAAcF,MAAd,IAAwBA,MAAM,CAAC,CAAD,CAA9B,GAAoCA,MAArD;;AACA,QAAI,OAAOK,QAAP,KAAoB,QAAxB,EAAkC;AAChC;AACA,YAAMC,UAAU,GAAGP,MAAM,CAACI,SAAP,CAAkBC,iBAAlB,CAAoCG,QAApC,CAA6CF,QAA7C,CAAnB;;AACA,UAAI,CAACC,UAAL,EAAiB;AACf;AACA,eAAO,IAAP;AACD;AACF;AACF;;AACD,SAAO,KAAP;AACD","sourcesContent":["import { ModPlatform, StaticPlugin } from '@expo/config-plugins';\nimport { ExpoConfig } from '@expo/config-types';\nimport {\n findModulesAsync,\n resolveSearchPathsAsync,\n} from 'expo-modules-autolinking/build/autolinking';\n\n/**\n * Returns a list of packages that are autolinked to a project.\n *\n * @param projectRoot\n * @param platforms platforms to check for\n * @returns list of packages ex: `['expo-camera', 'react-native-screens']`\n */\nexport async function getAutolinkedPackagesAsync(\n projectRoot: string,\n platforms: ModPlatform[] = ['ios', 'android']\n) {\n const searchPaths = await resolveSearchPathsAsync(null, projectRoot);\n\n const platformPaths = await Promise.all(\n platforms.map(platform =>\n findModulesAsync({\n platform,\n searchPaths,\n silent: true,\n })\n )\n );\n\n return resolvePackagesList(platformPaths);\n}\n\nexport function resolvePackagesList(platformPaths: Record<string, any>[]) {\n const allPlatformPaths = platformPaths.map(paths => Object.keys(paths)).flat();\n\n const uniquePaths = [...new Set(allPlatformPaths)];\n\n return uniquePaths.sort();\n}\n\nexport function shouldSkipAutoPlugin(\n config: Pick<ExpoConfig, '_internal'>,\n plugin: StaticPlugin | string\n) {\n // Only perform the check if `autolinkedModules` is defined, otherwise we assume\n // this is a legacy runner which doesn't support autolinking.\n if (Array.isArray(config._internal?.autolinkedModules)) {\n // Resolve the pluginId as a string.\n const pluginId = Array.isArray(plugin) ? plugin[0] : plugin;\n if (typeof pluginId === 'string') {\n // Determine if the autolinked modules list includes our moduleId\n const isIncluded = config._internal!.autolinkedModules.includes(pluginId);\n if (!isIncluded) {\n // If it doesn't then we know that any potential plugin shouldn't be applied automatically.\n return true;\n }\n }\n }\n return false;\n}\n"],"file":"getAutolinkedPackages.js"}
|
|
1
|
+
{"version":3,"sources":["../src/getAutolinkedPackages.ts"],"names":["getAutolinkedPackagesAsync","projectRoot","platforms","searchPaths","platformPaths","Promise","all","map","platform","silent","resolvePackagesList","allPlatformPaths","paths","Object","keys","flat","uniquePaths","Set","sort","shouldSkipAutoPlugin","config","plugin","Array","isArray","_internal","autolinkedModules","pluginId","isIncluded","includes"],"mappings":";;;;;;;;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;A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QAA7C,CAAnB;;AACA,UAAI,CAACC,UAAL,EAAiB;AACf;AACA,eAAO,IAAP;AACD;AACF;AACF;;AACD,SAAO,KAAP;AACD","sourcesContent":["import { ModPlatform, StaticPlugin } from '@expo/config-plugins';\nimport { ExpoConfig } from '@expo/config-types';\nimport {\n findModulesAsync,\n resolveSearchPathsAsync,\n} from 'expo-modules-autolinking/build/autolinking';\n\n/**\n * Returns a list of packages that are autolinked to a project.\n *\n * @param projectRoot\n * @param platforms platforms to check for\n * @returns list of packages ex: `['expo-camera', 'react-native-screens']`\n */\nexport async function getAutolinkedPackagesAsync(\n projectRoot: string,\n platforms: ModPlatform[] = ['ios', 'android']\n) {\n const searchPaths = await resolveSearchPathsAsync(null, projectRoot);\n\n const platformPaths = await Promise.all(\n platforms.map(platform =>\n findModulesAsync({\n platform,\n searchPaths,\n silent: true,\n })\n )\n );\n\n return resolvePackagesList(platformPaths);\n}\n\nexport function resolvePackagesList(platformPaths: Record<string, any>[]) {\n const allPlatformPaths = platformPaths.map(paths => Object.keys(paths)).flat();\n\n const uniquePaths = [...new Set(allPlatformPaths)];\n\n return uniquePaths.sort();\n}\n\nexport function shouldSkipAutoPlugin(\n config: Pick<ExpoConfig, '_internal'>,\n plugin: StaticPlugin | string\n) {\n // Hack workaround because expo-dev-client doesn't use expo modules.\n if (plugin === 'expo-dev-client') {\n return false;\n }\n\n // Only perform the check if `autolinkedModules` is defined, otherwise we assume\n // this is a legacy runner which doesn't support autolinking.\n if (Array.isArray(config._internal?.autolinkedModules)) {\n // Resolve the pluginId as a string.\n const pluginId = Array.isArray(plugin) ? plugin[0] : plugin;\n if (typeof pluginId === 'string') {\n // Determine if the autolinked modules list includes our moduleId\n const isIncluded = config._internal!.autolinkedModules.includes(pluginId);\n if (!isIncluded) {\n // If it doesn't then we know that any potential plugin shouldn't be applied automatically.\n return true;\n }\n }\n }\n return false;\n}\n"],"file":"getAutolinkedPackages.js"}
|
|
@@ -131,7 +131,7 @@ const withAndroidAdaptiveIconColors = (config, backgroundColor) => {
|
|
|
131
131
|
function getIcon(config) {
|
|
132
132
|
var _config$android2;
|
|
133
133
|
|
|
134
|
-
return
|
|
134
|
+
return ((_config$android2 = config.android) === null || _config$android2 === void 0 ? void 0 : _config$android2.icon) || config.icon || null;
|
|
135
135
|
}
|
|
136
136
|
|
|
137
137
|
function getAdaptiveIcon(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;AA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5B,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.icon || config.android?.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,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,gBAA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AeC,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\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"}
|
|
@@ -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.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.JsEngine.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]);
|
|
@@ -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","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;;A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AAOF,iBAAP;AACD,C,CAED;AACA;;;AACA,MAAMA,iBAAiB,GAAG,CACxB,eADwB,EAExB,SAFwB,EAGxB,uBAHwB,EAIxB,sBAJwB,EAKxB,iBALwB,EAMxB,eANwB,EAOxB,aAPwB,EAQxB,eARwB,EASxB,eATwB,EAUxB,mBAVwB,EAWxB,iBAXwB,EAYxB,mBAZwB,EAaxB,kBAbwB,EAcxB,mBAdwB,EAexB,eAfwB,EAgBxB,oBAhBwB,EAiBxB,yBAjBwB,EAkBxB,cAlBwB,EAmBxB,mBAnBwB,EAoBxB,2BApBwB,CAA1B,C,CAuBA;AACA;;AACA,MAAMC,2BAA2B,GAAG,CAClC,yBADkC,EAElC,oBAFkC,EAGlC,qBAHkC,CAApC;;AAMA,MAAME,yBAAkE,GAAG,CAACpF,MAAD,EAASqF,OAAT,KAAqB;AAC9F,SAAOA,OAAO,CAACC,MAAR,CAAe,CAACC,IAAD,EAAOC,MAAP,KAAkB;AACtC,QAAI,mDAAqBxF,MAArB,EAA6BwF,MAA7B,CAAJ,EAA0C;AACxC1F,MAAAA,KAAK,CAAC,gCAAD,EAAmC0F,MAAnC,CAAL;AACA,aAAOD,IAAP;AACD;;AAED,WAAO,uCAAiBA,IAAjB,EAAuB;AAC5B;AACAE,MAAAA,eAAe,EAAE,IAFW;AAG5BD,MAAAA,MAH4B;AAI5B;AACAE,MAAAA,QAAQ,EAAE1F,MAAM,IAAIA;AALQ,KAAvB,CAAP;AAOD,GAbM,EAaJA,MAbI,CAAP;AAcD,CAfD;;AAiBO,SAAS2F,qBAAT,CAA+B3F,MAA/B,EAAmD;AACxD,SAAOoF,yBAAyB,CAACpF,MAAD,EAAS,CACvC,GAAG,IAAI4F,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.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","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","withOptionalLegacy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S,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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expo/prebuild-config",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.16",
|
|
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.
|
|
39
|
-
"@expo/config-plugins": "4.0.
|
|
38
|
+
"@expo/config": "6.0.16",
|
|
39
|
+
"@expo/config-plugins": "4.0.16",
|
|
40
40
|
"@expo/config-types": "^43.0.1",
|
|
41
41
|
"@expo/image-utils": "0.3.18",
|
|
42
42
|
"@expo/json-file": "8.2.34",
|
|
43
43
|
"debug": "^4.3.1",
|
|
44
|
-
"expo-modules-autolinking": "~0.
|
|
44
|
+
"expo-modules-autolinking": "~0.5.1",
|
|
45
45
|
"fs-extra": "^9.0.0",
|
|
46
46
|
"resolve-from": "^5.0.0",
|
|
47
47
|
"semver": "7.3.2",
|