diff --git a/packages/eas-cli/src/commandUtils/context/DynamicProjectConfigContextField.ts b/packages/eas-cli/src/commandUtils/context/DynamicProjectConfigContextField.ts index c6eef0033f..4826544b2b 100644 --- a/packages/eas-cli/src/commandUtils/context/DynamicProjectConfigContextField.ts +++ b/packages/eas-cli/src/commandUtils/context/DynamicProjectConfigContextField.ts @@ -5,8 +5,8 @@ import { findProjectDirAndVerifyProjectSetupAsync } from './contextUtils/findPro import { getProjectIdAsync } from './contextUtils/getProjectIdAsync'; import { ExpoConfigOptions, - getPrivateExpoConfig, - getPublicExpoConfig, + getPrivateExpoConfigAsync, + getPublicExpoConfigAsync, } from '../../project/expoConfig'; export type DynamicConfigContextFn = (options?: ExpoConfigOptions) => Promise<{ @@ -22,12 +22,12 @@ export class DynamicPublicProjectConfigContextField extends ContextField { const projectDir = await findProjectDirAndVerifyProjectSetupAsync(); return async (options?: ExpoConfigOptions) => { - const expBefore = getPublicExpoConfig(projectDir, options); + const expBefore = await getPublicExpoConfigAsync(projectDir, options); const projectId = await getProjectIdAsync(sessionManager, expBefore, { nonInteractive, env: options?.env, }); - const exp = getPublicExpoConfig(projectDir, options); + const exp = await getPublicExpoConfigAsync(projectDir, options); return { exp, projectDir, @@ -44,12 +44,12 @@ export class DynamicPrivateProjectConfigContextField extends ContextField { const projectDir = await findProjectDirAndVerifyProjectSetupAsync(); return async (options?: ExpoConfigOptions) => { - const expBefore = getPrivateExpoConfig(projectDir, options); + const expBefore = await getPrivateExpoConfigAsync(projectDir, options); const projectId = await getProjectIdAsync(sessionManager, expBefore, { nonInteractive, env: options?.env, }); - const exp = getPrivateExpoConfig(projectDir, options); + const exp = await getPrivateExpoConfigAsync(projectDir, options); return { exp, projectDir, diff --git a/packages/eas-cli/src/commandUtils/context/OptionalPrivateProjectConfigContextField.ts b/packages/eas-cli/src/commandUtils/context/OptionalPrivateProjectConfigContextField.ts index 2b5516611e..833f165f24 100644 --- a/packages/eas-cli/src/commandUtils/context/OptionalPrivateProjectConfigContextField.ts +++ b/packages/eas-cli/src/commandUtils/context/OptionalPrivateProjectConfigContextField.ts @@ -4,7 +4,7 @@ import { InvalidEasJsonError } from '@expo/eas-json/build/errors'; import ContextField, { ContextOptions } from './ContextField'; import { findProjectDirAndVerifyProjectSetupAsync } from './contextUtils/findProjectDirAndVerifyProjectSetupAsync'; import { getProjectIdAsync } from './contextUtils/getProjectIdAsync'; -import { getPrivateExpoConfig } from '../../project/expoConfig'; +import { getPrivateExpoConfigAsync } from '../../project/expoConfig'; export class OptionalPrivateProjectConfigContextField extends ContextField< | { @@ -35,11 +35,11 @@ export class OptionalPrivateProjectConfigContextField extends ContextField< return undefined; } - const expBefore = getPrivateExpoConfig(projectDir); + const expBefore = await getPrivateExpoConfigAsync(projectDir); const projectId = await getProjectIdAsync(sessionManager, expBefore, { nonInteractive, }); - const exp = getPrivateExpoConfig(projectDir); + const exp = await getPrivateExpoConfigAsync(projectDir); return { exp, projectDir, diff --git a/packages/eas-cli/src/commandUtils/context/PrivateProjectConfigContextField.ts b/packages/eas-cli/src/commandUtils/context/PrivateProjectConfigContextField.ts index cb0d0f7c13..95f3eb1d92 100644 --- a/packages/eas-cli/src/commandUtils/context/PrivateProjectConfigContextField.ts +++ b/packages/eas-cli/src/commandUtils/context/PrivateProjectConfigContextField.ts @@ -3,7 +3,7 @@ import { ExpoConfig } from '@expo/config'; import ContextField, { ContextOptions } from './ContextField'; import { findProjectDirAndVerifyProjectSetupAsync } from './contextUtils/findProjectDirAndVerifyProjectSetupAsync'; import { getProjectIdAsync } from './contextUtils/getProjectIdAsync'; -import { getPrivateExpoConfig } from '../../project/expoConfig'; +import { getPrivateExpoConfigAsync } from '../../project/expoConfig'; export class PrivateProjectConfigContextField extends ContextField<{ projectId: string; @@ -16,11 +16,11 @@ export class PrivateProjectConfigContextField extends ContextField<{ projectDir: string; }> { const projectDir = await findProjectDirAndVerifyProjectSetupAsync(); - const expBefore = getPrivateExpoConfig(projectDir); + const expBefore = await getPrivateExpoConfigAsync(projectDir); const projectId = await getProjectIdAsync(sessionManager, expBefore, { nonInteractive, }); - const exp = getPrivateExpoConfig(projectDir); + const exp = await getPrivateExpoConfigAsync(projectDir); return { projectId, diff --git a/packages/eas-cli/src/commandUtils/context/contextUtils/getProjectIdAsync.ts b/packages/eas-cli/src/commandUtils/context/contextUtils/getProjectIdAsync.ts index d559cbfbf2..465a05f453 100644 --- a/packages/eas-cli/src/commandUtils/context/contextUtils/getProjectIdAsync.ts +++ b/packages/eas-cli/src/commandUtils/context/contextUtils/getProjectIdAsync.ts @@ -7,7 +7,10 @@ import { findProjectRootAsync } from './findProjectDirAndVerifyProjectSetupAsync import { AppQuery } from '../../../graphql/queries/AppQuery'; import Log, { learnMore } from '../../../log'; import { ora } from '../../../ora'; -import { createOrModifyExpoConfigAsync, getPrivateExpoConfig } from '../../../project/expoConfig'; +import { + createOrModifyExpoConfigAsync, + getPrivateExpoConfigAsync, +} from '../../../project/expoConfig'; import { fetchOrCreateProjectIDForWriteToConfigWithConfirmationAsync } from '../../../project/fetchOrCreateProjectIDForWriteToConfigWithConfirmationAsync'; import { toAppPrivacy } from '../../../project/projectUtils'; import SessionManager from '../../../user/SessionManager'; @@ -25,7 +28,7 @@ export async function saveProjectIdToAppConfigAsync( options: { env?: Env } = {} ): Promise { // NOTE(cedric): we disable plugins to avoid writing plugin-generated content to `expo.extra` - const exp = getPrivateExpoConfig(projectDir, { skipPlugins: true, ...options }); + const exp = await getPrivateExpoConfigAsync(projectDir, { skipPlugins: true, ...options }); const result = await createOrModifyExpoConfigAsync( projectDir, { diff --git a/packages/eas-cli/src/commands/project/init.ts b/packages/eas-cli/src/commands/project/init.ts index 837d72280a..9a31a5777f 100644 --- a/packages/eas-cli/src/commands/project/init.ts +++ b/packages/eas-cli/src/commands/project/init.ts @@ -13,7 +13,7 @@ import { AppMutation } from '../../graphql/mutations/AppMutation'; import { AppQuery } from '../../graphql/queries/AppQuery'; import Log, { link } from '../../log'; import { ora } from '../../ora'; -import { createOrModifyExpoConfigAsync, getPrivateExpoConfig } from '../../project/expoConfig'; +import { createOrModifyExpoConfigAsync, getPrivateExpoConfigAsync } from '../../project/expoConfig'; import { findProjectIdByAccountNameAndSlugNullableAsync } from '../../project/fetchOrCreateProjectIDForWriteToConfigWithConfirmationAsync'; import { toAppPrivacy } from '../../project/projectUtils'; import { Choice, confirmAsync, promptAsync } from '../../prompts'; @@ -106,7 +106,7 @@ export default class ProjectInit extends EasCommand { projectDir: string, { force, nonInteractive }: InitializeMethodOptions ): Promise { - const exp = getPrivateExpoConfig(projectDir); + const exp = await getPrivateExpoConfigAsync(projectDir); const appForProjectId = await AppQuery.byIdAsync(graphqlClient, projectId); const correctOwner = appForProjectId.ownerAccount.name; const correctSlug = appForProjectId.slug; @@ -161,7 +161,7 @@ export default class ProjectInit extends EasCommand { projectDir: string, { force, nonInteractive }: InitializeMethodOptions ): Promise { - const exp = getPrivateExpoConfig(projectDir); + const exp = await getPrivateExpoConfigAsync(projectDir); const existingProjectId = exp.extra?.eas?.projectId; if (projectId === existingProjectId) { @@ -218,7 +218,7 @@ export default class ProjectInit extends EasCommand { projectDir: string, { force, nonInteractive }: InitializeMethodOptions ): Promise { - const exp = getPrivateExpoConfig(projectDir); + const exp = await getPrivateExpoConfigAsync(projectDir); const existingProjectId = exp.extra?.eas?.projectId; if (existingProjectId) { diff --git a/packages/eas-cli/src/commands/project/onboarding.ts b/packages/eas-cli/src/commands/project/onboarding.ts index ae9b3e39d9..c2a0e4285e 100644 --- a/packages/eas-cli/src/commands/project/onboarding.ts +++ b/packages/eas-cli/src/commands/project/onboarding.ts @@ -31,7 +31,7 @@ import { import { installDependenciesAsync } from '../../onboarding/installDependencies'; import { runCommandAsync } from '../../onboarding/runCommand'; import { RequestedPlatform } from '../../platform'; -import { ExpoConfigOptions, getPrivateExpoConfig } from '../../project/expoConfig'; +import { ExpoConfigOptions, getPrivateExpoConfigAsync } from '../../project/expoConfig'; import { promptAsync } from '../../prompts'; import { Actor } from '../../user/User'; import { easCliVersion } from '../../utils/easCli'; @@ -339,7 +339,7 @@ async function getPrivateExpoConfigWithProjectIdAsync({ actor: Actor; options?: ExpoConfigOptions; }): Promise { - const expBefore = getPrivateExpoConfig(projectDir, options); + const expBefore = await getPrivateExpoConfigAsync(projectDir, options); const projectId = await validateOrSetProjectIdAsync({ exp: expBefore, graphqlClient, @@ -349,7 +349,7 @@ async function getPrivateExpoConfigWithProjectIdAsync({ }, cwd: projectDir, }); - const exp = getPrivateExpoConfig(projectDir, options); + const exp = await getPrivateExpoConfigAsync(projectDir, options); return { exp, projectId, diff --git a/packages/eas-cli/src/credentials/android/actions/BuildCredentialsUtils.ts b/packages/eas-cli/src/credentials/android/actions/BuildCredentialsUtils.ts index 71a8632c38..bd4494975e 100644 --- a/packages/eas-cli/src/credentials/android/actions/BuildCredentialsUtils.ts +++ b/packages/eas-cli/src/credentials/android/actions/BuildCredentialsUtils.ts @@ -101,14 +101,14 @@ export async function getAppLookupParamsFromContextAsync( ctx: CredentialsContext, gradleContext?: GradleBuildContext ): Promise { - ctx.ensureProjectContext(); - const projectName = ctx.exp.slug; - const projectId = ctx.projectId; + const exp = await ctx.getExpoConfigAsync(); + const projectName = exp.slug; + const projectId = await ctx.getProjectIdAsync(); const account = await getOwnerAccountForProjectIdAsync(ctx.graphqlClient, projectId); const androidApplicationIdentifier = await getApplicationIdAsync( ctx.projectDir, - ctx.exp, + exp, ctx.vcsClient, gradleContext ); diff --git a/packages/eas-cli/src/credentials/android/actions/CreateKeystore.ts b/packages/eas-cli/src/credentials/android/actions/CreateKeystore.ts index 3953b8a1e1..9da141f7fb 100644 --- a/packages/eas-cli/src/credentials/android/actions/CreateKeystore.ts +++ b/packages/eas-cli/src/credentials/android/actions/CreateKeystore.ts @@ -16,7 +16,7 @@ export class CreateKeystore { throw new Error(`New keystore cannot be created in non-interactive mode.`); } - const projectId = ctx.projectId; + const projectId = await ctx.getProjectIdAsync(); const keystore = await this.provideOrGenerateAsync(ctx.graphqlClient, ctx.analytics, projectId); const keystoreFragment = await ctx.android.createKeystoreAsync( ctx.graphqlClient, diff --git a/packages/eas-cli/src/credentials/context.ts b/packages/eas-cli/src/credentials/context.ts index f6cfaaee77..827273564a 100644 --- a/packages/eas-cli/src/credentials/context.ts +++ b/packages/eas-cli/src/credentials/context.ts @@ -10,7 +10,7 @@ import { AuthenticationMode } from './ios/appstore/authenticateTypes'; import { Analytics } from '../analytics/AnalyticsManager'; import { ExpoGraphqlClient } from '../commandUtils/context/contextUtils/createGraphqlClient'; import Log from '../log'; -import { getPrivateExpoConfig } from '../project/expoConfig'; +import { getPrivateExpoConfigAsync } from '../project/expoConfig'; import { confirmAsync } from '../prompts'; import { Actor } from '../user/User'; import { Client } from '../vcs/vcs'; @@ -67,22 +67,22 @@ export class CredentialsContext { return !!this.projectInfo; } - get exp(): ExpoConfig { - this.ensureProjectContext(); + public async getExpoConfigAsync(): Promise { + await this.ensureProjectContextAsync(); return this.projectInfo!.exp; } - get projectId(): string { - this.ensureProjectContext(); + public async getProjectIdAsync(): Promise { + await this.ensureProjectContextAsync(); return this.projectInfo!.projectId; } - public ensureProjectContext(): void { + public async ensureProjectContextAsync(): Promise { if (this.hasProjectContext) { return; } // trigger getConfig error - getPrivateExpoConfig(this.options.projectDir); + await getPrivateExpoConfigAsync(this.options.projectDir); } async bestEffortAppStoreAuthenticateAsync(): Promise { diff --git a/packages/eas-cli/src/credentials/ios/actions/BuildCredentialsUtils.ts b/packages/eas-cli/src/credentials/ios/actions/BuildCredentialsUtils.ts index 5ed178edca..ee4466ec11 100644 --- a/packages/eas-cli/src/credentials/ios/actions/BuildCredentialsUtils.ts +++ b/packages/eas-cli/src/credentials/ios/actions/BuildCredentialsUtils.ts @@ -91,9 +91,9 @@ export async function assignBuildCredentialsAsync( } export async function getAppFromContextAsync(ctx: CredentialsContext): Promise { - ctx.ensureProjectContext(); - const projectName = ctx.exp.slug; - const projectId = ctx.projectId; + const exp = await ctx.getExpoConfigAsync(); + const projectName = exp.slug; + const projectId = await ctx.getProjectIdAsync(); const account = await getOwnerAccountForProjectIdAsync(ctx.graphqlClient, projectId); return { account, diff --git a/packages/eas-cli/src/credentials/manager/ManageIos.ts b/packages/eas-cli/src/credentials/manager/ManageIos.ts index c48eefe937..36c1865cb0 100644 --- a/packages/eas-cli/src/credentials/manager/ManageIos.ts +++ b/packages/eas-cli/src/credentials/manager/ManageIos.ts @@ -94,7 +94,7 @@ export class ManageIos { }; const account = ctx.hasProjectContext - ? await getAccountForProjectAsync(ctx.projectId) + ? await getAccountForProjectAsync(await ctx.getProjectIdAsync()) : ensureActorHasPrimaryAccount(ctx.user); let app = null; @@ -195,18 +195,19 @@ export class ManageIos { }> { assert(ctx.hasProjectContext, 'createProjectContextAsync: must have project context.'); - const app = { account, projectName: ctx.exp.slug }; + const exp = await ctx.getExpoConfigAsync(); + const app = { account, projectName: exp.slug }; const xcodeBuildContext = await resolveXcodeBuildContextAsync( { projectDir: ctx.projectDir, nonInteractive: ctx.nonInteractive, - exp: ctx.exp, + exp, vcsClient: ctx.vcsClient, }, buildProfile ); const targets = await resolveTargetsAsync({ - exp: ctx.exp, + exp, projectDir: ctx.projectDir, xcodeBuildContext, env: buildProfile.env, diff --git a/packages/eas-cli/src/credentials/manager/SetUpIosBuildCredentials.ts b/packages/eas-cli/src/credentials/manager/SetUpIosBuildCredentials.ts index d659bdc0eb..3681d90117 100644 --- a/packages/eas-cli/src/credentials/manager/SetUpIosBuildCredentials.ts +++ b/packages/eas-cli/src/credentials/manager/SetUpIosBuildCredentials.ts @@ -55,7 +55,7 @@ export class SetUpIosBuildCredentials extends ManageIos { }; const account = ctx.hasProjectContext - ? await getAccountForProjectAsync(ctx.projectId) + ? await getAccountForProjectAsync(await ctx.getProjectIdAsync()) : ensureActorHasPrimaryAccount(ctx.user); let app = null; diff --git a/packages/eas-cli/src/project/expoConfig.ts b/packages/eas-cli/src/project/expoConfig.ts index 2009103d0f..5197f2f7e1 100644 --- a/packages/eas-cli/src/project/expoConfig.ts +++ b/packages/eas-cli/src/project/expoConfig.ts @@ -1,14 +1,11 @@ -import { - ExpoConfig, - getConfig as _getConfig, - getConfigFilePaths, - modifyConfigAsync, -} from '@expo/config'; +import { ExpoConfig, getConfig, getConfigFilePaths, modifyConfigAsync } from '@expo/config'; import { Env } from '@expo/eas-build-job'; +import spawnAsync from '@expo/spawn-async'; import fs from 'fs-extra'; import Joi from 'joi'; import path from 'path'; +import { isExpoInstalled } from './projectUtils'; import Log from '../log'; export type PublicExpoConfig = Omit< @@ -46,34 +43,48 @@ export async function createOrModifyExpoConfigAsync( let wasExpoConfigWarnPrinted = false; -function getExpoConfigInternal( +async function getExpoConfigInternalAsync( projectDir: string, opts: ExpoConfigOptionsInternal = {} -): ExpoConfig { +): Promise { const originalProcessEnv: NodeJS.ProcessEnv = process.env; try { process.env = { ...process.env, ...opts.env, }; - const projectExpoConfigPath = path.join(projectDir, 'node_modules', '@expo', 'config'); - let getConfig: typeof _getConfig; - try { - const expoConfig = require(projectExpoConfigPath); - getConfig = expoConfig.getConfig; - } catch { - if (!wasExpoConfigWarnPrinted) { - Log.warn(`Failed to load getConfig function from ${projectExpoConfigPath}`); - Log.warn('Falling back to the version of @expo/config shipped with the EAS CLI.'); - wasExpoConfigWarnPrinted = true; + + let exp: ExpoConfig; + if (isExpoInstalled(projectDir)) { + try { + const { stdout } = await spawnAsync( + 'npx', + ['expo', 'config', '--json', ...(opts.isPublicConfig ? ['--type', 'public'] : [])], + + { + cwd: projectDir, + } + ); + exp = JSON.parse(stdout); + } catch (err: any) { + if (!wasExpoConfigWarnPrinted) { + Log.warn( + `Failed to read the app config from the project using npx expo config command: ${err.message}.` + ); + Log.warn('Falling back to the version of @expo/config shipped with the EAS CLI.'); + wasExpoConfigWarnPrinted = true; + } + exp = getConfig(projectDir, { + skipSDKVersionRequirement: true, + ...(opts.isPublicConfig ? { isPublicConfig: true } : {}), + }).exp; } - getConfig = _getConfig; + } else { + exp = getConfig(projectDir, { + skipSDKVersionRequirement: true, + ...(opts.isPublicConfig ? { isPublicConfig: true } : {}), + }).exp; } - const { exp } = getConfig(projectDir, { - skipSDKVersionRequirement: true, - ...(opts.isPublicConfig ? { isPublicConfig: true } : {}), - ...(opts.skipPlugins ? { skipPlugins: true } : {}), - }); const { error } = MinimalAppConfigSchema.validate(exp, { allowUnknown: true, @@ -100,10 +111,13 @@ const MinimalAppConfigSchema = Joi.object({ }), }); -export function getPrivateExpoConfig(projectDir: string, opts: ExpoConfigOptions = {}): ExpoConfig { +export async function getPrivateExpoConfigAsync( + projectDir: string, + opts: ExpoConfigOptions = {} +): Promise { ensureExpoConfigExists(projectDir); - return getExpoConfigInternal(projectDir, { ...opts, isPublicConfig: false }); + return await getExpoConfigInternalAsync(projectDir, { ...opts, isPublicConfig: false }); } export function ensureExpoConfigExists(projectDir: string): void { @@ -119,11 +133,11 @@ export function isUsingStaticExpoConfig(projectDir: string): boolean { return !!(paths.staticConfigPath?.endsWith('app.json') && !paths.dynamicConfigPath); } -export function getPublicExpoConfig( +export async function getPublicExpoConfigAsync( projectDir: string, opts: ExpoConfigOptions = {} -): PublicExpoConfig { +): Promise { ensureExpoConfigExists(projectDir); - return getExpoConfigInternal(projectDir, { ...opts, isPublicConfig: true }); + return await getExpoConfigInternalAsync(projectDir, { ...opts, isPublicConfig: true }); } diff --git a/packages/eas-cli/src/project/ios/entitlements.ts b/packages/eas-cli/src/project/ios/entitlements.ts index d88a804ed7..556e0d491d 100644 --- a/packages/eas-cli/src/project/ios/entitlements.ts +++ b/packages/eas-cli/src/project/ios/entitlements.ts @@ -1,7 +1,7 @@ -import { IOSConfig, compileModsAsync as _compileModsAsync } from '@expo/config-plugins'; +import { ExportedConfig, IOSConfig, compileModsAsync } from '@expo/config-plugins'; import { JSONObject } from '@expo/json-file'; -import { getPrebuildConfigAsync as _getPrebuildConfigAsync } from '@expo/prebuild-config'; -import path from 'path'; +import { getPrebuildConfigAsync } from '@expo/prebuild-config'; +import spawnAsync from '@expo/spawn-async'; import Log from '../../log'; import { readPlistAsync } from '../../utils/plist'; @@ -13,7 +13,6 @@ interface Target { targetName: string; } -let wasExooPrebuildConfigWarnPrinted = false; let wasExpoConfigPluginsWarnPrinted = false; export async function getManagedApplicationTargetEntitlementsAsync( @@ -28,52 +27,34 @@ export async function getManagedApplicationTargetEntitlementsAsync( ...process.env, ...env, }; - const projectExpoPrebuildConfigPath = path.join( - projectDir, - 'node_modules', - '@expo', - 'prebuild-config' - ); - let getPrebuildConfigAsync: typeof _getPrebuildConfigAsync; - try { - const expoPrebuildConfig = require(projectExpoPrebuildConfigPath); - getPrebuildConfigAsync = expoPrebuildConfig.getPrebuildConfigAsync; - } catch { - if (!wasExooPrebuildConfigWarnPrinted) { - Log.warn( - `Failed to load getPrebuildConfigAsync function from ${projectExpoPrebuildConfigPath}` - ); - Log.warn('Falling back to the version of @expo/prebuild-config shipped with the EAS CLI.'); - wasExooPrebuildConfigWarnPrinted = true; - } - getPrebuildConfigAsync = _getPrebuildConfigAsync; - } - const { exp } = await getPrebuildConfigAsync(projectDir, { platforms: ['ios'] }); - const projectExpoConfigPluginsPath = path.join( - projectDir, - 'node_modules', - '@expo', - 'config-plugins' - ); - let compileModsAsync: typeof _compileModsAsync; + let expWithMods: ExportedConfig; try { - const expoConfigPlugins = require(projectExpoConfigPluginsPath); - compileModsAsync = expoConfigPlugins.compileModsAsync; - } catch { + const { stdout } = await spawnAsync( + 'npx', + ['expo', 'config', '--json', '--type', 'introspect'], + + { + cwd: projectDir, + } + ); + expWithMods = JSON.parse(stdout); + } catch (err: any) { if (!wasExpoConfigPluginsWarnPrinted) { - Log.warn(`Failed to load compileModsAsync function from ${projectExpoConfigPluginsPath}`); - Log.warn('Falling back to the version of @expo/config-plugins shipped with the EAS CLI.'); + Log.warn( + `Failed to read the app config from the project using npx expo config command: ${err.message}.` + ); + Log.warn('Falling back to the version of @expo/config shipped with the EAS CLI.'); wasExpoConfigPluginsWarnPrinted = true; } - compileModsAsync = _compileModsAsync; + const { exp } = await getPrebuildConfigAsync(projectDir, { platforms: ['ios'] }); + expWithMods = await compileModsAsync(exp, { + projectRoot: projectDir, + platforms: ['ios'], + introspect: true, + ignoreExistingNativeFiles: await hasIgnoredIosProjectAsync(projectDir, vcsClient), + }); } - const expWithMods = await compileModsAsync(exp, { - projectRoot: projectDir, - platforms: ['ios'], - introspect: true, - ignoreExistingNativeFiles: await hasIgnoredIosProjectAsync(projectDir, vcsClient), - }); return expWithMods.ios?.entitlements ?? {}; } finally { process.env = originalProcessEnv; diff --git a/packages/eas-cli/src/project/projectUtils.ts b/packages/eas-cli/src/project/projectUtils.ts index 82289feb21..18610c4bf7 100644 --- a/packages/eas-cli/src/project/projectUtils.ts +++ b/packages/eas-cli/src/project/projectUtils.ts @@ -72,6 +72,11 @@ export function isExpoNotificationsInstalled(projectDir: string): boolean { return !!(packageJson.dependencies && 'expo-notifications' in packageJson.dependencies); } +export function isExpoInstalled(projectDir: string): boolean { + const packageJson = getPackageJson(projectDir); + return !!(packageJson.dependencies && 'expo' in packageJson.dependencies); +} + export function isExpoUpdatesInstalledAsDevDependency(projectDir: string): boolean { const packageJson = getPackageJson(projectDir); return !!(packageJson.devDependencies && 'expo-updates' in packageJson.devDependencies);