eas-cli 0.41.0 → 0.43.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 (92) hide show
  1. package/README.md +23 -465
  2. package/bin/dev +17 -0
  3. package/bin/dev.cmd +3 -0
  4. package/bin/run +3 -3
  5. package/build/api.d.ts +1 -0
  6. package/build/api.js +13 -1
  7. package/build/build/configure.js +3 -3
  8. package/build/build/local.js +1 -1
  9. package/build/build/utils/devClient.js +3 -3
  10. package/build/commandUtils/EasCommand.d.ts +2 -1
  11. package/build/commandUtils/EasCommand.js +7 -4
  12. package/build/commands/account/login.d.ts +1 -0
  13. package/build/commands/account/login.js +1 -0
  14. package/build/commands/account/logout.d.ts +1 -0
  15. package/build/commands/account/logout.js +1 -0
  16. package/build/commands/account/view.d.ts +1 -0
  17. package/build/commands/account/view.js +1 -0
  18. package/build/commands/analytics.js +1 -1
  19. package/build/commands/branch/create.d.ts +1 -2
  20. package/build/commands/branch/create.js +11 -7
  21. package/build/commands/branch/delete.d.ts +1 -2
  22. package/build/commands/branch/delete.js +12 -7
  23. package/build/commands/branch/list.d.ts +1 -2
  24. package/build/commands/branch/list.js +8 -5
  25. package/build/commands/branch/rename.d.ts +3 -5
  26. package/build/commands/branch/rename.js +13 -9
  27. package/build/commands/branch/view.d.ts +1 -2
  28. package/build/commands/branch/view.js +33 -29
  29. package/build/commands/build/cancel.js +1 -1
  30. package/build/commands/build/configure.d.ts +1 -2
  31. package/build/commands/build/configure.js +3 -3
  32. package/build/commands/build/index.d.ts +11 -12
  33. package/build/commands/build/index.js +20 -19
  34. package/build/commands/build/inspect.d.ts +7 -7
  35. package/build/commands/build/inspect.js +31 -24
  36. package/build/commands/build/list.d.ts +13 -14
  37. package/build/commands/build/list.js +15 -15
  38. package/build/commands/build/view.d.ts +1 -1
  39. package/build/commands/build/view.js +3 -3
  40. package/build/commands/channel/create.d.ts +1 -2
  41. package/build/commands/channel/create.js +24 -20
  42. package/build/commands/channel/delete.d.ts +15 -0
  43. package/build/commands/channel/delete.js +124 -0
  44. package/build/commands/channel/edit.d.ts +2 -4
  45. package/build/commands/channel/edit.js +14 -10
  46. package/build/commands/channel/list.d.ts +1 -2
  47. package/build/commands/channel/list.js +17 -13
  48. package/build/commands/channel/rollout.d.ts +4 -5
  49. package/build/commands/channel/rollout.js +14 -10
  50. package/build/commands/channel/view.d.ts +1 -2
  51. package/build/commands/channel/view.js +19 -15
  52. package/build/commands/config.d.ts +2 -3
  53. package/build/commands/config.js +4 -4
  54. package/build/commands/device/list.d.ts +1 -2
  55. package/build/commands/device/list.js +3 -3
  56. package/build/commands/device/view.js +1 -1
  57. package/build/commands/diagnostics.js +1 -0
  58. package/build/commands/secret/create.d.ts +4 -5
  59. package/build/commands/secret/create.js +6 -6
  60. package/build/commands/secret/delete.d.ts +1 -2
  61. package/build/commands/secret/delete.js +3 -3
  62. package/build/commands/submit.d.ts +9 -10
  63. package/build/commands/submit.js +13 -14
  64. package/build/commands/update/configure.d.ts +0 -3
  65. package/build/commands/update/configure.js +4 -10
  66. package/build/commands/update/delete.d.ts +1 -2
  67. package/build/commands/update/delete.js +12 -8
  68. package/build/commands/update/index.d.ts +9 -11
  69. package/build/commands/update/index.js +30 -18
  70. package/build/commands/update/view.d.ts +1 -2
  71. package/build/commands/update/view.js +25 -21
  72. package/build/commands/webhook/create.d.ts +3 -4
  73. package/build/commands/webhook/create.js +5 -5
  74. package/build/commands/webhook/delete.js +1 -1
  75. package/build/commands/webhook/list.d.ts +1 -2
  76. package/build/commands/webhook/list.js +3 -3
  77. package/build/commands/webhook/update.d.ts +4 -5
  78. package/build/commands/webhook/update.js +6 -6
  79. package/build/commands/webhook/view.js +1 -1
  80. package/build/graphql/generated.d.ts +33 -0
  81. package/build/index.d.ts +1 -1
  82. package/build/index.js +2 -2
  83. package/build/project/expoSdk.js +2 -2
  84. package/build/project/metroConfig.js +2 -2
  85. package/build/project/publish.js +1 -3
  86. package/build/submit/ios/IosSubmitCommand.js +6 -1
  87. package/build/user/actions.js +2 -2
  88. package/build/utils/expoCli.d.ts +3 -1
  89. package/build/utils/expoCli.js +13 -11
  90. package/build/vcs/clients/git.js +2 -2
  91. package/oclif.manifest.json +1 -1
  92. package/package.json +20 -13
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  const eas_json_1 = require("@expo/eas-json");
5
- const command_1 = require("@oclif/command");
5
+ const core_1 = require("@oclif/core");
6
6
  const semver_1 = (0, tslib_1.__importDefault)(require("semver"));
7
7
  const rudderstackClient_1 = require("../analytics/rudderstackClient");
8
8
  const projectUtils_1 = require("../project/projectUtils");
@@ -11,7 +11,7 @@ const actions_1 = require("../user/actions");
11
11
  const easCli_1 = require("../utils/easCli");
12
12
  const vcs_1 = require("../vcs");
13
13
  const git_1 = (0, tslib_1.__importDefault)(require("../vcs/clients/git"));
14
- class EasCommand extends command_1.Command {
14
+ class EasCommand extends core_1.Command {
15
15
  constructor() {
16
16
  super(...arguments);
17
17
  /**
@@ -19,14 +19,17 @@ class EasCommand extends command_1.Command {
19
19
  * force the user to log in
20
20
  */
21
21
  this.requiresAuthentication = true;
22
+ this.mustBeRunInsideProject = true;
22
23
  }
23
24
  // eslint-disable-next-line async-protect/async-suffix
24
25
  async run() {
25
26
  var _a;
26
27
  await (0, rudderstackClient_1.initAsync)();
27
- await this.applyCliConfigAsync();
28
+ if (this.mustBeRunInsideProject) {
29
+ await this.applyCliConfigAsync();
30
+ }
28
31
  if (this.requiresAuthentication) {
29
- const { flags } = this.parse();
32
+ const { flags } = await this.parse();
30
33
  const nonInteractive = (_a = flags['non-interactive']) !== null && _a !== void 0 ? _a : false;
31
34
  await (0, actions_1.ensureLoggedInAsync)({ nonInteractive });
32
35
  }
@@ -2,6 +2,7 @@ import EasCommand from '../../commandUtils/EasCommand';
2
2
  export default class AccountLogin extends EasCommand {
3
3
  static description: string;
4
4
  static aliases: string[];
5
+ protected mustBeRunInsideProject: boolean;
5
6
  protected requiresAuthentication: boolean;
6
7
  runAsync(): Promise<void>;
7
8
  }
@@ -7,6 +7,7 @@ const actions_1 = require("../../user/actions");
7
7
  class AccountLogin extends EasCommand_1.default {
8
8
  constructor() {
9
9
  super(...arguments);
10
+ this.mustBeRunInsideProject = false;
10
11
  this.requiresAuthentication = false;
11
12
  }
12
13
  async runAsync() {
@@ -2,6 +2,7 @@ import EasCommand from '../../commandUtils/EasCommand';
2
2
  export default class AccountLogout extends EasCommand {
3
3
  static description: string;
4
4
  static aliases: string[];
5
+ protected mustBeRunInsideProject: boolean;
5
6
  protected requiresAuthentication: boolean;
6
7
  runAsync(): Promise<void>;
7
8
  }
@@ -7,6 +7,7 @@ const User_1 = require("../../user/User");
7
7
  class AccountLogout extends EasCommand_1.default {
8
8
  constructor() {
9
9
  super(...arguments);
10
+ this.mustBeRunInsideProject = false;
10
11
  this.requiresAuthentication = false;
11
12
  }
12
13
  async runAsync() {
@@ -2,6 +2,7 @@ import EasCommand from '../../commandUtils/EasCommand';
2
2
  export default class AccountView extends EasCommand {
3
3
  static description: string;
4
4
  static aliases: string[];
5
+ protected mustBeRunInsideProject: boolean;
5
6
  protected requiresAuthentication: boolean;
6
7
  runAsync(): Promise<void>;
7
8
  }
@@ -8,6 +8,7 @@ const User_1 = require("../../user/User");
8
8
  class AccountView extends EasCommand_1.default {
9
9
  constructor() {
10
10
  super(...arguments);
11
+ this.mustBeRunInsideProject = false;
11
12
  this.requiresAuthentication = false;
12
13
  }
13
14
  async runAsync() {
@@ -10,7 +10,7 @@ class AnalyticsView extends EasCommand_1.default {
10
10
  this.requiresAuthentication = false;
11
11
  }
12
12
  async runAsync() {
13
- const { STATUS: status } = this.parse(AnalyticsView).args;
13
+ const { STATUS: status } = (await this.parse(AnalyticsView)).args;
14
14
  if (status) {
15
15
  await UserSettings_1.default.setAsync('analyticsEnabled', status === 'on');
16
16
  log_1.default.withTick(`${status === 'on' ? 'Enabling' : 'Disabling'} analytics.`);
@@ -2,7 +2,6 @@ import EasCommand from '../../commandUtils/EasCommand';
2
2
  import { CreateUpdateBranchForAppMutationVariables, UpdateBranch } from '../../graphql/generated';
3
3
  export declare function createUpdateBranchOnAppAsync({ appId, name, }: CreateUpdateBranchForAppMutationVariables): Promise<Pick<UpdateBranch, 'id' | 'name'>>;
4
4
  export default class BranchCreate extends EasCommand {
5
- static hidden: boolean;
6
5
  static description: string;
7
6
  static args: {
8
7
  name: string;
@@ -10,7 +9,7 @@ export default class BranchCreate extends EasCommand {
10
9
  description: string;
11
10
  }[];
12
11
  static flags: {
13
- json: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
12
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
14
13
  };
15
14
  runAsync(): Promise<void>;
16
15
  }
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createUpdateBranchOnAppAsync = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const config_1 = require("@expo/config");
6
- const command_1 = require("@oclif/command");
6
+ const core_1 = require("@oclif/core");
7
7
  const chalk_1 = (0, tslib_1.__importDefault)(require("chalk"));
8
8
  const graphql_tag_1 = (0, tslib_1.__importDefault)(require("graphql-tag"));
9
9
  const EasCommand_1 = (0, tslib_1.__importDefault)(require("../../commandUtils/EasCommand"));
@@ -11,6 +11,7 @@ const client_1 = require("../../graphql/client");
11
11
  const log_1 = (0, tslib_1.__importDefault)(require("../../log"));
12
12
  const projectUtils_1 = require("../../project/projectUtils");
13
13
  const prompts_1 = require("../../prompts");
14
+ const json_1 = require("../../utils/json");
14
15
  const vcs_1 = require("../../vcs");
15
16
  async function createUpdateBranchOnAppAsync({ appId, name, }) {
16
17
  const result = await (0, client_1.withErrorHandlingAsync)(client_1.graphqlClient
@@ -37,7 +38,10 @@ async function createUpdateBranchOnAppAsync({ appId, name, }) {
37
38
  exports.createUpdateBranchOnAppAsync = createUpdateBranchOnAppAsync;
38
39
  class BranchCreate extends EasCommand_1.default {
39
40
  async runAsync() {
40
- let { args: { name }, flags, } = this.parse(BranchCreate);
41
+ let { args: { name }, flags, } = await this.parse(BranchCreate);
42
+ if (flags.json) {
43
+ (0, json_1.enableJsonOutput)();
44
+ }
41
45
  const projectDir = await (0, projectUtils_1.findProjectRootAsync)();
42
46
  const { exp } = (0, config_1.getConfig)(projectDir, { skipSDKVersionRequirement: true });
43
47
  const fullName = await (0, projectUtils_1.getProjectFullNameAsync)(exp);
@@ -58,14 +62,14 @@ class BranchCreate extends EasCommand_1.default {
58
62
  }
59
63
  const newBranch = await createUpdateBranchOnAppAsync({ appId: projectId, name });
60
64
  if (flags.json) {
61
- log_1.default.log(newBranch);
62
- return;
65
+ (0, json_1.printJsonOnlyOutput)(newBranch);
66
+ }
67
+ else {
68
+ log_1.default.withTick(`️Created a new branch: ${chalk_1.default.bold(newBranch.name)} on project ${chalk_1.default.bold(fullName)}.`);
63
69
  }
64
- log_1.default.withTick(`️Created a new branch: ${chalk_1.default.bold(newBranch.name)} on project ${chalk_1.default.bold(fullName)}.`);
65
70
  }
66
71
  }
67
72
  exports.default = BranchCreate;
68
- BranchCreate.hidden = true;
69
73
  BranchCreate.description = 'Create a branch on the current project.';
70
74
  BranchCreate.args = [
71
75
  {
@@ -75,7 +79,7 @@ BranchCreate.args = [
75
79
  },
76
80
  ];
77
81
  BranchCreate.flags = {
78
- json: command_1.flags.boolean({
82
+ json: core_1.Flags.boolean({
79
83
  description: 'return a json with the new branch ID and name.',
80
84
  default: false,
81
85
  }),
@@ -1,6 +1,5 @@
1
1
  import EasCommand from '../../commandUtils/EasCommand';
2
2
  export default class BranchDelete extends EasCommand {
3
- static hidden: boolean;
4
3
  static description: string;
5
4
  static args: {
6
5
  name: string;
@@ -8,7 +7,7 @@ export default class BranchDelete extends EasCommand {
8
7
  description: string;
9
8
  }[];
10
9
  static flags: {
11
- json: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
10
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
12
11
  };
13
12
  runAsync(): Promise<void>;
14
13
  }
@@ -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 graphql_tag_1 = (0, tslib_1.__importDefault)(require("graphql-tag"));
8
8
  const EasCommand_1 = (0, tslib_1.__importDefault)(require("../../commandUtils/EasCommand"));
@@ -10,6 +10,7 @@ const client_1 = require("../../graphql/client");
10
10
  const log_1 = (0, tslib_1.__importDefault)(require("../../log"));
11
11
  const projectUtils_1 = require("../../project/projectUtils");
12
12
  const prompts_1 = require("../../prompts");
13
+ const json_1 = require("../../utils/json");
13
14
  async function getBranchInfoAsync({ appId, name, }) {
14
15
  const data = await (0, client_1.withErrorHandlingAsync)(client_1.graphqlClient
15
16
  .query((0, graphql_tag_1.default) `
@@ -50,7 +51,10 @@ async function deleteBranchOnAppAsync({ branchId, }) {
50
51
  class BranchDelete extends EasCommand_1.default {
51
52
  async runAsync() {
52
53
  var _a, _b;
53
- let { args: { name }, flags: { json: jsonFlag }, } = this.parse(BranchDelete);
54
+ let { args: { name }, flags: { json: jsonFlag }, } = await this.parse(BranchDelete);
55
+ if (jsonFlag) {
56
+ (0, json_1.enableJsonOutput)();
57
+ }
54
58
  const projectDir = await (0, projectUtils_1.findProjectRootAsync)();
55
59
  const { exp } = (0, config_1.getConfig)(projectDir, { skipSDKVersionRequirement: true });
56
60
  const fullName = await (0, projectUtils_1.getProjectFullNameAsync)(exp);
@@ -87,14 +91,15 @@ class BranchDelete extends EasCommand_1.default {
87
91
  branchId,
88
92
  });
89
93
  if (jsonFlag) {
90
- log_1.default.log(JSON.stringify(deletionResult));
94
+ (0, json_1.printJsonOnlyOutput)(deletionResult);
95
+ }
96
+ else {
97
+ log_1.default.withTick(`️Deleted branch "${name}" and all of its updates on project ${chalk_1.default.bold(fullName)}.`);
91
98
  }
92
- log_1.default.withTick(`️Deleted branch "${name}" and all of its updates on project ${chalk_1.default.bold(fullName)}.`);
93
99
  }
94
100
  }
95
101
  exports.default = BranchDelete;
96
- BranchDelete.hidden = true;
97
- BranchDelete.description = 'Republish an update group';
102
+ BranchDelete.description = 'Delete a branch on the current project';
98
103
  BranchDelete.args = [
99
104
  {
100
105
  name: 'name',
@@ -103,7 +108,7 @@ BranchDelete.args = [
103
108
  },
104
109
  ];
105
110
  BranchDelete.flags = {
106
- json: command_1.flags.boolean({
111
+ json: core_1.Flags.boolean({
107
112
  description: `return JSON with the edited branch's ID and name.`,
108
113
  default: false,
109
114
  }),
@@ -4,10 +4,9 @@ export declare function listBranchesAsync({ projectId, }: {
4
4
  projectId: string;
5
5
  }): Promise<UpdateBranchFragment[]>;
6
6
  export default class BranchList extends EasCommand {
7
- static hidden: boolean;
8
7
  static description: string;
9
8
  static flags: {
10
- json: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
9
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
11
10
  };
12
11
  runAsync(): Promise<void>;
13
12
  }
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.listBranchesAsync = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const config_1 = require("@expo/config");
6
- const command_1 = require("@oclif/command");
6
+ const core_1 = require("@oclif/core");
7
7
  const chalk_1 = (0, tslib_1.__importDefault)(require("chalk"));
8
8
  const cli_table3_1 = (0, tslib_1.__importDefault)(require("cli-table3"));
9
9
  const graphql_1 = require("graphql");
@@ -14,6 +14,7 @@ const UpdateBranch_1 = require("../../graphql/types/UpdateBranch");
14
14
  const log_1 = (0, tslib_1.__importDefault)(require("../../log"));
15
15
  const projectUtils_1 = require("../../project/projectUtils");
16
16
  const utils_1 = require("../../update/utils");
17
+ const json_1 = require("../../utils/json");
17
18
  const BRANCHES_LIMIT = 10000;
18
19
  async function listBranchesAsync({ projectId, }) {
19
20
  var _a, _b;
@@ -41,13 +42,16 @@ async function listBranchesAsync({ projectId, }) {
41
42
  exports.listBranchesAsync = listBranchesAsync;
42
43
  class BranchList extends EasCommand_1.default {
43
44
  async runAsync() {
44
- const { flags } = this.parse(BranchList);
45
+ const { flags } = await this.parse(BranchList);
46
+ if (flags.json) {
47
+ (0, json_1.enableJsonOutput)();
48
+ }
45
49
  const projectDir = await (0, projectUtils_1.findProjectRootAsync)();
46
50
  const { exp } = (0, config_1.getConfig)(projectDir, { skipSDKVersionRequirement: true });
47
51
  const projectId = await (0, projectUtils_1.getProjectIdAsync)(exp);
48
52
  const branches = await listBranchesAsync({ projectId });
49
53
  if (flags.json) {
50
- log_1.default.log(JSON.stringify(branches, null, 2));
54
+ (0, json_1.printJsonOnlyOutput)(branches);
51
55
  }
52
56
  else {
53
57
  const table = new cli_table3_1.default({
@@ -77,10 +81,9 @@ class BranchList extends EasCommand_1.default {
77
81
  }
78
82
  }
79
83
  exports.default = BranchList;
80
- BranchList.hidden = true;
81
84
  BranchList.description = 'List all branches on this project.';
82
85
  BranchList.flags = {
83
- json: command_1.flags.boolean({
86
+ json: core_1.Flags.boolean({
84
87
  description: 'return output as JSON',
85
88
  default: false,
86
89
  }),
@@ -1,12 +1,10 @@
1
- import { flags } from '@oclif/command';
2
1
  import EasCommand from '../../commandUtils/EasCommand';
3
2
  export default class BranchRename extends EasCommand {
4
- static hidden: boolean;
5
3
  static description: string;
6
4
  static flags: {
7
- from: flags.IOptionFlag<string | undefined>;
8
- to: flags.IOptionFlag<string | undefined>;
9
- json: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
5
+ from: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
6
+ to: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
7
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
10
8
  };
11
9
  runAsync(): Promise<void>;
12
10
  }
@@ -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 graphql_tag_1 = (0, tslib_1.__importDefault)(require("graphql-tag"));
8
8
  const EasCommand_1 = (0, tslib_1.__importDefault)(require("../../commandUtils/EasCommand"));
@@ -10,6 +10,7 @@ const client_1 = require("../../graphql/client");
10
10
  const log_1 = (0, tslib_1.__importDefault)(require("../../log"));
11
11
  const projectUtils_1 = require("../../project/projectUtils");
12
12
  const prompts_1 = require("../../prompts");
13
+ const json_1 = require("../../utils/json");
13
14
  async function renameUpdateBranchOnAppAsync({ appId, name, newName, }) {
14
15
  const data = await (0, client_1.withErrorHandlingAsync)(client_1.graphqlClient
15
16
  .mutation((0, graphql_tag_1.default) `
@@ -33,7 +34,10 @@ async function renameUpdateBranchOnAppAsync({ appId, name, newName, }) {
33
34
  }
34
35
  class BranchRename extends EasCommand_1.default {
35
36
  async runAsync() {
36
- let { flags: { json: jsonFlag, from: currentName, to: newName }, } = this.parse(BranchRename);
37
+ let { flags: { json: jsonFlag, from: currentName, to: newName }, } = await this.parse(BranchRename);
38
+ if (jsonFlag) {
39
+ (0, json_1.enableJsonOutput)();
40
+ }
37
41
  const projectDir = await (0, projectUtils_1.findProjectRootAsync)();
38
42
  const { exp } = (0, config_1.getConfig)(projectDir, { skipSDKVersionRequirement: true });
39
43
  const fullName = await (0, projectUtils_1.getProjectFullNameAsync)(exp);
@@ -68,25 +72,25 @@ class BranchRename extends EasCommand_1.default {
68
72
  newName: newName,
69
73
  });
70
74
  if (jsonFlag) {
71
- log_1.default.log(JSON.stringify(editedBranch));
72
- return;
75
+ (0, json_1.printJsonOnlyOutput)(editedBranch);
76
+ }
77
+ else {
78
+ log_1.default.withTick(`️Renamed branch from ${currentName} to ${chalk_1.default.bold(editedBranch.name)} on project ${chalk_1.default.bold(fullName)}.`);
73
79
  }
74
- log_1.default.withTick(`️Renamed branch from ${currentName} to ${chalk_1.default.bold(editedBranch.name)} on project ${chalk_1.default.bold(fullName)}.`);
75
80
  }
76
81
  }
77
82
  exports.default = BranchRename;
78
- BranchRename.hidden = true;
79
83
  BranchRename.description = 'Rename a branch.';
80
84
  BranchRename.flags = {
81
- from: command_1.flags.string({
85
+ from: core_1.Flags.string({
82
86
  description: 'current name of the branch.',
83
87
  required: false,
84
88
  }),
85
- to: command_1.flags.string({
89
+ to: core_1.Flags.string({
86
90
  description: 'new name of the branch.',
87
91
  required: false,
88
92
  }),
89
- json: command_1.flags.boolean({
93
+ json: core_1.Flags.boolean({
90
94
  description: `return a json with the edited branch's ID and name.`,
91
95
  default: false,
92
96
  }),
@@ -2,7 +2,6 @@ import EasCommand from '../../commandUtils/EasCommand';
2
2
  import { ViewBranchQuery, ViewBranchQueryVariables } from '../../graphql/generated';
3
3
  export declare function viewUpdateBranchAsync({ appId, name, }: Pick<ViewBranchQueryVariables, 'appId' | 'name'>): Promise<ViewBranchQuery>;
4
4
  export default class BranchView extends EasCommand {
5
- static hidden: boolean;
6
5
  static description: string;
7
6
  static args: {
8
7
  name: string;
@@ -10,7 +9,7 @@ export default class BranchView extends EasCommand {
10
9
  description: string;
11
10
  }[];
12
11
  static flags: {
13
- json: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
12
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
14
13
  };
15
14
  runAsync(): Promise<void>;
16
15
  }
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.viewUpdateBranchAsync = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const config_1 = require("@expo/config");
6
- const command_1 = require("@oclif/command");
6
+ const core_1 = require("@oclif/core");
7
7
  const chalk_1 = (0, tslib_1.__importDefault)(require("chalk"));
8
8
  const cli_table3_1 = (0, tslib_1.__importDefault)(require("cli-table3"));
9
9
  const graphql_tag_1 = (0, tslib_1.__importDefault)(require("graphql-tag"));
@@ -15,6 +15,7 @@ const prompts_1 = require("../../prompts");
15
15
  const utils_1 = require("../../update/utils");
16
16
  const groupBy_1 = (0, tslib_1.__importDefault)(require("../../utils/expodash/groupBy"));
17
17
  const formatFields_1 = (0, tslib_1.__importDefault)(require("../../utils/formatFields"));
18
+ const json_1 = require("../../utils/json");
18
19
  const PAGE_LIMIT = 10000;
19
20
  async function viewUpdateBranchAsync({ appId, name, }) {
20
21
  const data = await (0, client_1.withErrorHandlingAsync)(client_1.graphqlClient
@@ -59,7 +60,10 @@ async function viewUpdateBranchAsync({ appId, name, }) {
59
60
  exports.viewUpdateBranchAsync = viewUpdateBranchAsync;
60
61
  class BranchView extends EasCommand_1.default {
61
62
  async runAsync() {
62
- let { args: { name }, flags: { json: jsonFlag }, } = this.parse(BranchView);
63
+ let { args: { name }, flags: { json: jsonFlag }, } = await this.parse(BranchView);
64
+ if (jsonFlag) {
65
+ (0, json_1.enableJsonOutput)();
66
+ }
63
67
  const projectDir = await (0, projectUtils_1.findProjectRootAsync)();
64
68
  const { exp } = (0, config_1.getConfig)(projectDir, { skipSDKVersionRequirement: true });
65
69
  const projectId = await (0, projectUtils_1.getProjectIdAsync)(exp);
@@ -85,37 +89,37 @@ class BranchView extends EasCommand_1.default {
85
89
  }
86
90
  const updates = Object.values((0, groupBy_1.default)(UpdateBranch.updates, u => u.group)).map(group => group[0]);
87
91
  if (jsonFlag) {
88
- log_1.default.log(JSON.stringify({ ...UpdateBranch, updates }));
89
- return;
92
+ (0, json_1.printJsonOnlyOutput)({ ...UpdateBranch, updates });
90
93
  }
91
- const groupTable = new cli_table3_1.default({
92
- head: utils_1.UPDATE_COLUMNS,
93
- wordWrap: true,
94
- });
95
- for (const update of updates) {
96
- groupTable.push([
97
- (0, utils_1.formatUpdate)(update),
98
- update.runtimeVersion,
99
- update.group,
100
- (0, utils_1.getPlatformsForGroup)({
101
- updates: UpdateBranch.updates,
102
- group: update.group,
103
- }),
104
- ]);
94
+ else {
95
+ const groupTable = new cli_table3_1.default({
96
+ head: utils_1.UPDATE_COLUMNS,
97
+ wordWrap: true,
98
+ });
99
+ for (const update of updates) {
100
+ groupTable.push([
101
+ (0, utils_1.formatUpdate)(update),
102
+ update.runtimeVersion,
103
+ update.group,
104
+ (0, utils_1.getPlatformsForGroup)({
105
+ updates: UpdateBranch.updates,
106
+ group: update.group,
107
+ }),
108
+ ]);
109
+ }
110
+ log_1.default.addNewLineIfNone();
111
+ log_1.default.log(chalk_1.default.bold('Branch:'));
112
+ log_1.default.log((0, formatFields_1.default)([
113
+ { label: 'Name', value: UpdateBranch.name },
114
+ { label: 'ID', value: UpdateBranch.id },
115
+ ]));
116
+ log_1.default.addNewLineIfNone();
117
+ log_1.default.log(chalk_1.default.bold('Recently published update groups:'));
118
+ log_1.default.log(groupTable.toString());
105
119
  }
106
- log_1.default.addNewLineIfNone();
107
- log_1.default.log(chalk_1.default.bold('Branch:'));
108
- log_1.default.log((0, formatFields_1.default)([
109
- { label: 'Name', value: UpdateBranch.name },
110
- { label: 'ID', value: UpdateBranch.id },
111
- ]));
112
- log_1.default.addNewLineIfNone();
113
- log_1.default.log(chalk_1.default.bold('Recently published update groups:'));
114
- log_1.default.log(groupTable.toString());
115
120
  }
116
121
  }
117
122
  exports.default = BranchView;
118
- BranchView.hidden = true;
119
123
  BranchView.description = 'View a branch.';
120
124
  BranchView.args = [
121
125
  {
@@ -125,7 +129,7 @@ BranchView.args = [
125
129
  },
126
130
  ];
127
131
  BranchView.flags = {
128
- json: command_1.flags.boolean({
132
+ json: core_1.Flags.boolean({
129
133
  description: `return a json with the branch's ID name and recent update groups.`,
130
134
  default: false,
131
135
  }),
@@ -90,7 +90,7 @@ async function ensureBuildExistsAsync(buildId) {
90
90
  }
91
91
  class BuildCancel extends EasCommand_1.default {
92
92
  async runAsync() {
93
- const { BUILD_ID: buildIdFromArg } = this.parse(BuildCancel).args;
93
+ const { BUILD_ID: buildIdFromArg } = (await this.parse(BuildCancel)).args;
94
94
  const projectDir = await (0, projectUtils_1.findProjectRootAsync)();
95
95
  const { exp } = (0, config_1.getConfig)(projectDir, { skipSDKVersionRequirement: true });
96
96
  const projectId = await (0, projectUtils_1.getProjectIdAsync)(exp);
@@ -1,9 +1,8 @@
1
- import { flags } from '@oclif/command';
2
1
  import EasCommand from '../../commandUtils/EasCommand';
3
2
  export default class BuildConfigure extends EasCommand {
4
3
  static description: string;
5
4
  static flags: {
6
- platform: flags.IOptionFlag<string>;
5
+ platform: import("@oclif/core/lib/interfaces").OptionFlag<string>;
7
6
  };
8
7
  runAsync(): Promise<void>;
9
8
  }
@@ -1,7 +1,7 @@
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 configure_1 = require("../../build/configure");
7
7
  const EasCommand_1 = (0, tslib_1.__importDefault)(require("../../commandUtils/EasCommand"));
@@ -13,7 +13,7 @@ const vcs_1 = require("../../vcs");
13
13
  class BuildConfigure extends EasCommand_1.default {
14
14
  async runAsync() {
15
15
  var _a;
16
- const { flags } = this.parse(BuildConfigure);
16
+ const { flags } = await this.parse(BuildConfigure);
17
17
  log_1.default.log('💡 The following process will configure your iOS and/or Android project to be compatible with EAS Build. These changes only apply to your local project files and you can safely revert them at any time.');
18
18
  log_1.default.newLine();
19
19
  await (0, vcs_1.getVcsClient)().ensureRepoExistsAsync();
@@ -29,7 +29,7 @@ class BuildConfigure extends EasCommand_1.default {
29
29
  exports.default = BuildConfigure;
30
30
  BuildConfigure.description = 'Configure the project to support EAS Build.';
31
31
  BuildConfigure.flags = {
32
- platform: command_1.flags.enum({
32
+ platform: core_1.Flags.enum({
33
33
  description: 'Platform to configure',
34
34
  char: 'p',
35
35
  options: ['android', 'ios', 'all'],
@@ -1,19 +1,18 @@
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
17
  runAsync(): Promise<void>;
19
18
  private sanitizeFlagsAsync;