@expo/config-plugins
Advanced tools
Comparing version 9.0.15-canary-20250131-5c4e588 to 9.0.15
@@ -20,2 +20,3 @@ import * as Bitcode from './Bitcode'; | ||
import * as Scheme from './Scheme'; | ||
import * as Swift from './Swift'; | ||
import * as Target from './Target'; | ||
@@ -28,2 +29,2 @@ import * as Updates from './Updates'; | ||
export { InfoPlist, ExpoPlist, Entitlements, Paths, Permissions, XcodeUtils }; | ||
export { Bitcode, BundleIdentifier, BuildProperties, BuildScheme, DevelopmentTeam, DeviceFamily, Google, Maps, Locales, Name, Orientation, ProvisioningProfile, RequiresFullScreen, Scheme, Target, Updates, UsesNonExemptEncryption, Version, XcodeProjectFile, PrivacyInfo, }; | ||
export { Bitcode, BundleIdentifier, BuildProperties, BuildScheme, DevelopmentTeam, DeviceFamily, Google, Maps, Locales, Name, Orientation, ProvisioningProfile, RequiresFullScreen, Scheme, Swift, Target, Updates, UsesNonExemptEncryption, Version, XcodeProjectFile, PrivacyInfo, }; |
@@ -20,3 +20,3 @@ "use strict"; | ||
}); | ||
exports.XcodeUtils = exports.XcodeProjectFile = exports.Version = exports.UsesNonExemptEncryption = exports.Updates = exports.Target = exports.Scheme = exports.RequiresFullScreen = exports.ProvisioningProfile = exports.PrivacyInfo = exports.Permissions = exports.Paths = exports.Orientation = exports.Name = exports.Maps = exports.Locales = void 0; | ||
exports.XcodeUtils = exports.XcodeProjectFile = exports.Version = exports.UsesNonExemptEncryption = exports.Updates = exports.Target = exports.Swift = exports.Scheme = exports.RequiresFullScreen = exports.ProvisioningProfile = exports.PrivacyInfo = exports.Permissions = exports.Paths = exports.Orientation = exports.Name = exports.Maps = exports.Locales = void 0; | ||
function Bitcode() { | ||
@@ -263,2 +263,15 @@ const data = _interopRequireWildcard(require("./Bitcode")); | ||
}); | ||
function Swift() { | ||
const data = _interopRequireWildcard(require("./Swift")); | ||
Swift = function () { | ||
return data; | ||
}; | ||
return data; | ||
} | ||
Object.defineProperty(exports, "Swift", { | ||
enumerable: true, | ||
get: function () { | ||
return Swift(); | ||
} | ||
}); | ||
function Target() { | ||
@@ -265,0 +278,0 @@ const data = _interopRequireWildcard(require("./Target")); |
@@ -46,3 +46,3 @@ "use strict"; | ||
const debug = require('debug')('expo:config-plugins:ios:maps'); | ||
const MATCH_INIT = exports.MATCH_INIT = /\bsuper\.application\(\w+?, didFinishLaunchingWithOptions: \w+?\)/g; | ||
const MATCH_INIT = exports.MATCH_INIT = /-\s*\(BOOL\)\s*application:\s*\(UIApplication\s*\*\s*\)\s*\w+\s+didFinishLaunchingWithOptions:/g; | ||
const withGoogleMapsKey = (0, _iosPlugins().createInfoPlistPlugin)(setGoogleMapsApiKey, 'withGoogleMapsKey'); | ||
@@ -83,3 +83,4 @@ const withMaps = config => { | ||
function addGoogleMapsAppDelegateImport(src) { | ||
const newSrc = ['#if canImport(GoogleMaps)', 'import GoogleMaps', '#endif']; | ||
const newSrc = []; | ||
newSrc.push('#if __has_include(<GoogleMaps/GoogleMaps.h>)', '#import <GoogleMaps/GoogleMaps.h>', '#endif'); | ||
return (0, _generateCode().mergeContents)({ | ||
@@ -89,4 +90,4 @@ tag: 'react-native-maps-import', | ||
newSrc: newSrc.join('\n'), | ||
anchor: /@UIApplicationMain/, | ||
offset: 0, | ||
anchor: /#import "AppDelegate\.h"/, | ||
offset: 1, | ||
comment: '//' | ||
@@ -102,3 +103,4 @@ }); | ||
function addGoogleMapsAppDelegateInit(src, apiKey) { | ||
const newSrc = ['#if canImport(GoogleMaps)', `GMSServices.provideAPIKey("${apiKey}")`, '#endif']; | ||
const newSrc = []; | ||
newSrc.push('#if __has_include(<GoogleMaps/GoogleMaps.h>)', ` [GMSServices provideAPIKey:@"${apiKey}"];`, '#endif'); | ||
return (0, _generateCode().mergeContents)({ | ||
@@ -109,3 +111,3 @@ tag: 'react-native-maps-init', | ||
anchor: MATCH_INIT, | ||
offset: 0, | ||
offset: 2, | ||
comment: '//' | ||
@@ -193,19 +195,20 @@ }); | ||
return (0, _iosPlugins().withAppDelegate)(config, config => { | ||
if (!apiKey || !isReactNativeMapsAutolinked(config) || !isReactNativeMapsInstalled(config.modRequest.projectRoot)) { | ||
config.modResults.contents = removeGoogleMapsAppDelegateImport(config.modResults.contents).contents; | ||
config.modResults.contents = removeGoogleMapsAppDelegateInit(config.modResults.contents).contents; | ||
return config; | ||
} | ||
if (config.modResults.language !== 'swift') { | ||
if (['objc', 'objcpp'].includes(config.modResults.language)) { | ||
if (apiKey && isReactNativeMapsAutolinked(config) && isReactNativeMapsInstalled(config.modRequest.projectRoot)) { | ||
try { | ||
config.modResults.contents = addGoogleMapsAppDelegateImport(config.modResults.contents).contents; | ||
config.modResults.contents = addGoogleMapsAppDelegateInit(config.modResults.contents, apiKey).contents; | ||
} catch (error) { | ||
if (error.code === 'ERR_NO_MATCH') { | ||
throw new Error(`Cannot add Google Maps to the project's AppDelegate because it's malformed. Please report this with a copy of your project AppDelegate.`); | ||
} | ||
throw error; | ||
} | ||
} else { | ||
config.modResults.contents = removeGoogleMapsAppDelegateImport(config.modResults.contents).contents; | ||
config.modResults.contents = removeGoogleMapsAppDelegateInit(config.modResults.contents).contents; | ||
} | ||
} else { | ||
throw new Error(`Cannot setup Google Maps because the project AppDelegate is not a supported language: ${config.modResults.language}`); | ||
} | ||
try { | ||
config.modResults.contents = addGoogleMapsAppDelegateImport(config.modResults.contents).contents; | ||
config.modResults.contents = addGoogleMapsAppDelegateInit(config.modResults.contents, apiKey).contents; | ||
} catch (error) { | ||
if (error.code === 'ERR_NO_MATCH') { | ||
throw new Error(`Cannot add Google Maps to the project's AppDelegate because it's malformed. Please report this with a copy of your project AppDelegate.`); | ||
} | ||
throw error; | ||
} | ||
return config; | ||
@@ -212,0 +215,0 @@ }); |
import { ExpoConfig } from '@expo/config-types'; | ||
import { InfoPlist } from './IosConfig.types'; | ||
export declare const withRequiresFullScreen: import("..").ConfigPlugin; | ||
export declare function getRequiresFullScreen(config: Pick<ExpoConfig, 'ios' | 'sdkVersion'>): boolean; | ||
export declare function setRequiresFullScreen(config: Pick<ExpoConfig, 'ios'>, infoPlist: InfoPlist): InfoPlist; |
@@ -6,2 +6,3 @@ "use strict"; | ||
}); | ||
exports.getRequiresFullScreen = getRequiresFullScreen; | ||
exports.setRequiresFullScreen = setRequiresFullScreen; | ||
@@ -16,2 +17,9 @@ exports.withRequiresFullScreen = void 0; | ||
} | ||
function _versions() { | ||
const data = require("../utils/versions"); | ||
_versions = function () { | ||
return data; | ||
}; | ||
return data; | ||
} | ||
function _warnings() { | ||
@@ -25,2 +33,21 @@ const data = require("../utils/warnings"); | ||
const withRequiresFullScreen = exports.withRequiresFullScreen = (0, _iosPlugins().createInfoPlistPlugin)(setRequiresFullScreen, 'withRequiresFullScreen'); | ||
// NOTES: This is defaulted to `true` for now to match the behavior prior to SDK | ||
// 34, but will change to `false` in SDK +43. | ||
function getRequiresFullScreen(config) { | ||
// Yes, the property is called ios.requireFullScreen, without the s - not "requires" | ||
// This is confusing indeed because the actual property name does have the s | ||
if (config.ios?.hasOwnProperty('requireFullScreen')) { | ||
return !!config.ios.requireFullScreen; | ||
} else { | ||
// In SDK 43, the `requireFullScreen` default has been changed to false. | ||
if ((0, _versions().gteSdkVersion)(config, '43.0.0') | ||
// TODO: Uncomment after SDK 43 is released. | ||
// || !config.sdkVersion | ||
) { | ||
return false; | ||
} | ||
return true; | ||
} | ||
} | ||
const iPadInterfaceKey = 'UISupportedInterfaceOrientations~ipad'; | ||
@@ -61,5 +88,4 @@ const requiredIPadInterface = ['UIInterfaceOrientationPortrait', 'UIInterfaceOrientationPortraitUpsideDown', 'UIInterfaceOrientationLandscapeLeft', 'UIInterfaceOrientationLandscapeRight']; | ||
function setRequiresFullScreen(config, infoPlist) { | ||
const requiresFullScreen = !!config.ios?.requireFullScreen; | ||
const isTabletEnabled = config.ios?.supportsTablet || config.ios?.isTabletOnly; | ||
if (isTabletEnabled && !requiresFullScreen) { | ||
const requiresFullScreen = getRequiresFullScreen(config); | ||
if (!requiresFullScreen) { | ||
const existing = resolveExistingIpadInterfaceOrientations(infoPlist[iPadInterfaceKey]); | ||
@@ -66,0 +92,0 @@ |
@@ -70,5 +70,2 @@ "use strict"; | ||
} | ||
if (!('_' in string)) { | ||
throw new Error(`Empty string resource not supported: ${JSON.stringify(string)}`); | ||
} | ||
string._ = unescapeAndroidString(string._); | ||
@@ -75,0 +72,0 @@ } |
{ | ||
"name": "@expo/config-plugins", | ||
"version": "9.0.15-canary-20250131-5c4e588", | ||
"version": "9.0.15", | ||
"description": "A library for Expo config plugins", | ||
@@ -36,5 +36,5 @@ "main": "build/index.js", | ||
"dependencies": { | ||
"@expo/config-types": "53.0.0-canary-20250131-5c4e588", | ||
"@expo/json-file": "9.0.2-canary-20250131-5c4e588", | ||
"@expo/plist": "0.2.2-canary-20250131-5c4e588", | ||
"@expo/config-types": "^52.0.4", | ||
"@expo/json-file": "~9.0.1", | ||
"@expo/plist": "^0.2.1", | ||
"@expo/sdk-runtime-versions": "^1.0.0", | ||
@@ -56,7 +56,8 @@ "chalk": "^4.1.2", | ||
"@types/xml2js": "~0.4.11", | ||
"expo-module-scripts": "4.0.4-canary-20250131-5c4e588" | ||
"expo-module-scripts": "^4.0.3" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
} | ||
}, | ||
"gitHead": "9442f00874e0cd738030abae80e5bdef184a2581" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
1135020
261
13199
0
20
+ Added@expo/config-types@52.0.4(transitive)
+ Added@expo/json-file@9.0.1(transitive)
+ Added@expo/plist@0.2.1(transitive)
- Removed@expo/config-types@53.0.0-canary-20250131-5c4e588(transitive)
- Removed@expo/json-file@9.0.2-canary-20250131-5c4e588(transitive)
- Removed@expo/plist@0.2.2-canary-20250131-5c4e588(transitive)
Updated@expo/config-types@^52.0.4
Updated@expo/json-file@~9.0.1
Updated@expo/plist@^0.2.1