From 41968155dd376cf9a22a60c920be4d3a0bae589c Mon Sep 17 00:00:00 2001 From: Satyajit Sahoo Date: Sun, 9 Aug 2020 18:37:14 +0200 Subject: [PATCH] [expo-cli] Add a eas:build:init command We want to add a separate command to configure the project for eas builds without having to actually start a build. --- .../eas-build/build/__tests__/build-test.ts | 27 +++- .../src/commands/eas-build/build/action.ts | 52 ++----- .../build/builders/AndroidBuilder.ts | 47 ++++-- .../eas-build/build/builders/iOSBuilder.ts | 14 +- .../src/commands/eas-build/build/types.ts | 27 ---- .../expo-cli/src/commands/eas-build/index.ts | 16 ++- .../eas-build/init/__tests__/init-test.ts | 134 ++++++++++++++++++ .../src/commands/eas-build/init/action.ts | 103 ++++++++++++++ .../expo-cli/src/commands/eas-build/types.ts | 27 +++- .../utils/createBuilderContextAsync.ts | 39 +++++ .../eas-build/{build => }/utils/git.ts | 8 +- .../eas-build/{build => }/utils/misc.ts | 8 +- 12 files changed, 398 insertions(+), 104 deletions(-) delete mode 100644 packages/expo-cli/src/commands/eas-build/build/types.ts create mode 100644 packages/expo-cli/src/commands/eas-build/init/__tests__/init-test.ts create mode 100644 packages/expo-cli/src/commands/eas-build/init/action.ts create mode 100644 packages/expo-cli/src/commands/eas-build/utils/createBuilderContextAsync.ts rename packages/expo-cli/src/commands/eas-build/{build => }/utils/git.ts (95%) rename packages/expo-cli/src/commands/eas-build/{build => }/utils/misc.ts (87%) diff --git a/packages/expo-cli/src/commands/eas-build/build/__tests__/build-test.ts b/packages/expo-cli/src/commands/eas-build/build/__tests__/build-test.ts index fc4a77f9e2..a6244dabe5 100644 --- a/packages/expo-cli/src/commands/eas-build/build/__tests__/build-test.ts +++ b/packages/expo-cli/src/commands/eas-build/build/__tests__/build-test.ts @@ -38,7 +38,7 @@ jest.mock('../../../../projects', () => { ensureProjectExistsAsync: () => 'fakeProjectId', }; }); -jest.mock('../utils/git'); +jest.mock('../../utils/git'); jest.mock('../../../../git'); jest.mock('../../../../uploads', () => ({ UploadType: {}, @@ -142,7 +142,8 @@ function setupProjectConfig(overrideConfig: any) { 'package.json': JSON.stringify(packageJson), 'node_modules/expo/package.json': '{ "version": "38.0.0" }', 'cert.p12': cert.content, - 'android/app/build.gradle': '', + 'android/app/build.gradle': 'apply from: "./eas-build.gradle"', + 'android/app/eas-build.gradle': '', }, '/projectdir' ); @@ -169,6 +170,24 @@ jest.setTimeout(30000); describe('build command', () => { describe('android generic job', () => { + it('should throw if project is not configured', async () => { + expect.assertions(1); + + setupProjectConfig({}); + vol.unlinkSync('/projectdir/android/app/eas-build.gradle'); + + try { + await buildAction('/projectdir', { + platform: BuildCommandPlatform.ANDROID, + wait: false, + profile: 'release', + }); + } catch (e) { + expect(e.message).toMatch( + 'Project is not configured. Please run "expo eas:build:init" first to configure the project' + ); + } + }); it('should go through build process', async () => { const postArguments: any = {}; mockPostAsync.mockImplementationOnce((url, body) => { @@ -199,10 +218,6 @@ describe('build command', () => { }, }, }); - expect(vol.existsSync('/projectdir/android/app/eas-build.gradle')).toBe(true); - expect(vol.readFileSync('/projectdir/android/app/build.gradle', 'utf-8')).toContain( - 'apply from: "./eas-build.gradle"' - ); }); }); describe('ios generic job', () => { diff --git a/packages/expo-cli/src/commands/eas-build/build/action.ts b/packages/expo-cli/src/commands/eas-build/build/action.ts index 9479f246ac..07a1b1fb05 100644 --- a/packages/expo-cli/src/commands/eas-build/build/action.ts +++ b/packages/expo-cli/src/commands/eas-build/build/action.ts @@ -1,6 +1,4 @@ -import { getConfig } from '@expo/config'; -import { ApiV2, User, UserManager } from '@expo/xdl'; -import { build } from '@hapi/joi'; +import { ApiV2 } from '@expo/xdl'; import chalk from 'chalk'; import delayAsync from 'delay-async'; import fs from 'fs-extra'; @@ -15,16 +13,16 @@ import { ensureProjectExistsAsync } from '../../../projects'; import { UploadType, uploadAsync } from '../../../uploads'; import { createProgressTracker } from '../../utils/progress'; import { platformDisplayNames } from '../constants'; -import { Build, BuildCommandPlatform, BuildStatus } from '../types'; -import AndroidBuilder from './builders/AndroidBuilder'; -import iOSBuilder from './builders/iOSBuilder'; -import { Builder, BuilderContext } from './types'; +import { Build, BuildCommandPlatform, BuildStatus, Builder, BuilderContext } from '../types'; +import createBuilderContextAsync from '../utils/createBuilderContextAsync'; import { ensureGitRepoExistsAsync, ensureGitStatusIsCleanAsync, makeProjectTarballAsync, -} from './utils/git'; -import { printBuildResults, printLogsUrls } from './utils/misc'; +} from '../utils/git'; +import { printBuildResults, printLogsUrls } from '../utils/misc'; +import AndroidBuilder from './builders/AndroidBuilder'; +import iOSBuilder from './builders/iOSBuilder'; interface BuildOptions { platform: BuildCommandPlatform; @@ -78,40 +76,6 @@ async function buildAction(projectDir: string, options: BuildOptions): Promise { - const user: User = await UserManager.ensureLoggedInAsync(); - const { exp } = getConfig(projectDir, { skipSDKVersionRequirement: true }); - const accountName = exp.owner || user.username; - const projectName = exp.slug; - - return { - eas, - projectDir, - user, - accountName, - projectName, - exp, - platform, - nonInteractive, - skipCredentialsCheck, - skipProjectConfiguration, - }; -} - async function startBuildsAsync( ctx: BuilderContext, projectId: string @@ -146,7 +110,7 @@ async function startBuildAsync( await builder.setupAsync(); await builder.ensureCredentialsAsync(); if (!builder.ctx.skipProjectConfiguration) { - await builder.configureProjectAsync(); + await builder.ensureProjectConfiguredAsync(); } const fileSize = await makeProjectTarballAsync(tarPath); diff --git a/packages/expo-cli/src/commands/eas-build/build/builders/AndroidBuilder.ts b/packages/expo-cli/src/commands/eas-build/build/builders/AndroidBuilder.ts index c74d3b34dd..a1aa191d86 100644 --- a/packages/expo-cli/src/commands/eas-build/build/builders/AndroidBuilder.ts +++ b/packages/expo-cli/src/commands/eas-build/build/builders/AndroidBuilder.ts @@ -5,6 +5,7 @@ import fs from 'fs-extra'; import ora from 'ora'; import path from 'path'; +import CommandError from '../../../../CommandError'; import AndroidCredentialsProvider, { AndroidCredentials, } from '../../../../credentials/provider/AndroidCredentialsProvider'; @@ -16,10 +17,10 @@ import { } from '../../../../easJson'; import { gitAddAsync } from '../../../../git'; import log from '../../../../log'; +import { Builder, BuilderContext } from '../../types'; +import * as gitUtils from '../../utils/git'; import { ensureCredentialsAsync } from '../credentials'; import gradleContent from '../templates/gradleContent'; -import { Builder, BuilderContext } from '../types'; -import * as gitUtils from '../utils/git'; interface CommonJobProperties { platform: Platform.Android; @@ -62,9 +63,40 @@ class AndroidBuilder implements Builder { this.credentials = await provider.getCredentialsAsync(credentialsSource); } + private async isProjectConfiguredAsync(): Promise { + const androidAppDir = path.join(this.ctx.projectDir, 'android', 'app'); + const buildGradlePath = path.join(androidAppDir, 'build.gradle'); + const easGradlePath = path.join(androidAppDir, 'eas-build.gradle'); + + const hasEasGradleFile = await fs.pathExists(easGradlePath); + + const buildGradleContent = await fs.readFile(path.join(buildGradlePath), 'utf-8'); + const applyEasGradle = 'apply from: "./eas-build.gradle"'; + + const hasEasGradleApply = buildGradleContent + .split('\n') + // Check for both single and double quotes + .some(line => line === applyEasGradle || line === applyEasGradle.replace(/"/g, "'")); + + return hasEasGradleApply && hasEasGradleFile; + } + + public async ensureProjectConfiguredAsync(): Promise { + if (!(await this.isProjectConfiguredAsync())) { + throw new CommandError( + 'Project is not configured. Please run "expo eas:build:init" first to configure the project' + ); + } + } + public async configureProjectAsync(): Promise { const spinner = ora('Making sure your Android project is set up properly'); + if (await this.isProjectConfiguredAsync()) { + spinner.succeed('Android project is already configured'); + return; + } + const { projectDir } = this.ctx; const androidAppDir = path.join(projectDir, 'android', 'app'); @@ -77,14 +109,7 @@ class AndroidBuilder implements Builder { const buildGradleContent = await fs.readFile(path.join(buildGradlePath), 'utf-8'); const applyEasGradle = 'apply from: "./eas-build.gradle"'; - const isAlreadyConfigured = buildGradleContent - .split('\n') - // Check for both single and double quotes - .some(line => line === applyEasGradle || line === applyEasGradle.replace(/"/g, "'")); - - if (!isAlreadyConfigured) { - await fs.writeFile(buildGradlePath, `${buildGradleContent.trim()}\n${applyEasGradle}\n`); - } + await fs.writeFile(buildGradlePath, `${buildGradleContent.trim()}\n${applyEasGradle}\n`); try { await gitUtils.ensureGitStatusIsCleanAsync(); @@ -102,7 +127,7 @@ class AndroidBuilder implements Builder { log(`${chalk.green(figures.tick)} Successfully committed the configuration changes.`); } catch (e) { throw new Error( - "Aborting, run the build command once you're ready. Make sure to commit any changes you've made." + "Aborting, run the command again once you're ready. Make sure to commit any changes you've made." ); } } else { diff --git a/packages/expo-cli/src/commands/eas-build/build/builders/iOSBuilder.ts b/packages/expo-cli/src/commands/eas-build/build/builders/iOSBuilder.ts index 61d434c240..a74799e609 100644 --- a/packages/expo-cli/src/commands/eas-build/build/builders/iOSBuilder.ts +++ b/packages/expo-cli/src/commands/eas-build/build/builders/iOSBuilder.ts @@ -17,9 +17,9 @@ import { } from '../../../../easJson'; import log from '../../../../log'; import prompts from '../../../../prompts'; +import { Builder, BuilderContext } from '../../types'; +import * as gitUtils from '../../utils/git'; import { ensureCredentialsAsync } from '../credentials'; -import { Builder, BuilderContext } from '../types'; -import * as gitUtils from '../utils/git'; import { getBundleIdentifier } from '../utils/ios'; interface CommonJobProperties { @@ -82,6 +82,10 @@ class iOSBuilder implements Builder { } } + public async ensureProjectConfiguredAsync(): Promise { + await this.configureProjectAsync(); + } + public async configureProjectAsync(): Promise { if (this.buildProfile.workflow !== Workflow.Generic) { return; @@ -93,10 +97,10 @@ class iOSBuilder implements Builder { throw new Error('Call ensureCredentialsAsync first!'); } - const bundleIdentifier = await getBundleIdentifier(this.ctx.projectDir, this.ctx.exp); - const spinner = ora('Configuring the Xcode project'); + const bundleIdentifier = await getBundleIdentifier(this.ctx.projectDir, this.ctx.exp); + const profileName = ProvisioningProfileUtils.readProfileName( this.credentials.provisioningProfile ); @@ -125,7 +129,7 @@ class iOSBuilder implements Builder { log(`${chalk.green(figures.tick)} Successfully committed the configuration changes.`); } catch (e) { throw new Error( - "Aborting, run the build command once you're ready. Make sure to commit any changes you've made." + "Aborting, run the command again once you're ready. Make sure to commit any changes you've made." ); } } else { diff --git a/packages/expo-cli/src/commands/eas-build/build/types.ts b/packages/expo-cli/src/commands/eas-build/build/types.ts deleted file mode 100644 index 58ce778c1f..0000000000 --- a/packages/expo-cli/src/commands/eas-build/build/types.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { Job } from '@expo/build-tools'; -import { ExpoConfig } from '@expo/config'; -import { User } from '@expo/xdl'; - -import { EasConfig } from '../../../easJson'; -import { BuildCommandPlatform } from '../types'; - -export interface BuilderContext { - projectDir: string; - eas: EasConfig; - user: User; - accountName: string; - projectName: string; - exp: ExpoConfig; - platform: BuildCommandPlatform; - nonInteractive: boolean; - skipCredentialsCheck: boolean; - skipProjectConfiguration: boolean; -} - -export interface Builder { - ctx: BuilderContext; - setupAsync(): Promise; - ensureCredentialsAsync(): Promise; - configureProjectAsync(): Promise; - prepareJobAsync(archiveUrl: string): Promise; -} diff --git a/packages/expo-cli/src/commands/eas-build/index.ts b/packages/expo-cli/src/commands/eas-build/index.ts index fff58b80d0..0443bddc20 100644 --- a/packages/expo-cli/src/commands/eas-build/index.ts +++ b/packages/expo-cli/src/commands/eas-build/index.ts @@ -4,12 +4,24 @@ import path from 'path'; import buildAction from './build/action'; import credentialsSyncAction from './credentialsSync/action'; +import initAction from './init/action'; import statusAction from './status/action'; export default function (program: Command) { // don't register `expo eas:build:*` commands if eas.json doesn't exist const easJsonPath = path.join(process.cwd(), 'eas.json'); - if (!fs.pathExistsSync(easJsonPath)) { + const hasEasJson = fs.pathExistsSync(easJsonPath); + + if (hasEasJson || process.argv[2] !== '--help') { + // We don't want to show this in the help output for now + program + .command('eas:build:init [project-dir]') + .description('Initialize build configuration for your project.') + .option('--skip-credentials-check', 'Skip checking credentials', false) + .asyncActionProjectDir(initAction, { checkConfig: true }); + } + + if (!hasEasJson) { return; } @@ -26,7 +38,7 @@ export default function (program: Command) { .description('Build an app binary for your project.') .option( '-p --platform ', - 'Build for specified platform: ios, android, all', + 'Build for the specified platform: ios, android, all', /^(all|android|ios)$/i ) .option('--skip-credentials-check', 'Skip checking credentials', false) diff --git a/packages/expo-cli/src/commands/eas-build/init/__tests__/init-test.ts b/packages/expo-cli/src/commands/eas-build/init/__tests__/init-test.ts new file mode 100644 index 0000000000..c4ccf0a2d0 --- /dev/null +++ b/packages/expo-cli/src/commands/eas-build/init/__tests__/init-test.ts @@ -0,0 +1,134 @@ +import merge from 'lodash/merge'; +import { vol } from 'memfs'; + +import { mockExpoXDL } from '../../../../__tests__/mock-utils'; +import { testProvisioningProfileBase64 } from '../../../../credentials/test-fixtures/mock-base64-data'; +import initAction from '../action'; + +const mockedUser = { + username: 'jester', +}; + +jest.mock('fs'); +jest.mock('../../../../projects', () => { + return { + ensureProjectExistsAsync: () => 'fakeProjectId', + }; +}); +jest.mock('../../utils/git'); +jest.mock('../../build/builders/iOSBuilder'); +jest.mock('../../../../git'); +jest.mock('@expo/image-utils', () => ({ + generateImageAsync(input, { src }) { + const fs = require('fs'); + return { source: fs.readFileSync(src) }; + }, +})); + +const mockedXDLModules = { + UserManager: { + ensureLoggedInAsync: jest.fn(() => mockedUser), + getCurrentUserAsync: jest.fn(() => mockedUser), + }, + ApiV2: { + clientForUser: jest.fn(() => ({ + getAsync: url => { + if (url === 'credentials/ios') { + return { appCredentials: [], userCredentials: [] }; + } + }, + postAsync: jest.fn(), + })), + }, +}; +mockExpoXDL(mockedXDLModules); + +const credentialsJson = { + android: { + keystore: { + keystorePath: 'keystore.jks', + keystorePassword: 'keystorePassword', + keyAlias: 'keyAlias', + keyPassword: 'keyPassword', + }, + }, + ios: { + provisioningProfilePath: 'pprofile', + distributionCertificate: { + path: 'cert.p12', + password: 'certPass', + }, + }, +}; + +const keystore = { + content: 'somebinarycontent', + base64: 'c29tZWJpbmFyeWNvbnRlbnQ=', +}; + +const pprofile = { + content: Buffer.from(testProvisioningProfileBase64, 'base64'), + base64: testProvisioningProfileBase64, +}; + +const cert = { + content: 'certp12content', + base64: 'Y2VydHAxMmNvbnRlbnQ=', +}; + +const appJson = { + expo: { + ios: { + bundleIdentifier: 'example.bundle.identifier', + }, + }, +}; + +const packageJson = { + name: 'examplepackage', +}; + +function setupProjectConfig(overrideConfig: any) { + vol.fromJSON( + { + 'credentials.json': JSON.stringify(merge(credentialsJson, overrideConfig.credentialsJson)), + 'keystore.jks': overrideConfig.keystore ?? keystore.content, + 'app.json': JSON.stringify(appJson), + 'package.json': JSON.stringify(packageJson), + 'node_modules/expo/package.json': '{ "version": "38.0.0" }', + 'cert.p12': cert.content, + 'android/app/build.gradle': '', + }, + '/projectdir' + ); + vol.writeFileSync('/projectdir/pprofile', pprofile.content); +} + +const originalWarn = console.warn; +const originalLog = console.log; +beforeAll(() => { + console.warn = jest.fn(); + console.log = jest.fn(); +}); +afterAll(() => { + console.warn = originalWarn; + console.log = originalLog; +}); + +beforeEach(() => { + vol.reset(); +}); + +jest.setTimeout(30000); + +describe('init command', () => { + it('should configure android project', async () => { + setupProjectConfig({}); + await initAction('/projectdir', {}); + expect(vol.existsSync('/projectdir/eas.json')).toBe(true); + expect(vol.existsSync('/projectdir/android/app/eas-build.gradle')).toBe(true); + expect(vol.readFileSync('/projectdir/android/app/build.gradle', 'utf-8')).toContain( + 'apply from: "./eas-build.gradle"' + ); + }); +}); diff --git a/packages/expo-cli/src/commands/eas-build/init/action.ts b/packages/expo-cli/src/commands/eas-build/init/action.ts new file mode 100644 index 0000000000..a648ba897b --- /dev/null +++ b/packages/expo-cli/src/commands/eas-build/init/action.ts @@ -0,0 +1,103 @@ +import chalk from 'chalk'; +import figures from 'figures'; +import fs from 'fs-extra'; +import ora from 'ora'; +import path from 'path'; + +import { EasConfig, EasJsonReader } from '../../../easJson'; +import { gitAddAsync } from '../../../git'; +import log from '../../../log'; +import AndroidBuilder from '../build/builders/AndroidBuilder'; +import iOSBuilder from '../build/builders/iOSBuilder'; +import { BuildCommandPlatform } from '../types'; +import createBuilderContextAsync from '../utils/createBuilderContextAsync'; +import { + DirtyGitTreeError, + ensureGitRepoExistsAsync, + ensureGitStatusIsCleanAsync, + reviewAndCommitChangesAsync, +} from '../utils/git'; + +interface BuildOptions { + skipCredentialsCheck?: boolean; // noop for now + parent?: { + nonInteractive: boolean; + }; +} + +async function initAction(projectDir: string, options: BuildOptions): Promise { + const nonInteractive = options.parent?.nonInteractive === true; + + const spinner = ora('Checking for eas.json file'); + + await ensureGitRepoExistsAsync(); + await ensureGitStatusIsCleanAsync(); + + const easJsonPath = path.join(projectDir, 'eas.json'); + const easJson = { + builds: { + android: { + release: { + workflow: 'generic', + }, + }, + ios: { + release: { + workflow: 'generic', + }, + }, + }, + }; + + if (!(await fs.pathExists(easJsonPath))) { + await fs.writeFile(easJsonPath, `${JSON.stringify(easJson, null, 2)}\n`); + await gitAddAsync(easJsonPath, { intentToAdd: true }); + } + + try { + await ensureGitStatusIsCleanAsync(); + spinner.succeed('Found existing eas.json file'); + } catch (err) { + if (err instanceof DirtyGitTreeError) { + spinner.succeed('We created a minimal eas.json file'); + log.newLine(); + + try { + await reviewAndCommitChangesAsync('Create minimal eas.json', { nonInteractive }); + + log(`${chalk.green(figures.tick)} Successfully committed eas.json.`); + } catch (e) { + throw new Error( + "Aborting, run the command again once you're ready. Make sure to commit any changes you've made." + ); + } + } else { + spinner.fail(); + throw err; + } + } + + const easConfig: EasConfig = await new EasJsonReader( + projectDir, + BuildCommandPlatform.ALL + ).readAsync('release'); + + const ctx = await createBuilderContextAsync(projectDir, easConfig, { + platform: BuildCommandPlatform.ALL, + nonInteractive, + skipCredentialsCheck: options?.skipCredentialsCheck, + skipProjectConfiguration: false, + }); + + const androidBuilder = new AndroidBuilder(ctx); + + await androidBuilder.ensureCredentialsAsync(); + await androidBuilder.configureProjectAsync(); + + const iosBuilder = new iOSBuilder(ctx); + + await iosBuilder.ensureCredentialsAsync(); + await iosBuilder.configureProjectAsync(); +} + +export default initAction; diff --git a/packages/expo-cli/src/commands/eas-build/types.ts b/packages/expo-cli/src/commands/eas-build/types.ts index af23977b53..aca8c4da28 100644 --- a/packages/expo-cli/src/commands/eas-build/types.ts +++ b/packages/expo-cli/src/commands/eas-build/types.ts @@ -1,4 +1,8 @@ -import { Platform } from '@expo/build-tools'; +import { Job, Platform } from '@expo/build-tools'; +import { ExpoConfig } from '@expo/config'; +import { User } from '@expo/xdl'; + +import { EasConfig } from '../../easJson'; export enum BuildCommandPlatform { ANDROID = 'android', @@ -25,3 +29,24 @@ interface BuildArtifacts { buildUrl?: string; logsUrl: string; } + +export interface Builder { + ctx: BuilderContext; + setupAsync(): Promise; + ensureCredentialsAsync(): Promise; + ensureProjectConfiguredAsync(): Promise; + prepareJobAsync(archiveUrl: string): Promise; +} + +export interface BuilderContext { + projectDir: string; + eas: EasConfig; + user: User; + accountName: string; + projectName: string; + exp: ExpoConfig; + platform: BuildCommandPlatform; + nonInteractive: boolean; + skipCredentialsCheck: boolean; + skipProjectConfiguration: boolean; +} diff --git a/packages/expo-cli/src/commands/eas-build/utils/createBuilderContextAsync.ts b/packages/expo-cli/src/commands/eas-build/utils/createBuilderContextAsync.ts new file mode 100644 index 0000000000..17e1fa71ee --- /dev/null +++ b/packages/expo-cli/src/commands/eas-build/utils/createBuilderContextAsync.ts @@ -0,0 +1,39 @@ +import { getConfig } from '@expo/config'; +import { User, UserManager } from '@expo/xdl'; + +import { EasConfig } from '../../../easJson'; +import { BuildCommandPlatform, BuilderContext } from '../types'; + +export default async function createBuilderContextAsync( + projectDir: string, + eas: EasConfig, + { + platform = BuildCommandPlatform.ALL, + nonInteractive = false, + skipCredentialsCheck = false, + skipProjectConfiguration = false, + }: { + platform?: BuildCommandPlatform; + nonInteractive?: boolean; + skipCredentialsCheck?: boolean; + skipProjectConfiguration?: boolean; + } +): Promise { + const user: User = await UserManager.ensureLoggedInAsync(); + const { exp } = getConfig(projectDir, { skipSDKVersionRequirement: true }); + const accountName = exp.owner || user.username; + const projectName = exp.slug; + + return { + eas, + projectDir, + user, + accountName, + projectName, + exp, + platform, + nonInteractive, + skipCredentialsCheck, + skipProjectConfiguration, + }; +} diff --git a/packages/expo-cli/src/commands/eas-build/build/utils/git.ts b/packages/expo-cli/src/commands/eas-build/utils/git.ts similarity index 95% rename from packages/expo-cli/src/commands/eas-build/build/utils/git.ts rename to packages/expo-cli/src/commands/eas-build/utils/git.ts index 170031080e..7f4420ea05 100644 --- a/packages/expo-cli/src/commands/eas-build/build/utils/git.ts +++ b/packages/expo-cli/src/commands/eas-build/utils/git.ts @@ -3,10 +3,10 @@ import commandExists from 'command-exists'; import fs from 'fs-extra'; import ora from 'ora'; -import CommandError from '../../../../CommandError'; -import { gitDiffAsync, gitDoesRepoExistAsync, gitStatusAsync } from '../../../../git'; -import log from '../../../../log'; -import prompts from '../../../../prompts'; +import CommandError from '../../../CommandError'; +import { gitDiffAsync, gitDoesRepoExistAsync, gitStatusAsync } from '../../../git'; +import log from '../../../log'; +import prompts from '../../../prompts'; async function ensureGitRepoExistsAsync(): Promise { try { diff --git a/packages/expo-cli/src/commands/eas-build/build/utils/misc.ts b/packages/expo-cli/src/commands/eas-build/utils/misc.ts similarity index 87% rename from packages/expo-cli/src/commands/eas-build/build/utils/misc.ts rename to packages/expo-cli/src/commands/eas-build/utils/misc.ts index f423a4d1a6..a49b2e601c 100644 --- a/packages/expo-cli/src/commands/eas-build/build/utils/misc.ts +++ b/packages/expo-cli/src/commands/eas-build/utils/misc.ts @@ -1,9 +1,9 @@ import { UserManager } from '@expo/xdl'; -import log from '../../../../log'; -import * as UrlUtils from '../../../utils/url'; -import { platformDisplayNames } from '../../constants'; -import { Build } from '../../types'; +import log from '../../../log'; +import * as UrlUtils from '../../utils/url'; +import { platformDisplayNames } from '../constants'; +import { Build } from '../types'; async function printLogsUrls( accountName: string,