@expo/config-plugins
Advanced tools
Comparing version 0.0.1-canary-20231205-250b31f to 0.0.1-canary-20240109-93608d8
@@ -10,6 +10,4 @@ import { Resources } from '.'; | ||
LAUNCH_WAIT_MS = "expo.modules.updates.EXPO_UPDATES_LAUNCH_WAIT_MS", | ||
SDK_VERSION = "expo.modules.updates.EXPO_SDK_VERSION", | ||
RUNTIME_VERSION = "expo.modules.updates.EXPO_RUNTIME_VERSION", | ||
UPDATE_URL = "expo.modules.updates.EXPO_UPDATE_URL", | ||
RELEASE_CHANNEL = "expo.modules.updates.EXPO_RELEASE_CHANNEL", | ||
UPDATES_CONFIGURATION_REQUEST_HEADERS_KEY = "expo.modules.updates.UPDATES_CONFIGURATION_REQUEST_HEADERS_KEY", | ||
@@ -21,2 +19,3 @@ CODE_SIGNING_CERTIFICATE = "expo.modules.updates.CODE_SIGNING_CERTIFICATE", | ||
export declare function applyRuntimeVersionFromConfigAsync(config: ExportedConfigWithProps<Resources.ResourceXML>, stringsJSON: ResourceXML): Promise<ResourceXML>; | ||
export declare function applyRuntimeVersionFromConfigForProjectRootAsync(projectRoot: string, config: ExpoConfigUpdates, stringsJSON: ResourceXML): Promise<ResourceXML>; | ||
export declare function setUpdatesConfigAsync(projectRoot: string, config: ExpoConfigUpdates, androidManifest: AndroidManifest, expoUpdatesPackageVersion?: string | null): Promise<AndroidManifest>; | ||
@@ -23,0 +22,0 @@ export declare function setVersionsConfigAsync(projectRoot: string, config: Pick<ExpoConfigUpdates, 'sdkVersion' | 'runtimeVersion'>, androidManifest: AndroidManifest): Promise<AndroidManifest>; |
@@ -8,2 +8,3 @@ "use strict"; | ||
exports.applyRuntimeVersionFromConfigAsync = applyRuntimeVersionFromConfigAsync; | ||
exports.applyRuntimeVersionFromConfigForProjectRootAsync = applyRuntimeVersionFromConfigForProjectRootAsync; | ||
exports.areVersionsSyncedAsync = areVersionsSyncedAsync; | ||
@@ -83,6 +84,4 @@ exports.ensureBuildGradleContainsConfigurationScript = ensureBuildGradleContainsConfigurationScript; | ||
Config["LAUNCH_WAIT_MS"] = "expo.modules.updates.EXPO_UPDATES_LAUNCH_WAIT_MS"; | ||
Config["SDK_VERSION"] = "expo.modules.updates.EXPO_SDK_VERSION"; | ||
Config["RUNTIME_VERSION"] = "expo.modules.updates.EXPO_RUNTIME_VERSION"; | ||
Config["UPDATE_URL"] = "expo.modules.updates.EXPO_UPDATE_URL"; | ||
Config["RELEASE_CHANNEL"] = "expo.modules.updates.EXPO_RELEASE_CHANNEL"; | ||
Config["UPDATES_CONFIGURATION_REQUEST_HEADERS_KEY"] = "expo.modules.updates.UPDATES_CONFIGURATION_REQUEST_HEADERS_KEY"; | ||
@@ -107,2 +106,5 @@ Config["CODE_SIGNING_CERTIFICATE"] = "expo.modules.updates.CODE_SIGNING_CERTIFICATE"; | ||
const projectRoot = config.modRequest.projectRoot; | ||
return await applyRuntimeVersionFromConfigForProjectRootAsync(projectRoot, config, stringsJSON); | ||
} | ||
async function applyRuntimeVersionFromConfigForProjectRootAsync(projectRoot, config, stringsJSON) { | ||
const runtimeVersion = await (0, _Updates().getRuntimeVersionNullableAsync)(projectRoot, config, 'android'); | ||
@@ -154,16 +156,8 @@ if (runtimeVersion) { | ||
} | ||
const sdkVersion = (0, _Updates().getSDKVersion)(config); | ||
if (runtimeVersion) { | ||
(0, _Manifest().removeMetaDataItemFromMainApplication)(mainApplication, Config.SDK_VERSION); | ||
(0, _Manifest().removeMetaDataItemFromMainApplication)(mainApplication, 'expo.modules.updates.EXPO_SDK_VERSION'); | ||
(0, _Manifest().addMetaDataItemToMainApplication)(mainApplication, Config.RUNTIME_VERSION, '@string/expo_runtime_version'); | ||
} else if (sdkVersion) { | ||
/** | ||
* runtime version maybe null in projects using classic updates. In that | ||
* case we use SDK version | ||
*/ | ||
(0, _Manifest().removeMetaDataItemFromMainApplication)(mainApplication, Config.RUNTIME_VERSION); | ||
(0, _Manifest().addMetaDataItemToMainApplication)(mainApplication, Config.SDK_VERSION, sdkVersion); | ||
} else { | ||
(0, _Manifest().removeMetaDataItemFromMainApplication)(mainApplication, Config.RUNTIME_VERSION); | ||
(0, _Manifest().removeMetaDataItemFromMainApplication)(mainApplication, Config.SDK_VERSION); | ||
(0, _Manifest().removeMetaDataItemFromMainApplication)(mainApplication, 'expo.modules.updates.EXPO_SDK_VERSION'); | ||
} | ||
@@ -205,4 +199,3 @@ return androidManifest; | ||
const runtimeVersion = (0, _Manifest().getMainApplicationMetaDataValue)(androidManifest, Config.RUNTIME_VERSION); | ||
const sdkVersion = (0, _Manifest().getMainApplicationMetaDataValue)(androidManifest, Config.SDK_VERSION); | ||
return Boolean(updateUrl && (sdkVersion || runtimeVersion)); | ||
return Boolean(updateUrl && runtimeVersion); | ||
} | ||
@@ -214,9 +207,6 @@ async function isMainApplicationMetaDataSyncedAsync(projectRoot, config, androidManifest) { | ||
const expectedRuntimeVersion = await (0, _Updates().getRuntimeVersionNullableAsync)(projectRoot, config, 'android'); | ||
const expectedSdkVersion = (0, _Updates().getSDKVersion)(config); | ||
const currentRuntimeVersion = (0, _Manifest().getMainApplicationMetaDataValue)(androidManifest, Config.RUNTIME_VERSION); | ||
const currentSdkVersion = (0, _Manifest().getMainApplicationMetaDataValue)(androidManifest, Config.SDK_VERSION); | ||
const currentSdkVersion = (0, _Manifest().getMainApplicationMetaDataValue)(androidManifest, 'expo.modules.updates.EXPO_SDK_VERSION'); | ||
if (expectedRuntimeVersion !== null) { | ||
return currentRuntimeVersion === expectedRuntimeVersion && currentSdkVersion === null; | ||
} else if (expectedSdkVersion !== null) { | ||
return currentSdkVersion === expectedSdkVersion && currentRuntimeVersion === null; | ||
} else { | ||
@@ -223,0 +213,0 @@ return true; |
@@ -38,5 +38,7 @@ import { JSONValue } from '@expo/json-file'; | ||
EXUpdatesLaunchWaitMs?: number; | ||
EXUpdatesReleaseChannel?: string; | ||
EXUpdatesRuntimeVersion?: string; | ||
EXUpdatesRequestHeaders?: Record<string, string>; | ||
/** | ||
* @deprecated removed, but kept in types so that it can be mutated (deleted) from existing plists | ||
*/ | ||
EXUpdatesSDKVersion?: string; | ||
@@ -43,0 +45,0 @@ EXUpdatesURL?: string; |
@@ -172,3 +172,2 @@ "use strict"; | ||
} | ||
const withMapsCocoaPods = (config, { | ||
@@ -175,0 +174,0 @@ useGoogleMaps |
@@ -10,5 +10,3 @@ import xcode from 'xcode'; | ||
RUNTIME_VERSION = "EXUpdatesRuntimeVersion", | ||
SDK_VERSION = "EXUpdatesSDKVersion", | ||
UPDATE_URL = "EXUpdatesURL", | ||
RELEASE_CHANNEL = "EXUpdatesReleaseChannel", | ||
UPDATES_CONFIGURATION_REQUEST_HEADERS_KEY = "EXUpdatesRequestHeaders", | ||
@@ -15,0 +13,0 @@ CODE_SIGNING_CERTIFICATE = "EXUpdatesCodeSigningCertificate", |
@@ -56,5 +56,3 @@ "use strict"; | ||
Config["RUNTIME_VERSION"] = "EXUpdatesRuntimeVersion"; | ||
Config["SDK_VERSION"] = "EXUpdatesSDKVersion"; | ||
Config["UPDATE_URL"] = "EXUpdatesURL"; | ||
Config["RELEASE_CHANNEL"] = "EXUpdatesReleaseChannel"; | ||
Config["UPDATES_CONFIGURATION_REQUEST_HEADERS_KEY"] = "EXUpdatesRequestHeaders"; | ||
@@ -114,15 +112,7 @@ Config["CODE_SIGNING_CERTIFICATE"] = "EXUpdatesCodeSigningCertificate"; | ||
} | ||
const sdkVersion = (0, _Updates().getSDKVersion)(config); | ||
if (runtimeVersion) { | ||
delete newExpoPlist[Config.SDK_VERSION]; | ||
delete newExpoPlist['EXUpdatesSDKVersion']; | ||
newExpoPlist[Config.RUNTIME_VERSION] = runtimeVersion; | ||
} else if (sdkVersion) { | ||
/** | ||
* runtime version maybe null in projects using classic updates. In that | ||
* case we use SDK version | ||
*/ | ||
delete newExpoPlist[Config.RUNTIME_VERSION]; | ||
newExpoPlist[Config.SDK_VERSION] = sdkVersion; | ||
} else { | ||
delete newExpoPlist[Config.SDK_VERSION]; | ||
delete newExpoPlist['EXUpdatesSDKVersion']; | ||
delete newExpoPlist[Config.RUNTIME_VERSION]; | ||
@@ -167,3 +157,3 @@ } | ||
function isPlistConfigurationSet(expoPlist) { | ||
return Boolean(expoPlist.EXUpdatesURL && (expoPlist.EXUpdatesSDKVersion || expoPlist.EXUpdatesRuntimeVersion)); | ||
return Boolean(expoPlist.EXUpdatesURL && expoPlist.EXUpdatesRuntimeVersion); | ||
} | ||
@@ -176,3 +166,2 @@ async function isPlistConfigurationSyncedAsync(projectRoot, config, expoPlist) { | ||
const expectedRuntimeVersion = await (0, _Updates().getRuntimeVersionNullableAsync)(projectRoot, config, 'ios'); | ||
const expectedSdkVersion = (0, _Updates().getSDKVersion)(config); | ||
const currentRuntimeVersion = (_expoPlist$EXUpdatesR = expoPlist.EXUpdatesRuntimeVersion) !== null && _expoPlist$EXUpdatesR !== void 0 ? _expoPlist$EXUpdatesR : null; | ||
@@ -182,4 +171,2 @@ const currentSdkVersion = (_expoPlist$EXUpdatesS = expoPlist.EXUpdatesSDKVersion) !== null && _expoPlist$EXUpdatesS !== void 0 ? _expoPlist$EXUpdatesS : null; | ||
return currentRuntimeVersion === expectedRuntimeVersion && currentSdkVersion === null; | ||
} else if (expectedSdkVersion !== null) { | ||
return currentSdkVersion === expectedSdkVersion && currentRuntimeVersion === null; | ||
} else { | ||
@@ -186,0 +173,0 @@ return true; |
@@ -90,3 +90,3 @@ "use strict"; | ||
<meta-data android:name="expo.modules.updates.EXPO_UPDATE_URL" android:value="YOUR-APP-URL-HERE"/> | ||
<meta-data android:name="expo.modules.updates.EXPO_SDK_VERSION" android:value="YOUR-APP-SDK-VERSION-HERE"/> | ||
<meta-data android:name="expo.modules.updates.EXPO_RUNTIME_VERSION" android:value="YOUR-APP-RUNTIME-VERSION-HERE"/> | ||
<activity | ||
@@ -93,0 +93,0 @@ android:name=".MainActivity" |
@@ -10,3 +10,3 @@ "use strict"; | ||
constructor(message) { | ||
super(`${message}\nPlease report this as an issue on https://github.com/expo/expo-cli/issues`); | ||
super(`${message}\nPlease report this as an issue on https://github.com/expo/expo/issues`); | ||
} | ||
@@ -13,0 +13,0 @@ } |
@@ -27,4 +27,4 @@ "use strict"; | ||
const contents = src.split('\n'); | ||
const start = contents.findIndex(line => line.includes(`@generated begin ${tag}`)); | ||
const end = contents.findIndex(line => line.includes(`@generated end ${tag}`)); | ||
const start = contents.findIndex(line => new RegExp(`@generated begin ${tag} -`).test(line)); | ||
const end = contents.findIndex(line => new RegExp(`@generated end ${tag}$`).test(line)); | ||
return { | ||
@@ -31,0 +31,0 @@ contents, |
{ | ||
"name": "@expo/config-plugins", | ||
"version": "0.0.1-canary-20231205-250b31f", | ||
"version": "0.0.1-canary-20240109-93608d8", | ||
"description": "A library for Expo config plugins", | ||
@@ -37,5 +37,5 @@ "main": "build/index.js", | ||
"@expo/config-types": "^50.0.0-alpha.1", | ||
"@expo/fingerprint": "0.0.1-canary-20231205-250b31f", | ||
"@expo/json-file": "0.0.1-canary-20231205-250b31f", | ||
"@expo/plist": "^0.0.20", | ||
"@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/sdk-runtime-versions": "^1.0.0", | ||
@@ -51,2 +51,3 @@ "@react-native/normalize-color": "^2.0.0", | ||
"slash": "^3.0.0", | ||
"slugify": "^1.6.6", | ||
"xcode": "^3.0.1", | ||
@@ -59,3 +60,3 @@ "xml2js": "0.6.0" | ||
"@types/xml2js": "~0.4.11", | ||
"expo-module-scripts": "0.0.1-canary-20231205-250b31f" | ||
"expo-module-scripts": "0.0.1-canary-20240109-93608d8" | ||
}, | ||
@@ -65,3 +66,3 @@ "publishConfig": { | ||
}, | ||
"gitHead": "250b31f516a04578a29c6bcda29aab80ef4d4e2d" | ||
"gitHead": "93608d8dcb0268312e0c8ed22036ebfa6efe9830" | ||
} |
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
1149339
17
12885
+ Addedslugify@^1.6.6
+ Added@expo/fingerprint@0.0.1-canary-20240109-93608d8(transitive)
+ Added@expo/json-file@0.0.1-canary-20240109-93608d8(transitive)
+ Added@expo/plist@0.0.1-canary-20240109-93608d8(transitive)
+ Addedslugify@1.6.6(transitive)
- Removed@expo/fingerprint@0.0.1-canary-20231205-250b31f(transitive)
- Removed@expo/json-file@0.0.1-canary-20231205-250b31f(transitive)
- Removed@expo/plist@0.0.20(transitive)