diff --git a/CHANGELOG.md b/CHANGELOG.md index 423d34f2ac..de19ec0813 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,8 @@ This is the log of notable changes to EAS CLI and related packages. ### ๐Ÿ› Bug fixes +- [eas-cli] Stop `eas simulator --type` from listing `web-preview-only` twice in `--help`. ([#4321](https://github.com/expo/eas-cli/pull/4321) by [@tchayen](https://github.com/tchayen)) + ### ๐Ÿงน Chores ## [23.2.0](https://github.com/expo/eas-cli/releases/tag/v23.2.0) - 2026-08-31 diff --git a/packages/eas-cli/src/commands/simulator/index.ts b/packages/eas-cli/src/commands/simulator/index.ts index 94dc1eac5a..651106949b 100644 --- a/packages/eas-cli/src/commands/simulator/index.ts +++ b/packages/eas-cli/src/commands/simulator/index.ts @@ -33,6 +33,7 @@ import { DEVICE_RUN_SESSION_RESOURCE_CLASS_BY_FLAG_VALUE, DEVICE_RUN_SESSION_RESOURCE_CLASS_FLAG_VALUES, DEVICE_RUN_SESSION_TYPE_BY_FLAG_VALUE, + DEVICE_RUN_SESSION_TYPE_FLAG_OPTIONS, DEVICE_RUN_SESSION_TYPE_FLAG_VALUES, DeviceRunSessionRemoteConfig, formatRemoteSessionInstructions, @@ -110,7 +111,7 @@ export default class Simulator extends EasCommand { type: Flags.option({ description: 'Type of simulator session to create. All session types include a web preview. agent-device, appium, and argent also include an automation interface; web-preview-only includes no automation interface.', - options: Object.values(DEVICE_RUN_SESSION_TYPE_FLAG_VALUES), + options: DEVICE_RUN_SESSION_TYPE_FLAG_OPTIONS, default: DEVICE_RUN_SESSION_TYPE_FLAG_VALUES[DeviceRunSessionType.AgentDevice], })(), 'package-version': Flags.string({ diff --git a/packages/eas-cli/src/commands/simulator/list.ts b/packages/eas-cli/src/commands/simulator/list.ts index fe857aaa55..a3df567614 100644 --- a/packages/eas-cli/src/commands/simulator/list.ts +++ b/packages/eas-cli/src/commands/simulator/list.ts @@ -18,7 +18,7 @@ import Log, { link } from '../../log'; import { ora } from '../../ora'; import { DEVICE_RUN_SESSION_TYPE_BY_FLAG_VALUE, - DEVICE_RUN_SESSION_TYPE_FLAG_VALUES, + DEVICE_RUN_SESSION_TYPE_FLAG_OPTIONS, deviceRunSessionTypeToFlagValue, } from '../../simulator/utils'; import { fromNow } from '../../utils/date'; @@ -63,7 +63,7 @@ export default class SimulatorList extends EasCommand { type: Flags.option({ description: 'Filter by session type (repeatable). All session types include a web preview. agent-device, appium, and argent also include an automation interface; web-preview-only includes no automation interface.', - options: Object.values(DEVICE_RUN_SESSION_TYPE_FLAG_VALUES), + options: DEVICE_RUN_SESSION_TYPE_FLAG_OPTIONS, multiple: true, })(), platform: Flags.option({ diff --git a/packages/eas-cli/src/simulator/__tests__/utils.test.ts b/packages/eas-cli/src/simulator/__tests__/utils.test.ts index 9bf0cb7cac..b79d050ecd 100644 --- a/packages/eas-cli/src/simulator/__tests__/utils.test.ts +++ b/packages/eas-cli/src/simulator/__tests__/utils.test.ts @@ -2,6 +2,7 @@ import { DeviceRunSessionResourceClass, DeviceRunSessionType } from '../../graph import { DEVICE_RUN_SESSION_RESOURCE_CLASS_BY_FLAG_VALUE, DEVICE_RUN_SESSION_TYPE_BY_FLAG_VALUE, + DEVICE_RUN_SESSION_TYPE_FLAG_OPTIONS, DEVICE_RUN_SESSION_TYPE_FLAG_VALUES, deviceRunSessionTypeToFlagValue, formatRemoteSessionInstructions, @@ -19,6 +20,17 @@ const iosAppiumConfig = { webPreviewUrl: 'https://preview.example.test', }; +describe('DEVICE_RUN_SESSION_TYPE_FLAG_OPTIONS', () => { + it('offers web-preview-only once even though two enum values map to it', () => { + expect(DEVICE_RUN_SESSION_TYPE_FLAG_OPTIONS).toEqual([ + 'agent-device', + 'appium', + 'argent', + 'web-preview-only', + ]); + }); +}); + describe('Appium simulator configuration', () => { it('maps the appium CLI value to the GraphQL enum', () => { expect(DEVICE_RUN_SESSION_TYPE_BY_FLAG_VALUE.appium).toBe(DeviceRunSessionType.Appium); diff --git a/packages/eas-cli/src/simulator/utils.ts b/packages/eas-cli/src/simulator/utils.ts index 2dec24ee17..186617196a 100644 --- a/packages/eas-cli/src/simulator/utils.ts +++ b/packages/eas-cli/src/simulator/utils.ts @@ -32,6 +32,12 @@ export const DEVICE_RUN_SESSION_TYPE_FLAG_VALUES: Record [value, type]