Compare commits

..
Author SHA1 Message Date
Quinlan JungandWill Schurman d2889571fe Update packages/eas-cli/src/project/projectUtils.ts
Co-authored-by: Will Schurman <[email protected]>
2023-06-30 16:57:29 -07:00
Quinlan Jung 224a5b288c update CHANGELOG.md 2023-06-30 23:35:11 +00:00
Quinlan Jung 16629e1ab5 remove draft function 2023-06-30 16:30:13 -07:00
Quinlan Jung d5a744b938 [eas-cli] remove useClassicUpdates upon configuration 2023-06-30 16:17:10 -07:00
3 changed files with 20 additions and 1 deletions

No files matched your search

+1 -1
View File
@@ -17,7 +17,7 @@ This is the log of notable changes to EAS CLI and related packages.
- Better runtimeVersion output. ([#1894](https://github.com/expo/eas-cli/pull/1894) by [@quinlanj](https://github.com/quinlanj))
- Print better error message when uploading project archive tarball fails. ([#1897](https://github.com/expo/eas-cli/pull/1897) by [@szdziedzic](https://github.com/szdziedzic))
- Bump config dependencies. ([#1913](https://github.com/expo/eas-cli/pull/1913) by [@quinlanj](https://github.com/quinlanj))
- Set useClassicUpdates to false on `eas update` and `eas update:configure`. ([#1914](https://github.com/expo/eas-cli/pull/1914) by [@quinlanj](https://github.com/quinlanj))
## [3.14.0](https://github.com/expo/eas-cli/releases/tag/v3.14.0) - 2023-06-20
@@ -84,6 +84,13 @@ export function isExpoUpdatesInstalledOrAvailable(
return isExpoUpdatesInstalled(projectDir);
}
/**
* Projects on SDK 49 are required to set `updates.useClassicUpdates` to `true` to use Classic Updates.
*/
export function isDefinitelyUsingClassicUpdates(exp: ExpoConfig): boolean {
return !!exp.updates?.useClassicUpdates;
}
export function isUsingEASUpdate(exp: ExpoConfig, projectId: string): boolean {
return exp.updates?.url === getEASUpdateURL(projectId);
}
+12
View File
@@ -12,6 +12,7 @@ import { RequestedPlatform, appPlatformDisplayNames } from '../platform';
import { createOrModifyExpoConfigAsync } from '../project/expoConfig';
import {
installExpoUpdatesAsync,
isDefinitelyUsingClassicUpdates,
isExpoUpdatesInstalledAsDevDependency,
isExpoUpdatesInstalledOrAvailable,
} from '../project/projectUtils';
@@ -96,6 +97,10 @@ async function ensureEASUpdatesIsConfiguredInExpoConfigAsync({
}): Promise<{ projectChanged: boolean; exp: ExpoConfig }> {
const modifyConfig: Partial<ExpoConfig> = {};
if (isDefinitelyUsingClassicUpdates(exp)) {
modifyConfig.updates = { useClassicUpdates: false };
}
if (exp.updates?.url !== getEASUpdateURL(projectId)) {
modifyConfig.updates = { url: getEASUpdateURL(projectId) };
}
@@ -161,6 +166,12 @@ function logEasUpdatesAutoConfig({
modifyConfig: Partial<ExpoConfig>;
exp: ExpoConfig;
}): void {
if (modifyConfig.updates?.useClassicUpdates === false) {
Log.withTick(
`Configured updates.useClassicUpdates to "${modifyConfig.updates?.useClassicUpdates}". You cannot use EAS Update and Classic Updates at the same time.`
);
}
if (modifyConfig.updates?.url) {
Log.withTick(
exp.updates?.url
@@ -326,6 +337,7 @@ export async function ensureEASUpdateIsConfiguredInEasJsonAsync(projectDir: stri
* This goes over a checklist and performs the following checks or changes:
* - Enure the `expo-updates` package is currently installed.
* - Ensure `app.json` is configured for EAS Updates
* - Sets `useClassicUpdates` to false if set
* - Sets `runtimeVersion` if not set
* - Sets `updates.url` if not set
* - Ensure latest changes are reflected in the native config, if any