eas-cli 0.38.2 → 0.41.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 (57) hide show
  1. package/README.md +64 -31
  2. package/build/build/build.js +3 -3
  3. package/build/build/context.d.ts +2 -1
  4. package/build/build/createContext.d.ts +3 -2
  5. package/build/build/createContext.js +3 -3
  6. package/build/build/local.d.ts +9 -1
  7. package/build/build/local.js +35 -5
  8. package/build/build/metadata.js +14 -0
  9. package/build/build/runBuildAndSubmit.d.ts +15 -0
  10. package/build/build/runBuildAndSubmit.js +173 -0
  11. package/build/commands/branch/list.js +1 -1
  12. package/build/commands/branch/publish.d.ts +1 -18
  13. package/build/commands/branch/publish.js +2 -358
  14. package/build/commands/build/configure.js +1 -1
  15. package/build/commands/build/index.d.ts +0 -5
  16. package/build/commands/build/index.js +8 -159
  17. package/build/commands/build/inspect.d.ts +22 -0
  18. package/build/commands/build/inspect.js +129 -0
  19. package/build/commands/channel/edit.js +1 -1
  20. package/build/commands/channel/view.js +3 -3
  21. package/build/commands/credentials.js +1 -7
  22. package/build/commands/diagnostics.d.ts +1 -0
  23. package/build/commands/diagnostics.js +19 -1
  24. package/build/commands/submit.js +1 -1
  25. package/build/commands/update/configure.d.ts +8 -0
  26. package/build/commands/update/configure.js +81 -0
  27. package/build/commands/update/index.d.ts +20 -0
  28. package/build/commands/update/index.js +384 -0
  29. package/build/credentials/context.d.ts +5 -0
  30. package/build/credentials/context.js +12 -7
  31. package/build/credentials/ios/actions/AscApiKeyUtils.js +1 -1
  32. package/build/credentials/ios/appstore/ensureAppExists.js +3 -3
  33. package/build/credentials/manager/ManageAndroid.d.ts +3 -3
  34. package/build/credentials/manager/ManageAndroid.js +21 -13
  35. package/build/credentials/manager/ManageIos.d.ts +3 -3
  36. package/build/credentials/manager/ManageIos.js +23 -13
  37. package/build/credentials/manager/SelectBuildProfileFromEasJson.d.ts +2 -3
  38. package/build/credentials/manager/SelectBuildProfileFromEasJson.js +3 -6
  39. package/build/credentials/manager/SelectPlatform.d.ts +1 -2
  40. package/build/credentials/manager/SelectPlatform.js +3 -3
  41. package/build/graphql/generated.d.ts +31 -11
  42. package/build/graphql/generated.js +6 -1
  43. package/build/graphql/types/Submission.js +1 -0
  44. package/build/project/expoSdk.d.ts +3 -0
  45. package/build/project/expoSdk.js +30 -0
  46. package/build/project/ios/target.js +32 -7
  47. package/build/prompts.d.ts +3 -3
  48. package/build/submit/context.js +0 -1
  49. package/build/submit/ios/AppProduce.js +3 -3
  50. package/build/submit/ios/IosSubmitCommand.js +1 -1
  51. package/build/submit/utils/urls.js +1 -1
  52. package/build/submit/utils/wait.js +1 -1
  53. package/build/update/utils.js +5 -5
  54. package/build/utils/profiles.d.ts +1 -1
  55. package/build/utils/profiles.js +80 -30
  56. package/oclif.manifest.json +1 -1
  57. package/package.json +10 -9
@@ -10,13 +10,13 @@ class SelectBuildProfileFromEasJson {
10
10
  this.platform = platform;
11
11
  this.easJsonReader = new eas_json_1.EasJsonReader(projectDir);
12
12
  }
13
- async runAsync(ctx) {
14
- const profileName = await this.getProfileNameFromEasConfigAsync(ctx);
13
+ async runAsync() {
14
+ const profileName = await this.getProfileNameFromEasConfigAsync();
15
15
  const easConfig = await this.easJsonReader.getBuildProfileAsync(this.platform, profileName);
16
16
  log_1.default.succeed(`Using build profile: ${profileName}`);
17
17
  return easConfig;
18
18
  }
19
- async getProfileNameFromEasConfigAsync(ctx) {
19
+ async getProfileNameFromEasConfigAsync() {
20
20
  const buildProfileNames = await this.easJsonReader.getBuildProfileNamesAsync();
21
21
  if (buildProfileNames.length === 0) {
22
22
  throw new Error('You need at least one iOS build profile declared in eas.json. Go to https://docs.expo.dev/build/eas-json/ for more details');
@@ -24,9 +24,6 @@ class SelectBuildProfileFromEasJson {
24
24
  else if (buildProfileNames.length === 1) {
25
25
  return buildProfileNames[0];
26
26
  }
27
- if (ctx.nonInteractive) {
28
- throw new Error('You have multiple build profiles. Please run this command in interactive mode.');
29
- }
30
27
  const { profileName } = await (0, prompts_1.promptAsync)({
31
28
  type: 'select',
32
29
  name: 'profileName',
@@ -1,4 +1,3 @@
1
- import { CredentialsContext } from '../context';
2
1
  export declare class SelectPlatform {
3
- runAsync(ctx: CredentialsContext): Promise<void>;
2
+ runAsync(): Promise<void>;
4
3
  }
@@ -5,7 +5,7 @@ const prompts_1 = require("../../prompts");
5
5
  const ManageAndroid_1 = require("./ManageAndroid");
6
6
  const ManageIos_1 = require("./ManageIos");
7
7
  class SelectPlatform {
8
- async runAsync(ctx) {
8
+ async runAsync() {
9
9
  const { platform } = await (0, prompts_1.promptAsync)({
10
10
  type: 'select',
11
11
  name: 'platform',
@@ -16,9 +16,9 @@ class SelectPlatform {
16
16
  ],
17
17
  });
18
18
  if (platform === 'ios') {
19
- return await new ManageIos_1.ManageIos(new SelectPlatform()).runAsync(ctx);
19
+ return await new ManageIos_1.ManageIos(new SelectPlatform(), process.cwd()).runAsync();
20
20
  }
21
- return await new ManageAndroid_1.ManageAndroid(new SelectPlatform()).runAsync(ctx);
21
+ return await new ManageAndroid_1.ManageAndroid(new SelectPlatform(), process.cwd()).runAsync();
22
22
  }
23
23
  }
24
24
  exports.SelectPlatform = SelectPlatform;
@@ -632,6 +632,7 @@ export declare type Build = ActivityTimelineProjectActivity & BuildOrBuildJob &
632
632
  appBuildVersion?: Maybe<Scalars['String']>;
633
633
  sdkVersion?: Maybe<Scalars['String']>;
634
634
  runtimeVersion?: Maybe<Scalars['String']>;
635
+ reactNativeVersion?: Maybe<Scalars['String']>;
635
636
  releaseChannel?: Maybe<Scalars['String']>;
636
637
  channel?: Maybe<Scalars['String']>;
637
638
  metrics?: Maybe<BuildMetrics>;
@@ -1535,6 +1536,7 @@ export declare type InvoiceQuery = {
1535
1536
  export declare type InvoiceQueryPreviewInvoiceForSubscriptionUpdateArgs = {
1536
1537
  accountId: Scalars['String'];
1537
1538
  newPlanIdentifier: Scalars['String'];
1539
+ couponCode?: Maybe<Scalars['String']>;
1538
1540
  };
1539
1541
  export declare type Invoice = {
1540
1542
  __typename?: 'Invoice';
@@ -1545,12 +1547,28 @@ export declare type Invoice = {
1545
1547
  amountPaid: Scalars['Int'];
1546
1548
  /** The total amount that needs to be paid, considering any discounts or account credit. Value is in cents. */
1547
1549
  amountRemaining: Scalars['Int'];
1550
+ discount?: Maybe<InvoiceDiscount>;
1551
+ totalDiscountedAmount: Scalars['Int'];
1548
1552
  lineItems: Array<InvoiceLineItem>;
1549
1553
  period: InvoicePeriod;
1550
1554
  startingBalance: Scalars['Int'];
1551
1555
  subtotal: Scalars['Int'];
1552
1556
  total: Scalars['Int'];
1553
1557
  };
1558
+ export declare type InvoiceDiscount = {
1559
+ __typename?: 'InvoiceDiscount';
1560
+ id: Scalars['ID'];
1561
+ name: Scalars['String'];
1562
+ type: InvoiceDiscountType;
1563
+ duration: Scalars['String'];
1564
+ durationInMonths?: Maybe<Scalars['Int']>;
1565
+ /** The coupon's discount value, in percentage or in dollar amount */
1566
+ amount: Scalars['Int'];
1567
+ };
1568
+ export declare enum InvoiceDiscountType {
1569
+ Percentage = "PERCENTAGE",
1570
+ Amount = "AMOUNT"
1571
+ }
1554
1572
  export declare type InvoiceLineItem = {
1555
1573
  __typename?: 'InvoiceLineItem';
1556
1574
  id: Scalars['ID'];
@@ -1818,6 +1836,7 @@ export declare type AccountMutationCancelSubscriptionArgs = {
1818
1836
  export declare type AccountMutationChangePlanArgs = {
1819
1837
  accountID: Scalars['ID'];
1820
1838
  newPlanIdentifier: Scalars['String'];
1839
+ couponCode?: Maybe<Scalars['String']>;
1821
1840
  };
1822
1841
  export declare type AccountMutationCancelScheduledSubscriptionChangeArgs = {
1823
1842
  accountID: Scalars['ID'];
@@ -2307,6 +2326,7 @@ export declare type BuildMetadataInput = {
2307
2326
  credentialsSource?: Maybe<BuildCredentialsSource>;
2308
2327
  sdkVersion?: Maybe<Scalars['String']>;
2309
2328
  runtimeVersion?: Maybe<Scalars['String']>;
2329
+ reactNativeVersion?: Maybe<Scalars['String']>;
2310
2330
  releaseChannel?: Maybe<Scalars['String']>;
2311
2331
  channel?: Maybe<Scalars['String']>;
2312
2332
  distribution?: Maybe<DistributionType>;
@@ -3060,16 +3080,6 @@ export declare type BranchesByAppQuery = ({
3060
3080
  });
3061
3081
  });
3062
3082
  });
3063
- export declare type GetUpdateGroupAsyncQueryVariables = Exact<{
3064
- group: Scalars['ID'];
3065
- }>;
3066
- export declare type GetUpdateGroupAsyncQuery = ({
3067
- __typename?: 'RootQuery';
3068
- } & {
3069
- updatesByGroup: Array<({
3070
- __typename?: 'Update';
3071
- } & Pick<Update, 'id' | 'group' | 'runtimeVersion' | 'manifestFragment' | 'platform' | 'message'>)>;
3072
- });
3073
3083
  export declare type EditUpdateBranchMutationVariables = Exact<{
3074
3084
  input: EditUpdateBranchInput;
3075
3085
  }>;
@@ -3277,6 +3287,16 @@ export declare type DeleteUpdateGroupMutation = ({
3277
3287
  } & Pick<DeleteUpdateGroupResult, 'group'>);
3278
3288
  });
3279
3289
  });
3290
+ export declare type GetUpdateGroupAsyncQueryVariables = Exact<{
3291
+ group: Scalars['ID'];
3292
+ }>;
3293
+ export declare type GetUpdateGroupAsyncQuery = ({
3294
+ __typename?: 'RootQuery';
3295
+ } & {
3296
+ updatesByGroup: Array<({
3297
+ __typename?: 'Update';
3298
+ } & Pick<Update, 'id' | 'group' | 'runtimeVersion' | 'manifestFragment' | 'platform' | 'message'>)>;
3299
+ });
3280
3300
  export declare type UpdatesByGroupQueryVariables = Exact<{
3281
3301
  groupId: Scalars['ID'];
3282
3302
  }>;
@@ -4585,7 +4605,7 @@ export declare type SubmissionFragment = ({
4585
4605
  } & Pick<Submission, 'id' | 'status' | 'platform' | 'logsUrl'> & {
4586
4606
  app: ({
4587
4607
  __typename?: 'App';
4588
- } & Pick<App, 'id' | 'name'> & {
4608
+ } & Pick<App, 'id' | 'name' | 'slug'> & {
4589
4609
  ownerAccount: ({
4590
4610
  __typename?: 'Account';
4591
4611
  } & Pick<Account, 'id' | 'name'>);
@@ -6,7 +6,7 @@
6
6
  * For more info and docs, visit https://graphql-code-generator.com/
7
7
  */
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.CacheControlScope = exports.IosManagedBuildType = exports.IosSchemeBuildConfiguration = exports.StandardOffer = exports.MailchimpAudience = exports.MailchimpTag = exports.UploadSessionType = exports.IosBuildType = exports.EasBuildDeprecationInfoType = exports.BuildCredentialsSource = exports.AndroidBuildType = exports.ProjectArchiveSourceType = exports.BuildWorkflow = exports.Order = exports.AssetMetadataStatus = exports.AppSort = exports.AppsFilter = exports.WebhookType = exports.AndroidKeystoreType = exports.AndroidFcmVersion = exports.AppStoreConnectUserRole = exports.IosDistributionType = exports.AppleDeviceClass = exports.BuildJobStatus = exports.BuildJobLogsFormat = exports.SubmissionAndroidReleaseStatus = exports.SubmissionAndroidTrack = exports.SubmissionAndroidArchiveType = exports.SubmissionStatus = exports.BuildIosEnterpriseProvisioning = exports.ActivityTimelineProjectActivityType = exports.Role = exports.Permission = exports.SecondFactorMethod = exports.DistributionType = exports.BuildStatus = exports.AppPlatform = exports.AppPrivacy = exports.Feature = exports.OfferType = void 0;
9
+ exports.CacheControlScope = exports.IosManagedBuildType = exports.IosSchemeBuildConfiguration = exports.StandardOffer = exports.MailchimpAudience = exports.MailchimpTag = exports.UploadSessionType = exports.IosBuildType = exports.EasBuildDeprecationInfoType = exports.BuildCredentialsSource = exports.AndroidBuildType = exports.ProjectArchiveSourceType = exports.BuildWorkflow = exports.InvoiceDiscountType = exports.Order = exports.AssetMetadataStatus = exports.AppSort = exports.AppsFilter = exports.WebhookType = exports.AndroidKeystoreType = exports.AndroidFcmVersion = exports.AppStoreConnectUserRole = exports.IosDistributionType = exports.AppleDeviceClass = exports.BuildJobStatus = exports.BuildJobLogsFormat = exports.SubmissionAndroidReleaseStatus = exports.SubmissionAndroidTrack = exports.SubmissionAndroidArchiveType = exports.SubmissionStatus = exports.BuildIosEnterpriseProvisioning = exports.ActivityTimelineProjectActivityType = exports.Role = exports.Permission = exports.SecondFactorMethod = exports.DistributionType = exports.BuildStatus = exports.AppPlatform = exports.AppPrivacy = exports.Feature = exports.OfferType = void 0;
10
10
  var OfferType;
11
11
  (function (OfferType) {
12
12
  /** Term subscription */
@@ -202,6 +202,11 @@ var Order;
202
202
  Order["Desc"] = "DESC";
203
203
  Order["Asc"] = "ASC";
204
204
  })(Order = exports.Order || (exports.Order = {}));
205
+ var InvoiceDiscountType;
206
+ (function (InvoiceDiscountType) {
207
+ InvoiceDiscountType["Percentage"] = "PERCENTAGE";
208
+ InvoiceDiscountType["Amount"] = "AMOUNT";
209
+ })(InvoiceDiscountType = exports.InvoiceDiscountType || (exports.InvoiceDiscountType = {}));
205
210
  var BuildWorkflow;
206
211
  (function (BuildWorkflow) {
207
212
  BuildWorkflow["Generic"] = "GENERIC";
@@ -11,6 +11,7 @@ exports.SubmissionFragmentNode = (0, graphql_tag_1.default) `
11
11
  app {
12
12
  id
13
13
  name
14
+ slug
14
15
  ownerAccount {
15
16
  id
16
17
  name
@@ -0,0 +1,3 @@
1
+ import { Platform } from '@expo/eas-build-job';
2
+ import { BuildContext } from '../build/context';
3
+ export declare function checkExpoSdkIsSupportedAsync(ctx: BuildContext<Platform>): Promise<void>;
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.checkExpoSdkIsSupportedAsync = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const eas_build_job_1 = require("@expo/eas-build-job");
6
+ const errors_1 = require("@oclif/errors");
7
+ const assert_1 = (0, tslib_1.__importDefault)(require("assert"));
8
+ const semver_1 = (0, tslib_1.__importDefault)(require("semver"));
9
+ const log_1 = (0, tslib_1.__importDefault)(require("../log"));
10
+ const prompts_1 = require("../prompts");
11
+ const SUPPORTED_EXPO_SDK_VERSIONS = '>= 41.0.0';
12
+ (0, assert_1.default)(semver_1.default.validRange(SUPPORTED_EXPO_SDK_VERSIONS), 'Must be a valid version range');
13
+ async function checkExpoSdkIsSupportedAsync(ctx) {
14
+ (0, assert_1.default)(ctx.workflow === eas_build_job_1.Workflow.MANAGED, 'Must be a managed workflow project');
15
+ if (ctx.exp.sdkVersion && semver_1.default.satisfies(ctx.exp.sdkVersion, SUPPORTED_EXPO_SDK_VERSIONS)) {
16
+ return;
17
+ }
18
+ const unsupportedSdkMessage = 'EAS Build does not officially support building managed project with Expo SDK < 41.';
19
+ if (ctx.nonInteractive) {
20
+ log_1.default.warn(`${unsupportedSdkMessage} Proceeding because you are running in non-interactive mode.`);
21
+ return;
22
+ }
23
+ const proceed = await (0, prompts_1.confirmAsync)({
24
+ message: `${unsupportedSdkMessage} Do you want to proceed?`,
25
+ });
26
+ if (!proceed) {
27
+ (0, errors_1.exit)(1);
28
+ }
29
+ }
30
+ exports.checkExpoSdkIsSupportedAsync = checkExpoSdkIsSupportedAsync;
@@ -17,22 +17,47 @@ async function resolveTargetsAsync({ exp, projectDir }, { buildConfiguration, bu
17
17
  bundleIdentifier,
18
18
  buildConfiguration,
19
19
  });
20
- if (applicationTarget.dependencies && applicationTarget.dependencies.length > 0) {
21
- for (const dependency of applicationTarget.dependencies) {
20
+ const dependencies = await resolveDependenciesAsync({
21
+ exp,
22
+ projectDir,
23
+ buildConfiguration,
24
+ target: applicationTarget,
25
+ bundleIdentifier,
26
+ });
27
+ if (dependencies.length > 0) {
28
+ result.push(...dependencies);
29
+ }
30
+ return result;
31
+ }
32
+ exports.resolveTargetsAsync = resolveTargetsAsync;
33
+ async function resolveDependenciesAsync({ exp, projectDir, buildConfiguration, target, bundleIdentifier, }) {
34
+ const result = [];
35
+ if (target.dependencies && target.dependencies.length > 0) {
36
+ for (const dependency of target.dependencies) {
37
+ const dependencyBundleIdentifier = await (0, bundleIdentifier_1.getBundleIdentifierAsync)(projectDir, exp, {
38
+ targetName: dependency.name,
39
+ buildConfiguration,
40
+ });
22
41
  result.push({
23
42
  targetName: dependency.name,
24
43
  buildConfiguration,
25
- bundleIdentifier: await (0, bundleIdentifier_1.getBundleIdentifierAsync)(projectDir, exp, {
26
- targetName: dependency.name,
27
- buildConfiguration,
28
- }),
44
+ bundleIdentifier: dependencyBundleIdentifier,
29
45
  parentBundleIdentifier: bundleIdentifier,
30
46
  });
47
+ const dependencyDependencies = await resolveDependenciesAsync({
48
+ exp,
49
+ projectDir,
50
+ buildConfiguration,
51
+ target: dependency,
52
+ bundleIdentifier: dependencyBundleIdentifier,
53
+ });
54
+ if (dependencyDependencies.length > 0) {
55
+ result.push(...dependencyDependencies);
56
+ }
31
57
  }
32
58
  }
33
59
  return result;
34
60
  }
35
- exports.resolveTargetsAsync = resolveTargetsAsync;
36
61
  async function readApplicationTargetForSchemeAsync(projectDir, scheme) {
37
62
  const workflow = await (0, workflow_1.resolveWorkflowAsync)(projectDir, eas_build_job_1.Platform.IOS);
38
63
  if (workflow === eas_build_job_1.Workflow.GENERIC) {
@@ -1,11 +1,11 @@
1
1
  import { Answers, Choice, Options, PromptType, PromptObject as Question } from 'prompts';
2
2
  export { PromptType, Question, Choice };
3
+ export interface ExpoChoice<T> extends Choice {
4
+ value: T;
5
+ }
3
6
  declare type NamelessQuestion = Omit<Question<'value'>, 'name' | 'type'>;
4
7
  export declare function promptAsync<T extends string = string>(questions: Question<T> | Question<T>[], options?: Options): Promise<Answers<T>>;
5
8
  export declare function confirmAsync(question: NamelessQuestion, options?: Options): Promise<boolean>;
6
- interface ExpoChoice<T> extends Choice {
7
- value: T;
8
- }
9
9
  export declare function selectAsync<T>(message: string, choices: ExpoChoice<T>[], options?: Options): Promise<T>;
10
10
  /**
11
11
  * Create a more dynamic yes/no confirmation that can be cancelled.
@@ -25,7 +25,6 @@ async function createSubmissionContextAsync(params) {
25
25
  tracking_id: (0, uuid_1.v4)(),
26
26
  platform: params.platform,
27
27
  ...(accountId && { account_id: accountId }),
28
- account_name: accountName,
29
28
  project_id: params.projectId,
30
29
  };
31
30
  events_1.Analytics.logEvent(events_1.SubmissionEvent.SUBMIT_COMMAND, trackingCtx);
@@ -11,13 +11,13 @@ const bundleIdentifier_1 = require("../../project/ios/bundleIdentifier");
11
11
  const prompts_1 = require("../../prompts");
12
12
  const language_1 = require("./utils/language");
13
13
  async function ensureAppStoreConnectAppExistsAsync(ctx) {
14
- var _a;
14
+ var _a, _b, _c;
15
15
  const { exp } = ctx;
16
16
  const { appName, language } = ctx.profile;
17
17
  const options = {
18
18
  ...ctx.profile,
19
- bundleIdentifier: await (0, bundleIdentifier_1.getBundleIdentifierAsync)(ctx.projectDir, exp),
20
- appName: (_a = appName !== null && appName !== void 0 ? appName : exp.name) !== null && _a !== void 0 ? _a : (await promptForAppNameAsync()),
19
+ bundleIdentifier: (_b = (_a = ctx.applicationIdentifierOverride) !== null && _a !== void 0 ? _a : ctx.profile.bundleIdentifier) !== null && _b !== void 0 ? _b : (await (0, bundleIdentifier_1.getBundleIdentifierAsync)(ctx.projectDir, exp)),
20
+ appName: (_c = appName !== null && appName !== void 0 ? appName : exp.name) !== null && _c !== void 0 ? _c : (await promptForAppNameAsync()),
21
21
  language: (0, language_1.sanitizeLanguage)(language),
22
22
  };
23
23
  return await createAppStoreConnectAppAsync(ctx, options);
@@ -159,7 +159,7 @@ class IosSubmitCommand {
159
159
  return (0, results_1.result)(ascAppId);
160
160
  }
161
161
  else if (this.ctx.nonInteractive) {
162
- return (0, results_1.result)(new Error('Set ascAppId in the submit profile (eas.json).'));
162
+ return (0, results_1.result)(new Error('Set ascAppId in the submit profile (eas.json) or re-run this command in interactive mode.'));
163
163
  }
164
164
  else {
165
165
  log_1.default.log((0, wrap_ansi_1.default)(`Ensuring your app exists on App Store Connect. This step can be skipped by providing ${chalk_1.default.bold(`ascAppId`)} in the submit profile. ${(0, log_1.learnMore)('https://expo.fyi/asc-app-id')}`, process.stdout.columns || 80));
@@ -21,6 +21,6 @@ function printSubmissionDetailsUrls(submissions) {
21
21
  exports.printSubmissionDetailsUrls = printSubmissionDetailsUrls;
22
22
  function getSubmissionDetailsUrl(submission) {
23
23
  const { id, app } = submission;
24
- return new url_1.URL(`/accounts/${app.ownerAccount.name}/projects/${app.name}/submissions/${id}`, (0, api_1.getExpoWebsiteBaseUrl)()).toString();
24
+ return new url_1.URL(`/accounts/${app.ownerAccount.name}/projects/${app.slug}/submissions/${id}`, (0, api_1.getExpoWebsiteBaseUrl)()).toString();
25
25
  }
26
26
  exports.getSubmissionDetailsUrl = getSubmissionDetailsUrl;
@@ -10,7 +10,7 @@ const ora_1 = require("../../ora");
10
10
  const promise_1 = require("../../utils/promise");
11
11
  const APP_STORE_NAMES = {
12
12
  [generated_1.AppPlatform.Android]: 'Google Play Store',
13
- [generated_1.AppPlatform.Ios]: 'Apple App Store',
13
+ [generated_1.AppPlatform.Ios]: 'Apple App Store Connect',
14
14
  };
15
15
  const CHECK_TIMEOUT_MS = 3600000;
16
16
  const CHECK_INTERVAL_MS = 5000;
@@ -6,10 +6,10 @@ const timeago_js_1 = require("@expo/timeago.js");
6
6
  const User_1 = require("../user/User");
7
7
  const groupBy_1 = (0, tslib_1.__importDefault)(require("../utils/expodash/groupBy"));
8
8
  exports.UPDATE_COLUMNS = [
9
- 'update description',
10
- 'update runtime version',
11
- 'update group ID',
12
- 'platforms',
9
+ 'Update message',
10
+ 'Update runtime version',
11
+ 'Update group ID',
12
+ 'Update platforms',
13
13
  ];
14
14
  function getPlatformsForGroup({ group, updates, }) {
15
15
  const groupedUpdates = (0, groupBy_1.default)(updates, update => update.group);
@@ -19,7 +19,7 @@ function getPlatformsForGroup({ group, updates, }) {
19
19
  return groupedUpdates[group]
20
20
  .map(update => update.platform)
21
21
  .sort()
22
- .join(',');
22
+ .join(', ');
23
23
  }
24
24
  exports.getPlatformsForGroup = getPlatformsForGroup;
25
25
  function formatUpdate(update) {
@@ -6,7 +6,7 @@ export declare type ProfileData<T extends ProfileType> = {
6
6
  platform: Platform;
7
7
  profileName: string;
8
8
  };
9
- export declare function getProfilesAsync<T extends ProfileType>({ projectDir, platforms, profileName: profileNameArg, type, }: {
9
+ export declare function getProfilesAsync<T extends ProfileType>({ projectDir, platforms, profileName, type, }: {
10
10
  projectDir: string;
11
11
  platforms: Platform[];
12
12
  profileName?: string;
@@ -3,44 +3,85 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getProfilesAsync = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const eas_json_1 = require("@expo/eas-json");
6
+ const chalk_1 = (0, tslib_1.__importDefault)(require("chalk"));
6
7
  const log_1 = (0, tslib_1.__importDefault)(require("../log"));
7
- async function getProfilesAsync({ projectDir, platforms, profileName: profileNameArg, type, }) {
8
+ const prompts_1 = require("../prompts");
9
+ async function getProfilesAsync({ projectDir, platforms, profileName, type, }) {
8
10
  const results = platforms.map(async function (platform) {
9
- let profile;
10
- let profileName = profileNameArg;
11
- if (!profileName) {
12
- try {
13
- profileName = 'production';
14
- profile = await readProfileAsync({ projectDir, platform, type, profileName });
11
+ if (profileName) {
12
+ const profile = await readProfileAsync({ projectDir, platform, type, profileName });
13
+ return {
14
+ profile,
15
+ profileName,
16
+ platform,
17
+ };
18
+ }
19
+ try {
20
+ const profile = await readProfileAsync({
21
+ projectDir,
22
+ platform,
23
+ type,
24
+ profileName: 'production',
25
+ });
26
+ return {
27
+ profile,
28
+ profileName: 'production',
29
+ platform,
30
+ };
31
+ }
32
+ catch (error) {
33
+ if (!(error instanceof eas_json_1.errors.MissingProfileError)) {
34
+ throw error;
15
35
  }
16
- catch (errorOuter) {
17
- if (!(errorOuter instanceof eas_json_1.errors.MissingProfileError)) {
18
- throw errorOuter;
19
- }
20
- try {
21
- profileName = 'release';
22
- profile = await readProfileAsync({ projectDir, platform, type, profileName });
23
- log_1.default.warn('The default profile changed from "release" to "production". We detected that you still have a "release" build profile, so we are using it. Update eas.json to have a profile named "production" under the `build` key, or specify which profile you\'d like to use with the --profile flag. This fallback behavior will be removed in the next major version of EAS CLI.');
24
- }
25
- catch (errorInner) {
26
- if (!(errorInner instanceof eas_json_1.errors.MissingProfileError)) {
27
- throw errorInner;
28
- }
29
- const defaultProfile = getDefaultProfile({ platform, type });
30
- if (!defaultProfile) {
31
- throw errorInner;
32
- }
33
- profileName = '__default__';
34
- profile = defaultProfile;
35
- }
36
+ }
37
+ try {
38
+ const profile = await readProfileAsync({
39
+ projectDir,
40
+ platform,
41
+ type,
42
+ profileName: 'release',
43
+ });
44
+ log_1.default.warn(`The default profile changed from ${chalk_1.default.bold('release')} to ${chalk_1.default.bold('production')}. We detected that you still have a ${chalk_1.default.bold('release')} build profile, so we are using it. Update eas.json to have a profile named ${chalk_1.default.bold('production')} under the ${chalk_1.default.bold('build')} key, or specify which profile you'd like to use with the ${chalk_1.default.bold('--profile')} flag. This fallback behavior will be removed in the next major version of EAS CLI.`);
45
+ return {
46
+ profile,
47
+ profileName: 'release',
48
+ platform,
49
+ };
50
+ }
51
+ catch (error) {
52
+ if (!(error instanceof eas_json_1.errors.MissingProfileError)) {
53
+ throw error;
36
54
  }
37
55
  }
38
- else {
39
- profile = await readProfileAsync({ projectDir, platform, type, profileName });
56
+ const defaultProfile = getDefaultProfile({ platform, type });
57
+ if (defaultProfile) {
58
+ return {
59
+ profile: defaultProfile,
60
+ profileName: '__default__',
61
+ platform,
62
+ };
63
+ }
64
+ const profileNames = await readProfileNamesAsync({
65
+ projectDir,
66
+ type,
67
+ });
68
+ if (profileNames.length === 0) {
69
+ throw new eas_json_1.errors.MissingProfileError(`Missing profile in eas.json: ${profileName !== null && profileName !== void 0 ? profileName : 'production'}`);
40
70
  }
71
+ const choices = profileNames.map(profileName => ({
72
+ title: profileName,
73
+ value: profileName,
74
+ }));
75
+ const chosenProfileName = await (0, prompts_1.selectAsync)('The "production" profile is missing in eas.json. Pick another profile:', choices);
76
+ const profile = await readProfileAsync({
77
+ projectDir,
78
+ platform,
79
+ type,
80
+ profileName: chosenProfileName,
81
+ });
41
82
  return {
42
83
  profile,
43
- profileName,
84
+ profileName: chosenProfileName,
44
85
  platform,
45
86
  };
46
87
  });
@@ -64,3 +105,12 @@ function getDefaultProfile({ platform, type, }) {
64
105
  return (0, eas_json_1.getDefaultSubmitProfile)(platform);
65
106
  }
66
107
  }
108
+ async function readProfileNamesAsync({ projectDir, type, }) {
109
+ const easJsonReader = new eas_json_1.EasJsonReader(projectDir);
110
+ if (type === 'build') {
111
+ return await easJsonReader.getBuildProfileNamesAsync();
112
+ }
113
+ else {
114
+ return await easJsonReader.getSubmitProfileNamesAsync();
115
+ }
116
+ }