eas-cli 0.39.0 → 0.42.3

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 (117) hide show
  1. package/README.md +457 -104
  2. package/bin/run +3 -4
  3. package/build/api.d.ts +1 -0
  4. package/build/api.js +13 -1
  5. package/build/build/build.js +3 -3
  6. package/build/build/configure.js +3 -3
  7. package/build/build/context.d.ts +2 -1
  8. package/build/build/createContext.d.ts +3 -2
  9. package/build/build/createContext.js +3 -3
  10. package/build/build/local.d.ts +9 -1
  11. package/build/build/local.js +35 -5
  12. package/build/build/runBuildAndSubmit.d.ts +15 -0
  13. package/build/build/runBuildAndSubmit.js +173 -0
  14. package/build/build/utils/devClient.js +3 -3
  15. package/build/commandUtils/EasCommand.d.ts +2 -1
  16. package/build/commandUtils/EasCommand.js +7 -4
  17. package/build/commands/account/login.d.ts +1 -0
  18. package/build/commands/account/login.js +1 -0
  19. package/build/commands/account/logout.d.ts +1 -0
  20. package/build/commands/account/logout.js +1 -0
  21. package/build/commands/account/view.d.ts +1 -0
  22. package/build/commands/account/view.js +1 -0
  23. package/build/commands/analytics.js +1 -1
  24. package/build/commands/branch/create.d.ts +1 -2
  25. package/build/commands/branch/create.js +3 -4
  26. package/build/commands/branch/delete.d.ts +1 -2
  27. package/build/commands/branch/delete.js +4 -5
  28. package/build/commands/branch/list.d.ts +1 -2
  29. package/build/commands/branch/list.js +4 -5
  30. package/build/commands/branch/publish.d.ts +1 -18
  31. package/build/commands/branch/publish.js +2 -354
  32. package/build/commands/branch/rename.d.ts +3 -5
  33. package/build/commands/branch/rename.js +5 -6
  34. package/build/commands/branch/view.d.ts +1 -2
  35. package/build/commands/branch/view.js +3 -4
  36. package/build/commands/build/cancel.js +1 -1
  37. package/build/commands/build/configure.d.ts +1 -2
  38. package/build/commands/build/configure.js +3 -3
  39. package/build/commands/build/index.d.ts +11 -17
  40. package/build/commands/build/index.js +28 -178
  41. package/build/commands/build/inspect.d.ts +21 -0
  42. package/build/commands/build/inspect.js +129 -0
  43. package/build/commands/build/list.d.ts +13 -14
  44. package/build/commands/build/list.js +15 -15
  45. package/build/commands/build/view.d.ts +1 -1
  46. package/build/commands/build/view.js +3 -3
  47. package/build/commands/channel/create.d.ts +1 -2
  48. package/build/commands/channel/create.js +3 -4
  49. package/build/commands/channel/edit.d.ts +2 -4
  50. package/build/commands/channel/edit.js +4 -5
  51. package/build/commands/channel/list.d.ts +1 -2
  52. package/build/commands/channel/list.js +3 -4
  53. package/build/commands/channel/rollout.d.ts +4 -5
  54. package/build/commands/channel/rollout.js +6 -7
  55. package/build/commands/channel/view.d.ts +1 -2
  56. package/build/commands/channel/view.js +3 -4
  57. package/build/commands/config.d.ts +2 -3
  58. package/build/commands/config.js +4 -4
  59. package/build/commands/credentials.js +1 -7
  60. package/build/commands/device/list.d.ts +1 -2
  61. package/build/commands/device/list.js +3 -3
  62. package/build/commands/device/view.js +1 -1
  63. package/build/commands/diagnostics.js +1 -0
  64. package/build/commands/secret/create.d.ts +4 -5
  65. package/build/commands/secret/create.js +6 -6
  66. package/build/commands/secret/delete.d.ts +1 -2
  67. package/build/commands/secret/delete.js +3 -3
  68. package/build/commands/submit.d.ts +9 -10
  69. package/build/commands/submit.js +14 -15
  70. package/build/commands/update/configure.d.ts +0 -2
  71. package/build/commands/update/configure.js +14 -14
  72. package/build/commands/update/delete.d.ts +1 -2
  73. package/build/commands/update/delete.js +3 -4
  74. package/build/commands/update/index.d.ts +18 -0
  75. package/build/commands/update/index.js +392 -0
  76. package/build/commands/update/view.d.ts +1 -2
  77. package/build/commands/update/view.js +3 -4
  78. package/build/commands/webhook/create.d.ts +3 -4
  79. package/build/commands/webhook/create.js +5 -5
  80. package/build/commands/webhook/delete.js +1 -1
  81. package/build/commands/webhook/list.d.ts +1 -2
  82. package/build/commands/webhook/list.js +3 -3
  83. package/build/commands/webhook/update.d.ts +4 -5
  84. package/build/commands/webhook/update.js +6 -6
  85. package/build/commands/webhook/view.js +1 -1
  86. package/build/credentials/context.d.ts +5 -0
  87. package/build/credentials/context.js +12 -7
  88. package/build/credentials/manager/ManageAndroid.d.ts +3 -3
  89. package/build/credentials/manager/ManageAndroid.js +21 -13
  90. package/build/credentials/manager/ManageIos.d.ts +3 -3
  91. package/build/credentials/manager/ManageIos.js +23 -13
  92. package/build/credentials/manager/SelectBuildProfileFromEasJson.d.ts +2 -3
  93. package/build/credentials/manager/SelectBuildProfileFromEasJson.js +3 -6
  94. package/build/credentials/manager/SelectPlatform.d.ts +1 -2
  95. package/build/credentials/manager/SelectPlatform.js +3 -3
  96. package/build/graphql/generated.d.ts +31 -11
  97. package/build/graphql/generated.js +6 -1
  98. package/build/graphql/types/Submission.js +1 -0
  99. package/build/index.d.ts +1 -1
  100. package/build/index.js +2 -2
  101. package/build/project/expoSdk.d.ts +3 -0
  102. package/build/project/expoSdk.js +30 -0
  103. package/build/project/metroConfig.js +2 -2
  104. package/build/project/publish.js +1 -3
  105. package/build/prompts.d.ts +3 -3
  106. package/build/submit/context.js +0 -1
  107. package/build/submit/ios/IosSubmitCommand.js +6 -1
  108. package/build/submit/utils/urls.js +1 -1
  109. package/build/update/utils.js +4 -4
  110. package/build/user/actions.js +2 -2
  111. package/build/utils/expoCli.d.ts +3 -1
  112. package/build/utils/expoCli.js +13 -11
  113. package/build/utils/profiles.d.ts +1 -1
  114. package/build/utils/profiles.js +80 -30
  115. package/build/vcs/clients/git.js +2 -2
  116. package/oclif.manifest.json +1 -1
  117. package/package.json +16 -12
@@ -1,26 +1,20 @@
1
- import { flags } from '@oclif/command';
2
1
  import EasCommand from '../../commandUtils/EasCommand';
3
2
  export default class Build extends EasCommand {
4
3
  static description: string;
5
4
  static flags: {
6
- platform: flags.IOptionFlag<string>;
7
- 'skip-credentials-check': import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
8
- json: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
9
- 'skip-project-configuration': import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
10
- profile: flags.IOptionFlag<string | undefined>;
11
- 'non-interactive': import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
12
- local: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
13
- wait: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
14
- 'clear-cache': import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
15
- 'auto-submit': import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
16
- 'auto-submit-with-profile': flags.IOptionFlag<string | undefined>;
5
+ platform: import("@oclif/core/lib/interfaces").OptionFlag<string>;
6
+ 'skip-credentials-check': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
7
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
8
+ 'skip-project-configuration': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
9
+ profile: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
10
+ 'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
11
+ local: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
12
+ wait: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
13
+ 'clear-cache': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
14
+ 'auto-submit': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
15
+ 'auto-submit-with-profile': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
17
16
  };
18
- private metroConfigValidated;
19
17
  runAsync(): Promise<void>;
20
18
  private sanitizeFlagsAsync;
21
- private prepareAndStartBuildAsync;
22
- private startBuildAsync;
23
- private prepareAndStartSubmissionAsync;
24
- private exitWithNonZeroCodeIfSomeBuildsFailed;
25
19
  }
26
20
  export declare function handleDeprecatedEasJsonAsync(projectDir: string, nonInteractive: boolean): Promise<void>;
@@ -2,147 +2,55 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.handleDeprecatedEasJsonAsync = void 0;
4
4
  const tslib_1 = require("tslib");
5
- const eas_build_job_1 = require("@expo/eas-build-job");
6
5
  const eas_json_1 = require("@expo/eas-json");
7
- const command_1 = require("@oclif/command");
8
- const errors_1 = require("@oclif/errors");
6
+ const core_1 = require("@oclif/core");
9
7
  const chalk_1 = (0, tslib_1.__importDefault)(require("chalk"));
10
8
  const figures_1 = (0, tslib_1.__importDefault)(require("figures"));
11
9
  const fs_extra_1 = (0, tslib_1.__importDefault)(require("fs-extra"));
12
- const nullthrows_1 = (0, tslib_1.__importDefault)(require("nullthrows"));
13
- const build_1 = require("../../build/android/build");
14
- const build_2 = require("../../build/build");
15
- const configure_1 = require("../../build/configure");
16
- const createContext_1 = require("../../build/createContext");
17
- const build_3 = require("../../build/ios/build");
18
- const devClient_1 = require("../../build/utils/devClient");
19
- const printBuildInfo_1 = require("../../build/utils/printBuildInfo");
10
+ const runBuildAndSubmit_1 = require("../../build/runBuildAndSubmit");
20
11
  const repository_1 = require("../../build/utils/repository");
21
12
  const EasCommand_1 = (0, tslib_1.__importDefault)(require("../../commandUtils/EasCommand"));
22
- const generated_1 = require("../../graphql/generated");
23
- const AppPlatform_1 = require("../../graphql/types/AppPlatform");
24
13
  const log_1 = (0, tslib_1.__importStar)(require("../../log"));
25
14
  const platform_1 = require("../../platform");
26
- const metroConfig_1 = require("../../project/metroConfig");
27
15
  const projectUtils_1 = require("../../project/projectUtils");
28
16
  const prompts_1 = require("../../prompts");
29
- const context_1 = require("../../submit/context");
30
- const submit_1 = require("../../submit/submit");
31
- const urls_1 = require("../../submit/utils/urls");
32
17
  const easCli_1 = require("../../utils/easCli");
33
18
  const json_1 = require("../../utils/json");
34
- const profiles_1 = require("../../utils/profiles");
35
19
  const vcs_1 = require("../../vcs");
36
20
  const git_1 = (0, tslib_1.__importDefault)(require("../../vcs/clients/git"));
37
21
  class Build extends EasCommand_1.default {
38
- constructor() {
39
- super(...arguments);
40
- this.metroConfigValidated = false;
41
- }
42
22
  async runAsync() {
43
- var _a;
44
- const { flags: rawFlags } = this.parse(Build);
23
+ const { flags: rawFlags } = await this.parse(Build);
45
24
  if (rawFlags.json) {
46
25
  (0, json_1.enableJsonOutput)();
47
26
  }
48
27
  const flags = await this.sanitizeFlagsAsync(rawFlags);
49
- const { requestedPlatform } = flags;
50
28
  const projectDir = await (0, projectUtils_1.findProjectRootAsync)();
51
29
  await handleDeprecatedEasJsonAsync(projectDir, flags.nonInteractive);
52
- await (0, vcs_1.getVcsClient)().ensureRepoExistsAsync();
53
- await (0, repository_1.ensureRepoIsCleanAsync)(flags.nonInteractive);
54
- await (0, configure_1.ensureProjectConfiguredAsync)(projectDir, requestedPlatform);
55
- const platforms = (0, platform_1.toPlatforms)(requestedPlatform);
56
- const buildProfiles = await (0, profiles_1.getProfilesAsync)({
57
- type: 'build',
58
- projectDir,
59
- platforms,
60
- profileName: (_a = flags.profile) !== null && _a !== void 0 ? _a : undefined,
61
- });
62
- await (0, devClient_1.ensureExpoDevClientInstalledForDevClientBuildsAsync)({
63
- projectDir,
64
- nonInteractive: flags.nonInteractive,
65
- buildProfiles,
66
- });
67
- const startedBuilds = [];
68
- const buildCtxByPlatform = {};
69
- for (const buildProfile of buildProfiles) {
70
- const { build: maybeBuild, buildCtx } = await this.prepareAndStartBuildAsync({
71
- projectDir,
72
- flags,
73
- moreBuilds: platforms.length > 1,
74
- buildProfile,
75
- });
76
- if (maybeBuild) {
77
- startedBuilds.push({ build: maybeBuild, buildProfile });
78
- }
79
- buildCtxByPlatform[(0, AppPlatform_1.toAppPlatform)(buildProfile.platform)] = buildCtx;
80
- }
81
- if (flags.local) {
82
- return;
83
- }
84
- log_1.default.newLine();
85
- (0, printBuildInfo_1.printLogsUrls)(startedBuilds.map(startedBuild => startedBuild.build));
86
- log_1.default.newLine();
87
- const submissions = [];
88
- if (flags.autoSubmit) {
89
- const submitProfiles = await (0, profiles_1.getProfilesAsync)({
90
- projectDir,
91
- platforms,
92
- profileName: flags.submitProfile,
93
- type: 'submit',
94
- });
95
- for (const startedBuild of startedBuilds) {
96
- const submitProfile = (0, nullthrows_1.default)(submitProfiles.find(({ platform }) => (0, AppPlatform_1.toAppPlatform)(platform) === startedBuild.build.platform)).profile;
97
- const submission = await this.prepareAndStartSubmissionAsync({
98
- build: startedBuild.build,
99
- buildCtx: (0, nullthrows_1.default)(buildCtxByPlatform[startedBuild.build.platform]),
100
- moreBuilds: startedBuilds.length > 1,
101
- projectDir,
102
- buildProfile: startedBuild.buildProfile.profile,
103
- submitProfile,
104
- nonInteractive: flags.nonInteractive,
105
- });
106
- submissions.push(submission);
107
- }
108
- log_1.default.newLine();
109
- (0, urls_1.printSubmissionDetailsUrls)(submissions);
110
- log_1.default.newLine();
111
- }
112
- if (!flags.wait) {
113
- return;
114
- }
115
- const builds = await (0, build_2.waitForBuildEndAsync)(startedBuilds.map(({ build }) => build.id));
116
- (0, printBuildInfo_1.printBuildResults)(builds, flags.json);
117
- 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));
118
- if (haveAllBuildsFailedOrCanceled || !flags.autoSubmit) {
119
- this.exitWithNonZeroCodeIfSomeBuildsFailed(builds);
120
- }
121
- else {
122
- // the following function also exits with non zero code if any of the submissions failed
123
- await (0, submit_1.waitToCompleteAsync)(submissions);
124
- }
30
+ await (0, runBuildAndSubmit_1.runBuildAndSubmitAsync)(projectDir, flags);
125
31
  }
126
32
  async sanitizeFlagsAsync(flags) {
127
33
  var _a;
128
34
  const nonInteractive = flags['non-interactive'];
129
35
  if (!flags.platform && nonInteractive) {
130
- (0, errors_1.error)('--platform is required when building in non-interactive mode', { exit: 1 });
36
+ core_1.Errors.error('--platform is required when building in non-interactive mode', { exit: 1 });
131
37
  }
132
38
  if (flags.json && !nonInteractive) {
133
- (0, errors_1.error)('--json is allowed only when building in non-interactive mode', { exit: 1 });
39
+ core_1.Errors.error('--json is allowed only when building in non-interactive mode', { exit: 1 });
134
40
  }
135
41
  const requestedPlatform = await (0, platform_1.selectRequestedPlatformAsync)(flags.platform);
136
42
  if (flags.local) {
137
43
  if (flags['auto-submit'] || flags['auto-submit-with-profile'] !== undefined) {
138
44
  // TODO: implement this
139
- (0, errors_1.error)('Auto-submits are not yet supported when building locally', { exit: 1 });
45
+ core_1.Errors.error('Auto-submits are not yet supported when building locally', { exit: 1 });
140
46
  }
141
47
  if (requestedPlatform === platform_1.RequestedPlatform.All) {
142
- (0, errors_1.error)('Builds for multiple platforms are not supported with flag --local', { exit: 1 });
48
+ core_1.Errors.error('Builds for multiple platforms are not supported with flag --local', {
49
+ exit: 1,
50
+ });
143
51
  }
144
52
  else if (process.platform !== 'darwin' && requestedPlatform === platform_1.RequestedPlatform.Ios) {
145
- (0, errors_1.error)('Unsupported platform, macOS is required to build apps for iOS', { exit: 1 });
53
+ core_1.Errors.error('Unsupported platform, macOS is required to build apps for iOS', { exit: 1 });
146
54
  }
147
55
  }
148
56
  if (flags['skip-credentials-check']) {
@@ -155,7 +63,11 @@ class Build extends EasCommand_1.default {
155
63
  skipProjectConfiguration: flags['skip-project-configuration'],
156
64
  profile,
157
65
  nonInteractive,
158
- local: flags['local'],
66
+ localBuildOptions: flags['local']
67
+ ? { enable: true, verbose: true }
68
+ : {
69
+ enable: false,
70
+ },
159
71
  wait: flags['wait'],
160
72
  clearCache: flags['clear-cache'],
161
73
  json: flags['json'],
@@ -163,115 +75,53 @@ class Build extends EasCommand_1.default {
163
75
  submitProfile: (_a = flags['auto-submit-with-profile']) !== null && _a !== void 0 ? _a : profile,
164
76
  };
165
77
  }
166
- async prepareAndStartBuildAsync({ projectDir, flags, moreBuilds, buildProfile, }) {
167
- const buildCtx = await (0, createContext_1.createBuildContextAsync)({
168
- buildProfileName: buildProfile.profileName,
169
- clearCache: flags.clearCache,
170
- buildProfile: buildProfile.profile,
171
- local: flags.local,
172
- nonInteractive: flags.nonInteractive,
173
- platform: buildProfile.platform,
174
- projectDir,
175
- skipProjectConfiguration: flags.skipProjectConfiguration,
176
- });
177
- if (moreBuilds) {
178
- log_1.default.newLine();
179
- const appPlatform = (0, AppPlatform_1.toAppPlatform)(buildProfile.platform);
180
- log_1.default.log(`${platform_1.appPlatformEmojis[appPlatform]} ${chalk_1.default.bold(`${platform_1.appPlatformDisplayNames[appPlatform]} build`)}`);
181
- }
182
- if (buildCtx.workflow === eas_build_job_1.Workflow.MANAGED && !this.metroConfigValidated) {
183
- await (0, metroConfig_1.validateMetroConfigForManagedWorkflowAsync)(buildCtx);
184
- this.metroConfigValidated = true;
185
- }
186
- const build = await this.startBuildAsync(buildCtx);
187
- return {
188
- build,
189
- buildCtx,
190
- };
191
- }
192
- async startBuildAsync(ctx) {
193
- let sendBuildRequestAsync;
194
- if (ctx.platform === eas_build_job_1.Platform.ANDROID) {
195
- sendBuildRequestAsync = await (0, build_1.prepareAndroidBuildAsync)(ctx);
196
- }
197
- else {
198
- sendBuildRequestAsync = await (0, build_3.prepareIosBuildAsync)(ctx);
199
- }
200
- return await sendBuildRequestAsync();
201
- }
202
- async prepareAndStartSubmissionAsync({ build, buildCtx, moreBuilds, projectDir, buildProfile, submitProfile, nonInteractive, }) {
203
- var _a, _b, _c;
204
- const platform = (0, AppPlatform_1.toPlatform)(build.platform);
205
- const submissionCtx = await (0, context_1.createSubmissionContextAsync)({
206
- platform,
207
- projectDir,
208
- projectId: build.project.id,
209
- profile: submitProfile,
210
- archiveFlags: { id: build.id },
211
- nonInteractive,
212
- env: buildProfile.env,
213
- credentialsCtx: buildCtx.credentialsCtx,
214
- applicationIdentifier: (_b = (_a = buildCtx.android) === null || _a === void 0 ? void 0 : _a.applicationId) !== null && _b !== void 0 ? _b : (_c = buildCtx.ios) === null || _c === void 0 ? void 0 : _c.bundleIdentifier,
215
- });
216
- if (moreBuilds) {
217
- log_1.default.newLine();
218
- log_1.default.log(`${platform_1.appPlatformEmojis[build.platform]} ${chalk_1.default.bold(`${platform_1.appPlatformDisplayNames[build.platform]} submission`)}`);
219
- }
220
- return await (0, submit_1.submitAsync)(submissionCtx);
221
- }
222
- exitWithNonZeroCodeIfSomeBuildsFailed(maybeBuilds) {
223
- const failedBuilds = maybeBuilds.filter(i => i).filter(i => i.status === generated_1.BuildStatus.Errored);
224
- if (failedBuilds.length > 0) {
225
- process.exit(1);
226
- }
227
- }
228
78
  }
229
79
  exports.default = Build;
230
- Build.description = 'start a build';
80
+ Build.description = 'Start a build';
231
81
  Build.flags = {
232
- platform: command_1.flags.enum({
82
+ platform: core_1.Flags.enum({
233
83
  char: 'p',
234
84
  options: ['android', 'ios', 'all'],
235
85
  }),
236
- 'skip-credentials-check': command_1.flags.boolean({
86
+ 'skip-credentials-check': core_1.Flags.boolean({
237
87
  default: false,
238
88
  hidden: true,
239
89
  }),
240
- json: command_1.flags.boolean({
90
+ json: core_1.Flags.boolean({
241
91
  description: 'Enable JSON output, non-JSON messages will be printed to stderr',
242
92
  default: false,
243
93
  }),
244
- 'skip-project-configuration': command_1.flags.boolean({
94
+ 'skip-project-configuration': core_1.Flags.boolean({
245
95
  default: false,
246
96
  description: 'Skip project configuration',
247
97
  }),
248
- profile: command_1.flags.string({
98
+ profile: core_1.Flags.string({
249
99
  description: 'Name of the build profile from eas.json. Defaults to "production" if defined in eas.json.',
250
100
  helpValue: 'PROFILE_NAME',
251
101
  }),
252
- 'non-interactive': command_1.flags.boolean({
102
+ 'non-interactive': core_1.Flags.boolean({
253
103
  default: false,
254
104
  description: 'Run command in non-interactive mode',
255
105
  }),
256
- local: command_1.flags.boolean({
106
+ local: core_1.Flags.boolean({
257
107
  default: false,
258
108
  description: 'Run build locally [experimental]',
259
109
  }),
260
- wait: command_1.flags.boolean({
110
+ wait: core_1.Flags.boolean({
261
111
  default: true,
262
112
  allowNo: true,
263
113
  description: 'Wait for build(s) to complete',
264
114
  }),
265
- 'clear-cache': command_1.flags.boolean({
115
+ 'clear-cache': core_1.Flags.boolean({
266
116
  default: false,
267
117
  description: 'Clear cache before the build',
268
118
  }),
269
- 'auto-submit': command_1.flags.boolean({
119
+ 'auto-submit': core_1.Flags.boolean({
270
120
  default: false,
271
121
  description: 'Submit on build complete using the submit profile with the same name as the build profile',
272
122
  exclusive: ['auto-submit-with-profile'],
273
123
  }),
274
- 'auto-submit-with-profile': command_1.flags.string({
124
+ 'auto-submit-with-profile': core_1.Flags.string({
275
125
  description: 'Submit on build complete using the submit profile with provided name',
276
126
  helpValue: 'PROFILE_NAME',
277
127
  exclusive: ['auto-submit'],
@@ -0,0 +1,21 @@
1
+ import EasCommand from '../../commandUtils/EasCommand';
2
+ import { RequestedPlatform } from '../../platform';
3
+ declare enum InspectStage {
4
+ ARCHIVE = "archive",
5
+ PRE_BUILD = "pre-build",
6
+ POST_BUILD = "post-build"
7
+ }
8
+ export default class BuildInspect extends EasCommand {
9
+ static description: string;
10
+ static flags: {
11
+ platform: import("@oclif/core/lib/interfaces").OptionFlag<RequestedPlatform>;
12
+ profile: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
13
+ stage: import("@oclif/core/lib/interfaces").OptionFlag<InspectStage>;
14
+ output: import("@oclif/core/lib/interfaces").OptionFlag<string>;
15
+ force: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
16
+ verbose: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
17
+ };
18
+ runAsync(): Promise<void>;
19
+ private prepareOutputDirAsync;
20
+ }
21
+ export {};
@@ -0,0 +1,129 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const core_1 = require("@oclif/core");
5
+ const chalk_1 = (0, tslib_1.__importDefault)(require("chalk"));
6
+ const fs_extra_1 = (0, tslib_1.__importDefault)(require("fs-extra"));
7
+ const path_1 = (0, tslib_1.__importDefault)(require("path"));
8
+ const uuid_1 = require("uuid");
9
+ const runBuildAndSubmit_1 = require("../../build/runBuildAndSubmit");
10
+ const EasCommand_1 = (0, tslib_1.__importDefault)(require("../../commandUtils/EasCommand"));
11
+ const log_1 = (0, tslib_1.__importDefault)(require("../../log"));
12
+ const ora_1 = require("../../ora");
13
+ const platform_1 = require("../../platform");
14
+ const projectUtils_1 = require("../../project/projectUtils");
15
+ const paths_1 = require("../../utils/paths");
16
+ const vcs_1 = require("../../vcs");
17
+ var InspectStage;
18
+ (function (InspectStage) {
19
+ InspectStage["ARCHIVE"] = "archive";
20
+ InspectStage["PRE_BUILD"] = "pre-build";
21
+ InspectStage["POST_BUILD"] = "post-build";
22
+ })(InspectStage || (InspectStage = {}));
23
+ const STAGE_DESCRIPTION = `Stage of the build you want to inspect.
24
+ archive - builds the project archive that would be uploaded to EAS when building
25
+ pre-build - prepares the project to be built with Gradle/Xcode. Does not run the native build.
26
+ post-build - builds the native project and leaves the output directory for inspection`;
27
+ class BuildInspect extends EasCommand_1.default {
28
+ async runAsync() {
29
+ const { flags } = await this.parse(BuildInspect);
30
+ const outputDirectory = path_1.default.resolve(process.cwd(), flags.output);
31
+ await this.prepareOutputDirAsync(outputDirectory, flags.force);
32
+ if (flags.stage === InspectStage.ARCHIVE) {
33
+ const vcs = (0, vcs_1.getVcsClient)();
34
+ await vcs.ensureRepoExistsAsync();
35
+ await vcs.makeShallowCopyAsync(outputDirectory);
36
+ log_1.default.withTick(`Project saved to ${outputDirectory}`);
37
+ }
38
+ else {
39
+ const projectDir = await (0, projectUtils_1.findProjectRootAsync)();
40
+ const tmpWorkingdir = path_1.default.join((0, paths_1.getTmpDirectory)(), (0, uuid_1.v4)());
41
+ try {
42
+ await (0, runBuildAndSubmit_1.runBuildAndSubmitAsync)(projectDir, {
43
+ skipProjectConfiguration: false,
44
+ nonInteractive: false,
45
+ wait: true,
46
+ clearCache: false,
47
+ json: false,
48
+ autoSubmit: false,
49
+ requestedPlatform: flags.platform,
50
+ profile: flags.profile,
51
+ localBuildOptions: {
52
+ enable: true,
53
+ ...(flags.stage === InspectStage.PRE_BUILD ? { skipNativeBuild: true } : {}),
54
+ ...(flags.stage === InspectStage.POST_BUILD ? { skipCleanup: true } : {}),
55
+ verbose: flags.verbose,
56
+ workingdir: tmpWorkingdir,
57
+ artifactsDir: path_1.default.join(tmpWorkingdir, 'artifacts'),
58
+ },
59
+ });
60
+ if (!flags.verbose) {
61
+ log_1.default.log(chalk_1.default.green('Build successful'));
62
+ }
63
+ }
64
+ catch (err) {
65
+ if (!flags.verbose) {
66
+ log_1.default.error('Build failed');
67
+ log_1.default.error(`Re-run this command with ${chalk_1.default.bold('--verbose')} flag to see the logs`);
68
+ }
69
+ }
70
+ finally {
71
+ const spinner = (0, ora_1.ora)().start(`Copying project build directory to ${outputDirectory}`);
72
+ try {
73
+ const tmpBuildDirectory = path_1.default.join(tmpWorkingdir, 'build');
74
+ if (await fs_extra_1.default.pathExists(tmpBuildDirectory)) {
75
+ await fs_extra_1.default.copy(tmpBuildDirectory, outputDirectory);
76
+ }
77
+ await fs_extra_1.default.remove(tmpWorkingdir);
78
+ spinner.succeed(`Project build directory saved to ${outputDirectory}`);
79
+ }
80
+ catch (err) {
81
+ spinner.fail();
82
+ throw err;
83
+ }
84
+ }
85
+ }
86
+ }
87
+ async prepareOutputDirAsync(outputDir, force) {
88
+ if (await fs_extra_1.default.pathExists(outputDir)) {
89
+ if (force) {
90
+ await fs_extra_1.default.remove(outputDir);
91
+ }
92
+ else {
93
+ throw new Error(`Directory ${outputDir} already exists`);
94
+ }
95
+ }
96
+ await fs_extra_1.default.mkdirp(outputDir);
97
+ }
98
+ }
99
+ exports.default = BuildInspect;
100
+ BuildInspect.description = 'Inspect the state of the project at specific build stages. Useful for troubleshooting.';
101
+ BuildInspect.flags = {
102
+ platform: core_1.Flags.enum({
103
+ char: 'p',
104
+ options: [platform_1.RequestedPlatform.Android, platform_1.RequestedPlatform.Ios],
105
+ required: true,
106
+ }),
107
+ profile: core_1.Flags.string({
108
+ description: 'Name of the build profile from eas.json. Defaults to "production" if defined in eas.json.',
109
+ helpValue: 'PROFILE_NAME',
110
+ }),
111
+ stage: core_1.Flags.enum({
112
+ char: 's',
113
+ description: STAGE_DESCRIPTION,
114
+ options: [InspectStage.ARCHIVE, InspectStage.PRE_BUILD, InspectStage.POST_BUILD],
115
+ required: true,
116
+ }),
117
+ output: core_1.Flags.string({
118
+ description: 'Output directory.',
119
+ required: true,
120
+ helpValue: 'OUTPUT_DIRECTORY',
121
+ }),
122
+ force: core_1.Flags.boolean({
123
+ description: 'Delete OUTPUT_DIRECTORY if it already exists.',
124
+ default: false,
125
+ }),
126
+ verbose: core_1.Flags.boolean({
127
+ default: false,
128
+ }),
129
+ };
@@ -1,23 +1,22 @@
1
- import { flags } from '@oclif/command';
2
1
  import { BuildDistributionType, BuildStatus } from '../../build/types';
3
2
  import EasCommand from '../../commandUtils/EasCommand';
4
3
  import { RequestedPlatform } from '../../platform';
5
4
  export default class BuildList extends EasCommand {
6
5
  static description: string;
7
6
  static flags: {
8
- platform: flags.IOptionFlag<RequestedPlatform>;
9
- json: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
10
- status: flags.IOptionFlag<BuildStatus>;
11
- distribution: flags.IOptionFlag<BuildDistributionType>;
12
- channel: flags.IOptionFlag<string | undefined>;
13
- appVersion: flags.IOptionFlag<string | undefined>;
14
- appBuildVersion: flags.IOptionFlag<string | undefined>;
15
- sdkVersion: flags.IOptionFlag<string | undefined>;
16
- runtimeVersion: flags.IOptionFlag<string | undefined>;
17
- appIdentifier: flags.IOptionFlag<string | undefined>;
18
- buildProfile: flags.IOptionFlag<string | undefined>;
19
- gitCommitHash: flags.IOptionFlag<string | undefined>;
20
- limit: import("@oclif/parser/lib/flags").IOptionFlag<number | undefined>;
7
+ platform: import("@oclif/core/lib/interfaces").OptionFlag<RequestedPlatform>;
8
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
9
+ status: import("@oclif/core/lib/interfaces").OptionFlag<BuildStatus>;
10
+ distribution: import("@oclif/core/lib/interfaces").OptionFlag<BuildDistributionType>;
11
+ channel: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
12
+ appVersion: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
13
+ appBuildVersion: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
14
+ sdkVersion: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
15
+ runtimeVersion: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
16
+ appIdentifier: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
17
+ buildProfile: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
18
+ gitCommitHash: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
19
+ limit: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined>;
21
20
  };
22
21
  runAsync(): Promise<void>;
23
22
  }
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  const config_1 = require("@expo/config");
5
- const command_1 = require("@oclif/command");
5
+ const core_1 = require("@oclif/core");
6
6
  const chalk_1 = (0, tslib_1.__importDefault)(require("chalk"));
7
7
  const types_1 = require("../../build/types");
8
8
  const formatBuild_1 = require("../../build/utils/formatBuild");
@@ -16,7 +16,7 @@ const projectUtils_1 = require("../../project/projectUtils");
16
16
  const json_1 = require("../../utils/json");
17
17
  class BuildList extends EasCommand_1.default {
18
18
  async runAsync() {
19
- const { flags } = this.parse(BuildList);
19
+ const { flags } = await this.parse(BuildList);
20
20
  const { json, platform: requestedPlatform, status: buildStatus, distribution: buildDistribution, limit = 10, } = flags;
21
21
  if (json) {
22
22
  (0, json_1.enableJsonOutput)();
@@ -76,13 +76,13 @@ class BuildList extends EasCommand_1.default {
76
76
  exports.default = BuildList;
77
77
  BuildList.description = 'list all builds for your project';
78
78
  BuildList.flags = {
79
- platform: command_1.flags.enum({
79
+ platform: core_1.Flags.enum({
80
80
  options: [platform_1.RequestedPlatform.All, platform_1.RequestedPlatform.Android, platform_1.RequestedPlatform.Ios],
81
81
  }),
82
- json: command_1.flags.boolean({
82
+ json: core_1.Flags.boolean({
83
83
  description: 'Enable JSON output, non-JSON messages will be printed to stderr',
84
84
  }),
85
- status: command_1.flags.enum({
85
+ status: core_1.Flags.enum({
86
86
  options: [
87
87
  types_1.BuildStatus.NEW,
88
88
  types_1.BuildStatus.IN_QUEUE,
@@ -92,22 +92,22 @@ BuildList.flags = {
92
92
  types_1.BuildStatus.CANCELED,
93
93
  ],
94
94
  }),
95
- distribution: command_1.flags.enum({
95
+ distribution: core_1.Flags.enum({
96
96
  options: [
97
97
  types_1.BuildDistributionType.STORE,
98
98
  types_1.BuildDistributionType.INTERNAL,
99
99
  types_1.BuildDistributionType.SIMULATOR,
100
100
  ],
101
101
  }),
102
- channel: command_1.flags.string(),
103
- appVersion: command_1.flags.string(),
104
- appBuildVersion: command_1.flags.string(),
105
- sdkVersion: command_1.flags.string(),
106
- runtimeVersion: command_1.flags.string(),
107
- appIdentifier: command_1.flags.string(),
108
- buildProfile: command_1.flags.string(),
109
- gitCommitHash: command_1.flags.string(),
110
- limit: command_1.flags.integer(),
102
+ channel: core_1.Flags.string(),
103
+ appVersion: core_1.Flags.string(),
104
+ appBuildVersion: core_1.Flags.string(),
105
+ sdkVersion: core_1.Flags.string(),
106
+ runtimeVersion: core_1.Flags.string(),
107
+ appIdentifier: core_1.Flags.string(),
108
+ buildProfile: core_1.Flags.string(),
109
+ gitCommitHash: core_1.Flags.string(),
110
+ limit: core_1.Flags.integer(),
111
111
  };
112
112
  const toAppPlatform = (requestedPlatform) => {
113
113
  if (!requestedPlatform || requestedPlatform === platform_1.RequestedPlatform.All) {
@@ -5,7 +5,7 @@ export default class BuildView extends EasCommand {
5
5
  name: string;
6
6
  }[];
7
7
  static flags: {
8
- json: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
8
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
9
9
  };
10
10
  runAsync(): Promise<void>;
11
11
  }
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  const config_1 = require("@expo/config");
5
- const command_1 = require("@oclif/command");
5
+ const core_1 = require("@oclif/core");
6
6
  const formatBuild_1 = require("../../build/utils/formatBuild");
7
7
  const EasCommand_1 = (0, tslib_1.__importDefault)(require("../../commandUtils/EasCommand"));
8
8
  const BuildQuery_1 = require("../../graphql/queries/BuildQuery");
@@ -12,7 +12,7 @@ const projectUtils_1 = require("../../project/projectUtils");
12
12
  const json_1 = require("../../utils/json");
13
13
  class BuildView extends EasCommand_1.default {
14
14
  async runAsync() {
15
- const { args: { BUILD_ID: buildId }, flags, } = this.parse(BuildView);
15
+ const { args: { BUILD_ID: buildId }, flags, } = await this.parse(BuildView);
16
16
  if (flags.json) {
17
17
  (0, json_1.enableJsonOutput)();
18
18
  }
@@ -62,7 +62,7 @@ exports.default = BuildView;
62
62
  BuildView.description = 'view a build for your project';
63
63
  BuildView.args = [{ name: 'BUILD_ID' }];
64
64
  BuildView.flags = {
65
- json: command_1.flags.boolean({
65
+ json: core_1.Flags.boolean({
66
66
  description: 'Enable JSON output, non-JSON messages will be printed to stderr',
67
67
  }),
68
68
  };
@@ -6,7 +6,6 @@ export declare function createUpdateChannelOnAppAsync({ appId, channelName, bran
6
6
  branchId: string;
7
7
  }): Promise<CreateUpdateChannelOnAppMutation>;
8
8
  export default class ChannelCreate extends EasCommand {
9
- static hidden: boolean;
10
9
  static description: string;
11
10
  static args: {
12
11
  name: string;
@@ -14,7 +13,7 @@ export default class ChannelCreate extends EasCommand {
14
13
  description: string;
15
14
  }[];
16
15
  static flags: {
17
- json: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
16
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
18
17
  };
19
18
  runAsync(): Promise<void>;
20
19
  }