@expo/prebuild-config 55.0.19 → 55.0.21
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 +1 -3
- package/build/getAutolinkedPackages.js.map +1 -1
- package/build/getPrebuildConfig.js +1 -3
- package/build/getPrebuildConfig.js.map +1 -1
- package/build/index.js +4 -15
- package/build/index.js.map +1 -1
- package/build/plugins/icons/AssetContents.js +1 -3
- package/build/plugins/icons/AssetContents.js.map +1 -1
- package/build/plugins/icons/withAndroidIcons.js +1 -3
- package/build/plugins/icons/withAndroidIcons.js.map +1 -1
- package/build/plugins/icons/withAndroidManifestIcons.js +1 -3
- package/build/plugins/icons/withAndroidManifestIcons.js.map +1 -1
- package/build/plugins/icons/withIosIcons.js +1 -3
- package/build/plugins/icons/withIosIcons.js.map +1 -1
- package/build/plugins/sdk52/ReactNative77CompatPlugin.js +1 -3
- package/build/plugins/sdk52/ReactNative77CompatPlugin.js.map +1 -1
- package/build/plugins/sdk52/ReactNative78CompatPlugin.js +1 -3
- package/build/plugins/sdk52/ReactNative78CompatPlugin.js.map +1 -1
- package/build/plugins/unversioned/createLegacyPlugin.js +1 -3
- package/build/plugins/unversioned/createLegacyPlugin.js.map +1 -1
- package/build/plugins/unversioned/edge-to-edge/withEdgeToEdge.js +1 -3
- package/build/plugins/unversioned/edge-to-edge/withEdgeToEdge.js.map +1 -1
- package/build/plugins/unversioned/edge-to-edge/withRestoreDefaultTheme.js +1 -3
- package/build/plugins/unversioned/edge-to-edge/withRestoreDefaultTheme.js.map +1 -1
- package/build/plugins/unversioned/expo-ads-admob/expo-ads-admob.js +1 -3
- package/build/plugins/unversioned/expo-ads-admob/expo-ads-admob.js.map +1 -1
- package/build/plugins/unversioned/expo-ads-admob/withAndroidAdMob.js +1 -3
- package/build/plugins/unversioned/expo-ads-admob/withAndroidAdMob.js.map +1 -1
- package/build/plugins/unversioned/expo-ads-admob/withIosAdMob.js +1 -3
- package/build/plugins/unversioned/expo-ads-admob/withIosAdMob.js.map +1 -1
- package/build/plugins/unversioned/expo-apple-authentication.js +1 -3
- package/build/plugins/unversioned/expo-apple-authentication.js.map +1 -1
- package/build/plugins/unversioned/expo-contacts.js +1 -3
- package/build/plugins/unversioned/expo-contacts.js.map +1 -1
- package/build/plugins/unversioned/expo-document-picker.js +1 -3
- package/build/plugins/unversioned/expo-document-picker.js.map +1 -1
- package/build/plugins/unversioned/expo-navigation-bar/expo-navigation-bar.js +1 -3
- package/build/plugins/unversioned/expo-navigation-bar/expo-navigation-bar.js.map +1 -1
- package/build/plugins/unversioned/expo-navigation-bar/withAndroidNavigationBar.js +1 -3
- package/build/plugins/unversioned/expo-navigation-bar/withAndroidNavigationBar.js.map +1 -1
- package/build/plugins/unversioned/expo-notifications/expo-notifications.js +1 -3
- package/build/plugins/unversioned/expo-notifications/expo-notifications.js.map +1 -1
- package/build/plugins/unversioned/expo-splash-screen/InterfaceBuilder.js +1 -3
- package/build/plugins/unversioned/expo-splash-screen/InterfaceBuilder.js.map +1 -1
- package/build/plugins/unversioned/expo-splash-screen/expo-splash-screen.js +1 -3
- package/build/plugins/unversioned/expo-splash-screen/expo-splash-screen.js.map +1 -1
- package/build/plugins/unversioned/expo-splash-screen/getAndroidSplashConfig.js +1 -3
- package/build/plugins/unversioned/expo-splash-screen/getAndroidSplashConfig.js.map +1 -1
- package/build/plugins/unversioned/expo-splash-screen/getIosSplashConfig.js +1 -3
- package/build/plugins/unversioned/expo-splash-screen/getIosSplashConfig.js.map +1 -1
- package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashDrawables.js +1 -3
- package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashDrawables.js.map +1 -1
- package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashImages.js +1 -3
- package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashImages.js.map +1 -1
- package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashLegacyMainActivity.js +1 -3
- package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashLegacyMainActivity.js.map +1 -1
- package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashMainActivity.js +1 -3
- package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashMainActivity.js.map +1 -1
- package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashScreen.js +1 -3
- package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashScreen.js.map +1 -1
- package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashStrings.js +1 -3
- package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashStrings.js.map +1 -1
- package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashStyles.js +1 -3
- package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashStyles.js.map +1 -1
- package/build/plugins/unversioned/expo-splash-screen/withIosSplashAssets.js +1 -3
- package/build/plugins/unversioned/expo-splash-screen/withIosSplashAssets.js.map +1 -1
- package/build/plugins/unversioned/expo-splash-screen/withIosSplashColors.js +1 -3
- package/build/plugins/unversioned/expo-splash-screen/withIosSplashColors.js.map +1 -1
- package/build/plugins/unversioned/expo-splash-screen/withIosSplashInfoPlist.js +1 -3
- package/build/plugins/unversioned/expo-splash-screen/withIosSplashInfoPlist.js.map +1 -1
- package/build/plugins/unversioned/expo-splash-screen/withIosSplashScreen.js +1 -3
- package/build/plugins/unversioned/expo-splash-screen/withIosSplashScreen.js.map +1 -1
- package/build/plugins/unversioned/expo-splash-screen/withIosSplashScreenStoryboard.js +1 -3
- package/build/plugins/unversioned/expo-splash-screen/withIosSplashScreenStoryboard.js.map +1 -1
- package/build/plugins/unversioned/expo-splash-screen/withIosSplashScreenStoryboardImage.js +1 -3
- package/build/plugins/unversioned/expo-splash-screen/withIosSplashScreenStoryboardImage.js.map +1 -1
- package/build/plugins/unversioned/expo-splash-screen/withIosSplashXcodeProject.js +1 -3
- package/build/plugins/unversioned/expo-splash-screen/withIosSplashXcodeProject.js.map +1 -1
- package/build/plugins/unversioned/expo-system-ui/expo-system-ui.js +1 -3
- package/build/plugins/unversioned/expo-system-ui/expo-system-ui.js.map +1 -1
- package/build/plugins/unversioned/expo-system-ui/withAndroidRootViewBackgroundColor.js +1 -3
- package/build/plugins/unversioned/expo-system-ui/withAndroidRootViewBackgroundColor.js.map +1 -1
- package/build/plugins/unversioned/expo-system-ui/withAndroidUserInterfaceStyle.js +1 -3
- package/build/plugins/unversioned/expo-system-ui/withAndroidUserInterfaceStyle.js.map +1 -1
- package/build/plugins/unversioned/expo-system-ui/withIosRootViewBackgroundColor.js +1 -3
- package/build/plugins/unversioned/expo-system-ui/withIosRootViewBackgroundColor.js.map +1 -1
- package/build/plugins/unversioned/expo-system-ui/withIosUserInterfaceStyle.js +1 -3
- package/build/plugins/unversioned/expo-system-ui/withIosUserInterfaceStyle.js.map +1 -1
- package/build/plugins/unversioned/expo-updates.js +1 -3
- package/build/plugins/unversioned/expo-updates.js.map +1 -1
- package/build/plugins/unversioned/react-native-maps.js +1 -3
- package/build/plugins/unversioned/react-native-maps.js.map +1 -1
- package/build/plugins/withDefaultPlugins.js +1 -3
- package/build/plugins/withDefaultPlugins.js.map +1 -1
- package/package.json +7 -7
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
3
|
+
exports.__esModule = true;
|
|
6
4
|
exports.getAutolinkedPackagesAsync = getAutolinkedPackagesAsync;
|
|
7
5
|
exports.resolvePackagesList = resolvePackagesList;
|
|
8
6
|
exports.shouldSkipAutoPlugin = shouldSkipAutoPlugin;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getAutolinkedPackages.js","names":["_unstableAutolinkingExports","data","require","getAutolinkedPackagesAsync","projectRoot","platforms","linker","makeCachedDependenciesLinker","dependenciesPerPlatform","Promise","all","map","platform","scanExpoModuleResolutionsForPlatform","resolvePackagesList","platformPaths","allPlatformPaths","paths","Object","keys","flat","uniquePaths","Set","sort","shouldSkipAutoPlugin","config","plugin","Array","isArray","_internal","autolinkedModules","pluginId","isIncluded","includes"],"sources":["../src/getAutolinkedPackages.ts"],"sourcesContent":["import { ModPlatform, StaticPlugin } from '@expo/config-plugins';\nimport { ExpoConfig } from '@expo/config-types';\nimport {\n makeCachedDependenciesLinker,\n scanExpoModuleResolutionsForPlatform,\n} from 'expo/internal/unstable-autolinking-exports';\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 linker = makeCachedDependenciesLinker({ projectRoot });\n const dependenciesPerPlatform = await Promise.all(\n platforms.map((platform) => {\n return scanExpoModuleResolutionsForPlatform(linker, platform);\n })\n );\n return resolvePackagesList(dependenciesPerPlatform);\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"],"mappings":"
|
|
1
|
+
{"version":3,"file":"getAutolinkedPackages.js","names":["_unstableAutolinkingExports","data","require","getAutolinkedPackagesAsync","projectRoot","platforms","linker","makeCachedDependenciesLinker","dependenciesPerPlatform","Promise","all","map","platform","scanExpoModuleResolutionsForPlatform","resolvePackagesList","platformPaths","allPlatformPaths","paths","Object","keys","flat","uniquePaths","Set","sort","shouldSkipAutoPlugin","config","plugin","Array","isArray","_internal","autolinkedModules","pluginId","isIncluded","includes"],"sources":["../src/getAutolinkedPackages.ts"],"sourcesContent":["import { ModPlatform, StaticPlugin } from '@expo/config-plugins';\nimport { ExpoConfig } from '@expo/config-types';\nimport {\n makeCachedDependenciesLinker,\n scanExpoModuleResolutionsForPlatform,\n} from 'expo/internal/unstable-autolinking-exports';\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 linker = makeCachedDependenciesLinker({ projectRoot });\n const dependenciesPerPlatform = await Promise.all(\n platforms.map((platform) => {\n return scanExpoModuleResolutionsForPlatform(linker, platform);\n })\n );\n return resolvePackagesList(dependenciesPerPlatform);\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"],"mappings":";;;;;;AAEA,SAAAA,4BAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,2BAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,eAAeE,0BAA0BA,CAC9CC,WAAmB,EACnBC,SAAwB,GAAG,CAAC,KAAK,EAAE,SAAS,CAAC,EAC7C;EACA,MAAMC,MAAM,GAAG,IAAAC,0DAA4B,EAAC;IAAEH;EAAY,CAAC,CAAC;EAC5D,MAAMI,uBAAuB,GAAG,MAAMC,OAAO,CAACC,GAAG,CAC/CL,SAAS,CAACM,GAAG,CAAEC,QAAQ,IAAK;IAC1B,OAAO,IAAAC,kEAAoC,EAACP,MAAM,EAAEM,QAAQ,CAAC;EAC/D,CAAC,CACH,CAAC;EACD,OAAOE,mBAAmB,CAACN,uBAAuB,CAAC;AACrD;AAEO,SAASM,mBAAmBA,CAACC,aAAoC,EAAE;EACxE,MAAMC,gBAAgB,GAAGD,aAAa,CAACJ,GAAG,CAAEM,KAAK,IAAKC,MAAM,CAACC,IAAI,CAACF,KAAK,CAAC,CAAC,CAACG,IAAI,CAAC,CAAC;EAEhF,MAAMC,WAAW,GAAG,CAAC,GAAG,IAAIC,GAAG,CAACN,gBAAgB,CAAC,CAAC;EAElD,OAAOK,WAAW,CAACE,IAAI,CAAC,CAAC;AAC3B;AAEO,SAASC,oBAAoBA,CAClCC,MAAqC,EACrCC,MAA6B,EAC7B;EACA;EACA,IAAIA,MAAM,KAAK,iBAAiB,EAAE;IAChC,OAAO,KAAK;EACd;;EAEA;EACA;EACA,IAAIC,KAAK,CAACC,OAAO,CAACH,MAAM,CAACI,SAAS,EAAEC,iBAAiB,CAAC,EAAE;IACtD;IACA,MAAMC,QAAQ,GAAGJ,KAAK,CAACC,OAAO,CAACF,MAAM,CAAC,GAAGA,MAAM,CAAC,CAAC,CAAC,GAAGA,MAAM;IAC3D,IAAI,OAAOK,QAAQ,KAAK,QAAQ,EAAE;MAChC;MACA,MAAMC,UAAU,GAAGP,MAAM,CAACI,SAAS,CAAEC,iBAAiB,CAACG,QAAQ,CAACF,QAAQ,CAAC;MACzE,IAAI,CAACC,UAAU,EAAE;QACf;QACA,OAAO,IAAI;MACb;IACF;EACF;EACA,OAAO,KAAK;AACd","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getPrebuildConfig.js","names":["_config","data","require","_getAutolinkedPackages","_withDefaultPlugins","getPrebuildConfigAsync","projectRoot","props","autolinkedModules","getAutolinkedPackagesAsync","platforms","getPrebuildConfig","bundleIdentifier","packageName","exp","config","rest","getConfig","skipSDKVersionRequirement","isModdedConfig","_internal","withVersionedExpoSDKPlugins","withLegacyExpoPlugins","includes","ios","withIosExpoPlugins","android","package","withAndroidExpoPlugins"],"sources":["../src/getPrebuildConfig.ts"],"sourcesContent":["import { getConfig } from '@expo/config';\nimport { ModPlatform } from '@expo/config-plugins';\n\nimport { getAutolinkedPackagesAsync } from './getAutolinkedPackages';\nimport {\n withAndroidExpoPlugins,\n withIosExpoPlugins,\n withLegacyExpoPlugins,\n withVersionedExpoSDKPlugins,\n} from './plugins/withDefaultPlugins';\n\nexport async function getPrebuildConfigAsync(\n projectRoot: string,\n props: {\n bundleIdentifier?: string;\n packageName?: string;\n platforms: ModPlatform[];\n }\n): Promise<ReturnType<typeof getConfig>> {\n const autolinkedModules = await getAutolinkedPackagesAsync(projectRoot, props.platforms);\n\n return getPrebuildConfig(projectRoot, {\n ...props,\n autolinkedModules,\n });\n}\n\nfunction getPrebuildConfig(\n projectRoot: string,\n {\n platforms,\n bundleIdentifier,\n packageName,\n autolinkedModules,\n }: {\n bundleIdentifier?: string;\n packageName?: string;\n platforms: ModPlatform[];\n autolinkedModules?: string[];\n }\n) {\n // let config: ExpoConfig;\n let { exp: config, ...rest } = getConfig(projectRoot, {\n skipSDKVersionRequirement: true,\n isModdedConfig: true,\n });\n\n if (autolinkedModules) {\n if (!config._internal) {\n config._internal = {};\n }\n config._internal.autolinkedModules = autolinkedModules;\n }\n\n // Add all built-in plugins first because they should take\n // priority over the unversioned plugins.\n config = withVersionedExpoSDKPlugins(config);\n config = withLegacyExpoPlugins(config);\n\n if (platforms.includes('ios')) {\n if (!config.ios) config.ios = {};\n config.ios.bundleIdentifier =\n bundleIdentifier ?? config.ios.bundleIdentifier ?? `com.placeholder.appid`;\n\n // Add all built-in plugins\n config = withIosExpoPlugins(config, {\n bundleIdentifier: config.ios.bundleIdentifier,\n });\n }\n\n if (platforms.includes('android')) {\n if (!config.android) config.android = {};\n config.android.package = packageName ?? config.android.package ?? `com.placeholder.appid`;\n\n // Add all built-in plugins\n config = withAndroidExpoPlugins(config, {\n package: config.android.package,\n projectRoot,\n });\n }\n\n return { exp: config, ...rest };\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"getPrebuildConfig.js","names":["_config","data","require","_getAutolinkedPackages","_withDefaultPlugins","getPrebuildConfigAsync","projectRoot","props","autolinkedModules","getAutolinkedPackagesAsync","platforms","getPrebuildConfig","bundleIdentifier","packageName","exp","config","rest","getConfig","skipSDKVersionRequirement","isModdedConfig","_internal","withVersionedExpoSDKPlugins","withLegacyExpoPlugins","includes","ios","withIosExpoPlugins","android","package","withAndroidExpoPlugins"],"sources":["../src/getPrebuildConfig.ts"],"sourcesContent":["import { getConfig } from '@expo/config';\nimport { ModPlatform } from '@expo/config-plugins';\n\nimport { getAutolinkedPackagesAsync } from './getAutolinkedPackages';\nimport {\n withAndroidExpoPlugins,\n withIosExpoPlugins,\n withLegacyExpoPlugins,\n withVersionedExpoSDKPlugins,\n} from './plugins/withDefaultPlugins';\n\nexport async function getPrebuildConfigAsync(\n projectRoot: string,\n props: {\n bundleIdentifier?: string;\n packageName?: string;\n platforms: ModPlatform[];\n }\n): Promise<ReturnType<typeof getConfig>> {\n const autolinkedModules = await getAutolinkedPackagesAsync(projectRoot, props.platforms);\n\n return getPrebuildConfig(projectRoot, {\n ...props,\n autolinkedModules,\n });\n}\n\nfunction getPrebuildConfig(\n projectRoot: string,\n {\n platforms,\n bundleIdentifier,\n packageName,\n autolinkedModules,\n }: {\n bundleIdentifier?: string;\n packageName?: string;\n platforms: ModPlatform[];\n autolinkedModules?: string[];\n }\n) {\n // let config: ExpoConfig;\n let { exp: config, ...rest } = getConfig(projectRoot, {\n skipSDKVersionRequirement: true,\n isModdedConfig: true,\n });\n\n if (autolinkedModules) {\n if (!config._internal) {\n config._internal = {};\n }\n config._internal.autolinkedModules = autolinkedModules;\n }\n\n // Add all built-in plugins first because they should take\n // priority over the unversioned plugins.\n config = withVersionedExpoSDKPlugins(config);\n config = withLegacyExpoPlugins(config);\n\n if (platforms.includes('ios')) {\n if (!config.ios) config.ios = {};\n config.ios.bundleIdentifier =\n bundleIdentifier ?? config.ios.bundleIdentifier ?? `com.placeholder.appid`;\n\n // Add all built-in plugins\n config = withIosExpoPlugins(config, {\n bundleIdentifier: config.ios.bundleIdentifier,\n });\n }\n\n if (platforms.includes('android')) {\n if (!config.android) config.android = {};\n config.android.package = packageName ?? config.android.package ?? `com.placeholder.appid`;\n\n // Add all built-in plugins\n config = withAndroidExpoPlugins(config, {\n package: config.android.package,\n projectRoot,\n });\n }\n\n return { exp: config, ...rest };\n}\n"],"mappings":";;;;AAAA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAE,uBAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,sBAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,oBAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAA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AAG,CAACZ;IAC/B,CAAC,CAAC;EACJ;EAEA,IAAIF,SAAS,CAACa,QAAQ,CAAC,SAAS,CAAC,EAAE;IACjC,IAAI,CAACR,MAAM,CAACW,OAAO,EAAEX,MAAM,CAACW,OAAO,GAAG,CAAC,CAAC;IACxCX,MAAM,CAACW,OAAO,CAACC,OAAO,GAAGd,WAAW,IAAIE,MAAM,CAACW,OAAO,CAACC,OAAO,IAAI,uBAAuB;;IAEzF;IACAZ,MAAM,GAAG,IAAAa,4CAAsB,EAACb,MAAM,EAAE;MACtCY,OAAO,EAAEZ,MAAM,CAACW,OAAO,CAACC,OAAO;MAC/BrB;IACF,CAAC,CAAC;EACJ;EAEA,OAAO;IAAEQ,GAAG,EAAEC,MAAM;IAAE,GAAGC;EAAK,CAAC;AACjC","ignoreList":[]}
|
package/build/index.js
CHANGED
|
@@ -1,17 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
3
|
+
exports.__esModule = true;
|
|
6
4
|
var _exportNames = {
|
|
7
5
|
getPrebuildConfigAsync: true
|
|
8
6
|
};
|
|
9
|
-
|
|
10
|
-
enumerable: true,
|
|
11
|
-
get: function () {
|
|
12
|
-
return _getPrebuildConfig().getPrebuildConfigAsync;
|
|
13
|
-
}
|
|
14
|
-
});
|
|
7
|
+
exports.getPrebuildConfigAsync = void 0;
|
|
15
8
|
function _getPrebuildConfig() {
|
|
16
9
|
const data = require("./getPrebuildConfig");
|
|
17
10
|
_getPrebuildConfig = function () {
|
|
@@ -19,16 +12,12 @@ function _getPrebuildConfig() {
|
|
|
19
12
|
};
|
|
20
13
|
return data;
|
|
21
14
|
}
|
|
15
|
+
exports.getPrebuildConfigAsync = _getPrebuildConfig().getPrebuildConfigAsync;
|
|
22
16
|
var _withDefaultPlugins = require("./plugins/withDefaultPlugins");
|
|
23
17
|
Object.keys(_withDefaultPlugins).forEach(function (key) {
|
|
24
18
|
if (key === "default" || key === "__esModule") return;
|
|
25
19
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
26
20
|
if (key in exports && exports[key] === _withDefaultPlugins[key]) return;
|
|
27
|
-
|
|
28
|
-
enumerable: true,
|
|
29
|
-
get: function () {
|
|
30
|
-
return _withDefaultPlugins[key];
|
|
31
|
-
}
|
|
32
|
-
});
|
|
21
|
+
exports[key] = _withDefaultPlugins[key];
|
|
33
22
|
});
|
|
34
23
|
//# sourceMappingURL=index.js.map
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_getPrebuildConfig","data","require","_withDefaultPlugins","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames"
|
|
1
|
+
{"version":3,"file":"index.js","names":["_getPrebuildConfig","data","require","exports","getPrebuildConfigAsync","_withDefaultPlugins","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames"],"sources":["../src/index.ts"],"sourcesContent":["export { getPrebuildConfigAsync } from './getPrebuildConfig';\nexport * from './plugins/withDefaultPlugins';\n"],"mappings":";;;;;;;AAAA,SAAAA,mBAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,kBAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA6DE,OAAA,CAAAC,sBAAA,GAAAJ,kBAAA,GAAAI,sBAAA;AAC7D,IAAAC,mBAAA,GAAAH,OAAA;AAAAI,MAAA,CAAAC,IAAA,CAAAF,mBAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAN,OAAA,IAAAA,OAAA,CAAAM,GAAA,MAAAJ,mBAAA,CAAAI,GAAA;EAAAN,OAAA,CAAAM,GAAA,IAAAJ,mBAAA,CAAAI,GAAA;AAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssetContents.js","names":["_fs","data","_interopRequireDefault","require","_path","e","__esModule","default","createContentsJsonItem","item","writeContentsJsonAsync","directory","images","fs","promises","mkdir","recursive","writeFile","join","JSON","stringify","info","version","author"],"sources":["../../../src/plugins/icons/AssetContents.ts"],"sourcesContent":["import fs from 'fs';\nimport { join } from 'path';\n\nexport type ContentsJsonImageIdiom =\n | 'iphone'\n | 'ipad'\n | 'watchos'\n | 'ios'\n | 'ios-marketing'\n | 'universal';\n\nexport type ContentsJsonImageAppearanceLuminosityType = 'light' | 'dark' | 'tinted';\n\nexport type ContentsJsonAppearance = {\n appearance: 'luminosity';\n value: ContentsJsonImageAppearanceLuminosityType;\n};\n\nexport type ContentsJsonImageScale = '1x' | '2x' | '3x';\n\nexport interface ContentsJsonImage {\n appearances?: ContentsJsonAppearance[];\n idiom: ContentsJsonImageIdiom;\n size?: string;\n scale?: ContentsJsonImageScale;\n filename?: string;\n platform?: ContentsJsonImageIdiom;\n}\n\nexport interface ContentsJsonColor {\n appearances?: ContentsJsonAppearance[];\n idiom: ContentsJsonImageIdiom;\n color: {\n 'color-space': 'srgb';\n components: {\n alpha: string;\n blue: string;\n green: string;\n red: string;\n };\n };\n}\n\nexport interface ContentsJson {\n images: ContentsJsonImage[];\n colors: ContentsJsonColor[];\n info: {\n version: number;\n author: string;\n };\n}\n\nexport function createContentsJsonItem(item: ContentsJsonImage): ContentsJsonImage {\n return item;\n}\n\n/**\n * Writes the Config.json which is used to assign images to their respective platform, dpi, and idiom.\n *\n * @param directory path to add the Contents.json to.\n * @param contents image json data\n */\nexport async function writeContentsJsonAsync(\n directory: string,\n { images }: Pick<ContentsJson, 'images'>\n): Promise<void> {\n await fs.promises.mkdir(directory, { recursive: true });\n await fs.promises.writeFile(\n join(directory, 'Contents.json'),\n JSON.stringify(\n {\n images,\n info: {\n version: 1,\n // common practice is for the tool that generated the icons to be the \"author\"\n author: 'expo',\n },\n },\n null,\n 2\n )\n );\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"AssetContents.js","names":["_fs","data","_interopRequireDefault","require","_path","e","__esModule","default","createContentsJsonItem","item","writeContentsJsonAsync","directory","images","fs","promises","mkdir","recursive","writeFile","join","JSON","stringify","info","version","author"],"sources":["../../../src/plugins/icons/AssetContents.ts"],"sourcesContent":["import fs from 'fs';\nimport { join } from 'path';\n\nexport type ContentsJsonImageIdiom =\n | 'iphone'\n | 'ipad'\n | 'watchos'\n | 'ios'\n | 'ios-marketing'\n | 'universal';\n\nexport type ContentsJsonImageAppearanceLuminosityType = 'light' | 'dark' | 'tinted';\n\nexport type ContentsJsonAppearance = {\n appearance: 'luminosity';\n value: ContentsJsonImageAppearanceLuminosityType;\n};\n\nexport type ContentsJsonImageScale = '1x' | '2x' | '3x';\n\nexport interface ContentsJsonImage {\n appearances?: ContentsJsonAppearance[];\n idiom: ContentsJsonImageIdiom;\n size?: string;\n scale?: ContentsJsonImageScale;\n filename?: string;\n platform?: ContentsJsonImageIdiom;\n}\n\nexport interface ContentsJsonColor {\n appearances?: ContentsJsonAppearance[];\n idiom: ContentsJsonImageIdiom;\n color: {\n 'color-space': 'srgb';\n components: {\n alpha: string;\n blue: string;\n green: string;\n red: string;\n };\n };\n}\n\nexport interface ContentsJson {\n images: ContentsJsonImage[];\n colors: ContentsJsonColor[];\n info: {\n version: number;\n author: string;\n };\n}\n\nexport function createContentsJsonItem(item: ContentsJsonImage): ContentsJsonImage {\n return item;\n}\n\n/**\n * Writes the Config.json which is used to assign images to their respective platform, dpi, and idiom.\n *\n * @param directory path to add the Contents.json to.\n * @param contents image json data\n */\nexport async function writeContentsJsonAsync(\n directory: string,\n { images }: Pick<ContentsJson, 'images'>\n): Promise<void> {\n await fs.promises.mkdir(directory, { recursive: true });\n await fs.promises.writeFile(\n join(directory, 'Contents.json'),\n JSON.stringify(\n {\n images,\n info: {\n version: 1,\n // common practice is for the tool that generated the icons to be the \"author\"\n author: 'expo',\n },\n },\n null,\n 2\n )\n );\n}\n"],"mappings":";;;;;AAAA,SAAAA,IAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,GAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,MAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,KAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA4B,SAAAC,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAmDrB,SAASG,sBAAsBA,CAACC,IAAuB,EAAqB;EACjF,OAAOA,IAAI;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,eAAeC,sBAAsBA,CAC1CC,SAAiB,EACjB;EAAEC;AAAqC,CAAC,EACzB;EACf,MAAMC,aAAE,CAACC,QAAQ,CAACC,KAAK,CAACJ,SAAS,EAAE;IAAEK,SAAS,EAAE;EAAK,CAAC,CAAC;EACvD,MAAMH,aAAE,CAACC,QAAQ,CAACG,SAAS,CACzB,IAAAC,YAAI,EAACP,SAAS,EAAE,eAAe,CAAC,EAChCQ,IAAI,CAACC,SAAS,CACZ;IACER,MAAM;IACNS,IAAI,EAAE;MACJC,OAAO,EAAE,CAAC;MACV;MACAC,MAAM,EAAE;IACV;EACF,CAAC,EACD,IAAI,EACJ,CACF,CACF,CAAC;AACH","ignoreList":[]}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
3
|
+
exports.__esModule = true;
|
|
6
4
|
exports.ANDROID_RES_PATH = void 0;
|
|
7
5
|
exports.configureAdaptiveIconAsync = configureAdaptiveIconAsync;
|
|
8
6
|
exports.dpiValues = exports.createAdaptiveIconXmlString = void 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withAndroidIcons.js","names":["_configPlugins","data","require","_imageUtils","_fs","_interopRequireDefault","_path","_withAndroidManifestIcons","e","__esModule","default","Colors","AndroidConfig","dpiValues","exports","mdpi","folderName","scale","hdpi","xhdpi","xxhdpi","xxxhdpi","LEGACY_BASELINE_PIXEL_SIZE","ADAPTIVE_BASELINE_PIXEL_SIZE","ANDROID_RES_PATH","MIPMAP_ANYDPI_V26","ICON_BACKGROUND","IC_LAUNCHER_WEBP","IC_LAUNCHER_ROUND_WEBP","IC_LAUNCHER_BACKGROUND_WEBP","IC_LAUNCHER_FOREGROUND_WEBP","IC_LAUNCHER_MONOCHROME_WEBP","IC_LAUNCHER_XML","IC_LAUNCHER_ROUND_XML","withAndroidIcons","config","foregroundImage","backgroundColor","backgroundImage","monochromeImage","getAdaptiveIcon","icon","getIcon","withAndroidManifestIcons","withAndroidAdaptiveIconColors","withDangerousMod","setIconAsync","modRequest","projectRoot","isAdaptive","android","adaptiveIcon","setRoundIconManifest","manifest","application","Manifest","getMainApplicationOrThrow","$","withAndroidColors","modResults","setBackgroundColor","configureLegacyIconAsync","generateRoundIconAsync","deleteIconNamedAsync","configureAdaptiveIconAsync","generateMultiLayerImageAsync","outputImageFileName","imageCacheFolder","backgroundImageCacheFolder","borderRadiusRatio","generateMonochromeImageAsync","backgroundImageFileName","icLauncherXmlString","createAdaptiveIconXmlString","createAdaptiveIconXmlFiles","colors","assignColorValue","value","name","background","iconElements","push","join","add","anyDpiV26Directory","path","resolve","fs","promises","mkdir","recursive","launcherPath","launcherRoundPath","Promise","all","writeFile","map","rm","force","iterateDpiValues","dpiFolder","iconLayer","generateIconAsync","cacheType","src","backgroundLayer","compositeImagesAsync","foreground","monochromeIcon","callback","Object","values","iconSizePx","generateImageAsync","width","height","resizeMode","borderRadius","undefined","source"],"sources":["../../../src/plugins/icons/withAndroidIcons.ts"],"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';\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};\n\nconst LEGACY_BASELINE_PIXEL_SIZE = 48;\nconst ADAPTIVE_BASELINE_PIXEL_SIZE = 108;\n\nexport const ANDROID_RES_PATH = 'android/app/src/main/res/';\nconst MIPMAP_ANYDPI_V26 = 'mipmap-anydpi-v26';\nconst ICON_BACKGROUND = 'iconBackground';\nconst IC_LAUNCHER_WEBP = 'ic_launcher.webp';\nconst IC_LAUNCHER_ROUND_WEBP = 'ic_launcher_round.webp';\nconst IC_LAUNCHER_BACKGROUND_WEBP = 'ic_launcher_background.webp';\nconst IC_LAUNCHER_FOREGROUND_WEBP = 'ic_launcher_foreground.webp';\nconst IC_LAUNCHER_MONOCHROME_WEBP = 'ic_launcher_monochrome.webp';\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, monochromeImage } =\n 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 monochromeImage,\n isAdaptive: !!config.android?.adaptiveIcon,\n });\n return config;\n },\n ]);\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\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 monochromeImage: config.android?.adaptiveIcon?.monochromeImage ?? 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 monochromeImage,\n isAdaptive,\n }: {\n icon: string | null;\n backgroundColor: string | null;\n backgroundImage: string | null;\n monochromeImage: string | null;\n isAdaptive: boolean;\n }\n) {\n if (!icon) {\n return null;\n }\n\n await configureLegacyIconAsync(projectRoot, icon, backgroundImage, backgroundColor);\n if (isAdaptive) {\n await generateRoundIconAsync(projectRoot, icon, backgroundImage, backgroundColor);\n } else {\n await deleteIconNamedAsync(projectRoot, IC_LAUNCHER_ROUND_WEBP);\n }\n await configureAdaptiveIconAsync(projectRoot, icon, backgroundImage, monochromeImage, 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 return generateMultiLayerImageAsync(projectRoot, {\n icon,\n backgroundImage,\n backgroundColor,\n outputImageFileName: IC_LAUNCHER_WEBP,\n imageCacheFolder: 'android-standard-square',\n backgroundImageCacheFolder: 'android-standard-square-background',\n });\n}\n\nasync function generateRoundIconAsync(\n projectRoot: string,\n icon: string,\n backgroundImage: string | null,\n backgroundColor: string | null\n) {\n return generateMultiLayerImageAsync(projectRoot, {\n icon,\n borderRadiusRatio: 0.5,\n outputImageFileName: IC_LAUNCHER_ROUND_WEBP,\n backgroundImage,\n backgroundColor,\n imageCacheFolder: 'android-standard-circle',\n backgroundImageCacheFolder: 'android-standard-round-background',\n isAdaptive: false,\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 monochromeImage: string | null,\n isAdaptive: boolean\n) {\n if (monochromeImage) {\n await generateMonochromeImageAsync(projectRoot, {\n icon: monochromeImage,\n imageCacheFolder: 'android-adaptive-monochrome',\n outputImageFileName: IC_LAUNCHER_MONOCHROME_WEBP,\n });\n }\n await generateMultiLayerImageAsync(projectRoot, {\n backgroundColor: 'transparent',\n backgroundImage,\n backgroundImageCacheFolder: 'android-adaptive-background',\n outputImageFileName: IC_LAUNCHER_FOREGROUND_WEBP,\n icon: foregroundImage,\n imageCacheFolder: 'android-adaptive-foreground',\n backgroundImageFileName: IC_LAUNCHER_BACKGROUND_WEBP,\n isAdaptive: true,\n });\n\n // create ic_launcher.xml and ic_launcher_round.xml\n const icLauncherXmlString = createAdaptiveIconXmlString(backgroundImage, monochromeImage);\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 = (\n backgroundImage: string | null,\n monochromeImage: string | null\n) => {\n const background = backgroundImage ? `@mipmap/ic_launcher_background` : `@color/iconBackground`;\n\n const iconElements: string[] = [\n `<background android:drawable=\"${background}\"/>`,\n '<foreground android:drawable=\"@mipmap/ic_launcher_foreground\"/>',\n ];\n\n if (monochromeImage) {\n iconElements.push('<monochrome android:drawable=\"@mipmap/ic_launcher_monochrome\"/>');\n }\n\n return `<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<adaptive-icon xmlns:android=\"http://schemas.android.com/apk/res/android\">\n ${iconElements.join('\\n ')}\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.promises.mkdir(anyDpiV26Directory, { recursive: true });\n const launcherPath = path.resolve(anyDpiV26Directory, IC_LAUNCHER_XML);\n const launcherRoundPath = path.resolve(anyDpiV26Directory, IC_LAUNCHER_ROUND_XML);\n if (add) {\n await Promise.all([\n fs.promises.writeFile(launcherPath, icLauncherXmlString, 'utf8'),\n fs.promises.writeFile(launcherRoundPath, icLauncherXmlString, 'utf8'),\n ]);\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 return fs.promises.rm(path, { force: true });\n })\n );\n }\n}\n\nasync function generateMultiLayerImageAsync(\n projectRoot: string,\n {\n icon,\n backgroundColor,\n backgroundImage,\n imageCacheFolder,\n backgroundImageCacheFolder,\n borderRadiusRatio,\n outputImageFileName,\n backgroundImageFileName,\n isAdaptive,\n }: {\n icon: string;\n backgroundImage: string | null;\n backgroundColor: string | null;\n imageCacheFolder: string;\n backgroundImageCacheFolder: string;\n backgroundImageFileName?: string;\n borderRadiusRatio?: number;\n outputImageFileName: string;\n isAdaptive?: boolean;\n }\n) {\n await iterateDpiValues(projectRoot, async ({ dpiFolder, scale }) => {\n let iconLayer = await generateIconAsync(projectRoot, {\n cacheType: imageCacheFolder,\n src: icon,\n scale,\n // backgroundImage overrides backgroundColor\n backgroundColor: backgroundImage ? 'transparent' : (backgroundColor ?? 'transparent'),\n borderRadiusRatio,\n isAdaptive,\n });\n\n if (backgroundImage) {\n const backgroundLayer = await generateIconAsync(projectRoot, {\n cacheType: backgroundImageCacheFolder,\n src: backgroundImage,\n scale,\n backgroundColor: 'transparent',\n borderRadiusRatio,\n isAdaptive,\n });\n\n if (backgroundImageFileName) {\n await fs.promises.writeFile(\n path.resolve(dpiFolder, backgroundImageFileName),\n backgroundLayer\n );\n } else {\n iconLayer = await compositeImagesAsync({\n foreground: iconLayer,\n background: backgroundLayer,\n });\n }\n } else if (backgroundImageFileName) {\n // Remove any instances of ic_launcher_background.png that are there from previous icons\n await deleteIconNamedAsync(projectRoot, backgroundImageFileName);\n }\n\n await fs.promises.mkdir(dpiFolder, { recursive: true });\n await fs.promises.writeFile(path.resolve(dpiFolder, outputImageFileName), iconLayer);\n });\n}\n\nasync function generateMonochromeImageAsync(\n projectRoot: string,\n {\n icon,\n imageCacheFolder,\n outputImageFileName,\n }: { icon: string; imageCacheFolder: string; outputImageFileName: string }\n) {\n await iterateDpiValues(projectRoot, async ({ dpiFolder, scale }) => {\n const monochromeIcon = await generateIconAsync(projectRoot, {\n cacheType: imageCacheFolder,\n src: icon,\n scale,\n backgroundColor: 'transparent',\n isAdaptive: true,\n });\n await fs.promises.mkdir(dpiFolder, { recursive: true });\n await fs.promises.writeFile(path.resolve(dpiFolder, outputImageFileName), monochromeIcon);\n });\n}\n\nfunction iterateDpiValues(\n projectRoot: string,\n callback: (value: { dpiFolder: string; folderName: string; scale: number }) => Promise<void>\n) {\n return Promise.all(\n Object.values(dpiValues).map((value) =>\n callback({\n dpiFolder: path.resolve(projectRoot, ANDROID_RES_PATH, value.folderName),\n ...value,\n })\n )\n );\n}\n\nasync function deleteIconNamedAsync(projectRoot: string, name: string) {\n return iterateDpiValues(projectRoot, ({ dpiFolder }) => {\n return fs.promises.rm(path.resolve(dpiFolder, name), { force: true });\n });\n}\n\nasync function generateIconAsync(\n projectRoot: string,\n {\n cacheType,\n src,\n scale,\n backgroundColor,\n borderRadiusRatio,\n isAdaptive,\n }: {\n cacheType: string;\n src: string;\n scale: number;\n backgroundColor: string;\n borderRadiusRatio?: number;\n isAdaptive?: boolean;\n }\n) {\n const iconSizePx =\n (isAdaptive ? ADAPTIVE_BASELINE_PIXEL_SIZE : LEGACY_BASELINE_PIXEL_SIZE) * scale;\n\n return (\n await generateImageAsync(\n { projectRoot, cacheType },\n {\n src,\n width: iconSizePx,\n height: iconSizePx,\n resizeMode: 'cover',\n backgroundColor,\n borderRadius: borderRadiusRatio ? iconSizePx * borderRadiusRatio : undefined,\n }\n )\n ).source;\n}\n"],"mappings":";;;;;;;;;;;;;AAAA,SAAAA,eAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,cAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAQA,SAAAE,Y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,CAAC/D,UAAU,GAAG1B,4BAA4B,GAAGD,0BAA0B,IAAIL,KAAK;EAElF,OAAO,CACL,MAAM,IAAAgG,gCAAkB,EACtB;IAAEjE,WAAW;IAAEuD;EAAU,CAAC,EAC1B;IACEC,GAAG;IACHU,KAAK,EAAEF,UAAU;IACjBG,MAAM,EAAEH,UAAU;IAClBI,UAAU,EAAE,OAAO;IACnB/E,eAAe;IACfgF,YAAY,EAAEhD,iBAAiB,GAAG2C,UAAU,GAAG3C,iBAAiB,GAAGiD;EACrE,CACF,CAAC,EACDC,MAAM;AACV","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"withAndroidIcons.js","names":["_configPlugins","data","require","_imageUtils","_fs","_interopRequireDefault","_path","_withAndroidManifestIcons","e","__esModule","default","Colors","AndroidConfig","dpiValues","exports","mdpi","folderName","scale","hdpi","xhdpi","xxhdpi","xxxhdpi","LEGACY_BASELINE_PIXEL_SIZE","ADAPTIVE_BASELINE_PIXEL_SIZE","ANDROID_RES_PATH","MIPMAP_ANYDPI_V26","ICON_BACKGROUND","IC_LAUNCHER_WEBP","IC_LAUNCHER_ROUND_WEBP","IC_LAUNCHER_BACKGROUND_WEBP","IC_LAUNCHER_FOREGROUND_WEBP","IC_LAUNCHER_MONOCHROME_WEBP","IC_LAUNCHER_XML","IC_LAUNCHER_ROUND_XML","withAndroidIcons","config","foregroundImage","backgroundColor","backgroundImage","monochromeImage","getAdaptiveIcon","icon","getIcon","withAndroidManifestIcons","withAndroidAdaptiveIconColors","withDangerousMod","setIconAsync","modRequest","projectRoot","isAdaptive","android","adaptiveIcon","setRoundIconManifest","manifest","application","Manifest","getMainApplicationOrThrow","$","withAndroidColors","modResults","setBackgroundColor","configureLegacyIconAsync","generateRoundIconAsync","deleteIconNamedAsync","configureAdaptiveIconAsync","generateMultiLayerImageAsync","outputImageFileName","imageCacheFolder","backgroundImageCacheFolder","borderRadiusRatio","generateMonochromeImageAsync","backgroundImageFileName","icLauncherXmlString","createAdaptiveIconXmlString","createAdaptiveIconXmlFiles","colors","assignColorValue","value","name","background","iconElements","push","join","add","anyDpiV26Directory","path","resolve","fs","promises","mkdir","recursive","launcherPath","launcherRoundPath","Promise","all","writeFile","map","rm","force","iterateDpiValues","dpiFolder","iconLayer","generateIconAsync","cacheType","src","backgroundLayer","compositeImagesAsync","foreground","monochromeIcon","callback","Object","values","iconSizePx","generateImageAsync","width","height","resizeMode","borderRadius","undefined","source"],"sources":["../../../src/plugins/icons/withAndroidIcons.ts"],"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';\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};\n\nconst LEGACY_BASELINE_PIXEL_SIZE = 48;\nconst ADAPTIVE_BASELINE_PIXEL_SIZE = 108;\n\nexport const ANDROID_RES_PATH = 'android/app/src/main/res/';\nconst MIPMAP_ANYDPI_V26 = 'mipmap-anydpi-v26';\nconst ICON_BACKGROUND = 'iconBackground';\nconst IC_LAUNCHER_WEBP = 'ic_launcher.webp';\nconst IC_LAUNCHER_ROUND_WEBP = 'ic_launcher_round.webp';\nconst IC_LAUNCHER_BACKGROUND_WEBP = 'ic_launcher_background.webp';\nconst IC_LAUNCHER_FOREGROUND_WEBP = 'ic_launcher_foreground.webp';\nconst IC_LAUNCHER_MONOCHROME_WEBP = 'ic_launcher_monochrome.webp';\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, monochromeImage } =\n 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 monochromeImage,\n isAdaptive: !!config.android?.adaptiveIcon,\n });\n return config;\n },\n ]);\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\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 monochromeImage: config.android?.adaptiveIcon?.monochromeImage ?? 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 monochromeImage,\n isAdaptive,\n }: {\n icon: string | null;\n backgroundColor: string | null;\n backgroundImage: string | null;\n monochromeImage: string | null;\n isAdaptive: boolean;\n }\n) {\n if (!icon) {\n return null;\n }\n\n await configureLegacyIconAsync(projectRoot, icon, backgroundImage, backgroundColor);\n if (isAdaptive) {\n await generateRoundIconAsync(projectRoot, icon, backgroundImage, backgroundColor);\n } else {\n await deleteIconNamedAsync(projectRoot, IC_LAUNCHER_ROUND_WEBP);\n }\n await configureAdaptiveIconAsync(projectRoot, icon, backgroundImage, monochromeImage, 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 return generateMultiLayerImageAsync(projectRoot, {\n icon,\n backgroundImage,\n backgroundColor,\n outputImageFileName: IC_LAUNCHER_WEBP,\n imageCacheFolder: 'android-standard-square',\n backgroundImageCacheFolder: 'android-standard-square-background',\n });\n}\n\nasync function generateRoundIconAsync(\n projectRoot: string,\n icon: string,\n backgroundImage: string | null,\n backgroundColor: string | null\n) {\n return generateMultiLayerImageAsync(projectRoot, {\n icon,\n borderRadiusRatio: 0.5,\n outputImageFileName: IC_LAUNCHER_ROUND_WEBP,\n backgroundImage,\n backgroundColor,\n imageCacheFolder: 'android-standard-circle',\n backgroundImageCacheFolder: 'android-standard-round-background',\n isAdaptive: false,\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 monochromeImage: string | null,\n isAdaptive: boolean\n) {\n if (monochromeImage) {\n await generateMonochromeImageAsync(projectRoot, {\n icon: monochromeImage,\n imageCacheFolder: 'android-adaptive-monochrome',\n outputImageFileName: IC_LAUNCHER_MONOCHROME_WEBP,\n });\n }\n await generateMultiLayerImageAsync(projectRoot, {\n backgroundColor: 'transparent',\n backgroundImage,\n backgroundImageCacheFolder: 'android-adaptive-background',\n outputImageFileName: IC_LAUNCHER_FOREGROUND_WEBP,\n icon: foregroundImage,\n imageCacheFolder: 'android-adaptive-foreground',\n backgroundImageFileName: IC_LAUNCHER_BACKGROUND_WEBP,\n isAdaptive: true,\n });\n\n // create ic_launcher.xml and ic_launcher_round.xml\n const icLauncherXmlString = createAdaptiveIconXmlString(backgroundImage, monochromeImage);\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 = (\n backgroundImage: string | null,\n monochromeImage: string | null\n) => {\n const background = backgroundImage ? `@mipmap/ic_launcher_background` : `@color/iconBackground`;\n\n const iconElements: string[] = [\n `<background android:drawable=\"${background}\"/>`,\n '<foreground android:drawable=\"@mipmap/ic_launcher_foreground\"/>',\n ];\n\n if (monochromeImage) {\n iconElements.push('<monochrome android:drawable=\"@mipmap/ic_launcher_monochrome\"/>');\n }\n\n return `<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<adaptive-icon xmlns:android=\"http://schemas.android.com/apk/res/android\">\n ${iconElements.join('\\n ')}\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.promises.mkdir(anyDpiV26Directory, { recursive: true });\n const launcherPath = path.resolve(anyDpiV26Directory, IC_LAUNCHER_XML);\n const launcherRoundPath = path.resolve(anyDpiV26Directory, IC_LAUNCHER_ROUND_XML);\n if (add) {\n await Promise.all([\n fs.promises.writeFile(launcherPath, icLauncherXmlString, 'utf8'),\n fs.promises.writeFile(launcherRoundPath, icLauncherXmlString, 'utf8'),\n ]);\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 return fs.promises.rm(path, { force: true });\n })\n );\n }\n}\n\nasync function generateMultiLayerImageAsync(\n projectRoot: string,\n {\n icon,\n backgroundColor,\n backgroundImage,\n imageCacheFolder,\n backgroundImageCacheFolder,\n borderRadiusRatio,\n outputImageFileName,\n backgroundImageFileName,\n isAdaptive,\n }: {\n icon: string;\n backgroundImage: string | null;\n backgroundColor: string | null;\n imageCacheFolder: string;\n backgroundImageCacheFolder: string;\n backgroundImageFileName?: string;\n borderRadiusRatio?: number;\n outputImageFileName: string;\n isAdaptive?: boolean;\n }\n) {\n await iterateDpiValues(projectRoot, async ({ dpiFolder, scale }) => {\n let iconLayer = await generateIconAsync(projectRoot, {\n cacheType: imageCacheFolder,\n src: icon,\n scale,\n // backgroundImage overrides backgroundColor\n backgroundColor: backgroundImage ? 'transparent' : (backgroundColor ?? 'transparent'),\n borderRadiusRatio,\n isAdaptive,\n });\n\n if (backgroundImage) {\n const backgroundLayer = await generateIconAsync(projectRoot, {\n cacheType: backgroundImageCacheFolder,\n src: backgroundImage,\n scale,\n backgroundColor: 'transparent',\n borderRadiusRatio,\n isAdaptive,\n });\n\n if (backgroundImageFileName) {\n await fs.promises.writeFile(\n path.resolve(dpiFolder, backgroundImageFileName),\n backgroundLayer\n );\n } else {\n iconLayer = await compositeImagesAsync({\n foreground: iconLayer,\n background: backgroundLayer,\n });\n }\n } else if (backgroundImageFileName) {\n // Remove any instances of ic_launcher_background.png that are there from previous icons\n await deleteIconNamedAsync(projectRoot, backgroundImageFileName);\n }\n\n await fs.promises.mkdir(dpiFolder, { recursive: true });\n await fs.promises.writeFile(path.resolve(dpiFolder, outputImageFileName), iconLayer);\n });\n}\n\nasync function generateMonochromeImageAsync(\n projectRoot: string,\n {\n icon,\n imageCacheFolder,\n outputImageFileName,\n }: { icon: string; imageCacheFolder: string; outputImageFileName: string }\n) {\n await iterateDpiValues(projectRoot, async ({ dpiFolder, scale }) => {\n const monochromeIcon = await generateIconAsync(projectRoot, {\n cacheType: imageCacheFolder,\n src: icon,\n scale,\n backgroundColor: 'transparent',\n isAdaptive: true,\n });\n await fs.promises.mkdir(dpiFolder, { recursive: true });\n await fs.promises.writeFile(path.resolve(dpiFolder, outputImageFileName), monochromeIcon);\n });\n}\n\nfunction iterateDpiValues(\n projectRoot: string,\n callback: (value: { dpiFolder: string; folderName: string; scale: number }) => Promise<void>\n) {\n return Promise.all(\n Object.values(dpiValues).map((value) =>\n callback({\n dpiFolder: path.resolve(projectRoot, ANDROID_RES_PATH, value.folderName),\n ...value,\n })\n )\n );\n}\n\nasync function deleteIconNamedAsync(projectRoot: string, name: string) {\n return iterateDpiValues(projectRoot, ({ dpiFolder }) => {\n return fs.promises.rm(path.resolve(dpiFolder, name), { force: true });\n });\n}\n\nasync function generateIconAsync(\n projectRoot: string,\n {\n cacheType,\n src,\n scale,\n backgroundColor,\n borderRadiusRatio,\n isAdaptive,\n }: {\n cacheType: string;\n src: string;\n scale: number;\n backgroundColor: string;\n borderRadiusRatio?: number;\n isAdaptive?: boolean;\n }\n) {\n const iconSizePx =\n (isAdaptive ? ADAPTIVE_BASELINE_PIXEL_SIZE : LEGACY_BASELINE_PIXEL_SIZE) * scale;\n\n return (\n await generateImageAsync(\n { projectRoot, cacheType },\n {\n src,\n width: iconSizePx,\n height: iconSizePx,\n resizeMode: 'cover',\n backgroundColor,\n borderRadius: borderRadiusRatio ? iconSizePx * borderRadiusRatio : undefined,\n }\n )\n ).source;\n}\n"],"mappings":";;;;;;;;;;;AAAA,SAAAA,eAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,cAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAQA,SAAAE,YAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,WAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,IAAA;EAAA,MAAAH,IAAA,GAAAI,sBAAA,CAAAH,OAAA;EAAAE,GAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,MAAA;EAAA,MAAAL,IAAA,GAAAI,sBAAA,CAAAH,OAAA;EAAAI,KAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAM,0BAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,yBAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAsE,SAAAI,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEtE,MAAM;EAAEG;AAAO,CAAC,GAAGC,8BAAa;AAKzB,MAAMC,SAAiB,GAAAC,OAAA,CAAAD,SAAA,GAAG;EAC/BE,IAAI,EAAE;IAAEC,UAAU,EAAE,aAAa;IAAEC,KAAK,EAAE;EAAE,CAAC;EAC7CC,IAAI,EAAE;IAAEF,UAAU,EAAE,aAAa;IAAEC,KAAK,EAAE;EAAI,CAAC;EAC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AK;IACtD,OAAOb,aAAE,CAACC,QAAQ,CAACS,EAAE,CAACZ,eAAI,CAACC,OAAO,CAACc,SAAS,EAAEtB,IAAI,CAAC,EAAE;MAAEoB,KAAK,EAAE;IAAK,CAAC,CAAC;EACvE,CAAC,CAAC;AACJ;AAEA,eAAeI,iBAAiBA,CAC9BtD,WAAmB,EACnB;EACEuD,SAAS;EACTC,GAAG;EACHvF,KAAK;EACLoB,eAAe;EACfgC,iBAAiB;EACjBpB;AAQF,CAAC,EACD;EACA,MAAM+D,UAAU,GACd,CAAC/D,UAAU,GAAG1B,4BAA4B,GAAGD,0BAA0B,IAAIL,KAAK;EAElF,OAAO,CACL,MAAM,IAAAgG,gCAAkB,EACtB;IAAEjE,WAAW;IAAEuD;EAAU,CAAC,EAC1B;IACEC,GAAG;IACHU,KAAK,EAAEF,UAAU;IACjBG,MAAM,EAAEH,UAAU;IAClBI,UAAU,EAAE,OAAO;IACnB/E,eAAe;IACfgF,YAAY,EAAEhD,iBAAiB,GAAG2C,UAAU,GAAG3C,iBAAiB,GAAGiD;EACrE,CACF,CAAC,EACDC,MAAM;AACV","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withAndroidManifestIcons.js","names":["_configPlugins","data","require","withAndroidManifestIcons","config","withAndroidManifest","modResults","setRoundIconManifest","exports","manifest","isAdaptive","android","adaptiveIcon","application","AndroidConfig","Manifest","getMainApplicationOrThrow","$"],"sources":["../../../src/plugins/icons/withAndroidManifestIcons.ts"],"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"],"mappings":"
|
|
1
|
+
{"version":3,"file":"withAndroidManifestIcons.js","names":["_configPlugins","data","require","withAndroidManifestIcons","config","withAndroidManifest","modResults","setRoundIconManifest","exports","manifest","isAdaptive","android","adaptiveIcon","application","AndroidConfig","Manifest","getMainApplicationOrThrow","$"],"sources":["../../../src/plugins/icons/withAndroidManifestIcons.ts"],"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"],"mappings":";;;;;AAAA,SAAAA,eAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,cAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGO,MAAME,wBAAsC,GAAIC,MAAM,IAC3D,IAAAC,oCAAmB,EAACD,MAAM,EAAGA,MAAM,IAAK;EACtCA,MAAM,CAACE,UAAU,GAAGC,oBAAoB,CAACH,MAAM,EAAEA,MAAM,CAACE,UAAU,CAAC;EACnE,OAAOF,MAAM;AACf,CAAC,CAAC;AAACI,OAAA,CAAAL,wBAAA,GAAAA,wBAAA;AAEE,SAASI,oBAAoBA,CAClCH,MAAmC,EACnCK,QAAgD,EACR;EACxC,MAAMC,UAAU,GAAG,CAAC,CAACN,MAAM,CAACO,OAAO,EAAEC,YAAY;EACjD,MAAMC,WAAW,GAAGC,8BAAa,CAACC,QAAQ,CAACC,yBAAyB,CAACP,QAAQ,CAAC;EAE9E,IAAIC,UAAU,EAAE;IACdG,WAAW,CAACI,CAAC,CAAC,mBAAmB,CAAC,GAAG,2BAA2B;EAClE,CAAC,MAAM;IACL,OAAOJ,WAAW,CAACI,CAAC,CAAC,mBAAmB,CAAC;EAC3C;EACA,OAAOR,QAAQ;AACjB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withIosIcons.js","names":["_configPlugins","data","require","_Target","_imageUtils","_fs","_interopRequireDefault","_path","_AssetContents","e","__esModule","default","getProjectName","IOSConfig","XcodeUtils","IMAGE_CACHE_NAME","IMAGESET_PATH","withIosIcons","config","withDangerousMod","setIconsAsync","modRequest","projectRoot","withXcodeProject","icon","getIcons","projectName","path","extname","iconName","basename","setIconName","modResults","addIconFileToProject","exports","iosSpecificIcons","ios","paths","light","dark","tinted","filter","Boolean","iconPath","WarningAggregator","addWarningIOS","iosNamedProjectRoot","getIosNamedProjectPath","addLiquidGlassIcon","fs","promises","mkdir","join","recursive","imagesJson","baseIconPath","baseIcon","generateUniversalIconAsync","cacheKey","platform","push","darkIcon","appearance","tintedIcon","writeContentsJsonAsync","images","getAppleIconName","size","scale","name","filename","source","generateImageAsync","cacheType","src","width","height","removeTransparency","resizeMode","backgroundColor","undefined","createSquareAsync","assetPath","writeFile","idiom","appearances","value","sourceIconPath","targetIconPath","existsSync","cp","project","target","findNativeTargetByName","configurations","getBuildConfigurationsForListId","buildConfigurationList","buildSettings","ASSETCATALOG_COMPILER_APPICON_NAME","addResourceFileToGroup","filepath","groupName","isBuildFile","verbose"],"sources":["../../../src/plugins/icons/withIosIcons.ts"],"sourcesContent":["import {\n ConfigPlugin,\n IOSConfig,\n WarningAggregator,\n withDangerousMod,\n withXcodeProject,\n} from '@expo/config-plugins';\nimport { findNativeTargetByName } from '@expo/config-plugins/build/ios/Target';\nimport { ExpoConfig, IOSIcons } from '@expo/config-types';\nimport { createSquareAsync, generateImageAsync } from '@expo/image-utils';\nimport fs from 'fs';\nimport path from 'path';\n\nimport { ContentsJson, ContentsJsonImage, writeContentsJsonAsync } from './AssetContents';\n\nconst { getProjectName } = IOSConfig.XcodeUtils;\n\nconst IMAGE_CACHE_NAME = 'icons';\nconst IMAGESET_PATH = 'Images.xcassets/AppIcon.appiconset';\n\nexport const withIosIcons: ConfigPlugin = (config) => {\n config = withDangerousMod(config, [\n 'ios',\n async (config) => {\n await setIconsAsync(config, config.modRequest.projectRoot);\n return config;\n },\n ]);\n\n config = withXcodeProject(config, (config) => {\n const icon = getIcons(config);\n const projectName = config.modRequest.projectName;\n\n if (icon && typeof icon === 'string' && path.extname(icon) === '.icon' && projectName) {\n const iconName = path.basename(icon, '.icon');\n setIconName(config.modResults, projectName, iconName);\n addIconFileToProject(config.modResults, projectName, iconName);\n }\n return config;\n });\n\n return config;\n};\n\nexport function getIcons(config: Pick<ExpoConfig, 'icon' | 'ios'>): IOSIcons | string | null {\n const iosSpecificIcons = config.ios?.icon;\n\n if (iosSpecificIcons) {\n // For backwards compatibility, the icon can be a string\n if (typeof iosSpecificIcons === 'string') {\n return iosSpecificIcons || config.icon || null;\n }\n\n if (typeof iosSpecificIcons === 'object') {\n const paths = [iosSpecificIcons.light, iosSpecificIcons.dark, iosSpecificIcons.tinted].filter(\n Boolean\n );\n for (const iconPath of paths) {\n if (typeof iconPath === 'string' && path.extname(iconPath) === '.icon') {\n WarningAggregator.addWarningIOS(\n 'icon',\n `Liquid glass icons (.icon) should be provided as a string to the \"ios.icon\" property, not as an object. Found: \"${iconPath}\"`\n );\n }\n }\n }\n\n // in iOS 18 introduced the ability to specify dark and tinted icons, which users can specify as an object\n if (!iosSpecificIcons.light && !iosSpecificIcons.dark && !iosSpecificIcons.tinted) {\n return config.icon || null;\n }\n\n return iosSpecificIcons;\n }\n\n // Top level icon property should not be used to specify a `.icon` folder\n if (config.icon && typeof config.icon === 'string' && path.extname(config.icon) === '.icon') {\n WarningAggregator.addWarningIOS(\n 'icon',\n `Liquid glass icons (.icon) should be provided via the \"ios.icon\" property, not the root \"icon\" property. Found: \"${config.icon}\"`\n );\n }\n\n if (config.icon) {\n return config.icon;\n }\n\n return null;\n}\n\nexport async function setIconsAsync(config: ExpoConfig, projectRoot: string) {\n const icon = getIcons(config);\n\n if (\n !icon ||\n (typeof icon === 'string' && !icon) ||\n (typeof icon === 'object' && !icon?.light && !icon?.dark && !icon?.tinted)\n ) {\n WarningAggregator.addWarningIOS('icon', 'No icon is defined in the Expo config.');\n }\n\n // Something like projectRoot/ios/MyApp/\n const iosNamedProjectRoot = getIosNamedProjectPath(projectRoot);\n\n if (typeof icon === 'string' && path.extname(icon) === '.icon') {\n return await addLiquidGlassIcon(icon, projectRoot, iosNamedProjectRoot);\n }\n\n // Ensure the Images.xcassets/AppIcon.appiconset path exists\n await fs.promises.mkdir(path.join(iosNamedProjectRoot, IMAGESET_PATH), { recursive: true });\n\n const imagesJson: ContentsJson['images'] = [];\n\n const baseIconPath = typeof icon === 'object' ? icon?.light || icon?.dark || icon?.tinted : icon;\n\n // Store the image JSON data for assigning via the Contents.json\n const baseIcon = await generateUniversalIconAsync(projectRoot, {\n icon: baseIconPath,\n cacheKey: 'universal-icon',\n iosNamedProjectRoot,\n platform: 'ios',\n });\n\n imagesJson.push(baseIcon);\n\n if (typeof icon === 'object') {\n if (icon?.dark) {\n const darkIcon = await generateUniversalIconAsync(projectRoot, {\n icon: icon.dark,\n cacheKey: 'universal-icon-dark',\n iosNamedProjectRoot,\n platform: 'ios',\n appearance: 'dark',\n });\n\n imagesJson.push(darkIcon);\n }\n\n if (icon?.tinted) {\n const tintedIcon = await generateUniversalIconAsync(projectRoot, {\n icon: icon.tinted,\n cacheKey: 'universal-icon-tinted',\n iosNamedProjectRoot,\n platform: 'ios',\n appearance: 'tinted',\n });\n\n imagesJson.push(tintedIcon);\n }\n }\n\n // Finally, write the Contents.json\n await writeContentsJsonAsync(path.join(iosNamedProjectRoot, IMAGESET_PATH), {\n images: imagesJson,\n });\n}\n\n/**\n * Return the project's named iOS path: ios/MyProject/\n *\n * @param projectRoot Expo project root path.\n */\nfunction getIosNamedProjectPath(projectRoot: string): string {\n const projectName = getProjectName(projectRoot);\n return path.join(projectRoot, 'ios', projectName);\n}\n\nfunction getAppleIconName(size: number, scale: number, appearance?: 'dark' | 'tinted'): string {\n let name = 'App-Icon';\n\n if (appearance) {\n name = `${name}-${appearance}`;\n }\n\n name = `${name}-${size}x${size}@${scale}x.png`;\n\n return name;\n}\n\nexport async function generateUniversalIconAsync(\n projectRoot: string,\n {\n icon,\n cacheKey,\n iosNamedProjectRoot,\n platform,\n appearance,\n }: {\n platform: 'watchos' | 'ios';\n icon?: string | null;\n appearance?: 'dark' | 'tinted';\n iosNamedProjectRoot: string;\n cacheKey: string;\n }\n): Promise<ContentsJsonImage> {\n const size = 1024;\n const filename = getAppleIconName(size, 1, appearance);\n\n let source: Buffer;\n\n if (icon) {\n // Using this method will cache the images in `.expo` based on the properties used to generate them.\n // this method also supports remote URLs and using the global sharp instance.\n source = (\n await generateImageAsync(\n { projectRoot, cacheType: IMAGE_CACHE_NAME + cacheKey },\n {\n src: icon,\n name: filename,\n width: size,\n height: size,\n // Transparency needs to be preserved in dark variant, but can safely be removed in \"light\" and \"tinted\" variants.\n removeTransparency: appearance !== 'dark',\n // The icon should be square, but if it's not then it will be cropped.\n resizeMode: 'cover',\n // Force the background color to solid white to prevent any transparency. (for \"any\" and \"tinted\" variants)\n // TODO: Maybe use a more adaptive option based on the icon color?\n backgroundColor: appearance !== 'dark' ? '#ffffff' : undefined,\n }\n )\n ).source;\n } else {\n // Create a white square image if no icon exists to mitigate the chance of a submission failure to the app store.\n source = await createSquareAsync({ size });\n }\n // Write image buffer to the file system.\n const assetPath = path.join(iosNamedProjectRoot, IMAGESET_PATH, filename);\n await fs.promises.writeFile(assetPath, source);\n\n return {\n filename,\n idiom: 'universal',\n platform,\n size: `${size}x${size}`,\n ...(appearance ? { appearances: [{ appearance: 'luminosity', value: appearance }] } : {}),\n };\n}\n\nasync function addLiquidGlassIcon(\n iconPath: string,\n projectRoot: string,\n iosNamedProjectRoot: string\n): Promise<void> {\n const iconName = path.basename(iconPath, '.icon');\n const sourceIconPath = path.join(projectRoot, iconPath);\n const targetIconPath = path.join(iosNamedProjectRoot, `${iconName}.icon`);\n\n if (!fs.existsSync(sourceIconPath)) {\n WarningAggregator.addWarningIOS(\n 'icon',\n `Liquid glass icon file not found at path: ${iconPath}`\n );\n return;\n }\n\n await fs.promises.cp(sourceIconPath, targetIconPath, { recursive: true });\n}\n\n/**\n * Adds the .icons name to the project\n */\nfunction setIconName(project: any, projectName: string, iconName: string): void {\n const [, target] = findNativeTargetByName(project, projectName);\n const configurations = IOSConfig.XcodeUtils.getBuildConfigurationsForListId(\n project,\n target.buildConfigurationList\n );\n\n for (const [, config] of configurations) {\n if ((config as any)?.buildSettings) {\n (config as any).buildSettings.ASSETCATALOG_COMPILER_APPICON_NAME = iconName;\n }\n }\n}\n\n/**\n * Adds the .icon file to the project\n */\nfunction addIconFileToProject(project: any, projectName: string, iconName: string): void {\n const iconPath = `${iconName}.icon`;\n\n IOSConfig.XcodeUtils.addResourceFileToGroup({\n filepath: `${projectName}/${iconPath}`,\n groupName: projectName,\n project,\n isBuildFile: true,\n verbose: true,\n });\n}\n"],"mappings":";;;;;;;;;AAAA,SAAAA,eAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,cAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAOA,SAAAE,QAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAF,IA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D,MAAM,CAAC,GAAG,IAAAC,gCAAsB,EAACF,OAAO,EAAEjE,WAAW,CAAC;EAC/D,MAAMoE,cAAc,GAAGjF,0BAAS,CAACC,UAAU,CAACiF,+BAA+B,CACzEJ,OAAO,EACPC,MAAM,CAACI,sBACT,CAAC;EAED,KAAK,MAAM,GAAG9E,MAAM,CAAC,IAAI4E,cAAc,EAAE;IACvC,IAAK5E,MAAM,EAAU+E,aAAa,EAAE;MACjC/E,MAAM,CAAS+E,aAAa,CAACC,kCAAkC,GAAGrE,QAAQ;IAC7E;EACF;AACF;;AAEA;AACA;AACA;AACA,SAASI,oBAAoBA,CAAC0D,OAAY,EAAEjE,WAAmB,EAAEG,QAAgB,EAAQ;EACvF,MAAMc,QAAQ,GAAG,GAAGd,QAAQ,OAAO;EAEnChB,0BAAS,CAACC,UAAU,CAACqF,sBAAsB,CAAC;IAC1CC,QAAQ,EAAE,GAAG1E,WAAW,IAAIiB,QAAQ,EAAE;IACtC0D,SAAS,EAAE3E,WAAW;IACtBiE,OAAO;IACPW,WAAW,EAAE,IAAI;IACjBC,OAAO,EAAE;EACX,CAAC,CAAC;AACJ","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"withIosIcons.js","names":["_configPlugins","data","require","_Target","_imageUtils","_fs","_interopRequireDefault","_path","_AssetContents","e","__esModule","default","getProjectName","IOSConfig","XcodeUtils","IMAGE_CACHE_NAME","IMAGESET_PATH","withIosIcons","config","withDangerousMod","setIconsAsync","modRequest","projectRoot","withXcodeProject","icon","getIcons","projectName","path","extname","iconName","basename","setIconName","modResults","addIconFileToProject","exports","iosSpecificIcons","ios","paths","light","dark","tinted","filter","Boolean","iconPath","WarningAggregator","addWarningIOS","iosNamedProjectRoot","getIosNamedProjectPath","addLiquidGlassIcon","fs","promises","mkdir","join","recursive","imagesJson","baseIconPath","baseIcon","generateUniversalIconAsync","cacheKey","platform","push","darkIcon","appearance","tintedIcon","writeContentsJsonAsync","images","getAppleIconName","size","scale","name","filename","source","generateImageAsync","cacheType","src","width","height","removeTransparency","resizeMode","backgroundColor","undefined","createSquareAsync","assetPath","writeFile","idiom","appearances","value","sourceIconPath","targetIconPath","existsSync","cp","project","target","findNativeTargetByName","configurations","getBuildConfigurationsForListId","buildConfigurationList","buildSettings","ASSETCATALOG_COMPILER_APPICON_NAME","addResourceFileToGroup","filepath","groupName","isBuildFile","verbose"],"sources":["../../../src/plugins/icons/withIosIcons.ts"],"sourcesContent":["import {\n ConfigPlugin,\n IOSConfig,\n WarningAggregator,\n withDangerousMod,\n withXcodeProject,\n} from '@expo/config-plugins';\nimport { findNativeTargetByName } from '@expo/config-plugins/build/ios/Target';\nimport { ExpoConfig, IOSIcons } from '@expo/config-types';\nimport { createSquareAsync, generateImageAsync } from '@expo/image-utils';\nimport fs from 'fs';\nimport path from 'path';\n\nimport { ContentsJson, ContentsJsonImage, writeContentsJsonAsync } from './AssetContents';\n\nconst { getProjectName } = IOSConfig.XcodeUtils;\n\nconst IMAGE_CACHE_NAME = 'icons';\nconst IMAGESET_PATH = 'Images.xcassets/AppIcon.appiconset';\n\nexport const withIosIcons: ConfigPlugin = (config) => {\n config = withDangerousMod(config, [\n 'ios',\n async (config) => {\n await setIconsAsync(config, config.modRequest.projectRoot);\n return config;\n },\n ]);\n\n config = withXcodeProject(config, (config) => {\n const icon = getIcons(config);\n const projectName = config.modRequest.projectName;\n\n if (icon && typeof icon === 'string' && path.extname(icon) === '.icon' && projectName) {\n const iconName = path.basename(icon, '.icon');\n setIconName(config.modResults, projectName, iconName);\n addIconFileToProject(config.modResults, projectName, iconName);\n }\n return config;\n });\n\n return config;\n};\n\nexport function getIcons(config: Pick<ExpoConfig, 'icon' | 'ios'>): IOSIcons | string | null {\n const iosSpecificIcons = config.ios?.icon;\n\n if (iosSpecificIcons) {\n // For backwards compatibility, the icon can be a string\n if (typeof iosSpecificIcons === 'string') {\n return iosSpecificIcons || config.icon || null;\n }\n\n if (typeof iosSpecificIcons === 'object') {\n const paths = [iosSpecificIcons.light, iosSpecificIcons.dark, iosSpecificIcons.tinted].filter(\n Boolean\n );\n for (const iconPath of paths) {\n if (typeof iconPath === 'string' && path.extname(iconPath) === '.icon') {\n WarningAggregator.addWarningIOS(\n 'icon',\n `Liquid glass icons (.icon) should be provided as a string to the \"ios.icon\" property, not as an object. Found: \"${iconPath}\"`\n );\n }\n }\n }\n\n // in iOS 18 introduced the ability to specify dark and tinted icons, which users can specify as an object\n if (!iosSpecificIcons.light && !iosSpecificIcons.dark && !iosSpecificIcons.tinted) {\n return config.icon || null;\n }\n\n return iosSpecificIcons;\n }\n\n // Top level icon property should not be used to specify a `.icon` folder\n if (config.icon && typeof config.icon === 'string' && path.extname(config.icon) === '.icon') {\n WarningAggregator.addWarningIOS(\n 'icon',\n `Liquid glass icons (.icon) should be provided via the \"ios.icon\" property, not the root \"icon\" property. Found: \"${config.icon}\"`\n );\n }\n\n if (config.icon) {\n return config.icon;\n }\n\n return null;\n}\n\nexport async function setIconsAsync(config: ExpoConfig, projectRoot: string) {\n const icon = getIcons(config);\n\n if (\n !icon ||\n (typeof icon === 'string' && !icon) ||\n (typeof icon === 'object' && !icon?.light && !icon?.dark && !icon?.tinted)\n ) {\n WarningAggregator.addWarningIOS('icon', 'No icon is defined in the Expo config.');\n }\n\n // Something like projectRoot/ios/MyApp/\n const iosNamedProjectRoot = getIosNamedProjectPath(projectRoot);\n\n if (typeof icon === 'string' && path.extname(icon) === '.icon') {\n return await addLiquidGlassIcon(icon, projectRoot, iosNamedProjectRoot);\n }\n\n // Ensure the Images.xcassets/AppIcon.appiconset path exists\n await fs.promises.mkdir(path.join(iosNamedProjectRoot, IMAGESET_PATH), { recursive: true });\n\n const imagesJson: ContentsJson['images'] = [];\n\n const baseIconPath = typeof icon === 'object' ? icon?.light || icon?.dark || icon?.tinted : icon;\n\n // Store the image JSON data for assigning via the Contents.json\n const baseIcon = await generateUniversalIconAsync(projectRoot, {\n icon: baseIconPath,\n cacheKey: 'universal-icon',\n iosNamedProjectRoot,\n platform: 'ios',\n });\n\n imagesJson.push(baseIcon);\n\n if (typeof icon === 'object') {\n if (icon?.dark) {\n const darkIcon = await generateUniversalIconAsync(projectRoot, {\n icon: icon.dark,\n cacheKey: 'universal-icon-dark',\n iosNamedProjectRoot,\n platform: 'ios',\n appearance: 'dark',\n });\n\n imagesJson.push(darkIcon);\n }\n\n if (icon?.tinted) {\n const tintedIcon = await generateUniversalIconAsync(projectRoot, {\n icon: icon.tinted,\n cacheKey: 'universal-icon-tinted',\n iosNamedProjectRoot,\n platform: 'ios',\n appearance: 'tinted',\n });\n\n imagesJson.push(tintedIcon);\n }\n }\n\n // Finally, write the Contents.json\n await writeContentsJsonAsync(path.join(iosNamedProjectRoot, IMAGESET_PATH), {\n images: imagesJson,\n });\n}\n\n/**\n * Return the project's named iOS path: ios/MyProject/\n *\n * @param projectRoot Expo project root path.\n */\nfunction getIosNamedProjectPath(projectRoot: string): string {\n const projectName = getProjectName(projectRoot);\n return path.join(projectRoot, 'ios', projectName);\n}\n\nfunction getAppleIconName(size: number, scale: number, appearance?: 'dark' | 'tinted'): string {\n let name = 'App-Icon';\n\n if (appearance) {\n name = `${name}-${appearance}`;\n }\n\n name = `${name}-${size}x${size}@${scale}x.png`;\n\n return name;\n}\n\nexport async function generateUniversalIconAsync(\n projectRoot: string,\n {\n icon,\n cacheKey,\n iosNamedProjectRoot,\n platform,\n appearance,\n }: {\n platform: 'watchos' | 'ios';\n icon?: string | null;\n appearance?: 'dark' | 'tinted';\n iosNamedProjectRoot: string;\n cacheKey: string;\n }\n): Promise<ContentsJsonImage> {\n const size = 1024;\n const filename = getAppleIconName(size, 1, appearance);\n\n let source: Buffer;\n\n if (icon) {\n // Using this method will cache the images in `.expo` based on the properties used to generate them.\n // this method also supports remote URLs and using the global sharp instance.\n source = (\n await generateImageAsync(\n { projectRoot, cacheType: IMAGE_CACHE_NAME + cacheKey },\n {\n src: icon,\n name: filename,\n width: size,\n height: size,\n // Transparency needs to be preserved in dark variant, but can safely be removed in \"light\" and \"tinted\" variants.\n removeTransparency: appearance !== 'dark',\n // The icon should be square, but if it's not then it will be cropped.\n resizeMode: 'cover',\n // Force the background color to solid white to prevent any transparency. (for \"any\" and \"tinted\" variants)\n // TODO: Maybe use a more adaptive option based on the icon color?\n backgroundColor: appearance !== 'dark' ? '#ffffff' : undefined,\n }\n )\n ).source;\n } else {\n // Create a white square image if no icon exists to mitigate the chance of a submission failure to the app store.\n source = await createSquareAsync({ size });\n }\n // Write image buffer to the file system.\n const assetPath = path.join(iosNamedProjectRoot, IMAGESET_PATH, filename);\n await fs.promises.writeFile(assetPath, source);\n\n return {\n filename,\n idiom: 'universal',\n platform,\n size: `${size}x${size}`,\n ...(appearance ? { appearances: [{ appearance: 'luminosity', value: appearance }] } : {}),\n };\n}\n\nasync function addLiquidGlassIcon(\n iconPath: string,\n projectRoot: string,\n iosNamedProjectRoot: string\n): Promise<void> {\n const iconName = path.basename(iconPath, '.icon');\n const sourceIconPath = path.join(projectRoot, iconPath);\n const targetIconPath = path.join(iosNamedProjectRoot, `${iconName}.icon`);\n\n if (!fs.existsSync(sourceIconPath)) {\n WarningAggregator.addWarningIOS(\n 'icon',\n `Liquid glass icon file not found at path: ${iconPath}`\n );\n return;\n }\n\n await fs.promises.cp(sourceIconPath, targetIconPath, { recursive: true });\n}\n\n/**\n * Adds the .icons name to the project\n */\nfunction setIconName(project: any, projectName: string, iconName: string): void {\n const [, target] = findNativeTargetByName(project, projectName);\n const configurations = IOSConfig.XcodeUtils.getBuildConfigurationsForListId(\n project,\n target.buildConfigurationList\n );\n\n for (const [, config] of configurations) {\n if ((config as any)?.buildSettings) {\n (config as any).buildSettings.ASSETCATALOG_COMPILER_APPICON_NAME = iconName;\n }\n }\n}\n\n/**\n * Adds the .icon file to the project\n */\nfunction addIconFileToProject(project: any, projectName: string, iconName: string): void {\n const iconPath = `${iconName}.icon`;\n\n IOSConfig.XcodeUtils.addResourceFileToGroup({\n filepath: `${projectName}/${iconPath}`,\n groupName: projectName,\n project,\n isB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CAA6CF,QAAQ,EACvD,CAAC;IACD;EACF;EAEA,MAAMM,aAAE,CAACC,QAAQ,CAACwC,EAAE,CAACH,cAAc,EAAEC,cAAc,EAAE;IAAEnC,SAAS,EAAE;EAAK,CAAC,CAAC;AAC3E;;AAEA;AACA;AACA;AACA,SAAStB,WAAWA,CAAC4D,OAAY,EAAEjE,WAAmB,EAAEG,QAAgB,EAAQ;EAC9E,MAAM,GAAG+D,MAAM,CAAC,GAAG,IAAAC,gCAAsB,EAACF,OAAO,EAAEjE,WAAW,CAAC;EAC/D,MAAMoE,cAAc,GAAGjF,0BAAS,CAACC,UAAU,CAACiF,+BAA+B,CACzEJ,OAAO,EACPC,MAAM,CAACI,sBACT,CAAC;EAED,KAAK,MAAM,GAAG9E,MAAM,CAAC,IAAI4E,cAAc,EAAE;IACvC,IAAK5E,MAAM,EAAU+E,aAAa,EAAE;MACjC/E,MAAM,CAAS+E,aAAa,CAACC,kCAAkC,GAAGrE,QAAQ;IAC7E;EACF;AACF;;AAEA;AACA;AACA;AACA,SAASI,oBAAoBA,CAAC0D,OAAY,EAAEjE,WAAmB,EAAEG,QAAgB,EAAQ;EACvF,MAAMc,QAAQ,GAAG,GAAGd,QAAQ,OAAO;EAEnChB,0BAAS,CAACC,UAAU,CAACqF,sBAAsB,CAAC;IAC1CC,QAAQ,EAAE,GAAG1E,WAAW,IAAIiB,QAAQ,EAAE;IACtC0D,SAAS,EAAE3E,WAAW;IACtBiE,OAAO;IACPW,WAAW,EAAE,IAAI;IACjBC,OAAO,EAAE;EACX,CAAC,CAAC;AACJ","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReactNative77CompatPlugin.js","names":["_configPlugins","data","require","_jsonFile","_interopRequireDefault","_resolveFrom","_semver","e","__esModule","default","withSdk52ReactNative77CompatAndroid","config","withProjectBuildGradle","sdkVersion","reactNativeVersion","queryReactNativeVersionAsync","modRequest","projectRoot","semver","lt","modResults","language","contents","setProjectBuildGradle","WarningAggregator","addWarningAndroid","exports","kotlinVersion","newContents","replace","ndkVersion","packageJsonPath","resolveFrom","silent","packageJson","JsonFile","readAsync","version","parse"],"sources":["../../../src/plugins/sdk52/ReactNative77CompatPlugin.ts"],"sourcesContent":["import { withProjectBuildGradle, WarningAggregator, type ConfigPlugin } from '@expo/config-plugins';\nimport JsonFile from '@expo/json-file';\nimport resolveFrom from 'resolve-from';\nimport semver from 'semver';\n\n// TODO(kudo,20241112): Remove this plugin when we drop support for SDK 52.\nexport const withSdk52ReactNative77CompatAndroid: ConfigPlugin = (config) => {\n return withProjectBuildGradle(config, async (config) => {\n if (config.sdkVersion !== '52.0.0') {\n return config;\n }\n const reactNativeVersion = await queryReactNativeVersionAsync(config.modRequest.projectRoot);\n if (!reactNativeVersion || semver.lt(reactNativeVersion, '0.77.0')) {\n return config;\n }\n\n if (config.modResults.language === 'groovy') {\n config.modResults.contents = setProjectBuildGradle(config.modResults.contents);\n } else {\n WarningAggregator.addWarningAndroid(\n 'ReactNative77CompatPlugin',\n `Cannot automatically configure project build.gradle if it's not groovy`\n );\n }\n return config;\n });\n};\n\nfunction setProjectBuildGradle(contents: string): string {\n // Update kotlinVersion\n const kotlinVersion = '2.0.21';\n let newContents = contents.replace(\n /\\b(kotlinVersion\\s*=\\s*findProperty\\('android.kotlinVersion'\\)\\s*\\?: ['\"])(1\\.9\\.\\d+)(['\"])/g,\n `$1${kotlinVersion}$3`\n );\n\n // Update ndkVersion\n const ndkVersion = '27.1.12297006';\n newContents = newContents.replace(\n /\\b(ndkVersion\\s*=\\s*['\"])(26.1.10909125)(['\"])/g,\n `$1${ndkVersion}$3`\n );\n\n return newContents;\n}\n\nasync function queryReactNativeVersionAsync(projectRoot: string): Promise<semver.SemVer | null> {\n const packageJsonPath = resolveFrom.silent(projectRoot, 'react-native/package.json');\n if (packageJsonPath) {\n const packageJson = await JsonFile.readAsync(packageJsonPath);\n const version = packageJson.version;\n if (typeof version === 'string') {\n return semver.parse(version);\n }\n }\n return null;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ReactNative77CompatPlugin.js","names":["_configPlugins","data","require","_jsonFile","_interopRequireDefault","_resolveFrom","_semver","e","__esModule","default","withSdk52ReactNative77CompatAndroid","config","withProjectBuildGradle","sdkVersion","reactNativeVersion","queryReactNativeVersionAsync","modRequest","projectRoot","semver","lt","modResults","language","contents","setProjectBuildGradle","WarningAggregator","addWarningAndroid","exports","kotlinVersion","newContents","replace","ndkVersion","packageJsonPath","resolveFrom","silent","packageJson","JsonFile","readAsync","version","parse"],"sources":["../../../src/plugins/sdk52/ReactNative77CompatPlugin.ts"],"sourcesContent":["import { withProjectBuildGradle, WarningAggregator, type ConfigPlugin } from '@expo/config-plugins';\nimport JsonFile from '@expo/json-file';\nimport resolveFrom from 'resolve-from';\nimport semver from 'semver';\n\n// TODO(kudo,20241112): Remove this plugin when we drop support for SDK 52.\nexport const withSdk52ReactNative77CompatAndroid: ConfigPlugin = (config) => {\n return withProjectBuildGradle(config, async (config) => {\n if (config.sdkVersion !== '52.0.0') {\n return config;\n }\n const reactNativeVersion = await queryReactNativeVersionAsync(config.modRequest.projectRoot);\n if (!reactNativeVersion || semver.lt(reactNativeVersion, '0.77.0')) {\n return config;\n }\n\n if (config.modResults.language === 'groovy') {\n config.modResults.contents = setProjectBuildGradle(config.modResults.contents);\n } else {\n WarningAggregator.addWarningAndroid(\n 'ReactNative77CompatPlugin',\n `Cannot automatically configure project build.gradle if it's not groovy`\n );\n }\n return config;\n });\n};\n\nfunction setProjectBuildGradle(contents: string): string {\n // Update kotlinVersion\n const kotlinVersion = '2.0.21';\n let newContents = contents.replace(\n /\\b(kotlinVersion\\s*=\\s*findProperty\\('android.kotlinVersion'\\)\\s*\\?: ['\"])(1\\.9\\.\\d+)(['\"])/g,\n `$1${kotlinVersion}$3`\n );\n\n // Update ndkVersion\n const ndkVersion = '27.1.12297006';\n newContents = newContents.replace(\n /\\b(ndkVersion\\s*=\\s*['\"])(26.1.10909125)(['\"])/g,\n `$1${ndkVersion}$3`\n );\n\n return newContents;\n}\n\nasync function queryReactNativeVersionAsync(projectRoot: string): Promise<semver.SemVer | null> {\n const packageJsonPath = resolveFrom.silent(projectRoot, 'react-native/package.json');\n if (packageJsonPath) {\n const packageJson = await JsonFile.readAsync(packageJsonPath);\n const version = packageJson.version;\n if (typeof version === 'string') {\n return semver.parse(version);\n }\n }\n return null;\n}\n"],"mappings":";;;;AAAA,SAAAA,eAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,cAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,UAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,SAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,aAAA;EAAA,MAAAJ,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAG,YAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,QAAA;EAAA,MAAAL,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAI,OAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA4B,SAAAG,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE5B;AACO,MAAMG,mCAAiD,GAAIC,MAAM,IAAK;EAC3E,OAAO,IAAAC,uCAAsB,EAACD,MAAM,EAAE,MAAOA,MAAM,IAAK;IACtD,IAAIA,MAAM,CAACE,UAAU,KAAK,QAAQ,EAAE;MAClC,OAAOF,MAAM;IACf;IACA,MAAMG,kBAAkB,GAAG,MAAMC,4BAA4B,CAACJ,MAAM,CAACK,UAAU,CAACC,WAAW,CAAC;IAC5F,IAAI,CAACH,kBAAkB,IAA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","_jsonFile","_interopRequireDefault","_resolveFrom","_semver","e","__esModule","default","cachedIsTargetSdkVersion","undefined","withSdk52ReactNative78CompatAndroid","config","withSdk52ReactNative78CompatAndroidAppGradle","withSdk52ReactNative78CompatAndroidProjectGradle","exports","withAppBuildGradle","isTargetSdkVersionAsync","modRequest","projectRoot","sdkVersion","modResults","contents","replace","withProjectBuildGradle","reactNativeVersion","queryReactNativeVersionAsync","semver","gte","packageJsonPath","resolveFrom","silent","packageJson","JsonFile","readAsync","version","parse"],"sources":["../../../src/plugins/sdk52/ReactNative78CompatPlugin.ts"],"sourcesContent":["import {\n withAppBuildGradle,\n withProjectBuildGradle,\n type ConfigPlugin,\n} from '@expo/config-plugins';\nimport JsonFile from '@expo/json-file';\nimport resolveFrom from 'resolve-from';\nimport semver from 'semver';\n\nlet cachedIsTargetSdkVersion: boolean | undefined = undefined;\n\n// TODO(kudo,20241210): Remove this plugin when we drop support for SDK 52.\nexport const withSdk52ReactNative78CompatAndroid: ConfigPlugin = (config) => {\n config = withSdk52ReactNative78CompatAndroidAppGradle(config);\n config = withSdk52ReactNative78CompatAndroidProjectGradle(config);\n return config;\n};\n\nconst withSdk52ReactNative78CompatAndroidAppGradle: ConfigPlugin = (config) => {\n return withAppBuildGradle(config, async (config) => {\n if (!(await isTargetSdkVersionAsync(config.modRequest.projectRoot, config.sdkVersion))) {\n return config;\n }\n config.modResults.contents = config.modResults.contents.replace(\n /jscFlavor = ['\"]org\\.webkit:android-jsc(-intl)?:\\+['\"]/gm,\n `jscFlavor = 'io.github.react-native-community:jsc-android$1:2026004.+'`\n );\n return config;\n });\n};\n\nconst withSdk52ReactNative78CompatAndroidProjectGradle: ConfigPlugin = (config) => {\n return withProjectBuildGradle(config, async (config) => {\n if (!(await isTargetSdkVersionAsync(config.modRequest.projectRoot, config.sdkVersion))) {\n return config;\n }\n config.modResults.contents = config.modResults.contents.replace(\n /\\ndef jscAndroidDir = new File\\([\\s\\S]+?^\\)\\n/gm,\n ''\n );\n config.modResults.contents = config.modResults.contents.replace(\n /^\\s+maven \\{\\n\\s+\\/\\/ Android JSC.*\\n\\s+url\\(jscAndroidDir\\)[\\s\\S]+?\\}\\n/gm,\n ''\n );\n return config;\n });\n};\n\nasync function isTargetSdkVersionAsync(\n projectRoot: string,\n sdkVersion: string | undefined\n): Promise<boolean> {\n if (cachedIsTargetSdkVersion !== undefined) {\n return cachedIsTargetSdkVersion;\n }\n\n cachedIsTargetSdkVersion = false;\n if (sdkVersion === '52.0.0') {\n const reactNativeVersion = await queryReactNativeVersionAsync(projectRoot);\n if (reactNativeVersion && semver.gte(reactNativeVersion, '0.78.0')) {\n cachedIsTargetSdkVersion = true;\n }\n }\n return cachedIsTargetSdkVersion;\n}\n\nasync function queryReactNativeVersionAsync(projectRoot: string): Promise<semver.SemVer | null> {\n const packageJsonPath = resolveFrom.silent(projectRoot, 'react-native/package.json');\n if (packageJsonPath) {\n const packageJson = await JsonFile.readAsync(packageJsonPath);\n const version = packageJson.version;\n if (typeof version === 'string') {\n return semver.parse(version);\n }\n }\n return null;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ReactNative78CompatPlugin.js","names":["_configPlugins","data","require","_jsonFile","_interopRequireDefault","_resolveFrom","_semver","e","__esModule","default","cachedIsTargetSdkVersion","undefined","withSdk52ReactNative78CompatAndroid","config","withSdk52ReactNative78CompatAndroidAppGradle","withSdk52ReactNative78CompatAndroidProjectGradle","exports","withAppBuildGradle","isTargetSdkVersionAsync","modRequest","projectRoot","sdkVersion","modResults","contents","replace","withProjectBuildGradle","reactNativeVersion","queryReactNativeVersionAsync","semver","gte","packageJsonPath","resolveFrom","silent","packageJson","JsonFile","readAsync","version","parse"],"sources":["../../../src/plugins/sdk52/ReactNative78CompatPlugin.ts"],"sourcesContent":["import {\n withAppBuildGradle,\n withProjectBuildGradle,\n type ConfigPlugin,\n} from '@expo/config-plugins';\nimport JsonFile from '@expo/json-file';\nimport resolveFrom from 'resolve-from';\nimport semver from 'semver';\n\nlet cachedIsTargetSdkVersion: boolean | undefined = undefined;\n\n// TODO(kudo,20241210): Remove this plugin when we drop support for SDK 52.\nexport const withSdk52ReactNative78CompatAndroid: ConfigPlugin = (config) => {\n config = withSdk52ReactNative78CompatAndroidAppGradle(config);\n config = withSdk52ReactNative78CompatAndroidProjectGradle(config);\n return config;\n};\n\nconst withSdk52ReactNative78CompatAndroidAppGradle: ConfigPlugin = (config) => {\n return withAppBuildGradle(config, async (config) => {\n if (!(await isTargetSdkVersionAsync(config.modRequest.projectRoot, config.sdkVersion))) {\n return config;\n }\n config.modResults.contents = config.modResults.contents.replace(\n /jscFlavor = ['\"]org\\.webkit:android-jsc(-intl)?:\\+['\"]/gm,\n `jscFlavor = 'io.github.react-native-community:jsc-android$1:2026004.+'`\n );\n return config;\n });\n};\n\nconst withSdk52ReactNative78CompatAndroidProjectGradle: ConfigPlugin = (config) => {\n return withProjectBuildGradle(config, async (config) => {\n if (!(await isTargetSdkVersionAsync(config.modRequest.projectRoot, config.sdkVersion))) {\n return config;\n }\n config.modResults.contents = config.modResults.contents.replace(\n /\\ndef jscAndroidDir = new File\\([\\s\\S]+?^\\)\\n/gm,\n ''\n );\n config.modResults.contents = config.modResults.contents.replace(\n /^\\s+maven \\{\\n\\s+\\/\\/ Android JSC.*\\n\\s+url\\(jscAndroidDir\\)[\\s\\S]+?\\}\\n/gm,\n ''\n );\n return config;\n });\n};\n\nasync function isTargetSdkVersionAsync(\n projectRoot: string,\n sdkVersion: string | undefined\n): Promise<boolean> {\n if (cachedIsTargetSdkVersion !== undefined) {\n return cachedIsTargetSdkVersion;\n }\n\n cachedIsTargetSdkVersion = false;\n if (sdkVersion === '52.0.0') {\n const reactNativeVersion = await queryReactNativeVersionAsync(projectRoot);\n if (reactNativeVersion && semver.gte(reactNativeVersion, '0.78.0')) {\n cachedIsTargetSdkVersion = true;\n }\n }\n return cachedIsTargetSdkVersion;\n}\n\nasync function queryReactNativeVersionAsync(projectRoot: string): Promise<semver.SemVer | null> {\n const packageJsonPath = resolveFrom.silent(projectRoot, 'react-native/package.json');\n if (packageJsonPath) {\n const packageJson = await JsonFile.readAsync(packageJsonPath);\n const version = packageJson.version;\n if (typeof version === 'string') {\n return semver.parse(version);\n }\n }\n return null;\n}\n"],"mappings":";;;;AAAA,SAAAA,eAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,cAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAKA,SAAAE,UAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,SAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,aAAA;EAAA,MAAAJ,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAG,YAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,QAAA;EAAA,MAAAL,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAI,OAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA4B,SAAAG,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE5B,IAAIG,wBAA6C,GAAGC,SAAS;;AAE7D;AACO,MAAMC,mCAAiD,GAAIC,MAAM,IAAK;EAC3EA,MAAM,GAAGC,4CAA4C,CAACD,MAAM,CAAC;EAC7DA,MAAM,GAAGE,gDAAgD,CAACF,MAAM,CAAC;EACjE,OAAOA,MAAM;AACf,CAAC;AAACG,OAAA,CAAAJ,mCAAA,GAAAA,mCAAA;AAEF,MAAME,4CAA0D,GAAID,MAAM,IAAK;EAC7E,OAAO,IAAAI,mCAAkB,EAACJ,MAAM,EAAE,MAAOA,MAAM,IAAK;IAClD,IAAI,EAAE,MAAMK,uBAAuB,CAACL,MA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CAACP,WAAmB,EAAiC;EAC9F,MAAMU,eAAe,GAAGC,sBAAW,CAACC,MAAM,CAACZ,WAAW,EAAE,2BAA2B,CAAC;EACpF,IAAIU,eAAe,EAAE;IACnB,MAAMG,WAAW,GAAG,MAAMC,mBAAQ,CAACC,SAAS,CAACL,eAAe,CAAC;IAC7D,MAAMM,OAAO,GAAGH,WAAW,CAACG,OAAO;IACnC,IAAI,OAAOA,OAAO,KAAK,QAAQ,EAAE;MAC/B,OAAOR,iBAAM,CAACS,KAAK,CAACD,OAAO,CAAC;IAC9B;EACF;EACA,OAAO,IAAI;AACb","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createLegacyPlugin.js","names":["_configPlugins","data","require","toCamelCase","s","replace","x","toUpperCase","isModuleExcluded","config","packageName","_internal","autolinkedModules","includes","createLegacyPlugin","fallback","withFallback","Array","isArray","withPlugins","withUnknown","createRunOncePlugin","withStaticPlugin","_isLegacyPlugin","plugin","methodName","Object","defineProperty","value"],"sources":["../../../src/plugins/unversioned/createLegacyPlugin.ts"],"sourcesContent":["import {\n ConfigPlugin,\n createRunOncePlugin,\n PluginParameters,\n withPlugins,\n withStaticPlugin,\n} from '@expo/config-plugins';\nimport { ExpoConfig } from '@expo/config-types';\n\nconst toCamelCase = (s: string) => s.replace(/-./g, (x) => x.toUpperCase()[1]);\n\nfunction isModuleExcluded(config: Pick<ExpoConfig, '_internal'>, packageName: string): boolean {\n // Skip using the versioned plugin when autolinking is enabled\n // and doesn't link the native module.\n return (\n config._internal?.autolinkedModules && !config._internal.autolinkedModules.includes(packageName)\n );\n}\n\nexport function createLegacyPlugin({\n packageName,\n fallback,\n}: {\n packageName: string;\n fallback: ConfigPlugin | PluginParameters<typeof withPlugins>;\n}): ConfigPlugin {\n let withFallback: ConfigPlugin;\n\n if (Array.isArray(fallback)) {\n withFallback = (config) => withPlugins(config, fallback);\n } else {\n withFallback = fallback;\n }\n\n const withUnknown: ConfigPlugin = (config) => {\n // Skip using the versioned plugin when autolinking is enabled\n // and doesn't link the native module.\n if (isModuleExcluded(config, packageName)) {\n return createRunOncePlugin(withFallback, packageName)(config);\n }\n\n return withStaticPlugin(config, {\n _isLegacyPlugin: true,\n plugin: packageName,\n // If the static plugin isn't found, use the unversioned one.\n fallback: createRunOncePlugin(withFallback, packageName),\n });\n };\n\n const methodName = toCamelCase(`with-${packageName}`);\n Object.defineProperty(withUnknown, 'name', {\n value: methodName,\n });\n\n return withUnknown;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"createLegacyPlugin.js","names":["_configPlugins","data","require","toCamelCase","s","replace","x","toUpperCase","isModuleExcluded","config","packageName","_internal","autolinkedModules","includes","createLegacyPlugin","fallback","withFallback","Array","isArray","withPlugins","withUnknown","createRunOncePlugin","withStaticPlugin","_isLegacyPlugin","plugin","methodName","Object","defineProperty","value"],"sources":["../../../src/plugins/unversioned/createLegacyPlugin.ts"],"sourcesContent":["import {\n ConfigPlugin,\n createRunOncePlugin,\n PluginParameters,\n withPlugins,\n withStaticPlugin,\n} from '@expo/config-plugins';\nimport { ExpoConfig } from '@expo/config-types';\n\nconst toCamelCase = (s: string) => s.replace(/-./g, (x) => x.toUpperCase()[1]);\n\nfunction isModuleExcluded(config: Pick<ExpoConfig, '_internal'>, packageName: string): boolean {\n // Skip using the versioned plugin when autolinking is enabled\n // and doesn't link the native module.\n return (\n config._internal?.autolinkedModules && !config._internal.autolinkedModules.includes(packageName)\n );\n}\n\nexport function createLegacyPlugin({\n packageName,\n fallback,\n}: {\n packageName: string;\n fallback: ConfigPlugin | PluginParameters<typeof withPlugins>;\n}): ConfigPlugin {\n let withFallback: ConfigPlugin;\n\n if (Array.isArray(fallback)) {\n withFallback = (config) => withPlugins(config, fallback);\n } else {\n withFallback = fallback;\n }\n\n const withUnknown: ConfigPlugin = (config) => {\n // Skip using the versioned plugin when autolinking is enabled\n // and doesn't link the native module.\n if (isModuleExcluded(config, packageName)) {\n return createRunOncePlugin(withFallback, packageName)(config);\n }\n\n return withStaticPlugin(config, {\n _isLegacyPlugin: true,\n plugin: packageName,\n // If the static plugin isn't found, use the unversioned one.\n fallback: createRunOncePlugin(withFallback, packageName),\n });\n };\n\n const methodName = toCamelCase(`with-${packageName}`);\n Object.defineProperty(withUnknown, 'name', {\n value: methodName,\n });\n\n return withUnknown;\n}\n"],"mappings":";;;;AAAA,SAAAA,eAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,cAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AASA,MAAME,WAAW,GAAIC,CAAS,IAAKA,CAAC,CAACC,OAAO,CAAC,KAAK,EAAGC,CAAC,IAAKA,CAAC,CAACC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAE9E,SAASC,gBAAgBA,CAACC,MAAqC,EAAEC,WAAmB,EAAW;EAC7F;EACA;EACA,OACED,MAAM,CAACE,SAAS,EAAEC,iBAAiB,IAAI,CAACH,MAAM,CAACE,SAAS,CAACC,iBAAiB,CAACC,QAAQ,CAACH,WAAW,CAAC;AAEpG;AAEO,SAASI,kBAAkBA,CAAC;EACjCJ,WAAW;EACXK;AAIF,CAAC,EAAgB;EACf,IAAIC,YAA0B;EAE9B,IAAIC,KAAK,CAACC,OAAO,CAACH,QAAQ,CAAC,EAAE;IAC3BC,YAAY,GAAIP,MAAM,IAAK,IAAAU,4BAAW,EAACV,MAAM,EAAEM,QAAQ,CAAC;EAC1D,CAAC,MAAM;IACLC,YAAY,GAAGD,QAAQ;EACzB;EAEA,MAAMK,WAAyB,GAAIX,MAAM,IAAK;IAC5C;IACA;IACA,IAAID,gBAAgB,CAACC,MAAM,EAAEC,WAAW,CAAC,EAAE;MACzC,OAAO,IAAAW,oCAAmB,EAACL,YAAY,EAAEN,WAAW,CAAC,CAACD,MAAM,CAAC;IAC/D;IAEA,OAAO,IAAAa,iCAAgB,EAACb,MAAM,EAAE;MAC9Bc,eAAe,EAAE,IAAI;MACrBC,MAAM,EAAEd,WAAW;MACnB;MACAK,QAAQ,EAAE,IAAAM,oCAAmB,EAACL,YAAY,EAAEN,WAAW;IACzD,CAAC,CAAC;EACJ,CAAC;EAED,MAAMe,UAAU,GAAGtB,WAAW,CAAC,QAAQO,WAAW,EAAE,CAAC;EACrDgB,MAAM,CAACC,cAAc,CAACP,WAAW,EAAE,MAAM,EAAE;IACzCQ,KAAK,EAAEH;EACT,CAAC,CAAC;EAEF,OAAOL,WAAW;AACpB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withEdgeToEdge.js","names":["_configPlugins","data","require","_withRestoreDefaultTheme","TAG","withEdgeToEdge","config","applyEdgeToEdge","exports","android","WarningAggregator","addWarningAndroid","withRestoreDefaultTheme","_default","default"],"sources":["../../../../src/plugins/unversioned/edge-to-edge/withEdgeToEdge.ts"],"sourcesContent":["import {\n ConfigPlugin,\n ExportedConfigWithProps,\n WarningAggregator,\n AndroidConfig,\n} from '@expo/config-plugins';\nimport { type ExpoConfig } from '@expo/config-types';\n\nimport { withRestoreDefaultTheme } from './withRestoreDefaultTheme';\n\nconst TAG = 'EDGE_TO_EDGE_PLUGIN';\n\nexport type ResourceXMLConfig = ExportedConfigWithProps<AndroidConfig.Resources.ResourceXML>;\n\nexport const withEdgeToEdge: ConfigPlugin = (config) => {\n return applyEdgeToEdge(config);\n};\n\nexport function applyEdgeToEdge(config: ExpoConfig): ExpoConfig {\n if ('edgeToEdgeEnabled' in (config.android ?? {})) {\n WarningAggregator.addWarningAndroid(\n TAG,\n '`edgeToEdgeEnabled` customization is no longer available - Android 16 makes edge-to-edge mandatory. Remove the `edgeToEdgeEnabled` entry from your app.json/app.config.js.'\n );\n }\n\n // We always restore the default theme in case the project has a leftover react-native-edge-to-edge theme from SDK 53.\n // If they are using react-native-edge-to-edge config plugin it'll be reapplied later.\n return withRestoreDefaultTheme(config);\n}\n\nexport default withEdgeToEdge;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"withEdgeToEdge.js","names":["_configPlugins","data","require","_withRestoreDefaultTheme","TAG","withEdgeToEdge","config","applyEdgeToEdge","exports","android","WarningAggregator","addWarningAndroid","withRestoreDefaultTheme","_default","default"],"sources":["../../../../src/plugins/unversioned/edge-to-edge/withEdgeToEdge.ts"],"sourcesContent":["import {\n ConfigPlugin,\n ExportedConfigWithProps,\n WarningAggregator,\n AndroidConfig,\n} from '@expo/config-plugins';\nimport { type ExpoConfig } from '@expo/config-types';\n\nimport { withRestoreDefaultTheme } from './withRestoreDefaultTheme';\n\nconst TAG = 'EDGE_TO_EDGE_PLUGIN';\n\nexport type ResourceXMLConfig = ExportedConfigWithProps<AndroidConfig.Resources.ResourceXML>;\n\nexport const withEdgeToEdge: ConfigPlugin = (config) => {\n return applyEdgeToEdge(config);\n};\n\nexport function applyEdgeToEdge(config: ExpoConfig): ExpoConfig {\n if ('edgeToEdgeEnabled' in (config.android ?? {})) {\n WarningAggregator.addWarningAndroid(\n TAG,\n '`edgeToEdgeEnabled` customization is no longer available - Android 16 makes edge-to-edge mandatory. Remove the `edgeToEdgeEnabled` entry from your app.json/app.config.js.'\n );\n }\n\n // We always restore the default theme in case the project has a leftover react-native-edge-to-edge theme from SDK 53.\n // If they are using react-native-edge-to-edge config plugin it'll be reapplied later.\n return withRestoreDefaultTheme(config);\n}\n\nexport default withEdgeToEdge;\n"],"mappings":";;;;;AAAA,SAAAA,eAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,cAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAQA,SAAAE,yBAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,wBAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,MAAMG,GAAG,GAAG,qBAAqB;AAI1B,MAAMC,cAA4B,GAAIC,MAAM,IAAK;EACtD,OAAOC,eAAe,CAACD,MAAM,CAAC;AAChC,CAAC;AAACE,OAAA,CAAAH,cAAA,GAAAA,cAAA;AAEK,SAASE,eAAeA,CAACD,MAAkB,EAAc;EAC9D,IAAI,mBAAmB,KAAKA,MAAM,CAACG,OAAO,IAAI,CAAC,CAAC,CAAC,EAAE;IACjDC,kCAAiB,CAACC,iBAAiB,CACjCP,GAAG,EACH,4KACF,CAAC;EACH;;EAEA;EACA;EACA,OAAO,IAAAQ,kDAAuB,EAACN,MAAM,CAAC;AACxC;AAAC,IAAAO,QAAA,GAAAL,OAAA,CAAAM,OAAA,GAEcT,cAAc","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withRestoreDefaultTheme.js","names":["_configPlugins","data","require","withRestoreDefaultTheme","config","withAndroidStyles","restoreDefaultTheme","exports","DEFAULT_THEME","style","modResults","resources","mainThemeIndex","findIndex","$","name","parent","includes","item","filter"],"sources":["../../../../src/plugins/unversioned/edge-to-edge/withRestoreDefaultTheme.ts"],"sourcesContent":["import { ConfigPlugin, withAndroidStyles } from '@expo/config-plugins';\n\nimport { ResourceXMLConfig } from './withEdgeToEdge';\n\nexport const withRestoreDefaultTheme: ConfigPlugin = (config) => {\n // Default theme for SDK 53 and onwards projects\n return withAndroidStyles(config, (config) => {\n return restoreDefaultTheme(config);\n });\n};\n\nexport function restoreDefaultTheme(config: ResourceXMLConfig): ResourceXMLConfig {\n const DEFAULT_THEME = 'Theme.AppCompat.DayNight.NoActionBar';\n\n const { style = [] } = config.modResults.resources;\n const mainThemeIndex = style.findIndex(({ $ }) => $.name === 'AppTheme');\n if (mainThemeIndex === -1) {\n return config;\n }\n\n if (style[mainThemeIndex].$?.parent.includes('EdgeToEdge')) {\n config.modResults.resources.style = [\n {\n $: {\n name: 'AppTheme',\n parent: DEFAULT_THEME,\n },\n item: style[mainThemeIndex].item,\n },\n ...style.filter(({ $ }) => $.name !== 'AppTheme'),\n ];\n }\n return config;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"withRestoreDefaultTheme.js","names":["_configPlugins","data","require","withRestoreDefaultTheme","config","withAndroidStyles","restoreDefaultTheme","exports","DEFAULT_THEME","style","modResults","resources","mainThemeIndex","findIndex","$","name","parent","includes","item","filter"],"sources":["../../../../src/plugins/unversioned/edge-to-edge/withRestoreDefaultTheme.ts"],"sourcesContent":["import { ConfigPlugin, withAndroidStyles } from '@expo/config-plugins';\n\nimport { ResourceXMLConfig } from './withEdgeToEdge';\n\nexport const withRestoreDefaultTheme: ConfigPlugin = (config) => {\n // Default theme for SDK 53 and onwards projects\n return withAndroidStyles(config, (config) => {\n return restoreDefaultTheme(config);\n });\n};\n\nexport function restoreDefaultTheme(config: ResourceXMLConfig): ResourceXMLConfig {\n const DEFAULT_THEME = 'Theme.AppCompat.DayNight.NoActionBar';\n\n const { style = [] } = config.modResults.resources;\n const mainThemeIndex = style.findIndex(({ $ }) => $.name === 'AppTheme');\n if (mainThemeIndex === -1) {\n return config;\n }\n\n if (style[mainThemeIndex].$?.parent.includes('EdgeToEdge')) {\n config.modResults.resources.style = [\n {\n $: {\n name: 'AppTheme',\n parent: DEFAULT_THEME,\n },\n item: style[mainThemeIndex].item,\n },\n ...style.filter(({ $ }) => $.name !== 'AppTheme'),\n ];\n }\n return config;\n}\n"],"mappings":";;;;;AAAA,SAAAA,eAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,cAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAIO,MAAME,uBAAqC,GAAIC,MAAM,IAAK;EAC/D;EACA,OAAO,IAAAC,kCAAiB,EAACD,MAAM,EAAGA,MAAM,IAAK;IAC3C,OAAOE,mBAAmB,CAACF,MAAM,CAAC;EACpC,CAAC,CAAC;AACJ,CAAC;AAACG,OAAA,CAAAJ,uBAAA,GAAAA,uBAAA;AAEK,SAASG,mBAAmBA,CAACF,MAAyB,EAAqB;EAChF,MAAMI,aAAa,GAAG,sCAAsC;EAE5D,MAAM;IAAEC,KAAK,GAAG;EAAG,CAAC,GAAGL,MAAM,CAACM,UAAU,CAACC,SAAS;EAClD,MAAMC,cAAc,GAAGH,KAAK,CAACI,SAAS,CAAC,CAAC;IAAEC;EAAE,CAAC,KAAKA,CAAC,CAACC,IAAI,KAAK,UAAU,CAAC;EACxE,IAAIH,cAAc,KAAK,CAAC,CAAC,EAAE;IACzB,OAAOR,MAAM;EACf;EAEA,IAAIK,KAAK,CAACG,cAAc,CAAC,CAACE,CAAC,EAAEE,MAAM,CAACC,QAAQ,CAAC,YAAY,CAAC,EAAE;IAC1Db,MAAM,CAACM,UAAU,CAACC,SAAS,CAACF,KAAK,GAAG,CAClC;MACEK,CAAC,EAAE;QACDC,IAAI,EAAE,UAAU;QAChBC,MAAM,EAAER;MACV,CAAC;MACDU,IAAI,EAAET,KAAK,CAACG,cAAc,CAAC,CAACM;IAC9B,CAAC,EACD,GAAGT,KAAK,CAACU,MAAM,CAAC,CAAC;MAAEL;IAAE,CAAC,KAAKA,CAAC,CAACC,IAAI,KAAK,UAAU,CAAC,CAClD;EACH;EACA,OAAOX,MAAM;AACf","ignoreList":[]}
|