eas-cli 2.7.1 → 2.9.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 +78 -53
  2. package/build/branch/queries.d.ts +1 -0
  3. package/build/branch/queries.js +2 -2
  4. package/build/build/build.d.ts +1 -1
  5. package/build/build/build.js +2 -2
  6. package/build/build/createContext.js +1 -0
  7. package/build/build/graphql.js +6 -0
  8. package/build/build/local.js +1 -1
  9. package/build/build/queries.d.ts +4 -2
  10. package/build/build/queries.js +32 -7
  11. package/build/build/runBuildAndSubmit.js +31 -2
  12. package/build/commands/build/run.d.ts +0 -1
  13. package/build/commands/build/run.js +32 -12
  14. package/build/commands/submit.js +1 -1
  15. package/build/commands/update/index.js +20 -8
  16. package/build/devices/utils/formatDevice.js +1 -2
  17. package/build/graphql/generated.d.ts +15 -0
  18. package/build/graphql/generated.js +9 -2
  19. package/build/graphql/mutations/SubmissionMutation.js +14 -2
  20. package/build/graphql/mutations/UploadSessionMutation.d.ts +4 -3
  21. package/build/project/applicationIdentifier.js +6 -2
  22. package/build/run/android/aapt.d.ts +5 -0
  23. package/build/run/android/aapt.js +51 -0
  24. package/build/run/android/adb.d.ts +23 -0
  25. package/build/run/android/adb.js +120 -0
  26. package/build/run/android/emulator.d.ts +7 -0
  27. package/build/run/android/emulator.js +109 -0
  28. package/build/run/android/run.d.ts +1 -1
  29. package/build/run/android/run.js +10 -3
  30. package/build/run/android/sdk.d.ts +3 -0
  31. package/build/run/android/sdk.js +29 -0
  32. package/build/run/android/systemRequirements.d.ts +1 -0
  33. package/build/run/android/systemRequirements.js +24 -0
  34. package/build/run/ios/simulator.js +1 -1
  35. package/build/run/utils.d.ts +2 -0
  36. package/build/run/utils.js +20 -0
  37. package/build/submit/ArchiveSource.d.ts +20 -10
  38. package/build/submit/ArchiveSource.js +59 -60
  39. package/build/submit/BaseSubmitter.d.ts +4 -1
  40. package/build/submit/BaseSubmitter.js +20 -0
  41. package/build/submit/android/AndroidSubmitCommand.js +1 -2
  42. package/build/submit/android/AndroidSubmitter.d.ts +3 -3
  43. package/build/submit/android/AndroidSubmitter.js +12 -7
  44. package/build/submit/commons.d.ts +1 -1
  45. package/build/submit/commons.js +1 -16
  46. package/build/submit/ios/IosSubmitCommand.js +1 -2
  47. package/build/submit/ios/IosSubmitter.d.ts +3 -3
  48. package/build/submit/ios/IosSubmitter.js +11 -6
  49. package/build/submit/utils/files.js +2 -2
  50. package/build/submit/utils/summary.d.ts +2 -2
  51. package/build/submit/utils/summary.js +7 -8
  52. package/build/uploads.d.ts +4 -10
  53. package/build/uploads.js +16 -36
  54. package/build/utils/download.d.ts +3 -2
  55. package/build/utils/download.js +60 -36
  56. package/build/utils/paths.d.ts +7 -7
  57. package/build/utils/paths.js +3 -1
  58. package/build/utils/progress.d.ts +1 -1
  59. package/build/utils/progress.js +6 -4
  60. package/oclif.manifest.json +1 -1
  61. package/package.json +3 -3
@@ -3,10 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getLatestBuildAsync = exports.listAndSelectBuildsOnAppAsync = exports.listAndRenderBuildsOnAppAsync = exports.BUILDS_LIMIT = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const chalk_1 = tslib_1.__importDefault(require("chalk"));
6
+ const generated_1 = require("../graphql/generated");
6
7
  const BuildQuery_1 = require("../graphql/queries/BuildQuery");
7
8
  const log_1 = tslib_1.__importDefault(require("../log"));
8
- const platform_1 = require("../platform");
9
9
  const prompts_1 = require("../prompts");
10
+ const date_1 = require("../utils/date");
10
11
  const json_1 = require("../utils/json");
11
12
  const queries_1 = require("../utils/queries");
12
13
  const formatBuild_1 = require("./utils/formatBuild");
@@ -40,7 +41,25 @@ async function listAndRenderBuildsOnAppAsync(graphqlClient, { projectId, project
40
41
  }
41
42
  }
42
43
  exports.listAndRenderBuildsOnAppAsync = listAndRenderBuildsOnAppAsync;
43
- async function listAndSelectBuildsOnAppAsync(graphqlClient, { projectId, projectDisplayName, filter, queryOptions, }) {
44
+ function formatBuildChoiceValue(value) {
45
+ return value ? chalk_1.default.bold(value) : chalk_1.default.dim('Unknown');
46
+ }
47
+ function formatBuildChoiceTitleAndDescription(build) {
48
+ var _a;
49
+ const splitCommitMessage = (_a = build.gitCommitMessage) === null || _a === void 0 ? void 0 : _a.split('\n');
50
+ const formattedCommitData = build.gitCommitHash && splitCommitMessage && splitCommitMessage.length > 0
51
+ ? `${chalk_1.default.dim(build.gitCommitHash.slice(0, 7))} "${chalk_1.default.bold(splitCommitMessage[0] + (splitCommitMessage.length > 1 ? '…' : ''))}"`
52
+ : 'Unknown';
53
+ return {
54
+ title: `ID: ${chalk_1.default.dim(build.id)} (${chalk_1.default.dim(`${(0, date_1.fromNow)(new Date(build.updatedAt))} ago`)})`,
55
+ description: [
56
+ `\tVersion: ${formatBuildChoiceValue(build.appVersion)}`,
57
+ `\t${build.platform === generated_1.AppPlatform.Ios ? 'Build number' : 'Version code'}: ${formatBuildChoiceValue(build.appBuildVersion)}`,
58
+ `\tCommit: ${formattedCommitData}`,
59
+ ].join('\n'),
60
+ };
61
+ }
62
+ async function listAndSelectBuildsOnAppAsync(graphqlClient, selectedPlatform, { projectId, projectDisplayName, filter, queryOptions, selectPromptDisabledFunction, warningMessage, }) {
44
63
  var _a;
45
64
  const builds = await BuildQuery_1.BuildQuery.viewBuildsOnAppAsync(graphqlClient, {
46
65
  appId: projectId,
@@ -53,12 +72,18 @@ async function listAndSelectBuildsOnAppAsync(graphqlClient, { projectId, project
53
72
  }
54
73
  const { selectedSimulatorBuild } = await (0, prompts_1.promptAsync)({
55
74
  type: 'select',
56
- message: `Select simulator build to run for ${projectDisplayName} app`,
75
+ message: `Select ${selectedPlatform === generated_1.AppPlatform.Ios ? 'iOS' : 'Android'} ${selectedPlatform === generated_1.AppPlatform.Ios ? 'simulator' : 'emulator'} build to run for ${projectDisplayName} app`,
57
76
  name: 'selectedSimulatorBuild',
58
- choices: builds.map(build => ({
59
- title: `id: ${build.id}, platform: ${platform_1.appPlatformDisplayNames[build.platform]}, version: ${build.appVersion}, build number: ${build.appBuildVersion}`,
60
- value: build,
61
- })),
77
+ choices: builds.map(build => {
78
+ const buildChoice = formatBuildChoiceTitleAndDescription(build);
79
+ return {
80
+ title: buildChoice.title,
81
+ description: buildChoice.description,
82
+ value: build,
83
+ disabled: selectPromptDisabledFunction === null || selectPromptDisabledFunction === void 0 ? void 0 : selectPromptDisabledFunction(build),
84
+ };
85
+ }),
86
+ warn: warningMessage,
62
87
  });
63
88
  return selectedSimulatorBuild;
64
89
  }
@@ -4,6 +4,7 @@ exports.runBuildAndSubmitAsync = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const eas_build_job_1 = require("@expo/eas-build-job");
6
6
  const eas_json_1 = require("@expo/eas-json");
7
+ const assert_1 = tslib_1.__importDefault(require("assert"));
7
8
  const chalk_1 = tslib_1.__importDefault(require("chalk"));
8
9
  const nullthrows_1 = tslib_1.__importDefault(require("nullthrows"));
9
10
  const generated_1 = require("../graphql/generated");
@@ -15,10 +16,15 @@ const expoSdk_1 = require("../project/expoSdk");
15
16
  const metroConfig_1 = require("../project/metroConfig");
16
17
  const projectUtils_1 = require("../project/projectUtils");
17
18
  const remoteVersionSource_1 = require("../project/remoteVersionSource");
19
+ const prompts_1 = require("../prompts");
20
+ const run_1 = require("../run/run");
21
+ const utils_1 = require("../run/utils");
18
22
  const context_1 = require("../submit/context");
19
23
  const submit_1 = require("../submit/submit");
20
24
  const urls_1 = require("../submit/utils/urls");
21
- const utils_1 = require("../update/utils");
25
+ const utils_2 = require("../update/utils");
26
+ const download_1 = require("../utils/download");
27
+ const filter_1 = require("../utils/expodash/filter");
22
28
  const json_1 = require("../utils/json");
23
29
  const profiles_1 = require("../utils/profiles");
24
30
  const vcs_1 = require("../vcs");
@@ -142,6 +148,7 @@ async function runBuildAndSubmitAsync(graphqlClient, analytics, projectDir, flag
142
148
  (0, printBuildInfo_1.printBuildResults)(builds);
143
149
  }
144
150
  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));
151
+ await maybeDownloadAndRunSimulatorBuildsAsync(builds, flags);
145
152
  if (haveAllBuildsFailedOrCanceled || !flags.autoSubmit) {
146
153
  if (flags.json) {
147
154
  (0, json_1.printJsonOnlyOutput)(builds);
@@ -182,7 +189,7 @@ async function prepareAndStartBuildAsync({ projectDir, flags, moreBuilds, buildP
182
189
  const appPlatform = (0, AppPlatform_1.toAppPlatform)(buildProfile.platform);
183
190
  log_1.default.log(`${platform_1.appPlatformEmojis[appPlatform]} ${chalk_1.default.bold(`${platform_1.appPlatformDisplayNames[appPlatform]} build`)}`);
184
191
  }
185
- await (0, utils_1.validateBuildProfileConfigMatchesProjectConfigAsync)(buildCtx.exp, buildProfile, buildCtx.projectId, flags.nonInteractive);
192
+ await (0, utils_2.validateBuildProfileConfigMatchesProjectConfigAsync)(buildCtx.exp, buildProfile, buildCtx.projectId, flags.nonInteractive);
186
193
  await (0, projectUtils_1.validateAppVersionRuntimePolicySupportAsync)(buildCtx.projectDir, buildCtx.exp);
187
194
  if ((easJsonCliConfig === null || easJsonCliConfig === void 0 ? void 0 : easJsonCliConfig.appVersionSource) === eas_json_1.AppVersionSource.REMOTE) {
188
195
  (0, remoteVersionSource_1.validateAppConfigForRemoteVersionSource)(buildCtx.exp, buildProfile.platform);
@@ -243,3 +250,25 @@ function exitWithNonZeroCodeIfSomeBuildsFailed(maybeBuilds) {
243
250
  process.exit(1);
244
251
  }
245
252
  }
253
+ async function downloadAndRunAsync(build) {
254
+ var _a;
255
+ (0, assert_1.default)((_a = build.artifacts) === null || _a === void 0 ? void 0 : _a.applicationArchiveUrl);
256
+ const buildPath = await (0, download_1.downloadAndMaybeExtractAppAsync)(build.artifacts.applicationArchiveUrl, build.platform);
257
+ await (0, run_1.runAsync)(buildPath, build.platform);
258
+ }
259
+ async function maybeDownloadAndRunSimulatorBuildsAsync(builds, flags) {
260
+ const simBuilds = builds.filter(filter_1.truthy).filter(utils_1.isRunnableOnSimulatorOrEmulator);
261
+ if (simBuilds.length > 0 && !flags.autoSubmit && !flags.nonInteractive) {
262
+ for (const simBuild of simBuilds) {
263
+ if (simBuild.platform === generated_1.AppPlatform.Android || process.platform === 'darwin') {
264
+ log_1.default.newLine();
265
+ const confirm = await (0, prompts_1.confirmAsync)({
266
+ message: `Install and run the ${simBuild.platform === generated_1.AppPlatform.Android ? 'Android' : 'iOS'} build on ${simBuild.platform === generated_1.AppPlatform.Android ? 'an emulator' : 'a simulator'}?`,
267
+ });
268
+ if (confirm) {
269
+ await downloadAndRunAsync(simBuild);
270
+ }
271
+ }
272
+ }
273
+ }
274
+ }
@@ -1,6 +1,5 @@
1
1
  import EasCommand from '../../commandUtils/EasCommand';
2
2
  export default class Run extends EasCommand {
3
- static hidden: boolean;
4
3
  static description: string;
5
4
  static flags: {
6
5
  offset: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined>;
@@ -5,17 +5,19 @@ const tslib_1 = require("tslib");
5
5
  const core_1 = require("@oclif/core");
6
6
  const fs_extra_1 = require("fs-extra");
7
7
  const node_assert_1 = tslib_1.__importDefault(require("node:assert"));
8
+ const path_1 = tslib_1.__importDefault(require("path"));
8
9
  const queries_1 = require("../../build/queries");
9
- const types_1 = require("../../build/types");
10
10
  const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
11
11
  const pagination_1 = require("../../commandUtils/pagination");
12
12
  const generated_1 = require("../../graphql/generated");
13
13
  const BuildQuery_1 = require("../../graphql/queries/BuildQuery");
14
+ const log_1 = tslib_1.__importDefault(require("../../log"));
14
15
  const projectUtils_1 = require("../../project/projectUtils");
15
16
  const prompts_1 = require("../../prompts");
16
17
  const run_1 = require("../../run/run");
17
- const buildDistribution_1 = require("../../utils/buildDistribution");
18
+ const utils_1 = require("../../run/utils");
18
19
  const download_1 = require("../../utils/download");
20
+ const paths_1 = require("../../utils/paths");
19
21
  class Run extends EasCommand_1.default {
20
22
  async runAsync() {
21
23
  const { flags: rawFlags } = await this.parse(Run);
@@ -30,11 +32,16 @@ class Run extends EasCommand_1.default {
30
32
  async sanitizeFlagsAsync(flags) {
31
33
  const { platform, limit, offset, ...runArchiveFlags } = flags;
32
34
  const selectedPlatform = await resolvePlatformAsync(platform);
35
+ if (platform === 'ios' && process.platform !== 'darwin') {
36
+ core_1.Errors.error('You can only use an iOS simulator to run apps on macOS devices', {
37
+ exit: 1,
38
+ });
39
+ }
33
40
  if (runArchiveFlags.path &&
34
41
  !((runArchiveFlags.path.endsWith('.tar.gz') ||
35
42
  runArchiveFlags.path.endsWith('.app') ||
36
43
  runArchiveFlags.path.endsWith('.apk')) &&
37
- (0, fs_extra_1.existsSync)(runArchiveFlags.path))) {
44
+ (await (0, fs_extra_1.pathExists)(runArchiveFlags.path)))) {
38
45
  core_1.Errors.error('The path must point to a .tar.gz archive, .apk file, or .app directory', {
39
46
  exit: 1,
40
47
  });
@@ -49,7 +56,6 @@ class Run extends EasCommand_1.default {
49
56
  }
50
57
  exports.default = Run;
51
58
  _a = Run;
52
- Run.hidden = true;
53
59
  Run.description = 'run simulator/emulator builds from eas-cli';
54
60
  Run.flags = {
55
61
  latest: core_1.Flags.boolean({
@@ -61,7 +67,7 @@ Run.flags = {
61
67
  exclusive: ['latest', 'id', 'path'],
62
68
  }),
63
69
  path: core_1.Flags.string({
64
- description: 'Path to the simulator/emulator build archive or simulator build app',
70
+ description: 'Path to the simulator/emulator build archive or app',
65
71
  exclusive: ['latest', 'id', 'url'],
66
72
  }),
67
73
  id: core_1.Flags.string({
@@ -80,6 +86,9 @@ Run.contextDefinition = {
80
86
  ..._a.ContextOptions.ProjectDir,
81
87
  };
82
88
  async function resolvePlatformAsync(platform) {
89
+ if (process.platform !== 'darwin') {
90
+ return generated_1.AppPlatform.Android;
91
+ }
83
92
  if (platform && Object.values(generated_1.AppPlatform).includes(platform.toUpperCase())) {
84
93
  return platform.toUpperCase();
85
94
  }
@@ -95,6 +104,7 @@ async function resolvePlatformAsync(platform) {
95
104
  return selectedPlatform;
96
105
  }
97
106
  async function maybeGetBuildAsync(graphqlClient, flags, projectId, paginatedQueryOptions) {
107
+ const distributionType = flags.selectedPlatform === generated_1.AppPlatform.Ios ? generated_1.DistributionType.Simulator : undefined;
98
108
  if (flags.runArchiveFlags.id) {
99
109
  return BuildQuery_1.BuildQuery.byIdAsync(graphqlClient, flags.runArchiveFlags.id);
100
110
  }
@@ -102,15 +112,17 @@ async function maybeGetBuildAsync(graphqlClient, flags, projectId, paginatedQuer
102
112
  !flags.runArchiveFlags.path &&
103
113
  !flags.runArchiveFlags.url &&
104
114
  !flags.runArchiveFlags.latest) {
105
- return await (0, queries_1.listAndSelectBuildsOnAppAsync)(graphqlClient, {
115
+ return await (0, queries_1.listAndSelectBuildsOnAppAsync)(graphqlClient, flags.selectedPlatform, {
106
116
  projectId,
107
117
  projectDisplayName: await (0, projectUtils_1.getDisplayNameForProjectIdAsync)(graphqlClient, projectId),
108
118
  filter: {
109
119
  platform: flags.selectedPlatform,
110
- distribution: (0, buildDistribution_1.buildDistributionTypeToGraphQLDistributionType)(types_1.BuildDistributionType.SIMULATOR),
120
+ distribution: distributionType,
111
121
  status: generated_1.BuildStatus.Finished,
112
122
  },
113
123
  queryOptions: paginatedQueryOptions,
124
+ selectPromptDisabledFunction: build => !(0, utils_1.isRunnableOnSimulatorOrEmulator)(build),
125
+ warningMessage: 'Artifacts for this build have expired and are no longer available, or this is not a simulator/emulator build.',
114
126
  });
115
127
  }
116
128
  else if (flags.runArchiveFlags.latest) {
@@ -118,7 +130,7 @@ async function maybeGetBuildAsync(graphqlClient, flags, projectId, paginatedQuer
118
130
  projectId,
119
131
  filter: {
120
132
  platform: flags.selectedPlatform,
121
- distribution: (0, buildDistribution_1.buildDistributionTypeToGraphQLDistributionType)(types_1.BuildDistributionType.SIMULATOR),
133
+ distribution: distributionType,
122
134
  status: generated_1.BuildStatus.Finished,
123
135
  },
124
136
  });
@@ -127,21 +139,29 @@ async function maybeGetBuildAsync(graphqlClient, flags, projectId, paginatedQuer
127
139
  return null;
128
140
  }
129
141
  }
142
+ function getEasBuildRunCachedAppPath(projectId, buildId, platform) {
143
+ return path_1.default.join((0, paths_1.getEasBuildRunCacheDirectoryPath)(), `${projectId}_${buildId}.${platform === generated_1.AppPlatform.Ios ? 'app' : 'apk'}`);
144
+ }
130
145
  async function getPathToSimulatorBuildAppAsync(graphqlClient, projectId, flags, queryOptions) {
131
146
  var _b, _c;
132
147
  const maybeBuild = await maybeGetBuildAsync(graphqlClient, flags, projectId, queryOptions);
133
- const appExtension = flags.selectedPlatform === generated_1.AppPlatform.Ios ? 'app' : 'apk';
134
148
  if (maybeBuild) {
149
+ const cachedAppPath = getEasBuildRunCachedAppPath(projectId, maybeBuild.id, flags.selectedPlatform);
150
+ if (await (0, fs_extra_1.pathExists)(cachedAppPath)) {
151
+ log_1.default.newLine();
152
+ log_1.default.log(`Using cached app...`);
153
+ return cachedAppPath;
154
+ }
135
155
  if (!((_b = maybeBuild.artifacts) === null || _b === void 0 ? void 0 : _b.applicationArchiveUrl)) {
136
156
  throw new Error('Build does not have an application archive url');
137
157
  }
138
- return await (0, download_1.downloadAndExtractAppAsync)(maybeBuild.artifacts.applicationArchiveUrl, appExtension);
158
+ return await (0, download_1.downloadAndMaybeExtractAppAsync)(maybeBuild.artifacts.applicationArchiveUrl, flags.selectedPlatform, cachedAppPath);
139
159
  }
140
160
  if (flags.runArchiveFlags.url) {
141
- return await (0, download_1.downloadAndExtractAppAsync)(flags.runArchiveFlags.url, appExtension);
161
+ return await (0, download_1.downloadAndMaybeExtractAppAsync)(flags.runArchiveFlags.url, flags.selectedPlatform);
142
162
  }
143
163
  if ((_c = flags.runArchiveFlags.path) === null || _c === void 0 ? void 0 : _c.endsWith('.tar.gz')) {
144
- return await (0, download_1.extractAppFromLocalArchiveAsync)(flags.runArchiveFlags.path, appExtension);
164
+ return await (0, download_1.extractAppFromLocalArchiveAsync)(flags.runArchiveFlags.path, flags.selectedPlatform);
145
165
  }
146
166
  // this should never fail, due to the validation in sanitizeFlagsAsync
147
167
  (0, node_assert_1.default)(flags.runArchiveFlags.path);
@@ -124,7 +124,7 @@ Submit.flags = {
124
124
  exclusive: ['latest', 'id', 'path'],
125
125
  }),
126
126
  verbose: core_1.Flags.boolean({
127
- description: 'Always print logs from Submission Service',
127
+ description: 'Always print logs from EAS Submit',
128
128
  default: false,
129
129
  }),
130
130
  wait: core_1.Flags.boolean({
@@ -248,17 +248,21 @@ class UpdatePublish extends EasCommand_1.default {
248
248
  runtimeToPlatformMapping.push({ runtimeVersion: runtime.runtimeVersion, platforms });
249
249
  }
250
250
  }
251
- const { branchId } = await (0, queries_1.ensureBranchExistsAsync)(graphqlClient, {
251
+ const { branchId, createdBranch } = await (0, queries_1.ensureBranchExistsAsync)(graphqlClient, {
252
252
  appId: projectId,
253
253
  branchName,
254
254
  });
255
- await (0, queries_2.ensureChannelExistsAsync)(graphqlClient, {
256
- appId: projectId,
257
- branchId,
258
- channelName: branchName,
259
- });
255
+ if (createdBranch) {
256
+ await (0, queries_2.ensureChannelExistsAsync)(graphqlClient, {
257
+ appId: projectId,
258
+ branchId,
259
+ channelName: branchName,
260
+ });
261
+ }
260
262
  log_1.default.withTick(`Channel: ${chalk_1.default.bold(branchName)} pointed at branch: ${chalk_1.default.bold(branchName)}`);
261
- const gitCommitHash = await (0, vcs_1.getVcsClient)().getCommitHashAsync();
263
+ const vcsClient = (0, vcs_1.getVcsClient)();
264
+ const gitCommitHash = await vcsClient.getCommitHashAsync();
265
+ const isGitWorkingTreeDirty = await vcsClient.hasUncommittedChangesAsync();
262
266
  // Sort the updates into different groups based on their platform specific runtime versions
263
267
  const updateGroups = runtimeToPlatformMapping.map(({ runtimeVersion, platforms }) => {
264
268
  const localUpdateInfoGroup = Object.fromEntries(platforms.map(platform => [
@@ -274,6 +278,7 @@ class UpdatePublish extends EasCommand_1.default {
274
278
  runtimeVersion: republish ? oldRuntimeVersion : runtimeVersion,
275
279
  message: truncatedMessage,
276
280
  gitCommitHash,
281
+ isGitWorkingTreeDirty,
277
282
  awaitingCodeSigningInfo: !!codeSigningInfo,
278
283
  };
279
284
  });
@@ -346,7 +351,14 @@ class UpdatePublish extends EasCommand_1.default {
346
351
  : []),
347
352
  ...(newIosUpdate ? [{ label: 'iOS update ID', value: newIosUpdate.id }] : []),
348
353
  { label: 'Message', value: truncatedMessage },
349
- ...(gitCommitHash ? [{ label: 'Commit', value: gitCommitHash }] : []),
354
+ ...(gitCommitHash
355
+ ? [
356
+ {
357
+ label: 'Commit',
358
+ value: `${gitCommitHash}${isGitWorkingTreeDirty ? '*' : ''}`,
359
+ },
360
+ ]
361
+ : []),
350
362
  { label: 'Website link', value: updateGroupLink },
351
363
  ]));
352
364
  log_1.default.addNewLineIfNone();
@@ -19,13 +19,12 @@ function formatDeviceClass(device) {
19
19
  function formatDevice(device, team) {
20
20
  var _a, _b;
21
21
  const fields = [
22
- { label: 'ID', value: device.id },
22
+ { label: 'UDID', value: device.identifier },
23
23
  { label: 'Name', value: (_a = device.name) !== null && _a !== void 0 ? _a : 'Unknown' },
24
24
  {
25
25
  label: 'Class',
26
26
  value: formatDeviceClass(device),
27
27
  },
28
- { label: 'UDID', value: device.identifier },
29
28
  ];
30
29
  if (team) {
31
30
  fields.push({ label: 'Apple Team ID', value: team.appleTeamIdentifier }, { label: 'Apple Team Name', value: (_b = team.appleTeamName) !== null && _b !== void 0 ? _b : 'Unknown' });
@@ -2114,6 +2114,11 @@ export declare type GetSignedAssetUploadSpecificationsResult = {
2114
2114
  __typename?: 'GetSignedAssetUploadSpecificationsResult';
2115
2115
  specifications: Array<Scalars['String']>;
2116
2116
  };
2117
+ export declare enum GitHubAppEnvironment {
2118
+ Development = "DEVELOPMENT",
2119
+ Production = "PRODUCTION",
2120
+ Staging = "STAGING"
2121
+ }
2117
2122
  export declare type GitHubAppInstallation = {
2118
2123
  __typename?: 'GitHubAppInstallation';
2119
2124
  accessibleRepositories: GitHubRepositoryPaginationResult;
@@ -2166,7 +2171,9 @@ export declare type GitHubAppQuery = {
2166
2171
  __typename?: 'GitHubAppQuery';
2167
2172
  appIdentifier: Scalars['String'];
2168
2173
  clientIdentifier: Scalars['String'];
2174
+ environment: GitHubAppEnvironment;
2169
2175
  installation: GitHubAppInstallation;
2176
+ name: Scalars['String'];
2170
2177
  searchRepositories: GitHubRepositoryPaginationResult;
2171
2178
  };
2172
2179
  export declare type GitHubAppQueryInstallationArgs = {
@@ -2187,12 +2194,14 @@ export declare type GitHubRepository = {
2187
2194
  };
2188
2195
  export declare type GitHubRepositoryMetadata = {
2189
2196
  __typename?: 'GitHubRepositoryMetadata';
2197
+ defaultBranch?: Maybe<Scalars['String']>;
2190
2198
  githubRepoDescription?: Maybe<Scalars['String']>;
2191
2199
  githubRepoName: Scalars['String'];
2192
2200
  githubRepoOwnerName: Scalars['String'];
2193
2201
  githubRepoUrl: Scalars['String'];
2194
2202
  lastPushed: Scalars['DateTime'];
2195
2203
  lastUpdated: Scalars['DateTime'];
2204
+ openGraphImageUrl?: Maybe<Scalars['String']>;
2196
2205
  private: Scalars['Boolean'];
2197
2206
  };
2198
2207
  export declare type GitHubRepositoryMutation = {
@@ -2735,6 +2744,7 @@ export declare type ProjectArchiveSourceInput = {
2735
2744
  url?: InputMaybe<Scalars['String']>;
2736
2745
  };
2737
2746
  export declare enum ProjectArchiveSourceType {
2747
+ Gcs = "GCS",
2738
2748
  S3 = "S3",
2739
2749
  Url = "URL"
2740
2750
  }
@@ -2774,7 +2784,9 @@ export declare type PublicArtifacts = {
2774
2784
  export declare type PublishUpdateGroupInput = {
2775
2785
  awaitingCodeSigningInfo?: InputMaybe<Scalars['Boolean']>;
2776
2786
  branchId: Scalars['String'];
2787
+ excludedAssets?: InputMaybe<Array<PartialManifestAsset>>;
2777
2788
  gitCommitHash?: InputMaybe<Scalars['String']>;
2789
+ isGitWorkingTreeDirty?: InputMaybe<Scalars['Boolean']>;
2778
2790
  message?: InputMaybe<Scalars['String']>;
2779
2791
  runtimeVersion: Scalars['String'];
2780
2792
  updateInfoGroup: UpdateInfoGroup;
@@ -3348,6 +3360,7 @@ export declare type Update = ActivityTimelineProjectActivity & {
3348
3360
  gitCommitHash?: Maybe<Scalars['String']>;
3349
3361
  group: Scalars['String'];
3350
3362
  id: Scalars['ID'];
3363
+ isGitWorkingTreeDirty: Scalars['Boolean'];
3351
3364
  manifestFragment: Scalars['String'];
3352
3365
  manifestPermalink: Scalars['String'];
3353
3366
  message?: Maybe<Scalars['String']>;
@@ -6939,6 +6952,7 @@ export declare type CreateAndroidSubmissionMutationVariables = Exact<{
6939
6952
  appId: Scalars['ID'];
6940
6953
  config: AndroidSubmissionConfigInput;
6941
6954
  submittedBuildId?: InputMaybe<Scalars['ID']>;
6955
+ archiveSource?: InputMaybe<SubmissionArchiveSourceInput>;
6942
6956
  }>;
6943
6957
  export declare type CreateAndroidSubmissionMutation = {
6944
6958
  __typename?: 'RootMutation';
@@ -6987,6 +7001,7 @@ export declare type CreateIosSubmissionMutationVariables = Exact<{
6987
7001
  appId: Scalars['ID'];
6988
7002
  config: IosSubmissionConfigInput;
6989
7003
  submittedBuildId?: InputMaybe<Scalars['ID']>;
7004
+ archiveSource?: InputMaybe<SubmissionArchiveSourceInput>;
6990
7005
  }>;
6991
7006
  export declare type CreateIosSubmissionMutation = {
6992
7007
  __typename?: 'RootMutation';
@@ -6,8 +6,8 @@
6
6
  * For more info and docs, visit https://graphql-code-generator.com/
7
7
  */
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.SubmissionStatus = exports.SubmissionArchiveSourceType = exports.SubmissionAndroidTrack = exports.SubmissionAndroidReleaseStatus = exports.SubmissionAndroidArchiveType = exports.StatuspageServiceStatus = exports.StatuspageServiceName = exports.StatuspageIncidentStatus = exports.StatuspageIncidentImpact = exports.StandardOffer = exports.SecondFactorMethod = exports.Role = exports.ProjectArchiveSourceType = exports.Permission = exports.Order = exports.OfferType = exports.MailchimpTag = exports.MailchimpAudience = exports.IosSchemeBuildConfiguration = exports.IosManagedBuildType = exports.IosDistributionType = exports.IosBuildType = exports.InvoiceDiscountType = exports.GitHubAppInstallationStatus = exports.Feature = exports.EnvironmentSecretType = exports.EasServiceMetric = exports.EasBuildDeprecationInfoType = exports.DistributionType = exports.CacheControlScope = exports.BuildWorkflow = exports.BuildStatus = exports.BuildResourceClass = exports.BuildPriority = exports.BuildJobStatus = exports.BuildJobLogsFormat = exports.BuildIosEnterpriseProvisioning = exports.BuildCredentialsSource = exports.AuthProtocolType = exports.AssetMetadataStatus = exports.AppsFilter = exports.AppleDeviceClass = exports.AppStoreConnectUserRole = exports.AppSort = exports.AppPrivacy = exports.AppPlatform = exports.AndroidKeystoreType = exports.AndroidFcmVersion = exports.AndroidBuildType = exports.ActivityTimelineProjectActivityType = void 0;
10
- exports.WebhookType = exports.UsageMetricsGranularity = exports.UsageMetricType = exports.UploadSessionType = void 0;
9
+ exports.SubmissionArchiveSourceType = exports.SubmissionAndroidTrack = exports.SubmissionAndroidReleaseStatus = exports.SubmissionAndroidArchiveType = exports.StatuspageServiceStatus = exports.StatuspageServiceName = exports.StatuspageIncidentStatus = exports.StatuspageIncidentImpact = exports.StandardOffer = exports.SecondFactorMethod = exports.Role = exports.ProjectArchiveSourceType = exports.Permission = exports.Order = exports.OfferType = exports.MailchimpTag = exports.MailchimpAudience = exports.IosSchemeBuildConfiguration = exports.IosManagedBuildType = exports.IosDistributionType = exports.IosBuildType = exports.InvoiceDiscountType = exports.GitHubAppInstallationStatus = exports.GitHubAppEnvironment = exports.Feature = exports.EnvironmentSecretType = exports.EasServiceMetric = exports.EasBuildDeprecationInfoType = exports.DistributionType = exports.CacheControlScope = exports.BuildWorkflow = exports.BuildStatus = exports.BuildResourceClass = exports.BuildPriority = exports.BuildJobStatus = exports.BuildJobLogsFormat = exports.BuildIosEnterpriseProvisioning = exports.BuildCredentialsSource = exports.AuthProtocolType = exports.AssetMetadataStatus = exports.AppsFilter = exports.AppleDeviceClass = exports.AppStoreConnectUserRole = exports.AppSort = exports.AppPrivacy = exports.AppPlatform = exports.AndroidKeystoreType = exports.AndroidFcmVersion = exports.AndroidBuildType = exports.ActivityTimelineProjectActivityType = void 0;
10
+ exports.WebhookType = exports.UsageMetricsGranularity = exports.UsageMetricType = exports.UploadSessionType = exports.SubmissionStatus = void 0;
11
11
  var ActivityTimelineProjectActivityType;
12
12
  (function (ActivityTimelineProjectActivityType) {
13
13
  ActivityTimelineProjectActivityType["Build"] = "BUILD";
@@ -186,6 +186,12 @@ var Feature;
186
186
  /** Share access to projects */
187
187
  Feature["Teams"] = "TEAMS";
188
188
  })(Feature = exports.Feature || (exports.Feature = {}));
189
+ var GitHubAppEnvironment;
190
+ (function (GitHubAppEnvironment) {
191
+ GitHubAppEnvironment["Development"] = "DEVELOPMENT";
192
+ GitHubAppEnvironment["Production"] = "PRODUCTION";
193
+ GitHubAppEnvironment["Staging"] = "STAGING";
194
+ })(GitHubAppEnvironment = exports.GitHubAppEnvironment || (exports.GitHubAppEnvironment = {}));
189
195
  var GitHubAppInstallationStatus;
190
196
  (function (GitHubAppInstallationStatus) {
191
197
  GitHubAppInstallationStatus["Active"] = "ACTIVE";
@@ -253,6 +259,7 @@ var Permission;
253
259
  })(Permission = exports.Permission || (exports.Permission = {}));
254
260
  var ProjectArchiveSourceType;
255
261
  (function (ProjectArchiveSourceType) {
262
+ ProjectArchiveSourceType["Gcs"] = "GCS";
256
263
  ProjectArchiveSourceType["S3"] = "S3";
257
264
  ProjectArchiveSourceType["Url"] = "URL";
258
265
  })(ProjectArchiveSourceType = exports.ProjectArchiveSourceType || (exports.ProjectArchiveSourceType = {}));
@@ -15,10 +15,16 @@ exports.SubmissionMutation = {
15
15
  $appId: ID!
16
16
  $config: AndroidSubmissionConfigInput!
17
17
  $submittedBuildId: ID
18
+ $archiveSource: SubmissionArchiveSourceInput
18
19
  ) {
19
20
  submission {
20
21
  createAndroidSubmission(
21
- input: { appId: $appId, config: $config, submittedBuildId: $submittedBuildId }
22
+ input: {
23
+ appId: $appId
24
+ config: $config
25
+ submittedBuildId: $submittedBuildId
26
+ archiveSource: $archiveSource
27
+ }
22
28
  ) {
23
29
  submission {
24
30
  id
@@ -39,10 +45,16 @@ exports.SubmissionMutation = {
39
45
  $appId: ID!
40
46
  $config: IosSubmissionConfigInput!
41
47
  $submittedBuildId: ID
48
+ $archiveSource: SubmissionArchiveSourceInput
42
49
  ) {
43
50
  submission {
44
51
  createIosSubmission(
45
- input: { appId: $appId, config: $config, submittedBuildId: $submittedBuildId }
52
+ input: {
53
+ appId: $appId
54
+ config: $config
55
+ submittedBuildId: $submittedBuildId
56
+ archiveSource: $archiveSource
57
+ }
46
58
  ) {
47
59
  submission {
48
60
  id
@@ -1,9 +1,10 @@
1
1
  import { ExpoGraphqlClient } from '../../commandUtils/context/contextUtils/createGraphqlClient';
2
2
  import { UploadSessionType } from '../generated';
3
- export interface PresignedPost {
3
+ export interface SignedUrl {
4
4
  url: string;
5
- fields: Record<string, string>;
5
+ headers: Record<string, string>;
6
+ bucketKey: string;
6
7
  }
7
8
  export declare const UploadSessionMutation: {
8
- createUploadSessionAsync(graphqlClient: ExpoGraphqlClient, type: UploadSessionType): Promise<PresignedPost>;
9
+ createUploadSessionAsync(graphqlClient: ExpoGraphqlClient, type: UploadSessionType): Promise<SignedUrl>;
9
10
  };
@@ -12,14 +12,18 @@ async function getApplicationIdentifierAsync(projectDir, exp, buildProfile, plat
12
12
  if (platform === eas_build_job_1.Platform.ANDROID) {
13
13
  const profile = buildProfile;
14
14
  const workflow = await (0, workflow_1.resolveWorkflowAsync)(projectDir, eas_build_job_1.Platform.ANDROID);
15
- const gradleContext = await (0, gradle_1.resolveGradleBuildContextAsync)(projectDir, profile);
16
15
  if (workflow === eas_build_job_1.Workflow.MANAGED) {
17
- await (0, applicationId_1.ensureApplicationIdIsDefinedForManagedProjectAsync)(projectDir, exp, actor);
16
+ return await (0, applicationId_1.ensureApplicationIdIsDefinedForManagedProjectAsync)(projectDir, exp, actor);
18
17
  }
18
+ const gradleContext = await (0, gradle_1.resolveGradleBuildContextAsync)(projectDir, profile);
19
19
  return await (0, applicationId_1.getApplicationIdAsync)(projectDir, exp, gradleContext);
20
20
  }
21
21
  else {
22
+ const workflow = await (0, workflow_1.resolveWorkflowAsync)(projectDir, eas_build_job_1.Platform.IOS);
22
23
  const profile = buildProfile;
24
+ if (workflow === eas_build_job_1.Workflow.MANAGED) {
25
+ return await (0, bundleIdentifier_1.ensureBundleIdentifierIsDefinedForManagedProjectAsync)(projectDir, exp, actor);
26
+ }
23
27
  const xcodeBuildContext = await (0, scheme_1.resolveXcodeBuildContextAsync)({ exp, projectDir, nonInteractive: false }, profile);
24
28
  const targets = await (0, target_1.resolveTargetsAsync)({
25
29
  projectDir,
@@ -0,0 +1,5 @@
1
+ export declare function getAaptExecutableAsync(): Promise<string>;
2
+ export declare function getAptParametersAsync(appPath: string): Promise<{
3
+ packageName: string;
4
+ activityName: string;
5
+ }>;
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getAptParametersAsync = exports.getAaptExecutableAsync = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const spawn_async_1 = tslib_1.__importDefault(require("@expo/spawn-async"));
6
+ const fast_glob_1 = tslib_1.__importDefault(require("fast-glob"));
7
+ const path_1 = tslib_1.__importDefault(require("path"));
8
+ const log_1 = tslib_1.__importDefault(require("../../log"));
9
+ const sdk_1 = require("./sdk");
10
+ async function aaptAsync(...options) {
11
+ try {
12
+ return await (0, spawn_async_1.default)(await getAaptExecutableAsync(), options);
13
+ }
14
+ catch (error) {
15
+ if (error.stderr) {
16
+ log_1.default.error(error.stderr);
17
+ }
18
+ throw error;
19
+ }
20
+ }
21
+ async function getAaptExecutableAsync() {
22
+ const sdkRoot = await (0, sdk_1.getAndroidSdkRootAsync)();
23
+ if (!sdkRoot) {
24
+ log_1.default.debug('Failed to resolve the Android SDK path, falling back to global aapt executable');
25
+ return 'aapt';
26
+ }
27
+ const aaptPaths = await (0, fast_glob_1.default)(path_1.default.posix.join('build-tools/**', process.platform === 'win32' ? 'aapt.exe' : 'aapt'), { cwd: sdkRoot, absolute: true });
28
+ if (aaptPaths.length === 0) {
29
+ throw new Error('Failed to resolve the Android aapt path');
30
+ }
31
+ const sorted = aaptPaths.sort();
32
+ return sorted[sorted.length - 1];
33
+ }
34
+ exports.getAaptExecutableAsync = getAaptExecutableAsync;
35
+ async function getAptParametersAsync(appPath) {
36
+ const { stdout } = await aaptAsync('dump', 'badging', appPath);
37
+ const packageNameMatch = stdout.match(/package: name='([^']+)'/);
38
+ if (!packageNameMatch) {
39
+ throw new Error(`Could not read package name from ${appPath}`);
40
+ }
41
+ // get activity name
42
+ const activityNameMatch = stdout.match(/launchable-activity: name='([^']+)'/);
43
+ if (!activityNameMatch) {
44
+ throw new Error(`Could not read activity name from ${appPath}`);
45
+ }
46
+ return {
47
+ packageName: packageNameMatch[1],
48
+ activityName: activityNameMatch[1],
49
+ };
50
+ }
51
+ exports.getAptParametersAsync = getAptParametersAsync;
@@ -0,0 +1,23 @@
1
+ import { SpawnResult } from '@expo/spawn-async';
2
+ export interface AndroidEmulator {
3
+ pid?: string;
4
+ name: string;
5
+ }
6
+ export declare function adbAsync(...args: string[]): Promise<SpawnResult>;
7
+ export declare function getAdbExecutableAsync(): Promise<string>;
8
+ export declare function sanitizeAdbDeviceName(deviceName: string): string | undefined;
9
+ /**
10
+ * Return the Emulator name for an emulator ID, this can be used to determine if an emulator is booted.
11
+ *
12
+ * @param devicePid a value like `emulator-5554` from `abd devices`
13
+ */
14
+ export declare function getAdbNameForDeviceIdAsync(emulatorPid: string): Promise<string | null>;
15
+ export declare function getRunningEmulatorsAsync(): Promise<AndroidEmulator[]>;
16
+ export declare function getFirstRunningEmulatorAsync(): Promise<AndroidEmulator | null>;
17
+ /**
18
+ * Returns true if emulator is booted
19
+ *
20
+ * @param emulatorPid
21
+ */
22
+ export declare function isEmulatorBootedAsync(emulatorPid: string): Promise<boolean>;
23
+ export declare function waitForEmulatorToBeBootedAsync(maxWaitTimeMs: number, intervalMs: number): Promise<AndroidEmulator>;