eas-cli 16.1.0 → 16.2.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.
@@ -6,3 +6,4 @@ export declare function getInternalDistributionInstallUrl(build: BuildFragment):
6
6
  export declare function getUpdateGroupUrl(accountName: string, projectName: string, updateGroupId: string): string;
7
7
  export declare function getWorkflowRunUrl(accountName: string, projectName: string, workflowRunId: string): string;
8
8
  export declare function getProjectGitHubSettingsUrl(accountName: string, projectName: string): string;
9
+ export declare function getHostingDeploymentsUrl(accountName: string, projectName: string): string;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getProjectGitHubSettingsUrl = exports.getWorkflowRunUrl = exports.getUpdateGroupUrl = exports.getInternalDistributionInstallUrl = exports.getArtifactUrl = exports.getBuildLogsUrl = exports.getProjectDashboardUrl = void 0;
3
+ exports.getHostingDeploymentsUrl = exports.getProjectGitHubSettingsUrl = exports.getWorkflowRunUrl = exports.getUpdateGroupUrl = exports.getInternalDistributionInstallUrl = exports.getArtifactUrl = exports.getBuildLogsUrl = exports.getProjectDashboardUrl = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const assert_1 = tslib_1.__importDefault(require("assert"));
6
6
  const api_1 = require("../../api");
@@ -41,3 +41,7 @@ function getProjectGitHubSettingsUrl(accountName, projectName) {
41
41
  return new URL(`/accounts/${encodeURIComponent(accountName)}/projects/${encodeURIComponent(projectName)}/github`, (0, api_1.getExpoWebsiteBaseUrl)()).toString();
42
42
  }
43
43
  exports.getProjectGitHubSettingsUrl = getProjectGitHubSettingsUrl;
44
+ function getHostingDeploymentsUrl(accountName, projectName) {
45
+ return new URL(`/accounts/${encodeURIComponent(accountName)}/projects/${encodeURIComponent(projectName)}/hosting/deployments`, (0, api_1.getExpoWebsiteBaseUrl)()).toString();
46
+ }
47
+ exports.getHostingDeploymentsUrl = getHostingDeploymentsUrl;
@@ -19,7 +19,7 @@ const SessionManagementContextField_1 = tslib_1.__importDefault(require("./conte
19
19
  const VcsClientContextField_1 = tslib_1.__importDefault(require("./context/VcsClientContextField"));
20
20
  const errors_1 = require("./errors");
21
21
  const AnalyticsManager_1 = require("../analytics/AnalyticsManager");
22
- const log_1 = tslib_1.__importDefault(require("../log"));
22
+ const log_1 = tslib_1.__importStar(require("../log"));
23
23
  const SessionManager_1 = tslib_1.__importDefault(require("../user/SessionManager"));
24
24
  const BASE_GRAPHQL_ERROR_MESSAGE = 'GraphQL request failed.';
25
25
  class EasCommand extends core_1.Command {
@@ -186,6 +186,11 @@ class EasCommand extends core_1.Command {
186
186
  : '';
187
187
  const defaultMsg = `${messageLine}${requestIdLine}`;
188
188
  if (graphQLError.extensions?.errorCode === 'UNAUTHORIZED_ERROR') {
189
+ if (defaultMsg.includes('ScopedAccountActorViewerContext') && process.env.EAS_BUILD) {
190
+ // We're in EAS, authenticated with a scoped account actor access token.
191
+ // We may have not added the scoped actor privacy rule to the right place yet.
192
+ return `${chalk_1.default.bold(`You don't have the required permissions to perform this operation.`)}\n\nWe are in the process of migrating EAS to a more granular permissioning system. If you believe what you're doing is a legitimate operation you should be able to perform, report this to us at ${(0, log_1.link)('https://expo.dev/contact')}\n\nOriginal error message: ${defaultMsg}`;
193
+ }
189
194
  return `${chalk_1.default.bold(`You don't have the required permissions to perform this operation.`)}\n\nThis can sometimes happen if you are logged in as incorrect user.\nRun ${chalk_1.default.bold('eas whoami')} to check the username you are logged in as.\nRun ${chalk_1.default.bold('eas login')} to change the account.\n\nOriginal error message: ${defaultMsg}`;
190
195
  }
191
196
  return defaultMsg;
@@ -10,6 +10,7 @@ export declare function fetchBuildsAsync({ graphqlClient, projectId, filters, }:
10
10
  platform?: RequestedPlatform;
11
11
  profile?: string;
12
12
  hasFingerprint?: boolean;
13
+ fingerprintHash?: string;
13
14
  };
14
15
  }): Promise<BuildFragment[]>;
15
16
  export declare function formatBuild(build: Pick<Build, 'id' | 'platform' | 'status' | 'createdAt'>): string;
@@ -31,6 +31,9 @@ async function fetchBuildsAsync({ graphqlClient, projectId, filters, }) {
31
31
  if (filters?.hasFingerprint) {
32
32
  queryFilters['hasFingerprint'] = filters.hasFingerprint;
33
33
  }
34
+ if (filters?.fingerprintHash) {
35
+ queryFilters['fingerprintHash'] = filters.fingerprintHash;
36
+ }
34
37
  if (!filters?.statuses) {
35
38
  builds = await BuildQuery_1.BuildQuery.viewBuildsOnAppAsync(graphqlClient, {
36
39
  appId: projectId,
@@ -1,6 +1,5 @@
1
1
  import ContextField, { ContextOptions } from './ContextField';
2
- type GetServerSideEnvironmentVariablesFn = (maybeEnv?: Record<string, string>) => Promise<Record<string, string>>;
2
+ export type GetServerSideEnvironmentVariablesFn = (maybeEnv?: Record<string, string>) => Promise<Record<string, string>>;
3
3
  export declare class ServerSideEnvironmentVariablesContextField extends ContextField<GetServerSideEnvironmentVariablesFn> {
4
4
  getValueAsync({ nonInteractive, sessionManager, withServerSideEnvironment, }: ContextOptions): Promise<GetServerSideEnvironmentVariablesFn>;
5
5
  }
6
- export {};
@@ -3,13 +3,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  const timeago_js_1 = require("@expo/timeago.js");
5
5
  const core_1 = require("@oclif/core");
6
+ const core_2 = require("@urql/core");
6
7
  const chalk_1 = tslib_1.__importDefault(require("chalk"));
7
8
  const node_fs_1 = tslib_1.__importDefault(require("node:fs"));
8
9
  const path = tslib_1.__importStar(require("node:path"));
10
+ const url_1 = require("../../build/utils/url");
9
11
  const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
10
12
  const flags_1 = require("../../commandUtils/flags");
11
- const log_1 = tslib_1.__importDefault(require("../../log"));
13
+ const log_1 = tslib_1.__importStar(require("../../log"));
12
14
  const ora_1 = require("../../ora");
15
+ const projectUtils_1 = require("../../project/projectUtils");
13
16
  const json_1 = require("../../utils/json");
14
17
  const progress_1 = require("../../utils/progress");
15
18
  const WorkerAssets = tslib_1.__importStar(require("../../worker/assets"));
@@ -65,7 +68,9 @@ class WorkerDeploy extends EasCommand_1.default {
65
68
  log_1.default.warn('EAS Hosting is still in preview and subject to changes.');
66
69
  const { getDynamicPrivateProjectConfigAsync, loggedIn: { graphqlClient }, projectDir, } = await this.getContextAsync(WorkerDeploy, { ...flags, withServerSideEnvironment: null });
67
70
  const projectDist = await resolveExportedProjectAsync(flags, projectDir);
68
- const { projectId } = await getDynamicPrivateProjectConfigAsync();
71
+ const { projectId, exp } = await getDynamicPrivateProjectConfigAsync();
72
+ const projectName = exp.slug;
73
+ const accountName = (await (0, projectUtils_1.getOwnerAccountForProjectIdAsync)(graphqlClient, projectId)).name;
69
74
  logExportedProjectInfo(projectDist);
70
75
  async function* emitWorkerTarballAsync(params) {
71
76
  yield ['assets.json', JSON.stringify(params.assetMap)];
@@ -212,6 +217,19 @@ class WorkerDeploy extends EasCommand_1.default {
212
217
  }
213
218
  catch (error) {
214
219
  progress.fail('Failed to create deployment');
220
+ if (flags.isProduction &&
221
+ error instanceof core_2.CombinedError &&
222
+ error.graphQLErrors.some(err => {
223
+ return (err.extensions?.errorCode === 'UNAUTHORIZED_ERROR' &&
224
+ err.message.includes('AppDevDomainNameEntity') &&
225
+ err.message.includes('CREATE'));
226
+ })) {
227
+ throw new Error(`You have specified the new deployment should be a production deployment, but a production domain has not been set up yet for this app.\n\nRun ${chalk_1.default.bold('eas deploy --prod')} as an app admin on your machine or promote an existing deployment to production on the ${(0, log_1.link)((0, url_1.getHostingDeploymentsUrl)(accountName, projectName), {
228
+ dim: false,
229
+ text: 'Hosting Dashboard',
230
+ fallback: `Hosting Dashboard (${(0, url_1.getHostingDeploymentsUrl)(accountName, projectName)})`,
231
+ })} to set up a production domain and then try again.`);
232
+ }
215
233
  throw error;
216
234
  }
217
235
  await uploadAssetsAsync(assetMap, deployResult);
@@ -1,4 +1,5 @@
1
1
  import EasCommand from '../../commandUtils/EasCommand';
2
+ import { EnvironmentVariableEnvironment } from '../../graphql/generated';
2
3
  export default class FingerprintCompare extends EasCommand {
3
4
  static description: string;
4
5
  static strict: boolean;
@@ -14,8 +15,10 @@ export default class FingerprintCompare extends EasCommand {
14
15
  'build-id': import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined>;
15
16
  'update-id': import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined>;
16
17
  open: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
18
+ environment: import("@oclif/core/lib/interfaces").OptionFlag<EnvironmentVariableEnvironment | undefined>;
17
19
  };
18
20
  static contextDefinition: {
21
+ getServerSideEnvironmentVariablesAsync: import("../../commandUtils/context/ServerSideEnvironmentVariablesContextField").ServerSideEnvironmentVariablesContextField;
19
22
  vcsClient: import("../../commandUtils/context/VcsClientContextField").default;
20
23
  loggedIn: import("../../commandUtils/context/LoggedInContextField").default;
21
24
  privateProjectConfig: import("../../commandUtils/context/PrivateProjectConfigContextField").PrivateProjectConfigContextField;
@@ -38,6 +38,7 @@ class FingerprintCompare extends EasCommand_1.default {
38
38
  '$ eas fingerprint:compare <FINGERPRINT-HASH> \t # Compare fingerprint against local directory',
39
39
  '$ eas fingerprint:compare <FINGERPRINT-HASH-1> <FINGERPRINT-HASH-2> \t # Compare provided fingerprints',
40
40
  '$ eas fingerprint:compare --build-id <BUILD-ID> \t # Compare fingerprint from build against local directory',
41
+ '$ eas fingerprint:compare --build-id <BUILD-ID> --environment production \t # Compare fingerprint from build against local directory with the "production" environment',
41
42
  '$ eas fingerprint:compare --build-id <BUILD-ID-1> --build-id <BUILD-ID-2>\t # Compare fingerprint from a build against another build',
42
43
  '$ eas fingerprint:compare --build-id <BUILD-ID> --update-id <UPDATE-ID>\t # Compare fingerprint from build against fingerprint from update',
43
44
  '$ eas fingerprint:compare <FINGERPRINT-HASH> --update-id <UPDATE-ID> \t # Compare fingerprint from update against provided fingerprint',
@@ -68,6 +69,10 @@ class FingerprintCompare extends EasCommand_1.default {
68
69
  open: core_1.Flags.boolean({
69
70
  description: 'Open the fingerprint comparison in the browser',
70
71
  }),
72
+ environment: core_1.Flags.enum({
73
+ ...flags_1.EasEnvironmentFlagParameters,
74
+ description: 'If generating a fingerprint from the local directory, use the specified environment.',
75
+ }),
71
76
  ...flags_1.EasNonInteractiveAndJsonFlags,
72
77
  };
73
78
  static contextDefinition = {
@@ -75,21 +80,22 @@ class FingerprintCompare extends EasCommand_1.default {
75
80
  ...this.ContextOptions.ProjectConfig,
76
81
  ...this.ContextOptions.LoggedIn,
77
82
  ...this.ContextOptions.Vcs,
83
+ ...this.ContextOptions.ServerSideEnvironmentVariables,
78
84
  };
79
85
  async runAsync() {
80
86
  const { args, flags } = await this.parse(FingerprintCompare);
81
87
  const { hash1, hash2 } = args;
82
- const { json, 'non-interactive': nonInteractive, 'build-id': buildIds, 'update-id': updateIds, open, } = flags;
88
+ const { json, 'non-interactive': nonInteractive, 'build-id': buildIds, 'update-id': updateIds, open, environment, } = flags;
83
89
  const [buildId1, buildId2] = buildIds ?? [];
84
90
  const [updateId1, updateId2] = updateIds ?? [];
85
- const { projectId, privateProjectConfig: { projectDir }, loggedIn: { graphqlClient }, vcsClient, } = await this.getContextAsync(FingerprintCompare, {
91
+ const { projectId, privateProjectConfig: { projectDir }, loggedIn: { graphqlClient }, vcsClient, getServerSideEnvironmentVariablesAsync, } = await this.getContextAsync(FingerprintCompare, {
86
92
  nonInteractive,
87
- withServerSideEnvironment: null,
93
+ withServerSideEnvironment: environment ?? null,
88
94
  });
89
95
  if (json) {
90
96
  (0, json_1.enableJsonOutput)();
91
97
  }
92
- const firstFingerprintInfo = await getFingerprintInfoAsync(graphqlClient, projectDir, projectId, vcsClient, {
98
+ const firstFingerprintInfo = await getFingerprintInfoAsync(graphqlClient, projectDir, projectId, vcsClient, getServerSideEnvironmentVariablesAsync, {
93
99
  nonInteractive,
94
100
  buildId: buildId1,
95
101
  updateId: updateId1,
@@ -98,12 +104,13 @@ class FingerprintCompare extends EasCommand_1.default {
98
104
  const { fingerprint: firstFingerprint, origin: firstFingerprintOrigin } = firstFingerprintInfo;
99
105
  const isFirstFingerprintSpecifiedByFlagOrArg = hash1 || buildId1 || updateId1;
100
106
  const isSecondFingerprintSpecifiedByFlagOrArg = hash2 || buildId2 || updateId2;
101
- const secondFingerprintInfo = await getFingerprintInfoAsync(graphqlClient, projectDir, projectId, vcsClient, {
107
+ const secondFingerprintInfo = await getFingerprintInfoAsync(graphqlClient, projectDir, projectId, vcsClient, getServerSideEnvironmentVariablesAsync, {
102
108
  nonInteractive,
103
109
  buildId: buildId2,
104
110
  updateId: updateId2,
105
111
  hash: hash2,
106
112
  useProjectFingerprint: isFirstFingerprintSpecifiedByFlagOrArg && !isSecondFingerprintSpecifiedByFlagOrArg,
113
+ environmentForProjectFingerprint: environment,
107
114
  }, firstFingerprintInfo);
108
115
  const { fingerprint: secondFingerprint, origin: secondFingerprintOrigin } = secondFingerprintInfo;
109
116
  if (json) {
@@ -180,7 +187,7 @@ class FingerprintCompare extends EasCommand_1.default {
180
187
  }
181
188
  }
182
189
  exports.default = FingerprintCompare;
183
- async function getFingerprintInfoAsync(graphqlClient, projectDir, projectId, vcsClient, { buildId, updateId, hash, useProjectFingerprint, nonInteractive, }, firstFingerprintInfo) {
190
+ async function getFingerprintInfoAsync(graphqlClient, projectDir, projectId, vcsClient, getServerSideEnvironmentVariablesAsync, { buildId, updateId, hash, useProjectFingerprint, environmentForProjectFingerprint, nonInteractive, }, firstFingerprintInfo) {
184
191
  if (hash) {
185
192
  return await getFingerprintInfoFromHashAsync(graphqlClient, projectId, hash);
186
193
  }
@@ -194,14 +201,30 @@ async function getFingerprintInfoAsync(graphqlClient, projectDir, projectId, vcs
194
201
  if (!firstFingerprintInfo) {
195
202
  throw new Error('First fingerprint must be provided in order to compare against the project.');
196
203
  }
197
- return await getFingerprintInfoFromLocalProjectAsync(graphqlClient, projectDir, projectId, vcsClient, firstFingerprintInfo);
204
+ return await getFingerprintInfoFromLocalProjectAsync({
205
+ graphqlClient,
206
+ projectDir,
207
+ projectId,
208
+ vcsClient,
209
+ getServerSideEnvironmentVariablesAsync,
210
+ firstFingerprintInfo,
211
+ environment: environmentForProjectFingerprint,
212
+ });
198
213
  }
199
214
  if (nonInteractive) {
200
215
  throw new Error('Insufficent arguments provided for fingerprint comparison in non-interactive mode');
201
216
  }
202
- return await getFingerprintInfoInteractiveAsync(graphqlClient, projectDir, projectId, vcsClient, firstFingerprintInfo);
217
+ return await getFingerprintInfoInteractiveAsync({
218
+ graphqlClient,
219
+ projectDir,
220
+ projectId,
221
+ vcsClient,
222
+ getServerSideEnvironmentVariablesAsync,
223
+ firstFingerprintInfo,
224
+ environmentForProjectFingerprint,
225
+ });
203
226
  }
204
- async function getFingerprintInfoInteractiveAsync(graphqlClient, projectDir, projectId, vcsClient, firstFingerprintInfo) {
227
+ async function getFingerprintInfoInteractiveAsync({ graphqlClient, projectDir, projectId, vcsClient, getServerSideEnvironmentVariablesAsync, firstFingerprintInfo, environmentForProjectFingerprint, }) {
205
228
  const prompt = firstFingerprintInfo
206
229
  ? 'Select the second fingerprint to compare against'
207
230
  : 'Select a reference fingerprint for comparison';
@@ -217,7 +240,15 @@ async function getFingerprintInfoInteractiveAsync(graphqlClient, projectDir, pro
217
240
  if (!firstFingerprintInfo) {
218
241
  throw new Error('First fingerprint must be provided in order to compare against the project.');
219
242
  }
220
- return await getFingerprintInfoFromLocalProjectAsync(graphqlClient, projectDir, projectId, vcsClient, firstFingerprintInfo);
243
+ return await getFingerprintInfoFromLocalProjectAsync({
244
+ graphqlClient,
245
+ projectDir,
246
+ projectId,
247
+ vcsClient,
248
+ getServerSideEnvironmentVariablesAsync,
249
+ firstFingerprintInfo,
250
+ environment: environmentForProjectFingerprint,
251
+ });
221
252
  }
222
253
  else if (originType === FingerprintOriginType.Build) {
223
254
  const displayName = await (0, projectUtils_1.getDisplayNameForProjectIdAsync)(graphqlClient, projectId);
@@ -268,12 +299,18 @@ async function getFingerprintInfoInteractiveAsync(graphqlClient, projectDir, pro
268
299
  throw new Error(`Unsupported fingerprint origin type: ${originType}`);
269
300
  }
270
301
  }
271
- async function getFingerprintInfoFromLocalProjectAsync(graphqlClient, projectDir, projectId, vcsClient, firstFingerprintInfo) {
302
+ async function getFingerprintInfoFromLocalProjectAsync({ graphqlClient, projectDir, projectId, vcsClient, getServerSideEnvironmentVariablesAsync, firstFingerprintInfo, environment, }) {
272
303
  const firstFingerprintPlatforms = firstFingerprintInfo.platforms;
273
- if (!firstFingerprintPlatforms) {
304
+ if (!firstFingerprintPlatforms || firstFingerprintPlatforms.length === 0) {
274
305
  throw new Error(`Cannot compare the local directory against the provided fingerprint hash "${firstFingerprintInfo.fingerprint.hash}" because the associated platform could not be determined. Ensure the fingerprint is linked to a build or update to identify the platform.`);
275
306
  }
276
- const fingerprint = await (0, utils_1.getFingerprintInfoFromLocalProjectForPlatformsAsync)(graphqlClient, projectDir, projectId, vcsClient, firstFingerprintPlatforms);
307
+ if (environment) {
308
+ log_1.default.log(`🔧 Using environment: ${environment}`);
309
+ }
310
+ const env = environment
311
+ ? { ...(await getServerSideEnvironmentVariablesAsync()), EXPO_NO_DOTENV: '1' }
312
+ : undefined;
313
+ const fingerprint = await (0, utils_1.getFingerprintInfoFromLocalProjectForPlatformsAsync)(graphqlClient, projectDir, projectId, vcsClient, firstFingerprintPlatforms, { env });
277
314
  return { fingerprint, origin: { type: FingerprintOriginType.Project } };
278
315
  }
279
316
  async function getFingerprintFromUpdateFragmentAsync(updateWithFingerprint) {
@@ -1,16 +1,19 @@
1
1
  import EasCommand from '../../commandUtils/EasCommand';
2
+ import { EnvironmentVariableEnvironment } from '../../graphql/generated';
2
3
  export default class FingerprintGenerate extends EasCommand {
3
4
  static description: string;
4
5
  static strict: boolean;
5
- static hidden: boolean;
6
6
  static examples: string[];
7
7
  static flags: {
8
8
  json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
9
9
  'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
10
- environment: import("@oclif/core/lib/interfaces").OptionFlag<import("../../graphql/generated").EnvironmentVariableEnvironment | undefined>;
10
+ environment: import("@oclif/core/lib/interfaces").OptionFlag<EnvironmentVariableEnvironment | undefined>;
11
+ 'build-profile': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
11
12
  platform: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
12
13
  };
13
14
  static contextDefinition: {
15
+ getDynamicPublicProjectConfigAsync: import("../../commandUtils/context/DynamicProjectConfigContextField").DynamicPublicProjectConfigContextField;
16
+ getDynamicPrivateProjectConfigAsync: import("../../commandUtils/context/DynamicProjectConfigContextField").DynamicPrivateProjectConfigContextField;
14
17
  getServerSideEnvironmentVariablesAsync: import("../../commandUtils/context/ServerSideEnvironmentVariablesContextField").ServerSideEnvironmentVariablesContextField;
15
18
  vcsClient: import("../../commandUtils/context/VcsClientContextField").default;
16
19
  loggedIn: import("../../commandUtils/context/LoggedInContextField").default;
@@ -1,8 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
+ const eas_json_1 = require("@expo/eas-json");
4
5
  const core_1 = require("@oclif/core");
5
6
  const api_1 = require("../../api");
7
+ const evaluateConfigWithEnvVarsAsync_1 = require("../../build/evaluateConfigWithEnvVarsAsync");
6
8
  const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
7
9
  const flags_1 = require("../../commandUtils/flags");
8
10
  const utils_1 = require("../../fingerprint/utils");
@@ -11,13 +13,14 @@ const AppQuery_1 = require("../../graphql/queries/AppQuery");
11
13
  const log_1 = tslib_1.__importStar(require("../../log"));
12
14
  const prompts_1 = require("../../prompts");
13
15
  const json_1 = require("../../utils/json");
16
+ const profiles_1 = require("../../utils/profiles");
14
17
  class FingerprintGenerate extends EasCommand_1.default {
15
18
  static description = 'generate fingerprints from the current project';
16
19
  static strict = false;
17
- static hidden = true;
18
20
  static examples = [
19
21
  '$ eas fingerprint:generate \t # Generate fingerprint in interactive mode',
20
- '$ eas fingerprint:generate --profile preview \t # Generate a fingerprint using the "preview" build profile',
22
+ '$ eas fingerprint:generate --build-profile preview \t # Generate a fingerprint using the "preview" build profile',
23
+ '$ eas fingerprint:generate --environment preview \t # Generate a fingerprint using the "preview" environment',
21
24
  '$ eas fingerprint:generate --json --non-interactive --platform android \t # Output fingerprint json to stdout',
22
25
  ];
23
26
  static flags = {
@@ -26,6 +29,15 @@ class FingerprintGenerate extends EasCommand_1.default {
26
29
  options: ['android', 'ios'],
27
30
  }),
28
31
  ...flags_1.EASEnvironmentFlag,
32
+ environment: core_1.Flags.enum({
33
+ ...flags_1.EasEnvironmentFlagParameters,
34
+ exclusive: ['build-profile'],
35
+ }),
36
+ 'build-profile': core_1.Flags.string({
37
+ char: 'e',
38
+ description: 'Name of the build profile from eas.json.',
39
+ exclusive: ['environment'],
40
+ }),
29
41
  ...flags_1.EasNonInteractiveAndJsonFlags,
30
42
  };
31
43
  static contextDefinition = {
@@ -34,11 +46,12 @@ class FingerprintGenerate extends EasCommand_1.default {
34
46
  ...this.ContextOptions.LoggedIn,
35
47
  ...this.ContextOptions.Vcs,
36
48
  ...this.ContextOptions.ServerSideEnvironmentVariables,
49
+ ...this.ContextOptions.DynamicProjectConfig,
37
50
  };
38
51
  async runAsync() {
39
52
  const { flags } = await this.parse(FingerprintGenerate);
40
- const { json, 'non-interactive': nonInteractive, platform: platformStringFlag, environment, } = flags;
41
- const { projectId, privateProjectConfig: { projectDir }, loggedIn: { graphqlClient }, vcsClient, getServerSideEnvironmentVariablesAsync, } = await this.getContextAsync(FingerprintGenerate, {
53
+ const { json, 'non-interactive': nonInteractive, platform: platformStringFlag, environment, 'build-profile': buildProfileName, } = flags;
54
+ const { projectId, privateProjectConfig: { projectDir }, loggedIn: { graphqlClient }, vcsClient, getServerSideEnvironmentVariablesAsync, getDynamicPrivateProjectConfigAsync, } = await this.getContextAsync(FingerprintGenerate, {
42
55
  nonInteractive,
43
56
  withServerSideEnvironment: environment ?? null,
44
57
  });
@@ -55,9 +68,33 @@ class FingerprintGenerate extends EasCommand_1.default {
55
68
  }
56
69
  platform = await selectRequestedPlatformAsync();
57
70
  }
58
- const env = environment
59
- ? { ...(await getServerSideEnvironmentVariablesAsync()), EXPO_NO_DOTENV: '1' }
60
- : undefined;
71
+ let env = undefined;
72
+ if (environment) {
73
+ log_1.default.log(`🔧 Using environment: ${environment}`);
74
+ env = { ...(await getServerSideEnvironmentVariablesAsync()), EXPO_NO_DOTENV: '1' };
75
+ }
76
+ else if (buildProfileName) {
77
+ log_1.default.log(`🔧 Using build profile: ${buildProfileName}`);
78
+ const easJsonAccessor = eas_json_1.EasJsonAccessor.fromProjectPath(projectDir);
79
+ const buildProfile = (await (0, profiles_1.getProfilesAsync)({
80
+ type: 'build',
81
+ easJsonAccessor,
82
+ platforms: [(0, utils_1.appPlatformToPlatform)(platform)],
83
+ profileName: buildProfileName ?? undefined,
84
+ projectDir,
85
+ }))[0];
86
+ if (!buildProfile) {
87
+ throw new Error(`Build profile ${buildProfile} not found for platform: ${platform}`);
88
+ }
89
+ const configResult = await (0, evaluateConfigWithEnvVarsAsync_1.evaluateConfigWithEnvVarsAsync)({
90
+ buildProfile: buildProfile.profile,
91
+ buildProfileName: buildProfile.profileName,
92
+ graphqlClient,
93
+ getProjectConfig: getDynamicPrivateProjectConfigAsync,
94
+ opts: { env: buildProfile.profile.env },
95
+ });
96
+ env = configResult.env;
97
+ }
61
98
  const fingerprint = await (0, utils_1.getFingerprintInfoFromLocalProjectForPlatformsAsync)(graphqlClient, projectDir, projectId, vcsClient, [platform], { env });
62
99
  if (json) {
63
100
  (0, json_1.printJsonOnlyOutput)(fingerprint);
@@ -6,21 +6,26 @@ const graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag"));
6
6
  const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
7
7
  const flags_1 = require("../../commandUtils/flags");
8
8
  const client_1 = require("../../graphql/client");
9
+ const BackgroundJobReceipt_1 = require("../../graphql/types/BackgroundJobReceipt");
9
10
  const log_1 = tslib_1.__importDefault(require("../../log"));
10
11
  const prompts_1 = require("../../prompts");
11
12
  const json_1 = require("../../utils/json");
12
- async function deleteUpdateGroupAsync(graphqlClient, { group, }) {
13
- return await (0, client_1.withErrorHandlingAsync)(graphqlClient
13
+ const pollForBackgroundJobReceiptAsync_1 = require("../../utils/pollForBackgroundJobReceiptAsync");
14
+ async function scheduleUpdateGroupDeletionAsync(graphqlClient, { group, }) {
15
+ const result = await (0, client_1.withErrorHandlingAsync)(graphqlClient
14
16
  .mutation((0, graphql_tag_1.default) `
15
- mutation DeleteUpdateGroup($group: ID!) {
17
+ mutation ScheduleUpdateGroupDeletion($group: ID!) {
16
18
  update {
17
- deleteUpdateGroup(group: $group) {
18
- group
19
+ scheduleUpdateGroupDeletion(group: $group) {
20
+ id
21
+ ...BackgroundJobReceiptData
19
22
  }
20
23
  }
21
24
  }
25
+ ${BackgroundJobReceipt_1.BackgroundJobReceiptNode}
22
26
  `, { group })
23
27
  .toPromise());
28
+ return result.update.scheduleUpdateGroupDeletion;
24
29
  }
25
30
  class UpdateDelete extends EasCommand_1.default {
26
31
  static description = 'delete all the updates in an update group';
@@ -56,7 +61,9 @@ class UpdateDelete extends EasCommand_1.default {
56
61
  return;
57
62
  }
58
63
  }
59
- await deleteUpdateGroupAsync(graphqlClient, { group });
64
+ const receipt = await scheduleUpdateGroupDeletionAsync(graphqlClient, { group });
65
+ const successfulReceipt = await (0, pollForBackgroundJobReceiptAsync_1.pollForBackgroundJobReceiptAsync)(graphqlClient, receipt);
66
+ log_1.default.debug('Deletion result', { successfulReceipt });
60
67
  if (jsonFlag) {
61
68
  (0, json_1.printJsonOnlyOutput)({ group });
62
69
  }
@@ -27,5 +27,6 @@ export default class UpdatePublish extends EasCommand {
27
27
  getDynamicPrivateProjectConfigAsync: import("../../commandUtils/context/DynamicProjectConfigContextField").DynamicPrivateProjectConfigContextField;
28
28
  };
29
29
  runAsync(): Promise<void>;
30
+ private prettyPlatform;
30
31
  private sanitizeFlags;
31
32
  }