eas-cli 20.5.0 → 20.5.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.
@@ -1,5 +1,5 @@
1
1
  import { ExpoConfig } from '@expo/config';
2
- import { Platform, Workflow } from '@expo/eas-build-job';
2
+ import { Env, Platform, Workflow } from '@expo/eas-build-job';
3
3
  import { BuildProfile, EasJson } from '@expo/eas-json';
4
4
  import { LoggerLevel } from '@expo/logger';
5
5
  import { NodePackageManager } from '@expo/package-manager';
@@ -60,5 +60,5 @@ export interface BuildContext<T extends Platform> {
60
60
  loggerLevel?: LoggerLevel;
61
61
  isVerboseLoggingEnabled: boolean;
62
62
  whatToTest?: string;
63
- env: Record<string, string>;
63
+ env: Env;
64
64
  }
@@ -1,4 +1,4 @@
1
- import { Platform } from '@expo/eas-build-job';
1
+ import { Env, Platform } from '@expo/eas-build-job';
2
2
  import { BuildProfile, EasJson, ResourceClass } from '@expo/eas-json';
3
3
  import { LoggerLevel } from '@expo/logger';
4
4
  import { BuildContext } from './context';
@@ -32,5 +32,5 @@ export declare function createBuildContextAsync<T extends Platform>({ buildProfi
32
32
  refreshAdHocProvisioningProfile?: boolean;
33
33
  isVerboseLoggingEnabled: boolean;
34
34
  whatToTest?: string;
35
- env: Record<string, string>;
35
+ env: Env;
36
36
  }): Promise<BuildContext<T>>;
@@ -1,4 +1,4 @@
1
- import { Job, Metadata } from '@expo/eas-build-job';
1
+ import { Env, Job, Metadata } from '@expo/eas-build-job';
2
2
  export declare enum LocalBuildMode {
3
3
  /**
4
4
  * Local build that users can run on their own machines. Instead
@@ -25,4 +25,4 @@ export interface LocalBuildOptions {
25
25
  workingdir?: string;
26
26
  verbose?: boolean;
27
27
  }
28
- export declare function runLocalBuildAsync(job: Job, metadata: Metadata, options: LocalBuildOptions, env: Record<string, string>): Promise<void>;
28
+ export declare function runLocalBuildAsync(job: Job, metadata: Metadata, options: LocalBuildOptions, env: Env): Promise<void>;
@@ -1,10 +1,10 @@
1
- import { Platform } from '@expo/eas-build-job';
1
+ import { Env, Platform } from '@expo/eas-build-job';
2
2
  import { Fingerprint } from './types';
3
3
  import { ExpoGraphqlClient } from '../commandUtils/context/contextUtils/createGraphqlClient';
4
4
  import { AppPlatform } from '../graphql/generated';
5
5
  import { Client } from '../vcs/vcs';
6
6
  export declare function getFingerprintInfoFromLocalProjectForPlatformsAsync(graphqlClient: ExpoGraphqlClient, projectDir: string, projectId: string, vcsClient: Client, platforms: AppPlatform[], { env }?: {
7
- env?: Record<string, string>;
7
+ env?: Env;
8
8
  }): Promise<Fingerprint>;
9
9
  export declare function appPlatformToPlatform(platform: AppPlatform): Platform;
10
10
  export declare function appPlatformToString(platform: AppPlatform): string;
@@ -1,9 +1,10 @@
1
+ import { Env } from '@expo/eas-build-job';
1
2
  import { JSONObject } from '@expo/json-file';
2
3
  import { Client } from '../../vcs/vcs';
3
4
  interface Target {
4
5
  buildConfiguration?: string;
5
6
  targetName: string;
6
7
  }
7
- export declare function getManagedApplicationTargetEntitlementsAsync(projectDir: string, env: Record<string, string>, vcsClient: Client): Promise<JSONObject>;
8
+ export declare function getManagedApplicationTargetEntitlementsAsync(projectDir: string, env: Env, vcsClient: Client): Promise<JSONObject>;
8
9
  export declare function getNativeTargetEntitlementsAsync(projectDir: string, target: Target): Promise<JSONObject | null>;
9
10
  export {};
@@ -1,4 +1,5 @@
1
1
  import { ExpoConfig } from '@expo/config';
2
+ import { Env } from '@expo/eas-build-job';
2
3
  import { XcodeBuildContext } from './scheme';
3
4
  import { ApplePlatform } from '../../credentials/ios/appstore/constants';
4
5
  import { Target } from '../../credentials/ios/types';
@@ -6,10 +7,23 @@ import { Client } from '../../vcs/vcs';
6
7
  interface ResolveTargetOptions {
7
8
  projectDir: string;
8
9
  exp: ExpoConfig;
9
- env?: Record<string, string>;
10
+ env?: Env;
10
11
  xcodeBuildContext: XcodeBuildContext;
11
12
  vcsClient: Client;
12
13
  }
14
+ /**
15
+ * For managed projects we don't have an Xcode project to read build settings
16
+ * from, but the @react-native-tvos/config-tv plugin signals a tvOS build via
17
+ * the EXPO_TV environment variable. That variable can come from the build
18
+ * profile's `env` in eas.json (the typical case, which flows in via `env`),
19
+ * or from the shell process when the user runs `EXPO_TV=1 eas build ...`
20
+ * (which is NOT included in the merged `env` upstream, so we read
21
+ * `process.env` directly as a fallback). When set, synthesize
22
+ * TARGETED_DEVICE_FAMILY=3 so getApplePlatformFromTarget (and every
23
+ * Apple-portal flow downstream) picks TV_OS for these targets instead of
24
+ * defaulting to IOS.
25
+ */
26
+ export declare function getManagedTvBuildSettings(env: Env | undefined): Target['buildSettings'] | undefined;
13
27
  export declare function resolveManagedProjectTargetsAsync({ exp, projectDir, xcodeBuildContext, env, vcsClient, }: ResolveTargetOptions): Promise<Target[]>;
14
28
  export declare function resolveBareProjectTargetsAsync({ exp, projectDir, xcodeBuildContext, vcsClient, }: ResolveTargetOptions): Promise<Target[]>;
15
29
  export declare function resolveTargetsAsync(opts: ResolveTargetOptions): Promise<Target[]>;
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getManagedTvBuildSettings = getManagedTvBuildSettings;
3
4
  exports.resolveManagedProjectTargetsAsync = resolveManagedProjectTargetsAsync;
4
5
  exports.resolveBareProjectTargetsAsync = resolveBareProjectTargetsAsync;
5
6
  exports.resolveTargetsAsync = resolveTargetsAsync;
@@ -22,6 +23,25 @@ const AppExtensionsConfigSchema = joi_1.default.array().items(joi_1.default.obje
22
23
  parentBundleIdentifier: joi_1.default.string(),
23
24
  entitlements: joi_1.default.object(),
24
25
  }));
26
+ /**
27
+ * For managed projects we don't have an Xcode project to read build settings
28
+ * from, but the @react-native-tvos/config-tv plugin signals a tvOS build via
29
+ * the EXPO_TV environment variable. That variable can come from the build
30
+ * profile's `env` in eas.json (the typical case, which flows in via `env`),
31
+ * or from the shell process when the user runs `EXPO_TV=1 eas build ...`
32
+ * (which is NOT included in the merged `env` upstream, so we read
33
+ * `process.env` directly as a fallback). When set, synthesize
34
+ * TARGETED_DEVICE_FAMILY=3 so getApplePlatformFromTarget (and every
35
+ * Apple-portal flow downstream) picks TV_OS for these targets instead of
36
+ * defaulting to IOS.
37
+ */
38
+ function getManagedTvBuildSettings(env) {
39
+ const expoTv = (env?.EXPO_TV ?? process.env.EXPO_TV ?? '').toString().toLowerCase();
40
+ if (expoTv === '1' || expoTv === 'true' || expoTv === 'yes') {
41
+ return { TARGETED_DEVICE_FAMILY: '3' };
42
+ }
43
+ return undefined;
44
+ }
25
45
  async function resolveManagedProjectTargetsAsync({ exp, projectDir, xcodeBuildContext, env, vcsClient, }) {
26
46
  const { buildScheme, buildConfiguration } = xcodeBuildContext;
27
47
  const applicationTargetName = buildScheme;
@@ -38,12 +58,14 @@ async function resolveManagedProjectTargetsAsync({ exp, projectDir, xcodeBuildCo
38
58
  if (error) {
39
59
  throw new Error(`Failed to validate "extra.eas.build.experimental.ios.appExtensions" in you app config.\n${error.message}`);
40
60
  }
61
+ const managedBuildSettings = getManagedTvBuildSettings(env);
41
62
  const extensionsTargets = appExtensions.map(extension => ({
42
63
  targetName: extension.targetName,
43
64
  buildConfiguration,
44
65
  bundleIdentifier: extension.bundleIdentifier,
45
66
  parentBundleIdentifier: extension.parentBundleIdentifier ?? applicationTargetBundleIdentifier,
46
67
  entitlements: extension.entitlements ?? {},
68
+ ...(managedBuildSettings && { buildSettings: managedBuildSettings }),
47
69
  }));
48
70
  return [
49
71
  {
@@ -51,6 +73,7 @@ async function resolveManagedProjectTargetsAsync({ exp, projectDir, xcodeBuildCo
51
73
  bundleIdentifier: applicationTargetBundleIdentifier,
52
74
  buildConfiguration,
53
75
  entitlements: applicationTargetEntitlements,
76
+ ...(managedBuildSettings && { buildSettings: managedBuildSettings }),
54
77
  },
55
78
  ...extensionsTargets,
56
79
  ];
@@ -1,5 +1,5 @@
1
1
  import { ExpoConfig } from '@expo/config';
2
- import { Platform } from '@expo/eas-build-job';
2
+ import { Env, Platform } from '@expo/eas-build-job';
3
3
  import { SubmitProfile } from '@expo/eas-json';
4
4
  import { Analytics, AnalyticsEventProperties } from '../analytics/AnalyticsManager';
5
5
  import { ExpoGraphqlClient } from '../commandUtils/context/contextUtils/createGraphqlClient';
@@ -37,7 +37,7 @@ export interface SubmitArchiveFlags {
37
37
  export declare function createSubmissionContextAsync<T extends Platform>(params: {
38
38
  archiveFlags: SubmitArchiveFlags;
39
39
  credentialsCtx?: CredentialsContext;
40
- env?: Record<string, string>;
40
+ env?: Env;
41
41
  nonInteractive: boolean;
42
42
  isVerboseFastlaneEnabled: boolean;
43
43
  groups: string[] | undefined;
@@ -4,10 +4,12 @@ export declare function maybeWarnAboutUsageOveragesAsync({ graphqlClient, accoun
4
4
  graphqlClient: ExpoGraphqlClient;
5
5
  accountId: string;
6
6
  }): Promise<void>;
7
- export declare function classifyUsageTier({ planValue, limit, overageCount, }: {
7
+ export declare function classifyUsageTier({ planValue, limit, overageCount, overageCostCents, hasFreePlan, }: {
8
8
  planValue: number;
9
9
  limit: number;
10
10
  overageCount: number;
11
+ overageCostCents: number;
12
+ hasFreePlan: boolean;
11
13
  }): UsageTier | null;
12
14
  export declare function calculatePercentUsed(value: number, limit: number): number;
13
15
  export declare function createProgressBar(percentUsed: number, width?: number): string;
@@ -25,15 +25,17 @@ async function maybeWarnAboutUsageOveragesAsync({ graphqlClient, accountId, }) {
25
25
  }
26
26
  const overageCount = buildMetrics.overageMetrics.reduce((sum, o) => sum + o.value, 0);
27
27
  const overageCostCents = buildMetrics.totalCost;
28
+ const hasFreePlan = subscription.name === 'Free';
28
29
  const tier = classifyUsageTier({
29
30
  planValue: planMetric.value,
30
31
  limit: planMetric.limit,
31
32
  overageCount,
33
+ overageCostCents,
34
+ hasFreePlan,
32
35
  });
33
36
  if (!tier) {
34
37
  return;
35
38
  }
36
- const hasFreePlan = subscription.name === 'Free';
37
39
  displayOverageWarning({
38
40
  tier,
39
41
  name,
@@ -49,8 +51,14 @@ async function maybeWarnAboutUsageOveragesAsync({ graphqlClient, accountId, }) {
49
51
  log_1.default.debug(`Failed to fetch usage data: ${error}`);
50
52
  }
51
53
  }
52
- function classifyUsageTier({ planValue, limit, overageCount, }) {
53
- if (overageCount > 0) {
54
+ function classifyUsageTier({ planValue, limit, overageCount, overageCostCents, hasFreePlan, }) {
55
+ // Only paid plans can incur pay-as-you-go overages, and only when there is an
56
+ // actual billable cost. Free plans are blocked at the limit and are never charged,
57
+ // so they can never be in an "over" state — a nonzero overage row (e.g. a usage
58
+ // rollup returned by the API) must not be treated as billable usage. Without this
59
+ // guard, free users well below their limit were shown a "you've reached your limit,
60
+ // upgrade to keep building" warning.
61
+ if (!hasFreePlan && overageCount > 0 && overageCostCents > 0) {
54
62
  return 'over';
55
63
  }
56
64
  if (limit > 0 && planValue >= limit) {