eas-cli 9.1.0 → 10.0.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.
@@ -162,12 +162,14 @@ async function uploadProjectAsync(ctx) {
162
162
  throw new Error('Project archive is too big. Maximum allowed size is 2GB.');
163
163
  }
164
164
  projectTarballPath = projectTarball.path;
165
- const bucketKey = await (0, uploads_1.uploadFileAtPathToGCSAsync)(ctx.graphqlClient, generated_1.UploadSessionType.EasBuildGcsProjectSources, projectTarball.path, (0, progress_1.createProgressTracker)({
166
- total: projectTarball.size,
167
- message: ratio => `Uploading to EAS Build (${(0, files_1.formatBytes)(projectTarball.size * ratio)} / ${(0, files_1.formatBytes)(projectTarball.size)})`,
168
- completedMessage: (duration) => `Uploaded to EAS ${chalk_1.default.dim(duration)}`,
169
- }));
170
- const { metadataLocation } = await uploadMetadataFileAsync(projectTarball, ctx);
165
+ const [bucketKey, { metadataLocation }] = await Promise.all([
166
+ (0, uploads_1.uploadFileAtPathToGCSAsync)(ctx.graphqlClient, generated_1.UploadSessionType.EasBuildGcsProjectSources, projectTarball.path, (0, progress_1.createProgressTracker)({
167
+ total: projectTarball.size,
168
+ message: ratio => `Uploading to EAS Build (${(0, files_1.formatBytes)(projectTarball.size * ratio)} / ${(0, files_1.formatBytes)(projectTarball.size)})`,
169
+ completedMessage: (duration) => `Uploaded to EAS ${chalk_1.default.dim(duration)}`,
170
+ })),
171
+ uploadMetadataFileAsync(projectTarball, ctx),
172
+ ]);
171
173
  if (metadataLocation) {
172
174
  return { bucketKey, metadataLocation };
173
175
  }
@@ -196,11 +198,7 @@ async function uploadMetadataFileAsync(projectTarball, ctx) {
196
198
  let projectMetadataFile = null;
197
199
  try {
198
200
  projectMetadataFile = await (0, repository_1.makeProjectMetadataFileAsync)(projectTarball.path);
199
- const metadataLocation = await (0, uploads_1.uploadFileAtPathToGCSAsync)(ctx.graphqlClient, generated_1.UploadSessionType.EasBuildGcsProjectMetadata, projectMetadataFile.path, (0, progress_1.createProgressTracker)({
200
- total: projectMetadataFile.size,
201
- message: ratio => `Uploading metadata to EAS Build (${(0, files_1.formatBytes)(projectMetadataFile.size * ratio)} / ${(0, files_1.formatBytes)(projectMetadataFile.size)})`,
202
- completedMessage: (duration) => `Uploaded to EAS ${chalk_1.default.dim(duration)}`,
203
- }));
201
+ const metadataLocation = await (0, uploads_1.uploadFileAtPathToGCSAsync)(ctx.graphqlClient, generated_1.UploadSessionType.EasBuildGcsProjectMetadata, projectMetadataFile.path);
204
202
  return { metadataLocation };
205
203
  }
206
204
  catch (err) {
@@ -26,6 +26,16 @@ async function prepareJobAsync(ctx, jobData) {
26
26
  const maybeCustomBuildConfigPath = buildProfile.config
27
27
  ? (0, customBuildConfig_1.getCustomBuildConfigPathForJob)(buildProfile.config)
28
28
  : undefined;
29
+ let buildMode;
30
+ if (ctx.repack) {
31
+ buildMode = eas_build_job_1.BuildMode.REPACK;
32
+ }
33
+ else if (buildProfile.config) {
34
+ buildMode = eas_build_job_1.BuildMode.CUSTOM;
35
+ }
36
+ else {
37
+ buildMode = eas_build_job_1.BuildMode.BUILD;
38
+ }
29
39
  const job = {
30
40
  type: ctx.workflow,
31
41
  platform: eas_build_job_1.Platform.IOS,
@@ -66,7 +76,7 @@ async function prepareJobAsync(ctx, jobData) {
66
76
  experimental: {
67
77
  prebuildCommand: buildProfile.prebuildCommand,
68
78
  },
69
- mode: buildProfile.config || ctx.repack ? eas_build_job_1.BuildMode.CUSTOM : eas_build_job_1.BuildMode.BUILD,
79
+ mode: buildMode,
70
80
  triggeredBy: eas_build_job_1.BuildTrigger.EAS_CLI,
71
81
  ...(maybeCustomBuildConfigPath && {
72
82
  customBuildConfig: {
@@ -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.112';
9
+ const PLUGIN_PACKAGE_VERSION = '1.0.117';
10
10
  var LocalBuildMode;
11
11
  (function (LocalBuildMode) {
12
12
  /**
@@ -152,6 +152,7 @@ async function runBuildAndSubmitAsync(graphqlClient, analytics, vcsClient, proje
152
152
  buildProfile: startedBuild.buildProfile.profile,
153
153
  submitProfile,
154
154
  nonInteractive: flags.nonInteractive,
155
+ selectedSubmitProfileName: flags.submitProfile,
155
156
  });
156
157
  startedBuild.build = await BuildQuery_1.BuildQuery.withSubmissionsByIdAsync(graphqlClient, startedBuild.build.id);
157
158
  submissions.push(submission);
@@ -288,7 +289,7 @@ async function startBuildAsync(ctx) {
288
289
  }
289
290
  return await sendBuildRequestAsync();
290
291
  }
291
- async function prepareAndStartSubmissionAsync({ build, buildCtx, moreBuilds, projectDir, buildProfile, submitProfile, nonInteractive, }) {
292
+ async function prepareAndStartSubmissionAsync({ build, buildCtx, moreBuilds, projectDir, buildProfile, submitProfile, selectedSubmitProfileName, nonInteractive, }) {
292
293
  const platform = (0, AppPlatform_1.toPlatform)(build.platform);
293
294
  const submissionCtx = await (0, context_1.createSubmissionContextAsync)({
294
295
  platform,
@@ -306,6 +307,7 @@ async function prepareAndStartSubmissionAsync({ build, buildCtx, moreBuilds, pro
306
307
  exp: buildCtx.exp,
307
308
  vcsClient: buildCtx.vcsClient,
308
309
  isVerboseFastlaneEnabled: false,
310
+ specifiedProfile: selectedSubmitProfileName,
309
311
  });
310
312
  if (moreBuilds) {
311
313
  log_1.default.newLine();
@@ -37,6 +37,10 @@ function formatGraphQLBuild(build) {
37
37
  }
38
38
  },
39
39
  },
40
+ {
41
+ label: 'Profile',
42
+ value: build.buildProfile,
43
+ },
40
44
  {
41
45
  label: 'Message',
42
46
  value: build.message,
@@ -71,38 +71,19 @@ async function commitPromptAsync(vcsClient, { initialCommitMessage, commitAllFil
71
71
  }
72
72
  exports.commitPromptAsync = commitPromptAsync;
73
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
74
  const metadataLocation = path_1.default.join((0, paths_1.getTmpDirectory)(), `${(0, uuid_1.v4)()}-eas-build-metadata.json`);
81
75
  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)}`);
76
+ await tar_1.default.list({
77
+ file: archivePath,
78
+ onentry: (entry) => {
79
+ if (entry.type === 'File' && !entry.path.includes('.git/')) {
80
+ archiveContent.push(entry.path);
81
+ }
82
+ },
83
+ });
84
+ await fs_extra_1.default.writeJSON(metadataLocation, {
85
+ archiveContent,
86
+ });
106
87
  return { path: metadataLocation, size: await fs_extra_1.default.stat(metadataLocation).then(stat => stat.size) };
107
88
  }
108
89
  exports.makeProjectMetadataFileAsync = makeProjectMetadataFileAsync;
@@ -71,7 +71,7 @@ class EasCommand extends core_1.Command {
71
71
  log_1.default.error(err.message);
72
72
  }
73
73
  else if (err instanceof core_2.CombinedError && err?.graphQLErrors) {
74
- const cleanMessage = err?.graphQLErrors
74
+ const cleanGQLErrorsMessage = err?.graphQLErrors
75
75
  .map((graphQLError) => {
76
76
  const messageLine = graphQLError.message.replace('[GraphQL] ', '');
77
77
  const requestIdLine = graphQLError.extensions?.requestId
@@ -84,6 +84,9 @@ class EasCommand extends core_1.Command {
84
84
  return defaultMsg;
85
85
  })
86
86
  .join('\n');
87
+ const cleanMessage = err.networkError
88
+ ? `${cleanGQLErrorsMessage}\n${err.networkError.message}`
89
+ : cleanGQLErrorsMessage;
87
90
  log_1.default.error(cleanMessage);
88
91
  baseMessage = BASE_GRAPHQL_ERROR_MESSAGE;
89
92
  }
@@ -13,13 +13,13 @@ export default class BuildList extends EasCommand {
13
13
  status: import("@oclif/core/lib/interfaces").OptionFlag<BuildStatus | undefined>;
14
14
  distribution: import("@oclif/core/lib/interfaces").OptionFlag<BuildDistributionType | undefined>;
15
15
  channel: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
16
- appVersion: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
17
- appBuildVersion: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
18
- sdkVersion: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
19
- runtimeVersion: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
20
- appIdentifier: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
21
- buildProfile: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
22
- gitCommitHash: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
16
+ 'app-version': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
17
+ 'app-build-version': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
18
+ 'sdk-version': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
19
+ 'runtime-version': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
20
+ 'app-identifier': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
21
+ 'build-profile': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
22
+ 'git-commit-hash': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
23
23
  };
24
24
  static contextDefinition: {
25
25
  vcsClient: import("../../commandUtils/context/VcsClientContextField").default;
@@ -44,13 +44,13 @@ class BuildList extends EasCommand_1.default {
44
44
  status: graphqlBuildStatus,
45
45
  distribution: graphqlBuildDistribution,
46
46
  channel: flags.channel,
47
- appVersion: flags.appVersion,
48
- appBuildVersion: flags.appBuildVersion,
49
- sdkVersion: flags.sdkVersion,
50
- runtimeVersion: flags.runtimeVersion,
51
- appIdentifier: flags.appIdentifier,
52
- buildProfile: flags.buildProfile,
53
- gitCommitHash: flags.gitCommitHash,
47
+ appVersion: flags['app-version'],
48
+ appBuildVersion: flags['app-build-version'],
49
+ sdkVersion: flags['sdk-version'],
50
+ runtimeVersion: flags['runtime-version'],
51
+ appIdentifier: flags['app-identifier'],
52
+ buildProfile: flags['build-profile'],
53
+ gitCommitHash: flags['git-commit-hash'],
54
54
  simulator: flags.simulator,
55
55
  },
56
56
  paginatedQueryOptions,
@@ -61,34 +61,47 @@ _a = BuildList;
61
61
  BuildList.description = 'list all builds for your project';
62
62
  BuildList.flags = {
63
63
  platform: core_1.Flags.enum({
64
- options: [platform_1.RequestedPlatform.All, platform_1.RequestedPlatform.Android, platform_1.RequestedPlatform.Ios],
64
+ options: Object.values(platform_1.RequestedPlatform),
65
+ char: 'p',
65
66
  }),
66
67
  status: core_1.Flags.enum({
67
- options: [
68
- types_1.BuildStatus.NEW,
69
- types_1.BuildStatus.IN_QUEUE,
70
- types_1.BuildStatus.IN_PROGRESS,
71
- types_1.BuildStatus.PENDING_CANCEL,
72
- types_1.BuildStatus.ERRORED,
73
- types_1.BuildStatus.FINISHED,
74
- types_1.BuildStatus.CANCELED,
75
- ],
68
+ options: Object.values(types_1.BuildStatus),
69
+ description: 'Filter only builds with the specified status',
76
70
  }),
77
71
  distribution: core_1.Flags.enum({
78
- options: [
79
- types_1.BuildDistributionType.STORE,
80
- types_1.BuildDistributionType.INTERNAL,
81
- types_1.BuildDistributionType.SIMULATOR,
82
- ],
72
+ options: Object.values(types_1.BuildDistributionType),
73
+ description: 'Filter only builds with the specified distribution type',
83
74
  }),
84
75
  channel: core_1.Flags.string(),
85
- appVersion: core_1.Flags.string(),
86
- appBuildVersion: core_1.Flags.string(),
87
- sdkVersion: core_1.Flags.string(),
88
- runtimeVersion: core_1.Flags.string(),
89
- appIdentifier: core_1.Flags.string(),
90
- buildProfile: core_1.Flags.string(),
91
- gitCommitHash: core_1.Flags.string(),
76
+ 'app-version': core_1.Flags.string({
77
+ aliases: ['appVersion'],
78
+ description: 'Filter only builds created with the specified main app version',
79
+ }),
80
+ 'app-build-version': core_1.Flags.string({
81
+ aliases: ['appBuildVersion'],
82
+ description: 'Filter only builds created with the specified app build version',
83
+ }),
84
+ 'sdk-version': core_1.Flags.string({
85
+ aliases: ['sdkVersion'],
86
+ description: 'Filter only builds created with the specified Expo SDK version',
87
+ }),
88
+ 'runtime-version': core_1.Flags.string({
89
+ aliases: ['runtimeVersion'],
90
+ description: 'Filter only builds created with the specified runtime version',
91
+ }),
92
+ 'app-identifier': core_1.Flags.string({
93
+ aliases: ['appIdentifier'],
94
+ description: 'Filter only builds created with the specified app identifier',
95
+ }),
96
+ 'build-profile': core_1.Flags.string({
97
+ char: 'e',
98
+ aliases: ['profile', 'buildProfile'],
99
+ description: 'Filter only builds created with the specified build profile',
100
+ }),
101
+ 'git-commit-hash': core_1.Flags.string({
102
+ aliases: ['gitCommitHash'],
103
+ description: 'Filter only builds created with the specified git commit hash',
104
+ }),
92
105
  ...pagination_1.EasPaginatedQueryFlags,
93
106
  limit: (0, pagination_1.getLimitFlagWithCustomValues)({ defaultTo: 10, limit: queries_1.BUILDS_LIMIT }),
94
107
  ...flags_1.EasNonInteractiveAndJsonFlags,
@@ -8,7 +8,8 @@ interface BuildResignFlags {
8
8
  offset?: number;
9
9
  limit?: number;
10
10
  platform?: Platform;
11
- profile?: string;
11
+ targetProfile?: string;
12
+ sourceProfile?: string;
12
13
  maybeBuildId?: string;
13
14
  wait: boolean;
14
15
  }
@@ -18,7 +19,8 @@ interface RawBuildResignFlags {
18
19
  offset: number | undefined;
19
20
  limit: number | undefined;
20
21
  platform: 'android' | 'ios' | undefined;
21
- profile: string | undefined;
22
+ 'target-profile': string | undefined;
23
+ 'source-profile': string | undefined;
22
24
  wait: boolean;
23
25
  id: string | undefined;
24
26
  }
@@ -30,7 +32,8 @@ export default class BuildResign extends EasCommand {
30
32
  offset: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined>;
31
33
  limit: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined>;
32
34
  platform: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
33
- profile: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
35
+ 'target-profile': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
36
+ 'source-profile': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
34
37
  wait: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
35
38
  id: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
36
39
  };
@@ -44,13 +47,14 @@ export default class BuildResign extends EasCommand {
44
47
  };
45
48
  runAsync(): Promise<void>;
46
49
  sanitizeFlags(flags: RawBuildResignFlags): BuildResignFlags;
47
- ensureBuildSelectedAsync({ graphqlClient, projectId, platform, nonInteractive, limit, offset, }: {
50
+ ensureBuildSelectedAsync({ graphqlClient, projectId, platform, nonInteractive, limit, offset, buildProfile, }: {
48
51
  graphqlClient: ExpoGraphqlClient;
49
52
  projectId: string;
50
53
  platform: Platform;
51
54
  nonInteractive: boolean;
52
55
  limit?: number;
53
56
  offset?: number;
57
+ buildProfile?: string;
54
58
  }, maybeBuild?: BuildFragment): Promise<BuildFragment>;
55
59
  maybeGetBuildAsync(graphqlClient: ExpoGraphqlClient, maybeBuildId?: string, maybePlatform?: Platform): Promise<BuildFragment | undefined>;
56
60
  }
@@ -51,10 +51,18 @@ class BuildResign extends EasCommand_1.default {
51
51
  await (0, statuspageService_1.maybeWarnAboutEasOutagesAsync)(graphqlClient, [generated_1.StatuspageServiceName.EasBuild]);
52
52
  const easJsonAccessor = eas_json_1.EasJsonAccessor.fromProjectPath(projectDir);
53
53
  const easJsonCliConfig = (await eas_json_1.EasJsonUtils.getCliConfigAsync(easJsonAccessor)) ?? {};
54
- const buildProfile = await eas_json_1.EasJsonUtils.getBuildProfileAsync(easJsonAccessor, platform, flags.profile ?? 'production');
54
+ const buildProfile = await eas_json_1.EasJsonUtils.getBuildProfileAsync(easJsonAccessor, platform, flags.targetProfile ?? 'production');
55
55
  const { exp, projectId } = await getDynamicPrivateProjectConfigAsync({ env: buildProfile.env });
56
56
  const account = await (0, projectUtils_1.getOwnerAccountForProjectIdAsync)(graphqlClient, projectId);
57
- const build = await this.ensureBuildSelectedAsync({ graphqlClient, projectId, platform, nonInteractive, limit, offset }, maybeBuild);
57
+ const build = await this.ensureBuildSelectedAsync({
58
+ graphqlClient,
59
+ projectId,
60
+ platform,
61
+ nonInteractive,
62
+ limit,
63
+ offset,
64
+ buildProfile: flags.sourceProfile,
65
+ }, maybeBuild);
58
66
  const credentialsCtx = new context_1.CredentialsContext({
59
67
  projectInfo: { exp, projectId },
60
68
  nonInteractive,
@@ -132,12 +140,13 @@ class BuildResign extends EasCommand_1.default {
132
140
  offset: flags.offset,
133
141
  limit: flags.limit,
134
142
  platform: flags.platform,
135
- profile: flags.profile,
143
+ sourceProfile: flags['source-profile'],
144
+ targetProfile: flags['target-profile'],
136
145
  maybeBuildId: flags.id,
137
146
  wait: flags.wait,
138
147
  };
139
148
  }
140
- async ensureBuildSelectedAsync({ graphqlClient, projectId, platform, nonInteractive, limit, offset, }, maybeBuild) {
149
+ async ensureBuildSelectedAsync({ graphqlClient, projectId, platform, nonInteractive, limit, offset, buildProfile, }, maybeBuild) {
141
150
  if (maybeBuild) {
142
151
  return maybeBuild;
143
152
  }
@@ -154,6 +163,7 @@ class BuildResign extends EasCommand_1.default {
154
163
  distribution: generated_1.DistributionType.Internal,
155
164
  platform: (0, AppPlatform_1.toAppPlatform)(platform),
156
165
  status: generated_1.BuildStatus.Finished,
166
+ buildProfile,
157
167
  },
158
168
  });
159
169
  if (!build) {
@@ -185,9 +195,14 @@ BuildResign.flags = {
185
195
  char: 'p',
186
196
  options: ['android', 'ios'],
187
197
  }),
188
- profile: core_1.Flags.string({
198
+ 'target-profile': core_1.Flags.string({
189
199
  char: 'e',
190
- description: 'Name of the build profile from eas.json. Defaults to "production" if defined in eas.json.',
200
+ description: 'Name of the target build profile from eas.json. Credentials and environment variables from this profile will be used when re-signing. Defaults to "production" if defined in eas.json.',
201
+ helpValue: 'PROFILE_NAME',
202
+ aliases: ['profile'],
203
+ }),
204
+ 'source-profile': core_1.Flags.string({
205
+ description: 'Name of the source build profile from eas.json. Used to filter builds eligible for re-signing.',
191
206
  helpValue: 'PROFILE_NAME',
192
207
  }),
193
208
  wait: core_1.Flags.boolean({
@@ -316,7 +316,10 @@ async function configureProjectFromBareDefaultExpoTemplateAsync({ app, vcsClient
316
316
  await vcsClient.trackFileAsync(easJsonPath);
317
317
  log_1.default.log(`✅ Generated ${chalk_1.default.bold('eas.json')}. ${(0, log_1.learnMore)('https://docs.expo.dev/build-reference/eas-json/')}`);
318
318
  log_1.default.log();
319
+ const baseExpoConfig = JSON.parse(await fs_extra_1.default.readFile(path_1.default.join(targetDir, 'app.json'), 'utf8'))
320
+ .expo;
319
321
  const expoConfig = {
322
+ ...baseExpoConfig,
320
323
  name: app.name ?? app.slug,
321
324
  slug: app.slug,
322
325
  extra: {
@@ -332,9 +335,11 @@ async function configureProjectFromBareDefaultExpoTemplateAsync({ app, vcsClient
332
335
  policy: 'appVersion',
333
336
  },
334
337
  ios: {
338
+ ...baseExpoConfig.ios,
335
339
  bundleIdentifier,
336
340
  },
337
341
  android: {
342
+ ...baseExpoConfig.android,
338
343
  package: bundleIdentifier,
339
344
  },
340
345
  };
@@ -5,7 +5,7 @@ const tslib_1 = require("tslib");
5
5
  const apple_utils_1 = require("@expo/apple-utils");
6
6
  const assert_1 = tslib_1.__importDefault(require("assert"));
7
7
  const chalk_1 = tslib_1.__importDefault(require("chalk"));
8
- const getenv_1 = require("getenv");
8
+ const getenv = tslib_1.__importStar(require("getenv"));
9
9
  const authenticateTypes_1 = require("./authenticateTypes");
10
10
  const resolveCredentials_1 = require("./resolveCredentials");
11
11
  const log_1 = tslib_1.__importDefault(require("../../../log"));
@@ -130,7 +130,7 @@ async function authenticateAsUserAsync(options = {}) {
130
130
  cookies: options.cookies,
131
131
  teamId: options.teamId ?? process.env.EXPO_APPLE_TEAM_ID,
132
132
  providerId: process.env.EXPO_APPLE_PROVIDER_ID
133
- ? (0, getenv_1.int)(process.env.EXPO_APPLE_PROVIDER_ID)
133
+ ? getenv.int('EXPO_APPLE_PROVIDER_ID')
134
134
  : undefined,
135
135
  }, {
136
136
  // TODO: Provide a way to disable this for users who want to mix and match teams / providers.
@@ -155,8 +155,6 @@ async function handleBuildIdSourceAsync(ctx, source) {
155
155
  async function handleBuildListSourceAsync(ctx) {
156
156
  try {
157
157
  const appPlatform = (0, AppPlatform_1.toAppPlatform)(ctx.platform);
158
- const expiryDate = new Date(); // artifacts expire after 30 days
159
- expiryDate.setDate(expiryDate.getDate() - 30);
160
158
  const recentBuilds = await (0, builds_1.getRecentBuildsForSubmissionAsync)(ctx.graphqlClient, appPlatform, ctx.projectId, {
161
159
  limit: exports.BUILD_LIST_ITEM_COUNT,
162
160
  });
@@ -167,14 +165,14 @@ async function handleBuildListSourceAsync(ctx) {
167
165
  sourceType: ArchiveSourceType.prompt,
168
166
  });
169
167
  }
170
- if (recentBuilds.every(it => new Date(it.updatedAt) < expiryDate)) {
168
+ if (recentBuilds.every(it => new Date(it.expirationDate) <= new Date())) {
171
169
  log_1.default.error(chalk_1.default.bold('It looks like all of your build artifacts have expired. ' +
172
170
  'EAS keeps your build artifacts only for 30 days.'));
173
171
  return getArchiveAsync(ctx, {
174
172
  sourceType: ArchiveSourceType.prompt,
175
173
  });
176
174
  }
177
- const choices = recentBuilds.map(build => formatBuildChoice(build, expiryDate));
175
+ const choices = recentBuilds.map(build => formatBuildChoice(build));
178
176
  choices.push({
179
177
  title: 'None of the above (select another option)',
180
178
  value: null,
@@ -201,7 +199,7 @@ async function handleBuildListSourceAsync(ctx) {
201
199
  throw err;
202
200
  }
203
201
  }
204
- function formatBuildChoice(build, expiryDate) {
202
+ function formatBuildChoice(build) {
205
203
  const { id, updatedAt, runtimeVersion, buildProfile, gitCommitHash, gitCommitMessage, channel, message, } = build;
206
204
  const buildDate = new Date(updatedAt);
207
205
  const splitCommitMessage = gitCommitMessage?.split('\n');
@@ -228,7 +226,7 @@ function formatBuildChoice(build, expiryDate) {
228
226
  title,
229
227
  description: filteredDescriptionArray.length > 0 ? filteredDescriptionArray.join('\n') : '',
230
228
  value: build,
231
- disabled: buildDate < expiryDate,
229
+ disabled: new Date(build.expirationDate) < new Date(),
232
230
  };
233
231
  }
234
232
  async function handlePromptSourceAsync(ctx) {
@@ -6,5 +6,5 @@ export interface PresignedPost {
6
6
  url: string;
7
7
  fields: Record<string, string>;
8
8
  }
9
- export declare function uploadFileAtPathToGCSAsync(graphqlClient: ExpoGraphqlClient, type: UploadSessionType, path: string, handleProgressEvent: ProgressHandler): Promise<string>;
9
+ export declare function uploadFileAtPathToGCSAsync(graphqlClient: ExpoGraphqlClient, type: UploadSessionType, path: string, handleProgressEvent?: ProgressHandler): Promise<string>;
10
10
  export declare function uploadWithPresignedPostWithRetryAsync(file: string, presignedPost: PresignedPost, onAssetUploadBegin: () => void): Promise<Response>;
package/build/uploads.js CHANGED
@@ -7,7 +7,7 @@ const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
7
7
  const promise_retry_1 = tslib_1.__importDefault(require("promise-retry"));
8
8
  const fetch_1 = tslib_1.__importDefault(require("./fetch"));
9
9
  const UploadSessionMutation_1 = require("./graphql/mutations/UploadSessionMutation");
10
- async function uploadFileAtPathToGCSAsync(graphqlClient, type, path, handleProgressEvent) {
10
+ async function uploadFileAtPathToGCSAsync(graphqlClient, type, path, handleProgressEvent = () => { }) {
11
11
  const signedUrl = await UploadSessionMutation_1.UploadSessionMutation.createUploadSessionAsync(graphqlClient, type);
12
12
  await uploadWithSignedUrlWithProgressAsync(path, signedUrl, handleProgressEvent);
13
13
  return signedUrl.bucketKey;