eas-cli 1.1.1 → 2.1.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 (89) hide show
  1. package/README.md +86 -79
  2. package/build/branch/queries.js +11 -8
  3. package/build/build/android/graphql.js +2 -1
  4. package/build/build/android/prepareJob.js +3 -1
  5. package/build/build/createContext.js +1 -0
  6. package/build/build/ios/graphql.js +2 -2
  7. package/build/build/ios/prepareJob.js +3 -1
  8. package/build/commandUtils/EasCommand.d.ts +2 -0
  9. package/build/commandUtils/EasCommand.js +44 -3
  10. package/build/commands/branch/delete.js +1 -1
  11. package/build/commands/build/index.d.ts +2 -1
  12. package/build/commands/build/index.js +91 -19
  13. package/build/commands/channel/delete.js +1 -1
  14. package/build/commands/device/delete.js +3 -2
  15. package/build/commands/open.d.ts +5 -0
  16. package/build/commands/open.js +40 -0
  17. package/build/commands/secret/delete.js +1 -1
  18. package/build/commands/submit.d.ts +2 -1
  19. package/build/commands/submit.js +28 -14
  20. package/build/commands/update/configure.js +58 -5
  21. package/build/commands/update/delete.js +1 -1
  22. package/build/commands/update/index.js +3 -0
  23. package/build/commands/webhook/delete.js +1 -1
  24. package/build/credentials/android/api/GraphqlClient.js +1 -1
  25. package/build/credentials/context.d.ts +3 -0
  26. package/build/credentials/context.js +1 -0
  27. package/build/credentials/ios/IosCredentialsProvider.d.ts +1 -0
  28. package/build/credentials/ios/IosCredentialsProvider.js +33 -5
  29. package/build/credentials/ios/actions/ConfigureProvisioningProfile.d.ts +3 -1
  30. package/build/credentials/ios/actions/ConfigureProvisioningProfile.js +5 -2
  31. package/build/credentials/ios/actions/CreateProvisioningProfile.d.ts +3 -1
  32. package/build/credentials/ios/actions/CreateProvisioningProfile.js +3 -2
  33. package/build/credentials/ios/actions/ProvisioningProfileUtils.d.ts +2 -1
  34. package/build/credentials/ios/actions/ProvisioningProfileUtils.js +4 -2
  35. package/build/credentials/ios/actions/SetUpAdhocProvisioningProfile.d.ts +8 -2
  36. package/build/credentials/ios/actions/SetUpAdhocProvisioningProfile.js +30 -18
  37. package/build/credentials/ios/actions/SetUpBuildCredentials.js +1 -0
  38. package/build/credentials/ios/actions/SetUpInternalProvisioningProfile.d.ts +8 -2
  39. package/build/credentials/ios/actions/SetUpInternalProvisioningProfile.js +6 -12
  40. package/build/credentials/ios/actions/SetUpProvisioningProfile.d.ts +3 -1
  41. package/build/credentials/ios/actions/SetUpProvisioningProfile.js +8 -5
  42. package/build/credentials/ios/actions/SetUpTargetBuildCredentials.d.ts +2 -0
  43. package/build/credentials/ios/actions/SetUpTargetBuildCredentials.js +5 -5
  44. package/build/credentials/ios/api/GraphqlClient.js +1 -1
  45. package/build/credentials/ios/appstore/AppStoreApi.d.ts +7 -4
  46. package/build/credentials/ios/appstore/AppStoreApi.js +8 -8
  47. package/build/credentials/ios/appstore/Credentials.types.d.ts +0 -14
  48. package/build/credentials/ios/appstore/Credentials.types.js +0 -6
  49. package/build/credentials/ios/appstore/bundleIdCapabilities.js +176 -15
  50. package/build/credentials/ios/appstore/constants.d.ts +1 -0
  51. package/build/credentials/ios/appstore/constants.js +6 -0
  52. package/build/credentials/ios/appstore/distributionCertificate.js +1 -1
  53. package/build/credentials/ios/appstore/provisioningProfile.d.ts +5 -3
  54. package/build/credentials/ios/appstore/provisioningProfile.js +30 -7
  55. package/build/credentials/ios/appstore/provisioningProfileAdhoc.d.ts +3 -1
  56. package/build/credentials/ios/appstore/provisioningProfileAdhoc.js +10 -10
  57. package/build/credentials/ios/validators/validateProvisioningProfile.d.ts +2 -1
  58. package/build/credentials/ios/validators/validateProvisioningProfile.js +6 -4
  59. package/build/credentials/manager/ManageAndroid.js +2 -8
  60. package/build/credentials/manager/ManageIos.js +10 -9
  61. package/build/devices/actions/create/developerPortalMethod.js +2 -2
  62. package/build/graphql/generated.d.ts +230 -39
  63. package/build/graphql/generated.js +39 -1
  64. package/build/{credentials/ios/api/graphql → graphql}/queries/AppQuery.d.ts +1 -1
  65. package/build/{credentials/ios/api/graphql → graphql}/queries/AppQuery.js +2 -2
  66. package/build/graphql/queries/EnvironmentSecretsQuery.d.ts +1 -1
  67. package/build/graphql/queries/EnvironmentSecretsQuery.js +2 -2
  68. package/build/graphql/queries/StatuspageServiceQuery.d.ts +4 -0
  69. package/build/graphql/queries/StatuspageServiceQuery.js +28 -0
  70. package/build/graphql/types/StatuspageService.d.ts +1 -0
  71. package/build/graphql/types/StatuspageService.js +19 -0
  72. package/build/project/ensureProjectExists.d.ts +0 -7
  73. package/build/project/ensureProjectExists.js +4 -14
  74. package/build/project/ios/target.d.ts +7 -0
  75. package/build/project/ios/target.js +26 -1
  76. package/build/project/projectUtils.d.ts +0 -1
  77. package/build/project/projectUtils.js +9 -29
  78. package/build/project/workflow.js +3 -1
  79. package/build/submit/android/AndroidSubmitter.js +1 -1
  80. package/build/submit/submit.js +2 -2
  81. package/build/submit/utils/errors.js +2 -0
  82. package/build/utils/statuspageService.d.ts +2 -0
  83. package/build/utils/statuspageService.js +41 -0
  84. package/build/vcs/clients/git.js +4 -1
  85. package/build/vcs/clients/gitNoCommit.js +2 -1
  86. package/oclif.manifest.json +1 -1
  87. package/package.json +7 -6
  88. package/build/graphql/queries/ProjectQuery.d.ts +0 -6
  89. package/build/graphql/queries/ProjectQuery.js +0 -24
@@ -2,9 +2,14 @@
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 PackageManagerUtils = tslib_1.__importStar(require("@expo/package-manager"));
5
6
  const core_1 = require("@oclif/core");
7
+ const chalk_1 = tslib_1.__importDefault(require("chalk"));
8
+ const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
9
+ const path_1 = tslib_1.__importDefault(require("path"));
6
10
  const semver_1 = tslib_1.__importDefault(require("semver"));
7
11
  const rudderstackClient_1 = require("../analytics/rudderstackClient");
12
+ const log_1 = require("../log");
8
13
  const projectUtils_1 = require("../project/projectUtils");
9
14
  const User_1 = require("../user/User");
10
15
  const actions_1 = require("../user/actions");
@@ -26,7 +31,9 @@ class EasCommand extends core_1.Command {
26
31
  var _a;
27
32
  await (0, rudderstackClient_1.initAsync)();
28
33
  if (this.mustBeRunInsideProject) {
29
- await this.applyCliConfigAsync();
34
+ const projectDir = await (0, projectUtils_1.findProjectRootAsync)();
35
+ await this.applyCliConfigAsync(projectDir);
36
+ await this.ensureEasCliIsNotInDependenciesAsync(projectDir);
30
37
  }
31
38
  if (this.requiresAuthentication) {
32
39
  const { flags } = await this.parse();
@@ -48,8 +55,7 @@ class EasCommand extends core_1.Command {
48
55
  await (0, rudderstackClient_1.flushAsync)();
49
56
  return super.finally(err);
50
57
  }
51
- async applyCliConfigAsync() {
52
- const projectDir = await (0, projectUtils_1.findProjectRootAsync)();
58
+ async applyCliConfigAsync(projectDir) {
53
59
  const easJsonReader = new eas_json_1.EasJsonReader(projectDir);
54
60
  const config = await easJsonReader.getCliConfigAsync();
55
61
  if ((config === null || config === void 0 ? void 0 : config.version) && !semver_1.default.satisfies(easCli_1.easCliVersion, config.version)) {
@@ -59,5 +65,40 @@ class EasCommand extends core_1.Command {
59
65
  (0, vcs_1.setVcsClient)(new git_1.default());
60
66
  }
61
67
  }
68
+ async ensureEasCliIsNotInDependenciesAsync(projectDir) {
69
+ var _a;
70
+ let printCliVersionWarning = false;
71
+ const consoleWarn = (msg) => {
72
+ if (msg) {
73
+ // eslint-disable-next-line no-console
74
+ console.warn(chalk_1.default.yellow(msg));
75
+ }
76
+ else {
77
+ // eslint-disable-next-line no-console
78
+ console.warn();
79
+ }
80
+ };
81
+ if (await this.isEasCliInDependenciesAsync(projectDir)) {
82
+ printCliVersionWarning = true;
83
+ consoleWarn(`Found ${chalk_1.default.bold('eas-cli')} in your project dependencies.`);
84
+ }
85
+ const maybeRepoRoot = (_a = PackageManagerUtils.findWorkspaceRoot(projectDir)) !== null && _a !== void 0 ? _a : projectDir;
86
+ if (maybeRepoRoot !== projectDir && (await this.isEasCliInDependenciesAsync(maybeRepoRoot))) {
87
+ printCliVersionWarning = true;
88
+ consoleWarn(`Found ${chalk_1.default.bold('eas-cli')} in your monorepo dependencies.`);
89
+ }
90
+ if (printCliVersionWarning) {
91
+ consoleWarn(`It's recommended to use the ${chalk_1.default.bold('"cli.version"')} field in eas.json to enforce the ${chalk_1.default.bold('eas-cli')} version for your project.`);
92
+ consoleWarn((0, log_1.learnMore)('https://github.com/expo/eas-cli#enforcing-eas-cli-version-for-your-project'));
93
+ consoleWarn();
94
+ }
95
+ }
96
+ async isEasCliInDependenciesAsync(dir) {
97
+ var _a, _b;
98
+ const packageJsonPath = path_1.default.join(dir, 'package.json');
99
+ const packageJson = JSON.parse(await fs_extra_1.default.readFile(packageJsonPath, 'utf8'));
100
+ return (((_a = packageJson === null || packageJson === void 0 ? void 0 : packageJson.dependencies) === null || _a === void 0 ? void 0 : _a['eas-cli']) !== undefined ||
101
+ ((_b = packageJson === null || packageJson === void 0 ? void 0 : packageJson.devDependencies) === null || _b === void 0 ? void 0 : _b['eas-cli']) !== undefined);
102
+ }
62
103
  }
63
104
  exports.default = EasCommand;
@@ -78,7 +78,7 @@ class BranchDelete extends EasCommand_1.default {
78
78
  }
79
79
  if (!jsonFlag) {
80
80
  log_1.default.addNewLineIfNone();
81
- log_1.default.warn(`You are about to permamently delete branch: "${name}" and all of the updates published on it.` +
81
+ log_1.default.warn(`You are about to permanently delete branch: "${name}" and all of the updates published on it.` +
82
82
  `\nThis action is irreversible.`);
83
83
  log_1.default.newLine();
84
84
  const confirmed = await (0, prompts_1.toggleConfirmAsync)({ message: 'Are you sure you wish to proceed?' });
@@ -19,5 +19,6 @@ export default class Build extends EasCommand {
19
19
  message: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
20
20
  };
21
21
  runAsync(): Promise<void>;
22
- private sanitizeFlagsAsync;
22
+ private sanitizeFlags;
23
+ private ensurePlatformSelectedAsync;
23
24
  }
@@ -1,26 +1,42 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
+ const eas_build_job_1 = require("@expo/eas-build-job");
5
+ const eas_json_1 = require("@expo/eas-json");
4
6
  const core_1 = require("@oclif/core");
7
+ const chalk_1 = tslib_1.__importDefault(require("chalk"));
8
+ const figures_1 = tslib_1.__importDefault(require("figures"));
9
+ const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
5
10
  const path_1 = tslib_1.__importDefault(require("path"));
6
11
  const runBuildAndSubmit_1 = require("../../build/runBuildAndSubmit");
7
12
  const types_1 = require("../../build/types");
8
13
  const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
9
- const log_1 = tslib_1.__importDefault(require("../../log"));
14
+ const generated_1 = require("../../graphql/generated");
15
+ const log_1 = tslib_1.__importStar(require("../../log"));
10
16
  const platform_1 = require("../../platform");
11
17
  const projectUtils_1 = require("../../project/projectUtils");
18
+ const prompts_1 = require("../../prompts");
19
+ const uniq_1 = tslib_1.__importDefault(require("../../utils/expodash/uniq"));
12
20
  const json_1 = require("../../utils/json");
21
+ const statuspageService_1 = require("../../utils/statuspageService");
13
22
  class Build extends EasCommand_1.default {
14
23
  async runAsync() {
15
24
  const { flags: rawFlags } = await this.parse(Build);
16
25
  if (rawFlags.json) {
17
26
  (0, json_1.enableJsonOutput)();
18
27
  }
19
- const flags = await this.sanitizeFlagsAsync(rawFlags);
28
+ const flags = this.sanitizeFlags(rawFlags);
20
29
  const projectDir = await (0, projectUtils_1.findProjectRootAsync)();
21
- await (0, runBuildAndSubmit_1.runBuildAndSubmitAsync)(projectDir, flags);
30
+ await handleDeprecatedEasJsonAsync(projectDir, flags.nonInteractive);
31
+ if (!flags.localBuildOptions.enable) {
32
+ await (0, statuspageService_1.maybeWarnAboutEasOutagesAsync)(flags.autoSubmit
33
+ ? [generated_1.StatuspageServiceName.EasBuild, generated_1.StatuspageServiceName.EasSubmit]
34
+ : [generated_1.StatuspageServiceName.EasBuild]);
35
+ }
36
+ const flagsWithPlatform = await this.ensurePlatformSelectedAsync(flags);
37
+ await (0, runBuildAndSubmit_1.runBuildAndSubmitAsync)(projectDir, flagsWithPlatform);
22
38
  }
23
- async sanitizeFlagsAsync(flags) {
39
+ sanitizeFlags(flags) {
24
40
  var _a, _b;
25
41
  const nonInteractive = flags['non-interactive'];
26
42
  if (!flags.local && flags.output) {
@@ -32,21 +48,10 @@ class Build extends EasCommand_1.default {
32
48
  if (flags.json && !nonInteractive) {
33
49
  core_1.Errors.error('--json is allowed only when building in non-interactive mode', { exit: 1 });
34
50
  }
35
- const requestedPlatform = await (0, platform_1.selectRequestedPlatformAsync)(flags.platform);
36
- if (flags.local) {
37
- if (flags['auto-submit'] || flags['auto-submit-with-profile'] !== undefined) {
38
- // TODO: implement this
39
- core_1.Errors.error('Auto-submits are not yet supported when building locally', { exit: 1 });
40
- }
41
- if (requestedPlatform === platform_1.RequestedPlatform.All) {
42
- core_1.Errors.error('Builds for multiple platforms are not supported with flag --local', {
43
- exit: 1,
44
- });
45
- }
46
- else if (process.platform !== 'darwin' && requestedPlatform === platform_1.RequestedPlatform.Ios) {
47
- core_1.Errors.error('Unsupported platform, macOS is required to build apps for iOS', { exit: 1 });
48
- }
49
- }
51
+ const requestedPlatform = flags.platform &&
52
+ Object.values(platform_1.RequestedPlatform).includes(flags.platform.toLowerCase())
53
+ ? flags.platform.toLowerCase()
54
+ : undefined;
50
55
  if (flags['skip-credentials-check']) {
51
56
  log_1.default.warnDeprecatedFlag('skip-credentials-check', 'Build credentials validation is always skipped with the --non-interactive flag. You can also skip interactively.');
52
57
  log_1.default.newLine();
@@ -82,6 +87,27 @@ class Build extends EasCommand_1.default {
82
87
  message,
83
88
  };
84
89
  }
90
+ async ensurePlatformSelectedAsync(flags) {
91
+ const requestedPlatform = await (0, platform_1.selectRequestedPlatformAsync)(flags.requestedPlatform);
92
+ if (flags.localBuildOptions.enable) {
93
+ if (flags.autoSubmit) {
94
+ // TODO: implement this
95
+ core_1.Errors.error('Auto-submits are not yet supported when building locally', { exit: 1 });
96
+ }
97
+ if (requestedPlatform === platform_1.RequestedPlatform.All) {
98
+ core_1.Errors.error('Builds for multiple platforms are not supported with flag --local', {
99
+ exit: 1,
100
+ });
101
+ }
102
+ else if (process.platform !== 'darwin' && requestedPlatform === platform_1.RequestedPlatform.Ios) {
103
+ core_1.Errors.error('Unsupported platform, macOS is required to build apps for iOS', { exit: 1 });
104
+ }
105
+ }
106
+ return {
107
+ ...flags,
108
+ requestedPlatform,
109
+ };
110
+ }
85
111
  }
86
112
  exports.default = Build;
87
113
  Build.description = 'start a build';
@@ -146,3 +172,49 @@ Build.flags = {
146
172
  description: 'A short message describing the build',
147
173
  }),
148
174
  };
175
+ async function handleDeprecatedEasJsonAsync(projectDir, nonInteractive) {
176
+ const reader = new eas_json_1.EasJsonReader(projectDir);
177
+ const profileNames = await reader.getBuildProfileNamesAsync();
178
+ const platformAndProfileNames = profileNames.flatMap(profileName => [
179
+ [eas_build_job_1.Platform.ANDROID, profileName],
180
+ [eas_build_job_1.Platform.IOS, profileName],
181
+ ]);
182
+ const deprecatedProfiles = [];
183
+ for (const [platform, profileName] of platformAndProfileNames) {
184
+ const buildProfile = await reader.getBuildProfileAsync(platform, profileName);
185
+ if (buildProfile.artifactPath) {
186
+ deprecatedProfiles.push([platform, profileName]);
187
+ }
188
+ }
189
+ if (deprecatedProfiles.length === 0) {
190
+ return;
191
+ }
192
+ const deprecatedProfileNames = (0, uniq_1.default)(deprecatedProfiles.map(([, profileName]) => profileName));
193
+ log_1.default.warn(`Some of your build profiles use deprecated field ${chalk_1.default.bold('artifactPath')}:`);
194
+ for (const profileName of deprecatedProfileNames) {
195
+ log_1.default.warn(`- ${profileName}`);
196
+ }
197
+ log_1.default.newLine();
198
+ if (nonInteractive) {
199
+ log_1.default.warn(`${figures_1.default.warning} Action required: rename ${chalk_1.default.bold('artifactPath')} to ${chalk_1.default.bold('applicationArchivePath')} in all of the build profiles listed above.`);
200
+ log_1.default.warn(`See ${(0, log_1.link)('https://docs.expo.dev/build-reference/eas-json/')} for more information.`);
201
+ log_1.default.warn(`This warning will become an error in a future EAS CLI release. This build will continue to use the ${chalk_1.default.bold('artifactPath')} setting.`);
202
+ return;
203
+ }
204
+ const rename = await (0, prompts_1.selectAsync)('Do you want us to handle renaming the field for you?', [
205
+ { title: 'Yes', value: true },
206
+ { title: 'No, I will edit eas.json manually (EAS CLI exits)', value: false },
207
+ ]);
208
+ if (!rename) {
209
+ core_1.Errors.exit(1);
210
+ }
211
+ const easJsonPath = eas_json_1.EasJsonReader.formatEasJsonPath(projectDir);
212
+ const easJson = await fs_extra_1.default.readJSON(easJsonPath);
213
+ for (const [platform, profileName] of deprecatedProfiles) {
214
+ easJson.build[profileName][platform].applicationArchivePath =
215
+ easJson.build[profileName][platform].artifactPath;
216
+ delete easJson.build[profileName][platform].artifactPath;
217
+ }
218
+ await fs_extra_1.default.writeFile(easJsonPath, `${JSON.stringify(easJson, null, 2)}\n`);
219
+ log_1.default.withTick('Updated eas.json');
220
+ }
@@ -46,7 +46,7 @@ class ChannelDelete extends EasCommand_1.default {
46
46
  }
47
47
  if (!nonInteractiveFlag) {
48
48
  log_1.default.addNewLineIfNone();
49
- log_1.default.warn(`You are about to permamently delete channel: "${name}".\nThis action is irreversible.`);
49
+ log_1.default.warn(`You are about to permanently delete channel: "${name}".\nThis action is irreversible.`);
50
50
  log_1.default.newLine();
51
51
  const confirmed = await (0, prompts_1.toggleConfirmAsync)({ message: 'Are you sure you wish to proceed?' });
52
52
  if (!confirmed) {
@@ -57,8 +57,9 @@ class DeviceDelete extends EasCommand_1.default {
57
57
  log_1.default.addNewLineIfNone();
58
58
  const removeAppleSpinner = (0, ora_1.ora)('Disabling devices on Apple').start();
59
59
  try {
60
- let realDevices = await apple_utils_1.Device.getAllIOSProfileDevicesAsync(context);
61
- realDevices = realDevices.filter(d => chosenDevices.map(cd => cd.identifier).includes(d.attributes.udid));
60
+ const chosenDeviceIdentifiers = chosenDevices.map(cd => cd.identifier);
61
+ const allDevices = await apple_utils_1.Device.getAsync(context);
62
+ const realDevices = allDevices.filter(d => chosenDeviceIdentifiers.includes(d.attributes.udid));
62
63
  for (const device of realDevices) {
63
64
  await device.updateAsync({ status: apple_utils_1.DeviceStatus.DISABLED });
64
65
  }
@@ -0,0 +1,5 @@
1
+ import EasCommand from '../commandUtils/EasCommand';
2
+ export default class Open extends EasCommand {
3
+ static description: string;
4
+ runAsync(): Promise<void>;
5
+ }
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const better_opn_1 = tslib_1.__importDefault(require("better-opn"));
5
+ const url_1 = require("../build/utils/url");
6
+ const EasCommand_1 = tslib_1.__importDefault(require("../commandUtils/EasCommand"));
7
+ const ora_1 = require("../ora");
8
+ const expoConfig_1 = require("../project/expoConfig");
9
+ const projectUtils_1 = require("../project/projectUtils");
10
+ const actions_1 = require("../user/actions");
11
+ class Open extends EasCommand_1.default {
12
+ async runAsync() {
13
+ const projectDir = await (0, projectUtils_1.findProjectRootAsync)();
14
+ const exp = (0, expoConfig_1.getExpoConfig)(projectDir);
15
+ // this ensures the project exists
16
+ await (0, projectUtils_1.fetchProjectIdFromServerAsync)(exp);
17
+ const user = await (0, actions_1.ensureLoggedInAsync)();
18
+ const accountName = (0, projectUtils_1.getProjectAccountName)(exp, user);
19
+ const projectName = exp.slug;
20
+ const projectDashboardUrl = (0, url_1.getProjectDashboardUrl)(accountName, projectName);
21
+ const failedMessage = `Unable to open a web browser. Project page is available at: ${projectDashboardUrl}`;
22
+ const spinner = (0, ora_1.ora)(`Opening ${projectDashboardUrl}`).start();
23
+ try {
24
+ const opened = await (0, better_opn_1.default)(projectDashboardUrl);
25
+ if (opened) {
26
+ spinner.succeed(`Opened ${projectDashboardUrl}`);
27
+ }
28
+ else {
29
+ spinner.fail(failedMessage);
30
+ }
31
+ return;
32
+ }
33
+ catch (error) {
34
+ spinner.fail(failedMessage);
35
+ throw error;
36
+ }
37
+ }
38
+ }
39
+ exports.default = Open;
40
+ Open.description = 'open the project page in a web browser';
@@ -35,7 +35,7 @@ class EnvironmentSecretDelete extends EasCommand_1.default {
35
35
  }
36
36
  }
37
37
  log_1.default.addNewLineIfNone();
38
- log_1.default.warn(`You are about to permamently delete secret${(secret === null || secret === void 0 ? void 0 : secret.name) ? ` "${secret === null || secret === void 0 ? void 0 : secret.name}"` : ''} with id: "${id}".\nThis action is irreversible.`);
38
+ log_1.default.warn(`You are about to permanently delete secret${(secret === null || secret === void 0 ? void 0 : secret.name) ? ` "${secret === null || secret === void 0 ? void 0 : secret.name}"` : ''} with id: "${id}".\nThis action is irreversible.`);
39
39
  log_1.default.newLine();
40
40
  const confirmed = await (0, prompts_1.toggleConfirmAsync)({
41
41
  message: `Are you sure you wish to proceed?${(secret === null || secret === void 0 ? void 0 : secret.scope) === EnvironmentSecretsQuery_1.EnvironmentSecretScope.ACCOUNT
@@ -14,5 +14,6 @@ export default class Submit extends EasCommand {
14
14
  'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
15
15
  };
16
16
  runAsync(): Promise<void>;
17
- private sanitizeFlagsAsync;
17
+ private sanitizeFlags;
18
+ private ensurePlatformSelectedAsync;
18
19
  }
@@ -5,6 +5,7 @@ const eas_json_1 = require("@expo/eas-json");
5
5
  const core_1 = require("@oclif/core");
6
6
  const chalk_1 = tslib_1.__importDefault(require("chalk"));
7
7
  const EasCommand_1 = tslib_1.__importDefault(require("../commandUtils/EasCommand"));
8
+ const generated_1 = require("../graphql/generated");
8
9
  const AppPlatform_1 = require("../graphql/types/AppPlatform");
9
10
  const log_1 = tslib_1.__importDefault(require("../log"));
10
11
  const platform_1 = require("../platform");
@@ -14,19 +15,22 @@ const context_1 = require("../submit/context");
14
15
  const submit_1 = require("../submit/submit");
15
16
  const urls_1 = require("../submit/utils/urls");
16
17
  const profiles_1 = require("../utils/profiles");
18
+ const statuspageService_1 = require("../utils/statuspageService");
17
19
  class Submit extends EasCommand_1.default {
18
20
  async runAsync() {
19
21
  const { flags: rawFlags } = await this.parse(Submit);
20
- const flags = await this.sanitizeFlagsAsync(rawFlags);
22
+ const flags = this.sanitizeFlags(rawFlags);
21
23
  const projectDir = await (0, projectUtils_1.findProjectRootAsync)();
22
24
  const exp = (0, expoConfig_1.getExpoConfig)(projectDir);
23
25
  const projectId = await (0, projectUtils_1.getProjectIdAsync)(exp);
24
- const platforms = (0, platform_1.toPlatforms)(flags.requestedPlatform);
26
+ await (0, statuspageService_1.maybeWarnAboutEasOutagesAsync)([generated_1.StatuspageServiceName.EasSubmit]);
27
+ const flagsWithPlatform = await this.ensurePlatformSelectedAsync(flags);
28
+ const platforms = (0, platform_1.toPlatforms)(flagsWithPlatform.requestedPlatform);
25
29
  const submissionProfiles = await (0, profiles_1.getProfilesAsync)({
26
30
  type: 'submit',
27
31
  easJsonReader: new eas_json_1.EasJsonReader(projectDir),
28
32
  platforms,
29
- profileName: flags.profile,
33
+ profileName: flagsWithPlatform.profile,
30
34
  });
31
35
  const submissions = [];
32
36
  for (const submissionProfile of submissionProfiles) {
@@ -35,8 +39,8 @@ class Submit extends EasCommand_1.default {
35
39
  projectDir,
36
40
  projectId,
37
41
  profile: submissionProfile.profile,
38
- archiveFlags: flags.archiveFlags,
39
- nonInteractive: flags.nonInteractive,
42
+ archiveFlags: flagsWithPlatform.archiveFlags,
43
+ nonInteractive: flagsWithPlatform.nonInteractive,
40
44
  });
41
45
  if (submissionProfiles.length > 1) {
42
46
  log_1.default.newLine();
@@ -48,24 +52,22 @@ class Submit extends EasCommand_1.default {
48
52
  }
49
53
  log_1.default.newLine();
50
54
  (0, urls_1.printSubmissionDetailsUrls)(submissions);
51
- if (flags.wait) {
55
+ if (flagsWithPlatform.wait) {
52
56
  const completedSubmissions = await (0, submit_1.waitToCompleteAsync)(submissions, {
53
- verbose: flags.verbose,
57
+ verbose: flagsWithPlatform.verbose,
54
58
  });
55
59
  (0, submit_1.exitWithNonZeroCodeIfSomeSubmissionsDidntFinish)(completedSubmissions);
56
60
  }
57
61
  }
58
- async sanitizeFlagsAsync(flags) {
62
+ sanitizeFlags(flags) {
59
63
  const { platform, verbose, wait, profile, 'non-interactive': nonInteractive, ...archiveFlags } = flags;
60
64
  if (!flags.platform && nonInteractive) {
61
65
  core_1.Errors.error('--platform is required when building in non-interactive mode', { exit: 1 });
62
66
  }
63
- const requestedPlatform = await (0, platform_1.selectRequestedPlatformAsync)(flags.platform);
64
- if (requestedPlatform === platform_1.RequestedPlatform.All) {
65
- if (archiveFlags.id || archiveFlags.path || archiveFlags.url) {
66
- core_1.Errors.error('--id, --path, and --url params are only supported when performing a single-platform submit', { exit: 1 });
67
- }
68
- }
67
+ const requestedPlatform = flags.platform &&
68
+ Object.values(platform_1.RequestedPlatform).includes(flags.platform.toLowerCase())
69
+ ? flags.platform.toLowerCase()
70
+ : undefined;
69
71
  return {
70
72
  archiveFlags,
71
73
  requestedPlatform,
@@ -75,6 +77,18 @@ class Submit extends EasCommand_1.default {
75
77
  nonInteractive,
76
78
  };
77
79
  }
80
+ async ensurePlatformSelectedAsync(flags) {
81
+ const requestedPlatform = await (0, platform_1.selectRequestedPlatformAsync)(flags.requestedPlatform);
82
+ if (requestedPlatform === platform_1.RequestedPlatform.All) {
83
+ if (flags.archiveFlags.id || flags.archiveFlags.path || flags.archiveFlags.url) {
84
+ core_1.Errors.error('--id, --path, and --url params are only supported when performing a single-platform submit', { exit: 1 });
85
+ }
86
+ }
87
+ return {
88
+ ...flags,
89
+ requestedPlatform,
90
+ };
91
+ }
78
92
  }
79
93
  exports.default = Submit;
80
94
  Submit.description = 'submit app binary to App Store and/or Play Store';
@@ -81,6 +81,7 @@ async function configureAppJSONForEASUpdateAsync({ projectDir, exp, platform, wo
81
81
  const newAndroidRuntimeVersion = (_c = (_b = (_a = exp.android) === null || _a === void 0 ? void 0 : _a.runtimeVersion) !== null && _b !== void 0 ? _b : exp.runtimeVersion) !== null && _c !== void 0 ? _c : androidDefaultRuntimeVersion;
82
82
  const newIosRuntimeVersion = (_f = (_e = (_d = exp.ios) === null || _d === void 0 ? void 0 : _d.runtimeVersion) !== null && _e !== void 0 ? _e : exp.runtimeVersion) !== null && _f !== void 0 ? _f : iosDefaultRuntimeVersion;
83
83
  let newConfig;
84
+ let newConfigOnlyAddedValues;
84
85
  switch (platform) {
85
86
  case platform_1.RequestedPlatform.All: {
86
87
  if (isRuntimeEqual(newAndroidRuntimeVersion, newIosRuntimeVersion)) {
@@ -93,6 +94,26 @@ async function configureAppJSONForEASUpdateAsync({ projectDir, exp, platform, wo
93
94
  ios: { ...exp.ios, runtimeVersion: undefined },
94
95
  updates,
95
96
  };
97
+ newConfigOnlyAddedValues = {
98
+ runtimeVersion: newAndroidRuntimeVersion,
99
+ ...(exp.android && 'runtimeVersion' in exp.android
100
+ ? {
101
+ android: {
102
+ runtimeVersion: '<remove this key>',
103
+ },
104
+ }
105
+ : {}),
106
+ ...(exp.ios && 'runtimeVersion' in exp.ios
107
+ ? {
108
+ ios: {
109
+ runtimeVersion: '<remove this key>',
110
+ },
111
+ }
112
+ : {}),
113
+ updates: {
114
+ url: easUpdateURL,
115
+ },
116
+ };
96
117
  }
97
118
  else {
98
119
  newConfig = {
@@ -107,6 +128,22 @@ async function configureAppJSONForEASUpdateAsync({ projectDir, exp, platform, wo
107
128
  },
108
129
  updates,
109
130
  };
131
+ newConfigOnlyAddedValues = {
132
+ ...('runtimeVersion' in exp
133
+ ? {
134
+ runtimeVersion: '<remove this key>', // top level runtime is redundant if it is specified in both android and ios
135
+ }
136
+ : {}),
137
+ android: {
138
+ runtimeVersion: newAndroidRuntimeVersion,
139
+ },
140
+ ios: {
141
+ runtimeVersion: newIosRuntimeVersion,
142
+ },
143
+ updates: {
144
+ url: easUpdateURL,
145
+ },
146
+ };
110
147
  }
111
148
  break;
112
149
  }
@@ -118,6 +155,14 @@ async function configureAppJSONForEASUpdateAsync({ projectDir, exp, platform, wo
118
155
  },
119
156
  updates,
120
157
  };
158
+ newConfigOnlyAddedValues = {
159
+ android: {
160
+ runtimeVersion: newAndroidRuntimeVersion,
161
+ },
162
+ updates: {
163
+ url: easUpdateURL,
164
+ },
165
+ };
121
166
  break;
122
167
  }
123
168
  case platform_1.RequestedPlatform.Ios: {
@@ -128,6 +173,14 @@ async function configureAppJSONForEASUpdateAsync({ projectDir, exp, platform, wo
128
173
  },
129
174
  updates,
130
175
  };
176
+ newConfigOnlyAddedValues = {
177
+ ios: {
178
+ runtimeVersion: newIosRuntimeVersion,
179
+ },
180
+ updates: {
181
+ url: easUpdateURL,
182
+ },
183
+ };
131
184
  break;
132
185
  }
133
186
  default: {
@@ -135,8 +188,8 @@ async function configureAppJSONForEASUpdateAsync({ projectDir, exp, platform, wo
135
188
  }
136
189
  }
137
190
  const result = await (0, config_1.modifyConfigAsync)(projectDir, newConfig);
138
- const prexistingAndroidRuntimeVersion = (_h = (_g = exp.android) === null || _g === void 0 ? void 0 : _g.runtimeVersion) !== null && _h !== void 0 ? _h : exp.runtimeVersion;
139
- const prexistingIosRuntimeVersion = (_k = (_j = exp.ios) === null || _j === void 0 ? void 0 : _j.runtimeVersion) !== null && _k !== void 0 ? _k : exp.runtimeVersion;
191
+ const preexistingAndroidRuntimeVersion = (_h = (_g = exp.android) === null || _g === void 0 ? void 0 : _g.runtimeVersion) !== null && _h !== void 0 ? _h : exp.runtimeVersion;
192
+ const preexistingIosRuntimeVersion = (_k = (_j = exp.ios) === null || _j === void 0 ? void 0 : _j.runtimeVersion) !== null && _k !== void 0 ? _k : exp.runtimeVersion;
140
193
  switch (result.type) {
141
194
  case 'success':
142
195
  if ((_l = exp.updates) === null || _l === void 0 ? void 0 : _l.url) {
@@ -147,11 +200,11 @@ async function configureAppJSONForEASUpdateAsync({ projectDir, exp, platform, wo
147
200
  else {
148
201
  log_1.default.withTick(`Set updates.url value, to "${easUpdateURL}" in app.json`);
149
202
  }
150
- if (!prexistingAndroidRuntimeVersion &&
203
+ if (!preexistingAndroidRuntimeVersion &&
151
204
  [platform_1.RequestedPlatform.Android, platform_1.RequestedPlatform.All].includes(platform)) {
152
205
  log_1.default.withTick(`Set ${platform_1.appPlatformDisplayNames[generated_1.AppPlatform.Android]} runtimeVersion to "${JSON.stringify((_p = (_o = newConfig.android) === null || _o === void 0 ? void 0 : _o.runtimeVersion) !== null && _p !== void 0 ? _p : newConfig.runtimeVersion)}" in app.json`);
153
206
  }
154
- if (!prexistingIosRuntimeVersion &&
207
+ if (!preexistingIosRuntimeVersion &&
155
208
  [platform_1.RequestedPlatform.Ios, platform_1.RequestedPlatform.All].includes(platform)) {
156
209
  log_1.default.withTick(`Set ${platform_1.appPlatformDisplayNames[generated_1.AppPlatform.Ios]} runtimeVersion to "${JSON.stringify((_r = (_q = newConfig.ios) === null || _q === void 0 ? void 0 : _q.runtimeVersion) !== null && _r !== void 0 ? _r : newConfig.runtimeVersion)}" in app.json`);
157
210
  }
@@ -160,7 +213,7 @@ async function configureAppJSONForEASUpdateAsync({ projectDir, exp, platform, wo
160
213
  log_1.default.addNewLineIfNone();
161
214
  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)')}`);
162
215
  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`);
163
- log_1.default.log(chalk_1.default.bold(JSON.stringify(newConfig, null, 2)));
216
+ log_1.default.log(chalk_1.default.bold(JSON.stringify(newConfigOnlyAddedValues, null, 2)));
164
217
  log_1.default.addNewLineIfNone();
165
218
  if (workflows['android'] === eas_build_job_1.Workflow.GENERIC || workflows['ios'] === eas_build_job_1.Workflow.GENERIC) {
166
219
  log_1.default.warn(`You will also have to manually edit the projects ${chalk_1.default.bold('Expo.plist/AndroidManifest.xml')}. ${(0, log_1.learnMore)('https://expo.fyi/eas-update-config.md#native-configuration')}`);
@@ -33,7 +33,7 @@ class UpdateDelete extends EasCommand_1.default {
33
33
  message: `🚨${chalk_1.default.red('CAUTION')}🚨\n\n` +
34
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` +
35
35
  `If you want to revert to a previous publish, you should use 'update --republish' targeted at the last working update group instead.\n\n` +
36
- `An update group should only be deleted in an emergency like an accidental publish of a secret. In this case user 'update --republish' to revert to the last working update group first and then proceed with the deletion. Deleting an update group when it is the latest publish can lead to inconsistent cacheing behavior by clients.\n\n` +
36
+ `An update group should only be deleted in an emergency like an accidental publish of a secret. In this case user 'update --republish' to revert to the last working update group first and then proceed with the deletion. Deleting an update group when it is the latest publish can lead to inconsistent caching behavior by clients.\n\n` +
37
37
  `Would you like to abort?`,
38
38
  });
39
39
  if (shouldAbort) {
@@ -16,6 +16,7 @@ const url_1 = require("../../build/utils/url");
16
16
  const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
17
17
  const fetch_1 = tslib_1.__importDefault(require("../../fetch"));
18
18
  const client_1 = require("../../graphql/client");
19
+ const generated_1 = require("../../graphql/generated");
19
20
  const PublishMutation_1 = require("../../graphql/mutations/PublishMutation");
20
21
  const BranchQuery_1 = require("../../graphql/queries/BranchQuery");
21
22
  const UpdateQuery_1 = require("../../graphql/queries/UpdateQuery");
@@ -32,6 +33,7 @@ const code_signing_1 = require("../../utils/code-signing");
32
33
  const uniqBy_1 = tslib_1.__importDefault(require("../../utils/expodash/uniqBy"));
33
34
  const formatFields_1 = tslib_1.__importDefault(require("../../utils/formatFields"));
34
35
  const json_1 = require("../../utils/json");
36
+ const statuspageService_1 = require("../../utils/statuspageService");
35
37
  const vcs_1 = require("../../vcs");
36
38
  const create_1 = require("../branch/create");
37
39
  const create_2 = require("../channel/create");
@@ -109,6 +111,7 @@ class UpdatePublish extends EasCommand_1.default {
109
111
  const expPrivate = (0, expoConfig_1.getExpoConfig)(projectDir, {
110
112
  isPublicConfig: false,
111
113
  });
114
+ await (0, statuspageService_1.maybeWarnAboutEasOutagesAsync)([generated_1.StatuspageServiceName.EasUpdate]);
112
115
  const codeSigningInfo = await (0, code_signing_1.getCodeSigningInfoAsync)(expPrivate, privateKeyPath);
113
116
  const hasExpoUpdates = (0, projectUtils_1.isExpoUpdatesInstalledOrAvailable)(projectDir, exp.sdkVersion);
114
117
  if (!hasExpoUpdates && nonInteractive) {
@@ -40,7 +40,7 @@ class WebhookDelete extends EasCommand_1.default {
40
40
  log_1.default.addNewLineIfNone();
41
41
  log_1.default.log((0, formatWebhook_1.formatWebhook)(webhook));
42
42
  log_1.default.newLine();
43
- log_1.default.warn(`You are about to permamently delete this webhook.\nThis action is irreversible.`);
43
+ log_1.default.warn(`You are about to permanently delete this webhook.\nThis action is irreversible.`);
44
44
  log_1.default.newLine();
45
45
  const confirmed = await (0, prompts_1.toggleConfirmAsync)({
46
46
  message: 'Are you sure you wish to proceed?',
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.formatProjectFullName = exports.getGoogleServiceAccountKeysForAccountAsync = exports.deleteGoogleServiceAccountKeyAsync = exports.createGoogleServiceAccountKeyAsync = exports.deleteFcmAsync = exports.createFcmAsync = exports.deleteKeystoreAsync = exports.createKeystoreAsync = exports.createOrUpdateDefaultIosAppBuildCredentialsAsync = exports.createOrUpdateAndroidAppBuildCredentialsByNameAsync = exports.getAndroidAppBuildCredentialsByNameAsync = exports.getDefaultAndroidAppBuildCredentialsAsync = exports.createAndroidAppBuildCredentialsAsync = exports.updateAndroidAppBuildCredentialsAsync = exports.updateAndroidAppCredentialsAsync = exports.createOrGetExistingAndroidAppCredentialsWithBuildCredentialsAsync = exports.getLegacyAndroidAppBuildCredentialsAsync = exports.getLegacyAndroidAppCredentialsWithCommonFieldsAsync = exports.getAndroidAppBuildCredentialsListAsync = exports.getAndroidAppCredentialsWithCommonFieldsAsync = void 0;
4
- const AppQuery_1 = require("../../ios/api/graphql/queries/AppQuery");
4
+ const AppQuery_1 = require("../../../graphql/queries/AppQuery");
5
5
  const AndroidAppBuildCredentialsMutation_1 = require("./graphql/mutations/AndroidAppBuildCredentialsMutation");
6
6
  const AndroidAppCredentialsMutation_1 = require("./graphql/mutations/AndroidAppCredentialsMutation");
7
7
  const AndroidFcmMutation_1 = require("./graphql/mutations/AndroidFcmMutation");
@@ -1,5 +1,6 @@
1
1
  import { ExpoConfig } from '@expo/config';
2
2
  import { Env } from '@expo/eas-build-job';
3
+ import { EasJson } from '@expo/eas-json';
3
4
  import { Actor } from '../user/User';
4
5
  import * as AndroidGraphqlClient from './android/api/GraphqlClient';
5
6
  import * as IosGraphqlClient from './ios/api/GraphqlClient';
@@ -12,10 +13,12 @@ export declare class CredentialsContext {
12
13
  readonly nonInteractive: boolean;
13
14
  readonly projectDir: string;
14
15
  readonly user: Actor;
16
+ readonly easJsonCliConfig?: EasJson['cli'];
15
17
  private shouldAskAuthenticateAppStore;
16
18
  private resolvedExp?;
17
19
  constructor(options: {
18
20
  exp?: ExpoConfig;
21
+ easJsonCliConfig?: EasJson['cli'];
19
22
  nonInteractive?: boolean;
20
23
  projectDir: string;
21
24
  user: Actor;
@@ -20,6 +20,7 @@ class CredentialsContext {
20
20
  this.appStore = new AppStoreApi_1.default();
21
21
  this.ios = IosGraphqlClient;
22
22
  this.shouldAskAuthenticateAppStore = true;
23
+ this.easJsonCliConfig = options.easJsonCliConfig;
23
24
  this.projectDir = options.projectDir;
24
25
  this.user = options.user;
25
26
  this.nonInteractive = (_a = options.nonInteractive) !== null && _a !== void 0 ? _a : false;