eas-cli 8.0.0 → 9.0.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 (78) hide show
  1. package/README.md +62 -60
  2. package/build/build/android/build.js +1 -0
  3. package/build/build/android/graphql.js +0 -1
  4. package/build/build/android/prepareJob.js +0 -2
  5. package/build/build/android/syncProjectConfiguration.d.ts +3 -1
  6. package/build/build/android/syncProjectConfiguration.js +2 -2
  7. package/build/build/createContext.d.ts +2 -1
  8. package/build/build/createContext.js +2 -1
  9. package/build/build/ios/build.js +1 -0
  10. package/build/build/ios/graphql.js +0 -1
  11. package/build/build/ios/prepareJob.js +0 -2
  12. package/build/build/ios/syncProjectConfiguration.d.ts +3 -1
  13. package/build/build/ios/syncProjectConfiguration.js +2 -2
  14. package/build/build/local.js +1 -1
  15. package/build/build/metadata.js +11 -25
  16. package/build/build/runBuildAndSubmit.d.ts +1 -0
  17. package/build/build/runBuildAndSubmit.js +4 -3
  18. package/build/build/utils/formatBuild.js +0 -4
  19. package/build/commandUtils/context/contextUtils/getProjectIdAsync.d.ts +11 -0
  20. package/build/commandUtils/context/contextUtils/getProjectIdAsync.js +8 -3
  21. package/build/commands/build/configure.js +8 -2
  22. package/build/commands/build/index.d.ts +1 -0
  23. package/build/commands/build/index.js +5 -0
  24. package/build/commands/build/inspect.js +1 -0
  25. package/build/commands/build/internal.js +1 -0
  26. package/build/commands/credentials/configure-build.js +1 -1
  27. package/build/commands/project/onboarding.d.ts +15 -0
  28. package/build/commands/project/onboarding.js +154 -0
  29. package/build/commands/update/configure.js +1 -0
  30. package/build/commands/update/index.js +2 -0
  31. package/build/commands/update/roll-back-to-embedded.js +2 -0
  32. package/build/credentials/context.d.ts +2 -0
  33. package/build/credentials/context.js +3 -1
  34. package/build/credentials/errors.d.ts +6 -0
  35. package/build/credentials/errors.js +14 -1
  36. package/build/credentials/ios/actions/ConfigureProvisioningProfile.js +9 -4
  37. package/build/credentials/ios/actions/CreateProvisioningProfile.d.ts +1 -0
  38. package/build/credentials/ios/actions/CreateProvisioningProfile.js +22 -5
  39. package/build/credentials/ios/actions/SetUpProvisioningProfile.js +17 -5
  40. package/build/credentials/manager/SetUpBuildCredentialsCommandAction.d.ts +2 -1
  41. package/build/credentials/manager/SetUpBuildCredentialsCommandAction.js +4 -3
  42. package/build/credentials/manager/SetUpIosBuildCredentials.js +1 -1
  43. package/build/graphql/generated.d.ts +648 -184
  44. package/build/graphql/generated.js +63 -17
  45. package/build/graphql/mutations/UserPreferencesMutation.d.ts +9 -0
  46. package/build/graphql/mutations/UserPreferencesMutation.js +44 -0
  47. package/build/graphql/queries/UserQuery.js +10 -0
  48. package/build/graphql/types/App.js +7 -0
  49. package/build/graphql/types/Build.js +0 -1
  50. package/build/onboarding/git.d.ts +10 -0
  51. package/build/onboarding/git.js +57 -0
  52. package/build/onboarding/installDependencies.d.ts +3 -0
  53. package/build/onboarding/installDependencies.js +20 -0
  54. package/build/onboarding/runCommand.d.ts +7 -0
  55. package/build/onboarding/runCommand.js +41 -0
  56. package/build/project/projectUtils.d.ts +0 -1
  57. package/build/project/projectUtils.js +1 -12
  58. package/build/project/publish.d.ts +3 -2
  59. package/build/project/publish.js +4 -10
  60. package/build/project/resolveRuntimeVersionAsync.d.ts +3 -2
  61. package/build/project/resolveRuntimeVersionAsync.js +2 -9
  62. package/build/rollout/actions/CreateRollout.js +1 -0
  63. package/build/update/android/UpdatesModule.d.ts +7 -3
  64. package/build/update/android/UpdatesModule.js +3 -19
  65. package/build/update/configure.d.ts +3 -2
  66. package/build/update/configure.js +17 -5
  67. package/build/update/ios/UpdatesModule.d.ts +8 -3
  68. package/build/update/ios/UpdatesModule.js +3 -20
  69. package/build/update/utils.d.ts +0 -2
  70. package/build/update/utils.js +2 -22
  71. package/build/utils/expoUpdatesCli.d.ts +4 -1
  72. package/build/utils/expoUpdatesCli.js +5 -2
  73. package/build/vcs/clients/git.d.ts +2 -0
  74. package/build/vcs/clients/git.js +52 -27
  75. package/build/vcs/git.d.ts +6 -4
  76. package/build/vcs/git.js +13 -6
  77. package/oclif.manifest.json +30 -1
  78. package/package.json +5 -5
@@ -4,10 +4,11 @@ exports.ConfigureProvisioningProfile = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const assert_1 = tslib_1.__importDefault(require("assert"));
6
6
  const chalk_1 = tslib_1.__importDefault(require("chalk"));
7
- const log_1 = tslib_1.__importDefault(require("../../../log"));
7
+ const log_1 = tslib_1.__importStar(require("../../../log"));
8
8
  const ora_1 = require("../../../ora");
9
9
  const target_1 = require("../../../project/ios/target");
10
10
  const errors_1 = require("../../errors");
11
+ const authenticateTypes_1 = require("../appstore/authenticateTypes");
11
12
  class ConfigureProvisioningProfile {
12
13
  constructor(app, target, distributionCertificate, originalProvisioningProfile) {
13
14
  this.app = app;
@@ -16,8 +17,12 @@ class ConfigureProvisioningProfile {
16
17
  this.originalProvisioningProfile = originalProvisioningProfile;
17
18
  }
18
19
  async runAsync(ctx) {
19
- if (ctx.nonInteractive) {
20
- throw new errors_1.MissingCredentialsNonInteractiveError('Configuring Provisioning Profiles is only supported in interactive mode.');
20
+ if (ctx.freezeCredentials) {
21
+ throw new errors_1.ForbidCredentialModificationError('Remove the --freeze-credentials flag to configure a Provisioning Profile.');
22
+ }
23
+ else if (ctx.nonInteractive &&
24
+ ctx.appStore.defaultAuthenticationMode !== authenticateTypes_1.AuthenticationMode.API_KEY) {
25
+ throw new errors_1.InsufficientAuthenticationNonInteractiveError(`In order to configure your Provisioning Profile, authentication with an ASC API key is required in non-interactive mode. ${(0, log_1.learnMore)('https://docs.expo.dev/build/building-on-ci/#optional-provide-an-asc-api-token-for-your-apple-team')}`);
21
26
  }
22
27
  const { developerPortalIdentifier, provisioningProfile } = this.originalProvisioningProfile;
23
28
  if (!developerPortalIdentifier && !provisioningProfile) {
@@ -29,7 +34,7 @@ class ConfigureProvisioningProfile {
29
34
  log_1.default.warn('Make sure to recreate the profile if you selected a new distribution certificate.');
30
35
  return null;
31
36
  }
32
- const applePlatform = await (0, target_1.getApplePlatformFromTarget)(this.target);
37
+ const applePlatform = (0, target_1.getApplePlatformFromTarget)(this.target);
33
38
  const profilesFromApple = await ctx.appStore.listProvisioningProfilesAsync(this.app.bundleIdentifier, applePlatform);
34
39
  const [matchingProfile] = profilesFromApple.filter(appleInfo => developerPortalIdentifier
35
40
  ? appleInfo.provisioningProfileId === developerPortalIdentifier
@@ -9,5 +9,6 @@ export declare class CreateProvisioningProfile {
9
9
  private distributionCertificate;
10
10
  constructor(app: AppLookupParams, target: Target, distributionCertificate: AppleDistributionCertificateFragment);
11
11
  runAsync(ctx: CredentialsContext): Promise<AppleProvisioningProfileMutationResult>;
12
+ private maybeGetUserProvidedAsync;
12
13
  private provideOrGenerateAsync;
13
14
  }
@@ -6,9 +6,10 @@ const assert_1 = tslib_1.__importDefault(require("assert"));
6
6
  const nullthrows_1 = tslib_1.__importDefault(require("nullthrows"));
7
7
  const AppleTeamUtils_1 = require("./AppleTeamUtils");
8
8
  const ProvisioningProfileUtils_1 = require("./ProvisioningProfileUtils");
9
- const log_1 = tslib_1.__importDefault(require("../../../log"));
9
+ const log_1 = tslib_1.__importStar(require("../../../log"));
10
10
  const errors_1 = require("../../errors");
11
11
  const promptForCredentials_1 = require("../../utils/promptForCredentials");
12
+ const authenticateTypes_1 = require("../appstore/authenticateTypes");
12
13
  const credentials_1 = require("../credentials");
13
14
  class CreateProvisioningProfile {
14
15
  constructor(app, target, distributionCertificate) {
@@ -17,8 +18,12 @@ class CreateProvisioningProfile {
17
18
  this.distributionCertificate = distributionCertificate;
18
19
  }
19
20
  async runAsync(ctx) {
20
- if (ctx.nonInteractive) {
21
- throw new errors_1.MissingCredentialsNonInteractiveError('Creating Provisioning Profiles is only supported in interactive mode.');
21
+ if (ctx.freezeCredentials) {
22
+ throw new errors_1.ForbidCredentialModificationError('Run this command again without the --freeze-credentials flag in order to generate a new Provisioning Profile.');
23
+ }
24
+ else if (ctx.nonInteractive &&
25
+ ctx.appStore.defaultAuthenticationMode !== authenticateTypes_1.AuthenticationMode.API_KEY) {
26
+ throw new errors_1.InsufficientAuthenticationNonInteractiveError(`In order to generate a new Provisioning Profile, authentication with an ASC API key is required in non-interactive mode. ${(0, log_1.learnMore)('https://docs.expo.dev/build/building-on-ci/#optional-provide-an-asc-api-token-for-your-apple-team')}`);
22
27
  }
23
28
  const appleAuthCtx = await ctx.appStore.ensureAuthenticatedAsync();
24
29
  const provisioningProfile = await this.provideOrGenerateAsync(ctx, appleAuthCtx);
@@ -31,14 +36,26 @@ class CreateProvisioningProfile {
31
36
  log_1.default.succeed('Created provisioning profile');
32
37
  return provisioningProfileMutationResult;
33
38
  }
34
- async provideOrGenerateAsync(ctx, appleAuthCtx) {
35
- var _a, _b, _c;
39
+ async maybeGetUserProvidedAsync(ctx) {
40
+ if (ctx.nonInteractive) {
41
+ return null;
42
+ }
36
43
  const userProvided = await (0, promptForCredentials_1.askForUserProvidedAsync)(credentials_1.provisioningProfileSchema);
37
44
  if (userProvided) {
38
45
  // userProvided profiles don't come with ProvisioningProfileId's (only accessible from Apple Portal API)
39
46
  log_1.default.warn('Provisioning profile: Unable to validate specified profile.');
40
47
  return userProvided;
41
48
  }
49
+ return null;
50
+ }
51
+ async provideOrGenerateAsync(ctx, appleAuthCtx) {
52
+ var _a, _b, _c;
53
+ const maybeUserProvided = await this.maybeGetUserProvidedAsync(ctx);
54
+ if (maybeUserProvided) {
55
+ // userProvided profiles don't come with ProvisioningProfileId's (only accessible from Apple Portal API)
56
+ log_1.default.warn('Provisioning profile: Unable to validate specified profile.');
57
+ return maybeUserProvided;
58
+ }
42
59
  (0, assert_1.default)(this.distributionCertificate.certificateP12, 'Distribution Certificate must have p12 certificate');
43
60
  (0, assert_1.default)(this.distributionCertificate.certificatePassword, 'Distribution Certificate must have certificate password');
44
61
  return await (0, ProvisioningProfileUtils_1.generateProvisioningProfileAsync)(ctx, this.target, this.app.bundleIdentifier, {
@@ -8,9 +8,11 @@ const ConfigureProvisioningProfile_1 = require("./ConfigureProvisioningProfile")
8
8
  const CreateProvisioningProfile_1 = require("./CreateProvisioningProfile");
9
9
  const ProvisioningProfileUtils_1 = require("./ProvisioningProfileUtils");
10
10
  const SetUpDistributionCertificate_1 = require("./SetUpDistributionCertificate");
11
+ const log_1 = require("../../../log");
11
12
  const target_1 = require("../../../project/ios/target");
12
13
  const prompts_1 = require("../../../prompts");
13
14
  const errors_1 = require("../../errors");
15
+ const authenticateTypes_1 = require("../appstore/authenticateTypes");
14
16
  const validateProvisioningProfile_1 = require("../validators/validateProvisioningProfile");
15
17
  /**
16
18
  * Sets up either APP_STORE or ENTERPRISE provisioning profiles
@@ -49,8 +51,12 @@ class SetUpProvisioningProfile {
49
51
  if (areBuildCredentialsSetup) {
50
52
  return (0, nullthrows_1.default)(await (0, BuildCredentialsUtils_1.getBuildCredentialsAsync)(ctx, this.app, this.distributionType));
51
53
  }
52
- if (ctx.nonInteractive) {
53
- throw new errors_1.MissingCredentialsNonInteractiveError('Provisioning profile is not configured correctly. Run this command again in interactive mode.');
54
+ if (ctx.freezeCredentials) {
55
+ throw new errors_1.ForbidCredentialModificationError('Provisioning profile is not configured correctly. Remove the --freeze-credentials flag to configure it.');
56
+ }
57
+ else if (ctx.nonInteractive &&
58
+ ctx.appStore.defaultAuthenticationMode !== authenticateTypes_1.AuthenticationMode.API_KEY) {
59
+ throw new errors_1.InsufficientAuthenticationNonInteractiveError(`In order to configure your Provisioning Profile, authentication with an ASC API key is required in non-interactive mode. ${(0, log_1.learnMore)('https://docs.expo.dev/build/building-on-ci/#optional-provide-an-asc-api-token-for-your-apple-team')}`);
54
60
  }
55
61
  const currentProfile = await (0, BuildCredentialsUtils_1.getProvisioningProfileAsync)(ctx, this.app, this.distributionType);
56
62
  if (!currentProfile) {
@@ -63,9 +69,15 @@ class SetUpProvisioningProfile {
63
69
  if (!currentProfileFromServer) {
64
70
  return await this.assignNewAndDeleteOldProfileAsync(ctx, distCert, currentProfile);
65
71
  }
66
- const confirm = await (0, prompts_1.confirmAsync)({
67
- message: `${(0, ProvisioningProfileUtils_1.formatProvisioningProfileFromApple)(currentProfileFromServer)} \n Would you like to reuse the original profile?`,
68
- });
72
+ const isNonInteractiveOrUserDidConfirmAsync = async () => {
73
+ if (ctx.nonInteractive) {
74
+ return true;
75
+ }
76
+ return await (0, prompts_1.confirmAsync)({
77
+ message: `${(0, ProvisioningProfileUtils_1.formatProvisioningProfileFromApple)(currentProfileFromServer)} \n Would you like to reuse the original profile?`,
78
+ });
79
+ };
80
+ const confirm = await isNonInteractiveOrUserDidConfirmAsync();
69
81
  if (!confirm) {
70
82
  return await this.assignNewAndDeleteOldProfileAsync(ctx, distCert, currentProfile);
71
83
  }
@@ -14,6 +14,7 @@ export declare class SetUpBuildCredentialsCommandAction {
14
14
  readonly getDynamicPrivateProjectConfigAsync: DynamicConfigContextFn;
15
15
  private readonly platform;
16
16
  private readonly profileName;
17
- constructor(actor: Actor, graphqlClient: ExpoGraphqlClient, vcsClient: Client, analytics: Analytics, projectInfo: CredentialsContextProjectInfo | null, getDynamicPrivateProjectConfigAsync: DynamicConfigContextFn, platform: Platform, profileName: string);
17
+ private readonly projectDir;
18
+ constructor(actor: Actor, graphqlClient: ExpoGraphqlClient, vcsClient: Client, analytics: Analytics, projectInfo: CredentialsContextProjectInfo | null, getDynamicPrivateProjectConfigAsync: DynamicConfigContextFn, platform: Platform, profileName: string, projectDir: string);
18
19
  runAsync(): Promise<void>;
19
20
  }
@@ -5,7 +5,7 @@ const eas_build_job_1 = require("@expo/eas-build-job");
5
5
  const SetUpAndroidBuildCredentials_1 = require("../manager/SetUpAndroidBuildCredentials");
6
6
  const SetUpIosBuildCredentials_1 = require("../manager/SetUpIosBuildCredentials");
7
7
  class SetUpBuildCredentialsCommandAction {
8
- constructor(actor, graphqlClient, vcsClient, analytics, projectInfo, getDynamicPrivateProjectConfigAsync, platform, profileName) {
8
+ constructor(actor, graphqlClient, vcsClient, analytics, projectInfo, getDynamicPrivateProjectConfigAsync, platform, profileName, projectDir) {
9
9
  this.actor = actor;
10
10
  this.graphqlClient = graphqlClient;
11
11
  this.vcsClient = vcsClient;
@@ -14,12 +14,13 @@ class SetUpBuildCredentialsCommandAction {
14
14
  this.getDynamicPrivateProjectConfigAsync = getDynamicPrivateProjectConfigAsync;
15
15
  this.platform = platform;
16
16
  this.profileName = profileName;
17
+ this.projectDir = projectDir;
17
18
  }
18
19
  async runAsync() {
19
20
  if (this.platform === eas_build_job_1.Platform.IOS) {
20
- return await new SetUpIosBuildCredentials_1.SetUpIosBuildCredentials(this, process.cwd(), this.profileName).runAsync();
21
+ return await new SetUpIosBuildCredentials_1.SetUpIosBuildCredentials(this, this.projectDir, this.profileName).runAsync();
21
22
  }
22
- return await new SetUpAndroidBuildCredentials_1.SetUpAndroidBuildCredentials(this, process.cwd(), this.profileName).runAsync();
23
+ return await new SetUpAndroidBuildCredentials_1.SetUpAndroidBuildCredentials(this, this.projectDir, this.profileName).runAsync();
23
24
  }
24
25
  }
25
26
  exports.SetUpBuildCredentialsCommandAction = SetUpBuildCredentialsCommandAction;
@@ -28,7 +28,7 @@ class SetUpIosBuildCredentials extends ManageIos_1.ManageIos {
28
28
  projectInfo = { exp, projectId };
29
29
  }
30
30
  const ctx = new context_1.CredentialsContext({
31
- projectDir: process.cwd(),
31
+ projectDir: this.projectDir,
32
32
  projectInfo,
33
33
  user: this.callingAction.actor,
34
34
  graphqlClient: this.callingAction.graphqlClient,