eas-cli 19.0.7 → 19.0.8

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.
@@ -1,4 +1,5 @@
1
1
  import EasCommand from '../commandUtils/EasCommand';
2
+ export declare function detectProjectSdkVersionAsync(projectDir: string): Promise<string | undefined>;
2
3
  export default class Go extends EasCommand {
3
4
  static description: string;
4
5
  static hidden: boolean;
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.detectProjectSdkVersionAsync = detectProjectSdkVersionAsync;
3
4
  const tslib_1 = require("tslib");
5
+ const config_1 = require("@expo/config");
4
6
  const apple_utils_1 = require("@expo/apple-utils");
5
7
  const core_1 = require("@oclif/core");
6
8
  const chalk_1 = tslib_1.__importDefault(require("chalk"));
@@ -23,6 +25,7 @@ const WorkflowRunQuery_1 = require("../graphql/queries/WorkflowRunQuery");
23
25
  const log_1 = tslib_1.__importStar(require("../log"));
24
26
  const prompts_1 = require("../prompts");
25
27
  const ora_1 = require("../ora");
28
+ const expoConfig_1 = require("../project/expoConfig");
26
29
  const fetchOrCreateProjectIDForWriteToConfigWithConfirmationAsync_1 = require("../project/fetchOrCreateProjectIDForWriteToConfigWithConfirmationAsync");
27
30
  const uploadAccountScopedFileAsync_1 = require("../project/uploadAccountScopedFileAsync");
28
31
  const uploadAccountScopedProjectSourceAsync_1 = require("../project/uploadAccountScopedProjectSourceAsync");
@@ -34,6 +37,18 @@ const bundleIdentifier_1 = require("../project/ios/bundleIdentifier");
34
37
  function deriveBundleIdSlug(bundleId) {
35
38
  return bundleId.split('.').filter(Boolean).pop();
36
39
  }
40
+ async function detectProjectSdkVersionAsync(projectDir) {
41
+ const paths = (0, config_1.getConfigFilePaths)(projectDir);
42
+ if (!paths.staticConfigPath && !paths.dynamicConfigPath) {
43
+ return;
44
+ }
45
+ try {
46
+ return (await (0, expoConfig_1.getPrivateExpoConfigAsync)(projectDir)).sdkVersion;
47
+ }
48
+ catch {
49
+ return;
50
+ }
51
+ }
37
52
  const TESTFLIGHT_GROUP_NAME = 'Team (Expo)';
38
53
  async function setupTestFlightAsync(ascApp) {
39
54
  let group;
@@ -150,7 +165,11 @@ class Go extends EasCommand_1.default {
150
165
  nonInteractive: false,
151
166
  });
152
167
  log_1.default.withTick(`Logged in as ${chalk_1.default.cyan((0, User_1.getActorDisplayName)(actor))}`);
153
- const sdkVersion = flags['sdk-version'];
168
+ const detectedSdkVersion = await detectProjectSdkVersionAsync(process.cwd());
169
+ if (detectedSdkVersion && !flags['sdk-version']) {
170
+ log_1.default.log(`Current project using SDK ${detectedSdkVersion.split('.')[0]}. Auto-selected same version. To use a different version, pass --sdk-version.`);
171
+ }
172
+ const sdkVersion = flags['sdk-version'] ?? detectedSdkVersion;
154
173
  const bundleId = flags['bundle-id'] ?? this.generateBundleId(actor);
155
174
  if (!(0, bundleIdentifier_1.isBundleIdentifierValid)(bundleId)) {
156
175
  throw new Error(`"${bundleId}" is not a valid iOS bundle identifier. ${bundleIdentifier_1.INVALID_BUNDLE_IDENTIFIER_MESSAGE} Pass a valid identifier with --bundle-id.`);
@@ -174,7 +193,8 @@ class Go extends EasCommand_1.default {
174
193
  setupSpinner.stop();
175
194
  log_1.default.markFreshLine();
176
195
  });
177
- const { workflowUrl, workflowRunId } = await this.dispatchWorkflowAsync(graphqlClient, projectId, actor, bundleId, appName, ascApp.id, sdkVersion, tmpDir, vcsClient);
196
+ const { workflowUrl, workflowRunId, sdkVersion: resolvedSdkVersion, } = await this.dispatchWorkflowAsync(graphqlClient, projectId, actor, bundleId, appName, ascApp.id, sdkVersion, tmpDir, vcsClient);
197
+ log_1.default.withTick(`Using Expo Go SDK ${chalk_1.default.cyan(resolvedSdkVersion.split('.')[0])}`);
178
198
  log_1.default.withTick(`Build started: ${chalk_1.default.cyan(workflowUrl)}`);
179
199
  const status = await this.monitorWorkflowJobsAsync(graphqlClient, workflowRunId);
180
200
  if (status === generated_1.WorkflowRunStatus.Failure) {
@@ -319,7 +339,7 @@ class Go extends EasCommand_1.default {
319
339
  },
320
340
  });
321
341
  const workflowUrl = (0, url_1.getWorkflowRunUrl)(account.name, deriveBundleIdSlug(bundleId), result.id);
322
- return { workflowUrl, workflowRunId: result.id };
342
+ return { workflowUrl, workflowRunId: result.id, sdkVersion: repackConfig.sdkVersion };
323
343
  }
324
344
  async monitorWorkflowJobsAsync(graphqlClient, workflowRunId) {
325
345
  const EXPECTED_BUILD_DURATION_SECONDS = 5 * 60;