eas-cli 0.43.0 → 0.44.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 (39) hide show
  1. package/README.md +825 -0
  2. package/build/build/android/UpdatesModule.d.ts +0 -1
  3. package/build/build/android/UpdatesModule.js +4 -37
  4. package/build/build/android/build.js +3 -3
  5. package/build/build/android/{configure.d.ts → syncProjectConfiguration.d.ts} +2 -3
  6. package/build/build/android/{configure.js → syncProjectConfiguration.js} +22 -23
  7. package/build/build/build.d.ts +1 -1
  8. package/build/build/build.js +6 -8
  9. package/build/build/configure.d.ts +12 -7
  10. package/build/build/configure.js +25 -99
  11. package/build/build/context.d.ts +0 -12
  12. package/build/build/createContext.d.ts +1 -2
  13. package/build/build/createContext.js +1 -2
  14. package/build/build/ios/UpdatesModule.d.ts +0 -1
  15. package/build/build/ios/UpdatesModule.js +8 -39
  16. package/build/build/ios/build.js +3 -3
  17. package/build/build/ios/{configure.d.ts → syncProjectConfiguration.d.ts} +1 -3
  18. package/build/build/ios/{configure.js → syncProjectConfiguration.js} +3 -18
  19. package/build/build/local.d.ts +1 -0
  20. package/build/build/local.js +2 -1
  21. package/build/build/runBuildAndSubmit.d.ts +0 -1
  22. package/build/build/runBuildAndSubmit.js +4 -2
  23. package/build/commands/branch/view.d.ts +0 -2
  24. package/build/commands/branch/view.js +2 -46
  25. package/build/commands/build/configure.js +35 -25
  26. package/build/commands/build/index.d.ts +1 -0
  27. package/build/commands/build/index.js +12 -2
  28. package/build/commands/build/inspect.js +0 -1
  29. package/build/commands/update/index.js +2 -2
  30. package/build/commands/update/list.d.ts +10 -0
  31. package/build/commands/update/list.js +114 -0
  32. package/build/credentials/ios/appstore/bundleIdCapabilities.js +0 -2
  33. package/build/credentials/ios/appstore/ensureAppExists.js +3 -1
  34. package/build/graphql/generated.d.ts +59 -30
  35. package/build/graphql/queries/UpdateQuery.d.ts +7 -0
  36. package/build/graphql/queries/UpdateQuery.js +85 -0
  37. package/build/vcs/local.js +5 -1
  38. package/oclif.manifest.json +1 -1
  39. package/package.json +4 -4
@@ -1,5 +1,4 @@
1
1
  import { ExpoConfig } from '@expo/config';
2
- export declare function configureUpdatesAsync(projectDir: string, exp: ExpoConfig): Promise<void>;
3
2
  export declare function syncUpdatesConfigurationAsync(projectDir: string, exp: ExpoConfig): Promise<void>;
4
3
  export declare function readReleaseChannelSafelyAsync(projectDir: string): Promise<string | null>;
5
4
  export declare function readChannelSafelyAsync(projectDir: string): Promise<string | null>;
@@ -1,52 +1,19 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.readChannelSafelyAsync = exports.readReleaseChannelSafelyAsync = exports.syncUpdatesConfigurationAsync = exports.configureUpdatesAsync = void 0;
4
- const tslib_1 = require("tslib");
3
+ exports.readChannelSafelyAsync = exports.readReleaseChannelSafelyAsync = exports.syncUpdatesConfigurationAsync = void 0;
5
4
  const config_plugins_1 = require("@expo/config-plugins");
6
- const log_1 = (0, tslib_1.__importDefault)(require("../../log"));
7
5
  const projectUtils_1 = require("../../project/projectUtils");
8
6
  const actions_1 = require("../../user/actions");
9
7
  const updates_1 = require("../utils/updates");
10
- async function configureUpdatesAsync(projectDir, exp) {
11
- (0, updates_1.ensureValidVersions)(exp);
12
- const accountName = (0, projectUtils_1.getProjectAccountName)(exp, await (0, actions_1.ensureLoggedInAsync)());
13
- const androidManifestPath = await config_plugins_1.AndroidConfig.Paths.getAndroidManifestAsync(projectDir);
14
- const androidManifest = await getAndroidManifestAsync(projectDir);
15
- if (!config_plugins_1.AndroidConfig.Updates.isMainApplicationMetaDataSynced(exp, androidManifest, accountName)) {
16
- const result = config_plugins_1.AndroidConfig.Updates.setUpdatesConfig(exp, androidManifest, accountName);
17
- await config_plugins_1.AndroidConfig.Manifest.writeAndroidManifestAsync(androidManifestPath, result);
18
- }
19
- }
20
- exports.configureUpdatesAsync = configureUpdatesAsync;
21
8
  async function syncUpdatesConfigurationAsync(projectDir, exp) {
22
9
  (0, updates_1.ensureValidVersions)(exp);
23
10
  const accountName = (0, projectUtils_1.getProjectAccountName)(exp, await (0, actions_1.ensureLoggedInAsync)());
24
- try {
25
- await ensureUpdatesConfiguredAsync(projectDir);
26
- }
27
- catch (error) {
28
- log_1.default.error('expo-updates module is not configured. Please run "eas build:configure" first to configure the project');
29
- throw error;
30
- }
31
11
  const androidManifestPath = await config_plugins_1.AndroidConfig.Paths.getAndroidManifestAsync(projectDir);
32
- let androidManifest = await getAndroidManifestAsync(projectDir);
33
- if (!config_plugins_1.AndroidConfig.Updates.areVersionsSynced(exp, androidManifest)) {
34
- androidManifest = config_plugins_1.AndroidConfig.Updates.setVersionsConfig(exp, androidManifest);
35
- await config_plugins_1.AndroidConfig.Manifest.writeAndroidManifestAsync(androidManifestPath, androidManifest);
36
- }
37
- if (!config_plugins_1.AndroidConfig.Updates.isMainApplicationMetaDataSynced(exp, androidManifest, accountName)) {
38
- log_1.default.warn('Native project configuration is not synced with values present in your app.json, run "eas build:configure" to make sure all values are applied in the native project');
39
- }
40
- }
41
- exports.syncUpdatesConfigurationAsync = syncUpdatesConfigurationAsync;
42
- // Note: we assume here that Expo modules are properly configured in the project. Aside from that,
43
- // all that is needed on Expo SDK 43+ to configure expo-updates configuration in AndroidManifest.xml
44
- async function ensureUpdatesConfiguredAsync(projectDir) {
45
12
  const androidManifest = await getAndroidManifestAsync(projectDir);
46
- if (!config_plugins_1.AndroidConfig.Updates.isMainApplicationMetaDataSet(androidManifest)) {
47
- throw new Error('Missing values in AndroidManifest.xml');
48
- }
13
+ const updatedAndroidManifest = config_plugins_1.AndroidConfig.Updates.setUpdatesConfig(exp, androidManifest, accountName);
14
+ await config_plugins_1.AndroidConfig.Manifest.writeAndroidManifestAsync(androidManifestPath, updatedAndroidManifest);
49
15
  }
16
+ exports.syncUpdatesConfigurationAsync = syncUpdatesConfigurationAsync;
50
17
  async function readReleaseChannelSafelyAsync(projectDir) {
51
18
  try {
52
19
  const androidManifest = await getAndroidManifestAsync(projectDir);
@@ -16,9 +16,9 @@ const build_1 = require("../build");
16
16
  const graphql_1 = require("../graphql");
17
17
  const credentials_1 = require("../utils/credentials");
18
18
  const validate_1 = require("../validate");
19
- const configure_1 = require("./configure");
20
19
  const graphql_2 = require("./graphql");
21
20
  const prepareJob_1 = require("./prepareJob");
21
+ const syncProjectConfiguration_1 = require("./syncProjectConfiguration");
22
22
  async function createAndroidContextAsync(ctx) {
23
23
  var _a;
24
24
  const { buildProfile } = ctx;
@@ -49,8 +49,8 @@ async function prepareAndroidBuildAsync(ctx) {
49
49
  ensureCredentialsAsync: async (ctx) => {
50
50
  return await ensureAndroidCredentialsAsync(ctx);
51
51
  },
52
- ensureProjectConfiguredAsync: async () => {
53
- await (0, configure_1.validateAndSyncProjectConfigurationAsync)({
52
+ syncProjectConfigurationAsync: async () => {
53
+ await (0, syncProjectConfiguration_1.syncProjectConfigurationAsync)({
54
54
  projectDir: ctx.projectDir,
55
55
  exp: ctx.exp,
56
56
  buildProfile: ctx.buildProfile,
@@ -1,10 +1,9 @@
1
1
  import { ExpoConfig } from '@expo/config';
2
2
  import { Platform } from '@expo/eas-build-job';
3
3
  import { BuildProfile } from '@expo/eas-json';
4
- import { ConfigureContext } from '../context';
5
- export declare function configureAndroidAsync(ctx: ConfigureContext): Promise<void>;
6
- export declare function validateAndSyncProjectConfigurationAsync({ projectDir, exp, buildProfile, }: {
4
+ export declare function syncProjectConfigurationAsync({ projectDir, exp, buildProfile, }: {
7
5
  projectDir: string;
8
6
  exp: ExpoConfig;
9
7
  buildProfile: BuildProfile<Platform.ANDROID>;
10
8
  }): Promise<void>;
9
+ export declare function cleanUpOldEasBuildGradleScriptAsync(projectDir: string): Promise<void>;
@@ -1,39 +1,23 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.validateAndSyncProjectConfigurationAsync = exports.configureAndroidAsync = void 0;
3
+ exports.cleanUpOldEasBuildGradleScriptAsync = exports.syncProjectConfigurationAsync = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const config_plugins_1 = require("@expo/config-plugins");
6
6
  const eas_build_job_1 = require("@expo/eas-build-job");
7
+ const chalk_1 = (0, tslib_1.__importDefault)(require("chalk"));
8
+ const fs_extra_1 = (0, tslib_1.__importDefault)(require("fs-extra"));
9
+ const path_1 = (0, tslib_1.__importDefault)(require("path"));
7
10
  const log_1 = (0, tslib_1.__importDefault)(require("../../log"));
8
- const applicationId_1 = require("../../project/android/applicationId");
9
11
  const workflow_1 = require("../../project/workflow");
10
- const vcs_1 = require("../../vcs");
11
12
  const updates_1 = require("../utils/updates");
12
13
  const UpdatesModule_1 = require("./UpdatesModule");
13
14
  const version_1 = require("./version");
14
- async function configureAndroidAsync(ctx) {
15
- if (!ctx.hasAndroidNativeProject) {
16
- await (0, applicationId_1.ensureApplicationIdIsDefinedForManagedProjectAsync)(ctx.projectDir, ctx.exp);
17
- return;
18
- }
19
- (0, applicationId_1.warnIfAndroidPackageDefinedInAppConfigForBareWorkflowProject)(ctx.projectDir, ctx.exp);
20
- await config_plugins_1.AndroidConfig.EasBuild.configureEasBuildAsync(ctx.projectDir);
21
- const easGradlePath = config_plugins_1.AndroidConfig.EasBuild.getEasBuildGradlePath(ctx.projectDir);
22
- await (0, vcs_1.getVcsClient)().trackFileAsync(easGradlePath);
23
- if ((0, updates_1.isExpoUpdatesInstalled)(ctx.projectDir)) {
24
- await (0, UpdatesModule_1.configureUpdatesAsync)(ctx.projectDir, ctx.exp);
25
- }
26
- log_1.default.withTick('Android project configured');
27
- }
28
- exports.configureAndroidAsync = configureAndroidAsync;
29
- async function validateAndSyncProjectConfigurationAsync({ projectDir, exp, buildProfile, }) {
15
+ async function syncProjectConfigurationAsync({ projectDir, exp, buildProfile, }) {
30
16
  const workflow = await (0, workflow_1.resolveWorkflowAsync)(projectDir, eas_build_job_1.Platform.ANDROID);
31
17
  const { autoIncrement } = buildProfile;
32
18
  const versionBumpStrategy = resolveVersionBumpStrategy(autoIncrement !== null && autoIncrement !== void 0 ? autoIncrement : false);
33
19
  if (workflow === eas_build_job_1.Workflow.GENERIC) {
34
- if (!(await config_plugins_1.AndroidConfig.EasBuild.isEasBuildGradleConfiguredAsync(projectDir))) {
35
- throw new Error('Project is not configured. Please run "eas build:configure" to configure the project.');
36
- }
20
+ await cleanUpOldEasBuildGradleScriptAsync(projectDir);
37
21
  if ((0, updates_1.isExpoUpdatesInstalled)(projectDir)) {
38
22
  await (0, UpdatesModule_1.syncUpdatesConfigurationAsync)(projectDir, exp);
39
23
  }
@@ -43,7 +27,7 @@ async function validateAndSyncProjectConfigurationAsync({ projectDir, exp, build
43
27
  await (0, version_1.bumpVersionInAppJsonAsync)({ projectDir, exp, bumpStrategy: versionBumpStrategy });
44
28
  }
45
29
  }
46
- exports.validateAndSyncProjectConfigurationAsync = validateAndSyncProjectConfigurationAsync;
30
+ exports.syncProjectConfigurationAsync = syncProjectConfigurationAsync;
47
31
  function resolveVersionBumpStrategy(autoIncrement) {
48
32
  if (autoIncrement === true) {
49
33
  return version_1.BumpStrategy.VERSION_CODE;
@@ -58,3 +42,18 @@ function resolveVersionBumpStrategy(autoIncrement) {
58
42
  return version_1.BumpStrategy.APP_VERSION;
59
43
  }
60
44
  }
45
+ // TODO: remove this after a few months
46
+ async function cleanUpOldEasBuildGradleScriptAsync(projectDir) {
47
+ const easBuildGradlePath = path_1.default.join(projectDir, 'android', 'app', 'eas-build.gradle');
48
+ if (await fs_extra_1.default.pathExists(easBuildGradlePath)) {
49
+ log_1.default.withTick(`Removing ${chalk_1.default.bold('eas-build.gradle')} as it's not longer necessary`);
50
+ await fs_extra_1.default.remove(easBuildGradlePath);
51
+ const buildGradlePath = config_plugins_1.AndroidConfig.Paths.getAppBuildGradleFilePath(projectDir);
52
+ const buildGradleContents = await fs_extra_1.default.readFile(buildGradlePath, 'utf-8');
53
+ const buildGradleContentsWithoutApply = buildGradleContents.replace(/apply from: ["'].\/eas-build.gradle["']\n/, '');
54
+ if (buildGradleContentsWithoutApply !== buildGradleContents) {
55
+ await fs_extra_1.default.writeFile(buildGradlePath, buildGradleContentsWithoutApply);
56
+ }
57
+ }
58
+ }
59
+ exports.cleanUpOldEasBuildGradleScriptAsync = cleanUpOldEasBuildGradleScriptAsync;
@@ -14,7 +14,7 @@ export interface JobData<Credentials> {
14
14
  interface Builder<TPlatform extends Platform, Credentials, TJob extends Job> {
15
15
  ctx: BuildContext<TPlatform>;
16
16
  ensureCredentialsAsync(ctx: BuildContext<TPlatform>): Promise<CredentialsResult<Credentials> | undefined>;
17
- ensureProjectConfiguredAsync(ctx: BuildContext<TPlatform>): Promise<void>;
17
+ syncProjectConfigurationAsync(ctx: BuildContext<TPlatform>): Promise<void>;
18
18
  prepareJobAsync(ctx: BuildContext<TPlatform>, jobData: JobData<Credentials>): Promise<Job>;
19
19
  sendBuildRequestAsync(appId: string, job: TJob, metadata: Metadata): Promise<BuildResult>;
20
20
  }
@@ -29,14 +29,12 @@ async function prepareBuildRequestForPlatformAsync(builder) {
29
29
  failureEvent: events_1.BuildEvent.GATHER_CREDENTIALS_FAIL,
30
30
  trackingCtx: ctx.trackingCtx,
31
31
  });
32
- if (!ctx.skipProjectConfiguration) {
33
- await (0, common_1.withAnalyticsAsync)(async () => await builder.ensureProjectConfiguredAsync(ctx), {
34
- attemptEvent: events_1.BuildEvent.CONFIGURE_PROJECT_ATTEMPT,
35
- successEvent: events_1.BuildEvent.CONFIGURE_PROJECT_SUCCESS,
36
- failureEvent: events_1.BuildEvent.CONFIGURE_PROJECT_FAIL,
37
- trackingCtx: ctx.trackingCtx,
38
- });
39
- }
32
+ await (0, common_1.withAnalyticsAsync)(async () => await builder.syncProjectConfigurationAsync(ctx), {
33
+ attemptEvent: events_1.BuildEvent.CONFIGURE_PROJECT_ATTEMPT,
34
+ successEvent: events_1.BuildEvent.CONFIGURE_PROJECT_SUCCESS,
35
+ failureEvent: events_1.BuildEvent.CONFIGURE_PROJECT_FAIL,
36
+ trackingCtx: ctx.trackingCtx,
37
+ });
40
38
  if (await (0, vcs_1.getVcsClient)().isCommitRequiredAsync()) {
41
39
  log_1.default.addNewLineIfNone();
42
40
  await (0, repository_1.reviewAndCommitChangesAsync)(`[EAS Build] Run EAS Build for ${platform_1.requestedPlatformDisplayNames[ctx.platform]}`, { nonInteractive: ctx.nonInteractive });
@@ -1,8 +1,13 @@
1
- import { RequestedPlatform } from '../platform';
2
- import { ConfigureContext } from './context';
3
- export declare function ensureProjectConfiguredAsync(projectDir: string, requestedPlatform: RequestedPlatform): Promise<void>;
4
- export declare function configureAsync(options: {
5
- platform: RequestedPlatform;
1
+ interface ConfigureParams {
6
2
  projectDir: string;
7
- }): Promise<void>;
8
- export declare function ensureEasJsonExistsAsync(ctx: ConfigureContext): Promise<void>;
3
+ nonInteractive: boolean;
4
+ }
5
+ /**
6
+ * Creates eas.json if it does not exist.
7
+ *
8
+ * Returns:
9
+ * - false - if eas.json already exists
10
+ * - true - if eas.json was created by the function
11
+ */
12
+ export declare function ensureProjectConfiguredAsync(configureParams: ConfigureParams): Promise<boolean>;
13
+ export {};
@@ -1,79 +1,41 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ensureEasJsonExistsAsync = exports.configureAsync = exports.ensureProjectConfiguredAsync = void 0;
3
+ exports.ensureProjectConfiguredAsync = void 0;
4
4
  const tslib_1 = require("tslib");
5
- const config_1 = require("@expo/config");
6
5
  const eas_build_job_1 = require("@expo/eas-build-job");
7
6
  const eas_json_1 = require("@expo/eas-json");
8
- const core_1 = require("@oclif/core");
9
7
  const chalk_1 = (0, tslib_1.__importDefault)(require("chalk"));
10
8
  const fs_extra_1 = (0, tslib_1.__importDefault)(require("fs-extra"));
11
- const log_1 = (0, tslib_1.__importStar)(require("../log"));
12
- const platform_1 = require("../platform");
9
+ const log_1 = (0, tslib_1.__importDefault)(require("../log"));
13
10
  const workflow_1 = require("../project/workflow");
14
- const prompts_1 = require("../prompts");
15
- const actions_1 = require("../user/actions");
16
11
  const easCli_1 = require("../utils/easCli");
17
12
  const vcs_1 = require("../vcs");
18
- const configure_1 = require("./android/configure");
19
- const configure_2 = require("./ios/configure");
20
13
  const repository_1 = require("./utils/repository");
21
- const configureCommitMessage = {
22
- [platform_1.RequestedPlatform.Android]: 'Configure EAS Build for Android',
23
- [platform_1.RequestedPlatform.Ios]: 'Configure EAS Build for iOS',
24
- [platform_1.RequestedPlatform.All]: 'Configure EAS Build',
25
- };
26
- async function ensureProjectConfiguredAsync(projectDir, requestedPlatform) {
27
- if (await fs_extra_1.default.pathExists(eas_json_1.EasJsonReader.formatEasJsonPath(projectDir))) {
28
- return;
29
- }
30
- const message = 'This project is not configured to build with EAS. Set it up now?';
31
- const confirm = await (0, prompts_1.confirmAsync)({ message });
32
- if (confirm) {
33
- await configureAsync({
34
- projectDir,
35
- platform: requestedPlatform,
36
- });
37
- if (await (0, vcs_1.getVcsClient)().isCommitRequiredAsync()) {
38
- core_1.Errors.error('Build process requires clean working tree, please commit all your changes and run `eas build` again', { exit: 1 });
39
- }
40
- }
41
- else {
42
- core_1.Errors.error(`Aborting, please run ${chalk_1.default.bold('eas build:configure')} or create eas.json (${(0, log_1.learnMore)('https://docs.expo.dev/build/eas-json')})`, { exit: 1 });
14
+ /**
15
+ * Creates eas.json if it does not exist.
16
+ *
17
+ * Returns:
18
+ * - false - if eas.json already exists
19
+ * - true - if eas.json was created by the function
20
+ */
21
+ async function ensureProjectConfiguredAsync(configureParams) {
22
+ if (await fs_extra_1.default.pathExists(eas_json_1.EasJsonReader.formatEasJsonPath(configureParams.projectDir))) {
23
+ return false;
43
24
  }
25
+ await configureAsync(configureParams);
26
+ return true;
44
27
  }
45
28
  exports.ensureProjectConfiguredAsync = ensureProjectConfiguredAsync;
46
- async function configureAsync(options) {
29
+ async function configureAsync({ projectDir, nonInteractive }) {
47
30
  await (0, repository_1.maybeBailOnRepoStatusAsync)();
48
- const { exp } = (0, config_1.getConfig)(options.projectDir, { skipSDKVersionRequirement: true });
49
- const ctx = {
50
- user: await (0, actions_1.ensureLoggedInAsync)(),
51
- projectDir: options.projectDir,
52
- exp,
53
- requestedPlatform: options.platform,
54
- shouldConfigureAndroid: [platform_1.RequestedPlatform.All, platform_1.RequestedPlatform.Android].includes(options.platform),
55
- shouldConfigureIos: [platform_1.RequestedPlatform.All, platform_1.RequestedPlatform.Ios].includes(options.platform),
56
- hasAndroidNativeProject: (await (0, workflow_1.resolveWorkflowAsync)(options.projectDir, eas_build_job_1.Platform.ANDROID)) === eas_build_job_1.Workflow.GENERIC,
57
- hasIosNativeProject: (await (0, workflow_1.resolveWorkflowAsync)(options.projectDir, eas_build_job_1.Platform.IOS)) === eas_build_job_1.Workflow.GENERIC,
58
- };
59
- log_1.default.newLine();
60
- await ensureEasJsonExistsAsync(ctx);
61
- if (ctx.shouldConfigureAndroid) {
62
- await (0, configure_1.configureAndroidAsync)(ctx);
63
- }
64
- if (ctx.shouldConfigureIos) {
65
- await (0, configure_2.configureIosAsync)(ctx);
66
- }
31
+ await createEasJsonAsync(projectDir);
67
32
  if (await (0, vcs_1.getVcsClient)().isCommitRequiredAsync()) {
68
33
  log_1.default.newLine();
69
- await reviewAndCommitChangesAsync(configureCommitMessage[options.platform]);
70
- }
71
- else if (!(await (0, vcs_1.getVcsClient)().hasUncommittedChangesAsync())) {
72
- log_1.default.newLine();
73
- log_1.default.withTick('No changes were necessary, the project is already configured correctly.');
34
+ await (0, repository_1.reviewAndCommitChangesAsync)('Configure EAS Build', {
35
+ nonInteractive,
36
+ });
74
37
  }
75
38
  }
76
- exports.configureAsync = configureAsync;
77
39
  const EAS_JSON_MANAGED_DEFAULT = {
78
40
  cli: {
79
41
  version: `>= ${easCli_1.easCliVersion}`,
@@ -115,50 +77,14 @@ const EAS_JSON_BARE_DEFAULT = {
115
77
  production: {},
116
78
  },
117
79
  };
118
- async function ensureEasJsonExistsAsync(ctx) {
119
- const easJsonPath = eas_json_1.EasJsonReader.formatEasJsonPath(ctx.projectDir);
120
- if (await fs_extra_1.default.pathExists(easJsonPath)) {
121
- const reader = new eas_json_1.EasJsonReader(ctx.projectDir);
122
- await reader.readAsync();
123
- log_1.default.withTick('Validated eas.json');
124
- return;
125
- }
126
- const easJson = ctx.hasAndroidNativeProject && ctx.hasIosNativeProject
80
+ async function createEasJsonAsync(projectDir) {
81
+ const easJsonPath = eas_json_1.EasJsonReader.formatEasJsonPath(projectDir);
82
+ const hasAndroidNativeProject = (await (0, workflow_1.resolveWorkflowAsync)(projectDir, eas_build_job_1.Platform.ANDROID)) === eas_build_job_1.Workflow.GENERIC;
83
+ const hasIosNativeProject = (await (0, workflow_1.resolveWorkflowAsync)(projectDir, eas_build_job_1.Platform.IOS)) === eas_build_job_1.Workflow.GENERIC;
84
+ const easJson = hasAndroidNativeProject || hasIosNativeProject
127
85
  ? EAS_JSON_BARE_DEFAULT
128
86
  : EAS_JSON_MANAGED_DEFAULT;
129
87
  await fs_extra_1.default.writeFile(easJsonPath, `${JSON.stringify(easJson, null, 2)}\n`);
130
88
  await (0, vcs_1.getVcsClient)().trackFileAsync(easJsonPath);
131
- log_1.default.withTick('Generated eas.json');
132
- }
133
- exports.ensureEasJsonExistsAsync = ensureEasJsonExistsAsync;
134
- var ShouldCommitChanges;
135
- (function (ShouldCommitChanges) {
136
- ShouldCommitChanges[ShouldCommitChanges["Yes"] = 0] = "Yes";
137
- ShouldCommitChanges[ShouldCommitChanges["ShowDiffFirst"] = 1] = "ShowDiffFirst";
138
- ShouldCommitChanges[ShouldCommitChanges["Skip"] = 2] = "Skip";
139
- })(ShouldCommitChanges || (ShouldCommitChanges = {}));
140
- async function reviewAndCommitChangesAsync(initialCommitMessage, askedFirstTime = true) {
141
- const { selected } = await (0, prompts_1.promptAsync)({
142
- type: 'select',
143
- name: 'selected',
144
- message: 'Can we commit these changes to git for you?',
145
- choices: [
146
- { title: 'Yes', value: ShouldCommitChanges.Yes },
147
- ...(askedFirstTime
148
- ? [{ title: 'Show the diff and ask me again', value: ShouldCommitChanges.ShowDiffFirst }]
149
- : []),
150
- {
151
- title: 'Skip committing changes, I will do it later on my own',
152
- value: ShouldCommitChanges.Skip,
153
- },
154
- ],
155
- });
156
- if (selected === ShouldCommitChanges.Yes) {
157
- await (0, repository_1.commitPromptAsync)({ initialCommitMessage });
158
- log_1.default.withTick('Committed changes');
159
- }
160
- else if (selected === ShouldCommitChanges.ShowDiffFirst) {
161
- await (0, vcs_1.getVcsClient)().showDiffAsync();
162
- await reviewAndCommitChangesAsync(initialCommitMessage, false);
163
- }
89
+ log_1.default.withTick(`Generated ${chalk_1.default.bold('eas.json')}`);
164
90
  }
@@ -5,21 +5,10 @@ import type { XCBuildConfiguration } from 'xcode';
5
5
  import { TrackingContext } from '../analytics/common';
6
6
  import { CredentialsContext } from '../credentials/context';
7
7
  import { Target } from '../credentials/ios/types';
8
- import { RequestedPlatform } from '../platform';
9
8
  import { GradleBuildContext } from '../project/android/gradle';
10
9
  import { XcodeBuildContext } from '../project/ios/scheme';
11
10
  import { Actor } from '../user/User';
12
11
  import { LocalBuildOptions } from './local';
13
- export interface ConfigureContext {
14
- user: Actor;
15
- projectDir: string;
16
- exp: ExpoConfig;
17
- requestedPlatform: RequestedPlatform;
18
- shouldConfigureAndroid: boolean;
19
- shouldConfigureIos: boolean;
20
- hasAndroidNativeProject: boolean;
21
- hasIosNativeProject: boolean;
22
- }
23
12
  export declare type CommonContext<T extends Platform> = Omit<BuildContext<T>, 'android' | 'ios'>;
24
13
  export interface AndroidBuildContext {
25
14
  applicationId: string;
@@ -45,7 +34,6 @@ export interface BuildContext<T extends Platform> {
45
34
  projectDir: string;
46
35
  projectId: string;
47
36
  projectName: string;
48
- skipProjectConfiguration: boolean;
49
37
  trackingCtx: TrackingContext;
50
38
  user: Actor;
51
39
  workflow: Workflow;
@@ -2,7 +2,7 @@ import { Platform } from '@expo/eas-build-job';
2
2
  import { BuildProfile } from '@expo/eas-json';
3
3
  import { BuildContext } from './context';
4
4
  import { LocalBuildOptions } from './local';
5
- export declare function createBuildContextAsync<T extends Platform>({ buildProfileName, buildProfile, clearCache, localBuildOptions, nonInteractive, platform, projectDir, skipProjectConfiguration, }: {
5
+ export declare function createBuildContextAsync<T extends Platform>({ buildProfileName, buildProfile, clearCache, localBuildOptions, nonInteractive, platform, projectDir, }: {
6
6
  buildProfileName: string;
7
7
  buildProfile: BuildProfile<T>;
8
8
  clearCache: boolean;
@@ -10,5 +10,4 @@ export declare function createBuildContextAsync<T extends Platform>({ buildProfi
10
10
  nonInteractive: boolean;
11
11
  platform: T;
12
12
  projectDir: string;
13
- skipProjectConfiguration: boolean;
14
13
  }): Promise<BuildContext<T>>;
@@ -15,7 +15,7 @@ const Account_1 = require("../user/Account");
15
15
  const actions_1 = require("../user/actions");
16
16
  const build_1 = require("./android/build");
17
17
  const build_2 = require("./ios/build");
18
- async function createBuildContextAsync({ buildProfileName, buildProfile, clearCache = false, localBuildOptions, nonInteractive = false, platform, projectDir, skipProjectConfiguration = false, }) {
18
+ async function createBuildContextAsync({ buildProfileName, buildProfile, clearCache = false, localBuildOptions, nonInteractive = false, platform, projectDir, }) {
19
19
  var _a;
20
20
  const exp = (0, expoConfig_1.getExpoConfig)(projectDir, { env: buildProfile.env });
21
21
  const user = await (0, actions_1.ensureLoggedInAsync)();
@@ -58,7 +58,6 @@ async function createBuildContextAsync({ buildProfileName, buildProfile, clearCa
58
58
  projectDir,
59
59
  projectId,
60
60
  projectName,
61
- skipProjectConfiguration,
62
61
  trackingCtx,
63
62
  user,
64
63
  workflow,
@@ -1,5 +1,4 @@
1
1
  import { ExpoConfig } from '@expo/config';
2
- export declare function configureUpdatesAsync(projectDir: string, exp: ExpoConfig): Promise<void>;
3
2
  export declare function syncUpdatesConfigurationAsync(projectDir: string, exp: ExpoConfig): Promise<void>;
4
3
  export declare function readReleaseChannelSafelyAsync(projectDir: string): Promise<string | null>;
5
4
  export declare function readChannelSafelyAsync(projectDir: string): Promise<string | null>;
@@ -1,53 +1,20 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.readChannelSafelyAsync = exports.readReleaseChannelSafelyAsync = exports.syncUpdatesConfigurationAsync = exports.configureUpdatesAsync = void 0;
4
- const tslib_1 = require("tslib");
3
+ exports.readChannelSafelyAsync = exports.readReleaseChannelSafelyAsync = exports.syncUpdatesConfigurationAsync = void 0;
5
4
  const config_plugins_1 = require("@expo/config-plugins");
6
- const log_1 = (0, tslib_1.__importDefault)(require("../../log"));
7
5
  const projectUtils_1 = require("../../project/projectUtils");
8
6
  const actions_1 = require("../../user/actions");
9
7
  const plist_1 = require("../../utils/plist");
10
8
  const vcs_1 = require("../../vcs");
11
9
  const updates_1 = require("../utils/updates");
12
- async function configureUpdatesAsync(projectDir, exp) {
13
- (0, updates_1.ensureValidVersions)(exp);
14
- const accountName = (0, projectUtils_1.getProjectAccountName)(exp, await (0, actions_1.ensureLoggedInAsync)());
15
- let expoPlist = await readExpoPlistAsync(projectDir);
16
- if (!config_plugins_1.IOSConfig.Updates.isPlistConfigurationSynced(exp, expoPlist, accountName)) {
17
- expoPlist = config_plugins_1.IOSConfig.Updates.setUpdatesConfig(exp, expoPlist, accountName);
18
- await writeExpoPlistAsync(projectDir, expoPlist);
19
- }
20
- // TODO: ensure ExpoPlist in pbxproj
21
- }
22
- exports.configureUpdatesAsync = configureUpdatesAsync;
23
10
  async function syncUpdatesConfigurationAsync(projectDir, exp) {
24
11
  (0, updates_1.ensureValidVersions)(exp);
25
12
  const accountName = (0, projectUtils_1.getProjectAccountName)(exp, await (0, actions_1.ensureLoggedInAsync)());
26
- try {
27
- await ensureUpdatesConfiguredAsync(projectDir);
28
- }
29
- catch (error) {
30
- log_1.default.error('expo-updates module is not configured. Please run "eas build:configure" first to configure the project');
31
- throw error;
32
- }
33
- let expoPlist = await readExpoPlistAsync(projectDir);
34
- if (!config_plugins_1.IOSConfig.Updates.isPlistVersionConfigurationSynced(exp, expoPlist)) {
35
- expoPlist = config_plugins_1.IOSConfig.Updates.setVersionsConfig(exp, expoPlist);
36
- await writeExpoPlistAsync(projectDir, expoPlist);
37
- }
38
- if (!config_plugins_1.IOSConfig.Updates.isPlistConfigurationSynced(exp, expoPlist, accountName)) {
39
- log_1.default.warn('Native project configuration is not synced with values present in your app.json, run "eas build:configure" to make sure all values are applied in the native project');
40
- }
41
- }
42
- exports.syncUpdatesConfigurationAsync = syncUpdatesConfigurationAsync;
43
- // Note: we assume here that Expo modules are properly configured in the project. Aside from that,
44
- // all that is needed on Expo SDK 43+ to configure expo-updates configuration in Expo.plist
45
- async function ensureUpdatesConfiguredAsync(projectDir) {
46
13
  const expoPlist = await readExpoPlistAsync(projectDir);
47
- if (!config_plugins_1.IOSConfig.Updates.isPlistConfigurationSet(expoPlist)) {
48
- throw new Error('Missing values in Expo.plist');
49
- }
14
+ const updatedExpoPlist = config_plugins_1.IOSConfig.Updates.setUpdatesConfig(exp, expoPlist, accountName);
15
+ await writeExpoPlistAsync(projectDir, updatedExpoPlist);
50
16
  }
17
+ exports.syncUpdatesConfigurationAsync = syncUpdatesConfigurationAsync;
51
18
  async function readExpoPlistAsync(projectDir) {
52
19
  var _a;
53
20
  const expoPlistPath = config_plugins_1.IOSConfig.Paths.getExpoPlistPath(projectDir);
@@ -72,8 +39,10 @@ exports.readReleaseChannelSafelyAsync = readReleaseChannelSafelyAsync;
72
39
  async function readChannelSafelyAsync(projectDir) {
73
40
  var _a, _b;
74
41
  try {
75
- const expoPlist = await readExpoPlistAsync(projectDir); // TODO-JJ remove any once IOSConfig.ExpoPlist is updated to include `EXUpdatesRequestHeaders : Record<string,string>`
76
- const updatesRequestHeaders = (_a = expoPlist['EXUpdatesRequestHeaders']) !== null && _a !== void 0 ? _a : {}; //TODO-JJ 'EXUpdatesRequestHeaders' IosConfig.Updates.Config.UPDATES_CONFIGURATION_REQUEST_HEADERS_KEY once https://github.com/expo/expo-cli/pull/3571 is published
42
+ // TODO-JJ remove any once IOSConfig.ExpoPlist is updated to include `EXUpdatesRequestHeaders : Record<string,string>`
43
+ const expoPlist = await readExpoPlistAsync(projectDir);
44
+ //TODO-JJ 'EXUpdatesRequestHeaders' IosConfig.Updates.Config.UPDATES_CONFIGURATION_REQUEST_HEADERS_KEY once https://github.com/expo/expo-cli/pull/3571 is published
45
+ const updatesRequestHeaders = (_a = expoPlist['EXUpdatesRequestHeaders']) !== null && _a !== void 0 ? _a : {};
77
46
  return (_b = updatesRequestHeaders['expo-channel-name']) !== null && _b !== void 0 ? _b : null;
78
47
  }
79
48
  catch (err) {
@@ -10,10 +10,10 @@ const target_1 = require("../../project/ios/target");
10
10
  const build_1 = require("../build");
11
11
  const graphql_1 = require("../graphql");
12
12
  const validate_1 = require("../validate");
13
- const configure_1 = require("./configure");
14
13
  const credentials_1 = require("./credentials");
15
14
  const graphql_2 = require("./graphql");
16
15
  const prepareJob_1 = require("./prepareJob");
16
+ const syncProjectConfiguration_1 = require("./syncProjectConfiguration");
17
17
  async function createIosContextAsync(ctx) {
18
18
  const { buildProfile } = ctx;
19
19
  if (ctx.workflow === eas_build_job_1.Workflow.MANAGED) {
@@ -47,8 +47,8 @@ async function prepareIosBuildAsync(ctx) {
47
47
  ensureCredentialsAsync: async (ctx) => {
48
48
  return (0, credentials_1.ensureIosCredentialsAsync)(ctx, ctx.ios.targets);
49
49
  },
50
- ensureProjectConfiguredAsync: async () => {
51
- await (0, configure_1.validateAndSyncProjectConfigurationAsync)({
50
+ syncProjectConfigurationAsync: async () => {
51
+ await (0, syncProjectConfiguration_1.syncProjectConfigurationAsync)({
52
52
  projectDir: ctx.projectDir,
53
53
  exp: ctx.exp,
54
54
  buildProfile: ctx.buildProfile,
@@ -2,9 +2,7 @@ import { ExpoConfig } from '@expo/config';
2
2
  import { Platform } from '@expo/eas-build-job';
3
3
  import { BuildProfile } from '@expo/eas-json';
4
4
  import type { XCBuildConfiguration } from 'xcode';
5
- import { ConfigureContext } from '../context';
6
- export declare function configureIosAsync(ctx: ConfigureContext): Promise<void>;
7
- export declare function validateAndSyncProjectConfigurationAsync({ projectDir, exp, buildProfile, buildSettings, }: {
5
+ export declare function syncProjectConfigurationAsync({ projectDir, exp, buildProfile, buildSettings, }: {
8
6
  projectDir: string;
9
7
  exp: ExpoConfig;
10
8
  buildProfile: BuildProfile<Platform.IOS>;
@@ -1,27 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.validateAndSyncProjectConfigurationAsync = exports.configureIosAsync = void 0;
4
- const tslib_1 = require("tslib");
3
+ exports.syncProjectConfigurationAsync = void 0;
5
4
  const eas_build_job_1 = require("@expo/eas-build-job");
6
- const log_1 = (0, tslib_1.__importDefault)(require("../../log"));
7
- const bundleIdentifier_1 = require("../../project/ios/bundleIdentifier");
8
5
  const workflow_1 = require("../../project/workflow");
9
6
  const updates_1 = require("../utils/updates");
10
7
  const UpdatesModule_1 = require("./UpdatesModule");
11
8
  const version_1 = require("./version");
12
- async function configureIosAsync(ctx) {
13
- if (!ctx.hasIosNativeProject) {
14
- await (0, bundleIdentifier_1.ensureBundleIdentifierIsDefinedForManagedProjectAsync)(ctx.projectDir, ctx.exp);
15
- return;
16
- }
17
- (0, bundleIdentifier_1.warnIfBundleIdentifierDefinedInAppConfigForBareWorkflowProject)(ctx.projectDir, ctx.exp);
18
- if ((0, updates_1.isExpoUpdatesInstalled)(ctx.projectDir)) {
19
- await (0, UpdatesModule_1.configureUpdatesAsync)(ctx.projectDir, ctx.exp);
20
- }
21
- log_1.default.withTick('iOS project configured');
22
- }
23
- exports.configureIosAsync = configureIosAsync;
24
- async function validateAndSyncProjectConfigurationAsync({ projectDir, exp, buildProfile, buildSettings, }) {
9
+ async function syncProjectConfigurationAsync({ projectDir, exp, buildProfile, buildSettings, }) {
25
10
  const workflow = await (0, workflow_1.resolveWorkflowAsync)(projectDir, eas_build_job_1.Platform.IOS);
26
11
  const { autoIncrement } = buildProfile;
27
12
  const versionBumpStrategy = resolveVersionBumpStrategy(autoIncrement !== null && autoIncrement !== void 0 ? autoIncrement : false);
@@ -35,7 +20,7 @@ async function validateAndSyncProjectConfigurationAsync({ projectDir, exp, build
35
20
  await (0, version_1.bumpVersionInAppJsonAsync)({ projectDir, exp, bumpStrategy: versionBumpStrategy });
36
21
  }
37
22
  }
38
- exports.validateAndSyncProjectConfigurationAsync = validateAndSyncProjectConfigurationAsync;
23
+ exports.syncProjectConfigurationAsync = syncProjectConfigurationAsync;
39
24
  function resolveVersionBumpStrategy(autoIncrement) {
40
25
  if (autoIncrement === true) {
41
26
  return version_1.BumpStrategy.BUILD_NUMBER;
@@ -4,6 +4,7 @@ export interface LocalBuildOptions {
4
4
  skipCleanup?: boolean;
5
5
  skipNativeBuild?: boolean;
6
6
  artifactsDir?: string;
7
+ artifactPath?: string;
7
8
  workingdir?: string;
8
9
  verbose?: boolean;
9
10
  }
@@ -6,7 +6,7 @@ const spawn_async_1 = (0, tslib_1.__importDefault)(require("@expo/spawn-async"))
6
6
  const semver_1 = (0, 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 = '0.0.57';
9
+ const PLUGIN_PACKAGE_VERSION = '0.0.58';
10
10
  async function runLocalBuildAsync(job, options) {
11
11
  var _a;
12
12
  const { command, args } = await getCommandAndArgsAsync(job);
@@ -32,6 +32,7 @@ async function runLocalBuildAsync(job, options) {
32
32
  : {}),
33
33
  ...(options.skipNativeBuild ? { EAS_LOCAL_BUILD_SKIP_NATIVE_BUILD: '1' } : {}),
34
34
  ...(options.artifactsDir ? { EAS_LOCAL_BUILD_ARTIFACTS_DIR: options.artifactsDir } : {}),
35
+ ...(options.artifactPath ? { EAS_LOCAL_BUILD_ARTIFACT_PATH: options.artifactPath } : {}),
35
36
  },
36
37
  });
37
38
  childProcess = spawnPromise.child;