eas-cli 0.41.1 → 0.44.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 (113) hide show
  1. package/README.md +313 -157
  2. package/bin/dev +17 -0
  3. package/bin/dev.cmd +3 -0
  4. package/bin/run +3 -3
  5. package/build/build/android/UpdatesModule.d.ts +0 -1
  6. package/build/build/android/UpdatesModule.js +4 -37
  7. package/build/build/android/build.js +3 -3
  8. package/build/build/android/{configure.d.ts → syncProjectConfiguration.d.ts} +2 -3
  9. package/build/build/android/{configure.js → syncProjectConfiguration.js} +22 -23
  10. package/build/build/build.d.ts +1 -1
  11. package/build/build/build.js +6 -8
  12. package/build/build/configure.d.ts +12 -7
  13. package/build/build/configure.js +25 -99
  14. package/build/build/context.d.ts +0 -12
  15. package/build/build/createContext.d.ts +1 -2
  16. package/build/build/createContext.js +1 -2
  17. package/build/build/ios/UpdatesModule.d.ts +0 -1
  18. package/build/build/ios/UpdatesModule.js +8 -39
  19. package/build/build/ios/build.js +3 -3
  20. package/build/build/ios/{configure.d.ts → syncProjectConfiguration.d.ts} +1 -3
  21. package/build/build/ios/{configure.js → syncProjectConfiguration.js} +3 -18
  22. package/build/build/local.d.ts +1 -0
  23. package/build/build/local.js +2 -1
  24. package/build/build/runBuildAndSubmit.d.ts +0 -1
  25. package/build/build/runBuildAndSubmit.js +4 -2
  26. package/build/build/utils/devClient.js +3 -3
  27. package/build/commandUtils/EasCommand.d.ts +2 -1
  28. package/build/commandUtils/EasCommand.js +7 -4
  29. package/build/commands/account/login.d.ts +1 -0
  30. package/build/commands/account/login.js +1 -0
  31. package/build/commands/account/logout.d.ts +1 -0
  32. package/build/commands/account/logout.js +1 -0
  33. package/build/commands/account/view.d.ts +1 -0
  34. package/build/commands/account/view.js +1 -0
  35. package/build/commands/analytics.js +1 -1
  36. package/build/commands/branch/create.d.ts +1 -1
  37. package/build/commands/branch/create.js +11 -6
  38. package/build/commands/branch/delete.d.ts +1 -1
  39. package/build/commands/branch/delete.js +11 -5
  40. package/build/commands/branch/list.d.ts +1 -1
  41. package/build/commands/branch/list.js +8 -4
  42. package/build/commands/branch/rename.d.ts +3 -4
  43. package/build/commands/branch/rename.js +13 -8
  44. package/build/commands/branch/view.d.ts +1 -3
  45. package/build/commands/branch/view.js +35 -74
  46. package/build/commands/build/cancel.js +1 -1
  47. package/build/commands/build/configure.d.ts +1 -2
  48. package/build/commands/build/configure.js +38 -28
  49. package/build/commands/build/index.d.ts +12 -12
  50. package/build/commands/build/index.js +32 -21
  51. package/build/commands/build/inspect.d.ts +7 -7
  52. package/build/commands/build/inspect.js +31 -25
  53. package/build/commands/build/list.d.ts +13 -14
  54. package/build/commands/build/list.js +15 -15
  55. package/build/commands/build/view.d.ts +1 -1
  56. package/build/commands/build/view.js +3 -3
  57. package/build/commands/channel/create.d.ts +1 -1
  58. package/build/commands/channel/create.js +24 -19
  59. package/build/commands/channel/delete.d.ts +15 -0
  60. package/build/commands/channel/delete.js +124 -0
  61. package/build/commands/channel/edit.d.ts +2 -3
  62. package/build/commands/channel/edit.js +14 -9
  63. package/build/commands/channel/list.d.ts +1 -1
  64. package/build/commands/channel/list.js +17 -12
  65. package/build/commands/channel/rollout.d.ts +4 -5
  66. package/build/commands/channel/rollout.js +14 -10
  67. package/build/commands/channel/view.d.ts +1 -1
  68. package/build/commands/channel/view.js +19 -14
  69. package/build/commands/config.d.ts +2 -3
  70. package/build/commands/config.js +4 -4
  71. package/build/commands/device/list.d.ts +1 -2
  72. package/build/commands/device/list.js +3 -3
  73. package/build/commands/device/view.js +1 -1
  74. package/build/commands/secret/create.d.ts +4 -5
  75. package/build/commands/secret/create.js +6 -6
  76. package/build/commands/secret/delete.d.ts +1 -2
  77. package/build/commands/secret/delete.js +3 -3
  78. package/build/commands/submit.d.ts +9 -10
  79. package/build/commands/submit.js +13 -14
  80. package/build/commands/update/configure.js +1 -1
  81. package/build/commands/update/delete.d.ts +1 -1
  82. package/build/commands/update/delete.js +12 -7
  83. package/build/commands/update/index.d.ts +9 -10
  84. package/build/commands/update/index.js +29 -17
  85. package/build/commands/update/list.d.ts +10 -0
  86. package/build/commands/update/list.js +114 -0
  87. package/build/commands/update/view.d.ts +1 -1
  88. package/build/commands/update/view.js +25 -20
  89. package/build/commands/webhook/create.d.ts +3 -4
  90. package/build/commands/webhook/create.js +5 -5
  91. package/build/commands/webhook/delete.js +1 -1
  92. package/build/commands/webhook/list.d.ts +1 -2
  93. package/build/commands/webhook/list.js +3 -3
  94. package/build/commands/webhook/update.d.ts +4 -5
  95. package/build/commands/webhook/update.js +6 -6
  96. package/build/commands/webhook/view.js +1 -1
  97. package/build/credentials/ios/appstore/bundleIdCapabilities.js +0 -2
  98. package/build/credentials/ios/appstore/ensureAppExists.js +3 -1
  99. package/build/graphql/generated.d.ts +92 -30
  100. package/build/graphql/queries/UpdateQuery.d.ts +7 -0
  101. package/build/graphql/queries/UpdateQuery.js +85 -0
  102. package/build/index.d.ts +1 -1
  103. package/build/index.js +2 -2
  104. package/build/project/expoSdk.js +2 -2
  105. package/build/project/metroConfig.js +2 -2
  106. package/build/project/publish.js +1 -3
  107. package/build/user/actions.js +2 -2
  108. package/build/utils/expoCli.d.ts +3 -1
  109. package/build/utils/expoCli.js +13 -11
  110. package/build/vcs/clients/git.js +2 -2
  111. package/build/vcs/local.js +5 -1
  112. package/oclif.manifest.json +1 -1
  113. package/package.json +21 -14
@@ -1,18 +1,17 @@
1
- import { flags } from '@oclif/command';
2
1
  import EasCommand from '../commandUtils/EasCommand';
3
2
  export default class Submit extends EasCommand {
4
3
  static description: string;
5
4
  static aliases: string[];
6
5
  static flags: {
7
- platform: flags.IOptionFlag<string>;
8
- profile: flags.IOptionFlag<string | undefined>;
9
- latest: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
10
- id: flags.IOptionFlag<string | undefined>;
11
- path: flags.IOptionFlag<string | undefined>;
12
- url: flags.IOptionFlag<string | undefined>;
13
- verbose: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
14
- wait: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
15
- 'non-interactive': import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
6
+ platform: import("@oclif/core/lib/interfaces").OptionFlag<string>;
7
+ profile: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
8
+ latest: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
9
+ id: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
10
+ path: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
11
+ url: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
12
+ verbose: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
13
+ wait: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
14
+ 'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
16
15
  };
17
16
  runAsync(): Promise<void>;
18
17
  private sanitizeFlagsAsync;
@@ -2,8 +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");
6
- const errors_1 = require("@oclif/errors");
5
+ const core_1 = require("@oclif/core");
7
6
  const chalk_1 = (0, tslib_1.__importDefault)(require("chalk"));
8
7
  const EasCommand_1 = (0, tslib_1.__importDefault)(require("../commandUtils/EasCommand"));
9
8
  const AppPlatform_1 = require("../graphql/types/AppPlatform");
@@ -16,7 +15,7 @@ const urls_1 = require("../submit/utils/urls");
16
15
  const profiles_1 = require("../utils/profiles");
17
16
  class Submit extends EasCommand_1.default {
18
17
  async runAsync() {
19
- const { flags: rawFlags } = this.parse(Submit);
18
+ const { flags: rawFlags } = await this.parse(Submit);
20
19
  const flags = await this.sanitizeFlagsAsync(rawFlags);
21
20
  const projectDir = await (0, projectUtils_1.findProjectRootAsync)();
22
21
  const { exp } = (0, config_1.getConfig)(projectDir, { skipSDKVersionRequirement: true });
@@ -55,12 +54,12 @@ class Submit extends EasCommand_1.default {
55
54
  async sanitizeFlagsAsync(flags) {
56
55
  const { platform, verbose, wait, profile, 'non-interactive': nonInteractive, ...archiveFlags } = flags;
57
56
  if (!flags.platform && nonInteractive) {
58
- (0, errors_1.error)('--platform is required when building in non-interactive mode', { exit: 1 });
57
+ core_1.Errors.error('--platform is required when building in non-interactive mode', { exit: 1 });
59
58
  }
60
59
  const requestedPlatform = await (0, platform_1.selectRequestedPlatformAsync)(flags.platform);
61
60
  if (requestedPlatform === platform_1.RequestedPlatform.All) {
62
61
  if (archiveFlags.id || archiveFlags.path || archiveFlags.url) {
63
- (0, errors_1.error)('--id, --path, and --url params are only supported when performing a single-platform submit', { exit: 1 });
62
+ core_1.Errors.error('--id, --path, and --url params are only supported when performing a single-platform submit', { exit: 1 });
64
63
  }
65
64
  }
66
65
  return {
@@ -78,39 +77,39 @@ Submit.description = `Submit build archive to App Store Connect
78
77
  See how to configure submits with eas.json: ${(0, log_1.link)('https://docs.expo.dev/submit/eas-json/')}`;
79
78
  Submit.aliases = ['build:submit'];
80
79
  Submit.flags = {
81
- platform: command_1.flags.enum({
80
+ platform: core_1.Flags.enum({
82
81
  char: 'p',
83
82
  options: ['android', 'ios', 'all'],
84
83
  }),
85
- profile: command_1.flags.string({
84
+ profile: core_1.Flags.string({
86
85
  description: 'Name of the submit profile from eas.json. Defaults to "production" if defined in eas.json.',
87
86
  }),
88
- latest: command_1.flags.boolean({
87
+ latest: core_1.Flags.boolean({
89
88
  description: 'Submit the latest build for specified platform',
90
89
  exclusive: ['id', 'path', 'url'],
91
90
  }),
92
- id: command_1.flags.string({
91
+ id: core_1.Flags.string({
93
92
  description: 'ID of the build to submit',
94
93
  exclusive: ['latest, path, url'],
95
94
  }),
96
- path: command_1.flags.string({
95
+ path: core_1.Flags.string({
97
96
  description: 'Path to the .apk/.aab/.ipa file',
98
97
  exclusive: ['latest', 'id', 'url'],
99
98
  }),
100
- url: command_1.flags.string({
99
+ url: core_1.Flags.string({
101
100
  description: 'App archive url',
102
101
  exclusive: ['latest', 'id', 'path'],
103
102
  }),
104
- verbose: command_1.flags.boolean({
103
+ verbose: core_1.Flags.boolean({
105
104
  description: 'Always print logs from Submission Service',
106
105
  default: false,
107
106
  }),
108
- wait: command_1.flags.boolean({
107
+ wait: core_1.Flags.boolean({
109
108
  description: 'Wait for submission to complete',
110
109
  default: true,
111
110
  allowNo: true,
112
111
  }),
113
- 'non-interactive': command_1.flags.boolean({
112
+ 'non-interactive': core_1.Flags.boolean({
114
113
  default: false,
115
114
  description: 'Run command in non-interactive mode',
116
115
  }),
@@ -41,7 +41,7 @@ async function configureProjectForEASUpdateAsync(projectDir, exp, isBare) {
41
41
  log_1.default.addNewLineIfNone();
42
42
  log_1.default.warn(`It looks like you are using a dynamic configuration! ${(0, log_1.learnMore)('https://docs.expo.dev/workflow/configuration/#dynamic-configuration-with-appconfigjs)')}`);
43
43
  log_1.default.warn(`In order to finish configuring your project for EAS Update, you are going to need manually add the following to your app.config.js:\n${(0, log_1.learnMore)('https://expo.fyi/eas-update-config.md')}\n`);
44
- log_1.default.log(chalk_1.default.bold(`{\n updates": {\n "url": "${easUpdateURL}"\n },\n "runtimeVersion": {\n "policy": "sdkVersion"\n }\n}`));
44
+ log_1.default.log(chalk_1.default.bold(`{\n "updates": {\n "url": "${easUpdateURL}"\n },\n "runtimeVersion": {\n "policy": "sdkVersion"\n }\n}`));
45
45
  log_1.default.addNewLineIfNone();
46
46
  throw new Error(result.message);
47
47
  }
@@ -7,7 +7,7 @@ export default class UpdateDelete extends EasCommand {
7
7
  description: string;
8
8
  }[];
9
9
  static flags: {
10
- json: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
10
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
11
11
  };
12
12
  runAsync(): Promise<void>;
13
13
  }
@@ -1,13 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
- const command_1 = require("@oclif/command");
4
+ const core_1 = require("@oclif/core");
5
5
  const chalk_1 = (0, tslib_1.__importDefault)(require("chalk"));
6
6
  const graphql_tag_1 = (0, tslib_1.__importDefault)(require("graphql-tag"));
7
7
  const EasCommand_1 = (0, tslib_1.__importDefault)(require("../../commandUtils/EasCommand"));
8
8
  const client_1 = require("../../graphql/client");
9
9
  const log_1 = (0, tslib_1.__importDefault)(require("../../log"));
10
10
  const prompts_1 = require("../../prompts");
11
+ const json_1 = require("../../utils/json");
11
12
  async function deleteUpdateGroupAsync({ group, }) {
12
13
  return await (0, client_1.withErrorHandlingAsync)(client_1.graphqlClient
13
14
  .mutation((0, graphql_tag_1.default) `
@@ -23,8 +24,11 @@ async function deleteUpdateGroupAsync({ group, }) {
23
24
  }
24
25
  class UpdateDelete extends EasCommand_1.default {
25
26
  async runAsync() {
26
- const { args: { groupId: group }, flags: { json: jsonFlag }, } = this.parse(UpdateDelete);
27
- if (!jsonFlag) {
27
+ const { args: { groupId: group }, flags: { json: jsonFlag }, } = await this.parse(UpdateDelete);
28
+ if (jsonFlag) {
29
+ (0, json_1.enableJsonOutput)();
30
+ }
31
+ else {
28
32
  const shouldAbort = await (0, prompts_1.confirmAsync)({
29
33
  message: `🚨${chalk_1.default.red('CAUTION')}🚨\n\n` +
30
34
  `${chalk_1.default.yellow(`This will delete all of the updates in group "${group}".`)} ${chalk_1.default.red('This is a permanent operation.')}\n\n` +
@@ -39,10 +43,11 @@ class UpdateDelete extends EasCommand_1.default {
39
43
  }
40
44
  await deleteUpdateGroupAsync({ group });
41
45
  if (jsonFlag) {
42
- log_1.default.log(JSON.stringify({ group }));
43
- return;
46
+ (0, json_1.printJsonOnlyOutput)({ group });
47
+ }
48
+ else {
49
+ log_1.default.withTick(`Deleted update group ${group}`);
44
50
  }
45
- log_1.default.withTick(`Deleted update group ${group}`);
46
51
  }
47
52
  }
48
53
  exports.default = UpdateDelete;
@@ -55,7 +60,7 @@ UpdateDelete.args = [
55
60
  },
56
61
  ];
57
62
  UpdateDelete.flags = {
58
- json: command_1.flags.boolean({
63
+ json: core_1.Flags.boolean({
59
64
  description: `Return a json with the group ID of the deleted updates.`,
60
65
  default: false,
61
66
  }),
@@ -1,19 +1,18 @@
1
- import { flags } from '@oclif/command';
2
1
  import EasCommand from '../../commandUtils/EasCommand';
3
2
  import { PublishPlatform } from '../../project/publish';
4
3
  export declare const defaultPublishPlatforms: PublishPlatform[];
5
4
  export default class UpdatePublish extends EasCommand {
6
5
  static description: string;
7
6
  static flags: {
8
- branch: flags.IOptionFlag<string | undefined>;
9
- message: flags.IOptionFlag<string | undefined>;
10
- republish: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
11
- group: flags.IOptionFlag<string | undefined>;
12
- 'input-dir': flags.IOptionFlag<string>;
13
- 'skip-bundler': import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
14
- platform: flags.IOptionFlag<string>;
15
- json: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
16
- auto: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
7
+ branch: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
8
+ message: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
9
+ republish: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
10
+ group: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
11
+ 'input-dir': import("@oclif/core/lib/interfaces").OptionFlag<string>;
12
+ 'skip-bundler': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
13
+ platform: import("@oclif/core/lib/interfaces").OptionFlag<string>;
14
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
15
+ auto: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
17
16
  };
18
17
  runAsync(): Promise<void>;
19
18
  }
@@ -5,7 +5,7 @@ const tslib_1 = require("tslib");
5
5
  const config_1 = require("@expo/config");
6
6
  const config_plugins_1 = require("@expo/config-plugins");
7
7
  const eas_build_job_1 = require("@expo/eas-build-job");
8
- const command_1 = require("@oclif/command");
8
+ const core_1 = require("@oclif/core");
9
9
  const assert_1 = (0, tslib_1.__importDefault)(require("assert"));
10
10
  const chalk_1 = (0, tslib_1.__importDefault)(require("chalk"));
11
11
  const dateformat_1 = (0, tslib_1.__importDefault)(require("dateformat"));
@@ -14,6 +14,7 @@ const api_1 = require("../../api");
14
14
  const EasCommand_1 = (0, tslib_1.__importDefault)(require("../../commandUtils/EasCommand"));
15
15
  const client_1 = require("../../graphql/client");
16
16
  const PublishMutation_1 = require("../../graphql/mutations/PublishMutation");
17
+ const UpdateQuery_1 = require("../../graphql/queries/UpdateQuery");
17
18
  const log_1 = (0, tslib_1.__importDefault)(require("../../log"));
18
19
  const ora_1 = require("../../ora");
19
20
  const projectUtils_1 = require("../../project/projectUtils");
@@ -23,10 +24,10 @@ const prompts_1 = require("../../prompts");
23
24
  const utils_1 = require("../../update/utils");
24
25
  const uniqBy_1 = (0, tslib_1.__importDefault)(require("../../utils/expodash/uniqBy"));
25
26
  const formatFields_1 = (0, tslib_1.__importDefault)(require("../../utils/formatFields"));
27
+ const json_1 = require("../../utils/json");
26
28
  const vcs_1 = require("../../vcs");
27
29
  const create_1 = require("../branch/create");
28
30
  const list_1 = require("../branch/list");
29
- const view_1 = require("../branch/view");
30
31
  const create_2 = require("../channel/create");
31
32
  exports.defaultPublishPlatforms = ['android', 'ios'];
32
33
  async function getUpdateGroupAsync({ group, }) {
@@ -67,7 +68,7 @@ async function ensureChannelExistsAsync({ appId, branchId, channelName, }) {
67
68
  }
68
69
  }
69
70
  async function ensureBranchExistsAsync({ appId, name: branchName, }) {
70
- const { app } = await (0, view_1.viewUpdateBranchAsync)({
71
+ const { app } = await UpdateQuery_1.UpdateQuery.viewBranchAsync({
71
72
  appId,
72
73
  name: branchName,
73
74
  });
@@ -85,8 +86,11 @@ async function ensureBranchExistsAsync({ appId, name: branchName, }) {
85
86
  class UpdatePublish extends EasCommand_1.default {
86
87
  async runAsync() {
87
88
  var _a, _b, _c;
88
- let { flags: { branch: branchName, json: jsonFlag, auto: autoFlag, message, republish, group, 'input-dir': inputDir, 'skip-bundler': skipBundler, }, } = this.parse(UpdatePublish);
89
- const platformFlag = this.parse(UpdatePublish).flags.platform;
89
+ let { flags: { branch: branchName, json: jsonFlag, auto: autoFlag, message, republish, group, 'input-dir': inputDir, 'skip-bundler': skipBundler, platform, }, } = await this.parse(UpdatePublish);
90
+ if (jsonFlag) {
91
+ (0, json_1.enableJsonOutput)();
92
+ }
93
+ const platformFlag = platform;
90
94
  // If a group was specified, that means we are republishing it.
91
95
  republish = group ? true : republish;
92
96
  const projectDir = await (0, projectUtils_1.findProjectRootAsync)();
@@ -222,9 +226,17 @@ class UpdatePublish extends EasCommand_1.default {
222
226
  }
223
227
  // build bundle and upload assets for a new publish
224
228
  if (!skipBundler) {
225
- await (0, publish_1.buildBundlesAsync)({ projectDir, inputDir });
229
+ const bundleSpinner = (0, ora_1.ora)().start('Building bundle...');
230
+ try {
231
+ await (0, publish_1.buildBundlesAsync)({ projectDir, inputDir });
232
+ bundleSpinner.succeed('Built bundle!');
233
+ }
234
+ catch (e) {
235
+ bundleSpinner.fail('Failed to build bundle!');
236
+ throw e;
237
+ }
226
238
  }
227
- const assetSpinner = (0, ora_1.ora)('Uploading assets...').start();
239
+ const assetSpinner = (0, ora_1.ora)().start('Uploading assets...');
228
240
  try {
229
241
  const platforms = platformFlag === 'all' ? exports.defaultPublishPlatforms : [platformFlag];
230
242
  const assets = await (0, publish_1.collectAssetsAsync)({ inputDir: inputDir, platforms });
@@ -270,7 +282,7 @@ class UpdatePublish extends EasCommand_1.default {
270
282
  throw e;
271
283
  }
272
284
  if (jsonFlag) {
273
- log_1.default.log(JSON.stringify(newUpdates));
285
+ (0, json_1.printJsonOnlyOutput)(newUpdates);
274
286
  }
275
287
  else {
276
288
  if (new Set(newUpdates.map(update => update.group)).size > 1) {
@@ -301,42 +313,42 @@ class UpdatePublish extends EasCommand_1.default {
301
313
  exports.default = UpdatePublish;
302
314
  UpdatePublish.description = 'Publish an update group.';
303
315
  UpdatePublish.flags = {
304
- branch: command_1.flags.string({
316
+ branch: core_1.Flags.string({
305
317
  description: 'Branch to publish the update group on',
306
318
  required: false,
307
319
  }),
308
- message: command_1.flags.string({
320
+ message: core_1.Flags.string({
309
321
  description: 'A short message describing the update',
310
322
  required: false,
311
323
  }),
312
- republish: command_1.flags.boolean({
324
+ republish: core_1.Flags.boolean({
313
325
  description: 'Republish an update group',
314
326
  exclusive: ['input-dir', 'skip-bundler'],
315
327
  }),
316
- group: command_1.flags.string({
328
+ group: core_1.Flags.string({
317
329
  description: 'Update group to republish',
318
330
  exclusive: ['input-dir', 'skip-bundler'],
319
331
  }),
320
- 'input-dir': command_1.flags.string({
332
+ 'input-dir': core_1.Flags.string({
321
333
  description: 'Location of the bundle',
322
334
  default: 'dist',
323
335
  required: false,
324
336
  }),
325
- 'skip-bundler': command_1.flags.boolean({
337
+ 'skip-bundler': core_1.Flags.boolean({
326
338
  description: `Skip running Expo CLI to bundle the app before publishing`,
327
339
  default: false,
328
340
  }),
329
- platform: command_1.flags.enum({
341
+ platform: core_1.Flags.enum({
330
342
  char: 'p',
331
343
  options: [...exports.defaultPublishPlatforms, 'all'],
332
344
  default: 'all',
333
345
  required: false,
334
346
  }),
335
- json: command_1.flags.boolean({
347
+ json: core_1.Flags.boolean({
336
348
  description: 'Enable JSON output, non-JSON messages will be printed to stderr',
337
349
  default: false,
338
350
  }),
339
- auto: command_1.flags.boolean({
351
+ auto: core_1.Flags.boolean({
340
352
  description: 'Use the current git branch and commit message for the EAS branch and update message',
341
353
  default: false,
342
354
  }),
@@ -0,0 +1,10 @@
1
+ import EasCommand from '../../commandUtils/EasCommand';
2
+ export default class BranchView extends EasCommand {
3
+ static description: string;
4
+ static flags: {
5
+ branch: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
6
+ all: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
7
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
8
+ };
9
+ runAsync(): Promise<void>;
10
+ }
@@ -0,0 +1,114 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const config_1 = require("@expo/config");
5
+ const core_1 = require("@oclif/core");
6
+ const assert_1 = (0, tslib_1.__importDefault)(require("assert"));
7
+ const chalk_1 = (0, tslib_1.__importDefault)(require("chalk"));
8
+ const cli_table3_1 = (0, tslib_1.__importDefault)(require("cli-table3"));
9
+ const EasCommand_1 = (0, tslib_1.__importDefault)(require("../../commandUtils/EasCommand"));
10
+ const UpdateQuery_1 = require("../../graphql/queries/UpdateQuery");
11
+ const log_1 = (0, tslib_1.__importDefault)(require("../../log"));
12
+ const projectUtils_1 = require("../../project/projectUtils");
13
+ const prompts_1 = require("../../prompts");
14
+ const utils_1 = require("../../update/utils");
15
+ const groupBy_1 = (0, tslib_1.__importDefault)(require("../../utils/expodash/groupBy"));
16
+ const json_1 = require("../../utils/json");
17
+ const vcs_1 = require("../../vcs");
18
+ class BranchView extends EasCommand_1.default {
19
+ async runAsync() {
20
+ var _a, _b;
21
+ const { flags: { branch: branchFlag, all, json: jsonFlag }, } = await this.parse(BranchView);
22
+ if (jsonFlag) {
23
+ (0, json_1.enableJsonOutput)();
24
+ }
25
+ const projectDir = await (0, projectUtils_1.findProjectRootAsync)();
26
+ const { exp } = (0, config_1.getConfig)(projectDir, { skipSDKVersionRequirement: true });
27
+ const projectId = await (0, projectUtils_1.getProjectIdAsync)(exp);
28
+ let updateGroupDescriptions;
29
+ if (all) {
30
+ const branchesAndUpdates = await UpdateQuery_1.UpdateQuery.viewAllAsync({ appId: projectId });
31
+ updateGroupDescriptions = getUpdateGroupDescriptions(branchesAndUpdates.app.byId.updateBranches);
32
+ }
33
+ else {
34
+ let branchInteractive;
35
+ if (!branchFlag) {
36
+ const validationMessage = 'Branch name may not be empty.';
37
+ if (jsonFlag) {
38
+ throw new Error(validationMessage);
39
+ }
40
+ ({ name: branchInteractive } = await (0, prompts_1.promptAsync)({
41
+ type: 'text',
42
+ name: 'name',
43
+ message: 'Please enter the name of the branch whose updates you wish to view:',
44
+ initial: (_a = (await (0, vcs_1.getVcsClient)().getBranchNameAsync())) !== null && _a !== void 0 ? _a : undefined,
45
+ validate: (value) => (value ? true : validationMessage),
46
+ }));
47
+ }
48
+ const branch = branchFlag !== null && branchFlag !== void 0 ? branchFlag : branchInteractive;
49
+ (0, assert_1.default)(branch, 'Branch name may not be empty.');
50
+ const branchesAndUpdates = await UpdateQuery_1.UpdateQuery.viewBranchAsync({
51
+ appId: projectId,
52
+ name: branch,
53
+ });
54
+ const UpdateBranch = (_b = branchesAndUpdates.app) === null || _b === void 0 ? void 0 : _b.byId.updateBranchByName;
55
+ if (!UpdateBranch) {
56
+ throw new Error(`Could not find branch "${branch}"`);
57
+ }
58
+ updateGroupDescriptions = getUpdateGroupDescriptions([UpdateBranch]);
59
+ }
60
+ if (jsonFlag) {
61
+ (0, json_1.printJsonOnlyOutput)(updateGroupDescriptions);
62
+ }
63
+ else {
64
+ logAsTable(updateGroupDescriptions);
65
+ }
66
+ }
67
+ }
68
+ exports.default = BranchView;
69
+ BranchView.description = 'View the recent updates for a branch';
70
+ BranchView.flags = {
71
+ branch: core_1.Flags.string({
72
+ description: 'List all updates on this branch',
73
+ exclusive: ['all'],
74
+ }),
75
+ all: core_1.Flags.boolean({
76
+ description: 'List all updates associated with this project',
77
+ exclusive: ['branch'],
78
+ default: false,
79
+ }),
80
+ json: core_1.Flags.boolean({
81
+ description: `Return a json with all of the recent update groups.`,
82
+ default: false,
83
+ }),
84
+ };
85
+ function getUpdateGroupDescriptions(branchesAndUpdates) {
86
+ const flattenedBranchesAndUpdates = branchesAndUpdates.flatMap(branch => branch.updates.map(update => {
87
+ return { branch: branch.name, ...update };
88
+ }));
89
+ const updateGroupDescriptions = Object.values((0, groupBy_1.default)(flattenedBranchesAndUpdates, update => update.group)).map(updateGroup => {
90
+ const platforms = updateGroup
91
+ .map(update => update.platform)
92
+ .sort()
93
+ .join(', ');
94
+ return { ...updateGroup[0], platforms };
95
+ });
96
+ updateGroupDescriptions.sort((a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime());
97
+ return updateGroupDescriptions;
98
+ }
99
+ function logAsTable(updateGroupDescriptions) {
100
+ const table = new cli_table3_1.default({
101
+ head: ['Branch', ...utils_1.UPDATE_COLUMNS],
102
+ wordWrap: true,
103
+ });
104
+ table.push(...updateGroupDescriptions.map(updateGroupDescription => [
105
+ updateGroupDescription.branch,
106
+ (0, utils_1.formatUpdate)(updateGroupDescription),
107
+ updateGroupDescription.runtimeVersion,
108
+ updateGroupDescription.group,
109
+ updateGroupDescription.platforms,
110
+ ]));
111
+ log_1.default.addNewLineIfNone();
112
+ log_1.default.log(chalk_1.default.bold('Recently published update groups:'));
113
+ log_1.default.log(table.toString());
114
+ }
@@ -11,7 +11,7 @@ export default class UpdateView extends EasCommand {
11
11
  description: string;
12
12
  }[];
13
13
  static flags: {
14
- json: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
14
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
15
15
  };
16
16
  runAsync(): Promise<void>;
17
17
  }
@@ -2,13 +2,14 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.viewUpdateAsync = void 0;
4
4
  const tslib_1 = require("tslib");
5
- const command_1 = require("@oclif/command");
5
+ const core_1 = require("@oclif/core");
6
6
  const cli_table3_1 = (0, tslib_1.__importDefault)(require("cli-table3"));
7
7
  const graphql_tag_1 = (0, tslib_1.__importDefault)(require("graphql-tag"));
8
8
  const EasCommand_1 = (0, tslib_1.__importDefault)(require("../../commandUtils/EasCommand"));
9
9
  const client_1 = require("../../graphql/client");
10
10
  const log_1 = (0, tslib_1.__importDefault)(require("../../log"));
11
11
  const utils_1 = require("../../update/utils");
12
+ const json_1 = require("../../utils/json");
12
13
  async function viewUpdateAsync({ groupId, }) {
13
14
  const data = await (0, client_1.withErrorHandlingAsync)(client_1.graphqlClient
14
15
  .query((0, graphql_tag_1.default) `
@@ -44,27 +45,31 @@ exports.viewUpdateAsync = viewUpdateAsync;
44
45
  class UpdateView extends EasCommand_1.default {
45
46
  async runAsync() {
46
47
  var _a;
47
- const { args: { groupId }, flags: { json: jsonFlag }, } = this.parse(UpdateView);
48
+ const { args: { groupId }, flags: { json: jsonFlag }, } = await this.parse(UpdateView);
49
+ if (jsonFlag) {
50
+ (0, json_1.enableJsonOutput)();
51
+ }
48
52
  const { updatesByGroup } = await viewUpdateAsync({ groupId });
49
53
  if (jsonFlag) {
50
- log_1.default.log(JSON.stringify(updatesByGroup));
51
- return;
54
+ (0, json_1.printJsonOnlyOutput)(updatesByGroup);
55
+ }
56
+ else {
57
+ const groupTable = new cli_table3_1.default({
58
+ head: [...utils_1.UPDATE_COLUMNS],
59
+ wordWrap: true,
60
+ });
61
+ const representativeUpdate = updatesByGroup[0];
62
+ groupTable.push([
63
+ (0, utils_1.formatUpdate)(representativeUpdate),
64
+ representativeUpdate.runtimeVersion,
65
+ representativeUpdate.group,
66
+ (0, utils_1.getPlatformsForGroup)({
67
+ updates: updatesByGroup,
68
+ group: (_a = updatesByGroup[0]) === null || _a === void 0 ? void 0 : _a.group,
69
+ }),
70
+ ]);
71
+ log_1.default.log(groupTable.toString());
52
72
  }
53
- const groupTable = new cli_table3_1.default({
54
- head: [...utils_1.UPDATE_COLUMNS],
55
- wordWrap: true,
56
- });
57
- const representativeUpdate = updatesByGroup[0];
58
- groupTable.push([
59
- (0, utils_1.formatUpdate)(representativeUpdate),
60
- representativeUpdate.runtimeVersion,
61
- representativeUpdate.group,
62
- (0, utils_1.getPlatformsForGroup)({
63
- updates: updatesByGroup,
64
- group: (_a = updatesByGroup[0]) === null || _a === void 0 ? void 0 : _a.group,
65
- }),
66
- ]);
67
- log_1.default.log(groupTable.toString());
68
73
  }
69
74
  }
70
75
  exports.default = UpdateView;
@@ -77,7 +82,7 @@ UpdateView.args = [
77
82
  },
78
83
  ];
79
84
  UpdateView.flags = {
80
- json: command_1.flags.boolean({
85
+ json: core_1.Flags.boolean({
81
86
  description: `Return a json with the updates belonging to the group.`,
82
87
  default: false,
83
88
  }),
@@ -1,12 +1,11 @@
1
- import { flags } from '@oclif/command';
2
1
  import EasCommand from '../../commandUtils/EasCommand';
3
2
  import { WebhookType } from '../../graphql/generated';
4
3
  export default class WebhookCreate extends EasCommand {
5
4
  static description: string;
6
5
  static flags: {
7
- event: flags.IOptionFlag<WebhookType>;
8
- url: flags.IOptionFlag<string | undefined>;
9
- secret: flags.IOptionFlag<string | undefined>;
6
+ event: import("@oclif/core/lib/interfaces").OptionFlag<WebhookType>;
7
+ url: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
8
+ secret: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
10
9
  };
11
10
  runAsync(): Promise<void>;
12
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 EasCommand_1 = (0, tslib_1.__importDefault)(require("../../commandUtils/EasCommand"));
7
7
  const generated_1 = require("../../graphql/generated");
8
8
  const WebhookMutation_1 = require("../../graphql/mutations/WebhookMutation");
@@ -11,7 +11,7 @@ const projectUtils_1 = require("../../project/projectUtils");
11
11
  const input_1 = require("../../webhooks/input");
12
12
  class WebhookCreate extends EasCommand_1.default {
13
13
  async runAsync() {
14
- const { flags } = this.parse(WebhookCreate);
14
+ const { flags } = await this.parse(WebhookCreate);
15
15
  const webhookInputParams = await (0, input_1.prepareInputParamsAsync)(flags);
16
16
  const projectDir = await (0, projectUtils_1.findProjectRootAsync)();
17
17
  const { exp } = (0, config_1.getConfig)(projectDir, { skipSDKVersionRequirement: true });
@@ -30,14 +30,14 @@ class WebhookCreate extends EasCommand_1.default {
30
30
  exports.default = WebhookCreate;
31
31
  WebhookCreate.description = 'Create a webhook on the current project.';
32
32
  WebhookCreate.flags = {
33
- event: command_1.flags.enum({
33
+ event: core_1.Flags.enum({
34
34
  description: 'Event type that triggers the webhook',
35
35
  options: [generated_1.WebhookType.Build, generated_1.WebhookType.Submit],
36
36
  }),
37
- url: command_1.flags.string({
37
+ url: core_1.Flags.string({
38
38
  description: 'Webhook URL',
39
39
  }),
40
- secret: command_1.flags.string({
40
+ secret: core_1.Flags.string({
41
41
  description: "Secret used to create a hash signature of the request payload, provided in the 'Expo-Signature' header.",
42
42
  }),
43
43
  };
@@ -15,7 +15,7 @@ const prompts_1 = require("../../prompts");
15
15
  const formatWebhook_1 = require("../../webhooks/formatWebhook");
16
16
  class WebhookDelete extends EasCommand_1.default {
17
17
  async runAsync() {
18
- let { args: { ID: webhookId }, } = this.parse(WebhookDelete);
18
+ let { args: { ID: webhookId }, } = await this.parse(WebhookDelete);
19
19
  const projectDir = await (0, projectUtils_1.findProjectRootAsync)();
20
20
  const { exp } = (0, config_1.getConfig)(projectDir, { skipSDKVersionRequirement: true });
21
21
  const projectId = await (0, projectUtils_1.getProjectIdAsync)(exp);
@@ -1,10 +1,9 @@
1
- import { flags } from '@oclif/command';
2
1
  import EasCommand from '../../commandUtils/EasCommand';
3
2
  import { WebhookType } from '../../graphql/generated';
4
3
  export default class WebhookList extends EasCommand {
5
4
  static description: string;
6
5
  static flags: {
7
- event: flags.IOptionFlag<WebhookType>;
6
+ event: import("@oclif/core/lib/interfaces").OptionFlag<WebhookType>;
8
7
  };
9
8
  runAsync(): Promise<void>;
10
9
  }