@expo/config-plugins 6.0.0 → 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/build/Plugin.types.js.map +1 -1
- package/build/android/AllowBackup.js.map +1 -1
- package/build/android/BuildProperties.js.map +1 -1
- package/build/android/Colors.js.map +1 -1
- package/build/android/EasBuild.js.map +1 -1
- package/build/android/EasBuildGradleScript.js.map +1 -1
- package/build/android/GoogleMapsApiKey.js.map +1 -1
- package/build/android/GoogleServices.js.map +1 -1
- package/build/android/IntentFilters.js.map +1 -1
- package/build/android/Manifest.js.map +1 -1
- package/build/android/Name.js.map +1 -1
- package/build/android/Orientation.js.map +1 -1
- package/build/android/Package.js +1 -0
- package/build/android/Package.js.map +1 -1
- package/build/android/Paths.js.map +1 -1
- package/build/android/Permissions.js.map +1 -1
- package/build/android/PrimaryColor.js.map +1 -1
- package/build/android/Properties.js.map +1 -1
- package/build/android/Resources.js.map +1 -1
- package/build/android/Scheme.js +1 -1
- package/build/android/Scheme.js.map +1 -1
- package/build/android/StatusBar.js.map +1 -1
- package/build/android/Strings.js.map +1 -1
- package/build/android/Styles.js.map +1 -1
- package/build/android/Updates.js +2 -2
- package/build/android/Updates.js.map +1 -1
- package/build/android/Version.js.map +1 -1
- package/build/android/WindowSoftInputMode.js.map +1 -1
- package/build/android/codeMod.js.map +1 -1
- package/build/android/index.js.map +1 -1
- package/build/index.js.map +1 -1
- package/build/ios/Bitcode.js.map +1 -1
- package/build/ios/BuildProperties.js.map +1 -1
- package/build/ios/BuildScheme.js.map +1 -1
- package/build/ios/BundleIdentifier.js.map +1 -1
- package/build/ios/DeviceFamily.js.map +1 -1
- package/build/ios/Entitlements.js.map +1 -1
- package/build/ios/Google.js.map +1 -1
- package/build/ios/Locales.js.map +1 -1
- package/build/ios/Maps.js +2 -4
- package/build/ios/Maps.js.map +1 -1
- package/build/ios/Name.js.map +1 -1
- package/build/ios/Orientation.js.map +1 -1
- package/build/ios/Paths.js.map +1 -1
- package/build/ios/Permissions.js.map +1 -1
- package/build/ios/ProvisioningProfile.js.map +1 -1
- package/build/ios/RequiresFullScreen.js +1 -1
- package/build/ios/RequiresFullScreen.js.map +1 -1
- package/build/ios/Scheme.js.map +1 -1
- package/build/ios/Swift.js +1 -1
- package/build/ios/Swift.js.map +1 -1
- package/build/ios/Target.js.map +1 -1
- package/build/ios/Updates.js +2 -2
- package/build/ios/Updates.js.map +1 -1
- package/build/ios/UsesNonExemptEncryption.js.map +1 -1
- package/build/ios/Version.js.map +1 -1
- package/build/ios/XcodeProjectFile.js.map +1 -1
- package/build/ios/codeMod.js.map +1 -1
- package/build/ios/index.js.map +1 -1
- package/build/ios/utils/Xcodeproj.js.map +1 -1
- package/build/ios/utils/getInfoPlistPath.js.map +1 -1
- package/build/ios/utils/string.js.map +1 -1
- package/build/plugins/android-plugins.js.map +1 -1
- package/build/plugins/createBaseMod.d.ts +2 -1
- package/build/plugins/createBaseMod.js.map +1 -1
- package/build/plugins/ios-plugins.js.map +1 -1
- package/build/plugins/mod-compiler.js +3 -3
- package/build/plugins/mod-compiler.js.map +1 -1
- package/build/plugins/withAndroidBaseMods.js.map +1 -1
- package/build/plugins/withDangerousMod.js.map +1 -1
- package/build/plugins/withIosBaseMods.js.map +1 -1
- package/build/plugins/withMod.d.ts +2 -1
- package/build/plugins/withMod.js.map +1 -1
- package/build/plugins/withPlugins.js.map +1 -1
- package/build/plugins/withRunOnce.js.map +1 -1
- package/build/plugins/withStaticPlugin.js.map +1 -1
- package/build/utils/Updates.d.ts +2 -2
- package/build/utils/Updates.js +35 -18
- package/build/utils/Updates.js.map +1 -1
- package/build/utils/XML.d.ts +1 -0
- package/build/utils/XML.js +5 -2
- package/build/utils/XML.js.map +1 -1
- package/build/utils/commonCodeMod.js.map +1 -1
- package/build/utils/errors.js.map +1 -1
- package/build/utils/fs.js.map +1 -1
- package/build/utils/generateCode.js.map +1 -1
- package/build/utils/history.js.map +1 -1
- package/build/utils/matchBrackets.js.map +1 -1
- package/build/utils/modules.js.map +1 -1
- package/build/utils/obj.js.map +1 -1
- package/build/utils/plugin-resolver.js.map +1 -1
- package/build/utils/sortObject.js.map +1 -1
- package/build/utils/versions.js.map +1 -1
- package/build/utils/warnings.d.ts +1 -1
- package/build/utils/warnings.js.map +1 -1
- package/package.json +3 -3
package/build/ios/Maps.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Maps.js","names":["debug","require","MATCH_INIT","withGoogleMapsKey","createInfoPlistPlugin","setGoogleMapsApiKey","withMaps","config","apiKey","getGoogleMapsApiKey","withMapsCocoaPods","useGoogleMaps","withGoogleMapsAppDelegate","ios","googleMapsApiKey","GMSApiKey","infoPlist","addGoogleMapsAppDelegateImport","src","newSrc","push","mergeContents","tag","join","anchor","offset","comment","removeGoogleMapsAppDelegateImport","removeContents","addGoogleMapsAppDelegateInit","removeGoogleMapsAppDelegateInit","addMapsCocoaPods","removeMapsCocoaPods","isReactNativeMapsInstalled","projectRoot","resolved","resolveFrom","silent","path","dirname","isReactNativeMapsAutolinked","withDangerousMod","filePath","modRequest","platformProjectRoot","contents","fs","promises","readFile","results","googleMapsPath","isLinked","error","code","Error","didMerge","didClear","writeFile","withAppDelegate","includes","modResults","language"],"sources":["../../src/ios/Maps.ts"],"sourcesContent":["import { ExpoConfig } from '@expo/config-types';\nimport fs from 'fs';\nimport path from 'path';\nimport resolveFrom from 'resolve-from';\n\nimport { ConfigPlugin, InfoPlist } from '../Plugin.types';\nimport { createInfoPlistPlugin, withAppDelegate } from '../plugins/ios-plugins';\nimport { withDangerousMod } from '../plugins/withDangerousMod';\nimport { mergeContents, MergeResults, removeContents } from '../utils/generateCode';\n\nconst debug = require('debug')('expo:config-plugins:ios:maps') as typeof console.log;\n\n// Match against `UMModuleRegistryAdapter` (unimodules), and React Native without unimodules (Expo Modules), and SDK +44 React AppDelegate subscriber.\nexport const MATCH_INIT =\n /(?:(self\\.|_)(\\w+)\\s?=\\s?\\[\\[UMModuleRegistryAdapter alloc\\])|(?:RCTBridge\\s?\\*\\s?(\\w+)\\s?=\\s?\\[\\[RCTBridge alloc\\])|(\\[self\\.reactDelegate createBridgeWithDelegate:self launchOptions:launchOptions\\])/g;\n\nconst withGoogleMapsKey = createInfoPlistPlugin(setGoogleMapsApiKey, 'withGoogleMapsKey');\n\nexport const withMaps: ConfigPlugin = (config) => {\n config = withGoogleMapsKey(config);\n\n const apiKey = getGoogleMapsApiKey(config);\n // Technically adds react-native-maps (Apple maps) and google maps.\n\n debug('Google Maps API Key:', apiKey);\n config = withMapsCocoaPods(config, { useGoogleMaps: !!apiKey });\n\n // Adds/Removes AppDelegate setup for Google Maps API on iOS\n config = withGoogleMapsAppDelegate(config, { apiKey });\n\n return config;\n};\n\nexport function getGoogleMapsApiKey(config: Pick<ExpoConfig, 'ios'>) {\n return config.ios?.config?.googleMapsApiKey ?? null;\n}\n\nexport function setGoogleMapsApiKey(\n config: Pick<ExpoConfig, 'ios'>,\n { GMSApiKey, ...infoPlist }: InfoPlist\n): InfoPlist {\n const apiKey = getGoogleMapsApiKey(config);\n\n if (apiKey === null) {\n return infoPlist;\n }\n\n return {\n ...infoPlist,\n GMSApiKey: apiKey,\n };\n}\n\nexport function addGoogleMapsAppDelegateImport(src: string): MergeResults {\n const newSrc = [];\n newSrc.push(\n '#if __has_include(<GoogleMaps/GoogleMaps.h>)',\n '#import <GoogleMaps/GoogleMaps.h>',\n '#endif'\n );\n\n return mergeContents({\n tag: 'react-native-maps-import',\n src,\n newSrc: newSrc.join('\\n'),\n anchor: /#import \"AppDelegate\\.h\"/,\n offset: 1,\n comment: '//',\n });\n}\n\nexport function removeGoogleMapsAppDelegateImport(src: string): MergeResults {\n return removeContents({\n tag: 'react-native-maps-import',\n src,\n });\n}\n\nexport function addGoogleMapsAppDelegateInit(src: string, apiKey: string): MergeResults {\n const newSrc = [];\n newSrc.push(\n '#if __has_include(<GoogleMaps/GoogleMaps.h>)',\n ` [GMSServices provideAPIKey:@\"${apiKey}\"];`,\n '#endif'\n );\n\n return mergeContents({\n tag: 'react-native-maps-init',\n src,\n newSrc: newSrc.join('\\n'),\n anchor: MATCH_INIT,\n offset: 0,\n comment: '//',\n });\n}\n\nexport function removeGoogleMapsAppDelegateInit(src: string): MergeResults {\n return removeContents({\n tag: 'react-native-maps-init',\n src,\n });\n}\n\n/**\n * @param src The contents of the Podfile.\n * @returns Podfile with Google Maps added.\n */\nexport function addMapsCocoaPods(src: string): MergeResults {\n return mergeContents({\n tag: 'react-native-maps',\n src,\n newSrc: ` pod 'react-native-google-maps', path: File.dirname(\\`node --print \"require.resolve('react-native-maps/package.json')\"\\`)`,\n anchor: /use_native_modules/,\n offset: 0,\n comment: '#',\n });\n}\n\nexport function removeMapsCocoaPods(src: string): MergeResults {\n return removeContents({\n tag: 'react-native-maps',\n src,\n });\n}\n\nfunction isReactNativeMapsInstalled(projectRoot: string): string | null {\n const resolved = resolveFrom.silent(projectRoot, 'react-native-maps/package.json');\n return resolved ? path.dirname(resolved) : null;\n}\n\nfunction isReactNativeMapsAutolinked(config: Pick<ExpoConfig, '_internal'>): boolean {\n // Only add the native code changes if we know that the package is going to be linked natively.\n // This is specifically for monorepo support where one app might have react-native-maps (adding it to the node_modules)\n // but another app will not have it installed in the package.json, causing it to not be linked natively.\n // This workaround only exists because react-native-maps doesn't have a config plugin vendored in the package.\n\n // TODO: `react-native-maps` doesn't use Expo autolinking so we cannot safely disable the module.\n return true;\n\n // return (\n // !config._internal?.autolinkedModules ||\n // config._internal.autolinkedModules.includes('react-native-maps')\n // );\n}\n\nconst withMapsCocoaPods: ConfigPlugin<{ useGoogleMaps: boolean }> = (config, { useGoogleMaps }) => {\n return withDangerousMod(config, [\n 'ios',\n async (config) => {\n const filePath = path.join(config.modRequest.platformProjectRoot, 'Podfile');\n const contents = await fs.promises.readFile(filePath, 'utf-8');\n let results: MergeResults;\n // Only add the block if react-native-maps is installed in the project (best effort).\n // Generally prebuild runs after a yarn install so this should always work as expected.\n const googleMapsPath = isReactNativeMapsInstalled(config.modRequest.projectRoot);\n const isLinked = isReactNativeMapsAutolinked(config);\n debug('Is Expo Autolinked:', isLinked);\n debug('react-native-maps path:', googleMapsPath);\n if (isLinked && googleMapsPath && useGoogleMaps) {\n try {\n results = addMapsCocoaPods(contents);\n } catch (error: any) {\n if (error.code === 'ERR_NO_MATCH') {\n throw new Error(\n `Cannot add react-native-maps to the project's ios/Podfile because it's malformed. Please report this with a copy of your project Podfile.`\n );\n }\n throw error;\n }\n } else {\n // If the package is no longer installed, then remove the block.\n results = removeMapsCocoaPods(contents);\n }\n if (results.didMerge || results.didClear) {\n await fs.promises.writeFile(filePath, results.contents);\n }\n return config;\n },\n ]);\n};\n\nconst withGoogleMapsAppDelegate: ConfigPlugin<{ apiKey: string | null }> = (config, { apiKey }) => {\n return withAppDelegate(config, (config) => {\n if (['objc', 'objcpp'].includes(config.modResults.language)) {\n if (\n apiKey &&\n isReactNativeMapsAutolinked(config) &&\n isReactNativeMapsInstalled(config.modRequest.projectRoot)\n ) {\n try {\n config.modResults.contents = addGoogleMapsAppDelegateImport(\n config.modResults.contents\n ).contents;\n config.modResults.contents = addGoogleMapsAppDelegateInit(\n config.modResults.contents,\n apiKey\n ).contents;\n } catch (error: any) {\n if (error.code === 'ERR_NO_MATCH') {\n throw new Error(\n `Cannot add Google Maps to the project's AppDelegate because it's malformed. Please report this with a copy of your project AppDelegate.`\n );\n }\n throw error;\n }\n } else {\n config.modResults.contents = removeGoogleMapsAppDelegateImport(\n config.modResults.contents\n ).contents;\n config.modResults.contents = removeGoogleMapsAppDelegateInit(\n config.modResults.contents\n ).contents;\n }\n } else {\n throw new Error(\n `Cannot setup Google Maps because the project AppDelegate is not a supported language: ${config.modResults.language}`\n );\n }\n return config;\n });\n};\n"],"mappings":";;;;;;;;;;;;;;;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;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,MAAM,CAACqD,UAAU,CAACf,QAAQ,GAAGlB,iCAAiC,CAC5DpB,MAAM,CAACqD,UAAU,CAACf,QAAQ,CAC3B,CAACA,QAAQ;QACVtC,MAAM,CAACqD,UAAU,CAACf,QAAQ,GAAGf,+BAA+B,CAC1DvB,MAAM,CAACqD,UAAU,CAACf,QAAQ,CAC3B,CAACA,QAAQ;MACZ;IACF,CAAC,MAAM;MACL,MAAM,IAAIS,KAAK,CACZ,yFAAwF/C,MAAM,CAACqD,UAAU,CAACC,QAAS,EAAC,CACtH;IACH;IACA,OAAOtD,MAAM;EACf,CAAC,CAAC;AACJ,CAAC"}
|
|
1
|
+
{"version":3,"file":"Maps.js","names":["_fs","data","_interopRequireDefault","require","_path","_resolveFrom","_iosPlugins","_withDangerousMod","_generateCode","obj","__esModule","default","debug","MATCH_INIT","exports","withGoogleMapsKey","createInfoPlistPlugin","setGoogleMapsApiKey","withMaps","config","apiKey","getGoogleMapsApiKey","withMapsCocoaPods","useGoogleMaps","withGoogleMapsAppDelegate","_config$ios$config$go","_config$ios","_config$ios$config","ios","googleMapsApiKey","GMSApiKey","infoPlist","addGoogleMapsAppDelegateImport","src","newSrc","push","mergeContents","tag","join","anchor","offset","comment","removeGoogleMapsAppDelegateImport","removeContents","addGoogleMapsAppDelegateInit","removeGoogleMapsAppDelegateInit","addMapsCocoaPods","removeMapsCocoaPods","isReactNativeMapsInstalled","projectRoot","resolved","resolveFrom","silent","path","dirname","isReactNativeMapsAutolinked","withDangerousMod","filePath","modRequest","platformProjectRoot","contents","fs","promises","readFile","results","googleMapsPath","isLinked","error","code","Error","didMerge","didClear","writeFile","withAppDelegate","includes","modResults","language"],"sources":["../../src/ios/Maps.ts"],"sourcesContent":["import { ExpoConfig } from '@expo/config-types';\nimport fs from 'fs';\nimport path from 'path';\nimport resolveFrom from 'resolve-from';\n\nimport { ConfigPlugin, InfoPlist } from '../Plugin.types';\nimport { createInfoPlistPlugin, withAppDelegate } from '../plugins/ios-plugins';\nimport { withDangerousMod } from '../plugins/withDangerousMod';\nimport { mergeContents, MergeResults, removeContents } from '../utils/generateCode';\n\nconst debug = require('debug')('expo:config-plugins:ios:maps') as typeof console.log;\n\nexport const MATCH_INIT =\n /-\\s*\\(BOOL\\)\\s*application:\\s*\\(UIApplication\\s*\\*\\s*\\)\\s*\\w+\\s+didFinishLaunchingWithOptions:/g;\n\nconst withGoogleMapsKey = createInfoPlistPlugin(setGoogleMapsApiKey, 'withGoogleMapsKey');\n\nexport const withMaps: ConfigPlugin = (config) => {\n config = withGoogleMapsKey(config);\n\n const apiKey = getGoogleMapsApiKey(config);\n // Technically adds react-native-maps (Apple maps) and google maps.\n\n debug('Google Maps API Key:', apiKey);\n config = withMapsCocoaPods(config, { useGoogleMaps: !!apiKey });\n\n // Adds/Removes AppDelegate setup for Google Maps API on iOS\n config = withGoogleMapsAppDelegate(config, { apiKey });\n\n return config;\n};\n\nexport function getGoogleMapsApiKey(config: Pick<ExpoConfig, 'ios'>) {\n return config.ios?.config?.googleMapsApiKey ?? null;\n}\n\nexport function setGoogleMapsApiKey(\n config: Pick<ExpoConfig, 'ios'>,\n { GMSApiKey, ...infoPlist }: InfoPlist\n): InfoPlist {\n const apiKey = getGoogleMapsApiKey(config);\n\n if (apiKey === null) {\n return infoPlist;\n }\n\n return {\n ...infoPlist,\n GMSApiKey: apiKey,\n };\n}\n\nexport function addGoogleMapsAppDelegateImport(src: string): MergeResults {\n const newSrc = [];\n newSrc.push(\n '#if __has_include(<GoogleMaps/GoogleMaps.h>)',\n '#import <GoogleMaps/GoogleMaps.h>',\n '#endif'\n );\n\n return mergeContents({\n tag: 'react-native-maps-import',\n src,\n newSrc: newSrc.join('\\n'),\n anchor: /#import \"AppDelegate\\.h\"/,\n offset: 1,\n comment: '//',\n });\n}\n\nexport function removeGoogleMapsAppDelegateImport(src: string): MergeResults {\n return removeContents({\n tag: 'react-native-maps-import',\n src,\n });\n}\n\nexport function addGoogleMapsAppDelegateInit(src: string, apiKey: string): MergeResults {\n const newSrc = [];\n newSrc.push(\n '#if __has_include(<GoogleMaps/GoogleMaps.h>)',\n ` [GMSServices provideAPIKey:@\"${apiKey}\"];`,\n '#endif'\n );\n\n return mergeContents({\n tag: 'react-native-maps-init',\n src,\n newSrc: newSrc.join('\\n'),\n anchor: MATCH_INIT,\n offset: 2,\n comment: '//',\n });\n}\n\nexport function removeGoogleMapsAppDelegateInit(src: string): MergeResults {\n return removeContents({\n tag: 'react-native-maps-init',\n src,\n });\n}\n\n/**\n * @param src The contents of the Podfile.\n * @returns Podfile with Google Maps added.\n */\nexport function addMapsCocoaPods(src: string): MergeResults {\n return mergeContents({\n tag: 'react-native-maps',\n src,\n newSrc: ` pod 'react-native-google-maps', path: File.dirname(\\`node --print \"require.resolve('react-native-maps/package.json')\"\\`)`,\n anchor: /use_native_modules/,\n offset: 0,\n comment: '#',\n });\n}\n\nexport function removeMapsCocoaPods(src: string): MergeResults {\n return removeContents({\n tag: 'react-native-maps',\n src,\n });\n}\n\nfunction isReactNativeMapsInstalled(projectRoot: string): string | null {\n const resolved = resolveFrom.silent(projectRoot, 'react-native-maps/package.json');\n return resolved ? path.dirname(resolved) : null;\n}\n\nfunction isReactNativeMapsAutolinked(config: Pick<ExpoConfig, '_internal'>): boolean {\n // Only add the native code changes if we know that the package is going to be linked natively.\n // This is specifically for monorepo support where one app might have react-native-maps (adding it to the node_modules)\n // but another app will not have it installed in the package.json, causing it to not be linked natively.\n // This workaround only exists because react-native-maps doesn't have a config plugin vendored in the package.\n\n // TODO: `react-native-maps` doesn't use Expo autolinking so we cannot safely disable the module.\n return true;\n\n // return (\n // !config._internal?.autolinkedModules ||\n // config._internal.autolinkedModules.includes('react-native-maps')\n // );\n}\n\nconst withMapsCocoaPods: ConfigPlugin<{ useGoogleMaps: boolean }> = (config, { useGoogleMaps }) => {\n return withDangerousMod(config, [\n 'ios',\n async (config) => {\n const filePath = path.join(config.modRequest.platformProjectRoot, 'Podfile');\n const contents = await fs.promises.readFile(filePath, 'utf-8');\n let results: MergeResults;\n // Only add the block if react-native-maps is installed in the project (best effort).\n // Generally prebuild runs after a yarn install so this should always work as expected.\n const googleMapsPath = isReactNativeMapsInstalled(config.modRequest.projectRoot);\n const isLinked = isReactNativeMapsAutolinked(config);\n debug('Is Expo Autolinked:', isLinked);\n debug('react-native-maps path:', googleMapsPath);\n if (isLinked && googleMapsPath && useGoogleMaps) {\n try {\n results = addMapsCocoaPods(contents);\n } catch (error: any) {\n if (error.code === 'ERR_NO_MATCH') {\n throw new Error(\n `Cannot add react-native-maps to the project's ios/Podfile because it's malformed. Please report this with a copy of your project Podfile.`\n );\n }\n throw error;\n }\n } else {\n // If the package is no longer installed, then remove the block.\n results = removeMapsCocoaPods(contents);\n }\n if (results.didMerge || results.didClear) {\n await fs.promises.writeFile(filePath, results.contents);\n }\n return config;\n },\n ]);\n};\n\nconst withGoogleMapsAppDelegate: ConfigPlugin<{ apiKey: string | null }> = (config, { apiKey }) => {\n return withAppDelegate(config, (config) => {\n if (['objc', 'objcpp'].includes(config.modResults.language)) {\n if (\n apiKey &&\n isReactNativeMapsAutolinked(config) &&\n isReactNativeMapsInstalled(config.modRequest.projectRoot)\n ) {\n try {\n config.modResults.contents = addGoogleMapsAppDelegateImport(\n config.modResults.contents\n ).contents;\n config.modResults.contents = addGoogleMapsAppDelegateInit(\n config.modResults.contents,\n apiKey\n ).contents;\n } catch (error: any) {\n if (error.code === 'ERR_NO_MATCH') {\n throw new Error(\n `Cannot add Google Maps to the project's AppDelegate because it's malformed. Please report this with a copy of your project AppDelegate.`\n );\n }\n throw error;\n }\n } else {\n config.modResults.contents = removeGoogleMapsAppDelegateImport(\n config.modResults.contents\n ).contents;\n config.modResults.contents = removeGoogleMapsAppDelegateInit(\n config.modResults.contents\n ).contents;\n }\n } else {\n throw new Error(\n `Cannot setup Google Maps because the project AppDelegate is not a supported language: ${config.modResults.language}`\n );\n }\n return config;\n });\n};\n"],"mappings":";;;;;;;;;;;;;;;AACA,SAAAA,IAAA;EAAA,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S,KAAK,CACZ,yFAAwFlD,MAAM,CAACwD,UAAU,CAACC,QAAS,EAAC,CACtH;IACH;IACA,OAAOzD,MAAM;EACf,CAAC,CAAC;AACJ,CAAC"}
|
package/build/ios/Name.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Name.js","names":["withDisplayName","createInfoPlistPluginWithPropertyGuard","setDisplayName","infoPlistProperty","expoConfigProperty","withName","setName","withProductName","config","withXcodeProject","modResults","setProductName","getName","name","configOrName","CFBundleDisplayName","infoPlist","CFBundleName","project","sanitizedName","quotedName","ensureQuotes","nativeTarget","findFirstNativeTarget","getBuildConfigurationsForListId","buildConfigurationList","forEach","item","buildSettings","PRODUCT_NAME","value","match"],"sources":["../../src/ios/Name.ts"],"sourcesContent":["import { ExpoConfig } from '@expo/config-types';\nimport { XcodeProject } from 'xcode';\n\nimport { ConfigPlugin } from '../Plugin.types';\nimport { createInfoPlistPluginWithPropertyGuard, withXcodeProject } from '../plugins/ios-plugins';\nimport { InfoPlist } from './IosConfig.types';\nimport { findFirstNativeTarget } from './Target';\nimport {\n ConfigurationSectionEntry,\n getBuildConfigurationsForListId,\n sanitizedName,\n} from './utils/Xcodeproj';\n\nexport const withDisplayName = createInfoPlistPluginWithPropertyGuard(\n setDisplayName,\n {\n infoPlistProperty: 'CFBundleDisplayName',\n expoConfigProperty: 'name',\n },\n 'withDisplayName'\n);\n\nexport const withName = createInfoPlistPluginWithPropertyGuard(\n setName,\n {\n infoPlistProperty: 'CFBundleName',\n expoConfigProperty: 'name',\n },\n 'withName'\n);\n\n/** Set the PRODUCT_NAME variable in the xcproj file based on the app.json name property. */\nexport const withProductName: ConfigPlugin = (config) => {\n return withXcodeProject(config, (config) => {\n config.modResults = setProductName(config, config.modResults);\n return config;\n });\n};\n\nexport function getName(config: Pick<ExpoConfig, 'name'>) {\n return typeof config.name === 'string' ? config.name : null;\n}\n\n/**\n * CFBundleDisplayName is used for most things: the name on the home screen, in\n * notifications, and others.\n */\nexport function setDisplayName(\n configOrName: Pick<ExpoConfig, 'name'> | string,\n { CFBundleDisplayName, ...infoPlist }: InfoPlist\n): InfoPlist {\n let name: string | null = null;\n if (typeof configOrName === 'string') {\n name = configOrName;\n } else {\n name = getName(configOrName);\n }\n\n if (!name) {\n return infoPlist;\n }\n\n return {\n ...infoPlist,\n CFBundleDisplayName: name,\n };\n}\n\n/**\n * CFBundleName is recommended to be 16 chars or less and is used in lists, eg:\n * sometimes on the App Store\n */\nexport function setName(\n config: Pick<ExpoConfig, 'name'>,\n { CFBundleName, ...infoPlist }: InfoPlist\n): InfoPlist {\n const name = getName(config);\n\n if (!name) {\n return infoPlist;\n }\n\n return {\n ...infoPlist,\n CFBundleName: name,\n };\n}\n\nexport function setProductName(\n config: Pick<ExpoConfig, 'name'>,\n project: XcodeProject\n): XcodeProject {\n const name = sanitizedName(getName(config) ?? '');\n\n if (!name) {\n return project;\n }\n const quotedName = ensureQuotes(name);\n\n const [, nativeTarget] = findFirstNativeTarget(project);\n\n getBuildConfigurationsForListId(project, nativeTarget.buildConfigurationList).forEach(\n ([, item]: ConfigurationSectionEntry) => {\n item.buildSettings.PRODUCT_NAME = quotedName;\n }\n );\n\n return project;\n}\n\nconst ensureQuotes = (value: string) => {\n if (!value.match(/^['\"]/)) {\n return `\"${value}\"`;\n }\n return value;\n};\n"],"mappings":";;;;;;;;;;AAIA;EAAA;
|
|
1
|
+
{"version":3,"file":"Name.js","names":["_iosPlugins","data","require","_Target","_Xcodeproj","withDisplayName","createInfoPlistPluginWithPropertyGuard","setDisplayName","infoPlistProperty","expoConfigProperty","exports","withName","setName","withProductName","config","withXcodeProject","modResults","setProductName","getName","name","configOrName","CFBundleDisplayName","infoPlist","CFBundleName","project","_getName","sanitizedName","quotedName","ensureQuotes","nativeTarget","findFirstNativeTarget","getBuildConfigurationsForListId","buildConfigurationList","forEach","item","buildSettings","PRODUCT_NAME","value","match"],"sources":["../../src/ios/Name.ts"],"sourcesContent":["import { ExpoConfig } from '@expo/config-types';\nimport { XcodeProject } from 'xcode';\n\nimport { ConfigPlugin } from '../Plugin.types';\nimport { createInfoPlistPluginWithPropertyGuard, withXcodeProject } from '../plugins/ios-plugins';\nimport { InfoPlist } from './IosConfig.types';\nimport { findFirstNativeTarget } from './Target';\nimport {\n ConfigurationSectionEntry,\n getBuildConfigurationsForListId,\n sanitizedName,\n} from './utils/Xcodeproj';\n\nexport const withDisplayName = createInfoPlistPluginWithPropertyGuard(\n setDisplayName,\n {\n infoPlistProperty: 'CFBundleDisplayName',\n expoConfigProperty: 'name',\n },\n 'withDisplayName'\n);\n\nexport const withName = createInfoPlistPluginWithPropertyGuard(\n setName,\n {\n infoPlistProperty: 'CFBundleName',\n expoConfigProperty: 'name',\n },\n 'withName'\n);\n\n/** Set the PRODUCT_NAME variable in the xcproj file based on the app.json name property. */\nexport const withProductName: ConfigPlugin = (config) => {\n return withXcodeProject(config, (config) => {\n config.modResults = setProductName(config, config.modResults);\n return config;\n });\n};\n\nexport function getName(config: Pick<ExpoConfig, 'name'>) {\n return typeof config.name === 'string' ? config.name : null;\n}\n\n/**\n * CFBundleDisplayName is used for most things: the name on the home screen, in\n * notifications, and others.\n */\nexport function setDisplayName(\n configOrName: Pick<ExpoConfig, 'name'> | string,\n { CFBundleDisplayName, ...infoPlist }: InfoPlist\n): InfoPlist {\n let name: string | null = null;\n if (typeof configOrName === 'string') {\n name = configOrName;\n } else {\n name = getName(configOrName);\n }\n\n if (!name) {\n return infoPlist;\n }\n\n return {\n ...infoPlist,\n CFBundleDisplayName: name,\n };\n}\n\n/**\n * CFBundleName is recommended to be 16 chars or less and is used in lists, eg:\n * sometimes on the App Store\n */\nexport function setName(\n config: Pick<ExpoConfig, 'name'>,\n { CFBundleName, ...infoPlist }: InfoPlist\n): InfoPlist {\n const name = getName(config);\n\n if (!name) {\n return infoPlist;\n }\n\n return {\n ...infoPlist,\n CFBundleName: name,\n };\n}\n\nexport function setProductName(\n config: Pick<ExpoConfig, 'name'>,\n project: XcodeProject\n): XcodeProject {\n const name = sanitizedName(getName(config) ?? '');\n\n if (!name) {\n return project;\n }\n const quotedName = ensureQuotes(name);\n\n const [, nativeTarget] = findFirstNativeTarget(project);\n\n getBuildConfigurationsForListId(project, nativeTarget.buildConfigurationList).forEach(\n ([, item]: ConfigurationSectionEntry) => {\n item.buildSettings.PRODUCT_NAME = quotedName;\n }\n );\n\n return project;\n}\n\nconst ensureQuotes = (value: string) => {\n if (!value.match(/^['\"]/)) {\n return `\"${value}\"`;\n }\n return value;\n};\n"],"mappings":";;;;;;;;;;AAIA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAE,QAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,WAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,UAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAMO,MAAMI,eAAe,GAAG,IAAAC,oDAAsC,EACnEC,cAAc,EACd;EACEC,iBAAiB,EAAE,qBAAqB;EACxCC,kBAAkB,EAAE;AACtB,CAAC,EACD,iBAAiB,CAClB;AAACC,OAAA,CAAAL,eAAA,GAAAA,eAAA;AAEK,MAAMM,QAAQ,GAAG,IAAAL,oDAAsC,EAC5DM,OAAO,EACP;EACEJ,iBAAiB,EAAE,cAAc;EACjCC,kBAAkB,EAAE;AACtB,CAAC,EACD,UAAU,CACX;;AAED;AAAAC,OAAA,CAAAC,QAAA,GAAAA,QAAA;AACO,MAAME,eAA6B,GAAIC,MAAM,IAAK;EACvD,OAAO,IAAAC,8BAAgB,EAACD,MAAM,EAAGA,MAAM,IAAK;IAC1CA,MAAM,CAACE,UAAU,GAAGC,cAAc,CAAC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YAAY,CAACT,IAAI,CAAC;EAErC,MAAM,GAAGU,YAAY,CAAC,GAAG,IAAAC,+BAAqB,EAACN,OAAO,CAAC;EAEvD,IAAAO,4CAA+B,EAACP,OAAO,EAAEK,YAAY,CAACG,sBAAsB,CAAC,CAACC,OAAO,CACnF,CAAC,GAAGC,IAAI,CAA4B,KAAK;IACvCA,IAAI,CAACC,aAAa,CAACC,YAAY,GAAGT,UAAU;EAC9C,CAAC,CACF;EAED,OAAOH,OAAO;AAChB;AAEA,MAAMI,YAAY,GAAIS,KAAa,IAAK;EACtC,IAAI,CAACA,KAAK,CAACC,KAAK,CAAC,OAAO,CAAC,EAAE;IACzB,OAAQ,IAAGD,KAAM,GAAE;EACrB;EACA,OAAOA,KAAK;AACd,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Orientation.js","names":["withOrientation","createInfoPlistPluginWithPropertyGuard","setOrientation","infoPlistProperty","expoConfigProperty","getOrientation","config","orientation","PORTRAIT_ORIENTATIONS","LANDSCAPE_ORIENTATIONS","getUISupportedInterfaceOrientations","infoPlist","UISupportedInterfaceOrientations"],"sources":["../../src/ios/Orientation.ts"],"sourcesContent":["import { ExpoConfig } from '@expo/config-types';\n\nimport { createInfoPlistPluginWithPropertyGuard } from '../plugins/ios-plugins';\nimport { InfoPlist, InterfaceOrientation } from './IosConfig.types';\n\nexport const withOrientation = createInfoPlistPluginWithPropertyGuard(\n setOrientation,\n {\n infoPlistProperty: 'UISupportedInterfaceOrientations',\n expoConfigProperty: 'orientation',\n },\n 'withOrientation'\n);\n\nexport function getOrientation(config: Pick<ExpoConfig, 'orientation'>) {\n return config.orientation ?? null;\n}\n\nexport const PORTRAIT_ORIENTATIONS: InterfaceOrientation[] = [\n 'UIInterfaceOrientationPortrait',\n 'UIInterfaceOrientationPortraitUpsideDown',\n];\n\nexport const LANDSCAPE_ORIENTATIONS: InterfaceOrientation[] = [\n 'UIInterfaceOrientationLandscapeLeft',\n 'UIInterfaceOrientationLandscapeRight',\n];\n\nfunction getUISupportedInterfaceOrientations(orientation: string | null): InterfaceOrientation[] {\n if (orientation === 'portrait') {\n return PORTRAIT_ORIENTATIONS;\n } else if (orientation === 'landscape') {\n return LANDSCAPE_ORIENTATIONS;\n } else {\n return [...PORTRAIT_ORIENTATIONS, ...LANDSCAPE_ORIENTATIONS];\n }\n}\n\nexport function setOrientation(\n config: Pick<ExpoConfig, 'orientation'>,\n infoPlist: InfoPlist\n): InfoPlist {\n const orientation = getOrientation(config);\n\n return {\n ...infoPlist,\n UISupportedInterfaceOrientations: getUISupportedInterfaceOrientations(orientation),\n };\n}\n"],"mappings":";;;;;;;;;AAEA;EAAA;
|
|
1
|
+
{"version":3,"file":"Orientation.js","names":["_iosPlugins","data","require","withOrientation","createInfoPlistPluginWithPropertyGuard","setOrientation","infoPlistProperty","expoConfigProperty","exports","getOrientation","config","_config$orientation","orientation","PORTRAIT_ORIENTATIONS","LANDSCAPE_ORIENTATIONS","getUISupportedInterfaceOrientations","infoPlist","UISupportedInterfaceOrientations"],"sources":["../../src/ios/Orientation.ts"],"sourcesContent":["import { ExpoConfig } from '@expo/config-types';\n\nimport { createInfoPlistPluginWithPropertyGuard } from '../plugins/ios-plugins';\nimport { InfoPlist, InterfaceOrientation } from './IosConfig.types';\n\nexport const withOrientation = createInfoPlistPluginWithPropertyGuard(\n setOrientation,\n {\n infoPlistProperty: 'UISupportedInterfaceOrientations',\n expoConfigProperty: 'orientation',\n },\n 'withOrientation'\n);\n\nexport function getOrientation(config: Pick<ExpoConfig, 'orientation'>) {\n return config.orientation ?? null;\n}\n\nexport const PORTRAIT_ORIENTATIONS: InterfaceOrientation[] = [\n 'UIInterfaceOrientationPortrait',\n 'UIInterfaceOrientationPortraitUpsideDown',\n];\n\nexport const LANDSCAPE_ORIENTATIONS: InterfaceOrientation[] = [\n 'UIInterfaceOrientationLandscapeLeft',\n 'UIInterfaceOrientationLandscapeRight',\n];\n\nfunction getUISupportedInterfaceOrientations(orientation: string | null): InterfaceOrientation[] {\n if (orientation === 'portrait') {\n return PORTRAIT_ORIENTATIONS;\n } else if (orientation === 'landscape') {\n return LANDSCAPE_ORIENTATIONS;\n } else {\n return [...PORTRAIT_ORIENTATIONS, ...LANDSCAPE_ORIENTATIONS];\n }\n}\n\nexport function setOrientation(\n config: Pick<ExpoConfig, 'orientation'>,\n infoPlist: InfoPlist\n): InfoPlist {\n const orientation = getOrientation(config);\n\n return {\n ...infoPlist,\n UISupportedInterfaceOrientations: getUISupportedInterfaceOrientations(orientation),\n };\n}\n"],"mappings":";;;;;;;;;AAEA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGO,MAAME,eAAe,GAAG,IAAAC,oDAAsC,EACnEC,cAAc,EACd;EACEC,iBAAiB,EAAE,kCAAkC;EACrDC,kBAAkB,EAAE;AACtB,CAAC,EACD,iBAAiB,CAClB;AAACC,OAAA,CAAAL,eAAA,GAAAA,eAAA;AAEK,SAASM,cAAcA,CAACC,MAAuC,EAAE;EAAA,IAAAC,mBAAA;EACtE,QAAAA,mBAAA,GAAOD,MAAM,CAACE,WAAW,cAAAD,mBAAA,cAAAA,mBAAA,GAAI,IAAI;AACnC;AAEO,MAAME,qBAA6C,GAAG,CAC3D,gCAAgC,EAChC,0CAA0C,CAC3C;AAACL,OAAA,CAAAK,qBAAA,GAAAA,qBAAA;AAEK,MAAMC,sBAA8C,GAAG,CAC5D,qCAAqC,EACrC,sCAAsC,CACvC;AAACN,OAAA,CAAAM,sBAAA,GAAAA,sBAAA;AAEF,SAASC,mCAAmCA,CAACH,WAA0B,EAA0B;EAC/F,IAAIA,WAAW,KAAK,UAAU,EAAE;IAC9B,OAAOC,qBAAqB;EAC9B,CAAC,MAAM,IAAID,WAAW,KAAK,WAAW,EAAE;IACtC,OAAOE,sBAAsB;EAC/B,CAAC,MAAM;IACL,OAAO,CAAC,GAAGD,qBAAqB,EAAE,GAAGC,sBAAsB,CAAC;EAC9D;AACF;AAEO,SAAST,cAAcA,CAC5BK,MAAuC,EACvCM,SAAoB,EACT;EACX,MAAMJ,WAAW,GAAGH,cAAc,CAACC,MAAM,CAAC;EAE1C,OAAO;IACL,GAAGM,SAAS;IACZC,gCAAgC,EAAEF,mCAAmC,CAACH,WAAW;EACnF,CAAC;AACH"}
|
package/build/ios/Paths.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Paths.js","names":["ignoredPaths","getAppDelegateHeaderFilePath","projectRoot","using","extra","globSync","absolute","cwd","ignore","UnexpectedError","length","warnMultipleFiles","tag","fileName","getAppDelegateFilePath","getAppDelegateObjcHeaderFilePath","getLanguage","filePath","extension","path","extname","getFileInfo","normalize","contents","readFileSync","language","getAppDelegate","getSourceRoot","appDelegate","dirname","findSchemePaths","findSchemeNames","schemePaths","map","schemePath","parse","name","getAllXcodeProjectPaths","iosFolder","pbxprojPaths","filter","project","test","sort","a","b","isAInIos","isBInIos","value","join","getXcodeProjectPath","getAllPBXProjectPaths","projectPaths","paths","existsSync","getPBXProjectPath","getAllInfoPlistPaths","getInfoPlistPath","getAllEntitlementsPaths","getEntitlementsPath","Entitlements","getSupportingPath","resolve","basename","getExpoPlistPath","supportingPath","usingPath","relative","extraPaths","v","addWarningIOS","JSON","stringify"],"sources":["../../src/ios/Paths.ts"],"sourcesContent":["import { existsSync, readFileSync } from 'fs';\nimport { sync as globSync } from 'glob';\nimport * as path from 'path';\n\nimport { UnexpectedError } from '../utils/errors';\nimport { addWarningIOS } from '../utils/warnings';\nimport * as Entitlements from './Entitlements';\n\nconst ignoredPaths = ['**/@(Carthage|Pods|vendor|node_modules)/**'];\n\ninterface ProjectFile<L extends string = string> {\n path: string;\n language: L;\n contents: string;\n}\n\ntype AppleLanguage = 'objc' | 'objcpp' | 'swift';\n\nexport type AppDelegateProjectFile = ProjectFile<AppleLanguage>;\n\nexport function getAppDelegateHeaderFilePath(projectRoot: string): string {\n const [using, ...extra] = globSync('ios/*/AppDelegate.h', {\n absolute: true,\n cwd: projectRoot,\n ignore: ignoredPaths,\n });\n\n if (!using) {\n throw new UnexpectedError(\n `Could not locate a valid AppDelegate header at root: \"${projectRoot}\"`\n );\n }\n\n if (extra.length) {\n warnMultipleFiles({\n tag: 'app-delegate-header',\n fileName: 'AppDelegate',\n projectRoot,\n using,\n extra,\n });\n }\n\n return using;\n}\n\nexport function getAppDelegateFilePath(projectRoot: string): string {\n const [using, ...extra] = globSync('ios/*/AppDelegate.@(m|mm|swift)', {\n absolute: true,\n cwd: projectRoot,\n ignore: ignoredPaths,\n });\n\n if (!using) {\n throw new UnexpectedError(`Could not locate a valid AppDelegate at root: \"${projectRoot}\"`);\n }\n\n if (extra.length) {\n warnMultipleFiles({\n tag: 'app-delegate',\n fileName: 'AppDelegate',\n projectRoot,\n using,\n extra,\n });\n }\n\n return using;\n}\n\nexport function getAppDelegateObjcHeaderFilePath(projectRoot: string): string {\n const [using, ...extra] = globSync('ios/*/AppDelegate.h', {\n absolute: true,\n cwd: projectRoot,\n ignore: ignoredPaths,\n });\n\n if (!using) {\n throw new UnexpectedError(`Could not locate a valid AppDelegate.h at root: \"${projectRoot}\"`);\n }\n\n if (extra.length) {\n warnMultipleFiles({\n tag: 'app-delegate-objc-header',\n fileName: 'AppDelegate.h',\n projectRoot,\n using,\n extra,\n });\n }\n\n return using;\n}\n\nfunction getLanguage(filePath: string): AppleLanguage {\n const extension = path.extname(filePath);\n switch (extension) {\n case '.mm':\n return 'objcpp';\n case '.m':\n case '.h':\n return 'objc';\n case '.swift':\n return 'swift';\n default:\n throw new UnexpectedError(`Unexpected iOS file extension: ${extension}`);\n }\n}\n\nexport function getFileInfo(filePath: string) {\n return {\n path: path.normalize(filePath),\n contents: readFileSync(filePath, 'utf8'),\n language: getLanguage(filePath),\n };\n}\n\nexport function getAppDelegate(projectRoot: string): AppDelegateProjectFile {\n const filePath = getAppDelegateFilePath(projectRoot);\n return getFileInfo(filePath);\n}\n\nexport function getSourceRoot(projectRoot: string): string {\n const appDelegate = getAppDelegate(projectRoot);\n return path.dirname(appDelegate.path);\n}\n\nexport function findSchemePaths(projectRoot: string): string[] {\n return globSync('ios/*.xcodeproj/xcshareddata/xcschemes/*.xcscheme', {\n absolute: true,\n cwd: projectRoot,\n ignore: ignoredPaths,\n });\n}\n\nexport function findSchemeNames(projectRoot: string): string[] {\n const schemePaths = findSchemePaths(projectRoot);\n return schemePaths.map((schemePath) => path.parse(schemePath).name);\n}\n\nexport function getAllXcodeProjectPaths(projectRoot: string): string[] {\n const iosFolder = 'ios';\n const pbxprojPaths = globSync('ios/**/*.xcodeproj', { cwd: projectRoot, ignore: ignoredPaths })\n .filter(\n (project) => !/test|example|sample/i.test(project) || path.dirname(project) === iosFolder\n )\n // sort alphabetically to ensure this works the same across different devices (Fail in CI (linux) without this)\n .sort()\n .sort((a, b) => {\n const isAInIos = path.dirname(a) === iosFolder;\n const isBInIos = path.dirname(b) === iosFolder;\n // preserve previous sort order\n if ((isAInIos && isBInIos) || (!isAInIos && !isBInIos)) {\n return 0;\n }\n return isAInIos ? -1 : 1;\n });\n\n if (!pbxprojPaths.length) {\n throw new UnexpectedError(\n `Failed to locate the ios/*.xcodeproj files relative to path \"${projectRoot}\".`\n );\n }\n return pbxprojPaths.map((value) => path.join(projectRoot, value));\n}\n\n/**\n * Get the pbxproj for the given path\n */\nexport function getXcodeProjectPath(projectRoot: string): string {\n const [using, ...extra] = getAllXcodeProjectPaths(projectRoot);\n\n if (extra.length) {\n warnMultipleFiles({\n tag: 'xcodeproj',\n fileName: '*.xcodeproj',\n projectRoot,\n using,\n extra,\n });\n }\n\n return using;\n}\n\nexport function getAllPBXProjectPaths(projectRoot: string): string[] {\n const projectPaths = getAllXcodeProjectPaths(projectRoot);\n const paths = projectPaths\n .map((value) => path.join(value, 'project.pbxproj'))\n .filter((value) => existsSync(value));\n\n if (!paths.length) {\n throw new UnexpectedError(\n `Failed to locate the ios/*.xcodeproj/project.pbxproj files relative to path \"${projectRoot}\".`\n );\n }\n return paths;\n}\n\nexport function getPBXProjectPath(projectRoot: string): string {\n const [using, ...extra] = getAllPBXProjectPaths(projectRoot);\n\n if (extra.length) {\n warnMultipleFiles({\n tag: 'project-pbxproj',\n fileName: 'project.pbxproj',\n projectRoot,\n using,\n extra,\n });\n }\n\n return using;\n}\n\nexport function getAllInfoPlistPaths(projectRoot: string): string[] {\n const paths = globSync('ios/*/Info.plist', {\n absolute: true,\n cwd: projectRoot,\n ignore: ignoredPaths,\n }).sort(\n // longer name means more suffixes, we want the shortest possible one to be first.\n (a, b) => a.length - b.length\n );\n\n if (!paths.length) {\n throw new UnexpectedError(\n `Failed to locate Info.plist files relative to path \"${projectRoot}\".`\n );\n }\n return paths;\n}\n\nexport function getInfoPlistPath(projectRoot: string): string {\n const [using, ...extra] = getAllInfoPlistPaths(projectRoot);\n\n if (extra.length) {\n warnMultipleFiles({\n tag: 'info-plist',\n fileName: 'Info.plist',\n projectRoot,\n using,\n extra,\n });\n }\n\n return using;\n}\n\nexport function getAllEntitlementsPaths(projectRoot: string): string[] {\n const paths = globSync('ios/*/*.entitlements', {\n absolute: true,\n cwd: projectRoot,\n ignore: ignoredPaths,\n });\n return paths;\n}\n\n/**\n * @deprecated: use Entitlements.getEntitlementsPath instead\n */\nexport function getEntitlementsPath(projectRoot: string): string | null {\n return Entitlements.getEntitlementsPath(projectRoot);\n}\n\nexport function getSupportingPath(projectRoot: string): string {\n return path.resolve(projectRoot, 'ios', path.basename(getSourceRoot(projectRoot)), 'Supporting');\n}\n\nexport function getExpoPlistPath(projectRoot: string): string {\n const supportingPath = getSupportingPath(projectRoot);\n return path.join(supportingPath, 'Expo.plist');\n}\n\nfunction warnMultipleFiles({\n tag,\n fileName,\n projectRoot,\n using,\n extra,\n}: {\n tag: string;\n fileName: string;\n projectRoot?: string;\n using: string;\n extra: string[];\n}) {\n const usingPath = projectRoot ? path.relative(projectRoot, using) : using;\n const extraPaths = projectRoot ? extra.map((v) => path.relative(projectRoot, v)) : extra;\n addWarningIOS(\n `paths-${tag}`,\n `Found multiple ${fileName} file paths, using \"${usingPath}\". Ignored paths: ${JSON.stringify(\n extraPaths\n )}`\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAA+C;AAAA;AAE/C,MAAMA,YAAY,GAAG,CAAC,4CAA4C,CAAC;AAY5D,SAASC,4BAA4B,CAACC,WAAmB,EAAU;EACxE,MAAM,CAACC,KAAK,EAAE,GAAGC,KAAK,CAAC,GAAG,IAAAC,YAAQ,EAAC,qBAAqB,EAAE;IACxDC,QAAQ,EAAE,IAAI;IACdC,GAAG,EAAEL,WAAW;IAChBM,MAAM,EAAER;EACV,CAAC,CAAC;EAEF,IAAI,CAACG,KAAK,EAAE;IACV,MAAM,KAAIM,yBAAe,EACtB,yDAAwDP,WAAY,GAAE,CACxE;EACH;EAEA,IAAIE,KAAK,CAACM,MAAM,EAAE;IAChBC,iBAAiB,CAAC;MAChBC,GAAG,EAAE,qBAAqB;MAC1BC,QAAQ,EAAE,aAAa;MACvBX,WAAW;MACXC,KAAK;MACLC;IACF,CAAC,CAAC;EACJ;EAEA,OAAOD,KAAK;AACd;AAEO,SAASW,sBAAsB,CAACZ,WAAmB,EAAU;EAClE,MAAM,CAACC,KAAK,EAAE,GAAGC,KAAK,CAAC,GAAG,IAAAC,YAAQ,EAAC,iCAAiC,EAAE;IACpEC,QAAQ,EAAE,IAAI;IACdC,GAAG,EAAEL,WAAW;IAChBM,MAAM,EAAER;EACV,CAAC,CAAC;EAEF,IAA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ors","_warnings","Entitlements","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","ignoredPaths","getAppDelegateHeaderFilePath","projectRoot","using","extra","globSync","absolute","cwd","ignore","UnexpectedError","length","warnMultipleFiles","tag","fileName","getAppDelegateFilePath","getAppDelegateObjcHeaderFilePath","getLanguage","filePath","extension","extname","getFileInfo","normalize","contents","readFileSync","language","getAppDelegate","getSourceRoot","appDelegate","dirname","findSchemePaths","findSchemeNames","schemePaths","map","schemePath","parse","name","getAllXcodeProjectPaths","iosFolder","pbxprojPaths","filter","project","test","sort","a","b","isAInIos","isBInIos","value","join","getXcodeProjectPath","getAllPBXProjectPaths","projectPaths","paths","existsSync","getPBXProjectPath","getAllInfoPlistPaths","getInfoPlistPath","getAllEntitlementsPaths","getEntitlementsPath","getSupportingPath","resolve","basename","getExpoPlistPath","supportingPath","usingPath","relative","extraPaths","v","addWarningIOS","JSON","stringify"],"sources":["../../src/ios/Paths.ts"],"sourcesContent":["import { existsSync, readFileSync } from 'fs';\nimport { sync as globSync } from 'glob';\nimport * as path from 'path';\n\nimport { UnexpectedError } from '../utils/errors';\nimport { addWarningIOS } from '../utils/warnings';\nimport * as Entitlements from './Entitlements';\n\nconst ignoredPaths = ['**/@(Carthage|Pods|vendor|node_modules)/**'];\n\ninterface ProjectFile<L extends string = string> {\n path: string;\n language: L;\n contents: string;\n}\n\ntype AppleLanguage = 'objc' | 'objcpp' | 'swift';\n\nexport type AppDelegateProjectFile = ProjectFile<AppleLanguage>;\n\nexport function getAppDelegateHeaderFilePath(projectRoot: string): string {\n const [using, ...extra] = globSync('ios/*/AppDelegate.h', {\n absolute: true,\n cwd: projectRoot,\n ignore: ignoredPaths,\n });\n\n if (!using) {\n throw new UnexpectedError(\n `Could not locate a valid AppDelegate header at root: \"${projectRoot}\"`\n );\n }\n\n if (extra.length) {\n warnMultipleFiles({\n tag: 'app-delegate-header',\n fileName: 'AppDelegate',\n projectRoot,\n using,\n extra,\n });\n }\n\n return using;\n}\n\nexport function getAppDelegateFilePath(projectRoot: string): string {\n const [using, ...extra] = globSync('ios/*/AppDelegate.@(m|mm|swift)', {\n absolute: true,\n cwd: projectRoot,\n ignore: ignoredPaths,\n });\n\n if (!using) {\n throw new UnexpectedError(`Could not locate a valid AppDelegate at root: \"${projectRoot}\"`);\n }\n\n if (extra.length) {\n warnMultipleFiles({\n tag: 'app-delegate',\n fileName: 'AppDelegate',\n projectRoot,\n using,\n extra,\n });\n }\n\n return using;\n}\n\nexport function getAppDelegateObjcHeaderFilePath(projectRoot: string): string {\n const [using, ...extra] = globSync('ios/*/AppDelegate.h', {\n absolute: true,\n cwd: projectRoot,\n ignore: ignoredPaths,\n });\n\n if (!using) {\n throw new UnexpectedError(`Could not locate a valid AppDelegate.h at root: \"${projectRoot}\"`);\n }\n\n if (extra.length) {\n warnMultipleFiles({\n tag: 'app-delegate-objc-header',\n fileName: 'AppDelegate.h',\n projectRoot,\n using,\n extra,\n });\n }\n\n return using;\n}\n\nfunction getLanguage(filePath: string): AppleLanguage {\n const extension = path.extname(filePath);\n switch (extension) {\n case '.mm':\n return 'objcpp';\n case '.m':\n case '.h':\n return 'objc';\n case '.swift':\n return 'swift';\n default:\n throw new UnexpectedError(`Unexpected iOS file extension: ${extension}`);\n }\n}\n\nexport function getFileInfo(filePath: string) {\n return {\n path: path.normalize(filePath),\n contents: readFileSync(filePath, 'utf8'),\n language: getLanguage(filePath),\n };\n}\n\nexport function getAppDelegate(projectRoot: string): AppDelegateProjectFile {\n const filePath = getAppDelegateFilePath(projectRoot);\n return getFileInfo(filePath);\n}\n\nexport function getSourceRoot(projectRoot: string): string {\n const appDelegate = getAppDelegate(projectRoot);\n return path.dirname(appDelegate.path);\n}\n\nexport function findSchemePaths(projectRoot: string): string[] {\n return globSync('ios/*.xcodeproj/xcshareddata/xcschemes/*.xcscheme', {\n absolute: true,\n cwd: projectRoot,\n ignore: ignoredPaths,\n });\n}\n\nexport function findSchemeNames(projectRoot: string): string[] {\n const schemePaths = findSchemePaths(projectRoot);\n return schemePaths.map((schemePath) => path.parse(schemePath).name);\n}\n\nexport function getAllXcodeProjectPaths(projectRoot: string): string[] {\n const iosFolder = 'ios';\n const pbxprojPaths = globSync('ios/**/*.xcodeproj', { cwd: projectRoot, ignore: ignoredPaths })\n .filter(\n (project) => !/test|example|sample/i.test(project) || path.dirname(project) === iosFolder\n )\n // sort alphabetically to ensure this works the same across different devices (Fail in CI (linux) without this)\n .sort()\n .sort((a, b) => {\n const isAInIos = path.dirname(a) === iosFolder;\n const isBInIos = path.dirname(b) === iosFolder;\n // preserve previous sort order\n if ((isAInIos && isBInIos) || (!isAInIos && !isBInIos)) {\n return 0;\n }\n return isAInIos ? -1 : 1;\n });\n\n if (!pbxprojPaths.length) {\n throw new UnexpectedError(\n `Failed to locate the ios/*.xcodeproj files relative to path \"${projectRoot}\".`\n );\n }\n return pbxprojPaths.map((value) => path.join(projectRoot, value));\n}\n\n/**\n * Get the pbxproj for the given path\n */\nexport function getXcodeProjectPath(projectRoot: string): string {\n const [using, ...extra] = getAllXcodeProjectPaths(projectRoot);\n\n if (extra.length) {\n warnMultipleFiles({\n tag: 'xcodeproj',\n fileName: '*.xcodeproj',\n projectRoot,\n using,\n extra,\n });\n }\n\n return using;\n}\n\nexport function getAllPBXProjectPaths(projectRoot: string): string[] {\n const projectPaths = getAllXcodeProjectPaths(projectRoot);\n const paths = projectPaths\n .map((value) => path.join(value, 'project.pbxproj'))\n .filter((value) => existsSync(value));\n\n if (!paths.length) {\n throw new UnexpectedError(\n `Failed to locate the ios/*.xcodeproj/project.pbxproj files relative to path \"${projectRoot}\".`\n );\n }\n return paths;\n}\n\nexport function getPBXProjectPath(projectRoot: string): string {\n const [using, ...extra] = getAllPBXProjectPaths(projectRoot);\n\n if (extra.length) {\n warnMultipleFiles({\n tag: 'project-pbxproj',\n fileName: 'project.pbxproj',\n projectRoot,\n using,\n extra,\n });\n }\n\n return using;\n}\n\nexport function getAllInfoPlistPaths(projectRoot: string): string[] {\n const paths = globSync('ios/*/Info.plist', {\n absolute: true,\n cwd: projectRoot,\n ignore: ignoredPaths,\n }).sort(\n // longer name means more suffixes, we want the shortest possible one to be first.\n (a, b) => a.length - b.length\n );\n\n if (!paths.length) {\n throw new UnexpectedError(\n `Failed to locate Info.plist files relative to path \"${projectRoot}\".`\n );\n }\n return paths;\n}\n\nexport function getInfoPlistPath(projectRoot: string): string {\n const [using, ...extra] = getAllInfoPlistPaths(projectRoot);\n\n if (extra.length) {\n warnMultipleFiles({\n tag: 'info-plist',\n fileName: 'Info.plist',\n projectRoot,\n using,\n extra,\n });\n }\n\n return using;\n}\n\nexport function getAllEntitlementsPaths(projectRoot: string): string[] {\n const paths = globSync('ios/*/*.entitlements', {\n absolute: true,\n cwd: projectRoot,\n ignore: ignoredPaths,\n });\n return paths;\n}\n\n/**\n * @deprecated: use Entitlements.getEntitlementsPath instead\n */\nexport function getEntitlementsPath(projectRoot: string): string | null {\n return Entitlements.getEntitlementsPath(projectRoot);\n}\n\nexport function getSupportingPath(projectRoot: string): string {\n return path.resolve(projectRoot, 'ios', path.basename(getSourceRoot(projectRoot)), 'Supporting');\n}\n\nexport function getExpoPlistPath(projectRoot: string): string {\n const supportingPath = getSupportingPath(projectRoot);\n return path.join(supportingPath, 'Expo.plist');\n}\n\nfunction warnMultipleFiles({\n tag,\n fileName,\n projectRoot,\n using,\n extra,\n}: {\n tag: string;\n fileName: string;\n projectRoot?: string;\n using: string;\n extra: string[];\n}) {\n const usingPath = projectRoot ? path.relative(projectRoot, using) : using;\n const extraPaths = projectRoot ? extra.map((v) => path.relative(projectRoot, v)) : extra;\n addWarningIOS(\n `paths-${tag}`,\n `Found multiple ${fileName} file paths, using \"${usingPath}\". Ignored paths: ${JSON.stringify(\n extraPaths\n )}`\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;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,CAAC,CAAC,CAAC,GAAG/D,KAAK;EACxF,IAAAgE,yBAAa,EACV,SAAQxD,GAAI,EAAC,EACb,kBAAiBC,QAAS,uBAAsBmD,SAAU,qBAAoBK,IAAI,CAACC,SAAS,CAC3FJ,UAAU,CACV,EAAC,CACJ;AACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Permissions.js","names":["debug","Debug","applyPermissions","defaults","permissions","infoPlist","entries","Object","length","JSON","stringify","permission","description","createPermissionsPlugin","name","withIosPermissions","config","withInfoPlist","modResults","defineProperty","value"],"sources":["../../src/ios/Permissions.ts"],"sourcesContent":["import Debug from 'debug';\n\nimport { ConfigPlugin } from '../Plugin.types';\nimport { withInfoPlist } from '../plugins/ios-plugins';\nimport { InfoPlist } from './IosConfig.types';\n\nconst debug = Debug('expo:config-plugins:ios:permissions');\n\nexport function applyPermissions<Defaults extends Record<string, string> = Record<string, string>>(\n defaults: Defaults,\n permissions: Partial<Record<keyof Defaults, string | false>>,\n infoPlist: InfoPlist\n): InfoPlist {\n const entries = Object.entries(defaults);\n if (entries.length === 0) {\n debug(`No defaults provided: ${JSON.stringify(permissions)}`);\n }\n for (const [permission, description] of entries) {\n if (permissions[permission] === false) {\n debug(`Deleting \"${permission}\"`);\n delete infoPlist[permission];\n } else {\n infoPlist[permission] = permissions[permission] || infoPlist[permission] || description;\n debug(`Setting \"${permission}\" to \"${infoPlist[permission]}\"`);\n }\n }\n return infoPlist;\n}\n\n/**\n * Helper method for creating mods to apply default permissions.\n *\n * @param action\n */\nexport function createPermissionsPlugin<\n Defaults extends Record<string, string> = Record<string, string>\n>(defaults: Defaults, name?: string) {\n const withIosPermissions: ConfigPlugin<Record<keyof Defaults, string | undefined | false>> = (\n config,\n permissions\n ) =>\n withInfoPlist(config, async (config) => {\n config.modResults = applyPermissions(defaults, permissions, config.modResults);\n return config;\n });\n if (name) {\n Object.defineProperty(withIosPermissions, 'name', {\n value: name,\n });\n }\n return withIosPermissions;\n}\n"],"mappings":";;;;;;;AAAA;EAAA;
|
|
1
|
+
{"version":3,"file":"Permissions.js","names":["_debug","data","_interopRequireDefault","require","_iosPlugins","obj","__esModule","default","debug","Debug","applyPermissions","defaults","permissions","infoPlist","entries","Object","length","JSON","stringify","permission","description","createPermissionsPlugin","name","withIosPermissions","config","withInfoPlist","modResults","defineProperty","value"],"sources":["../../src/ios/Permissions.ts"],"sourcesContent":["import Debug from 'debug';\n\nimport { ConfigPlugin } from '../Plugin.types';\nimport { withInfoPlist } from '../plugins/ios-plugins';\nimport { InfoPlist } from './IosConfig.types';\n\nconst debug = Debug('expo:config-plugins:ios:permissions');\n\nexport function applyPermissions<Defaults extends Record<string, string> = Record<string, string>>(\n defaults: Defaults,\n permissions: Partial<Record<keyof Defaults, string | false>>,\n infoPlist: InfoPlist\n): InfoPlist {\n const entries = Object.entries(defaults);\n if (entries.length === 0) {\n debug(`No defaults provided: ${JSON.stringify(permissions)}`);\n }\n for (const [permission, description] of entries) {\n if (permissions[permission] === false) {\n debug(`Deleting \"${permission}\"`);\n delete infoPlist[permission];\n } else {\n infoPlist[permission] = permissions[permission] || infoPlist[permission] || description;\n debug(`Setting \"${permission}\" to \"${infoPlist[permission]}\"`);\n }\n }\n return infoPlist;\n}\n\n/**\n * Helper method for creating mods to apply default permissions.\n *\n * @param action\n */\nexport function createPermissionsPlugin<\n Defaults extends Record<string, string> = Record<string, string>\n>(defaults: Defaults, name?: string) {\n const withIosPermissions: ConfigPlugin<Record<keyof Defaults, string | undefined | false>> = (\n config,\n permissions\n ) =>\n withInfoPlist(config, async (config) => {\n config.modResults = applyPermissions(defaults, permissions, config.modResults);\n return config;\n });\n if (name) {\n Object.defineProperty(withIosPermissions, 'name', {\n value: name,\n });\n }\n return withIosPermissions;\n}\n"],"mappings":";;;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,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AAM,CAACE,UAAU,GAAGhB,gBAAgB,CAACC,QAAQ,EAAEC,WAAW,EAAEY,MAAM,CAACE,UAAU,CAAC;IAC9E,OAAOF,MAAM;EACf,CAAC,CAAC;EACJ,IAAIF,IAAI,EAAE;IACRP,MAAM,CAACY,cAAc,CAACJ,kBAAkB,EAAE,MAAM,EAAE;MAChDK,KAAK,EAAEN;IACT,CAAC,CAAC;EACJ;EACA,OAAOC,kBAAkB;AAC3B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProvisioningProfile.js","names":["setProvisioningProfileForPbxproj","projectRoot","targetName","profileName","appleTeamId","buildConfiguration","project","getPbxproj","nativeTargetEntry","findNativeTargetByName","findFirstNativeTarget","nativeTargetId","nativeTarget","quotedAppleTeamId","ensureQuotes","getBuildConfigurationsForListId","buildConfigurationList","filter","item","trimQuotes","name","forEach","buildSettings","PROVISIONING_PROFILE_SPECIFIER","DEVELOPMENT_TEAM","CODE_SIGN_IDENTITY","CODE_SIGN_STYLE","Object","entries","getProjectSection","isNotComment","attributes","TargetAttributes","DevelopmentTeam","ProvisioningStyle","fs","writeFileSync","filepath","writeSync","value","match"],"sources":["../../src/ios/ProvisioningProfile.ts"],"sourcesContent":["import fs from 'fs';\n\nimport { findFirstNativeTarget, findNativeTargetByName } from './Target';\nimport {\n ConfigurationSectionEntry,\n getBuildConfigurationsForListId,\n getPbxproj,\n getProjectSection,\n isNotComment,\n ProjectSectionEntry,\n} from './utils/Xcodeproj';\nimport { trimQuotes } from './utils/string';\n\ntype ProvisioningProfileSettings = {\n targetName?: string;\n appleTeamId: string;\n profileName: string;\n buildConfiguration?: string;\n};\n\nexport function setProvisioningProfileForPbxproj(\n projectRoot: string,\n {\n targetName,\n profileName,\n appleTeamId,\n buildConfiguration = 'Release',\n }: ProvisioningProfileSettings\n): void {\n const project = getPbxproj(projectRoot);\n\n const nativeTargetEntry = targetName\n ? findNativeTargetByName(project, targetName)\n : findFirstNativeTarget(project);\n const [nativeTargetId, nativeTarget] = nativeTargetEntry;\n\n const quotedAppleTeamId = ensureQuotes(appleTeamId);\n\n getBuildConfigurationsForListId(project, nativeTarget.buildConfigurationList)\n .filter(([, item]: ConfigurationSectionEntry) => trimQuotes(item.name) === buildConfiguration)\n .forEach(([, item]: ConfigurationSectionEntry) => {\n item.buildSettings.PROVISIONING_PROFILE_SPECIFIER = `\"${profileName}\"`;\n item.buildSettings.DEVELOPMENT_TEAM = quotedAppleTeamId;\n item.buildSettings.CODE_SIGN_IDENTITY = '\"iPhone Distribution\"';\n item.buildSettings.CODE_SIGN_STYLE = 'Manual';\n });\n\n Object.entries(getProjectSection(project))\n .filter(isNotComment)\n .forEach(([, item]: ProjectSectionEntry) => {\n if (!item.attributes.TargetAttributes[nativeTargetId]) {\n item.attributes.TargetAttributes[nativeTargetId] = {};\n }\n item.attributes.TargetAttributes[nativeTargetId].DevelopmentTeam = quotedAppleTeamId;\n item.attributes.TargetAttributes[nativeTargetId].ProvisioningStyle = 'Manual';\n });\n\n fs.writeFileSync(project.filepath, project.writeSync());\n}\n\nconst ensureQuotes = (value: string) => {\n if (!value.match(/^['\"]/)) {\n return `\"${value}\"`;\n }\n return value;\n};\n"],"mappings":";;;;;;AAAA;EAAA;
|
|
1
|
+
{"version":3,"file":"ProvisioningProfile.js","names":["_fs","data","_interopRequireDefault","require","_Target","_Xcodeproj","_string","obj","__esModule","default","setProvisioningProfileForPbxproj","projectRoot","targetName","profileName","appleTeamId","buildConfiguration","project","getPbxproj","nativeTargetEntry","findNativeTargetByName","findFirstNativeTarget","nativeTargetId","nativeTarget","quotedAppleTeamId","ensureQuotes","getBuildConfigurationsForListId","buildConfigurationList","filter","item","trimQuotes","name","forEach","buildSettings","PROVISIONING_PROFILE_SPECIFIER","DEVELOPMENT_TEAM","CODE_SIGN_IDENTITY","CODE_SIGN_STYLE","Object","entries","getProjectSection","isNotComment","attributes","TargetAttributes","DevelopmentTeam","ProvisioningStyle","fs","writeFileSync","filepath","writeSync","value","match"],"sources":["../../src/ios/ProvisioningProfile.ts"],"sourcesContent":["import fs from 'fs';\n\nimport { findFirstNativeTarget, findNativeTargetByName } from './Target';\nimport {\n ConfigurationSectionEntry,\n getBuildConfigurationsForListId,\n getPbxproj,\n getProjectSection,\n isNotComment,\n ProjectSectionEntry,\n} from './utils/Xcodeproj';\nimport { trimQuotes } from './utils/string';\n\ntype ProvisioningProfileSettings = {\n targetName?: string;\n appleTeamId: string;\n profileName: string;\n buildConfiguration?: string;\n};\n\nexport function setProvisioningProfileForPbxproj(\n projectRoot: string,\n {\n targetName,\n profileName,\n appleTeamId,\n buildConfiguration = 'Release',\n }: ProvisioningProfileSettings\n): void {\n const project = getPbxproj(projectRoot);\n\n const nativeTargetEntry = targetName\n ? findNativeTargetByName(project, targetName)\n : findFirstNativeTarget(project);\n const [nativeTargetId, nativeTarget] = nativeTargetEntry;\n\n const quotedAppleTeamId = ensureQuotes(appleTeamId);\n\n getBuildConfigurationsForListId(project, nativeTarget.buildConfigurationList)\n .filter(([, item]: ConfigurationSectionEntry) => trimQuotes(item.name) === buildConfiguration)\n .forEach(([, item]: ConfigurationSectionEntry) => {\n item.buildSettings.PROVISIONING_PROFILE_SPECIFIER = `\"${profileName}\"`;\n item.buildSettings.DEVELOPMENT_TEAM = quotedAppleTeamId;\n item.buildSettings.CODE_SIGN_IDENTITY = '\"iPhone Distribution\"';\n item.buildSettings.CODE_SIGN_STYLE = 'Manual';\n });\n\n Object.entries(getProjectSection(project))\n .filter(isNotComment)\n .forEach(([, item]: ProjectSectionEntry) => {\n if (!item.attributes.TargetAttributes[nativeTargetId]) {\n item.attributes.TargetAttributes[nativeTargetId] = {};\n }\n item.attributes.TargetAttributes[nativeTargetId].DevelopmentTeam = quotedAppleTeamId;\n item.attributes.TargetAttributes[nativeTargetId].ProvisioningStyle = 'Manual';\n });\n\n fs.writeFileSync(project.filepath, project.writeSync());\n}\n\nconst ensureQuotes = (value: string) => {\n if (!value.match(/^['\"]/)) {\n return `\"${value}\"`;\n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AI,CAACE,IAAI,CAAC,KAAKf,kBAAkB,CAAC,CAC7FgB,OAAO,CAAC,CAAC,GAAGH,IAAI,CAA4B,KAAK;IAChDA,IAAI,CAACI,aAAa,CAACC,8BAA8B,GAAI,IAAGpB,WAAY,GAAE;IACtEe,IAAI,CAACI,aAAa,CAACE,gBAAgB,GAAGX,iBAAiB;IACvDK,IAAI,CAACI,aAAa,CAACG,kBAAkB,GAAG,uBAAuB;IAC/DP,IAAI,CAACI,aAAa,CAACI,eAAe,GAAG,QAAQ;EAC/C,CAAC,CAAC;EAEJC,MAAM,CAACC,OAAO,CAAC,IAAAC,8BAAiB,EAACvB,OAAO,CAAC,CAAC,CACvCW,MAAM,CAACa,yBAAY,CAAC,CACpBT,OAAO,CAAC,CAAC,GAAGH,IAAI,CAAsB,KAAK;IAC1C,IAAI,CAACA,IAAI,CAACa,UAAU,CAACC,gBAAgB,CAACrB,cAAc,CAAC,EAAE;MACrDO,IAAI,CAACa,UAAU,CAACC,gBAAgB,CAACrB,cAAc,CAAC,GAAG,CAAC,CAAC;IACvD;IACAO,IAAI,CAACa,UAAU,CAACC,gBAAgB,CAACrB,cAAc,CAAC,CAACsB,eAAe,GAAGpB,iBAAiB;IACpFK,IAAI,CAACa,UAAU,CAACC,gBAAgB,CAACrB,cAAc,CAAC,CAACuB,iBAAiB,GAAG,QAAQ;EAC/E,CAAC,CAAC;EAEJC,aAAE,CAACC,aAAa,CAAC9B,OAAO,CAAC+B,QAAQ,EAAE/B,OAAO,CAACgC,SAAS,EAAE,CAAC;AACzD;AAEA,MAAMxB,YAAY,GAAIyB,KAAa,IAAK;EACtC,IAAI,CAACA,KAAK,CAACC,KAAK,CAAC,OAAO,CAAC,EAAE;IACzB,OAAQ,IAAGD,KAAM,GAAE;EACrB;EACA,OAAOA,KAAK;AACd,CAAC"}
|
|
@@ -88,7 +88,7 @@ function setRequiresFullScreen(config, infoPlist) {
|
|
|
88
88
|
if (!requiresFullScreen) {
|
|
89
89
|
const existing = resolveExistingIpadInterfaceOrientations(infoPlist[iPadInterfaceKey]);
|
|
90
90
|
|
|
91
|
-
// There currently exists no mechanism to safely undo this feature besides `expo prebuild --clear`,
|
|
91
|
+
// There currently exists no mechanism to safely undo this feature besides `npx expo prebuild --clear`,
|
|
92
92
|
// this seems ok though because anyone using `UISupportedInterfaceOrientations~ipad` probably
|
|
93
93
|
// wants them to be defined to this value anyways. This is also the default value used in the Xcode iOS template.
|
|
94
94
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequiresFullScreen.js","names":["withRequiresFullScreen","createInfoPlistPlugin","setRequiresFullScreen","getRequiresFullScreen","config","ios","hasOwnProperty","requireFullScreen","gteSdkVersion","iPadInterfaceKey","requiredIPadInterface","isStringArray","value","Array","isArray","every","hasMinimumOrientations","masks","mask","includes","resolveExistingIpadInterfaceOrientations","interfaceOrientations","length","existingList","join","addWarningIOS","infoPlist","requiresFullScreen","existing","Set","concat","UIRequiresFullScreen"],"sources":["../../src/ios/RequiresFullScreen.ts"],"sourcesContent":["import { ExpoConfig } from '@expo/config-types';\n\nimport { createInfoPlistPlugin } from '../plugins/ios-plugins';\nimport { gteSdkVersion } from '../utils/versions';\nimport { addWarningIOS } from '../utils/warnings';\nimport { InfoPlist } from './IosConfig.types';\n\nexport const withRequiresFullScreen = createInfoPlistPlugin(\n setRequiresFullScreen,\n 'withRequiresFullScreen'\n);\n\n// NOTES: This is defaulted to `true` for now to match the behavior prior to SDK\n// 34, but will change to `false` in SDK +43.\nexport function getRequiresFullScreen(config: Pick<ExpoConfig, 'ios' | 'sdkVersion'>) {\n // Yes, the property is called ios.requireFullScreen, without the s - not \"requires\"\n // This is confusing indeed because the actual property name does have the s\n if (config.ios?.hasOwnProperty('requireFullScreen')) {\n return !!config.ios.requireFullScreen;\n } else {\n // In SDK 43, the `requireFullScreen` default has been changed to false.\n if (\n gteSdkVersion(config, '43.0.0')\n // TODO: Uncomment after SDK 43 is released.\n // || !config.sdkVersion\n ) {\n return false;\n }\n return true;\n }\n}\n\nconst iPadInterfaceKey = 'UISupportedInterfaceOrientations~ipad';\n\nconst requiredIPadInterface = [\n 'UIInterfaceOrientationPortrait',\n 'UIInterfaceOrientationPortraitUpsideDown',\n 'UIInterfaceOrientationLandscapeLeft',\n 'UIInterfaceOrientationLandscapeRight',\n];\n\nfunction isStringArray(value: any): value is string[] {\n return Array.isArray(value) && value.every((value) => typeof value === 'string');\n}\n\nfunction hasMinimumOrientations(masks: string[]): boolean {\n return requiredIPadInterface.every((mask) => masks.includes(mask));\n}\n\n/**\n * Require full screen being disabled requires all ipad interfaces to to be added,\n * otherwise submissions to the iOS App Store will fail.\n *\n * ERROR ITMS-90474: \"Invalid Bundle. iPad Multitasking support requires these orientations: 'UIInterfaceOrientationPortrait,UIInterfaceOrientationPortraitUpsideDown,UIInterfaceOrientationLandscapeLeft,UIInterfaceOrientationLandscapeRight'. Found 'UIInterfaceOrientationPortrait,UIInterfaceOrientationPortraitUpsideDown' in bundle 'com.bacon.app'.\"\n *\n * @param interfaceOrientations\n * @returns\n */\nfunction resolveExistingIpadInterfaceOrientations(interfaceOrientations: any): string[] {\n if (\n // Ensure type.\n isStringArray(interfaceOrientations) &&\n // Don't warn if it's an empty array, this is invalid regardless.\n interfaceOrientations.length &&\n // Check if the minimum requirements are met.\n !hasMinimumOrientations(interfaceOrientations)\n ) {\n const existingList = interfaceOrientations!.join(', ');\n addWarningIOS(\n 'ios.requireFullScreen',\n `iPad multitasking requires all \\`${iPadInterfaceKey}\\` orientations to be defined in the Info.plist. The Info.plist currently defines values that are incompatible with multitasking, these will be overwritten to prevent submission failure. Existing: ${existingList}`\n );\n return interfaceOrientations;\n }\n return [];\n}\n\n// Whether requires full screen on iPad\nexport function setRequiresFullScreen(\n config: Pick<ExpoConfig, 'ios'>,\n infoPlist: InfoPlist\n): InfoPlist {\n const requiresFullScreen = getRequiresFullScreen(config);\n if (!requiresFullScreen) {\n const existing = resolveExistingIpadInterfaceOrientations(infoPlist[iPadInterfaceKey]);\n\n // There currently exists no mechanism to safely undo this feature besides `expo prebuild --clear`,\n // this seems ok though because anyone using `UISupportedInterfaceOrientations~ipad` probably\n // wants them to be defined to this value anyways. This is also the default value used in the Xcode iOS template.\n\n // Merge any previous interfaces with the required interfaces.\n infoPlist[iPadInterfaceKey] = [...new Set(existing.concat(requiredIPadInterface))];\n }\n\n return {\n ...infoPlist,\n UIRequiresFullScreen: requiresFullScreen,\n };\n}\n"],"mappings":";;;;;;;;AAEA;EAAA;
|
|
1
|
+
{"version":3,"file":"RequiresFullScreen.js","names":["_iosPlugins","data","require","_versions","_warnings","withRequiresFullScreen","createInfoPlistPlugin","setRequiresFullScreen","exports","getRequiresFullScreen","config","_config$ios","ios","hasOwnProperty","requireFullScreen","gteSdkVersion","iPadInterfaceKey","requiredIPadInterface","isStringArray","value","Array","isArray","every","hasMinimumOrientations","masks","mask","includes","resolveExistingIpadInterfaceOrientations","interfaceOrientations","length","existingList","join","addWarningIOS","infoPlist","requiresFullScreen","existing","Set","concat","UIRequiresFullScreen"],"sources":["../../src/ios/RequiresFullScreen.ts"],"sourcesContent":["import { ExpoConfig } from '@expo/config-types';\n\nimport { createInfoPlistPlugin } from '../plugins/ios-plugins';\nimport { gteSdkVersion } from '../utils/versions';\nimport { addWarningIOS } from '../utils/warnings';\nimport { InfoPlist } from './IosConfig.types';\n\nexport const withRequiresFullScreen = createInfoPlistPlugin(\n setRequiresFullScreen,\n 'withRequiresFullScreen'\n);\n\n// NOTES: This is defaulted to `true` for now to match the behavior prior to SDK\n// 34, but will change to `false` in SDK +43.\nexport function getRequiresFullScreen(config: Pick<ExpoConfig, 'ios' | 'sdkVersion'>) {\n // Yes, the property is called ios.requireFullScreen, without the s - not \"requires\"\n // This is confusing indeed because the actual property name does have the s\n if (config.ios?.hasOwnProperty('requireFullScreen')) {\n return !!config.ios.requireFullScreen;\n } else {\n // In SDK 43, the `requireFullScreen` default has been changed to false.\n if (\n gteSdkVersion(config, '43.0.0')\n // TODO: Uncomment after SDK 43 is released.\n // || !config.sdkVersion\n ) {\n return false;\n }\n return true;\n }\n}\n\nconst iPadInterfaceKey = 'UISupportedInterfaceOrientations~ipad';\n\nconst requiredIPadInterface = [\n 'UIInterfaceOrientationPortrait',\n 'UIInterfaceOrientationPortraitUpsideDown',\n 'UIInterfaceOrientationLandscapeLeft',\n 'UIInterfaceOrientationLandscapeRight',\n];\n\nfunction isStringArray(value: any): value is string[] {\n return Array.isArray(value) && value.every((value) => typeof value === 'string');\n}\n\nfunction hasMinimumOrientations(masks: string[]): boolean {\n return requiredIPadInterface.every((mask) => masks.includes(mask));\n}\n\n/**\n * Require full screen being disabled requires all ipad interfaces to to be added,\n * otherwise submissions to the iOS App Store will fail.\n *\n * ERROR ITMS-90474: \"Invalid Bundle. iPad Multitasking support requires these orientations: 'UIInterfaceOrientationPortrait,UIInterfaceOrientationPortraitUpsideDown,UIInterfaceOrientationLandscapeLeft,UIInterfaceOrientationLandscapeRight'. Found 'UIInterfaceOrientationPortrait,UIInterfaceOrientationPortraitUpsideDown' in bundle 'com.bacon.app'.\"\n *\n * @param interfaceOrientations\n * @returns\n */\nfunction resolveExistingIpadInterfaceOrientations(interfaceOrientations: any): string[] {\n if (\n // Ensure type.\n isStringArray(interfaceOrientations) &&\n // Don't warn if it's an empty array, this is invalid regardless.\n interfaceOrientations.length &&\n // Check if the minimum requirements are met.\n !hasMinimumOrientations(interfaceOrientations)\n ) {\n const existingList = interfaceOrientations!.join(', ');\n addWarningIOS(\n 'ios.requireFullScreen',\n `iPad multitasking requires all \\`${iPadInterfaceKey}\\` orientations to be defined in the Info.plist. The Info.plist currently defines values that are incompatible with multitasking, these will be overwritten to prevent submission failure. Existing: ${existingList}`\n );\n return interfaceOrientations;\n }\n return [];\n}\n\n// Whether requires full screen on iPad\nexport function setRequiresFullScreen(\n config: Pick<ExpoConfig, 'ios'>,\n infoPlist: InfoPlist\n): InfoPlist {\n const requiresFullScreen = getRequiresFullScreen(config);\n if (!requiresFullScreen) {\n const existing = resolveExistingIpadInterfaceOrientations(infoPlist[iPadInterfaceKey]);\n\n // There currently exists no mechanism to safely undo this feature besides `npx expo prebuild --clear`,\n // this seems ok though because anyone using `UISupportedInterfaceOrientations~ipad` probably\n // wants them to be defined to this value anyways. This is also the default value used in the Xcode iOS template.\n\n // Merge any previous interfaces with the required interfaces.\n infoPlist[iPadInterfaceKey] = [...new Set(existing.concat(requiredIPadInterface))];\n }\n\n return {\n ...infoPlist,\n UIRequiresFullScreen: requiresFullScreen,\n };\n}\n"],"mappings":";;;;;;;;AAEA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,UAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,SAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,UAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,SAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGO,MAAMI,sBAAsB,GAAG,IAAAC,mCAAqB,EACzDC,qBAAqB,EACrB,wBAAwB,CACzB;;AAED;AACA;AAAAC,OAAA,CAAAH,sBAAA,GAAAA,sBAAA;AACO,SAASI,qBAAqBA,CAACC,MAA8C,EAAE;EAAA,IAAAC,WAAA;EACpF;EACA;EACA,KAAAA,WAAA,GAAID,MAAM,CAACE,GAAG,cAAAD,WAAA,eAAVA,WAAA,CAAYE,cAAc,CAAC,mBAAmB,CAAC,EAAE;IACnD,OAAO,CAAC,CAACH,MAAM,CAACE,GAAG,CAACE,iBAAiB;EACvC,CAAC,MAAM;IACL;IACA,IACE,IAAAC,yBAAa,EAACL,MAAM,EAAE,QAAQ;IAC9B;IACA;IAAA,EACA;MACA,OAAO,KAAK;IACd;IACA,OAAO,IAAI;EACb;AACF;AA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C,CAAC;EACpF;EAEA,OAAO;IACL,GAAGgB,SAAS;IACZK,oBAAoB,EAAEJ;EACxB,CAAC;AACH"}
|
package/build/ios/Scheme.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Scheme.js","names":["withScheme","createInfoPlistPluginWithPropertyGuard","setScheme","infoPlistProperty","expoConfigProperty","getScheme","config","Array","isArray","scheme","validate","value","filter","infoPlist","ios","bundleIdentifier","push","length","CFBundleURLTypes","CFBundleURLSchemes","appendScheme","existingSchemes","some","includes","removeScheme","map","bundleUrlType","index","indexOf","splice","undefined","Boolean","hasScheme","schemes","getSchemesFromPlist","reduce"],"sources":["../../src/ios/Scheme.ts"],"sourcesContent":["import { ExpoConfig } from '@expo/config-types';\n\nimport { createInfoPlistPluginWithPropertyGuard } from '../plugins/ios-plugins';\nimport { InfoPlist, URLScheme } from './IosConfig.types';\n\nexport const withScheme = createInfoPlistPluginWithPropertyGuard(\n setScheme,\n {\n infoPlistProperty: 'CFBundleURLTypes',\n expoConfigProperty: 'scheme',\n },\n 'withScheme'\n);\n\nexport function getScheme(config: { scheme?: string | string[] }): string[] {\n if (Array.isArray(config.scheme)) {\n const validate = (value: any): value is string => {\n return typeof value === 'string';\n };\n return config.scheme.filter<string>(validate);\n } else if (typeof config.scheme === 'string') {\n return [config.scheme];\n }\n return [];\n}\n\nexport function setScheme(\n config: Partial<Pick<ExpoConfig, 'scheme' | 'ios'>>,\n infoPlist: InfoPlist\n): InfoPlist {\n const scheme = [\n ...getScheme(config),\n // @ts-ignore: TODO: ios.scheme is an unreleased -- harder to add to turtle v1.\n ...getScheme(config.ios ?? {}),\n ];\n // Add the bundle identifier to the list of schemes for easier Google auth and parity with Turtle v1.\n if (config.ios?.bundleIdentifier) {\n scheme.push(config.ios.bundleIdentifier);\n }\n if (scheme.length === 0) {\n return infoPlist;\n }\n\n return {\n ...infoPlist,\n CFBundleURLTypes: [{ CFBundleURLSchemes: scheme }],\n };\n}\n\nexport function appendScheme(scheme: string | null, infoPlist: InfoPlist): InfoPlist {\n if (!scheme) {\n return infoPlist;\n }\n\n const existingSchemes = infoPlist.CFBundleURLTypes ?? [];\n if (existingSchemes?.some(({ CFBundleURLSchemes }) => CFBundleURLSchemes.includes(scheme))) {\n return infoPlist;\n }\n\n return {\n ...infoPlist,\n CFBundleURLTypes: [\n ...existingSchemes,\n {\n CFBundleURLSchemes: [scheme],\n },\n ],\n };\n}\n\nexport function removeScheme(scheme: string | null, infoPlist: InfoPlist): InfoPlist {\n if (!scheme) {\n return infoPlist;\n }\n\n // No need to remove if we don't have any\n if (!infoPlist.CFBundleURLTypes) {\n return infoPlist;\n }\n\n infoPlist.CFBundleURLTypes = infoPlist.CFBundleURLTypes.map((bundleUrlType) => {\n const index = bundleUrlType.CFBundleURLSchemes.indexOf(scheme);\n if (index > -1) {\n bundleUrlType.CFBundleURLSchemes.splice(index, 1);\n if (bundleUrlType.CFBundleURLSchemes.length === 0) {\n return undefined;\n }\n }\n return bundleUrlType;\n }).filter(Boolean) as URLScheme[];\n\n return infoPlist;\n}\n\nexport function hasScheme(scheme: string, infoPlist: InfoPlist): boolean {\n const existingSchemes = infoPlist.CFBundleURLTypes;\n\n if (!Array.isArray(existingSchemes)) return false;\n\n return existingSchemes?.some(({ CFBundleURLSchemes: schemes }: any) =>\n Array.isArray(schemes) ? schemes.includes(scheme) : false\n );\n}\n\nexport function getSchemesFromPlist(infoPlist: InfoPlist): string[] {\n if (Array.isArray(infoPlist.CFBundleURLTypes)) {\n return infoPlist.CFBundleURLTypes.reduce<string[]>((schemes, { CFBundleURLSchemes }) => {\n if (Array.isArray(CFBundleURLSchemes)) {\n return [...schemes, ...CFBundleURLSchemes];\n }\n return schemes;\n }, []);\n }\n return [];\n}\n"],"mappings":";;;;;;;;;;;;AAEA;EAAA;
|
|
1
|
+
{"version":3,"file":"Scheme.js","names":["_iosPlugins","data","require","withScheme","createInfoPlistPluginWithPropertyGuard","setScheme","infoPlistProperty","expoConfigProperty","exports","getScheme","config","Array","isArray","scheme","validate","value","filter","infoPlist","_config$ios","_config$ios2","ios","bundleIdentifier","push","length","CFBundleURLTypes","CFBundleURLSchemes","appendScheme","_infoPlist$CFBundleUR","existingSchemes","some","includes","removeScheme","map","bundleUrlType","index","indexOf","splice","undefined","Boolean","hasScheme","schemes","getSchemesFromPlist","reduce"],"sources":["../../src/ios/Scheme.ts"],"sourcesContent":["import { ExpoConfig } from '@expo/config-types';\n\nimport { createInfoPlistPluginWithPropertyGuard } from '../plugins/ios-plugins';\nimport { InfoPlist, URLScheme } from './IosConfig.types';\n\nexport const withScheme = createInfoPlistPluginWithPropertyGuard(\n setScheme,\n {\n infoPlistProperty: 'CFBundleURLTypes',\n expoConfigProperty: 'scheme',\n },\n 'withScheme'\n);\n\nexport function getScheme(config: { scheme?: string | string[] }): string[] {\n if (Array.isArray(config.scheme)) {\n const validate = (value: any): value is string => {\n return typeof value === 'string';\n };\n return config.scheme.filter<string>(validate);\n } else if (typeof config.scheme === 'string') {\n return [config.scheme];\n }\n return [];\n}\n\nexport function setScheme(\n config: Partial<Pick<ExpoConfig, 'scheme' | 'ios'>>,\n infoPlist: InfoPlist\n): InfoPlist {\n const scheme = [\n ...getScheme(config),\n // @ts-ignore: TODO: ios.scheme is an unreleased -- harder to add to turtle v1.\n ...getScheme(config.ios ?? {}),\n ];\n // Add the bundle identifier to the list of schemes for easier Google auth and parity with Turtle v1.\n if (config.ios?.bundleIdentifier) {\n scheme.push(config.ios.bundleIdentifier);\n }\n if (scheme.length === 0) {\n return infoPlist;\n }\n\n return {\n ...infoPlist,\n CFBundleURLTypes: [{ CFBundleURLSchemes: scheme }],\n };\n}\n\nexport function appendScheme(scheme: string | null, infoPlist: InfoPlist): InfoPlist {\n if (!scheme) {\n return infoPlist;\n }\n\n const existingSchemes = infoPlist.CFBundleURLTypes ?? [];\n if (existingSchemes?.some(({ CFBundleURLSchemes }) => CFBundleURLSchemes.includes(scheme))) {\n return infoPlist;\n }\n\n return {\n ...infoPlist,\n CFBundleURLTypes: [\n ...existingSchemes,\n {\n CFBundleURLSchemes: [scheme],\n },\n ],\n };\n}\n\nexport function removeScheme(scheme: string | null, infoPlist: InfoPlist): InfoPlist {\n if (!scheme) {\n return infoPlist;\n }\n\n // No need to remove if we don't have any\n if (!infoPlist.CFBundleURLTypes) {\n return infoPlist;\n }\n\n infoPlist.CFBundleURLTypes = infoPlist.CFBundleURLTypes.map((bundleUrlType) => {\n const index = bundleUrlType.CFBundleURLSchemes.indexOf(scheme);\n if (index > -1) {\n bundleUrlType.CFBundleURLSchemes.splice(index, 1);\n if (bundleUrlType.CFBundleURLSchemes.length === 0) {\n return undefined;\n }\n }\n return bundleUrlType;\n }).filter(Boolean) as URLScheme[];\n\n return infoPlist;\n}\n\nexport function hasScheme(scheme: string, infoPlist: InfoPlist): boolean {\n const existingSchemes = infoPlist.CFBundleURLTypes;\n\n if (!Array.isArray(existingSchemes)) return false;\n\n return existingSchemes?.some(({ CFBundleURLSchemes: schemes }: any) =>\n Array.isArray(schemes) ? schemes.includes(scheme) : false\n );\n}\n\nexport function getSchemesFromPlist(infoPlist: InfoPlist): string[] {\n if (Array.isArray(infoPlist.CFBundleURLTypes)) {\n return infoPlist.CFBundleURLTypes.reduce<string[]>((schemes, { CFBundleURLSchemes }) => {\n if (Array.isArray(CFBundleURLSchemes)) {\n return [...schemes, ...CFBundleURLSchemes];\n }\n return schemes;\n }, []);\n }\n return [];\n}\n"],"mappings":";;;;;;;;;;;;AAEA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGO,MAAME,UAAU,GAAG,IAAAC,oDAAsC,EAC9DC,SAAS,EACT;EACEC,iBAAiB,EAAE,kBAAkB;EACrCC,kBAAkB,EAAE;AACtB,CAAC,EACD,YAAY,CACb;AAACC,OAAA,CAAAL,UAAA,GAAAA,UAAA;AAEK,SAASM,SA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IAAEJ,kBAAkB,EAAEe;EAAa,CAAC,KAChE7B,KAAK,CAACC,OAAO,CAAC4B,OAAO,CAAC,GAAGA,OAAO,CAACV,QAAQ,CAACjB,MAAM,CAAC,GAAG,KAAK,CAC1D;AACH;AAEO,SAAS4B,mBAAmBA,CAACxB,SAAoB,EAAY;EAClE,IAAIN,KAAK,CAACC,OAAO,CAACK,SAAS,CAACO,gBAAgB,CAAC,EAAE;IAC7C,OAAOP,SAAS,CAACO,gBAAgB,CAACkB,MAAM,CAAW,CAACF,OAAO,EAAE;MAAEf;IAAmB,CAAC,KAAK;MACtF,IAAId,KAAK,CAACC,OAAO,CAACa,kBAAkB,CAAC,EAAE;QACrC,OAAO,CAAC,GAAGe,OAAO,EAAE,GAAGf,kBAAkB,CAAC;MAC5C;MACA,OAAOe,OAAO;IAChB,CAAC,EAAE,EAAE,CAAC;EACR;EACA,OAAO,EAAE;AACX"}
|
package/build/ios/Swift.js
CHANGED
|
@@ -105,7 +105,7 @@ function shouldCreateSwiftBridgingHeader({
|
|
|
105
105
|
project
|
|
106
106
|
}) {
|
|
107
107
|
// Only create a bridging header if the project is using in Objective C (AppDelegate is written in Objc).
|
|
108
|
-
const isObjc = (0, _Paths().getAppDelegate)(projectRoot).language
|
|
108
|
+
const isObjc = (0, _Paths().getAppDelegate)(projectRoot).language !== 'swift';
|
|
109
109
|
return isObjc && !getDesignatedSwiftBridgingHeaderFileReference({
|
|
110
110
|
project
|
|
111
111
|
});
|
package/build/ios/Swift.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Swift.js","names":["templateBridgingHeader","withSwiftBridgingHeader","config","withXcodeProject","modResults","ensureSwiftBridgingHeaderSetup","project","projectRoot","modRequest","shouldCreateSwiftBridgingHeader","projectName","getProjectName","bridgingHeader","createBridgingHeaderFileName","createBridgingHeaderFile","linkBridgingHeaderFile","path","join","isObjc","getAppDelegate","language","getDesignatedSwiftBridgingHeaderFileReference","configurations","pbxXCBuildConfigurationSection","buildSettings","Object","values","PRODUCT_NAME","SWIFT_OBJC_BRIDGING_HEADER","bridgingHeaderProjectPath","getSourceRoot","fs","existsSync","writeFileSync","filePath","hasFile","addResourceFileToGroup","filepath","groupName","isBuildFile","verbose","withNoopSwiftFile","withBuildSourceFile","contents"],"sources":["../../src/ios/Swift.ts"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\n\nimport { ConfigPlugin, XcodeProject } from '../Plugin.types';\nimport { withXcodeProject } from '../plugins/ios-plugins';\nimport { getAppDelegate, getSourceRoot } from './Paths';\nimport { withBuildSourceFile } from './XcodeProjectFile';\nimport { addResourceFileToGroup, getProjectName } from './utils/Xcodeproj';\n\nconst templateBridgingHeader = `//\n// Use this file to import your target's public headers that you would like to expose to Swift.\n//\n`;\n\n/**\n * Ensure a Swift bridging header is created for the project.\n * This helps fix problems related to using modules that are written in Swift (lottie, FBSDK).\n *\n * 1. Ensures the file exists given the project path.\n * 2. Writes the file and links to Xcode as a resource file.\n * 3. Sets the build configuration `SWIFT_OBJC_BRIDGING_HEADER = [PROJECT_NAME]-Bridging-Header.h`\n */\nexport const withSwiftBridgingHeader: ConfigPlugin = (config) => {\n return withXcodeProject(config, (config) => {\n config.modResults = ensureSwiftBridgingHeaderSetup({\n project: config.modResults,\n projectRoot: config.modRequest.projectRoot,\n });\n return config;\n });\n};\n\nexport function ensureSwiftBridgingHeaderSetup({\n projectRoot,\n project,\n}: {\n projectRoot: string;\n project: XcodeProject;\n}) {\n // Only create a bridging header if using objective-c\n if (shouldCreateSwiftBridgingHeader({ projectRoot, project })) {\n const projectName = getProjectName(projectRoot);\n const bridgingHeader = createBridgingHeaderFileName(projectName);\n // Ensure a bridging header is created in the Xcode project.\n project = createBridgingHeaderFile({\n project,\n projectName,\n projectRoot,\n bridgingHeader,\n });\n // Designate the newly created file as the Swift bridging header in the Xcode project.\n project = linkBridgingHeaderFile({\n project,\n bridgingHeader: path.join(projectName, bridgingHeader),\n });\n }\n return project;\n}\n\nfunction shouldCreateSwiftBridgingHeader({\n projectRoot,\n project,\n}: {\n projectRoot: string;\n project: XcodeProject;\n}): boolean {\n // Only create a bridging header if the project is using in Objective C (AppDelegate is written in Objc).\n const isObjc = getAppDelegate(projectRoot).language === 'objc';\n return isObjc && !getDesignatedSwiftBridgingHeaderFileReference({ project });\n}\n\n/**\n * @returns String matching the default name used when Xcode automatically creates a bridging header file.\n */\nfunction createBridgingHeaderFileName(projectName: string): string {\n return `${projectName}-Bridging-Header.h`;\n}\n\nexport function getDesignatedSwiftBridgingHeaderFileReference({\n project,\n}: {\n project: XcodeProject;\n}): string | null {\n const configurations = project.pbxXCBuildConfigurationSection();\n // @ts-ignore\n for (const { buildSettings } of Object.values(configurations || {})) {\n // Guessing that this is the best way to emulate Xcode.\n // Using `project.addToBuildSettings` modifies too many targets.\n if (typeof buildSettings?.PRODUCT_NAME !== 'undefined') {\n if (\n typeof buildSettings.SWIFT_OBJC_BRIDGING_HEADER === 'string' &&\n buildSettings.SWIFT_OBJC_BRIDGING_HEADER\n ) {\n return buildSettings.SWIFT_OBJC_BRIDGING_HEADER;\n }\n }\n }\n return null;\n}\n\n/**\n *\n * @param bridgingHeader The bridging header filename ex: `ExpoAPIs-Bridging-Header.h`\n * @returns\n */\nexport function linkBridgingHeaderFile({\n project,\n bridgingHeader,\n}: {\n project: XcodeProject;\n bridgingHeader: string;\n}): XcodeProject {\n const configurations = project.pbxXCBuildConfigurationSection();\n // @ts-ignore\n for (const { buildSettings } of Object.values(configurations || {})) {\n // Guessing that this is the best way to emulate Xcode.\n // Using `project.addToBuildSettings` modifies too many targets.\n if (typeof buildSettings?.PRODUCT_NAME !== 'undefined') {\n buildSettings.SWIFT_OBJC_BRIDGING_HEADER = bridgingHeader;\n }\n }\n\n return project;\n}\n\nexport function createBridgingHeaderFile({\n projectRoot,\n projectName,\n project,\n bridgingHeader,\n}: {\n project: XcodeProject;\n projectName: string;\n projectRoot: string;\n bridgingHeader: string;\n}): XcodeProject {\n const bridgingHeaderProjectPath = path.join(getSourceRoot(projectRoot), bridgingHeader);\n if (!fs.existsSync(bridgingHeaderProjectPath)) {\n // Create the file\n fs.writeFileSync(bridgingHeaderProjectPath, templateBridgingHeader, 'utf8');\n }\n\n // This is non-standard, Xcode generates the bridging header in `/ios` which is kinda annoying.\n // Instead, this'll generate the default header in the application code folder `/ios/myproject/`.\n const filePath = `${projectName}/${bridgingHeader}`;\n // Ensure the file is linked with Xcode resource files\n if (!project.hasFile(filePath)) {\n project = addResourceFileToGroup({\n filepath: filePath,\n groupName: projectName,\n project,\n // Not sure why, but this is how Xcode generates it.\n isBuildFile: false,\n verbose: false,\n });\n }\n return project;\n}\n\nexport const withNoopSwiftFile: ConfigPlugin = (config) => {\n return withBuildSourceFile(config, {\n filePath: 'noop-file.swift',\n contents: [\n '//',\n '// @generated',\n '// A blank Swift file must be created for native modules with Swift files to work correctly.',\n '//',\n '',\n ].join('\\n'),\n });\n};\n"],"mappings":";;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAGA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAA2E;AAE3E,MAAMA,sBAAsB,GAAI;AAChC;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,uBAAqC,GAAIC,MAAM,IAAK;EAC/D,OAAO,IAAAC,8BAAgB,EAACD,MAAM,EAAGA,MAAM,IAAK;IAC1CA,MAAM,CAACE,UAAU,GAAGC,8BAA8B,CAAC;MACjDC,OAAO,EAAEJ,MAAM,CAACE,UAAU;MAC1BG,WAAW,EAAEL,MAAM,CAACM,UAAU,CAACD;IACjC,CAAC,CAAC;IACF,OAAOL,MAAM;EACf,CAAC,CAAC;AACJ,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AChB;AAEO,MAAMmC,iBAA+B,GAAIvC,MAAM,IAAK;EACzD,OAAO,IAAAwC,uCAAmB,EAACxC,MAAM,EAAE;IACjCgC,QAAQ,EAAE,iBAAiB;IAC3BS,QAAQ,EAAE,CACR,IAAI,EACJ,eAAe,EACf,8FAA8F,EAC9F,IAAI,EACJ,EAAE,CACH,CAAC1B,IAAI,CAAC,IAAI;EACb,CAAC,CAAC;AACJ,CAAC;AAAC"}
|
|
1
|
+
{"version":3,"file":"Swift.js","names":["_fs","data","_interopRequireDefault","require","_path","_iosPlugins","_Paths","_XcodeProjectFile","_Xcodeproj","obj","__esModule","default","templateBridgingHeader","withSwiftBridgingHeader","config","withXcodeProject","modResults","ensureSwiftBridgingHeaderSetup","project","projectRoot","modRequest","exports","shouldCreateSwiftBridgingHeader","projectName","getProjectName","bridgingHeader","createBridgingHeaderFileName","createBridgingHeaderFile","linkBridgingHeaderFile","path","join","isObjc","getAppDelegate","language","getDesignatedSwiftBridgingHeaderFileReference","configurations","pbxXCBuildConfigurationSection","buildSettings","Object","values","PRODUCT_NAME","SWIFT_OBJC_BRIDGING_HEADER","bridgingHeaderProjectPath","getSourceRoot","fs","existsSync","writeFileSync","filePath","hasFile","addResourceFileToGroup","filepath","groupName","isBuildFile","verbose","withNoopSwiftFile","withBuildSourceFile","contents"],"sources":["../../src/ios/Swift.ts"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\n\nimport { ConfigPlugin, XcodeProject } from '../Plugin.types';\nimport { withXcodeProject } from '../plugins/ios-plugins';\nimport { getAppDelegate, getSourceRoot } from './Paths';\nimport { withBuildSourceFile } from './XcodeProjectFile';\nimport { addResourceFileToGroup, getProjectName } from './utils/Xcodeproj';\n\nconst templateBridgingHeader = `//\n// Use this file to import your target's public headers that you would like to expose to Swift.\n//\n`;\n\n/**\n * Ensure a Swift bridging header is created for the project.\n * This helps fix problems related to using modules that are written in Swift (lottie, FBSDK).\n *\n * 1. Ensures the file exists given the project path.\n * 2. Writes the file and links to Xcode as a resource file.\n * 3. Sets the build configuration `SWIFT_OBJC_BRIDGING_HEADER = [PROJECT_NAME]-Bridging-Header.h`\n */\nexport const withSwiftBridgingHeader: ConfigPlugin = (config) => {\n return withXcodeProject(config, (config) => {\n config.modResults = ensureSwiftBridgingHeaderSetup({\n project: config.modResults,\n projectRoot: config.modRequest.projectRoot,\n });\n return config;\n });\n};\n\nexport function ensureSwiftBridgingHeaderSetup({\n projectRoot,\n project,\n}: {\n projectRoot: string;\n project: XcodeProject;\n}) {\n // Only create a bridging header if using objective-c\n if (shouldCreateSwiftBridgingHeader({ projectRoot, project })) {\n const projectName = getProjectName(projectRoot);\n const bridgingHeader = createBridgingHeaderFileName(projectName);\n // Ensure a bridging header is created in the Xcode project.\n project = createBridgingHeaderFile({\n project,\n projectName,\n projectRoot,\n bridgingHeader,\n });\n // Designate the newly created file as the Swift bridging header in the Xcode project.\n project = linkBridgingHeaderFile({\n project,\n bridgingHeader: path.join(projectName, bridgingHeader),\n });\n }\n return project;\n}\n\nfunction shouldCreateSwiftBridgingHeader({\n projectRoot,\n project,\n}: {\n projectRoot: string;\n project: XcodeProject;\n}): boolean {\n // Only create a bridging header if the project is using in Objective C (AppDelegate is written in Objc).\n const isObjc = getAppDelegate(projectRoot).language !== 'swift';\n return isObjc && !getDesignatedSwiftBridgingHeaderFileReference({ project });\n}\n\n/**\n * @returns String matching the default name used when Xcode automatically creates a bridging header file.\n */\nfunction createBridgingHeaderFileName(projectName: string): string {\n return `${projectName}-Bridging-Header.h`;\n}\n\nexport function getDesignatedSwiftBridgingHeaderFileReference({\n project,\n}: {\n project: XcodeProject;\n}): string | null {\n const configurations = project.pbxXCBuildConfigurationSection();\n // @ts-ignore\n for (const { buildSettings } of Object.values(configurations || {})) {\n // Guessing that this is the best way to emulate Xcode.\n // Using `project.addToBuildSettings` modifies too many targets.\n if (typeof buildSettings?.PRODUCT_NAME !== 'undefined') {\n if (\n typeof buildSettings.SWIFT_OBJC_BRIDGING_HEADER === 'string' &&\n buildSettings.SWIFT_OBJC_BRIDGING_HEADER\n ) {\n return buildSettings.SWIFT_OBJC_BRIDGING_HEADER;\n }\n }\n }\n return null;\n}\n\n/**\n *\n * @param bridgingHeader The bridging header filename ex: `ExpoAPIs-Bridging-Header.h`\n * @returns\n */\nexport function linkBridgingHeaderFile({\n project,\n bridgingHeader,\n}: {\n project: XcodeProject;\n bridgingHeader: string;\n}): XcodeProject {\n const configurations = project.pbxXCBuildConfigurationSection();\n // @ts-ignore\n for (const { buildSettings } of Object.values(configurations || {})) {\n // Guessing that this is the best way to emulate Xcode.\n // Using `project.addToBuildSettings` modifies too many targets.\n if (typeof buildSettings?.PRODUCT_NAME !== 'undefined') {\n buildSettings.SWIFT_OBJC_BRIDGING_HEADER = bridgingHeader;\n }\n }\n\n return project;\n}\n\nexport function createBridgingHeaderFile({\n projectRoot,\n projectName,\n project,\n bridgingHeader,\n}: {\n project: XcodeProject;\n projectName: string;\n projectRoot: string;\n bridgingHeader: string;\n}): XcodeProject {\n const bridgingHeaderProjectPath = path.join(getSourceRoot(projectRoot), bridgingHeader);\n if (!fs.existsSync(bridgingHeaderProjectPath)) {\n // Create the file\n fs.writeFileSync(bridgingHeaderProjectPath, templateBridgingHeader, 'utf8');\n }\n\n // This is non-standard, Xcode generates the bridging header in `/ios` which is kinda annoying.\n // Instead, this'll generate the default header in the application code folder `/ios/myproject/`.\n const filePath = `${projectName}/${bridgingHeader}`;\n // Ensure the file is linked with Xcode resource files\n if (!project.hasFile(filePath)) {\n project = addResourceFileToGroup({\n filepath: filePath,\n groupName: projectName,\n project,\n // Not sure why, but this is how Xcode generates it.\n isBuildFile: false,\n verbose: false,\n });\n }\n return project;\n}\n\nexport const withNoopSwiftFile: ConfigPlugin = (config) => {\n return withBuildSourceFile(config, {\n filePath: 'noop-file.swift',\n contents: [\n '//',\n '// @generated',\n '// A blank Swift file must be created for native modules with Swift files to work correctly.',\n '//',\n '',\n ].join('\\n'),\n });\n};\n"],"mappings":";;;;;;;;;;A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OAAO;MACP;MACAkC,WAAW,EAAE,KAAK;MAClBC,OAAO,EAAE;IACX,CAAC,CAAC;EACJ;EACA,OAAOnC,OAAO;AAChB;AAEO,MAAMoC,iBAA+B,GAAIxC,MAAM,IAAK;EACzD,OAAO,IAAAyC,uCAAmB,EAACzC,MAAM,EAAE;IACjCiC,QAAQ,EAAE,iBAAiB;IAC3BS,QAAQ,EAAE,CACR,IAAI,EACJ,eAAe,EACf,8FAA8F,EAC9F,IAAI,EACJ,EAAE,CACH,CAAC1B,IAAI,CAAC,IAAI;EACb,CAAC,CAAC;AACJ,CAAC;AAACT,OAAA,CAAAiC,iBAAA,GAAAA,iBAAA"}
|
package/build/ios/Target.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Target.js","names":["TargetType","getXCBuildConfigurationFromPbxproj","project","targetName","buildConfiguration","nativeTarget","findNativeTargetByName","findFirstNativeTarget","xcBuildConfiguration","getBuildConfigurationForListIdAndName","configurationListId","buildConfigurationList","findApplicationTargetWithDependenciesAsync","projectRoot","scheme","applicationTargetName","getApplicationTargetNameForSchemeAsync","getPbxproj","applicationTarget","dependencies","getTargetDependencies","name","trimQuotes","type","APPLICATION","parentTarget","length","undefined","map","value","target","targetId","getPBXGroupByKeyAndType","findNativeTargetById","isTargetOfType","EXTENSION","OTHER","targetType","productType","getNativeTargets","section","pbxNativeTargetSection","Object","entries","filter","isNotComment","findSignableTargets","targets","signableTargetTypes","APP_CLIP","WATCH","STICKER_PACK_EXTENSION","applicationTargets","Error","nativeTargets","nativeTargetEntry","find","i","key"],"sources":["../../src/ios/Target.ts"],"sourcesContent":["import { PBXNativeTarget, PBXTargetDependency, XCBuildConfiguration, XcodeProject } from 'xcode';\n\nimport { getApplicationTargetNameForSchemeAsync } from './BuildScheme';\nimport {\n getBuildConfigurationForListIdAndName,\n getPbxproj,\n isNotComment,\n NativeTargetSectionEntry,\n} from './utils/Xcodeproj';\nimport { trimQuotes } from './utils/string';\n\nexport enum TargetType {\n APPLICATION = 'com.apple.product-type.application',\n EXTENSION = 'com.apple.product-type.app-extension',\n WATCH = 'com.apple.product-type.application.watchapp',\n APP_CLIP = 'com.apple.product-type.application.on-demand-install-capable',\n STICKER_PACK_EXTENSION = 'com.apple.product-type.app-extension.messages-sticker-pack',\n OTHER = 'other',\n}\n\nexport interface Target {\n name: string;\n type: TargetType;\n dependencies?: Target[];\n}\n\nexport function getXCBuildConfigurationFromPbxproj(\n project: XcodeProject,\n {\n targetName,\n buildConfiguration = 'Release',\n }: { targetName?: string; buildConfiguration?: string } = {}\n): XCBuildConfiguration | null {\n const [, nativeTarget] = targetName\n ? findNativeTargetByName(project, targetName)\n : findFirstNativeTarget(project);\n const [, xcBuildConfiguration] = getBuildConfigurationForListIdAndName(project, {\n configurationListId: nativeTarget.buildConfigurationList,\n buildConfiguration,\n });\n return xcBuildConfiguration ?? null;\n}\n\nexport async function findApplicationTargetWithDependenciesAsync(\n projectRoot: string,\n scheme: string\n): Promise<Target> {\n const applicationTargetName = await getApplicationTargetNameForSchemeAsync(projectRoot, scheme);\n const project = getPbxproj(projectRoot);\n const [, applicationTarget] = findNativeTargetByName(project, applicationTargetName);\n const dependencies = getTargetDependencies(project, applicationTarget);\n return {\n name: trimQuotes(applicationTarget.name),\n type: TargetType.APPLICATION,\n dependencies,\n };\n}\n\nfunction getTargetDependencies(\n project: XcodeProject,\n parentTarget: PBXNativeTarget\n): Target[] | undefined {\n if (!parentTarget.dependencies || parentTarget.dependencies.length === 0) {\n return undefined;\n }\n return parentTarget.dependencies.map(({ value }) => {\n const { target: targetId } = project.getPBXGroupByKeyAndType(\n value,\n 'PBXTargetDependency'\n ) as PBXTargetDependency;\n\n const [, target] = findNativeTargetById(project, targetId);\n\n const type = isTargetOfType(target, TargetType.EXTENSION)\n ? TargetType.EXTENSION\n : TargetType.OTHER;\n return {\n name: trimQuotes(target.name),\n type,\n dependencies: getTargetDependencies(project, target),\n };\n });\n}\n\nexport function isTargetOfType(target: PBXNativeTarget, targetType: TargetType): boolean {\n return trimQuotes(target.productType) === targetType;\n}\n\nexport function getNativeTargets(project: XcodeProject): NativeTargetSectionEntry[] {\n const section = project.pbxNativeTargetSection();\n return Object.entries(section).filter(isNotComment);\n}\n\nexport function findSignableTargets(project: XcodeProject): NativeTargetSectionEntry[] {\n const targets = getNativeTargets(project);\n\n const signableTargetTypes = [\n TargetType.APPLICATION,\n TargetType.APP_CLIP,\n TargetType.EXTENSION,\n TargetType.WATCH,\n TargetType.STICKER_PACK_EXTENSION,\n ];\n\n const applicationTargets = targets.filter(([, target]) => {\n for (const targetType of signableTargetTypes) {\n if (isTargetOfType(target, targetType)) {\n return true;\n }\n }\n return false;\n });\n if (applicationTargets.length === 0) {\n throw new Error(`Could not find any signable targets in project.pbxproj`);\n }\n return applicationTargets;\n}\n\nexport function findFirstNativeTarget(project: XcodeProject): NativeTargetSectionEntry {\n const targets = getNativeTargets(project);\n const applicationTargets = targets.filter(([, target]) =>\n isTargetOfType(target, TargetType.APPLICATION)\n );\n if (applicationTargets.length === 0) {\n throw new Error(`Could not find any application target in project.pbxproj`);\n }\n return applicationTargets[0];\n}\n\nexport function findNativeTargetByName(\n project: XcodeProject,\n targetName: string\n): NativeTargetSectionEntry {\n const nativeTargets = getNativeTargets(project);\n const nativeTargetEntry = nativeTargets.find(([, i]) => trimQuotes(i.name) === targetName);\n if (!nativeTargetEntry) {\n throw new Error(`Could not find target '${targetName}' in project.pbxproj`);\n }\n return nativeTargetEntry;\n}\n\nfunction findNativeTargetById(project: XcodeProject, targetId: string): NativeTargetSectionEntry {\n const nativeTargets = getNativeTargets(project);\n const nativeTargetEntry = nativeTargets.find(([key]) => key === targetId);\n if (!nativeTargetEntry) {\n throw new Error(`Could not find target with id '${targetId}' in project.pbxproj`);\n }\n return nativeTargetEntry;\n}\n"],"mappings":";;;;;;;;;;;;;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAMA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A,SAAStB,oBAAoB,CAAC/B,OAAqB,EAAE6B,QAAgB,EAA4B;EAC/F,MAAMuB,aAAa,GAAGf,gBAAgB,CAACrC,OAAO,CAAC;EAC/C,MAAMqD,iBAAiB,GAAGD,aAAa,CAACE,IAAI,CAAC,CAAC,CAACE,GAAG,CAAC,KAAKA,GAAG,KAAK3B,QAAQ,CAAC;EACzE,IAAI,CAACwB,iBAAiB,EAAE;IACtB,MAAM,IAAIF,KAAK,CAAE,kCAAiCtB,QAAS,sBAAqB,CAAC;EACnF;EACA,OAAOwB,iBAAiB;AAC1B"}
|
|
1
|
+
{"version":3,"file":"Target.js","names":["_BuildScheme","data","require","_Xcodeproj","_string","TargetType","exports","getXCBuildConfigurationFromPbxproj","project","targetName","buildConfiguration","nativeTarget","findNativeTargetByName","findFirstNativeTarget","xcBuildConfiguration","getBuildConfigurationForListIdAndName","configurationListId","buildConfigurationList","findApplicationTargetWithDependenciesAsync","projectRoot","scheme","applicationTargetName","getApplicationTargetNameForSchemeAsync","getPbxproj","applicationTarget","dependencies","getTargetDependencies","name","trimQuotes","type","APPLICATION","parentTarget","length","undefined","map","value","target","targetId","getPBXGroupByKeyAndType","findNativeTargetById","isTargetOfType","EXTENSION","OTHER","targetType","productType","getNativeTargets","section","pbxNativeTargetSection","Object","entries","filter","isNotComment","findSignableTargets","targets","signableTargetTypes","APP_CLIP","WATCH","STICKER_PACK_EXTENSION","applicationTargets","Error","nativeTargets","nativeTargetEntry","find","i","key"],"sources":["../../src/ios/Target.ts"],"sourcesContent":["import { PBXNativeTarget, PBXTargetDependency, XCBuildConfiguration, XcodeProject } from 'xcode';\n\nimport { getApplicationTargetNameForSchemeAsync } from './BuildScheme';\nimport {\n getBuildConfigurationForListIdAndName,\n getPbxproj,\n isNotComment,\n NativeTargetSectionEntry,\n} from './utils/Xcodeproj';\nimport { trimQuotes } from './utils/string';\n\nexport enum TargetType {\n APPLICATION = 'com.apple.product-type.application',\n EXTENSION = 'com.apple.product-type.app-extension',\n WATCH = 'com.apple.product-type.application.watchapp',\n APP_CLIP = 'com.apple.product-type.application.on-demand-install-capable',\n STICKER_PACK_EXTENSION = 'com.apple.product-type.app-extension.messages-sticker-pack',\n OTHER = 'other',\n}\n\nexport interface Target {\n name: string;\n type: TargetType;\n dependencies?: Target[];\n}\n\nexport function getXCBuildConfigurationFromPbxproj(\n project: XcodeProject,\n {\n targetName,\n buildConfiguration = 'Release',\n }: { targetName?: string; buildConfiguration?: string } = {}\n): XCBuildConfiguration | null {\n const [, nativeTarget] = targetName\n ? findNativeTargetByName(project, targetName)\n : findFirstNativeTarget(project);\n const [, xcBuildConfiguration] = getBuildConfigurationForListIdAndName(project, {\n configurationListId: nativeTarget.buildConfigurationList,\n buildConfiguration,\n });\n return xcBuildConfiguration ?? null;\n}\n\nexport async function findApplicationTargetWithDependenciesAsync(\n projectRoot: string,\n scheme: string\n): Promise<Target> {\n const applicationTargetName = await getApplicationTargetNameForSchemeAsync(projectRoot, scheme);\n const project = getPbxproj(projectRoot);\n const [, applicationTarget] = findNativeTargetByName(project, applicationTargetName);\n const dependencies = getTargetDependencies(project, applicationTarget);\n return {\n name: trimQuotes(applicationTarget.name),\n type: TargetType.APPLICATION,\n dependencies,\n };\n}\n\nfunction getTargetDependencies(\n project: XcodeProject,\n parentTarget: PBXNativeTarget\n): Target[] | undefined {\n if (!parentTarget.dependencies || parentTarget.dependencies.length === 0) {\n return undefined;\n }\n return parentTarget.dependencies.map(({ value }) => {\n const { target: targetId } = project.getPBXGroupByKeyAndType(\n value,\n 'PBXTargetDependency'\n ) as PBXTargetDependency;\n\n const [, target] = findNativeTargetById(project, targetId);\n\n const type = isTargetOfType(target, TargetType.EXTENSION)\n ? TargetType.EXTENSION\n : TargetType.OTHER;\n return {\n name: trimQuotes(target.name),\n type,\n dependencies: getTargetDependencies(project, target),\n };\n });\n}\n\nexport function isTargetOfType(target: PBXNativeTarget, targetType: TargetType): boolean {\n return trimQuotes(target.productType) === targetType;\n}\n\nexport function getNativeTargets(project: XcodeProject): NativeTargetSectionEntry[] {\n const section = project.pbxNativeTargetSection();\n return Object.entries(section).filter(isNotComment);\n}\n\nexport function findSignableTargets(project: XcodeProject): NativeTargetSectionEntry[] {\n const targets = getNativeTargets(project);\n\n const signableTargetTypes = [\n TargetType.APPLICATION,\n TargetType.APP_CLIP,\n TargetType.EXTENSION,\n TargetType.WATCH,\n TargetType.STICKER_PACK_EXTENSION,\n ];\n\n const applicationTargets = targets.filter(([, target]) => {\n for (const targetType of signableTargetTypes) {\n if (isTargetOfType(target, targetType)) {\n return true;\n }\n }\n return false;\n });\n if (applicationTargets.length === 0) {\n throw new Error(`Could not find any signable targets in project.pbxproj`);\n }\n return applicationTargets;\n}\n\nexport function findFirstNativeTarget(project: XcodeProject): NativeTargetSectionEntry {\n const targets = getNativeTargets(project);\n const applicationTargets = targets.filter(([, target]) =>\n isTargetOfType(target, TargetType.APPLICATION)\n );\n if (applicationTargets.length === 0) {\n throw new Error(`Could not find any application target in project.pbxproj`);\n }\n return applicationTargets[0];\n}\n\nexport function findNativeTargetByName(\n project: XcodeProject,\n targetName: string\n): NativeTargetSectionEntry {\n const nativeTargets = getNativeTargets(project);\n const nativeTargetEntry = nativeTargets.find(([, i]) => trimQuotes(i.name) === targetName);\n if (!nativeTargetEntry) {\n throw new Error(`Could not find target '${targetName}' in project.pbxproj`);\n }\n return nativeTargetEntry;\n}\n\nfunction findNativeTargetById(project: XcodeProject, targetId: string): NativeTargetSectionEntry {\n const nativeTargets = getNativeTargets(project);\n const nativeTargetEntry = nativeTargets.find(([key]) => key === targetId);\n if (!nativeTargetEntry) {\n throw new Error(`Could not find target with id '${targetId}' in project.pbxproj`);\n }\n return nativeTargetEntry;\n}\n"],"mappings":";;;;;;;;;;;;;AAEA,SAAAA,aAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,YAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,WAAA;EAAA,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,aAAa,CAACE,IAAI,CAAC,CAAC,GAAGC,CAAC,CAAC,KAAK,IAAAnC,oBAAU,EAACmC,CAAC,CAACpC,IAAI,CAAC,KAAKlB,UAAU,CAAC;EAC1F,IAAI,CAACoD,iBAAiB,EAAE;IACtB,MAAM,IAAIF,KAAK,CAAE,0BAAyBlD,UAAW,sBAAqB,CAAC;EAC7E;EACA,OAAOoD,iBAAiB;AAC1B;AAEA,SAAStB,oBAAoBA,CAAC/B,OAAqB,EAAE6B,QAAgB,EAA4B;EAC/F,MAAMuB,aAAa,GAAGf,gBAAgB,CAACrC,OAAO,CAAC;EAC/C,MAAMqD,iBAAiB,GAAGD,aAAa,CAACE,IAAI,CAAC,CAAC,CAACE,GAAG,CAAC,KAAKA,GAAG,KAAK3B,QAAQ,CAAC;EACzE,IAAI,CAACwB,iBAAiB,EAAE;IACtB,MAAM,IAAIF,KAAK,CAAE,kCAAiCtB,QAAS,sBAAqB,CAAC;EACnF;EACA,OAAOwB,iBAAiB;AAC1B"}
|
package/build/ios/Updates.js
CHANGED
|
@@ -73,7 +73,7 @@ exports.withUpdates = withUpdates;
|
|
|
73
73
|
function setUpdatesConfig(projectRoot, config, expoPlist, username, expoUpdatesPackageVersion) {
|
|
74
74
|
const newExpoPlist = {
|
|
75
75
|
...expoPlist,
|
|
76
|
-
[Config.ENABLED]: (0, _Updates().getUpdatesEnabled)(config),
|
|
76
|
+
[Config.ENABLED]: (0, _Updates().getUpdatesEnabled)(config, username),
|
|
77
77
|
[Config.CHECK_ON_LAUNCH]: (0, _Updates().getUpdatesCheckOnLaunch)(config, expoUpdatesPackageVersion),
|
|
78
78
|
[Config.LAUNCH_WAIT_MS]: (0, _Updates().getUpdatesTimeout)(config)
|
|
79
79
|
};
|
|
@@ -166,7 +166,7 @@ function isPlistConfigurationSet(expoPlist) {
|
|
|
166
166
|
return Boolean(expoPlist.EXUpdatesURL && (expoPlist.EXUpdatesSDKVersion || expoPlist.EXUpdatesRuntimeVersion));
|
|
167
167
|
}
|
|
168
168
|
function isPlistConfigurationSynced(projectRoot, config, expoPlist, username) {
|
|
169
|
-
return (0, _Updates().getUpdateUrl)(config, username) === expoPlist.EXUpdatesURL && (0, _Updates().getUpdatesEnabled)(config) === expoPlist.EXUpdatesEnabled && (0, _Updates().getUpdatesTimeout)(config) === expoPlist.EXUpdatesLaunchWaitMs && (0, _Updates().getUpdatesCheckOnLaunch)(config) === expoPlist.EXUpdatesCheckOnLaunch && (0, _Updates().getUpdatesCodeSigningCertificate)(projectRoot, config) === expoPlist.EXUpdatesCodeSigningCertificate && (0, _Updates().getUpdatesCodeSigningMetadata)(config) === expoPlist.EXUpdatesCodeSigningMetadata && isPlistVersionConfigurationSynced(config, expoPlist);
|
|
169
|
+
return (0, _Updates().getUpdateUrl)(config, username) === expoPlist.EXUpdatesURL && (0, _Updates().getUpdatesEnabled)(config, username) === expoPlist.EXUpdatesEnabled && (0, _Updates().getUpdatesTimeout)(config) === expoPlist.EXUpdatesLaunchWaitMs && (0, _Updates().getUpdatesCheckOnLaunch)(config) === expoPlist.EXUpdatesCheckOnLaunch && (0, _Updates().getUpdatesCodeSigningCertificate)(projectRoot, config) === expoPlist.EXUpdatesCodeSigningCertificate && (0, _Updates().getUpdatesCodeSigningMetadata)(config) === expoPlist.EXUpdatesCodeSigningMetadata && isPlistVersionConfigurationSynced(config, expoPlist);
|
|
170
170
|
}
|
|
171
171
|
function isPlistVersionConfigurationSynced(config, expoPlist) {
|
|
172
172
|
var _expoPlist$EXUpdatesR, _expoPlist$EXUpdatesS;
|
package/build/ios/Updates.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Updates.js","names":["CREATE_MANIFEST_IOS_PATH","Config","withUpdates","config","expoUsername","withExpoPlist","projectRoot","modRequest","expoUpdatesPackageVersion","getExpoUpdatesPackageVersion","modResults","setUpdatesConfig","expoPlist","username","newExpoPlist","ENABLED","getUpdatesEnabled","CHECK_ON_LAUNCH","getUpdatesCheckOnLaunch","LAUNCH_WAIT_MS","getUpdatesTimeout","updateUrl","getUpdateUrl","UPDATE_URL","codeSigningCertificate","getUpdatesCodeSigningCertificate","CODE_SIGNING_CERTIFICATE","codeSigningMetadata","getUpdatesCodeSigningMetadata","CODE_SIGNING_METADATA","requestHeaders","getUpdatesRequestHeaders","UPDATES_CONFIGURATION_REQUEST_HEADERS_KEY","setVersionsConfig","runtimeVersion","getRuntimeVersionNullable","RUNTIME_VERSION","Error","sdkVersion","getSDKVersion","SDK_VERSION","formatConfigurationScriptPath","buildScriptPath","resolveFrom","silent","relativePath","path","relative","join","process","platform","replace","getBundleReactNativePhase","project","shellScriptBuildPhase","hash","objects","PBXShellScriptBuildPhase","bundleReactNative","Object","values","find","buildPhase","name","ensureBundleReactNativePhaseContainsConfigurationScript","buildPhaseShellScriptPath","isShellScriptBuildPhaseConfigured","shellScript","includes","RegExp","isPlistConfigurationSet","Boolean","EXUpdatesURL","EXUpdatesSDKVersion","EXUpdatesRuntimeVersion","isPlistConfigurationSynced","EXUpdatesEnabled","EXUpdatesLaunchWaitMs","EXUpdatesCheckOnLaunch","EXUpdatesCodeSigningCertificate","EXUpdatesCodeSigningMetadata","isPlistVersionConfigurationSynced","expectedRuntimeVersion","expectedSdkVersion","currentRuntimeVersion","currentSdkVersion"],"sources":["../../src/ios/Updates.ts"],"sourcesContent":["import * as path from 'path';\nimport resolveFrom from 'resolve-from';\nimport xcode from 'xcode';\n\nimport { ConfigPlugin } from '../Plugin.types';\nimport { withExpoPlist } from '../plugins/ios-plugins';\nimport {\n ExpoConfigUpdates,\n getExpoUpdatesPackageVersion,\n getRuntimeVersionNullable,\n getSDKVersion,\n getUpdatesCheckOnLaunch,\n getUpdatesCodeSigningCertificate,\n getUpdatesCodeSigningMetadata,\n getUpdatesRequestHeaders,\n getUpdatesEnabled,\n getUpdatesTimeout,\n getUpdateUrl,\n} from '../utils/Updates';\nimport { ExpoPlist } from './IosConfig.types';\n\nconst CREATE_MANIFEST_IOS_PATH = 'expo-updates/scripts/create-manifest-ios.sh';\n\nexport enum Config {\n ENABLED = 'EXUpdatesEnabled',\n CHECK_ON_LAUNCH = 'EXUpdatesCheckOnLaunch',\n LAUNCH_WAIT_MS = 'EXUpdatesLaunchWaitMs',\n RUNTIME_VERSION = 'EXUpdatesRuntimeVersion',\n SDK_VERSION = 'EXUpdatesSDKVersion',\n UPDATE_URL = 'EXUpdatesURL',\n RELEASE_CHANNEL = 'EXUpdatesReleaseChannel',\n UPDATES_CONFIGURATION_REQUEST_HEADERS_KEY = 'EXUpdatesRequestHeaders',\n CODE_SIGNING_CERTIFICATE = 'EXUpdatesCodeSigningCertificate',\n CODE_SIGNING_METADATA = 'EXUpdatesCodeSigningMetadata',\n}\n\nexport const withUpdates: ConfigPlugin<{ expoUsername: string | null }> = (\n config,\n { expoUsername }\n) => {\n return withExpoPlist(config, (config) => {\n const projectRoot = config.modRequest.projectRoot;\n const expoUpdatesPackageVersion = getExpoUpdatesPackageVersion(projectRoot);\n config.modResults = setUpdatesConfig(\n projectRoot,\n config,\n config.modResults,\n expoUsername,\n expoUpdatesPackageVersion\n );\n return config;\n });\n};\n\nexport function setUpdatesConfig(\n projectRoot: string,\n config: ExpoConfigUpdates,\n expoPlist: ExpoPlist,\n username: string | null,\n expoUpdatesPackageVersion?: string | null\n): ExpoPlist {\n const newExpoPlist = {\n ...expoPlist,\n [Config.ENABLED]: getUpdatesEnabled(config),\n [Config.CHECK_ON_LAUNCH]: getUpdatesCheckOnLaunch(config, expoUpdatesPackageVersion),\n [Config.LAUNCH_WAIT_MS]: getUpdatesTimeout(config),\n };\n\n const updateUrl = getUpdateUrl(config, username);\n if (updateUrl) {\n newExpoPlist[Config.UPDATE_URL] = updateUrl;\n } else {\n delete newExpoPlist[Config.UPDATE_URL];\n }\n\n const codeSigningCertificate = getUpdatesCodeSigningCertificate(projectRoot, config);\n if (codeSigningCertificate) {\n newExpoPlist[Config.CODE_SIGNING_CERTIFICATE] = codeSigningCertificate;\n } else {\n delete newExpoPlist[Config.CODE_SIGNING_CERTIFICATE];\n }\n\n const codeSigningMetadata = getUpdatesCodeSigningMetadata(config);\n if (codeSigningMetadata) {\n newExpoPlist[Config.CODE_SIGNING_METADATA] = codeSigningMetadata;\n } else {\n delete newExpoPlist[Config.CODE_SIGNING_METADATA];\n }\n\n const requestHeaders = getUpdatesRequestHeaders(config);\n if (requestHeaders) {\n newExpoPlist[Config.UPDATES_CONFIGURATION_REQUEST_HEADERS_KEY] = requestHeaders;\n } else {\n delete newExpoPlist[Config.UPDATES_CONFIGURATION_REQUEST_HEADERS_KEY];\n }\n\n return setVersionsConfig(config, newExpoPlist);\n}\n\nexport function setVersionsConfig(config: ExpoConfigUpdates, expoPlist: ExpoPlist): ExpoPlist {\n const newExpoPlist = { ...expoPlist };\n\n const runtimeVersion = getRuntimeVersionNullable(config, 'ios');\n if (!runtimeVersion && expoPlist[Config.RUNTIME_VERSION]) {\n throw new Error(\n 'A runtime version is set in your Expo.plist, but is missing from your app.json/app.config.js. Please either set runtimeVersion in your app.json/app.config.js or remove EXUpdatesRuntimeVersion from your Expo.plist.'\n );\n }\n const sdkVersion = getSDKVersion(config);\n if (runtimeVersion) {\n delete newExpoPlist[Config.SDK_VERSION];\n newExpoPlist[Config.RUNTIME_VERSION] = runtimeVersion;\n } else if (sdkVersion) {\n /**\n * runtime version maybe null in projects using classic updates. In that\n * case we use SDK version\n */\n delete newExpoPlist[Config.RUNTIME_VERSION];\n newExpoPlist[Config.SDK_VERSION] = sdkVersion;\n } else {\n delete newExpoPlist[Config.SDK_VERSION];\n delete newExpoPlist[Config.RUNTIME_VERSION];\n }\n\n return newExpoPlist;\n}\n\nfunction formatConfigurationScriptPath(projectRoot: string): string {\n const buildScriptPath = resolveFrom.silent(projectRoot, CREATE_MANIFEST_IOS_PATH);\n\n if (!buildScriptPath) {\n throw new Error(\n \"Could not find the build script for iOS. This could happen in case of outdated 'node_modules'. Run 'npm install' to make sure that it's up-to-date.\"\n );\n }\n\n const relativePath = path.relative(path.join(projectRoot, 'ios'), buildScriptPath);\n return process.platform === 'win32' ? relativePath.replace(/\\\\/g, '/') : relativePath;\n}\n\ninterface ShellScriptBuildPhase {\n isa: 'PBXShellScriptBuildPhase';\n name: string;\n shellScript: string;\n [key: string]: any;\n}\n\nexport function getBundleReactNativePhase(project: xcode.XcodeProject): ShellScriptBuildPhase {\n const shellScriptBuildPhase = project.hash.project.objects.PBXShellScriptBuildPhase as Record<\n string,\n ShellScriptBuildPhase\n >;\n const bundleReactNative = Object.values(shellScriptBuildPhase).find(\n (buildPhase) => buildPhase.name === '\"Bundle React Native code and images\"'\n );\n\n if (!bundleReactNative) {\n throw new Error(`Couldn't find a build phase \"Bundle React Native code and images\"`);\n }\n\n return bundleReactNative;\n}\n\nexport function ensureBundleReactNativePhaseContainsConfigurationScript(\n projectRoot: string,\n project: xcode.XcodeProject\n): xcode.XcodeProject {\n const bundleReactNative = getBundleReactNativePhase(project);\n const buildPhaseShellScriptPath = formatConfigurationScriptPath(projectRoot);\n\n if (!isShellScriptBuildPhaseConfigured(projectRoot, project)) {\n // check if there's already another path to create-manifest-ios.sh\n // this might be the case for monorepos\n if (bundleReactNative.shellScript.includes(CREATE_MANIFEST_IOS_PATH)) {\n bundleReactNative.shellScript = bundleReactNative.shellScript.replace(\n new RegExp(`(\\\\\\\\n)(\\\\.\\\\.)+/node_modules/${CREATE_MANIFEST_IOS_PATH}`),\n ''\n );\n }\n bundleReactNative.shellScript = `${bundleReactNative.shellScript.replace(\n /\"$/,\n ''\n )}${buildPhaseShellScriptPath}\\\\n\"`;\n }\n return project;\n}\n\nexport function isShellScriptBuildPhaseConfigured(\n projectRoot: string,\n project: xcode.XcodeProject\n): boolean {\n const bundleReactNative = getBundleReactNativePhase(project);\n const buildPhaseShellScriptPath = formatConfigurationScriptPath(projectRoot);\n return bundleReactNative.shellScript.includes(buildPhaseShellScriptPath);\n}\n\nexport function isPlistConfigurationSet(expoPlist: ExpoPlist): boolean {\n return Boolean(\n expoPlist.EXUpdatesURL && (expoPlist.EXUpdatesSDKVersion || expoPlist.EXUpdatesRuntimeVersion)\n );\n}\n\nexport function isPlistConfigurationSynced(\n projectRoot: string,\n config: ExpoConfigUpdates,\n expoPlist: ExpoPlist,\n username: string | null\n): boolean {\n return (\n getUpdateUrl(config, username) === expoPlist.EXUpdatesURL &&\n getUpdatesEnabled(config) === expoPlist.EXUpdatesEnabled &&\n getUpdatesTimeout(config) === expoPlist.EXUpdatesLaunchWaitMs &&\n getUpdatesCheckOnLaunch(config) === expoPlist.EXUpdatesCheckOnLaunch &&\n getUpdatesCodeSigningCertificate(projectRoot, config) ===\n expoPlist.EXUpdatesCodeSigningCertificate &&\n getUpdatesCodeSigningMetadata(config) === expoPlist.EXUpdatesCodeSigningMetadata &&\n isPlistVersionConfigurationSynced(config, expoPlist)\n );\n}\n\nexport function isPlistVersionConfigurationSynced(\n config: Pick<ExpoConfigUpdates, 'sdkVersion' | 'runtimeVersion'>,\n expoPlist: ExpoPlist\n): boolean {\n const expectedRuntimeVersion = getRuntimeVersionNullable(config, 'ios');\n const expectedSdkVersion = getSDKVersion(config);\n\n const currentRuntimeVersion = expoPlist.EXUpdatesRuntimeVersion ?? null;\n const currentSdkVersion = expoPlist.EXUpdatesSDKVersion ?? null;\n\n if (expectedRuntimeVersion !== null) {\n return currentRuntimeVersion === expectedRuntimeVersion && currentSdkVersion === null;\n } else if (expectedSdkVersion !== null) {\n return currentSdkVersion === expectedSdkVersion && currentRuntimeVersion === null;\n } else {\n return true;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAIA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAY0B;AAAA;AAAA;AAG1B,MAAMA,wBAAwB,GAAG,6CAA6C;AAAC,IAEnEC,MAAM;AAAA;AAAA,WAANA,MAAM;EAANA,MA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AM,CAAC,KAAKS,SAAS,CAACiE,qBAAqB,IAC7D,IAAA3D,kCAAuB,EAACf,MAAM,CAAC,KAAKS,SAAS,CAACkE,sBAAsB,IACpE,IAAArD,2CAAgC,EAACnB,WAAW,EAAEH,MAAM,CAAC,KACnDS,SAAS,CAACmE,+BAA+B,IAC3C,IAAAnD,wCAA6B,EAACzB,MAAM,CAAC,KAAKS,SAAS,CAACoE,4BAA4B,IAChFC,iCAAiC,CAAC9E,MAAM,EAAES,SAAS,CAAC;AAExD;AAEO,SAASqE,iCAAiC,CAC/C9E,MAAgE,EAChES,SAAoB,EACX;EAAA;EACT,MAAMsE,sBAAsB,GAAG,IAAA/C,oCAAyB,EAAChC,MAAM,EAAE,KAAK,CAAC;EACvE,MAAMgF,kBAAkB,GAAG,IAAA5C,wBAAa,EAACpC,MAAM,CAAC;EAEhD,MAAMiF,qBAAqB,4BAAGxE,SAAS,CAAC8D,uBAAuB,yEAAI,IAAI;EACvE,MAAMW,iBAAiB,4BAAGzE,SAAS,CAAC6D,mBAAmB,yEAAI,IAAI;EAE/D,IAAIS,sBAAsB,KAAK,IAAI,EAAE;IACnC,OAAOE,qBAAqB,KAAKF,sBAAsB,IAAIG,iBAAiB,KAAK,IAAI;EACvF,CAAC,MAAM,IAAIF,kBAAkB,KAAK,IAAI,EAAE;IACtC,OAAOE,iBAAiB,KAAKF,kBAAkB,IAAIC,qBAAqB,KAAK,IAAI;EACnF,CAAC,MAAM;IACL,OAAO,IAAI;EACb;AACF"}
|
|
1
|
+
{"version":3,"file":"Updates.js","names":["path","data","_interopRequireWildcard","require","_resolveFrom","_interopRequireDefault","_iosPlugins","_Updates","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","CREATE_MANIFEST_IOS_PATH","Config","exports","withUpdates","config","expoUsername","withExpoPlist","projectRoot","modRequest","expoUpdatesPackageVersion","getExpoUpdatesPackageVersion","modResults","setUpdatesConfig","expoPlist","username","newExpoPlist","ENABLED","getUpdatesEnabled","CHECK_ON_LAUNCH","getUpdatesCheckOnLaunch","LAUNCH_WAIT_MS","getUpdatesTimeout","updateUrl","getUpdateUrl","UPDATE_URL","codeSigningCertificate","getUpdatesCodeSigningCertificate","CODE_SIGNING_CERTIFICATE","codeSigningMetadata","getUpdatesCodeSigningMetadata","CODE_SIGNING_METADATA","requestHeaders","getUpdatesRequestHeaders","UPDATES_CONFIGURATION_REQUEST_HEADERS_KEY","setVersionsConfig","runtimeVersion","getRuntimeVersionNullable","RUNTIME_VERSION","Error","sdkVersion","getSDKVersion","SDK_VERSION","formatConfigurationScriptPath","buildScriptPath","resolveFrom","silent","relativePath","relative","join","process","platform","replace","getBundleReactNativePhase","project","shellScriptBuildPhase","hash","objects","PBXShellScriptBuildPhase","bundleReactNative","values","find","buildPhase","name","ensureBundleReactNativePhaseContainsConfigurationScript","buildPhaseShellScriptPath","isShellScriptBuildPhaseConfigured","shellScript","includes","RegExp","isPlistConfigurationSet","Boolean","EXUpdatesURL","EXUpdatesSDKVersion","EXUpdatesRuntimeVersion","isPlistConfigurationSynced","EXUpdatesEnabled","EXUpdatesLaunchWaitMs","EXUpdatesCheckOnLaunch","EXUpdatesCodeSigningCertificate","EXUpdatesCodeSigningMetadata","isPlistVersionConfigurationSynced","_expoPlist$EXUpdatesR","_expoPlist$EXUpdatesS","expectedRuntimeVersion","expectedSdkVersion","currentRuntimeVersion","currentSdkVersion"],"sources":["../../src/ios/Updates.ts"],"sourcesContent":["import * as path from 'path';\nimport resolveFrom from 'resolve-from';\nimport xcode from 'xcode';\n\nimport { ConfigPlugin } from '../Plugin.types';\nimport { withExpoPlist } from '../plugins/ios-plugins';\nimport {\n ExpoConfigUpdates,\n getExpoUpdatesPackageVersion,\n getRuntimeVersionNullable,\n getSDKVersion,\n getUpdatesCheckOnLaunch,\n getUpdatesCodeSigningCertificate,\n getUpdatesCodeSigningMetadata,\n getUpdatesRequestHeaders,\n getUpdatesEnabled,\n getUpdatesTimeout,\n getUpdateUrl,\n} from '../utils/Updates';\nimport { ExpoPlist } from './IosConfig.types';\n\nconst CREATE_MANIFEST_IOS_PATH = 'expo-updates/scripts/create-manifest-ios.sh';\n\nexport enum Config {\n ENABLED = 'EXUpdatesEnabled',\n CHECK_ON_LAUNCH = 'EXUpdatesCheckOnLaunch',\n LAUNCH_WAIT_MS = 'EXUpdatesLaunchWaitMs',\n RUNTIME_VERSION = 'EXUpdatesRuntimeVersion',\n SDK_VERSION = 'EXUpdatesSDKVersion',\n UPDATE_URL = 'EXUpdatesURL',\n RELEASE_CHANNEL = 'EXUpdatesReleaseChannel',\n UPDATES_CONFIGURATION_REQUEST_HEADERS_KEY = 'EXUpdatesRequestHeaders',\n CODE_SIGNING_CERTIFICATE = 'EXUpdatesCodeSigningCertificate',\n CODE_SIGNING_METADATA = 'EXUpdatesCodeSigningMetadata',\n}\n\nexport const withUpdates: ConfigPlugin<{ expoUsername: string | null }> = (\n config,\n { expoUsername }\n) => {\n return withExpoPlist(config, (config) => {\n const projectRoot = config.modRequest.projectRoot;\n const expoUpdatesPackageVersion = getExpoUpdatesPackageVersion(projectRoot);\n config.modResults = setUpdatesConfig(\n projectRoot,\n config,\n config.modResults,\n expoUsername,\n expoUpdatesPackageVersion\n );\n return config;\n });\n};\n\nexport function setUpdatesConfig(\n projectRoot: string,\n config: ExpoConfigUpdates,\n expoPlist: ExpoPlist,\n username: string | null,\n expoUpdatesPackageVersion?: string | null\n): ExpoPlist {\n const newExpoPlist = {\n ...expoPlist,\n [Config.ENABLED]: getUpdatesEnabled(config, username),\n [Config.CHECK_ON_LAUNCH]: getUpdatesCheckOnLaunch(config, expoUpdatesPackageVersion),\n [Config.LAUNCH_WAIT_MS]: getUpdatesTimeout(config),\n };\n\n const updateUrl = getUpdateUrl(config, username);\n if (updateUrl) {\n newExpoPlist[Config.UPDATE_URL] = updateUrl;\n } else {\n delete newExpoPlist[Config.UPDATE_URL];\n }\n\n const codeSigningCertificate = getUpdatesCodeSigningCertificate(projectRoot, config);\n if (codeSigningCertificate) {\n newExpoPlist[Config.CODE_SIGNING_CERTIFICATE] = codeSigningCertificate;\n } else {\n delete newExpoPlist[Config.CODE_SIGNING_CERTIFICATE];\n }\n\n const codeSigningMetadata = getUpdatesCodeSigningMetadata(config);\n if (codeSigningMetadata) {\n newExpoPlist[Config.CODE_SIGNING_METADATA] = codeSigningMetadata;\n } else {\n delete newExpoPlist[Config.CODE_SIGNING_METADATA];\n }\n\n const requestHeaders = getUpdatesRequestHeaders(config);\n if (requestHeaders) {\n newExpoPlist[Config.UPDATES_CONFIGURATION_REQUEST_HEADERS_KEY] = requestHeaders;\n } else {\n delete newExpoPlist[Config.UPDATES_CONFIGURATION_REQUEST_HEADERS_KEY];\n }\n\n return setVersionsConfig(config, newExpoPlist);\n}\n\nexport function setVersionsConfig(config: ExpoConfigUpdates, expoPlist: ExpoPlist): ExpoPlist {\n const newExpoPlist = { ...expoPlist };\n\n const runtimeVersion = getRuntimeVersionNullable(config, 'ios');\n if (!runtimeVersion && expoPlist[Config.RUNTIME_VERSION]) {\n throw new Error(\n 'A runtime version is set in your Expo.plist, but is missing from your app.json/app.config.js. Please either set runtimeVersion in your app.json/app.config.js or remove EXUpdatesRuntimeVersion from your Expo.plist.'\n );\n }\n const sdkVersion = getSDKVersion(config);\n if (runtimeVersion) {\n delete newExpoPlist[Config.SDK_VERSION];\n newExpoPlist[Config.RUNTIME_VERSION] = runtimeVersion;\n } else if (sdkVersion) {\n /**\n * runtime version maybe null in projects using classic updates. In that\n * case we use SDK version\n */\n delete newExpoPlist[Config.RUNTIME_VERSION];\n newExpoPlist[Config.SDK_VERSION] = sdkVersion;\n } else {\n delete newExpoPlist[Config.SDK_VERSION];\n delete newExpoPlist[Config.RUNTIME_VERSION];\n }\n\n return newExpoPlist;\n}\n\nfunction formatConfigurationScriptPath(projectRoot: string): string {\n const buildScriptPath = resolveFrom.silent(projectRoot, CREATE_MANIFEST_IOS_PATH);\n\n if (!buildScriptPath) {\n throw new Error(\n \"Could not find the build script for iOS. This could happen in case of outdated 'node_modules'. Run 'npm install' to make sure that it's up-to-date.\"\n );\n }\n\n const relativePath = path.relative(path.join(projectRoot, 'ios'), buildScriptPath);\n return process.platform === 'win32' ? relativePath.replace(/\\\\/g, '/') : relativePath;\n}\n\ninterface ShellScriptBuildPhase {\n isa: 'PBXShellScriptBuildPhase';\n name: string;\n shellScript: string;\n [key: string]: any;\n}\n\nexport function getBundleReactNativePhase(project: xcode.XcodeProject): ShellScriptBuildPhase {\n const shellScriptBuildPhase = project.hash.project.objects.PBXShellScriptBuildPhase as Record<\n string,\n ShellScriptBuildPhase\n >;\n const bundleReactNative = Object.values(shellScriptBuildPhase).find(\n (buildPhase) => buildPhase.name === '\"Bundle React Native code and images\"'\n );\n\n if (!bundleReactNative) {\n throw new Error(`Couldn't find a build phase \"Bundle React Native code and images\"`);\n }\n\n return bundleReactNative;\n}\n\nexport function ensureBundleReactNativePhaseContainsConfigurationScript(\n projectRoot: string,\n project: xcode.XcodeProject\n): xcode.XcodeProject {\n const bundleReactNative = getBundleReactNativePhase(project);\n const buildPhaseShellScriptPath = formatConfigurationScriptPath(projectRoot);\n\n if (!isShellScriptBuildPhaseConfigured(projectRoot, project)) {\n // check if there's already another path to create-manifest-ios.sh\n // this might be the case for monorepos\n if (bundleReactNative.shellScript.includes(CREATE_MANIFEST_IOS_PATH)) {\n bundleReactNative.shellScript = bundleReactNative.shellScript.replace(\n new RegExp(`(\\\\\\\\n)(\\\\.\\\\.)+/node_modules/${CREATE_MANIFEST_IOS_PATH}`),\n ''\n );\n }\n bundleReactNative.shellScript = `${bundleReactNative.shellScript.replace(\n /\"$/,\n ''\n )}${buildPhaseShellScriptPath}\\\\n\"`;\n }\n return project;\n}\n\nexport function isShellScriptBuildPhaseConfigured(\n projectRoot: string,\n project: xcode.XcodeProject\n): boolean {\n const bundleReactNative = getBundleReactNativePhase(project);\n const buildPhaseShellScriptPath = formatConfigurationScriptPath(projectRoot);\n return bundleReactNative.shellScript.includes(buildPhaseShellScriptPath);\n}\n\nexport function isPlistConfigurationSet(expoPlist: ExpoPlist): boolean {\n return Boolean(\n expoPlist.EXUpdatesURL && (expoPlist.EXUpdatesSDKVersion || expoPlist.EXUpdatesRuntimeVersion)\n );\n}\n\nexport function isPlistConfigurationSynced(\n projectRoot: string,\n config: ExpoConfigUpdates,\n expoPlist: ExpoPlist,\n username: string | null\n): boolean {\n return (\n getUpdateUrl(config, username) === expoPlist.EXUpdatesURL &&\n getUpdatesEnabled(config, username) === expoPlist.EXUpdatesEnabled &&\n getUpdatesTimeout(config) === expoPlist.EXUpdatesLaunchWaitMs &&\n getUpdatesCheckOnLaunch(config) === expoPlist.EXUpdatesCheckOnLaunch &&\n getUpdatesCodeSigningCertificate(projectRoot, config) ===\n expoPlist.EXUpdatesCodeSigningCertificate &&\n getUpdatesCodeSigningMetadata(config) === expoPlist.EXUpdatesCodeSigningMetadata &&\n isPlistVersionConfigurationSynced(config, expoPlist)\n );\n}\n\nexport function isPlistVersionConfigurationSynced(\n config: Pick<ExpoConfigUpdates, 'sdkVersion' | 'runtimeVersion'>,\n expoPlist: ExpoPlist\n): boolean {\n const expectedRuntimeVersion = getRuntimeVersionNullable(config, 'ios');\n const expectedSdkVersion = getSDKVersion(config);\n\n const currentRuntimeVersion = expoPlist.EXUpdatesRuntimeVersion ?? null;\n const currentSdkVersion = expoPlist.EXUpdatesSDKVersion ?? null;\n\n if (expectedRuntimeVersion !== null) {\n return currentRuntimeVersion === expectedRuntimeVersion && currentSdkVersion === null;\n } else if (expectedSdkVersion !== null) {\n return currentSdkVersion === expectedSdkVersion && currentRuntimeVersion === null;\n } else {\n return true;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;AAAA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,uBAAA,CAAAC,OAAA;EAAAH,IAAA,YAAAA,CAAA;IAAA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