eas-cli 0.34.1 → 0.37.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 (152) hide show
  1. package/README.md +27 -27
  2. package/build/analytics/common.d.ts +8 -0
  3. package/build/analytics/common.js +19 -0
  4. package/build/analytics/events.d.ts +43 -0
  5. package/build/analytics/events.js +51 -0
  6. package/build/{analytics.d.ts → analytics/rudderstackClient.d.ts} +0 -0
  7. package/build/{analytics.js → analytics/rudderstackClient.js} +2 -2
  8. package/build/api.js +3 -3
  9. package/build/build/build.js +18 -27
  10. package/build/build/context.d.ts +1 -1
  11. package/build/build/context.js +2 -2
  12. package/build/build/ios/UpdatesModule.js +3 -2
  13. package/build/build/ios/credentials.js +3 -3
  14. package/build/build/ios/version.js +7 -3
  15. package/build/build/local.js +18 -27
  16. package/build/build/types.d.ts +0 -1
  17. package/build/build/utils/devClient.d.ts +1 -2
  18. package/build/build/utils/formatBuild.js +1 -9
  19. package/build/build/utils/repository.js +1 -0
  20. package/build/build/utils/url.js +1 -1
  21. package/build/commandUtils/EasCommand.js +4 -4
  22. package/build/commands/branch/publish.js +24 -2
  23. package/build/commands/build/index.js +15 -12
  24. package/build/commands/channel/create.d.ts +6 -0
  25. package/build/commands/channel/create.js +2 -0
  26. package/build/commands/secret/create.js +0 -6
  27. package/build/commands/secret/delete.js +1 -7
  28. package/build/commands/secret/list.js +0 -6
  29. package/build/commands/submit.js +2 -11
  30. package/build/credentials/android/AndroidCredentialsProvider.js +2 -2
  31. package/build/credentials/android/actions/RemoveFcm.js +4 -4
  32. package/build/credentials/android/actions/{SetupBuildCredentials.d.ts → SetUpBuildCredentials.d.ts} +1 -1
  33. package/build/credentials/android/actions/{SetupBuildCredentials.js → SetUpBuildCredentials.js} +3 -3
  34. package/build/credentials/android/actions/{SetupBuildCredentialsFromCredentialsJson.d.ts → SetUpBuildCredentialsFromCredentialsJson.d.ts} +1 -1
  35. package/build/credentials/android/actions/{SetupBuildCredentialsFromCredentialsJson.js → SetUpBuildCredentialsFromCredentialsJson.js} +3 -3
  36. package/build/credentials/android/actions/{SetupGoogleServiceAccountKey.d.ts → SetUpGoogleServiceAccountKey.d.ts} +1 -1
  37. package/build/credentials/android/actions/{SetupGoogleServiceAccountKey.js → SetUpGoogleServiceAccountKey.js} +3 -3
  38. package/build/credentials/android/utils/keystore.js +67 -32
  39. package/build/credentials/errors.d.ts +4 -0
  40. package/build/credentials/errors.js +8 -1
  41. package/build/credentials/ios/IosCredentialsProvider.js +4 -4
  42. package/build/credentials/ios/actions/AscApiKeyUtils.d.ts +17 -1
  43. package/build/credentials/ios/actions/AscApiKeyUtils.js +158 -24
  44. package/build/credentials/ios/actions/AssignAscApiKey.d.ts +9 -0
  45. package/build/credentials/ios/actions/AssignAscApiKey.js +29 -0
  46. package/build/credentials/ios/actions/CreateAscApiKey.d.ts +9 -0
  47. package/build/credentials/ios/actions/CreateAscApiKey.js +21 -0
  48. package/build/credentials/ios/actions/DistributionCertificateUtils.js +1 -1
  49. package/build/credentials/ios/actions/PushKeyUtils.js +1 -1
  50. package/build/credentials/ios/actions/RemoveAscApiKey.d.ts +14 -0
  51. package/build/credentials/ios/actions/RemoveAscApiKey.js +55 -0
  52. package/build/credentials/ios/actions/{SetupAdhocProvisioningProfile.d.ts → SetUpAdhocProvisioningProfile.d.ts} +1 -1
  53. package/build/credentials/ios/actions/{SetupAdhocProvisioningProfile.js → SetUpAdhocProvisioningProfile.js} +5 -5
  54. package/build/credentials/ios/actions/SetUpAscApiKey.d.ts +21 -0
  55. package/build/credentials/ios/actions/SetUpAscApiKey.js +114 -0
  56. package/build/credentials/ios/actions/{SetupBuildCredentials.d.ts → SetUpBuildCredentials.d.ts} +1 -1
  57. package/build/credentials/ios/actions/{SetupBuildCredentials.js → SetUpBuildCredentials.js} +5 -5
  58. package/build/credentials/ios/actions/{SetupBuildCredentialsFromCredentialsJson.d.ts → SetUpBuildCredentialsFromCredentialsJson.d.ts} +1 -1
  59. package/build/credentials/ios/actions/{SetupBuildCredentialsFromCredentialsJson.js → SetUpBuildCredentialsFromCredentialsJson.js} +5 -5
  60. package/build/credentials/ios/actions/{SetupDistributionCertificate.d.ts → SetUpDistributionCertificate.d.ts} +1 -1
  61. package/build/credentials/ios/actions/{SetupDistributionCertificate.js → SetUpDistributionCertificate.js} +3 -3
  62. package/build/credentials/ios/actions/{SetupInternalProvisioningProfile.d.ts → SetUpInternalProvisioningProfile.d.ts} +1 -1
  63. package/build/credentials/ios/actions/{SetupInternalProvisioningProfile.js → SetUpInternalProvisioningProfile.js} +7 -7
  64. package/build/credentials/ios/actions/{SetupProvisioningProfile.d.ts → SetUpProvisioningProfile.d.ts} +1 -1
  65. package/build/credentials/ios/actions/{SetupProvisioningProfile.js → SetUpProvisioningProfile.js} +5 -5
  66. package/build/credentials/ios/actions/{SetupPushKey.d.ts → SetUpPushKey.d.ts} +1 -1
  67. package/build/credentials/ios/actions/{SetupPushKey.js → SetUpPushKey.js} +3 -3
  68. package/build/credentials/ios/actions/SetUpSubmissionCredentials.d.ts +10 -0
  69. package/build/credentials/ios/actions/SetUpSubmissionCredentials.js +53 -0
  70. package/build/credentials/ios/actions/{SetupTargetBuildCredentials.d.ts → SetUpTargetBuildCredentials.d.ts} +1 -1
  71. package/build/credentials/ios/actions/{SetupTargetBuildCredentials.js → SetUpTargetBuildCredentials.js} +10 -10
  72. package/build/credentials/ios/actions/{SetupTargetBuildCredentialsFromCredentialsJson.d.ts → SetUpTargetBuildCredentialsFromCredentialsJson.d.ts} +1 -1
  73. package/build/credentials/ios/actions/{SetupTargetBuildCredentialsFromCredentialsJson.js → SetUpTargetBuildCredentialsFromCredentialsJson.js} +3 -3
  74. package/build/credentials/ios/api/GraphqlClient.d.ts +8 -2
  75. package/build/credentials/ios/api/GraphqlClient.js +74 -2
  76. package/build/credentials/ios/api/graphql/mutations/AppStoreConnectApiKeyMutation.d.ts +5 -0
  77. package/build/credentials/ios/api/graphql/mutations/AppStoreConnectApiKeyMutation.js +54 -0
  78. package/build/credentials/ios/api/graphql/mutations/IosAppCredentialsMutation.d.ts +1 -0
  79. package/build/credentials/ios/api/graphql/mutations/IosAppCredentialsMutation.js +25 -0
  80. package/build/credentials/ios/api/graphql/queries/AppStoreConnectApiKeyQuery.d.ts +4 -0
  81. package/build/credentials/ios/api/graphql/queries/AppStoreConnectApiKeyQuery.js +33 -0
  82. package/build/credentials/ios/appstore/AppStoreApi.d.ts +1 -1
  83. package/build/credentials/ios/appstore/Credentials.types.d.ts +1 -0
  84. package/build/credentials/ios/appstore/ascApiKey.d.ts +1 -1
  85. package/build/credentials/ios/appstore/ascApiKey.js +11 -1
  86. package/build/credentials/ios/appstore/entitlements.d.ts +2 -2
  87. package/build/credentials/ios/appstore/entitlements.js +28 -21
  88. package/build/credentials/ios/credentials.d.ts +2 -1
  89. package/build/credentials/ios/credentials.js +7 -2
  90. package/build/credentials/ios/utils/printCredentials.js +1 -1
  91. package/build/credentials/ios/validators/validateAscApiKey.d.ts +5 -0
  92. package/build/credentials/ios/validators/validateAscApiKey.js +21 -0
  93. package/build/credentials/manager/Actions.d.ts +20 -15
  94. package/build/credentials/manager/Actions.js +20 -15
  95. package/build/credentials/manager/AndroidActions.js +6 -6
  96. package/build/credentials/manager/IosActions.d.ts +1 -0
  97. package/build/credentials/manager/IosActions.js +40 -5
  98. package/build/credentials/manager/ManageAndroid.js +6 -6
  99. package/build/credentials/manager/ManageIos.js +56 -17
  100. package/build/credentials/utils/promptForCredentials.d.ts +2 -1
  101. package/build/credentials/utils/promptForCredentials.js +3 -2
  102. package/build/graphql/client.js +1 -1
  103. package/build/graphql/generated.d.ts +208 -55
  104. package/build/graphql/mutations/KeystoreGenerationUrlMutation.d.ts +3 -0
  105. package/build/graphql/mutations/KeystoreGenerationUrlMutation.js +23 -0
  106. package/build/graphql/types/Build.js +1 -6
  107. package/build/project/android/applicationId.d.ts +6 -0
  108. package/build/project/android/applicationId.js +39 -29
  109. package/build/project/android/gradle.js +3 -2
  110. package/build/project/android/gradleUtils.d.ts +1 -0
  111. package/build/project/ios/bundleIdentifier.d.ts +6 -1
  112. package/build/project/ios/bundleIdentifier.js +29 -18
  113. package/build/submit/ArchiveSource.js +2 -1
  114. package/build/submit/BaseSubmitter.d.ts +20 -4
  115. package/build/submit/BaseSubmitter.js +34 -1
  116. package/build/submit/android/AndroidSubmitCommand.d.ts +1 -2
  117. package/build/submit/android/AndroidSubmitCommand.js +22 -35
  118. package/build/submit/android/AndroidSubmitter.d.ts +12 -8
  119. package/build/submit/android/AndroidSubmitter.js +30 -21
  120. package/build/submit/android/ServiceAccountSource.d.ts +3 -2
  121. package/build/submit/android/ServiceAccountSource.js +18 -6
  122. package/build/submit/context.d.ts +2 -0
  123. package/build/submit/context.js +14 -0
  124. package/build/submit/ios/AppSpecificPasswordSource.d.ts +9 -6
  125. package/build/submit/ios/AppSpecificPasswordSource.js +42 -20
  126. package/build/submit/ios/AscApiKeySource.d.ts +9 -3
  127. package/build/submit/ios/AscApiKeySource.js +10 -10
  128. package/build/submit/ios/CredentialsServiceSource.d.ts +18 -0
  129. package/build/submit/ios/CredentialsServiceSource.js +63 -0
  130. package/build/submit/ios/IosSubmitCommand.d.ts +2 -2
  131. package/build/submit/ios/IosSubmitCommand.js +56 -56
  132. package/build/submit/ios/IosSubmitter.d.ts +20 -7
  133. package/build/submit/ios/IosSubmitter.js +79 -43
  134. package/build/submit/submit.js +13 -4
  135. package/build/submit/utils/errors.js +2 -0
  136. package/build/user/User.js +1 -1
  137. package/build/{build/ios → utils}/plist.d.ts +1 -1
  138. package/build/{build/ios → utils}/plist.js +8 -2
  139. package/build/utils/profiles.d.ts +9 -4
  140. package/build/utils/profiles.js +14 -7
  141. package/build/vcs/clients/git.d.ts +2 -1
  142. package/build/vcs/clients/git.js +83 -5
  143. package/build/vcs/vcs.d.ts +4 -3
  144. package/build/vcs/vcs.js +3 -3
  145. package/oclif.manifest.json +1 -1
  146. package/package.json +4 -4
  147. package/build/build/utils/analytics.d.ts +0 -22
  148. package/build/build/utils/analytics.js +0 -28
  149. package/build/project/isEasEnabledForProject.d.ts +0 -8
  150. package/build/project/isEasEnabledForProject.js +0 -33
  151. package/build/submit/android/AndroidPackageSource.d.ts +0 -17
  152. package/build/submit/android/AndroidPackageSource.js +0 -27
@@ -3,36 +3,27 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.runLocalBuildAsync = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const spawn_async_1 = (0, tslib_1.__importDefault)(require("@expo/spawn-async"));
6
- const chalk_1 = (0, tslib_1.__importDefault)(require("chalk"));
7
- const fs_extra_1 = (0, tslib_1.__importDefault)(require("fs-extra"));
8
- const path_1 = (0, tslib_1.__importDefault)(require("path"));
9
- const log_1 = (0, tslib_1.__importDefault)(require("../log"));
10
6
  const PLUGIN_PACKAGE_NAME = 'eas-cli-local-build-plugin';
7
+ const PLUGIN_PACKAGE_VERSION = '0.0.50';
11
8
  async function runLocalBuildAsync(job) {
12
- var _a, _b;
13
- const execNameOrPath = (_b = (_a = process.env.EAS_LOCAL_BUILD_PLUGIN_PATH) !== null && _a !== void 0 ? _a : (await findWithNodeResolutionAsync())) !== null && _b !== void 0 ? _b : PLUGIN_PACKAGE_NAME;
14
- try {
15
- const arg = Buffer.from(JSON.stringify({ job })).toString('base64');
16
- await (0, spawn_async_1.default)(execNameOrPath, [arg], {
17
- stdio: 'inherit',
18
- });
19
- }
20
- catch (err) {
21
- if (err.code === 'ENOENT') {
22
- log_1.default.warn(`Could not resolve executable ${execNameOrPath}.`);
23
- log_1.default.warn(`Install ${PLUGIN_PACKAGE_NAME} package from npm e.g. ${chalk_1.default.bold(`npm install -g ${PLUGIN_PACKAGE_NAME}`)} and make sure it's in PATH.`);
24
- throw err;
25
- }
26
- }
9
+ const { command, args } = getCommandAndArgs(job);
10
+ await (0, spawn_async_1.default)(command, args, {
11
+ stdio: 'inherit',
12
+ });
27
13
  }
28
14
  exports.runLocalBuildAsync = runLocalBuildAsync;
29
- async function findWithNodeResolutionAsync() {
30
- try {
31
- const resolvedPath = path_1.default.resolve(path_1.default.dirname(require.resolve(PLUGIN_PACKAGE_NAME)), '../bin/run');
32
- if (await fs_extra_1.default.pathExists(resolvedPath)) {
33
- return resolvedPath;
34
- }
15
+ function getCommandAndArgs(job) {
16
+ const jobBase64 = Buffer.from(JSON.stringify({ job })).toString('base64');
17
+ if (process.env.EAS_LOCAL_BUILD_PLUGIN_PATH) {
18
+ return {
19
+ command: process.env.EAS_LOCAL_BUILD_PLUGIN_PATH,
20
+ args: [jobBase64],
21
+ };
22
+ }
23
+ else {
24
+ return {
25
+ command: 'npx',
26
+ args: ['-y', `${PLUGIN_PACKAGE_NAME}@${PLUGIN_PACKAGE_VERSION}`, jobBase64],
27
+ };
35
28
  }
36
- catch { }
37
- return undefined;
38
29
  }
@@ -11,4 +11,3 @@ export declare enum BuildDistributionType {
11
11
  INTERNAL = "internal",
12
12
  SIMULATOR = "simulator"
13
13
  }
14
- export declare type TrackingContext = Record<string, string | number | boolean>;
@@ -1,7 +1,6 @@
1
- import { BuildProfile } from '@expo/eas-json';
2
1
  import { ProfileData } from '../../utils/profiles';
3
2
  export declare function ensureExpoDevClientInstalledForDevClientBuildsAsync({ projectDir, nonInteractive, buildProfiles, }: {
4
3
  projectDir: string;
5
4
  nonInteractive?: boolean;
6
- buildProfiles?: ProfileData<BuildProfile>[];
5
+ buildProfiles?: ProfileData<'build'>[];
7
6
  }): Promise<void>;
@@ -117,13 +117,5 @@ function formatGraphQLBuild(build) {
117
117
  exports.formatGraphQLBuild = formatGraphQLBuild;
118
118
  const getActorName = (build) => {
119
119
  var _a;
120
- if (!build.initiatingActor) {
121
- return 'unknown';
122
- }
123
- else if (build.initiatingActor.__typename === 'User') {
124
- return build.initiatingActor.username;
125
- }
126
- else {
127
- return (_a = build.initiatingActor.firstName) !== null && _a !== void 0 ? _a : 'unknown';
128
- }
120
+ return ((_a = build.initiatingActor) === null || _a === void 0 ? void 0 : _a.displayName) || 'unknown';
129
121
  };
@@ -113,6 +113,7 @@ async function reviewAndCommitChangesAsync(initialCommitMessage, { nonInteractiv
113
113
  await (0, vcs_1.getVcsClient)().commitAsync({
114
114
  commitMessage: initialCommitMessage,
115
115
  commitAllFiles: false,
116
+ nonInteractive,
116
117
  });
117
118
  log_1.default.withTick('Committed changes.');
118
119
  return;
@@ -26,7 +26,7 @@ exports.getArtifactUrl = getArtifactUrl;
26
26
  function getInternalDistributionInstallUrl(build) {
27
27
  var _a;
28
28
  if (build.platform === generated_1.AppPlatform.Ios) {
29
- return `itms-services://?action=download-manifest;url=${(0, api_1.getExpoApiBaseUrl)()}/--/api/v2/projects/${build.project.id}/builds/${build.id}/manifest.plist`;
29
+ return `itms-services://?action=download-manifest;url=${(0, api_1.getExpoApiBaseUrl)()}/v2/projects/${build.project.id}/builds/${build.id}/manifest.plist`;
30
30
  }
31
31
  (0, assert_1.default)((_a = build.artifacts) === null || _a === void 0 ? void 0 : _a.buildUrl, 'buildUrl is missing');
32
32
  return build.artifacts.buildUrl;
@@ -4,7 +4,7 @@ const tslib_1 = require("tslib");
4
4
  const eas_json_1 = require("@expo/eas-json");
5
5
  const command_1 = require("@oclif/command");
6
6
  const semver_1 = (0, tslib_1.__importDefault)(require("semver"));
7
- const analytics_1 = require("../analytics");
7
+ const rudderstackClient_1 = require("../analytics/rudderstackClient");
8
8
  const log_1 = (0, tslib_1.__importDefault)(require("../log"));
9
9
  const projectUtils_1 = require("../project/projectUtils");
10
10
  const User_1 = require("../user/User");
@@ -25,7 +25,7 @@ class EasCommand extends command_1.Command {
25
25
  async run() {
26
26
  var _a;
27
27
  eas_json_1.EasJsonReader.setLog(log_1.default);
28
- await (0, analytics_1.initAsync)();
28
+ await (0, rudderstackClient_1.initAsync)();
29
29
  await this.applyCliConfigAsync();
30
30
  if (this.requiresAuthentication) {
31
31
  const { flags } = this.parse();
@@ -35,7 +35,7 @@ class EasCommand extends command_1.Command {
35
35
  else {
36
36
  await (0, User_1.getUserAsync)();
37
37
  }
38
- (0, analytics_1.logEvent)(analytics_1.AnalyticsEvent.ACTION, {
38
+ (0, rudderstackClient_1.logEvent)(rudderstackClient_1.AnalyticsEvent.ACTION, {
39
39
  // id is assigned by oclif in constructor based on the filepath:
40
40
  // commands/submit === submit, commands/build/list === build:list
41
41
  action: `eas ${this.id}`,
@@ -44,7 +44,7 @@ class EasCommand extends command_1.Command {
44
44
  }
45
45
  // eslint-disable-next-line async-protect/async-suffix
46
46
  async finally(err) {
47
- await (0, analytics_1.flushAsync)();
47
+ await (0, rudderstackClient_1.flushAsync)();
48
48
  return super.finally(err);
49
49
  }
50
50
  async applyCliConfigAsync() {
@@ -23,7 +23,8 @@ const utils_1 = require("../../update/utils");
23
23
  const uniqBy_1 = (0, tslib_1.__importDefault)(require("../../utils/expodash/uniqBy"));
24
24
  const formatFields_1 = (0, tslib_1.__importDefault)(require("../../utils/formatFields"));
25
25
  const vcs_1 = require("../../vcs");
26
- const create_1 = require("./create");
26
+ const create_1 = require("../channel/create");
27
+ const create_2 = require("./create");
27
28
  const list_1 = require("./list");
28
29
  const view_1 = require("./view");
29
30
  exports.defaultPublishPlatforms = ['android', 'ios'];
@@ -46,6 +47,24 @@ async function getUpdateGroupAsync({ group, }) {
46
47
  .toPromise());
47
48
  return updatesByGroup;
48
49
  }
50
+ async function ensureChannelExistsAsync({ appId, branchId, channelName, }) {
51
+ var _a;
52
+ try {
53
+ await (0, create_1.createUpdateChannelOnAppAsync)({
54
+ appId,
55
+ channelName,
56
+ branchId,
57
+ });
58
+ log_1.default.withTick(`Created a channel: ${chalk_1.default.bold(channelName)} pointed at branch: ${chalk_1.default.bold(channelName)}.`);
59
+ }
60
+ catch (e) {
61
+ const isIgnorableError = ((_a = e.graphQLErrors) === null || _a === void 0 ? void 0 : _a.length) === 1 &&
62
+ e.graphQLErrors[0].extensions.errorCode === 'CHANNEL_ALREADY_EXISTS';
63
+ if (!isIgnorableError) {
64
+ throw e;
65
+ }
66
+ }
67
+ }
49
68
  async function ensureBranchExistsAsync({ appId, name: branchName, }) {
50
69
  const { app } = await (0, view_1.viewUpdateBranchAsync)({
51
70
  appId,
@@ -54,9 +73,12 @@ async function ensureBranchExistsAsync({ appId, name: branchName, }) {
54
73
  const updateBranch = app === null || app === void 0 ? void 0 : app.byId.updateBranchByName;
55
74
  if (updateBranch) {
56
75
  const { id, updates } = updateBranch;
76
+ await ensureChannelExistsAsync({ appId, branchId: id, channelName: branchName });
57
77
  return { id, updates };
58
78
  }
59
- const newUpdateBranch = await (0, create_1.createUpdateBranchOnAppAsync)({ appId, name: branchName });
79
+ const newUpdateBranch = await (0, create_2.createUpdateBranchOnAppAsync)({ appId, name: branchName });
80
+ log_1.default.withTick(`Created branch: ${chalk_1.default.bold(branchName)}`);
81
+ await ensureChannelExistsAsync({ appId, branchId: newUpdateBranch.id, channelName: branchName });
60
82
  return { id: newUpdateBranch.id, updates: [] };
61
83
  }
62
84
  class BranchPublish extends EasCommand_1.default {
@@ -23,7 +23,6 @@ const generated_1 = require("../../graphql/generated");
23
23
  const AppPlatform_1 = require("../../graphql/types/AppPlatform");
24
24
  const log_1 = (0, tslib_1.__importStar)(require("../../log"));
25
25
  const platform_1 = require("../../platform");
26
- const isEasEnabledForProject_1 = require("../../project/isEasEnabledForProject");
27
26
  const metroConfig_1 = require("../../project/metroConfig");
28
27
  const projectUtils_1 = require("../../project/projectUtils");
29
28
  const prompts_1 = require("../../prompts");
@@ -54,13 +53,11 @@ class Build extends EasCommand_1.default {
54
53
  await (0, repository_1.ensureRepoIsCleanAsync)(flags.nonInteractive);
55
54
  await (0, configure_1.ensureProjectConfiguredAsync)(projectDir, requestedPlatform);
56
55
  const platforms = (0, platform_1.toPlatforms)(requestedPlatform);
57
- const easJsonReader = new eas_json_1.EasJsonReader(projectDir);
58
56
  const buildProfiles = await (0, profiles_1.getProfilesAsync)({
57
+ type: 'build',
58
+ projectDir,
59
59
  platforms,
60
60
  profileName: flags.profile,
61
- async readProfileAsync(platform, profileName) {
62
- return await easJsonReader.readBuildProfileAsync(platform, profileName);
63
- },
64
61
  });
65
62
  await (0, devClient_1.ensureExpoDevClientInstalledForDevClientBuildsAsync)({
66
63
  projectDir,
@@ -154,7 +151,7 @@ class Build extends EasCommand_1.default {
154
151
  wait: flags['wait'],
155
152
  clearCache: flags['clear-cache'],
156
153
  json: flags['json'],
157
- autoSubmit: flags['auto-submit'],
154
+ autoSubmit: flags['auto-submit'] || flags['auto-submit-with-profile'] !== undefined,
158
155
  submitProfile: (_a = flags['auto-submit-with-profile']) !== null && _a !== void 0 ? _a : profile,
159
156
  };
160
157
  }
@@ -178,9 +175,6 @@ class Build extends EasCommand_1.default {
178
175
  await (0, metroConfig_1.validateMetroConfigForManagedWorkflowAsync)(buildCtx);
179
176
  this.metroConfigValidated = true;
180
177
  }
181
- if (!buildCtx.local && !(await (0, isEasEnabledForProject_1.isEasEnabledForProjectAsync)(buildCtx.projectId))) {
182
- (0, errors_1.error)(isEasEnabledForProject_1.EAS_UNAVAILABLE_MESSAGE, { exit: 1 });
183
- }
184
178
  const build = await this.startBuildAsync(buildCtx);
185
179
  return {
186
180
  build,
@@ -276,7 +270,8 @@ Build.flags = {
276
270
  }),
277
271
  };
278
272
  async function handleDeprecatedEasJsonAsync(projectDir, nonInteractive) {
279
- if (!(await fs_extra_1.default.pathExists(eas_json_1.EasJsonReader.formatEasJsonPath(projectDir)))) {
273
+ const easJsonPath = eas_json_1.EasJsonReader.formatEasJsonPath(projectDir);
274
+ if (!(await fs_extra_1.default.pathExists(easJsonPath))) {
280
275
  return;
281
276
  }
282
277
  const easJsonReader = new eas_json_1.EasJsonReader(projectDir);
@@ -297,13 +292,21 @@ async function handleDeprecatedEasJsonAsync(projectDir, nonInteractive) {
297
292
  { title: 'Require changes to be committed in Git (old default)', value: 'requireCommit' },
298
293
  { title: 'Allow builds with dirty Git working tree (new default)', value: 'noCommit' },
299
294
  ]);
295
+ if (mode === 'requireCommit') {
296
+ (0, vcs_1.setVcsClient)(new git_1.default());
297
+ await (0, repository_1.ensureRepoIsCleanAsync)(nonInteractive);
298
+ }
300
299
  rawEasJson.cli =
301
300
  mode === 'requireCommit'
302
301
  ? { version: `>= ${easCli_1.easCliVersion}`, requireCommit: true }
303
302
  : { version: `>= ${easCli_1.easCliVersion}` };
304
- await fs_extra_1.default.writeJSON(eas_json_1.EasJsonReader.formatEasJsonPath(projectDir), rawEasJson, { spaces: 2 });
303
+ await fs_extra_1.default.writeJSON(easJsonPath, rawEasJson, { spaces: 2 });
304
+ log_1.default.withTick('Updated eas.json');
305
305
  if (mode === 'requireCommit') {
306
- (0, vcs_1.setVcsClient)(new git_1.default());
306
+ await (0, vcs_1.getVcsClient)().trackFileAsync(easJsonPath);
307
+ await (0, repository_1.reviewAndCommitChangesAsync)('Set cli.requireCommit to true in eas.json', {
308
+ nonInteractive,
309
+ });
307
310
  }
308
311
  }
309
312
  exports.handleDeprecatedEasJsonAsync = handleDeprecatedEasJsonAsync;
@@ -1,4 +1,10 @@
1
1
  import EasCommand from '../../commandUtils/EasCommand';
2
+ import { CreateUpdateChannelOnAppMutation } from '../../graphql/generated';
3
+ export declare function createUpdateChannelOnAppAsync({ appId, channelName, branchId, }: {
4
+ appId: string;
5
+ channelName: string;
6
+ branchId: string;
7
+ }): Promise<CreateUpdateChannelOnAppMutation>;
2
8
  export default class ChannelCreate extends EasCommand {
3
9
  static hidden: boolean;
4
10
  static description: string;
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createUpdateChannelOnAppAsync = void 0;
3
4
  const tslib_1 = require("tslib");
4
5
  const config_1 = require("@expo/config");
5
6
  const command_1 = require("@oclif/command");
@@ -36,6 +37,7 @@ async function createUpdateChannelOnAppAsync({ appId, channelName, branchId, })
36
37
  })
37
38
  .toPromise());
38
39
  }
40
+ exports.createUpdateChannelOnAppAsync = createUpdateChannelOnAppAsync;
39
41
  class ChannelCreate extends EasCommand_1.default {
40
42
  async runAsync() {
41
43
  let { args: { name: channelName }, flags: { json: jsonFlag }, } = this.parse(ChannelCreate);
@@ -8,7 +8,6 @@ const EasCommand_1 = (0, tslib_1.__importDefault)(require("../../commandUtils/Ea
8
8
  const EnvironmentSecretMutation_1 = require("../../graphql/mutations/EnvironmentSecretMutation");
9
9
  const EnvironmentSecretsQuery_1 = require("../../graphql/queries/EnvironmentSecretsQuery");
10
10
  const log_1 = (0, tslib_1.__importDefault)(require("../../log"));
11
- const isEasEnabledForProject_1 = require("../../project/isEasEnabledForProject");
12
11
  const projectUtils_1 = require("../../project/projectUtils");
13
12
  const prompts_1 = require("../../prompts");
14
13
  const Account_1 = require("../../user/Account");
@@ -23,11 +22,6 @@ class EnvironmentSecretCreate extends EasCommand_1.default {
23
22
  const accountName = await (0, projectUtils_1.getProjectAccountNameAsync)(exp);
24
23
  const { slug } = exp;
25
24
  const projectId = await (0, projectUtils_1.getProjectIdAsync)(exp);
26
- if (!(await (0, isEasEnabledForProject_1.isEasEnabledForProjectAsync)(projectId))) {
27
- (0, isEasEnabledForProject_1.warnEasUnavailable)();
28
- process.exitCode = 1;
29
- return;
30
- }
31
25
  if (!scope) {
32
26
  const validationMessage = 'Secret scope may not be empty.';
33
27
  ({ scope } = await (0, prompts_1.promptAsync)({
@@ -8,7 +8,6 @@ const EasCommand_1 = (0, tslib_1.__importDefault)(require("../../commandUtils/Ea
8
8
  const EnvironmentSecretMutation_1 = require("../../graphql/mutations/EnvironmentSecretMutation");
9
9
  const EnvironmentSecretsQuery_1 = require("../../graphql/queries/EnvironmentSecretsQuery");
10
10
  const log_1 = (0, tslib_1.__importDefault)(require("../../log"));
11
- const isEasEnabledForProject_1 = require("../../project/isEasEnabledForProject");
12
11
  const projectUtils_1 = require("../../project/projectUtils");
13
12
  const prompts_1 = require("../../prompts");
14
13
  class EnvironmentSecretDelete extends EasCommand_1.default {
@@ -17,11 +16,6 @@ class EnvironmentSecretDelete extends EasCommand_1.default {
17
16
  const { exp } = (0, config_1.getConfig)(projectDir, { skipSDKVersionRequirement: true });
18
17
  const projectId = await (0, projectUtils_1.getProjectIdAsync)(exp);
19
18
  const projectAccountName = await (0, projectUtils_1.getProjectAccountNameAsync)(exp);
20
- if (!(await (0, isEasEnabledForProject_1.isEasEnabledForProjectAsync)(projectId))) {
21
- (0, isEasEnabledForProject_1.warnEasUnavailable)();
22
- process.exitCode = 1;
23
- return;
24
- }
25
19
  let { flags: { id }, } = this.parse(EnvironmentSecretDelete);
26
20
  let secret;
27
21
  if (!id) {
@@ -59,7 +53,7 @@ class EnvironmentSecretDelete extends EasCommand_1.default {
59
53
  }
60
54
  exports.default = EnvironmentSecretDelete;
61
55
  EnvironmentSecretDelete.description = `Delete an environment secret by ID.
62
- Unsure where to find the secret's ID? Run ${chalk_1.default.bold('eas secrets:list')}`;
56
+ Unsure where to find the secret's ID? Run ${chalk_1.default.bold('eas secret:list')}`;
63
57
  EnvironmentSecretDelete.flags = {
64
58
  id: command_1.flags.string({
65
59
  description: 'ID of the secret to delete',
@@ -8,7 +8,6 @@ const dateformat_1 = (0, tslib_1.__importDefault)(require("dateformat"));
8
8
  const EasCommand_1 = (0, tslib_1.__importDefault)(require("../../commandUtils/EasCommand"));
9
9
  const EnvironmentSecretsQuery_1 = require("../../graphql/queries/EnvironmentSecretsQuery");
10
10
  const log_1 = (0, tslib_1.__importDefault)(require("../../log"));
11
- const isEasEnabledForProject_1 = require("../../project/isEasEnabledForProject");
12
11
  const projectUtils_1 = require("../../project/projectUtils");
13
12
  class EnvironmentSecretList extends EasCommand_1.default {
14
13
  async runAsync() {
@@ -16,11 +15,6 @@ class EnvironmentSecretList extends EasCommand_1.default {
16
15
  const { exp } = (0, config_1.getConfig)(projectDir, { skipSDKVersionRequirement: true });
17
16
  const projectId = await (0, projectUtils_1.getProjectIdAsync)(exp);
18
17
  const projectAccountName = await (0, projectUtils_1.getProjectAccountNameAsync)(exp);
19
- if (!(await (0, isEasEnabledForProject_1.isEasEnabledForProjectAsync)(projectId))) {
20
- (0, isEasEnabledForProject_1.warnEasUnavailable)();
21
- process.exitCode = 1;
22
- return;
23
- }
24
18
  if (!projectDir) {
25
19
  throw new Error("Please run this command inside your project's directory");
26
20
  }
@@ -2,7 +2,6 @@
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 eas_json_1 = require("@expo/eas-json");
6
5
  const command_1 = require("@oclif/command");
7
6
  const errors_1 = require("@oclif/errors");
8
7
  const chalk_1 = (0, tslib_1.__importDefault)(require("chalk"));
@@ -10,7 +9,6 @@ const EasCommand_1 = (0, tslib_1.__importDefault)(require("../commandUtils/EasCo
10
9
  const AppPlatform_1 = require("../graphql/types/AppPlatform");
11
10
  const log_1 = (0, tslib_1.__importStar)(require("../log"));
12
11
  const platform_1 = require("../platform");
13
- const isEasEnabledForProject_1 = require("../project/isEasEnabledForProject");
14
12
  const projectUtils_1 = require("../project/projectUtils");
15
13
  const context_1 = require("../submit/context");
16
14
  const submit_1 = require("../submit/submit");
@@ -23,19 +21,12 @@ class Submit extends EasCommand_1.default {
23
21
  const projectDir = await (0, projectUtils_1.findProjectRootAsync)();
24
22
  const { exp } = (0, config_1.getConfig)(projectDir, { skipSDKVersionRequirement: true });
25
23
  const projectId = await (0, projectUtils_1.getProjectIdAsync)(exp);
26
- if (!(await (0, isEasEnabledForProject_1.isEasEnabledForProjectAsync)(projectId))) {
27
- (0, isEasEnabledForProject_1.warnEasUnavailable)();
28
- process.exitCode = 1;
29
- return;
30
- }
31
24
  const platforms = (0, platform_1.toPlatforms)(flags.requestedPlatform);
32
- const easJsonReader = new eas_json_1.EasJsonReader(projectDir);
33
25
  const submissionProfiles = await (0, profiles_1.getProfilesAsync)({
26
+ type: 'submit',
27
+ projectDir,
34
28
  platforms,
35
29
  profileName: flags.profile,
36
- async readProfileAsync(platform, profileName) {
37
- return await easJsonReader.readSubmitProfileAsync(platform, profileName);
38
- },
39
30
  });
40
31
  const submissions = [];
41
32
  for (const submissionProfile of submissionProfiles) {
@@ -5,7 +5,7 @@ const eas_build_job_1 = require("@expo/eas-build-job");
5
5
  const eas_json_1 = require("@expo/eas-json");
6
6
  const nullthrows_1 = (0, tslib_1.__importDefault)(require("nullthrows"));
7
7
  const credentialsJsonReader = (0, tslib_1.__importStar)(require("../credentialsJson/read"));
8
- const SetupBuildCredentials_1 = require("./actions/SetupBuildCredentials");
8
+ const SetUpBuildCredentials_1 = require("./actions/SetUpBuildCredentials");
9
9
  class AndroidCredentialsProvider {
10
10
  constructor(ctx, options) {
11
11
  this.ctx = ctx;
@@ -21,7 +21,7 @@ class AndroidCredentialsProvider {
21
21
  }
22
22
  }
23
23
  async getRemoteAsync() {
24
- const setupBuildCredentialsAction = new SetupBuildCredentials_1.SetupBuildCredentials({ app: this.options.app });
24
+ const setupBuildCredentialsAction = new SetUpBuildCredentials_1.SetUpBuildCredentials({ app: this.options.app });
25
25
  const buildCredentials = await setupBuildCredentialsAction.runAsync(this.ctx);
26
26
  return this.toAndroidCredentials(buildCredentials);
27
27
  }
@@ -11,23 +11,23 @@ class RemoveFcm {
11
11
  }
12
12
  async runAsync(ctx) {
13
13
  if (ctx.nonInteractive) {
14
- throw new Error("Deleting an FCM Api Key is a destructive operation. Start the CLI without the '--non-interactive' flag to delete the credentials.");
14
+ throw new Error("Deleting an FCM API Key is a destructive operation. Start the CLI without the '--non-interactive' flag to delete the credentials.");
15
15
  }
16
16
  const appCredentials = await ctx.android.getAndroidAppCredentialsWithCommonFieldsAsync(this.app);
17
17
  const fcm = appCredentials === null || appCredentials === void 0 ? void 0 : appCredentials.androidFcm;
18
18
  if (!fcm) {
19
- log_1.default.warn(`There is no valid FCM Api Key defined for ${(0, GraphqlClient_1.formatProjectFullName)(this.app)}, ${this.app.androidApplicationIdentifier}`);
19
+ log_1.default.warn(`There is no valid FCM API Key defined for ${(0, GraphqlClient_1.formatProjectFullName)(this.app)}, ${this.app.androidApplicationIdentifier}`);
20
20
  return;
21
21
  }
22
22
  const confirm = await (0, prompts_1.confirmAsync)({
23
- message: 'Permanently delete the FCM Api Key from Expo servers?',
23
+ message: 'Permanently delete the FCM API Key from Expo servers?',
24
24
  initial: false,
25
25
  });
26
26
  if (!confirm) {
27
27
  return;
28
28
  }
29
29
  await ctx.android.deleteFcmAsync(fcm);
30
- log_1.default.succeed('FCM Api Key removed');
30
+ log_1.default.succeed('FCM API Key removed');
31
31
  }
32
32
  }
33
33
  exports.RemoveFcm = RemoveFcm;
@@ -9,7 +9,7 @@ interface Options {
9
9
  * Sets up Build Credentials for Android
10
10
  * @name: sets up build credentials for the specified configuration. If no name is specified, the default configuration is setup
11
11
  */
12
- export declare class SetupBuildCredentials {
12
+ export declare class SetUpBuildCredentials {
13
13
  private options;
14
14
  constructor(options: Options);
15
15
  runAsync(ctx: CredentialsContext): Promise<AndroidAppBuildCredentialsFragment>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SetupBuildCredentials = void 0;
3
+ exports.SetUpBuildCredentials = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const nullthrows_1 = (0, tslib_1.__importDefault)(require("nullthrows"));
6
6
  const log_1 = (0, tslib_1.__importDefault)(require("../../../log"));
@@ -12,7 +12,7 @@ const CreateKeystore_1 = require("./CreateKeystore");
12
12
  * Sets up Build Credentials for Android
13
13
  * @name: sets up build credentials for the specified configuration. If no name is specified, the default configuration is setup
14
14
  */
15
- class SetupBuildCredentials {
15
+ class SetUpBuildCredentials {
16
16
  constructor(options) {
17
17
  this.options = options;
18
18
  }
@@ -74,4 +74,4 @@ class SetupBuildCredentials {
74
74
  return null;
75
75
  }
76
76
  }
77
- exports.SetupBuildCredentials = SetupBuildCredentials;
77
+ exports.SetUpBuildCredentials = SetUpBuildCredentials;
@@ -1,7 +1,7 @@
1
1
  import { AndroidAppBuildCredentialsFragment } from '../../../graphql/generated';
2
2
  import { CredentialsContext } from '../../context';
3
3
  import { AppLookupParams } from '../api/GraphqlClient';
4
- export declare class SetupBuildCredentialsFromCredentialsJson {
4
+ export declare class SetUpBuildCredentialsFromCredentialsJson {
5
5
  private app;
6
6
  constructor(app: AppLookupParams);
7
7
  runAsync(ctx: CredentialsContext): Promise<AndroidAppBuildCredentialsFragment | null>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SetupBuildCredentialsFromCredentialsJson = void 0;
3
+ exports.SetUpBuildCredentialsFromCredentialsJson = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const generated_1 = require("../../../graphql/generated");
6
6
  const log_1 = (0, tslib_1.__importDefault)(require("../../../log"));
@@ -9,7 +9,7 @@ const read_1 = require("../../credentialsJson/read");
9
9
  const SelectAndroidBuildCredentials_1 = require("../../manager/SelectAndroidBuildCredentials");
10
10
  const keystoreNew_1 = require("../utils/keystoreNew");
11
11
  const DownloadKeystore_1 = require("./DownloadKeystore");
12
- class SetupBuildCredentialsFromCredentialsJson {
12
+ class SetUpBuildCredentialsFromCredentialsJson {
13
13
  constructor(app) {
14
14
  this.app = app;
15
15
  }
@@ -65,4 +65,4 @@ class SetupBuildCredentialsFromCredentialsJson {
65
65
  return buildCredentials;
66
66
  }
67
67
  }
68
- exports.SetupBuildCredentialsFromCredentialsJson = SetupBuildCredentialsFromCredentialsJson;
68
+ exports.SetUpBuildCredentialsFromCredentialsJson = SetUpBuildCredentialsFromCredentialsJson;
@@ -1,7 +1,7 @@
1
1
  import { CommonAndroidAppCredentialsFragment } from '../../../graphql/generated';
2
2
  import { CredentialsContext } from '../../context';
3
3
  import { AppLookupParams } from '../api/GraphqlClient';
4
- export declare class SetupGoogleServiceAccountKey {
4
+ export declare class SetUpGoogleServiceAccountKey {
5
5
  private app;
6
6
  constructor(app: AppLookupParams);
7
7
  runAsync(ctx: CredentialsContext): Promise<CommonAndroidAppCredentialsFragment>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SetupGoogleServiceAccountKey = void 0;
3
+ exports.SetUpGoogleServiceAccountKey = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const nullthrows_1 = (0, tslib_1.__importDefault)(require("nullthrows"));
6
6
  const log_1 = (0, tslib_1.__importDefault)(require("../../../log"));
@@ -9,7 +9,7 @@ const errors_1 = require("../../errors");
9
9
  const AssignGoogleServiceAccountKey_1 = require("./AssignGoogleServiceAccountKey");
10
10
  const CreateGoogleServiceAccountKey_1 = require("./CreateGoogleServiceAccountKey");
11
11
  const UseExistingGoogleServiceAccountKey_1 = require("./UseExistingGoogleServiceAccountKey");
12
- class SetupGoogleServiceAccountKey {
12
+ class SetUpGoogleServiceAccountKey {
13
13
  constructor(app) {
14
14
  this.app = app;
15
15
  }
@@ -56,4 +56,4 @@ class SetupGoogleServiceAccountKey {
56
56
  return ((_a = (await new UseExistingGoogleServiceAccountKey_1.UseExistingGoogleServiceAccountKey(this.app.account).runAsync(ctx))) !== null && _a !== void 0 ? _a : (await this.createOrUseExistingKeyAsync(ctx)));
57
57
  }
58
58
  }
59
- exports.SetupGoogleServiceAccountKey = SetupGoogleServiceAccountKey;
59
+ exports.SetUpGoogleServiceAccountKey = SetUpGoogleServiceAccountKey;