@expo/config-plugins 56.0.9 → 56.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/Plugin.types.js +3 -9
- package/build/Plugin.types.js.map +1 -1
- package/build/android/AllowBackup.js +1 -3
- package/build/android/AllowBackup.js.map +1 -1
- package/build/android/BuildProperties.js +1 -3
- package/build/android/BuildProperties.js.map +1 -1
- package/build/android/Colors.js +1 -3
- package/build/android/Colors.js.map +1 -1
- package/build/android/EasBuild.js +1 -3
- package/build/android/EasBuild.js.map +1 -1
- package/build/android/EasBuildGradleScript.js +1 -3
- package/build/android/EasBuildGradleScript.js.map +1 -1
- package/build/android/GoogleMapsApiKey.js +1 -3
- package/build/android/GoogleMapsApiKey.js.map +1 -1
- package/build/android/GoogleServices.js +1 -3
- package/build/android/GoogleServices.js.map +1 -1
- package/build/android/IntentFilters.js +1 -3
- package/build/android/IntentFilters.js.map +1 -1
- package/build/android/Locales.js +13 -8
- package/build/android/Locales.js.map +1 -1
- package/build/android/Manifest.js +1 -3
- package/build/android/Manifest.js.map +1 -1
- package/build/android/Name.js +1 -3
- package/build/android/Name.js.map +1 -1
- package/build/android/Orientation.js +1 -3
- package/build/android/Orientation.js.map +1 -1
- package/build/android/Package.js +1 -3
- package/build/android/Package.js.map +1 -1
- package/build/android/Paths.js +1 -3
- package/build/android/Paths.js.map +1 -1
- package/build/android/Permissions.js +1 -3
- package/build/android/Permissions.js.map +1 -1
- package/build/android/PredictiveBackGesture.js +1 -3
- package/build/android/PredictiveBackGesture.js.map +1 -1
- package/build/android/PrimaryColor.js +1 -3
- package/build/android/PrimaryColor.js.map +1 -1
- package/build/android/Properties.js +1 -3
- package/build/android/Properties.js.map +1 -1
- package/build/android/Resources.js +1 -3
- package/build/android/Resources.js.map +1 -1
- package/build/android/Scheme.js +1 -3
- package/build/android/Scheme.js.map +1 -1
- package/build/android/Strings.js +1 -3
- package/build/android/Strings.js.map +1 -1
- package/build/android/Styles.js +1 -3
- package/build/android/Styles.js.map +1 -1
- package/build/android/SystemBars.js +1 -3
- package/build/android/SystemBars.js.map +1 -1
- package/build/android/Updates.js +1 -3
- package/build/android/Updates.js.map +1 -1
- package/build/android/Version.js +1 -3
- package/build/android/Version.js.map +1 -1
- package/build/android/WindowSoftInputMode.js +1 -3
- package/build/android/WindowSoftInputMode.js.map +1 -1
- package/build/android/codeMod.js +1 -3
- package/build/android/codeMod.js.map +1 -1
- package/build/android/index.js +1 -3
- package/build/android/index.js.map +1 -1
- package/build/index.js +44 -212
- package/build/index.js.map +1 -1
- package/build/ios/Bitcode.js +1 -3
- package/build/ios/Bitcode.js.map +1 -1
- package/build/ios/BuildProperties.js +1 -3
- package/build/ios/BuildProperties.js.map +1 -1
- package/build/ios/BuildScheme.js +1 -3
- package/build/ios/BuildScheme.js.map +1 -1
- package/build/ios/BundleIdentifier.js +1 -3
- package/build/ios/BundleIdentifier.js.map +1 -1
- package/build/ios/DeploymentTarget.js +1 -3
- package/build/ios/DeploymentTarget.js.map +1 -1
- package/build/ios/DevelopmentTeam.js +1 -3
- package/build/ios/DevelopmentTeam.js.map +1 -1
- package/build/ios/DeviceFamily.js +1 -3
- package/build/ios/DeviceFamily.js.map +1 -1
- package/build/ios/Entitlements.js +1 -3
- package/build/ios/Entitlements.js.map +1 -1
- package/build/ios/Google.js +1 -3
- package/build/ios/Google.js.map +1 -1
- package/build/ios/Locales.js +1 -3
- package/build/ios/Locales.js.map +1 -1
- package/build/ios/Maps.js +1 -3
- package/build/ios/Maps.js.map +1 -1
- package/build/ios/Name.js +1 -3
- package/build/ios/Name.js.map +1 -1
- package/build/ios/Orientation.js +1 -3
- package/build/ios/Orientation.js.map +1 -1
- package/build/ios/Paths.js +1 -3
- package/build/ios/Paths.js.map +1 -1
- package/build/ios/Permissions.js +1 -3
- package/build/ios/Permissions.js.map +1 -1
- package/build/ios/PrivacyInfo.js +1 -3
- package/build/ios/PrivacyInfo.js.map +1 -1
- package/build/ios/ProvisioningProfile.js +1 -3
- package/build/ios/ProvisioningProfile.js.map +1 -1
- package/build/ios/RequiresFullScreen.js +1 -3
- package/build/ios/RequiresFullScreen.js.map +1 -1
- package/build/ios/Scheme.js +1 -3
- package/build/ios/Scheme.js.map +1 -1
- package/build/ios/Target.js +1 -3
- package/build/ios/Target.js.map +1 -1
- package/build/ios/Updates.js +1 -3
- package/build/ios/Updates.js.map +1 -1
- package/build/ios/UsesNonExemptEncryption.js +1 -3
- package/build/ios/UsesNonExemptEncryption.js.map +1 -1
- package/build/ios/Version.js +1 -3
- package/build/ios/Version.js.map +1 -1
- package/build/ios/XcodeProjectFile.js +1 -3
- package/build/ios/XcodeProjectFile.js.map +1 -1
- package/build/ios/codeMod.js +1 -3
- package/build/ios/codeMod.js.map +1 -1
- package/build/ios/index.js +1 -3
- package/build/ios/utils/Xcodeproj.js +1 -3
- package/build/ios/utils/Xcodeproj.js.map +1 -1
- package/build/ios/utils/getInfoPlistPath.js +1 -3
- package/build/ios/utils/getInfoPlistPath.js.map +1 -1
- package/build/ios/utils/string.js +1 -3
- package/build/ios/utils/string.js.map +1 -1
- package/build/plugins/android-plugins.js +1 -3
- package/build/plugins/android-plugins.js.map +1 -1
- package/build/plugins/createBaseMod.js +1 -3
- package/build/plugins/createBaseMod.js.map +1 -1
- package/build/plugins/ios-plugins.js +1 -3
- package/build/plugins/ios-plugins.js.map +1 -1
- package/build/plugins/mod-compiler.js +1 -3
- package/build/plugins/mod-compiler.js.map +1 -1
- package/build/plugins/withAndroidBaseMods.js +1 -3
- package/build/plugins/withAndroidBaseMods.js.map +1 -1
- package/build/plugins/withDangerousMod.js +1 -3
- package/build/plugins/withDangerousMod.js.map +1 -1
- package/build/plugins/withFinalizedMod.js +1 -3
- package/build/plugins/withFinalizedMod.js.map +1 -1
- package/build/plugins/withIosBaseMods.js +1 -3
- package/build/plugins/withIosBaseMods.js.map +1 -1
- package/build/plugins/withMod.js +1 -3
- package/build/plugins/withMod.js.map +1 -1
- package/build/plugins/withPlugins.js +1 -3
- package/build/plugins/withPlugins.js.map +1 -1
- package/build/plugins/withRunOnce.js +1 -3
- package/build/plugins/withRunOnce.js.map +1 -1
- package/build/plugins/withStaticPlugin.js +1 -3
- package/build/plugins/withStaticPlugin.js.map +1 -1
- package/build/utils/Updates.js +1 -3
- package/build/utils/Updates.js.map +1 -1
- package/build/utils/XML.js +1 -3
- package/build/utils/XML.js.map +1 -1
- package/build/utils/commonCodeMod.js +1 -3
- package/build/utils/commonCodeMod.js.map +1 -1
- package/build/utils/errors.js +1 -3
- package/build/utils/errors.js.map +1 -1
- package/build/utils/fs.js +1 -3
- package/build/utils/fs.js.map +1 -1
- package/build/utils/generateCode.js +1 -3
- package/build/utils/generateCode.js.map +1 -1
- package/build/utils/glob.js +1 -3
- package/build/utils/glob.js.map +1 -1
- package/build/utils/history.js +1 -3
- package/build/utils/history.js.map +1 -1
- package/build/utils/locales.js +1 -3
- package/build/utils/locales.js.map +1 -1
- package/build/utils/matchBrackets.js +1 -3
- package/build/utils/matchBrackets.js.map +1 -1
- package/build/utils/modules.js +1 -3
- package/build/utils/modules.js.map +1 -1
- package/build/utils/obj.js +1 -3
- package/build/utils/obj.js.map +1 -1
- package/build/utils/plugin-resolver.js +1 -3
- package/build/utils/plugin-resolver.js.map +1 -1
- package/build/utils/sortObject.js +1 -3
- package/build/utils/sortObject.js.map +1 -1
- package/build/utils/validations.js +1 -3
- package/build/utils/validations.js.map +1 -1
- package/build/utils/warnings.js +1 -3
- package/build/utils/warnings.js.map +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeploymentTarget.js","names":["_BuildProperties","data","require","_Target","_iosPlugins","_Xcodeproj","withDeploymentTarget","config","withXcodeProject","deploymentTarget","getDeploymentTarget","modResults","updateDeploymentTargetForPbxproj","exports","withDeploymentTargetPodfileProps","createBuildPodfilePropsConfigPlugin","propName","propValueGetter","ios","setDeploymentTargetForBuildConfiguration","xcBuildConfiguration","buildSettings","IPHONEOS_DEPLOYMENT_TARGET","project","mainTarget","findFirstNativeTarget","getBuildConfigurationsForListId","buildConfigurationList","forEach","buildConfig"],"sources":["../../src/ios/DeploymentTarget.ts"],"sourcesContent":["import type { ExpoConfig } from '@expo/config-types';\nimport type { XCBuildConfiguration } from 'xcode';\n\nimport { createBuildPodfilePropsConfigPlugin } from './BuildProperties';\nimport { findFirstNativeTarget } from './Target';\nimport type { ConfigPlugin, XcodeProject } from '../Plugin.types';\nimport { withXcodeProject } from '../plugins/ios-plugins';\nimport { getBuildConfigurationsForListId } from './utils/Xcodeproj';\n\n/**\n * Set the iOS deployment target for all build configurations in the main application target.\n */\nexport const withDeploymentTarget: ConfigPlugin = (config) => {\n return withXcodeProject(config, (config) => {\n const deploymentTarget = getDeploymentTarget(config);\n if (deploymentTarget) {\n config.modResults = updateDeploymentTargetForPbxproj(config.modResults, deploymentTarget);\n }\n return config;\n });\n};\n\n/**\n * A config-plugin to update `ios/Podfile.properties.json` with the deployment target\n */\nexport const withDeploymentTargetPodfileProps = createBuildPodfilePropsConfigPlugin<ExpoConfig>(\n [\n {\n propName: 'ios.deploymentTarget',\n propValueGetter: (config) => config.ios?.deploymentTarget ?? null,\n },\n ],\n 'withDeploymentTargetPodfileProps'\n);\n\n/** Get the iOS deployment target from Expo config, if defined */\nexport function getDeploymentTarget(config: Pick<ExpoConfig, 'ios'>): string | null {\n return config.ios?.deploymentTarget ?? null;\n}\n\n/** Set the iOS deployment target for an XCBuildConfiguration object */\nexport function setDeploymentTargetForBuildConfiguration(\n xcBuildConfiguration: XCBuildConfiguration,\n deploymentTarget?: string\n): void {\n if (deploymentTarget) {\n xcBuildConfiguration.buildSettings.IPHONEOS_DEPLOYMENT_TARGET = deploymentTarget;\n }\n}\n\n/**\n * Update the iOS deployment target for all XCBuildConfiguration entries in the main application target.\n */\nexport function updateDeploymentTargetForPbxproj(\n project: XcodeProject,\n deploymentTarget: string\n): XcodeProject {\n const [, mainTarget] = findFirstNativeTarget(project);\n\n getBuildConfigurationsForListId(project, mainTarget.buildConfigurationList).forEach(\n ([, buildConfig]) => setDeploymentTargetForBuildConfiguration(buildConfig, deploymentTarget)\n );\n\n return project;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"DeploymentTarget.js","names":["_BuildProperties","data","require","_Target","_iosPlugins","_Xcodeproj","withDeploymentTarget","config","withXcodeProject","deploymentTarget","getDeploymentTarget","modResults","updateDeploymentTargetForPbxproj","exports","withDeploymentTargetPodfileProps","createBuildPodfilePropsConfigPlugin","propName","propValueGetter","ios","setDeploymentTargetForBuildConfiguration","xcBuildConfiguration","buildSettings","IPHONEOS_DEPLOYMENT_TARGET","project","mainTarget","findFirstNativeTarget","getBuildConfigurationsForListId","buildConfigurationList","forEach","buildConfig"],"sources":["../../src/ios/DeploymentTarget.ts"],"sourcesContent":["import type { ExpoConfig } from '@expo/config-types';\nimport type { XCBuildConfiguration } from 'xcode';\n\nimport { createBuildPodfilePropsConfigPlugin } from './BuildProperties';\nimport { findFirstNativeTarget } from './Target';\nimport type { ConfigPlugin, XcodeProject } from '../Plugin.types';\nimport { withXcodeProject } from '../plugins/ios-plugins';\nimport { getBuildConfigurationsForListId } from './utils/Xcodeproj';\n\n/**\n * Set the iOS deployment target for all build configurations in the main application target.\n */\nexport const withDeploymentTarget: ConfigPlugin = (config) => {\n return withXcodeProject(config, (config) => {\n const deploymentTarget = getDeploymentTarget(config);\n if (deploymentTarget) {\n config.modResults = updateDeploymentTargetForPbxproj(config.modResults, deploymentTarget);\n }\n return config;\n });\n};\n\n/**\n * A config-plugin to update `ios/Podfile.properties.json` with the deployment target\n */\nexport const withDeploymentTargetPodfileProps = createBuildPodfilePropsConfigPlugin<ExpoConfig>(\n [\n {\n propName: 'ios.deploymentTarget',\n propValueGetter: (config) => config.ios?.deploymentTarget ?? null,\n },\n ],\n 'withDeploymentTargetPodfileProps'\n);\n\n/** Get the iOS deployment target from Expo config, if defined */\nexport function getDeploymentTarget(config: Pick<ExpoConfig, 'ios'>): string | null {\n return config.ios?.deploymentTarget ?? null;\n}\n\n/** Set the iOS deployment target for an XCBuildConfiguration object */\nexport function setDeploymentTargetForBuildConfiguration(\n xcBuildConfiguration: XCBuildConfiguration,\n deploymentTarget?: string\n): void {\n if (deploymentTarget) {\n xcBuildConfiguration.buildSettings.IPHONEOS_DEPLOYMENT_TARGET = deploymentTarget;\n }\n}\n\n/**\n * Update the iOS deployment target for all XCBuildConfiguration entries in the main application target.\n */\nexport function updateDeploymentTargetForPbxproj(\n project: XcodeProject,\n deploymentTarget: string\n): XcodeProject {\n const [, mainTarget] = findFirstNativeTarget(project);\n\n getBuildConfigurationsForListId(project, mainTarget.buildConfigurationList).forEach(\n ([, buildConfig]) => setDeploymentTargetForBuildConfiguration(buildConfig, deploymentTarget)\n );\n\n return project;\n}\n"],"mappings":";;;;;;;AAGA,SAAAA,iBAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,gBAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,QAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAG,YAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,WAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,WAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,UAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA;AACA;AACA;AACO,MAAMK,oBAAkC,GAAIC,MAAM,IAAK;EAC5D,OAAO,IAAAC,8BAAgB,EAACD,MAAM,EAAGA,MAAM,IAAK;IAC1C,MAAME,gBAAgB,GAAGC,mBAAmB,CAACH,MAAM,CAAC;IACpD,IAAIE,gBAAgB,EAAE;MACpBF,MAAM,CAACI,UAAU,GAAGC,gCAAgC,CAACL,MAAM,CAACI,UAAU,EAAEF,gBAAgB,CAAC;IAC3F;IACA,OAAOF,MAAM;EACf,CAAC,CAAC;AACJ,CAAC;;AAED;AACA;AACA;AAFAM,OAAA,CAAAP,oBAAA,GAAAA,oBAAA;AAGO,MAAMQ,gCAAgC,GAAAD,OAAA,CAAAC,gCAAA,GAAG,IAAAC,sDAAmC,EACjF,CACE;EACEC,QAAQ,EAAE,sBAAsB;EAChCC,eAAe,EAAGV,MAAM,IAAKA,MAAM,CAACW,GAAG,EAAET,gBAAgB,IAAI;AAC/D,CAAC,CACF,EACD,kCACF,CAAC;;AAED;AACO,SAASC,mBAAmBA,CAACH,MAA+B,EAAiB;EAClF,OAAOA,MAAM,CAACW,GAAG,EAAET,gBAAgB,IAAI,IAAI;AAC7C;;AAEA;AACO,SAASU,wCAAwCA,CACtDC,oBAA0C,EAC1CX,gBAAyB,EACnB;EACN,IAAIA,gBAAgB,EAAE;IACpBW,oBAAoB,CAACC,aAAa,CAACC,0BAA0B,GAAGb,gBAAgB;EAClF;AACF;;AAEA;AACA;AACA;AACO,SAASG,gCAAgCA,CAC9CW,OAAqB,EACrBd,gBAAwB,EACV;EACd,MAAM,GAAGe,UAAU,CAAC,GAAG,IAAAC,+BAAqB,EAACF,OAAO,CAAC;EAErD,IAAAG,4CAA+B,EAACH,OAAO,EAAEC,UAAU,CAACG,sBAAsB,CAAC,CAACC,OAAO,CACjF,CAAC,GAAGC,WAAW,CAAC,KAAKV,wCAAwC,CAACU,WAAW,EAAEpB,gBAAgB,CAC7F,CAAC;EAED,OAAOc,OAAO;AAChB","ignoreList":[]}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
3
|
+
exports.__esModule = true;
|
|
6
4
|
exports.getDevelopmentTeam = getDevelopmentTeam;
|
|
7
5
|
exports.setDevelopmentTeamForBuildConfiguration = setDevelopmentTeamForBuildConfiguration;
|
|
8
6
|
exports.setDevelopmentTeamForPbxproj = setDevelopmentTeamForPbxproj;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DevelopmentTeam.js","names":["_nodeFs","data","_interopRequireDefault","require","_xcode","_Paths","_Target","_Xcodeproj","_string","_iosPlugins","e","__esModule","default","withDevelopmentTeam","config","appleTeamId","withXcodeProject","teamId","getDevelopmentTeam","modResults","updateDevelopmentTeamForPbxproj","exports","ios","setDevelopmentTeamForBuildConfiguration","xcBuildConfiguration","developmentTeam","buildSettings","DEVELOPMENT_TEAM","trimQuotes","project","nativeTargets","getNativeTargets","forEach","nativeTarget","getBuildConfigurationsForListId","buildConfigurationList","buildConfig","setDevelopmentTeamForPbxproj","projectRoot","pbxprojPaths","getAllPBXProjectPaths","pbxprojPath","xcode","parseSync","fs","writeFileSync","writeSync"],"sources":["../../src/ios/DevelopmentTeam.ts"],"sourcesContent":["import type { ExpoConfig } from '@expo/config-types';\nimport fs from 'node:fs';\nimport xcode, { type XCBuildConfiguration } from 'xcode';\n\nimport { getAllPBXProjectPaths } from './Paths';\nimport { getNativeTargets } from './Target';\nimport type { ConfigPlugin, XcodeProject } from '../Plugin.types';\nimport { getBuildConfigurationsForListId } from './utils/Xcodeproj';\nimport { trimQuotes } from './utils/string';\nimport { withXcodeProject } from '../plugins/ios-plugins';\n\n/**\n * Set the Apple development team ID for all build configurations using the first native target.\n */\nexport const withDevelopmentTeam: ConfigPlugin<{ appleTeamId?: string } | void> = (\n config,\n { appleTeamId } = {}\n) => {\n return withXcodeProject(config, (config) => {\n const teamId = appleTeamId ?? getDevelopmentTeam(config);\n if (teamId) {\n config.modResults = updateDevelopmentTeamForPbxproj(config.modResults, teamId);\n }\n\n return config;\n });\n};\n\n/** Get the Apple development team ID from Expo config, if defined */\nexport function getDevelopmentTeam(config: Pick<ExpoConfig, 'ios'>): string | null {\n return config.ios?.appleTeamId ?? null;\n}\n\n/** Set the Apple development team ID for an XCBuildConfiguration object */\nexport function setDevelopmentTeamForBuildConfiguration(\n xcBuildConfiguration: XCBuildConfiguration,\n developmentTeam?: string\n): void {\n if (developmentTeam) {\n xcBuildConfiguration.buildSettings.DEVELOPMENT_TEAM = trimQuotes(developmentTeam);\n } else {\n delete xcBuildConfiguration.buildSettings.DEVELOPMENT_TEAM;\n }\n}\n\n/**\n * Update the Apple development team ID for all XCBuildConfiguration entries, in all native targets.\n *\n * A development team is stored as a value in XCBuildConfiguration entry.\n * Those entries exist for every pair (build target, build configuration).\n * Unless target name is passed, the first target defined in the pbxproj is used\n * (to keep compatibility with the inaccurate legacy implementation of this function).\n */\nexport function updateDevelopmentTeamForPbxproj(\n project: XcodeProject,\n appleTeamId?: string\n): XcodeProject {\n const nativeTargets = getNativeTargets(project);\n\n nativeTargets.forEach(([, nativeTarget]) => {\n getBuildConfigurationsForListId(project, nativeTarget.buildConfigurationList).forEach(\n ([, buildConfig]) => setDevelopmentTeamForBuildConfiguration(buildConfig, appleTeamId)\n );\n });\n\n return project;\n}\n\n/**\n * Updates the Apple development team ID for pbx projects inside the ios directory of the given project root\n *\n * @param {string} projectRoot Path to project root containing the ios directory\n * @param {[string]} appleTeamId Desired Apple development team ID\n */\nexport function setDevelopmentTeamForPbxproj(projectRoot: string, appleTeamId?: string): void {\n // Get all pbx projects in the ${projectRoot}/ios directory\n const pbxprojPaths = getAllPBXProjectPaths(projectRoot);\n\n for (const pbxprojPath of pbxprojPaths) {\n let project = xcode.project(pbxprojPath);\n project.parseSync();\n project = updateDevelopmentTeamForPbxproj(project, appleTeamId);\n fs.writeFileSync(pbxprojPath, project.writeSync());\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"DevelopmentTeam.js","names":["_nodeFs","data","_interopRequireDefault","require","_xcode","_Paths","_Target","_Xcodeproj","_string","_iosPlugins","e","__esModule","default","withDevelopmentTeam","config","appleTeamId","withXcodeProject","teamId","getDevelopmentTeam","modResults","updateDevelopmentTeamForPbxproj","exports","ios","setDevelopmentTeamForBuildConfiguration","xcBuildConfiguration","developmentTeam","buildSettings","DEVELOPMENT_TEAM","trimQuotes","project","nativeTargets","getNativeTargets","forEach","nativeTarget","getBuildConfigurationsForListId","buildConfigurationList","buildConfig","setDevelopmentTeamForPbxproj","projectRoot","pbxprojPaths","getAllPBXProjectPaths","pbxprojPath","xcode","parseSync","fs","writeFileSync","writeSync"],"sources":["../../src/ios/DevelopmentTeam.ts"],"sourcesContent":["import type { ExpoConfig } from '@expo/config-types';\nimport fs from 'node:fs';\nimport xcode, { type XCBuildConfiguration } from 'xcode';\n\nimport { getAllPBXProjectPaths } from './Paths';\nimport { getNativeTargets } from './Target';\nimport type { ConfigPlugin, XcodeProject } from '../Plugin.types';\nimport { getBuildConfigurationsForListId } from './utils/Xcodeproj';\nimport { trimQuotes } from './utils/string';\nimport { withXcodeProject } from '../plugins/ios-plugins';\n\n/**\n * Set the Apple development team ID for all build configurations using the first native target.\n */\nexport const withDevelopmentTeam: ConfigPlugin<{ appleTeamId?: string } | void> = (\n config,\n { appleTeamId } = {}\n) => {\n return withXcodeProject(config, (config) => {\n const teamId = appleTeamId ?? getDevelopmentTeam(config);\n if (teamId) {\n config.modResults = updateDevelopmentTeamForPbxproj(config.modResults, teamId);\n }\n\n return config;\n });\n};\n\n/** Get the Apple development team ID from Expo config, if defined */\nexport function getDevelopmentTeam(config: Pick<ExpoConfig, 'ios'>): string | null {\n return config.ios?.appleTeamId ?? null;\n}\n\n/** Set the Apple development team ID for an XCBuildConfiguration object */\nexport function setDevelopmentTeamForBuildConfiguration(\n xcBuildConfiguration: XCBuildConfiguration,\n developmentTeam?: string\n): void {\n if (developmentTeam) {\n xcBuildConfiguration.buildSettings.DEVELOPMENT_TEAM = trimQuotes(developmentTeam);\n } else {\n delete xcBuildConfiguration.buildSettings.DEVELOPMENT_TEAM;\n }\n}\n\n/**\n * Update the Apple development team ID for all XCBuildConfiguration entries, in all native targets.\n *\n * A development team is stored as a value in XCBuildConfiguration entry.\n * Those entries exist for every pair (build target, build configuration).\n * Unless target name is passed, the first target defined in the pbxproj is used\n * (to keep compatibility with the inaccurate legacy implementation of this function).\n */\nexport function updateDevelopmentTeamForPbxproj(\n project: XcodeProject,\n appleTeamId?: string\n): XcodeProject {\n const nativeTargets = getNativeTargets(project);\n\n nativeTargets.forEach(([, nativeTarget]) => {\n getBuildConfigurationsForListId(project, nativeTarget.buildConfigurationList).forEach(\n ([, buildConfig]) => setDevelopmentTeamForBuildConfiguration(buildConfig, appleTeamId)\n );\n });\n\n return project;\n}\n\n/**\n * Updates the Apple development team ID for pbx projects inside the ios directory of the given project root\n *\n * @param {string} projectRoot Path to project root containing the ios directory\n * @param {[string]} appleTeamId Desired Apple development team ID\n */\nexport function setDevelopmentTeamForPbxproj(projectRoot: string, appleTeamId?: string): void {\n // Get all pbx projects in the ${projectRoot}/ios directory\n const pbxprojPaths = getAllPBXProjectPaths(projectRoot);\n\n for (const pbxprojPath of pbxprojPaths) {\n let project = xcode.project(pbxprojPath);\n project.parseSync();\n project = updateDevelopmentTeamForPbxproj(project, appleTeamId);\n fs.writeFileSync(pbxprojPath, project.writeSync());\n }\n}\n"],"mappings":";;;;;;;;AACA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,OAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAC,MAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAI,OAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,MAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,QAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,OAAA,YAAAA,C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AAG,IAAAC,oBAAU,EAACH,eAAe,CAAC;EACnF,CAAC,MAAM;IACL,OAAOD,oBAAoB,CAACE,aAAa,CAACC,gBAAgB;EAC5D;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASP,+BAA+BA,CAC7CS,OAAqB,EACrBd,WAAoB,EACN;EACd,MAAMe,aAAa,GAAG,IAAAC,0BAAgB,EAACF,OAAO,CAAC;EAE/CC,aAAa,CAACE,OAAO,CAAC,CAAC,GAAGC,YAAY,CAAC,KAAK;IAC1C,IAAAC,4CAA+B,EAACL,OAAO,EAAEI,YAAY,CAACE,sBAAsB,CAAC,CAACH,OAAO,CACnF,CAAC,GAAGI,WAAW,CAAC,KAAKb,uCAAuC,CAACa,WAAW,EAAErB,WAAW,CACvF,CAAC;EACH,CAAC,CAAC;EAEF,OAAOc,OAAO;AAChB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,SAASQ,4BAA4BA,CAACC,WAAmB,EAAEvB,WAAoB,EAAQ;EAC5F;EACA,MAAMwB,YAAY,GAAG,IAAAC,8BAAqB,EAACF,WAAW,CAAC;EAEvD,KAAK,MAAMG,WAAW,IAAIF,YAAY,EAAE;IACtC,IAAIV,OAAO,GAAGa,gBAAK,CAACb,OAAO,CAACY,WAAW,CAAC;IACxCZ,OAAO,CAACc,SAAS,CAAC,CAAC;IACnBd,OAAO,GAAGT,+BAA+B,CAACS,OAAO,EAAEd,WAAW,CAAC;IAC/D6B,iBAAE,CAACC,aAAa,CAACJ,WAAW,EAAEZ,OAAO,CAACiB,SAAS,CAAC,CAAC,CAAC;EACpD;AACF","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeviceFamily.js","names":["_iosPlugins","data","require","_warnings","withDeviceFamily","config","withXcodeProject","modResults","setDeviceFamily","project","exports","getSupportsTablet","ios","supportsTablet","getIsTabletOnly","isTabletOnly","getDeviceFamilies","addWarningIOS","formatDeviceFamilies","deviceFamilies","join","configurations","pbxXCBuildConfigurationSection","buildSettings","Object","values","PRODUCT_NAME","TVOS_DEPLOYMENT_TARGET","TARGETED_DEVICE_FAMILY"],"sources":["../../src/ios/DeviceFamily.ts"],"sourcesContent":["import type { ExpoConfig } from '@expo/config-types';\nimport type { XcodeProject } from 'xcode';\n\nimport type { ConfigPlugin } from '../Plugin.types';\nimport { withXcodeProject } from '../plugins/ios-plugins';\nimport { addWarningIOS } from '../utils/warnings';\n\nexport const withDeviceFamily: ConfigPlugin = (config) => {\n return withXcodeProject(config, async (config) => {\n config.modResults = await setDeviceFamily(config, {\n project: config.modResults,\n });\n return config;\n });\n};\n\nexport function getSupportsTablet(config: Pick<ExpoConfig, 'ios'>): boolean {\n return !!config.ios?.supportsTablet;\n}\n\nexport function getIsTabletOnly(config: Pick<ExpoConfig, 'ios'>): boolean {\n return !!config?.ios?.isTabletOnly;\n}\n\nexport function getDeviceFamilies(config: Pick<ExpoConfig, 'ios'>): number[] {\n const supportsTablet = getSupportsTablet(config);\n const isTabletOnly = getIsTabletOnly(config);\n\n if (isTabletOnly && config.ios?.supportsTablet === false) {\n addWarningIOS(\n 'ios.supportsTablet',\n `Found contradictory values: \\`{ ios: { isTabletOnly: true, supportsTablet: false } }\\`. Using \\`{ isTabletOnly: true }\\`.`\n );\n }\n\n // 1 is iPhone, 2 is iPad\n if (isTabletOnly) {\n return [2];\n } else if (supportsTablet) {\n return [1, 2];\n } else {\n // is iPhone only\n return [1];\n }\n}\n\n/**\n * Wrapping the families in double quotes is the only way to set a value with a comma in it.\n *\n * @param deviceFamilies\n */\nexport function formatDeviceFamilies(deviceFamilies: number[]): string {\n return `\"${deviceFamilies.join(',')}\"`;\n}\n\n/**\n * Add to pbxproj under TARGETED_DEVICE_FAMILY\n */\nexport function setDeviceFamily(\n config: Pick<ExpoConfig, 'ios'>,\n { project }: { project: XcodeProject }\n): XcodeProject {\n const deviceFamilies = formatDeviceFamilies(getDeviceFamilies(config));\n\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 (typeof buildSettings?.TVOS_DEPLOYMENT_TARGET !== 'undefined') {\n buildSettings.TARGETED_DEVICE_FAMILY = '3';\n } else {\n buildSettings.TARGETED_DEVICE_FAMILY = deviceFamilies;\n }\n }\n }\n\n return project;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"DeviceFamily.js","names":["_iosPlugins","data","require","_warnings","withDeviceFamily","config","withXcodeProject","modResults","setDeviceFamily","project","exports","getSupportsTablet","ios","supportsTablet","getIsTabletOnly","isTabletOnly","getDeviceFamilies","addWarningIOS","formatDeviceFamilies","deviceFamilies","join","configurations","pbxXCBuildConfigurationSection","buildSettings","Object","values","PRODUCT_NAME","TVOS_DEPLOYMENT_TARGET","TARGETED_DEVICE_FAMILY"],"sources":["../../src/ios/DeviceFamily.ts"],"sourcesContent":["import type { ExpoConfig } from '@expo/config-types';\nimport type { XcodeProject } from 'xcode';\n\nimport type { ConfigPlugin } from '../Plugin.types';\nimport { withXcodeProject } from '../plugins/ios-plugins';\nimport { addWarningIOS } from '../utils/warnings';\n\nexport const withDeviceFamily: ConfigPlugin = (config) => {\n return withXcodeProject(config, async (config) => {\n config.modResults = await setDeviceFamily(config, {\n project: config.modResults,\n });\n return config;\n });\n};\n\nexport function getSupportsTablet(config: Pick<ExpoConfig, 'ios'>): boolean {\n return !!config.ios?.supportsTablet;\n}\n\nexport function getIsTabletOnly(config: Pick<ExpoConfig, 'ios'>): boolean {\n return !!config?.ios?.isTabletOnly;\n}\n\nexport function getDeviceFamilies(config: Pick<ExpoConfig, 'ios'>): number[] {\n const supportsTablet = getSupportsTablet(config);\n const isTabletOnly = getIsTabletOnly(config);\n\n if (isTabletOnly && config.ios?.supportsTablet === false) {\n addWarningIOS(\n 'ios.supportsTablet',\n `Found contradictory values: \\`{ ios: { isTabletOnly: true, supportsTablet: false } }\\`. Using \\`{ isTabletOnly: true }\\`.`\n );\n }\n\n // 1 is iPhone, 2 is iPad\n if (isTabletOnly) {\n return [2];\n } else if (supportsTablet) {\n return [1, 2];\n } else {\n // is iPhone only\n return [1];\n }\n}\n\n/**\n * Wrapping the families in double quotes is the only way to set a value with a comma in it.\n *\n * @param deviceFamilies\n */\nexport function formatDeviceFamilies(deviceFamilies: number[]): string {\n return `\"${deviceFamilies.join(',')}\"`;\n}\n\n/**\n * Add to pbxproj under TARGETED_DEVICE_FAMILY\n */\nexport function setDeviceFamily(\n config: Pick<ExpoConfig, 'ios'>,\n { project }: { project: XcodeProject }\n): XcodeProject {\n const deviceFamilies = formatDeviceFamilies(getDeviceFamilies(config));\n\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 (typeof buildSettings?.TVOS_DEPLOYMENT_TARGET !== 'undefined') {\n buildSettings.TARGETED_DEVICE_FAMILY = '3';\n } else {\n buildSettings.TARGETED_DEVICE_FAMILY = deviceFamilies;\n }\n }\n }\n\n return project;\n}\n"],"mappings":";;;;;;;;;AAIA,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;AAEO,MAAMG,gBAA8B,GAAIC,MAAM,IAAK;EACxD,OAAO,IAAAC,8BAAgB,EAACD,MAAM,EAAE,MAAOA,MAAM,IAAK;IAChDA,MAAM,CAACE,UAAU,GAAG,MAAMC,eAAe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AAc,CAAC,IAAIC,MAAM,CAACC,MAAM,CAACJ,cAAc,IAAI,CAAC,CAAC,CAAC,EAAE;IACnE;IACA;IACA,IAAI,OAAOE,aAAa,EAAEG,YAAY,KAAK,WAAW,EAAE;MACtD,IAAI,OAAOH,aAAa,EAAEI,sBAAsB,KAAK,WAAW,EAAE;QAChEJ,aAAa,CAACK,sBAAsB,GAAG,GAAG;MAC5C,CAAC,MAAM;QACLL,aAAa,CAACK,sBAAsB,GAAGT,cAAc;MACvD;IACF;EACF;EAEA,OAAOV,OAAO;AAChB","ignoreList":[]}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
3
|
+
exports.__esModule = true;
|
|
6
4
|
exports.ensureApplicationTargetEntitlementsFileConfigured = ensureApplicationTargetEntitlementsFileConfigured;
|
|
7
5
|
exports.getEntitlementsPath = getEntitlementsPath;
|
|
8
6
|
exports.setAssociatedDomains = setAssociatedDomains;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Entitlements.js","names":["_fs","data","_interopRequireDefault","require","_path","_Target","_Xcodeproj","_string","_iosPlugins","e","__esModule","default","withAssociatedDomains","exports","createEntitlementsPlugin","setAssociatedDomains","config","_","entitlementsPlist","ios","associatedDomains","getEntitlementsPath","projectRoot","targetName","buildConfiguration","project","getPbxproj","xcBuildConfiguration","getXCBuildConfigurationFromPbxproj","entitlementsPath","getEntitlementsPathFromBuildConfiguration","fs","existsSync","entitlementsPathRaw","buildSettings","CODE_SIGN_ENTITLEMENTS","path","normalize","join","trimQuotes","ensureApplicationTargetEntitlementsFileConfigured","projectName","getProjectName","productName","getProductName","applicationTarget","findFirstNativeTarget","buildConfigurations","getBuildConfigurationsForListId","buildConfigurationList","hasChangesToWrite","oldEntitlementPath","entitlementsRelativePath","replace","resolve","mkdirSync","dirname","recursive","writeFileSync","ENTITLEMENTS_TEMPLATE","filepath","writeSync"],"sources":["../../src/ios/Entitlements.ts"],"sourcesContent":["import type { ExpoConfig } from '@expo/config-types';\nimport type { JSONObject } from '@expo/json-file';\nimport fs from 'fs';\nimport path from 'path';\nimport type { XCBuildConfiguration } from 'xcode';\n\nimport { findFirstNativeTarget, getXCBuildConfigurationFromPbxproj } from './Target';\nimport {\n getBuildConfigurationsForListId,\n getPbxproj,\n getProductName,\n getProjectName,\n} from './utils/Xcodeproj';\nimport { trimQuotes } from './utils/string';\nimport { createEntitlementsPlugin } from '../plugins/ios-plugins';\n\nexport const withAssociatedDomains = createEntitlementsPlugin(\n setAssociatedDomains,\n 'withAssociatedDomains'\n);\n\nexport function setAssociatedDomains(\n config: ExpoConfig,\n { 'com.apple.developer.associated-domains': _, ...entitlementsPlist }: JSONObject\n): JSONObject {\n if (config.ios?.associatedDomains) {\n return {\n ...entitlementsPlist,\n 'com.apple.developer.associated-domains': config.ios.associatedDomains,\n };\n }\n\n return entitlementsPlist;\n}\n\nexport function getEntitlementsPath(\n projectRoot: string,\n {\n targetName,\n buildConfiguration = 'Release',\n }: { targetName?: string; buildConfiguration?: string } = {}\n): string | null {\n const project = getPbxproj(projectRoot);\n const xcBuildConfiguration = getXCBuildConfigurationFromPbxproj(project, {\n targetName,\n buildConfiguration,\n });\n if (!xcBuildConfiguration) {\n return null;\n }\n const entitlementsPath = getEntitlementsPathFromBuildConfiguration(\n projectRoot,\n xcBuildConfiguration\n );\n return entitlementsPath && fs.existsSync(entitlementsPath) ? entitlementsPath : null;\n}\n\nfunction getEntitlementsPathFromBuildConfiguration(\n projectRoot: string,\n xcBuildConfiguration: XCBuildConfiguration\n): string | null {\n const entitlementsPathRaw = xcBuildConfiguration?.buildSettings?.CODE_SIGN_ENTITLEMENTS as\n | string\n | undefined;\n if (entitlementsPathRaw) {\n return path.normalize(path.join(projectRoot, 'ios', trimQuotes(entitlementsPathRaw)));\n } else {\n return null;\n }\n}\n\nexport function ensureApplicationTargetEntitlementsFileConfigured(projectRoot: string): void {\n const project = getPbxproj(projectRoot);\n const projectName = getProjectName(projectRoot);\n const productName = getProductName(project);\n\n const [, applicationTarget] = findFirstNativeTarget(project);\n const buildConfigurations = getBuildConfigurationsForListId(\n project,\n applicationTarget.buildConfigurationList\n );\n let hasChangesToWrite = false;\n for (const [, xcBuildConfiguration] of buildConfigurations) {\n const oldEntitlementPath = getEntitlementsPathFromBuildConfiguration(\n projectRoot,\n xcBuildConfiguration\n );\n if (oldEntitlementPath && fs.existsSync(oldEntitlementPath)) {\n return;\n }\n hasChangesToWrite = true;\n // Use posix formatted path, even on Windows\n const entitlementsRelativePath = path\n .join(projectName, `${productName}.entitlements`)\n .replace(/\\\\/g, '/');\n const entitlementsPath = path.resolve(projectRoot, 'ios', entitlementsRelativePath);\n fs.mkdirSync(path.dirname(entitlementsPath), { recursive: true });\n if (!fs.existsSync(entitlementsPath)) {\n fs.writeFileSync(entitlementsPath, ENTITLEMENTS_TEMPLATE);\n }\n xcBuildConfiguration.buildSettings.CODE_SIGN_ENTITLEMENTS = entitlementsRelativePath;\n }\n if (hasChangesToWrite) {\n fs.writeFileSync(project.filepath, project.writeSync());\n }\n}\n\nconst ENTITLEMENTS_TEMPLATE = `\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n</dict>\n</plist>\n`;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Entitlements.js","names":["_fs","data","_interopRequireDefault","require","_path","_Target","_Xcodeproj","_string","_iosPlugins","e","__esModule","default","withAssociatedDomains","exports","createEntitlementsPlugin","setAssociatedDomains","config","_","entitlementsPlist","ios","associatedDomains","getEntitlementsPath","projectRoot","targetName","buildConfiguration","project","getPbxproj","xcBuildConfiguration","getXCBuildConfigurationFromPbxproj","entitlementsPath","getEntitlementsPathFromBuildConfiguration","fs","existsSync","entitlementsPathRaw","buildSettings","CODE_SIGN_ENTITLEMENTS","path","normalize","join","trimQuotes","ensureApplicationTargetEntitlementsFileConfigured","projectName","getProjectName","productName","getProductName","applicationTarget","findFirstNativeTarget","buildConfigurations","getBuildConfigurationsForListId","buildConfigurationList","hasChangesToWrite","oldEntitlementPath","entitlementsRelativePath","replace","resolve","mkdirSync","dirname","recursive","writeFileSync","ENTITLEMENTS_TEMPLATE","filepath","writeSync"],"sources":["../../src/ios/Entitlements.ts"],"sourcesContent":["import type { ExpoConfig } from '@expo/config-types';\nimport type { JSONObject } from '@expo/json-file';\nimport fs from 'fs';\nimport path from 'path';\nimport type { XCBuildConfiguration } from 'xcode';\n\nimport { findFirstNativeTarget, getXCBuildConfigurationFromPbxproj } from './Target';\nimport {\n getBuildConfigurationsForListId,\n getPbxproj,\n getProductName,\n getProjectName,\n} from './utils/Xcodeproj';\nimport { trimQuotes } from './utils/string';\nimport { createEntitlementsPlugin } from '../plugins/ios-plugins';\n\nexport const withAssociatedDomains = createEntitlementsPlugin(\n setAssociatedDomains,\n 'withAssociatedDomains'\n);\n\nexport function setAssociatedDomains(\n config: ExpoConfig,\n { 'com.apple.developer.associated-domains': _, ...entitlementsPlist }: JSONObject\n): JSONObject {\n if (config.ios?.associatedDomains) {\n return {\n ...entitlementsPlist,\n 'com.apple.developer.associated-domains': config.ios.associatedDomains,\n };\n }\n\n return entitlementsPlist;\n}\n\nexport function getEntitlementsPath(\n projectRoot: string,\n {\n targetName,\n buildConfiguration = 'Release',\n }: { targetName?: string; buildConfiguration?: string } = {}\n): string | null {\n const project = getPbxproj(projectRoot);\n const xcBuildConfiguration = getXCBuildConfigurationFromPbxproj(project, {\n targetName,\n buildConfiguration,\n });\n if (!xcBuildConfiguration) {\n return null;\n }\n const entitlementsPath = getEntitlementsPathFromBuildConfiguration(\n projectRoot,\n xcBuildConfiguration\n );\n return entitlementsPath && fs.existsSync(entitlementsPath) ? entitlementsPath : null;\n}\n\nfunction getEntitlementsPathFromBuildConfiguration(\n projectRoot: string,\n xcBuildConfiguration: XCBuildConfiguration\n): string | null {\n const entitlementsPathRaw = xcBuildConfiguration?.buildSettings?.CODE_SIGN_ENTITLEMENTS as\n | string\n | undefined;\n if (entitlementsPathRaw) {\n return path.normalize(path.join(projectRoot, 'ios', trimQuotes(entitlementsPathRaw)));\n } else {\n return null;\n }\n}\n\nexport function ensureApplicationTargetEntitlementsFileConfigured(projectRoot: string): void {\n const project = getPbxproj(projectRoot);\n const projectName = getProjectName(projectRoot);\n const productName = getProductName(project);\n\n const [, applicationTarget] = findFirstNativeTarget(project);\n const buildConfigurations = getBuildConfigurationsForListId(\n project,\n applicationTarget.buildConfigurationList\n );\n let hasChangesToWrite = false;\n for (const [, xcBuildConfiguration] of buildConfigurations) {\n const oldEntitlementPath = getEntitlementsPathFromBuildConfiguration(\n projectRoot,\n xcBuildConfiguration\n );\n if (oldEntitlementPath && fs.existsSync(oldEntitlementPath)) {\n return;\n }\n hasChangesToWrite = true;\n // Use posix formatted path, even on Windows\n const entitlementsRelativePath = path\n .join(projectName, `${productName}.entitlements`)\n .replace(/\\\\/g, '/');\n const entitlementsPath = path.resolve(projectRoot, 'ios', entitlementsRelativePath);\n fs.mkdirSync(path.dirname(entitlementsPath), { recursive: true });\n if (!fs.existsSync(entitlementsPath)) {\n fs.writeFileSync(entitlementsPath, ENTITLEMENTS_TEMPLATE);\n }\n xcBuildConfiguration.buildSettings.CODE_SIGN_ENTITLEMENTS = entitlementsRelativePath;\n }\n if (hasChangesToWrite) {\n fs.writeFileSync(project.filepath, project.writeSync());\n }\n}\n\nconst ENTITLEMENTS_TEMPLATE = `\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n</dict>\n</plist>\n`;\n"],"mappings":";;;;;;;AAEA,SAAAA,IAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAA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iBAAiB,GAAG,KAAK;EAC7B,KAAK,MAAM,GAAGvB,oBAAoB,CAAC,IAAIoB,mBAAmB,EAAE;IAC1D,MAAMI,kBAAkB,GAAGrB,yCAAyC,CAClER,WAAW,EACXK,oBACF,CAAC;IACD,IAAIwB,kBAAkB,IAAIpB,aAAE,CAACC,UAAU,CAACmB,kBAAkB,CAAC,EAAE;MAC3D;IACF;IACAD,iBAAiB,GAAG,IAAI;IACxB;IACA,MAAME,wBAAwB,GAAGhB,eAAI,CAClCE,IAAI,CAACG,WAAW,EAAE,GAAGE,WAAW,eAAe,CAAC,CAChDU,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC;IACtB,MAAMxB,gBAAgB,GAAGO,eAAI,CAACkB,OAAO,CAAChC,WAAW,EAAE,KAAK,EAAE8B,wBAAwB,CAAC;IACnFrB,aAAE,CAACwB,SAAS,CAACnB,eAAI,CAACoB,OAAO,CAAC3B,gBAAgB,CAAC,EAAE;MAAE4B,SAAS,EAAE;IAAK,CAAC,CAAC;IACjE,IAAI,CAAC1B,aAAE,CAACC,UAAU,CAACH,gBAAgB,CAAC,EAAE;MACpCE,aAAE,CAAC2B,aAAa,CAAC7B,gBAAgB,EAAE8B,qBAAqB,CAAC;IAC3D;IACAhC,oBAAoB,CAACO,aAAa,CAACC,sBAAsB,GAAGiB,wBAAwB;EACtF;EACA,IAAIF,iBAAiB,EAAE;IACrBnB,aAAE,CAAC2B,aAAa,CAACjC,OAAO,CAACmC,QAAQ,EAAEnC,OAAO,CAACoC,SAAS,CAAC,CAAC,CAAC;EACzD;AACF;AAEA,MAAMF,qBAAqB,GAAG;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,CAAC","ignoreList":[]}
|
package/build/ios/Google.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
3
|
+
exports.__esModule = true;
|
|
6
4
|
exports.getGoogleServicesFile = getGoogleServicesFile;
|
|
7
5
|
exports.getGoogleSignInReversedClientId = getGoogleSignInReversedClientId;
|
|
8
6
|
exports.setGoogleConfig = setGoogleConfig;
|
package/build/ios/Google.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Google.js","names":["_plist","data","_interopRequireDefault","require","_assert","_fs","_path","_Paths","_Scheme","_Xcodeproj","_iosPlugins","e","__esModule","default","withGoogle","config","withInfoPlist","modResults","setGoogleConfig","modRequest","exports","withGoogleServicesFile","withXcodeProject","setGoogleServicesFile","projectRoot","project","readGoogleServicesInfoPlist","relativePath","googleServiceFilePath","path","resolve","contents","fs","readFileSync","assert","plist","parse","getGoogleSignInReversedClientId","googleServicesFileRelativePath","getGoogleServicesFile","infoPlist","REVERSED_CLIENT_ID","ios","googleServicesFile","setGoogleSignInReversedClientId","reversedClientId","appendScheme","copyFileSync","join","getSourceRoot","projectName","getProjectName","plistFilePath","hasFile","addResourceFileToGroup","filepath","groupName","isBuildFile","verbose"],"sources":["../../src/ios/Google.ts"],"sourcesContent":["import type { ExpoConfig } from '@expo/config-types';\nimport plist from '@expo/plist';\nimport assert from 'assert';\nimport fs from 'fs';\nimport path from 'path';\nimport type { XcodeProject } from 'xcode';\n\nimport type { InfoPlist } from './IosConfig.types';\nimport { getSourceRoot } from './Paths';\nimport { appendScheme } from './Scheme';\nimport type { ConfigPlugin, ModProps } from '../Plugin.types';\nimport { addResourceFileToGroup, getProjectName } from './utils/Xcodeproj';\nimport { withInfoPlist, withXcodeProject } from '../plugins/ios-plugins';\n\nexport const withGoogle: ConfigPlugin = (config) => {\n return withInfoPlist(config, (config) => {\n config.modResults = setGoogleConfig(config, config.modResults, config.modRequest);\n return config;\n });\n};\n\nexport const withGoogleServicesFile: ConfigPlugin = (config) => {\n return withXcodeProject(config, (config) => {\n config.modResults = setGoogleServicesFile(config, {\n projectRoot: config.modRequest.projectRoot,\n project: config.modResults,\n });\n return config;\n });\n};\n\nfunction readGoogleServicesInfoPlist(\n relativePath: string,\n { projectRoot }: { projectRoot: string }\n) {\n const googleServiceFilePath = path.resolve(projectRoot, relativePath);\n const contents = fs.readFileSync(googleServiceFilePath, 'utf8');\n assert(contents, 'GoogleService-Info.plist is empty');\n return plist.parse(contents);\n}\n\nexport function getGoogleSignInReversedClientId(\n config: Pick<ExpoConfig, 'ios'>,\n modRequest: Pick<ModProps<InfoPlist>, 'projectRoot'>\n): string | null {\n const googleServicesFileRelativePath = getGoogleServicesFile(config);\n if (googleServicesFileRelativePath === null) {\n return null;\n }\n\n const infoPlist = readGoogleServicesInfoPlist(googleServicesFileRelativePath, modRequest);\n\n return infoPlist.REVERSED_CLIENT_ID ?? null;\n}\n\nexport function getGoogleServicesFile(config: Pick<ExpoConfig, 'ios'>) {\n return config.ios?.googleServicesFile ?? null;\n}\n\nexport function setGoogleSignInReversedClientId(\n config: Pick<ExpoConfig, 'ios'>,\n infoPlist: InfoPlist,\n modRequest: Pick<ModProps<InfoPlist>, 'projectRoot'>\n): InfoPlist {\n const reversedClientId = getGoogleSignInReversedClientId(config, modRequest);\n\n if (reversedClientId === null) {\n return infoPlist;\n }\n\n return appendScheme(reversedClientId, infoPlist);\n}\n\nexport function setGoogleConfig(\n config: Pick<ExpoConfig, 'ios'>,\n infoPlist: InfoPlist,\n modRequest: ModProps<InfoPlist>\n): InfoPlist {\n infoPlist = setGoogleSignInReversedClientId(config, infoPlist, modRequest);\n return infoPlist;\n}\n\nexport function setGoogleServicesFile(\n config: Pick<ExpoConfig, 'ios'>,\n { projectRoot, project }: { project: XcodeProject; projectRoot: string }\n): XcodeProject {\n const googleServicesFileRelativePath = getGoogleServicesFile(config);\n if (googleServicesFileRelativePath === null) {\n return project;\n }\n\n const googleServiceFilePath = path.resolve(projectRoot, googleServicesFileRelativePath);\n fs.copyFileSync(\n googleServiceFilePath,\n path.join(getSourceRoot(projectRoot), 'GoogleService-Info.plist')\n );\n\n const projectName = getProjectName(projectRoot);\n const plistFilePath = `${projectName}/GoogleService-Info.plist`;\n if (!project.hasFile(plistFilePath)) {\n project = addResourceFileToGroup({\n filepath: plistFilePath,\n groupName: projectName,\n project,\n isBuildFile: true,\n verbose: true,\n });\n }\n return project;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Google.js","names":["_plist","data","_interopRequireDefault","require","_assert","_fs","_path","_Paths","_Scheme","_Xcodeproj","_iosPlugins","e","__esModule","default","withGoogle","config","withInfoPlist","modResults","setGoogleConfig","modRequest","exports","withGoogleServicesFile","withXcodeProject","setGoogleServicesFile","projectRoot","project","readGoogleServicesInfoPlist","relativePath","googleServiceFilePath","path","resolve","contents","fs","readFileSync","assert","plist","parse","getGoogleSignInReversedClientId","googleServicesFileRelativePath","getGoogleServicesFile","infoPlist","REVERSED_CLIENT_ID","ios","googleServicesFile","setGoogleSignInReversedClientId","reversedClientId","appendScheme","copyFileSync","join","getSourceRoot","projectName","getProjectName","plistFilePath","hasFile","addResourceFileToGroup","filepath","groupName","isBuildFile","verbose"],"sources":["../../src/ios/Google.ts"],"sourcesContent":["import type { ExpoConfig } from '@expo/config-types';\nimport plist from '@expo/plist';\nimport assert from 'assert';\nimport fs from 'fs';\nimport path from 'path';\nimport type { XcodeProject } from 'xcode';\n\nimport type { InfoPlist } from './IosConfig.types';\nimport { getSourceRoot } from './Paths';\nimport { appendScheme } from './Scheme';\nimport type { ConfigPlugin, ModProps } from '../Plugin.types';\nimport { addResourceFileToGroup, getProjectName } from './utils/Xcodeproj';\nimport { withInfoPlist, withXcodeProject } from '../plugins/ios-plugins';\n\nexport const withGoogle: ConfigPlugin = (config) => {\n return withInfoPlist(config, (config) => {\n config.modResults = setGoogleConfig(config, config.modResults, config.modRequest);\n return config;\n });\n};\n\nexport const withGoogleServicesFile: ConfigPlugin = (config) => {\n return withXcodeProject(config, (config) => {\n config.modResults = setGoogleServicesFile(config, {\n projectRoot: config.modRequest.projectRoot,\n project: config.modResults,\n });\n return config;\n });\n};\n\nfunction readGoogleServicesInfoPlist(\n relativePath: string,\n { projectRoot }: { projectRoot: string }\n) {\n const googleServiceFilePath = path.resolve(projectRoot, relativePath);\n const contents = fs.readFileSync(googleServiceFilePath, 'utf8');\n assert(contents, 'GoogleService-Info.plist is empty');\n return plist.parse(contents);\n}\n\nexport function getGoogleSignInReversedClientId(\n config: Pick<ExpoConfig, 'ios'>,\n modRequest: Pick<ModProps<InfoPlist>, 'projectRoot'>\n): string | null {\n const googleServicesFileRelativePath = getGoogleServicesFile(config);\n if (googleServicesFileRelativePath === null) {\n return null;\n }\n\n const infoPlist = readGoogleServicesInfoPlist(googleServicesFileRelativePath, modRequest);\n\n return infoPlist.REVERSED_CLIENT_ID ?? null;\n}\n\nexport function getGoogleServicesFile(config: Pick<ExpoConfig, 'ios'>) {\n return config.ios?.googleServicesFile ?? null;\n}\n\nexport function setGoogleSignInReversedClientId(\n config: Pick<ExpoConfig, 'ios'>,\n infoPlist: InfoPlist,\n modRequest: Pick<ModProps<InfoPlist>, 'projectRoot'>\n): InfoPlist {\n const reversedClientId = getGoogleSignInReversedClientId(config, modRequest);\n\n if (reversedClientId === null) {\n return infoPlist;\n }\n\n return appendScheme(reversedClientId, infoPlist);\n}\n\nexport function setGoogleConfig(\n config: Pick<ExpoConfig, 'ios'>,\n infoPlist: InfoPlist,\n modRequest: ModProps<InfoPlist>\n): InfoPlist {\n infoPlist = setGoogleSignInReversedClientId(config, infoPlist, modRequest);\n return infoPlist;\n}\n\nexport function setGoogleServicesFile(\n config: Pick<ExpoConfig, 'ios'>,\n { projectRoot, project }: { project: XcodeProject; projectRoot: string }\n): XcodeProject {\n const googleServicesFileRelativePath = getGoogleServicesFile(config);\n if (googleServicesFileRelativePath === null) {\n return project;\n }\n\n const googleServiceFilePath = path.resolve(projectRoot, googleServicesFileRelativePath);\n fs.copyFileSync(\n googleServiceFilePath,\n path.join(getSourceRoot(projectRoot), 'GoogleService-Info.plist')\n );\n\n const projectName = getProjectName(projectRoot);\n const plistFilePath = `${projectName}/GoogleService-Info.plist`;\n if (!project.hasFile(plistFilePath)) {\n project = addResourceFileToGroup({\n filepath: plistFilePath,\n groupName: projectName,\n project,\n isBuildFile: true,\n verbose: true,\n });\n }\n return project;\n}\n"],"mappings":";;;;;;;;;AACA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,IAAA;EAAA,MAAAJ,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAE,GAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,MAAA;EAAA,MAAAL,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAG,KAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAIA,SAAAM,OAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,MAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,QAAA;EAAA,MAAAP,IAAA,GAAAE,OAAA;EAAAK,OAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAQ,WAAA;EAAA,MAAAR,IAAA,GAAAE,OAAA;EAAAM,UAAA,YAAAA,CAAA;IAAA,OAAAR,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAS,YAAA;EAAA,MAAAT,IAAA,GAAAE,OAAA;EAAAO,WAAA,YAAAA,CAAA;IAAA,OAAAT,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAyE,SAAAC,uBA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WAAW,2BAA2B;EAC/D,IAAI,CAACzB,OAAO,CAAC4B,OAAO,CAACD,aAAa,CAAC,EAAE;IACnC3B,OAAO,GAAG,IAAA6B,mCAAsB,EAAC;MAC/BC,QAAQ,EAAEH,aAAa;MACvBI,SAAS,EAAEN,WAAW;MACtBzB,OAAO;MACPgC,WAAW,EAAE,IAAI;MACjBC,OAAO,EAAE;IACX,CAAC,CAAC;EACJ;EACA,OAAOjC,OAAO;AAChB","ignoreList":[]}
|
package/build/ios/Locales.js
CHANGED
package/build/ios/Locales.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Locales.js","names":["_fs","data","_interopRequireDefault","require","_path","_Xcodeproj","_iosPlugins","_locales","e","__esModule","default","withLocales","config","withXcodeProject","modResults","setLocalesAsync","projectRoot","modRequest","project","exports","writeStringsFile","localesMap","supportingDirectory","fileName","projectName","lang","localizationObj","Object","entries","length","dir","path","join","fs","promises","mkdir","recursive","strings","buffer","plistKey","localVersion","push","writeFile","groupName","group","ensureGroupRecursively","children","some","comment","addResourceFileToGroup","filepath","relative","isBuildFile","verbose","getLocales","locales","localizableStringsIOS","localizableStrings","getResolvedLocalesAsync","getProjectName","keys"],"sources":["../../src/ios/Locales.ts"],"sourcesContent":["import type { ExpoConfig } from '@expo/config-types';\nimport fs from 'fs';\nimport path from 'path';\nimport type { XcodeProject } from 'xcode';\n\nimport type { ConfigPlugin } from '../Plugin.types';\nimport { addResourceFileToGroup, ensureGroupRecursively, getProjectName } from './utils/Xcodeproj';\nimport { withXcodeProject } from '../plugins/ios-plugins';\nimport type { LocaleJson, ResolvedLocalesJson } from '../utils/locales';\nimport { getResolvedLocalesAsync } from '../utils/locales';\n\nexport const withLocales: ConfigPlugin = (config) => {\n return withXcodeProject(config, async (config) => {\n config.modResults = await setLocalesAsync(config, {\n projectRoot: config.modRequest.projectRoot,\n project: config.modResults,\n });\n return config;\n });\n};\n\nexport async function writeStringsFile({\n localesMap,\n supportingDirectory,\n fileName,\n projectName,\n project,\n}: {\n localesMap: LocaleJson | ResolvedLocalesJson;\n supportingDirectory: string;\n fileName: string;\n projectName: string;\n project: XcodeProject;\n}) {\n for (const [lang, localizationObj] of Object.entries(localesMap)) {\n if (Object.entries(localizationObj).length === 0) return project;\n const dir = path.join(supportingDirectory, `${lang}.lproj`);\n await fs.promises.mkdir(dir, { recursive: true });\n\n const strings = path.join(dir, fileName);\n const buffer = [];\n for (const [plistKey, localVersion] of Object.entries(localizationObj)) {\n buffer.push(`${plistKey} = \"${localVersion}\";`);\n }\n // Write the file to the file system.\n await fs.promises.writeFile(strings, buffer.join('\\n'));\n\n const groupName = `${projectName}/Supporting/${lang}.lproj`;\n // deep find the correct folder\n const group = ensureGroupRecursively(project, groupName);\n\n // Ensure the file doesn't already exist\n if (!group?.children.some(({ comment }) => comment === fileName)) {\n // Only write the file if it doesn't already exist.\n project = addResourceFileToGroup({\n filepath: path.relative(supportingDirectory, strings),\n groupName,\n project,\n isBuildFile: true,\n verbose: true,\n });\n }\n }\n return project;\n}\n\nexport function getLocales(\n config: Pick<ExpoConfig, 'locales'>\n): Record<string, string | LocaleJson> | null {\n return config.locales ?? null;\n}\n\nexport async function setLocalesAsync(\n config: Pick<ExpoConfig, 'locales'>,\n { projectRoot, project }: { projectRoot: string; project: XcodeProject }\n): Promise<XcodeProject> {\n const locales = getLocales(config);\n if (!locales) {\n return project;\n }\n // possibly validate CFBundleAllowMixedLocalizations is enabled\n const { localesMap, localizableStringsIOS: localizableStrings } = await getResolvedLocalesAsync(\n projectRoot,\n locales,\n 'ios'\n );\n\n const projectName = getProjectName(projectRoot);\n const supportingDirectory = path.join(projectRoot, 'ios', projectName, 'Supporting');\n\n // TODO: Should we delete all before running? Revisit after we land on a lock file.\n project = await writeStringsFile({\n localesMap,\n supportingDirectory,\n fileName: 'InfoPlist.strings',\n projectName,\n project,\n });\n if (localizableStrings && Object.keys(localizableStrings).length) {\n project = await writeStringsFile({\n localesMap: localizableStrings,\n supportingDirectory,\n fileName: 'Localizable.strings',\n projectName,\n project,\n });\n }\n return project;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Locales.js","names":["_fs","data","_interopRequireDefault","require","_path","_Xcodeproj","_iosPlugins","_locales","e","__esModule","default","withLocales","config","withXcodeProject","modResults","setLocalesAsync","projectRoot","modRequest","project","exports","writeStringsFile","localesMap","supportingDirectory","fileName","projectName","lang","localizationObj","Object","entries","length","dir","path","join","fs","promises","mkdir","recursive","strings","buffer","plistKey","localVersion","push","writeFile","groupName","group","ensureGroupRecursively","children","some","comment","addResourceFileToGroup","filepath","relative","isBuildFile","verbose","getLocales","locales","localizableStringsIOS","localizableStrings","getResolvedLocalesAsync","getProjectName","keys"],"sources":["../../src/ios/Locales.ts"],"sourcesContent":["import type { ExpoConfig } from '@expo/config-types';\nimport fs from 'fs';\nimport path from 'path';\nimport type { XcodeProject } from 'xcode';\n\nimport type { ConfigPlugin } from '../Plugin.types';\nimport { addResourceFileToGroup, ensureGroupRecursively, getProjectName } from './utils/Xcodeproj';\nimport { withXcodeProject } from '../plugins/ios-plugins';\nimport type { LocaleJson, ResolvedLocalesJson } from '../utils/locales';\nimport { getResolvedLocalesAsync } from '../utils/locales';\n\nexport const withLocales: ConfigPlugin = (config) => {\n return withXcodeProject(config, async (config) => {\n config.modResults = await setLocalesAsync(config, {\n projectRoot: config.modRequest.projectRoot,\n project: config.modResults,\n });\n return config;\n });\n};\n\nexport async function writeStringsFile({\n localesMap,\n supportingDirectory,\n fileName,\n projectName,\n project,\n}: {\n localesMap: LocaleJson | ResolvedLocalesJson;\n supportingDirectory: string;\n fileName: string;\n projectName: string;\n project: XcodeProject;\n}) {\n for (const [lang, localizationObj] of Object.entries(localesMap)) {\n if (Object.entries(localizationObj).length === 0) return project;\n const dir = path.join(supportingDirectory, `${lang}.lproj`);\n await fs.promises.mkdir(dir, { recursive: true });\n\n const strings = path.join(dir, fileName);\n const buffer = [];\n for (const [plistKey, localVersion] of Object.entries(localizationObj)) {\n buffer.push(`${plistKey} = \"${localVersion}\";`);\n }\n // Write the file to the file system.\n await fs.promises.writeFile(strings, buffer.join('\\n'));\n\n const groupName = `${projectName}/Supporting/${lang}.lproj`;\n // deep find the correct folder\n const group = ensureGroupRecursively(project, groupName);\n\n // Ensure the file doesn't already exist\n if (!group?.children.some(({ comment }) => comment === fileName)) {\n // Only write the file if it doesn't already exist.\n project = addResourceFileToGroup({\n filepath: path.relative(supportingDirectory, strings),\n groupName,\n project,\n isBuildFile: true,\n verbose: true,\n });\n }\n }\n return project;\n}\n\nexport function getLocales(\n config: Pick<ExpoConfig, 'locales'>\n): Record<string, string | LocaleJson> | null {\n return config.locales ?? null;\n}\n\nexport async function setLocalesAsync(\n config: Pick<ExpoConfig, 'locales'>,\n { projectRoot, project }: { projectRoot: string; project: XcodeProject }\n): Promise<XcodeProject> {\n const locales = getLocales(config);\n if (!locales) {\n return project;\n }\n // possibly validate CFBundleAllowMixedLocalizations is enabled\n const { localesMap, localizableStringsIOS: localizableStrings } = await getResolvedLocalesAsync(\n projectRoot,\n locales,\n 'ios'\n );\n\n const projectName = getProjectName(projectRoot);\n const supportingDirectory = path.join(projectRoot, 'ios', projectName, 'Supporting');\n\n // TODO: Should we delete all before running? Revisit after we land on a lock file.\n project = await writeStringsFile({\n localesMap,\n supportingDirectory,\n fileName: 'InfoPlist.strings',\n projectName,\n project,\n });\n if (localizableStrings && Object.keys(localizableStrings).length) {\n project = await writeStringsFile({\n localesMap: localizableStrings,\n supportingDirectory,\n fileName: 'Localizable.strings',\n projectName,\n project,\n });\n }\n return project;\n}\n"],"mappings":";;;;;;;AACA,SAAAA,IAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,GAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,MAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAC,KAAA,YAAAA,CAAA;IAAA,O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E;AAAwD,CAAC,EACjD;EACvB,MAAMqC,OAAO,GAAGD,UAAU,CAAC1C,MAAM,CAAC;EAClC,IAAI,CAAC2C,OAAO,EAAE;IACZ,OAAOrC,OAAO;EAChB;EACA;EACA,MAAM;IAAEG,UAAU;IAAEmC,qBAAqB,EAAEC;EAAmB,CAAC,GAAG,MAAM,IAAAC,kCAAuB,EAC7F1C,WAAW,EACXuC,OAAO,EACP,KACF,CAAC;EAED,MAAM/B,WAAW,GAAG,IAAAmC,2BAAc,EAAC3C,WAAW,CAAC;EAC/C,MAAMM,mBAAmB,GAAGS,eAAI,CAACC,IAAI,CAAChB,WAAW,EAAE,KAAK,EAAEQ,WAAW,EAAE,YAAY,CAAC;;EAEpF;EACAN,OAAO,GAAG,MAAME,gBAAgB,CAAC;IAC/BC,UAAU;IACVC,mBAAmB;IACnBC,QAAQ,EAAE,mBAAmB;IAC7BC,WAAW;IACXN;EACF,CAAC,CAAC;EACF,IAAIuC,kBAAkB,IAAI9B,MAAM,CAACiC,IAAI,CAACH,kBAAkB,CAAC,CAAC5B,MAAM,EAAE;IAChEX,OAAO,GAAG,MAAME,gBAAgB,CAAC;MAC/BC,UAAU,EAAEoC,kBAAkB;MAC9BnC,mBAAmB;MACnBC,QAAQ,EAAE,qBAAqB;MAC/BC,WAAW;MACXN;IACF,CAAC,CAAC;EACJ;EACA,OAAOA,OAAO;AAChB","ignoreList":[]}
|
package/build/ios/Maps.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
3
|
+
exports.__esModule = true;
|
|
6
4
|
exports.MATCH_INIT = void 0;
|
|
7
5
|
exports.addGoogleMapsAppDelegateImport = addGoogleMapsAppDelegateImport;
|
|
8
6
|
exports.addGoogleMapsAppDelegateInit = addGoogleMapsAppDelegateInit;
|
package/build/ios/Maps.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Maps.js","names":["_requireUtils","data","require","_path","_interopRequireDefault","_iosPlugins","_generateCode","e","__esModule","default","debug","MATCH_INIT","exports","withGoogleMapsKey","createInfoPlistPlugin","setGoogleMapsApiKey","withMaps","config","apiKey","getGoogleMapsApiKey","withMapsCocoaPods","useGoogleMaps","withGoogleMapsAppDelegate","ios","googleMapsApiKey","GMSApiKey","infoPlist","addGoogleMapsAppDelegateImport","src","newSrc","mergeContents","tag","join","anchor","offset","comment","removeGoogleMapsAppDelegateImport","removeContents","addGoogleMapsAppDelegateInit","removeGoogleMapsAppDelegateInit","addMapsCocoaPods","removeMapsCocoaPods","isReactNativeMapsInstalled","projectRoot","resolved","resolveFrom","path","dirname","isReactNativeMapsAutolinked","withPodfile","googleMapsPath","modRequest","isLinked","results","modResults","contents","error","code","Error","didMerge","didClear","withAppDelegate","language"],"sources":["../../src/ios/Maps.ts"],"sourcesContent":["import type { ExpoConfig } from '@expo/config-types';\nimport { resolveFrom } from '@expo/require-utils';\nimport path from 'path';\n\nimport type { ConfigPlugin, InfoPlist } from '../Plugin.types';\nimport { createInfoPlistPlugin, withAppDelegate, withPodfile } from '../plugins/ios-plugins';\nimport type { MergeResults } from '../utils/generateCode';\nimport { mergeContents, removeContents } from '../utils/generateCode';\n\nconst debug = require('debug')('expo:config-plugins:ios:maps') as typeof console.log;\n\nexport const MATCH_INIT = /\\bsuper\\.application\\(\\w+?, didFinishLaunchingWithOptions: \\w+?\\)/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 = ['#if canImport(GoogleMaps)', 'import GoogleMaps', '#endif'];\n\n return mergeContents({\n tag: 'react-native-maps-import',\n src,\n newSrc: newSrc.join('\\n'),\n anchor: /(@main|@UIApplicationMain)/,\n offset: 0,\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 = ['#if canImport(GoogleMaps)', `GMSServices.provideAPIKey(\"${apiKey}\")`, '#endif'];\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(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 withPodfile(config, async (config) => {\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\n let results: MergeResults;\n\n if (isLinked && googleMapsPath && useGoogleMaps) {\n try {\n results = addMapsCocoaPods(config.modResults.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. Report this with a copy of your project Podfile: https://github.com/expo/expo/issues`\n );\n }\n throw error;\n }\n } else {\n // If the package is no longer installed, then remove the block.\n results = removeMapsCocoaPods(config.modResults.contents);\n }\n\n if (results.didMerge || results.didClear) {\n config.modResults.contents = results.contents;\n }\n\n return config;\n });\n};\n\nconst withGoogleMapsAppDelegate: ConfigPlugin<{ apiKey: string | null }> = (config, { apiKey }) => {\n return withAppDelegate(config, (config) => {\n if (\n !apiKey ||\n !isReactNativeMapsAutolinked(config) ||\n !isReactNativeMapsInstalled(config.modRequest.projectRoot)\n ) {\n config.modResults.contents = removeGoogleMapsAppDelegateImport(\n config.modResults.contents\n ).contents;\n config.modResults.contents = removeGoogleMapsAppDelegateInit(\n config.modResults.contents\n ).contents;\n return config;\n }\n\n if (config.modResults.language !== 'swift') {\n throw new Error(\n `Cannot setup Google Maps because the project AppDelegate is not a supported language: ${config.modResults.language}`\n );\n }\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. Report this with a copy of your project AppDelegate: https://github.com/expo/expo/issues`\n );\n }\n throw error;\n }\n return config;\n });\n};\n"],"mappings":";;;;;;;;;;;;;;;AACA,SAAAA,cAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,aAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,MAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,KAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAI,YAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,WAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAK,cAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,aAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAsE,SAAAG,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEtE,MAAMG,KAAK,GAAGR,OAAO,CAAC,OAAO,CAAC,CAAC,8BAA8B,CAAuB;AAE7E,MAAMS,UAAU,GAAAC,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G,OAAO,IAAA2C,6BAAe,EAAC5C,MAAM,EAAGA,MAAM,IAAK;IACzC,IACE,CAACC,MAAM,IACP,CAAC8B,2BAA2B,CAAC/B,MAAM,CAAC,IACpC,CAACyB,0BAA0B,CAACzB,MAAM,CAACkC,UAAU,CAACR,WAAW,CAAC,EAC1D;MACA1B,MAAM,CAACqC,UAAU,CAACC,QAAQ,GAAGnB,iCAAiC,CAC5DnB,MAAM,CAACqC,UAAU,CAACC,QACpB,CAAC,CAACA,QAAQ;MACVtC,MAAM,CAACqC,UAAU,CAACC,QAAQ,GAAGhB,+BAA+B,CAC1DtB,MAAM,CAACqC,UAAU,CAACC,QACpB,CAAC,CAACA,QAAQ;MACV,OAAOtC,MAAM;IACf;IAEA,IAAIA,MAAM,CAACqC,UAAU,CAACQ,QAAQ,KAAK,OAAO,EAAE;MAC1C,MAAM,IAAIJ,KAAK,CACb,yFAAyFzC,MAAM,CAACqC,UAAU,CAACQ,QAAQ,EACrH,CAAC;IACH;IAEA,IAAI;MACF7C,MAAM,CAACqC,UAAU,CAACC,QAAQ,GAAG5B,8BAA8B,CACzDV,MAAM,CAACqC,UAAU,CAACC,QACpB,CAAC,CAACA,QAAQ;MACVtC,MAAM,CAACqC,UAAU,CAACC,QAAQ,GAAGjB,4BAA4B,CACvDrB,MAAM,CAACqC,UAAU,CAACC,QAAQ,EAC1BrC,MACF,CAAC,CAACqC,QAAQ;IACZ,CAAC,CAAC,OAAOC,KAAU,EAAE;MACnB,IAAIA,KAAK,CAACC,IAAI,KAAK,cAAc,EAAE;QACjC,MAAM,IAAIC,KAAK,CACb,sKACF,CAAC;MACH;MACA,MAAMF,KAAK;IACb;IACA,OAAOvC,MAAM;EACf,CAAC,CAAC;AACJ,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"Maps.js","names":["_requireUtils","data","require","_path","_interopRequireDefault","_iosPlugins","_generateCode","e","__esModule","default","debug","MATCH_INIT","exports","withGoogleMapsKey","createInfoPlistPlugin","setGoogleMapsApiKey","withMaps","config","apiKey","getGoogleMapsApiKey","withMapsCocoaPods","useGoogleMaps","withGoogleMapsAppDelegate","ios","googleMapsApiKey","GMSApiKey","infoPlist","addGoogleMapsAppDelegateImport","src","newSrc","mergeContents","tag","join","anchor","offset","comment","removeGoogleMapsAppDelegateImport","removeContents","addGoogleMapsAppDelegateInit","removeGoogleMapsAppDelegateInit","addMapsCocoaPods","removeMapsCocoaPods","isReactNativeMapsInstalled","projectRoot","resolved","resolveFrom","path","dirname","isReactNativeMapsAutolinked","withPodfile","googleMapsPath","modRequest","isLinked","results","modResults","contents","error","code","Error","didMerge","didClear","withAppDelegate","language"],"sources":["../../src/ios/Maps.ts"],"sourcesContent":["import type { ExpoConfig } from '@expo/config-types';\nimport { resolveFrom } from '@expo/require-utils';\nimport path from 'path';\n\nimport type { ConfigPlugin, InfoPlist } from '../Plugin.types';\nimport { createInfoPlistPlugin, withAppDelegate, withPodfile } from '../plugins/ios-plugins';\nimport type { MergeResults } from '../utils/generateCode';\nimport { mergeContents, removeContents } from '../utils/generateCode';\n\nconst debug = require('debug')('expo:config-plugins:ios:maps') as typeof console.log;\n\nexport const MATCH_INIT = /\\bsuper\\.application\\(\\w+?, didFinishLaunchingWithOptions: \\w+?\\)/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 = ['#if canImport(GoogleMaps)', 'import GoogleMaps', '#endif'];\n\n return mergeContents({\n tag: 'react-native-maps-import',\n src,\n newSrc: newSrc.join('\\n'),\n anchor: /(@main|@UIApplicationMain)/,\n offset: 0,\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 = ['#if canImport(GoogleMaps)', `GMSServices.provideAPIKey(\"${apiKey}\")`, '#endif'];\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(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 withPodfile(config, async (config) => {\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\n let results: MergeResults;\n\n if (isLinked && googleMapsPath && useGoogleMaps) {\n try {\n results = addMapsCocoaPods(config.modResults.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. Report this with a copy of your project Podfile: https://github.com/expo/expo/issues`\n );\n }\n throw error;\n }\n } else {\n // If the package is no longer installed, then remove the block.\n results = removeMapsCocoaPods(config.modResults.contents);\n }\n\n if (results.didMerge || results.didClear) {\n config.modResults.contents = results.contents;\n }\n\n return config;\n });\n};\n\nconst withGoogleMapsAppDelegate: ConfigPlugin<{ apiKey: string | null }> = (config, { apiKey }) => {\n return withAppDelegate(config, (config) => {\n if (\n !apiKey ||\n !isReactNativeMapsAutolinked(config) ||\n !isReactNativeMapsInstalled(config.modRequest.projectRoot)\n ) {\n config.modResults.contents = removeGoogleMapsAppDelegateImport(\n config.modResults.contents\n ).contents;\n config.modResults.contents = removeGoogleMapsAppDelegateInit(\n config.modResults.contents\n ).contents;\n return config;\n }\n\n if (config.modResults.language !== 'swift') {\n throw new Error(\n `Cannot setup Google Maps because the project AppDelegate is not a supported language: ${config.modResults.language}`\n );\n }\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. Report this with a copy of your project AppDelegate: https://github.com/expo/expo/issues`\n );\n }\n throw error;\n }\n return config;\n });\n};\n"],"mappings":";;;;;;;;;;;;;AACA,SAAAA,cAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,aAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,MAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,KAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAI,YAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,WAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAK,cAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,aAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAsE,SAAAG,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEtE,MAAMG,KAAK,GAAGR,OAAO,CAAC,OAAO,CAAC,CAAC,8BAA8B,CAAuB;AAE7E,MAAMS,UAAU,GAAAC,OAAA,CAAAD,UAAA,GAAG,oEAAoE;AAE9F,MAAME,iBAAiB,GAAG,IAAAC,mCAAqB,EAACC,mBAAmB,EAAE,mBAAmB,CAAC;AAElF,MAAMC,QAA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CAACyB,0BAA0B,CAACzB,MAAM,CAACkC,UAAU,CAACR,WAAW,CAAC,EAC1D;MACA1B,MAAM,CAACqC,UAAU,CAACC,QAAQ,GAAGnB,iCAAiC,CAC5DnB,MAAM,CAACqC,UAAU,CAACC,QACpB,CAAC,CAACA,QAAQ;MACVtC,MAAM,CAACqC,UAAU,CAACC,QAAQ,GAAGhB,+BAA+B,CAC1DtB,MAAM,CAACqC,UAAU,CAACC,QACpB,CAAC,CAACA,QAAQ;MACV,OAAOtC,MAAM;IACf;IAEA,IAAIA,MAAM,CAACqC,UAAU,CAACQ,QAAQ,KAAK,OAAO,EAAE;MAC1C,MAAM,IAAIJ,KAAK,CACb,yFAAyFzC,MAAM,CAACqC,UAAU,CAACQ,QAAQ,EACrH,CAAC;IACH;IAEA,IAAI;MACF7C,MAAM,CAACqC,UAAU,CAACC,QAAQ,GAAG5B,8BAA8B,CACzDV,MAAM,CAACqC,UAAU,CAACC,QACpB,CAAC,CAACA,QAAQ;MACVtC,MAAM,CAACqC,UAAU,CAACC,QAAQ,GAAGjB,4BAA4B,CACvDrB,MAAM,CAACqC,UAAU,CAACC,QAAQ,EAC1BrC,MACF,CAAC,CAACqC,QAAQ;IACZ,CAAC,CAAC,OAAOC,KAAU,EAAE;MACnB,IAAIA,KAAK,CAACC,IAAI,KAAK,cAAc,EAAE;QACjC,MAAM,IAAIC,KAAK,CACb,sKACF,CAAC;MACH;MACA,MAAMF,KAAK;IACb;IACA,OAAOvC,MAAM;EACf,CAAC,CAAC;AACJ,CAAC","ignoreList":[]}
|
package/build/ios/Name.js
CHANGED
package/build/ios/Name.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Name.js","names":["_Target","data","require","_Xcodeproj","_iosPlugins","withDisplayName","exports","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 type { ExpoConfig } from '@expo/config-types';\nimport type { XcodeProject } from 'xcode';\n\nimport type { InfoPlist } from './IosConfig.types';\nimport { findFirstNativeTarget } from './Target';\nimport type { ConfigPlugin } from '../Plugin.types';\nimport type { ConfigurationSectionEntry } from './utils/Xcodeproj';\nimport { getBuildConfigurationsForListId, sanitizedName } from './utils/Xcodeproj';\nimport { createInfoPlistPluginWithPropertyGuard, withXcodeProject } from '../plugins/ios-plugins';\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":"
|
|
1
|
+
{"version":3,"file":"Name.js","names":["_Target","data","require","_Xcodeproj","_iosPlugins","withDisplayName","exports","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 type { ExpoConfig } from '@expo/config-types';\nimport type { XcodeProject } from 'xcode';\n\nimport type { InfoPlist } from './IosConfig.types';\nimport { findFirstNativeTarget } from './Target';\nimport type { ConfigPlugin } from '../Plugin.types';\nimport type { ConfigurationSectionEntry } from './utils/Xcodeproj';\nimport { getBuildConfigurationsForListId, sanitizedName } from './utils/Xcodeproj';\nimport { createInfoPlistPluginWithPropertyGuard, withXcodeProject } from '../plugins/ios-plugins';\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":";;;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GAAG;EACrB;EACA,OAAOA,KAAK;AACd,CAAC","ignoreList":[]}
|
package/build/ios/Orientation.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
3
|
+
exports.__esModule = true;
|
|
6
4
|
exports.PORTRAIT_ORIENTATIONS = exports.LANDSCAPE_ORIENTATIONS = void 0;
|
|
7
5
|
exports.getOrientation = getOrientation;
|
|
8
6
|
exports.setOrientation = setOrientation;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Orientation.js","names":["_iosPlugins","data","require","withOrientation","exports","createInfoPlistPluginWithPropertyGuard","setOrientation","infoPlistProperty","expoConfigProperty","getOrientation","config","orientation","PORTRAIT_ORIENTATIONS","LANDSCAPE_ORIENTATIONS","getUISupportedInterfaceOrientations","infoPlist","UISupportedInterfaceOrientations"],"sources":["../../src/ios/Orientation.ts"],"sourcesContent":["import type { ExpoConfig } from '@expo/config-types';\n\nimport type { InfoPlist, InterfaceOrientation } from './IosConfig.types';\nimport { createInfoPlistPluginWithPropertyGuard } from '../plugins/ios-plugins';\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":"
|
|
1
|
+
{"version":3,"file":"Orientation.js","names":["_iosPlugins","data","require","withOrientation","exports","createInfoPlistPluginWithPropertyGuard","setOrientation","infoPlistProperty","expoConfigProperty","getOrientation","config","orientation","PORTRAIT_ORIENTATIONS","LANDSCAPE_ORIENTATIONS","getUISupportedInterfaceOrientations","infoPlist","UISupportedInterfaceOrientations"],"sources":["../../src/ios/Orientation.ts"],"sourcesContent":["import type { ExpoConfig } from '@expo/config-types';\n\nimport type { InfoPlist, InterfaceOrientation } from './IosConfig.types';\nimport { createInfoPlistPluginWithPropertyGuard } from '../plugins/ios-plugins';\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":";;;;;;;AAGA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,MAAME,eAAe,GAAAC,OAAA,CAAAD,eAAA,GAAG,IAAAE,oDAAsC,EACnEC,cAAc,EACd;EACEC,iBAAiB,EAAE,kCAAkC;EACrDC,kBAAkB,EAAE;AACtB,CAAC,EACD,iBACF,CAAC;AAEM,SAASC,cAAcA,CAACC,MAAuC,EAAE;EACtE,OAAOA,MAAM,CAACC,WAAW,IAAI,IAAI;AACnC;AAEO,MAAMC,qBAA6C,GAAAR,OAAA,CAAAQ,qBAAA,GAAG,CAC3D,gCAAgC,EAChC,0CAA0C,CAC3C;AAEM,MAAMC,sBAA8C,GAAAT,OAAA,CAAAS,sBAAA,GAAG,CAC5D,qCAAqC,EACrC,sCAAsC,CACvC;AAED,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,SAASP,cAAcA,CAC5BI,MAAuC,EACvCK,SAAoB,EACT;EACX,MAAMJ,WAAW,GAAGF,cAAc,CAACC,MAAM,CAAC;EAE1C,OAAO;IACL,GAAGK,SAAS;IACZC,gCAAgC,EAAEF,mCAAmC,CAACH,WAAW;EACnF,CAAC;AACH","ignoreList":[]}
|
package/build/ios/Paths.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
3
|
+
exports.__esModule = true;
|
|
6
4
|
exports.findSchemeNames = findSchemeNames;
|
|
7
5
|
exports.findSchemePaths = findSchemePaths;
|
|
8
6
|
exports.getAllEntitlementsPaths = getAllEntitlementsPaths;
|
package/build/ios/Paths.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Paths.js","names":["_fs","data","require","_glob","path","_interopRequireWildcard","Entitlements","_errors","_glob2","_warnings","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ignoredPaths","getAppDelegateHeaderFilePath","projectRoot","using","extra","withSortedGlobResult","globSync","absolute","cwd","ignore","UnexpectedError","length","warnMultipleFiles","tag","fileName","getAppDelegateFilePath","getAppDelegateObjcHeaderFilePath","getPodfilePath","getLanguage","filePath","extension","extname","basename","getFileInfo","normalize","contents","readFileSync","language","getAppDelegate","getSourceRoot","appDelegate","dirname","findSchemePaths","findSchemeNames","schemePaths","map","schemePath","parse","name","getAllXcodeProjectPaths","iosFolder","pbxprojPaths","replace","filter","project","test","sort","a","b","isAInIos","isBInIos","value","join","getXcodeProjectPath","getAllPBXProjectPaths","projectPaths","paths","existsSync","getPBXProjectPath","getAllInfoPlistPaths","getInfoPlistPath","getAllEntitlementsPaths","getEntitlementsPath","getSupportingPath","resolve","getExpoPlistPath","supportingPath","usingPath","relative","extraPaths","v","addWarningIOS","JSON","stringify"],"sources":["../../src/ios/Paths.ts"],"sourcesContent":["import { existsSync, readFileSync } from 'fs';\nimport { globSync } from 'glob';\nimport * as path from 'path';\n\nimport * as Entitlements from './Entitlements';\nimport { UnexpectedError } from '../utils/errors';\nimport { withSortedGlobResult } from '../utils/glob';\nimport { addWarningIOS } from '../utils/warnings';\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' | 'rb';\n\nexport type PodfileProjectFile = ProjectFile<'rb'>;\nexport type AppDelegateProjectFile = ProjectFile<AppleLanguage>;\n\nexport function getAppDelegateHeaderFilePath(projectRoot: string): string {\n const [using, ...extra] = withSortedGlobResult(\n globSync('ios/*/AppDelegate.h', {\n absolute: true,\n cwd: projectRoot,\n ignore: ignoredPaths,\n })\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] = withSortedGlobResult(\n globSync('ios/*/AppDelegate.@(m|mm|swift)', {\n absolute: true,\n cwd: projectRoot,\n ignore: ignoredPaths,\n })\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] = withSortedGlobResult(\n globSync('ios/*/AppDelegate.h', {\n absolute: true,\n cwd: projectRoot,\n ignore: ignoredPaths,\n })\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\nexport function getPodfilePath(projectRoot: string): string {\n const [using, ...extra] = withSortedGlobResult(\n globSync('ios/Podfile', {\n absolute: true,\n cwd: projectRoot,\n ignore: ignoredPaths,\n })\n );\n\n if (!using) {\n throw new UnexpectedError(`Could not locate a valid Podfile at root: \"${projectRoot}\"`);\n }\n\n if (extra.length) {\n warnMultipleFiles({\n tag: 'podfile',\n fileName: 'Podfile',\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 if (!extension && path.basename(filePath) === 'Podfile') {\n return 'rb';\n }\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 withSortedGlobResult(\n globSync('ios/*.xcodeproj/xcshareddata/xcschemes/*.xcscheme', {\n absolute: true,\n cwd: projectRoot,\n ignore: ignoredPaths,\n })\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 = withSortedGlobResult(\n globSync('ios/**/*.xcodeproj', { cwd: projectRoot, ignore: ignoredPaths })\n // Drop leading `/` from glob results to mimick glob@<9 behavior\n .map((filePath) => filePath.replace(/^\\//, ''))\n .filter(\n (project) => !/test|example|sample/i.test(project) || path.dirname(project) === iosFolder\n )\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 = withSortedGlobResult(\n globSync('ios/*/Info.plist', {\n absolute: true,\n cwd: projectRoot,\n ignore: ignoredPaths,\n })\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,SAAAA,IAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,GAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,MAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,KAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,KAAA;EAAA,MAAAH,IAAA,GAAAI,uBAAA,CAAAH,OAAA;EAAAE,IAAA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D;AAEO,SAAS6D,iBAAiBA,CAAC7D,WAAmB,EAAU;EAC7D,OAAO3B,IAAI,CAAD,CAAC,CAACyF,OAAO,CAAC9D,WAAW,EAAE,KAAK,EAAE3B,IAAI,CAAD,CAAC,CAAC+C,QAAQ,CAACO,aAAa,CAAC3B,WAAW,CAAC,CAAC,EAAE,YAAY,CAAC;AAClG;AAEO,SAAS+D,gBAAgBA,CAAC/D,WAAmB,EAAU;EAC5D,MAAMgE,cAAc,GAAGH,iBAAiB,CAAC7D,WAAW,CAAC;EACrD,OAAO3B,IAAI,CAAD,CAAC,CAAC6E,IAAI,CAACc,cAAc,EAAE,YAAY,CAAC;AAChD;AAEA,SAAStD,iBAAiBA,CAAC;EACzBC,GAAG;EACHC,QAAQ;EACRZ,WAAW;EACXC,KAAK;EACLC;AAOF,CAAC,EAAE;EACD,MAAM+D,SAAS,GAAGjE,WAAW,GAAG3B,IAAI,CAAD,CAAC,CAAC6F,QAAQ,CAAClE,WAAW,EAAEC,KAAK,CAAC,GAAGA,KAAK;EACzE,MAAMkE,UAAU,GAAGnE,WAAW,GAAGE,KAAK,CAAC+B,GAAG,CAAEmC,CAAC,IAAK/F,IAAI,CAAD,CAAC,CAAC6F,QAAQ,CAAClE,WAAW,EAAEoE,CAAC,CAAC,CAAC,GAAGlE,KAAK;EACxF,IAAAmE,yBAAa,EACX,SAAS1D,GAAG,EAAE,EACd,kBAAkBC,QAAQ,uBAAuBqD,SAAS,qBAAqBK,IAAI,CAACC,SAAS,CAC3FJ,UACF,CAAC,EACH,CAAC;AACH","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"Paths.js","names":["_fs","data","require","_glob","path","_interopRequireWildcard","Entitlements","_errors","_glob2","_warnings","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ignoredPaths","getAppDelegateHeaderFilePath","projectRoot","using","extra","withSortedGlobResult","globSync","absolute","cwd","ignore","UnexpectedError","length","warnMultipleFiles","tag","fileName","getAppDelegateFilePath","getAppDelegateObjcHeaderFilePath","getPodfilePath","getLanguage","filePath","extension","extname","basename","getFileInfo","normalize","contents","readFileSync","language","getAppDelegate","getSourceRoot","appDelegate","dirname","findSchemePaths","findSchemeNames","schemePaths","map","schemePath","parse","name","getAllXcodeProjectPaths","iosFolder","pbxprojPaths","replace","filter","project","test","sort","a","b","isAInIos","isBInIos","value","join","getXcodeProjectPath","getAllPBXProjectPaths","projectPaths","paths","existsSync","getPBXProjectPath","getAllInfoPlistPaths","getInfoPlistPath","getAllEntitlementsPaths","getEntitlementsPath","getSupportingPath","resolve","getExpoPlistPath","supportingPath","usingPath","relative","extraPaths","v","addWarningIOS","JSON","stringify"],"sources":["../../src/ios/Paths.ts"],"sourcesContent":["import { existsSync, readFileSync } from 'fs';\nimport { globSync } from 'glob';\nimport * as path from 'path';\n\nimport * as Entitlements from './Entitlements';\nimport { UnexpectedError } from '../utils/errors';\nimport { withSortedGlobResult } from '../utils/glob';\nimport { addWarningIOS } from '../utils/warnings';\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' | 'rb';\n\nexport type PodfileProjectFile = ProjectFile<'rb'>;\nexport type AppDelegateProjectFile = ProjectFile<AppleLanguage>;\n\nexport function getAppDelegateHeaderFilePath(projectRoot: string): string {\n const [using, ...extra] = withSortedGlobResult(\n globSync('ios/*/AppDelegate.h', {\n absolute: true,\n cwd: projectRoot,\n ignore: ignoredPaths,\n })\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] = withSortedGlobResult(\n globSync('ios/*/AppDelegate.@(m|mm|swift)', {\n absolute: true,\n cwd: projectRoot,\n ignore: ignoredPaths,\n })\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] = withSortedGlobResult(\n globSync('ios/*/AppDelegate.h', {\n absolute: true,\n cwd: projectRoot,\n ignore: ignoredPaths,\n })\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\nexport function getPodfilePath(projectRoot: string): string {\n const [using, ...extra] = withSortedGlobResult(\n globSync('ios/Podfile', {\n absolute: true,\n cwd: projectRoot,\n ignore: ignoredPaths,\n })\n );\n\n if (!using) {\n throw new UnexpectedError(`Could not locate a valid Podfile at root: \"${projectRoot}\"`);\n }\n\n if (extra.length) {\n warnMultipleFiles({\n tag: 'podfile',\n fileName: 'Podfile',\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 if (!extension && path.basename(filePath) === 'Podfile') {\n return 'rb';\n }\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 withSortedGlobResult(\n globSync('ios/*.xcodeproj/xcshareddata/xcschemes/*.xcscheme', {\n absolute: true,\n cwd: projectRoot,\n ignore: ignoredPaths,\n })\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 = withSortedGlobResult(\n globSync('ios/**/*.xcodeproj', { cwd: projectRoot, ignore: ignoredPaths })\n // Drop leading `/` from glob results to mimick glob@<9 behavior\n .map((filePath) => filePath.replace(/^\\//, ''))\n .filter(\n (project) => !/test|example|sample/i.test(project) || path.dirname(project) === iosFolder\n )\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 = withSortedGlobResult(\n globSync('ios/*/Info.plist', {\n absolute: true,\n cwd: projectRoot,\n ignore: ignoredPaths,\n })\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,SAAAA,IAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,GAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,MAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,KAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,KAAA;EAAA,MAAAH,IAAA,GAAAI,uBAAA,CAAAH,OAAA;EAAAE,IAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAK,aAAA;EAAA,MAAAL,IAAA,GAAAI,uBAAA,CAAAH,OAAA;EAAAI,YAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,QAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,OAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,OAAA;EAAA,MAAAP,IAAA,GAAAC,OAAA;EAAAM,MAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAQ,UAAA;EAAA,MAAAR,IAAA,GAAAC,OAAA;EAAAO,SAAA,YAAAA,CAAA;IAAA,OAAAR,IAAA;EAAA;EAAA,OAAAA,IAAA;AAA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Q,CAAClE,WAAW,EAAEC,KAAK,CAAC,GAAGA,KAAK;EACzE,MAAMkE,UAAU,GAAGnE,WAAW,GAAGE,KAAK,CAAC+B,GAAG,CAAEmC,CAAC,IAAK/F,IAAI,CAAD,CAAC,CAAC6F,QAAQ,CAAClE,WAAW,EAAEoE,CAAC,CAAC,CAAC,GAAGlE,KAAK;EACxF,IAAAmE,yBAAa,EACX,SAAS1D,GAAG,EAAE,EACd,kBAAkBC,QAAQ,uBAAuBqD,SAAS,qBAAqBK,IAAI,CAACC,SAAS,CAC3FJ,UACF,CAAC,EACH,CAAC;AACH","ignoreList":[]}
|
package/build/ios/Permissions.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Permissions.js","names":["_debug","data","_interopRequireDefault","require","_iosPlugins","e","__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 type { InfoPlist } from './IosConfig.types';\nimport type { ConfigPlugin } from '../Plugin.types';\nimport { withInfoPlist } from '../plugins/ios-plugins';\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":"
|
|
1
|
+
{"version":3,"file":"Permissions.js","names":["_debug","data","_interopRequireDefault","require","_iosPlugins","e","__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 type { InfoPlist } from './IosConfig.types';\nimport type { ConfigPlugin } from '../Plugin.types';\nimport { withInfoPlist } from '../plugins/ios-plugins';\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,OAAAA,IAAA;AAAA;AAIA,SAAAG,YAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,WAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAuD,SAAAC,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEvD,MAAMG,KAAK,GAAG,IAAAC,gBAAK,EAAC,qCAAqC,CAAC;AAEnD,SAASC,gBAAgBA,CAC9BC,QAAkB,EAClBC,WAA4D,EAC5DC,SAAoB,EACT;EACX,MAAMC,OAAO,GAAGC,MAAM,CAACD,OAAO,CAACH,QAAQ,CAAC;EACxC,IAAIG,OAAO,CAACE,MAAM,KAAK,CAAC,EAAE;IACxBR,KAAK,CAAC,yBAAyBS,IAAI,CAACC,SAAS,CAACN,WAAW,CAAC,EAAE,CAAC;EAC/D;EACA,KAAK,MAAM,CAACO,UAAU,EAAEC,WAAW,CAAC,IAAIN,OAAO,EAAE;IAC/C,IAAIF,WAAW,CAACO,UAAU,CAAC,KAAK,KAAK,EAAE;MACrCX,KAAK,CAAC,aAAaW,UAAU,GAAG,CAAC;MACjC,OAAON,SAAS,CAACM,UAAU,CAAC;IAC9B,CAAC,MAAM;MACLN,SAAS,CAACM,UAAU,CAAC,GAAGP,WAAW,CAACO,UAAU,CAAC,IAAIN,SAAS,CAACM,UAAU,CAAC,IAAIC,WAAW;MACvFZ,KAAK,CAAC,YAAYW,UAAU,SAASN,SAAS,CAACM,UAAU,CAAC,GA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