eas-cli 0.56.0 → 0.59.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 (93) hide show
  1. package/README.md +98 -49
  2. package/build/branch/queries.d.ts +5 -0
  3. package/build/branch/queries.js +87 -0
  4. package/build/build/android/build.js +17 -3
  5. package/build/build/android/graphql.js +2 -0
  6. package/build/build/android/prepareJob.js +5 -0
  7. package/build/build/android/syncProjectConfiguration.d.ts +3 -4
  8. package/build/build/android/syncProjectConfiguration.js +2 -3
  9. package/build/build/android/version.d.ts +11 -0
  10. package/build/build/android/version.js +71 -1
  11. package/build/build/build.js +1 -1
  12. package/build/build/context.d.ts +5 -0
  13. package/build/build/createContext.d.ts +3 -1
  14. package/build/build/createContext.js +8 -1
  15. package/build/build/ios/build.js +17 -1
  16. package/build/build/ios/graphql.js +2 -0
  17. package/build/build/ios/prepareJob.js +5 -0
  18. package/build/build/ios/syncProjectConfiguration.d.ts +3 -4
  19. package/build/build/ios/syncProjectConfiguration.js +2 -3
  20. package/build/build/ios/version.d.ts +13 -0
  21. package/build/build/ios/version.js +72 -1
  22. package/build/build/local.d.ts +2 -2
  23. package/build/build/local.js +7 -7
  24. package/build/build/metadata.d.ts +1 -0
  25. package/build/build/metadata.js +32 -6
  26. package/build/build/runBuildAndSubmit.d.ts +1 -0
  27. package/build/build/runBuildAndSubmit.js +24 -3
  28. package/build/build/utils/printBuildInfo.d.ts +1 -1
  29. package/build/build/utils/printBuildInfo.js +7 -13
  30. package/build/commandUtils/pagination.d.ts +13 -0
  31. package/build/commandUtils/pagination.js +42 -0
  32. package/build/commands/branch/list.d.ts +3 -4
  33. package/build/commands/branch/list.js +6 -69
  34. package/build/commands/branch/view.d.ts +3 -0
  35. package/build/commands/branch/view.js +15 -63
  36. package/build/commands/build/index.d.ts +1 -0
  37. package/build/commands/build/index.js +9 -0
  38. package/build/commands/build/version/set.d.ts +0 -1
  39. package/build/commands/build/version/set.js +2 -3
  40. package/build/commands/build/version/sync.d.ts +0 -1
  41. package/build/commands/build/version/sync.js +2 -3
  42. package/build/commands/submit.js +4 -1
  43. package/build/commands/update/index.d.ts +2 -2
  44. package/build/commands/update/index.js +22 -6
  45. package/build/commands/update/list.js +13 -18
  46. package/build/credentials/ios/actions/SetUpAdhocProvisioningProfile.js +2 -2
  47. package/build/devices/actions/create/action.d.ts +5 -2
  48. package/build/devices/actions/create/action.js +12 -2
  49. package/build/devices/actions/create/developerPortalMethod.d.ts +6 -0
  50. package/build/devices/actions/create/developerPortalMethod.js +90 -0
  51. package/build/devices/manager.js +4 -4
  52. package/build/graphql/generated.d.ts +424 -61
  53. package/build/graphql/generated.js +9 -1
  54. package/build/graphql/mutations/PublishMutation.d.ts +2 -4
  55. package/build/graphql/queries/BranchQuery.d.ts +2 -1
  56. package/build/graphql/queries/BranchQuery.js +26 -0
  57. package/build/graphql/queries/BuildQuery.d.ts +4 -1
  58. package/build/graphql/queries/BuildQuery.js +19 -0
  59. package/build/graphql/queries/PublishQuery.d.ts +2 -1
  60. package/build/graphql/queries/PublishQuery.js +16 -0
  61. package/build/graphql/queries/UpdateQuery.d.ts +6 -8
  62. package/build/graphql/queries/UpdateQuery.js +27 -23
  63. package/build/graphql/types/Build.d.ts +1 -0
  64. package/build/graphql/types/Build.js +16 -1
  65. package/build/metadata/apple/config/reader.d.ts +3 -2
  66. package/build/metadata/apple/config/reader.js +22 -5
  67. package/build/metadata/apple/config/writer.d.ts +3 -2
  68. package/build/metadata/apple/config/writer.js +22 -6
  69. package/build/metadata/apple/tasks/app-version.d.ts +5 -1
  70. package/build/metadata/apple/tasks/app-version.js +109 -8
  71. package/build/metadata/apple/tasks/index.d.ts +6 -1
  72. package/build/metadata/apple/tasks/index.js +7 -2
  73. package/build/metadata/apple/types.d.ts +3 -7
  74. package/build/metadata/upload.js +6 -1
  75. package/build/project/publish.d.ts +3 -1
  76. package/build/project/publish.js +17 -8
  77. package/build/project/remoteVersionSource.d.ts +5 -3
  78. package/build/project/remoteVersionSource.js +18 -9
  79. package/build/submit/submit.d.ts +2 -1
  80. package/build/submit/submit.js +3 -2
  81. package/build/update/queries.d.ts +3 -0
  82. package/build/update/queries.js +72 -0
  83. package/build/update/utils.d.ts +14 -0
  84. package/build/update/utils.js +26 -9
  85. package/build/utils/expodash/chunk.d.ts +1 -0
  86. package/build/utils/expodash/chunk.js +16 -0
  87. package/build/utils/queries.d.ts +25 -0
  88. package/build/utils/queries.js +67 -0
  89. package/build/vcs/clients/gitNoCommit.d.ts +1 -0
  90. package/build/vcs/clients/gitNoCommit.js +14 -0
  91. package/oclif.manifest.json +1 -1
  92. package/package.json +27 -25
  93. package/schema/metadata-0.json +38 -233
@@ -7,11 +7,13 @@ const eas_json_1 = require("@expo/eas-json");
7
7
  const chalk_1 = tslib_1.__importDefault(require("chalk"));
8
8
  const nullthrows_1 = tslib_1.__importDefault(require("nullthrows"));
9
9
  const generated_1 = require("../graphql/generated");
10
+ const BuildQuery_1 = require("../graphql/queries/BuildQuery");
10
11
  const AppPlatform_1 = require("../graphql/types/AppPlatform");
11
12
  const log_1 = tslib_1.__importDefault(require("../log"));
12
13
  const platform_1 = require("../platform");
13
14
  const expoSdk_1 = require("../project/expoSdk");
14
15
  const metroConfig_1 = require("../project/metroConfig");
16
+ const remoteVersionSource_1 = require("../project/remoteVersionSource");
15
17
  const context_1 = require("../submit/context");
16
18
  const submit_1 = require("../submit/submit");
17
19
  const urls_1 = require("../submit/utils/urls");
@@ -61,6 +63,9 @@ async function runBuildAndSubmitAsync(projectDir, flags) {
61
63
  nonInteractive: flags.nonInteractive,
62
64
  buildProfiles,
63
65
  });
66
+ for (const buildProfile of buildProfiles) {
67
+ (0, remoteVersionSource_1.validateBuildProfileVersionSettings)(buildProfile, easJsonCliConfig);
68
+ }
64
69
  const startedBuilds = [];
65
70
  const buildCtxByPlatform = {};
66
71
  for (const buildProfile of buildProfiles) {
@@ -102,6 +107,7 @@ async function runBuildAndSubmitAsync(projectDir, flags) {
102
107
  submitProfile,
103
108
  nonInteractive: flags.nonInteractive,
104
109
  });
110
+ startedBuild.build = await BuildQuery_1.BuildQuery.withSubmissionsByIdAsync(startedBuild.build.id);
105
111
  submissions.push(submission);
106
112
  }
107
113
  log_1.default.newLine();
@@ -119,14 +125,24 @@ async function runBuildAndSubmitAsync(projectDir, flags) {
119
125
  buildIds: startedBuilds.map(({ build }) => build.id),
120
126
  accountName,
121
127
  });
122
- (0, printBuildInfo_1.printBuildResults)(builds, flags.json);
128
+ if (!flags.json) {
129
+ (0, printBuildInfo_1.printBuildResults)(builds);
130
+ }
123
131
  const haveAllBuildsFailedOrCanceled = builds.every(build => (build === null || build === void 0 ? void 0 : build.status) && [generated_1.BuildStatus.Errored, generated_1.BuildStatus.Canceled].includes(build === null || build === void 0 ? void 0 : build.status));
124
132
  if (haveAllBuildsFailedOrCanceled || !flags.autoSubmit) {
133
+ if (flags.json) {
134
+ (0, json_1.printJsonOnlyOutput)(builds);
135
+ }
125
136
  exitWithNonZeroCodeIfSomeBuildsFailed(builds);
126
137
  }
127
138
  else {
128
- // the following function also exits with non zero code if any of the submissions failed
129
- await (0, submit_1.waitToCompleteAsync)(submissions);
139
+ const completedSubmissions = await (0, submit_1.waitToCompleteAsync)(submissions);
140
+ if (flags.json) {
141
+ (0, json_1.printJsonOnlyOutput)(await Promise.all(builds
142
+ .filter((i) => !!i)
143
+ .map(build => BuildQuery_1.BuildQuery.withSubmissionsByIdAsync(build.id))));
144
+ }
145
+ (0, submit_1.exitWithNonZeroCodeIfSomeSubmissionsDidntFinish)(completedSubmissions);
130
146
  }
131
147
  }
132
148
  exports.runBuildAndSubmitAsync = runBuildAndSubmitAsync;
@@ -137,16 +153,21 @@ async function prepareAndStartBuildAsync({ projectDir, flags, moreBuilds, buildP
137
153
  clearCache: flags.clearCache,
138
154
  buildProfile: buildProfile.profile,
139
155
  nonInteractive: flags.nonInteractive,
156
+ noWait: !flags.wait,
140
157
  platform: buildProfile.platform,
141
158
  projectDir,
142
159
  localBuildOptions: flags.localBuildOptions,
143
160
  easJsonCliConfig,
161
+ message: flags.message,
144
162
  });
145
163
  if (moreBuilds) {
146
164
  log_1.default.newLine();
147
165
  const appPlatform = (0, AppPlatform_1.toAppPlatform)(buildProfile.platform);
148
166
  log_1.default.log(`${platform_1.appPlatformEmojis[appPlatform]} ${chalk_1.default.bold(`${platform_1.appPlatformDisplayNames[appPlatform]} build`)}`);
149
167
  }
168
+ if ((easJsonCliConfig === null || easJsonCliConfig === void 0 ? void 0 : easJsonCliConfig.appVersionSource) === eas_json_1.AppVersionSource.REMOTE) {
169
+ (0, remoteVersionSource_1.validateAppConfigForRemoteVersionSource)(buildCtx.exp, buildProfile.platform);
170
+ }
150
171
  if (buildCtx.workflow === eas_build_job_1.Workflow.MANAGED) {
151
172
  if (!sdkVersionChecked) {
152
173
  await (0, expoSdk_1.checkExpoSdkIsSupportedAsync)(buildCtx);
@@ -1,5 +1,5 @@
1
1
  import { BuildError, BuildFragment, EasBuildDeprecationInfo } from '../../graphql/generated';
2
2
  export declare function printLogsUrls(builds: BuildFragment[]): void;
3
- export declare function printBuildResults(builds: (BuildFragment | null)[], json: boolean): void;
3
+ export declare function printBuildResults(builds: (BuildFragment | null)[]): void;
4
4
  export declare function printDeprecationWarnings(deprecationInfo?: EasBuildDeprecationInfo | null): void;
5
5
  export declare function printUserError(error: BuildError): void;
@@ -9,7 +9,6 @@ const qrcode_terminal_1 = tslib_1.__importDefault(require("qrcode-terminal"));
9
9
  const generated_1 = require("../../graphql/generated");
10
10
  const log_1 = tslib_1.__importStar(require("../../log"));
11
11
  const platform_1 = require("../../platform");
12
- const json_1 = require("../../utils/json");
13
12
  const url_1 = require("./url");
14
13
  function printLogsUrls(builds) {
15
14
  if (builds.length === 1) {
@@ -23,20 +22,15 @@ function printLogsUrls(builds) {
23
22
  }
24
23
  }
25
24
  exports.printLogsUrls = printLogsUrls;
26
- function printBuildResults(builds, json) {
27
- if (json) {
28
- (0, json_1.printJsonOnlyOutput)(builds);
25
+ function printBuildResults(builds) {
26
+ log_1.default.newLine();
27
+ if (builds.length === 1) {
28
+ const [build] = builds;
29
+ (0, assert_1.default)(build, 'Build should be defined');
30
+ printBuildResult(build);
29
31
  }
30
32
  else {
31
- log_1.default.newLine();
32
- if (builds.length === 1) {
33
- const [build] = builds;
34
- (0, assert_1.default)(build, 'Build should be defined');
35
- printBuildResult(build);
36
- }
37
- else {
38
- builds.filter(i => i).forEach(build => printBuildResult(build));
39
- }
33
+ builds.filter(i => i).forEach(build => printBuildResult(build));
40
34
  }
41
35
  }
42
36
  exports.printBuildResults = printBuildResults;
@@ -0,0 +1,13 @@
1
+ export declare const getPaginatedQueryOptions: (flags: Record<keyof typeof EasPaginatedQueryFlags, any>) => PaginatedQueryOptions;
2
+ export declare const EasPaginatedQueryFlags: {
3
+ offset: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined>;
4
+ limit: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined>;
5
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
6
+ 'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
7
+ };
8
+ export declare type PaginatedQueryOptions = {
9
+ nonInteractive: boolean;
10
+ json: boolean;
11
+ limit?: number;
12
+ offset: number;
13
+ };
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EasPaginatedQueryFlags = exports.getPaginatedQueryOptions = void 0;
4
+ const core_1 = require("@oclif/core");
5
+ const getPaginatedQueryOptions = (flags) => {
6
+ var _a, _b, _c;
7
+ return {
8
+ json: (_a = flags.json) !== null && _a !== void 0 ? _a : false,
9
+ offset: (_b = flags.offset) !== null && _b !== void 0 ? _b : 0,
10
+ nonInteractive: (_c = flags['non-interactive']) !== null && _c !== void 0 ? _c : false,
11
+ ...('limit' in flags && { limit: flags.limit }),
12
+ };
13
+ };
14
+ exports.getPaginatedQueryOptions = getPaginatedQueryOptions;
15
+ const parseFlagInputStringAsInteger = (input, flagName, lowerLimit, upperLimit) => {
16
+ const inputAsNumber = Number(input);
17
+ if (isNaN(inputAsNumber)) {
18
+ throw new Error(`Unable to parse ${input} as a number`);
19
+ }
20
+ if (inputAsNumber < lowerLimit || inputAsNumber > upperLimit) {
21
+ throw new Error(`--${flagName} must be between ${lowerLimit} and ${upperLimit}`);
22
+ }
23
+ return inputAsNumber;
24
+ };
25
+ exports.EasPaginatedQueryFlags = {
26
+ offset: core_1.Flags.integer({
27
+ description: 'Start queries from specified index. Use for paginating results. Defaults to 0.',
28
+ // eslint-disable-next-line async-protect/async-suffix
29
+ parse: async (input) => parseFlagInputStringAsInteger(input, 'offset', 0, Number.MAX_SAFE_INTEGER),
30
+ }),
31
+ limit: core_1.Flags.integer({
32
+ description: 'The number of query items to list at once. The default value is 50 (the maximum is 100). Using a lower value may help increase command speed.',
33
+ // eslint-disable-next-line async-protect/async-suffix
34
+ parse: async (input) => parseFlagInputStringAsInteger(input, 'limit', 1, 100),
35
+ }),
36
+ json: core_1.Flags.boolean({
37
+ description: 'Enable JSON output, non-JSON messages will be printed to stderr.',
38
+ }),
39
+ 'non-interactive': core_1.Flags.boolean({
40
+ description: 'Run the command in non-interactive mode.',
41
+ }),
42
+ };
@@ -1,12 +1,11 @@
1
1
  import EasCommand from '../../commandUtils/EasCommand';
2
- import { UpdateBranchFragment } from '../../graphql/generated';
3
- export declare function listBranchesAsync({ projectId, }: {
4
- projectId: string;
5
- }): Promise<UpdateBranchFragment[]>;
6
2
  export default class BranchList extends EasCommand {
7
3
  static description: string;
8
4
  static flags: {
5
+ offset: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined>;
6
+ limit: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined>;
9
7
  json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
8
+ 'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
10
9
  };
11
10
  runAsync(): Promise<void>;
12
11
  }
@@ -1,90 +1,27 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.listBranchesAsync = void 0;
4
3
  const tslib_1 = require("tslib");
5
- const core_1 = require("@oclif/core");
6
- const chalk_1 = tslib_1.__importDefault(require("chalk"));
7
- const cli_table3_1 = tslib_1.__importDefault(require("cli-table3"));
8
- const graphql_1 = require("graphql");
9
- const graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag"));
4
+ const queries_1 = require("../../branch/queries");
10
5
  const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
11
- const client_1 = require("../../graphql/client");
12
- const UpdateBranch_1 = require("../../graphql/types/UpdateBranch");
13
- const log_1 = tslib_1.__importDefault(require("../../log"));
6
+ const pagination_1 = require("../../commandUtils/pagination");
14
7
  const expoConfig_1 = require("../../project/expoConfig");
15
8
  const projectUtils_1 = require("../../project/projectUtils");
16
- const utils_1 = require("../../update/utils");
17
9
  const json_1 = require("../../utils/json");
18
- const BRANCHES_LIMIT = 10000;
19
- async function listBranchesAsync({ projectId, }) {
20
- var _a, _b;
21
- const data = await (0, client_1.withErrorHandlingAsync)(client_1.graphqlClient
22
- .query((0, graphql_tag_1.default) `
23
- query BranchesByAppQuery($appId: String!, $limit: Int!) {
24
- app {
25
- byId(appId: $appId) {
26
- id
27
- updateBranches(offset: 0, limit: $limit) {
28
- id
29
- ...UpdateBranchFragment
30
- }
31
- }
32
- }
33
- }
34
- ${(0, graphql_1.print)(UpdateBranch_1.UpdateBranchFragmentNode)}
35
- `, {
36
- appId: projectId,
37
- limit: BRANCHES_LIMIT,
38
- }, { additionalTypenames: ['UpdateBranch'] })
39
- .toPromise());
40
- return (_b = (_a = data === null || data === void 0 ? void 0 : data.app) === null || _a === void 0 ? void 0 : _a.byId.updateBranches) !== null && _b !== void 0 ? _b : [];
41
- }
42
- exports.listBranchesAsync = listBranchesAsync;
43
10
  class BranchList extends EasCommand_1.default {
44
11
  async runAsync() {
45
12
  const { flags } = await this.parse(BranchList);
46
- if (flags.json) {
13
+ const options = (0, pagination_1.getPaginatedQueryOptions)(flags);
14
+ if (options.json) {
47
15
  (0, json_1.enableJsonOutput)();
48
16
  }
49
17
  const projectDir = await (0, projectUtils_1.findProjectRootAsync)();
50
18
  const exp = (0, expoConfig_1.getExpoConfig)(projectDir);
51
19
  const projectId = await (0, projectUtils_1.getProjectIdAsync)(exp);
52
- const branches = await listBranchesAsync({ projectId });
53
- if (flags.json) {
54
- (0, json_1.printJsonOnlyOutput)(branches);
55
- }
56
- else {
57
- const table = new cli_table3_1.default({
58
- head: ['Branch', ...utils_1.UPDATE_COLUMNS],
59
- wordWrap: true,
60
- });
61
- table.push(...branches.map(branch => {
62
- var _a, _b, _c, _d, _e;
63
- return [
64
- branch.name,
65
- (0, utils_1.formatUpdate)(branch.updates[0]),
66
- (_b = (_a = branch.updates[0]) === null || _a === void 0 ? void 0 : _a.runtimeVersion) !== null && _b !== void 0 ? _b : 'N/A',
67
- (_d = (_c = branch.updates[0]) === null || _c === void 0 ? void 0 : _c.group) !== null && _d !== void 0 ? _d : 'N/A',
68
- (0, utils_1.getPlatformsForGroup)({
69
- updates: branch.updates,
70
- group: (_e = branch.updates[0]) === null || _e === void 0 ? void 0 : _e.group,
71
- }),
72
- ];
73
- }));
74
- log_1.default.addNewLineIfNone();
75
- log_1.default.log(chalk_1.default.bold('Branches with their most recent update group:'));
76
- log_1.default.log(table.toString());
77
- if (branches.length >= BRANCHES_LIMIT) {
78
- log_1.default.warn(`Showing first ${BRANCHES_LIMIT} branches, some results might be omitted.`);
79
- }
80
- }
20
+ await (0, queries_1.listAndRenderPaginatedBranchesAsync)(projectId, options);
81
21
  }
82
22
  }
83
23
  exports.default = BranchList;
84
24
  BranchList.description = 'list all branches';
85
25
  BranchList.flags = {
86
- json: core_1.Flags.boolean({
87
- description: 'return output as JSON',
88
- default: false,
89
- }),
26
+ ...pagination_1.EasPaginatedQueryFlags,
90
27
  };
@@ -7,7 +7,10 @@ export default class BranchView extends EasCommand {
7
7
  description: string;
8
8
  }[];
9
9
  static flags: {
10
+ offset: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined>;
11
+ limit: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined>;
10
12
  json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
13
+ 'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
11
14
  };
12
15
  runAsync(): Promise<void>;
13
16
  }
@@ -1,78 +1,33 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
- const core_1 = require("@oclif/core");
5
- const chalk_1 = tslib_1.__importDefault(require("chalk"));
6
- const cli_table3_1 = tslib_1.__importDefault(require("cli-table3"));
4
+ const queries_1 = require("../../branch/queries");
7
5
  const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
8
- const UpdateQuery_1 = require("../../graphql/queries/UpdateQuery");
9
- const log_1 = tslib_1.__importDefault(require("../../log"));
6
+ const pagination_1 = require("../../commandUtils/pagination");
10
7
  const expoConfig_1 = require("../../project/expoConfig");
11
8
  const projectUtils_1 = require("../../project/projectUtils");
12
- const prompts_1 = require("../../prompts");
13
- const utils_1 = require("../../update/utils");
14
- const groupBy_1 = tslib_1.__importDefault(require("../../utils/expodash/groupBy"));
15
- const formatFields_1 = tslib_1.__importDefault(require("../../utils/formatFields"));
9
+ const queries_2 = require("../../update/queries");
16
10
  const json_1 = require("../../utils/json");
17
11
  class BranchView extends EasCommand_1.default {
18
12
  async runAsync() {
19
- let { args: { name }, flags: { json: jsonFlag }, } = await this.parse(BranchView);
20
- if (jsonFlag) {
13
+ let { args: { name: branchName }, flags, } = await this.parse(BranchView);
14
+ const options = (0, pagination_1.getPaginatedQueryOptions)(flags);
15
+ if (options.json) {
21
16
  (0, json_1.enableJsonOutput)();
22
17
  }
23
18
  const projectDir = await (0, projectUtils_1.findProjectRootAsync)();
24
19
  const exp = (0, expoConfig_1.getExpoConfig)(projectDir);
25
20
  const projectId = await (0, projectUtils_1.getProjectIdAsync)(exp);
26
- if (!name) {
27
- const validationMessage = 'Branch name may not be empty.';
28
- if (jsonFlag) {
29
- throw new Error(validationMessage);
21
+ // provide help to a user if they ran the command with missing args
22
+ if (!branchName) {
23
+ if (options.nonInteractive) {
24
+ throw new Error('Branch name may not be empty.');
30
25
  }
31
- ({ name } = await (0, prompts_1.promptAsync)({
32
- type: 'text',
33
- name: 'name',
34
- message: 'Please enter the name of the branch to view:',
35
- validate: value => (value ? true : validationMessage),
36
- }));
37
- }
38
- const { app } = await UpdateQuery_1.UpdateQuery.viewBranchAsync({
39
- appId: projectId,
40
- name,
41
- });
42
- const UpdateBranch = app === null || app === void 0 ? void 0 : app.byId.updateBranchByName;
43
- if (!UpdateBranch) {
44
- throw new Error(`Could not find branch "${name}"`);
45
- }
46
- const updates = Object.values((0, groupBy_1.default)(UpdateBranch.updates, u => u.group)).map(group => group[0]);
47
- if (jsonFlag) {
48
- (0, json_1.printJsonOnlyOutput)({ ...UpdateBranch, updates });
49
- }
50
- else {
51
- const groupTable = new cli_table3_1.default({
52
- head: utils_1.UPDATE_COLUMNS,
53
- wordWrap: true,
54
- });
55
- for (const update of updates) {
56
- groupTable.push([
57
- (0, utils_1.formatUpdate)(update),
58
- update.runtimeVersion,
59
- update.group,
60
- (0, utils_1.getPlatformsForGroup)({
61
- updates: UpdateBranch.updates,
62
- group: update.group,
63
- }),
64
- ]);
65
- }
66
- log_1.default.addNewLineIfNone();
67
- log_1.default.log(chalk_1.default.bold('Branch:'));
68
- log_1.default.log((0, formatFields_1.default)([
69
- { label: 'Name', value: UpdateBranch.name },
70
- { label: 'ID', value: UpdateBranch.id },
71
- ]));
72
- log_1.default.addNewLineIfNone();
73
- log_1.default.log(chalk_1.default.bold('Recently published update groups:'));
74
- log_1.default.log(groupTable.toString());
26
+ ({ name: branchName } = await (0, queries_1.selectBranchFromPaginatedQueryAsync)(projectId, 'Which branch would you like to view?',
27
+ // discard limit and offset because this query is not those flag's intended target
28
+ { json: options.json, nonInteractive: options.nonInteractive, offset: 0 }));
75
29
  }
30
+ await (0, queries_2.listAndRenderUpdatesOnBranchByNameAsync)(projectId, branchName, options);
76
31
  }
77
32
  }
78
33
  exports.default = BranchView;
@@ -85,8 +40,5 @@ BranchView.args = [
85
40
  },
86
41
  ];
87
42
  BranchView.flags = {
88
- json: core_1.Flags.boolean({
89
- description: `return a json with the branch's ID name and recent update groups.`,
90
- default: false,
91
- }),
43
+ ...pagination_1.EasPaginatedQueryFlags,
92
44
  };
@@ -16,6 +16,7 @@ export default class Build extends EasCommand {
16
16
  'auto-submit': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
17
17
  'auto-submit-with-profile': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
18
18
  'resource-class': import("@oclif/core/lib/interfaces").OptionFlag<UserInputResourceClass>;
19
+ message: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
19
20
  };
20
21
  runAsync(): Promise<void>;
21
22
  private sanitizeFlagsAsync;
@@ -55,6 +55,10 @@ class Build extends EasCommand_1.default {
55
55
  log_1.default.warnDeprecatedFlag('skip-project-configuration', 'Automatic configuration of native code is no longer optional.');
56
56
  log_1.default.newLine();
57
57
  }
58
+ const message = flags['message'];
59
+ if (message && message.length > 1024) {
60
+ core_1.Errors.error('Message cannot be longer than 1024 characters.', { exit: 1 });
61
+ }
58
62
  const profile = flags['profile'];
59
63
  return {
60
64
  requestedPlatform,
@@ -75,6 +79,7 @@ class Build extends EasCommand_1.default {
75
79
  autoSubmit: flags['auto-submit'] || flags['auto-submit-with-profile'] !== undefined,
76
80
  submitProfile: (_a = flags['auto-submit-with-profile']) !== null && _a !== void 0 ? _a : profile,
77
81
  userInputResourceClass: (_b = flags['resource-class']) !== null && _b !== void 0 ? _b : types_1.UserInputResourceClass.DEFAULT,
82
+ message,
78
83
  };
79
84
  }
80
85
  }
@@ -136,4 +141,8 @@ Build.flags = {
136
141
  hidden: true,
137
142
  description: 'The instance type that will be used to run this build [experimental]',
138
143
  }),
144
+ message: core_1.Flags.string({
145
+ char: 'm',
146
+ description: 'A short message describing the build',
147
+ }),
139
148
  };
@@ -1,7 +1,6 @@
1
1
  import EasCommand from '../../../commandUtils/EasCommand';
2
2
  export default class BuildVersionSetView extends EasCommand {
3
3
  static description: string;
4
- static hidden: boolean;
5
4
  static flags: {
6
5
  platform: import("@oclif/core/lib/interfaces").OptionFlag<string>;
7
6
  profile: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
@@ -26,12 +26,12 @@ class BuildVersionSetView extends EasCommand_1.default {
26
26
  const projectDir = await (0, projectUtils_1.findProjectRootAsync)();
27
27
  const platform = await (0, platform_1.selectPlatformAsync)(flags.platform);
28
28
  const easJsonReader = new eas_json_1.EasJsonReader(projectDir);
29
- await (0, remoteVersionSource_1.ensureRemoteVersionPolicyAsync)(projectDir, easJsonReader);
29
+ await (0, remoteVersionSource_1.ensureVersionSourceIsRemoteAsync)(projectDir, easJsonReader);
30
30
  const profile = await easJsonReader.getBuildProfileAsync(platform, (_a = flags.profile) !== null && _a !== void 0 ? _a : undefined);
31
31
  const exp = (0, expoConfig_1.getExpoConfig)(projectDir, { env: profile.env });
32
32
  const projectId = await (0, projectUtils_1.getProjectIdAsync)(exp);
33
33
  const projectFullName = await (0, projectUtils_1.getProjectFullNameAsync)(exp);
34
- await (0, remoteVersionSource_1.validateAppConfigForRemoteVersionPolicyAsync)(exp);
34
+ (0, remoteVersionSource_1.validateAppConfigForRemoteVersionSource)(exp, platform);
35
35
  const applicationIdentifier = await (0, applicationIdentifier_1.getApplicationIdentifierAsync)(projectDir, exp, profile, platform);
36
36
  const remoteVersions = await AppVersionQuery_1.AppVersionQuery.latestVersionAsync(projectId, (0, AppPlatform_1.toAppPlatform)(platform), applicationIdentifier);
37
37
  const currentStateMessage = (remoteVersions === null || remoteVersions === void 0 ? void 0 : remoteVersions.buildVersion)
@@ -61,7 +61,6 @@ class BuildVersionSetView extends EasCommand_1.default {
61
61
  }
62
62
  exports.default = BuildVersionSetView;
63
63
  BuildVersionSetView.description = 'Update version of an app.';
64
- BuildVersionSetView.hidden = true;
65
64
  BuildVersionSetView.flags = {
66
65
  platform: core_1.Flags.enum({
67
66
  char: 'p',
@@ -1,7 +1,6 @@
1
1
  import EasCommand from '../../../commandUtils/EasCommand';
2
2
  export default class BuildVersionSyncView extends EasCommand {
3
3
  static description: string;
4
- static hidden: boolean;
5
4
  static flags: {
6
5
  platform: import("@oclif/core/lib/interfaces").OptionFlag<string>;
7
6
  profile: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
@@ -30,7 +30,7 @@ class BuildVersionSyncView extends EasCommand_1.default {
30
30
  const projectDir = await (0, projectUtils_1.findProjectRootAsync)();
31
31
  const requestedPlatform = await (0, platform_1.selectRequestedPlatformAsync)(flags.platform);
32
32
  const easJsonReader = new eas_json_1.EasJsonReader(projectDir);
33
- await (0, remoteVersionSource_1.ensureRemoteVersionPolicyAsync)(projectDir, easJsonReader);
33
+ await (0, remoteVersionSource_1.ensureVersionSourceIsRemoteAsync)(projectDir, easJsonReader);
34
34
  const platforms = (0, platform_1.toPlatforms)(requestedPlatform);
35
35
  const buildProfiles = await (0, profiles_1.getProfilesAsync)({
36
36
  type: 'build',
@@ -41,7 +41,7 @@ class BuildVersionSyncView extends EasCommand_1.default {
41
41
  for (const profileInfo of buildProfiles) {
42
42
  const exp = (0, expoConfig_1.getExpoConfig)(projectDir, { env: profileInfo.profile.env });
43
43
  const projectId = await (0, projectUtils_1.getProjectIdAsync)(exp);
44
- await (0, remoteVersionSource_1.validateAppConfigForRemoteVersionPolicyAsync)(exp);
44
+ (0, remoteVersionSource_1.validateAppConfigForRemoteVersionSource)(exp, profileInfo.platform);
45
45
  const platformDisplayName = platform_1.appPlatformDisplayNames[(0, AppPlatform_1.toAppPlatform)(profileInfo.platform)];
46
46
  const applicationIdentifier = await (0, applicationIdentifier_1.getApplicationIdentifierAsync)(projectDir, exp, profileInfo.profile, profileInfo.platform);
47
47
  const remoteVersions = await AppVersionQuery_1.AppVersionQuery.latestVersionAsync(projectId, (0, AppPlatform_1.toAppPlatform)(profileInfo.platform), applicationIdentifier);
@@ -111,7 +111,6 @@ class BuildVersionSyncView extends EasCommand_1.default {
111
111
  }
112
112
  exports.default = BuildVersionSyncView;
113
113
  BuildVersionSyncView.description = 'Update a version in native code with a value stored on EAS servers';
114
- BuildVersionSyncView.hidden = true;
115
114
  BuildVersionSyncView.flags = {
116
115
  platform: core_1.Flags.enum({
117
116
  char: 'p',
@@ -49,7 +49,10 @@ class Submit extends EasCommand_1.default {
49
49
  log_1.default.newLine();
50
50
  (0, urls_1.printSubmissionDetailsUrls)(submissions);
51
51
  if (flags.wait) {
52
- await (0, submit_1.waitToCompleteAsync)(submissions, { verbose: flags.verbose });
52
+ const completedSubmissions = await (0, submit_1.waitToCompleteAsync)(submissions, {
53
+ verbose: flags.verbose,
54
+ });
55
+ (0, submit_1.exitWithNonZeroCodeIfSomeSubmissionsDidntFinish)(completedSubmissions);
53
56
  }
54
57
  }
55
58
  async sanitizeFlagsAsync(flags) {
@@ -6,8 +6,8 @@ export declare type PublishPlatformFlag = PublishPlatform | 'all';
6
6
  export declare function ensureBranchExistsAsync({ appId, name: branchName, limit, offset, }: {
7
7
  appId: string;
8
8
  name: string;
9
- limit?: number;
10
- offset?: number;
9
+ limit: number;
10
+ offset: number;
11
11
  }): Promise<{
12
12
  id: string;
13
13
  updates: Exclude<Exclude<ViewBranchUpdatesQuery['app'], null | undefined>['byId']['updateBranchByName'], null | undefined>['updates'];
@@ -11,11 +11,13 @@ const dateformat_1 = tslib_1.__importDefault(require("dateformat"));
11
11
  const graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag"));
12
12
  const nullthrows_1 = tslib_1.__importDefault(require("nullthrows"));
13
13
  const api_1 = require("../../api");
14
+ const queries_1 = require("../../branch/queries");
14
15
  const url_1 = require("../../build/utils/url");
15
16
  const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
16
17
  const fetch_1 = tslib_1.__importDefault(require("../../fetch"));
17
18
  const client_1 = require("../../graphql/client");
18
19
  const PublishMutation_1 = require("../../graphql/mutations/PublishMutation");
20
+ const BranchQuery_1 = require("../../graphql/queries/BranchQuery");
19
21
  const UpdateQuery_1 = require("../../graphql/queries/UpdateQuery");
20
22
  const log_1 = tslib_1.__importStar(require("../../log"));
21
23
  const ora_1 = require("../../ora");
@@ -32,7 +34,6 @@ const formatFields_1 = tslib_1.__importDefault(require("../../utils/formatFields
32
34
  const json_1 = require("../../utils/json");
33
35
  const vcs_1 = require("../../vcs");
34
36
  const create_1 = require("../branch/create");
35
- const list_1 = require("../branch/list");
36
37
  const create_2 = require("../channel/create");
37
38
  exports.defaultPublishPlatforms = ['android', 'ios'];
38
39
  async function getUpdateGroupAsync({ group, }) {
@@ -143,7 +144,11 @@ class UpdatePublish extends EasCommand_1.default {
143
144
  if (jsonFlag) {
144
145
  throw new Error(validationMessage);
145
146
  }
146
- const branches = await (0, list_1.listBranchesAsync)({ projectId });
147
+ const branches = await BranchQuery_1.BranchQuery.listBranchesAsync({
148
+ appId: projectId,
149
+ limit: queries_1.BRANCHES_LIMIT,
150
+ offset: 0,
151
+ });
147
152
  if (branches.length === 0) {
148
153
  ({ name: branchName } = await (0, prompts_1.promptAsync)({
149
154
  type: 'text',
@@ -167,6 +172,7 @@ class UpdatePublish extends EasCommand_1.default {
167
172
  let unsortedUpdateInfoGroups = {};
168
173
  let oldMessage, oldRuntimeVersion;
169
174
  let uploadedAssetCount = 0;
175
+ let assetLimitPerUpdateGroup = 0;
170
176
  if (republish) {
171
177
  // If we are republishing, we don't need to worry about building the bundle or uploading the assets.
172
178
  // Instead we get the `updateInfoGroup` from the update we wish to republish.
@@ -265,10 +271,11 @@ class UpdatePublish extends EasCommand_1.default {
265
271
  try {
266
272
  const platforms = platformFlag === 'all' ? exports.defaultPublishPlatforms : [platformFlag];
267
273
  const assets = await (0, publish_1.collectAssetsAsync)({ inputDir: inputDir, platforms });
268
- const { uniqueUploadedAssetCount } = await (0, publish_1.uploadAssetsAsync)(assets, (totalAssets, missingAssets) => {
274
+ const uploadResults = await (0, publish_1.uploadAssetsAsync)(assets, projectId, (totalAssets, missingAssets) => {
269
275
  assetSpinner.text = `Uploading assets. Finished (${totalAssets - missingAssets}/${totalAssets})`;
270
276
  });
271
- uploadedAssetCount = uniqueUploadedAssetCount;
277
+ uploadedAssetCount = uploadResults.uniqueUploadedAssetCount;
278
+ assetLimitPerUpdateGroup = uploadResults.assetLimitPerUpdateGroup;
272
279
  unsortedUpdateInfoGroups = await (0, publish_1.buildUnsortedUpdateInfoGroupAsync)(assets, exp);
273
280
  const uploadAssetSuccessMessage = uploadedAssetCount
274
281
  ? `Uploaded ${uploadedAssetCount} ${uploadedAssetCount === 1 ? 'asset' : 'assets'}!`
@@ -291,6 +298,7 @@ class UpdatePublish extends EasCommand_1.default {
291
298
  appId: projectId,
292
299
  name: branchName,
293
300
  limit: 0,
301
+ offset: 0,
294
302
  });
295
303
  // Sort the updates into different groups based on their platform specific runtime versions
296
304
  const updateGroups = Object.entries(runtimeToPlatformMapping).map(([runtime, platforms]) => {
@@ -357,7 +365,7 @@ class UpdatePublish extends EasCommand_1.default {
357
365
  log_1.default.addNewLineIfNone();
358
366
  for (const runtime of new Set(Object.values(runtimeVersions))) {
359
367
  const newUpdatesForRuntimeVersion = newUpdates.filter(update => update.runtimeVersion === runtime);
360
- if (!newUpdatesForRuntimeVersion.length) {
368
+ if (newUpdatesForRuntimeVersion.length === 0) {
361
369
  throw new Error(`Publish response is missing updates with runtime ${runtime}.`);
362
370
  }
363
371
  const platforms = newUpdatesForRuntimeVersion.map(update => update.platform);
@@ -381,6 +389,14 @@ class UpdatePublish extends EasCommand_1.default {
381
389
  { label: 'Website link', value: updateGroupLink },
382
390
  ]));
383
391
  log_1.default.addNewLineIfNone();
392
+ if ((0, publish_1.isUploadedAssetCountAboveWarningThreshold)(uploadedAssetCount, assetLimitPerUpdateGroup)) {
393
+ log_1.default.warn(`This update group contains ${uploadedAssetCount} assets and is nearing the server cap of ${assetLimitPerUpdateGroup}.\n` +
394
+ `${(0, log_1.learnMore)('https://docs.expo.dev/eas-update/optimize-assets/', {
395
+ learnMoreMessage: 'Consider optimizing your usage of assets',
396
+ dim: false,
397
+ })}.`);
398
+ log_1.default.addNewLineIfNone();
399
+ }
384
400
  }
385
401
  }
386
402
  }
@@ -459,7 +475,7 @@ async function getUpdatesToRepublishInteractiveAsync(projectId, branchName, plat
459
475
  title: formatUpdateTitle(update),
460
476
  value: update.group,
461
477
  }));
462
- if (!updateGroups.length) {
478
+ if (updateGroups.length === 0) {
463
479
  throw new Error(`There are no updates on branch "${branchName}" published for the platform(s) ${platformFlag}. Did you mean to publish a new update instead?`);
464
480
  }
465
481
  if (updates.length > pageSize) {