eas-cli 8.0.0 → 9.0.1

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 +168 -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 +10 -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 +49 -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 +23 -6
  77. package/oclif.manifest.json +30 -1
  78. package/package.json +5 -5
@@ -11,7 +11,6 @@ function transformJob(job) {
11
11
  triggeredBy: (0, graphql_1.transformBuildTrigger)(job.triggeredBy),
12
12
  projectArchive: (0, graphql_1.transformProjectArchive)(job.projectArchive),
13
13
  projectRootDirectory: (0, nullthrows_1.default)(job.projectRootDirectory),
14
- releaseChannel: job.releaseChannel,
15
14
  updates: job.updates,
16
15
  secrets: job.secrets ? transformIosSecrets(job.secrets) : undefined,
17
16
  builderEnvironment: job.builderEnvironment,
@@ -41,7 +41,6 @@ async function prepareJobAsync(ctx, jobData) {
41
41
  bundler: buildProfile.bundler,
42
42
  cocoapods: buildProfile.cocoapods,
43
43
  fastlane: buildProfile.fastlane,
44
- expoCli: buildProfile.expoCli,
45
44
  env: buildProfile.env,
46
45
  },
47
46
  cache: {
@@ -52,7 +51,6 @@ async function prepareJobAsync(ctx, jobData) {
52
51
  secrets: {
53
52
  buildCredentials,
54
53
  },
55
- releaseChannel: buildProfile.releaseChannel,
56
54
  updates: { channel: buildProfile.channel },
57
55
  developmentClient: buildProfile.developmentClient,
58
56
  simulator: buildProfile.simulator,
@@ -1,11 +1,13 @@
1
1
  import { ExpoConfig } from '@expo/config';
2
+ import { Env } from '@expo/eas-build-job';
2
3
  import { IosVersionAutoIncrement } from '@expo/eas-json';
3
4
  import { Target } from '../../credentials/ios/types';
4
5
  import { Client } from '../../vcs/vcs';
5
- export declare function syncProjectConfigurationAsync({ projectDir, exp, targets, localAutoIncrement, vcsClient, }: {
6
+ export declare function syncProjectConfigurationAsync({ projectDir, exp, targets, localAutoIncrement, vcsClient, env, }: {
6
7
  projectDir: string;
7
8
  exp: ExpoConfig;
8
9
  targets: Target[];
9
10
  localAutoIncrement?: IosVersionAutoIncrement;
10
11
  vcsClient: Client;
12
+ env: Env | undefined;
11
13
  }): Promise<void>;
@@ -6,12 +6,12 @@ const version_1 = require("./version");
6
6
  const projectUtils_1 = require("../../project/projectUtils");
7
7
  const workflow_1 = require("../../project/workflow");
8
8
  const UpdatesModule_1 = require("../../update/ios/UpdatesModule");
9
- async function syncProjectConfigurationAsync({ projectDir, exp, targets, localAutoIncrement, vcsClient, }) {
9
+ async function syncProjectConfigurationAsync({ projectDir, exp, targets, localAutoIncrement, vcsClient, env, }) {
10
10
  const workflow = await (0, workflow_1.resolveWorkflowAsync)(projectDir, eas_build_job_1.Platform.IOS, vcsClient);
11
11
  const versionBumpStrategy = resolveVersionBumpStrategy(localAutoIncrement !== null && localAutoIncrement !== void 0 ? localAutoIncrement : false);
12
12
  if (workflow === eas_build_job_1.Workflow.GENERIC) {
13
13
  if ((0, projectUtils_1.isExpoUpdatesInstalled)(projectDir)) {
14
- await (0, UpdatesModule_1.syncUpdatesConfigurationAsync)(vcsClient, projectDir, exp, workflow);
14
+ await (0, UpdatesModule_1.syncUpdatesConfigurationAsync)({ vcsClient, projectDir, exp, workflow, env });
15
15
  }
16
16
  await (0, version_1.bumpVersionAsync)({ projectDir, exp, bumpStrategy: versionBumpStrategy, targets });
17
17
  }
@@ -6,7 +6,7 @@ const spawn_async_1 = tslib_1.__importDefault(require("@expo/spawn-async"));
6
6
  const semver_1 = tslib_1.__importDefault(require("semver"));
7
7
  const ora_1 = require("../ora");
8
8
  const PLUGIN_PACKAGE_NAME = 'eas-cli-local-build-plugin';
9
- const PLUGIN_PACKAGE_VERSION = '1.0.102';
9
+ const PLUGIN_PACKAGE_VERSION = '1.0.107';
10
10
  var LocalBuildMode;
11
11
  (function (LocalBuildMode) {
12
12
  /**
@@ -17,7 +17,7 @@ const UpdatesModule_2 = require("../update/ios/UpdatesModule");
17
17
  const easCli_1 = require("../utils/easCli");
18
18
  async function collectMetadataAsync(ctx) {
19
19
  var _a, _b, _c, _d, _e;
20
- const channelOrReleaseChannel = await resolveChannelOrReleaseChannelAsync(ctx);
20
+ const channelObject = await resolveChannelAsync(ctx);
21
21
  const distribution = (_a = ctx.buildProfile.distribution) !== null && _a !== void 0 ? _a : types_1.BuildDistributionType.STORE;
22
22
  const metadata = {
23
23
  trackingContext: ctx.analyticsEventProperties,
@@ -26,9 +26,15 @@ async function collectMetadataAsync(ctx) {
26
26
  workflow: ctx.workflow,
27
27
  credentialsSource: ctx.buildProfile.credentialsSource,
28
28
  sdkVersion: ctx.exp.sdkVersion,
29
- runtimeVersion: (_b = (await (0, resolveRuntimeVersionAsync_1.resolveRuntimeVersionAsync)(ctx))) !== null && _b !== void 0 ? _b : undefined,
29
+ runtimeVersion: (_b = (await (0, resolveRuntimeVersionAsync_1.resolveRuntimeVersionAsync)({
30
+ exp: ctx.exp,
31
+ platform: ctx.platform,
32
+ workflow: ctx.workflow,
33
+ projectDir: ctx.projectDir,
34
+ env: ctx.buildProfile.env,
35
+ }))) !== null && _b !== void 0 ? _b : undefined,
30
36
  reactNativeVersion: await getReactNativeVersionAsync(ctx.projectDir),
31
- ...channelOrReleaseChannel,
37
+ ...channelObject,
32
38
  distribution,
33
39
  appName: ctx.exp.name,
34
40
  appIdentifier: resolveAppIdentifier(ctx),
@@ -90,7 +96,7 @@ function resolveAppIdentifier(ctx) {
90
96
  return ctx.android.applicationId;
91
97
  }
92
98
  }
93
- async function resolveChannelOrReleaseChannelAsync(ctx) {
99
+ async function resolveChannelAsync(ctx) {
94
100
  if (!(0, projectUtils_1.isExpoUpdatesInstalled)(ctx.projectDir)) {
95
101
  return null;
96
102
  }
@@ -101,27 +107,7 @@ async function resolveChannelOrReleaseChannelAsync(ctx) {
101
107
  if (channel) {
102
108
  return { channel };
103
109
  }
104
- if (!(await (0, projectUtils_1.isClassicUpdatesSupportedAsync)(ctx.projectDir))) {
105
- return null;
106
- }
107
- if (ctx.buildProfile.releaseChannel) {
108
- return { releaseChannel: ctx.buildProfile.releaseChannel };
109
- }
110
- const releaseChannel = await getNativeReleaseChannelAsync(ctx);
111
- return { releaseChannel };
112
- }
113
- async function getNativeReleaseChannelAsync(ctx) {
114
- var _a, _b;
115
- switch (ctx.platform) {
116
- case eas_build_job_1.Platform.ANDROID: {
117
- return (_a = (await (0, UpdatesModule_1.readReleaseChannelSafelyAsync)(ctx.projectDir))) !== null && _a !== void 0 ? _a : 'default';
118
- }
119
- case eas_build_job_1.Platform.IOS: {
120
- return (_b = (await (0, UpdatesModule_2.readReleaseChannelSafelyAsync)(ctx.projectDir))) !== null && _b !== void 0 ? _b : 'default';
121
- }
122
- default:
123
- return 'default';
124
- }
110
+ return null;
125
111
  }
126
112
  async function getNativeChannelAsync(ctx) {
127
113
  var _a, _b;
@@ -20,5 +20,6 @@ export interface BuildFlags {
20
20
  resourceClass?: ResourceClass;
21
21
  message?: string;
22
22
  buildLoggerLevel?: LoggerLevel;
23
+ freezeCredentials: boolean;
23
24
  }
24
25
  export declare function runBuildAndSubmitAsync(graphqlClient: ExpoGraphqlClient, analytics: Analytics, vcsClient: Client, projectDir: string, flags: BuildFlags, actor: Actor, getDynamicPrivateProjectConfigAsync: DynamicConfigContextFn): Promise<void>;
@@ -34,7 +34,6 @@ const context_1 = require("../submit/context");
34
34
  const submit_1 = require("../submit/submit");
35
35
  const urls_1 = require("../submit/utils/urls");
36
36
  const configure_2 = require("../update/configure");
37
- const utils_2 = require("../update/utils");
38
37
  const download_1 = require("../utils/download");
39
38
  const filter_1 = require("../utils/expodash/filter");
40
39
  const json_1 = require("../utils/json");
@@ -219,13 +218,13 @@ async function prepareAndStartBuildAsync({ projectDir, flags, moreBuilds, buildP
219
218
  getDynamicPrivateProjectConfigAsync,
220
219
  customBuildConfigMetadata,
221
220
  buildLoggerLevel: flags.buildLoggerLevel,
221
+ freezeCredentials: flags.freezeCredentials,
222
222
  });
223
223
  if (moreBuilds) {
224
224
  log_1.default.newLine();
225
225
  const appPlatform = (0, AppPlatform_1.toAppPlatform)(buildProfile.platform);
226
226
  log_1.default.log(`${platform_1.appPlatformEmojis[appPlatform]} ${chalk_1.default.bold(`${platform_1.appPlatformDisplayNames[appPlatform]} build`)}`);
227
227
  }
228
- await (0, utils_2.validateBuildProfileConfigMatchesProjectConfigAsync)(buildCtx.exp, buildProfile, buildCtx.projectId, flags.nonInteractive);
229
228
  if (buildProfile.profile.channel) {
230
229
  await validateExpoUpdatesInstalledAsProjectDependencyAsync({
231
230
  exp: buildCtx.exp,
@@ -235,6 +234,7 @@ async function prepareAndStartBuildAsync({ projectDir, flags, moreBuilds, buildP
235
234
  sdkVersion: buildCtx.exp.sdkVersion,
236
235
  nonInteractive: flags.nonInteractive,
237
236
  buildProfile,
237
+ env: buildProfile.profile.env,
238
238
  });
239
239
  if ((0, projectUtils_1.isUsingEASUpdate)(buildCtx.exp, buildCtx.projectId)) {
240
240
  const doesChannelExist = await (0, queries_1.doesChannelExistAsync)(graphqlClient, {
@@ -333,7 +333,7 @@ async function maybeDownloadAndRunSimulatorBuildsAsync(builds, flags) {
333
333
  }
334
334
  }
335
335
  }
336
- async function validateExpoUpdatesInstalledAsProjectDependencyAsync({ exp, projectId, projectDir, vcsClient, buildProfile, nonInteractive, sdkVersion, }) {
336
+ async function validateExpoUpdatesInstalledAsProjectDependencyAsync({ exp, projectId, projectDir, vcsClient, buildProfile, nonInteractive, sdkVersion, env, }) {
337
337
  if ((0, projectUtils_1.isExpoUpdatesInstalledOrAvailable)(projectDir, sdkVersion)) {
338
338
  return;
339
339
  }
@@ -355,6 +355,7 @@ async function validateExpoUpdatesInstalledAsProjectDependencyAsync({ exp, proje
355
355
  projectDir,
356
356
  platform: platform_1.RequestedPlatform.All,
357
357
  vcsClient,
358
+ env,
358
359
  });
359
360
  log_1.default.withTick('Installed expo-updates and configured EAS Update.');
360
361
  throw new Error('Command must be re-run to pick up new updates configuration.');
@@ -50,10 +50,6 @@ function formatGraphQLBuild(build) {
50
50
  label: 'Enterprise Provisioning',
51
51
  value: (_b = build.iosEnterpriseProvisioning) === null || _b === void 0 ? void 0 : _b.toLowerCase(),
52
52
  },
53
- {
54
- label: 'Release Channel',
55
- value: build.releaseChannel,
56
- },
57
53
  {
58
54
  label: 'Channel',
59
55
  value: build.channel,
@@ -1,6 +1,8 @@
1
1
  import { ExpoConfig } from '@expo/config-types';
2
2
  import { Env } from '@expo/eas-build-job';
3
+ import { ExpoGraphqlClient } from './createGraphqlClient';
3
4
  import SessionManager from '../../../user/SessionManager';
5
+ import { Actor } from '../../../user/User';
4
6
  /**
5
7
  * Save an EAS project ID to the appropriate field in the app config.
6
8
  *
@@ -23,3 +25,12 @@ export declare function getProjectIdAsync(sessionManager: SessionManager, exp: E
23
25
  env?: Env;
24
26
  nonInteractive: boolean;
25
27
  }): Promise<string>;
28
+ export declare function validateOrSetProjectIdAsync({ exp, graphqlClient, actor, options, }: {
29
+ exp: ExpoConfig;
30
+ graphqlClient: ExpoGraphqlClient;
31
+ actor: Actor;
32
+ options: {
33
+ env?: Env;
34
+ nonInteractive: boolean;
35
+ };
36
+ }): Promise<string>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getProjectIdAsync = exports.saveProjectIdToAppConfigAsync = void 0;
3
+ exports.validateOrSetProjectIdAsync = exports.getProjectIdAsync = exports.saveProjectIdToAppConfigAsync = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const config_1 = require("@expo/config");
6
6
  const chalk_1 = tslib_1.__importDefault(require("chalk"));
@@ -56,7 +56,6 @@ exports.saveProjectIdToAppConfigAsync = saveProjectIdToAppConfigAsync;
56
56
  * @deprecated Should not be used outside of context functions.
57
57
  */
58
58
  async function getProjectIdAsync(sessionManager, exp, options) {
59
- var _a, _b;
60
59
  // all codepaths in this function require a logged-in user with access to the owning account
61
60
  // since they either query the app via graphql or create it, which includes getting info about
62
61
  // the owner
@@ -64,6 +63,12 @@ async function getProjectIdAsync(sessionManager, exp, options) {
64
63
  nonInteractive: options.nonInteractive,
65
64
  });
66
65
  const graphqlClient = (0, createGraphqlClient_1.createGraphqlClient)(authenticationInfo);
66
+ const projectId = await validateOrSetProjectIdAsync({ exp, graphqlClient, actor, options });
67
+ return projectId;
68
+ }
69
+ exports.getProjectIdAsync = getProjectIdAsync;
70
+ async function validateOrSetProjectIdAsync({ exp, graphqlClient, actor, options, }) {
71
+ var _a, _b;
67
72
  const localProjectId = (_b = (_a = exp.extra) === null || _a === void 0 ? void 0 : _a.eas) === null || _b === void 0 ? void 0 : _b.projectId;
68
73
  if (localProjectId) {
69
74
  if (typeof localProjectId !== 'string') {
@@ -125,4 +130,4 @@ async function getProjectIdAsync(sessionManager, exp, options) {
125
130
  }
126
131
  return projectId;
127
132
  }
128
- exports.getProjectIdAsync = getProjectIdAsync;
133
+ exports.validateOrSetProjectIdAsync = validateOrSetProjectIdAsync;
@@ -47,13 +47,19 @@ class BuildConfigure extends EasCommand_1.default {
47
47
  if ([platform_1.RequestedPlatform.Android, platform_1.RequestedPlatform.All].includes(platform)) {
48
48
  const workflow = await (0, workflow_1.resolveWorkflowAsync)(projectDir, eas_build_job_1.Platform.ANDROID, vcsClient);
49
49
  if (workflow === eas_build_job_1.Workflow.GENERIC) {
50
- await (0, UpdatesModule_1.syncUpdatesConfigurationAsync)(projectDir, exp, workflow);
50
+ await (0, UpdatesModule_1.syncUpdatesConfigurationAsync)({ projectDir, exp, workflow, env: undefined });
51
51
  }
52
52
  }
53
53
  if ([platform_1.RequestedPlatform.Ios, platform_1.RequestedPlatform.All].includes(platform)) {
54
54
  const workflow = await (0, workflow_1.resolveWorkflowAsync)(projectDir, eas_build_job_1.Platform.IOS, vcsClient);
55
55
  if (workflow === eas_build_job_1.Workflow.GENERIC) {
56
- await (0, UpdatesModule_2.syncUpdatesConfigurationAsync)(vcsClient, projectDir, exp, workflow);
56
+ await (0, UpdatesModule_2.syncUpdatesConfigurationAsync)({
57
+ vcsClient,
58
+ projectDir,
59
+ exp,
60
+ workflow,
61
+ env: undefined,
62
+ });
57
63
  }
58
64
  }
59
65
  }
@@ -19,6 +19,7 @@ export default class Build extends EasCommand {
19
19
  'resource-class': import("@oclif/core/lib/interfaces").OptionFlag<ResourceClass | undefined>;
20
20
  message: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
21
21
  'build-logger-level': import("@oclif/core/lib/interfaces").OptionFlag<LoggerLevel | undefined>;
22
+ 'freeze-credentials': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
22
23
  };
23
24
  static contextDefinition: {
24
25
  vcsClient: import("../../commandUtils/context/VcsClientContextField").default;
@@ -89,6 +89,7 @@ class Build extends EasCommand_1.default {
89
89
  resourceClass: flags['resource-class'],
90
90
  message,
91
91
  buildLoggerLevel: flags['build-logger-level'],
92
+ freezeCredentials: flags['freeze-credentials'],
92
93
  };
93
94
  }
94
95
  async ensurePlatformSelectedAsync(flags) {
@@ -181,6 +182,10 @@ Build.flags = {
181
182
  description: 'The level of logs to output during the build process. Defaults to "info".',
182
183
  options: Object.values(logger_1.LoggerLevel),
183
184
  }),
185
+ 'freeze-credentials': core_1.Flags.boolean({
186
+ default: false,
187
+ description: 'Prevent the build from updating credentials in non-interactive mode',
188
+ }),
184
189
  ...flags_1.EasNonInteractiveAndJsonFlags,
185
190
  };
186
191
  Build.contextDefinition = {
@@ -45,6 +45,7 @@ class BuildInspect extends EasCommand_1.default {
45
45
  try {
46
46
  await (0, runBuildAndSubmit_1.runBuildAndSubmitAsync)(graphqlClient, analytics, vcsClient, projectDir, {
47
47
  nonInteractive: false,
48
+ freezeCredentials: false,
48
49
  wait: true,
49
50
  clearCache: false,
50
51
  json: false,
@@ -30,6 +30,7 @@ class BuildInternal extends EasCommand_1.default {
30
30
  requestedPlatform: flags.platform,
31
31
  profile: flags.profile,
32
32
  nonInteractive: true,
33
+ freezeCredentials: false,
33
34
  wait: false,
34
35
  clearCache: false,
35
36
  json: true,
@@ -17,7 +17,7 @@ class InitializeBuildCredentials extends EasCommand_1.default {
17
17
  });
18
18
  const platform = await (0, platform_1.selectPlatformAsync)(flags.platform);
19
19
  const buildProfile = (_b = flags.profile) !== null && _b !== void 0 ? _b : (await new SelectBuildProfileFromEasJson_1.SelectBuildProfileFromEasJson(privateProjectConfig.projectDir, eas_build_job_1.Platform.IOS).getProfileNameFromEasConfigAsync());
20
- await new SetUpBuildCredentialsCommandAction_1.SetUpBuildCredentialsCommandAction(actor, graphqlClient, vcsClient, analytics, privateProjectConfig !== null && privateProjectConfig !== void 0 ? privateProjectConfig : null, getDynamicPrivateProjectConfigAsync, platform, buildProfile).runAsync();
20
+ await new SetUpBuildCredentialsCommandAction_1.SetUpBuildCredentialsCommandAction(actor, graphqlClient, vcsClient, analytics, privateProjectConfig !== null && privateProjectConfig !== void 0 ? privateProjectConfig : null, getDynamicPrivateProjectConfigAsync, platform, buildProfile, process.cwd()).runAsync();
21
21
  }
22
22
  }
23
23
  _a = InitializeBuildCredentials;
@@ -0,0 +1,15 @@
1
+ import EasCommand from '../../commandUtils/EasCommand';
2
+ export default class Onboarding extends EasCommand {
3
+ static hidden: boolean;
4
+ static aliases: string[];
5
+ static description: string;
6
+ static flags: {};
7
+ static args: {
8
+ name: string;
9
+ }[];
10
+ static contextDefinition: {
11
+ analytics: import("../../commandUtils/context/AnalyticsContextField").default;
12
+ loggedIn: import("../../commandUtils/context/LoggedInContextField").default;
13
+ };
14
+ runAsync(): Promise<void>;
15
+ }
@@ -0,0 +1,168 @@
1
+ "use strict";
2
+ var _a;
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ const tslib_1 = require("tslib");
5
+ const eas_build_job_1 = require("@expo/eas-build-job");
6
+ const api_1 = require("../../api");
7
+ const repository_1 = require("../../build/utils/repository");
8
+ const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
9
+ const getProjectIdAsync_1 = require("../../commandUtils/context/contextUtils/getProjectIdAsync");
10
+ const SetUpBuildCredentialsCommandAction_1 = require("../../credentials/manager/SetUpBuildCredentialsCommandAction");
11
+ const generated_1 = require("../../graphql/generated");
12
+ const UserPreferencesMutation_1 = require("../../graphql/mutations/UserPreferencesMutation");
13
+ const AppQuery_1 = require("../../graphql/queries/AppQuery");
14
+ const log_1 = tslib_1.__importStar(require("../../log"));
15
+ const git_1 = require("../../onboarding/git");
16
+ const installDependencies_1 = require("../../onboarding/installDependencies");
17
+ const expoConfig_1 = require("../../project/expoConfig");
18
+ const prompts_1 = require("../../prompts");
19
+ const git_2 = tslib_1.__importDefault(require("../../vcs/clients/git"));
20
+ class Onboarding extends EasCommand_1.default {
21
+ async runAsync() {
22
+ const { args: { TARGET_PROJECT_DIRECTORY: targetProjectDirInput }, } = await this.parse(_a);
23
+ const { loggedIn: { actor, graphqlClient }, analytics, } = await this.getContextAsync(_a, {
24
+ nonInteractive: false,
25
+ });
26
+ if (actor.__typename === 'Robot') {
27
+ throw new Error('This command is not available for robot users. Make sure you are not using a robot token and try again.');
28
+ }
29
+ if (!actor.preferences.onboarding) {
30
+ throw new Error('This command can only be run as part of the onboarding process started on the Expo website. Visit https://expo.new to start a new project.');
31
+ }
32
+ if (!actor.preferences.onboarding.platform) {
33
+ throw new Error('This command can only be run as part of the onboarding process started on the Expo website. It seems like you started an onboarding process, but we are missing some information needed to be filled in before running the eas init:onboarding command (selected platform). Continue the onboarding process on the Expo website.');
34
+ }
35
+ if (!actor.preferences.onboarding.environment) {
36
+ throw new Error('This command can only be run as part of the onboarding process started on the Expo website. It seems like you started an onboarding process, but we are missing some information needed to be filled in before running the eas init:onboarding command (selected environment). Continue the onboarding process on the Expo website.');
37
+ }
38
+ if (!actor.preferences.onboarding.deviceType) {
39
+ throw new Error('This command can only be run as part of the onboarding process started on the Expo website. It seems like you started an onboarding process, but we are missing some information needed to be filled in before running the eas init:onboarding command (selected device type). Continue the onboarding process on the Expo website.');
40
+ }
41
+ if (new Date(actor.preferences.onboarding.lastUsed) < new Date(Date.now() - 1000 * 60 * 60 * 24)) {
42
+ log_1.default.warn('It seems like you started an onboarding process, but it has been a while since you last used it. If you want to start a new onboarding process, visit https://expo.new.');
43
+ log_1.default.log();
44
+ return;
45
+ }
46
+ const platform = actor.preferences.onboarding.platform === generated_1.AppPlatform.Android
47
+ ? eas_build_job_1.Platform.ANDROID
48
+ : eas_build_job_1.Platform.IOS;
49
+ const app = await AppQuery_1.AppQuery.byIdAsync(graphqlClient, actor.preferences.onboarding.appId);
50
+ const githubUsername = app.githubRepository
51
+ ? app.githubRepository.metadata.githubRepoOwnerName
52
+ : 'expo';
53
+ const githubRepositoryName = app.githubRepository
54
+ ? app.githubRepository.metadata.githubRepoName
55
+ : 'expo-default-template';
56
+ const initialTargetProjectDir = targetProjectDirInput !== null && targetProjectDirInput !== void 0 ? targetProjectDirInput : `./${githubRepositoryName}`;
57
+ log_1.default.log(`👋 Welcome to Expo, ${actor.username}!`);
58
+ log_1.default.log();
59
+ log_1.default.log('✨ We will continue your onboarding process in EAS CLI');
60
+ log_1.default.log();
61
+ log_1.default.log(`🚚 Let's start by cloning ${app.githubRepository
62
+ ? `your project (${githubUsername}/${githubRepositoryName})`
63
+ : `default Expo template project (${githubUsername}/${githubRepositoryName})`} from GitHub and installing dependencies.`);
64
+ log_1.default.log();
65
+ const shouldContinueWithDefaultTargetDirectory = await (0, prompts_1.confirmAsync)({
66
+ message: `Do you want to clone your project into ${initialTargetProjectDir}?`,
67
+ });
68
+ let targetProjectDir = initialTargetProjectDir;
69
+ if (!shouldContinueWithDefaultTargetDirectory) {
70
+ const { newTargetProjectDir } = await (0, prompts_1.promptAsync)({
71
+ type: 'text',
72
+ name: 'newTargetProjectDir',
73
+ message: 'Provide a new target directory path:',
74
+ validate: (input) => input !== '',
75
+ });
76
+ targetProjectDir = newTargetProjectDir;
77
+ }
78
+ log_1.default.log();
79
+ const { targetProjectDir: finalTargetProjectDirectory } = await (0, git_1.runGitCloneAsync)({
80
+ githubUsername,
81
+ githubRepositoryName,
82
+ targetProjectDir,
83
+ });
84
+ const vcsClient = new git_2.default(finalTargetProjectDirectory);
85
+ await (0, installDependencies_1.installDependenciesAsync)({
86
+ projectDir: finalTargetProjectDirectory,
87
+ });
88
+ await vcsClient.trackFileAsync('package-lock.json');
89
+ const shouldSetupCredentials = actor.preferences.onboarding.deviceType === generated_1.OnboardingDeviceType.Device &&
90
+ actor.preferences.onboarding.environment === generated_1.OnboardingEnvironment.DevBuild;
91
+ if (shouldSetupCredentials) {
92
+ log_1.default.log('🔑 Now we need to set up build credentials for your project:');
93
+ await new SetUpBuildCredentialsCommandAction_1.SetUpBuildCredentialsCommandAction(actor, graphqlClient, vcsClient, analytics, await getPrivateExpoConfigWithProjectIdAsync({
94
+ projectDir: finalTargetProjectDirectory,
95
+ graphqlClient,
96
+ actor,
97
+ }), getDynamicPrivateProjectConfigGetter({
98
+ projectDir: finalTargetProjectDirectory,
99
+ graphqlClient,
100
+ actor,
101
+ }), platform, 'development', finalTargetProjectDirectory).runAsync();
102
+ }
103
+ if (await vcsClient.hasUncommittedChangesAsync()) {
104
+ log_1.default.log('📦 We will now commit the changes made by the configuration process and push them to GitHub:');
105
+ log_1.default.log();
106
+ log_1.default.log('🔍 Checking for changes in the repository...');
107
+ await vcsClient.showChangedFilesAsync();
108
+ await (0, repository_1.reviewAndCommitChangesAsync)(vcsClient, `[eas-onboarding] Install dependencies${shouldSetupCredentials ? 'and set up build credentials' : ''}`, { nonInteractive: false });
109
+ log_1.default.log('📤 Pushing changes to GitHub...');
110
+ await (0, git_1.runGitPushAsync)({
111
+ targetProjectDir: finalTargetProjectDirectory,
112
+ });
113
+ }
114
+ const { __typename, ...previousPreferences } = actor.preferences.onboarding;
115
+ await UserPreferencesMutation_1.UserPreferencesMutation.markCliDoneInOnboardingUserPreferencesAsync(graphqlClient, {
116
+ ...previousPreferences,
117
+ appId: app.id,
118
+ });
119
+ log_1.default.log();
120
+ log_1.default.log('🎉 We finished configuring your project.');
121
+ log_1.default.log();
122
+ log_1.default.log('🚀 You can now go back to the website to continue:');
123
+ const url = new URL(`/onboarding/develop/set-up-project-on-your-machine?project=${app.slug}&accountId=${app.ownerAccount.id}`, (0, api_1.getExpoWebsiteBaseUrl)()).toString();
124
+ log_1.default.log(`👉 ${(0, log_1.link)(url)}`);
125
+ }
126
+ }
127
+ _a = Onboarding;
128
+ Onboarding.hidden = true;
129
+ Onboarding.aliases = ['init:onboarding', 'onboarding'];
130
+ Onboarding.description = 'continue onboarding process started on the expo.dev website';
131
+ Onboarding.flags = {};
132
+ Onboarding.args = [{ name: 'TARGET_PROJECT_DIRECTORY' }];
133
+ Onboarding.contextDefinition = {
134
+ ..._a.ContextOptions.LoggedIn,
135
+ ..._a.ContextOptions.Analytics,
136
+ };
137
+ exports.default = Onboarding;
138
+ // we can't get this automated by using command context because when we run a command the project directory doesn't exist yet
139
+ async function getPrivateExpoConfigWithProjectIdAsync({ projectDir, graphqlClient, actor, options, }) {
140
+ const expBefore = (0, expoConfig_1.getPrivateExpoConfig)(projectDir, options);
141
+ const projectId = await (0, getProjectIdAsync_1.validateOrSetProjectIdAsync)({
142
+ exp: expBefore,
143
+ graphqlClient,
144
+ actor,
145
+ options: {
146
+ nonInteractive: false,
147
+ },
148
+ });
149
+ const exp = (0, expoConfig_1.getPrivateExpoConfig)(projectDir, options);
150
+ return {
151
+ exp,
152
+ projectId,
153
+ };
154
+ }
155
+ // we can't get this automated by using command context because when we run a command the project directory doesn't exist yet
156
+ function getDynamicPrivateProjectConfigGetter({ projectDir, graphqlClient, actor, }) {
157
+ return async (options) => {
158
+ return {
159
+ ...(await getPrivateExpoConfigWithProjectIdAsync({
160
+ projectDir,
161
+ graphqlClient,
162
+ actor,
163
+ options,
164
+ })),
165
+ projectDir,
166
+ };
167
+ };
168
+ }
@@ -24,6 +24,7 @@ class UpdateConfigure extends EasCommand_1.default {
24
24
  projectDir,
25
25
  platform,
26
26
  vcsClient,
27
+ env: undefined,
27
28
  });
28
29
  await (0, configure_2.ensureEASUpdateIsConfiguredInEasJsonAsync)(projectDir);
29
30
  log_1.default.addNewLineIfNone();
@@ -49,6 +49,7 @@ class UpdatePublish extends EasCommand_1.default {
49
49
  projectDir,
50
50
  projectId,
51
51
  vcsClient,
52
+ env: undefined,
52
53
  });
53
54
  const { exp } = await getDynamicPublicProjectConfigAsync();
54
55
  const { exp: expPrivate } = await getDynamicPrivateProjectConfigAsync();
@@ -183,6 +184,7 @@ class UpdatePublish extends EasCommand_1.default {
183
184
  ...workflows,
184
185
  web: eas_build_job_1.Workflow.UNKNOWN,
185
186
  },
187
+ env: undefined,
186
188
  });
187
189
  const runtimeToPlatformMapping = (0, publish_1.getRuntimeToPlatformMappingFromRuntimeVersions)(runtimeVersions);
188
190
  const { branchId } = await (0, queries_1.ensureBranchExistsAsync)(graphqlClient, {
@@ -44,6 +44,7 @@ class UpdateRollBackToEmbedded extends EasCommand_1.default {
44
44
  projectDir,
45
45
  projectId,
46
46
  vcsClient,
47
+ env: undefined,
47
48
  });
48
49
  // check that the expo-updates package version supports roll back to embedded
49
50
  await (0, projectUtils_1.enforceRollBackToEmbeddedUpdateSupportAsync)(projectDir);
@@ -82,6 +83,7 @@ class UpdateRollBackToEmbedded extends EasCommand_1.default {
82
83
  ...workflows,
83
84
  web: eas_build_job_1.Workflow.UNKNOWN,
84
85
  },
86
+ env: undefined,
85
87
  });
86
88
  let newUpdates;
87
89
  const publishSpinner = (0, ora_1.ora)('Publishing...').start();
@@ -18,6 +18,7 @@ export declare class CredentialsContext {
18
18
  readonly appStore: AppStoreApi;
19
19
  readonly ios: typeof IosGraphqlClient;
20
20
  readonly nonInteractive: boolean;
21
+ readonly freezeCredentials: boolean;
21
22
  readonly projectDir: string;
22
23
  readonly user: Actor;
23
24
  readonly graphqlClient: ExpoGraphqlClient;
@@ -35,6 +36,7 @@ export declare class CredentialsContext {
35
36
  graphqlClient: ExpoGraphqlClient;
36
37
  analytics: Analytics;
37
38
  vcsClient: Client;
39
+ freezeCredentials?: boolean;
38
40
  env?: Env;
39
41
  });
40
42
  get hasProjectContext(): boolean;
@@ -12,11 +12,12 @@ const expoConfig_1 = require("../project/expoConfig");
12
12
  const prompts_1 = require("../prompts");
13
13
  class CredentialsContext {
14
14
  constructor(options) {
15
- var _a;
15
+ var _a, _b;
16
16
  this.options = options;
17
17
  this.android = AndroidGraphqlClient;
18
18
  this.appStore = new AppStoreApi_1.default();
19
19
  this.ios = IosGraphqlClient;
20
+ this.freezeCredentials = false;
20
21
  this.shouldAskAuthenticateAppStore = true;
21
22
  this.easJsonCliConfig = options.easJsonCliConfig;
22
23
  this.projectDir = options.projectDir;
@@ -26,6 +27,7 @@ class CredentialsContext {
26
27
  this.vcsClient = options.vcsClient;
27
28
  this.nonInteractive = (_a = options.nonInteractive) !== null && _a !== void 0 ? _a : false;
28
29
  this.projectInfo = options.projectInfo;
30
+ this.freezeCredentials = (_b = options.freezeCredentials) !== null && _b !== void 0 ? _b : false;
29
31
  }
30
32
  get hasProjectContext() {
31
33
  return !!this.projectInfo;
@@ -1,6 +1,12 @@
1
1
  export declare class MissingCredentialsNonInteractiveError extends Error {
2
2
  constructor(message?: string);
3
3
  }
4
+ export declare class InsufficientAuthenticationNonInteractiveError extends Error {
5
+ constructor(message?: string);
6
+ }
7
+ export declare class ForbidCredentialModificationError extends Error {
8
+ constructor(message?: string);
9
+ }
4
10
  export declare class MissingCredentialsError extends Error {
5
11
  constructor(message?: string);
6
12
  }
@@ -1,12 +1,25 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AndroidPackageNotDefinedError = exports.UnsupportedCredentialsChoiceError = exports.MissingCredentialsError = exports.MissingCredentialsNonInteractiveError = void 0;
3
+ exports.AndroidPackageNotDefinedError = exports.UnsupportedCredentialsChoiceError = exports.MissingCredentialsError = exports.ForbidCredentialModificationError = exports.InsufficientAuthenticationNonInteractiveError = exports.MissingCredentialsNonInteractiveError = void 0;
4
+ const log_1 = require("../log");
4
5
  class MissingCredentialsNonInteractiveError extends Error {
5
6
  constructor(message) {
6
7
  super(message !== null && message !== void 0 ? message : 'Credentials are not set up. Run this command again in interactive mode.');
7
8
  }
8
9
  }
9
10
  exports.MissingCredentialsNonInteractiveError = MissingCredentialsNonInteractiveError;
11
+ class InsufficientAuthenticationNonInteractiveError extends Error {
12
+ constructor(message) {
13
+ super(message !== null && message !== void 0 ? message : `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')}`);
14
+ }
15
+ }
16
+ exports.InsufficientAuthenticationNonInteractiveError = InsufficientAuthenticationNonInteractiveError;
17
+ class ForbidCredentialModificationError extends Error {
18
+ constructor(message) {
19
+ super(message !== null && message !== void 0 ? message : 'Credentials cannot be modified. Run this command again without the --freeze-credentials flag.');
20
+ }
21
+ }
22
+ exports.ForbidCredentialModificationError = ForbidCredentialModificationError;
10
23
  class MissingCredentialsError extends Error {
11
24
  constructor(message) {
12
25
  super(message !== null && message !== void 0 ? message : 'Credentials are not set up.');