@expo/config-plugins
Advanced tools
Comparing version 0.0.1-canary-20240109-93608d8 to 0.0.1-canary-20240222-c729a13
@@ -24,9 +24,7 @@ "use strict"; | ||
} | ||
const withAllowBackup = (0, _androidPlugins().createAndroidManifestPlugin)(setAllowBackup, 'withAllowBackup'); | ||
exports.withAllowBackup = withAllowBackup; | ||
const withAllowBackup = exports.withAllowBackup = (0, _androidPlugins().createAndroidManifestPlugin)(setAllowBackup, 'withAllowBackup'); | ||
function getAllowBackup(config) { | ||
var _config$android$allow, _config$android; | ||
// Defaults to true. | ||
// https://docs.expo.dev/versions/latest/config/app/#allowbackup | ||
return (_config$android$allow = (_config$android = config.android) === null || _config$android === void 0 ? void 0 : _config$android.allowBackup) !== null && _config$android$allow !== void 0 ? _config$android$allow : true; | ||
return config.android?.allowBackup ?? true; | ||
} | ||
@@ -36,3 +34,3 @@ function setAllowBackup(config, androidManifest) { | ||
const mainApplication = (0, _Manifest().getMainApplication)(androidManifest); | ||
if (mainApplication !== null && mainApplication !== void 0 && mainApplication.$) { | ||
if (mainApplication?.$) { | ||
mainApplication.$['android:allowBackup'] = String(allowBackup); | ||
@@ -44,3 +42,3 @@ } | ||
const mainApplication = (0, _Manifest().getMainApplication)(androidManifest); | ||
if (mainApplication !== null && mainApplication !== void 0 && mainApplication.$) { | ||
if (mainApplication?.$) { | ||
return String(mainApplication.$['android:allowBackup']) === 'true'; | ||
@@ -47,0 +45,0 @@ } |
@@ -34,3 +34,3 @@ "use strict"; | ||
const withUnknown = (config, sourceConfig) => (0, _androidPlugins().withGradleProperties)(config, config => { | ||
config.modResults = updateAndroidBuildPropertiesFromConfig(sourceConfig !== null && sourceConfig !== void 0 ? sourceConfig : config, config.modResults, configToPropertyRules); | ||
config.modResults = updateAndroidBuildPropertiesFromConfig(sourceConfig ?? config, config.modResults, configToPropertyRules); | ||
return config; | ||
@@ -49,10 +49,6 @@ }); | ||
*/ | ||
const withJsEngineGradleProps = createBuildGradlePropsConfigPlugin([{ | ||
const withJsEngineGradleProps = exports.withJsEngineGradleProps = createBuildGradlePropsConfigPlugin([{ | ||
propName: 'hermesEnabled', | ||
propValueGetter: config => { | ||
var _ref, _config$android$jsEng, _config$android; | ||
return (((_ref = (_config$android$jsEng = (_config$android = config.android) === null || _config$android === void 0 ? void 0 : _config$android.jsEngine) !== null && _config$android$jsEng !== void 0 ? _config$android$jsEng : config.jsEngine) !== null && _ref !== void 0 ? _ref : 'hermes') === 'hermes').toString(); | ||
} | ||
propValueGetter: config => ((config.android?.jsEngine ?? config.jsEngine ?? 'hermes') === 'hermes').toString() | ||
}], 'withJsEngineGradleProps'); | ||
exports.withJsEngineGradleProps = withJsEngineGradleProps; | ||
function updateAndroidBuildPropertiesFromConfig(config, gradleProperties, configToPropertyRules) { | ||
@@ -79,3 +75,3 @@ for (const configToProperty of configToPropertyRules) { | ||
} | ||
} else if (options !== null && options !== void 0 && options.removePropWhenValueIsNull && oldPropIndex >= 0) { | ||
} else if (options?.removePropWhenValueIsNull && oldPropIndex >= 0) { | ||
gradleProperties.splice(oldPropIndex, 1); | ||
@@ -82,0 +78,0 @@ } |
@@ -35,4 +35,3 @@ "use strict"; | ||
function setColorItem(itemToAdd, colorFileContentsJSON) { | ||
var _colorFileContentsJSO; | ||
if ((_colorFileContentsJSO = colorFileContentsJSON.resources) !== null && _colorFileContentsJSO !== void 0 && _colorFileContentsJSO.color) { | ||
if (colorFileContentsJSON.resources?.color) { | ||
const colorNameExists = colorFileContentsJSON.resources.color.filter(e => e.$.name === itemToAdd.$.name)[0]; | ||
@@ -54,4 +53,3 @@ if (colorNameExists) { | ||
function removeColorItem(named, contents) { | ||
var _contents$resources; | ||
if ((_contents$resources = contents.resources) !== null && _contents$resources !== void 0 && _contents$resources.color) { | ||
if (contents.resources?.color) { | ||
const index = contents.resources.color.findIndex(e => e.$.name === named); | ||
@@ -91,4 +89,3 @@ if (index > -1) { | ||
function getColorsAsObject(xml) { | ||
var _xml$resources; | ||
if (!(xml !== null && xml !== void 0 && (_xml$resources = xml.resources) !== null && _xml$resources !== void 0 && _xml$resources.color)) { | ||
if (!xml?.resources?.color) { | ||
return null; | ||
@@ -95,0 +92,0 @@ } |
@@ -37,4 +37,4 @@ "use strict"; | ||
} | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } | ||
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -41,0 +41,0 @@ const APPLY_EAS_GRADLE = 'apply from: "./eas-build.gradle"'; |
@@ -7,3 +7,3 @@ "use strict"; | ||
exports.default = void 0; | ||
var _default = `// Build integration with EAS | ||
var _default = exports.default = `// Build integration with EAS | ||
@@ -83,3 +83,2 @@ import java.nio.file.Paths | ||
`; | ||
exports.default = _default; | ||
//# sourceMappingURL=EasBuildGradleScript.js.map |
@@ -25,7 +25,5 @@ "use strict"; | ||
const LIB_HTTP = 'org.apache.http.legacy'; | ||
const withGoogleMapsApiKey = (0, _androidPlugins().createAndroidManifestPlugin)(setGoogleMapsApiKey, 'withGoogleMapsApiKey'); | ||
exports.withGoogleMapsApiKey = withGoogleMapsApiKey; | ||
const withGoogleMapsApiKey = exports.withGoogleMapsApiKey = (0, _androidPlugins().createAndroidManifestPlugin)(setGoogleMapsApiKey, 'withGoogleMapsApiKey'); | ||
function getGoogleMapsApiKey(config) { | ||
var _config$android$confi, _config$android, _config$android$confi2, _config$android$confi3; | ||
return (_config$android$confi = (_config$android = config.android) === null || _config$android === void 0 ? void 0 : (_config$android$confi2 = _config$android.config) === null || _config$android$confi2 === void 0 ? void 0 : (_config$android$confi3 = _config$android$confi2.googleMaps) === null || _config$android$confi3 === void 0 ? void 0 : _config$android$confi3.apiKey) !== null && _config$android$confi !== void 0 ? _config$android$confi : null; | ||
return config.android?.config?.googleMaps?.apiKey ?? null; | ||
} | ||
@@ -32,0 +30,0 @@ function setGoogleMapsApiKey(config, androidManifest) { |
@@ -87,4 +87,3 @@ "use strict"; | ||
function getGoogleServicesFilePath(config) { | ||
var _config$android$googl, _config$android; | ||
return (_config$android$googl = (_config$android = config.android) === null || _config$android === void 0 ? void 0 : _config$android.googleServicesFile) !== null && _config$android$googl !== void 0 ? _config$android$googl : null; | ||
return config.android?.googleServicesFile ?? null; | ||
} | ||
@@ -91,0 +90,0 @@ async function setGoogleServicesFile(config, projectRoot, targetPath = DEFAULT_TARGET_PATH) { |
@@ -306,4 +306,4 @@ "use strict"; | ||
}); | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } | ||
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } | ||
//# sourceMappingURL=index.js.map |
@@ -25,18 +25,12 @@ "use strict"; | ||
const GENERATED_TAG = 'data-generated'; | ||
const withAndroidIntentFilters = (0, _androidPlugins().createAndroidManifestPlugin)(setAndroidIntentFilters, 'withAndroidIntentFilters'); | ||
exports.withAndroidIntentFilters = withAndroidIntentFilters; | ||
const withAndroidIntentFilters = exports.withAndroidIntentFilters = (0, _androidPlugins().createAndroidManifestPlugin)(setAndroidIntentFilters, 'withAndroidIntentFilters'); | ||
function getIntentFilters(config) { | ||
var _config$android$inten, _config$android; | ||
return (_config$android$inten = (_config$android = config.android) === null || _config$android === void 0 ? void 0 : _config$android.intentFilters) !== null && _config$android$inten !== void 0 ? _config$android$inten : []; | ||
return config.android?.intentFilters ?? []; | ||
} | ||
function setAndroidIntentFilters(config, androidManifest) { | ||
var _mainActivity$intent, _mainActivity$intent2; | ||
// Always ensure old tags are removed. | ||
const mainActivity = (0, _Manifest().getMainActivityOrThrow)(androidManifest); | ||
// Remove all generated tags from previous runs... | ||
if ((_mainActivity$intent = mainActivity['intent-filter']) !== null && _mainActivity$intent !== void 0 && _mainActivity$intent.length) { | ||
mainActivity['intent-filter'] = mainActivity['intent-filter'].filter(value => { | ||
var _value$$; | ||
return ((_value$$ = value.$) === null || _value$$ === void 0 ? void 0 : _value$$[GENERATED_TAG]) !== 'true'; | ||
}); | ||
if (mainActivity['intent-filter']?.length) { | ||
mainActivity['intent-filter'] = mainActivity['intent-filter'].filter(value => value.$?.[GENERATED_TAG] !== 'true'); | ||
} | ||
@@ -47,3 +41,3 @@ const intentFilters = getIntentFilters(config); | ||
} | ||
mainActivity['intent-filter'] = (_mainActivity$intent2 = mainActivity['intent-filter']) === null || _mainActivity$intent2 === void 0 ? void 0 : _mainActivity$intent2.concat(renderIntentFilters(intentFilters)); | ||
mainActivity['intent-filter'] = mainActivity['intent-filter']?.concat(renderIntentFilters(intentFilters)); | ||
return androidManifest; | ||
@@ -76,3 +70,3 @@ } | ||
return (Array.isArray(data) ? data : [data]).filter(Boolean).map(datum => ({ | ||
$: Object.entries(datum !== null && datum !== void 0 ? datum : {}).reduce((prev, [key, value]) => ({ | ||
$: Object.entries(datum ?? {}).reduce((prev, [key, value]) => ({ | ||
...prev, | ||
@@ -79,0 +73,0 @@ [`android:${key}`]: value |
@@ -60,2 +60,3 @@ export type StringBoolean = 'true' | 'false'; | ||
'android:requestLegacyExternalStorage'?: StringBoolean; | ||
'android:supportsPictureInPicture'?: StringBoolean; | ||
'android:usesCleartextTraffic'?: StringBoolean; | ||
@@ -62,0 +63,0 @@ [key: string]: string | undefined; |
@@ -50,4 +50,4 @@ "use strict"; | ||
} | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } | ||
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -77,7 +77,3 @@ async function writeAndroidManifestAsync(manifestPath, androidManifest) { | ||
function getMainApplication(androidManifest) { | ||
var _androidManifest$mani, _androidManifest$mani2, _androidManifest$mani3; | ||
return (_androidManifest$mani = androidManifest === null || androidManifest === void 0 ? void 0 : (_androidManifest$mani2 = androidManifest.manifest) === null || _androidManifest$mani2 === void 0 ? void 0 : (_androidManifest$mani3 = _androidManifest$mani2.application) === null || _androidManifest$mani3 === void 0 ? void 0 : _androidManifest$mani3.filter(e => { | ||
var _e$$; | ||
return e === null || e === void 0 ? void 0 : (_e$$ = e.$) === null || _e$$ === void 0 ? void 0 : _e$$['android:name'].endsWith('.MainApplication'); | ||
})[0]) !== null && _androidManifest$mani !== void 0 ? _androidManifest$mani : null; | ||
return androidManifest?.manifest?.application?.filter(e => e?.$?.['android:name'].endsWith('.MainApplication'))[0] ?? null; | ||
} | ||
@@ -95,5 +91,4 @@ function getMainApplicationOrThrow(androidManifest) { | ||
function getRunnableActivity(androidManifest) { | ||
var _androidManifest$mani4, _androidManifest$mani5, _androidManifest$mani6, _androidManifest$mani7, _androidManifest$mani8; | ||
// Get enabled activities | ||
const enabledActivities = androidManifest === null || androidManifest === void 0 ? void 0 : (_androidManifest$mani4 = androidManifest.manifest) === null || _androidManifest$mani4 === void 0 ? void 0 : (_androidManifest$mani5 = _androidManifest$mani4.application) === null || _androidManifest$mani5 === void 0 ? void 0 : (_androidManifest$mani6 = _androidManifest$mani5[0]) === null || _androidManifest$mani6 === void 0 ? void 0 : (_androidManifest$mani7 = _androidManifest$mani6.activity) === null || _androidManifest$mani7 === void 0 ? void 0 : (_androidManifest$mani8 = _androidManifest$mani7.filter) === null || _androidManifest$mani8 === void 0 ? void 0 : _androidManifest$mani8.call(_androidManifest$mani7, e => e.$['android:enabled'] !== 'false' && e.$['android:enabled'] !== false); | ||
const enabledActivities = androidManifest?.manifest?.application?.[0]?.activity?.filter?.(e => e.$['android:enabled'] !== 'false' && e.$['android:enabled'] !== false); | ||
if (!enabledActivities) { | ||
@@ -107,4 +102,3 @@ return null; | ||
for (const intentFilter of activity['intent-filter']) { | ||
var _intentFilter$action, _intentFilter$categor; | ||
if ((_intentFilter$action = intentFilter.action) !== null && _intentFilter$action !== void 0 && _intentFilter$action.find(action => action.$['android:name'] === 'android.intent.action.MAIN') && (_intentFilter$categor = intentFilter.category) !== null && _intentFilter$categor !== void 0 && _intentFilter$categor.find(category => category.$['android:name'] === 'android.intent.category.LAUNCHER')) { | ||
if (intentFilter.action?.find(action => action.$['android:name'] === 'android.intent.action.MAIN') && intentFilter.category?.find(category => category.$['android:name'] === 'android.intent.category.LAUNCHER')) { | ||
return activity; | ||
@@ -118,5 +112,4 @@ } | ||
function getMainActivity(androidManifest) { | ||
var _androidManifest$mani9, _androidManifest$mani10, _androidManifest$mani11, _androidManifest$mani12, _androidManifest$mani13, _mainActivity$; | ||
const mainActivity = androidManifest === null || androidManifest === void 0 ? void 0 : (_androidManifest$mani9 = androidManifest.manifest) === null || _androidManifest$mani9 === void 0 ? void 0 : (_androidManifest$mani10 = _androidManifest$mani9.application) === null || _androidManifest$mani10 === void 0 ? void 0 : (_androidManifest$mani11 = _androidManifest$mani10[0]) === null || _androidManifest$mani11 === void 0 ? void 0 : (_androidManifest$mani12 = _androidManifest$mani11.activity) === null || _androidManifest$mani12 === void 0 ? void 0 : (_androidManifest$mani13 = _androidManifest$mani12.filter) === null || _androidManifest$mani13 === void 0 ? void 0 : _androidManifest$mani13.call(_androidManifest$mani12, e => e.$['android:name'] === '.MainActivity'); | ||
return (_mainActivity$ = mainActivity === null || mainActivity === void 0 ? void 0 : mainActivity[0]) !== null && _mainActivity$ !== void 0 ? _mainActivity$ : null; | ||
const mainActivity = androidManifest?.manifest?.application?.[0]?.activity?.filter?.(e => e.$['android:name'] === '.MainActivity'); | ||
return mainActivity?.[0] ?? null; | ||
} | ||
@@ -145,3 +138,3 @@ function addMetaDataItemToMainApplication(mainApplication, itemName, itemValue, itemType = 'value') { | ||
const index = findMetaDataItem(mainApplication, itemName); | ||
if (mainApplication !== null && mainApplication !== void 0 && mainApplication['meta-data'] && index > -1) { | ||
if (mainApplication?.['meta-data'] && index > -1) { | ||
mainApplication['meta-data'].splice(index, 1); | ||
@@ -167,6 +160,5 @@ } | ||
const mainApplication = getMainApplication(androidManifest); | ||
if (mainApplication !== null && mainApplication !== void 0 && mainApplication.hasOwnProperty('meta-data')) { | ||
var _mainApplication$meta, _item$$$androidValue; | ||
const item = mainApplication === null || mainApplication === void 0 ? void 0 : (_mainApplication$meta = mainApplication['meta-data']) === null || _mainApplication$meta === void 0 ? void 0 : _mainApplication$meta.find(e => e.$['android:name'] === name); | ||
return (_item$$$androidValue = item === null || item === void 0 ? void 0 : item.$['android:value']) !== null && _item$$$androidValue !== void 0 ? _item$$$androidValue : null; | ||
if (mainApplication?.hasOwnProperty('meta-data')) { | ||
const item = mainApplication?.['meta-data']?.find(e => e.$['android:name'] === name); | ||
return item?.$['android:value'] ?? null; | ||
} | ||
@@ -194,3 +186,3 @@ return null; | ||
const index = findUsesLibraryItem(mainApplication, itemName); | ||
if (mainApplication !== null && mainApplication !== void 0 && mainApplication['uses-library'] && index > -1) { | ||
if (mainApplication?.['uses-library'] && index > -1) { | ||
mainApplication['uses-library'].splice(index, 1); | ||
@@ -231,4 +223,3 @@ } | ||
}) { | ||
var _manifest$manifest, _manifest$manifest$$; | ||
if (manifest !== null && manifest !== void 0 && (_manifest$manifest = manifest.manifest) !== null && _manifest$manifest !== void 0 && (_manifest$manifest$$ = _manifest$manifest.$) !== null && _manifest$manifest$$ !== void 0 && _manifest$manifest$$[namespace]) { | ||
if (manifest?.manifest?.$?.[namespace]) { | ||
return manifest; | ||
@@ -235,0 +226,0 @@ } |
@@ -53,4 +53,3 @@ "use strict"; | ||
} | ||
const withName = (0, _androidPlugins().createStringsXmlPlugin)(applyNameFromConfig, 'withName'); | ||
exports.withName = withName; | ||
const withName = exports.withName = (0, _androidPlugins().createStringsXmlPlugin)(applyNameFromConfig, 'withName'); | ||
const withNameSettingsGradle = config => { | ||
@@ -88,4 +87,3 @@ return (0, _androidPlugins().withSettingsGradle)(config, config => { | ||
function applyNameSettingsGradle(config, settingsGradle) { | ||
var _getName; | ||
const name = sanitizeNameForGradle((_getName = getName(config)) !== null && _getName !== void 0 ? _getName : ''); | ||
const name = sanitizeNameForGradle(getName(config) ?? ''); | ||
@@ -92,0 +90,0 @@ // Select rootProject.name = '***' and replace the contents between the quotes. |
@@ -24,6 +24,4 @@ "use strict"; | ||
} | ||
const SCREEN_ORIENTATION_ATTRIBUTE = 'android:screenOrientation'; | ||
exports.SCREEN_ORIENTATION_ATTRIBUTE = SCREEN_ORIENTATION_ATTRIBUTE; | ||
const withOrientation = (0, _androidPlugins().createAndroidManifestPlugin)(setAndroidOrientation, 'withOrientation'); | ||
exports.withOrientation = withOrientation; | ||
const SCREEN_ORIENTATION_ATTRIBUTE = exports.SCREEN_ORIENTATION_ATTRIBUTE = 'android:screenOrientation'; | ||
const withOrientation = exports.withOrientation = (0, _androidPlugins().createAndroidManifestPlugin)(setAndroidOrientation, 'withOrientation'); | ||
function getOrientation(config) { | ||
@@ -30,0 +28,0 @@ return typeof config.orientation === 'string' ? config.orientation : null; |
@@ -97,4 +97,3 @@ "use strict"; | ||
function getPackage(config) { | ||
var _config$android$packa, _config$android; | ||
return (_config$android$packa = (_config$android = config.android) === null || _config$android === void 0 ? void 0 : _config$android.package) !== null && _config$android$packa !== void 0 ? _config$android$packa : null; | ||
return config.android?.package ?? null; | ||
} | ||
@@ -275,3 +274,2 @@ function getPackageRoot(projectRoot, type) { | ||
async function getApplicationIdAsync(projectRoot) { | ||
var _matchResult$; | ||
const buildGradlePath = (0, _Paths().getAppBuildGradleFilePath)(projectRoot); | ||
@@ -284,3 +282,3 @@ if (!_fs().default.existsSync(buildGradlePath)) { | ||
// TODO add fallback for legacy cases to read from AndroidManifest.xml | ||
return (_matchResult$ = matchResult === null || matchResult === void 0 ? void 0 : matchResult[1]) !== null && _matchResult$ !== void 0 ? _matchResult$ : null; | ||
return matchResult?.[1] ?? null; | ||
} | ||
@@ -287,0 +285,0 @@ |
@@ -63,4 +63,4 @@ "use strict"; | ||
} | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } | ||
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -67,0 +67,0 @@ function getProjectFilePath(projectRoot, name) { |
@@ -51,5 +51,4 @@ "use strict"; | ||
const withBlockedPermissions = (config, permissions) => { | ||
var _config$android; | ||
const resolvedPermissions = prefixAndroidPermissionsIfNecessary((Array.isArray(permissions) ? permissions : [permissions]).filter(Boolean)); | ||
if (config !== null && config !== void 0 && (_config$android = config.android) !== null && _config$android !== void 0 && _config$android.permissions && Array.isArray(config.android.permissions)) { | ||
if (config?.android?.permissions && Array.isArray(config.android.permissions)) { | ||
// Remove any static config permissions | ||
@@ -66,6 +65,5 @@ config.android.permissions = prefixAndroidPermissionsIfNecessary(config.android.permissions).filter(permission => !resolvedPermissions.includes(permission)); | ||
const withInternalBlockedPermissions = config => { | ||
var _config$android2, _config$android2$bloc; | ||
// Only add permissions if the user defined the property and added some values | ||
// this ensures we don't add the `tools:*` namespace extraneously. | ||
if ((_config$android2 = config.android) !== null && _config$android2 !== void 0 && (_config$android2$bloc = _config$android2.blockedPermissions) !== null && _config$android2$bloc !== void 0 && _config$android2$bloc.length) { | ||
if (config.android?.blockedPermissions?.length) { | ||
return withBlockedPermissions(config, config.android.blockedPermissions); | ||
@@ -117,7 +115,5 @@ } | ||
function getAndroidPermissions(config) { | ||
var _config$android$permi, _config$android3; | ||
return (_config$android$permi = (_config$android3 = config.android) === null || _config$android3 === void 0 ? void 0 : _config$android3.permissions) !== null && _config$android$permi !== void 0 ? _config$android$permi : []; | ||
return config.android?.permissions ?? []; | ||
} | ||
function setAndroidPermissions(config, androidManifest) { | ||
var _androidManifest$mani; | ||
const permissions = getAndroidPermissions(config); | ||
@@ -131,3 +127,3 @@ const providedPermissions = prefixAndroidPermissionsIfNecessary(permissions); | ||
const manifestPermissions = (_androidManifest$mani = androidManifest.manifest['uses-permission']) !== null && _androidManifest$mani !== void 0 ? _androidManifest$mani : []; | ||
const manifestPermissions = androidManifest.manifest['uses-permission'] ?? []; | ||
permissionsToAdd.forEach(permission => { | ||
@@ -134,0 +130,0 @@ if (!isPermissionAlreadyRequested(permission, manifestPermissions)) { |
@@ -60,5 +60,4 @@ "use strict"; | ||
function getPrimaryColor(config) { | ||
var _config$primaryColor; | ||
return (_config$primaryColor = config.primaryColor) !== null && _config$primaryColor !== void 0 ? _config$primaryColor : DEFAULT_PRIMARY_COLOR; | ||
return config.primaryColor ?? DEFAULT_PRIMARY_COLOR; | ||
} | ||
//# sourceMappingURL=PrimaryColor.js.map |
@@ -21,2 +21,6 @@ "use strict"; | ||
} | ||
/** | ||
* Name of the resource folder. | ||
*/ | ||
const fallbackResourceString = `<?xml version="1.0" encoding="utf-8"?><resources></resources>`; | ||
@@ -90,3 +94,2 @@ | ||
function buildResourceGroup(parent) { | ||
var _parent$items; | ||
return { | ||
@@ -97,8 +100,7 @@ $: { | ||
}, | ||
item: (_parent$items = parent.items) !== null && _parent$items !== void 0 ? _parent$items : [] | ||
item: parent.items ?? [] | ||
}; | ||
} | ||
function findResourceGroup(xml, group) { | ||
var _xml$filter, _xml$filter$call; | ||
const app = xml === null || xml === void 0 ? void 0 : (_xml$filter = xml.filter) === null || _xml$filter === void 0 ? void 0 : (_xml$filter$call = _xml$filter.call(xml, ({ | ||
const app = xml?.filter?.(({ | ||
$: head | ||
@@ -111,4 +113,4 @@ }) => { | ||
return matches; | ||
})) === null || _xml$filter$call === void 0 ? void 0 : _xml$filter$call[0]; | ||
return app !== null && app !== void 0 ? app : null; | ||
})?.[0]; | ||
return app ?? null; | ||
} | ||
@@ -115,0 +117,0 @@ |
@@ -28,4 +28,3 @@ "use strict"; | ||
} | ||
const withScheme = (0, _androidPlugins().createAndroidManifestPlugin)(setScheme, 'withScheme'); | ||
exports.withScheme = withScheme; | ||
const withScheme = exports.withScheme = (0, _androidPlugins().createAndroidManifestPlugin)(setScheme, 'withScheme'); | ||
function getScheme(config) { | ||
@@ -45,8 +44,7 @@ if (Array.isArray(config.scheme)) { | ||
function setScheme(config, androidManifest) { | ||
var _config$android, _config$android2; | ||
const schemes = [...getScheme(config), | ||
// @ts-ignore: TODO: android.scheme is an unreleased -- harder to add to turtle v1. | ||
...getScheme((_config$android = config.android) !== null && _config$android !== void 0 ? _config$android : {})]; | ||
...getScheme(config.android ?? {})]; | ||
// Add the package name to the list of schemes for easier Google auth and parity with Turtle v1. | ||
if ((_config$android2 = config.android) !== null && _config$android2 !== void 0 && _config$android2.package) { | ||
if (config.android?.package) { | ||
schemes.push(config.android.package); | ||
@@ -82,21 +80,8 @@ } | ||
function propertiesFromIntentFilter(intentFilter) { | ||
var _intentFilter$action$, _intentFilter$action, _intentFilter$categor, _intentFilter$categor2, _intentFilter$data$fi, _intentFilter$data, _intentFilter$data$fi2; | ||
const actions = (_intentFilter$action$ = intentFilter === null || intentFilter === void 0 ? void 0 : (_intentFilter$action = intentFilter.action) === null || _intentFilter$action === void 0 ? void 0 : _intentFilter$action.map(data => { | ||
var _data$$; | ||
return data === null || data === void 0 ? void 0 : (_data$$ = data.$) === null || _data$$ === void 0 ? void 0 : _data$$['android:name']; | ||
})) !== null && _intentFilter$action$ !== void 0 ? _intentFilter$action$ : []; | ||
const categories = (_intentFilter$categor = intentFilter === null || intentFilter === void 0 ? void 0 : (_intentFilter$categor2 = intentFilter.category) === null || _intentFilter$categor2 === void 0 ? void 0 : _intentFilter$categor2.map(data => { | ||
var _data$$2; | ||
return data === null || data === void 0 ? void 0 : (_data$$2 = data.$) === null || _data$$2 === void 0 ? void 0 : _data$$2['android:name']; | ||
})) !== null && _intentFilter$categor !== void 0 ? _intentFilter$categor : []; | ||
const data = (_intentFilter$data$fi = intentFilter === null || intentFilter === void 0 ? void 0 : (_intentFilter$data = intentFilter.data) === null || _intentFilter$data === void 0 ? void 0 : (_intentFilter$data$fi2 = _intentFilter$data.filter(data => { | ||
var _data$$3; | ||
return data === null || data === void 0 ? void 0 : (_data$$3 = data.$) === null || _data$$3 === void 0 ? void 0 : _data$$3['android:scheme']; | ||
})) === null || _intentFilter$data$fi2 === void 0 ? void 0 : _intentFilter$data$fi2.map(data => { | ||
var _data$$4, _data$$5; | ||
return { | ||
scheme: data === null || data === void 0 ? void 0 : (_data$$4 = data.$) === null || _data$$4 === void 0 ? void 0 : _data$$4['android:scheme'], | ||
host: data === null || data === void 0 ? void 0 : (_data$$5 = data.$) === null || _data$$5 === void 0 ? void 0 : _data$$5['android:host'] | ||
}; | ||
})) !== null && _intentFilter$data$fi !== void 0 ? _intentFilter$data$fi : []; | ||
const actions = intentFilter?.action?.map(data => data?.$?.['android:name']) ?? []; | ||
const categories = intentFilter?.category?.map(data => data?.$?.['android:name']) ?? []; | ||
const data = intentFilter?.data?.filter(data => data?.$?.['android:scheme'])?.map(data => ({ | ||
scheme: data?.$?.['android:scheme'], | ||
host: data?.$?.['android:host'] | ||
})) ?? []; | ||
return { | ||
@@ -117,6 +102,3 @@ actions, | ||
const activities = Array.isArray(activity) ? activity : [activity]; | ||
const singleTaskActivities = activities.filter(activity => { | ||
var _activity$$; | ||
return (activity === null || activity === void 0 ? void 0 : (_activity$$ = activity.$) === null || _activity$$ === void 0 ? void 0 : _activity$$['android:launchMode']) === 'singleTask'; | ||
}); | ||
const singleTaskActivities = activities.filter(activity => activity?.$?.['android:launchMode'] === 'singleTask'); | ||
for (const activity of singleTaskActivities) { | ||
@@ -153,4 +135,3 @@ const intentFilters = activity['intent-filter']; | ||
for (const activity of application.activity || []) { | ||
var _activity$$2; | ||
if ((activity === null || activity === void 0 ? void 0 : (_activity$$2 = activity.$) === null || _activity$$2 === void 0 ? void 0 : _activity$$2['android:launchMode']) === 'singleTask') { | ||
if (activity?.$?.['android:launchMode'] === 'singleTask') { | ||
for (const intentFilter of activity['intent-filter'] || []) { | ||
@@ -198,4 +179,3 @@ // Parse valid intent filters... | ||
for (const activity of application.activity || []) { | ||
var _activity$$3; | ||
if ((activity === null || activity === void 0 ? void 0 : (_activity$$3 = activity.$) === null || _activity$$3 === void 0 ? void 0 : _activity$$3['android:launchMode']) === 'singleTask') { | ||
if (activity?.$?.['android:launchMode'] === 'singleTask') { | ||
for (const intentFilter of activity['intent-filter'] || []) { | ||
@@ -224,4 +204,3 @@ const properties = propertiesFromIntentFilter(intentFilter); | ||
for (const activity of application.activity || []) { | ||
var _activity$$4; | ||
if ((activity === null || activity === void 0 ? void 0 : (_activity$$4 = activity.$) === null || _activity$$4 === void 0 ? void 0 : _activity$$4['android:launchMode']) === 'singleTask') { | ||
if (activity?.$?.['android:launchMode'] === 'singleTask') { | ||
for (const intentFilter of activity['intent-filter'] || []) { | ||
@@ -231,8 +210,6 @@ // Parse valid intent filters... | ||
if (isValidRedirectIntentFilter(properties)) { | ||
for (const dataKey in (intentFilter === null || intentFilter === void 0 ? void 0 : intentFilter.data) || []) { | ||
var _intentFilter$data2, _data$$6; | ||
const data = (_intentFilter$data2 = intentFilter.data) === null || _intentFilter$data2 === void 0 ? void 0 : _intentFilter$data2[dataKey]; | ||
if ((data === null || data === void 0 ? void 0 : (_data$$6 = data.$) === null || _data$$6 === void 0 ? void 0 : _data$$6['android:scheme']) === scheme) { | ||
var _intentFilter$data3; | ||
(_intentFilter$data3 = intentFilter.data) === null || _intentFilter$data3 === void 0 ? true : delete _intentFilter$data3[dataKey]; | ||
for (const dataKey in intentFilter?.data || []) { | ||
const data = intentFilter.data?.[dataKey]; | ||
if (data?.$?.['android:scheme'] === scheme) { | ||
delete intentFilter.data?.[dataKey]; | ||
} | ||
@@ -239,0 +216,0 @@ } |
@@ -99,4 +99,3 @@ "use strict"; | ||
function getStatusBarColor(config) { | ||
var _config$androidStatus; | ||
const backgroundColor = (_config$androidStatus = config.androidStatusBar) === null || _config$androidStatus === void 0 ? void 0 : _config$androidStatus.backgroundColor; | ||
const backgroundColor = config.androidStatusBar?.backgroundColor; | ||
if (backgroundColor) { | ||
@@ -117,9 +116,7 @@ // Drop support for translucent | ||
function getStatusBarTranslucent(config) { | ||
var _config$androidStatus2, _config$androidStatus3; | ||
return (_config$androidStatus2 = (_config$androidStatus3 = config.androidStatusBar) === null || _config$androidStatus3 === void 0 ? void 0 : _config$androidStatus3.translucent) !== null && _config$androidStatus2 !== void 0 ? _config$androidStatus2 : false; | ||
return config.androidStatusBar?.translucent ?? false; | ||
} | ||
function getStatusBarStyle(config) { | ||
var _config$androidStatus4; | ||
return ((_config$androidStatus4 = config.androidStatusBar) === null || _config$androidStatus4 === void 0 ? void 0 : _config$androidStatus4.barStyle) || 'light-content'; | ||
return config.androidStatusBar?.barStyle || 'light-content'; | ||
} | ||
//# sourceMappingURL=StatusBar.js.map |
@@ -25,4 +25,3 @@ "use strict"; | ||
function setStringItem(itemToAdd, stringFileContentsJSON) { | ||
var _stringFileContentsJS; | ||
if (!(stringFileContentsJSON !== null && stringFileContentsJSON !== void 0 && (_stringFileContentsJS = stringFileContentsJSON.resources) !== null && _stringFileContentsJS !== void 0 && _stringFileContentsJS.string)) { | ||
if (!stringFileContentsJSON?.resources?.string) { | ||
if (!stringFileContentsJSON.resources || typeof stringFileContentsJSON.resources === 'string') { | ||
@@ -47,4 +46,3 @@ // file was empty and JSON is `{resources : ''}` | ||
function removeStringItem(named, stringFileContentsJSON) { | ||
var _stringFileContentsJS2; | ||
if (stringFileContentsJSON !== null && stringFileContentsJSON !== void 0 && (_stringFileContentsJS2 = stringFileContentsJSON.resources) !== null && _stringFileContentsJS2 !== void 0 && _stringFileContentsJS2.string) { | ||
if (stringFileContentsJSON?.resources?.string) { | ||
const stringNameExists = stringFileContentsJSON.resources.string.findIndex(e => e.$.name === named); | ||
@@ -51,0 +49,0 @@ if (stringNameExists > -1) { |
@@ -49,5 +49,4 @@ "use strict"; | ||
function ensureDefaultStyleResourceXML(xml) { | ||
var _xml, _xml$resources; | ||
xml = (0, _Resources().ensureDefaultResourceXML)(xml); | ||
if (!Array.isArray((_xml = xml) === null || _xml === void 0 ? void 0 : (_xml$resources = _xml.resources) === null || _xml$resources === void 0 ? void 0 : _xml$resources.style)) { | ||
if (!Array.isArray(xml?.resources?.style)) { | ||
xml.resources.style = []; | ||
@@ -117,3 +116,3 @@ } | ||
const appTheme = getStyleParent(xml, parent); | ||
if (appTheme !== null && appTheme !== void 0 && appTheme.item) { | ||
if (appTheme?.item) { | ||
const index = appTheme.item.findIndex(({ | ||
@@ -170,4 +169,4 @@ $: head | ||
const xmlGroup = getStyleParent(xml, group); | ||
return xmlGroup !== null && xmlGroup !== void 0 && xmlGroup.item ? (0, _Resources().getResourceItemsAsObject)(xmlGroup.item) : null; | ||
return xmlGroup?.item ? (0, _Resources().getResourceItemsAsObject)(xmlGroup.item) : null; | ||
} | ||
//# sourceMappingURL=Styles.js.map |
@@ -21,7 +21,1 @@ import { Resources } from '.'; | ||
export declare function setVersionsConfigAsync(projectRoot: string, config: Pick<ExpoConfigUpdates, 'sdkVersion' | 'runtimeVersion'>, androidManifest: AndroidManifest): Promise<AndroidManifest>; | ||
export declare function ensureBuildGradleContainsConfigurationScript(projectRoot: string, buildGradleContents: string): string; | ||
export declare function formatApplyLineForBuildGradle(projectRoot: string): string; | ||
export declare function isBuildGradleConfigured(projectRoot: string, buildGradleContents: string): boolean; | ||
export declare function isMainApplicationMetaDataSet(androidManifest: AndroidManifest): boolean; | ||
export declare function isMainApplicationMetaDataSyncedAsync(projectRoot: string, config: ExpoConfigUpdates, androidManifest: AndroidManifest): Promise<boolean>; | ||
export declare function areVersionsSyncedAsync(projectRoot: string, config: Pick<ExpoConfigUpdates, 'runtimeVersion' | 'sdkVersion'>, androidManifest: AndroidManifest): Promise<boolean>; |
@@ -9,25 +9,5 @@ "use strict"; | ||
exports.applyRuntimeVersionFromConfigForProjectRootAsync = applyRuntimeVersionFromConfigForProjectRootAsync; | ||
exports.areVersionsSyncedAsync = areVersionsSyncedAsync; | ||
exports.ensureBuildGradleContainsConfigurationScript = ensureBuildGradleContainsConfigurationScript; | ||
exports.formatApplyLineForBuildGradle = formatApplyLineForBuildGradle; | ||
exports.isBuildGradleConfigured = isBuildGradleConfigured; | ||
exports.isMainApplicationMetaDataSet = isMainApplicationMetaDataSet; | ||
exports.isMainApplicationMetaDataSyncedAsync = isMainApplicationMetaDataSyncedAsync; | ||
exports.setUpdatesConfigAsync = setUpdatesConfigAsync; | ||
exports.setVersionsConfigAsync = setVersionsConfigAsync; | ||
exports.withUpdates = void 0; | ||
function _path() { | ||
const data = _interopRequireDefault(require("path")); | ||
_path = function () { | ||
return data; | ||
}; | ||
return data; | ||
} | ||
function _resolveFrom() { | ||
const data = _interopRequireDefault(require("resolve-from")); | ||
_resolveFrom = function () { | ||
return data; | ||
}; | ||
return data; | ||
} | ||
function _Manifest() { | ||
@@ -75,8 +55,3 @@ const data = require("./Manifest"); | ||
} | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
const CREATE_MANIFEST_ANDROID_PATH = 'expo-updates/scripts/create-manifest-android.gradle'; | ||
let Config; // when making changes to this config plugin, ensure the same changes are also made in eas-cli and build-tools | ||
// Also ensure the docs are up-to-date: https://docs.expo.dev/bare/installing-updates/ | ||
exports.Config = Config; | ||
(function (Config) { | ||
let Config = exports.Config = /*#__PURE__*/function (Config) { | ||
Config["ENABLED"] = "expo.modules.updates.ENABLED"; | ||
@@ -90,3 +65,5 @@ Config["CHECK_ON_LAUNCH"] = "expo.modules.updates.EXPO_UPDATES_CHECK_ON_LAUNCH"; | ||
Config["CODE_SIGNING_METADATA"] = "expo.modules.updates.CODE_SIGNING_METADATA"; | ||
})(Config || (exports.Config = Config = {})); | ||
return Config; | ||
}({}); // when making changes to this config plugin, ensure the same changes are also made in eas-cli and build-tools | ||
// Also ensure the docs are up-to-date: https://docs.expo.dev/bare/installing-updates/ | ||
const withUpdates = config => { | ||
@@ -165,50 +142,2 @@ return (0, _withPlugins().withPlugins)(config, [withUpdatesManifest, withRuntimeVersionResource]); | ||
} | ||
function ensureBuildGradleContainsConfigurationScript(projectRoot, buildGradleContents) { | ||
if (!isBuildGradleConfigured(projectRoot, buildGradleContents)) { | ||
let cleanedUpBuildGradleContents; | ||
const isBuildGradleMisconfigured = buildGradleContents.split('\n').some(line => line.includes(CREATE_MANIFEST_ANDROID_PATH)); | ||
if (isBuildGradleMisconfigured) { | ||
cleanedUpBuildGradleContents = buildGradleContents.replace(new RegExp(`(\n// Integration with Expo updates)?\n.*${CREATE_MANIFEST_ANDROID_PATH}.*\n`), ''); | ||
} else { | ||
cleanedUpBuildGradleContents = buildGradleContents; | ||
} | ||
const gradleScriptApply = formatApplyLineForBuildGradle(projectRoot); | ||
return `${cleanedUpBuildGradleContents}\n// Integration with Expo updates\n${gradleScriptApply}\n`; | ||
} else { | ||
return buildGradleContents; | ||
} | ||
} | ||
function formatApplyLineForBuildGradle(projectRoot) { | ||
const updatesGradleScriptPath = _resolveFrom().default.silent(projectRoot, CREATE_MANIFEST_ANDROID_PATH); | ||
if (!updatesGradleScriptPath) { | ||
throw new Error("Could not find the build script for Android. This could happen in case of outdated 'node_modules'. Run 'npm install' to make sure that it's up-to-date."); | ||
} | ||
const relativePath = _path().default.relative(_path().default.join(projectRoot, 'android', 'app'), updatesGradleScriptPath); | ||
const posixPath = process.platform === 'win32' ? relativePath.replace(/\\/g, '/') : relativePath; | ||
return `apply from: "${posixPath}"`; | ||
} | ||
function isBuildGradleConfigured(projectRoot, buildGradleContents) { | ||
const androidBuildScript = formatApplyLineForBuildGradle(projectRoot); | ||
return buildGradleContents.replace(/\r\n/g, '\n').split('\n') | ||
// Check for both single and double quotes | ||
.some(line => line === androidBuildScript || line === androidBuildScript.replace(/"/g, "'")); | ||
} | ||
function isMainApplicationMetaDataSet(androidManifest) { | ||
const updateUrl = (0, _Manifest().getMainApplicationMetaDataValue)(androidManifest, Config.UPDATE_URL); | ||
const runtimeVersion = (0, _Manifest().getMainApplicationMetaDataValue)(androidManifest, Config.RUNTIME_VERSION); | ||
return Boolean(updateUrl && runtimeVersion); | ||
} | ||
async function isMainApplicationMetaDataSyncedAsync(projectRoot, config, androidManifest) { | ||
return (0, _Updates().getUpdateUrl)(config) === (0, _Manifest().getMainApplicationMetaDataValue)(androidManifest, Config.UPDATE_URL) && String((0, _Updates().getUpdatesEnabled)(config)) === (0, _Manifest().getMainApplicationMetaDataValue)(androidManifest, Config.ENABLED) && String((0, _Updates().getUpdatesTimeout)(config)) === (0, _Manifest().getMainApplicationMetaDataValue)(androidManifest, Config.LAUNCH_WAIT_MS) && (0, _Updates().getUpdatesCheckOnLaunch)(config) === (0, _Manifest().getMainApplicationMetaDataValue)(androidManifest, Config.CHECK_ON_LAUNCH) && (0, _Updates().getUpdatesCodeSigningCertificate)(projectRoot, config) === (0, _Manifest().getMainApplicationMetaDataValue)(androidManifest, Config.CODE_SIGNING_CERTIFICATE) && (0, _Updates().getUpdatesCodeSigningMetadataStringified)(config) === (0, _Manifest().getMainApplicationMetaDataValue)(androidManifest, Config.CODE_SIGNING_METADATA) && (await areVersionsSyncedAsync(projectRoot, config, androidManifest)); | ||
} | ||
async function areVersionsSyncedAsync(projectRoot, config, androidManifest) { | ||
const expectedRuntimeVersion = await (0, _Updates().getRuntimeVersionNullableAsync)(projectRoot, config, 'android'); | ||
const currentRuntimeVersion = (0, _Manifest().getMainApplicationMetaDataValue)(androidManifest, Config.RUNTIME_VERSION); | ||
const currentSdkVersion = (0, _Manifest().getMainApplicationMetaDataValue)(androidManifest, 'expo.modules.updates.EXPO_SDK_VERSION'); | ||
if (expectedRuntimeVersion !== null) { | ||
return currentRuntimeVersion === expectedRuntimeVersion && currentSdkVersion === null; | ||
} else { | ||
return true; | ||
} | ||
} | ||
//# sourceMappingURL=Updates.js.map |
@@ -55,5 +55,4 @@ "use strict"; | ||
}) { | ||
var _buildGradle$match; | ||
const regex = new RegExp(`(${name}\\s?=\\s?)(\\d+(?:\\.\\d+)?)`); | ||
const currentVersion = (_buildGradle$match = buildGradle.match(regex)) === null || _buildGradle$match === void 0 ? void 0 : _buildGradle$match[2]; | ||
const currentVersion = buildGradle.match(regex)?.[2]; | ||
if (!currentVersion) { | ||
@@ -68,4 +67,3 @@ (0, _warnings().addWarningAndroid)('withBuildScriptExtVersion', `Cannot set minimum buildscript.ext.${name} version because the property "${name}" cannot be found or does not have a numeric value.`); | ||
function getVersionName(config) { | ||
var _config$version; | ||
return (_config$version = config.version) !== null && _config$version !== void 0 ? _config$version : null; | ||
return config.version ?? null; | ||
} | ||
@@ -81,4 +79,3 @@ function setVersionName(config, buildGradle) { | ||
function getVersionCode(config) { | ||
var _config$android$versi, _config$android; | ||
return (_config$android$versi = (_config$android = config.android) === null || _config$android === void 0 ? void 0 : _config$android.versionCode) !== null && _config$android$versi !== void 0 ? _config$android$versi : 1; | ||
return config.android?.versionCode ?? 1; | ||
} | ||
@@ -85,0 +82,0 @@ function setVersionCode(config, buildGradle) { |
@@ -41,4 +41,3 @@ "use strict"; | ||
function getWindowSoftInputModeMode(config) { | ||
var _config$android, _MAPPING$value; | ||
const value = (_config$android = config.android) === null || _config$android === void 0 ? void 0 : _config$android.softwareKeyboardLayoutMode; | ||
const value = config.android?.softwareKeyboardLayoutMode; | ||
if (!value) { | ||
@@ -48,4 +47,4 @@ // Default to `adjustResize` or `resize`. | ||
} | ||
return (_MAPPING$value = MAPPING[value]) !== null && _MAPPING$value !== void 0 ? _MAPPING$value : value; | ||
return MAPPING[value] ?? value; | ||
} | ||
//# sourceMappingURL=WindowSoftInputMode.js.map |
@@ -22,2 +22,3 @@ /** | ||
export { withDangerousMod } from './plugins/withDangerousMod'; | ||
export { withFinalizedMod } from './plugins/withFinalizedMod'; | ||
export { withMod, withBaseMod } from './plugins/withMod'; | ||
@@ -24,0 +25,0 @@ export { withAppDelegate, withInfoPlist, withEntitlementsPlist, withExpoPlist, withXcodeProject, withPodfileProperties, } from './plugins/ios-plugins'; |
@@ -18,2 +18,3 @@ "use strict"; | ||
withDangerousMod: true, | ||
withFinalizedMod: true, | ||
withMod: true, | ||
@@ -136,2 +137,8 @@ withBaseMod: true, | ||
}); | ||
Object.defineProperty(exports, "withFinalizedMod", { | ||
enumerable: true, | ||
get: function () { | ||
return _withFinalizedMod().withFinalizedMod; | ||
} | ||
}); | ||
Object.defineProperty(exports, "withGradleProperties", { | ||
@@ -347,2 +354,9 @@ enumerable: true, | ||
} | ||
function _withFinalizedMod() { | ||
const data = require("./plugins/withFinalizedMod"); | ||
_withFinalizedMod = function () { | ||
return data; | ||
}; | ||
return data; | ||
} | ||
function _withMod() { | ||
@@ -390,4 +404,4 @@ const data = require("./plugins/withMod"); | ||
} | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } | ||
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } | ||
/** | ||
@@ -403,3 +417,3 @@ * For internal use in Expo CLI | ||
const BaseMods = { | ||
const BaseMods = exports.BaseMods = { | ||
withGeneratedBaseMods: _createBaseMod().withGeneratedBaseMods, | ||
@@ -412,3 +426,2 @@ provider: _createBaseMod().provider, | ||
}; | ||
exports.BaseMods = BaseMods; | ||
//# sourceMappingURL=index.js.map |
@@ -65,4 +65,3 @@ "use strict"; | ||
function getBitcode(config) { | ||
var _config$ios; | ||
return (_config$ios = config.ios) === null || _config$ios === void 0 ? void 0 : _config$ios.bitcode; | ||
return config.ios?.bitcode; | ||
} | ||
@@ -69,0 +68,0 @@ |
@@ -34,3 +34,3 @@ "use strict"; | ||
const withUnknown = (config, sourceConfig) => (0, _iosPlugins().withPodfileProperties)(config, config => { | ||
config.modResults = updateIosBuildPropertiesFromConfig(sourceConfig !== null && sourceConfig !== void 0 ? sourceConfig : config, config.modResults, configToPropertyRules); | ||
config.modResults = updateIosBuildPropertiesFromConfig(sourceConfig ?? config, config.modResults, configToPropertyRules); | ||
return config; | ||
@@ -49,10 +49,6 @@ }); | ||
*/ | ||
const withJsEnginePodfileProps = createBuildPodfilePropsConfigPlugin([{ | ||
const withJsEnginePodfileProps = exports.withJsEnginePodfileProps = createBuildPodfilePropsConfigPlugin([{ | ||
propName: 'expo.jsEngine', | ||
propValueGetter: config => { | ||
var _ref, _config$ios$jsEngine, _config$ios; | ||
return (_ref = (_config$ios$jsEngine = (_config$ios = config.ios) === null || _config$ios === void 0 ? void 0 : _config$ios.jsEngine) !== null && _config$ios$jsEngine !== void 0 ? _config$ios$jsEngine : config.jsEngine) !== null && _ref !== void 0 ? _ref : 'hermes'; | ||
} | ||
propValueGetter: config => config.ios?.jsEngine ?? config.jsEngine ?? 'hermes' | ||
}], 'withJsEnginePodfileProps'); | ||
exports.withJsEnginePodfileProps = withJsEnginePodfileProps; | ||
function updateIosBuildPropertiesFromConfig(config, podfileProperties, configToPropertyRules) { | ||
@@ -68,3 +64,3 @@ for (const configToProperty of configToPropertyRules) { | ||
podfileProperties[name] = value; | ||
} else if (options !== null && options !== void 0 && options.removePropWhenValueIsNull) { | ||
} else if (options?.removePropWhenValueIsNull) { | ||
delete podfileProperties[name]; | ||
@@ -71,0 +67,0 @@ } |
@@ -59,5 +59,4 @@ "use strict"; | ||
const buildConfiguration = xcConfigurationList.buildConfigurations.find(value => value.comment === configuration) || xcConfigurationList.buildConfigurations[0]; | ||
if (buildConfiguration !== null && buildConfiguration !== void 0 && buildConfiguration.value) { | ||
var _project$hash$project; | ||
const xcBuildConfiguration = (_project$hash$project = project.hash.project.objects.XCBuildConfiguration) === null || _project$hash$project === void 0 ? void 0 : _project$hash$project[buildConfiguration.value]; | ||
if (buildConfiguration?.value) { | ||
const xcBuildConfiguration = project.hash.project.objects.XCBuildConfiguration?.[buildConfiguration.value]; | ||
const buildSdkRoot = xcBuildConfiguration.buildSettings.SDKROOT; | ||
@@ -93,8 +92,6 @@ if (buildSdkRoot === 'appletvos' || 'TVOS_DEPLOYMENT_TARGET' in xcBuildConfiguration.buildSettings) { | ||
async function getApplicationTargetNameForSchemeAsync(projectRoot, scheme) { | ||
var _schemeXML$Scheme, _schemeXML$Scheme$Bui, _schemeXML$Scheme$Bui2, _schemeXML$Scheme$Bui3, _schemeXML$Scheme$Bui4; | ||
const schemeXML = await readSchemeAsync(projectRoot, scheme); | ||
const buildActionEntry = schemeXML === null || schemeXML === void 0 ? void 0 : (_schemeXML$Scheme = schemeXML.Scheme) === null || _schemeXML$Scheme === void 0 ? void 0 : (_schemeXML$Scheme$Bui = _schemeXML$Scheme.BuildAction) === null || _schemeXML$Scheme$Bui === void 0 ? void 0 : (_schemeXML$Scheme$Bui2 = _schemeXML$Scheme$Bui[0]) === null || _schemeXML$Scheme$Bui2 === void 0 ? void 0 : (_schemeXML$Scheme$Bui3 = _schemeXML$Scheme$Bui2.BuildActionEntries) === null || _schemeXML$Scheme$Bui3 === void 0 ? void 0 : (_schemeXML$Scheme$Bui4 = _schemeXML$Scheme$Bui3[0]) === null || _schemeXML$Scheme$Bui4 === void 0 ? void 0 : _schemeXML$Scheme$Bui4.BuildActionEntry; | ||
const targetName = (buildActionEntry === null || buildActionEntry === void 0 ? void 0 : buildActionEntry.length) === 1 ? getBlueprintName(buildActionEntry[0]) : getBlueprintName(buildActionEntry === null || buildActionEntry === void 0 ? void 0 : buildActionEntry.find(entry => { | ||
var _entry$BuildableRefer, _entry$BuildableRefer2, _entry$BuildableRefer3, _entry$BuildableRefer4; | ||
return (_entry$BuildableRefer = entry.BuildableReference) === null || _entry$BuildableRefer === void 0 ? void 0 : (_entry$BuildableRefer2 = _entry$BuildableRefer[0]) === null || _entry$BuildableRefer2 === void 0 ? void 0 : (_entry$BuildableRefer3 = _entry$BuildableRefer2['$']) === null || _entry$BuildableRefer3 === void 0 ? void 0 : (_entry$BuildableRefer4 = _entry$BuildableRefer3.BuildableName) === null || _entry$BuildableRefer4 === void 0 ? void 0 : _entry$BuildableRefer4.endsWith('.app'); | ||
const buildActionEntry = schemeXML?.Scheme?.BuildAction?.[0]?.BuildActionEntries?.[0]?.BuildActionEntry; | ||
const targetName = buildActionEntry?.length === 1 ? getBlueprintName(buildActionEntry[0]) : getBlueprintName(buildActionEntry?.find(entry => { | ||
return entry.BuildableReference?.[0]?.['$']?.BuildableName?.endsWith('.app'); | ||
})); | ||
@@ -107,5 +104,4 @@ if (!targetName) { | ||
async function getArchiveBuildConfigurationForSchemeAsync(projectRoot, scheme) { | ||
var _schemeXML$Scheme2, _schemeXML$Scheme2$Ar, _schemeXML$Scheme2$Ar2, _schemeXML$Scheme2$Ar3; | ||
const schemeXML = await readSchemeAsync(projectRoot, scheme); | ||
const buildConfiguration = schemeXML === null || schemeXML === void 0 ? void 0 : (_schemeXML$Scheme2 = schemeXML.Scheme) === null || _schemeXML$Scheme2 === void 0 ? void 0 : (_schemeXML$Scheme2$Ar = _schemeXML$Scheme2.ArchiveAction) === null || _schemeXML$Scheme2$Ar === void 0 ? void 0 : (_schemeXML$Scheme2$Ar2 = _schemeXML$Scheme2$Ar[0]) === null || _schemeXML$Scheme2$Ar2 === void 0 ? void 0 : (_schemeXML$Scheme2$Ar3 = _schemeXML$Scheme2$Ar2['$']) === null || _schemeXML$Scheme2$Ar3 === void 0 ? void 0 : _schemeXML$Scheme2$Ar3.buildConfiguration; | ||
const buildConfiguration = schemeXML?.Scheme?.ArchiveAction?.[0]?.['$']?.buildConfiguration; | ||
if (!buildConfiguration) { | ||
@@ -117,5 +113,4 @@ throw new Error(`${scheme}.xcscheme seems to be corrupted`); | ||
function getBlueprintName(entry) { | ||
var _entry$BuildableRefer5, _entry$BuildableRefer6, _entry$BuildableRefer7; | ||
return entry === null || entry === void 0 ? void 0 : (_entry$BuildableRefer5 = entry.BuildableReference) === null || _entry$BuildableRefer5 === void 0 ? void 0 : (_entry$BuildableRefer6 = _entry$BuildableRefer5[0]) === null || _entry$BuildableRefer6 === void 0 ? void 0 : (_entry$BuildableRefer7 = _entry$BuildableRefer6['$']) === null || _entry$BuildableRefer7 === void 0 ? void 0 : _entry$BuildableRefer7.BlueprintName; | ||
return entry?.BuildableReference?.[0]?.['$']?.BlueprintName; | ||
} | ||
//# sourceMappingURL=BuildScheme.js.map |
@@ -82,4 +82,3 @@ "use strict"; | ||
return (0, _iosPlugins().withXcodeProject)(config, async config => { | ||
var _config$ios; | ||
const bundleId = bundleIdentifier !== null && bundleIdentifier !== void 0 ? bundleIdentifier : (_config$ios = config.ios) === null || _config$ios === void 0 ? void 0 : _config$ios.bundleIdentifier; | ||
const bundleId = bundleIdentifier ?? config.ios?.bundleIdentifier; | ||
// Should never happen. | ||
@@ -93,4 +92,3 @@ (0, _assert().default)(bundleId, '`bundleIdentifier` must be defined in the app config (`ios.bundleIdentifier`) or passed to the plugin `withBundleIdentifier`.'); | ||
function getBundleIdentifier(config) { | ||
var _config$ios$bundleIde, _config$ios2; | ||
return (_config$ios$bundleIde = (_config$ios2 = config.ios) === null || _config$ios2 === void 0 ? void 0 : _config$ios2.bundleIdentifier) !== null && _config$ios$bundleIde !== void 0 ? _config$ios$bundleIde : null; | ||
return config.ios?.bundleIdentifier ?? null; | ||
} | ||
@@ -188,3 +186,3 @@ | ||
const productName = bundleIdentifier.split('.').pop(); | ||
if (!(productName !== null && productName !== void 0 && productName.includes('$'))) { | ||
if (!productName?.includes('$')) { | ||
item.buildSettings.PRODUCT_NAME = productName; | ||
@@ -191,0 +189,0 @@ } |
@@ -242,3 +242,2 @@ "use strict"; | ||
function insertContentsInsideFunctionBlock(srcContents, selector, insertion, options, language) { | ||
var _options$indent; | ||
const codeBlock = language === 'objc' ? findObjcFunctionCodeBlock(srcContents, selector) : findSwiftFunctionCodeBlock(srcContents, selector); | ||
@@ -251,3 +250,3 @@ if (!codeBlock) { | ||
} = options; | ||
const indent = ' '.repeat((_options$indent = options.indent) !== null && _options$indent !== void 0 ? _options$indent : 2); | ||
const indent = ' '.repeat(options.indent ?? 2); | ||
if (position === 'head') { | ||
@@ -254,0 +253,0 @@ srcContents = (0, _commonCodeMod().insertContentsAtOffset)(srcContents, `\n${indent}${insertion}`, codeBlock.start + 1); |
@@ -36,14 +36,11 @@ "use strict"; | ||
function getSupportsTablet(config) { | ||
var _config$ios; | ||
return !!((_config$ios = config.ios) !== null && _config$ios !== void 0 && _config$ios.supportsTablet); | ||
return !!config.ios?.supportsTablet; | ||
} | ||
function getIsTabletOnly(config) { | ||
var _config$ios2; | ||
return !!(config !== null && config !== void 0 && (_config$ios2 = config.ios) !== null && _config$ios2 !== void 0 && _config$ios2.isTabletOnly); | ||
return !!config?.ios?.isTabletOnly; | ||
} | ||
function getDeviceFamilies(config) { | ||
var _config$ios3; | ||
const supportsTablet = getSupportsTablet(config); | ||
const isTabletOnly = getIsTabletOnly(config); | ||
if (isTabletOnly && ((_config$ios3 = config.ios) === null || _config$ios3 === void 0 ? void 0 : _config$ios3.supportsTablet) === false) { | ||
if (isTabletOnly && config.ios?.supportsTablet === false) { | ||
(0, _warnings().addWarningIOS)('ios.supportsTablet', `Found contradictory values: \`{ ios: { isTabletOnly: true, supportsTablet: false } }\`. Using \`{ isTabletOnly: true }\`.`); | ||
@@ -86,4 +83,4 @@ } | ||
// Using `project.addToBuildSettings` modifies too many targets. | ||
if (typeof (buildSettings === null || buildSettings === void 0 ? void 0 : buildSettings.PRODUCT_NAME) !== 'undefined') { | ||
if (typeof (buildSettings === null || buildSettings === void 0 ? void 0 : buildSettings.TVOS_DEPLOYMENT_TARGET) !== 'undefined') { | ||
if (typeof buildSettings?.PRODUCT_NAME !== 'undefined') { | ||
if (typeof buildSettings?.TVOS_DEPLOYMENT_TARGET !== 'undefined') { | ||
buildSettings.TARGETED_DEVICE_FAMILY = '3'; | ||
@@ -90,0 +87,0 @@ } else { |
@@ -60,4 +60,3 @@ "use strict"; | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
const withAssociatedDomains = (0, _iosPlugins().createEntitlementsPlugin)(setAssociatedDomains, 'withAssociatedDomains'); | ||
exports.withAssociatedDomains = withAssociatedDomains; | ||
const withAssociatedDomains = exports.withAssociatedDomains = (0, _iosPlugins().createEntitlementsPlugin)(setAssociatedDomains, 'withAssociatedDomains'); | ||
function setAssociatedDomains(config, { | ||
@@ -67,4 +66,3 @@ 'com.apple.developer.associated-domains': _, | ||
}) { | ||
var _config$ios; | ||
if ((_config$ios = config.ios) !== null && _config$ios !== void 0 && _config$ios.associatedDomains) { | ||
if (config.ios?.associatedDomains) { | ||
return { | ||
@@ -93,4 +91,3 @@ ...entitlementsPlist, | ||
function getEntitlementsPathFromBuildConfiguration(projectRoot, xcBuildConfiguration) { | ||
var _xcBuildConfiguration; | ||
const entitlementsPathRaw = xcBuildConfiguration === null || xcBuildConfiguration === void 0 ? void 0 : (_xcBuildConfiguration = xcBuildConfiguration.buildSettings) === null || _xcBuildConfiguration === void 0 ? void 0 : _xcBuildConfiguration.CODE_SIGN_ENTITLEMENTS; | ||
const entitlementsPathRaw = xcBuildConfiguration?.buildSettings?.CODE_SIGN_ENTITLEMENTS; | ||
if (entitlementsPathRaw) { | ||
@@ -97,0 +94,0 @@ return _path().default.normalize(_path().default.join(projectRoot, 'ios', (0, _string().trimQuotes)(entitlementsPathRaw))); |
@@ -95,3 +95,2 @@ "use strict"; | ||
function getGoogleSignInReversedClientId(config, modRequest) { | ||
var _infoPlist$REVERSED_C; | ||
const googleServicesFileRelativePath = getGoogleServicesFile(config); | ||
@@ -102,7 +101,6 @@ if (googleServicesFileRelativePath === null) { | ||
const infoPlist = readGoogleServicesInfoPlist(googleServicesFileRelativePath, modRequest); | ||
return (_infoPlist$REVERSED_C = infoPlist.REVERSED_CLIENT_ID) !== null && _infoPlist$REVERSED_C !== void 0 ? _infoPlist$REVERSED_C : null; | ||
return infoPlist.REVERSED_CLIENT_ID ?? null; | ||
} | ||
function getGoogleServicesFile(config) { | ||
var _config$ios$googleSer, _config$ios; | ||
return (_config$ios$googleSer = (_config$ios = config.ios) === null || _config$ios === void 0 ? void 0 : _config$ios.googleServicesFile) !== null && _config$ios$googleSer !== void 0 ? _config$ios$googleSer : null; | ||
return config.ios?.googleServicesFile ?? null; | ||
} | ||
@@ -109,0 +107,0 @@ function setGoogleSignInReversedClientId(config, infoPlist, modRequest) { |
@@ -327,4 +327,4 @@ "use strict"; | ||
}); | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } | ||
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } | ||
//# sourceMappingURL=index.js.map |
@@ -64,4 +64,3 @@ "use strict"; | ||
function getLocales(config) { | ||
var _config$locales; | ||
return (_config$locales = config.locales) !== null && _config$locales !== void 0 ? _config$locales : null; | ||
return config.locales ?? null; | ||
} | ||
@@ -101,5 +100,5 @@ async function setLocalesAsync(config, { | ||
// Ensure the file doesn't already exist | ||
if (!(group !== null && group !== void 0 && group.children.some(({ | ||
if (!group?.children.some(({ | ||
comment | ||
}) => comment === stringName))) { | ||
}) => comment === stringName)) { | ||
// Only write the file if it doesn't already exist. | ||
@@ -106,0 +105,0 @@ project = (0, _Xcodeproj().addResourceFileToGroup)({ |
@@ -60,4 +60,3 @@ "use strict"; | ||
const debug = require('debug')('expo:config-plugins:ios:maps'); | ||
const MATCH_INIT = /-\s*\(BOOL\)\s*application:\s*\(UIApplication\s*\*\s*\)\s*\w+\s+didFinishLaunchingWithOptions:/g; | ||
exports.MATCH_INIT = MATCH_INIT; | ||
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'); | ||
@@ -82,4 +81,3 @@ const withMaps = config => { | ||
function getGoogleMapsApiKey(config) { | ||
var _config$ios$config$go, _config$ios, _config$ios$config; | ||
return (_config$ios$config$go = (_config$ios = config.ios) === null || _config$ios === void 0 ? void 0 : (_config$ios$config = _config$ios.config) === null || _config$ios$config === void 0 ? void 0 : _config$ios$config.googleMapsApiKey) !== null && _config$ios$config$go !== void 0 ? _config$ios$config$go : null; | ||
return config.ios?.config?.googleMapsApiKey ?? null; | ||
} | ||
@@ -86,0 +84,0 @@ function setGoogleMapsApiKey(config, { |
@@ -32,8 +32,7 @@ "use strict"; | ||
} | ||
const withDisplayName = (0, _iosPlugins().createInfoPlistPluginWithPropertyGuard)(setDisplayName, { | ||
const withDisplayName = exports.withDisplayName = (0, _iosPlugins().createInfoPlistPluginWithPropertyGuard)(setDisplayName, { | ||
infoPlistProperty: 'CFBundleDisplayName', | ||
expoConfigProperty: 'name' | ||
}, 'withDisplayName'); | ||
exports.withDisplayName = withDisplayName; | ||
const withName = (0, _iosPlugins().createInfoPlistPluginWithPropertyGuard)(setName, { | ||
const withName = exports.withName = (0, _iosPlugins().createInfoPlistPluginWithPropertyGuard)(setName, { | ||
infoPlistProperty: 'CFBundleName', | ||
@@ -44,3 +43,2 @@ expoConfigProperty: 'name' | ||
/** Set the PRODUCT_NAME variable in the xcproj file based on the app.json name property. */ | ||
exports.withName = withName; | ||
const withProductName = config => { | ||
@@ -98,4 +96,3 @@ return (0, _iosPlugins().withXcodeProject)(config, config => { | ||
function setProductName(config, project) { | ||
var _getName; | ||
const name = (0, _Xcodeproj().sanitizedName)((_getName = getName(config)) !== null && _getName !== void 0 ? _getName : ''); | ||
const name = (0, _Xcodeproj().sanitizedName)(getName(config) ?? ''); | ||
if (!name) { | ||
@@ -102,0 +99,0 @@ return project; |
@@ -17,15 +17,11 @@ "use strict"; | ||
} | ||
const withOrientation = (0, _iosPlugins().createInfoPlistPluginWithPropertyGuard)(setOrientation, { | ||
const withOrientation = exports.withOrientation = (0, _iosPlugins().createInfoPlistPluginWithPropertyGuard)(setOrientation, { | ||
infoPlistProperty: 'UISupportedInterfaceOrientations', | ||
expoConfigProperty: 'orientation' | ||
}, 'withOrientation'); | ||
exports.withOrientation = withOrientation; | ||
function getOrientation(config) { | ||
var _config$orientation; | ||
return (_config$orientation = config.orientation) !== null && _config$orientation !== void 0 ? _config$orientation : null; | ||
return config.orientation ?? null; | ||
} | ||
const PORTRAIT_ORIENTATIONS = ['UIInterfaceOrientationPortrait', 'UIInterfaceOrientationPortraitUpsideDown']; | ||
exports.PORTRAIT_ORIENTATIONS = PORTRAIT_ORIENTATIONS; | ||
const LANDSCAPE_ORIENTATIONS = ['UIInterfaceOrientationLandscapeLeft', 'UIInterfaceOrientationLandscapeRight']; | ||
exports.LANDSCAPE_ORIENTATIONS = LANDSCAPE_ORIENTATIONS; | ||
const PORTRAIT_ORIENTATIONS = exports.PORTRAIT_ORIENTATIONS = ['UIInterfaceOrientationPortrait', 'UIInterfaceOrientationPortraitUpsideDown']; | ||
const LANDSCAPE_ORIENTATIONS = exports.LANDSCAPE_ORIENTATIONS = ['UIInterfaceOrientationLandscapeLeft', 'UIInterfaceOrientationLandscapeRight']; | ||
function getUISupportedInterfaceOrientations(orientation) { | ||
@@ -32,0 +28,0 @@ if (orientation === 'portrait') { |
@@ -66,4 +66,4 @@ "use strict"; | ||
} | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } | ||
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } | ||
const ignoredPaths = ['**/@(Carthage|Pods|vendor|node_modules)/**']; | ||
@@ -70,0 +70,0 @@ function getAppDelegateHeaderFilePath(projectRoot) { |
@@ -30,12 +30,10 @@ "use strict"; | ||
} | ||
const withRequiresFullScreen = (0, _iosPlugins().createInfoPlistPlugin)(setRequiresFullScreen, 'withRequiresFullScreen'); | ||
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. | ||
exports.withRequiresFullScreen = withRequiresFullScreen; | ||
function getRequiresFullScreen(config) { | ||
var _config$ios; | ||
// 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 = config.ios) !== null && _config$ios !== void 0 && _config$ios.hasOwnProperty('requireFullScreen')) { | ||
if (config.ios?.hasOwnProperty('requireFullScreen')) { | ||
return !!config.ios.requireFullScreen; | ||
@@ -42,0 +40,0 @@ } else { |
@@ -20,7 +20,6 @@ "use strict"; | ||
} | ||
const withScheme = (0, _iosPlugins().createInfoPlistPluginWithPropertyGuard)(setScheme, { | ||
const withScheme = exports.withScheme = (0, _iosPlugins().createInfoPlistPluginWithPropertyGuard)(setScheme, { | ||
infoPlistProperty: 'CFBundleURLTypes', | ||
expoConfigProperty: 'scheme' | ||
}, 'withScheme'); | ||
exports.withScheme = withScheme; | ||
function getScheme(config) { | ||
@@ -38,8 +37,7 @@ if (Array.isArray(config.scheme)) { | ||
function setScheme(config, infoPlist) { | ||
var _config$ios, _config$ios2; | ||
const scheme = [...getScheme(config), | ||
// @ts-ignore: TODO: ios.scheme is an unreleased -- harder to add to turtle v1. | ||
...getScheme((_config$ios = config.ios) !== null && _config$ios !== void 0 ? _config$ios : {})]; | ||
...getScheme(config.ios ?? {})]; | ||
// Add the bundle identifier to the list of schemes for easier Google auth and parity with Turtle v1. | ||
if ((_config$ios2 = config.ios) !== null && _config$ios2 !== void 0 && _config$ios2.bundleIdentifier) { | ||
if (config.ios?.bundleIdentifier) { | ||
scheme.push(config.ios.bundleIdentifier); | ||
@@ -58,8 +56,7 @@ } | ||
function appendScheme(scheme, infoPlist) { | ||
var _infoPlist$CFBundleUR; | ||
if (!scheme) { | ||
return infoPlist; | ||
} | ||
const existingSchemes = (_infoPlist$CFBundleUR = infoPlist.CFBundleURLTypes) !== null && _infoPlist$CFBundleUR !== void 0 ? _infoPlist$CFBundleUR : []; | ||
if (existingSchemes !== null && existingSchemes !== void 0 && existingSchemes.some(({ | ||
const existingSchemes = infoPlist.CFBundleURLTypes ?? []; | ||
if (existingSchemes?.some(({ | ||
CFBundleURLSchemes | ||
@@ -100,3 +97,3 @@ }) => CFBundleURLSchemes.includes(scheme))) { | ||
if (!Array.isArray(existingSchemes)) return false; | ||
return existingSchemes === null || existingSchemes === void 0 ? void 0 : existingSchemes.some(({ | ||
return existingSchemes?.some(({ | ||
CFBundleURLSchemes: schemes | ||
@@ -103,0 +100,0 @@ }) => Array.isArray(schemes) ? schemes.includes(scheme) : false); |
@@ -130,3 +130,3 @@ "use strict"; | ||
// Using `project.addToBuildSettings` modifies too many targets. | ||
if (typeof (buildSettings === null || buildSettings === void 0 ? void 0 : buildSettings.PRODUCT_NAME) !== 'undefined') { | ||
if (typeof buildSettings?.PRODUCT_NAME !== 'undefined') { | ||
if (typeof buildSettings.SWIFT_OBJC_BRIDGING_HEADER === 'string' && buildSettings.SWIFT_OBJC_BRIDGING_HEADER) { | ||
@@ -156,3 +156,3 @@ return buildSettings.SWIFT_OBJC_BRIDGING_HEADER; | ||
// Using `project.addToBuildSettings` modifies too many targets. | ||
if (typeof (buildSettings === null || buildSettings === void 0 ? void 0 : buildSettings.PRODUCT_NAME) !== 'undefined') { | ||
if (typeof buildSettings?.PRODUCT_NAME !== 'undefined') { | ||
buildSettings.SWIFT_OBJC_BRIDGING_HEADER = bridgingHeader; | ||
@@ -159,0 +159,0 @@ } |
@@ -35,5 +35,3 @@ "use strict"; | ||
} | ||
let TargetType; | ||
exports.TargetType = TargetType; | ||
(function (TargetType) { | ||
let TargetType = exports.TargetType = /*#__PURE__*/function (TargetType) { | ||
TargetType["APPLICATION"] = "com.apple.product-type.application"; | ||
@@ -46,3 +44,4 @@ TargetType["EXTENSION"] = "com.apple.product-type.app-extension"; | ||
TargetType["OTHER"] = "other"; | ||
})(TargetType || (exports.TargetType = TargetType = {})); | ||
return TargetType; | ||
}({}); | ||
function getXCBuildConfigurationFromPbxproj(project, { | ||
@@ -57,3 +56,3 @@ targetName, | ||
}); | ||
return xcBuildConfiguration !== null && xcBuildConfiguration !== void 0 ? xcBuildConfiguration : null; | ||
return xcBuildConfiguration ?? null; | ||
} | ||
@@ -60,0 +59,0 @@ async function findApplicationTargetWithDependenciesAsync(projectRoot, scheme) { |
@@ -1,2 +0,1 @@ | ||
import xcode from 'xcode'; | ||
import { ExpoPlist } from './IosConfig.types'; | ||
@@ -18,14 +17,1 @@ import { ConfigPlugin } from '../Plugin.types'; | ||
export declare function setVersionsConfigAsync(projectRoot: string, config: ExpoConfigUpdates, expoPlist: ExpoPlist): Promise<ExpoPlist>; | ||
interface ShellScriptBuildPhase { | ||
isa: 'PBXShellScriptBuildPhase'; | ||
name: string; | ||
shellScript: string; | ||
[key: string]: any; | ||
} | ||
export declare function getBundleReactNativePhase(project: xcode.XcodeProject): ShellScriptBuildPhase; | ||
export declare function ensureBundleReactNativePhaseContainsConfigurationScript(projectRoot: string, project: xcode.XcodeProject): xcode.XcodeProject; | ||
export declare function isShellScriptBuildPhaseConfigured(projectRoot: string, project: xcode.XcodeProject): boolean; | ||
export declare function isPlistConfigurationSet(expoPlist: ExpoPlist): boolean; | ||
export declare function isPlistConfigurationSyncedAsync(projectRoot: string, config: ExpoConfigUpdates, expoPlist: ExpoPlist): Promise<boolean>; | ||
export declare function isPlistVersionConfigurationSyncedAsync(projectRoot: string, config: Pick<ExpoConfigUpdates, 'sdkVersion' | 'runtimeVersion'>, expoPlist: ExpoPlist): Promise<boolean>; | ||
export {}; |
@@ -7,25 +7,5 @@ "use strict"; | ||
exports.Config = void 0; | ||
exports.ensureBundleReactNativePhaseContainsConfigurationScript = ensureBundleReactNativePhaseContainsConfigurationScript; | ||
exports.getBundleReactNativePhase = getBundleReactNativePhase; | ||
exports.isPlistConfigurationSet = isPlistConfigurationSet; | ||
exports.isPlistConfigurationSyncedAsync = isPlistConfigurationSyncedAsync; | ||
exports.isPlistVersionConfigurationSyncedAsync = isPlistVersionConfigurationSyncedAsync; | ||
exports.isShellScriptBuildPhaseConfigured = isShellScriptBuildPhaseConfigured; | ||
exports.setUpdatesConfigAsync = setUpdatesConfigAsync; | ||
exports.setVersionsConfigAsync = setVersionsConfigAsync; | ||
exports.withUpdates = void 0; | ||
function path() { | ||
const data = _interopRequireWildcard(require("path")); | ||
path = function () { | ||
return data; | ||
}; | ||
return data; | ||
} | ||
function _resolveFrom() { | ||
const data = _interopRequireDefault(require("resolve-from")); | ||
_resolveFrom = function () { | ||
return data; | ||
}; | ||
return data; | ||
} | ||
function _iosPlugins() { | ||
@@ -45,10 +25,3 @@ const data = require("../plugins/ios-plugins"); | ||
} | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
const CREATE_MANIFEST_IOS_PATH = 'expo-updates/scripts/create-manifest-ios.sh'; | ||
let Config; // when making changes to this config plugin, ensure the same changes are also made in eas-cli and build-tools | ||
// Also ensure the docs are up-to-date: https://docs.expo.dev/bare/installing-updates/ | ||
exports.Config = Config; | ||
(function (Config) { | ||
let Config = exports.Config = /*#__PURE__*/function (Config) { | ||
Config["ENABLED"] = "EXUpdatesEnabled"; | ||
@@ -62,3 +35,5 @@ Config["CHECK_ON_LAUNCH"] = "EXUpdatesCheckOnLaunch"; | ||
Config["CODE_SIGNING_METADATA"] = "EXUpdatesCodeSigningMetadata"; | ||
})(Config || (exports.Config = Config = {})); | ||
return Config; | ||
}({}); // when making changes to this config plugin, ensure the same changes are also made in eas-cli and build-tools | ||
// Also ensure the docs are up-to-date: https://docs.expo.dev/bare/installing-updates/ | ||
const withUpdates = config => { | ||
@@ -123,53 +98,2 @@ return (0, _iosPlugins().withExpoPlist)(config, async config => { | ||
} | ||
function formatConfigurationScriptPath(projectRoot) { | ||
const buildScriptPath = _resolveFrom().default.silent(projectRoot, CREATE_MANIFEST_IOS_PATH); | ||
if (!buildScriptPath) { | ||
throw new Error("Could not find the build script for iOS. This could happen in case of outdated 'node_modules'. Run 'npm install' to make sure that it's up-to-date."); | ||
} | ||
const relativePath = path().relative(path().join(projectRoot, 'ios'), buildScriptPath); | ||
return process.platform === 'win32' ? relativePath.replace(/\\/g, '/') : relativePath; | ||
} | ||
function getBundleReactNativePhase(project) { | ||
const shellScriptBuildPhase = project.hash.project.objects.PBXShellScriptBuildPhase; | ||
const bundleReactNative = Object.values(shellScriptBuildPhase).find(buildPhase => buildPhase.name === '"Bundle React Native code and images"'); | ||
if (!bundleReactNative) { | ||
throw new Error(`Couldn't find a build phase "Bundle React Native code and images"`); | ||
} | ||
return bundleReactNative; | ||
} | ||
function ensureBundleReactNativePhaseContainsConfigurationScript(projectRoot, project) { | ||
const bundleReactNative = getBundleReactNativePhase(project); | ||
const buildPhaseShellScriptPath = formatConfigurationScriptPath(projectRoot); | ||
if (!isShellScriptBuildPhaseConfigured(projectRoot, project)) { | ||
// check if there's already another path to create-manifest-ios.sh | ||
// this might be the case for monorepos | ||
if (bundleReactNative.shellScript.includes(CREATE_MANIFEST_IOS_PATH)) { | ||
bundleReactNative.shellScript = bundleReactNative.shellScript.replace(new RegExp(`(\\\\n)(\\.\\.)+/node_modules/${CREATE_MANIFEST_IOS_PATH}`), ''); | ||
} | ||
bundleReactNative.shellScript = `${bundleReactNative.shellScript.replace(/"$/, '')}${buildPhaseShellScriptPath}\\n"`; | ||
} | ||
return project; | ||
} | ||
function isShellScriptBuildPhaseConfigured(projectRoot, project) { | ||
const bundleReactNative = getBundleReactNativePhase(project); | ||
const buildPhaseShellScriptPath = formatConfigurationScriptPath(projectRoot); | ||
return bundleReactNative.shellScript.includes(buildPhaseShellScriptPath); | ||
} | ||
function isPlistConfigurationSet(expoPlist) { | ||
return Boolean(expoPlist.EXUpdatesURL && expoPlist.EXUpdatesRuntimeVersion); | ||
} | ||
async function isPlistConfigurationSyncedAsync(projectRoot, config, expoPlist) { | ||
return (0, _Updates().getUpdateUrl)(config) === expoPlist.EXUpdatesURL && (0, _Updates().getUpdatesEnabled)(config) === expoPlist.EXUpdatesEnabled && (0, _Updates().getUpdatesTimeout)(config) === expoPlist.EXUpdatesLaunchWaitMs && (0, _Updates().getUpdatesCheckOnLaunch)(config) === expoPlist.EXUpdatesCheckOnLaunch && (0, _Updates().getUpdatesCodeSigningCertificate)(projectRoot, config) === expoPlist.EXUpdatesCodeSigningCertificate && (0, _Updates().getUpdatesCodeSigningMetadata)(config) === expoPlist.EXUpdatesCodeSigningMetadata && (await isPlistVersionConfigurationSyncedAsync(projectRoot, config, expoPlist)); | ||
} | ||
async function isPlistVersionConfigurationSyncedAsync(projectRoot, config, expoPlist) { | ||
var _expoPlist$EXUpdatesR, _expoPlist$EXUpdatesS; | ||
const expectedRuntimeVersion = await (0, _Updates().getRuntimeVersionNullableAsync)(projectRoot, config, 'ios'); | ||
const currentRuntimeVersion = (_expoPlist$EXUpdatesR = expoPlist.EXUpdatesRuntimeVersion) !== null && _expoPlist$EXUpdatesR !== void 0 ? _expoPlist$EXUpdatesR : null; | ||
const currentSdkVersion = (_expoPlist$EXUpdatesS = expoPlist.EXUpdatesSDKVersion) !== null && _expoPlist$EXUpdatesS !== void 0 ? _expoPlist$EXUpdatesS : null; | ||
if (expectedRuntimeVersion !== null) { | ||
return currentRuntimeVersion === expectedRuntimeVersion && currentSdkVersion === null; | ||
} else { | ||
return true; | ||
} | ||
} | ||
//# sourceMappingURL=Updates.js.map |
@@ -16,10 +16,8 @@ "use strict"; | ||
} | ||
const withUsesNonExemptEncryption = (0, _iosPlugins().createInfoPlistPluginWithPropertyGuard)(setUsesNonExemptEncryption, { | ||
const withUsesNonExemptEncryption = exports.withUsesNonExemptEncryption = (0, _iosPlugins().createInfoPlistPluginWithPropertyGuard)(setUsesNonExemptEncryption, { | ||
infoPlistProperty: 'ITSAppUsesNonExemptEncryption', | ||
expoConfigProperty: 'ios.config.usesNonExemptEncryption' | ||
}, 'withUsesNonExemptEncryption'); | ||
exports.withUsesNonExemptEncryption = withUsesNonExemptEncryption; | ||
function getUsesNonExemptEncryption(config) { | ||
var _config$ios$config$us, _config$ios, _config$ios$config; | ||
return (_config$ios$config$us = config === null || config === void 0 ? void 0 : (_config$ios = config.ios) === null || _config$ios === void 0 ? void 0 : (_config$ios$config = _config$ios.config) === null || _config$ios$config === void 0 ? void 0 : _config$ios$config.usesNonExemptEncryption) !== null && _config$ios$config$us !== void 0 ? _config$ios$config$us : null; | ||
return config?.ios?.config?.usesNonExemptEncryption ?? null; | ||
} | ||
@@ -26,0 +24,0 @@ function setUsesNonExemptEncryption(config, { |
@@ -47,5 +47,4 @@ "use strict"; | ||
function sanitizeInfoPlistBuildProperty(infoPlist) { | ||
var _infoPlist$replace$re; | ||
return (_infoPlist$replace$re = infoPlist === null || infoPlist === void 0 ? void 0 : infoPlist.replace(/"/g, '').replace('$(SRCROOT)', '')) !== null && _infoPlist$replace$re !== void 0 ? _infoPlist$replace$re : null; | ||
return infoPlist?.replace(/"/g, '').replace('$(SRCROOT)', '') ?? null; | ||
} | ||
//# sourceMappingURL=getInfoPlistPath.js.map |
@@ -83,4 +83,4 @@ "use strict"; | ||
} | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } | ||
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -235,3 +235,3 @@ /** | ||
const applicationNativeTarget = project.getTarget('com.apple.product-type.application'); | ||
file.target = applicationNativeTarget === null || applicationNativeTarget === void 0 ? void 0 : applicationNativeTarget.uuid; | ||
file.target = applicationNativeTarget?.uuid; | ||
} | ||
@@ -292,4 +292,3 @@ file.uuid = project.generateUuid(); | ||
if (foundGroup) { | ||
var _project$getPBXGroupB; | ||
return (_project$getPBXGroupB = project.getPBXGroupByKey(foundGroup.value)) !== null && _project$getPBXGroupB !== void 0 ? _project$getPBXGroupB : null; | ||
return project.getPBXGroupByKey(foundGroup.value) ?? null; | ||
} | ||
@@ -318,3 +317,2 @@ return null; | ||
function ensureGroupRecursively(project, filepath) { | ||
var _topMostGroup; | ||
const components = splitPath(filepath); | ||
@@ -337,3 +335,3 @@ const hasChild = (group, name) => group.children.find(({ | ||
} | ||
return (_topMostGroup = topMostGroup) !== null && _topMostGroup !== void 0 ? _topMostGroup : null; | ||
return topMostGroup ?? null; | ||
} | ||
@@ -366,5 +364,4 @@ | ||
if (productName === '$(TARGET_NAME)') { | ||
var _project$getFirstTarg, _project$getFirstTarg2; | ||
const targetName = (_project$getFirstTarg = project.getFirstTarget()) === null || _project$getFirstTarg === void 0 ? void 0 : (_project$getFirstTarg2 = _project$getFirstTarg.firstTarget) === null || _project$getFirstTarg2 === void 0 ? void 0 : _project$getFirstTarg2.productName; | ||
productName = targetName !== null && targetName !== void 0 ? targetName : productName; | ||
const targetName = project.getFirstTarget()?.firstTarget?.productName; | ||
productName = targetName ?? productName; | ||
} | ||
@@ -408,3 +405,2 @@ return productName; | ||
function unquote(value) { | ||
var _value$match$, _value$match; | ||
// projects with numeric names will fail due to a bug in the xcode package. | ||
@@ -414,7 +410,6 @@ if (typeof value === 'number') { | ||
} | ||
return (_value$match$ = (_value$match = value.match(/^"(.*)"$/)) === null || _value$match === void 0 ? void 0 : _value$match[1]) !== null && _value$match$ !== void 0 ? _value$match$ : value; | ||
return value.match(/^"(.*)"$/)?.[1] ?? value; | ||
} | ||
function resolveXcodeBuildSetting(value, lookup) { | ||
const parsedValue = value === null || value === void 0 ? void 0 : value.replace(/\$\(([^()]*|\([^)]*\))\)/g, match => { | ||
var _resolved5; | ||
const parsedValue = value?.replace(/\$\(([^()]*|\([^)]*\))\)/g, match => { | ||
// Remove the `$(` and `)`, then split modifier(s) from the variable name. | ||
@@ -431,11 +426,10 @@ const [variable, ...transformations] = match.slice(2, -1).split(':'); | ||
transformations.forEach(modifier => { | ||
var _resolved, _resolved2, _resolved3, _resolved4, _modifier$match; | ||
switch (modifier) { | ||
case 'lower': | ||
// A lowercase representation. | ||
resolved = (_resolved = resolved) === null || _resolved === void 0 ? void 0 : _resolved.toLowerCase(); | ||
resolved = resolved?.toLowerCase(); | ||
break; | ||
case 'upper': | ||
// An uppercase representation. | ||
resolved = (_resolved2 = resolved) === null || _resolved2 === void 0 ? void 0 : _resolved2.toUpperCase(); | ||
resolved = resolved?.toUpperCase(); | ||
break; | ||
@@ -472,3 +466,3 @@ case 'suffix': | ||
// TODO: Check the spec if there is one, this is just what we had before. | ||
resolved = (_resolved3 = resolved) === null || _resolved3 === void 0 ? void 0 : _resolved3.replace(/[^a-zA-Z0-9]/g, '-'); | ||
resolved = resolved?.replace(/[^a-zA-Z0-9]/g, '-'); | ||
// resolved = resolved.replace(/[\/\*\s]/g, '-'); | ||
@@ -479,3 +473,3 @@ break; | ||
// TODO: Check the spec if there is one. | ||
resolved = (_resolved4 = resolved) === null || _resolved4 === void 0 ? void 0 : _resolved4.replace(/[-\s]/g, '_'); | ||
resolved = resolved?.replace(/[-\s]/g, '_'); | ||
break; | ||
@@ -490,7 +484,7 @@ case 'standardizepath': | ||
default: | ||
resolved || (resolved = (_modifier$match = modifier.match(/default=(.*)/)) === null || _modifier$match === void 0 ? void 0 : _modifier$match[1]); | ||
resolved ||= modifier.match(/default=(.*)/)?.[1]; | ||
break; | ||
} | ||
}); | ||
return resolveXcodeBuildSetting((_resolved5 = resolved) !== null && _resolved5 !== void 0 ? _resolved5 : '', lookup); | ||
return resolveXcodeBuildSetting(resolved ?? '', lookup); | ||
}); | ||
@@ -497,0 +491,0 @@ if (parsedValue !== value) { |
@@ -18,12 +18,10 @@ "use strict"; | ||
} | ||
const withVersion = (0, _iosPlugins().createInfoPlistPluginWithPropertyGuard)(setVersion, { | ||
const withVersion = exports.withVersion = (0, _iosPlugins().createInfoPlistPluginWithPropertyGuard)(setVersion, { | ||
infoPlistProperty: 'CFBundleShortVersionString', | ||
expoConfigProperty: 'version' | ||
}, 'withVersion'); | ||
exports.withVersion = withVersion; | ||
const withBuildNumber = (0, _iosPlugins().createInfoPlistPluginWithPropertyGuard)(setBuildNumber, { | ||
const withBuildNumber = exports.withBuildNumber = (0, _iosPlugins().createInfoPlistPluginWithPropertyGuard)(setBuildNumber, { | ||
infoPlistProperty: 'CFBundleVersion', | ||
expoConfigProperty: 'ios.buildNumber' | ||
}, 'withBuildNumber'); | ||
exports.withBuildNumber = withBuildNumber; | ||
function getVersion(config) { | ||
@@ -39,4 +37,3 @@ return config.version || '1.0.0'; | ||
function getBuildNumber(config) { | ||
var _config$ios; | ||
return (_config$ios = config.ios) !== null && _config$ios !== void 0 && _config$ios.buildNumber ? config.ios.buildNumber : '1'; | ||
return config.ios?.buildNumber ? config.ios.buildNumber : '1'; | ||
} | ||
@@ -43,0 +40,0 @@ function setBuildNumber(config, infoPlist) { |
@@ -89,6 +89,10 @@ import { ExpoConfig } from '@expo/config-types'; | ||
/** | ||
* Dangerously make a modification before any other android mods have been run. | ||
* Dangerously make a modification before any other platform mods have been run. | ||
*/ | ||
dangerous?: Mod<unknown>; | ||
/** | ||
* Dangerously make a modification after all the other platform mods have been run. | ||
*/ | ||
finalized?: Mod<unknown>; | ||
/** | ||
* Modify the `android/app/src/main/AndroidManifest.xml` as JSON (parsed with [`xml2js`](https://www.npmjs.com/package/xml2js)). | ||
@@ -140,6 +144,10 @@ */ | ||
/** | ||
* Dangerously make a modification before any other android mods have been run. | ||
* Dangerously make a modification before any other platform mods have been run. | ||
*/ | ||
dangerous?: Mod<unknown>; | ||
/** | ||
* Dangerously make a modification after all the other platform mods have been run. | ||
*/ | ||
finalized?: Mod<unknown>; | ||
/** | ||
* Modify the `ios/<name>/Info.plist` as JSON (parsed with [`@expo/plist`](https://www.npmjs.com/package/@expo/plist)). | ||
@@ -146,0 +154,0 @@ */ |
@@ -37,3 +37,2 @@ "use strict"; | ||
const withUnknown = (config, _props) => { | ||
var _props$skipEmptyMod, _props$saveToInternal; | ||
const props = _props || {}; | ||
@@ -43,4 +42,4 @@ return (0, _withMod().withBaseMod)(config, { | ||
mod: modName, | ||
skipEmptyMod: (_props$skipEmptyMod = props.skipEmptyMod) !== null && _props$skipEmptyMod !== void 0 ? _props$skipEmptyMod : true, | ||
saveToInternal: (_props$saveToInternal = props.saveToInternal) !== null && _props$saveToInternal !== void 0 ? _props$saveToInternal : false, | ||
skipEmptyMod: props.skipEmptyMod ?? true, | ||
saveToInternal: props.saveToInternal ?? false, | ||
isProvider: true, | ||
@@ -91,3 +90,3 @@ isIntrospective, | ||
// Sanity check to help locate non compliant mods. | ||
if (!ensuredResults || typeof ensuredResults !== 'object' || !(ensuredResults !== null && ensuredResults !== void 0 && ensuredResults.mods)) { | ||
if (!ensuredResults || typeof ensuredResults !== 'object' || !ensuredResults?.mods) { | ||
throw new Error(`Mod \`mods.${platformName}.${modName}\` evaluated to an object that is not a valid project config. Instead got: ${JSON.stringify(ensuredResults)}`); | ||
@@ -94,0 +93,0 @@ } |
@@ -50,6 +50,5 @@ "use strict"; | ||
const withUnknown = config => withInfoPlist(config, async config => { | ||
var _config$modRawConfig$, _config$modRawConfig$2; | ||
const existingProperty = settings.expoPropertyGetter ? settings.expoPropertyGetter(config) : (0, _obj().get)(config, settings.expoConfigProperty); | ||
// If the user explicitly sets a value in the infoPlist, we should respect that. | ||
if (((_config$modRawConfig$ = config.modRawConfig.ios) === null || _config$modRawConfig$ === void 0 ? void 0 : (_config$modRawConfig$2 = _config$modRawConfig$.infoPlist) === null || _config$modRawConfig$2 === void 0 ? void 0 : _config$modRawConfig$2[settings.infoPlistProperty]) === undefined) { | ||
if (config.modRawConfig.ios?.infoPlist?.[settings.infoPlistProperty] === undefined) { | ||
config.modResults = await action(config, config.modResults); | ||
@@ -56,0 +55,0 @@ } else if (existingProperty !== undefined) { |
@@ -22,2 +22,3 @@ import { ForwardedBaseModOptions } from './createBaseMod'; | ||
}): Promise<ExportedConfig>; | ||
export declare function sortMods(commands: [string, any][], precedences: Record<string, number>): [string, any][]; | ||
/** | ||
@@ -24,0 +25,0 @@ * A generic plugin compiler. |
@@ -8,2 +8,3 @@ "use strict"; | ||
exports.evalModsAsync = evalModsAsync; | ||
exports.sortMods = sortMods; | ||
exports.withDefaultBaseMods = withDefaultBaseMods; | ||
@@ -67,4 +68,4 @@ exports.withIntrospectionBaseMods = withIntrospectionBaseMods; | ||
} | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } | ||
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -101,9 +102,7 @@ const debug = (0, _debug().default)('expo:config-plugins:mod-compiler'); | ||
for (const key of Object.keys(config.mods[platform] || {})) { | ||
var _config$mods$platform, _config$mods$platform2; | ||
// @ts-ignore | ||
if (!((_config$mods$platform = config.mods[platform]) !== null && _config$mods$platform !== void 0 && (_config$mods$platform2 = _config$mods$platform[key]) !== null && _config$mods$platform2 !== void 0 && _config$mods$platform2.isIntrospective)) { | ||
var _config$mods$platform3; | ||
if (!config.mods[platform]?.[key]?.isIntrospective) { | ||
debug(`removing non-idempotent mod: ${platform}.${key}`); | ||
// @ts-ignore | ||
(_config$mods$platform3 = config.mods[platform]) === null || _config$mods$platform3 === void 0 ? true : delete _config$mods$platform3[key]; | ||
delete config.mods[platform]?.[key]; | ||
} | ||
@@ -129,14 +128,14 @@ } | ||
} | ||
function sortMods(commands, order) { | ||
const allKeys = commands.map(([key]) => key); | ||
const completeOrder = [...new Set([...order, ...allKeys])]; | ||
const sorted = []; | ||
while (completeOrder.length) { | ||
const group = completeOrder.shift(); | ||
const commandSet = commands.find(([key]) => key === group); | ||
if (commandSet) { | ||
sorted.push(commandSet); | ||
} | ||
} | ||
return sorted; | ||
function sortMods(commands, precedences) { | ||
const seen = new Set(); | ||
const dedupedCommands = commands.filter(([key]) => { | ||
const duplicate = seen.has(key); | ||
seen.add(key); | ||
return !duplicate; | ||
}); | ||
return dedupedCommands.sort(([keyA], [keyB]) => { | ||
const precedenceA = precedences[keyA] || 0; | ||
const precedenceB = precedences[keyB] || 0; | ||
return precedenceA - precedenceB; | ||
}); | ||
} | ||
@@ -151,8 +150,11 @@ function getRawClone({ | ||
} | ||
const orders = { | ||
ios: [ | ||
// dangerous runs first | ||
'dangerous', | ||
// run the XcodeProject mod second because many plugins attempt to read from it. | ||
'xcodeproj'] | ||
const precedences = { | ||
ios: { | ||
// dangerous runs first | ||
dangerous: -2, | ||
// run the XcodeProject mod second because many plugins attempt to read from it. | ||
xcodeproj: -1, | ||
// put the finalized mod at the last | ||
finalized: 1 | ||
} | ||
}; | ||
@@ -172,4 +174,3 @@ /** | ||
const modRawConfig = getRawClone(config); | ||
for (const [platformName, platform] of Object.entries((_config$mods = config.mods) !== null && _config$mods !== void 0 ? _config$mods : {})) { | ||
var _config$mods; | ||
for (const [platformName, platform] of Object.entries(config.mods ?? {})) { | ||
if (platforms && !platforms.includes(platformName)) { | ||
@@ -181,5 +182,8 @@ debug(`skip platform: ${platformName}`); | ||
if (entries.length) { | ||
var _orders$platformName; | ||
// Move dangerous item to the first position if it exists, this ensures that all dangerous code runs first. | ||
entries = sortMods(entries, (_orders$platformName = orders[platformName]) !== null && _orders$platformName !== void 0 ? _orders$platformName : ['dangerous']); | ||
// Move dangerous item to the first position and finalized item to the last position if it exists. | ||
// This ensures that all dangerous code runs first and finalized applies last. | ||
entries = sortMods(entries, precedences[platformName] ?? { | ||
dangerous: -1, | ||
finalized: 1 | ||
}); | ||
debug(`run in order: ${entries.map(([name]) => name).join(', ')}`); | ||
@@ -186,0 +190,0 @@ const platformProjectRoot = _path().default.join(projectRoot, platformName); |
@@ -8,2 +8,3 @@ import { ForwardedBaseModOptions } from './createBaseMod'; | ||
dangerous: import("./createBaseMod").BaseModProviderMethods<unknown, Partial<Pick<import("./withMod").BaseModOptions, "skipEmptyMod" | "saveToInternal">>>; | ||
finalized: import("./createBaseMod").BaseModProviderMethods<unknown, Partial<Pick<import("./withMod").BaseModOptions, "skipEmptyMod" | "saveToInternal">>>; | ||
manifest: import("./createBaseMod").BaseModProviderMethods<Manifest.AndroidManifest, Partial<Pick<import("./withMod").BaseModOptions, "skipEmptyMod" | "saveToInternal">>>; | ||
@@ -27,2 +28,3 @@ gradleProperties: import("./createBaseMod").BaseModProviderMethods<Properties.PropertiesItem[], Partial<Pick<import("./withMod").BaseModOptions, "skipEmptyMod" | "saveToInternal">>>; | ||
dangerous: import("./createBaseMod").BaseModProviderMethods<unknown, Partial<Pick<import("./withMod").BaseModOptions, "skipEmptyMod" | "saveToInternal">>>; | ||
finalized: import("./createBaseMod").BaseModProviderMethods<unknown, Partial<Pick<import("./withMod").BaseModOptions, "skipEmptyMod" | "saveToInternal">>>; | ||
manifest: import("./createBaseMod").BaseModProviderMethods<Manifest.AndroidManifest, Partial<Pick<import("./withMod").BaseModOptions, "skipEmptyMod" | "saveToInternal">>>; | ||
@@ -29,0 +31,0 @@ gradleProperties: import("./createBaseMod").BaseModProviderMethods<Properties.PropertiesItem[], Partial<Pick<import("./withMod").BaseModOptions, "skipEmptyMod" | "saveToInternal">>>; |
@@ -57,7 +57,6 @@ "use strict"; | ||
function getAndroidManifestTemplate(config) { | ||
var _config$android$packa, _config$android; | ||
// Keep in sync with https://github.com/expo/expo/blob/master/templates/expo-template-bare-minimum/android/app/src/main/AndroidManifest.xml | ||
// TODO: Read from remote template when possible | ||
return (0, _XML().parseXMLAsync)(` | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="${(_config$android$packa = (_config$android = config.android) === null || _config$android === void 0 ? void 0 : _config$android.package) !== null && _config$android$packa !== void 0 ? _config$android$packa : 'com.placeholder.appid'}"> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="${config.android?.package ?? 'com.placeholder.appid'}"> | ||
@@ -153,2 +152,14 @@ <uses-permission android:name="android.permission.INTERNET"/> | ||
}), | ||
finalized: (0, _createBaseMod().provider)({ | ||
getFilePath() { | ||
return ''; | ||
}, | ||
async read() { | ||
return { | ||
filePath: '', | ||
modResults: {} | ||
}; | ||
}, | ||
async write() {} | ||
}), | ||
// Append a rule to supply gradle.properties data to mods on `mods.android.gradleProperties` | ||
@@ -371,3 +382,2 @@ manifest: (0, _createBaseMod().provider)({ | ||
async read(filePath, config) { | ||
var _styles$resources$$; | ||
let styles = { | ||
@@ -392,3 +402,3 @@ resources: {} | ||
} | ||
if (!((_styles$resources$$ = styles.resources.$) !== null && _styles$resources$$ !== void 0 && _styles$resources$$['xmlns:tools'])) { | ||
if (!styles.resources.$?.['xmlns:tools']) { | ||
styles.resources.$['xmlns:tools'] = 'http://schemas.android.com/tools'; | ||
@@ -514,3 +524,3 @@ } | ||
platform: 'android', | ||
providers: providers !== null && providers !== void 0 ? providers : getAndroidModFileProviders() | ||
providers: providers ?? getAndroidModFileProviders() | ||
}); | ||
@@ -517,0 +527,0 @@ } |
@@ -9,2 +9,3 @@ import { JSONObject, JSONValue } from '@expo/json-file'; | ||
dangerous: import("./createBaseMod").BaseModProviderMethods<unknown, Partial<Pick<import("./withMod").BaseModOptions, "skipEmptyMod" | "saveToInternal">>>; | ||
finalized: import("./createBaseMod").BaseModProviderMethods<unknown, Partial<Pick<import("./withMod").BaseModOptions, "skipEmptyMod" | "saveToInternal">>>; | ||
appDelegate: import("./createBaseMod").BaseModProviderMethods<Paths.AppDelegateProjectFile, Partial<Pick<import("./withMod").BaseModOptions, "skipEmptyMod" | "saveToInternal">>>; | ||
@@ -23,2 +24,3 @@ expoPlist: import("./createBaseMod").BaseModProviderMethods<JSONObject, Partial<Pick<import("./withMod").BaseModOptions, "skipEmptyMod" | "saveToInternal">>>; | ||
dangerous: import("./createBaseMod").BaseModProviderMethods<unknown, Partial<Pick<import("./withMod").BaseModOptions, "skipEmptyMod" | "saveToInternal">>>; | ||
finalized: import("./createBaseMod").BaseModProviderMethods<unknown, Partial<Pick<import("./withMod").BaseModOptions, "skipEmptyMod" | "saveToInternal">>>; | ||
appDelegate: import("./createBaseMod").BaseModProviderMethods<Paths.AppDelegateProjectFile, Partial<Pick<import("./withMod").BaseModOptions, "skipEmptyMod" | "saveToInternal">>>; | ||
@@ -25,0 +27,0 @@ expoPlist: import("./createBaseMod").BaseModProviderMethods<JSONObject, Partial<Pick<import("./withMod").BaseModOptions, "skipEmptyMod" | "saveToInternal">>>; |
@@ -106,4 +106,4 @@ "use strict"; | ||
} | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } | ||
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -154,2 +154,11 @@ const { | ||
}), | ||
finalized: (0, _createBaseMod().provider)({ | ||
getFilePath() { | ||
return ''; | ||
}, | ||
async read() { | ||
return {}; | ||
}, | ||
async write() {} | ||
}), | ||
// Append a rule to supply AppDelegate data to mods on `mods.ios.appDelegate` | ||
@@ -318,5 +327,4 @@ appDelegate: (0, _createBaseMod().provider)({ | ||
try { | ||
var _Entitlements$getEnti; | ||
(0, _Entitlements().ensureApplicationTargetEntitlementsFileConfigured)(config.modRequest.projectRoot); | ||
return (_Entitlements$getEnti = _ios().Entitlements.getEntitlementsPath(config.modRequest.projectRoot)) !== null && _Entitlements$getEnti !== void 0 ? _Entitlements$getEnti : ''; | ||
return _ios().Entitlements.getEntitlementsPath(config.modRequest.projectRoot) ?? ''; | ||
} catch (error) { | ||
@@ -410,3 +418,3 @@ if (config.modRequest.introspect) { | ||
platform: 'ios', | ||
providers: providers !== null && providers !== void 0 ? providers : getIosModFileProviders() | ||
providers: providers ?? getIosModFileProviders() | ||
}); | ||
@@ -413,0 +421,0 @@ } |
@@ -54,3 +54,2 @@ "use strict"; | ||
}) { | ||
var _config$_internal$isD, _config$_internal; | ||
if (!config.mods) { | ||
@@ -79,3 +78,3 @@ config.mods = {}; | ||
// We support the env variable because user mods won't have _internal defined in time. | ||
const isDebug = (_config$_internal$isD = (_config$_internal = config._internal) === null || _config$_internal === void 0 ? void 0 : _config$_internal.isDebug) !== null && _config$_internal$isD !== void 0 ? _config$_internal$isD : EXPO_DEBUG; | ||
const isDebug = config._internal?.isDebug ?? EXPO_DEBUG; | ||
if (isDebug) { | ||
@@ -147,6 +146,5 @@ // Get a stack trace via the Error API | ||
const plugins = treeStackLines.map(first => { | ||
var _ref, _first$match$1$trim, _first$match, _first$match$, _first$match2, _first$match2$; | ||
// Match the first part of the stack trace against the plugin naming convention | ||
// "with" followed by a capital letter. | ||
return (_ref = (_first$match$1$trim = first === null || first === void 0 ? void 0 : (_first$match = first.match(/^(\bwith[A-Z].*?\b)/)) === null || _first$match === void 0 ? void 0 : (_first$match$ = _first$match[1]) === null || _first$match$ === void 0 ? void 0 : _first$match$.trim()) !== null && _first$match$1$trim !== void 0 ? _first$match$1$trim : first === null || first === void 0 ? void 0 : (_first$match2 = first.match(/\.(\bwith[A-Z].*?\b)/)) === null || _first$match2 === void 0 ? void 0 : (_first$match2$ = _first$match2[1]) === null || _first$match2$ === void 0 ? void 0 : _first$match2$.trim()) !== null && _ref !== void 0 ? _ref : null; | ||
return first?.match(/^(\bwith[A-Z].*?\b)/)?.[1]?.trim() ?? first?.match(/\.(\bwith[A-Z].*?\b)/)?.[1]?.trim() ?? null; | ||
}).filter(Boolean).filter(plugin => { | ||
@@ -153,0 +151,0 @@ // redundant as all debug logs are captured in withBaseMod |
@@ -69,7 +69,5 @@ "use strict"; | ||
const withStaticPlugin = (config, props) => { | ||
var _pluginProps; | ||
let projectRoot = props.projectRoot; | ||
if (!projectRoot) { | ||
var _config$_internal; | ||
projectRoot = (_config$_internal = config._internal) === null || _config$_internal === void 0 ? void 0 : _config$_internal.projectRoot; | ||
projectRoot = config._internal?.projectRoot; | ||
(0, _pluginResolver().assertInternalProjectRoot)(projectRoot); | ||
@@ -79,3 +77,3 @@ } | ||
// Ensure no one uses this property by accident. | ||
(0, _assert().default)(!((_pluginProps = pluginProps) !== null && _pluginProps !== void 0 && _pluginProps._resolverError), `Plugin property '_resolverError' is a reserved property of \`withStaticPlugin\``); | ||
(0, _assert().default)(!pluginProps?._resolverError, `Plugin property '_resolverError' is a reserved property of \`withStaticPlugin\``); | ||
let withPlugin; | ||
@@ -82,0 +80,0 @@ if ( |
@@ -58,3 +58,3 @@ "use strict"; | ||
return { | ||
contents: addLines(sanitizedTarget !== null && sanitizedTarget !== void 0 ? sanitizedTarget : src, anchor, offset, [header, ...newSrc.split('\n'), `${comment} @generated end ${tag}`]), | ||
contents: addLines(sanitizedTarget ?? src, anchor, offset, [header, ...newSrc.split('\n'), `${comment} @generated end ${tag}`]), | ||
didMerge: true, | ||
@@ -77,3 +77,3 @@ didClear: !!sanitizedTarget | ||
return { | ||
contents: sanitizedTarget !== null && sanitizedTarget !== void 0 ? sanitizedTarget : src, | ||
contents: sanitizedTarget ?? src, | ||
didMerge: false, | ||
@@ -80,0 +80,0 @@ didClear: !!sanitizedTarget |
@@ -9,4 +9,3 @@ "use strict"; | ||
function getHistoryItem(config, name) { | ||
var _config$_internal$plu, _config$_internal, _config$_internal$plu2; | ||
return (_config$_internal$plu = (_config$_internal = config._internal) === null || _config$_internal === void 0 ? void 0 : (_config$_internal$plu2 = _config$_internal.pluginHistory) === null || _config$_internal$plu2 === void 0 ? void 0 : _config$_internal$plu2[name]) !== null && _config$_internal$plu !== void 0 ? _config$_internal$plu : null; | ||
return config._internal?.pluginHistory?.[name] ?? null; | ||
} | ||
@@ -13,0 +12,0 @@ function addHistoryItem(config, item) { |
@@ -30,8 +30,6 @@ "use strict"; | ||
async function fileExistsAsync(file) { | ||
var _await$statAsync$isFi, _await$statAsync; | ||
return (_await$statAsync$isFi = (_await$statAsync = await statAsync(file)) === null || _await$statAsync === void 0 ? void 0 : _await$statAsync.isFile()) !== null && _await$statAsync$isFi !== void 0 ? _await$statAsync$isFi : false; | ||
return (await statAsync(file))?.isFile() ?? false; | ||
} | ||
async function directoryExistsAsync(file) { | ||
var _await$statAsync$isDi, _await$statAsync2; | ||
return (_await$statAsync$isDi = (_await$statAsync2 = await statAsync(file)) === null || _await$statAsync2 === void 0 ? void 0 : _await$statAsync2.isDirectory()) !== null && _await$statAsync$isDi !== void 0 ? _await$statAsync$isDi : false; | ||
return (await statAsync(file))?.isDirectory() ?? false; | ||
} | ||
@@ -38,0 +36,0 @@ function fileExists(file) { |
@@ -56,8 +56,7 @@ "use strict"; | ||
} | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } | ||
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
// Default plugin entry file name. | ||
const pluginFileName = 'app.plugin.js'; | ||
exports.pluginFileName = pluginFileName; | ||
const pluginFileName = exports.pluginFileName = 'app.plugin.js'; | ||
function findUpPackageJson(root) { | ||
@@ -92,7 +91,6 @@ const packageJson = _findUp().default.sync('package.json', { | ||
function moduleNameIsDirectFileReference(name) { | ||
var _name$split; | ||
if (pathIsFilePath(name)) { | ||
return true; | ||
} | ||
const slashCount = (_name$split = name.split(path().sep)) === null || _name$split === void 0 ? void 0 : _name$split.length; | ||
const slashCount = name.split(path().sep)?.length; | ||
// Orgs (like @expo/config ) should have more than one slash to be a direct file. | ||
@@ -126,3 +124,3 @@ if (name.startsWith('@')) { | ||
return { | ||
filePath: pluginFile !== null && pluginFile !== void 0 ? pluginFile : root, | ||
filePath: pluginFile ?? root, | ||
isPluginFile: !!pluginFile | ||
@@ -129,0 +127,0 @@ }; |
import { Android, ExpoConfig, IOS } from '@expo/config-types'; | ||
export type ExpoConfigUpdates = Pick<ExpoConfig, 'sdkVersion' | 'owner' | 'runtimeVersion' | 'updates' | 'slug'>; | ||
export declare const FINGERPRINT_RUNTIME_VERSION_SENTINEL = "file:fingerprint"; | ||
export declare function getExpoUpdatesPackageVersion(projectRoot: string): string | null; | ||
@@ -4,0 +5,0 @@ export declare function getUpdateUrl(config: Pick<ExpoConfigUpdates, 'updates'>): string | null; |
@@ -6,2 +6,3 @@ "use strict"; | ||
}); | ||
exports.FINGERPRINT_RUNTIME_VERSION_SENTINEL = void 0; | ||
exports.getAppVersion = getAppVersion; | ||
@@ -22,9 +23,2 @@ exports.getExpoUpdatesPackageVersion = getExpoUpdatesPackageVersion; | ||
exports.getUpdatesTimeout = getUpdatesTimeout; | ||
function Fingerprint() { | ||
const data = _interopRequireWildcard(require("@expo/fingerprint")); | ||
Fingerprint = function () { | ||
return data; | ||
}; | ||
return data; | ||
} | ||
function _sdkRuntimeVersions() { | ||
@@ -80,4 +74,3 @@ const data = require("@expo/sdk-runtime-versions"); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
const FINGERPRINT_RUNTIME_VERSION_SENTINEL = exports.FINGERPRINT_RUNTIME_VERSION_SENTINEL = 'file:fingerprint'; | ||
function getExpoUpdatesPackageVersion(projectRoot) { | ||
@@ -92,8 +85,6 @@ const expoUpdatesPackageJsonPath = _resolveFrom().default.silent(projectRoot, 'expo-updates/package.json'); | ||
function getUpdateUrl(config) { | ||
var _config$updates$url, _config$updates; | ||
return (_config$updates$url = (_config$updates = config.updates) === null || _config$updates === void 0 ? void 0 : _config$updates.url) !== null && _config$updates$url !== void 0 ? _config$updates$url : null; | ||
return config.updates?.url ?? null; | ||
} | ||
function getAppVersion(config) { | ||
var _config$version; | ||
return (_config$version = config.version) !== null && _config$version !== void 0 ? _config$version : '1.0.0'; | ||
return config.version ?? '1.0.0'; | ||
} | ||
@@ -130,4 +121,3 @@ function getNativeVersion(config, platform) { | ||
async function getRuntimeVersionAsync(projectRoot, config, platform) { | ||
var _config$platform$runt, _config$platform; | ||
const runtimeVersion = (_config$platform$runt = (_config$platform = config[platform]) === null || _config$platform === void 0 ? void 0 : _config$platform.runtimeVersion) !== null && _config$platform$runt !== void 0 ? _config$platform$runt : config.runtimeVersion; | ||
const runtimeVersion = config[platform]?.runtimeVersion ?? config.runtimeVersion; | ||
if (!runtimeVersion) { | ||
@@ -137,2 +127,5 @@ return null; | ||
if (typeof runtimeVersion === 'string') { | ||
if (runtimeVersion === FINGERPRINT_RUNTIME_VERSION_SENTINEL) { | ||
throw new Error(`${FINGERPRINT_RUNTIME_VERSION_SENTINEL} is a reserved value for runtime version. To use a fingerprint runtime version, use the "fingerprintExperimental" runtime version policy.`); | ||
} | ||
return runtimeVersion; | ||
@@ -149,6 +142,6 @@ } else if (runtimeVersion.policy === 'appVersion') { | ||
} else if (runtimeVersion.policy === 'fingerprintExperimental') { | ||
console.warn("Use of the experimental 'fingerprintExperimental' runtime policy may result in unexpected system behavior."); | ||
return await Fingerprint().createProjectHashAsync(projectRoot); | ||
console.warn(`Use of the experimental '${runtimeVersion.policy}' runtime policy may result in unexpected system behavior.`); | ||
return FINGERPRINT_RUNTIME_VERSION_SENTINEL; | ||
} | ||
throw new Error(`"${typeof runtimeVersion === 'object' ? JSON.stringify(runtimeVersion) : runtimeVersion}" is not a valid runtime version. getRuntimeVersionAsync only supports a string, "sdkVersion", "appVersion", "nativeVersion" or "fingerprintExperimental" policy.`); | ||
throw new Error(`"${typeof runtimeVersion === 'object' ? JSON.stringify(runtimeVersion) : runtimeVersion}" is not a valid runtime version. getRuntimeVersionAsync only supports a string or one of the following policies: sdkVersion, appVersion, nativeVersion, fingerprintExperimental.`); | ||
} | ||
@@ -159,5 +152,4 @@ function getSDKVersion(config) { | ||
function getUpdatesEnabled(config) { | ||
var _config$updates2; | ||
// allow override of enabled property | ||
if (((_config$updates2 = config.updates) === null || _config$updates2 === void 0 ? void 0 : _config$updates2.enabled) !== undefined) { | ||
if (config.updates?.enabled !== undefined) { | ||
return config.updates.enabled; | ||
@@ -168,8 +160,6 @@ } | ||
function getUpdatesTimeout(config) { | ||
var _config$updates$fallb, _config$updates3; | ||
return (_config$updates$fallb = (_config$updates3 = config.updates) === null || _config$updates3 === void 0 ? void 0 : _config$updates3.fallbackToCacheTimeout) !== null && _config$updates$fallb !== void 0 ? _config$updates$fallb : 0; | ||
return config.updates?.fallbackToCacheTimeout ?? 0; | ||
} | ||
function getUpdatesCheckOnLaunch(config, expoUpdatesPackageVersion) { | ||
var _config$updates4, _config$updates5, _config$updates6, _config$updates7; | ||
if (((_config$updates4 = config.updates) === null || _config$updates4 === void 0 ? void 0 : _config$updates4.checkAutomatically) === 'ON_ERROR_RECOVERY') { | ||
if (config.updates?.checkAutomatically === 'ON_ERROR_RECOVERY') { | ||
// native 'ERROR_RECOVERY_ONLY' option was only introduced in 0.11.x | ||
@@ -180,7 +170,7 @@ if (expoUpdatesPackageVersion && _semver().default.gte(expoUpdatesPackageVersion, '0.11.0')) { | ||
return 'NEVER'; | ||
} else if (((_config$updates5 = config.updates) === null || _config$updates5 === void 0 ? void 0 : _config$updates5.checkAutomatically) === 'ON_LOAD') { | ||
} else if (config.updates?.checkAutomatically === 'ON_LOAD') { | ||
return 'ALWAYS'; | ||
} else if (((_config$updates6 = config.updates) === null || _config$updates6 === void 0 ? void 0 : _config$updates6.checkAutomatically) === 'WIFI_ONLY') { | ||
} else if (config.updates?.checkAutomatically === 'WIFI_ONLY') { | ||
return 'WIFI_ONLY'; | ||
} else if (((_config$updates7 = config.updates) === null || _config$updates7 === void 0 ? void 0 : _config$updates7.checkAutomatically) === 'NEVER') { | ||
} else if (config.updates?.checkAutomatically === 'NEVER') { | ||
return 'NEVER'; | ||
@@ -191,4 +181,3 @@ } | ||
function getUpdatesCodeSigningCertificate(projectRoot, config) { | ||
var _config$updates8; | ||
const codeSigningCertificatePath = (_config$updates8 = config.updates) === null || _config$updates8 === void 0 ? void 0 : _config$updates8.codeSigningCertificate; | ||
const codeSigningCertificatePath = config.updates?.codeSigningCertificate; | ||
if (!codeSigningCertificatePath) { | ||
@@ -204,4 +193,3 @@ return undefined; | ||
function getUpdatesCodeSigningMetadata(config) { | ||
var _config$updates9; | ||
return (_config$updates9 = config.updates) === null || _config$updates9 === void 0 ? void 0 : _config$updates9.codeSigningMetadata; | ||
return config.updates?.codeSigningMetadata; | ||
} | ||
@@ -216,4 +204,3 @@ function getUpdatesCodeSigningMetadataStringified(config) { | ||
function getUpdatesRequestHeaders(config) { | ||
var _config$updates10; | ||
return (_config$updates10 = config.updates) === null || _config$updates10 === void 0 ? void 0 : _config$updates10.requestHeaders; | ||
return config.updates?.requestHeaders; | ||
} | ||
@@ -220,0 +207,0 @@ function getUpdatesRequestHeadersStringified(config) { |
@@ -64,7 +64,5 @@ "use strict"; | ||
function _processAndroidXML(manifest) { | ||
var _manifest$resources; | ||
// For strings.xml | ||
if (Array.isArray(manifest === null || manifest === void 0 ? void 0 : (_manifest$resources = manifest.resources) === null || _manifest$resources === void 0 ? void 0 : _manifest$resources.string)) { | ||
for (const string of manifest === null || manifest === void 0 ? void 0 : (_manifest$resources2 = manifest.resources) === null || _manifest$resources2 === void 0 ? void 0 : _manifest$resources2.string) { | ||
var _manifest$resources2; | ||
if (Array.isArray(manifest?.resources?.string)) { | ||
for (const string of manifest?.resources?.string) { | ||
if (string.$.translatable === 'false' || string.$.translatable === false) { | ||
@@ -91,3 +89,2 @@ continue; | ||
} else if (manifest.toString) { | ||
var _manifest$resources3; | ||
const builder = new (_xml2js().Builder)({ | ||
@@ -98,5 +95,4 @@ headless: true | ||
// For strings.xml | ||
if (Array.isArray(manifest === null || manifest === void 0 ? void 0 : (_manifest$resources3 = manifest.resources) === null || _manifest$resources3 === void 0 ? void 0 : _manifest$resources3.string)) { | ||
for (const string of manifest === null || manifest === void 0 ? void 0 : (_manifest$resources4 = manifest.resources) === null || _manifest$resources4 === void 0 ? void 0 : _manifest$resources4.string) { | ||
var _manifest$resources4; | ||
if (Array.isArray(manifest?.resources?.string)) { | ||
for (const string of manifest?.resources?.string) { | ||
if (string.$.translatable === 'false' || string.$.translatable === false) { | ||
@@ -103,0 +99,0 @@ continue; |
{ | ||
"name": "@expo/config-plugins", | ||
"version": "0.0.1-canary-20240109-93608d8", | ||
"version": "0.0.1-canary-20240222-c729a13", | ||
"description": "A library for Expo config plugins", | ||
@@ -37,5 +37,4 @@ "main": "build/index.js", | ||
"@expo/config-types": "^50.0.0-alpha.1", | ||
"@expo/fingerprint": "0.0.1-canary-20240109-93608d8", | ||
"@expo/json-file": "0.0.1-canary-20240109-93608d8", | ||
"@expo/plist": "0.0.1-canary-20240109-93608d8", | ||
"@expo/json-file": "0.0.1-canary-20240222-c729a13", | ||
"@expo/plist": "0.0.1-canary-20240222-c729a13", | ||
"@expo/sdk-runtime-versions": "^1.0.0", | ||
@@ -49,3 +48,3 @@ "@react-native/normalize-color": "^2.0.0", | ||
"resolve-from": "^5.0.0", | ||
"semver": "^7.5.3", | ||
"semver": "^7.5.4", | ||
"slash": "^3.0.0", | ||
@@ -60,3 +59,3 @@ "slugify": "^1.6.6", | ||
"@types/xml2js": "~0.4.11", | ||
"expo-module-scripts": "0.0.1-canary-20240109-93608d8" | ||
"expo-module-scripts": "0.0.1-canary-20240222-c729a13" | ||
}, | ||
@@ -66,3 +65,3 @@ "publishConfig": { | ||
}, | ||
"gitHead": "93608d8dcb0268312e0c8ed22036ebfa6efe9830" | ||
"gitHead": "c729a13f936926743c13c021f569a22921455e49" | ||
} |
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
16
252
1076064
12606
+ Added@expo/json-file@0.0.1-canary-20240222-c729a13(transitive)
+ Added@expo/plist@0.0.1-canary-20240222-c729a13(transitive)
- Removed@expo/fingerprint@0.0.1-canary-20240109-93608d8(transitive)
- Removed@expo/json-file@0.0.1-canary-20240109-93608d8(transitive)
- Removed@expo/plist@0.0.1-canary-20240109-93608d8(transitive)
- Removed@expo/spawn-async@1.7.2(transitive)
- Removedcross-spawn@7.0.6(transitive)
- Removedisexe@2.0.0(transitive)
- Removedpath-key@3.1.1(transitive)
- Removedshebang-command@2.0.0(transitive)
- Removedshebang-regex@3.0.0(transitive)
- Removedwhich@2.0.2(transitive)
Updatedsemver@^7.5.4