eas-cli 18.10.0 → 18.12.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 (56) hide show
  1. package/README.md +107 -102
  2. package/build/build/runBuildAndSubmit.d.ts +3 -1
  3. package/build/build/runBuildAndSubmit.js +12 -4
  4. package/build/build/utils/repository.js +8 -0
  5. package/build/build/validateLockfile.d.ts +1 -0
  6. package/build/build/validateLockfile.js +37 -0
  7. package/build/commandUtils/buildFlags.d.ts +1 -0
  8. package/build/commandUtils/buildFlags.js +18 -0
  9. package/build/commandUtils/convex.d.ts +1 -0
  10. package/build/commandUtils/convex.js +8 -2
  11. package/build/commands/build/dev.d.ts +1 -0
  12. package/build/commands/build/dev.js +12 -2
  13. package/build/commands/build/run.d.ts +1 -0
  14. package/build/commands/build/run.js +12 -3
  15. package/build/commands/integrations/convex/connect.d.ts +1 -0
  16. package/build/commands/integrations/convex/connect.js +65 -7
  17. package/build/commands/integrations/convex/team/invite.js +6 -1
  18. package/build/commands/observe/events.js +12 -24
  19. package/build/commands/observe/logs.d.ts +29 -0
  20. package/build/commands/observe/logs.js +163 -0
  21. package/build/commands/observe/metrics.js +11 -19
  22. package/build/commands/observe/versions.js +11 -19
  23. package/build/commands/simulator/start.js +85 -92
  24. package/build/commands/simulator/stop.js +1 -1
  25. package/build/graphql/generated.d.ts +290 -10
  26. package/build/graphql/generated.js +32 -3
  27. package/build/graphql/mutations/DeviceRunSessionMutation.d.ts +2 -2
  28. package/build/graphql/mutations/DeviceRunSessionMutation.js +4 -4
  29. package/build/graphql/queries/DeviceRunSessionQuery.js +8 -1
  30. package/build/graphql/queries/ObserveQuery.d.ts +21 -1
  31. package/build/graphql/queries/ObserveQuery.js +80 -0
  32. package/build/graphql/types/ConvexTeamConnection.d.ts +1 -1
  33. package/build/graphql/types/ConvexTeamConnection.js +1 -0
  34. package/build/graphql/types/Observe.d.ts +1 -0
  35. package/build/graphql/types/Observe.js +26 -1
  36. package/build/observe/fetchCustomEvents.d.ts +19 -0
  37. package/build/observe/fetchCustomEvents.js +21 -0
  38. package/build/observe/formatCustomEvents.d.ts +70 -0
  39. package/build/observe/formatCustomEvents.js +140 -0
  40. package/build/observe/formatEvents.js +5 -34
  41. package/build/observe/formatMetrics.js +2 -7
  42. package/build/observe/formatUtils.d.ts +27 -0
  43. package/build/observe/formatUtils.js +64 -0
  44. package/build/observe/formatVersions.js +2 -9
  45. package/build/observe/platforms.d.ts +21 -0
  46. package/build/observe/platforms.js +48 -0
  47. package/build/observe/resolveProjectContext.d.ts +22 -0
  48. package/build/observe/resolveProjectContext.js +21 -0
  49. package/build/run/ios/run.d.ts +2 -1
  50. package/build/run/ios/run.js +6 -2
  51. package/build/run/ios/simulator.d.ts +4 -1
  52. package/build/run/ios/simulator.js +14 -2
  53. package/build/run/run.d.ts +2 -1
  54. package/build/run/run.js +2 -2
  55. package/oclif.manifest.json +568 -375
  56. package/package.json +5 -5
@@ -0,0 +1,21 @@
1
+ import { AppObservePlatform, AppPlatform } from '../graphql/generated';
2
+ /**
3
+ * Allowed values for the --platform flag in observe commands.
4
+ * Derived from the AppObservePlatform enum so new platforms added on
5
+ * the server are automatically picked up.
6
+ */
7
+ export declare const allowedPlatformFlagValues: string[];
8
+ type PlatformFlagValue = (typeof allowedPlatformFlagValues)[number];
9
+ /**
10
+ * Resolve a single AppObservePlatform from a --platform flag value.
11
+ * Returns undefined when no flag was provided.
12
+ */
13
+ export declare function appObservePlatformFromFlag(flag: PlatformFlagValue | undefined): AppObservePlatform | undefined;
14
+ /**
15
+ * Resolve a list of AppPlatform values from a --platform flag value.
16
+ * Returns the single matching platform when a flag is provided, or all
17
+ * known platforms when no flag is provided (so the caller queries every
18
+ * platform).
19
+ */
20
+ export declare function appPlatformsFromFlag(flag: PlatformFlagValue | undefined): AppPlatform[];
21
+ export {};
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.allowedPlatformFlagValues = void 0;
4
+ exports.appObservePlatformFromFlag = appObservePlatformFromFlag;
5
+ exports.appPlatformsFromFlag = appPlatformsFromFlag;
6
+ const generated_1 = require("../graphql/generated");
7
+ /**
8
+ * Allowed values for the --platform flag in observe commands.
9
+ * Derived from the AppObservePlatform enum so new platforms added on
10
+ * the server are automatically picked up.
11
+ */
12
+ exports.allowedPlatformFlagValues = Object.values(generated_1.AppObservePlatform).map(s => s.toLowerCase());
13
+ const defaultAppObservePlatform = generated_1.AppObservePlatform.Ios;
14
+ const defaultAppPlatform = generated_1.AppPlatform.Ios;
15
+ /**
16
+ * Resolve a single AppObservePlatform from a --platform flag value.
17
+ * Returns undefined when no flag was provided.
18
+ */
19
+ function appObservePlatformFromFlag(flag) {
20
+ if (!flag) {
21
+ return undefined;
22
+ }
23
+ switch (flag) {
24
+ case 'android':
25
+ return generated_1.AppObservePlatform.Android;
26
+ case 'ios':
27
+ return generated_1.AppObservePlatform.Ios;
28
+ }
29
+ return defaultAppObservePlatform;
30
+ }
31
+ /**
32
+ * Resolve a list of AppPlatform values from a --platform flag value.
33
+ * Returns the single matching platform when a flag is provided, or all
34
+ * known platforms when no flag is provided (so the caller queries every
35
+ * platform).
36
+ */
37
+ function appPlatformsFromFlag(flag) {
38
+ if (!flag) {
39
+ return [generated_1.AppPlatform.Android, generated_1.AppPlatform.Ios];
40
+ }
41
+ switch (flag) {
42
+ case 'android':
43
+ return [generated_1.AppPlatform.Android];
44
+ case 'ios':
45
+ return [generated_1.AppPlatform.Ios];
46
+ }
47
+ return [defaultAppPlatform];
48
+ }
@@ -0,0 +1,22 @@
1
+ import EasCommand, { ContextInput } from '../commandUtils/EasCommand';
2
+ import { ExpoGraphqlClient } from '../commandUtils/context/contextUtils/createGraphqlClient';
3
+ /**
4
+ * Shared context resolution for observe commands.
5
+ *
6
+ * If `projectIdOverride` is provided (typically via `--project-id`), the
7
+ * helper only requires the LoggedIn context (so the command can run outside
8
+ * of a project directory). Otherwise it uses the full context definition,
9
+ * which derives the project ID from the local app config.
10
+ */
11
+ export declare function resolveObserveCommandContextAsync({ command, commandClass, loggedInOnlyContextDefinition, projectIdOverride, nonInteractive, }: {
12
+ command: EasCommand;
13
+ commandClass: {
14
+ contextDefinition: ContextInput<any>;
15
+ };
16
+ loggedInOnlyContextDefinition: ContextInput<any>;
17
+ projectIdOverride?: string;
18
+ nonInteractive: boolean;
19
+ }): Promise<{
20
+ projectId: string;
21
+ graphqlClient: ExpoGraphqlClient;
22
+ }>;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.resolveObserveCommandContextAsync = resolveObserveCommandContextAsync;
4
+ /**
5
+ * Shared context resolution for observe commands.
6
+ *
7
+ * If `projectIdOverride` is provided (typically via `--project-id`), the
8
+ * helper only requires the LoggedIn context (so the command can run outside
9
+ * of a project directory). Otherwise it uses the full context definition,
10
+ * which derives the project ID from the local app config.
11
+ */
12
+ async function resolveObserveCommandContextAsync({ command, commandClass, loggedInOnlyContextDefinition, projectIdOverride, nonInteractive, }) {
13
+ // `getContextAsync` is `protected` on EasCommand; cast to access from this helper.
14
+ const commandWithContextAccess = command;
15
+ if (projectIdOverride) {
16
+ const ctx = await commandWithContextAccess.getContextAsync({ contextDefinition: loggedInOnlyContextDefinition }, { nonInteractive });
17
+ return { projectId: projectIdOverride, graphqlClient: ctx.loggedIn.graphqlClient };
18
+ }
19
+ const ctx = await commandWithContextAccess.getContextAsync(commandClass, { nonInteractive });
20
+ return { projectId: ctx.projectId, graphqlClient: ctx.loggedIn.graphqlClient };
21
+ }
@@ -1 +1,2 @@
1
- export declare function runAppOnIosSimulatorAsync(appPath: string): Promise<void>;
1
+ export type SimulatorRunTarget = true | string | undefined;
2
+ export declare function runAppOnIosSimulatorAsync(appPath: string, simulatorRunTarget?: SimulatorRunTarget): Promise<void>;
@@ -6,9 +6,13 @@ const spawn_async_1 = tslib_1.__importDefault(require("@expo/spawn-async"));
6
6
  const path_1 = tslib_1.__importDefault(require("path"));
7
7
  const simulator = tslib_1.__importStar(require("./simulator"));
8
8
  const systemRequirements_1 = require("./systemRequirements");
9
- async function runAppOnIosSimulatorAsync(appPath) {
9
+ async function runAppOnIosSimulatorAsync(appPath, simulatorRunTarget) {
10
10
  await (0, systemRequirements_1.validateSystemRequirementsAsync)();
11
- const selectedSimulator = await simulator.selectSimulatorAsync();
11
+ const selectedSimulator = simulatorRunTarget === true
12
+ ? await simulator.selectSimulatorAsync({ forcePrompt: true })
13
+ : simulatorRunTarget
14
+ ? await simulator.getIosSimulatorByIdOrNameAsync(simulatorRunTarget)
15
+ : await simulator.selectSimulatorAsync();
12
16
  await simulator.ensureSimulatorBootedAsync(selectedSimulator);
13
17
  await simulator.ensureSimulatorAppOpenedAsync(selectedSimulator.udid);
14
18
  const bundleIdentifier = await getAppBundleIdentifierAsync(appPath);
@@ -9,7 +9,10 @@ interface IosSimulator {
9
9
  udid: string;
10
10
  lastBootedAt?: Date;
11
11
  }
12
- export declare function selectSimulatorAsync(): Promise<IosSimulator>;
12
+ export declare function selectSimulatorAsync({ forcePrompt, }?: {
13
+ forcePrompt?: boolean;
14
+ }): Promise<IosSimulator>;
15
+ export declare function getIosSimulatorByIdOrNameAsync(simulator: string): Promise<IosSimulator>;
13
16
  export declare function getFirstBootedIosSimulatorAsync(): Promise<IosSimulator | undefined>;
14
17
  export declare function getAvaliableIosSimulatorsListAsync(query?: string): Promise<IosSimulator[]>;
15
18
  export declare function ensureSimulatorBootedAsync(simulator: IosSimulator): Promise<void>;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.selectSimulatorAsync = selectSimulatorAsync;
4
+ exports.getIosSimulatorByIdOrNameAsync = getIosSimulatorByIdOrNameAsync;
4
5
  exports.getFirstBootedIosSimulatorAsync = getFirstBootedIosSimulatorAsync;
5
6
  exports.getAvaliableIosSimulatorsListAsync = getAvaliableIosSimulatorsListAsync;
6
7
  exports.ensureSimulatorBootedAsync = ensureSimulatorBootedAsync;
@@ -16,8 +17,8 @@ const simctl_1 = require("./simctl");
16
17
  const log_1 = tslib_1.__importDefault(require("../../log"));
17
18
  const prompts_1 = require("../../prompts");
18
19
  const promise_1 = require("../../utils/promise");
19
- async function selectSimulatorAsync() {
20
- const bootedSimulator = await getFirstBootedIosSimulatorAsync();
20
+ async function selectSimulatorAsync({ forcePrompt = false, } = {}) {
21
+ const bootedSimulator = forcePrompt ? undefined : await getFirstBootedIosSimulatorAsync();
21
22
  if (bootedSimulator) {
22
23
  return bootedSimulator;
23
24
  }
@@ -32,6 +33,17 @@ async function selectSimulatorAsync() {
32
33
  value: simulator,
33
34
  })),
34
35
  });
36
+ if (!selectedSimulator) {
37
+ throw new Error('No simulator selected.');
38
+ }
39
+ return selectedSimulator;
40
+ }
41
+ async function getIosSimulatorByIdOrNameAsync(simulator) {
42
+ const simulators = await getAvaliableIosSimulatorsListAsync();
43
+ const selectedSimulator = simulators.find(availableSimulator => availableSimulator.udid === simulator || availableSimulator.name === simulator);
44
+ if (!selectedSimulator) {
45
+ throw new Error(`Could not find an available iOS simulator with name or UDID "${simulator}".`);
46
+ }
35
47
  return selectedSimulator;
36
48
  }
37
49
  async function getFirstBootedIosSimulatorAsync() {
@@ -1,3 +1,4 @@
1
+ import { SimulatorRunTarget } from './ios/run';
1
2
  import { AppPlatform } from '../graphql/generated';
2
3
  export interface RunArchiveFlags {
3
4
  latest?: boolean;
@@ -5,5 +6,5 @@ export interface RunArchiveFlags {
5
6
  path?: string;
6
7
  url?: string;
7
8
  }
8
- export declare function runAsync(simulatorBuildPath: string, selectedPlatform: AppPlatform): Promise<void>;
9
+ export declare function runAsync(simulatorBuildPath: string, selectedPlatform: AppPlatform, simulator?: SimulatorRunTarget): Promise<void>;
9
10
  export declare function getEasBuildRunCachedAppPath(projectId: string, buildId: string, platform: AppPlatform): string;
package/build/run/run.js CHANGED
@@ -8,9 +8,9 @@ const run_1 = require("./android/run");
8
8
  const run_2 = require("./ios/run");
9
9
  const generated_1 = require("../graphql/generated");
10
10
  const paths_1 = require("../utils/paths");
11
- async function runAsync(simulatorBuildPath, selectedPlatform) {
11
+ async function runAsync(simulatorBuildPath, selectedPlatform, simulator) {
12
12
  if (selectedPlatform === generated_1.AppPlatform.Ios) {
13
- await (0, run_2.runAppOnIosSimulatorAsync)(simulatorBuildPath);
13
+ await (0, run_2.runAppOnIosSimulatorAsync)(simulatorBuildPath, simulator);
14
14
  }
15
15
  else {
16
16
  await (0, run_1.runAppOnAndroidEmulatorAsync)(simulatorBuildPath);