eas-cli 27.4.1 → 27.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/README.md +373 -200
  2. package/build/build/simulatorsLaunchHint.js +1 -1
  3. package/build/commands/observe/events.d.ts +2 -0
  4. package/build/commands/observe/events.js +42 -4
  5. package/build/commands/simulator/availability.d.ts +1 -0
  6. package/build/commands/simulator/availability.js +3 -1
  7. package/build/commands/simulator/control/connection.d.ts +19 -0
  8. package/build/commands/simulator/control/connection.js +93 -0
  9. package/build/commands/simulator/control.d.ts +7 -0
  10. package/build/commands/simulator/control.js +249 -110
  11. package/build/commands/simulator/egress.d.ts +1 -0
  12. package/build/commands/simulator/egress.js +3 -1
  13. package/build/commands/simulator/events.d.ts +1 -0
  14. package/build/commands/simulator/events.js +3 -1
  15. package/build/commands/simulator/exec.d.ts +1 -0
  16. package/build/commands/simulator/exec.js +3 -1
  17. package/build/commands/simulator/get.d.ts +1 -0
  18. package/build/commands/simulator/get.js +3 -1
  19. package/build/commands/simulator/index.d.ts +2 -0
  20. package/build/commands/simulator/index.js +286 -76
  21. package/build/commands/simulator/list.d.ts +1 -0
  22. package/build/commands/simulator/list.js +3 -1
  23. package/build/commands/simulator/logs.d.ts +1 -0
  24. package/build/commands/simulator/logs.js +3 -1
  25. package/build/commands/simulator/stop.d.ts +1 -0
  26. package/build/commands/simulator/stop.js +3 -1
  27. package/build/commands/workflow/ssh.d.ts +0 -1
  28. package/build/commands/workflow/ssh.js +0 -1
  29. package/build/graphql/generated.d.ts +8 -0
  30. package/build/graphql/types/Actor.js +3 -0
  31. package/build/help.js +2 -1
  32. package/build/observe/fetchCustomEvents.d.ts +2 -1
  33. package/build/observe/fetchCustomEvents.js +1 -0
  34. package/build/project/accountSelection.js +5 -8
  35. package/build/simulator/commandAliases.d.ts +10 -0
  36. package/build/simulator/commandAliases.js +24 -0
  37. package/build/simulator/controlActions.d.ts +32 -0
  38. package/build/simulator/controlActions.js +128 -0
  39. package/build/simulator/controlConfig.d.ts +43 -0
  40. package/build/simulator/controlConfig.js +156 -0
  41. package/build/simulator/controlConnection.d.ts +28 -0
  42. package/build/simulator/controlConnection.js +337 -0
  43. package/build/simulator/controlConnectionProtocol.d.ts +64 -0
  44. package/build/simulator/controlConnectionProtocol.js +155 -0
  45. package/build/simulator/controlConnectionWorker.d.ts +7 -0
  46. package/build/simulator/controlConnectionWorker.js +278 -0
  47. package/build/simulator/controlSession.d.ts +3 -0
  48. package/build/simulator/controlSession.js +28 -0
  49. package/build/simulator/hostActions.d.ts +22 -3
  50. package/build/simulator/hostActions.js +78 -19
  51. package/build/simulator/sessionConfig.d.ts +16 -0
  52. package/build/simulator/sessionConfig.js +36 -0
  53. package/build/simulator/startConfig.d.ts +7 -0
  54. package/build/simulator/startConfig.js +89 -0
  55. package/build/simulator/startSetup.d.ts +7 -0
  56. package/build/simulator/startSetup.js +17 -0
  57. package/build/user/User.d.ts +9 -1
  58. package/build/user/User.js +25 -3
  59. package/build/user/accountPermissions.js +3 -1
  60. package/oclif.manifest.json +1194 -996
  61. package/package.json +8 -6
@@ -8,7 +8,7 @@ const createGraphqlClient_1 = require("../commandUtils/context/contextUtils/crea
8
8
  const UserPreferenceMutation_1 = require("../graphql/mutations/UserPreferenceMutation");
9
9
  const UserPreferenceQuery_1 = require("../graphql/queries/UserPreferenceQuery");
10
10
  const log_1 = tslib_1.__importStar(require("../log"));
11
- const SIMULATORS_LAUNCH_AT = new Date('2026-11-10T18:00:00Z');
11
+ const SIMULATORS_LAUNCH_AT = new Date('2026-11-12T18:00:00Z');
12
12
  const SIMULATORS_LAUNCH_HINT_PREFERENCE_KEY = 'simulators-launch-cli-hint-seen';
13
13
  const REQUEST_TIMEOUT_MS = 3000;
14
14
  const SIMULATORS_QUICKSTART_URL = 'https://docs.expo.dev/preview/simulators/get-started/?utm_source=eas-cli&utm_medium=cli&utm_campaign=simulators-launch';
@@ -1,4 +1,5 @@
1
1
  import EasCommand from '../../commandUtils/EasCommand';
2
+ import { AppObserveUserEventPropertyFilter } from '../../graphql/generated';
2
3
  export default class ObserveEvents extends EasCommand {
3
4
  static description: string;
4
5
  static args: {
@@ -9,6 +10,7 @@ export default class ObserveEvents extends EasCommand {
9
10
  'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
10
11
  'project-id': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
11
12
  'session-id': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
13
+ property: import("@oclif/core/lib/interfaces").OptionFlag<AppObserveUserEventPropertyFilter[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
12
14
  'all-events': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
13
15
  environment: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
14
16
  'update-id': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
@@ -15,6 +15,7 @@ const platforms_1 = require("../../observe/platforms");
15
15
  const startAndEndTime_1 = require("../../observe/startAndEndTime");
16
16
  const json_1 = require("../../utils/json");
17
17
  const DEFAULT_EVENTS_LIMIT = 10;
18
+ const MAX_PROPERTY_FILTERS = 5;
18
19
  class ObserveEvents extends EasCommand_1.default {
19
20
  static description = 'display individual events emitted by the app via `logEvent`, filtered by the event name in the argument. With no arguments, a list of the available event names and associated event counts is returned';
20
21
  static args = {
@@ -38,6 +39,11 @@ class ObserveEvents extends EasCommand_1.default {
38
39
  'session-id': core_1.Flags.string({
39
40
  description: 'Filter by session ID. When no event name is given, lists the events in the session instead of the event-name summary.',
40
41
  }),
42
+ property: core_1.Flags.custom({
43
+ description: `Filter by event property (key=value, exact match). Repeat up to ${MAX_PROPERTY_FILTERS} times to require all (each key may be used once). Without an event name, lists matching events.`,
44
+ multiple: true,
45
+ parse: parsePropertyFilterAsync,
46
+ })(),
41
47
  'all-events': core_1.Flags.boolean({
42
48
  description: 'When no event name argument is provided, list all events across all event names instead of a summary of event names + counts.',
43
49
  default: false,
@@ -55,6 +61,16 @@ class ObserveEvents extends EasCommand_1.default {
55
61
  if (args.eventName && flags['all-events']) {
56
62
  throw new Error('--all-events cannot be combined with an event name argument. Pass an event name to filter by it, or pass --all-events to list all events across all event names.');
57
63
  }
64
+ if (flags.property) {
65
+ if (flags.property.length > MAX_PROPERTY_FILTERS) {
66
+ throw new Error(`--property can be used up to ${MAX_PROPERTY_FILTERS} times, but got ${flags.property.length}.`);
67
+ }
68
+ const keys = flags.property.map(filter => filter.key);
69
+ const repeatedKey = keys.find((key, index) => keys.indexOf(key) !== index);
70
+ if (repeatedKey) {
71
+ throw new Error(`--property key "${repeatedKey}" is used more than once. Each key can be filtered by only one value.`);
72
+ }
73
+ }
58
74
  const { projectId, loggedIn: { graphqlClient }, } = await this.getContextAsync(ObserveEvents, {
59
75
  nonInteractive,
60
76
  projectIdOverride: flags['project-id'],
@@ -64,10 +80,10 @@ class ObserveEvents extends EasCommand_1.default {
64
80
  }
65
81
  const { daysBack, startTime, endTime } = (0, startAndEndTime_1.resolveTimeRange)(flags);
66
82
  const platforms = (0, platforms_1.observePlatformsFromFlag)(flags.platform);
67
- // A session ID narrows to a single session, so show that session's events
83
+ // A session ID or property filter narrows the events, so show them
68
84
  // (like --all-events) instead of the account-wide name+count summary, which
69
- // has no session filter.
70
- if (!args.eventName && !flags['all-events'] && !flags['session-id']) {
85
+ // supports neither filter.
86
+ if (!args.eventName && !flags['all-events'] && !flags['session-id'] && !flags.property) {
71
87
  const { names, isTruncated } = await (0, planGating_1.withObservePlanGateHandlingAsync)(() => ObserveQuery_1.ObserveQuery.customEventNamesAsync(graphqlClient, {
72
88
  appId: projectId,
73
89
  startTime,
@@ -101,8 +117,18 @@ class ObserveEvents extends EasCommand_1.default {
101
117
  updateId: flags['update-id'],
102
118
  sessionId: flags['session-id'],
103
119
  environment: flags.environment,
120
+ propertyFilters: flags.property,
104
121
  }));
105
- if (args.eventName && events.length === 0) {
122
+ // A session, app version, build number, update ID, or property may not
123
+ // contain the event even when the name is valid, so only suggest other names
124
+ // when the event name is the sole narrowing filter.
125
+ if (args.eventName &&
126
+ events.length === 0 &&
127
+ !flags['session-id'] &&
128
+ !flags['app-version'] &&
129
+ !flags['build-number'] &&
130
+ !flags['update-id'] &&
131
+ !flags.property) {
106
132
  const { names, isTruncated } = await ObserveQuery_1.ObserveQuery.customEventNamesAsync(graphqlClient, {
107
133
  appId: projectId,
108
134
  startTime,
@@ -139,3 +165,15 @@ class ObserveEvents extends EasCommand_1.default {
139
165
  }
140
166
  }
141
167
  exports.default = ObserveEvents;
168
+ // Split on the first "=" so values may contain "=".
169
+ async function parsePropertyFilterAsync(input) {
170
+ const separatorIndex = input.indexOf('=');
171
+ if (separatorIndex <= 0) {
172
+ throw new Error(`Invalid property filter "${input}". Expected key=value format.`);
173
+ }
174
+ const value = input.slice(separatorIndex + 1);
175
+ if (!value) {
176
+ throw new Error(`Invalid property filter "${input}". The value cannot be empty.`);
177
+ }
178
+ return { key: input.slice(0, separatorIndex), value };
179
+ }
@@ -1,6 +1,7 @@
1
1
  import EasCommand from '../../commandUtils/EasCommand';
2
2
  export default class SimulatorAvailability extends EasCommand {
3
3
  static aliases: string[];
4
+ static hiddenAliases: string[];
4
5
  static description: string;
5
6
  static flags: {
6
7
  json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
@@ -8,8 +8,10 @@ const log_1 = tslib_1.__importDefault(require("../../log"));
8
8
  const ora_1 = require("../../ora");
9
9
  const utils_1 = require("../../simulator/utils");
10
10
  const json_1 = require("../../utils/json");
11
+ const commandAliases_1 = require("../../simulator/commandAliases");
11
12
  class SimulatorAvailability extends EasCommand_1.default {
12
- static aliases = ['sim:availability'];
13
+ static aliases = (0, commandAliases_1.getSimulatorCommandAliases)('availability');
14
+ static hiddenAliases = (0, commandAliases_1.getSimulatorCommandHiddenAliases)('availability');
13
15
  static description = '[EXPERIMENTAL] check whether EAS Simulator is enabled for the current project account';
14
16
  static flags = {
15
17
  ...flags_1.EasNonInteractiveAndJsonFlags,
@@ -0,0 +1,19 @@
1
+ import EasCommand from '../../../commandUtils/EasCommand';
2
+ export default class SimulatorControlConnection extends EasCommand {
3
+ static description: string;
4
+ static args: {
5
+ operation: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
6
+ };
7
+ static flags: {
8
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
9
+ 'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
10
+ id: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
11
+ 'idle-timeout': import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
12
+ };
13
+ static examples: string[];
14
+ static contextDefinition: {
15
+ projectDir: import("../../../commandUtils/context/ProjectDirContextField").default;
16
+ loggedIn: import("../../../commandUtils/context/LoggedInContextField").default;
17
+ };
18
+ runAsync(): Promise<void>;
19
+ }
@@ -0,0 +1,93 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const core_1 = require("@oclif/core");
5
+ const EasCommand_1 = tslib_1.__importDefault(require("../../../commandUtils/EasCommand"));
6
+ const flags_1 = require("../../../commandUtils/flags");
7
+ const log_1 = tslib_1.__importDefault(require("../../../log"));
8
+ const controlConnection_1 = require("../../../simulator/controlConnection");
9
+ const controlSession_1 = require("../../../simulator/controlSession");
10
+ const env_1 = require("../../../simulator/env");
11
+ const json_1 = require("../../../utils/json");
12
+ const terminalText_1 = require("../../../utils/terminalText");
13
+ const timer_1 = require("../../../utils/timer");
14
+ class SimulatorControlConnection extends EasCommand_1.default {
15
+ static description = 'optionally keep a simulator control connection available between commands';
16
+ static args = {
17
+ operation: core_1.Args.string({
18
+ required: true,
19
+ options: ['open', 'status', 'close'],
20
+ description: 'Open, inspect or close the local control connection',
21
+ }),
22
+ };
23
+ static flags = {
24
+ id: core_1.Flags.string({
25
+ description: `Simulator session ID. Defaults to ${env_1.SIMULATOR_DOTENV_FILE_NAME}.`,
26
+ }),
27
+ 'idle-timeout': core_1.Flags.integer({
28
+ min: 1,
29
+ max: 86_400,
30
+ description: 'Seconds of idle time before closing the control connection (default: 120)',
31
+ }),
32
+ ...flags_1.EasNonInteractiveAndJsonFlags,
33
+ };
34
+ static examples = [
35
+ '$ eas simulator:control:connection open --idle-timeout 300',
36
+ '$ eas simulator:control:connection status --id <session-id> --json',
37
+ '$ eas simulator:control:connection close',
38
+ ];
39
+ static contextDefinition = {
40
+ ...this.ContextOptions.LoggedIn,
41
+ ...this.ContextOptions.ProjectDir,
42
+ };
43
+ async runAsync() {
44
+ const { args, flags } = await this.parse(SimulatorControlConnection);
45
+ const { json, nonInteractive } = (0, flags_1.resolveNonInteractiveAndJsonFlags)(flags);
46
+ if (json) {
47
+ (0, json_1.enableJsonOutput)();
48
+ }
49
+ if (flags.id === '') {
50
+ throw new Error('--id needs a simulator session ID.');
51
+ }
52
+ if (flags['idle-timeout'] !== undefined && args.operation !== 'open') {
53
+ throw new Error('--idle-timeout applies only to connection open.');
54
+ }
55
+ const idleTimeoutMs = flags['idle-timeout'] !== undefined ? flags['idle-timeout'] * 1_000 : undefined;
56
+ (0, controlConnection_1.assertControlKeepAliveSupported)();
57
+ const { projectDir, loggedIn: { graphqlClient, authenticationInfo }, } = await this.getContextAsync(SimulatorControlConnection, { nonInteractive });
58
+ await (0, env_1.loadSimulatorEnvAsync)(projectDir);
59
+ const sessionId = flags.id ?? process.env[env_1.EAS_SIMULATOR_SESSION_ID];
60
+ if (!sessionId) {
61
+ throw new Error('No simulator session ID provided. Pass --id, or run eas simulator:start first.');
62
+ }
63
+ const identity = await (0, controlConnection_1.createControlConnectionIdentityAsync)(sessionId, projectDir, authenticationInfo);
64
+ const info = args.operation === 'open'
65
+ ? await (0, controlConnection_1.openControlConnectionAsync)(identity, () => (0, controlSession_1.loadControlSessionAsync)(graphqlClient, sessionId), idleTimeoutMs)
66
+ : await (0, controlConnection_1.inspectControlConnectionAsync)(identity, {
67
+ operation: args.operation === 'close' ? 'close' : 'status',
68
+ });
69
+ if (json) {
70
+ (0, json_1.printJsonOnlyOutput)({
71
+ connected: Boolean(info) && args.operation !== 'close',
72
+ id: sessionId,
73
+ connection: args.operation === 'close' ? null : info,
74
+ });
75
+ }
76
+ else if (args.operation === 'close') {
77
+ log_1.default.succeed(info
78
+ ? 'Control connection closing. The simulator session continues.'
79
+ : 'No control connection is open.');
80
+ }
81
+ else if (!info) {
82
+ log_1.default.log('No control connection is open. Regular control commands are available.');
83
+ }
84
+ else {
85
+ log_1.default.log(`${(0, terminalText_1.sanitizeTerminalText)(info.session.device.name ?? 'iOS Simulator')} · ${sessionId}`);
86
+ log_1.default.log(`Control connection ${info.busy ? 'busy' : 'ready'} · idle timeout: ${(0, timer_1.formatMilliseconds)(info.idleTimeoutMs)}`);
87
+ if (info.idleDeadline !== null) {
88
+ log_1.default.log(`Closes in ${(0, timer_1.formatMilliseconds)(Math.max(0, info.idleDeadline - Date.now())) || '<1s'}`);
89
+ }
90
+ }
91
+ }
92
+ }
93
+ exports.default = SimulatorControlConnection;
@@ -1,6 +1,7 @@
1
1
  import EasCommand from '../../commandUtils/EasCommand';
2
2
  export default class SimulatorControl extends EasCommand {
3
3
  static aliases: string[];
4
+ static hiddenAliases: string[];
4
5
  static description: string;
5
6
  static strict: boolean;
6
7
  static examples: string[];
@@ -14,13 +15,19 @@ export default class SimulatorControl extends EasCommand {
14
15
  id: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
15
16
  list: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
16
17
  output: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
18
+ import: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
19
+ 'keep-alive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
20
+ 'idle-timeout': import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
17
21
  };
18
22
  static contextDefinition: {
19
23
  projectDir: import("../../commandUtils/context/ProjectDirContextField").default;
20
24
  loggedIn: import("../../commandUtils/context/LoggedInContextField").default;
21
25
  };
22
26
  runAsync(): Promise<void>;
27
+ private importConfigAsync;
28
+ private printConfigResult;
23
29
  private printCatalog;
24
30
  private printActionHelp;
31
+ private printSessionHeader;
25
32
  private runActionAsync;
26
33
  }