@expo/prebuild-config 6.7.0 → 6.7.2
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.map +1 -1
- package/build/importExpoModulesAutolinking.js.map +1 -1
- package/build/plugins/icons/AssetContents.js.map +1 -1
- package/build/plugins/icons/withAndroidIcons.js.map +1 -1
- package/build/plugins/icons/withIosIcons.js.map +1 -1
- package/build/plugins/unversioned/createLegacyPlugin.js.map +1 -1
- package/build/plugins/unversioned/expo-ads-admob/withAndroidAdMob.js.map +1 -1
- package/build/plugins/unversioned/expo-apple-authentication.js.map +1 -1
- package/build/plugins/unversioned/expo-document-picker.js +0 -1
- package/build/plugins/unversioned/expo-document-picker.js.map +1 -1
- package/build/plugins/unversioned/expo-navigation-bar/withAndroidNavigationBar.js.map +1 -1
- package/build/plugins/unversioned/expo-notifications/withAndroidNotifications.js.map +1 -1
- package/build/plugins/unversioned/expo-splash-screen/InterfaceBuilder.js.map +1 -1
- package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashImages.js.map +1 -1
- package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashLegacyMainActivity.js.map +1 -1
- package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashScreen.js.map +1 -1
- package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashStrings.js.map +1 -1
- package/build/plugins/unversioned/expo-splash-screen/withIosSplashAssets.js.map +1 -1
- package/build/plugins/unversioned/expo-splash-screen/withIosSplashInfoPlist.js.map +1 -1
- package/build/plugins/unversioned/expo-splash-screen/withIosSplashScreenStoryboard.js.map +1 -1
- package/build/plugins/unversioned/expo-splash-screen/withIosSplashXcodeProject.js.map +1 -1
- package/build/plugins/unversioned/expo-splash-screen/wtihIosSplashScreenStoryboardImage.js.map +1 -1
- package/build/plugins/unversioned/expo-system-ui/withAndroidRootViewBackgroundColor.js.map +1 -1
- package/build/plugins/unversioned/expo-system-ui/withAndroidUserInterfaceStyle.js.map +1 -1
- package/build/plugins/unversioned/expo-system-ui/withIosRootViewBackgroundColor.js.map +1 -1
- package/build/plugins/unversioned/expo-system-ui/withIosUserInterfaceStyle.js.map +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getAutolinkedPackages.js","names":["_importExpoModulesAutolinking","data","require","getAutolinkedPackagesAsync","projectRoot","platforms","autolinking","importExpoModulesAutolinking","searchPaths","resolveSearchPathsAsync","platformPaths","Promise","all","map","platform","findModulesAsync","silent","resolvePackagesList","allPlatformPaths","paths","Object","keys","flat","uniquePaths","Set","sort","shouldSkipAutoPlugin","config","plugin","_config$_internal","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';\n\nimport { importExpoModulesAutolinking } from './importExpoModulesAutolinking';\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 autolinking = importExpoModulesAutolinking(projectRoot);\n const searchPaths = await autolinking.resolveSearchPathsAsync(null, projectRoot);\n\n const platformPaths = await Promise.all(\n platforms.map((platform) =>\n autolinking.findModulesAsync({\n projectRoot,\n platform,\n searchPaths,\n silent: true,\n })\n )\n );\n\n return resolvePackagesList(platformPaths);\n}\n\nexport function resolvePackagesList(platformPaths: Record<string, any>[]) {\n const allPlatformPaths = platformPaths.map((paths) => Object.keys(paths)).flat();\n\n const uniquePaths = [...new Set(allPlatformPaths)];\n\n return uniquePaths.sort();\n}\n\nexport function shouldSkipAutoPlugin(\n config: Pick<ExpoConfig, '_internal'>,\n plugin: StaticPlugin | string\n) {\n // Hack workaround because expo-dev-client doesn't use expo modules.\n if (plugin === 'expo-dev-client') {\n return false;\n }\n\n // Only perform the check if `autolinkedModules` is defined, otherwise we assume\n // this is a legacy runner which doesn't support autolinking.\n if (Array.isArray(config._internal?.autolinkedModules)) {\n // Resolve the pluginId as a string.\n const pluginId = Array.isArray(plugin) ? plugin[0] : plugin;\n if (typeof pluginId === 'string') {\n // Determine if the autolinked modules list includes our moduleId\n const isIncluded = config._internal!.autolinkedModules.includes(pluginId);\n if (!isIncluded) {\n // If it doesn't then we know that any potential plugin shouldn't be applied automatically.\n return true;\n }\n }\n }\n return false;\n}\n"],"mappings":";;;;;;;;AAGA,SAAAA,8BAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,6BAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,eAAeE,0BAA0BA,CAC9CC,WAAmB,EACnBC,SAAwB,GAAG,CAAC,KAAK,EAAE,SAAS,CAAC,EAC7C;EACA,MAAMC,WAAW,GAAG,IAAAC,4DAA4B,EAACH,WAAW,CAAC;EAC7D,MAAMI,WAAW,GAAG,MAAMF,WAAW,CAACG,uBAAuB,CAAC,IAAI,EAAEL,WAAW,CAAC;EAEhF,MAAMM,aAAa,GAAG,MAAMC,OAAO,CAACC,GAAG,CACrCP,SAAS,CAACQ,GAAG,CAAEC,QAAQ,IACrBR,WAAW,CAACS,gBAAgB,CAAC;IAC3BX,WAAW;IACXU,QAAQ;IACRN,WAAW;IACXQ,MAAM,EAAE;EACV,CAAC,
|
|
1
|
+
{"version":3,"file":"getAutolinkedPackages.js","names":["_importExpoModulesAutolinking","data","require","getAutolinkedPackagesAsync","projectRoot","platforms","autolinking","importExpoModulesAutolinking","searchPaths","resolveSearchPathsAsync","platformPaths","Promise","all","map","platform","findModulesAsync","silent","resolvePackagesList","allPlatformPaths","paths","Object","keys","flat","uniquePaths","Set","sort","shouldSkipAutoPlugin","config","plugin","_config$_internal","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';\n\nimport { importExpoModulesAutolinking } from './importExpoModulesAutolinking';\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 autolinking = importExpoModulesAutolinking(projectRoot);\n const searchPaths = await autolinking.resolveSearchPathsAsync(null, projectRoot);\n\n const platformPaths = await Promise.all(\n platforms.map((platform) =>\n autolinking.findModulesAsync({\n projectRoot,\n platform,\n searchPaths,\n silent: true,\n })\n )\n );\n\n return resolvePackagesList(platformPaths);\n}\n\nexport function resolvePackagesList(platformPaths: Record<string, any>[]) {\n const allPlatformPaths = platformPaths.map((paths) => Object.keys(paths)).flat();\n\n const uniquePaths = [...new Set(allPlatformPaths)];\n\n return uniquePaths.sort();\n}\n\nexport function shouldSkipAutoPlugin(\n config: Pick<ExpoConfig, '_internal'>,\n plugin: StaticPlugin | string\n) {\n // Hack workaround because expo-dev-client doesn't use expo modules.\n if (plugin === 'expo-dev-client') {\n return false;\n }\n\n // Only perform the check if `autolinkedModules` is defined, otherwise we assume\n // this is a legacy runner which doesn't support autolinking.\n if (Array.isArray(config._internal?.autolinkedModules)) {\n // Resolve the pluginId as a string.\n const pluginId = Array.isArray(plugin) ? plugin[0] : plugin;\n if (typeof pluginId === 'string') {\n // Determine if the autolinked modules list includes our moduleId\n const isIncluded = config._internal!.autolinkedModules.includes(pluginId);\n if (!isIncluded) {\n // If it doesn't then we know that any potential plugin shouldn't be applied automatically.\n return true;\n }\n }\n }\n return false;\n}\n"],"mappings":";;;;;;;;AAGA,SAAAA,8BAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,6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C,OAAO,CAACH,MAAM,CAAC,GAAGA,MAAM,CAAC,CAAC,CAAC,GAAGA,MAAM;IAC3D,IAAI,OAAOM,QAAQ,KAAK,QAAQ,EAAE;MAChC;MACA,MAAMC,UAAU,GAAGR,MAAM,CAACK,SAAS,CAAEC,iBAAiB,CAACG,QAAQ,CAACF,QAAQ,CAAC;MACzE,IAAI,CAACC,UAAU,EAAE;QACf;QACA,OAAO,IAAI;MACb;IACF;EACF;EACA,OAAO,KAAK;AACd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"importExpoModulesAutolinking.js","names":["importExpoModulesAutolinking","projectRoot","autolinking","tryRequireExpoModulesAutolinking","assertAutolinkingCompatibility","resolvedAutolinkingPath","resolveOptions","paths","require","resolve","Error"],"sources":["../src/importExpoModulesAutolinking.ts"],"sourcesContent":["export type SearchResults = {\n [moduleName: string]: object;\n};\n\nexport type SearchOptions = {\n searchPaths: string[];\n platform: 'ios' | 'android' | 'web';\n silent?: boolean;\n};\n\ntype AutolinkingModule = typeof import('expo-modules-autolinking/exports');\n\n/**\n * Imports the `expo-modules-autolinking` package installed in the project at the given path.\n */\nexport function importExpoModulesAutolinking(projectRoot: string): AutolinkingModule {\n const autolinking = tryRequireExpoModulesAutolinking(projectRoot);\n assertAutolinkingCompatibility(autolinking);\n return autolinking;\n}\n\nfunction tryRequireExpoModulesAutolinking(projectRoot: string): AutolinkingModule {\n let resolvedAutolinkingPath;\n const resolveOptions = { paths: [projectRoot] };\n\n try {\n resolvedAutolinkingPath = require.resolve('expo-modules-autolinking/exports', resolveOptions);\n } catch {}\n // Fallback to the older version of expo-modules-autolinking\n try {\n resolvedAutolinkingPath = require.resolve(\n 'expo-modules-autolinking/build/autolinking',\n resolveOptions\n );\n } catch {}\n\n if (!resolvedAutolinkingPath) {\n throw new Error(\n \"Cannot find 'expo-modules-autolinking' package in your project, make sure that you have 'expo' package installed\"\n );\n }\n return require(resolvedAutolinkingPath);\n}\n\nfunction assertAutolinkingCompatibility(autolinking: AutolinkingModule): void {\n if ('resolveSearchPathsAsync' in autolinking && 'findModulesAsync' in autolinking) {\n return;\n }\n throw new Error(\n \"The 'expo-modules-autolinking' package has been found, but it seems to be incompatible with '@expo/prebuild-config'\"\n );\n}\n"],"mappings":";;;;;;AAYA;AACA;AACA;AACO,SAASA,4BAA4BA,CAACC,WAAmB,EAAqB;EACnF,MAAMC,WAAW,GAAGC,gCAAgC,CAACF,WAAW,CAAC;EACjEG,8BAA8B,CAACF,WAAW,CAAC;EAC3C,OAAOA,WAAW;AACpB;AAEA,SAASC,gCAAgCA,CAACF,WAAmB,EAAqB;EAChF,IAAII,uBAAuB;EAC3B,MAAMC,cAAc,GAAG;IAAEC,KAAK,EAAE,CAACN,WAAW;EAAE,CAAC;EAE/C,IAAI;IACFI,uBAAuB,GAAGG,OAAO,CAACC,OAAO,CAAC,kCAAkC,EAAEH,cAAc,CAAC;EAC/F,CAAC,CAAC,MAAM,CAAC;EACT;EACA,IAAI;IACFD,uBAAuB,GAAGG,OAAO,CAACC,OAAO,CACvC,4CAA4C,EAC5CH,
|
|
1
|
+
{"version":3,"file":"importExpoModulesAutolinking.js","names":["importExpoModulesAutolinking","projectRoot","autolinking","tryRequireExpoModulesAutolinking","assertAutolinkingCompatibility","resolvedAutolinkingPath","resolveOptions","paths","require","resolve","Error"],"sources":["../src/importExpoModulesAutolinking.ts"],"sourcesContent":["export type SearchResults = {\n [moduleName: string]: object;\n};\n\nexport type SearchOptions = {\n searchPaths: string[];\n platform: 'ios' | 'android' | 'web';\n silent?: boolean;\n};\n\ntype AutolinkingModule = typeof import('expo-modules-autolinking/exports');\n\n/**\n * Imports the `expo-modules-autolinking` package installed in the project at the given path.\n */\nexport function importExpoModulesAutolinking(projectRoot: string): AutolinkingModule {\n const autolinking = tryRequireExpoModulesAutolinking(projectRoot);\n assertAutolinkingCompatibility(autolinking);\n return autolinking;\n}\n\nfunction tryRequireExpoModulesAutolinking(projectRoot: string): AutolinkingModule {\n let resolvedAutolinkingPath;\n const resolveOptions = { paths: [projectRoot] };\n\n try {\n resolvedAutolinkingPath = require.resolve('expo-modules-autolinking/exports', resolveOptions);\n } catch {}\n // Fallback to the older version of expo-modules-autolinking\n try {\n resolvedAutolinkingPath = require.resolve(\n 'expo-modules-autolinking/build/autolinking',\n resolveOptions\n );\n } catch {}\n\n if (!resolvedAutolinkingPath) {\n throw new Error(\n \"Cannot find 'expo-modules-autolinking' package in your project, make sure that you have 'expo' package installed\"\n );\n }\n return require(resolvedAutolinkingPath);\n}\n\nfunction assertAutolinkingCompatibility(autolinking: AutolinkingModule): void {\n if ('resolveSearchPathsAsync' in autolinking && 'findModulesAsync' in autolinking) {\n return;\n }\n throw new Error(\n \"The 'expo-modules-autolinking' package has been found, but it seems to be incompatible with '@expo/prebuild-config'\"\n );\n}\n"],"mappings":";;;;;;AAYA;AACA;AACA;AACO,SAASA,4BAA4BA,CAACC,WAAmB,EAAqB;EACnF,MAAMC,WAAW,GAAGC,gCAAgC,CAACF,WAAW,CAAC;EACjEG,8BAA8B,CAACF,WAAW,CAAC;EAC3C,OAAOA,WAAW;AACpB;AAEA,SAASC,gCAAgCA,CAACF,WAAmB,EAAqB;EAChF,IAAII,uBAAuB;EAC3B,MAAMC,cAAc,GAAG;IAAEC,KAAK,EAAE,CAACN,WAAW;EAAE,CAAC;EAE/C,IAAI;IACFI,uBAAuB,GAAGG,OAAO,CAACC,OAAO,CAAC,kCAAkC,EAAEH,cAAc,CAAC;EAC/F,CAAC,CAAC,MAAM,CAAC;EACT;EACA,IAAI;IACFD,uBAAuB,GAAGG,OAAO,CAACC,OAAO,CACvC,4CAA4C,EAC5CH,cACF,CAAC;EACH,CAAC,CAAC,MAAM,CAAC;EAET,IAAI,CAACD,uBAAuB,EAAE;IAC5B,MAAM,IAAIK,KAAK,CACb,kHACF,CAAC;EACH;EACA,OAAOF,OAAO,CAACH,uBAAuB,CAAC;AACzC;AAEA,SAASD,8BAA8BA,CAACF,WAA8B,EAAQ;EAC5E,IAAI,yBAAyB,IAAIA,WAAW,IAAI,kBAAkB,IAAIA,WAAW,EAAE;IACjF;EACF;EACA,MAAM,IAAIQ,KAAK,CACb,qHACF,CAAC;AACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssetContents.js","names":["_fsExtra","data","_interopRequireDefault","require","_path","obj","__esModule","default","createContentsJsonItem","item","writeContentsJsonAsync","directory","images","fs","ensureDir","writeFile","join","JSON","stringify","info","version","author"],"sources":["../../../src/plugins/icons/AssetContents.ts"],"sourcesContent":["import fs from 'fs-extra';\nimport { join } from 'path';\n\nexport type ContentsJsonImageIdiom =\n | 'iphone'\n | 'ipad'\n | 'watchos'\n | 'ios'\n | 'ios-marketing'\n | 'universal';\n\nexport type ContentsJsonImageAppearance = {\n appearance: 'luminosity';\n value: 'dark';\n};\n\nexport type ContentsJsonImageScale = '1x' | '2x' | '3x';\n\nexport interface ContentsJsonImage {\n appearances?: ContentsJsonImageAppearance[];\n idiom: ContentsJsonImageIdiom;\n size?: string;\n scale?: ContentsJsonImageScale;\n filename?: string;\n platform?: ContentsJsonImageIdiom;\n}\n\nexport interface ContentsJson {\n images: ContentsJsonImage[];\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.ensureDir(directory);\n\n await fs.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,SAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,QAAA,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,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAkCrB,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,kBAAE,CAACC,SAAS,CAACH,SAAS,CAAC;EAE7B,MAAME,kBAAE,CAACE,SAAS,CAChB,IAAAC,YAAI,EAACL,SAAS,EAAE,eAAe,CAAC,EAChCM,IAAI,CAACC,SAAS,CACZ;IACEN,MAAM;IACNO,IAAI,EAAE;MACJC,OAAO,EAAE,CAAC;MACV;MACAC,MAAM,EAAE;IACV;EACF,CAAC,EACD,IAAI,EACJ,
|
|
1
|
+
{"version":3,"file":"AssetContents.js","names":["_fsExtra","data","_interopRequireDefault","require","_path","obj","__esModule","default","createContentsJsonItem","item","writeContentsJsonAsync","directory","images","fs","ensureDir","writeFile","join","JSON","stringify","info","version","author"],"sources":["../../../src/plugins/icons/AssetContents.ts"],"sourcesContent":["import fs from 'fs-extra';\nimport { join } from 'path';\n\nexport type ContentsJsonImageIdiom =\n | 'iphone'\n | 'ipad'\n | 'watchos'\n | 'ios'\n | 'ios-marketing'\n | 'universal';\n\nexport type ContentsJsonImageAppearance = {\n appearance: 'luminosity';\n value: 'dark';\n};\n\nexport type ContentsJsonImageScale = '1x' | '2x' | '3x';\n\nexport interface ContentsJsonImage {\n appearances?: ContentsJsonImageAppearance[];\n idiom: ContentsJsonImageIdiom;\n size?: string;\n scale?: ContentsJsonImageScale;\n filename?: string;\n platform?: ContentsJsonImageIdiom;\n}\n\nexport interface ContentsJson {\n images: ContentsJsonImage[];\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.ensureDir(directory);\n\n await fs.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,SAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,QAAA,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,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAkCrB,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,kBAAE,CAACC,SAAS,CAACH,SAAS,CAAC;EAE7B,MAAME,kBAAE,CAACE,SAAS,CAChB,IAAAC,YAAI,EAACL,SAAS,EAAE,eAAe,CAAC,EAChCM,IAAI,CAACC,SAAS,CACZ;IACEN,MAAM;IACNO,IAAI,EAAE;MACJC,OAAO,EAAE,CAAC;MACV;MACAC,MAAM,EAAE;IACV;EACF,CAAC,EACD,IAAI,EACJ,CACF,CACF,CAAC;AACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withAndroidIcons.js","names":["_configPlugins","data","require","_imageUtils","_fsExtra","_interopRequireDefault","_path","_withAndroidManifestIcons","obj","__esModule","default","Colors","AndroidConfig","dpiValues","mdpi","folderName","scale","hdpi","xhdpi","xxhdpi","xxxhdpi","exports","BASELINE_PIXEL_SIZE","ANDROID_RES_PATH","MIPMAP_ANYDPI_V26","ICON_BACKGROUND","IC_LAUNCHER_PNG","IC_LAUNCHER_ROUND_PNG","IC_LAUNCHER_BACKGROUND_PNG","IC_LAUNCHER_FOREGROUND_PNG","IC_LAUNCHER_MONOCHROME_PNG","IC_LAUNCHER_XML","IC_LAUNCHER_ROUND_XML","withAndroidIcons","config","foregroundImage","backgroundColor","backgroundImage","monochromeImage","getAdaptiveIcon","icon","getIcon","withAndroidManifestIcons","withAndroidAdaptiveIconColors","withDangerousMod","_config$android","setIconAsync","modRequest","projectRoot","isAdaptive","android","adaptiveIcon","setRoundIconManifest","manifest","_config$android2","application","Manifest","getMainApplicationOrThrow","$","withAndroidColors","modResults","setBackgroundColor","_config$android3","_config$android$adapt","_config$android4","_config$android4$adap","_config$android$adapt2","_config$android5","_config$android5$adap","_config$android$adapt3","_config$android6","_config$android6$adap","_config$android$adapt4","_config$android7","_config$android7$adap","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","ensureDir","launcherPath","launcherRoundPath","Promise","all","writeFile","map","existsSync","remove","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-extra';\nimport path from 'path';\n\nimport { withAndroidManifestIcons } from './withAndroidManifestIcons';\n\nconst { Colors } = AndroidConfig;\n\ntype DPIString = 'mdpi' | 'hdpi' | 'xhdpi' | 'xxhdpi' | 'xxxhdpi';\ntype dpiMap = Record<DPIString, { folderName: string; scale: number }>;\n\nexport const dpiValues: dpiMap = {\n mdpi: { folderName: 'mipmap-mdpi', scale: 1 },\n hdpi: { folderName: 'mipmap-hdpi', scale: 1.5 },\n xhdpi: { folderName: 'mipmap-xhdpi', scale: 2 },\n xxhdpi: { folderName: 'mipmap-xxhdpi', scale: 3 },\n xxxhdpi: { folderName: 'mipmap-xxxhdpi', scale: 4 },\n};\nconst BASELINE_PIXEL_SIZE = 108;\nexport const ANDROID_RES_PATH = 'android/app/src/main/res/';\nconst MIPMAP_ANYDPI_V26 = 'mipmap-anydpi-v26';\nconst ICON_BACKGROUND = 'iconBackground';\nconst IC_LAUNCHER_PNG = 'ic_launcher.png';\nconst IC_LAUNCHER_ROUND_PNG = 'ic_launcher_round.png';\nconst IC_LAUNCHER_BACKGROUND_PNG = 'ic_launcher_background.png';\nconst IC_LAUNCHER_FOREGROUND_PNG = 'ic_launcher_foreground.png';\nconst IC_LAUNCHER_MONOCHROME_PNG = 'ic_launcher_monochrome.png';\nconst IC_LAUNCHER_XML = 'ic_launcher.xml';\nconst IC_LAUNCHER_ROUND_XML = 'ic_launcher_round.xml';\n\nexport const withAndroidIcons: ConfigPlugin = (config) => {\n const { foregroundImage, backgroundColor, backgroundImage, 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_PNG);\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_PNG,\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_PNG,\n backgroundImage,\n backgroundColor,\n imageCacheFolder: 'android-standard-circle',\n backgroundImageCacheFolder: 'android-standard-round-background',\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_PNG,\n });\n }\n await generateMultiLayerImageAsync(projectRoot, {\n backgroundColor: 'transparent',\n backgroundImage,\n backgroundImageCacheFolder: 'android-adaptive-background',\n outputImageFileName: IC_LAUNCHER_FOREGROUND_PNG,\n icon: foregroundImage,\n imageCacheFolder: 'android-adaptive-foreground',\n backgroundImageFileName: IC_LAUNCHER_BACKGROUND_PNG,\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.ensureDir(anyDpiV26Directory);\n const launcherPath = path.resolve(anyDpiV26Directory, IC_LAUNCHER_XML);\n const launcherRoundPath = path.resolve(anyDpiV26Directory, IC_LAUNCHER_ROUND_XML);\n if (add) {\n await Promise.all([\n fs.writeFile(launcherPath, icLauncherXmlString),\n fs.writeFile(launcherRoundPath, icLauncherXmlString),\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 if (fs.existsSync(path)) {\n return fs.remove(path);\n }\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 }: {\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 }\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 });\n\n if (backgroundImage) {\n const backgroundLayer = await generateIconAsync(projectRoot, {\n cacheType: backgroundImageCacheFolder,\n src: backgroundImage,\n scale,\n backgroundColor: 'transparent',\n borderRadiusRatio,\n });\n\n if (backgroundImageFileName) {\n await fs.writeFile(path.resolve(dpiFolder, backgroundImageFileName), backgroundLayer);\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.ensureDir(dpiFolder);\n await fs.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 });\n await fs.ensureDir(dpiFolder);\n await fs.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.remove(path.resolve(dpiFolder, name));\n });\n}\n\nasync function generateIconAsync(\n projectRoot: string,\n {\n cacheType,\n src,\n scale,\n backgroundColor,\n borderRadiusRatio,\n }: {\n cacheType: string;\n src: string;\n scale: number;\n backgroundColor: string;\n borderRadiusRatio?: number;\n }\n) {\n const iconSizePx = 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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QAAQ,CAAC;IACPT,SAAS,EAAEb,eAAI,CAACC,OAAO,CAACpD,WAAW,EAAEzB,gBAAgB,EAAEoE,KAAK,CAAC5E,UAAU,CAAC;IACxE,GAAG4E;EACL,CAAC,CAAC,CACH,CACF;AACH;AAEA,eAAed,oBAAoBA,CAAC7B,WAAmB,EAAE4C,IAAY,EAAE;EACrE,OAAOmB,gBAAgB,CAAC/D,WAAW,EAAE,CAAC;IAAEgE;EAAU,CAAC,KAAK;IACtD,OAAOX,kBAAE,CAACS,MAAM,CAACX,eAAI,CAACC,OAAO,CAACY,SAAS,EAAEpB,IAAI,CAAC,CAAC;EACjD,CAAC,CAAC;AACJ;AAEA,eAAesB,iBAAiBA,CAC9BlE,WAAmB,EACnB;EACEmE,SAAS;EACTC,GAAG;EACHpG,KAAK;EACLoB,eAAe;EACf+C;AAOF,CAAC,EACD;EACA,MAAMyC,UAAU,GAAGtG,mBAAmB,GAAGN,KAAK;EAE9C,OAAO,CACL,MAAM,IAAA6G,gCAAkB,EACtB;IAAE7E,WAAW;IAAEmE;EAAU,CAAC,EAC1B;IACEC,GAAG;IACHU,KAAK,EAAEF,UAAU;IACjBG,MAAM,EAAEH,UAAU;IAClBI,UAAU,EAAE,OAAO;IACnB5F,eAAe;IACf6F,YAAY,EAAE9C,iBAAiB,GAAGyC,UAAU,GAAGzC,iBAAiB,GAAG+C;EACrE,CAAC,CACF,EACDC,MAAM;AACV"}
|
|
1
|
+
{"version":3,"file":"withAndroidIcons.js","names":["_configPlugins","data","require","_imageUtils","_fsExtra","_interopRequireDefault","_path","_withAndroidManifestIcons","obj","__esModule","default","Colors","AndroidConfig","dpiValues","mdpi","folderName","scale","hdpi","xhdpi","xxhdpi","xxxhdpi","exports","BASELINE_PIXEL_SIZE","ANDROID_RES_PATH","MIPMAP_ANYDPI_V26","ICON_BACKGROUND","IC_LAUNCHER_PNG","IC_LAUNCHER_ROUND_PNG","IC_LAUNCHER_BACKGROUND_PNG","IC_LAUNCHER_FOREGROUND_PNG","IC_LAUNCHER_MONOCHROME_PNG","IC_LAUNCHER_XML","IC_LAUNCHER_ROUND_XML","withAndroidIcons","config","foregroundImage","backgroundColor","backgroundImage","monochromeImage","getAdaptiveIcon","icon","getIcon","withAndroidManifestIcons","withAndroidAdaptiveIconColors","withDangerousMod","_config$android","setIconAsync","modRequest","projectRoot","isAdaptive","android","adaptiveIcon","setRoundIconManifest","manifest","_config$android2","application","Manifest","getMainApplicationOrThrow","$","withAndroidColors","modResults","setBackgroundColor","_config$android3","_config$android$adapt","_config$android4","_config$android4$adap","_config$android$adapt2","_config$android5","_config$android5$adap","_config$android$adapt3","_config$android6","_config$android6$adap","_config$android$adapt4","_config$android7","_config$android7$adap","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","ensureDir","launcherPath","launcherRoundPath","Promise","all","writeFile","map","existsSync","remove","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-extra';\nimport path from 'path';\n\nimport { withAndroidManifestIcons } from './withAndroidManifestIcons';\n\nconst { Colors } = AndroidConfig;\n\ntype DPIString = 'mdpi' | 'hdpi' | 'xhdpi' | 'xxhdpi' | 'xxxhdpi';\ntype dpiMap = Record<DPIString, { folderName: string; scale: number }>;\n\nexport const dpiValues: dpiMap = {\n mdpi: { folderName: 'mipmap-mdpi', scale: 1 },\n hdpi: { folderName: 'mipmap-hdpi', scale: 1.5 },\n xhdpi: { folderName: 'mipmap-xhdpi', scale: 2 },\n xxhdpi: { folderName: 'mipmap-xxhdpi', scale: 3 },\n xxxhdpi: { folderName: 'mipmap-xxxhdpi', scale: 4 },\n};\nconst BASELINE_PIXEL_SIZE = 108;\nexport const ANDROID_RES_PATH = 'android/app/src/main/res/';\nconst MIPMAP_ANYDPI_V26 = 'mipmap-anydpi-v26';\nconst ICON_BACKGROUND = 'iconBackground';\nconst IC_LAUNCHER_PNG = 'ic_launcher.png';\nconst IC_LAUNCHER_ROUND_PNG = 'ic_launcher_round.png';\nconst IC_LAUNCHER_BACKGROUND_PNG = 'ic_launcher_background.png';\nconst IC_LAUNCHER_FOREGROUND_PNG = 'ic_launcher_foreground.png';\nconst IC_LAUNCHER_MONOCHROME_PNG = 'ic_launcher_monochrome.png';\nconst IC_LAUNCHER_XML = 'ic_launcher.xml';\nconst IC_LAUNCHER_ROUND_XML = 'ic_launcher_round.xml';\n\nexport const withAndroidIcons: ConfigPlugin = (config) => {\n const { foregroundImage, backgroundColor, backgroundImage, 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_PNG);\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_PNG,\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_PNG,\n backgroundImage,\n backgroundColor,\n imageCacheFolder: 'android-standard-circle',\n backgroundImageCacheFolder: 'android-standard-round-background',\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_PNG,\n });\n }\n await generateMultiLayerImageAsync(projectRoot, {\n backgroundColor: 'transparent',\n backgroundImage,\n backgroundImageCacheFolder: 'android-adaptive-background',\n outputImageFileName: IC_LAUNCHER_FOREGROUND_PNG,\n icon: foregroundImage,\n imageCacheFolder: 'android-adaptive-foreground',\n backgroundImageFileName: IC_LAUNCHER_BACKGROUND_PNG,\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.ensureDir(anyDpiV26Directory);\n const launcherPath = path.resolve(anyDpiV26Directory, IC_LAUNCHER_XML);\n const launcherRoundPath = path.resolve(anyDpiV26Directory, IC_LAUNCHER_ROUND_XML);\n if (add) {\n await Promise.all([\n fs.writeFile(launcherPath, icLauncherXmlString),\n fs.writeFile(launcherRoundPath, icLauncherXmlString),\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 if (fs.existsSync(path)) {\n return fs.remove(path);\n }\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 }: {\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 }\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 });\n\n if (backgroundImage) {\n const backgroundLayer = await generateIconAsync(projectRoot, {\n cacheType: backgroundImageCacheFolder,\n src: backgroundImage,\n scale,\n backgroundColor: 'transparent',\n borderRadiusRatio,\n });\n\n if (backgroundImageFileName) {\n await fs.writeFile(path.resolve(dpiFolder, backgroundImageFileName), backgroundLayer);\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.ensureDir(dpiFolder);\n await fs.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 });\n await fs.ensureDir(dpiFolder);\n await fs.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.remove(path.resolve(dpiFolder, name));\n });\n}\n\nasync function generateIconAsync(\n projectRoot: string,\n {\n cacheType,\n src,\n scale,\n backgroundColor,\n borderRadiusRatio,\n }: {\n cacheType: string;\n src: string;\n scale: number;\n backgroundColor: string;\n borderRadiusRatio?: number;\n }\n) {\n const iconSizePx = 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,SAAA;EAAA,MAAAH,IAAA,GAAAI,sBAAA,CAAAH,OAAA;EAAAE,QAAA,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,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC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G,KAAK;EACLoB,eAAe;EACf+C;AAOF,CAAC,EACD;EACA,MAAMyC,UAAU,GAAGtG,mBAAmB,GAAGN,KAAK;EAE9C,OAAO,CACL,MAAM,IAAA6G,gCAAkB,EACtB;IAAE7E,WAAW;IAAEmE;EAAU,CAAC,EAC1B;IACEC,GAAG;IACHU,KAAK,EAAEF,UAAU;IACjBG,MAAM,EAAEH,UAAU;IAClBI,UAAU,EAAE,OAAO;IACnB5F,eAAe;IACf6F,YAAY,EAAE9C,iBAAiB,GAAGyC,UAAU,GAAGzC,iBAAiB,GAAG+C;EACrE,CACF,CAAC,EACDC,MAAM;AACV"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withIosIcons.js","names":["_configPlugins","data","require","_imageUtils","fs","_interopRequireWildcard","_path","_AssetContents","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","getProjectName","IOSConfig","XcodeUtils","IMAGE_CACHE_NAME","IMAGESET_PATH","withIosIcons","config","withDangerousMod","setIconsAsync","modRequest","projectRoot","exports","getIcons","_config$ios","ios","icon","WarningAggregator","addWarningIOS","iosNamedProjectRoot","getIosNamedProjectPath","ensureDir","join","imagesJson","generateUniversalIconAsync","cacheKey","platform","writeContentsJsonAsync","images","projectName","getAppleIconName","size","scale","filename","source","generateImageAsync","cacheType","src","name","width","height","removeTransparency","resizeMode","backgroundColor","assetPath","writeFile","idiom"],"sources":["../../../src/plugins/icons/withIosIcons.ts"],"sourcesContent":["import { ConfigPlugin, IOSConfig, WarningAggregator, withDangerousMod } from '@expo/config-plugins';\nimport { ExpoConfig } from '@expo/config-types';\nimport { generateImageAsync } from '@expo/image-utils';\nimport * as fs from 'fs-extra';\nimport { join } from 'path';\n\nimport { ContentsJson, 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 return withDangerousMod(config, [\n 'ios',\n async (config) => {\n await setIconsAsync(config, config.modRequest.projectRoot);\n return config;\n },\n ]);\n};\n\nexport function getIcons(config: Pick<ExpoConfig, 'icon' | 'ios'>): string | null {\n // No support for empty strings.\n return config.ios?.icon || config.icon || null;\n}\n\nexport async function setIconsAsync(config: ExpoConfig, projectRoot: string) {\n const icon = getIcons(config);\n if (!icon) {\n WarningAggregator.addWarningIOS(\n 'icon',\n 'This is the image that your app uses on your home screen, you will need to configure it manually.'\n );\n return;\n }\n\n // Something like projectRoot/ios/MyApp/\n const iosNamedProjectRoot = getIosNamedProjectPath(projectRoot);\n\n // Ensure the Images.xcassets/AppIcon.appiconset path exists\n await fs.ensureDir(join(iosNamedProjectRoot, IMAGESET_PATH));\n\n // Store the image JSON data for assigning via the Contents.json\n const imagesJson: ContentsJson['images'] = await generateUniversalIconAsync(projectRoot, {\n icon,\n cacheKey: 'universal-icon',\n iosNamedProjectRoot,\n platform: 'ios',\n });\n\n // Finally, write the Config.json\n await writeContentsJsonAsync(join(iosNamedProjectRoot, IMAGESET_PATH), { images: imagesJson });\n}\n\n/**\n * Return the project's named iOS path: ios/MyProject/\n *\n * @param projectRoot Expo project root path.\n */\nfunction getIosNamedProjectPath(projectRoot: string): string {\n const projectName = getProjectName(projectRoot);\n return join(projectRoot, 'ios', projectName);\n}\n\nfunction getAppleIconName(size: number, scale: number): string {\n return `App-Icon-${size}x${size}@${scale}x.png`;\n}\n\nexport async function generateUniversalIconAsync(\n projectRoot: string,\n {\n icon,\n cacheKey,\n iosNamedProjectRoot,\n platform,\n }: { platform: 'watchos' | 'ios'; icon: string; iosNamedProjectRoot: string; cacheKey: string }\n): Promise<ContentsJson['images']> {\n const size = 1024;\n const filename = getAppleIconName(size, 1);\n // Using this method will cache the images in `.expo` based on the properties used to generate them.\n // this method also supports remote URLs and using the global sharp instance.\n const { source } = await generateImageAsync(\n { projectRoot, cacheType: IMAGE_CACHE_NAME + cacheKey },\n {\n src: icon,\n name: filename,\n width: size,\n height: size,\n removeTransparency: true,\n // The icon should be square, but if it's not then it will be cropped.\n resizeMode: 'cover',\n // Force the background color to solid white to prevent any transparency.\n // TODO: Maybe use a more adaptive option based on the icon color?\n backgroundColor: '#ffffff',\n }\n );\n // Write image buffer to the file system.\n const assetPath = join(iosNamedProjectRoot, IMAGESET_PATH, filename);\n await fs.writeFile(assetPath, source);\n\n return [\n {\n filename: getAppleIconName(size, 1),\n idiom: 'universal',\n platform,\n size: `${size}x${size}`,\n },\n ];\n}\n"],"mappings":";;;;;;;;;AAAA,SAAAA,eAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,cAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAE,YAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,WAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,GAAA;EAAA,MAAAH,IAAA,GAAAI,uBAAA,CAAAH,OAAA;EAAAE,EAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,MAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,KAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAM,eAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,cAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAuE,SAAAO,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YA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AChB,MAAME,aAAa,CAACF,MAAM,EAAEA,MAAM,CAACG,UAAU,CAACC,WAAW,CAAC;IAC1D,OAAOJ,MAAM;EACf,CAAC,CACF,CAAC;AACJ,CAAC;AAACK,OAAA,CAAAN,YAAA,GAAAA,YAAA;AAEK,SAASO,QAAQA,CAACN,MAAwC,EAAiB;EAAA,IAAAO,WAAA;EAChF;EACA,OAAO,EAAAA,WAAA,GAAAP,MAAM,CAACQ,GAAG,cAAAD,WAAA,uBAAVA,WAAA,CAAYE,IAAI,KAAIT,MAAM,CAACS,IAAI,IAAI,IAAI;AAChD;AAEO,eAAeP,aAAaA,CAACF,MAAkB,EAAEI,WAAmB,EAAE;EAC3E,MAAMK,IAAI,GAAGH,QAAQ,CAACN,MAAM,CAAC;EAC7B,IAAI,CAACS,IAAI,EAAE;IACTC,kCAAiB,CAACC,aAAa,CAC7B,MAAM,EACN,
|
|
1
|
+
{"version":3,"file":"withIosIcons.js","names":["_configPlugins","data","require","_imageUtils","fs","_interopRequireWildcard","_path","_AssetContents","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","getProjectName","IOSConfig","XcodeUtils","IMAGE_CACHE_NAME","IMAGESET_PATH","withIosIcons","config","withDangerousMod","setIconsAsync","modRequest","projectRoot","exports","getIcons","_config$ios","ios","icon","WarningAggregator","addWarningIOS","iosNamedProjectRoot","getIosNamedProjectPath","ensureDir","join","imagesJson","generateUniversalIconAsync","cacheKey","platform","writeContentsJsonAsync","images","projectName","getAppleIconName","size","scale","filename","source","generateImageAsync","cacheType","src","name","width","height","removeTransparency","resizeMode","backgroundColor","assetPath","writeFile","idiom"],"sources":["../../../src/plugins/icons/withIosIcons.ts"],"sourcesContent":["import { ConfigPlugin, IOSConfig, WarningAggregator, withDangerousMod } from '@expo/config-plugins';\nimport { ExpoConfig } from '@expo/config-types';\nimport { generateImageAsync } from '@expo/image-utils';\nimport * as fs from 'fs-extra';\nimport { join } from 'path';\n\nimport { ContentsJson, 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 return withDangerousMod(config, [\n 'ios',\n async (config) => {\n await setIconsAsync(config, config.modRequest.projectRoot);\n return config;\n },\n ]);\n};\n\nexport function getIcons(config: Pick<ExpoConfig, 'icon' | 'ios'>): string | null {\n // No support for empty strings.\n return config.ios?.icon || config.icon || null;\n}\n\nexport async function setIconsAsync(config: ExpoConfig, projectRoot: string) {\n const icon = getIcons(config);\n if (!icon) {\n WarningAggregator.addWarningIOS(\n 'icon',\n 'This is the image that your app uses on your home screen, you will need to configure it manually.'\n );\n return;\n }\n\n // Something like projectRoot/ios/MyApp/\n const iosNamedProjectRoot = getIosNamedProjectPath(projectRoot);\n\n // Ensure the Images.xcassets/AppIcon.appiconset path exists\n await fs.ensureDir(join(iosNamedProjectRoot, IMAGESET_PATH));\n\n // Store the image JSON data for assigning via the Contents.json\n const imagesJson: ContentsJson['images'] = await generateUniversalIconAsync(projectRoot, {\n icon,\n cacheKey: 'universal-icon',\n iosNamedProjectRoot,\n platform: 'ios',\n });\n\n // Finally, write the Config.json\n await writeContentsJsonAsync(join(iosNamedProjectRoot, IMAGESET_PATH), { images: imagesJson });\n}\n\n/**\n * Return the project's named iOS path: ios/MyProject/\n *\n * @param projectRoot Expo project root path.\n */\nfunction getIosNamedProjectPath(projectRoot: string): string {\n const projectName = getProjectName(projectRoot);\n return join(projectRoot, 'ios', projectName);\n}\n\nfunction getAppleIconName(size: number, scale: number): string {\n return `App-Icon-${size}x${size}@${scale}x.png`;\n}\n\nexport async function generateUniversalIconAsync(\n projectRoot: string,\n {\n icon,\n cacheKey,\n iosNamedProjectRoot,\n platform,\n }: { platform: 'watchos' | 'ios'; icon: string; iosNamedProjectRoot: string; cacheKey: string }\n): Promise<ContentsJson['images']> {\n const size = 1024;\n const filename = getAppleIconName(size, 1);\n // Using this method will cache the images in `.expo` based on the properties used to generate them.\n // this method also supports remote URLs and using the global sharp instance.\n const { source } = await generateImageAsync(\n { projectRoot, cacheType: IMAGE_CACHE_NAME + cacheKey },\n {\n src: icon,\n name: filename,\n width: size,\n height: size,\n removeTransparency: true,\n // The icon should be square, but if it's not then it will be cropped.\n resizeMode: 'cover',\n // Force the background color to solid white to prevent any transparency.\n // TODO: Maybe use a more adaptive option based on the icon color?\n backgroundColor: '#ffffff',\n }\n );\n // Write image buffer to the file system.\n const assetPath = join(iosNamedProjectRoot, IMAGESET_PATH, filename);\n await fs.writeFile(assetPath, source);\n\n return [\n {\n filename: getAppleIconName(size, 1),\n idiom: 'universal',\n platform,\n size: `${size}x${size}`,\n },\n ];\n}\n"],"mappings":";;;;;;;;;AAAA,SAAAA,eAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,cAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAE,YAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,WAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,GAAA;EAAA,MAAAH,IAAA,GAAAI,uBAAA,CAAAH,OAAA;EAAAE,EAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,MAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,KAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAM,eAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,cAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,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yPlugin.js","names":["_configPlugins","data","require","toCamelCase","s","replace","x","toUpperCase","isModuleExcluded","config","packageName","_config$_internal","_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,
|
|
1
|
+
{"version":3,"file":"createLegacyPlugin.js","names":["_configPlugins","data","require","toCamelCase","s","replace","x","toUpperCase","isModuleExcluded","config","packageName","_config$_internal","_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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,CAAC,CAAC;EACJ,CAAC;EAED,MAAMgB,UAAU,GAAGvB,WAAW,CAAE,QAAOO,WAAY,EAAC,CAAC;EACrDiB,MAAM,CAACC,cAAc,CAACP,WAAW,EAAE,MAAM,EAAE;IACzCQ,KAAK,EAAEH;EACT,CAAC,CAAC;EAEF,OAAOL,WAAW;AACpB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withAndroidAdMob.js","names":["_configPlugins","data","require","addMetaDataItemToMainApplication","getMainApplicationOrThrow","removeMetaDataItemFromMainApplication","AndroidConfig","Manifest","META_APPLICATION_ID","META_DELAY_APP_MEASUREMENT_INIT","withAndroidAdMob","config","withAndroidManifest","modResults","setAdMobConfig","exports","getGoogleMobileAdsAppId","_config$android$confi","_config$android","_config$android$confi2","android","googleMobileAdsAppId","getGoogleMobileAdsAutoInit","_config$android$confi3","_config$android2","_config$android2$conf","googleMobileAdsAutoInit","androidManifest","appId","autoInit","mainApplication","String"],"sources":["../../../../src/plugins/unversioned/expo-ads-admob/withAndroidAdMob.ts"],"sourcesContent":["import { AndroidConfig, ConfigPlugin, withAndroidManifest } from '@expo/config-plugins';\nimport { ExpoConfig } from '@expo/config-types';\n\nconst {\n addMetaDataItemToMainApplication,\n getMainApplicationOrThrow,\n removeMetaDataItemFromMainApplication,\n} = AndroidConfig.Manifest;\n\nconst META_APPLICATION_ID = 'com.google.android.gms.ads.APPLICATION_ID';\nconst META_DELAY_APP_MEASUREMENT_INIT = 'com.google.android.gms.ads.DELAY_APP_MEASUREMENT_INIT';\n\nexport const withAndroidAdMob: ConfigPlugin = (config) => {\n return withAndroidManifest(config, (config) => {\n config.modResults = setAdMobConfig(config, config.modResults);\n return config;\n });\n};\n\nexport function getGoogleMobileAdsAppId(config: Pick<ExpoConfig, 'android'>) {\n return config.android?.config?.googleMobileAdsAppId ?? null;\n}\n\nexport function getGoogleMobileAdsAutoInit(config: Pick<ExpoConfig, 'android'>) {\n return config.android?.config?.googleMobileAdsAutoInit ?? false;\n}\n\nexport function setAdMobConfig(\n config: Pick<ExpoConfig, 'android'>,\n androidManifest: AndroidConfig.Manifest.AndroidManifest\n) {\n const appId = getGoogleMobileAdsAppId(config);\n const autoInit = getGoogleMobileAdsAutoInit(config);\n const mainApplication = getMainApplicationOrThrow(androidManifest);\n\n if (appId) {\n addMetaDataItemToMainApplication(mainApplication, META_APPLICATION_ID, appId);\n addMetaDataItemToMainApplication(\n mainApplication,\n META_DELAY_APP_MEASUREMENT_INIT,\n String(!autoInit)\n );\n } else {\n removeMetaDataItemFromMainApplication(mainApplication, META_APPLICATION_ID);\n removeMetaDataItemFromMainApplication(mainApplication, META_DELAY_APP_MEASUREMENT_INIT);\n }\n\n return androidManifest;\n}\n"],"mappings":";;;;;;;;;AAAA,SAAAA,eAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,cAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,MAAM;EACJE,gCAAgC;EAChCC,yBAAyB;EACzBC;AACF,CAAC,GAAGC,8BAAa,CAACC,QAAQ;AAE1B,MAAMC,mBAAmB,GAAG,2CAA2C;AACvE,MAAMC,+BAA+B,GAAG,uDAAuD;AAExF,MAAMC,gBAA8B,GAAIC,MAAM,IAAK;EACxD,OAAO,IAAAC,oCAAmB,EAACD,MAAM,EAAGA,MAAM,IAAK;IAC7CA,MAAM,CAACE,UAAU,GAAGC,cAAc,CAACH,MAAM,EAAEA,MAAM,CAACE,UAAU,CAAC;IAC7D,OAAOF,MAAM;EACf,CAAC,CAAC;AACJ,CAAC;AAACI,OAAA,CAAAL,gBAAA,GAAAA,gBAAA;AAEK,SAASM,uBAAuBA,CAACL,MAAmC,EAAE;EAAA,IAAAM,qBAAA,EAAAC,eAAA,EAAAC,sBAAA;EAC3E,QAAAF,qBAAA,IAAAC,eAAA,GAAOP,MAAM,CAACS,OAAO,cAAAF,eAAA,wBAAAC,sBAAA,GAAdD,eAAA,CAAgBP,MAAM,cAAAQ,sBAAA,uBAAtBA,sBAAA,CAAwBE,oBAAoB,cAAAJ,qBAAA,cAAAA,qBAAA,GAAI,IAAI;AAC7D;AAEO,SAASK,0BAA0BA,CAACX,MAAmC,EAAE;EAAA,IAAAY,sBAAA,EAAAC,gBAAA,EAAAC,qBAAA;EAC9E,QAAAF,sBAAA,IAAAC,gBAAA,GAAOb,MAAM,CAACS,OAAO,cAAAI,gBAAA,wBAAAC,qBAAA,GAAdD,gBAAA,CAAgBb,MAAM,cAAAc,qBAAA,uBAAtBA,qBAAA,CAAwBC,uBAAuB,cAAAH,sBAAA,cAAAA,sBAAA,GAAI,KAAK;AACjE;AAEO,SAAST,cAAcA,CAC5BH,MAAmC,EACnCgB,eAAuD,EACvD;EACA,MAAMC,KAAK,GAAGZ,uBAAuB,CAACL,MAAM,CAAC;EAC7C,MAAMkB,QAAQ,GAAGP,0BAA0B,CAACX,MAAM,CAAC;EACnD,MAAMmB,eAAe,GAAG1B,yBAAyB,CAACuB,eAAe,CAAC;EAElE,IAAIC,KAAK,EAAE;IACTzB,gCAAgC,CAAC2B,eAAe,EAAEtB,mBAAmB,EAAEoB,KAAK,CAAC;IAC7EzB,gCAAgC,CAC9B2B,eAAe,EACfrB,+BAA+B,EAC/BsB,MAAM,CAAC,CAACF,QAAQ,CAAC
|
|
1
|
+
{"version":3,"file":"withAndroidAdMob.js","names":["_configPlugins","data","require","addMetaDataItemToMainApplication","getMainApplicationOrThrow","removeMetaDataItemFromMainApplication","AndroidConfig","Manifest","META_APPLICATION_ID","META_DELAY_APP_MEASUREMENT_INIT","withAndroidAdMob","config","withAndroidManifest","modResults","setAdMobConfig","exports","getGoogleMobileAdsAppId","_config$android$confi","_config$android","_config$android$confi2","android","googleMobileAdsAppId","getGoogleMobileAdsAutoInit","_config$android$confi3","_config$android2","_config$android2$conf","googleMobileAdsAutoInit","androidManifest","appId","autoInit","mainApplication","String"],"sources":["../../../../src/plugins/unversioned/expo-ads-admob/withAndroidAdMob.ts"],"sourcesContent":["import { AndroidConfig, ConfigPlugin, withAndroidManifest } from '@expo/config-plugins';\nimport { ExpoConfig } from '@expo/config-types';\n\nconst {\n addMetaDataItemToMainApplication,\n getMainApplicationOrThrow,\n removeMetaDataItemFromMainApplication,\n} = AndroidConfig.Manifest;\n\nconst META_APPLICATION_ID = 'com.google.android.gms.ads.APPLICATION_ID';\nconst META_DELAY_APP_MEASUREMENT_INIT = 'com.google.android.gms.ads.DELAY_APP_MEASUREMENT_INIT';\n\nexport const withAndroidAdMob: ConfigPlugin = (config) => {\n return withAndroidManifest(config, (config) => {\n config.modResults = setAdMobConfig(config, config.modResults);\n return config;\n });\n};\n\nexport function getGoogleMobileAdsAppId(config: Pick<ExpoConfig, 'android'>) {\n return config.android?.config?.googleMobileAdsAppId ?? null;\n}\n\nexport function getGoogleMobileAdsAutoInit(config: Pick<ExpoConfig, 'android'>) {\n return config.android?.config?.googleMobileAdsAutoInit ?? false;\n}\n\nexport function setAdMobConfig(\n config: Pick<ExpoConfig, 'android'>,\n androidManifest: AndroidConfig.Manifest.AndroidManifest\n) {\n const appId = getGoogleMobileAdsAppId(config);\n const autoInit = getGoogleMobileAdsAutoInit(config);\n const mainApplication = getMainApplicationOrThrow(androidManifest);\n\n if (appId) {\n addMetaDataItemToMainApplication(mainApplication, META_APPLICATION_ID, appId);\n addMetaDataItemToMainApplication(\n mainApplication,\n META_DELAY_APP_MEASUREMENT_INIT,\n String(!autoInit)\n );\n } else {\n removeMetaDataItemFromMainApplication(mainApplication, META_APPLICATION_ID);\n removeMetaDataItemFromMainApplication(mainApplication, META_DELAY_APP_MEASUREMENT_INIT);\n }\n\n return androidManifest;\n}\n"],"mappings":";;;;;;;;;AAAA,SAAAA,eAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,cAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,MAAM;EACJE,gCAAgC;EAChCC,yBAAyB;EACzBC;AACF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,EAAE;IACTzB,gCAAgC,CAAC2B,eAAe,EAAEtB,mBAAmB,EAAEoB,KAAK,CAAC;IAC7EzB,gCAAgC,CAC9B2B,eAAe,EACfrB,+BAA+B,EAC/BsB,MAAM,CAAC,CAACF,QAAQ,CAClB,CAAC;EACH,CAAC,MAAM;IACLxB,qCAAqC,CAACyB,eAAe,EAAEtB,mBAAmB,CAAC;IAC3EH,qCAAqC,CAACyB,eAAe,EAAErB,+BAA+B,CAAC;EACzF;EAEA,OAAOkB,eAAe;AACxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expo-apple-authentication.js","names":["_configPlugins","data","require","_createLegacyPlugin","withAppleSignInWarning","config","withEntitlementsPlist","_config$ios","ios","usesAppleSignIn","WarningAggregator","addWarningIOS","_default","createLegacyPlugin","packageName","fallback","exports","default"],"sources":["../../../src/plugins/unversioned/expo-apple-authentication.ts"],"sourcesContent":["import { ConfigPlugin, WarningAggregator, withEntitlementsPlist } from '@expo/config-plugins';\n\nimport { createLegacyPlugin } from './createLegacyPlugin';\n\nconst withAppleSignInWarning: ConfigPlugin = (config) => {\n return withEntitlementsPlist(config, (config) => {\n if (config.ios?.usesAppleSignIn) {\n WarningAggregator.addWarningIOS(\n 'ios.usesAppleSignIn',\n 'Install expo-apple-authentication to enable this feature',\n 'https://docs.expo.dev/versions/latest/sdk/apple-authentication/#eas-build'\n );\n }\n\n return config;\n });\n};\n\nexport default createLegacyPlugin({\n packageName: 'expo-apple-authentication',\n fallback: withAppleSignInWarning,\n});\n"],"mappings":";;;;;;AAAA,SAAAA,eAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,cAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAE,oBAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,mBAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,MAAMG,sBAAoC,GAAIC,MAAM,IAAK;EACvD,OAAO,IAAAC,sCAAqB,EAACD,MAAM,EAAGA,MAAM,IAAK;IAAA,IAAAE,WAAA;IAC/C,KAAAA,WAAA,GAAIF,MAAM,CAACG,GAAG,cAAAD,WAAA,eAAVA,WAAA,CAAYE,eAAe,EAAE;MAC/BC,kCAAiB,CAACC,aAAa,CAC7B,qBAAqB,EACrB,0DAA0D,EAC1D,
|
|
1
|
+
{"version":3,"file":"expo-apple-authentication.js","names":["_configPlugins","data","require","_createLegacyPlugin","withAppleSignInWarning","config","withEntitlementsPlist","_config$ios","ios","usesAppleSignIn","WarningAggregator","addWarningIOS","_default","createLegacyPlugin","packageName","fallback","exports","default"],"sources":["../../../src/plugins/unversioned/expo-apple-authentication.ts"],"sourcesContent":["import { ConfigPlugin, WarningAggregator, withEntitlementsPlist } from '@expo/config-plugins';\n\nimport { createLegacyPlugin } from './createLegacyPlugin';\n\nconst withAppleSignInWarning: ConfigPlugin = (config) => {\n return withEntitlementsPlist(config, (config) => {\n if (config.ios?.usesAppleSignIn) {\n WarningAggregator.addWarningIOS(\n 'ios.usesAppleSignIn',\n 'Install expo-apple-authentication to enable this feature',\n 'https://docs.expo.dev/versions/latest/sdk/apple-authentication/#eas-build'\n );\n }\n\n return config;\n });\n};\n\nexport default createLegacyPlugin({\n packageName: 'expo-apple-authentication',\n fallback: withAppleSignInWarning,\n});\n"],"mappings":";;;;;;AAAA,SAAAA,eAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,cAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAE,oBAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,mBAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,MAAMG,sBAAoC,GAAIC,MAAM,IAAK;EACvD,OAAO,IAAAC,sCAAqB,EAACD,MAAM,EAAGA,MAAM,IAAK;IAAA,IAAAE,WAAA;IAC/C,KAAAA,WAAA,GAAIF,MAAM,CAACG,GAAG,cAAAD,WAAA,eAAVA,WAAA,CAAYE,eAAe,EAAE;MAC/BC,kCAAiB,CAACC,aAAa,CAC7B,qBAAqB,EACrB,0DAA0D,EAC1D,2EACF,CAAC;IACH;IAEA,OAAON,MAAM;EACf,CAAC,CAAC;AACJ,CAAC;AAAC,IAAAO,QAAA,GAEa,IAAAC,wCAAkB,EAAC;EAChCC,WAAW,EAAE,2BAA2B;EACxCC,QAAQ,EAAEX;AACZ,CAAC,CAAC;AAAAY,OAAA,CAAAC,OAAA,GAAAL,QAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expo-document-picker.js","names":["_configPlugins","data","require","_createLegacyPlugin","_default","createLegacyPlugin","packageName","fallback","config","_config$ios","ios","usesIcloudStorage","WarningAggregator","addWarningIOS","exports","default"],"sources":["../../../src/plugins/unversioned/expo-document-picker.ts"],"sourcesContent":["import { WarningAggregator } from '@expo/config-plugins';\n\nimport { createLegacyPlugin } from './createLegacyPlugin';\n\nexport default createLegacyPlugin({\n packageName: 'expo-document-picker',\n fallback(config) {\n if (config.ios?.usesIcloudStorage) {\n WarningAggregator.addWarningIOS(\n 'ios.usesIcloudStorage',\n 'Install expo-document-picker to enable the ios.usesIcloudStorage feature'\n // TODO: add a link to a docs page with more information on how to do this\n );\n }\n return config;\n },\n});\n"],"mappings":";;;;;;AAAA,SAAAA,eAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,cAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAE,oBAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,mBAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA0D,IAAAG,QAAA,GAE3C,IAAAC,wCAAkB,EAAC;EAChCC,WAAW,EAAE,sBAAsB;EACnCC,QAAQA,CAACC,MAAM,EAAE;IAAA,IAAAC,WAAA;IACf,KAAAA,WAAA,GAAID,MAAM,CAACE,GAAG,cAAAD,WAAA,eAAVA,WAAA,CAAYE,iBAAiB,EAAE;MACjCC,kCAAiB,CAACC,aAAa,CAC7B,uBAAuB,EACvB;MACA;
|
|
1
|
+
{"version":3,"file":"expo-document-picker.js","names":["_configPlugins","data","require","_createLegacyPlugin","_default","createLegacyPlugin","packageName","fallback","config","_config$ios","ios","usesIcloudStorage","WarningAggregator","addWarningIOS","exports","default"],"sources":["../../../src/plugins/unversioned/expo-document-picker.ts"],"sourcesContent":["import { WarningAggregator } from '@expo/config-plugins';\n\nimport { createLegacyPlugin } from './createLegacyPlugin';\n\nexport default createLegacyPlugin({\n packageName: 'expo-document-picker',\n fallback(config) {\n if (config.ios?.usesIcloudStorage) {\n WarningAggregator.addWarningIOS(\n 'ios.usesIcloudStorage',\n 'Install expo-document-picker to enable the ios.usesIcloudStorage feature'\n // TODO: add a link to a docs page with more information on how to do this\n );\n }\n return config;\n },\n});\n"],"mappings":";;;;;;AAAA,SAAAA,eAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,cAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAE,oBAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,mBAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA0D,IAAAG,QAAA,GAE3C,IAAAC,wCAAkB,EAAC;EAChCC,WAAW,EAAE,sBAAsB;EACnCC,QAAQA,CAACC,MAAM,EAAE;IAAA,IAAAC,WAAA;IACf,KAAAA,WAAA,GAAID,MAAM,CAACE,GAAG,cAAAD,WAAA,eAAVA,WAAA,CAAYE,iBAAiB,EAAE;MACjCC,kCAAiB,CAACC,aAAa,CAC7B,uBAAuB,EACvB;MACA;MACF,CAAC;IACH;IACA,OAAOL,MAAM;EACf;AACF,CAAC,CAAC;AAAAM,OAAA,CAAAC,OAAA,GAAAX,QAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withAndroidNavigationBar.js","names":["_configPlugins","data","require","NAVIGATION_BAR_COLOR","withNavigationBar","config","immersiveMode","getNavigationBarImmersiveMode","WarningAggregator","addWarningAndroid","withNavigationBarColors","withNavigationBarStyles","exports","withAndroidColors","modResults","setNavigationBarColors","withAndroidStyles","setNavigationBarStyles","colors","hexString","getNavigationBarColor","AndroidConfig","Colors","setColorItem","Resources","buildResourceItem","name","value","styles","Styles","assignStylesValue","add","getNavigationBarStyle","parent","getAppThemeLightNoActionBarGroup","_config$androidNaviga","androidNavigationBar","visible","_config$androidNaviga2","backgroundColor","_config$androidNaviga3","barStyle"],"sources":["../../../../src/plugins/unversioned/expo-navigation-bar/withAndroidNavigationBar.ts"],"sourcesContent":["import {\n AndroidConfig,\n ConfigPlugin,\n WarningAggregator,\n withAndroidColors,\n withAndroidStyles,\n} from '@expo/config-plugins';\nimport { ExpoConfig } from '@expo/config-types';\n\nconst NAVIGATION_BAR_COLOR = 'navigationBarColor';\n\nexport const withNavigationBar: ConfigPlugin = (config) => {\n const immersiveMode = getNavigationBarImmersiveMode(config);\n if (immersiveMode) {\n // Immersive mode needs to be set programmatically\n WarningAggregator.addWarningAndroid(\n 'androidNavigationBar.visible',\n 'Property is deprecated in Android 11 (API 30) and will be removed from Expo SDK.',\n 'https://expo.fyi/android-navigation-bar-visible-deprecated'\n );\n }\n\n config = withNavigationBarColors(config);\n config = withNavigationBarStyles(config);\n return config;\n};\n\nconst withNavigationBarColors: ConfigPlugin = (config) => {\n return withAndroidColors(config, (config) => {\n config.modResults = setNavigationBarColors(config, config.modResults);\n return config;\n });\n};\n\nconst withNavigationBarStyles: ConfigPlugin = (config) => {\n return withAndroidStyles(config, (config) => {\n config.modResults = setNavigationBarStyles(config, config.modResults);\n return config;\n });\n};\n\nexport function setNavigationBarColors(\n config: Pick<ExpoConfig, 'androidNavigationBar'>,\n colors: AndroidConfig.Resources.ResourceXML\n): AndroidConfig.Resources.ResourceXML {\n const hexString = getNavigationBarColor(config);\n if (hexString) {\n colors = AndroidConfig.Colors.setColorItem(\n AndroidConfig.Resources.buildResourceItem({\n name: NAVIGATION_BAR_COLOR,\n value: hexString,\n }),\n colors\n );\n }\n return colors;\n}\n\nexport function setNavigationBarStyles(\n config: Pick<ExpoConfig, 'androidNavigationBar'>,\n styles: AndroidConfig.Resources.ResourceXML\n): AndroidConfig.Resources.ResourceXML {\n styles = AndroidConfig.Styles.assignStylesValue(styles, {\n add: getNavigationBarStyle(config) === 'dark-content',\n parent: AndroidConfig.Styles.getAppThemeLightNoActionBarGroup(),\n name: 'android:windowLightNavigationBar',\n value: 'true',\n });\n styles = AndroidConfig.Styles.assignStylesValue(styles, {\n add: !!getNavigationBarColor(config),\n parent: AndroidConfig.Styles.getAppThemeLightNoActionBarGroup(),\n name: `android:${NAVIGATION_BAR_COLOR}`,\n value: `@color/${NAVIGATION_BAR_COLOR}`,\n });\n\n return styles;\n}\n\nexport function getNavigationBarImmersiveMode(config: Pick<ExpoConfig, 'androidNavigationBar'>) {\n return config.androidNavigationBar?.visible || null;\n}\n\nexport function getNavigationBarColor(config: Pick<ExpoConfig, 'androidNavigationBar'>) {\n return config.androidNavigationBar?.backgroundColor || null;\n}\n\nexport function getNavigationBarStyle(config: Pick<ExpoConfig, 'androidNavigationBar'>) {\n return config.androidNavigationBar?.barStyle || 'light-content';\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,oBAAoB,GAAG,oBAAoB;AAE1C,MAAMC,iBAA+B,GAAIC,MAAM,IAAK;EACzD,MAAMC,aAAa,GAAGC,6BAA6B,CAACF,MAAM,CAAC;EAC3D,IAAIC,aAAa,EAAE;IACjB;IACAE,kCAAiB,CAACC,iBAAiB,CACjC,8BAA8B,EAC9B,kFAAkF,EAClF,
|
|
1
|
+
{"version":3,"file":"withAndroidNavigationBar.js","names":["_configPlugins","data","require","NAVIGATION_BAR_COLOR","withNavigationBar","config","immersiveMode","getNavigationBarImmersiveMode","WarningAggregator","addWarningAndroid","withNavigationBarColors","withNavigationBarStyles","exports","withAndroidColors","modResults","setNavigationBarColors","withAndroidStyles","setNavigationBarStyles","colors","hexString","getNavigationBarColor","AndroidConfig","Colors","setColorItem","Resources","buildResourceItem","name","value","styles","Styles","assignStylesValue","add","getNavigationBarStyle","parent","getAppThemeLightNoActionBarGroup","_config$androidNaviga","androidNavigationBar","visible","_config$androidNaviga2","backgroundColor","_config$androidNaviga3","barStyle"],"sources":["../../../../src/plugins/unversioned/expo-navigation-bar/withAndroidNavigationBar.ts"],"sourcesContent":["import {\n AndroidConfig,\n ConfigPlugin,\n WarningAggregator,\n withAndroidColors,\n withAndroidStyles,\n} from '@expo/config-plugins';\nimport { ExpoConfig } from '@expo/config-types';\n\nconst NAVIGATION_BAR_COLOR = 'navigationBarColor';\n\nexport const withNavigationBar: ConfigPlugin = (config) => {\n const immersiveMode = getNavigationBarImmersiveMode(config);\n if (immersiveMode) {\n // Immersive mode needs to be set programmatically\n WarningAggregator.addWarningAndroid(\n 'androidNavigationBar.visible',\n 'Property is deprecated in Android 11 (API 30) and will be removed from Expo SDK.',\n 'https://expo.fyi/android-navigation-bar-visible-deprecated'\n );\n }\n\n config = withNavigationBarColors(config);\n config = withNavigationBarStyles(config);\n return config;\n};\n\nconst withNavigationBarColors: ConfigPlugin = (config) => {\n return withAndroidColors(config, (config) => {\n config.modResults = setNavigationBarColors(config, config.modResults);\n return config;\n });\n};\n\nconst withNavigationBarStyles: ConfigPlugin = (config) => {\n return withAndroidStyles(config, (config) => {\n config.modResults = setNavigationBarStyles(config, config.modResults);\n return config;\n });\n};\n\nexport function setNavigationBarColors(\n config: Pick<ExpoConfig, 'androidNavigationBar'>,\n colors: AndroidConfig.Resources.ResourceXML\n): AndroidConfig.Resources.ResourceXML {\n const hexString = getNavigationBarColor(config);\n if (hexString) {\n colors = AndroidConfig.Colors.setColorItem(\n AndroidConfig.Resources.buildResourceItem({\n name: NAVIGATION_BAR_COLOR,\n value: hexString,\n }),\n colors\n );\n }\n return colors;\n}\n\nexport function setNavigationBarStyles(\n config: Pick<ExpoConfig, 'androidNavigationBar'>,\n styles: AndroidConfig.Resources.ResourceXML\n): AndroidConfig.Resources.ResourceXML {\n styles = AndroidConfig.Styles.assignStylesValue(styles, {\n add: getNavigationBarStyle(config) === 'dark-content',\n parent: AndroidConfig.Styles.getAppThemeLightNoActionBarGroup(),\n name: 'android:windowLightNavigationBar',\n value: 'true',\n });\n styles = AndroidConfig.Styles.assignStylesValue(styles, {\n add: !!getNavigationBarColor(config),\n parent: AndroidConfig.Styles.getAppThemeLightNoActionBarGroup(),\n name: `android:${NAVIGATION_BAR_COLOR}`,\n value: `@color/${NAVIGATION_BAR_COLOR}`,\n });\n\n return styles;\n}\n\nexport function getNavigationBarImmersiveMode(config: Pick<ExpoConfig, 'androidNavigationBar'>) {\n return config.androidNavigationBar?.visible || null;\n}\n\nexport function getNavigationBarColor(config: Pick<ExpoConfig, 'androidNavigationBar'>) {\n return config.androidNavigationBar?.backgroundColor || null;\n}\n\nexport function getNavigationBarStyle(config: Pick<ExpoConfig, 'androidNavigationBar'>) {\n return config.androidNavigationBar?.barStyle || 'light-content';\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,oBAAoB,GAAG,oBAAoB;AAE1C,MAAMC,iBAA+B,GAAIC,MAAM,IAAK;EACzD,MAAMC,aAAa,GAAGC,6BAA6B,CAACF,MAAM,CAAC;EAC3D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EAAEC,qBAAqB,CAAC3B,MAAM,CAAC,KAAK,cAAc;IACrD4B,MAAM,EAAEZ,8BAAa,CAACQ,MAAM,CAACK,gCAAgC,CAAC,CAAC;IAC/DR,IAAI,EAAE,kCAAkC;IACxCC,KAAK,EAAE;EACT,CAAC,CAAC;EACFC,MAAM,GAAGP,8BAAa,CAACQ,MAAM,CAACC,iBAAiB,CAACF,MAAM,EAAE;IACtDG,GAAG,EAAE,CAAC,CAACX,qBAAqB,CAACf,MAAM,CAAC;IACpC4B,MAAM,EAAEZ,8BAAa,CAACQ,MAAM,CAACK,gCAAgC,CAAC,CAAC;IAC/DR,IAAI,EAAG,WAAUvB,oBAAqB,EAAC;IACvCwB,KAAK,EAAG,UAASxB,oBAAqB;EACxC,CAAC,CAAC;EAEF,OAAOyB,MAAM;AACf;AAEO,SAASrB,6BAA6BA,CAACF,MAAgD,EAAE;EAAA,IAAA8B,qBAAA;EAC9F,OAAO,EAAAA,qBAAA,GAAA9B,MAAM,CAAC+B,oBAAoB,cAAAD,qBAAA,uBAA3BA,qBAAA,CAA6BE,OAAO,KAAI,IAAI;AACrD;AAEO,SAASjB,qBAAqBA,CAACf,MAAgD,EAAE;EAAA,IAAAiC,sBAAA;EACtF,OAAO,EAAAA,sBAAA,GAAAjC,MAAM,CAAC+B,oBAAoB,cAAAE,sBAAA,uBAA3BA,sBAAA,CAA6BC,eAAe,KAAI,IAAI;AAC7D;AAEO,SAASP,qBAAqBA,CAAC3B,MAAgD,EAAE;EAAA,IAAAmC,sBAAA;EACtF,OAAO,EAAAA,sBAAA,GAAAnC,MAAM,CAAC+B,oBAAoB,cAAAI,sBAAA,uBAA3BA,sBAAA,CAA6BC,QAAQ,KAAI,eAAe;AACjE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withAndroidNotifications.js","names":["_configPlugins","data","require","_imageUtils","_fsExtra","_interopRequireDefault","_path","_withAndroidIcons","obj","__esModule","default","Colors","AndroidConfig","addMetaDataItemToMainApplication","getMainApplicationOrThrow","removeMetaDataItemFromMainApplication","Manifest","BASELINE_PIXEL_SIZE","META_DATA_NOTIFICATION_ICON","exports","META_DATA_NOTIFICATION_ICON_COLOR","NOTIFICATION_ICON","NOTIFICATION_ICON_RESOURCE","NOTIFICATION_ICON_COLOR","NOTIFICATION_ICON_COLOR_RESOURCE","withNotificationIcons","config","withDangerousMod","setNotificationIconAsync","modRequest","projectRoot","withNotificationIconColor","withAndroidColors","modResults","setNotificationIconColor","withNotificationManifest","withAndroidManifest","setNotificationConfig","getNotificationIcon","_config$notification","notification","icon","getNotificationColor","_config$notification2","color","writeNotificationIconImageFilesAsync","removeNotificationIconImageFilesAsync","manifest","mainApplication","colors","assignColorValue","name","value","Promise","all","Object","values","dpiValues","map","folderName","scale","drawableFolderName","replace","dpiFolderPath","path","resolve","ANDROID_RES_PATH","fs","ensureDir","iconSizePx","resizedIcon","generateImageAsync","cacheType","src","width","height","resizeMode","backgroundColor","source","writeFile","e","Error","remove"],"sources":["../../../../src/plugins/unversioned/expo-notifications/withAndroidNotifications.ts"],"sourcesContent":["import {\n AndroidConfig,\n ConfigPlugin,\n withAndroidColors,\n withAndroidManifest,\n withDangerousMod,\n} from '@expo/config-plugins';\nimport { ExpoConfig } from '@expo/config-types';\nimport { generateImageAsync } from '@expo/image-utils';\nimport fs from 'fs-extra';\nimport path from 'path';\n\nimport { ANDROID_RES_PATH, dpiValues } from '../../icons/withAndroidIcons';\n\nconst { Colors } = AndroidConfig;\nconst {\n addMetaDataItemToMainApplication,\n getMainApplicationOrThrow,\n removeMetaDataItemFromMainApplication,\n} = AndroidConfig.Manifest;\n\ntype AndroidManifest = AndroidConfig.Manifest.AndroidManifest;\nconst BASELINE_PIXEL_SIZE = 24;\nexport const META_DATA_NOTIFICATION_ICON = 'expo.modules.notifications.default_notification_icon';\nexport const META_DATA_NOTIFICATION_ICON_COLOR =\n 'expo.modules.notifications.default_notification_color';\nexport const NOTIFICATION_ICON = 'notification_icon';\nexport const NOTIFICATION_ICON_RESOURCE = `@drawable/${NOTIFICATION_ICON}`;\nexport const NOTIFICATION_ICON_COLOR = 'notification_icon_color';\nexport const NOTIFICATION_ICON_COLOR_RESOURCE = `@color/${NOTIFICATION_ICON_COLOR}`;\n\nexport const withNotificationIcons: ConfigPlugin = (config) => {\n return withDangerousMod(config, [\n 'android',\n async (config) => {\n await setNotificationIconAsync(config, config.modRequest.projectRoot);\n return config;\n },\n ]);\n};\n\nexport const withNotificationIconColor: ConfigPlugin = (config) => {\n return withAndroidColors(config, (config) => {\n config.modResults = setNotificationIconColor(config, config.modResults);\n return config;\n });\n};\n\nexport const withNotificationManifest: ConfigPlugin = (config) => {\n return withAndroidManifest(config, (config) => {\n config.modResults = setNotificationConfig(config, config.modResults);\n return config;\n });\n};\n\nexport function getNotificationIcon(config: ExpoConfig) {\n return config.notification?.icon || null;\n}\n\nexport function getNotificationColor(config: ExpoConfig) {\n return config.notification?.color || null;\n}\n\n/**\n * Applies configuration for expo-notifications, including\n * the notification icon and notification color.\n */\nexport async function setNotificationIconAsync(config: ExpoConfig, projectRoot: string) {\n const icon = getNotificationIcon(config);\n if (icon) {\n await writeNotificationIconImageFilesAsync(icon, projectRoot);\n } else {\n await removeNotificationIconImageFilesAsync(projectRoot);\n }\n}\n\nexport function setNotificationConfig(config: ExpoConfig, manifest: AndroidManifest) {\n const icon = getNotificationIcon(config);\n const color = getNotificationColor(config);\n const mainApplication = getMainApplicationOrThrow(manifest);\n if (icon) {\n addMetaDataItemToMainApplication(\n mainApplication,\n META_DATA_NOTIFICATION_ICON,\n NOTIFICATION_ICON_RESOURCE,\n 'resource'\n );\n } else {\n removeMetaDataItemFromMainApplication(mainApplication, META_DATA_NOTIFICATION_ICON);\n }\n if (color) {\n addMetaDataItemToMainApplication(\n mainApplication,\n META_DATA_NOTIFICATION_ICON_COLOR,\n NOTIFICATION_ICON_COLOR_RESOURCE,\n 'resource'\n );\n } else {\n removeMetaDataItemFromMainApplication(mainApplication, META_DATA_NOTIFICATION_ICON_COLOR);\n }\n return manifest;\n}\n\nexport function setNotificationIconColor(\n config: ExpoConfig,\n colors: AndroidConfig.Resources.ResourceXML\n) {\n return Colors.assignColorValue(colors, {\n name: NOTIFICATION_ICON_COLOR,\n value: getNotificationColor(config),\n });\n}\n\nasync function writeNotificationIconImageFilesAsync(icon: string, projectRoot: string) {\n await Promise.all(\n Object.values(dpiValues).map(async ({ folderName, scale }) => {\n const drawableFolderName = folderName.replace('mipmap', 'drawable');\n const dpiFolderPath = path.resolve(projectRoot, ANDROID_RES_PATH, drawableFolderName);\n await fs.ensureDir(dpiFolderPath);\n const iconSizePx = BASELINE_PIXEL_SIZE * scale;\n\n try {\n const resizedIcon = (\n await generateImageAsync(\n { projectRoot, cacheType: 'android-notification' },\n {\n src: icon,\n width: iconSizePx,\n height: iconSizePx,\n resizeMode: 'cover',\n backgroundColor: 'transparent',\n }\n )\n ).source;\n await fs.writeFile(path.resolve(dpiFolderPath, NOTIFICATION_ICON + '.png'), resizedIcon);\n } catch (e) {\n throw new Error('Encountered an issue resizing Android notification icon: ' + e);\n }\n })\n );\n}\n\nasync function removeNotificationIconImageFilesAsync(projectRoot: string) {\n await Promise.all(\n Object.values(dpiValues).map(async ({ folderName }) => {\n const drawableFolderName = folderName.replace('mipmap', 'drawable');\n const dpiFolderPath = path.resolve(projectRoot, ANDROID_RES_PATH, drawableFolderName);\n await fs.remove(path.resolve(dpiFolderPath, NOTIFICATION_ICON + '.png'));\n })\n );\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,SAAA;EAAA,MAAAH,IAAA,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CAAC,CACH;AACH"}
|
|
1
|
+
{"version":3,"file":"withAndroidNotifications.js","names":["_configPlugins","data","require","_imageUtils","_fsExtra","_interopRequireDefault","_path","_withAndroidIcons","obj","__esModule","default","Colors","AndroidConfig","addMetaDataItemToMainApplication","getMainApplicationOrThrow","removeMetaDataItemFromMainApplication","Manifest","BASELINE_PIXEL_SIZE","META_DATA_NOTIFICATION_ICON","exports","META_DATA_NOTIFICATION_ICON_COLOR","NOTIFICATION_ICON","NOTIFICATION_ICON_RESOURCE","NOTIFICATION_ICON_COLOR","NOTIFICATION_ICON_COLOR_RESOURCE","withNotificationIcons","config","withDangerousMod","setNotificationIconAsync","modRequest","projectRoot","withNotificationIconColor","withAndroidColors","modResults","setNotificationIconColor","withNotificationManifest","withAndroidManifest","setNotificationConfig","getNotificationIcon","_config$notification","notification","icon","getNotificationColor","_config$notification2","color","writeNotificationIconImageFilesAsync","removeNotificationIconImageFilesAsync","manifest","mainApplication","colors","assignColorValue","name","value","Promise","all","Object","values","dpiValues","map","folderName","scale","drawableFolderName","replace","dpiFolderPath","path","resolve","ANDROID_RES_PATH","fs","ensureDir","iconSizePx","resizedIcon","generateImageAsync","cacheType","src","width","height","resizeMode","backgroundColor","source","writeFile","e","Error","remove"],"sources":["../../../../src/plugins/unversioned/expo-notifications/withAndroidNotifications.ts"],"sourcesContent":["import {\n AndroidConfig,\n ConfigPlugin,\n withAndroidColors,\n withAndroidManifest,\n withDangerousMod,\n} from '@expo/config-plugins';\nimport { ExpoConfig } from '@expo/config-types';\nimport { generateImageAsync } from '@expo/image-utils';\nimport fs from 'fs-extra';\nimport path from 'path';\n\nimport { ANDROID_RES_PATH, dpiValues } from '../../icons/withAndroidIcons';\n\nconst { Colors } = AndroidConfig;\nconst {\n addMetaDataItemToMainApplication,\n getMainApplicationOrThrow,\n removeMetaDataItemFromMainApplication,\n} = AndroidConfig.Manifest;\n\ntype AndroidManifest = AndroidConfig.Manifest.AndroidManifest;\nconst BASELINE_PIXEL_SIZE = 24;\nexport const META_DATA_NOTIFICATION_ICON = 'expo.modules.notifications.default_notification_icon';\nexport const META_DATA_NOTIFICATION_ICON_COLOR =\n 'expo.modules.notifications.default_notification_color';\nexport const NOTIFICATION_ICON = 'notification_icon';\nexport const NOTIFICATION_ICON_RESOURCE = `@drawable/${NOTIFICATION_ICON}`;\nexport const NOTIFICATION_ICON_COLOR = 'notification_icon_color';\nexport const NOTIFICATION_ICON_COLOR_RESOURCE = `@color/${NOTIFICATION_ICON_COLOR}`;\n\nexport const withNotificationIcons: ConfigPlugin = (config) => {\n return withDangerousMod(config, [\n 'android',\n async (config) => {\n await setNotificationIconAsync(config, config.modRequest.projectRoot);\n return config;\n },\n ]);\n};\n\nexport const withNotificationIconColor: ConfigPlugin = (config) => {\n return withAndroidColors(config, (config) => {\n config.modResults = setNotificationIconColor(config, config.modResults);\n return config;\n });\n};\n\nexport const withNotificationManifest: ConfigPlugin = (config) => {\n return withAndroidManifest(config, (config) => {\n config.modResults = setNotificationConfig(config, config.modResults);\n return config;\n });\n};\n\nexport function getNotificationIcon(config: ExpoConfig) {\n return config.notification?.icon || null;\n}\n\nexport function getNotificationColor(config: ExpoConfig) {\n return config.notification?.color || null;\n}\n\n/**\n * Applies configuration for expo-notifications, including\n * the notification icon and notification color.\n */\nexport async function setNotificationIconAsync(config: ExpoConfig, projectRoot: string) {\n const icon = getNotificationIcon(config);\n if (icon) {\n await writeNotificationIconImageFilesAsync(icon, projectRoot);\n } else {\n await removeNotificationIconImageFilesAsync(projectRoot);\n }\n}\n\nexport function setNotificationConfig(config: ExpoConfig, manifest: AndroidManifest) {\n const icon = getNotificationIcon(config);\n const color = getNotificationColor(config);\n const mainApplication = getMainApplicationOrThrow(manifest);\n if (icon) {\n addMetaDataItemToMainApplication(\n mainApplication,\n META_DATA_NOTIFICATION_ICON,\n NOTIFICATION_ICON_RESOURCE,\n 'resource'\n );\n } else {\n removeMetaDataItemFromMainApplication(mainApplication, META_DATA_NOTIFICATION_ICON);\n }\n if (color) {\n addMetaDataItemToMainApplication(\n mainApplication,\n META_DATA_NOTIFICATION_ICON_COLOR,\n NOTIFICATION_ICON_COLOR_RESOURCE,\n 'resource'\n );\n } else {\n removeMetaDataItemFromMainApplication(mainApplication, META_DATA_NOTIFICATION_ICON_COLOR);\n }\n return manifest;\n}\n\nexport function setNotificationIconColor(\n config: ExpoConfig,\n colors: AndroidConfig.Resources.ResourceXML\n) {\n return Colors.assignColorValue(colors, {\n name: NOTIFICATION_ICON_COLOR,\n value: getNotificationColor(config),\n });\n}\n\nasync function writeNotificationIconImageFilesAsync(icon: string, projectRoot: string) {\n await Promise.all(\n Object.values(dpiValues).map(async ({ folderName, scale }) => {\n const drawableFolderName = folderName.replace('mipmap', 'drawable');\n const dpiFolderPath = path.resolve(projectRoot, ANDROID_RES_PATH, drawableFolderName);\n await fs.ensureDir(dpiFolderPath);\n const iconSizePx = BASELINE_PIXEL_SIZE * scale;\n\n try {\n const resizedIcon = (\n await generateImageAsync(\n { projectRoot, cacheType: 'android-notification' },\n {\n src: icon,\n width: iconSizePx,\n height: iconSizePx,\n resizeMode: 'cover',\n backgroundColor: 'transparent',\n }\n )\n ).source;\n await fs.writeFile(path.resolve(dpiFolderPath, NOTIFICATION_ICON + '.png'), resizedIcon);\n } catch (e) {\n throw new Error('Encountered an issue resizing Android notification icon: ' + e);\n }\n })\n );\n}\n\nasync function removeNotificationIconImageFilesAsync(projectRoot: string) {\n await Promise.all(\n Object.values(dpiValues).map(async ({ folderName }) => {\n const drawableFolderName = folderName.replace('mipmap', 'drawable');\n const dpiFolderPath = path.resolve(projectRoot, ANDROID_RES_PATH, drawableFolderName);\n await fs.remove(path.resolve(dpiFolderPath, NOTIFICATION_ICON + '.png'));\n })\n );\n}\n"],"mappings":";;;;;;;;;;;;AAAA,SAAAA,eAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,cAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAQA,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AEoC,oCAAgB,EAAEL,kBAAkB,CAAC;IACrF,MAAMM,kBAAE,CAACe,MAAM,CAAClB,eAAI,CAACC,OAAO,CAACF,aAAa,EAAE1C,iBAAiB,GAAG,MAAM,CAAC,CAAC;EAC1E,CAAC,CACH,CAAC;AACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InterfaceBuilder.js","names":["_crypto","data","_interopRequireDefault","require","_xml2js","obj","__esModule","default","debug","createConstraint","firstItem","firstAttribute","secondItem","secondAttribute","constant","$","id","createConstraintId","attributes","crypto","createHash","update","join","digest","IMAGE_ID","CONTAINER_ID","removeImageFromSplashScreen","xml","imageName","mainView","document","scenes","scene","objects","viewController","view","removeExisting","subviews","imageView","getAbsoluteConstraints","forEach","constraint","constrainsArray","constraints","imageSection","resources","image","existingImageIndex","findIndex","name","splice","childId","parentId","applyImageToSplashScreenXML","contentMode","width","height","userLabel","horizontalHuggingPriority","verticalHuggingPriority","clipsSubviews","userInteractionEnabled","translatesAutoresizingMaskIntoConstraints","rect","key","x","y","ensureUniquePush","push","array","item","_item$$","existingItem","toString","builder","Builder","preserveChildrenOrder","xmldec","version","encoding","renderOpts","pretty","indent","buildObject","toObjectAsync","contents","Parser","parseStringPromise"],"sources":["../../../../src/plugins/unversioned/expo-splash-screen/InterfaceBuilder.ts"],"sourcesContent":["import crypto from 'crypto';\nimport { Builder, Parser } from 'xml2js';\n\nconst debug = require('debug')(\n 'expo:prebuild-config:expo-splash-screen:ios:InterfaceBuilder'\n) as typeof console.log;\n\nexport type IBBoolean = 'YES' | 'NO' | boolean;\n\nexport type IBItem<\n H extends Record<string, any>,\n B extends Record<string, any[]> = { [key: string]: any },\n> = {\n $: H;\n} & B;\n\nexport type Rect = {\n key: string;\n x: number;\n y: number;\n width: number;\n height: number;\n};\n\nexport type IBRect = IBItem<Rect>;\n\nexport type IBAutoresizingMask = IBItem<{\n /** @example `autoresizingMask` */\n key: string;\n flexibleMaxX: IBBoolean;\n flexibleMaxY: IBBoolean;\n}>;\n\n/** @example `<color key=\"textColor\" systemColor=\"linkColor\"/>` */\nexport type IBColor = IBItem<\n {\n /** @example `textColor` */\n key: string;\n } & (\n | /** Custom color */\n {\n /** @example `0.86584504117670746` */\n red: number;\n /** @example `0.26445041990630447` */\n green: number;\n /** @example `0.3248577810203549` */\n blue: number;\n /** @example `1` */\n alpha: number;\n colorSpace: 'custom' | string;\n customColorSpace: 'displayP3' | 'sRGB' | string;\n }\n /** Built-in color */\n | {\n systemColor: 'linkColor' | string;\n }\n )\n>;\n\nexport type IBFontDescription = IBItem<{\n /** @example `fontDescription` */\n key: string;\n /** Font size */\n pointSize: number;\n\n /** Custom font */\n name?: 'HelveticaNeue' | string;\n family?: 'Helvetica Neue' | string;\n\n /** Built-in font */\n type?: 'system' | 'boldSystem' | 'UICTFontTextStyleCallout' | 'UICTFontTextStyleBody' | string;\n}>;\n\nexport type ImageContentMode = 'scaleAspectFit' | 'scaleAspectFill';\n\nexport type ConstraintAttribute = 'top' | 'bottom' | 'trailing' | 'leading';\n\nexport type IBImageView = IBItem<\n {\n id: string;\n userLabel: string;\n image: string;\n clipsSubviews?: IBBoolean;\n userInteractionEnabled: IBBoolean;\n contentMode: IBContentMode;\n horizontalHuggingPriority: number;\n verticalHuggingPriority: number;\n insetsLayoutMarginsFromSafeArea?: IBBoolean;\n translatesAutoresizingMaskIntoConstraints?: IBBoolean;\n },\n {\n rect: IBRect[];\n }\n>;\n\nexport type IBLabel = IBItem<\n {\n id: string;\n /** The main value. */\n text: string;\n\n opaque: IBBoolean;\n fixedFrame: IBBoolean;\n textAlignment?: IBTextAlignment;\n lineBreakMode:\n | 'clip'\n | 'characterWrap'\n | 'wordWrap'\n | 'headTruncation'\n | 'middleTruncation'\n | 'tailTruncation';\n baselineAdjustment?: 'none' | 'alignBaselines';\n adjustsFontSizeToFit: IBBoolean;\n userInteractionEnabled: IBBoolean;\n contentMode: IBContentMode;\n horizontalHuggingPriority: number;\n verticalHuggingPriority: number;\n translatesAutoresizingMaskIntoConstraints?: IBBoolean;\n },\n {\n /** @example `<rect key=\"frame\" x=\"175\" y=\"670\" width=\"35\" height=\"17\"/>` */\n rect: IBRect[];\n /** @example `<autoresizingMask key=\"autoresizingMask\" flexibleMaxX=\"YES\" flexibleMaxY=\"YES\"/>` */\n autoresizingMask?: IBAutoresizingMask[];\n /** @example `<fontDescription key=\"fontDescription\" type=\"system\" pointSize=\"19\"/>` */\n fontDescription?: IBFontDescription[];\n /** @example `<color key=\"textColor\" red=\"0.0\" green=\"0.0\" blue=\"0.0\" alpha=\"1\" colorSpace=\"custom\" customColorSpace=\"sRGB\"/>` */\n color?: IBColor[];\n nil?: IBItem<{\n /** @example `textColor` `highlightedColor` */\n key: string;\n }>[];\n }\n>;\n\nexport type IBTextAlignment = 'left' | 'center' | 'right' | 'justified' | 'natural';\n\nexport type IBContentMode = string | 'left' | 'scaleAspectFill';\n\nexport type IBConstraint = IBItem<{\n firstItem: string;\n firstAttribute: ConstraintAttribute;\n secondItem: string;\n secondAttribute: ConstraintAttribute;\n constant?: number;\n id: string;\n}>;\n\nexport type IBViewController = IBItem<\n {\n id: string;\n placeholderIdentifier?: string;\n userLabel: string;\n sceneMemberID: string;\n },\n {\n view: IBItem<\n {\n id: string;\n key: string;\n userInteractionEnabled: IBBoolean;\n contentMode: string | 'scaleToFill';\n insetsLayoutMarginsFromSafeArea: IBBoolean;\n userLabel: string;\n },\n {\n rect: IBRect[];\n autoresizingMask: IBItem<{\n key: string;\n flexibleMaxX: IBBoolean;\n flexibleMaxY: IBBoolean;\n }>[];\n\n subviews: IBItem<\n object,\n {\n imageView: IBImageView[];\n label: IBLabel[];\n }\n >[];\n color: IBItem<{\n key: string | 'backgroundColor';\n systemColor: string | 'systemBackgroundColor';\n }>[];\n constraints: IBItem<\n object,\n {\n constraint: IBConstraint[];\n }\n >[];\n viewLayoutGuide: IBItem<{\n id: string;\n key: string | 'safeArea';\n }>[];\n }\n >[];\n }\n>;\n\nexport type IBPoint = IBItem<{\n key: string | 'canvasLocation';\n x: number;\n y: number;\n}>;\n\nexport type IBScene = IBItem<\n { sceneID: string },\n {\n objects: {\n viewController: IBViewController[];\n placeholder: IBItem<{\n id: string;\n placeholderIdentifier?: string;\n userLabel: string;\n sceneMemberID: string;\n }>[];\n }[];\n point: IBPoint[];\n }\n>;\n\nexport type IBResourceImage = IBItem<{\n name: string;\n width: number;\n height: number;\n}>;\n\nexport type IBDevice = IBItem<{\n id: string;\n orientation: string | 'portrait';\n appearance: string | 'light';\n}>;\n\nexport type IBSplashScreenDocument = {\n document: IBItem<\n {\n type: 'com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB' | string;\n version: '3.0' | string;\n toolsVersion: number;\n targetRuntime: 'iOS.CocoaTouch' | string;\n propertyAccessControl: 'none' | string;\n useAutolayout: IBBoolean;\n launchScreen: IBBoolean;\n useTraitCollections: IBBoolean;\n useSafeAreas: IBBoolean;\n colorMatched: IBBoolean;\n initialViewController: string;\n },\n {\n device: IBDevice[];\n dependencies: unknown[];\n scenes: {\n scene: IBScene[];\n }[];\n resources: {\n image: IBResourceImage[];\n }[];\n }\n >;\n};\n\nexport function createConstraint(\n [firstItem, firstAttribute]: [string, ConstraintAttribute],\n [secondItem, secondAttribute]: [string, ConstraintAttribute],\n constant?: number\n): IBConstraint {\n return {\n $: {\n firstItem,\n firstAttribute,\n secondItem,\n secondAttribute,\n constant,\n // Prevent updating between runs\n id: createConstraintId(firstItem, firstAttribute, secondItem, secondAttribute),\n },\n };\n}\n\nexport function createConstraintId(...attributes: string[]) {\n return crypto.createHash('sha1').update(attributes.join('-')).digest('hex');\n}\n\nconst IMAGE_ID = 'EXPO-SplashScreen';\nconst CONTAINER_ID = 'EXPO-ContainerView';\n\nexport function removeImageFromSplashScreen(\n xml: IBSplashScreenDocument,\n { imageName }: { imageName: string }\n) {\n const mainView = xml.document.scenes[0].scene[0].objects[0].viewController[0].view[0];\n\n debug(`Remove all splash screen image elements`);\n\n removeExisting(mainView.subviews[0].imageView, IMAGE_ID);\n\n // Add Constraints\n getAbsoluteConstraints(IMAGE_ID, CONTAINER_ID).forEach((constraint) => {\n // <constraint firstItem=\"EXPO-SplashScreen\" firstAttribute=\"top\" secondItem=\"EXPO-ContainerView\" secondAttribute=\"top\" id=\"2VS-Uz-0LU\"/>\n const constrainsArray = mainView.constraints[0].constraint;\n removeExisting(constrainsArray, constraint);\n });\n\n // Add resource\n const imageSection = xml.document.resources[0].image;\n\n const existingImageIndex = imageSection.findIndex((image) => image.$.name === imageName);\n if (existingImageIndex > -1) {\n imageSection.splice(existingImageIndex, 1);\n }\n return xml;\n}\n\nfunction getAbsoluteConstraints(childId: string, parentId: string) {\n return [\n createConstraint([childId, 'top'], [parentId, 'top']),\n createConstraint([childId, 'leading'], [parentId, 'leading']),\n createConstraint([childId, 'trailing'], [parentId, 'trailing']),\n createConstraint([childId, 'bottom'], [parentId, 'bottom']),\n ];\n}\n\nexport function applyImageToSplashScreenXML(\n xml: IBSplashScreenDocument,\n {\n imageName,\n contentMode,\n }: {\n imageName: string;\n contentMode: ImageContentMode;\n }\n): IBSplashScreenDocument {\n const width = 414;\n const height = 736;\n\n const imageView: IBImageView = {\n $: {\n id: IMAGE_ID,\n userLabel: imageName,\n image: imageName,\n contentMode,\n horizontalHuggingPriority: 251,\n verticalHuggingPriority: 251,\n clipsSubviews: true,\n userInteractionEnabled: false,\n translatesAutoresizingMaskIntoConstraints: false,\n },\n rect: [\n {\n $: {\n key: 'frame',\n x: 0.0,\n y: 0.0,\n width,\n height,\n },\n },\n ],\n };\n\n const mainView = xml.document.scenes[0].scene[0].objects[0].viewController[0].view[0];\n\n // Add ImageView\n ensureUniquePush(mainView.subviews[0].imageView, imageView);\n\n // Add Constraints\n getAbsoluteConstraints(IMAGE_ID, CONTAINER_ID).forEach((constraint) => {\n // <constraint firstItem=\"EXPO-SplashScreen\" firstAttribute=\"top\" secondItem=\"EXPO-ContainerView\" secondAttribute=\"top\" id=\"2VS-Uz-0LU\"/>\n const constrainsArray = mainView.constraints[0].constraint;\n ensureUniquePush(constrainsArray, constraint);\n });\n\n // Add resource\n const imageSection = xml.document.resources[0].image;\n\n const existingImageIndex = imageSection.findIndex((image) => image.$.name === imageName);\n if (existingImageIndex > -1) {\n debug(`Removing existing IB image asset at index ${existingImageIndex}`);\n imageSection.splice(existingImageIndex, 1);\n }\n imageSection.push({\n // <image name=\"SplashScreen\" width=\"414\" height=\"736\"/>\n $: {\n name: imageName,\n width,\n height,\n },\n });\n\n return xml;\n}\n\n/**\n * IB does not allow two items to have the same ID.\n * This method will add an item by first removing any existing item with the same `$.id`.\n */\nexport function ensureUniquePush<TItem extends { $: { id: string } }>(array: TItem[], item: TItem) {\n if (!array) return array;\n removeExisting(array, item);\n array.push(item);\n return array;\n}\n\nexport function removeExisting<TItem extends { $: { id: string } }>(\n array: TItem[],\n item: TItem | string\n) {\n const id = typeof item === 'string' ? item : item.$?.id;\n const existingItem = array?.findIndex((existingItem) => existingItem.$.id === id);\n if (existingItem > -1) {\n debug(`Removing existing IB item with id ${id}, from: %O`, array);\n array.splice(existingItem, 1);\n }\n return array;\n}\n\n// Attempt to copy Xcode formatting.\nexport function toString(xml: any): string {\n const builder = new Builder({\n // @ts-expect-error: untyped\n preserveChildrenOrder: true,\n xmldec: {\n version: '1.0',\n encoding: 'UTF-8',\n },\n renderOpts: {\n pretty: true,\n indent: ' ',\n },\n });\n return builder.buildObject(xml);\n}\n\n/** Parse string contents into an object. */\nexport function toObjectAsync(contents: string) {\n return new Parser().parseStringPromise(contents);\n}\n"],"mappings":";;;;;;;;;;;;;AAAA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAA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C,MAAM,EAAE,IAAI;MACZC,MAAM,EAAE;IACV;EACF,CAAC,CAAC;EACF,OAAOR,OAAO,CAACS,WAAW,CAACxD,GAAG,CAAC;AACjC;;AAEA;AACO,SAASyD,aAAaA,CAACC,QAAgB,EAAE;EAC9C,OAAO,KAAIC,gBAAM,GAAE,CAACC,kBAAkB,CAACF,QAAQ,CAAC;AAClD"}
|
|
1
|
+
{"version":3,"file":"InterfaceBuilder.js","names":["_crypto","data","_interopRequireDefault","require","_xml2js","obj","__esModule","default","debug","createConstraint","firstItem","firstAttribute","secondItem","secondAttribute","constant","$","id","createConstraintId","attributes","crypto","createHash","update","join","digest","IMAGE_ID","CONTAINER_ID","removeImageFromSplashScreen","xml","imageName","mainView","document","scenes","scene","objects","viewController","view","removeExisting","subviews","imageView","getAbsoluteConstraints","forEach","constraint","constrainsArray","constraints","imageSection","resources","image","existingImageIndex","findIndex","name","splice","childId","parentId","applyImageToSplashScreenXML","contentMode","width","height","userLabel","horizontalHuggingPriority","verticalHuggingPriority","clipsSubviews","userInteractionEnabled","translatesAutoresizingMaskIntoConstraints","rect","key","x","y","ensureUniquePush","push","array","item","_item$$","existingItem","toString","builder","Builder","preserveChildrenOrder","xmldec","version","encoding","renderOpts","pretty","indent","buildObject","toObjectAsync","contents","Parser","parseStringPromise"],"sources":["../../../../src/plugins/unversioned/expo-splash-screen/InterfaceBuilder.ts"],"sourcesContent":["import crypto from 'crypto';\nimport { Builder, Parser } from 'xml2js';\n\nconst debug = require('debug')(\n 'expo:prebuild-config:expo-splash-screen:ios:InterfaceBuilder'\n) as typeof console.log;\n\nexport type IBBoolean = 'YES' | 'NO' | boolean;\n\nexport type IBItem<\n H extends Record<string, any>,\n B extends Record<string, any[]> = { [key: string]: any },\n> = {\n $: H;\n} & B;\n\nexport type Rect = {\n key: string;\n x: number;\n y: number;\n width: number;\n height: number;\n};\n\nexport type IBRect = IBItem<Rect>;\n\nexport type IBAutoresizingMask = IBItem<{\n /** @example `autoresizingMask` */\n key: string;\n flexibleMaxX: IBBoolean;\n flexibleMaxY: IBBoolean;\n}>;\n\n/** @example `<color key=\"textColor\" systemColor=\"linkColor\"/>` */\nexport type IBColor = IBItem<\n {\n /** @example `textColor` */\n key: string;\n } & (\n | /** Custom color */\n {\n /** @example `0.86584504117670746` */\n red: number;\n /** @example `0.26445041990630447` */\n green: number;\n /** @example `0.3248577810203549` */\n blue: number;\n /** @example `1` */\n alpha: number;\n colorSpace: 'custom' | string;\n customColorSpace: 'displayP3' | 'sRGB' | string;\n }\n /** Built-in color */\n | {\n systemColor: 'linkColor' | string;\n }\n )\n>;\n\nexport type IBFontDescription = IBItem<{\n /** @example `fontDescription` */\n key: string;\n /** Font size */\n pointSize: number;\n\n /** Custom font */\n name?: 'HelveticaNeue' | string;\n family?: 'Helvetica Neue' | string;\n\n /** Built-in font */\n type?: 'system' | 'boldSystem' | 'UICTFontTextStyleCallout' | 'UICTFontTextStyleBody' | string;\n}>;\n\nexport type ImageContentMode = 'scaleAspectFit' | 'scaleAspectFill';\n\nexport type ConstraintAttribute = 'top' | 'bottom' | 'trailing' | 'leading';\n\nexport type IBImageView = IBItem<\n {\n id: string;\n userLabel: string;\n image: string;\n clipsSubviews?: IBBoolean;\n userInteractionEnabled: IBBoolean;\n contentMode: IBContentMode;\n horizontalHuggingPriority: number;\n verticalHuggingPriority: number;\n insetsLayoutMarginsFromSafeArea?: IBBoolean;\n translatesAutoresizingMaskIntoConstraints?: IBBoolean;\n },\n {\n rect: IBRect[];\n }\n>;\n\nexport type IBLabel = IBItem<\n {\n id: string;\n /** The main value. */\n text: string;\n\n opaque: IBBoolean;\n fixedFrame: IBBoolean;\n textAlignment?: IBTextAlignment;\n lineBreakMode:\n | 'clip'\n | 'characterWrap'\n | 'wordWrap'\n | 'headTruncation'\n | 'middleTruncation'\n | 'tailTruncation';\n baselineAdjustment?: 'none' | 'alignBaselines';\n adjustsFontSizeToFit: IBBoolean;\n userInteractionEnabled: IBBoolean;\n contentMode: IBContentMode;\n horizontalHuggingPriority: number;\n verticalHuggingPriority: number;\n translatesAutoresizingMaskIntoConstraints?: IBBoolean;\n },\n {\n /** @example `<rect key=\"frame\" x=\"175\" y=\"670\" width=\"35\" height=\"17\"/>` */\n rect: IBRect[];\n /** @example `<autoresizingMask key=\"autoresizingMask\" flexibleMaxX=\"YES\" flexibleMaxY=\"YES\"/>` */\n autoresizingMask?: IBAutoresizingMask[];\n /** @example `<fontDescription key=\"fontDescription\" type=\"system\" pointSize=\"19\"/>` */\n fontDescription?: IBFontDescription[];\n /** @example `<color key=\"textColor\" red=\"0.0\" green=\"0.0\" blue=\"0.0\" alpha=\"1\" colorSpace=\"custom\" customColorSpace=\"sRGB\"/>` */\n color?: IBColor[];\n nil?: IBItem<{\n /** @example `textColor` `highlightedColor` */\n key: string;\n }>[];\n }\n>;\n\nexport type IBTextAlignment = 'left' | 'center' | 'right' | 'justified' | 'natural';\n\nexport type IBContentMode = string | 'left' | 'scaleAspectFill';\n\nexport type IBConstraint = IBItem<{\n firstItem: string;\n firstAttribute: ConstraintAttribute;\n secondItem: string;\n secondAttribute: ConstraintAttribute;\n constant?: number;\n id: string;\n}>;\n\nexport type IBViewController = IBItem<\n {\n id: string;\n placeholderIdentifier?: string;\n userLabel: string;\n sceneMemberID: string;\n },\n {\n view: IBItem<\n {\n id: string;\n key: string;\n userInteractionEnabled: IBBoolean;\n contentMode: string | 'scaleToFill';\n insetsLayoutMarginsFromSafeArea: IBBoolean;\n userLabel: string;\n },\n {\n rect: IBRect[];\n autoresizingMask: IBItem<{\n key: string;\n flexibleMaxX: IBBoolean;\n flexibleMaxY: IBBoolean;\n }>[];\n\n subviews: IBItem<\n object,\n {\n imageView: IBImageView[];\n label: IBLabel[];\n }\n >[];\n color: IBItem<{\n key: string | 'backgroundColor';\n systemColor: string | 'systemBackgroundColor';\n }>[];\n constraints: IBItem<\n object,\n {\n constraint: IBConstraint[];\n }\n >[];\n viewLayoutGuide: IBItem<{\n id: string;\n key: string | 'safeArea';\n }>[];\n }\n >[];\n }\n>;\n\nexport type IBPoint = IBItem<{\n key: string | 'canvasLocation';\n x: number;\n y: number;\n}>;\n\nexport type IBScene = IBItem<\n { sceneID: string },\n {\n objects: {\n viewController: IBViewController[];\n placeholder: IBItem<{\n id: string;\n placeholderIdentifier?: string;\n userLabel: string;\n sceneMemberID: string;\n }>[];\n }[];\n point: IBPoint[];\n }\n>;\n\nexport type IBResourceImage = IBItem<{\n name: string;\n width: number;\n height: number;\n}>;\n\nexport type IBDevice = IBItem<{\n id: string;\n orientation: string | 'portrait';\n appearance: string | 'light';\n}>;\n\nexport type IBSplashScreenDocument = {\n document: IBItem<\n {\n type: 'com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB' | string;\n version: '3.0' | string;\n toolsVersion: number;\n targetRuntime: 'iOS.CocoaTouch' | string;\n propertyAccessControl: 'none' | string;\n useAutolayout: IBBoolean;\n launchScreen: IBBoolean;\n useTraitCollections: IBBoolean;\n useSafeAreas: IBBoolean;\n colorMatched: IBBoolean;\n initialViewController: string;\n },\n {\n device: IBDevice[];\n dependencies: unknown[];\n scenes: {\n scene: IBScene[];\n }[];\n resources: {\n image: IBResourceImage[];\n }[];\n }\n >;\n};\n\nexport function createConstraint(\n [firstItem, firstAttribute]: [string, ConstraintAttribute],\n [secondItem, secondAttribute]: [string, ConstraintAttribute],\n constant?: number\n): IBConstraint {\n return {\n $: {\n firstItem,\n firstAttribute,\n secondItem,\n secondAttribute,\n constant,\n // Prevent updating between runs\n id: createConstraintId(firstItem, firstAttribute, secondItem, secondAttribute),\n },\n };\n}\n\nexport function createConstraintId(...attributes: string[]) {\n return crypto.createHash('sha1').update(attributes.join('-')).digest('hex');\n}\n\nconst IMAGE_ID = 'EXPO-SplashScreen';\nconst CONTAINER_ID = 'EXPO-ContainerView';\n\nexport function removeImageFromSplashScreen(\n xml: IBSplashScreenDocument,\n { imageName }: { imageName: string }\n) {\n const mainView = xml.document.scenes[0].scene[0].objects[0].viewController[0].view[0];\n\n debug(`Remove all splash screen image elements`);\n\n removeExisting(mainView.subviews[0].imageView, IMAGE_ID);\n\n // Add Constraints\n getAbsoluteConstraints(IMAGE_ID, CONTAINER_ID).forEach((constraint) => {\n // <constraint firstItem=\"EXPO-SplashScreen\" firstAttribute=\"top\" secondItem=\"EXPO-ContainerView\" secondAttribute=\"top\" id=\"2VS-Uz-0LU\"/>\n const constrainsArray = mainView.constraints[0].constraint;\n removeExisting(constrainsArray, constraint);\n });\n\n // Add resource\n const imageSection = xml.document.resources[0].image;\n\n const existingImageIndex = imageSection.findIndex((image) => image.$.name === imageName);\n if (existingImageIndex > -1) {\n imageSection.splice(existingImageIndex, 1);\n }\n return xml;\n}\n\nfunction getAbsoluteConstraints(childId: string, parentId: string) {\n return [\n createConstraint([childId, 'top'], [parentId, 'top']),\n createConstraint([childId, 'leading'], [parentId, 'leading']),\n createConstraint([childId, 'trailing'], [parentId, 'trailing']),\n createConstraint([childId, 'bottom'], [parentId, 'bottom']),\n ];\n}\n\nexport function applyImageToSplashScreenXML(\n xml: IBSplashScreenDocument,\n {\n imageName,\n contentMode,\n }: {\n imageName: string;\n contentMode: ImageContentMode;\n }\n): IBSplashScreenDocument {\n const width = 414;\n const height = 736;\n\n const imageView: IBImageView = {\n $: {\n id: IMAGE_ID,\n userLabel: imageName,\n image: imageName,\n contentMode,\n horizontalHuggingPriority: 251,\n verticalHuggingPriority: 251,\n clipsSubviews: true,\n userInteractionEnabled: false,\n translatesAutoresizingMaskIntoConstraints: false,\n },\n rect: [\n {\n $: {\n key: 'frame',\n x: 0.0,\n y: 0.0,\n width,\n height,\n },\n },\n ],\n };\n\n const mainView = xml.document.scenes[0].scene[0].objects[0].viewController[0].view[0];\n\n // Add ImageView\n ensureUniquePush(mainView.subviews[0].imageView, imageView);\n\n // Add Constraints\n getAbsoluteConstraints(IMAGE_ID, CONTAINER_ID).forEach((constraint) => {\n // <constraint firstItem=\"EXPO-SplashScreen\" firstAttribute=\"top\" secondItem=\"EXPO-ContainerView\" secondAttribute=\"top\" id=\"2VS-Uz-0LU\"/>\n const constrainsArray = mainView.constraints[0].constraint;\n ensureUniquePush(constrainsArray, constraint);\n });\n\n // Add resource\n const imageSection = xml.document.resources[0].image;\n\n const existingImageIndex = imageSection.findIndex((image) => image.$.name === imageName);\n if (existingImageIndex > -1) {\n debug(`Removing existing IB image asset at index ${existingImageIndex}`);\n imageSection.splice(existingImageIndex, 1);\n }\n imageSection.push({\n // <image name=\"SplashScreen\" width=\"414\" height=\"736\"/>\n $: {\n name: imageName,\n width,\n height,\n },\n });\n\n return xml;\n}\n\n/**\n * IB does not allow two items to have the same ID.\n * This method will add an item by first removing any existing item with the same `$.id`.\n */\nexport function ensureUniquePush<TItem extends { $: { id: string } }>(array: TItem[], item: TItem) {\n if (!array) return array;\n removeExisting(array, item);\n array.push(item);\n return array;\n}\n\nexport function removeExisting<TItem extends { $: { id: string } }>(\n array: TItem[],\n item: TItem | string\n) {\n const id = typeof item === 'string' ? item : item.$?.id;\n const existingItem = array?.findIndex((existingItem) => existingItem.$.id === id);\n if (existingItem > -1) {\n debug(`Removing existing IB item with id ${id}, from: %O`, array);\n array.splice(existingItem, 1);\n }\n return array;\n}\n\n// Attempt to copy Xcode formatting.\nexport function toString(xml: any): string {\n const builder = new Builder({\n // @ts-expect-error: untyped\n preserveChildrenOrder: true,\n xmldec: {\n version: '1.0',\n encoding: 'UTF-8',\n },\n renderOpts: {\n pretty: true,\n indent: ' ',\n },\n });\n return builder.buildObject(xml);\n}\n\n/** Parse string contents into an object. */\nexport function toObjectAsync(contents: string) {\n return new Parser().parseStringPromise(contents);\n}\n"],"mappings":";;;;;;;;;;;;;AAAA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,OAAA,YAAAA,CAA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E;IACZ,CAAC;IACDC,UAAU,EAAE;MACVC,MAAM,EAAE,IAAI;MACZC,MAAM,EAAE;IACV;EACF,CAAC,CAAC;EACF,OAAOR,OAAO,CAACS,WAAW,CAACxD,GAAG,CAAC;AACjC;;AAEA;AACO,SAASyD,aAAaA,CAACC,QAAgB,EAAE;EAC9C,OAAO,KAAIC,gBAAM,EAAC,CAAC,CAACC,kBAAkB,CAACF,QAAQ,CAAC;AAClD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withAndroidSplashImages.js","names":["_configPlugins","data","require","_imageUtils","_fsExtra","_interopRequireDefault","_path","_getAndroidSplashConfig","obj","__esModule","default","IMAGE_CACHE_NAME","SPLASH_SCREEN_FILENAME","DRAWABLES_CONFIGS","modes","light","path","dark","dimensionsMultiplier","mdpi","hdpi","xhdpi","xxhdpi","xxxhdpi","withAndroidSplashImages","config","withDangerousMod","setSplashImageDrawablesAsync","modRequest","projectRoot","exports","clearAllExistingSplashImagesAsync","splash","getAndroidSplashConfig","darkSplash","getAndroidDarkSplashConfig","Promise","all","setSplashImageDrawablesForThemeAsync","androidMainPath","join","Object","values","map","filePath","fs","pathExists","resolve","remove","theme","imageKey","image","source","generateImageAsync","cacheType","src","outputPath","folder","dirname","ensureDir","writeFile"],"sources":["../../../../src/plugins/unversioned/expo-splash-screen/withAndroidSplashImages.ts"],"sourcesContent":["import { ConfigPlugin, withDangerousMod } from '@expo/config-plugins';\nimport { ExpoConfig } from '@expo/config-types';\nimport { generateImageAsync } from '@expo/image-utils';\nimport fs from 'fs-extra';\nimport path from 'path';\n\nimport {\n getAndroidDarkSplashConfig,\n getAndroidSplashConfig,\n SplashScreenConfig,\n} from './getAndroidSplashConfig';\n\ntype DRAWABLE_SIZE = 'default' | 'mdpi' | 'hdpi' | 'xhdpi' | 'xxhdpi' | 'xxxhdpi';\ntype THEME = 'light' | 'dark';\n\nconst IMAGE_CACHE_NAME = 'splash-android';\nconst SPLASH_SCREEN_FILENAME = 'splashscreen_image.png';\nconst DRAWABLES_CONFIGS: {\n [key in DRAWABLE_SIZE]: {\n modes: {\n [key in THEME]: {\n path: string;\n };\n };\n dimensionsMultiplier: number;\n };\n} = {\n default: {\n modes: {\n light: {\n path: `./res/drawable/${SPLASH_SCREEN_FILENAME}`,\n },\n dark: {\n path: `./res/drawable-night/${SPLASH_SCREEN_FILENAME}`,\n },\n },\n dimensionsMultiplier: 1,\n },\n mdpi: {\n modes: {\n light: {\n path: `./res/drawable-mdpi/${SPLASH_SCREEN_FILENAME}`,\n },\n dark: {\n path: `./res/drawable-night-mdpi/${SPLASH_SCREEN_FILENAME}`,\n },\n },\n dimensionsMultiplier: 1,\n },\n hdpi: {\n modes: {\n light: {\n path: `./res/drawable-hdpi/${SPLASH_SCREEN_FILENAME}`,\n },\n dark: {\n path: `./res/drawable-night-hdpi/${SPLASH_SCREEN_FILENAME}`,\n },\n },\n dimensionsMultiplier: 1.5,\n },\n xhdpi: {\n modes: {\n light: {\n path: `./res/drawable-xhdpi/${SPLASH_SCREEN_FILENAME}`,\n },\n dark: {\n path: `./res/drawable-night-xhdpi/${SPLASH_SCREEN_FILENAME}`,\n },\n },\n dimensionsMultiplier: 2,\n },\n xxhdpi: {\n modes: {\n light: {\n path: `./res/drawable-xxhdpi/${SPLASH_SCREEN_FILENAME}`,\n },\n dark: {\n path: `./res/drawable-night-xxhdpi/${SPLASH_SCREEN_FILENAME}`,\n },\n },\n dimensionsMultiplier: 3,\n },\n xxxhdpi: {\n modes: {\n light: {\n path: `./res/drawable-xxxhdpi/${SPLASH_SCREEN_FILENAME}`,\n },\n dark: {\n path: `./res/drawable-night-xxxhdpi/${SPLASH_SCREEN_FILENAME}`,\n },\n },\n dimensionsMultiplier: 4,\n },\n};\n\nexport const withAndroidSplashImages: ConfigPlugin = (config) => {\n return withDangerousMod(config, [\n 'android',\n async (config) => {\n await setSplashImageDrawablesAsync(config, config.modRequest.projectRoot);\n return config;\n },\n ]);\n};\n\n/**\n * Deletes all previous splash_screen_images and copies new one to desired drawable directory.\n * If path isn't provided then no new image is placed in drawable directories.\n * @see https://developer.android.com/training/multiscreen/screendensities\n *\n * @param androidMainPath Absolute path to the main directory containing code and resources in Android project. In general that would be `android/app/src/main`.\n */\nexport async function setSplashImageDrawablesAsync(\n config: Pick<ExpoConfig, 'android' | 'splash'>,\n projectRoot: string\n) {\n await clearAllExistingSplashImagesAsync(projectRoot);\n\n const splash = getAndroidSplashConfig(config);\n const darkSplash = getAndroidDarkSplashConfig(config);\n\n await Promise.all([\n setSplashImageDrawablesForThemeAsync(splash, 'light', projectRoot),\n setSplashImageDrawablesForThemeAsync(darkSplash, 'dark', projectRoot),\n ]);\n}\n\nasync function clearAllExistingSplashImagesAsync(projectRoot: string) {\n const androidMainPath = path.join(projectRoot, 'android/app/src/main');\n\n await Promise.all(\n Object.values(DRAWABLES_CONFIGS).map(async ({ modes }) => {\n await Promise.all(\n Object.values(modes).map(async ({ path: filePath }) => {\n if (await fs.pathExists(path.resolve(androidMainPath, filePath))) {\n await fs.remove(path.resolve(androidMainPath, filePath));\n }\n })\n );\n })\n );\n}\n\nexport async function setSplashImageDrawablesForThemeAsync(\n config: SplashScreenConfig | null,\n theme: 'dark' | 'light',\n projectRoot: string\n) {\n if (!config) return;\n const androidMainPath = path.join(projectRoot, 'android/app/src/main');\n\n await Promise.all(\n ['mdpi', 'hdpi', 'xhdpi', 'xxhdpi', 'xxxhdpi'].map(async (imageKey) => {\n // @ts-ignore\n const image = config[imageKey];\n if (image) {\n // Using this method will cache the images in `.expo` based on the properties used to generate them.\n // this method also supports remote URLs and using the global sharp instance.\n const { source } = await generateImageAsync({ projectRoot, cacheType: IMAGE_CACHE_NAME }, {\n src: image,\n } as any);\n\n // Get output path for drawable.\n const outputPath = path.join(\n androidMainPath,\n // @ts-ignore\n DRAWABLES_CONFIGS[imageKey].modes[theme].path\n );\n // Ensure directory exists.\n const folder = path.dirname(outputPath);\n await fs.ensureDir(folder);\n // Write image buffer to the file system.\n await fs.write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Ae,GAAGvB,eAAI,CAACwB,IAAI,CAACX,WAAW,EAAE,sBAAsB,CAAC;EAEtE,MAAMO,OAAO,CAACC,GAAG,CACf,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,CAAC,CAACM,GAAG,CAAC,MAAOO,QAAQ,IAAK;IACrE;IACA,MAAMC,KAAK,GAAG1B,MAAM,CAACyB,QAAQ,CAAC;IAC9B,IAAIC,KAAK,EAAE;MACT;MACA;MACA,MAAM;QAAEC;MAAO,CAAC,GAAG,MAAM,IAAAC,gCAAkB,EAAC;QAAExB,WAAW;QAAEyB,SAAS,EAAE3C;MAAiB,CAAC,EAAE;QACxF4C,GAAG,EAAEJ;MACP,CAAC,CAAQ;;MAET;MACA,MAAMK,UAAU,GAAGxC,eAAI,CAACwB,IAAI,CAC1BD,eAAe;MACf;MACA1B,iBAAiB,CAACqC,QAAQ,CAAC,CAACpC,KAAK,CAACmC,KAAK,CAAC,CAACjC,IAAI,CAC9C;MACD;MACA,MAAMyC,MAAM,GAAGzC,eAAI,CAAC0C,OAAO,CAACF,UAAU,CAAC;MACvC,MAAMX,kBAAE,CAACc,SAAS,CAACF,MAAM,CAAC;MAC1B;MACA,MAAMZ,kBAAE,CAACe,SAAS,CAACJ,UAAU,EAAEJ,MAAM,CAAC;IACxC;IACA,OAAO,IAAI;EACb,CAAC,CAAC,CACH;AACH"}
|
|
1
|
+
{"version":3,"file":"withAndroidSplashImages.js","names":["_configPlugins","data","require","_imageUtils","_fsExtra","_interopRequireDefault","_path","_getAndroidSplashConfig","obj","__esModule","default","IMAGE_CACHE_NAME","SPLASH_SCREEN_FILENAME","DRAWABLES_CONFIGS","modes","light","path","dark","dimensionsMultiplier","mdpi","hdpi","xhdpi","xxhdpi","xxxhdpi","withAndroidSplashImages","config","withDangerousMod","setSplashImageDrawablesAsync","modRequest","projectRoot","exports","clearAllExistingSplashImagesAsync","splash","getAndroidSplashConfig","darkSplash","getAndroidDarkSplashConfig","Promise","all","setSplashImageDrawablesForThemeAsync","androidMainPath","join","Object","values","map","filePath","fs","pathExists","resolve","remove","theme","imageKey","image","source","generateImageAsync","cacheType","src","outputPath","folder","dirname","ensureDir","writeFile"],"sources":["../../../../src/plugins/unversioned/expo-splash-screen/withAndroidSplashImages.ts"],"sourcesContent":["import { ConfigPlugin, withDangerousMod } from '@expo/config-plugins';\nimport { ExpoConfig } from '@expo/config-types';\nimport { generateImageAsync } from '@expo/image-utils';\nimport fs from 'fs-extra';\nimport path from 'path';\n\nimport {\n getAndroidDarkSplashConfig,\n getAndroidSplashConfig,\n SplashScreenConfig,\n} from './getAndroidSplashConfig';\n\ntype DRAWABLE_SIZE = 'default' | 'mdpi' | 'hdpi' | 'xhdpi' | 'xxhdpi' | 'xxxhdpi';\ntype THEME = 'light' | 'dark';\n\nconst IMAGE_CACHE_NAME = 'splash-android';\nconst SPLASH_SCREEN_FILENAME = 'splashscreen_image.png';\nconst DRAWABLES_CONFIGS: {\n [key in DRAWABLE_SIZE]: {\n modes: {\n [key in THEME]: {\n path: string;\n };\n };\n dimensionsMultiplier: number;\n };\n} = {\n default: {\n modes: {\n light: {\n path: `./res/drawable/${SPLASH_SCREEN_FILENAME}`,\n },\n dark: {\n path: `./res/drawable-night/${SPLASH_SCREEN_FILENAME}`,\n },\n },\n dimensionsMultiplier: 1,\n },\n mdpi: {\n modes: {\n light: {\n path: `./res/drawable-mdpi/${SPLASH_SCREEN_FILENAME}`,\n },\n dark: {\n path: `./res/drawable-night-mdpi/${SPLASH_SCREEN_FILENAME}`,\n },\n },\n dimensionsMultiplier: 1,\n },\n hdpi: {\n modes: {\n light: {\n path: `./res/drawable-hdpi/${SPLASH_SCREEN_FILENAME}`,\n },\n dark: {\n path: `./res/drawable-night-hdpi/${SPLASH_SCREEN_FILENAME}`,\n },\n },\n dimensionsMultiplier: 1.5,\n },\n xhdpi: {\n modes: {\n light: {\n path: `./res/drawable-xhdpi/${SPLASH_SCREEN_FILENAME}`,\n },\n dark: {\n path: `./res/drawable-night-xhdpi/${SPLASH_SCREEN_FILENAME}`,\n },\n },\n dimensionsMultiplier: 2,\n },\n xxhdpi: {\n modes: {\n light: {\n path: `./res/drawable-xxhdpi/${SPLASH_SCREEN_FILENAME}`,\n },\n dark: {\n path: `./res/drawable-night-xxhdpi/${SPLASH_SCREEN_FILENAME}`,\n },\n },\n dimensionsMultiplier: 3,\n },\n xxxhdpi: {\n modes: {\n light: {\n path: `./res/drawable-xxxhdpi/${SPLASH_SCREEN_FILENAME}`,\n },\n dark: {\n path: `./res/drawable-night-xxxhdpi/${SPLASH_SCREEN_FILENAME}`,\n },\n },\n dimensionsMultiplier: 4,\n },\n};\n\nexport const withAndroidSplashImages: ConfigPlugin = (config) => {\n return withDangerousMod(config, [\n 'android',\n async (config) => {\n await setSplashImageDrawablesAsync(config, config.modRequest.projectRoot);\n return config;\n },\n ]);\n};\n\n/**\n * Deletes all previous splash_screen_images and copies new one to desired drawable directory.\n * If path isn't provided then no new image is placed in drawable directories.\n * @see https://developer.android.com/training/multiscreen/screendensities\n *\n * @param androidMainPath Absolute path to the main directory containing code and resources in Android project. In general that would be `android/app/src/main`.\n */\nexport async function setSplashImageDrawablesAsync(\n config: Pick<ExpoConfig, 'android' | 'splash'>,\n projectRoot: string\n) {\n await clearAllExistingSplashImagesAsync(projectRoot);\n\n const splash = getAndroidSplashConfig(config);\n const darkSplash = getAndroidDarkSplashConfig(config);\n\n await Promise.all([\n setSplashImageDrawablesForThemeAsync(splash, 'light', projectRoot),\n setSplashImageDrawablesForThemeAsync(darkSplash, 'dark', projectRoot),\n ]);\n}\n\nasync function clearAllExistingSplashImagesAsync(projectRoot: string) {\n const androidMainPath = path.join(projectRoot, 'android/app/src/main');\n\n await Promise.all(\n Object.values(DRAWABLES_CONFIGS).map(async ({ modes }) => {\n await Promise.all(\n Object.values(modes).map(async ({ path: filePath }) => {\n if (await fs.pathExists(path.resolve(androidMainPath, filePath))) {\n await fs.remove(path.resolve(androidMainPath, filePath));\n }\n })\n );\n })\n );\n}\n\nexport async function setSplashImageDrawablesForThemeAsync(\n config: SplashScreenConfig | null,\n theme: 'dark' | 'light',\n projectRoot: string\n) {\n if (!config) return;\n const androidMainPath = path.join(projectRoot, 'android/app/src/main');\n\n await Promise.all(\n ['mdpi', 'hdpi', 'xhdpi', 'xxhdpi', 'xxxhdpi'].map(async (imageKey) => {\n // @ts-ignore\n const image = config[imageKey];\n if (image) {\n // Using this method will cache the images in `.expo` based on the properties used to generate them.\n // this method also supports remote URLs and using the global sharp instance.\n const { source } = await generateImageAsync({ projectRoot, cacheType: IMAGE_CACHE_NAME }, {\n src: image,\n } as any);\n\n // Get output path for drawable.\n const outputPath = path.join(\n androidMainPath,\n // @ts-ignore\n DRAWABLES_CONFIGS[imageKey].modes[theme].path\n );\n // Ensure directory exists.\n const folder = path.dirname(outputPath);\n await fs.ensureDir(folder);\n // Write image buffer to the file system.\n await fs.writeFile(outputPath, source);\n }\n return null;\n })\n );\n}\n"],"mappings":";;;;;;;;AAAA,SAAAA,eAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,cAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAE,YAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,WAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,SAAA;EAAA,MAAAH,IAAA,GAAAI,sBAAA,CAAAH,OAAA;EAAAE,QAAA,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,wBAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,uBAAA,YA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C0C,OAAO,CAACF,UAAU,CAAC;MACvC,MAAMX,kBAAE,CAACc,SAAS,CAACF,MAAM,CAAC;MAC1B;MACA,MAAMZ,kBAAE,CAACe,SAAS,CAACJ,UAAU,EAAEJ,MAAM,CAAC;IACxC;IACA,OAAO,IAAI;EACb,CAAC,CACH,CAAC;AACH"}
|
package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashLegacyMainActivity.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withAndroidSplashLegacyMainActivity.js","names":["_configPlugins","data","require","_codeMod","_generateCode","_debug","_interopRequireDefault","_getAndroidSplashConfig","obj","__esModule","default","debug","Debug","SHOW_SPLASH_ID","withAndroidSplashLegacyMainActivity","config","withMainActivity","modResults","contents","setSplashScreenLegacyMainActivity","language","exports","mainActivity","_config$androidStatus","splashConfig","getAndroidSplashConfig","mod","removeContents","src","tag","didClear","statusBarTranslucent","androidStatusBar","translucent","resizeMode","isJava","LE","addImports","match","onCreateBlock","mergeContents","anchor","offset","comment","newSrc","join","split","filter","line","test","toUpperCase"],"sources":["../../../../src/plugins/unversioned/expo-splash-screen/withAndroidSplashLegacyMainActivity.ts"],"sourcesContent":["import { ConfigPlugin, withMainActivity } from '@expo/config-plugins';\nimport { addImports } from '@expo/config-plugins/build/android/codeMod';\nimport { mergeContents, removeContents } from '@expo/config-plugins/build/utils/generateCode';\nimport { ExpoConfig } from '@expo/config-types';\nimport Debug from 'debug';\n\nimport { getAndroidSplashConfig } from './getAndroidSplashConfig';\n\nconst debug = Debug('expo:prebuild-config:expo-splash-screen:android:mainActivity');\n\n// DO NOT CHANGE\nconst SHOW_SPLASH_ID = 'expo-splash-screen-mainActivity-onCreate-show-splash';\n\nexport const withAndroidSplashLegacyMainActivity: ConfigPlugin = (config) => {\n return withMainActivity(config, (config) => {\n config.modResults.contents = setSplashScreenLegacyMainActivity(\n config,\n config.modResults.contents,\n config.modResults.language\n );\n return config;\n });\n};\n\nexport function setSplashScreenLegacyMainActivity(\n config: Pick<ExpoConfig, 'android' | 'androidStatusBar' | 'userInterfaceStyle'>,\n mainActivity: string,\n language: 'java' | 'kt'\n): string {\n debug(`Modify with language: \"${language}\"`);\n const splashConfig = getAndroidSplashConfig(config);\n\n if (!splashConfig) {\n // Remove our generated code safely...\n const mod = removeContents({\n src: mainActivity,\n tag: SHOW_SPLASH_ID,\n });\n\n mainActivity = mod.contents;\n if (mod.didClear) {\n debug('Removed SplashScreen.show()');\n }\n return mainActivity;\n }\n // TODO: Translucent is weird\n const statusBarTranslucent = !!config.androidStatusBar?.translucent;\n\n const { resizeMode } = splashConfig;\n const isJava = language === 'java';\n const LE = isJava ? ';' : '';\n\n mainActivity = addImports(\n mainActivity,\n [\n 'expo.modules.splashscreen.singletons.SplashScreen',\n 'expo.modules.splashscreen.SplashScreenImageResizeMode',\n 'com.facebook.react.ReactRootView',\n 'android.os.Bundle',\n ],\n isJava\n );\n\n if (!mainActivity.match(/(?<=^.*super\\.onCreate.*$)/m)) {\n const onCreateBlock = isJava\n ? [\n ' @Override',\n ' protected void onCreate(Bundle savedInstanceState) {',\n ' super.onCreate(savedInstanceState);',\n ' }',\n ]\n : [\n ' override fun onCreate(savedInstanceState: Bundle?) {',\n ' super.onCreate(savedInstanceState)',\n ' }',\n ];\n\n mainActivity = mergeContents({\n src: mainActivity,\n // insert just below super.onCreate\n anchor: isJava\n ? /(?<=public\\s+class\\s+.*\\s+extends\\s+.*\\s+{.*$)/m\n : /(?<=class\\s+.*\\s+:\\s+.*\\s+{.*$)/m,\n offset: 1,\n comment: '//',\n tag: 'expo-splash-screen-mainActivity-onCreate',\n newSrc: onCreateBlock.join('\\n'),\n }).contents;\n }\n\n // Remove our generated code safely...\n mainActivity = removeContents({\n src: mainActivity,\n tag: SHOW_SPLASH_ID,\n }).contents;\n\n // Remove code from `@expo/configure-splash-screen`\n mainActivity = mainActivity\n .split('\\n')\n .filter((line) => {\n return !/SplashScreen\\.show\\(this,\\s?SplashScreenImageResizeMode\\./.test(line);\n })\n .join('\\n');\n\n // Reapply generated code.\n mainActivity = mergeContents({\n src: mainActivity,\n // insert just below super.onCreate\n anchor: /(?<=^.*super\\.onCreate.*$)/m,\n offset: 1,\n comment: '//',\n tag: SHOW_SPLASH_ID,\n newSrc: ` SplashScreen.show(this, SplashScreenImageResizeMode.${resizeMode.toUpperCase()}, ReactRootView${\n isJava ? '.class' : '::class.java'\n }, ${statusBarTranslucent})${LE}`,\n }).contents;\n\n // TODO: Remove old `SplashScreen.show`\n\n return mainActivity;\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,SAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,QAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,cAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,aAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAI,OAAA;EAAA,MAAAJ,IAAA,GAAAK,sBAAA,CAAAJ,OAAA;EAAAG,MAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAM,wBAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,uBAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAkE,SAAAK,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAElE,MAAMG,KAAK,GAAG,IAAAC,gBAAK,EAAC,8DAA8D,CAAC;;AAEnF;AACA,MAAMC,cAAc,GAAG,sDAAsD;AAEtE,MAAMC,mCAAiD,GAAIC,MAAM,IAAK;EAC3E,OAAO,IAAAC,iCAAgB,EAACD,MAAM,EAAGA,MAAM,IAAK;IAC1CA,MAAM,CAACE,UAAU,CAACC,QAAQ,GAAGC,iCAAiC,CAC5DJ,MAAM,EACNA,MAAM,CAACE,UAAU,CAACC,QAAQ,EAC1BH,MAAM,CAACE,UAAU,CAACG,
|
|
1
|
+
{"version":3,"file":"withAndroidSplashLegacyMainActivity.js","names":["_configPlugins","data","require","_codeMod","_generateCode","_debug","_interopRequireDefault","_getAndroidSplashConfig","obj","__esModule","default","debug","Debug","SHOW_SPLASH_ID","withAndroidSplashLegacyMainActivity","config","withMainActivity","modResults","contents","setSplashScreenLegacyMainActivity","language","exports","mainActivity","_config$androidStatus","splashConfig","getAndroidSplashConfig","mod","removeContents","src","tag","didClear","statusBarTranslucent","androidStatusBar","translucent","resizeMode","isJava","LE","addImports","match","onCreateBlock","mergeContents","anchor","offset","comment","newSrc","join","split","filter","line","test","toUpperCase"],"sources":["../../../../src/plugins/unversioned/expo-splash-screen/withAndroidSplashLegacyMainActivity.ts"],"sourcesContent":["import { ConfigPlugin, withMainActivity } from '@expo/config-plugins';\nimport { addImports } from '@expo/config-plugins/build/android/codeMod';\nimport { mergeContents, removeContents } from '@expo/config-plugins/build/utils/generateCode';\nimport { ExpoConfig } from '@expo/config-types';\nimport Debug from 'debug';\n\nimport { getAndroidSplashConfig } from './getAndroidSplashConfig';\n\nconst debug = Debug('expo:prebuild-config:expo-splash-screen:android:mainActivity');\n\n// DO NOT CHANGE\nconst SHOW_SPLASH_ID = 'expo-splash-screen-mainActivity-onCreate-show-splash';\n\nexport const withAndroidSplashLegacyMainActivity: ConfigPlugin = (config) => {\n return withMainActivity(config, (config) => {\n config.modResults.contents = setSplashScreenLegacyMainActivity(\n config,\n config.modResults.contents,\n config.modResults.language\n );\n return config;\n });\n};\n\nexport function setSplashScreenLegacyMainActivity(\n config: Pick<ExpoConfig, 'android' | 'androidStatusBar' | 'userInterfaceStyle'>,\n mainActivity: string,\n language: 'java' | 'kt'\n): string {\n debug(`Modify with language: \"${language}\"`);\n const splashConfig = getAndroidSplashConfig(config);\n\n if (!splashConfig) {\n // Remove our generated code safely...\n const mod = removeContents({\n src: mainActivity,\n tag: SHOW_SPLASH_ID,\n });\n\n mainActivity = mod.contents;\n if (mod.didClear) {\n debug('Removed SplashScreen.show()');\n }\n return mainActivity;\n }\n // TODO: Translucent is weird\n const statusBarTranslucent = !!config.androidStatusBar?.translucent;\n\n const { resizeMode } = splashConfig;\n const isJava = language === 'java';\n const LE = isJava ? ';' : '';\n\n mainActivity = addImports(\n mainActivity,\n [\n 'expo.modules.splashscreen.singletons.SplashScreen',\n 'expo.modules.splashscreen.SplashScreenImageResizeMode',\n 'com.facebook.react.ReactRootView',\n 'android.os.Bundle',\n ],\n isJava\n );\n\n if (!mainActivity.match(/(?<=^.*super\\.onCreate.*$)/m)) {\n const onCreateBlock = isJava\n ? [\n ' @Override',\n ' protected void onCreate(Bundle savedInstanceState) {',\n ' super.onCreate(savedInstanceState);',\n ' }',\n ]\n : [\n ' override fun onCreate(savedInstanceState: Bundle?) {',\n ' super.onCreate(savedInstanceState)',\n ' }',\n ];\n\n mainActivity = mergeContents({\n src: mainActivity,\n // insert just below super.onCreate\n anchor: isJava\n ? /(?<=public\\s+class\\s+.*\\s+extends\\s+.*\\s+{.*$)/m\n : /(?<=class\\s+.*\\s+:\\s+.*\\s+{.*$)/m,\n offset: 1,\n comment: '//',\n tag: 'expo-splash-screen-mainActivity-onCreate',\n newSrc: onCreateBlock.join('\\n'),\n }).contents;\n }\n\n // Remove our generated code safely...\n mainActivity = removeContents({\n src: mainActivity,\n tag: SHOW_SPLASH_ID,\n }).contents;\n\n // Remove code from `@expo/configure-splash-screen`\n mainActivity = mainActivity\n .split('\\n')\n .filter((line) => {\n return !/SplashScreen\\.show\\(this,\\s?SplashScreenImageResizeMode\\./.test(line);\n })\n .join('\\n');\n\n // Reapply generated code.\n mainActivity = mergeContents({\n src: mainActivity,\n // insert just below super.onCreate\n anchor: /(?<=^.*super\\.onCreate.*$)/m,\n offset: 1,\n comment: '//',\n tag: SHOW_SPLASH_ID,\n newSrc: ` SplashScreen.show(this, SplashScreenImageResizeMode.${resizeMode.toUpperCase()}, ReactRootView${\n isJava ? '.class' : '::class.java'\n }, ${statusBarTranslucent})${LE}`,\n }).contents;\n\n // TODO: Remove old `SplashScreen.show`\n\n return mainActivity;\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,SAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,QAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,cAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,aAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAI,OAAA;EAAA,MAAAJ,IAAA,GAAAK,sBAAA,CAAAJ,OAAA;EAAAG,MAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAM,wBAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,uBAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAkE,SAAAK,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAElE,MAAMG,KAAK,GAAG,IAAAC,gBAAK,EAAC,8DAA8D,CAAC;;AAEnF;AACA,MAAMC,cAAc,GAAG,sDAAsD;AAEtE,MAAMC,mCAAiD,GAAIC,MAAM,IAAK;EAC3E,OAAO,IAAAC,iCAAg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configPlugins","data","require","_jsonFile","_interopRequireDefault","_resolveFrom","_semver","_getAndroidSplashConfig","_withAndroidSplashDrawables","_withAndroidSplashImages","_withAndroidSplashLegacyMainActivity","_withAndroidSplashStrings","_withAndroidSplashStyles","obj","__esModule","default","withAndroidSplashScreen","config","_config$androidStatus","splashConfig","getAndroidSplashConfig","backgroundColor","androidStatusBar","_config$androidStatus2","_config$androidStatus3","_config$androidStatus4","toLowerCase","call","WarningAggregator","addWarningAndroid","withPlugins","withAndroidSplashImages","withAndroidSplashDrawables","shouldUpdateLegacyMainActivity","withAndroidSplashLegacyMainActivity","withAndroidSplashStyles","withAndroidSplashStrings","exports","_config$_internal","projectRoot","_internal","packagePath","resolveFrom","_JsonFile$read$versio","_JsonFile$read$versio2","version","JsonFile","read","toString","semver","lt","sdkVersion"],"sources":["../../../../src/plugins/unversioned/expo-splash-screen/withAndroidSplashScreen.ts"],"sourcesContent":["import { ConfigPlugin, WarningAggregator, withPlugins } from '@expo/config-plugins';\nimport { ExpoConfig } from '@expo/config-types';\nimport JsonFile from '@expo/json-file';\nimport resolveFrom from 'resolve-from';\nimport semver from 'semver';\n\nimport { getAndroidSplashConfig } from './getAndroidSplashConfig';\nimport { withAndroidSplashDrawables } from './withAndroidSplashDrawables';\nimport { withAndroidSplashImages } from './withAndroidSplashImages';\nimport { withAndroidSplashLegacyMainActivity } from './withAndroidSplashLegacyMainActivity';\nimport { withAndroidSplashStrings } from './withAndroidSplashStrings';\nimport { withAndroidSplashStyles } from './withAndroidSplashStyles';\n\nexport const withAndroidSplashScreen: ConfigPlugin = (config) => {\n const splashConfig = getAndroidSplashConfig(config);\n\n // Update the android status bar to match the splash screen\n // androidStatusBar applies info to the app activity style.\n const backgroundColor = splashConfig?.backgroundColor || '#ffffff';\n if (config.androidStatusBar?.backgroundColor) {\n if (\n backgroundColor.toLowerCase() !== config.androidStatusBar?.backgroundColor?.toLowerCase?.()\n ) {\n WarningAggregator.addWarningAndroid(\n 'androidStatusBar.backgroundColor',\n 'Color conflicts with the splash.backgroundColor'\n );\n }\n } else {\n if (!config.androidStatusBar) config.androidStatusBar = {};\n config.androidStatusBar.backgroundColor = backgroundColor;\n }\n\n return withPlugins(config, [\n withAndroidSplashImages,\n [withAndroidSplashDrawables, splashConfig],\n ...(shouldUpdateLegacyMainActivity(config) ? [withAndroidSplashLegacyMainActivity] : []),\n withAndroidSplashStyles,\n withAndroidSplashStrings,\n ]);\n};\n\nfunction shouldUpdateLegacyMainActivity(config: ExpoConfig): boolean {\n try {\n const projectRoot = config._internal?.projectRoot;\n const packagePath = resolveFrom(projectRoot, 'expo-splash-screen/package.json');\n if (packagePath) {\n const version = JsonFile.read(packagePath).version?.toString() ?? '';\n return semver.lt(version, '0.12.0');\n }\n // If expo-splash-screen didn't be installed or included in template, we check the sdkVersion instead.\n return !!(config.sdkVersion && semver.lt(config.sdkVersion, '43.0.0'));\n } catch {}\n return false;\n}\n"],"mappings":";;;;;;AAAA,SAAAA,eAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,cAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,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;AAEA,SAAAM,wBAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,uBAAA,YAAAA,CAAA;IAAA,OAAA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withAndroidSplashScreen.js","names":["_configPlugins","data","require","_jsonFile","_interopRequireDefault","_resolveFrom","_semver","_getAndroidSplashConfig","_withAndroidSplashDrawables","_withAndroidSplashImages","_withAndroidSplashLegacyMainActivity","_withAndroidSplashStrings","_withAndroidSplashStyles","obj","__esModule","default","withAndroidSplashScreen","config","_config$androidStatus","splashConfig","getAndroidSplashConfig","backgroundColor","androidStatusBar","_config$androidStatus2","_config$androidStatus3","_config$androidStatus4","toLowerCase","call","WarningAggregator","addWarningAndroid","withPlugins","withAndroidSplashImages","withAndroidSplashDrawables","shouldUpdateLegacyMainActivity","withAndroidSplashLegacyMainActivity","withAndroidSplashStyles","withAndroidSplashStrings","exports","_config$_internal","projectRoot","_internal","packagePath","resolveFrom","_JsonFile$read$versio","_JsonFile$read$versio2","version","JsonFile","read","toString","semver","lt","sdkVersion"],"sources":["../../../../src/plugins/unversioned/expo-splash-screen/withAndroidSplashScreen.ts"],"sourcesContent":["import { ConfigPlugin, WarningAggregator, withPlugins } from '@expo/config-plugins';\nimport { ExpoConfig } from '@expo/config-types';\nimport JsonFile from '@expo/json-file';\nimport resolveFrom from 'resolve-from';\nimport semver from 'semver';\n\nimport { getAndroidSplashConfig } from './getAndroidSplashConfig';\nimport { withAndroidSplashDrawables } from './withAndroidSplashDrawables';\nimport { withAndroidSplashImages } from './withAndroidSplashImages';\nimport { withAndroidSplashLegacyMainActivity } from './withAndroidSplashLegacyMainActivity';\nimport { withAndroidSplashStrings } from './withAndroidSplashStrings';\nimport { withAndroidSplashStyles } from './withAndroidSplashStyles';\n\nexport const withAndroidSplashScreen: ConfigPlugin = (config) => {\n const splashConfig = getAndroidSplashConfig(config);\n\n // Update the android status bar to match the splash screen\n // androidStatusBar applies info to the app activity style.\n const backgroundColor = splashConfig?.backgroundColor || '#ffffff';\n if (config.androidStatusBar?.backgroundColor) {\n if (\n backgroundColor.toLowerCase() !== config.androidStatusBar?.backgroundColor?.toLowerCase?.()\n ) {\n WarningAggregator.addWarningAndroid(\n 'androidStatusBar.backgroundColor',\n 'Color conflicts with the splash.backgroundColor'\n );\n }\n } else {\n if (!config.androidStatusBar) config.androidStatusBar = {};\n config.androidStatusBar.backgroundColor = backgroundColor;\n }\n\n return withPlugins(config, [\n withAndroidSplashImages,\n [withAndroidSplashDrawables, splashConfig],\n ...(shouldUpdateLegacyMainActivity(config) ? [withAndroidSplashLegacyMainActivity] : []),\n withAndroidSplashStyles,\n withAndroidSplashStrings,\n ]);\n};\n\nfunction shouldUpdateLegacyMainActivity(config: ExpoConfig): boolean {\n try {\n const projectRoot = config._internal?.projectRoot;\n const packagePath = resolveFrom(projectRoot, 'expo-splash-screen/package.json');\n if (packagePath) {\n const version = JsonFile.read(packagePath).version?.toString() ?? '';\n return semver.lt(version, '0.12.0');\n }\n // If expo-splash-screen didn't be installed or included in template, we check the sdkVersion instead.\n return !!(config.sdkVersion && semver.lt(config.sdkVersion, '43.0.0'));\n } catch {}\n return false;\n}\n"],"mappings":";;;;;;AAAA,SAAAA,eAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,cAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,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;AAEA,SAAAM,wBAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,uBAAA,YA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C,cAAAL,qBAAA,cAAAA,qBAAA,GAAI,EAAE;MACpE,OAAOM,iBAAM,CAACC,EAAE,CAACL,OAAO,EAAE,QAAQ,CAAC;IACrC;IACA;IACA,OAAO,CAAC,EAAE5B,MAAM,CAACkC,UAAU,IAAIF,iBAAM,CAACC,EAAE,CAACjC,MAAM,CAACkC,UAAU,EAAE,QAAQ,CAAC,CAAC;EACxE,CAAC,CAAC,MAAM,CAAC;EACT,OAAO,KAAK;AACd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withAndroidSplashStrings.js","names":["_configPlugins","data","require","_getAndroidSplashConfig","RESIZE_MODE_KEY","STATUS_BAR_TRANSLUCENT_KEY","withAndroidSplashStrings","config","withStringsXml","splashConfig","getAndroidSplashConfig","_config$androidStatus","resizeMode","statusBarTranslucent","androidStatusBar","translucent","modResults","setSplashStrings","exports","strings","AndroidConfig","Strings","setStringItem","Resources","buildResourceItem","name","value","translatable","String"],"sources":["../../../../src/plugins/unversioned/expo-splash-screen/withAndroidSplashStrings.ts"],"sourcesContent":["import { AndroidConfig, ConfigPlugin, withStringsXml } from '@expo/config-plugins';\n\nimport { getAndroidSplashConfig } from './getAndroidSplashConfig';\n\nconst RESIZE_MODE_KEY = 'expo_splash_screen_resize_mode';\nconst STATUS_BAR_TRANSLUCENT_KEY = 'expo_splash_screen_status_bar_translucent';\n\nexport const withAndroidSplashStrings: ConfigPlugin = (config) => {\n return withStringsXml(config, (config) => {\n const splashConfig = getAndroidSplashConfig(config);\n if (splashConfig) {\n const { resizeMode } = splashConfig;\n const statusBarTranslucent = !!config.androidStatusBar?.translucent;\n config.modResults = setSplashStrings(config.modResults, resizeMode, statusBarTranslucent);\n }\n return config;\n });\n};\n\nexport function setSplashStrings(\n strings: AndroidConfig.Resources.ResourceXML,\n resizeMode: string,\n statusBarTranslucent: boolean\n): AndroidConfig.Resources.ResourceXML {\n return AndroidConfig.Strings.setStringItem(\n [\n AndroidConfig.Resources.buildResourceItem({\n name: RESIZE_MODE_KEY,\n value: resizeMode,\n translatable: false,\n }),\n AndroidConfig.Resources.buildResourceItem({\n name: STATUS_BAR_TRANSLUCENT_KEY,\n value: String(statusBarTranslucent),\n translatable: false,\n }),\n ],\n strings\n );\n}\n"],"mappings":";;;;;;;AAAA,SAAAA,eAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,cAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAE,wBAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,uBAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,MAAMG,eAAe,GAAG,gCAAgC;AACxD,MAAMC,0BAA0B,GAAG,2CAA2C;AAEvE,MAAMC,wBAAsC,GAAIC,MAAM,IAAK;EAChE,OAAO,IAAAC,+BAAc,EAACD,MAAM,EAAGA,MAAM,IAAK;IACxC,MAAME,YAAY,GAAG,IAAAC,gDAAsB,EAACH,MAAM,CAAC;IACnD,IAAIE,YAAY,EAAE;MAAA,IAAAE,qBAAA;MAChB,MAAM;QAAEC;MAAW,CAAC,GAAGH,YAAY;MACnC,MAAMI,oBAAoB,GAAG,CAAC,GAAAF,qBAAA,GAACJ,MAAM,CAACO,gBAAgB,cAAAH,qBAAA,eAAvBA,qBAAA,CAAyBI,WAAW;MACnER,MAAM,CAACS,UAAU,GAAGC,gBAAgB,CAACV,MAAM,CAACS,UAAU,EAAEJ,UAAU,EAAEC,oBAAoB,CAAC;IAC3F;IACA,OAAON,MAAM;EACf,CAAC,CAAC;AACJ,CAAC;AAACW,OAAA,CAAAZ,wBAAA,GAAAA,wBAAA;AAEK,SAASW,gBAAgBA,CAC9BE,OAA4C,EAC5CP,UAAkB,EAClBC,oBAA6B,EACQ;EACrC,OAAOO,8BAAa,CAACC,OAAO,CAACC,aAAa,CACxC,CACEF,8BAAa,CAACG,SAAS,CAACC,iBAAiB,CAAC;IACxCC,IAAI,EAAErB,eAAe;IACrBsB,KAAK,EAAEd,UAAU;IACjBe,YAAY,EAAE;EAChB,CAAC,CAAC,EACFP,8BAAa,CAACG,SAAS,CAACC,iBAAiB,CAAC;IACxCC,IAAI,EAAEpB,0BAA0B;IAChCqB,KAAK,EAAEE,MAAM,CAACf,oBAAoB,CAAC;IACnCc,YAAY,EAAE;EAChB,CAAC,CAAC,CACH,EACDR,
|
|
1
|
+
{"version":3,"file":"withAndroidSplashStrings.js","names":["_configPlugins","data","require","_getAndroidSplashConfig","RESIZE_MODE_KEY","STATUS_BAR_TRANSLUCENT_KEY","withAndroidSplashStrings","config","withStringsXml","splashConfig","getAndroidSplashConfig","_config$androidStatus","resizeMode","statusBarTranslucent","androidStatusBar","translucent","modResults","setSplashStrings","exports","strings","AndroidConfig","Strings","setStringItem","Resources","buildResourceItem","name","value","translatable","String"],"sources":["../../../../src/plugins/unversioned/expo-splash-screen/withAndroidSplashStrings.ts"],"sourcesContent":["import { AndroidConfig, ConfigPlugin, withStringsXml } from '@expo/config-plugins';\n\nimport { getAndroidSplashConfig } from './getAndroidSplashConfig';\n\nconst RESIZE_MODE_KEY = 'expo_splash_screen_resize_mode';\nconst STATUS_BAR_TRANSLUCENT_KEY = 'expo_splash_screen_status_bar_translucent';\n\nexport const withAndroidSplashStrings: ConfigPlugin = (config) => {\n return withStringsXml(config, (config) => {\n const splashConfig = getAndroidSplashConfig(config);\n if (splashConfig) {\n const { resizeMode } = splashConfig;\n const statusBarTranslucent = !!config.androidStatusBar?.translucent;\n config.modResults = setSplashStrings(config.modResults, resizeMode, statusBarTranslucent);\n }\n return config;\n });\n};\n\nexport function setSplashStrings(\n strings: AndroidConfig.Resources.ResourceXML,\n resizeMode: string,\n statusBarTranslucent: boolean\n): AndroidConfig.Resources.ResourceXML {\n return AndroidConfig.Strings.setStringItem(\n [\n AndroidConfig.Resources.buildResourceItem({\n name: RESIZE_MODE_KEY,\n value: resizeMode,\n translatable: false,\n }),\n AndroidConfig.Resources.buildResourceItem({\n name: STATUS_BAR_TRANSLUCENT_KEY,\n value: String(statusBarTranslucent),\n translatable: false,\n }),\n ],\n strings\n );\n}\n"],"mappings":";;;;;;;AAAA,SAAAA,eAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,cAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAE,wBAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,uBAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,MAAMG,eAAe,GAAG,gCAAgC;AACxD,MAAMC,0BAA0B,GAAG,2CAA2C;AAEvE,MAAMC,wBAAsC,GAAIC,MAAM,IAAK;EAChE,OAAO,IAAAC,+BAAc,EAACD,MAAM,EAAGA,MAAM,IAAK;IACxC,MAAME,YAAY,GAAG,IAAAC,gDAAsB,EAACH,MAAM,CAAC;IACnD,IAAIE,YAAY,EAAE;MAAA,IAAAE,qBAAA;MAChB,MAAM;QAAEC;MAAW,CAAC,GAAGH,YAAY;MACnC,MAAMI,oBAAoB,GAAG,CAAC,GAAAF,qBAAA,GAACJ,MAAM,CAACO,gBAAgB,cAAAH,qBAAA,eAAvBA,qBAAA,CAAyBI,WAAW;MACnER,MAAM,CAACS,UAAU,GAAGC,gBAAgB,CAACV,MAAM,CAACS,UAAU,EAAEJ,UAAU,EAAEC,oBAAoB,CAAC;IAC3F;IACA,OAAON,MAAM;EACf,CAAC,CAAC;AACJ,CAAC;AAACW,OAAA,CAAAZ,wBAAA,GAAAA,wBAAA;AAEK,SAASW,gBAAgBA,CAC9BE,OAA4C,EAC5CP,UAAkB,EAClBC,oBAA6B,EACQ;EACrC,OAAOO,8BAAa,CAACC,OAAO,CAACC,aAAa,CACxC,CACEF,8BAAa,CAACG,SAAS,CAACC,iBAAiB,CAAC;IACxCC,IAAI,EAAErB,eAAe;IACrBsB,KAAK,EAAEd,UAAU;IACjBe,YAAY,EAAE;EAChB,CAAC,CAAC,EACFP,8BAAa,CAACG,SAAS,CAACC,iBAAiB,CAAC;IACxCC,IAAI,EAAEpB,0BAA0B;IAChCqB,KAAK,EAAEE,MAAM,CAACf,oBAAoB,CAAC;IACnCc,YAAY,EAAE;EAChB,CAAC,CAAC,CACH,EACDR,OACF,CAAC;AACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withIosSplashAssets.js","names":["_configPlugins","data","require","_imageUtils","_debug","_interopRequireDefault","_fsExtra","_jimpCompact","path","_interopRequireWildcard","_AssetContents","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","debug","Debug","IMAGE_CACHE_NAME","IMAGESET_PATH","BACKGROUND_IMAGESET_PATH","PNG_FILENAME","DARK_PNG_FILENAME","TABLET_PNG_FILENAME","DARK_TABLET_PNG_FILENAME","withIosSplashAssets","config","splash","withDangerousMod","_splash$dark","_splash$dark2","iosNamedProjectRoot","IOSConfig","Paths","getSourceRoot","modRequest","projectRoot","createSplashScreenBackgroundImageAsync","configureImageAssets","image","darkImage","dark","tabletImage","darkTabletImage","exports","imageSetPath","resolve","fs","remove","writeContentsJsonFileAsync","assetPath","copyImageFiles","createPngFileAsync","color","filePath","png","Jimp","writeAsync","createBackgroundImagesAsync","darkColor","tabletColor","darkTabletColor","generateImagesAssetsAsync","generateImageAsset","item","fileName","anyItem","darkItem","tabletItem","darkTabletItem","source","generateImageAsync","cacheType","src","writeFile","items","filter","Promise","all","map","_splash$dark3","_splash$dark4","backgroundColor","tabletBackgroundColor","imagesetPath","join","ensureDir","darkAppearances","appearance","value","buildContentsJsonImages","createContentsJsonItem","idiom","filename","scale","appearances","undefined","Boolean","images","writeContentsJsonAsync"],"sources":["../../../../src/plugins/unversioned/expo-splash-screen/withIosSplashAssets.ts"],"sourcesContent":["import { ConfigPlugin, IOSConfig, withDangerousMod } from '@expo/config-plugins';\nimport { generateImageAsync } from '@expo/image-utils';\nimport Debug from 'debug';\nimport fs from 'fs-extra';\n// @ts-ignore\nimport Jimp from 'jimp-compact';\nimport * as path from 'path';\n\nimport { IOSSplashConfig } from './getIosSplashConfig';\nimport {\n ContentsJsonImage,\n ContentsJsonImageAppearance,\n createContentsJsonItem,\n writeContentsJsonAsync,\n} from '../../icons/AssetContents';\n\nconst debug = Debug('expo:prebuild-config:expo-splash-screen:ios:assets');\n\nconst IMAGE_CACHE_NAME = 'splash-ios';\nconst IMAGESET_PATH = 'Images.xcassets/SplashScreen.imageset';\nconst BACKGROUND_IMAGESET_PATH = 'Images.xcassets/SplashScreenBackground.imageset';\nconst PNG_FILENAME = 'image.png';\nconst DARK_PNG_FILENAME = 'dark_image.png';\nconst TABLET_PNG_FILENAME = 'tablet_image.png';\nconst DARK_TABLET_PNG_FILENAME = 'dark_tablet_image.png';\n\nexport const withIosSplashAssets: ConfigPlugin<IOSSplashConfig> = (config, splash) => {\n if (!splash) {\n return config;\n }\n return withDangerousMod(config, [\n 'ios',\n async (config) => {\n const iosNamedProjectRoot = IOSConfig.Paths.getSourceRoot(config.modRequest.projectRoot);\n\n await createSplashScreenBackgroundImageAsync({\n iosNamedProjectRoot,\n splash,\n });\n\n await configureImageAssets({\n projectRoot: config.modRequest.projectRoot,\n iosNamedProjectRoot,\n image: splash.image,\n darkImage: splash.dark?.image,\n tabletImage: splash.tabletImage,\n darkTabletImage: splash.dark?.tabletImage,\n });\n\n return config;\n },\n ]);\n};\n\n/**\n * Creates imageset containing image for Splash/Launch Screen.\n */\nasync function configureImageAssets({\n projectRoot,\n iosNamedProjectRoot,\n image,\n darkImage,\n tabletImage,\n darkTabletImage,\n}: {\n projectRoot: string;\n iosNamedProjectRoot: string;\n image?: string | null;\n darkImage?: string | null;\n tabletImage: string | null;\n darkTabletImage?: string | null;\n}) {\n const imageSetPath = path.resolve(iosNamedProjectRoot, IMAGESET_PATH);\n\n // ensure old SplashScreen imageSet is removed\n await fs.remove(imageSetPath);\n\n if (!image) {\n return;\n }\n\n await writeContentsJsonFileAsync({\n assetPath: imageSetPath,\n image: PNG_FILENAME,\n darkImage: darkImage ? DARK_PNG_FILENAME : null,\n tabletImage: tabletImage ? TABLET_PNG_FILENAME : null,\n darkTabletImage: darkTabletImage ? DARK_TABLET_PNG_FILENAME : null,\n });\n\n await copyImageFiles({\n projectRoot,\n iosNamedProjectRoot,\n image,\n darkImage,\n tabletImage,\n darkTabletImage,\n });\n}\n\nasync function createPngFileAsync(color: string, filePath: string) {\n const png = new Jimp(1, 1, color);\n return png.writeAsync(filePath);\n}\n\nasync function createBackgroundImagesAsync({\n iosNamedProjectRoot,\n color,\n darkColor,\n tabletColor,\n darkTabletColor,\n}: {\n iosNamedProjectRoot: string;\n color: string;\n darkColor: string | null;\n tabletColor: string | null;\n darkTabletColor: string | null;\n}) {\n await generateImagesAssetsAsync({\n async generateImageAsset(item, fileName) {\n await createPngFileAsync(\n item,\n path.resolve(iosNamedProjectRoot, BACKGROUND_IMAGESET_PATH, fileName)\n );\n },\n anyItem: color,\n darkItem: darkColor,\n tabletItem: tabletColor,\n darkTabletItem: darkTabletColor,\n });\n}\n\nasync function copyImageFiles({\n projectRoot,\n iosNamedProjectRoot,\n image,\n darkImage,\n tabletImage,\n darkTabletImage,\n}: {\n projectRoot: string;\n iosNamedProjectRoot: string;\n image: string;\n darkImage?: string | null;\n tabletImage?: string | null;\n darkTabletImage?: string | null;\n}) {\n await generateImagesAssetsAsync({\n async generateImageAsset(item, fileName) {\n // Using this method will cache the images in `.expo` based on the properties used to generate them.\n // this method also supports remote URLs and using the global sharp instance.\n const { source } = await generateImageAsync({ projectRoot, cacheType: IMAGE_CACHE_NAME }, {\n src: item,\n } as any);\n // Write image buffer to the file system.\n // const assetPath = join(iosNamedProjectRoot, IMAGESET_PATH, filename);\n await fs.writeFile(path.resolve(iosNamedProjectRoot, IMAGESET_PATH, fileName), source);\n },\n anyItem: image,\n darkItem: darkImage,\n tabletItem: tabletImage,\n darkTabletItem: darkTabletImage,\n });\n}\n\nasync function generateImagesAssetsAsync({\n generateImageAsset,\n anyItem,\n darkItem,\n tabletItem,\n darkTabletItem,\n}: {\n generateImageAsset: (item: string, fileName: string) => Promise<void>;\n anyItem: string;\n darkItem?: string | null;\n tabletItem?: string | null;\n darkTabletItem?: string | null;\n}) {\n const items = [\n [anyItem, PNG_FILENAME],\n [darkItem, DARK_PNG_FILENAME],\n [tabletItem, TABLET_PNG_FILENAME],\n [darkTabletItem, DARK_TABLET_PNG_FILENAME],\n ].filter(([item]) => !!item) as unknown as [string, string];\n\n await Promise.all(items.map(([item, fileName]) => generateImageAsset(item, fileName)));\n}\n\nasync function createSplashScreenBackgroundImageAsync({\n iosNamedProjectRoot,\n splash,\n}: {\n // Something like projectRoot/ios/MyApp/\n iosNamedProjectRoot: string;\n splash: IOSSplashConfig;\n}) {\n const color = splash.backgroundColor;\n const darkColor = splash.dark?.backgroundColor;\n const tabletColor = splash.tabletBackgroundColor;\n const darkTabletColor = splash.dark?.tabletBackgroundColor;\n\n const imagesetPath = path.join(iosNamedProjectRoot, BACKGROUND_IMAGESET_PATH);\n // Ensure the Images.xcassets/... path exists\n await fs.remove(imagesetPath);\n await fs.ensureDir(imagesetPath);\n\n await createBackgroundImagesAsync({\n iosNamedProjectRoot,\n color,\n darkColor: darkColor ? darkColor : null,\n tabletColor: tabletColor ? tabletColor : null,\n darkTabletColor: darkTabletColor ? darkTabletColor : null,\n });\n\n await writeContentsJsonFileAsync({\n assetPath: path.resolve(iosNamedProjectRoot, BACKGROUND_IMAGESET_PATH),\n image: PNG_FILENAME,\n darkImage: darkColor ? DARK_PNG_FILENAME : null,\n tabletImage: tabletColor ? TABLET_PNG_FILENAME : null,\n darkTabletImage: darkTabletColor ? DARK_TABLET_PNG_FILENAME : null,\n });\n}\n\nconst darkAppearances: ContentsJsonImageAppearance[] = [\n {\n appearance: 'luminosity',\n value: 'dark',\n } as ContentsJsonImageAppearance,\n];\n\nexport function buildContentsJsonImages({\n image,\n darkImage,\n tabletImage,\n darkTabletImage,\n}: {\n image: string;\n tabletImage: string | null;\n darkImage: string | null;\n darkTabletImage: string | null;\n}): ContentsJsonImage[] {\n return [\n // Phone light\n createContentsJsonItem({\n idiom: 'universal',\n filename: image,\n scale: '1x',\n }),\n createContentsJsonItem({\n idiom: 'universal',\n scale: '2x',\n }),\n createContentsJsonItem({\n idiom: 'universal',\n scale: '3x',\n }),\n // Phone dark\n darkImage &&\n createContentsJsonItem({\n idiom: 'universal',\n appearances: darkAppearances,\n filename: darkImage,\n scale: '1x',\n }),\n darkImage &&\n createContentsJsonItem({\n idiom: 'universal',\n appearances: darkAppearances,\n scale: '2x',\n }),\n darkImage &&\n createContentsJsonItem({\n idiom: 'universal',\n appearances: darkAppearances,\n scale: '3x',\n }),\n // Tablet light\n tabletImage &&\n createContentsJsonItem({\n idiom: 'ipad',\n filename: tabletImage,\n scale: '1x',\n }),\n tabletImage &&\n createContentsJsonItem({\n idiom: 'ipad',\n scale: '2x',\n }),\n // Phone dark\n darkTabletImage &&\n createContentsJsonItem({\n idiom: 'ipad',\n appearances: darkAppearances,\n filename: darkTabletImage ?? undefined,\n scale: '1x',\n }),\n darkTabletImage &&\n createContentsJsonItem({\n idiom: 'ipad',\n appearances: darkAppearances,\n scale: '2x',\n }),\n ].filter(Boolean) as ContentsJsonImage[];\n}\n\nasync function writeContentsJsonFileAsync({\n assetPath,\n image,\n darkImage,\n tabletImage,\n darkTabletImage,\n}: {\n assetPath: string;\n image: string;\n darkImage: string | null;\n tabletImage: string | null;\n darkTabletImage: string | null;\n}) {\n const images = buildContentsJsonImages({ image, darkImage, tabletImage, darkTabletImage });\n\n debug(`create contents.json:`, assetPath);\n debug(`use images:`, images);\n await writeContentsJsonAsync(assetPath, { images });\n}\n"],"mappings":";;;;;;;AAAA,SAAAA,eAAA;EAAA,MAAAC,IAAA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AW;EACXC;AAOF,CAAC,EAAE;EACD,MAAMuD,MAAM,GAAGR,uBAAuB,CAAC;IAAEnD,KAAK;IAAEC,SAAS;IAAEE,WAAW;IAAEC;EAAgB,CAAC,CAAC;EAE1F3B,KAAK,CAAE,uBAAsB,EAAEkC,SAAS,CAAC;EACzClC,KAAK,CAAE,aAAY,EAAEkF,MAAM,CAAC;EAC5B,MAAM,IAAAC,uCAAsB,EAACjD,SAAS,EAAE;IAAEgD;EAAO,CAAC,CAAC;AACrD"}
|
|
1
|
+
{"version":3,"file":"withIosSplashAssets.js","names":["_configPlugins","data","require","_imageUtils","_debug","_interopRequireDefault","_fsExtra","_jimpCompact","path","_interopRequireWildcard","_AssetContents","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","debug","Debug","IMAGE_CACHE_NAME","IMAGESET_PATH","BACKGROUND_IMAGESET_PATH","PNG_FILENAME","DARK_PNG_FILENAME","TABLET_PNG_FILENAME","DARK_TABLET_PNG_FILENAME","withIosSplashAssets","config","splash","withDangerousMod","_splash$dark","_splash$dark2","iosNamedProjectRoot","IOSConfig","Paths","getSourceRoot","modRequest","projectRoot","createSplashScreenBackgroundImageAsync","configureImageAssets","image","darkImage","dark","tabletImage","darkTabletImage","exports","imageSetPath","resolve","fs","remove","writeContentsJsonFileAsync","assetPath","copyImageFiles","createPngFileAsync","color","filePath","png","Jimp","writeAsync","createBackgroundImagesAsync","darkColor","tabletColor","darkTabletColor","generateImagesAssetsAsync","generateImageAsset","item","fileName","anyItem","darkItem","tabletItem","darkTabletItem","source","generateImageAsync","cacheType","src","writeFile","items","filter","Promise","all","map","_splash$dark3","_splash$dark4","backgroundColor","tabletBackgroundColor","imagesetPath","join","ensureDir","darkAppearances","appearance","value","buildContentsJsonImages","createContentsJsonItem","idiom","filename","scale","appearances","undefined","Boolean","images","writeContentsJsonAsync"],"sources":["../../../../src/plugins/unversioned/expo-splash-screen/withIosSplashAssets.ts"],"sourcesContent":["import { ConfigPlugin, IOSConfig, withDangerousMod } from '@expo/config-plugins';\nimport { generateImageAsync } from '@expo/image-utils';\nimport Debug from 'debug';\nimport fs from 'fs-extra';\n// @ts-ignore\nimport Jimp from 'jimp-compact';\nimport * as path from 'path';\n\nimport { IOSSplashConfig } from './getIosSplashConfig';\nimport {\n ContentsJsonImage,\n ContentsJsonImageAppearance,\n createContentsJsonItem,\n writeContentsJsonAsync,\n} from '../../icons/AssetContents';\n\nconst debug = Debug('expo:prebuild-config:expo-splash-screen:ios:assets');\n\nconst IMAGE_CACHE_NAME = 'splash-ios';\nconst IMAGESET_PATH = 'Images.xcassets/SplashScreen.imageset';\nconst BACKGROUND_IMAGESET_PATH = 'Images.xcassets/SplashScreenBackground.imageset';\nconst PNG_FILENAME = 'image.png';\nconst DARK_PNG_FILENAME = 'dark_image.png';\nconst TABLET_PNG_FILENAME = 'tablet_image.png';\nconst DARK_TABLET_PNG_FILENAME = 'dark_tablet_image.png';\n\nexport const withIosSplashAssets: ConfigPlugin<IOSSplashConfig> = (config, splash) => {\n if (!splash) {\n return config;\n }\n return withDangerousMod(config, [\n 'ios',\n async (config) => {\n const iosNamedProjectRoot = IOSConfig.Paths.getSourceRoot(config.modRequest.projectRoot);\n\n await createSplashScreenBackgroundImageAsync({\n iosNamedProjectRoot,\n splash,\n });\n\n await configureImageAssets({\n projectRoot: config.modRequest.projectRoot,\n iosNamedProjectRoot,\n image: splash.image,\n darkImage: splash.dark?.image,\n tabletImage: splash.tabletImage,\n darkTabletImage: splash.dark?.tabletImage,\n });\n\n return config;\n },\n ]);\n};\n\n/**\n * Creates imageset containing image for Splash/Launch Screen.\n */\nasync function configureImageAssets({\n projectRoot,\n iosNamedProjectRoot,\n image,\n darkImage,\n tabletImage,\n darkTabletImage,\n}: {\n projectRoot: string;\n iosNamedProjectRoot: string;\n image?: string | null;\n darkImage?: string | null;\n tabletImage: string | null;\n darkTabletImage?: string | null;\n}) {\n const imageSetPath = path.resolve(iosNamedProjectRoot, IMAGESET_PATH);\n\n // ensure old SplashScreen imageSet is removed\n await fs.remove(imageSetPath);\n\n if (!image) {\n return;\n }\n\n await writeContentsJsonFileAsync({\n assetPath: imageSetPath,\n image: PNG_FILENAME,\n darkImage: darkImage ? DARK_PNG_FILENAME : null,\n tabletImage: tabletImage ? TABLET_PNG_FILENAME : null,\n darkTabletImage: darkTabletImage ? DARK_TABLET_PNG_FILENAME : null,\n });\n\n await copyImageFiles({\n projectRoot,\n iosNamedProjectRoot,\n image,\n darkImage,\n tabletImage,\n darkTabletImage,\n });\n}\n\nasync function createPngFileAsync(color: string, filePath: string) {\n const png = new Jimp(1, 1, color);\n return png.writeAsync(filePath);\n}\n\nasync function createBackgroundImagesAsync({\n iosNamedProjectRoot,\n color,\n darkColor,\n tabletColor,\n darkTabletColor,\n}: {\n iosNamedProjectRoot: string;\n color: string;\n darkColor: string | null;\n tabletColor: string | null;\n darkTabletColor: string | null;\n}) {\n await generateImagesAssetsAsync({\n async generateImageAsset(item, fileName) {\n await createPngFileAsync(\n item,\n path.resolve(iosNamedProjectRoot, BACKGROUND_IMAGESET_PATH, fileName)\n );\n },\n anyItem: color,\n darkItem: darkColor,\n tabletItem: tabletColor,\n darkTabletItem: darkTabletColor,\n });\n}\n\nasync function copyImageFiles({\n projectRoot,\n iosNamedProjectRoot,\n image,\n darkImage,\n tabletImage,\n darkTabletImage,\n}: {\n projectRoot: string;\n iosNamedProjectRoot: string;\n image: string;\n darkImage?: string | null;\n tabletImage?: string | null;\n darkTabletImage?: string | null;\n}) {\n await generateImagesAssetsAsync({\n async generateImageAsset(item, fileName) {\n // Using this method will cache the images in `.expo` based on the properties used to generate them.\n // this method also supports remote URLs and using the global sharp instance.\n const { source } = await generateImageAsync({ projectRoot, cacheType: IMAGE_CACHE_NAME }, {\n src: item,\n } as any);\n // Write image buffer to the file system.\n // const assetPath = join(iosNamedProjectRoot, IMAGESET_PATH, filename);\n await fs.writeFile(path.resolve(iosNamedProjectRoot, IMAGESET_PATH, fileName), source);\n },\n anyItem: image,\n darkItem: darkImage,\n tabletItem: tabletImage,\n darkTabletItem: darkTabletImage,\n });\n}\n\nasync function generateImagesAssetsAsync({\n generateImageAsset,\n anyItem,\n darkItem,\n tabletItem,\n darkTabletItem,\n}: {\n generateImageAsset: (item: string, fileName: string) => Promise<void>;\n anyItem: string;\n darkItem?: string | null;\n tabletItem?: string | null;\n darkTabletItem?: string | null;\n}) {\n const items = [\n [anyItem, PNG_FILENAME],\n [darkItem, DARK_PNG_FILENAME],\n [tabletItem, TABLET_PNG_FILENAME],\n [darkTabletItem, DARK_TABLET_PNG_FILENAME],\n ].filter(([item]) => !!item) as unknown as [string, string];\n\n await Promise.all(items.map(([item, fileName]) => generateImageAsset(item, fileName)));\n}\n\nasync function createSplashScreenBackgroundImageAsync({\n iosNamedProjectRoot,\n splash,\n}: {\n // Something like projectRoot/ios/MyApp/\n iosNamedProjectRoot: string;\n splash: IOSSplashConfig;\n}) {\n const color = splash.backgroundColor;\n const darkColor = splash.dark?.backgroundColor;\n const tabletColor = splash.tabletBackgroundColor;\n const darkTabletColor = splash.dark?.tabletBackgroundColor;\n\n const imagesetPath = path.join(iosNamedProjectRoot, BACKGROUND_IMAGESET_PATH);\n // Ensure the Images.xcassets/... path exists\n await fs.remove(imagesetPath);\n await fs.ensureDir(imagesetPath);\n\n await createBackgroundImagesAsync({\n iosNamedProjectRoot,\n color,\n darkColor: darkColor ? darkColor : null,\n tabletColor: tabletColor ? tabletColor : null,\n darkTabletColor: darkTabletColor ? darkTabletColor : null,\n });\n\n await writeContentsJsonFileAsync({\n assetPath: path.resolve(iosNamedProjectRoot, BACKGROUND_IMAGESET_PATH),\n image: PNG_FILENAME,\n darkImage: darkColor ? DARK_PNG_FILENAME : null,\n tabletImage: tabletColor ? TABLET_PNG_FILENAME : null,\n darkTabletImage: darkTabletColor ? DARK_TABLET_PNG_FILENAME : null,\n });\n}\n\nconst darkAppearances: ContentsJsonImageAppearance[] = [\n {\n appearance: 'luminosity',\n value: 'dark',\n } as ContentsJsonImageAppearance,\n];\n\nexport function buildContentsJsonImages({\n image,\n darkImage,\n tabletImage,\n darkTabletImage,\n}: {\n image: string;\n tabletImage: string | null;\n darkImage: string | null;\n darkTabletImage: string | null;\n}): ContentsJsonImage[] {\n return [\n // Phone light\n createContentsJsonItem({\n idiom: 'universal',\n filename: image,\n scale: '1x',\n }),\n createContentsJsonItem({\n idiom: 'universal',\n scale: '2x',\n }),\n createContentsJsonItem({\n idiom: 'universal',\n scale: '3x',\n }),\n // Phone dark\n darkImage &&\n createContentsJsonItem({\n idiom: 'universal',\n appearances: darkAppearances,\n filename: darkImage,\n scale: '1x',\n }),\n darkImage &&\n createContentsJsonItem({\n idiom: 'universal',\n appearances: darkAppearances,\n scale: '2x',\n }),\n darkImage &&\n createContentsJsonItem({\n idiom: 'universal',\n appearances: darkAppearances,\n scale: '3x',\n }),\n // Tablet light\n tabletImage &&\n createContentsJsonItem({\n idiom: 'ipad',\n filename: tabletImage,\n scale: '1x',\n }),\n tabletImage &&\n createContentsJsonItem({\n idiom: 'ipad',\n scale: '2x',\n }),\n // Phone dark\n darkTabletImage &&\n createContentsJsonItem({\n idiom: 'ipad',\n appearances: darkAppearances,\n filename: darkTabletImage ?? undefined,\n scale: '1x',\n }),\n darkTabletImage &&\n createContentsJsonItem({\n idiom: 'ipad',\n appearances: darkAppearances,\n scale: '2x',\n }),\n ].filter(Boolean) as ContentsJsonImage[];\n}\n\nasync function writeContentsJsonFileAsync({\n assetPath,\n image,\n darkImage,\n tabletImage,\n darkTabletImage,\n}: {\n assetPath: string;\n image: string;\n darkImage: string | null;\n tabletImage: string | null;\n darkTabletImage: string | null;\n}) {\n const images = buildContentsJsonImages({ image, darkImage, tabletImage, darkTabletImage });\n\n debug(`create contents.json:`, assetPath);\n debug(`use images:`, images);\n await writeContentsJsonAsync(assetPath, { images });\n}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ACL,CAAClB,MAAM,CAACqB,OAAO,CAAC;AACnB;AAEA,eAAehD,0BAA0BA,CAAC;EACxCC,SAAS;EACTX,KAAK;EACLC,SAAS;EACTE,WAAW;EACXC;AAOF,CAAC,EAAE;EACD,MAAMuD,MAAM,GAAGR,uBAAuB,CAAC;IAAEnD,KAAK;IAAEC,SAAS;IAAEE,WAAW;IAAEC;EAAgB,CAAC,CAAC;EAE1F3B,KAAK,CAAE,uBAAsB,EAAEkC,SAAS,CAAC;EACzClC,KAAK,CAAE,aAAY,EAAEkF,MAAM,CAAC;EAC5B,MAAM,IAAAC,uCAAsB,EAACjD,SAAS,EAAE;IAAEgD;EAAO,CAAC,CAAC;AACrD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withIosSplashInfoPlist.js","names":["_configPlugins","data","require","_debug","_interopRequireDefault","obj","__esModule","default","debug","Debug","withIosSplashInfoPlist","config","splash","withInfoPlist","modResults","setSplashInfoPlist","exports","infoPlist","_splash$dark","_splash$dark2","_splash$dark3","_splash$dark4","isDarkModeEnabled","dark","image","tabletImage","backgroundColor","tabletBackgroundColor","_config$ios$userInter","_config$ios","existing","ios","userInterfaceStyle","WarningAggregator","addWarningIOS","UIUserInterfaceStyle","UILaunchStoryboardName"],"sources":["../../../../src/plugins/unversioned/expo-splash-screen/withIosSplashInfoPlist.ts"],"sourcesContent":["import { ConfigPlugin, InfoPlist, WarningAggregator, withInfoPlist } from '@expo/config-plugins';\nimport { ExpoConfig } from '@expo/config-types';\nimport Debug from 'debug';\n\nimport { IOSSplashConfig } from './getIosSplashConfig';\n\nconst debug = Debug('expo:prebuild-config:expo-splash-screen:ios:infoPlist');\n\nexport const withIosSplashInfoPlist: ConfigPlugin<IOSSplashConfig> = (config, splash) => {\n return withInfoPlist(config, (config) => {\n config.modResults = setSplashInfoPlist(config, config.modResults, splash);\n return config;\n });\n};\n\nexport function setSplashInfoPlist(\n config: ExpoConfig,\n infoPlist: InfoPlist,\n splash: IOSSplashConfig\n): InfoPlist {\n const isDarkModeEnabled = !!(\n splash?.dark?.image ||\n splash?.dark?.tabletImage ||\n splash?.dark?.backgroundColor ||\n splash?.dark?.tabletBackgroundColor\n );\n debug(`isDarkModeEnabled: `, isDarkModeEnabled);\n\n if (isDarkModeEnabled) {\n // IOSConfig.UserInterfaceStyle.getUserInterfaceStyle(config);\n // Determine if the user manually defined the userInterfaceStyle incorrectly\n const existing = config.ios?.userInterfaceStyle ?? config.userInterfaceStyle;\n // Add a warning to prevent the dark mode splash screen from not being shown -- this was learned the hard way.\n if (existing && existing !== 'automatic') {\n WarningAggregator.addWarningIOS(\n 'userInterfaceStyle',\n 'The existing `userInterfaceStyle` property is preventing splash screen from working properly. Please remove it or disable dark mode splash screens.'\n );\n }\n // assigning it to auto anyways, but this is fragile because the order of operations matter now\n infoPlist.UIUserInterfaceStyle = 'Automatic';\n } else {\n // NOTE(brentvatne): Commented out this line because it causes https://github.com/expo/expo-cli/issues/3935\n // We should revisit this approach.\n // delete infoPlist.UIUserInterfaceStyle;\n }\n\n if (splash) {\n // TODO: What to do here ??\n infoPlist.UILaunchStoryboardName = 'SplashScreen';\n } else {\n debug(`Disabling UILaunchStoryboardName`);\n delete infoPlist.UILaunchStoryboardName;\n }\n\n return infoPlist;\n}\n"],"mappings":";;;;;;;AAAA,SAAAA,eAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,cAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAE,OAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,MAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA0B,SAAAG,uBAAAC,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAI1B,MAAMG,KAAK,GAAG,IAAAC,gBAAK,EAAC,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AIF,QAAQ,IAAIA,QAAQ,KAAK,WAAW,EAAE;MACxCG,kCAAiB,CAACC,aAAa,CAC7B,oBAAoB,EACpB,
|
|
1
|
+
{"version":3,"file":"withIosSplashInfoPlist.js","names":["_configPlugins","data","require","_debug","_interopRequireDefault","obj","__esModule","default","debug","Debug","withIosSplashInfoPlist","config","splash","withInfoPlist","modResults","setSplashInfoPlist","exports","infoPlist","_splash$dark","_splash$dark2","_splash$dark3","_splash$dark4","isDarkModeEnabled","dark","image","tabletImage","backgroundColor","tabletBackgroundColor","_config$ios$userInter","_config$ios","existing","ios","userInterfaceStyle","WarningAggregator","addWarningIOS","UIUserInterfaceStyle","UILaunchStoryboardName"],"sources":["../../../../src/plugins/unversioned/expo-splash-screen/withIosSplashInfoPlist.ts"],"sourcesContent":["import { ConfigPlugin, InfoPlist, WarningAggregator, withInfoPlist } from '@expo/config-plugins';\nimport { ExpoConfig } from '@expo/config-types';\nimport Debug from 'debug';\n\nimport { IOSSplashConfig } from './getIosSplashConfig';\n\nconst debug = Debug('expo:prebuild-config:expo-splash-screen:ios:infoPlist');\n\nexport const withIosSplashInfoPlist: ConfigPlugin<IOSSplashConfig> = (config, splash) => {\n return withInfoPlist(config, (config) => {\n config.modResults = setSplashInfoPlist(config, config.modResults, splash);\n return config;\n });\n};\n\nexport function setSplashInfoPlist(\n config: ExpoConfig,\n infoPlist: InfoPlist,\n splash: IOSSplashConfig\n): InfoPlist {\n const isDarkModeEnabled = !!(\n splash?.dark?.image ||\n splash?.dark?.tabletImage ||\n splash?.dark?.backgroundColor ||\n splash?.dark?.tabletBackgroundColor\n );\n debug(`isDarkModeEnabled: `, isDarkModeEnabled);\n\n if (isDarkModeEnabled) {\n // IOSConfig.UserInterfaceStyle.getUserInterfaceStyle(config);\n // Determine if the user manually defined the userInterfaceStyle incorrectly\n const existing = config.ios?.userInterfaceStyle ?? config.userInterfaceStyle;\n // Add a warning to prevent the dark mode splash screen from not being shown -- this was learned the hard way.\n if (existing && existing !== 'automatic') {\n WarningAggregator.addWarningIOS(\n 'userInterfaceStyle',\n 'The existing `userInterfaceStyle` property is preventing splash screen from working properly. Please remove it or disable dark mode splash screens.'\n );\n }\n // assigning it to auto anyways, but this is fragile because the order of operations matter now\n infoPlist.UIUserInterfaceStyle = 'Automatic';\n } else {\n // NOTE(brentvatne): Commented out this line because it causes https://github.com/expo/expo-cli/issues/3935\n // We should revisit this approach.\n // delete infoPlist.UIUserInterfaceStyle;\n }\n\n if (splash) {\n // TODO: What to do here ??\n infoPlist.UILaunchStoryboardName = 'SplashScreen';\n } else {\n debug(`Disabling UILaunchStoryboardName`);\n delete infoPlist.UILaunchStoryboardName;\n }\n\n return infoPlist;\n}\n"],"mappings":";;;;;;;AAAA,SAAAA,eAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,cAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAE,OAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,MAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA0B,SAAAG,uBAAAC,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAI1B,MAAMG,KAAK,GAAG,IAAAC,gBAAK,EAAC,uDAAuD,CAAC;AAErE,MAAMC,sBAAqD,GAAGA,CAACC,MAAM,EAAEC,MAAM,KAAK;EACvF,OAAO,IAAAC,8BAAa,EAACF,MAAM,EAAGA,MAAM,IAAK;IACvCA,MAAM,CAACG,UAAU,GAAGC,kBAAkB,CAACJ,MAAM,EAAEA,MAAM,CAACG,UAAU,EAAEF,MAAM,CAAC;IACzE,OAAOD,MAAM;EACf,CAAC,CAAC;AACJ,CAAC;AAACK,OAAA,CAAAN,sBAAA,GAAAA,sBAAA;AAEK,SAASK,kBAAkBA,CAChCJ,MAAkB,E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;EAEA,OAAOnB,SAAS;AAClB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withIosSplashScreenStoryboard.js","names":["_configPlugins","data","require","fs","_interopRequireWildcard","path","_xml2js","_InterfaceBuilder","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","STORYBOARD_FILE_PATH","exports","STORYBOARD_MOD_NAME","withIosSplashScreenStoryboard","config","action","withMod","platform","mod","withIosSplashScreenStoryboardBaseMod","BaseMods","withGeneratedBaseMods","saveToInternal","skipEmptyMod","providers","provider","isIntrospective","getFilePath","modRequest","join","platformProjectRoot","projectName","read","filePath","contents","promises","readFile","xml","Parser","parseStringPromise","getTemplateAsync","write","modResults","introspect","writeFile","toString"],"sources":["../../../../src/plugins/unversioned/expo-splash-screen/withIosSplashScreenStoryboard.ts"],"sourcesContent":["import { BaseMods, ConfigPlugin, Mod, withMod } from '@expo/config-plugins';\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport { Parser } from 'xml2js';\n\nimport { IBSplashScreenDocument, toString } from './InterfaceBuilder';\n\nexport const STORYBOARD_FILE_PATH = './SplashScreen.storyboard';\n\nconst STORYBOARD_MOD_NAME = 'splashScreenStoryboard';\n\n/**\n * Provides the SplashScreen `.storyboard` xml data for modification.\n *\n * @param config\n * @param action\n */\nexport const withIosSplashScreenStoryboard: ConfigPlugin<Mod<IBSplashScreenDocument>> = (\n config,\n action\n) => {\n return withMod(config, {\n platform: 'ios',\n mod: STORYBOARD_MOD_NAME,\n action,\n });\n};\n\n/** Append a custom rule to supply SplashScreen `.storyboard` xml data to mods on `mods.ios.splashScreenStoryboard` */\nexport const withIosSplashScreenStoryboardBaseMod: ConfigPlugin = (config) => {\n return BaseMods.withGeneratedBaseMods(config, {\n platform: 'ios',\n saveToInternal: true,\n skipEmptyMod: false,\n providers: {\n // Append a custom rule to supply .storyboard xml data to mods on `mods.ios.splashScreenStoryboard`\n [STORYBOARD_MOD_NAME]: BaseMods.provider<IBSplashScreenDocument>({\n isIntrospective: true,\n async getFilePath({ modRequest }) {\n //: [root]/myapp/ios/MyApp/SplashScreen.storyboard\n return path.join(\n //: myapp/ios\n modRequest.platformProjectRoot,\n // ./MyApp\n modRequest.projectName!,\n // ./SplashScreen.storyboard\n STORYBOARD_FILE_PATH\n );\n },\n async read(filePath) {\n try {\n const contents = await fs.promises.readFile(filePath, 'utf8');\n const xml = await new Parser().parseStringPromise(contents);\n return xml;\n } catch {\n return getTemplateAsync();\n }\n },\n async write(filePath, { modResults, modRequest: { introspect } }) {\n if (introspect) {\n return;\n }\n await fs.promises.writeFile(filePath, toString(modResults));\n },\n }),\n },\n });\n};\n\n/** Get a template splash screen storyboard file. */\nexport async function getTemplateAsync(): Promise<IBSplashScreenDocument> {\n const contents = `<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n <document\n type=\"com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB\"\n version=\"3.0\"\n toolsVersion=\"16096\"\n targetRuntime=\"iOS.CocoaTouch\"\n propertyAccessControl=\"none\"\n useAutolayout=\"YES\"\n launchScreen=\"YES\"\n useTraitCollections=\"YES\"\n useSafeAreas=\"YES\"\n colorMatched=\"YES\"\n initialViewController=\"EXPO-VIEWCONTROLLER-1\"\n >\n <dependencies>\n <deployment identifier=\"iOS\"/>\n <plugIn identifier=\"com.apple.InterfaceBuilder.IBCocoaTouchPlugin\" version=\"16087\"/>\n <capability name=\"Safe area layout guides\" minToolsVersion=\"9.0\"/>\n <capability name=\"documents saved in the Xcode 8 format\" minToolsVersion=\"8.0\"/>\n </dependencies>\n <scenes>\n <scene sceneID=\"EXPO-SCENE-1\">\n <objects>\n <viewController\n storyboardIdentifier=\"SplashScreenViewController\"\n id=\"EXPO-VIEWCONTROLLER-1\"\n sceneMemberID=\"viewController\"\n >\n <view\n key=\"view\"\n userInteractionEnabled=\"NO\"\n contentMode=\"scaleToFill\"\n insetsLayoutMarginsFromSafeArea=\"NO\"\n id=\"EXPO-ContainerView\"\n userLabel=\"ContainerView\"\n >\n <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"414\" height=\"736\"/>\n <autoresizingMask key=\"autoresizingMask\" flexibleMaxX=\"YES\" flexibleMaxY=\"YES\"/>\n <subviews>\n <imageView\n userInteractionEnabled=\"NO\"\n contentMode=\"scaleAspectFill\"\n horizontalHuggingPriority=\"251\"\n verticalHuggingPriority=\"251\"\n insetsLayoutMarginsFromSafeArea=\"NO\"\n image=\"SplashScreenBackground\"\n translatesAutoresizingMaskIntoConstraints=\"NO\"\n id=\"EXPO-SplashScreenBackground\"\n userLabel=\"SplashScreenBackground\"\n >\n <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"414\" height=\"736\"/>\n </imageView>\n </subviews>\n <color key=\"backgroundColor\" systemColor=\"systemBackgroundColor\"/>\n <constraints>\n <constraint firstItem=\"EXPO-SplashScreenBackground\" firstAttribute=\"top\" secondItem=\"EXPO-ContainerView\" secondAttribute=\"top\" id=\"1gX-mQ-vu6\"/>\n <constraint firstItem=\"EXPO-SplashScreenBackground\" firstAttribute=\"leading\" secondItem=\"EXPO-ContainerView\" secondAttribute=\"leading\" id=\"6tX-OG-Sck\"/>\n <constraint firstItem=\"EXPO-SplashScreenBackground\" firstAttribute=\"trailing\" secondItem=\"EXPO-ContainerView\" secondAttribute=\"trailing\" id=\"ABX-8g-7v4\"/>\n <constraint firstItem=\"EXPO-SplashScreenBackground\" firstAttribute=\"bottom\" secondItem=\"EXPO-ContainerView\" secondAttribute=\"bottom\" id=\"jkI-2V-eW5\"/>\n </constraints>\n <viewLayoutGuide key=\"safeArea\" id=\"EXPO-SafeArea\"/>\n </view>\n </viewController>\n <placeholder placeholderIdentifier=\"IBFirstResponder\" id=\"EXPO-PLACEHOLDER-1\" userLabel=\"First Responder\" sceneMemberID=\"firstResponder\"/>\n </objects>\n </scene>\n </scenes>\n <resources>\n <image name=\"SplashScreenBackground\" width=\"1\" height=\"1\"/>\n </resources>\n </document>`;\n return await new Parser().parseStringPromise(contents);\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,GAAA;EAAA,MAAAF,IAAA,GAAAG,uBAAA,CAAAF,OAAA;EAAAC,EAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,KAAA;EAAA,MAAAJ,IAAA,GAAAG,uBAAA,CAAAF,OAAA;EAAAG,IAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,QAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,OAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAM,kBAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,iBAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAsE,SAAAO,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAL,wBAAAS,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,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ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;EACd,OAAO,MAAM,KAAII,gBAAM,GAAE,CAACC,kBAAkB,CAACL,QAAQ,CAAC;AACxD"}
|
|
1
|
+
{"version":3,"file":"withIosSplashScreenStoryboard.js","names":["_configPlugins","data","require","fs","_interopRequireWildcard","path","_xml2js","_InterfaceBuilder","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","STORYBOARD_FILE_PATH","exports","STORYBOARD_MOD_NAME","withIosSplashScreenStoryboard","config","action","withMod","platform","mod","withIosSplashScreenStoryboardBaseMod","BaseMods","withGeneratedBaseMods","saveToInternal","skipEmptyMod","providers","provider","isIntrospective","getFilePath","modRequest","join","platformProjectRoot","projectName","read","filePath","contents","promises","readFile","xml","Parser","parseStringPromise","getTemplateAsync","write","modResults","introspect","writeFile","toString"],"sources":["../../../../src/plugins/unversioned/expo-splash-screen/withIosSplashScreenStoryboard.ts"],"sourcesContent":["import { BaseMods, ConfigPlugin, Mod, withMod } from '@expo/config-plugins';\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport { Parser } from 'xml2js';\n\nimport { IBSplashScreenDocument, toString } from './InterfaceBuilder';\n\nexport const STORYBOARD_FILE_PATH = './SplashScreen.storyboard';\n\nconst STORYBOARD_MOD_NAME = 'splashScreenStoryboard';\n\n/**\n * Provides the SplashScreen `.storyboard` xml data for modification.\n *\n * @param config\n * @param action\n */\nexport const withIosSplashScreenStoryboard: ConfigPlugin<Mod<IBSplashScreenDocument>> = (\n config,\n action\n) => {\n return withMod(config, {\n platform: 'ios',\n mod: STORYBOARD_MOD_NAME,\n action,\n });\n};\n\n/** Append a custom rule to supply SplashScreen `.storyboard` xml data to mods on `mods.ios.splashScreenStoryboard` */\nexport const withIosSplashScreenStoryboardBaseMod: ConfigPlugin = (config) => {\n return BaseMods.withGeneratedBaseMods(config, {\n platform: 'ios',\n saveToInternal: true,\n skipEmptyMod: false,\n providers: {\n // Append a custom rule to supply .storyboard xml data to mods on `mods.ios.splashScreenStoryboard`\n [STORYBOARD_MOD_NAME]: BaseMods.provider<IBSplashScreenDocument>({\n isIntrospective: true,\n async getFilePath({ modRequest }) {\n //: [root]/myapp/ios/MyApp/SplashScreen.storyboard\n return path.join(\n //: myapp/ios\n modRequest.platformProjectRoot,\n // ./MyApp\n modRequest.projectName!,\n // ./SplashScreen.storyboard\n STORYBOARD_FILE_PATH\n );\n },\n async read(filePath) {\n try {\n const contents = await fs.promises.readFile(filePath, 'utf8');\n const xml = await new Parser().parseStringPromise(contents);\n return xml;\n } catch {\n return getTemplateAsync();\n }\n },\n async write(filePath, { modResults, modRequest: { introspect } }) {\n if (introspect) {\n return;\n }\n await fs.promises.writeFile(filePath, toString(modResults));\n },\n }),\n },\n });\n};\n\n/** Get a template splash screen storyboard file. */\nexport async function getTemplateAsync(): Promise<IBSplashScreenDocument> {\n const contents = `<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n <document\n type=\"com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB\"\n version=\"3.0\"\n toolsVersion=\"16096\"\n targetRuntime=\"iOS.CocoaTouch\"\n propertyAccessControl=\"none\"\n useAutolayout=\"YES\"\n launchScreen=\"YES\"\n useTraitCollections=\"YES\"\n useSafeAreas=\"YES\"\n colorMatched=\"YES\"\n initialViewController=\"EXPO-VIEWCONTROLLER-1\"\n >\n <dependencies>\n <deployment identifier=\"iOS\"/>\n <plugIn identifier=\"com.apple.InterfaceBuilder.IBCocoaTouchPlugin\" version=\"16087\"/>\n <capability name=\"Safe area layout guides\" minToolsVersion=\"9.0\"/>\n <capability name=\"documents saved in the Xcode 8 format\" minToolsVersion=\"8.0\"/>\n </dependencies>\n <scenes>\n <scene sceneID=\"EXPO-SCENE-1\">\n <objects>\n <viewController\n storyboardIdentifier=\"SplashScreenViewController\"\n id=\"EXPO-VIEWCONTROLLER-1\"\n sceneMemberID=\"viewController\"\n >\n <view\n key=\"view\"\n userInteractionEnabled=\"NO\"\n contentMode=\"scaleToFill\"\n insetsLayoutMarginsFromSafeArea=\"NO\"\n id=\"EXPO-ContainerView\"\n userLabel=\"ContainerView\"\n >\n <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"414\" height=\"736\"/>\n <autoresizingMask key=\"autoresizingMask\" flexibleMaxX=\"YES\" flexibleMaxY=\"YES\"/>\n <subviews>\n <imageView\n userInteractionEnabled=\"NO\"\n contentMode=\"scaleAspectFill\"\n horizontalHuggingPriority=\"251\"\n verticalHuggingPriority=\"251\"\n insetsLayoutMarginsFromSafeArea=\"NO\"\n image=\"SplashScreenBackground\"\n translatesAutoresizingMaskIntoConstraints=\"NO\"\n id=\"EXPO-SplashScreenBackground\"\n userLabel=\"SplashScreenBackground\"\n >\n <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"414\" height=\"736\"/>\n </imageView>\n </subviews>\n <color key=\"backgroundColor\" systemColor=\"systemBackgroundColor\"/>\n <constraints>\n <constraint firstItem=\"EXPO-SplashScreenBackground\" firstAttribute=\"top\" secondItem=\"EXPO-ContainerView\" secondAttribute=\"top\" id=\"1gX-mQ-vu6\"/>\n <constraint firstItem=\"EXPO-SplashScreenBackground\" firstAttribute=\"leading\" secondItem=\"EXPO-ContainerView\" secondAttribute=\"leading\" id=\"6tX-OG-Sck\"/>\n <constraint firstItem=\"EXPO-SplashScreenBackground\" firstAttribute=\"trailing\" secondItem=\"EXPO-ContainerView\" secondAttribute=\"trailing\" id=\"ABX-8g-7v4\"/>\n <constraint firstItem=\"EXPO-SplashScreenBackground\" firstAttribute=\"bottom\" secondItem=\"EXPO-ContainerView\" secondAttribute=\"bottom\" id=\"jkI-2V-eW5\"/>\n </constraints>\n <viewLayoutGuide key=\"safeArea\" id=\"EXPO-SafeArea\"/>\n </view>\n </viewController>\n <placeholder placeholderIdentifier=\"IBFirstResponder\" id=\"EXPO-PLACEHOLDER-1\" userLabel=\"First Responder\" sceneMemberID=\"firstResponder\"/>\n </objects>\n </scene>\n </scenes>\n <resources>\n <image name=\"SplashScreenBackground\" width=\"1\" height=\"1\"/>\n </resources>\n </document>`;\n return await new Parser().parseStringPromise(contents);\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,GAAA;EAAA,MAAAF,IAAA,GAAAG,uBAAA,CAAAF,OAAA;EAAAC,EAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,KAAA;EAAA,MAAAJ,IAAA,GAAAG,uBAAA,CAAAF,OAAA;EAAAG,IAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,QAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,OAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAM,kBAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,iBAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAsE,SAAAO,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAL,wBAAAS,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,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AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;EACd,OAAO,MAAM,KAAII,gBAAM,EAAC,CAAC,CAACC,kBAAkB,CAACL,QAAQ,CAAC;AACxD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withIosSplashXcodeProject.js","names":["_configPlugins","data","require","_path","_interopRequireDefault","_withIosSplashScreenStoryboard","obj","__esModule","default","debug","withIosSplashXcodeProject","config","withXcodeProject","modResults","setSplashStoryboardAsync","projectName","modRequest","project","exports","storyboardFilePath","path","join","STORYBOARD_FILE_PATH","hasFile","IOSConfig","XcodeUtils","addResourceFileToGroup","filepath","groupName"],"sources":["../../../../src/plugins/unversioned/expo-splash-screen/withIosSplashXcodeProject.ts"],"sourcesContent":["import { ConfigPlugin, IOSConfig, withXcodeProject } from '@expo/config-plugins';\nimport path from 'path';\nimport { XcodeProject } from 'xcode';\n\nimport { STORYBOARD_FILE_PATH } from './withIosSplashScreenStoryboard';\n\nconst debug = require('debug')(\n 'expo:prebuild-config:expo-splash-screen:ios:xcodeproj'\n) as typeof console.log;\n\nexport const withIosSplashXcodeProject: ConfigPlugin = (config) => {\n return withXcodeProject(config, async (config) => {\n config.modResults = await setSplashStoryboardAsync({\n projectName: config.modRequest.projectName!,\n project: config.modResults,\n });\n return config;\n });\n};\n\n/**\n * Modifies `.pbxproj` by:\n * - adding reference for `.storyboard` file\n */\nexport async function setSplashStoryboardAsync({\n projectName,\n project,\n}: {\n projectName: string;\n project: XcodeProject;\n}): Promise<XcodeProject> {\n // Check if `${projectName}/SplashScreen.storyboard` already exists\n // Path relative to `ios` directory\n const storyboardFilePath = path.join(projectName, STORYBOARD_FILE_PATH);\n if (!project.hasFile(storyboardFilePath)) {\n debug(`Adding ${storyboardFilePath} to Xcode project`);\n IOSConfig.XcodeUtils.addResourceFileToGroup({\n filepath: storyboardFilePath,\n groupName: projectName,\n project,\n });\n }\n\n return project;\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,MAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,KAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAI,+BAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,8BAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAuE,SAAAG,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAEvE,MAAMG,KAAK,GAAGP,OAAO,CAAC,OAAO,CAAC,CAC5B,
|
|
1
|
+
{"version":3,"file":"withIosSplashXcodeProject.js","names":["_configPlugins","data","require","_path","_interopRequireDefault","_withIosSplashScreenStoryboard","obj","__esModule","default","debug","withIosSplashXcodeProject","config","withXcodeProject","modResults","setSplashStoryboardAsync","projectName","modRequest","project","exports","storyboardFilePath","path","join","STORYBOARD_FILE_PATH","hasFile","IOSConfig","XcodeUtils","addResourceFileToGroup","filepath","groupName"],"sources":["../../../../src/plugins/unversioned/expo-splash-screen/withIosSplashXcodeProject.ts"],"sourcesContent":["import { ConfigPlugin, IOSConfig, withXcodeProject } from '@expo/config-plugins';\nimport path from 'path';\nimport { XcodeProject } from 'xcode';\n\nimport { STORYBOARD_FILE_PATH } from './withIosSplashScreenStoryboard';\n\nconst debug = require('debug')(\n 'expo:prebuild-config:expo-splash-screen:ios:xcodeproj'\n) as typeof console.log;\n\nexport const withIosSplashXcodeProject: ConfigPlugin = (config) => {\n return withXcodeProject(config, async (config) => {\n config.modResults = await setSplashStoryboardAsync({\n projectName: config.modRequest.projectName!,\n project: config.modResults,\n });\n return config;\n });\n};\n\n/**\n * Modifies `.pbxproj` by:\n * - adding reference for `.storyboard` file\n */\nexport async function setSplashStoryboardAsync({\n projectName,\n project,\n}: {\n projectName: string;\n project: XcodeProject;\n}): Promise<XcodeProject> {\n // Check if `${projectName}/SplashScreen.storyboard` already exists\n // Path relative to `ios` directory\n const storyboardFilePath = path.join(projectName, STORYBOARD_FILE_PATH);\n if (!project.hasFile(storyboardFilePath)) {\n debug(`Adding ${storyboardFilePath} to Xcode project`);\n IOSConfig.XcodeUtils.addResourceFileToGroup({\n filepath: storyboardFilePath,\n groupName: projectName,\n project,\n });\n }\n\n return project;\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,MAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,KAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAI,+BAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,8BAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAuE,SAAAG,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAEvE,MAAMG,KAAK,GAAGP,OAAO,CAAC,OAAO,CAAC,CAC5B,uDACF,CAAuB;AAEhB,MAAMQ,yBAAuC,GAAIC,MAAM,IAAK;EACjE,OAAO,IAAAC,iCAAgB,EAACD,MAAM,EAAE,MAAOA,MAAM,IAAK;IAChDA,MAAM,CAACE,UAAU,GAAG,MAAMC,wBAAwB,CAAC;MACjDC,WAAW,EAAEJ,MAAM,CAACK,UAAU,CAACD,WAAY;MAC3CE,OAAO,EAAEN,MAAM,CAACE;IAClB,CAAC,CAAC;IACF,OAAOF,MAAM;EACf,CAAC,CAAC;AACJ,CAAC;;AAED;AACA;AACA;AACA;AAHAO,OAAA,CAAAR,yBAAA,GAAAA,yBAAA;AAIO,eAAeI,wBAAwBA,CAAC;EAC7CC,WAAW;EACXE;AAIF,CAAC,EAAyB;EACxB;EACA;EACA,MAAME,kBAAkB,GAAGC,eAAI,CAACC,IAAI,CAACN,WAAW,EAAEO,qDAAoB,CAAC;EACvE,IAAI,CAACL,OAAO,CAACM,OAAO,CAACJ,kBAAkB,CAAC,EAAE;IACxCV,KAAK,CAAE,UAASU,kBAAmB,mBAAkB,CAAC;IACtDK,0BAAS,CAACC,UAAU,CAACC,sBAAsB,CAAC;MAC1CC,QAAQ,EAAER,kBAAkB;MAC5BS,SAAS,EAAEb,WAAW;MACtBE;IACF,CAAC,CAAC;EACJ;EAEA,OAAOA,OAAO;AAChB"}
|
package/build/plugins/unversioned/expo-splash-screen/wtihIosSplashScreenStoryboardImage.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wtihIosSplashScreenStoryboardImage.js","names":["_InterfaceBuilder","data","require","_withIosSplashScreenStoryboard","withIosSplashScreenImage","config","splash","withIosSplashScreenStoryboard","modResults","applySplashScreenStoryboard","exports","obj","resizeMode","splashScreenImagePresent","Boolean","image","imageName","contentMode","getImageContentMode","applyImageToSplashScreenXML","removeImageFromSplashScreen","Error"],"sources":["../../../../src/plugins/unversioned/expo-splash-screen/wtihIosSplashScreenStoryboardImage.ts"],"sourcesContent":["import { ConfigPlugin } from '@expo/config-plugins';\n\nimport {\n applyImageToSplashScreenXML,\n IBSplashScreenDocument,\n ImageContentMode,\n removeImageFromSplashScreen,\n} from './InterfaceBuilder';\nimport { IOSSplashConfig } from './getIosSplashConfig';\nimport { withIosSplashScreenStoryboard } from './withIosSplashScreenStoryboard';\n\nexport const withIosSplashScreenImage: ConfigPlugin<IOSSplashConfig> = (config, splash) => {\n return withIosSplashScreenStoryboard(config, (config) => {\n config.modResults = applySplashScreenStoryboard(config.modResults, splash);\n return config;\n });\n};\n\nexport function applySplashScreenStoryboard(obj: IBSplashScreenDocument, splash: IOSSplashConfig) {\n const resizeMode = splash?.resizeMode;\n const splashScreenImagePresent = Boolean(splash?.image);\n const imageName = 'SplashScreen';\n // Only get the resize mode when the image is present.\n if (splashScreenImagePresent) {\n const contentMode = getImageContentMode(resizeMode || 'contain');\n return applyImageToSplashScreenXML(obj, {\n contentMode,\n imageName,\n });\n }\n\n return removeImageFromSplashScreen(obj, { imageName });\n}\n\nfunction getImageContentMode(resizeMode: string): ImageContentMode {\n switch (resizeMode) {\n case 'contain':\n return 'scaleAspectFit';\n case 'cover':\n return 'scaleAspectFill';\n default:\n throw new Error(`{ resizeMode: \"${resizeMode}\" } is not supported for iOS platform.`);\n }\n}\n"],"mappings":";;;;;;;AAEA,SAAAA,kBAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,iBAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAOA,SAAAE,+BAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,8BAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,MAAMG,wBAAuD,GAAGA,CAACC,MAAM,EAAEC,MAAM,KAAK;EACzF,OAAO,IAAAC,8DAA6B,EAACF,MAAM,EAAGA,MAAM,IAAK;IACvDA,MAAM,CAACG,UAAU,GAAGC,2BAA2B,CAACJ,MAAM,CAACG,UAAU,EAAEF,MAAM,CAAC;IAC1E,OAAOD,MAAM;EACf,CAAC,CAAC;AACJ,CAAC;AAACK,OAAA,CAAAN,wBAAA,GAAAA,wBAAA;AAEK,SAASK,2BAA2BA,CAACE,GAA2B,EAAEL,MAAuB,EAAE;EAChG,MAAMM,UAAU,GAAGN,MAAM,aAANA,MAAM,uBAANA,MAAM,CAAEM,UAAU;EACrC,MAAMC,wBAAwB,GAAGC,OAAO,CAACR,MAAM,aAANA,MAAM,uBAANA,MAAM,CAAES,KAAK,CAAC;EACvD,MAAMC,SAAS,GAAG,cAAc;EAChC;EACA,IAAIH,wBAAwB,EAAE;IAC5B,MAAMI,WAAW,GAAGC,mBAAmB,CAACN,UAAU,IAAI,SAAS,CAAC;IAChE,OAAO,IAAAO,+CAA2B,EAACR,GAAG,EAAE;MACtCM,WAAW;MACXD;IACF,CAAC,CAAC;EACJ;EAEA,OAAO,IAAAI,+CAA2B,EAACT,GAAG,EAAE;IAAEK;EAAU,CAAC,CAAC;AACxD;AAEA,SAASE,mBAAmBA,CAACN,UAAkB,EAAoB;EACjE,QAAQA,UAAU;IAChB,KAAK,SAAS;MACZ,OAAO,gBAAgB;IACzB,KAAK,OAAO;MACV,OAAO,iBAAiB;IAC1B;MACE,MAAM,IAAIS,KAAK,CAAE,kBAAiBT,UAAW,wCAAuC,CAAC;
|
|
1
|
+
{"version":3,"file":"wtihIosSplashScreenStoryboardImage.js","names":["_InterfaceBuilder","data","require","_withIosSplashScreenStoryboard","withIosSplashScreenImage","config","splash","withIosSplashScreenStoryboard","modResults","applySplashScreenStoryboard","exports","obj","resizeMode","splashScreenImagePresent","Boolean","image","imageName","contentMode","getImageContentMode","applyImageToSplashScreenXML","removeImageFromSplashScreen","Error"],"sources":["../../../../src/plugins/unversioned/expo-splash-screen/wtihIosSplashScreenStoryboardImage.ts"],"sourcesContent":["import { ConfigPlugin } from '@expo/config-plugins';\n\nimport {\n applyImageToSplashScreenXML,\n IBSplashScreenDocument,\n ImageContentMode,\n removeImageFromSplashScreen,\n} from './InterfaceBuilder';\nimport { IOSSplashConfig } from './getIosSplashConfig';\nimport { withIosSplashScreenStoryboard } from './withIosSplashScreenStoryboard';\n\nexport const withIosSplashScreenImage: ConfigPlugin<IOSSplashConfig> = (config, splash) => {\n return withIosSplashScreenStoryboard(config, (config) => {\n config.modResults = applySplashScreenStoryboard(config.modResults, splash);\n return config;\n });\n};\n\nexport function applySplashScreenStoryboard(obj: IBSplashScreenDocument, splash: IOSSplashConfig) {\n const resizeMode = splash?.resizeMode;\n const splashScreenImagePresent = Boolean(splash?.image);\n const imageName = 'SplashScreen';\n // Only get the resize mode when the image is present.\n if (splashScreenImagePresent) {\n const contentMode = getImageContentMode(resizeMode || 'contain');\n return applyImageToSplashScreenXML(obj, {\n contentMode,\n imageName,\n });\n }\n\n return removeImageFromSplashScreen(obj, { imageName });\n}\n\nfunction getImageContentMode(resizeMode: string): ImageContentMode {\n switch (resizeMode) {\n case 'contain':\n return 'scaleAspectFit';\n case 'cover':\n return 'scaleAspectFill';\n default:\n throw new Error(`{ resizeMode: \"${resizeMode}\" } is not supported for iOS platform.`);\n }\n}\n"],"mappings":";;;;;;;AAEA,SAAAA,kBAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,iBAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAOA,SAAAE,+BAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,8BAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,MAAMG,wBAAuD,GAAGA,CAACC,MAAM,EAAEC,MAAM,KAAK;EACzF,OAAO,IAAAC,8DAA6B,EAACF,MAAM,EAAGA,MAAM,IAAK;IACvDA,MAAM,CAACG,UAAU,GAAGC,2BAA2B,CAACJ,MAAM,CAACG,UAAU,EAAEF,MAAM,CAAC;IAC1E,OAAOD,MAAM;EACf,CAAC,CAAC;AACJ,CAAC;AAACK,OAAA,CAAAN,wBAAA,GAAAA,wBAAA;AAEK,SAASK,2BAA2BA,CAACE,GAA2B,EAAEL,MAAuB,EAAE;EAChG,MAAMM,UAAU,GAAGN,MAAM,aAANA,MAAM,uBAANA,MAAM,CAAEM,UAAU;EACrC,MAAMC,wBAAwB,GAAGC,OAAO,CAACR,MAAM,aAANA,MAAM,uBAANA,MAAM,CAAES,KAAK,CAAC;EACvD,MAAMC,SAAS,GAAG,cAAc;EAChC;EACA,IAAIH,wBAAwB,EAAE;IAC5B,MAAMI,WAAW,GAAGC,mBAAmB,CAACN,UAAU,IAAI,SAAS,CAAC;IAChE,OAAO,IAAAO,+CAA2B,EAACR,GAAG,EAAE;MACtCM,WAAW;MACXD;IACF,CAAC,CAAC;EACJ;EAEA,OAAO,IAAAI,+CAA2B,EAACT,GAAG,EAAE;IAAEK;EAAU,CAAC,CAAC;AACxD;AAEA,SAASE,mBAAmBA,CAACN,UAAkB,EAAoB;EACjE,QAAQA,UAAU;IAChB,KAAK,SAAS;MACZ,OAAO,gBAAgB;IACzB,KAAK,OAAO;MACV,OAAO,iBAAiB;IAC1B;MACE,MAAM,IAAIS,KAAK,CAAE,kBAAiBT,UAAW,wCAAuC,CAAC;EACzF;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withAndroidRootViewBackgroundColor.js","names":["_configPlugins","data","require","assignColorValue","AndroidConfig","Colors","assignStylesValue","getAppThemeLightNoActionBarGroup","Styles","ANDROID_WINDOW_BACKGROUND","WINDOW_BACKGROUND_COLOR","withAndroidRootViewBackgroundColor","config","withRootViewBackgroundColorColors","withRootViewBackgroundColorStyles","exports","withAndroidColors","modResults","value","getRootViewBackgroundColor","name","withAndroidStyles","add","parent","_config$android","android","backgroundColor"],"sources":["../../../../src/plugins/unversioned/expo-system-ui/withAndroidRootViewBackgroundColor.ts"],"sourcesContent":["import {\n AndroidConfig,\n ConfigPlugin,\n withAndroidColors,\n withAndroidStyles,\n} from '@expo/config-plugins';\nimport { ExpoConfig } from '@expo/config-types';\n\nconst { assignColorValue } = AndroidConfig.Colors;\nconst { assignStylesValue, getAppThemeLightNoActionBarGroup } = AndroidConfig.Styles;\n\nconst ANDROID_WINDOW_BACKGROUND = 'android:windowBackground';\nconst WINDOW_BACKGROUND_COLOR = 'activityBackground';\n\nexport const withAndroidRootViewBackgroundColor: ConfigPlugin = (config) => {\n config = withRootViewBackgroundColorColors(config);\n config = withRootViewBackgroundColorStyles(config);\n return config;\n};\n\nexport const withRootViewBackgroundColorColors: ConfigPlugin = (config) => {\n return withAndroidColors(config, async (config) => {\n config.modResults = assignColorValue(config.modResults, {\n value: getRootViewBackgroundColor(config),\n name: WINDOW_BACKGROUND_COLOR,\n });\n return config;\n });\n};\n\nexport const withRootViewBackgroundColorStyles: ConfigPlugin = (config) => {\n return withAndroidStyles(config, async (config) => {\n config.modResults = assignStylesValue(config.modResults, {\n add: !!getRootViewBackgroundColor(config),\n parent: getAppThemeLightNoActionBarGroup(),\n name: ANDROID_WINDOW_BACKGROUND,\n value: `@color/${WINDOW_BACKGROUND_COLOR}`,\n });\n return config;\n });\n};\n\nexport function getRootViewBackgroundColor(\n config: Pick<ExpoConfig, 'android' | 'backgroundColor'>\n) {\n return config.android?.backgroundColor || config.backgroundColor || null;\n}\n"],"mappings":";;;;;;;AAAA,SAAAA,eAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,cAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAQA,MAAM;EAAEE;AAAiB,CAAC,GAAGC,8BAAa,CAACC,MAAM;AACjD,MAAM;EAAEC,iBAAiB;EAAEC;AAAiC,CAAC,GAAGH,8BAAa,CAACI,MAAM;AAEpF,MAAMC,yBAAyB,GAAG,0BAA0B;AAC5D,MAAMC,uBAAuB,GAAG,oBAAoB;AAE7C,MAAMC,kCAAgD,GAAIC,MAAM,IAAK;EAC1EA,MAAM,GAAGC,iCAAiC,CAACD,MAAM,CAAC;EAClDA,MAAM,GAAGE,iCAAiC,CAACF,MAAM,CAAC;EAClD,OAAOA,MAAM;AACf,CAAC;AAACG,OAAA,CAAAJ,kCAAA,GAAAA,kCAAA;AAEK,MAAME,iCAA+C,GAAID,MAAM,IAAK;EACzE,OAAO,IAAAI,kCAAiB,EAACJ,MAAM,EAAE,MAAOA,MAAM,IAAK;IACjDA,MAAM,CAACK,UAAU,GAAGd,gBAAgB,CAACS,MAAM,CAACK,UAAU,EAAE;MACtDC,KAAK,EAAEC,0BAA0B,CAACP,MAAM,CAAC;MACzCQ,IAAI,EAAEV;IACR,CAAC,CAAC;IACF,OAAOE,MAAM;EACf,CAAC,CAAC;AACJ,CAAC;AAACG,OAAA,CAAAF,iCAAA,GAAAA,iCAAA;AAEK,MAAMC,iCAA+C,GAAIF,MAAM,IAAK;EACzE,OAAO,IAAAS,kCAAiB,EAACT,MAAM,EAAE,MAAOA,MAAM,IAAK;IACjDA,MAAM,CAACK,UAAU,GAAGX,iBAAiB,CAACM,MAAM,CAACK,UAAU,EAAE;MACvDK,GAAG,EAAE,CAAC,CAACH,0BAA0B,CAACP,MAAM,CAAC;MACzCW,MAAM,EAAEhB,gCAAgC,
|
|
1
|
+
{"version":3,"file":"withAndroidRootViewBackgroundColor.js","names":["_configPlugins","data","require","assignColorValue","AndroidConfig","Colors","assignStylesValue","getAppThemeLightNoActionBarGroup","Styles","ANDROID_WINDOW_BACKGROUND","WINDOW_BACKGROUND_COLOR","withAndroidRootViewBackgroundColor","config","withRootViewBackgroundColorColors","withRootViewBackgroundColorStyles","exports","withAndroidColors","modResults","value","getRootViewBackgroundColor","name","withAndroidStyles","add","parent","_config$android","android","backgroundColor"],"sources":["../../../../src/plugins/unversioned/expo-system-ui/withAndroidRootViewBackgroundColor.ts"],"sourcesContent":["import {\n AndroidConfig,\n ConfigPlugin,\n withAndroidColors,\n withAndroidStyles,\n} from '@expo/config-plugins';\nimport { ExpoConfig } from '@expo/config-types';\n\nconst { assignColorValue } = AndroidConfig.Colors;\nconst { assignStylesValue, getAppThemeLightNoActionBarGroup } = AndroidConfig.Styles;\n\nconst ANDROID_WINDOW_BACKGROUND = 'android:windowBackground';\nconst WINDOW_BACKGROUND_COLOR = 'activityBackground';\n\nexport const withAndroidRootViewBackgroundColor: ConfigPlugin = (config) => {\n config = withRootViewBackgroundColorColors(config);\n config = withRootViewBackgroundColorStyles(config);\n return config;\n};\n\nexport const withRootViewBackgroundColorColors: ConfigPlugin = (config) => {\n return withAndroidColors(config, async (config) => {\n config.modResults = assignColorValue(config.modResults, {\n value: getRootViewBackgroundColor(config),\n name: WINDOW_BACKGROUND_COLOR,\n });\n return config;\n });\n};\n\nexport const withRootViewBackgroundColorStyles: ConfigPlugin = (config) => {\n return withAndroidStyles(config, async (config) => {\n config.modResults = assignStylesValue(config.modResults, {\n add: !!getRootViewBackgroundColor(config),\n parent: getAppThemeLightNoActionBarGroup(),\n name: ANDROID_WINDOW_BACKGROUND,\n value: `@color/${WINDOW_BACKGROUND_COLOR}`,\n });\n return config;\n });\n};\n\nexport function getRootViewBackgroundColor(\n config: Pick<ExpoConfig, 'android' | 'backgroundColor'>\n) {\n return config.android?.backgroundColor || config.backgroundColor || null;\n}\n"],"mappings":";;;;;;;AAAA,SAAAA,eAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,cAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAQA,MAAM;EAAEE;AAAiB,CAAC,GAAGC,8BAAa,CAACC,MAAM;AACjD,MAAM;EAAEC,iBAAiB;EAAEC;AAAiC,CAAC,GAAGH,8BAAa,CAACI,MAAM;AAEpF,MAAMC,yBAAyB,GAAG,0BAA0B;AAC5D,MAAMC,uBAAuB,GAAG,oBAAoB;AAE7C,MAAMC,kCAAgD,GAAIC,MAAM,IAAK;EAC1EA,MAAM,GAAGC,iCAAiC,CAACD,MAAM,CAAC;EAClDA,MAAM,GAAGE,iCAAiC,CAACF,MAAM,CAAC;EAClD,OAAOA,MAAM;AACf,CAAC;AAACG,OAAA,CAAAJ,kCAAA,GAAAA,kCAAA;AAEK,MAAME,iCAA+C,GAAID,MAAM,IAAK;EACzE,OAAO,IAAAI,kCAAiB,EAACJ,MAAM,EAAE,MAAOA,MAAM,IAAK;IACjDA,MAAM,CAACK,UAAU,GAAGd,gBAAgB,CAACS,MAAM,CAACK,UAAU,EAAE;MACtDC,KAAK,EAAEC,0BAA0B,CAACP,MAAM,CAAC;MACzCQ,IAAI,EAAEV;IACR,CAAC,CAAC;IACF,OAAOE,MAAM;EACf,CAAC,CAAC;AACJ,CAAC;AAACG,OAAA,CAAAF,iCAAA,GAAAA,iCAAA;AAEK,MAAMC,iCAA+C,GAAIF,MAAM,IAAK;EACzE,OAAO,IAAAS,kCAAiB,EAACT,MAAM,EAAE,MAAOA,MAAM,IAAK;IACjDA,MAAM,CAACK,UAAU,GAAGX,iBAAiB,CAACM,MAAM,CAACK,UAAU,EAAE;MACvDK,GAAG,EAAE,CAAC,CAACH,0BAA0B,CAACP,MAAM,CAAC;MACzCW,MAAM,EAAEhB,gCAAgC,CAAC,CAAC;MAC1Ca,IAAI,EAAEX,yBAAyB;MAC/BS,KAAK,EAAG,UAASR,uBAAwB;IAC3C,CAAC,CAAC;IACF,OAAOE,MAAM;EACf,CAAC,CAAC;AACJ,CAAC;AAACG,OAAA,CAAAD,iCAAA,GAAAA,iCAAA;AAEK,SAASK,0BAA0BA,CACxCP,MAAuD,EACvD;EAAA,IAAAY,eAAA;EACA,OAAO,EAAAA,eAAA,GAAAZ,MAAM,CAACa,OAAO,cAAAD,eAAA,uBAAdA,eAAA,CAAgBE,eAAe,KAAId,MAAM,CAACc,eAAe,IAAI,IAAI;AAC1E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withAndroidUserInterfaceStyle.js","names":["_configPlugins","data","require","withAndroidUserInterfaceStyle","config","withStringsXml","_config$android$userI","_config$android","userInterfaceStyle","android","WarningAggregator","addWarningAndroid","exports"],"sources":["../../../../src/plugins/unversioned/expo-system-ui/withAndroidUserInterfaceStyle.ts"],"sourcesContent":["import { ConfigPlugin, WarningAggregator, withStringsXml } from '@expo/config-plugins';\n\nexport const withAndroidUserInterfaceStyle: ConfigPlugin<void> = (config) => {\n return withStringsXml(config, (config) => {\n const userInterfaceStyle = config.android?.userInterfaceStyle ?? config.userInterfaceStyle;\n if (userInterfaceStyle) {\n WarningAggregator.addWarningAndroid(\n 'userInterfaceStyle',\n // TODO: Maybe warn that they need a certain version of React Native as well?\n 'Install expo-system-ui in your project to enable this feature.'\n );\n }\n\n return config;\n });\n};\n"],"mappings":";;;;;;AAAA,SAAAA,eAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,cAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,MAAME,6BAAiD,GAAIC,MAAM,IAAK;EAC3E,OAAO,IAAAC,+BAAc,EAACD,MAAM,EAAGA,MAAM,IAAK;IAAA,IAAAE,qBAAA,EAAAC,eAAA;IACxC,MAAMC,kBAAkB,IAAAF,qBAAA,IAAAC,eAAA,GAAGH,MAAM,CAACK,OAAO,cAAAF,eAAA,uBAAdA,eAAA,CAAgBC,kBAAkB,cAAAF,qBAAA,cAAAA,qBAAA,GAAIF,MAAM,CAACI,kBAAkB;IAC1F,IAAIA,kBAAkB,EAAE;MACtBE,kCAAiB,CAACC,iBAAiB,CACjC,oBAAoB;MACpB;MACA,
|
|
1
|
+
{"version":3,"file":"withAndroidUserInterfaceStyle.js","names":["_configPlugins","data","require","withAndroidUserInterfaceStyle","config","withStringsXml","_config$android$userI","_config$android","userInterfaceStyle","android","WarningAggregator","addWarningAndroid","exports"],"sources":["../../../../src/plugins/unversioned/expo-system-ui/withAndroidUserInterfaceStyle.ts"],"sourcesContent":["import { ConfigPlugin, WarningAggregator, withStringsXml } from '@expo/config-plugins';\n\nexport const withAndroidUserInterfaceStyle: ConfigPlugin<void> = (config) => {\n return withStringsXml(config, (config) => {\n const userInterfaceStyle = config.android?.userInterfaceStyle ?? config.userInterfaceStyle;\n if (userInterfaceStyle) {\n WarningAggregator.addWarningAndroid(\n 'userInterfaceStyle',\n // TODO: Maybe warn that they need a certain version of React Native as well?\n 'Install expo-system-ui in your project to enable this feature.'\n );\n }\n\n return config;\n });\n};\n"],"mappings":";;;;;;AAAA,SAAAA,eAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,cAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,MAAME,6BAAiD,GAAIC,MAAM,IAAK;EAC3E,OAAO,IAAAC,+BAAc,EAACD,MAAM,EAAGA,MAAM,IAAK;IAAA,IAAAE,qBAAA,EAAAC,eAAA;IACxC,MAAMC,kBAAkB,IAAAF,qBAAA,IAAAC,eAAA,GAAGH,MAAM,CAACK,OAAO,cAAAF,eAAA,uBAAdA,eAAA,CAAgBC,kBAAkB,cAAAF,qBAAA,cAAAA,qBAAA,GAAIF,MAAM,CAACI,kBAAkB;IAC1F,IAAIA,kBAAkB,EAAE;MACtBE,kCAAiB,CAACC,iBAAiB,CACjC,oBAAoB;MACpB;MACA,gEACF,CAAC;IACH;IAEA,OAAOP,MAAM;EACf,CAAC,CAAC;AACJ,CAAC;AAACQ,OAAA,CAAAT,6BAAA,GAAAA,6BAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withIosRootViewBackgroundColor.js","names":["_configPlugins","data","require","_normalizeColor","_interopRequireDefault","_semver","obj","__esModule","default","BACKGROUND_COLOR_KEY","debug","withIosRootViewBackgroundColor","config","withInfoPlist","shouldUseLegacyBehavior","modResults","setRootViewBackgroundColor","warnSystemUIMissing","exports","sdkVersion","semver","lt","backgroundColor","getRootViewBackgroundColor","WarningAggregator","addWarningIOS","infoPlist","color","normalizeColor","Error","_config$ios","ios"],"sources":["../../../../src/plugins/unversioned/expo-system-ui/withIosRootViewBackgroundColor.ts"],"sourcesContent":["import { ConfigPlugin, InfoPlist, WarningAggregator, withInfoPlist } from '@expo/config-plugins';\nimport { ExpoConfig } from '@expo/config-types';\n// @ts-ignore: uses flow\nimport normalizeColor from '@react-native/normalize-color';\nimport semver from 'semver';\n\n// Maps to the template AppDelegate.m\nconst BACKGROUND_COLOR_KEY = 'RCTRootViewBackgroundColor';\n\nconst debug = require('debug')('expo:system-ui:plugin:ios');\n\nexport const withIosRootViewBackgroundColor: ConfigPlugin = (config) => {\n config = withInfoPlist(config, (config) => {\n if (shouldUseLegacyBehavior(config)) {\n config.modResults = setRootViewBackgroundColor(config, config.modResults);\n } else {\n warnSystemUIMissing(config);\n }\n return config;\n });\n return config;\n};\n\n/** The template was changed in SDK 43 to move the background color logic to the `expo-system-ui` module */\nexport function shouldUseLegacyBehavior(config: Pick<ExpoConfig, 'sdkVersion'>): boolean {\n try {\n return !!(config.sdkVersion && semver.lt(config.sdkVersion, '44.0.0'));\n } catch {}\n return false;\n}\n\nexport function warnSystemUIMissing(\n config: Pick<ExpoConfig, 'sdkVersion' | 'backgroundColor' | 'ios'>\n) {\n const backgroundColor = getRootViewBackgroundColor(config);\n\n if (backgroundColor) {\n // Background color needs to be set programmatically\n WarningAggregator.addWarningIOS(\n 'ios.backgroundColor',\n 'Install expo-system-ui to enable this feature',\n 'https://docs.expo.dev/build-reference/migrating/#expo-config--backgroundcolor--depends-on'\n );\n }\n}\n\nexport function setRootViewBackgroundColor(\n config: Pick<ExpoConfig, 'backgroundColor' | 'ios'>,\n infoPlist: InfoPlist\n): InfoPlist {\n const backgroundColor = getRootViewBackgroundColor(config);\n if (!backgroundColor) {\n delete infoPlist[BACKGROUND_COLOR_KEY];\n } else {\n let color = normalizeColor(backgroundColor);\n if (!color) {\n throw new Error('Invalid background color on iOS');\n }\n color = ((color << 24) | (color >>> 8)) >>> 0;\n infoPlist[BACKGROUND_COLOR_KEY] = color;\n\n debug(`Convert color: ${backgroundColor} -> ${color}`);\n }\n return infoPlist;\n}\n\nexport function getRootViewBackgroundColor(config: Pick<ExpoConfig, 'ios' | 'backgroundColor'>) {\n return config.ios?.backgroundColor || config.backgroundColor || null;\n}\n"],"mappings":";;;;;;;;;;AAAA,SAAAA,eAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,cAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAE,gBAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,eAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,QAAA;EAAA,MAAAJ,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAG,OAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA4B,SAAAG,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAF5B;;AAIA;AACA,MAAMG,oBAAoB,GAAG,4BAA4B;AAEzD,MAAMC,KAAK,GAAGR,OAAO,CAAC,OAAO,CAAC,CAAC,2BAA2B,CAAC;AAEpD,MAAMS,8BAA4C,GAAIC,MAAM,IAAK;EACtEA,MAAM,GAAG,IAAAC,8BAAa,EAACD,MAAM,EAAGA,MAAM,IAAK;IACzC,IAAIE,uBAAuB,CAACF,MAAM,CAAC,EAAE;MACnCA,MAAM,CAACG,UAAU,GAAGC,0BAA0B,CAACJ,MAAM,EAAEA,MAAM,CAACG,UAAU,CAAC;IAC3E,CAAC,MAAM;MACLE,mBAAmB,CAACL,MAAM,CAAC;IAC7B;IACA,OAAOA,MAAM;EACf,CAAC,CAAC;EACF,OAAOA,MAAM;AACf,CAAC;;AAED;AAAAM,OAAA,CAAAP,8BAAA,GAAAA,8BAAA;AACO,SAASG,uBAAuBA,CAACF,MAAsC,EAAW;EACvF,IAAI;IACF,OAAO,CAAC,EAAEA,MAAM,CAACO,UAAU,IAAIC,iBAAM,CAACC,EAAE,CAACT,MAAM,CAACO,UAAU,EAAE,QAAQ,CAAC,CAAC;EACxE,CAAC,CAAC,MAAM,CAAC;EACT,OAAO,KAAK;AACd;AAEO,SAASF,mBAAmBA,CACjCL,MAAkE,EAClE;EACA,MAAMU,eAAe,GAAGC,0BAA0B,CAACX,MAAM,CAAC;EAE1D,IAAIU,eAAe,EAAE;IACnB;IACAE,kCAAiB,CAACC,aAAa,CAC7B,qBAAqB,EACrB,+CAA+C,EAC/C,
|
|
1
|
+
{"version":3,"file":"withIosRootViewBackgroundColor.js","names":["_configPlugins","data","require","_normalizeColor","_interopRequireDefault","_semver","obj","__esModule","default","BACKGROUND_COLOR_KEY","debug","withIosRootViewBackgroundColor","config","withInfoPlist","shouldUseLegacyBehavior","modResults","setRootViewBackgroundColor","warnSystemUIMissing","exports","sdkVersion","semver","lt","backgroundColor","getRootViewBackgroundColor","WarningAggregator","addWarningIOS","infoPlist","color","normalizeColor","Error","_config$ios","ios"],"sources":["../../../../src/plugins/unversioned/expo-system-ui/withIosRootViewBackgroundColor.ts"],"sourcesContent":["import { ConfigPlugin, InfoPlist, WarningAggregator, withInfoPlist } from '@expo/config-plugins';\nimport { ExpoConfig } from '@expo/config-types';\n// @ts-ignore: uses flow\nimport normalizeColor from '@react-native/normalize-color';\nimport semver from 'semver';\n\n// Maps to the template AppDelegate.m\nconst BACKGROUND_COLOR_KEY = 'RCTRootViewBackgroundColor';\n\nconst debug = require('debug')('expo:system-ui:plugin:ios');\n\nexport const withIosRootViewBackgroundColor: ConfigPlugin = (config) => {\n config = withInfoPlist(config, (config) => {\n if (shouldUseLegacyBehavior(config)) {\n config.modResults = setRootViewBackgroundColor(config, config.modResults);\n } else {\n warnSystemUIMissing(config);\n }\n return config;\n });\n return config;\n};\n\n/** The template was changed in SDK 43 to move the background color logic to the `expo-system-ui` module */\nexport function shouldUseLegacyBehavior(config: Pick<ExpoConfig, 'sdkVersion'>): boolean {\n try {\n return !!(config.sdkVersion && semver.lt(config.sdkVersion, '44.0.0'));\n } catch {}\n return false;\n}\n\nexport function warnSystemUIMissing(\n config: Pick<ExpoConfig, 'sdkVersion' | 'backgroundColor' | 'ios'>\n) {\n const backgroundColor = getRootViewBackgroundColor(config);\n\n if (backgroundColor) {\n // Background color needs to be set programmatically\n WarningAggregator.addWarningIOS(\n 'ios.backgroundColor',\n 'Install expo-system-ui to enable this feature',\n 'https://docs.expo.dev/build-reference/migrating/#expo-config--backgroundcolor--depends-on'\n );\n }\n}\n\nexport function setRootViewBackgroundColor(\n config: Pick<ExpoConfig, 'backgroundColor' | 'ios'>,\n infoPlist: InfoPlist\n): InfoPlist {\n const backgroundColor = getRootViewBackgroundColor(config);\n if (!backgroundColor) {\n delete infoPlist[BACKGROUND_COLOR_KEY];\n } else {\n let color = normalizeColor(backgroundColor);\n if (!color) {\n throw new Error('Invalid background color on iOS');\n }\n color = ((color << 24) | (color >>> 8)) >>> 0;\n infoPlist[BACKGROUND_COLOR_KEY] = color;\n\n debug(`Convert color: ${backgroundColor} -> ${color}`);\n }\n return infoPlist;\n}\n\nexport function getRootViewBackgroundColor(config: Pick<ExpoConfig, 'ios' | 'backgroundColor'>) {\n return config.ios?.backgroundColor || config.backgroundColor || null;\n}\n"],"mappings":";;;;;;;;;;AAAA,SAAAA,eAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,cAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAE,gBAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,eAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,QAAA;EAAA,MAAAJ,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAG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0B,CAACX,MAAM,CAAC;EAC1D,IAAI,CAACU,eAAe,EAAE;IACpB,OAAOI,SAAS,CAACjB,oBAAoB,CAAC;EACxC,CAAC,MAAM;IACL,IAAIkB,KAAK,GAAG,IAAAC,yBAAc,EAACN,eAAe,CAAC;IAC3C,IAAI,CAACK,KAAK,EAAE;MACV,MAAM,IAAIE,KAAK,CAAC,iCAAiC,CAAC;IACpD;IACAF,KAAK,GAAG,CAAEA,KAAK,IAAI,EAAE,GAAKA,KAAK,KAAK,CAAE,MAAM,CAAC;IAC7CD,SAAS,CAACjB,oBAAoB,CAAC,GAAGkB,KAAK;IAEvCjB,KAAK,CAAE,kBAAiBY,eAAgB,OAAMK,KAAM,EAAC,CAAC;EACxD;EACA,OAAOD,SAAS;AAClB;AAEO,SAASH,0BAA0BA,CAACX,MAAmD,EAAE;EAAA,IAAAkB,WAAA;EAC9F,OAAO,EAAAA,WAAA,GAAAlB,MAAM,CAACmB,GAAG,cAAAD,WAAA,uBAAVA,WAAA,CAAYR,eAAe,KAAIV,MAAM,CAACU,eAAe,IAAI,IAAI;AACtE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withIosUserInterfaceStyle.js","names":["_iosPlugins","data","require","withIosUserInterfaceStyle","createInfoPlistPluginWithPropertyGuard","setUserInterfaceStyle","infoPlistProperty","expoConfigProperty","expoPropertyGetter","getUserInterfaceStyle","exports","config","_ref","_config$ios$userInter","_config$ios","ios","userInterfaceStyle","UIUserInterfaceStyle","infoPlist","style","mapUserInterfaceStyleForInfoPlist"],"sources":["../../../../src/plugins/unversioned/expo-system-ui/withIosUserInterfaceStyle.ts"],"sourcesContent":["import { InfoPlist } from '@expo/config-plugins';\nimport { createInfoPlistPluginWithPropertyGuard } from '@expo/config-plugins/build/plugins/ios-plugins';\nimport { ExpoConfig } from '@expo/config-types';\n\nexport const withIosUserInterfaceStyle = createInfoPlistPluginWithPropertyGuard(\n setUserInterfaceStyle,\n {\n infoPlistProperty: 'UIUserInterfaceStyle',\n expoConfigProperty: 'userInterfaceStyle | ios.userInterfaceStyle',\n expoPropertyGetter: getUserInterfaceStyle,\n },\n 'withIosUserInterfaceStyle'\n);\n\nexport function getUserInterfaceStyle(\n config: Pick<ExpoConfig, 'ios' | 'userInterfaceStyle'>\n): string {\n return config.ios?.userInterfaceStyle ?? config.userInterfaceStyle ?? 'light';\n}\n\nexport function setUserInterfaceStyle(\n config: Pick<ExpoConfig, 'ios' | 'userInterfaceStyle'>,\n { UIUserInterfaceStyle, ...infoPlist }: InfoPlist\n): InfoPlist {\n const userInterfaceStyle = getUserInterfaceStyle(config);\n const style = mapUserInterfaceStyleForInfoPlist(userInterfaceStyle);\n\n if (!style) {\n return infoPlist;\n }\n\n return {\n ...infoPlist,\n UIUserInterfaceStyle: style,\n };\n}\n\nfunction mapUserInterfaceStyleForInfoPlist(\n userInterfaceStyle: string\n): NonNullable<InfoPlist['UIUserInterfaceStyle']> | null {\n switch (userInterfaceStyle) {\n case 'light':\n return 'Light';\n case 'dark':\n return 'Dark';\n case 'automatic':\n return 'Automatic';\n }\n\n return null;\n}\n"],"mappings":";;;;;;;;AACA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGO,MAAME,yBAAyB,GAAG,IAAAC,oDAAsC,EAC7EC,qBAAqB,EACrB;EACEC,iBAAiB,EAAE,sBAAsB;EACzCC,kBAAkB,EAAE,6CAA6C;EACjEC,kBAAkB,EAAEC;AACtB,CAAC,EACD,
|
|
1
|
+
{"version":3,"file":"withIosUserInterfaceStyle.js","names":["_iosPlugins","data","require","withIosUserInterfaceStyle","createInfoPlistPluginWithPropertyGuard","setUserInterfaceStyle","infoPlistProperty","expoConfigProperty","expoPropertyGetter","getUserInterfaceStyle","exports","config","_ref","_config$ios$userInter","_config$ios","ios","userInterfaceStyle","UIUserInterfaceStyle","infoPlist","style","mapUserInterfaceStyleForInfoPlist"],"sources":["../../../../src/plugins/unversioned/expo-system-ui/withIosUserInterfaceStyle.ts"],"sourcesContent":["import { InfoPlist } from '@expo/config-plugins';\nimport { createInfoPlistPluginWithPropertyGuard } from '@expo/config-plugins/build/plugins/ios-plugins';\nimport { ExpoConfig } from '@expo/config-types';\n\nexport const withIosUserInterfaceStyle = createInfoPlistPluginWithPropertyGuard(\n setUserInterfaceStyle,\n {\n infoPlistProperty: 'UIUserInterfaceStyle',\n expoConfigProperty: 'userInterfaceStyle | ios.userInterfaceStyle',\n expoPropertyGetter: getUserInterfaceStyle,\n },\n 'withIosUserInterfaceStyle'\n);\n\nexport function getUserInterfaceStyle(\n config: Pick<ExpoConfig, 'ios' | 'userInterfaceStyle'>\n): string {\n return config.ios?.userInterfaceStyle ?? config.userInterfaceStyle ?? 'light';\n}\n\nexport function setUserInterfaceStyle(\n config: Pick<ExpoConfig, 'ios' | 'userInterfaceStyle'>,\n { UIUserInterfaceStyle, ...infoPlist }: InfoPlist\n): InfoPlist {\n const userInterfaceStyle = getUserInterfaceStyle(config);\n const style = mapUserInterfaceStyleForInfoPlist(userInterfaceStyle);\n\n if (!style) {\n return infoPlist;\n }\n\n return {\n ...infoPlist,\n UIUserInterfaceStyle: style,\n };\n}\n\nfunction mapUserInterfaceStyleForInfoPlist(\n userInterfaceStyle: string\n): NonNullable<InfoPlist['UIUserInterfaceStyle']> | null {\n switch (userInterfaceStyle) {\n case 'light':\n return 'Light';\n case 'dark':\n return 'Dark';\n case 'automatic':\n return 'Automatic';\n }\n\n return null;\n}\n"],"mappings":";;;;;;;;AACA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGO,MAAME,yBAAyB,GAAG,IAAAC,oDAAsC,EAC7EC,qBAAqB,EACrB;EACEC,iBAAiB,EAAE,sBAAsB;EACzCC,kBAAkB,EAAE,6CAA6C;EACjEC,kBAAkB,EAAEC;AACtB,CAAC,EACD,2BACF,CAAC;AAACC,OAAA,CAAAP,yBAAA,GAAAA,yBAAA;AAEK,SAASM,qBAAqBA,CACnCE,MAAsD,EAC9C;EAAA,IAAAC,IAAA,EAAAC,qBAAA,EAAAC,WAAA;EACR,QAAAF,IAAA,IAAAC,qBAAA,IAAAC,WAAA,GAAOH,MAAM,CAACI,GAAG,cAAAD,WAAA,uBAAVA,WAAA,CAAYE,kBAAkB,cAAAH,qBAAA,cAAAA,qBAAA,GAAIF,MAAM,CAACK,kBAAkB,cAAAJ,IAAA,cAAAA,IAAA,GAAI,OAAO;AAC/E;AAEO,SAASP,qBAAqBA,CACnCM,MAAsD,EACtD;EAAEM,oBAAoB;EAAE,GAAGC;AAAqB,CAAC,EACtC;EACX,MAAMF,kBAAkB,GAAGP,qBAAqB,CAACE,MAAM,CAAC;EACxD,MAAMQ,KAAK,GAAGC,iCAAiC,CAACJ,kBAAkB,CAAC;EAEnE,IAAI,CAACG,KAAK,EAAE;IACV,OAAOD,SAAS;EAClB;EAEA,OAAO;IACL,GAAGA,SAAS;IACZD,oBAAoB,EAAEE;EACxB,CAAC;AACH;AAEA,SAASC,iCAAiCA,CACxCJ,kBAA0B,EAC6B;EACvD,QAAQA,kBAAkB;IACxB,KAAK,OAAO;MACV,OAAO,OAAO;IAChB,KAAK,MAAM;MACT,OAAO,MAAM;IACf,KAAK,WAAW;MACd,OAAO,WAAW;EACtB;EAEA,OAAO,IAAI;AACb"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expo/prebuild-config",
|
|
3
|
-
"version": "6.7.
|
|
3
|
+
"version": "6.7.2",
|
|
4
4
|
"description": "Get the prebuild config",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -33,7 +33,8 @@
|
|
|
33
33
|
],
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@types/debug": "^4.1.5",
|
|
36
|
-
"@types/xml2js": "~0.4.11"
|
|
36
|
+
"@types/xml2js": "~0.4.11",
|
|
37
|
+
"expo-module-scripts": "^3.3.0"
|
|
37
38
|
},
|
|
38
39
|
"dependencies": {
|
|
39
40
|
"@expo/config": "~8.5.0",
|
|
@@ -48,11 +49,10 @@
|
|
|
48
49
|
"xml2js": "0.6.0"
|
|
49
50
|
},
|
|
50
51
|
"peerDependencies": {
|
|
51
|
-
"expo-module-scripts": "^3.3.0",
|
|
52
52
|
"expo-modules-autolinking": ">=0.8.1"
|
|
53
53
|
},
|
|
54
54
|
"publishConfig": {
|
|
55
55
|
"access": "public"
|
|
56
56
|
},
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "43f1b4f8a5a9bca649e4e7ca6e4155482a162431"
|
|
58
58
|
}
|