eas-cli 19.0.0 → 19.0.2

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.
@@ -3,6 +3,7 @@ export default class SimulatorStart extends EasCommand {
3
3
  static hidden: boolean;
4
4
  static description: string;
5
5
  static flags: {
6
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
6
7
  'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
7
8
  platform: import("@oclif/core/lib/interfaces").OptionFlag<"android" | "ios", import("@oclif/core/lib/interfaces").CustomOptions>;
8
9
  type: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
@@ -11,6 +11,7 @@ const DeviceRunSessionQuery_1 = require("../../graphql/queries/DeviceRunSessionQ
11
11
  const log_1 = tslib_1.__importStar(require("../../log"));
12
12
  const ora_1 = require("../../ora");
13
13
  const utils_1 = require("../../simulator/utils");
14
+ const json_1 = require("../../utils/json");
14
15
  const promise_1 = require("../../utils/promise");
15
16
  const nullthrows_1 = tslib_1.__importDefault(require("nullthrows"));
16
17
  const POLL_INTERVAL_MS = 5_000; // 5 seconds
@@ -19,6 +20,7 @@ const POLL_TIMEOUT_MS = 15 * 60 * 1_000; // 15 minutes
19
20
  // so adding a new enum value in codegen fails the build until it is wired up here.
20
21
  const DEVICE_RUN_SESSION_TYPE_FLAG_VALUES = {
21
22
  [generated_1.DeviceRunSessionType.AgentDevice]: 'agent-device',
23
+ [generated_1.DeviceRunSessionType.Argent]: 'argent',
22
24
  [generated_1.DeviceRunSessionType.ServeSim]: 'serve-sim',
23
25
  };
24
26
  const DEVICE_RUN_SESSION_TYPE_BY_FLAG_VALUE = Object.fromEntries(Object.entries(DEVICE_RUN_SESSION_TYPE_FLAG_VALUES).map(([type, value]) => [value, type]));
@@ -39,7 +41,7 @@ class SimulatorStart extends EasCommand_1.default {
39
41
  'package-version': core_1.Flags.string({
40
42
  description: 'Version of the package backing the device run session (e.g. "0.1.3-alpha.3"). Defaults to "latest" when omitted.',
41
43
  }),
42
- ...flags_1.EASNonInteractiveFlag,
44
+ ...flags_1.EasNonInteractiveAndJsonFlags,
43
45
  };
44
46
  static contextDefinition = {
45
47
  ...this.ContextOptions.ProjectId,
@@ -47,8 +49,12 @@ class SimulatorStart extends EasCommand_1.default {
47
49
  };
48
50
  async runAsync() {
49
51
  const { flags } = await this.parse(SimulatorStart);
52
+ const { json: jsonFlag, nonInteractive } = (0, flags_1.resolveNonInteractiveAndJsonFlags)(flags);
53
+ if (jsonFlag) {
54
+ (0, json_1.enableJsonOutput)();
55
+ }
50
56
  const { projectId, loggedIn: { graphqlClient }, } = await this.getContextAsync(SimulatorStart, {
51
- nonInteractive: flags['non-interactive'],
57
+ nonInteractive,
52
58
  });
53
59
  const platform = flags.platform === 'android' ? generated_1.AppPlatform.Android : generated_1.AppPlatform.Ios;
54
60
  const createSpinner = (0, ora_1.ora)('🚀 Creating device run session').start();
@@ -104,10 +110,19 @@ class SimulatorStart extends EasCommand_1.default {
104
110
  await ensureDeviceRunSessionStoppedSafelyAsync(graphqlClient, deviceRunSessionId);
105
111
  throw new Error(`Timed out after ${Math.round(POLL_TIMEOUT_MS / 1000)}s waiting for ${flags.type} session to be ready. ${(0, log_1.link)(jobRunUrl)}`);
106
112
  }
113
+ if (jsonFlag) {
114
+ (0, json_1.printJsonOnlyOutput)({
115
+ id: deviceRunSessionId,
116
+ type: flags.type,
117
+ jobRunUrl,
118
+ remoteConfig,
119
+ });
120
+ return;
121
+ }
107
122
  log_1.default.newLine();
108
123
  log_1.default.log((0, utils_1.formatRemoteSessionInstructions)(remoteConfig));
109
124
  log_1.default.newLine();
110
- if (flags['non-interactive']) {
125
+ if (nonInteractive) {
111
126
  log_1.default.log(`When you are done, stop the session with: eas simulator:stop --id ${deviceRunSessionId}`);
112
127
  return;
113
128
  }
@@ -2982,6 +2982,15 @@ export declare enum AppsFilter {
2982
2982
  /** New Projects */
2983
2983
  New = "NEW"
2984
2984
  }
2985
+ export type ArgentRunSessionRemoteConfig = {
2986
+ __typename?: 'ArgentRunSessionRemoteConfig';
2987
+ toolsUrl: Scalars['String']['output'];
2988
+ /**
2989
+ * URL of the web preview surface for the session. Null when web previews are
2990
+ * not available for the platform (e.g. Android).
2991
+ */
2992
+ webPreviewUrl?: Maybe<Scalars['String']['output']>;
2993
+ };
2985
2994
  export type AscApiKeyInput = {
2986
2995
  issuerIdentifier: Scalars['String']['input'];
2987
2996
  keyIdentifier: Scalars['String']['input'];
@@ -3588,6 +3597,7 @@ export declare enum BuildPhase {
3588
3597
  EasBuildInternal = "EAS_BUILD_INTERNAL",
3589
3598
  FailBuild = "FAIL_BUILD",
3590
3599
  FixGradlew = "FIX_GRADLEW",
3600
+ GradleBuildProfile = "GRADLE_BUILD_PROFILE",
3591
3601
  InstallCustomTools = "INSTALL_CUSTOM_TOOLS",
3592
3602
  InstallDependencies = "INSTALL_DEPENDENCIES",
3593
3603
  InstallPods = "INSTALL_PODS",
@@ -4471,7 +4481,7 @@ export type DeviceRunSessionQuery = {
4471
4481
  export type DeviceRunSessionQueryByIdArgs = {
4472
4482
  deviceRunSessionId: Scalars['ID']['input'];
4473
4483
  };
4474
- export type DeviceRunSessionRemoteConfig = AgentDeviceRunSessionRemoteConfig | ServeSimRunSessionRemoteConfig;
4484
+ export type DeviceRunSessionRemoteConfig = AgentDeviceRunSessionRemoteConfig | ArgentRunSessionRemoteConfig | ServeSimRunSessionRemoteConfig;
4475
4485
  export declare enum DeviceRunSessionStatus {
4476
4486
  Errored = "ERRORED",
4477
4487
  InProgress = "IN_PROGRESS",
@@ -4480,6 +4490,7 @@ export declare enum DeviceRunSessionStatus {
4480
4490
  }
4481
4491
  export declare enum DeviceRunSessionType {
4482
4492
  AgentDevice = "AGENT_DEVICE",
4493
+ Argent = "ARGENT",
4483
4494
  ServeSim = "SERVE_SIM"
4484
4495
  }
4485
4496
  export type DiscordUser = {
@@ -5107,6 +5118,25 @@ export type EditUpdateBranchInput = {
5107
5118
  name?: InputMaybe<Scalars['String']['input']>;
5108
5119
  newName: Scalars['String']['input'];
5109
5120
  };
5121
+ export type EmbeddedUpdate = {
5122
+ __typename?: 'EmbeddedUpdate';
5123
+ channel: Scalars['String']['output'];
5124
+ createdAt: Scalars['DateTime']['output'];
5125
+ /** The manifest UUID baked into the binary by expo-updates at build time. */
5126
+ id: Scalars['ID']['output'];
5127
+ launchAsset: EmbeddedUpdateAsset;
5128
+ platform: AppPlatform;
5129
+ runtimeVersion: Scalars['String']['output'];
5130
+ };
5131
+ export type EmbeddedUpdateAsset = {
5132
+ __typename?: 'EmbeddedUpdateAsset';
5133
+ contentType: Scalars['String']['output'];
5134
+ fileSHA256: Scalars['String']['output'];
5135
+ fileSize: Scalars['Int']['output'];
5136
+ finalFileSize?: Maybe<Scalars['Int']['output']>;
5137
+ id: Scalars['ID']['output'];
5138
+ storageKey: Scalars['String']['output'];
5139
+ };
5110
5140
  export type EmbeddedUpdateAssetMutation = {
5111
5141
  __typename?: 'EmbeddedUpdateAssetMutation';
5112
5142
  /**
@@ -5129,6 +5159,17 @@ export type EmbeddedUpdateAssetUploadSpec = {
5129
5159
  /** Storage key (`{appId}/{embeddedUpdateId}`). Same key in both upload and destination buckets. */
5130
5160
  storageKey: Scalars['String']['output'];
5131
5161
  };
5162
+ export type EmbeddedUpdateMutation = {
5163
+ __typename?: 'EmbeddedUpdateMutation';
5164
+ /**
5165
+ * Register an embedded bundle as the launch asset for a given app/platform/channel.
5166
+ * Returns EMBEDDED_UPDATE_ASSET_NOT_AVAILABLE if the asset has not been finalized yet.
5167
+ */
5168
+ uploadEmbeddedUpdate: EmbeddedUpdate;
5169
+ };
5170
+ export type EmbeddedUpdateMutationUploadEmbeddedUpdateArgs = {
5171
+ input: UploadEmbeddedUpdateInput;
5172
+ };
5132
5173
  export declare enum EntityTypeName {
5133
5174
  AccountEntity = "AccountEntity",
5134
5175
  AccountSsoConfigurationEntity = "AccountSSOConfigurationEntity",
@@ -6177,6 +6218,7 @@ export type JobRun = {
6177
6218
  createdAt: Scalars['DateTime']['output'];
6178
6219
  displayName?: Maybe<Scalars['String']['output']>;
6179
6220
  endedAt?: Maybe<Scalars['DateTime']['output']>;
6221
+ enqueuedAt?: Maybe<Scalars['DateTime']['output']>;
6180
6222
  errors: Array<JobRunError>;
6181
6223
  expiresAt: Scalars['DateTime']['output'];
6182
6224
  gitCommitHash?: Maybe<Scalars['String']['output']>;
@@ -6926,6 +6968,8 @@ export type RootMutation = {
6926
6968
  echoTurn: EchoTurnMutation;
6927
6969
  /** Mutations for Echo versions */
6928
6970
  echoVersion: EchoVersionMutation;
6971
+ /** Mutations that register embedded update bundles for bundle diffing. */
6972
+ embeddedUpdate: EmbeddedUpdateMutation;
6929
6973
  embeddedUpdateAsset: EmbeddedUpdateAssetMutation;
6930
6974
  /** Mutations that create and delete EnvironmentSecrets */
6931
6975
  environmentSecret: EnvironmentSecretMutation;
@@ -8243,6 +8287,15 @@ export type UpdatesMetricsData = {
8243
8287
  installsDataset: CumulativeUpdatesDataset;
8244
8288
  labels: Array<Scalars['String']['output']>;
8245
8289
  };
8290
+ export type UploadEmbeddedUpdateInput = {
8291
+ appId: Scalars['ID']['input'];
8292
+ channel: Scalars['String']['input'];
8293
+ /** UUID baked into the binary by expo-updates at build time (from app.manifest id field). */
8294
+ embeddedUpdateId: Scalars['ID']['input'];
8295
+ platform: AppPlatform;
8296
+ runtimeVersion: Scalars['String']['input'];
8297
+ turtleBuildId?: InputMaybe<Scalars['ID']['input']>;
8298
+ };
8246
8299
  export type UploadSession = {
8247
8300
  __typename?: 'UploadSession';
8248
8301
  /** Create an Upload Session for a specific account */
@@ -16866,6 +16919,10 @@ export type DeviceRunSessionByIdQuery = {
16866
16919
  agentDeviceRemoteSessionUrl: string;
16867
16920
  agentDeviceRemoteSessionToken: string;
16868
16921
  webPreviewUrl?: string | null;
16922
+ } | {
16923
+ __typename: 'ArgentRunSessionRemoteConfig';
16924
+ toolsUrl: string;
16925
+ webPreviewUrl?: string | null;
16869
16926
  } | {
16870
16927
  __typename: 'ServeSimRunSessionRemoteConfig';
16871
16928
  previewUrl: string;
@@ -279,6 +279,7 @@ var BuildPhase;
279
279
  BuildPhase["EasBuildInternal"] = "EAS_BUILD_INTERNAL";
280
280
  BuildPhase["FailBuild"] = "FAIL_BUILD";
281
281
  BuildPhase["FixGradlew"] = "FIX_GRADLEW";
282
+ BuildPhase["GradleBuildProfile"] = "GRADLE_BUILD_PROFILE";
282
283
  BuildPhase["InstallCustomTools"] = "INSTALL_CUSTOM_TOOLS";
283
284
  BuildPhase["InstallDependencies"] = "INSTALL_DEPENDENCIES";
284
285
  BuildPhase["InstallPods"] = "INSTALL_PODS";
@@ -414,6 +415,7 @@ var DeviceRunSessionStatus;
414
415
  var DeviceRunSessionType;
415
416
  (function (DeviceRunSessionType) {
416
417
  DeviceRunSessionType["AgentDevice"] = "AGENT_DEVICE";
418
+ DeviceRunSessionType["Argent"] = "ARGENT";
417
419
  DeviceRunSessionType["ServeSim"] = "SERVE_SIM";
418
420
  })(DeviceRunSessionType || (exports.DeviceRunSessionType = DeviceRunSessionType = {}));
419
421
  var DistributionType;
@@ -29,6 +29,10 @@ exports.DeviceRunSessionQuery = {
29
29
  agentDeviceRemoteSessionToken
30
30
  webPreviewUrl
31
31
  }
32
+ ... on ArgentRunSessionRemoteConfig {
33
+ toolsUrl
34
+ webPreviewUrl
35
+ }
32
36
  ... on ServeSimRunSessionRemoteConfig {
33
37
  previewUrl
34
38
  streamUrl
@@ -1,8 +1,9 @@
1
1
  import { JSONObject } from '@expo/json-file';
2
+ import { Client } from '../../vcs/vcs';
2
3
  interface Target {
3
4
  buildConfiguration?: string;
4
5
  targetName: string;
5
6
  }
6
- export declare function getManagedApplicationTargetEntitlementsAsync(projectDir: string, env: Record<string, string>): Promise<JSONObject>;
7
+ export declare function getManagedApplicationTargetEntitlementsAsync(projectDir: string, env: Record<string, string>, vcsClient: Client): Promise<JSONObject>;
7
8
  export declare function getNativeTargetEntitlementsAsync(projectDir: string, target: Target): Promise<JSONObject | null>;
8
9
  export {};
@@ -2,15 +2,84 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getManagedApplicationTargetEntitlementsAsync = getManagedApplicationTargetEntitlementsAsync;
4
4
  exports.getNativeTargetEntitlementsAsync = getNativeTargetEntitlementsAsync;
5
+ const tslib_1 = require("tslib");
5
6
  const config_plugins_1 = require("@expo/config-plugins");
7
+ const prebuild_config_1 = require("@expo/prebuild-config");
8
+ const log_1 = tslib_1.__importDefault(require("../../log"));
9
+ const sentry_1 = tslib_1.__importDefault(require("../../sentry"));
6
10
  const expoCli_1 = require("../../utils/expoCli");
7
11
  const plist_1 = require("../../utils/plist");
8
- async function getManagedApplicationTargetEntitlementsAsync(projectDir, env) {
9
- const { stdout } = await (0, expoCli_1.spawnExpoCommand)(projectDir, ['config', '--json', '--type', 'introspect'], {
10
- env,
11
- });
12
- const expWithMods = JSON.parse(stdout);
13
- return expWithMods.ios?.entitlements ?? {};
12
+ const projectUtils_1 = require("../projectUtils");
13
+ const workflow_1 = require("../workflow");
14
+ async function getManagedApplicationTargetEntitlementsAsync(projectDir, env, vcsClient) {
15
+ let expoConfigError;
16
+ if ((0, projectUtils_1.isExpoInstalled)(projectDir)) {
17
+ try {
18
+ const { stdout } = await (0, expoCli_1.spawnExpoCommand)(projectDir, ['config', '--json', '--type', 'introspect'], {
19
+ env: {
20
+ ...env,
21
+ EXPO_NO_DOTENV: '1',
22
+ },
23
+ });
24
+ const expWithMods = JSON.parse(stdout);
25
+ return expWithMods.ios?.entitlements ?? {};
26
+ }
27
+ catch (error) {
28
+ try {
29
+ sentry_1.default.withScope(scope => {
30
+ if (process.env.EAS_BUILD_PROJECT_ID) {
31
+ scope.setTag('app_id', process.env.EAS_BUILD_PROJECT_ID);
32
+ }
33
+ if (process.env.EAS_BUILD_ID) {
34
+ scope.setTag('build_id', process.env.EAS_BUILD_ID);
35
+ }
36
+ scope.setTag('config_resolution', 'ios_entitlements_introspection');
37
+ scope.setExtra('message', 'iOS entitlements config fallback');
38
+ scope.setExtra('stdout', error.stdout);
39
+ scope.setExtra('stderr', error.stderr);
40
+ sentry_1.default.captureException(error);
41
+ });
42
+ }
43
+ catch {
44
+ // do nothing
45
+ }
46
+ expoConfigError = error;
47
+ log_1.default.warn(`Failed to read the app config from the project using the local Expo CLI: ${formatError(error)}`);
48
+ log_1.default.warn('Falling back to the version of "@expo/config" shipped with the EAS CLI.');
49
+ }
50
+ }
51
+ try {
52
+ return await resolveManagedApplicationTargetEntitlementsWithBundledConfigAsync(projectDir, env, vcsClient);
53
+ }
54
+ catch (fallbackError) {
55
+ if (expoConfigError) {
56
+ throw new Error(`Failed to resolve iOS entitlements from Expo config. The local Expo CLI failed with: ${formatError(expoConfigError)}. The bundled config fallback also failed with: ${formatError(fallbackError)}`, { cause: fallbackError });
57
+ }
58
+ throw new Error(`Failed to resolve iOS entitlements from Expo config using the bundled config fallback: ${formatError(fallbackError)}`, { cause: fallbackError });
59
+ }
60
+ }
61
+ async function resolveManagedApplicationTargetEntitlementsWithBundledConfigAsync(projectDir, env, vcsClient) {
62
+ const originalProcessEnv = process.env;
63
+ try {
64
+ process.env = {
65
+ ...process.env,
66
+ ...env,
67
+ };
68
+ const { exp } = await (0, prebuild_config_1.getPrebuildConfigAsync)(projectDir, { platforms: ['ios'] });
69
+ const expWithMods = await (0, config_plugins_1.compileModsAsync)(exp, {
70
+ projectRoot: projectDir,
71
+ platforms: ['ios'],
72
+ introspect: true,
73
+ ignoreExistingNativeFiles: await (0, workflow_1.hasIgnoredIosProjectAsync)(projectDir, vcsClient),
74
+ });
75
+ return expWithMods.ios?.entitlements ?? {};
76
+ }
77
+ finally {
78
+ process.env = originalProcessEnv;
79
+ }
80
+ }
81
+ function formatError(error) {
82
+ return error.stderr?.trim() || error.stdout?.trim() || error.message;
14
83
  }
15
84
  async function getNativeTargetEntitlementsAsync(projectDir, target) {
16
85
  const entitlementsPath = config_plugins_1.IOSConfig.Entitlements.getEntitlementsPath(projectDir, target);
@@ -29,7 +29,7 @@ async function resolveManagedProjectTargetsAsync({ exp, projectDir, xcodeBuildCo
29
29
  targetName: applicationTargetName,
30
30
  buildConfiguration,
31
31
  });
32
- const applicationTargetEntitlements = await (0, entitlements_1.getManagedApplicationTargetEntitlementsAsync)(projectDir, env ?? {});
32
+ const applicationTargetEntitlements = await (0, entitlements_1.getManagedApplicationTargetEntitlementsAsync)(projectDir, env ?? {}, vcsClient);
33
33
  const appExtensions = exp.extra?.eas?.build?.experimental?.ios?.appExtensions ?? [];
34
34
  const { error } = AppExtensionsConfigSchema.validate(appExtensions, {
35
35
  allowUnknown: false,
@@ -15,6 +15,17 @@ function formatRemoteSessionInstructions(remoteConfig) {
15
15
  }
16
16
  return lines.join('\n');
17
17
  }
18
+ case 'ArgentRunSessionRemoteConfig': {
19
+ const lines = [
20
+ '🔑 Open the following URL to access the Argent tools for this session:',
21
+ '',
22
+ remoteConfig.toolsUrl,
23
+ ];
24
+ if (remoteConfig.webPreviewUrl) {
25
+ lines.push('', '🌐 Open the following URL in your browser to preview the simulator:', '', remoteConfig.webPreviewUrl);
26
+ }
27
+ return lines.join('\n');
28
+ }
18
29
  case 'ServeSimRunSessionRemoteConfig':
19
30
  return [
20
31
  '🌐 Open the following URL in your browser to access the simulator:',