eas-cli 22.2.0 → 22.4.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.
- package/README.md +286 -205
- package/build/analytics/AnalyticsManager.d.ts +4 -1
- package/build/analytics/AnalyticsManager.js +5 -1
- package/build/billing/billingClient.d.ts +18 -0
- package/build/billing/billingClient.js +23 -0
- package/build/billing/openUrl.d.ts +4 -0
- package/build/billing/openUrl.js +29 -0
- package/build/billing/plans.d.ts +18 -0
- package/build/billing/plans.js +17 -0
- package/build/billing/resolveAccount.d.ts +17 -0
- package/build/billing/resolveAccount.js +92 -0
- package/build/build/build.d.ts +1 -1
- package/build/build/build.js +9 -3
- package/build/commandUtils/flags.d.ts +1 -1
- package/build/commands/billing/manage.d.ts +14 -0
- package/build/commands/billing/manage.js +63 -0
- package/build/commands/billing/subscribe.d.ts +18 -0
- package/build/commands/billing/subscribe.js +117 -0
- package/build/commands/env/create.d.ts +1 -1
- package/build/commands/env/delete.d.ts +1 -1
- package/build/commands/env/get.d.ts +1 -1
- package/build/commands/env/list.d.ts +1 -1
- package/build/commands/env/set.d.ts +1 -1
- package/build/commands/env/update.d.ts +1 -1
- package/build/commands/go.d.ts +0 -1
- package/build/commands/go.js +2 -16
- package/build/commands/simulator/index.d.ts +6 -0
- package/build/commands/simulator/index.js +47 -0
- package/build/graphql/generated.d.ts +55 -0
- package/build/graphql/queries/AccountQuery.d.ts +4 -5
- package/build/graphql/queries/AccountQuery.js +23 -0
- package/build/project/detectProjectSdkVersionAsync.d.ts +1 -0
- package/build/project/detectProjectSdkVersionAsync.js +17 -0
- package/build/simulator/expoGo.d.ts +4 -0
- package/build/simulator/expoGo.js +19 -0
- package/build/utils/usage/checkForOverages.js +6 -2
- package/oclif.manifest.json +2160 -1912
- package/package.json +7 -3
package/build/commands/go.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.detectProjectSdkVersionAsync = detectProjectSdkVersionAsync;
|
|
4
3
|
exports.toRepackTargetSdkVersion = toRepackTargetSdkVersion;
|
|
5
4
|
const tslib_1 = require("tslib");
|
|
6
|
-
const config_1 = require("@expo/config");
|
|
7
5
|
const core_1 = require("@oclif/core");
|
|
8
6
|
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
9
7
|
const fs = tslib_1.__importStar(require("fs-extra"));
|
|
@@ -27,7 +25,7 @@ const WorkflowRunQuery_1 = require("../graphql/queries/WorkflowRunQuery");
|
|
|
27
25
|
const log_1 = tslib_1.__importStar(require("../log"));
|
|
28
26
|
const prompts_1 = require("../prompts");
|
|
29
27
|
const ora_1 = require("../ora");
|
|
30
|
-
const
|
|
28
|
+
const detectProjectSdkVersionAsync_1 = require("../project/detectProjectSdkVersionAsync");
|
|
31
29
|
const fetchOrCreateProjectIDForWriteToConfigWithConfirmationAsync_1 = require("../project/fetchOrCreateProjectIDForWriteToConfigWithConfirmationAsync");
|
|
32
30
|
const uploadAccountScopedFileAsync_1 = require("../project/uploadAccountScopedFileAsync");
|
|
33
31
|
const uploadAccountScopedProjectSourceAsync_1 = require("../project/uploadAccountScopedProjectSourceAsync");
|
|
@@ -39,18 +37,6 @@ const bundleIdentifier_1 = require("../project/ios/bundleIdentifier");
|
|
|
39
37
|
function deriveBundleIdSlug(bundleId) {
|
|
40
38
|
return bundleId.split('.').filter(Boolean).pop();
|
|
41
39
|
}
|
|
42
|
-
async function detectProjectSdkVersionAsync(projectDir) {
|
|
43
|
-
const paths = (0, config_1.getConfigFilePaths)(projectDir);
|
|
44
|
-
if (!paths.staticConfigPath && !paths.dynamicConfigPath) {
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
try {
|
|
48
|
-
return (await (0, expoConfig_1.getPrivateExpoConfigAsync)(projectDir)).sdkVersion;
|
|
49
|
-
}
|
|
50
|
-
catch {
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
40
|
function toRepackTargetSdkVersion(sdkVersion) {
|
|
55
41
|
const coerced = semver_1.default.coerce(sdkVersion);
|
|
56
42
|
return coerced ? `${coerced.major}.0.0` : sdkVersion;
|
|
@@ -128,7 +114,7 @@ class Go extends EasCommand_1.default {
|
|
|
128
114
|
nonInteractive: false,
|
|
129
115
|
});
|
|
130
116
|
log_1.default.withTick(`Logged in as ${chalk_1.default.cyan((0, User_1.getActorDisplayName)(actor))}`);
|
|
131
|
-
const detectedSdkVersion = await detectProjectSdkVersionAsync(process.cwd());
|
|
117
|
+
const detectedSdkVersion = await (0, detectProjectSdkVersionAsync_1.detectProjectSdkVersionAsync)(process.cwd());
|
|
132
118
|
if (detectedSdkVersion && !flags['sdk-version']) {
|
|
133
119
|
log_1.default.log(`Current project using SDK ${detectedSdkVersion.split('.')[0]}. Auto-selected same version. To use a different version, pass --sdk-version.`);
|
|
134
120
|
}
|
|
@@ -9,6 +9,12 @@ export default class Simulator extends EasCommand {
|
|
|
9
9
|
platform: import("@oclif/core/lib/interfaces").OptionFlag<"android" | "ios" | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
10
10
|
name: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
11
|
device: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
12
|
+
'build-id': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
13
|
+
'application-archive-url': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
14
|
+
'expo-go': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
15
|
+
'sdk-version': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
16
|
+
'launch-arg': import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
17
|
+
'open-url': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
12
18
|
type: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
13
19
|
'package-version': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
14
20
|
'max-duration-minutes': import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
@@ -15,6 +15,7 @@ const log_1 = tslib_1.__importStar(require("../../log"));
|
|
|
15
15
|
const ora_1 = require("../../ora");
|
|
16
16
|
const prompts_1 = require("../../prompts");
|
|
17
17
|
const env_1 = require("../../simulator/env");
|
|
18
|
+
const expoGo_1 = require("../../simulator/expoGo");
|
|
18
19
|
const utils_1 = require("../../simulator/utils");
|
|
19
20
|
const json_1 = require("../../utils/json");
|
|
20
21
|
const promise_1 = require("../../utils/promise");
|
|
@@ -45,6 +46,28 @@ class Simulator extends EasCommand_1.default {
|
|
|
45
46
|
device: core_1.Flags.string({
|
|
46
47
|
description: 'Virtual device to start for the session. On iOS, a Simulator device name or UDID (e.g. "iPhone 16 Pro"). On Android, an AVD hardware profile id (e.g. "pixel_7"). Defaults to a device chosen by the runner.',
|
|
47
48
|
}),
|
|
49
|
+
'build-id': core_1.Flags.string({
|
|
50
|
+
description: 'EAS Build to install and launch before the simulator session is ready.',
|
|
51
|
+
exclusive: ['application-archive-url', 'expo-go'],
|
|
52
|
+
}),
|
|
53
|
+
'application-archive-url': core_1.Flags.string({
|
|
54
|
+
description: 'Application archive URL to download, install, and launch before the simulator session is ready.',
|
|
55
|
+
exclusive: ['build-id', 'expo-go'],
|
|
56
|
+
}),
|
|
57
|
+
'expo-go': core_1.Flags.boolean({
|
|
58
|
+
description: "Install and launch Expo Go matching the current project's Expo SDK before the simulator session is ready.",
|
|
59
|
+
exclusive: ['build-id', 'application-archive-url'],
|
|
60
|
+
}),
|
|
61
|
+
'sdk-version': core_1.Flags.string({
|
|
62
|
+
description: 'Expo SDK version used to select Expo Go when --expo-go is passed. Defaults to the current project SDK.',
|
|
63
|
+
}),
|
|
64
|
+
'launch-arg': core_1.Flags.string({
|
|
65
|
+
description: 'Argument passed to the installed application when it launches. Repeat for multiple arguments.',
|
|
66
|
+
multiple: true,
|
|
67
|
+
}),
|
|
68
|
+
'open-url': core_1.Flags.string({
|
|
69
|
+
description: 'Expo or development-client URL to open in the installed application after it launches.',
|
|
70
|
+
}),
|
|
48
71
|
type: core_1.Flags.option({
|
|
49
72
|
description: 'Type of simulator session to create',
|
|
50
73
|
options: Object.values(utils_1.DEVICE_RUN_SESSION_TYPE_FLAG_VALUES),
|
|
@@ -96,12 +119,29 @@ class Simulator extends EasCommand_1.default {
|
|
|
96
119
|
// --name as if it had been omitted rather than surfacing a validation error.
|
|
97
120
|
const name = flags.name?.trim() || undefined;
|
|
98
121
|
const deviceIdentifier = flags.device?.trim() || undefined;
|
|
122
|
+
const buildId = flags['build-id']?.trim() || undefined;
|
|
123
|
+
const applicationArchiveUrlFromFlag = flags['application-archive-url']?.trim() || undefined;
|
|
124
|
+
const sdkVersionFromFlag = flags['sdk-version']?.trim() || undefined;
|
|
125
|
+
const launchArgs = flags['launch-arg'];
|
|
126
|
+
const openUrl = flags['open-url']?.trim() || undefined;
|
|
127
|
+
if (sdkVersionFromFlag && !flags['expo-go']) {
|
|
128
|
+
throw new errors_1.EasCommandError('The --sdk-version flag can only be used with --expo-go.');
|
|
129
|
+
}
|
|
130
|
+
if ((launchArgs?.length || openUrl) &&
|
|
131
|
+
!buildId &&
|
|
132
|
+
!applicationArchiveUrlFromFlag &&
|
|
133
|
+
!flags['expo-go']) {
|
|
134
|
+
throw new errors_1.EasCommandError('Launch options require an application source. Pass --build-id, --application-archive-url, or --expo-go.');
|
|
135
|
+
}
|
|
99
136
|
await (0, env_1.loadSimulatorEnvAsync)(projectDir);
|
|
100
137
|
const existingDeviceRunSessionId = process.env[env_1.EAS_SIMULATOR_SESSION_ID];
|
|
101
138
|
if (existingDeviceRunSessionId && !flags.force) {
|
|
102
139
|
throw new Error(`Existing simulator session in environment. Use --force to create a new simulator session.`);
|
|
103
140
|
}
|
|
104
141
|
const platform = await resolvePlatformAsync(flags.platform, nonInteractive);
|
|
142
|
+
const expoGoSdkVersion = flags['expo-go']
|
|
143
|
+
? await (0, expoGo_1.resolveExpoGoSdkVersionAsync)({ projectDir, sdkVersion: sdkVersionFromFlag })
|
|
144
|
+
: undefined;
|
|
105
145
|
if (existingDeviceRunSessionId) {
|
|
106
146
|
log_1.default.warn(` Overwriting previous simulator session (id: ${existingDeviceRunSessionId}). ` +
|
|
107
147
|
`The previous remote session will continue running until stopped. ` +
|
|
@@ -120,6 +160,13 @@ class Simulator extends EasCommand_1.default {
|
|
|
120
160
|
type: utils_1.DEVICE_RUN_SESSION_TYPE_BY_FLAG_VALUE[flags.type],
|
|
121
161
|
packageVersion: flags['package-version'],
|
|
122
162
|
deviceIdentifier,
|
|
163
|
+
...(buildId ? { buildId } : {}),
|
|
164
|
+
...(applicationArchiveUrlFromFlag
|
|
165
|
+
? { applicationArchiveUrl: applicationArchiveUrlFromFlag }
|
|
166
|
+
: {}),
|
|
167
|
+
...(expoGoSdkVersion ? { expoGo: true, sdkVersion: expoGoSdkVersion } : {}),
|
|
168
|
+
...(launchArgs?.length ? { launchArgs } : {}),
|
|
169
|
+
...(openUrl ? { openUrl } : {}),
|
|
123
170
|
maxRunTimeMinutes: flags['max-duration-minutes'],
|
|
124
171
|
});
|
|
125
172
|
deviceRunSessionId = session.id;
|
|
@@ -4470,6 +4470,16 @@ export type CreateDeviceRunSessionEventLogUploadSessionResult = {
|
|
|
4470
4470
|
};
|
|
4471
4471
|
export type CreateDeviceRunSessionInput = {
|
|
4472
4472
|
appId: Scalars['ID']['input'];
|
|
4473
|
+
/**
|
|
4474
|
+
* Application archive URL to download, install, and launch before the simulator session
|
|
4475
|
+
* becomes available. Mutually exclusive with buildId and expoGo.
|
|
4476
|
+
*/
|
|
4477
|
+
applicationArchiveUrl?: InputMaybe<Scalars['String']['input']>;
|
|
4478
|
+
/**
|
|
4479
|
+
* EAS Build to install and launch before the simulator session becomes available.
|
|
4480
|
+
* Mutually exclusive with applicationArchiveUrl and expoGo.
|
|
4481
|
+
*/
|
|
4482
|
+
buildId?: InputMaybe<Scalars['ID']['input']>;
|
|
4473
4483
|
/**
|
|
4474
4484
|
* Identifier of the virtual device to start for the session. On iOS this is a
|
|
4475
4485
|
* Simulator device name or UDID (e.g. "iPhone 16 Pro"). On Android this is an
|
|
@@ -4477,6 +4487,17 @@ export type CreateDeviceRunSessionInput = {
|
|
|
4477
4487
|
* default device.
|
|
4478
4488
|
*/
|
|
4479
4489
|
deviceIdentifier?: InputMaybe<Scalars['String']['input']>;
|
|
4490
|
+
/**
|
|
4491
|
+
* Install and launch Expo Go before the simulator session becomes available. The server resolves
|
|
4492
|
+
* the platform-specific application archive. Mutually exclusive with buildId and
|
|
4493
|
+
* applicationArchiveUrl.
|
|
4494
|
+
*/
|
|
4495
|
+
expoGo?: InputMaybe<Scalars['Boolean']['input']>;
|
|
4496
|
+
/**
|
|
4497
|
+
* Arguments passed to the installed application when it is launched. Requires buildId,
|
|
4498
|
+
* applicationArchiveUrl, or expoGo.
|
|
4499
|
+
*/
|
|
4500
|
+
launchArgs?: InputMaybe<Array<Scalars['String']['input']>>;
|
|
4480
4501
|
/**
|
|
4481
4502
|
* Stop the session automatically after this many minutes without observed
|
|
4482
4503
|
* session activity. Must be positive and smaller than the session's maximum
|
|
@@ -4497,12 +4518,22 @@ export type CreateDeviceRunSessionInput = {
|
|
|
4497
4518
|
* session is unnamed and clients fall back to identifying it by id.
|
|
4498
4519
|
*/
|
|
4499
4520
|
name?: InputMaybe<Scalars['String']['input']>;
|
|
4521
|
+
/**
|
|
4522
|
+
* Expo or development-client URL to open after launching the installed application. Requires
|
|
4523
|
+
* buildId, applicationArchiveUrl, or expoGo.
|
|
4524
|
+
*/
|
|
4525
|
+
openUrl?: InputMaybe<Scalars['String']['input']>;
|
|
4500
4526
|
/**
|
|
4501
4527
|
* The version of the package backing the device run session (e.g. "0.1.3-alpha.3").
|
|
4502
4528
|
* If omitted, consumers treat the session as pinned to "latest".
|
|
4503
4529
|
*/
|
|
4504
4530
|
packageVersion?: InputMaybe<Scalars['String']['input']>;
|
|
4505
4531
|
platform: AppPlatform;
|
|
4532
|
+
/**
|
|
4533
|
+
* Expo SDK version used to select an Expo Go application archive. Only supported when expoGo is
|
|
4534
|
+
* true. If omitted, the current Expo Go archive for the platform is used.
|
|
4535
|
+
*/
|
|
4536
|
+
sdkVersion?: InputMaybe<Scalars['String']['input']>;
|
|
4506
4537
|
type: DeviceRunSessionType;
|
|
4507
4538
|
};
|
|
4508
4539
|
export type CreateEchoChatInput = {
|
|
@@ -16691,6 +16722,11 @@ export type AccountByNameQuery = {
|
|
|
16691
16722
|
__typename?: 'Account';
|
|
16692
16723
|
id: string;
|
|
16693
16724
|
name: string;
|
|
16725
|
+
viewerUserPermission: {
|
|
16726
|
+
__typename?: 'UserPermission';
|
|
16727
|
+
id: string;
|
|
16728
|
+
permissions: Array<Permission>;
|
|
16729
|
+
};
|
|
16694
16730
|
};
|
|
16695
16731
|
};
|
|
16696
16732
|
};
|
|
@@ -16952,6 +16988,25 @@ export type AccountBillingPeriodQuery = {
|
|
|
16952
16988
|
};
|
|
16953
16989
|
};
|
|
16954
16990
|
};
|
|
16991
|
+
export type AccountSubscriptionQueryVariables = Exact<{
|
|
16992
|
+
accountId: Scalars['String']['input'];
|
|
16993
|
+
}>;
|
|
16994
|
+
export type AccountSubscriptionQuery = {
|
|
16995
|
+
__typename?: 'RootQuery';
|
|
16996
|
+
account: {
|
|
16997
|
+
__typename?: 'AccountQuery';
|
|
16998
|
+
byId: {
|
|
16999
|
+
__typename?: 'Account';
|
|
17000
|
+
id: string;
|
|
17001
|
+
subscription?: {
|
|
17002
|
+
__typename?: 'SubscriptionDetails';
|
|
17003
|
+
id: string;
|
|
17004
|
+
name?: string | null;
|
|
17005
|
+
planId?: string | null;
|
|
17006
|
+
} | null;
|
|
17007
|
+
};
|
|
17008
|
+
};
|
|
17009
|
+
};
|
|
16955
17010
|
export type AppByIdQueryVariables = Exact<{
|
|
16956
17011
|
appId: Scalars['String']['input'];
|
|
16957
17012
|
}>;
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { ExpoGraphqlClient } from '../../commandUtils/context/contextUtils/createGraphqlClient';
|
|
2
|
-
import { AccountFullUsageQuery as AccountFullUsageQueryType, AccountUsageForOverageWarningQuery } from '../generated';
|
|
2
|
+
import { AccountByNameQuery as AccountByNameQueryType, AccountFullUsageQuery as AccountFullUsageQueryType, AccountSubscriptionQuery as AccountSubscriptionQueryType, AccountUsageForOverageWarningQuery } from '../generated';
|
|
3
3
|
export type AccountFullUsageData = NonNullable<AccountFullUsageQueryType['account']['byId']>;
|
|
4
|
+
export type AccountSubscriptionInfo = NonNullable<NonNullable<AccountSubscriptionQueryType['account']['byId']>['subscription']>;
|
|
4
5
|
export declare const AccountQuery: {
|
|
5
|
-
getByNameAsync(graphqlClient: ExpoGraphqlClient, accountName: string): Promise<
|
|
6
|
-
id: string;
|
|
7
|
-
name: string;
|
|
8
|
-
} | null>;
|
|
6
|
+
getByNameAsync(graphqlClient: ExpoGraphqlClient, accountName: string): Promise<AccountByNameQueryType["account"]["byName"] | null>;
|
|
9
7
|
getFullUsageAsync(graphqlClient: ExpoGraphqlClient, accountId: string, currentDate: Date, startDate: Date, endDate: Date): Promise<AccountFullUsageData>;
|
|
10
8
|
getUsageForOverageWarningAsync(graphqlClient: ExpoGraphqlClient, accountId: string, currentDate: Date): Promise<AccountUsageForOverageWarningQuery["account"]["byId"]>;
|
|
11
9
|
getBillingPeriodAsync(graphqlClient: ExpoGraphqlClient, accountId: string, currentDate: Date): Promise<{
|
|
12
10
|
start: Date;
|
|
13
11
|
end: Date;
|
|
14
12
|
}>;
|
|
13
|
+
getSubscriptionAsync(graphqlClient: ExpoGraphqlClient, accountId: string): Promise<AccountSubscriptionInfo | null>;
|
|
15
14
|
};
|
|
@@ -15,6 +15,10 @@ exports.AccountQuery = {
|
|
|
15
15
|
byName(accountName: $accountName) {
|
|
16
16
|
id
|
|
17
17
|
name
|
|
18
|
+
viewerUserPermission {
|
|
19
|
+
id
|
|
20
|
+
permissions
|
|
21
|
+
}
|
|
18
22
|
}
|
|
19
23
|
}
|
|
20
24
|
}
|
|
@@ -205,4 +209,23 @@ exports.AccountQuery = {
|
|
|
205
209
|
end: new Date(end),
|
|
206
210
|
};
|
|
207
211
|
},
|
|
212
|
+
async getSubscriptionAsync(graphqlClient, accountId) {
|
|
213
|
+
const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
|
|
214
|
+
.query((0, graphql_tag_1.default) `
|
|
215
|
+
query AccountSubscription($accountId: String!) {
|
|
216
|
+
account {
|
|
217
|
+
byId(accountId: $accountId) {
|
|
218
|
+
id
|
|
219
|
+
subscription {
|
|
220
|
+
id
|
|
221
|
+
name
|
|
222
|
+
planId
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
`, { accountId }, { additionalTypenames: ['Account', 'SubscriptionDetails'] })
|
|
228
|
+
.toPromise());
|
|
229
|
+
return data.account.byId?.subscription ?? null;
|
|
230
|
+
},
|
|
208
231
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function detectProjectSdkVersionAsync(projectDir: string): Promise<string | undefined>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.detectProjectSdkVersionAsync = detectProjectSdkVersionAsync;
|
|
4
|
+
const config_1 = require("@expo/config");
|
|
5
|
+
const expoConfig_1 = require("./expoConfig");
|
|
6
|
+
async function detectProjectSdkVersionAsync(projectDir) {
|
|
7
|
+
const paths = (0, config_1.getConfigFilePaths)(projectDir);
|
|
8
|
+
if (!paths.staticConfigPath && !paths.dynamicConfigPath) {
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
try {
|
|
12
|
+
return (await (0, expoConfig_1.getPrivateExpoConfigAsync)(projectDir)).sdkVersion;
|
|
13
|
+
}
|
|
14
|
+
catch {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolveExpoGoSdkVersionAsync = resolveExpoGoSdkVersionAsync;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const semver_1 = tslib_1.__importDefault(require("semver"));
|
|
6
|
+
const errors_1 = require("../commandUtils/errors");
|
|
7
|
+
const detectProjectSdkVersionAsync_1 = require("../project/detectProjectSdkVersionAsync");
|
|
8
|
+
async function resolveExpoGoSdkVersionAsync({ projectDir, sdkVersion: sdkVersionFromFlag, }) {
|
|
9
|
+
const sdkVersion = sdkVersionFromFlag ?? (await (0, detectProjectSdkVersionAsync_1.detectProjectSdkVersionAsync)(projectDir));
|
|
10
|
+
const sdkMajorVersion = semver_1.default.coerce(sdkVersion)?.major;
|
|
11
|
+
if (!sdkMajorVersion) {
|
|
12
|
+
if (sdkVersionFromFlag) {
|
|
13
|
+
throw new errors_1.EasCommandError(`Unable to parse Expo SDK version "${sdkVersionFromFlag}". Pass a major or semantic version, such as --sdk-version 57.`);
|
|
14
|
+
}
|
|
15
|
+
throw new errors_1.EasCommandError("Unable to determine this project's Expo SDK version, so Expo Go could not be selected. " +
|
|
16
|
+
'Make sure the project has Expo installed and a valid app config, or use --build-id or --application-archive-url instead.');
|
|
17
|
+
}
|
|
18
|
+
return `${sdkMajorVersion}.0.0`;
|
|
19
|
+
}
|
|
@@ -7,6 +7,7 @@ exports.createProgressBar = createProgressBar;
|
|
|
7
7
|
exports.displayOverageWarning = displayOverageWarning;
|
|
8
8
|
const tslib_1 = require("tslib");
|
|
9
9
|
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
10
|
+
const plans_1 = require("../../billing/plans");
|
|
10
11
|
const AccountQuery_1 = require("../../graphql/queries/AccountQuery");
|
|
11
12
|
const log_1 = tslib_1.__importStar(require("../../log"));
|
|
12
13
|
const APPROACHING_THRESHOLD_PERCENT = 80;
|
|
@@ -93,6 +94,7 @@ function formatCents(cents) {
|
|
|
93
94
|
}
|
|
94
95
|
function displayOverageWarning({ tier, name, hasFreePlan, planValue, limit, overageCount, overageCostCents, }) {
|
|
95
96
|
const billingUrl = `https://expo.dev/accounts/${name}/settings/billing`;
|
|
97
|
+
const upgradeHint = ` Run ${(0, plans_1.formatStarterSubscribeCommand)(name)} to upgrade to the Starter plan.`;
|
|
96
98
|
if (tier === 'approaching') {
|
|
97
99
|
const percentUsed = calculatePercentUsed(planValue, limit);
|
|
98
100
|
log_1.default.warn(chalk_1.default.bold(`You've used ${percentUsed}% of your included build credits this billing period.`) +
|
|
@@ -100,7 +102,8 @@ function displayOverageWarning({ tier, name, hasFreePlan, planValue, limit, over
|
|
|
100
102
|
createProgressBar(percentUsed));
|
|
101
103
|
log_1.default.warn(hasFreePlan
|
|
102
104
|
? "You won't be able to start new builds once you reach the limit. " +
|
|
103
|
-
(0, log_1.link)(billingUrl, { text: 'Upgrade your plan to continue service.', dim: false })
|
|
105
|
+
(0, log_1.link)(billingUrl, { text: 'Upgrade your plan to continue service.', dim: false }) +
|
|
106
|
+
upgradeHint
|
|
104
107
|
: 'Additional usage beyond your limit will be charged at pay-as-you-go rates. ' +
|
|
105
108
|
(0, log_1.link)(billingUrl, { text: 'See usage in billing.', dim: false }));
|
|
106
109
|
return;
|
|
@@ -111,7 +114,8 @@ function displayOverageWarning({ tier, name, hasFreePlan, planValue, limit, over
|
|
|
111
114
|
log_1.default.warn(chalk_1.default.bold("You've reached your included build credits this billing period."));
|
|
112
115
|
log_1.default.warn(hasFreePlan
|
|
113
116
|
? 'New builds are blocked until your billing period resets. ' +
|
|
114
|
-
(0, log_1.link)(billingUrl, { text: 'Upgrade your plan to continue building.', dim: false })
|
|
117
|
+
(0, log_1.link)(billingUrl, { text: 'Upgrade your plan to continue building.', dim: false }) +
|
|
118
|
+
upgradeHint
|
|
115
119
|
: 'Additional builds will be charged at pay-as-you-go rates. ' +
|
|
116
120
|
(0, log_1.link)(billingUrl, { text: 'See usage in billing.', dim: false }));
|
|
117
121
|
return;
|