eas-cli 0.57.0 → 0.58.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 (61) hide show
  1. package/README.md +44 -44
  2. package/build/build/android/build.js +17 -3
  3. package/build/build/android/graphql.js +2 -0
  4. package/build/build/android/prepareJob.js +5 -0
  5. package/build/build/android/syncProjectConfiguration.d.ts +3 -4
  6. package/build/build/android/syncProjectConfiguration.js +2 -3
  7. package/build/build/android/version.d.ts +11 -0
  8. package/build/build/android/version.js +71 -1
  9. package/build/build/build.js +1 -1
  10. package/build/build/context.d.ts +4 -0
  11. package/build/build/createContext.d.ts +2 -1
  12. package/build/build/createContext.js +7 -1
  13. package/build/build/ios/build.js +17 -1
  14. package/build/build/ios/graphql.js +2 -0
  15. package/build/build/ios/prepareJob.js +5 -0
  16. package/build/build/ios/syncProjectConfiguration.d.ts +3 -4
  17. package/build/build/ios/syncProjectConfiguration.js +2 -3
  18. package/build/build/ios/version.d.ts +13 -0
  19. package/build/build/ios/version.js +72 -1
  20. package/build/build/local.d.ts +2 -2
  21. package/build/build/local.js +7 -7
  22. package/build/build/metadata.js +18 -2
  23. package/build/build/runBuildAndSubmit.js +21 -3
  24. package/build/build/utils/printBuildInfo.d.ts +1 -1
  25. package/build/build/utils/printBuildInfo.js +7 -13
  26. package/build/commands/build/version/set.d.ts +0 -1
  27. package/build/commands/build/version/set.js +2 -3
  28. package/build/commands/build/version/sync.d.ts +0 -1
  29. package/build/commands/build/version/sync.js +2 -3
  30. package/build/commands/submit.js +4 -1
  31. package/build/commands/update/index.js +12 -2
  32. package/build/graphql/generated.d.ts +230 -0
  33. package/build/graphql/generated.js +2 -0
  34. package/build/graphql/mutations/PublishMutation.d.ts +2 -4
  35. package/build/graphql/queries/BuildQuery.d.ts +4 -1
  36. package/build/graphql/queries/BuildQuery.js +19 -0
  37. package/build/graphql/queries/PublishQuery.d.ts +2 -1
  38. package/build/graphql/queries/PublishQuery.js +16 -0
  39. package/build/graphql/types/Build.d.ts +1 -0
  40. package/build/graphql/types/Build.js +16 -1
  41. package/build/metadata/apple/config/reader.d.ts +3 -2
  42. package/build/metadata/apple/config/reader.js +22 -5
  43. package/build/metadata/apple/config/writer.d.ts +3 -2
  44. package/build/metadata/apple/config/writer.js +22 -6
  45. package/build/metadata/apple/tasks/app-version.d.ts +5 -1
  46. package/build/metadata/apple/tasks/app-version.js +109 -8
  47. package/build/metadata/apple/tasks/index.d.ts +6 -1
  48. package/build/metadata/apple/tasks/index.js +7 -2
  49. package/build/metadata/apple/types.d.ts +3 -7
  50. package/build/metadata/upload.js +6 -1
  51. package/build/project/publish.d.ts +3 -1
  52. package/build/project/publish.js +17 -8
  53. package/build/project/remoteVersionSource.d.ts +5 -3
  54. package/build/project/remoteVersionSource.js +18 -9
  55. package/build/submit/submit.d.ts +2 -1
  56. package/build/submit/submit.js +3 -2
  57. package/build/vcs/clients/gitNoCommit.d.ts +1 -0
  58. package/build/vcs/clients/gitNoCommit.js +14 -0
  59. package/oclif.manifest.json +1 -1
  60. package/package.json +4 -4
  61. package/schema/metadata-0.json +38 -233
@@ -4,6 +4,7 @@ exports.createBuildContextAsync = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const eas_build_job_1 = require("@expo/eas-build-job");
6
6
  const json_file_1 = tslib_1.__importDefault(require("@expo/json-file"));
7
+ const getenv_1 = tslib_1.__importDefault(require("getenv"));
7
8
  const resolve_from_1 = tslib_1.__importDefault(require("resolve-from"));
8
9
  const uuid_1 = require("uuid");
9
10
  const events_1 = require("../analytics/events");
@@ -15,7 +16,7 @@ const Account_1 = require("../user/Account");
15
16
  const actions_1 = require("../user/actions");
16
17
  const build_1 = require("./android/build");
17
18
  const build_2 = require("./ios/build");
18
- async function createBuildContextAsync({ buildProfileName, buildProfile, easJsonCliConfig, clearCache = false, localBuildOptions, nonInteractive = false, platform, projectDir, resourceClass, message, }) {
19
+ async function createBuildContextAsync({ buildProfileName, buildProfile, easJsonCliConfig, clearCache = false, localBuildOptions, nonInteractive, noWait, platform, projectDir, resourceClass, message, }) {
19
20
  var _a;
20
21
  const exp = (0, expoConfig_1.getExpoConfig)(projectDir, { env: buildProfile.env });
21
22
  const user = await (0, actions_1.ensureLoggedInAsync)();
@@ -24,6 +25,7 @@ async function createBuildContextAsync({ buildProfileName, buildProfile, easJson
24
25
  const projectId = await (0, projectUtils_1.getProjectIdAsync)(exp, { env: buildProfile.env });
25
26
  const workflow = await (0, workflow_1.resolveWorkflowAsync)(projectDir, platform);
26
27
  const accountId = (_a = (0, Account_1.findAccountByName)(user.accounts, accountName)) === null || _a === void 0 ? void 0 : _a.id;
28
+ const runFromCI = getenv_1.default.boolish('CI', false);
27
29
  const credentialsCtx = new context_1.CredentialsContext({
28
30
  exp,
29
31
  nonInteractive,
@@ -43,6 +45,8 @@ async function createBuildContextAsync({ buildProfileName, buildProfile, easJson
43
45
  project_id: projectId,
44
46
  project_type: workflow,
45
47
  ...devClientProperties,
48
+ no_wait: noWait,
49
+ run_from_ci: runFromCI,
46
50
  };
47
51
  events_1.Analytics.logEvent(events_1.BuildEvent.BUILD_COMMAND, trackingCtx);
48
52
  const commonContext = {
@@ -56,6 +60,7 @@ async function createBuildContextAsync({ buildProfileName, buildProfile, easJson
56
60
  exp,
57
61
  localBuildOptions,
58
62
  nonInteractive,
63
+ noWait,
59
64
  platform,
60
65
  projectDir,
61
66
  projectId,
@@ -64,6 +69,7 @@ async function createBuildContextAsync({ buildProfileName, buildProfile, easJson
64
69
  user,
65
70
  workflow,
66
71
  message,
72
+ runFromCI,
67
73
  };
68
74
  if (platform === eas_build_job_1.Platform.ANDROID) {
69
75
  const common = commonContext;
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.prepareIosBuildAsync = exports.createIosContextAsync = void 0;
4
4
  const eas_build_job_1 = require("@expo/eas-build-job");
5
+ const eas_json_1 = require("@expo/eas-json");
5
6
  const BuildMutation_1 = require("../../graphql/mutations/BuildMutation");
6
7
  const bundleIdentifier_1 = require("../../project/ios/bundleIdentifier");
7
8
  const scheme_1 = require("../../project/ios/scheme");
@@ -13,7 +14,9 @@ const credentials_1 = require("./credentials");
13
14
  const graphql_2 = require("./graphql");
14
15
  const prepareJob_1 = require("./prepareJob");
15
16
  const syncProjectConfiguration_1 = require("./syncProjectConfiguration");
17
+ const version_1 = require("./version");
16
18
  async function createIosContextAsync(ctx) {
19
+ var _a;
17
20
  const { buildProfile } = ctx;
18
21
  if (ctx.workflow === eas_build_job_1.Workflow.MANAGED) {
19
22
  await (0, bundleIdentifier_1.ensureBundleIdentifierIsDefinedForManagedProjectAsync)(ctx.projectDir, ctx.exp);
@@ -32,11 +35,21 @@ async function createIosContextAsync(ctx) {
32
35
  env: buildProfile.env,
33
36
  });
34
37
  const applicationTarget = (0, target_1.findApplicationTarget)(targets);
38
+ const buildNumberOverride = ((_a = ctx.easJsonCliConfig) === null || _a === void 0 ? void 0 : _a.appVersionSource) === eas_json_1.AppVersionSource.REMOTE
39
+ ? await (0, version_1.resolveRemoteBuildNumberAsync)({
40
+ projectDir: ctx.projectDir,
41
+ projectId: ctx.projectId,
42
+ exp: ctx.exp,
43
+ applicationTarget,
44
+ buildProfile,
45
+ })
46
+ : undefined;
35
47
  return {
36
48
  bundleIdentifier: applicationTarget.bundleIdentifier,
37
49
  applicationTarget,
38
50
  targets,
39
51
  xcodeBuildContext,
52
+ buildNumberOverride,
40
53
  };
41
54
  }
42
55
  exports.createIosContextAsync = createIosContextAsync;
@@ -47,11 +60,14 @@ async function prepareIosBuildAsync(ctx) {
47
60
  return (0, credentials_1.ensureIosCredentialsAsync)(ctx, ctx.ios.targets);
48
61
  },
49
62
  syncProjectConfigurationAsync: async () => {
63
+ var _a;
50
64
  await (0, syncProjectConfiguration_1.syncProjectConfigurationAsync)({
51
65
  projectDir: ctx.projectDir,
52
66
  exp: ctx.exp,
53
- buildProfile: ctx.buildProfile,
54
67
  targets: ctx.ios.targets,
68
+ localAutoIncrement: ((_a = ctx.easJsonCliConfig) === null || _a === void 0 ? void 0 : _a.appVersionSource) === eas_json_1.AppVersionSource.REMOTE
69
+ ? false
70
+ : ctx.buildProfile.autoIncrement,
55
71
  });
56
72
  },
57
73
  prepareJobAsync: async (ctx, jobData) => {
@@ -5,6 +5,7 @@ const tslib_1 = require("tslib");
5
5
  const nullthrows_1 = tslib_1.__importDefault(require("nullthrows"));
6
6
  const graphql_1 = require("../graphql");
7
7
  function transformJob(job) {
8
+ var _a;
8
9
  return {
9
10
  type: (0, graphql_1.transformWorkflow)(job.type),
10
11
  projectArchive: (0, graphql_1.transformProjectArchive)(job.projectArchive),
@@ -14,6 +15,7 @@ function transformJob(job) {
14
15
  secrets: transformIosSecrets(job.secrets),
15
16
  builderEnvironment: job.builderEnvironment,
16
17
  cache: job.cache,
18
+ version: ((_a = job.version) === null || _a === void 0 ? void 0 : _a.buildNumber) ? { buildNumber: job.version.buildNumber } : undefined,
17
19
  scheme: job.scheme,
18
20
  buildConfiguration: job.buildConfiguration,
19
21
  artifactPath: job.artifactPath,
@@ -54,6 +54,11 @@ async function prepareJobAsync(ctx, jobData) {
54
54
  buildConfiguration: ctx.buildProfile.buildConfiguration,
55
55
  artifactPath: ctx.buildProfile.artifactPath,
56
56
  username,
57
+ ...(ctx.ios.buildNumberOverride && {
58
+ version: {
59
+ buildNumber: ctx.ios.buildNumberOverride,
60
+ },
61
+ }),
57
62
  experimental: {
58
63
  prebuildCommand: ctx.buildProfile.prebuildCommand,
59
64
  },
@@ -1,10 +1,9 @@
1
1
  import { ExpoConfig } from '@expo/config';
2
- import { Platform } from '@expo/eas-build-job';
3
- import { BuildProfile } from '@expo/eas-json';
2
+ import { IosVersionAutoIncrement } from '@expo/eas-json';
4
3
  import { Target } from '../../credentials/ios/types';
5
- export declare function syncProjectConfigurationAsync({ projectDir, exp, buildProfile, targets, }: {
4
+ export declare function syncProjectConfigurationAsync({ projectDir, exp, targets, localAutoIncrement, }: {
6
5
  projectDir: string;
7
6
  exp: ExpoConfig;
8
- buildProfile: BuildProfile<Platform.IOS>;
9
7
  targets: Target[];
8
+ localAutoIncrement?: IosVersionAutoIncrement;
10
9
  }): Promise<void>;
@@ -6,10 +6,9 @@ const projectUtils_1 = require("../../project/projectUtils");
6
6
  const workflow_1 = require("../../project/workflow");
7
7
  const UpdatesModule_1 = require("../../update/ios/UpdatesModule");
8
8
  const version_1 = require("./version");
9
- async function syncProjectConfigurationAsync({ projectDir, exp, buildProfile, targets, }) {
9
+ async function syncProjectConfigurationAsync({ projectDir, exp, targets, localAutoIncrement, }) {
10
10
  const workflow = await (0, workflow_1.resolveWorkflowAsync)(projectDir, eas_build_job_1.Platform.IOS);
11
- const { autoIncrement } = buildProfile;
12
- const versionBumpStrategy = resolveVersionBumpStrategy(autoIncrement !== null && autoIncrement !== void 0 ? autoIncrement : false);
11
+ const versionBumpStrategy = resolveVersionBumpStrategy(localAutoIncrement !== null && localAutoIncrement !== void 0 ? localAutoIncrement : false);
13
12
  if (workflow === eas_build_job_1.Workflow.GENERIC) {
14
13
  if ((0, projectUtils_1.isExpoUpdatesInstalled)(projectDir)) {
15
14
  await (0, UpdatesModule_1.syncUpdatesConfigurationAsync)(projectDir, exp);
@@ -1,4 +1,6 @@
1
1
  import { ExpoConfig } from '@expo/config';
2
+ import { Platform } from '@expo/eas-build-job';
3
+ import { BuildProfile } from '@expo/eas-json';
2
4
  import type { XCBuildConfiguration } from 'xcode';
3
5
  import { Target } from '../../credentials/ios/types';
4
6
  export declare enum BumpStrategy {
@@ -31,3 +33,14 @@ export declare function updateNativeVersionsAsync({ projectDir, version, buildNu
31
33
  targets: Target[];
32
34
  }): Promise<void>;
33
35
  export declare function evaluateTemplateString(s: string, buildSettings: XCBuildConfiguration['buildSettings']): string;
36
+ /**
37
+ * Returns buildNumber that will be used for the next build. If current build profile
38
+ * has an 'autoIncrement' option set, it increments the version on server.
39
+ */
40
+ export declare function resolveRemoteBuildNumberAsync({ projectDir, projectId, exp, applicationTarget, buildProfile, }: {
41
+ projectDir: string;
42
+ projectId: string;
43
+ exp: ExpoConfig;
44
+ applicationTarget: Target;
45
+ buildProfile: BuildProfile<Platform.IOS>;
46
+ }): Promise<string>;
@@ -1,12 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.evaluateTemplateString = exports.updateNativeVersionsAsync = exports.getInfoPlistPath = exports.maybeResolveVersionsAsync = exports.readBuildNumberAsync = exports.readShortVersionAsync = exports.bumpVersionInAppJsonAsync = exports.bumpVersionAsync = exports.BumpStrategy = void 0;
3
+ exports.resolveRemoteBuildNumberAsync = exports.evaluateTemplateString = exports.updateNativeVersionsAsync = exports.getInfoPlistPath = exports.maybeResolveVersionsAsync = exports.readBuildNumberAsync = exports.readShortVersionAsync = exports.bumpVersionInAppJsonAsync = exports.bumpVersionAsync = exports.BumpStrategy = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const config_plugins_1 = require("@expo/config-plugins");
6
6
  const eas_build_job_1 = require("@expo/eas-build-job");
7
7
  const chalk_1 = tslib_1.__importDefault(require("chalk"));
8
8
  const path_1 = tslib_1.__importDefault(require("path"));
9
+ const generated_1 = require("../../graphql/generated");
10
+ const AppVersionMutation_1 = require("../../graphql/mutations/AppVersionMutation");
11
+ const AppVersionQuery_1 = require("../../graphql/queries/AppVersionQuery");
9
12
  const log_1 = tslib_1.__importDefault(require("../../log"));
13
+ const ora_1 = require("../../ora");
10
14
  const target_1 = require("../../project/ios/target");
11
15
  const versions_1 = require("../../project/ios/versions");
12
16
  const workflow_1 = require("../../project/workflow");
@@ -186,3 +190,70 @@ function evaluateTemplateString(s, buildSettings) {
186
190
  });
187
191
  }
188
192
  exports.evaluateTemplateString = evaluateTemplateString;
193
+ /**
194
+ * Returns buildNumber that will be used for the next build. If current build profile
195
+ * has an 'autoIncrement' option set, it increments the version on server.
196
+ */
197
+ async function resolveRemoteBuildNumberAsync({ projectDir, projectId, exp, applicationTarget, buildProfile, }) {
198
+ var _a, _b, _c, _d;
199
+ const remoteVersions = await AppVersionQuery_1.AppVersionQuery.latestVersionAsync(projectId, generated_1.AppPlatform.Ios, applicationTarget.bundleIdentifier);
200
+ const localBuildNumber = await readBuildNumberAsync(projectDir, exp, (_a = applicationTarget.buildSettings) !== null && _a !== void 0 ? _a : {});
201
+ const localShortVersion = await readShortVersionAsync(projectDir, exp, (_b = applicationTarget.buildSettings) !== null && _b !== void 0 ? _b : {});
202
+ let currentBuildVersion;
203
+ if (remoteVersions === null || remoteVersions === void 0 ? void 0 : remoteVersions.buildVersion) {
204
+ currentBuildVersion = remoteVersions.buildVersion;
205
+ }
206
+ else {
207
+ if (localBuildNumber) {
208
+ log_1.default.warn('No remote versions are configured for this project, buildNumber will be initialized based on the value from the local project.');
209
+ currentBuildVersion = localBuildNumber;
210
+ }
211
+ else {
212
+ log_1.default.error(`Remote versions are not configured and EAS CLI was not able to read the current version from your project. Use "eas build:version:set" to initialize remote versions.`);
213
+ throw new Error('Remote versions are not configured.');
214
+ }
215
+ }
216
+ if (!buildProfile.autoIncrement && (remoteVersions === null || remoteVersions === void 0 ? void 0 : remoteVersions.buildVersion)) {
217
+ return currentBuildVersion;
218
+ }
219
+ else if (!buildProfile.autoIncrement && !(remoteVersions === null || remoteVersions === void 0 ? void 0 : remoteVersions.buildVersion)) {
220
+ const spinner = (0, ora_1.ora)(`Initializing the buildNumber with ${currentBuildVersion}.`).start();
221
+ try {
222
+ await AppVersionMutation_1.AppVersionMutation.createAppVersionAsync({
223
+ appId: projectId,
224
+ platform: generated_1.AppPlatform.Ios,
225
+ applicationIdentifier: applicationTarget.bundleIdentifier,
226
+ storeVersion: localShortVersion !== null && localShortVersion !== void 0 ? localShortVersion : '1.0.0',
227
+ buildVersion: currentBuildVersion,
228
+ runtimeVersion: (_c = config_plugins_1.Updates.getRuntimeVersionNullable(exp, eas_build_job_1.Platform.IOS)) !== null && _c !== void 0 ? _c : undefined,
229
+ });
230
+ spinner.succeed(`Initialized the buildNumber with ${currentBuildVersion}.`);
231
+ }
232
+ catch (err) {
233
+ spinner.fail(`Failed to initialize the buildNumber with ${currentBuildVersion}.`);
234
+ throw err;
235
+ }
236
+ return currentBuildVersion;
237
+ }
238
+ else {
239
+ const nextBuildVersion = (0, versions_1.getNextBuildNumber)(currentBuildVersion);
240
+ const spinner = (0, ora_1.ora)(`Incrementing buildNumber ${currentBuildVersion} -> ${nextBuildVersion}.`).start();
241
+ try {
242
+ await AppVersionMutation_1.AppVersionMutation.createAppVersionAsync({
243
+ appId: projectId,
244
+ platform: generated_1.AppPlatform.Ios,
245
+ applicationIdentifier: applicationTarget.bundleIdentifier,
246
+ storeVersion: localShortVersion !== null && localShortVersion !== void 0 ? localShortVersion : '1.0.0',
247
+ buildVersion: nextBuildVersion,
248
+ runtimeVersion: (_d = config_plugins_1.Updates.getRuntimeVersionNullable(exp, eas_build_job_1.Platform.IOS)) !== null && _d !== void 0 ? _d : undefined,
249
+ });
250
+ spinner.succeed(`Incremented buildNumber ${currentBuildVersion} -> ${nextBuildVersion}.`);
251
+ }
252
+ catch (err) {
253
+ spinner.fail(`Failed to increment buildNumber ${currentBuildVersion} -> ${nextBuildVersion}.`);
254
+ throw err;
255
+ }
256
+ return nextBuildVersion;
257
+ }
258
+ }
259
+ exports.resolveRemoteBuildNumberAsync = resolveRemoteBuildNumberAsync;
@@ -1,4 +1,4 @@
1
- import { Job } from '@expo/eas-build-job';
1
+ import { Job, Metadata } from '@expo/eas-build-job';
2
2
  export interface LocalBuildOptions {
3
3
  enable: boolean;
4
4
  skipCleanup?: boolean;
@@ -8,4 +8,4 @@ export interface LocalBuildOptions {
8
8
  workingdir?: string;
9
9
  verbose?: boolean;
10
10
  }
11
- export declare function runLocalBuildAsync(job: Job, options: LocalBuildOptions): Promise<void>;
11
+ export declare function runLocalBuildAsync(job: Job, metadata: Metadata, options: LocalBuildOptions): Promise<void>;
@@ -6,10 +6,10 @@ const spawn_async_1 = tslib_1.__importDefault(require("@expo/spawn-async"));
6
6
  const semver_1 = tslib_1.__importDefault(require("semver"));
7
7
  const ora_1 = require("../ora");
8
8
  const PLUGIN_PACKAGE_NAME = 'eas-cli-local-build-plugin';
9
- const PLUGIN_PACKAGE_VERSION = '0.0.85';
10
- async function runLocalBuildAsync(job, options) {
9
+ const PLUGIN_PACKAGE_VERSION = '0.0.98';
10
+ async function runLocalBuildAsync(job, metadata, options) {
11
11
  var _a;
12
- const { command, args } = await getCommandAndArgsAsync(job);
12
+ const { command, args } = await getCommandAndArgsAsync(job, metadata);
13
13
  let spinner;
14
14
  if (!options.verbose) {
15
15
  spinner = (0, ora_1.ora)().start(options.skipNativeBuild ? 'Preparing project' : 'Building project');
@@ -44,16 +44,16 @@ async function runLocalBuildAsync(job, options) {
44
44
  }
45
45
  }
46
46
  exports.runLocalBuildAsync = runLocalBuildAsync;
47
- async function getCommandAndArgsAsync(job) {
48
- const jobBase64 = Buffer.from(JSON.stringify({ job })).toString('base64');
47
+ async function getCommandAndArgsAsync(job, metadata) {
48
+ const jobAndMetadataBase64 = Buffer.from(JSON.stringify({ job, metadata })).toString('base64');
49
49
  if (process.env.EAS_LOCAL_BUILD_PLUGIN_PATH) {
50
50
  return {
51
51
  command: process.env.EAS_LOCAL_BUILD_PLUGIN_PATH,
52
- args: [jobBase64],
52
+ args: [jobAndMetadataBase64],
53
53
  };
54
54
  }
55
55
  else {
56
- const args = [`${PLUGIN_PACKAGE_NAME}@${PLUGIN_PACKAGE_VERSION}`, jobBase64];
56
+ const args = [`${PLUGIN_PACKAGE_NAME}@${PLUGIN_PACKAGE_VERSION}`, jobAndMetadataBase64];
57
57
  if (await isAtLeastNpm7Async()) {
58
58
  // npx shipped with npm >= 7.0.0 requires the "-y" flag to run commands without
59
59
  // prompting the user to install a package that is used for the first time
@@ -44,6 +44,8 @@ async function collectMetadataAsync(ctx) {
44
44
  ...(ctx.platform === eas_build_job_1.Platform.IOS && {
45
45
  iosEnterpriseProvisioning: resolveIosEnterpriseProvisioning(ctx),
46
46
  }),
47
+ runWithNoWaitFlag: ctx.noWait,
48
+ runFromCI: ctx.runFromCI,
47
49
  };
48
50
  return (0, eas_build_job_1.sanitizeMetadata)(metadata);
49
51
  }
@@ -51,11 +53,25 @@ exports.collectMetadataAsync = collectMetadataAsync;
51
53
  async function maybeResolveVersionsAsync(ctx) {
52
54
  if (ctx.platform === eas_build_job_1.Platform.IOS) {
53
55
  const iosContext = ctx;
54
- return await (0, version_2.maybeResolveVersionsAsync)(ctx.projectDir, ctx.exp, iosContext.ios.targets);
56
+ const resolvedVersion = await (0, version_2.maybeResolveVersionsAsync)(ctx.projectDir, ctx.exp, iosContext.ios.targets);
57
+ if (iosContext.ios.buildNumberOverride) {
58
+ return {
59
+ ...resolvedVersion,
60
+ appBuildVersion: iosContext.ios.buildNumberOverride,
61
+ };
62
+ }
63
+ return resolvedVersion;
55
64
  }
56
65
  else if (ctx.platform === eas_build_job_1.Platform.ANDROID) {
57
66
  const androidCtx = ctx;
58
- return await (0, version_1.maybeResolveVersionsAsync)(ctx.projectDir, ctx.exp, androidCtx.buildProfile);
67
+ const resolvedVersion = await (0, version_1.maybeResolveVersionsAsync)(ctx.projectDir, ctx.exp, androidCtx.buildProfile);
68
+ if (androidCtx.android.versionCodeOverride) {
69
+ return {
70
+ ...resolvedVersion,
71
+ appBuildVersion: androidCtx.android.versionCodeOverride,
72
+ };
73
+ }
74
+ return resolvedVersion;
59
75
  }
60
76
  else {
61
77
  throw new Error(`Unsupported platform ${ctx.platform}`);
@@ -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,6 +153,7 @@ 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,
@@ -148,6 +165,7 @@ async function prepareAndStartBuildAsync({ projectDir, flags, moreBuilds, buildP
148
165
  const appPlatform = (0, AppPlatform_1.toAppPlatform)(buildProfile.platform);
149
166
  log_1.default.log(`${platform_1.appPlatformEmojis[appPlatform]} ${chalk_1.default.bold(`${platform_1.appPlatformDisplayNames[appPlatform]} build`)}`);
150
167
  }
168
+ (0, remoteVersionSource_1.validateAppConfigForRemoteVersionSource)(buildCtx.exp, buildProfile.platform);
151
169
  if (buildCtx.workflow === eas_build_job_1.Workflow.MANAGED) {
152
170
  if (!sdkVersionChecked) {
153
171
  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;
@@ -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) {
@@ -172,6 +172,7 @@ class UpdatePublish extends EasCommand_1.default {
172
172
  let unsortedUpdateInfoGroups = {};
173
173
  let oldMessage, oldRuntimeVersion;
174
174
  let uploadedAssetCount = 0;
175
+ let assetLimitPerUpdateGroup = 0;
175
176
  if (republish) {
176
177
  // If we are republishing, we don't need to worry about building the bundle or uploading the assets.
177
178
  // Instead we get the `updateInfoGroup` from the update we wish to republish.
@@ -270,10 +271,11 @@ class UpdatePublish extends EasCommand_1.default {
270
271
  try {
271
272
  const platforms = platformFlag === 'all' ? exports.defaultPublishPlatforms : [platformFlag];
272
273
  const assets = await (0, publish_1.collectAssetsAsync)({ inputDir: inputDir, platforms });
273
- const { uniqueUploadedAssetCount } = await (0, publish_1.uploadAssetsAsync)(assets, (totalAssets, missingAssets) => {
274
+ const uploadResults = await (0, publish_1.uploadAssetsAsync)(assets, projectId, (totalAssets, missingAssets) => {
274
275
  assetSpinner.text = `Uploading assets. Finished (${totalAssets - missingAssets}/${totalAssets})`;
275
276
  });
276
- uploadedAssetCount = uniqueUploadedAssetCount;
277
+ uploadedAssetCount = uploadResults.uniqueUploadedAssetCount;
278
+ assetLimitPerUpdateGroup = uploadResults.assetLimitPerUpdateGroup;
277
279
  unsortedUpdateInfoGroups = await (0, publish_1.buildUnsortedUpdateInfoGroupAsync)(assets, exp);
278
280
  const uploadAssetSuccessMessage = uploadedAssetCount
279
281
  ? `Uploaded ${uploadedAssetCount} ${uploadedAssetCount === 1 ? 'asset' : 'assets'}!`
@@ -387,6 +389,14 @@ class UpdatePublish extends EasCommand_1.default {
387
389
  { label: 'Website link', value: updateGroupLink },
388
390
  ]));
389
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
+ }
390
400
  }
391
401
  }
392
402
  }