eas-cli 0.40.0 → 0.42.4

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 (103) hide show
  1. package/README.md +466 -101
  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 +2 -2
  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/rename.d.ts +3 -5
  31. package/build/commands/branch/rename.js +5 -6
  32. package/build/commands/branch/view.d.ts +1 -2
  33. package/build/commands/branch/view.js +3 -4
  34. package/build/commands/build/cancel.js +1 -1
  35. package/build/commands/build/configure.d.ts +1 -2
  36. package/build/commands/build/configure.js +3 -3
  37. package/build/commands/build/index.d.ts +11 -17
  38. package/build/commands/build/index.js +27 -177
  39. package/build/commands/build/inspect.d.ts +21 -0
  40. package/build/commands/build/inspect.js +129 -0
  41. package/build/commands/build/list.d.ts +13 -14
  42. package/build/commands/build/list.js +15 -15
  43. package/build/commands/build/view.d.ts +1 -1
  44. package/build/commands/build/view.js +3 -3
  45. package/build/commands/channel/create.d.ts +1 -2
  46. package/build/commands/channel/create.js +3 -4
  47. package/build/commands/channel/edit.d.ts +2 -4
  48. package/build/commands/channel/edit.js +4 -5
  49. package/build/commands/channel/list.d.ts +1 -2
  50. package/build/commands/channel/list.js +3 -4
  51. package/build/commands/channel/rollout.d.ts +4 -5
  52. package/build/commands/channel/rollout.js +6 -7
  53. package/build/commands/channel/view.d.ts +1 -2
  54. package/build/commands/channel/view.js +3 -4
  55. package/build/commands/config.d.ts +2 -3
  56. package/build/commands/config.js +4 -4
  57. package/build/commands/device/list.d.ts +1 -2
  58. package/build/commands/device/list.js +3 -3
  59. package/build/commands/device/view.js +1 -1
  60. package/build/commands/diagnostics.js +1 -0
  61. package/build/commands/secret/create.d.ts +4 -5
  62. package/build/commands/secret/create.js +6 -6
  63. package/build/commands/secret/delete.d.ts +1 -2
  64. package/build/commands/secret/delete.js +3 -3
  65. package/build/commands/submit.d.ts +9 -10
  66. package/build/commands/submit.js +13 -14
  67. package/build/commands/update/configure.d.ts +0 -3
  68. package/build/commands/update/configure.js +14 -15
  69. package/build/commands/update/delete.d.ts +1 -2
  70. package/build/commands/update/delete.js +3 -4
  71. package/build/commands/update/index.d.ts +9 -11
  72. package/build/commands/update/index.js +60 -29
  73. package/build/commands/update/view.d.ts +1 -2
  74. package/build/commands/update/view.js +3 -4
  75. package/build/commands/webhook/create.d.ts +3 -4
  76. package/build/commands/webhook/create.js +5 -5
  77. package/build/commands/webhook/delete.js +1 -1
  78. package/build/commands/webhook/list.d.ts +1 -2
  79. package/build/commands/webhook/list.js +3 -3
  80. package/build/commands/webhook/update.d.ts +4 -5
  81. package/build/commands/webhook/update.js +6 -6
  82. package/build/commands/webhook/view.js +1 -1
  83. package/build/graphql/generated.d.ts +31 -11
  84. package/build/graphql/generated.js +6 -1
  85. package/build/graphql/types/Submission.js +1 -0
  86. package/build/index.d.ts +1 -1
  87. package/build/index.js +2 -2
  88. package/build/project/expoSdk.d.ts +3 -0
  89. package/build/project/expoSdk.js +30 -0
  90. package/build/project/metroConfig.js +2 -2
  91. package/build/project/publish.js +1 -3
  92. package/build/prompts.d.ts +3 -3
  93. package/build/submit/ios/IosSubmitCommand.js +6 -1
  94. package/build/submit/utils/urls.js +1 -1
  95. package/build/update/utils.js +4 -4
  96. package/build/user/actions.js +2 -2
  97. package/build/utils/expoCli.d.ts +3 -1
  98. package/build/utils/expoCli.js +13 -11
  99. package/build/utils/profiles.d.ts +1 -1
  100. package/build/utils/profiles.js +80 -30
  101. package/build/vcs/clients/git.js +2 -2
  102. package/oclif.manifest.json +1 -1
  103. package/package.json +17 -12
@@ -1,13 +1,12 @@
1
- import { flags } from '@oclif/command';
2
1
  import EasCommand from '../../commandUtils/EasCommand';
3
2
  import { EnvironmentSecretScope } from '../../graphql/queries/EnvironmentSecretsQuery';
4
3
  export default class EnvironmentSecretCreate extends EasCommand {
5
4
  static description: string;
6
5
  static flags: {
7
- scope: flags.IOptionFlag<EnvironmentSecretScope>;
8
- name: flags.IOptionFlag<string | undefined>;
9
- value: flags.IOptionFlag<string | undefined>;
10
- force: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
6
+ scope: import("@oclif/core/lib/interfaces").OptionFlag<EnvironmentSecretScope>;
7
+ name: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
8
+ value: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
9
+ force: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
11
10
  };
12
11
  runAsync(): Promise<void>;
13
12
  }
@@ -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 EasCommand_1 = (0, tslib_1.__importDefault)(require("../../commandUtils/EasCommand"));
8
8
  const EnvironmentSecretMutation_1 = require("../../graphql/mutations/EnvironmentSecretMutation");
@@ -16,7 +16,7 @@ const actions_1 = require("../../user/actions");
16
16
  class EnvironmentSecretCreate extends EasCommand_1.default {
17
17
  async runAsync() {
18
18
  const actor = await (0, actions_1.ensureLoggedInAsync)();
19
- let { flags: { name, value: secretValue, scope, force }, } = this.parse(EnvironmentSecretCreate);
19
+ let { flags: { name, value: secretValue, scope, force }, } = await this.parse(EnvironmentSecretCreate);
20
20
  const projectDir = await (0, projectUtils_1.findProjectRootAsync)();
21
21
  const { exp } = (0, config_1.getConfig)(projectDir, { skipSDKVersionRequirement: true });
22
22
  const accountName = await (0, projectUtils_1.getProjectAccountNameAsync)(exp);
@@ -108,18 +108,18 @@ class EnvironmentSecretCreate extends EasCommand_1.default {
108
108
  exports.default = EnvironmentSecretCreate;
109
109
  EnvironmentSecretCreate.description = 'Create an environment secret on the current project or owner account.';
110
110
  EnvironmentSecretCreate.flags = {
111
- scope: command_1.flags.enum({
111
+ scope: core_1.Flags.enum({
112
112
  description: 'Scope for the secret',
113
113
  options: [EnvironmentSecretsQuery_1.EnvironmentSecretScope.ACCOUNT, EnvironmentSecretsQuery_1.EnvironmentSecretScope.PROJECT],
114
114
  default: EnvironmentSecretsQuery_1.EnvironmentSecretScope.PROJECT,
115
115
  }),
116
- name: command_1.flags.string({
116
+ name: core_1.Flags.string({
117
117
  description: 'Name of the secret',
118
118
  }),
119
- value: command_1.flags.string({
119
+ value: core_1.Flags.string({
120
120
  description: 'Value of the secret',
121
121
  }),
122
- force: command_1.flags.boolean({
122
+ force: core_1.Flags.boolean({
123
123
  description: 'Delete and recreate existing secrets',
124
124
  default: false,
125
125
  }),
@@ -1,9 +1,8 @@
1
- import { flags } from '@oclif/command';
2
1
  import EasCommand from '../../commandUtils/EasCommand';
3
2
  export default class EnvironmentSecretDelete extends EasCommand {
4
3
  static description: string;
5
4
  static flags: {
6
- id: flags.IOptionFlag<string | undefined>;
5
+ id: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
7
6
  };
8
7
  runAsync(): Promise<void>;
9
8
  }
@@ -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 EasCommand_1 = (0, tslib_1.__importDefault)(require("../../commandUtils/EasCommand"));
8
8
  const EnvironmentSecretMutation_1 = require("../../graphql/mutations/EnvironmentSecretMutation");
@@ -16,7 +16,7 @@ class EnvironmentSecretDelete extends EasCommand_1.default {
16
16
  const { exp } = (0, config_1.getConfig)(projectDir, { skipSDKVersionRequirement: true });
17
17
  const projectId = await (0, projectUtils_1.getProjectIdAsync)(exp);
18
18
  const projectAccountName = await (0, projectUtils_1.getProjectAccountNameAsync)(exp);
19
- let { flags: { id }, } = this.parse(EnvironmentSecretDelete);
19
+ let { flags: { id }, } = await this.parse(EnvironmentSecretDelete);
20
20
  let secret;
21
21
  if (!id) {
22
22
  const validationMessage = 'You must select which secret to delete.';
@@ -55,7 +55,7 @@ exports.default = EnvironmentSecretDelete;
55
55
  EnvironmentSecretDelete.description = `Delete an environment secret by ID.
56
56
  Unsure where to find the secret's ID? Run ${chalk_1.default.bold('eas secret:list')}`;
57
57
  EnvironmentSecretDelete.flags = {
58
- id: command_1.flags.string({
58
+ id: core_1.Flags.string({
59
59
  description: 'ID of the secret to delete',
60
60
  }),
61
61
  };
@@ -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
  }),
@@ -1,8 +1,5 @@
1
- import { ExpoConfig } from '@expo/config';
2
1
  import EasCommand from '../../commandUtils/EasCommand';
3
- export declare function getEASUpdateURLAsync(exp: ExpoConfig): Promise<string>;
4
2
  export default class UpdateConfigure extends EasCommand {
5
- static hidden: boolean;
6
3
  static description: string;
7
4
  runAsync(): Promise<void>;
8
5
  }
@@ -1,27 +1,26 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getEASUpdateURLAsync = void 0;
4
3
  const tslib_1 = require("tslib");
5
4
  const config_1 = require("@expo/config");
6
5
  const eas_build_job_1 = require("@expo/eas-build-job");
7
6
  const chalk_1 = (0, tslib_1.__importDefault)(require("chalk"));
7
+ const api_1 = require("../../api");
8
8
  const EasCommand_1 = (0, tslib_1.__importDefault)(require("../../commandUtils/EasCommand"));
9
9
  const log_1 = (0, tslib_1.__importStar)(require("../../log"));
10
10
  const projectUtils_1 = require("../../project/projectUtils");
11
11
  const workflow_1 = require("../../project/workflow");
12
- const EAS_UPDATE_URL = 'https://u.expo.dev';
13
- const DEFAULT_RUNTIME_VERSION = { policy: 'sdkVersion' };
14
- async function getEASUpdateURLAsync(exp) {
15
- const projectId = await (0, projectUtils_1.getProjectIdAsync)(exp);
16
- return new URL(projectId, EAS_UPDATE_URL).href;
17
- }
18
- exports.getEASUpdateURLAsync = getEASUpdateURLAsync;
19
- async function configureProjectForEASUpdateAsync(projectDir, exp) {
12
+ const DEFAULT_MANAGED_RUNTIME_VERSION = { policy: 'sdkVersion' };
13
+ const DEFAULT_BARE_RUNTIME_VERSION = '1.0.0';
14
+ async function configureProjectForEASUpdateAsync(projectDir, exp, isBare) {
20
15
  var _a, _b;
21
- const easUpdateURL = await getEASUpdateURLAsync(exp);
16
+ const projectId = await (0, projectUtils_1.getProjectIdAsync)(exp);
17
+ const easUpdateURL = (0, api_1.getEASUpdateURL)(projectId);
22
18
  const preexistingRuntimeVersion = exp.runtimeVersion;
19
+ const defaultRuntimeVersion = isBare
20
+ ? DEFAULT_BARE_RUNTIME_VERSION
21
+ : DEFAULT_MANAGED_RUNTIME_VERSION;
23
22
  const result = await (0, config_1.modifyConfigAsync)(projectDir, {
24
- runtimeVersion: preexistingRuntimeVersion !== null && preexistingRuntimeVersion !== void 0 ? preexistingRuntimeVersion : DEFAULT_RUNTIME_VERSION,
23
+ runtimeVersion: preexistingRuntimeVersion !== null && preexistingRuntimeVersion !== void 0 ? preexistingRuntimeVersion : defaultRuntimeVersion,
25
24
  updates: { ...exp.updates, url: easUpdateURL },
26
25
  });
27
26
  switch (result.type) {
@@ -35,7 +34,7 @@ async function configureProjectForEASUpdateAsync(projectDir, exp) {
35
34
  log_1.default.withTick(`Set updates.url value, to "${easUpdateURL}" in app.json`);
36
35
  }
37
36
  if (!preexistingRuntimeVersion) {
38
- log_1.default.withTick(`Set runtimeVersion to "${JSON.stringify(DEFAULT_RUNTIME_VERSION)}" in app.json`);
37
+ log_1.default.withTick(`Set runtimeVersion to "${JSON.stringify(defaultRuntimeVersion)}" in app.json`);
39
38
  }
40
39
  break;
41
40
  case 'warn': {
@@ -59,11 +58,12 @@ class UpdateConfigure extends EasCommand_1.default {
59
58
  const { exp } = (0, config_1.getConfig)(projectDir, {
60
59
  skipSDKVersionRequirement: true,
61
60
  });
62
- await configureProjectForEASUpdateAsync(projectDir, exp);
63
61
  const hasAndroidNativeProject = (await (0, workflow_1.resolveWorkflowAsync)(projectDir, eas_build_job_1.Platform.ANDROID)) === eas_build_job_1.Workflow.GENERIC;
64
62
  const hasIosNativeProject = (await (0, workflow_1.resolveWorkflowAsync)(projectDir, eas_build_job_1.Platform.IOS)) === eas_build_job_1.Workflow.GENERIC;
63
+ const isBare = hasAndroidNativeProject || hasIosNativeProject;
64
+ await configureProjectForEASUpdateAsync(projectDir, exp, isBare);
65
65
  log_1.default.addNewLineIfNone();
66
- if (hasAndroidNativeProject || hasIosNativeProject) {
66
+ if (isBare) {
67
67
  log_1.default.log(`🧐 It seems you are on the bare workflow! Please also update your native files. You can do this by either running ${chalk_1.default.bold('eas build:configure')} or manually editing Expo.plist/AndroidManifest.xml. ${(0, log_1.learnMore)('https://expo.fyi/eas-update-config.md#native-configuration')}`);
68
68
  }
69
69
  else {
@@ -72,5 +72,4 @@ class UpdateConfigure extends EasCommand_1.default {
72
72
  }
73
73
  }
74
74
  exports.default = UpdateConfigure;
75
- UpdateConfigure.hidden = true;
76
75
  UpdateConfigure.description = 'Configure the project to support EAS Update.';
@@ -1,6 +1,5 @@
1
1
  import EasCommand from '../../commandUtils/EasCommand';
2
2
  export default class UpdateDelete 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 UpdateDelete 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
  }
@@ -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 graphql_tag_1 = (0, tslib_1.__importDefault)(require("graphql-tag"));
7
7
  const EasCommand_1 = (0, tslib_1.__importDefault)(require("../../commandUtils/EasCommand"));
@@ -23,7 +23,7 @@ async function deleteUpdateGroupAsync({ group, }) {
23
23
  }
24
24
  class UpdateDelete extends EasCommand_1.default {
25
25
  async runAsync() {
26
- const { args: { groupId: group }, flags: { json: jsonFlag }, } = this.parse(UpdateDelete);
26
+ const { args: { groupId: group }, flags: { json: jsonFlag }, } = await this.parse(UpdateDelete);
27
27
  if (!jsonFlag) {
28
28
  const shouldAbort = await (0, prompts_1.confirmAsync)({
29
29
  message: `🚨${chalk_1.default.red('CAUTION')}🚨\n\n` +
@@ -46,7 +46,6 @@ class UpdateDelete extends EasCommand_1.default {
46
46
  }
47
47
  }
48
48
  exports.default = UpdateDelete;
49
- UpdateDelete.hidden = true;
50
49
  UpdateDelete.description = 'Delete all the updates in an update Group.';
51
50
  UpdateDelete.args = [
52
51
  {
@@ -56,7 +55,7 @@ UpdateDelete.args = [
56
55
  },
57
56
  ];
58
57
  UpdateDelete.flags = {
59
- json: command_1.flags.boolean({
58
+ json: core_1.Flags.boolean({
60
59
  description: `Return a json with the group ID of the deleted updates.`,
61
60
  default: false,
62
61
  }),
@@ -1,20 +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
- static hidden: boolean;
7
5
  static description: string;
8
6
  static flags: {
9
- branch: flags.IOptionFlag<string | undefined>;
10
- message: flags.IOptionFlag<string | undefined>;
11
- republish: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
12
- group: flags.IOptionFlag<string | undefined>;
13
- 'input-dir': flags.IOptionFlag<string>;
14
- 'skip-bundler': import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
15
- platform: flags.IOptionFlag<string>;
16
- json: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
17
- 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>;
18
16
  };
19
17
  runAsync(): Promise<void>;
20
18
  }
@@ -5,11 +5,12 @@ 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"));
12
12
  const graphql_tag_1 = (0, tslib_1.__importDefault)(require("graphql-tag"));
13
+ const api_1 = require("../../api");
13
14
  const EasCommand_1 = (0, tslib_1.__importDefault)(require("../../commandUtils/EasCommand"));
14
15
  const client_1 = require("../../graphql/client");
15
16
  const PublishMutation_1 = require("../../graphql/mutations/PublishMutation");
@@ -27,7 +28,6 @@ const create_1 = require("../branch/create");
27
28
  const list_1 = require("../branch/list");
28
29
  const view_1 = require("../branch/view");
29
30
  const create_2 = require("../channel/create");
30
- const configure_1 = require("./configure");
31
31
  exports.defaultPublishPlatforms = ['android', 'ios'];
32
32
  async function getUpdateGroupAsync({ group, }) {
33
33
  const { updatesByGroup } = await (0, client_1.withErrorHandlingAsync)(client_1.graphqlClient
@@ -85,8 +85,8 @@ async function ensureBranchExistsAsync({ appId, name: branchName, }) {
85
85
  class UpdatePublish extends EasCommand_1.default {
86
86
  async runAsync() {
87
87
  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;
88
+ let { flags: { branch: branchName, json: jsonFlag, auto: autoFlag, message, republish, group, 'input-dir': inputDir, 'skip-bundler': skipBundler, platform, }, } = await this.parse(UpdatePublish);
89
+ const platformFlag = platform;
90
90
  // If a group was specified, that means we are republishing it.
91
91
  republish = group ? true : republish;
92
92
  const projectDir = await (0, projectUtils_1.findProjectRootAsync)();
@@ -103,18 +103,30 @@ class UpdatePublish extends EasCommand_1.default {
103
103
  `branch-${Math.random().toString(36).substr(2, 4)}`;
104
104
  }
105
105
  if (!branchName) {
106
- const validationMessage = 'branch name may not be empty.';
106
+ const validationMessage = 'Branch name may not be empty.';
107
107
  if (jsonFlag) {
108
108
  throw new Error(validationMessage);
109
109
  }
110
110
  const branches = await (0, list_1.listBranchesAsync)({ projectId });
111
- branchName = await (0, prompts_1.selectAsync)('which branch would you like to publish on?', branches.map(branch => {
112
- return {
113
- title: `${branch.name} ${chalk_1.default.grey(`- current update: ${(0, utils_1.formatUpdate)(branch.updates[0])}`)}`,
114
- value: branch.name,
115
- };
116
- }));
117
- (0, assert_1.default)(branchName, 'branch name must be specified.');
111
+ if (branches.length === 0) {
112
+ ({ name: branchName } = await (0, prompts_1.promptAsync)({
113
+ type: 'text',
114
+ name: 'name',
115
+ message: 'No branches found. Creating a new one. Please name the new branch:',
116
+ initial: (await (0, vcs_1.getVcsClient)().getBranchNameAsync()) ||
117
+ `branch-${Math.random().toString(36).substr(2, 4)}`,
118
+ validate: value => (value ? true : validationMessage),
119
+ }));
120
+ }
121
+ else {
122
+ branchName = await (0, prompts_1.selectAsync)('Which branch would you like to publish on?', branches.map(branch => {
123
+ return {
124
+ title: `${branch.name} ${chalk_1.default.grey(`- current update: ${(0, utils_1.formatUpdate)(branch.updates[0])}`)}`,
125
+ value: branch.name,
126
+ };
127
+ }));
128
+ }
129
+ (0, assert_1.default)(branchName, 'Branch name must be specified.');
118
130
  }
119
131
  const { id: branchId, updates } = await ensureBranchExistsAsync({
120
132
  appId: projectId,
@@ -162,7 +174,7 @@ class UpdatePublish extends EasCommand_1.default {
162
174
  }
163
175
  publicationPlatformMessage = `The republished update will appear on the same plaforms it was originally published on: ${updatesToRepublishFilteredByPlatform
164
176
  .map(update => update.platform)
165
- .join(',')}`;
177
+ .join(', ')}`;
166
178
  }
167
179
  else {
168
180
  publicationPlatformMessage = `The republished update will appear only on: ${platformFlag}`;
@@ -177,6 +189,19 @@ class UpdatePublish extends EasCommand_1.default {
177
189
  group = updatesToRepublishFilteredByPlatform[0].group;
178
190
  oldMessage = (_a = updatesToRepublishFilteredByPlatform[0].message) !== null && _a !== void 0 ? _a : '';
179
191
  oldRuntimeVersion = updatesToRepublishFilteredByPlatform[0].runtimeVersion;
192
+ if (!message) {
193
+ const validationMessage = 'publish message may not be empty.';
194
+ if (jsonFlag) {
195
+ throw new Error(validationMessage);
196
+ }
197
+ ({ publishMessage: message } = await (0, prompts_1.promptAsync)({
198
+ type: 'text',
199
+ name: 'publishMessage',
200
+ message: `Please enter an update message.`,
201
+ initial: `Republish "${oldMessage}" - group: ${group}`,
202
+ validate: (value) => (value ? true : validationMessage),
203
+ }));
204
+ }
180
205
  }
181
206
  else {
182
207
  if (!message && autoFlag) {
@@ -191,17 +216,23 @@ class UpdatePublish extends EasCommand_1.default {
191
216
  type: 'text',
192
217
  name: 'publishMessage',
193
218
  message: `Please enter an update message.`,
194
- initial: republish
195
- ? `Republish "${oldMessage}" - group: ${group}`
196
- : (_c = (await (0, vcs_1.getVcsClient)().getLastCommitMessageAsync())) === null || _c === void 0 ? void 0 : _c.trim(),
219
+ initial: (_c = (await (0, vcs_1.getVcsClient)().getLastCommitMessageAsync())) === null || _c === void 0 ? void 0 : _c.trim(),
197
220
  validate: (value) => (value ? true : validationMessage),
198
221
  }));
199
222
  }
200
223
  // build bundle and upload assets for a new publish
201
224
  if (!skipBundler) {
202
- await (0, publish_1.buildBundlesAsync)({ projectDir, inputDir });
225
+ const bundleSpinner = (0, ora_1.ora)().start('Building bundle...');
226
+ try {
227
+ await (0, publish_1.buildBundlesAsync)({ projectDir, inputDir });
228
+ bundleSpinner.succeed('Built bundle!');
229
+ }
230
+ catch (e) {
231
+ bundleSpinner.fail('Failed to build bundle!');
232
+ throw e;
233
+ }
203
234
  }
204
- const assetSpinner = (0, ora_1.ora)('Uploading assets...').start();
235
+ const assetSpinner = (0, ora_1.ora)().start('Uploading assets...');
205
236
  try {
206
237
  const platforms = platformFlag === 'all' ? exports.defaultPublishPlatforms : [platformFlag];
207
238
  const assets = await (0, publish_1.collectAssetsAsync)({ inputDir: inputDir, platforms });
@@ -276,45 +307,44 @@ class UpdatePublish extends EasCommand_1.default {
276
307
  }
277
308
  }
278
309
  exports.default = UpdatePublish;
279
- UpdatePublish.hidden = true;
280
310
  UpdatePublish.description = 'Publish an update group.';
281
311
  UpdatePublish.flags = {
282
- branch: command_1.flags.string({
312
+ branch: core_1.Flags.string({
283
313
  description: 'Branch to publish the update group on',
284
314
  required: false,
285
315
  }),
286
- message: command_1.flags.string({
316
+ message: core_1.Flags.string({
287
317
  description: 'A short message describing the update',
288
318
  required: false,
289
319
  }),
290
- republish: command_1.flags.boolean({
320
+ republish: core_1.Flags.boolean({
291
321
  description: 'Republish an update group',
292
322
  exclusive: ['input-dir', 'skip-bundler'],
293
323
  }),
294
- group: command_1.flags.string({
324
+ group: core_1.Flags.string({
295
325
  description: 'Update group to republish',
296
326
  exclusive: ['input-dir', 'skip-bundler'],
297
327
  }),
298
- 'input-dir': command_1.flags.string({
328
+ 'input-dir': core_1.Flags.string({
299
329
  description: 'Location of the bundle',
300
330
  default: 'dist',
301
331
  required: false,
302
332
  }),
303
- 'skip-bundler': command_1.flags.boolean({
333
+ 'skip-bundler': core_1.Flags.boolean({
304
334
  description: `Skip running Expo CLI to bundle the app before publishing`,
305
335
  default: false,
306
336
  }),
307
- platform: command_1.flags.enum({
337
+ platform: core_1.Flags.enum({
308
338
  char: 'p',
309
339
  options: [...exports.defaultPublishPlatforms, 'all'],
310
340
  default: 'all',
311
341
  required: false,
312
342
  }),
313
- json: command_1.flags.boolean({
343
+ json: core_1.Flags.boolean({
314
344
  description: 'Enable JSON output, non-JSON messages will be printed to stderr',
315
345
  default: false,
316
346
  }),
317
- auto: command_1.flags.boolean({
347
+ auto: core_1.Flags.boolean({
318
348
  description: 'Use the current git branch and commit message for the EAS branch and update message',
319
349
  default: false,
320
350
  }),
@@ -354,7 +384,8 @@ function formatUpdateTitle(update) {
354
384
  async function checkEASUpdateURLIsSetAsync(exp) {
355
385
  var _a;
356
386
  const configuredURL = (_a = exp.updates) === null || _a === void 0 ? void 0 : _a.url;
357
- const expectedURL = await (0, configure_1.getEASUpdateURLAsync)(exp);
387
+ const projectId = await (0, projectUtils_1.getProjectIdAsync)(exp);
388
+ const expectedURL = (0, api_1.getEASUpdateURL)(projectId);
358
389
  if (configuredURL !== expectedURL) {
359
390
  throw new Error(`The update URL is incorrectly configured for EAS Update. Please set updates.url to ${expectedURL} in your app.json.`);
360
391
  }
@@ -4,7 +4,6 @@ export declare function viewUpdateAsync({ groupId, }: {
4
4
  groupId: string;
5
5
  }): Promise<UpdatesByGroupQuery>;
6
6
  export default class UpdateView extends EasCommand {
7
- static hidden: boolean;
8
7
  static description: string;
9
8
  static args: {
10
9
  name: string;
@@ -12,7 +11,7 @@ export default class UpdateView extends EasCommand {
12
11
  description: string;
13
12
  }[];
14
13
  static flags: {
15
- json: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
14
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
16
15
  };
17
16
  runAsync(): Promise<void>;
18
17
  }
@@ -2,7 +2,7 @@
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"));
@@ -44,7 +44,7 @@ exports.viewUpdateAsync = viewUpdateAsync;
44
44
  class UpdateView extends EasCommand_1.default {
45
45
  async runAsync() {
46
46
  var _a;
47
- const { args: { groupId }, flags: { json: jsonFlag }, } = this.parse(UpdateView);
47
+ const { args: { groupId }, flags: { json: jsonFlag }, } = await this.parse(UpdateView);
48
48
  const { updatesByGroup } = await viewUpdateAsync({ groupId });
49
49
  if (jsonFlag) {
50
50
  log_1.default.log(JSON.stringify(updatesByGroup));
@@ -68,7 +68,6 @@ class UpdateView extends EasCommand_1.default {
68
68
  }
69
69
  }
70
70
  exports.default = UpdateView;
71
- UpdateView.hidden = true;
72
71
  UpdateView.description = 'Update group details.';
73
72
  UpdateView.args = [
74
73
  {
@@ -78,7 +77,7 @@ UpdateView.args = [
78
77
  },
79
78
  ];
80
79
  UpdateView.flags = {
81
- json: command_1.flags.boolean({
80
+ json: core_1.Flags.boolean({
82
81
  description: `Return a json with the updates belonging to the group.`,
83
82
  default: false,
84
83
  }),
@@ -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
  }