diff --git a/CHANGELOG.md b/CHANGELOG.md index a95050c177..b4e07c981d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ This is the log of notable changes to EAS CLI and related packages. ### 🎉 New features +- [eas-cli] Make `eas simulator` the canonical command and keep `eas simulator:start` as an alias. ([#4112](https://github.com/expo/eas-cli/pull/4112) by [@szdziedzic](https://github.com/szdziedzic)) - [build-tools] Add `ref` input to the `eas/checkout` step to check out a different git ref (branch, tag, or commit SHA) than the one that triggered the job. ([#4035](https://github.com/expo/eas-cli/pull/4035) by [@sswrk](https://github.com/sswrk)) - [build-tools] Load local composite function catalogs at build time so custom builds and generic jobs can resolve local composite functions referenced via `uses:`. ([#3930](https://github.com/expo/eas-cli/pull/3930) by [@sswrk](https://github.com/sswrk)) diff --git a/packages/eas-cli/src/commands/simulator/__tests__/start.test.ts b/packages/eas-cli/src/commands/simulator/__tests__/index.test.ts similarity index 98% rename from packages/eas-cli/src/commands/simulator/__tests__/start.test.ts rename to packages/eas-cli/src/commands/simulator/__tests__/index.test.ts index 5fe80644a6..9b5fb78b5b 100644 --- a/packages/eas-cli/src/commands/simulator/__tests__/start.test.ts +++ b/packages/eas-cli/src/commands/simulator/__tests__/index.test.ts @@ -22,7 +22,7 @@ import { loadSimulatorEnvAsync, resetSimulatorEnvAsync, } from '../../../simulator/env'; -import SimulatorStart from '../start'; +import Simulator from '../index'; jest.mock('fs-extra'); jest.mock('../../../graphql/mutations/DeviceRunSessionMutation'); @@ -139,7 +139,7 @@ function getMockOclifConfig(): Config { return config; } -describe(SimulatorStart, () => { +describe(Simulator, () => { const mockConfig = getMockOclifConfig(); const previousDeviceRunSessionId = process.env[EAS_SIMULATOR_SESSION_ID]; @@ -162,10 +162,10 @@ describe(SimulatorStart, () => { }); function createCommand(argv: string[]): { - command: SimulatorStart; + command: Simulator; getContextAsync: jest.SpyInstance; } { - const command = new SimulatorStart(argv, mockConfig); + const command = new Simulator(argv, mockConfig); // @ts-expect-error getContextAsync is protected const getContextAsync = jest.spyOn(command, 'getContextAsync').mockResolvedValue({ loggedIn: { graphqlClient }, @@ -185,7 +185,7 @@ describe(SimulatorStart, () => { ]); await command.runAsync(); - expect(getContextAsync).toHaveBeenCalledWith(SimulatorStart, { + expect(getContextAsync).toHaveBeenCalledWith(Simulator, { nonInteractive: true, }); expect(mockCreateDeviceRunSessionAsync).toHaveBeenCalledWith(graphqlClient, { diff --git a/packages/eas-cli/src/commands/simulator/start.ts b/packages/eas-cli/src/commands/simulator/index.ts similarity index 98% rename from packages/eas-cli/src/commands/simulator/start.ts rename to packages/eas-cli/src/commands/simulator/index.ts index de1e95a36d..cb9680ec45 100644 --- a/packages/eas-cli/src/commands/simulator/start.ts +++ b/packages/eas-cli/src/commands/simulator/index.ts @@ -49,9 +49,9 @@ const APP_PLATFORM_BY_FLAG_VALUE: Record = { ios: AppPlatform.Ios, }; -export default class SimulatorStart extends EasCommand { +export default class Simulator extends EasCommand { static override hidden = true; - static override aliases = ['simulator']; + static override aliases = ['simulator:start']; static override description = '[EXPERIMENTAL] start a remote simulator session on EAS and get instructions to connect to it'; @@ -100,7 +100,7 @@ export default class SimulatorStart extends EasCommand { }; async runAsync(): Promise { - const { flags } = await this.parse(SimulatorStart); + const { flags } = await this.parse(Simulator); const { json: jsonFlag, nonInteractive } = resolveNonInteractiveAndJsonFlags(flags); if (jsonFlag) { @@ -111,7 +111,7 @@ export default class SimulatorStart extends EasCommand { projectId, projectDir, loggedIn: { graphqlClient }, - } = await this.getContextAsync(SimulatorStart, { + } = await this.getContextAsync(Simulator, { nonInteractive, });