eas-cli 7.6.2 → 7.8.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 (52) hide show
  1. package/README.md +99 -73
  2. package/build/build/android/graphql.js +3 -0
  3. package/build/build/android/prepareJob.d.ts +2 -2
  4. package/build/build/android/prepareJob.js +2 -1
  5. package/build/build/build.d.ts +4 -4
  6. package/build/build/build.js +33 -3
  7. package/build/build/context.d.ts +2 -0
  8. package/build/build/createContext.d.ts +3 -1
  9. package/build/build/createContext.js +2 -1
  10. package/build/build/graphql.d.ts +3 -1
  11. package/build/build/graphql.js +11 -1
  12. package/build/build/ios/graphql.js +3 -0
  13. package/build/build/ios/prepareJob.d.ts +2 -2
  14. package/build/build/ios/prepareJob.js +2 -1
  15. package/build/build/local.js +1 -1
  16. package/build/build/runBuildAndSubmit.d.ts +2 -0
  17. package/build/build/runBuildAndSubmit.js +20 -0
  18. package/build/build/utils/repository.d.ts +4 -2
  19. package/build/build/utils/repository.js +37 -1
  20. package/build/commands/build/index.d.ts +2 -0
  21. package/build/commands/build/index.js +6 -0
  22. package/build/commands/credentials/configure-build.d.ts +18 -0
  23. package/build/commands/credentials/configure-build.js +43 -0
  24. package/build/commands/credentials/index.d.ts +16 -0
  25. package/build/commands/{credentials.js → credentials/index.js} +2 -2
  26. package/build/commands/submit.d.ts +1 -0
  27. package/build/commands/submit.js +7 -1
  28. package/build/credentials/ios/api/graphql/queries/AppleDeviceQuery.js +1 -0
  29. package/build/credentials/manager/Actions.d.ts +2 -1
  30. package/build/credentials/manager/Actions.js +1 -0
  31. package/build/credentials/manager/CheckBuildProfileFlagAgainstEasJson.d.ts +10 -0
  32. package/build/credentials/manager/CheckBuildProfileFlagAgainstEasJson.js +35 -0
  33. package/build/credentials/manager/ManageAndroid.d.ts +9 -5
  34. package/build/credentials/manager/ManageAndroid.js +4 -0
  35. package/build/credentials/manager/ManageIos.d.ts +17 -8
  36. package/build/credentials/manager/SetUpAndroidBuildCredentials.d.ts +7 -0
  37. package/build/credentials/manager/SetUpAndroidBuildCredentials.js +48 -0
  38. package/build/credentials/manager/SetUpBuildCredentialsCommandAction.d.ts +19 -0
  39. package/build/credentials/manager/SetUpBuildCredentialsCommandAction.js +25 -0
  40. package/build/credentials/manager/SetUpIosBuildCredentials.d.ts +7 -0
  41. package/build/credentials/manager/SetUpIosBuildCredentials.js +58 -0
  42. package/build/devices/utils/formatDevice.js +1 -0
  43. package/build/graphql/generated.d.ts +346 -47
  44. package/build/graphql/generated.js +25 -2
  45. package/build/graphql/types/credentials/AppleDevice.js +1 -0
  46. package/build/submit/android/AndroidSubmitter.js +1 -0
  47. package/build/submit/context.d.ts +2 -0
  48. package/build/submit/ios/IosSubmitter.d.ts +1 -0
  49. package/build/submit/ios/IosSubmitter.js +2 -0
  50. package/oclif.manifest.json +92 -32
  51. package/package.json +7 -6
  52. package/build/commands/credentials.d.ts +0 -16
@@ -1,4 +1,4 @@
1
- import { ArchiveSource, Job, Metadata, Platform } from '@expo/eas-build-job';
1
+ import { ArchiveSource, BuildJob, Metadata, Platform } from '@expo/eas-build-job';
2
2
  import { CredentialsSource } from '@expo/eas-json';
3
3
  import { BuildContext } from './context';
4
4
  import { ExpoGraphqlClient } from '../commandUtils/context/contextUtils/createGraphqlClient';
@@ -12,15 +12,15 @@ export interface JobData<Credentials> {
12
12
  credentials?: Credentials;
13
13
  projectArchive: ArchiveSource;
14
14
  }
15
- interface Builder<TPlatform extends Platform, Credentials, TJob extends Job> {
15
+ interface Builder<TPlatform extends Platform, Credentials, TJob extends BuildJob> {
16
16
  ctx: BuildContext<TPlatform>;
17
17
  ensureCredentialsAsync(ctx: BuildContext<TPlatform>): Promise<CredentialsResult<Credentials> | undefined>;
18
18
  syncProjectConfigurationAsync(ctx: BuildContext<TPlatform>): Promise<void>;
19
- prepareJobAsync(ctx: BuildContext<TPlatform>, jobData: JobData<Credentials>): Promise<Job>;
19
+ prepareJobAsync(ctx: BuildContext<TPlatform>, jobData: JobData<Credentials>): Promise<BuildJob>;
20
20
  sendBuildRequestAsync(appId: string, job: TJob, metadata: Metadata, buildParams: BuildParamsInput): Promise<BuildResult>;
21
21
  }
22
22
  export type BuildRequestSender = () => Promise<BuildFragment | undefined>;
23
- export declare function prepareBuildRequestForPlatformAsync<TPlatform extends Platform, Credentials, TJob extends Job>(builder: Builder<TPlatform, Credentials, TJob>): Promise<BuildRequestSender>;
23
+ export declare function prepareBuildRequestForPlatformAsync<TPlatform extends Platform, Credentials, TJob extends BuildJob>(builder: Builder<TPlatform, Credentials, TJob>): Promise<BuildRequestSender>;
24
24
  export declare function handleBuildRequestError(error: any, platform: Platform): never;
25
25
  export type MaybeBuildFragment = BuildFragment | null;
26
26
  export declare function waitForBuildEndAsync(graphqlClient: ExpoGraphqlClient, { buildIds, accountName }: {
@@ -55,9 +55,10 @@ async function prepareBuildRequestForPlatformAsync(builder) {
55
55
  }
56
56
  let projectArchive;
57
57
  if (ctx.localBuildOptions.localBuildMode === local_1.LocalBuildMode.LOCAL_BUILD_PLUGIN) {
58
+ const projectPath = (await (0, repository_1.makeProjectTarballAsync)(ctx.vcsClient)).path;
58
59
  projectArchive = {
59
60
  type: eas_build_job_1.ArchiveSourceType.PATH,
60
- path: (await (0, repository_1.makeProjectTarballAsync)(ctx.vcsClient)).path,
61
+ path: projectPath,
61
62
  };
62
63
  }
63
64
  else if (ctx.localBuildOptions.localBuildMode === local_1.LocalBuildMode.INTERNAL) {
@@ -69,7 +70,7 @@ async function prepareBuildRequestForPlatformAsync(builder) {
69
70
  else if (!ctx.localBuildOptions.localBuildMode) {
70
71
  projectArchive = {
71
72
  type: eas_build_job_1.ArchiveSourceType.GCS,
72
- bucketKey: await uploadProjectAsync(ctx),
73
+ ...(await uploadProjectAsync(ctx)),
73
74
  };
74
75
  }
75
76
  (0, assert_1.default)(projectArchive);
@@ -168,7 +169,11 @@ async function uploadProjectAsync(ctx) {
168
169
  message: ratio => `Uploading to EAS Build (${(0, files_1.formatBytes)(projectTarball.size * ratio)} / ${(0, files_1.formatBytes)(projectTarball.size)})`,
169
170
  completedMessage: (duration) => `Uploaded to EAS ${chalk_1.default.dim(duration)}`,
170
171
  }));
171
- return bucketKey;
172
+ const { metadataLocation } = await uploadMetadataFileAsync(projectTarball, ctx);
173
+ if (metadataLocation) {
174
+ return { bucketKey, metadataLocation };
175
+ }
176
+ return { bucketKey };
172
177
  }, {
173
178
  attemptEvent: AnalyticsManager_1.BuildEvent.PROJECT_UPLOAD_ATTEMPT,
174
179
  successEvent: AnalyticsManager_1.BuildEvent.PROJECT_UPLOAD_SUCCESS,
@@ -189,6 +194,31 @@ async function uploadProjectAsync(ctx) {
189
194
  }
190
195
  }
191
196
  }
197
+ async function uploadMetadataFileAsync(projectTarball, ctx) {
198
+ let projectMetadataFile = null;
199
+ try {
200
+ projectMetadataFile = await (0, repository_1.makeProjectMetadataFileAsync)(projectTarball.path);
201
+ const metadataLocation = await (0, uploads_1.uploadFileAtPathToGCSAsync)(ctx.graphqlClient, generated_1.UploadSessionType.EasBuildGcsProjectMetadata, projectMetadataFile.path, (0, progress_1.createProgressTracker)({
202
+ total: projectMetadataFile.size,
203
+ message: ratio => `Uploading metadata to EAS Build (${(0, files_1.formatBytes)(projectMetadataFile.size * ratio)} / ${(0, files_1.formatBytes)(projectMetadataFile.size)})`,
204
+ completedMessage: (duration) => `Uploaded to EAS ${chalk_1.default.dim(duration)}`,
205
+ }));
206
+ return { metadataLocation };
207
+ }
208
+ catch (err) {
209
+ let errMessage = 'Failed to upload metadata to EAS Build';
210
+ if (err.message) {
211
+ errMessage += `\n\nReason: ${err.message}`;
212
+ }
213
+ log_1.default.warn(errMessage);
214
+ return { metadataLocation: null };
215
+ }
216
+ finally {
217
+ if (projectMetadataFile) {
218
+ await fs_extra_1.default.remove(projectMetadataFile.path);
219
+ }
220
+ }
221
+ }
192
222
  async function sendBuildRequestAsync(builder, job, metadata, buildParams) {
193
223
  const { ctx } = builder;
194
224
  return await (0, common_1.withAnalyticsAsync)(ctx.analytics, async () => {
@@ -1,6 +1,7 @@
1
1
  import { ExpoConfig } from '@expo/config';
2
2
  import { Platform, Workflow } from '@expo/eas-build-job';
3
3
  import { BuildProfile, EasJson } from '@expo/eas-json';
4
+ import { LoggerLevel } from '@expo/logger';
4
5
  import { NodePackageManager } from '@expo/package-manager';
5
6
  import { LocalBuildOptions } from './local';
6
7
  import { Analytics, AnalyticsEventProperties } from '../analytics/AnalyticsManager';
@@ -55,4 +56,5 @@ export interface BuildContext<T extends Platform> {
55
56
  developmentClient: boolean;
56
57
  requiredPackageManager: NodePackageManager['name'] | null;
57
58
  vcsClient: Client;
59
+ loggerLevel?: LoggerLevel;
58
60
  }
@@ -1,5 +1,6 @@
1
1
  import { Platform } from '@expo/eas-build-job';
2
2
  import { BuildProfile, EasJson, ResourceClass } from '@expo/eas-json';
3
+ import { LoggerLevel } from '@expo/logger';
3
4
  import { BuildContext } from './context';
4
5
  import { LocalBuildOptions } from './local';
5
6
  import { Analytics } from '../analytics/AnalyticsManager';
@@ -8,7 +9,7 @@ import { ExpoGraphqlClient } from '../commandUtils/context/contextUtils/createGr
8
9
  import { CustomBuildConfigMetadata } from '../project/customBuildConfig';
9
10
  import { Actor } from '../user/User';
10
11
  import { Client } from '../vcs/vcs';
11
- export declare function createBuildContextAsync<T extends Platform>({ buildProfileName, buildProfile, easJsonCliConfig, clearCache, localBuildOptions, nonInteractive, noWait, platform, projectDir, resourceClassFlag, message, actor, graphqlClient, analytics, vcsClient, getDynamicPrivateProjectConfigAsync, customBuildConfigMetadata, }: {
12
+ export declare function createBuildContextAsync<T extends Platform>({ buildProfileName, buildProfile, easJsonCliConfig, clearCache, localBuildOptions, nonInteractive, noWait, platform, projectDir, resourceClassFlag, message, actor, graphqlClient, analytics, vcsClient, getDynamicPrivateProjectConfigAsync, customBuildConfigMetadata, buildLoggerLevel, }: {
12
13
  buildProfileName: string;
13
14
  buildProfile: BuildProfile<T>;
14
15
  easJsonCliConfig: EasJson['cli'];
@@ -26,4 +27,5 @@ export declare function createBuildContextAsync<T extends Platform>({ buildProfi
26
27
  vcsClient: Client;
27
28
  getDynamicPrivateProjectConfigAsync: DynamicConfigContextFn;
28
29
  customBuildConfigMetadata?: CustomBuildConfigMetadata;
30
+ buildLoggerLevel?: LoggerLevel;
29
31
  }): Promise<BuildContext<T>>;
@@ -15,7 +15,7 @@ const AnalyticsManager_1 = require("../analytics/AnalyticsManager");
15
15
  const context_1 = require("../credentials/context");
16
16
  const projectUtils_1 = require("../project/projectUtils");
17
17
  const workflow_1 = require("../project/workflow");
18
- async function createBuildContextAsync({ buildProfileName, buildProfile, easJsonCliConfig, clearCache = false, localBuildOptions, nonInteractive, noWait, platform, projectDir, resourceClassFlag, message, actor, graphqlClient, analytics, vcsClient, getDynamicPrivateProjectConfigAsync, customBuildConfigMetadata, }) {
18
+ async function createBuildContextAsync({ buildProfileName, buildProfile, easJsonCliConfig, clearCache = false, localBuildOptions, nonInteractive, noWait, platform, projectDir, resourceClassFlag, message, actor, graphqlClient, analytics, vcsClient, getDynamicPrivateProjectConfigAsync, customBuildConfigMetadata, buildLoggerLevel, }) {
19
19
  var _a, _b;
20
20
  const { exp, projectId } = await getDynamicPrivateProjectConfigAsync({ env: buildProfile.env });
21
21
  const projectName = exp.slug;
@@ -83,6 +83,7 @@ async function createBuildContextAsync({ buildProfileName, buildProfile, easJson
83
83
  customBuildConfigMetadata,
84
84
  developmentClient,
85
85
  requiredPackageManager,
86
+ loggerLevel: buildLoggerLevel,
86
87
  };
87
88
  if (platform === eas_build_job_1.Platform.ANDROID) {
88
89
  const common = commonContext;
@@ -1,8 +1,10 @@
1
1
  import { ArchiveSource, BuildMode, BuildTrigger, Metadata, Workflow } from '@expo/eas-build-job';
2
- import { BuildIosEnterpriseProvisioning, BuildMetadataInput, BuildWorkflow, BuildMode as GraphQLBuildMode, BuildTrigger as GraphQLBuildTrigger, ProjectArchiveSourceInput } from '../graphql/generated';
2
+ import { LoggerLevel } from '@expo/logger';
3
+ import { BuildIosEnterpriseProvisioning, BuildMetadataInput, BuildWorkflow, BuildMode as GraphQLBuildMode, BuildTrigger as GraphQLBuildTrigger, ProjectArchiveSourceInput, WorkerLoggerLevel } from '../graphql/generated';
3
4
  export declare function transformProjectArchive(archiveSource: ArchiveSource): ProjectArchiveSourceInput;
4
5
  export declare function transformMetadata(metadata: Metadata): BuildMetadataInput;
5
6
  export declare function transformWorkflow(workflow: Workflow): BuildWorkflow;
6
7
  export declare function transformIosEnterpriseProvisioning(enterpriseProvisioning: Metadata['iosEnterpriseProvisioning']): BuildIosEnterpriseProvisioning;
7
8
  export declare function transformBuildMode(buildMode: BuildMode): GraphQLBuildMode;
8
9
  export declare function transformBuildTrigger(buildTrigger: BuildTrigger): GraphQLBuildTrigger;
10
+ export declare const loggerLevelToGraphQLWorkerLoggerLevel: Record<LoggerLevel, WorkerLoggerLevel>;
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.transformBuildTrigger = exports.transformBuildMode = exports.transformIosEnterpriseProvisioning = exports.transformWorkflow = exports.transformMetadata = exports.transformProjectArchive = void 0;
3
+ exports.loggerLevelToGraphQLWorkerLoggerLevel = exports.transformBuildTrigger = exports.transformBuildMode = exports.transformIosEnterpriseProvisioning = exports.transformWorkflow = exports.transformMetadata = exports.transformProjectArchive = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const eas_build_job_1 = require("@expo/eas-build-job");
6
+ const logger_1 = require("@expo/logger");
6
7
  const assert_1 = tslib_1.__importDefault(require("assert"));
7
8
  const generated_1 = require("../graphql/generated");
8
9
  function transformProjectArchive(archiveSource) {
@@ -10,6 +11,7 @@ function transformProjectArchive(archiveSource) {
10
11
  return {
11
12
  type: generated_1.ProjectArchiveSourceType.Gcs,
12
13
  bucketKey: archiveSource.bucketKey,
14
+ metadataLocation: archiveSource.metadataLocation,
13
15
  };
14
16
  }
15
17
  else if (archiveSource.type === eas_build_job_1.ArchiveSourceType.URL) {
@@ -92,3 +94,11 @@ function transformBuildTrigger(buildTrigger) {
92
94
  throw new Error('Unknown build trigger');
93
95
  }
94
96
  exports.transformBuildTrigger = transformBuildTrigger;
97
+ exports.loggerLevelToGraphQLWorkerLoggerLevel = {
98
+ [logger_1.LoggerLevel.TRACE]: generated_1.WorkerLoggerLevel.Trace,
99
+ [logger_1.LoggerLevel.DEBUG]: generated_1.WorkerLoggerLevel.Debug,
100
+ [logger_1.LoggerLevel.INFO]: generated_1.WorkerLoggerLevel.Info,
101
+ [logger_1.LoggerLevel.WARN]: generated_1.WorkerLoggerLevel.Warn,
102
+ [logger_1.LoggerLevel.ERROR]: generated_1.WorkerLoggerLevel.Error,
103
+ [logger_1.LoggerLevel.FATAL]: generated_1.WorkerLoggerLevel.Fatal,
104
+ };
@@ -27,6 +27,9 @@ function transformJob(job) {
27
27
  experimental: job.experimental,
28
28
  mode: (0, graphql_1.transformBuildMode)(job.mode),
29
29
  customBuildConfig: job.customBuildConfig,
30
+ loggerLevel: job.loggerLevel
31
+ ? graphql_1.loggerLevelToGraphQLWorkerLoggerLevel[job.loggerLevel]
32
+ : undefined,
30
33
  };
31
34
  }
32
35
  exports.transformJob = transformJob;
@@ -1,4 +1,4 @@
1
- import { ArchiveSource, Job, Platform } from '@expo/eas-build-job';
1
+ import { ArchiveSource, Ios, Platform } from '@expo/eas-build-job';
2
2
  import { IosCredentials } from '../../credentials/ios/types';
3
3
  import { IosJobSecretsInput } from '../../graphql/generated';
4
4
  import { BuildContext } from '../context';
@@ -7,6 +7,6 @@ interface JobData {
7
7
  credentials?: IosCredentials;
8
8
  buildScheme: string;
9
9
  }
10
- export declare function prepareJobAsync(ctx: BuildContext<Platform.IOS>, jobData: JobData): Promise<Job>;
10
+ export declare function prepareJobAsync(ctx: BuildContext<Platform.IOS>, jobData: JobData): Promise<Ios.Job>;
11
11
  export declare function prepareCredentialsToResign(credentials: IosCredentials): IosJobSecretsInput;
12
12
  export {};
@@ -76,8 +76,9 @@ async function prepareJobAsync(ctx, jobData) {
76
76
  path: maybeCustomBuildConfigPath,
77
77
  },
78
78
  }),
79
+ loggerLevel: ctx.loggerLevel,
79
80
  };
80
- return (0, eas_build_job_1.sanitizeJob)(job);
81
+ return (0, eas_build_job_1.sanitizeBuildJob)(job);
81
82
  }
82
83
  exports.prepareJobAsync = prepareJobAsync;
83
84
  function prepareCredentialsToResign(credentials) {
@@ -6,7 +6,7 @@ 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 = '1.0.89';
9
+ const PLUGIN_PACKAGE_VERSION = '1.0.96';
10
10
  var LocalBuildMode;
11
11
  (function (LocalBuildMode) {
12
12
  /**
@@ -1,4 +1,5 @@
1
1
  import { ResourceClass } from '@expo/eas-json';
2
+ import { LoggerLevel } from '@expo/logger';
2
3
  import { LocalBuildOptions } from './local';
3
4
  import { Analytics } from '../analytics/AnalyticsManager';
4
5
  import { DynamicConfigContextFn } from '../commandUtils/context/DynamicProjectConfigContextField';
@@ -18,5 +19,6 @@ export interface BuildFlags {
18
19
  localBuildOptions: LocalBuildOptions;
19
20
  resourceClass?: ResourceClass;
20
21
  message?: string;
22
+ buildLoggerLevel?: LoggerLevel;
21
23
  }
22
24
  export declare function runBuildAndSubmitAsync(graphqlClient: ExpoGraphqlClient, analytics: Analytics, vcsClient: Client, projectDir: string, flags: BuildFlags, actor: Actor, getDynamicPrivateProjectConfigAsync: DynamicConfigContextFn): Promise<void>;
@@ -63,6 +63,24 @@ async function runBuildAndSubmitAsync(graphqlClient, analytics, vcsClient, proje
63
63
  log_1.default.log(`Loaded "env" configuration for the "${buildProfiles[0].profileName}" profile: ${buildProfiles[0].profile.env
64
64
  ? Object.keys(buildProfiles[0].profile.env).join(', ')
65
65
  : 'no environment variables specified'}. ${(0, log_1.learnMore)('https://docs.expo.dev/build-reference/variables/')}`);
66
+ for (const buildProfile of buildProfiles) {
67
+ if (buildProfile.profile.image && ['default', 'stable'].includes(buildProfile.profile.image)) {
68
+ log_1.default.warn(`The "image" field in the build profile "${buildProfile.profileName}" is set to "${buildProfile.profile.image}". This tag is deprecated and will be removed in the future. Use other images or tags listed here: https://docs.expo.dev/build-reference/infrastructure/`);
69
+ }
70
+ if (buildProfile.profile.image &&
71
+ [
72
+ 'macos-monterey-12.4-xcode-13.4',
73
+ 'macos-monterey-12.3-xcode-13.3',
74
+ 'macos-monterey-12.1-xcode-13.2',
75
+ 'macos-ventura-13.4-xcode-14.3.1',
76
+ 'macos-ventura-13.3-xcode-14.3',
77
+ 'macos-monterey-12.6-xcode-14.2',
78
+ 'macos-monterey-12.6-xcode-14.1',
79
+ 'macos-monterey-12.6-xcode-14.0',
80
+ ].includes(buildProfile.profile.image)) {
81
+ log_1.default.warn(`The "image" field in the build profile "${buildProfile.profileName}" is set to "${buildProfile.profile.image}". This image is using Xcode in version lower then 15. Apple's new requirement states that starting on April 29th, 2024, apps uploaded to App Store Connect must be built with Xcode 15 for iOS 17, iPadOS 17, tvOS 17, or watchOS 10. Start using Xcode 15 image today by setting "macos-sonoma-14.4-xcode-15.3" or "latest" as your image value. This image will be removed from EAS Build on May 29th, 2024. ${(0, log_1.learnMore)('https://expo.dev/changelog/2024/03-29-eas-build-upcoming-ios-images-updates')}`);
82
+ }
83
+ }
66
84
  await (0, devClient_1.ensureExpoDevClientInstalledForDevClientBuildsAsync)({
67
85
  projectDir,
68
86
  nonInteractive: flags.nonInteractive,
@@ -200,6 +218,7 @@ async function prepareAndStartBuildAsync({ projectDir, flags, moreBuilds, buildP
200
218
  vcsClient,
201
219
  getDynamicPrivateProjectConfigAsync,
202
220
  customBuildConfigMetadata,
221
+ buildLoggerLevel: flags.buildLoggerLevel,
203
222
  });
204
223
  if (moreBuilds) {
205
224
  log_1.default.newLine();
@@ -278,6 +297,7 @@ async function prepareAndStartSubmissionAsync({ build, buildCtx, moreBuilds, pro
278
297
  projectId: buildCtx.projectId,
279
298
  exp: buildCtx.exp,
280
299
  vcsClient: buildCtx.vcsClient,
300
+ isVerboseFastlaneEnabled: false,
281
301
  });
282
302
  if (moreBuilds) {
283
303
  log_1.default.newLine();
@@ -5,10 +5,12 @@ export declare function commitPromptAsync(vcsClient: Client, { initialCommitMess
5
5
  initialCommitMessage?: string;
6
6
  commitAllFiles?: boolean;
7
7
  }): Promise<void>;
8
- export declare function makeProjectTarballAsync(vcsClient: Client): Promise<{
8
+ export type LocalFile = {
9
9
  path: string;
10
10
  size: number;
11
- }>;
11
+ };
12
+ export declare function makeProjectMetadataFileAsync(archivePath: string): Promise<LocalFile>;
13
+ export declare function makeProjectTarballAsync(vcsClient: Client): Promise<LocalFile>;
12
14
  export declare function reviewAndCommitChangesAsync(vcsClient: Client, initialCommitMessage: string, { nonInteractive, askedFirstTime }: {
13
15
  nonInteractive: boolean;
14
16
  askedFirstTime?: boolean;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.reviewAndCommitChangesAsync = exports.makeProjectTarballAsync = exports.commitPromptAsync = exports.ensureRepoIsCleanAsync = exports.maybeBailOnRepoStatusAsync = void 0;
3
+ exports.reviewAndCommitChangesAsync = exports.makeProjectTarballAsync = exports.makeProjectMetadataFileAsync = exports.commitPromptAsync = exports.ensureRepoIsCleanAsync = exports.maybeBailOnRepoStatusAsync = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const chalk_1 = tslib_1.__importDefault(require("chalk"));
6
6
  const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
@@ -70,6 +70,42 @@ async function commitPromptAsync(vcsClient, { initialCommitMessage, commitAllFil
70
70
  });
71
71
  }
72
72
  exports.commitPromptAsync = commitPromptAsync;
73
+ async function makeProjectMetadataFileAsync(archivePath) {
74
+ const spinner = (0, ora_1.ora)('Creating project metadata file');
75
+ const timerLabel = 'makeProjectMetadataFileAsync';
76
+ const timer = setTimeout(() => {
77
+ spinner.start();
78
+ }, log_1.default.isDebug ? 1 : 1000);
79
+ (0, timer_1.startTimer)(timerLabel);
80
+ const metadataLocation = path_1.default.join((0, paths_1.getTmpDirectory)(), `${(0, uuid_1.v4)()}-eas-build-metadata.json`);
81
+ const archiveContent = [];
82
+ try {
83
+ await tar_1.default.list({
84
+ file: archivePath,
85
+ onentry: (entry) => {
86
+ if (entry.type === 'File' && !entry.path.includes('.git/')) {
87
+ archiveContent.push(entry.path);
88
+ }
89
+ },
90
+ });
91
+ await fs_extra_1.default.writeJSON(metadataLocation, {
92
+ archiveContent,
93
+ });
94
+ }
95
+ catch (e) {
96
+ clearTimeout(timer);
97
+ if (spinner.isSpinning) {
98
+ spinner.fail();
99
+ }
100
+ throw e;
101
+ }
102
+ clearTimeout(timer);
103
+ const duration = (0, timer_1.endTimer)(timerLabel);
104
+ const prettyTime = (0, timer_1.formatMilliseconds)(duration);
105
+ spinner.succeed(`Created project metadata file ${chalk_1.default.dim(prettyTime)}`);
106
+ return { path: metadataLocation, size: await fs_extra_1.default.stat(metadataLocation).then(stat => stat.size) };
107
+ }
108
+ exports.makeProjectMetadataFileAsync = makeProjectMetadataFileAsync;
73
109
  async function makeProjectTarballAsync(vcsClient) {
74
110
  const spinner = (0, ora_1.ora)('Compressing project files');
75
111
  await fs_extra_1.default.mkdirp((0, paths_1.getTmpDirectory)());
@@ -1,4 +1,5 @@
1
1
  import { ResourceClass } from '@expo/eas-json';
2
+ import { LoggerLevel } from '@expo/logger';
2
3
  import EasCommand from '../../commandUtils/EasCommand';
3
4
  export default class Build extends EasCommand {
4
5
  static description: string;
@@ -17,6 +18,7 @@ export default class Build extends EasCommand {
17
18
  'auto-submit-with-profile': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
18
19
  'resource-class': import("@oclif/core/lib/interfaces").OptionFlag<ResourceClass | undefined>;
19
20
  message: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
21
+ 'build-logger-level': import("@oclif/core/lib/interfaces").OptionFlag<LoggerLevel | undefined>;
20
22
  };
21
23
  static contextDefinition: {
22
24
  vcsClient: import("../../commandUtils/context/VcsClientContextField").default;
@@ -5,6 +5,7 @@ exports.handleDeprecatedEasJsonAsync = void 0;
5
5
  const tslib_1 = require("tslib");
6
6
  const eas_build_job_1 = require("@expo/eas-build-job");
7
7
  const eas_json_1 = require("@expo/eas-json");
8
+ const logger_1 = require("@expo/logger");
8
9
  const core_1 = require("@oclif/core");
9
10
  const chalk_1 = tslib_1.__importDefault(require("chalk"));
10
11
  const figures_1 = tslib_1.__importDefault(require("figures"));
@@ -87,6 +88,7 @@ class Build extends EasCommand_1.default {
87
88
  submitProfile: (_b = flags['auto-submit-with-profile']) !== null && _b !== void 0 ? _b : profile,
88
89
  resourceClass: flags['resource-class'],
89
90
  message,
91
+ buildLoggerLevel: flags['build-logger-level'],
90
92
  };
91
93
  }
92
94
  async ensurePlatformSelectedAsync(flags) {
@@ -175,6 +177,10 @@ Build.flags = {
175
177
  char: 'm',
176
178
  description: 'A short message describing the build',
177
179
  }),
180
+ 'build-logger-level': core_1.Flags.enum({
181
+ description: 'The level of logs to output during the build process. Defaults to "info".',
182
+ options: Object.values(logger_1.LoggerLevel),
183
+ }),
178
184
  ...flags_1.EasNonInteractiveAndJsonFlags,
179
185
  };
180
186
  Build.contextDefinition = {
@@ -0,0 +1,18 @@
1
+ import { Platform } from '@expo/eas-build-job';
2
+ import EasCommand from '../../commandUtils/EasCommand';
3
+ export default class InitializeBuildCredentials extends EasCommand {
4
+ static description: string;
5
+ static flags: {
6
+ platform: import("@oclif/core/lib/interfaces").OptionFlag<Platform | undefined>;
7
+ profile: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
8
+ };
9
+ static contextDefinition: {
10
+ vcsClient: import("../../commandUtils/context/VcsClientContextField").default;
11
+ analytics: import("../../commandUtils/context/AnalyticsContextField").default;
12
+ getDynamicPublicProjectConfigAsync: import("../../commandUtils/context/DynamicProjectConfigContextField").DynamicPublicProjectConfigContextField;
13
+ getDynamicPrivateProjectConfigAsync: import("../../commandUtils/context/DynamicProjectConfigContextField").DynamicPrivateProjectConfigContextField;
14
+ loggedIn: import("../../commandUtils/context/LoggedInContextField").default;
15
+ privateProjectConfig: import("../../commandUtils/context/PrivateProjectConfigContextField").PrivateProjectConfigContextField;
16
+ };
17
+ runAsync(): Promise<void>;
18
+ }
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ var _a;
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ const tslib_1 = require("tslib");
5
+ const eas_build_job_1 = require("@expo/eas-build-job");
6
+ const core_1 = require("@oclif/core");
7
+ const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
8
+ const SelectBuildProfileFromEasJson_1 = require("../../credentials/manager/SelectBuildProfileFromEasJson");
9
+ const SetUpBuildCredentialsCommandAction_1 = require("../../credentials/manager/SetUpBuildCredentialsCommandAction");
10
+ const platform_1 = require("../../platform");
11
+ class InitializeBuildCredentials extends EasCommand_1.default {
12
+ async runAsync() {
13
+ var _b;
14
+ const { flags } = await this.parse(_a);
15
+ const { loggedIn: { actor, graphqlClient }, privateProjectConfig, getDynamicPrivateProjectConfigAsync, analytics, vcsClient, } = await this.getContextAsync(_a, {
16
+ nonInteractive: false,
17
+ });
18
+ const platform = await (0, platform_1.selectPlatformAsync)(flags.platform);
19
+ const buildProfile = (_b = flags.profile) !== null && _b !== void 0 ? _b : (await new SelectBuildProfileFromEasJson_1.SelectBuildProfileFromEasJson(privateProjectConfig.projectDir, eas_build_job_1.Platform.IOS).getProfileNameFromEasConfigAsync());
20
+ await new SetUpBuildCredentialsCommandAction_1.SetUpBuildCredentialsCommandAction(actor, graphqlClient, vcsClient, analytics, privateProjectConfig !== null && privateProjectConfig !== void 0 ? privateProjectConfig : null, getDynamicPrivateProjectConfigAsync, platform, buildProfile).runAsync();
21
+ }
22
+ }
23
+ _a = InitializeBuildCredentials;
24
+ InitializeBuildCredentials.description = 'Set up credentials for building your project.';
25
+ InitializeBuildCredentials.flags = {
26
+ platform: core_1.Flags.enum({
27
+ char: 'p',
28
+ options: [eas_build_job_1.Platform.ANDROID, eas_build_job_1.Platform.IOS],
29
+ }),
30
+ profile: core_1.Flags.string({
31
+ char: 'e',
32
+ description: 'The name of the build profile in eas.json.',
33
+ helpValue: 'PROFILE_NAME',
34
+ }),
35
+ };
36
+ InitializeBuildCredentials.contextDefinition = {
37
+ ..._a.ContextOptions.LoggedIn,
38
+ ..._a.ContextOptions.ProjectConfig,
39
+ ..._a.ContextOptions.DynamicProjectConfig,
40
+ ..._a.ContextOptions.Analytics,
41
+ ..._a.ContextOptions.Vcs,
42
+ };
43
+ exports.default = InitializeBuildCredentials;
@@ -0,0 +1,16 @@
1
+ import EasCommand from '../../commandUtils/EasCommand';
2
+ export default class Credentials extends EasCommand {
3
+ static description: string;
4
+ static flags: {
5
+ platform: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
6
+ };
7
+ static contextDefinition: {
8
+ vcsClient: import("../../commandUtils/context/VcsClientContextField").default;
9
+ analytics: import("../../commandUtils/context/AnalyticsContextField").default;
10
+ getDynamicPublicProjectConfigAsync: import("../../commandUtils/context/DynamicProjectConfigContextField").DynamicPublicProjectConfigContextField;
11
+ getDynamicPrivateProjectConfigAsync: import("../../commandUtils/context/DynamicProjectConfigContextField").DynamicPrivateProjectConfigContextField;
12
+ privateProjectConfig: import("../../commandUtils/context/OptionalPrivateProjectConfigContextField").OptionalPrivateProjectConfigContextField;
13
+ loggedIn: import("../../commandUtils/context/LoggedInContextField").default;
14
+ };
15
+ runAsync(): Promise<void>;
16
+ }
@@ -3,8 +3,8 @@ var _a;
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  const tslib_1 = require("tslib");
5
5
  const core_1 = require("@oclif/core");
6
- const EasCommand_1 = tslib_1.__importDefault(require("../commandUtils/EasCommand"));
7
- const SelectPlatform_1 = require("../credentials/manager/SelectPlatform");
6
+ const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
7
+ const SelectPlatform_1 = require("../../credentials/manager/SelectPlatform");
8
8
  class Credentials extends EasCommand_1.default {
9
9
  async runAsync() {
10
10
  const { flags } = await this.parse(_a);
@@ -11,6 +11,7 @@ export default class Submit extends EasCommand {
11
11
  url: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
12
12
  verbose: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
13
13
  wait: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
14
+ 'verbose-fastlane': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
14
15
  'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
15
16
  };
16
17
  static contextDefinition: {
@@ -41,6 +41,7 @@ class Submit extends EasCommand_1.default {
41
41
  profile: submissionProfile.profile,
42
42
  archiveFlags: flagsWithPlatform.archiveFlags,
43
43
  nonInteractive: flagsWithPlatform.nonInteractive,
44
+ isVerboseFastlaneEnabled: flagsWithPlatform.isVerboseFastlaneEnabled,
44
45
  actor,
45
46
  graphqlClient,
46
47
  analytics,
@@ -67,7 +68,7 @@ class Submit extends EasCommand_1.default {
67
68
  }
68
69
  }
69
70
  sanitizeFlags(flags) {
70
- const { platform, verbose, wait, profile, 'non-interactive': nonInteractive, ...archiveFlags } = flags;
71
+ const { platform, verbose, wait, profile, 'non-interactive': nonInteractive, 'verbose-fastlane': isVerboseFastlaneEnabled, ...archiveFlags } = flags;
71
72
  if (!flags.platform && nonInteractive) {
72
73
  core_1.Errors.error('--platform is required when building in non-interactive mode', { exit: 1 });
73
74
  }
@@ -82,6 +83,7 @@ class Submit extends EasCommand_1.default {
82
83
  wait,
83
84
  profile,
84
85
  nonInteractive,
86
+ isVerboseFastlaneEnabled,
85
87
  };
86
88
  }
87
89
  async ensurePlatformSelectedAsync(flags) {
@@ -134,6 +136,10 @@ Submit.flags = {
134
136
  default: true,
135
137
  allowNo: true,
136
138
  }),
139
+ 'verbose-fastlane': core_1.Flags.boolean({
140
+ default: false,
141
+ description: 'Enable verbose logging for the submission process',
142
+ }),
137
143
  'non-interactive': core_1.Flags.boolean({
138
144
  default: false,
139
145
  description: 'Run command in non-interactive mode',
@@ -68,6 +68,7 @@ exports.AppleDeviceQuery = {
68
68
  deviceClass
69
69
  enabled
70
70
  model
71
+ createdAt
71
72
  }
72
73
  }
73
74
  }
@@ -32,7 +32,8 @@ export declare enum AndroidActionType {
32
32
  RemoveGsaKeyForFcmV1 = 20,
33
33
  SetUpGsaKeyForFcmV1 = 21,
34
34
  UpdateCredentialsJson = 22,
35
- SetUpBuildCredentialsFromCredentialsJson = 23
35
+ SetUpBuildCredentialsFromCredentialsJson = 23,
36
+ SetUpBuildCredentials = 24
36
37
  }
37
38
  export declare enum IosActionType {
38
39
  ManageCredentialsJson = 0,
@@ -33,6 +33,7 @@ var AndroidActionType;
33
33
  AndroidActionType[AndroidActionType["SetUpGsaKeyForFcmV1"] = 21] = "SetUpGsaKeyForFcmV1";
34
34
  AndroidActionType[AndroidActionType["UpdateCredentialsJson"] = 22] = "UpdateCredentialsJson";
35
35
  AndroidActionType[AndroidActionType["SetUpBuildCredentialsFromCredentialsJson"] = 23] = "SetUpBuildCredentialsFromCredentialsJson";
36
+ AndroidActionType[AndroidActionType["SetUpBuildCredentials"] = 24] = "SetUpBuildCredentials";
36
37
  })(AndroidActionType || (exports.AndroidActionType = AndroidActionType = {}));
37
38
  var IosActionType;
38
39
  (function (IosActionType) {
@@ -0,0 +1,10 @@
1
+ import { Platform } from '@expo/eas-build-job';
2
+ import { BuildProfile } from '@expo/eas-json';
3
+ export declare class CheckBuildProfileFlagAgainstEasJson<T extends Platform> {
4
+ private platform;
5
+ private profileNameFromFlag;
6
+ private easJsonAccessor;
7
+ constructor(projectDir: string, platform: T, profileNameFromFlag: string);
8
+ runAsync(): Promise<BuildProfile<T>>;
9
+ getProfileNameFromEasConfigAsync(): Promise<string>;
10
+ }
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CheckBuildProfileFlagAgainstEasJson = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const eas_json_1 = require("@expo/eas-json");
6
+ const log_1 = tslib_1.__importDefault(require("../../log"));
7
+ class CheckBuildProfileFlagAgainstEasJson {
8
+ constructor(projectDir, platform, profileNameFromFlag) {
9
+ this.platform = platform;
10
+ this.profileNameFromFlag = profileNameFromFlag;
11
+ this.easJsonAccessor = eas_json_1.EasJsonAccessor.fromProjectPath(projectDir);
12
+ }
13
+ async runAsync() {
14
+ const profileName = await this.getProfileNameFromEasConfigAsync();
15
+ const easConfig = await eas_json_1.EasJsonUtils.getBuildProfileAsync(this.easJsonAccessor, this.platform, profileName);
16
+ log_1.default.succeed(`Using build profile: ${profileName}`);
17
+ return easConfig;
18
+ }
19
+ async getProfileNameFromEasConfigAsync() {
20
+ const buildProfileNames = await eas_json_1.EasJsonUtils.getBuildProfileNamesAsync(this.easJsonAccessor);
21
+ if (buildProfileNames.length === 0) {
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');
23
+ }
24
+ else if (buildProfileNames.length === 1) {
25
+ return buildProfileNames[0];
26
+ }
27
+ if (buildProfileNames.includes(this.profileNameFromFlag)) {
28
+ return this.profileNameFromFlag;
29
+ }
30
+ else {
31
+ throw new Error(`Build profile ${this.profileNameFromFlag} does not exist in eas.json. Go to https://docs.expo.dev/build/eas-json/ for more details`);
32
+ }
33
+ }
34
+ }
35
+ exports.CheckBuildProfileFlagAgainstEasJson = CheckBuildProfileFlagAgainstEasJson;