eas-cli 25.3.0 → 26.0.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 +198 -198
- package/build/build/createContext.d.ts +4 -3
- package/build/build/createContext.js +1 -4
- package/build/build/runBuildAndSubmit.d.ts +7 -2
- package/build/build/runBuildAndSubmit.js +9 -8
- package/build/commandUtils/context/DynamicProjectConfigContextField.d.ts +2 -2
- package/build/commandUtils/context/DynamicProjectConfigContextField.js +40 -61
- package/build/commandUtils/context/LoggedInContextField.js +1 -2
- package/build/commandUtils/context/MaybeLoggedInContextField.js +1 -2
- package/build/commandUtils/context/OptionalPrivateProjectConfigContextField.js +3 -1
- package/build/commandUtils/context/PrivateProjectConfigContextField.js +3 -1
- package/build/commandUtils/context/contextUtils/getProjectIdAsync.d.ts +1 -0
- package/build/commandUtils/context/contextUtils/getProjectIdAsync.js +5 -2
- package/build/commands/browse.js +1 -1
- package/build/commands/build/dev.js +3 -3
- package/build/commands/channel/delete.js +1 -1
- package/build/commands/channel/rollout.js +1 -1
- package/build/commands/credentials/configure-build.js +1 -1
- package/build/commands/deploy/alias/delete.js +1 -1
- package/build/commands/deploy/alias/index.js +1 -1
- package/build/commands/deploy/delete.js +1 -1
- package/build/commands/go.js +1 -1
- package/build/commands/observe/event.js +1 -1
- package/build/commands/observe/events.js +1 -1
- package/build/commands/project/new.js +1 -1
- package/build/commands/simulator/control.js +1 -1
- package/build/commands/simulator/get.js +14 -1
- package/build/commands/simulator/index.js +12 -4
- package/build/commands/workflow/cancel.js +1 -1
- package/build/commands/workflow/list.js +1 -1
- package/build/commands/workflow/logs.js +1 -1
- package/build/commands/workflow/run.js +1 -1
- package/build/commands/workflow/status.js +1 -1
- package/build/commands/workflow/view.js +1 -1
- package/build/graphql/generated.d.ts +146 -112
- package/build/graphql/generated.js +18 -8
- package/build/graphql/queries/DeviceRunSessionQuery.d.ts +8 -1
- package/build/graphql/queries/DeviceRunSessionQuery.js +67 -0
- package/build/simulator/jobRunErrors.d.ts +22 -0
- package/build/simulator/jobRunErrors.js +134 -0
- package/build/user/SessionManager.d.ts +10 -0
- package/build/user/SessionManager.js +12 -0
- package/oclif.manifest.json +411 -411
- package/package.json +7 -7
|
@@ -1,17 +1,17 @@
|
|
|
1
|
+
import { ExpoConfig } from '@expo/config';
|
|
1
2
|
import { Env, Platform } from '@expo/eas-build-job';
|
|
2
3
|
import { BuildProfile, EasJson, ResourceClass } from '@expo/eas-json';
|
|
3
4
|
import { LoggerLevel } from '@expo/logger';
|
|
4
5
|
import { BuildContext } from './context';
|
|
5
6
|
import { LocalBuildOptions } from './local';
|
|
6
7
|
import { Analytics } from '../analytics/AnalyticsManager';
|
|
7
|
-
import { DynamicConfigContextFn } from '../commandUtils/context/DynamicProjectConfigContextField';
|
|
8
8
|
import { ExpoGraphqlClient } from '../commandUtils/context/contextUtils/createGraphqlClient';
|
|
9
9
|
import { LazyExperimentationClient } from '../experimentation/LazyExperimentationClient';
|
|
10
10
|
import { CustomBuildConfigMetadata } from '../project/customBuildConfig';
|
|
11
11
|
import { LoggedInAuthenticationInfo } from '../user/SessionManager';
|
|
12
12
|
import { Actor } from '../user/User';
|
|
13
13
|
import { Client } from '../vcs/vcs';
|
|
14
|
-
export declare function createBuildContextAsync<T extends Platform>({ buildProfileName, buildProfile, easJsonCliConfig, clearCache, localBuildOptions, nonInteractive, noWait, platform, projectDir, resourceClassFlag, message, actor, graphqlClient, analytics, vcsClient,
|
|
14
|
+
export declare function createBuildContextAsync<T extends Platform>({ buildProfileName, buildProfile, easJsonCliConfig, clearCache, localBuildOptions, nonInteractive, noWait, platform, projectDir, resourceClassFlag, message, actor, graphqlClient, analytics, vcsClient, exp, projectId, customBuildConfigMetadata, buildLoggerLevel, freezeCredentials, refreshAdHocProvisioningProfile: refreshAdHocProvisioningProfileFlag, isVerboseLoggingEnabled, whatToTest, env, experimentation, authenticationInfo, }: {
|
|
15
15
|
buildProfileName: string;
|
|
16
16
|
buildProfile: BuildProfile<T>;
|
|
17
17
|
easJsonCliConfig: EasJson['cli'];
|
|
@@ -27,7 +27,8 @@ export declare function createBuildContextAsync<T extends Platform>({ buildProfi
|
|
|
27
27
|
graphqlClient: ExpoGraphqlClient;
|
|
28
28
|
analytics: Analytics;
|
|
29
29
|
vcsClient: Client;
|
|
30
|
-
|
|
30
|
+
exp: ExpoConfig;
|
|
31
|
+
projectId: string;
|
|
31
32
|
customBuildConfigMetadata?: CustomBuildConfigMetadata;
|
|
32
33
|
buildLoggerLevel?: LoggerLevel;
|
|
33
34
|
freezeCredentials: boolean;
|
|
@@ -16,10 +16,7 @@ const AnalyticsManager_1 = require("../analytics/AnalyticsManager");
|
|
|
16
16
|
const context_1 = require("../credentials/context");
|
|
17
17
|
const projectUtils_1 = require("../project/projectUtils");
|
|
18
18
|
const workflow_1 = require("../project/workflow");
|
|
19
|
-
async function createBuildContextAsync({ buildProfileName, buildProfile, easJsonCliConfig, clearCache = false, localBuildOptions, nonInteractive, noWait, platform, projectDir, resourceClassFlag, message, actor, graphqlClient, analytics, vcsClient,
|
|
20
|
-
const { exp, projectId } = await getDynamicPrivateProjectConfigAsync({
|
|
21
|
-
env,
|
|
22
|
-
});
|
|
19
|
+
async function createBuildContextAsync({ buildProfileName, buildProfile, easJsonCliConfig, clearCache = false, localBuildOptions, nonInteractive, noWait, platform, projectDir, resourceClassFlag, message, actor, graphqlClient, analytics, vcsClient, exp, projectId, customBuildConfigMetadata, buildLoggerLevel, freezeCredentials, refreshAdHocProvisioningProfile: refreshAdHocProvisioningProfileFlag, isVerboseLoggingEnabled, whatToTest, env, experimentation, authenticationInfo, }) {
|
|
23
20
|
const projectName = exp.slug;
|
|
24
21
|
const [account, workflow] = await Promise.all([
|
|
25
22
|
(0, projectUtils_1.getOwnerAccountForProjectIdAsync)(graphqlClient, projectId),
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ExpoConfig } from '@expo/config';
|
|
1
2
|
import { Env } from '@expo/eas-build-job';
|
|
2
3
|
import { ResourceClass } from '@expo/eas-json';
|
|
3
4
|
import { LoggerLevel } from '@expo/logger';
|
|
@@ -32,7 +33,7 @@ export interface BuildFlags {
|
|
|
32
33
|
whatToTest?: string;
|
|
33
34
|
simulator?: SimulatorRunTarget;
|
|
34
35
|
}
|
|
35
|
-
export declare function runBuildAndSubmitAsync({ graphqlClient, analytics, vcsClient, projectDir, flags, actor, getDynamicPrivateProjectConfigAsync, downloadSimBuildAutoConfirm,
|
|
36
|
+
export declare function runBuildAndSubmitAsync({ graphqlClient, analytics, vcsClient, projectDir, flags, actor, getDynamicPrivateProjectConfigAsync, downloadSimBuildAutoConfirm, evaluatedConfig, experimentation, authenticationInfo, }: {
|
|
36
37
|
graphqlClient: ExpoGraphqlClient;
|
|
37
38
|
analytics: Analytics;
|
|
38
39
|
vcsClient: Client;
|
|
@@ -41,7 +42,11 @@ export declare function runBuildAndSubmitAsync({ graphqlClient, analytics, vcsCl
|
|
|
41
42
|
actor: Actor;
|
|
42
43
|
getDynamicPrivateProjectConfigAsync: DynamicConfigContextFn;
|
|
43
44
|
downloadSimBuildAutoConfirm?: boolean;
|
|
44
|
-
|
|
45
|
+
evaluatedConfig?: {
|
|
46
|
+
env: Env;
|
|
47
|
+
exp: ExpoConfig;
|
|
48
|
+
projectId: string;
|
|
49
|
+
};
|
|
45
50
|
/** Enables the Free plan limit experiments on the build request error path. */
|
|
46
51
|
experimentation?: LazyExperimentationClient;
|
|
47
52
|
/** Lets the Free plan limit checkout experiment create a checkout session. */
|
|
@@ -49,7 +49,7 @@ let metroConfigValidated = false;
|
|
|
49
49
|
let sdkVersionChecked = false;
|
|
50
50
|
let lockfileChecked = false;
|
|
51
51
|
let hasWarnedAboutUsageOverages = false;
|
|
52
|
-
async function runBuildAndSubmitAsync({ graphqlClient, analytics, vcsClient, projectDir, flags, actor, getDynamicPrivateProjectConfigAsync, downloadSimBuildAutoConfirm,
|
|
52
|
+
async function runBuildAndSubmitAsync({ graphqlClient, analytics, vcsClient, projectDir, flags, actor, getDynamicPrivateProjectConfigAsync, downloadSimBuildAutoConfirm, evaluatedConfig, experimentation, authenticationInfo, }) {
|
|
53
53
|
await vcsClient.ensureRepoExistsAsync();
|
|
54
54
|
await (0, repository_1.ensureRepoIsCleanAsync)(vcsClient, flags.nonInteractive);
|
|
55
55
|
await (0, configure_1.ensureProjectConfiguredAsync)({
|
|
@@ -106,15 +106,14 @@ async function runBuildAndSubmitAsync({ graphqlClient, analytics, vcsClient, pro
|
|
|
106
106
|
const buildCtxByPlatform = {};
|
|
107
107
|
for (const buildProfile of buildProfiles) {
|
|
108
108
|
const platform = (0, AppPlatform_1.toAppPlatform)(buildProfile.platform);
|
|
109
|
-
const { env } =
|
|
110
|
-
|
|
109
|
+
const { env, exp, projectId } = evaluatedConfig ??
|
|
110
|
+
(await (0, evaluateConfigWithEnvVarsAsync_1.evaluateConfigWithEnvVarsAsync)({
|
|
111
111
|
buildProfile: buildProfile.profile,
|
|
112
112
|
buildProfileName: buildProfile.profileName,
|
|
113
113
|
graphqlClient,
|
|
114
114
|
getProjectConfig: getDynamicPrivateProjectConfigAsync,
|
|
115
115
|
opts: { env: buildProfile.profile.env },
|
|
116
|
-
})
|
|
117
|
-
: { env: envOverride };
|
|
116
|
+
}));
|
|
118
117
|
const { build: maybeBuild, buildCtx } = await prepareAndStartBuildAsync({
|
|
119
118
|
projectDir,
|
|
120
119
|
flags,
|
|
@@ -125,7 +124,8 @@ async function runBuildAndSubmitAsync({ graphqlClient, analytics, vcsClient, pro
|
|
|
125
124
|
graphqlClient,
|
|
126
125
|
analytics,
|
|
127
126
|
vcsClient,
|
|
128
|
-
|
|
127
|
+
exp,
|
|
128
|
+
projectId,
|
|
129
129
|
customBuildConfigMetadata: customBuildConfigMetadataByPlatform[platform],
|
|
130
130
|
env,
|
|
131
131
|
easJsonAccessor,
|
|
@@ -224,7 +224,7 @@ async function runBuildAndSubmitAsync({ graphqlClient, analytics, vcsClient, pro
|
|
|
224
224
|
buildProfiles,
|
|
225
225
|
};
|
|
226
226
|
}
|
|
227
|
-
async function prepareAndStartBuildAsync({ projectDir, flags, moreBuilds, buildProfile, easJsonCliConfig, actor, graphqlClient, analytics, vcsClient,
|
|
227
|
+
async function prepareAndStartBuildAsync({ projectDir, flags, moreBuilds, buildProfile, easJsonCliConfig, actor, graphqlClient, analytics, vcsClient, exp, projectId, customBuildConfigMetadata, env, easJsonAccessor, experimentation, authenticationInfo, }) {
|
|
228
228
|
const buildCtx = await (0, createContext_1.createBuildContextAsync)({
|
|
229
229
|
buildProfileName: buildProfile.profileName,
|
|
230
230
|
resourceClassFlag: flags.resourceClass,
|
|
@@ -241,7 +241,8 @@ async function prepareAndStartBuildAsync({ projectDir, flags, moreBuilds, buildP
|
|
|
241
241
|
graphqlClient,
|
|
242
242
|
analytics,
|
|
243
243
|
vcsClient,
|
|
244
|
-
|
|
244
|
+
exp,
|
|
245
|
+
projectId,
|
|
245
246
|
customBuildConfigMetadata,
|
|
246
247
|
buildLoggerLevel: flags.buildLoggerLevel ?? (log_1.default.isDebug ? logger_1.LoggerLevel.DEBUG : undefined),
|
|
247
248
|
freezeCredentials: flags.freezeCredentials,
|
|
@@ -7,8 +7,8 @@ export type DynamicConfigContextFn = (options?: ExpoConfigOptions) => Promise<{
|
|
|
7
7
|
projectDir: string;
|
|
8
8
|
}>;
|
|
9
9
|
export declare class DynamicPublicProjectConfigContextField extends ContextField<DynamicConfigContextFn> {
|
|
10
|
-
getValueAsync(
|
|
10
|
+
getValueAsync(options: ContextOptions): Promise<DynamicConfigContextFn>;
|
|
11
11
|
}
|
|
12
12
|
export declare class DynamicPrivateProjectConfigContextField extends ContextField<DynamicConfigContextFn> {
|
|
13
|
-
getValueAsync(
|
|
13
|
+
getValueAsync(options: ContextOptions): Promise<DynamicConfigContextFn>;
|
|
14
14
|
}
|
|
@@ -9,76 +9,55 @@ const getProjectIdAsync_1 = require("./contextUtils/getProjectIdAsync");
|
|
|
9
9
|
const loadServerSideEnvironmentVariablesAsync_1 = require("./contextUtils/loadServerSideEnvironmentVariablesAsync");
|
|
10
10
|
const expoConfig_1 = require("../../project/expoConfig");
|
|
11
11
|
class DynamicPublicProjectConfigContextField extends ContextField_1.default {
|
|
12
|
-
async getValueAsync(
|
|
13
|
-
|
|
14
|
-
return async (options) => {
|
|
15
|
-
const expBefore = await (0, expoConfig_1.getPublicExpoConfigAsync)(projectDir, options);
|
|
16
|
-
const projectId = await (0, getProjectIdAsync_1.getProjectIdAsync)(sessionManager, expBefore, {
|
|
17
|
-
nonInteractive,
|
|
18
|
-
env: options?.env,
|
|
19
|
-
});
|
|
20
|
-
if (withServerSideEnvironment) {
|
|
21
|
-
const { authenticationInfo } = await sessionManager.ensureLoggedInAsync({
|
|
22
|
-
nonInteractive,
|
|
23
|
-
});
|
|
24
|
-
const graphqlClient = (0, createGraphqlClient_1.createGraphqlClient)(authenticationInfo);
|
|
25
|
-
const serverSideEnvironmentVariables = await (0, loadServerSideEnvironmentVariablesAsync_1.loadServerSideEnvironmentVariablesAsync)({
|
|
26
|
-
environment: withServerSideEnvironment,
|
|
27
|
-
projectId,
|
|
28
|
-
graphqlClient,
|
|
29
|
-
});
|
|
30
|
-
options = {
|
|
31
|
-
...options,
|
|
32
|
-
env: {
|
|
33
|
-
...options?.env,
|
|
34
|
-
...serverSideEnvironmentVariables,
|
|
35
|
-
},
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
const exp = await (0, expoConfig_1.getPublicExpoConfigAsync)(projectDir, options);
|
|
39
|
-
return {
|
|
40
|
-
exp,
|
|
41
|
-
projectDir,
|
|
42
|
-
projectId,
|
|
43
|
-
};
|
|
44
|
-
};
|
|
12
|
+
async getValueAsync(options) {
|
|
13
|
+
return await createDynamicConfigFnAsync(expoConfig_1.getPublicExpoConfigAsync, options);
|
|
45
14
|
}
|
|
46
15
|
}
|
|
47
16
|
exports.DynamicPublicProjectConfigContextField = DynamicPublicProjectConfigContextField;
|
|
48
17
|
class DynamicPrivateProjectConfigContextField extends ContextField_1.default {
|
|
49
|
-
async getValueAsync(
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
18
|
+
async getValueAsync(options) {
|
|
19
|
+
return await createDynamicConfigFnAsync(expoConfig_1.getPrivateExpoConfigAsync, options);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.DynamicPrivateProjectConfigContextField = DynamicPrivateProjectConfigContextField;
|
|
23
|
+
async function createDynamicConfigFnAsync(getExpoConfigAsync, { nonInteractive, sessionManager, withServerSideEnvironment }) {
|
|
24
|
+
const projectDir = await (0, findProjectDirAndVerifyProjectSetupAsync_1.findProjectDirAndVerifyProjectSetupAsync)();
|
|
25
|
+
return async (options) => {
|
|
26
|
+
const expBefore = await getExpoConfigAsync(projectDir, options);
|
|
27
|
+
const projectId = await (0, getProjectIdAsync_1.getProjectIdAsync)(sessionManager, expBefore, {
|
|
28
|
+
nonInteractive,
|
|
29
|
+
env: options?.env,
|
|
30
|
+
});
|
|
31
|
+
if (withServerSideEnvironment) {
|
|
32
|
+
const { authenticationInfo } = await sessionManager.ensureLoggedInAsync({
|
|
54
33
|
nonInteractive,
|
|
55
|
-
env: options?.env,
|
|
56
34
|
});
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
},
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
const exp = await (0, expoConfig_1.getPrivateExpoConfigAsync)(projectDir, options);
|
|
35
|
+
const graphqlClient = (0, createGraphqlClient_1.createGraphqlClient)(authenticationInfo);
|
|
36
|
+
const serverSideEnvironmentVariables = await (0, loadServerSideEnvironmentVariablesAsync_1.loadServerSideEnvironmentVariablesAsync)({
|
|
37
|
+
environment: withServerSideEnvironment,
|
|
38
|
+
projectId,
|
|
39
|
+
graphqlClient,
|
|
40
|
+
});
|
|
41
|
+
options = {
|
|
42
|
+
...options,
|
|
43
|
+
env: {
|
|
44
|
+
...options?.env,
|
|
45
|
+
...serverSideEnvironmentVariables,
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
else if ((0, getProjectIdAsync_1.isProjectIdInAppConfig)(expBefore, projectId)) {
|
|
76
50
|
return {
|
|
77
|
-
exp,
|
|
51
|
+
exp: expBefore,
|
|
78
52
|
projectDir,
|
|
79
53
|
projectId,
|
|
80
54
|
};
|
|
55
|
+
}
|
|
56
|
+
const exp = await getExpoConfigAsync(projectDir, options);
|
|
57
|
+
return {
|
|
58
|
+
exp,
|
|
59
|
+
projectDir,
|
|
60
|
+
projectId,
|
|
81
61
|
};
|
|
82
|
-
}
|
|
62
|
+
};
|
|
83
63
|
}
|
|
84
|
-
exports.DynamicPrivateProjectConfigContextField = DynamicPrivateProjectConfigContextField;
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const ContextField_1 = tslib_1.__importDefault(require("./ContextField"));
|
|
5
|
-
const createGraphqlClient_1 = require("./contextUtils/createGraphqlClient");
|
|
6
5
|
const FeatureGateEnvOverrides_1 = tslib_1.__importDefault(require("../gating/FeatureGateEnvOverrides"));
|
|
7
6
|
const FeatureGating_1 = tslib_1.__importDefault(require("../gating/FeatureGating"));
|
|
8
7
|
class LoggedInContextField extends ContextField_1.default {
|
|
@@ -11,7 +10,7 @@ class LoggedInContextField extends ContextField_1.default {
|
|
|
11
10
|
nonInteractive,
|
|
12
11
|
});
|
|
13
12
|
const featureGateServerValues = actor?.featureGates ?? {};
|
|
14
|
-
const graphqlClient =
|
|
13
|
+
const graphqlClient = sessionManager.getGraphqlClient(authenticationInfo);
|
|
15
14
|
return {
|
|
16
15
|
actor,
|
|
17
16
|
featureGating: new FeatureGating_1.default(featureGateServerValues, new FeatureGateEnvOverrides_1.default()),
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const ContextField_1 = tslib_1.__importDefault(require("./ContextField"));
|
|
5
|
-
const createGraphqlClient_1 = require("./contextUtils/createGraphqlClient");
|
|
6
5
|
const FeatureGateEnvOverrides_1 = tslib_1.__importDefault(require("../gating/FeatureGateEnvOverrides"));
|
|
7
6
|
const FeatureGating_1 = tslib_1.__importDefault(require("../gating/FeatureGating"));
|
|
8
7
|
class MaybeLoggedInContextField extends ContextField_1.default {
|
|
@@ -11,7 +10,7 @@ class MaybeLoggedInContextField extends ContextField_1.default {
|
|
|
11
10
|
accessToken: sessionManager.getAccessToken(),
|
|
12
11
|
sessionSecret: sessionManager.getSessionSecret(),
|
|
13
12
|
};
|
|
14
|
-
const graphqlClient =
|
|
13
|
+
const graphqlClient = sessionManager.getGraphqlClient(authenticationInfo);
|
|
15
14
|
const actor = await sessionManager.getUserAsync();
|
|
16
15
|
const featureGateServerValues = actor?.featureGates ?? {};
|
|
17
16
|
return {
|
|
@@ -41,7 +41,9 @@ class OptionalPrivateProjectConfigContextField extends ContextField_1.default {
|
|
|
41
41
|
});
|
|
42
42
|
serverSideEnvVars = serverSideEnvironmentVariables;
|
|
43
43
|
}
|
|
44
|
-
const exp =
|
|
44
|
+
const exp = withServerSideEnvironment || !(0, getProjectIdAsync_1.isProjectIdInAppConfig)(expBefore, projectId)
|
|
45
|
+
? await (0, expoConfig_1.getPrivateExpoConfigAsync)(projectDir, { env: serverSideEnvVars })
|
|
46
|
+
: expBefore;
|
|
45
47
|
return {
|
|
46
48
|
exp,
|
|
47
49
|
projectDir,
|
|
@@ -28,7 +28,9 @@ class PrivateProjectConfigContextField extends ContextField_1.default {
|
|
|
28
28
|
});
|
|
29
29
|
serverSideEnvVars = serverSideEnvironmentVariables;
|
|
30
30
|
}
|
|
31
|
-
const exp =
|
|
31
|
+
const exp = withServerSideEnvironment || !(0, getProjectIdAsync_1.isProjectIdInAppConfig)(expBefore, projectId)
|
|
32
|
+
? await (0, expoConfig_1.getPrivateExpoConfigAsync)(projectDir, { env: serverSideEnvVars })
|
|
33
|
+
: expBefore;
|
|
32
34
|
return {
|
|
33
35
|
projectId,
|
|
34
36
|
exp,
|
|
@@ -26,6 +26,7 @@ export declare function getProjectIdAsync(sessionManager: SessionManager, exp: E
|
|
|
26
26
|
env?: Env;
|
|
27
27
|
nonInteractive: boolean;
|
|
28
28
|
}): Promise<string>;
|
|
29
|
+
export declare function isProjectIdInAppConfig(exp: Pick<ExpoConfig, 'extra'>, projectId: string): boolean;
|
|
29
30
|
export declare function validateOrSetProjectIdAsync({ exp, graphqlClient, actor, options, cwd, }: {
|
|
30
31
|
exp: ExpoConfig;
|
|
31
32
|
graphqlClient: ExpoGraphqlClient;
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.saveProjectIdToAppConfigAsync = saveProjectIdToAppConfigAsync;
|
|
4
4
|
exports.getProjectIdAsync = getProjectIdAsync;
|
|
5
|
+
exports.isProjectIdInAppConfig = isProjectIdInAppConfig;
|
|
5
6
|
exports.validateOrSetProjectIdAsync = validateOrSetProjectIdAsync;
|
|
6
7
|
const tslib_1 = require("tslib");
|
|
7
8
|
const config_1 = require("@expo/config");
|
|
8
9
|
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
9
10
|
const semver_1 = tslib_1.__importDefault(require("semver"));
|
|
10
|
-
const createGraphqlClient_1 = require("./createGraphqlClient");
|
|
11
11
|
const findProjectDirAndVerifyProjectSetupAsync_1 = require("./findProjectDirAndVerifyProjectSetupAsync");
|
|
12
12
|
const AppQuery_1 = require("../../../graphql/queries/AppQuery");
|
|
13
13
|
const log_1 = tslib_1.__importStar(require("../../../log"));
|
|
@@ -67,10 +67,13 @@ async function getProjectIdAsync(sessionManager, exp, options) {
|
|
|
67
67
|
const { actor, authenticationInfo } = await sessionManager.ensureLoggedInAsync({
|
|
68
68
|
nonInteractive: options.nonInteractive,
|
|
69
69
|
});
|
|
70
|
-
const graphqlClient =
|
|
70
|
+
const graphqlClient = sessionManager.getGraphqlClient(authenticationInfo);
|
|
71
71
|
const projectId = await validateOrSetProjectIdAsync({ exp, graphqlClient, actor, options });
|
|
72
72
|
return projectId;
|
|
73
73
|
}
|
|
74
|
+
function isProjectIdInAppConfig(exp, projectId) {
|
|
75
|
+
return exp.extra?.eas?.projectId === projectId;
|
|
76
|
+
}
|
|
74
77
|
async function validateOrSetProjectIdAsync({ exp, graphqlClient, actor, options, cwd, }) {
|
|
75
78
|
const localProjectId = exp.extra?.eas?.projectId;
|
|
76
79
|
if (localProjectId) {
|
package/build/commands/browse.js
CHANGED
|
@@ -29,7 +29,7 @@ const PROJECT_PAGES = {
|
|
|
29
29
|
settings: 'settings',
|
|
30
30
|
};
|
|
31
31
|
class Browse extends EasCommand_1.default {
|
|
32
|
-
static description = '
|
|
32
|
+
static description = 'transition from the terminal to the web browser to view and interact with your project on https://expo.dev';
|
|
33
33
|
static args = {
|
|
34
34
|
page: core_1.Args.string({
|
|
35
35
|
description: 'Project subpage to open. Defaults to the project dashboard.',
|
|
@@ -84,7 +84,7 @@ class BuildDev extends EasCommand_1.default {
|
|
|
84
84
|
vcsClient,
|
|
85
85
|
});
|
|
86
86
|
const workflow = await (0, workflow_1.resolveWorkflowAsync)(projectDir, platform, vcsClient);
|
|
87
|
-
const
|
|
87
|
+
const evaluatedConfig = await (0, evaluateConfigWithEnvVarsAsync_1.evaluateConfigWithEnvVarsAsync)({
|
|
88
88
|
buildProfile: buildProfile.profile,
|
|
89
89
|
buildProfileName: buildProfile.profileName,
|
|
90
90
|
graphqlClient,
|
|
@@ -92,7 +92,7 @@ class BuildDev extends EasCommand_1.default {
|
|
|
92
92
|
opts: { env: buildProfile.profile.env },
|
|
93
93
|
});
|
|
94
94
|
const fingerprint = await (0, cli_1.createFingerprintAsync)(projectDir, {
|
|
95
|
-
env,
|
|
95
|
+
env: evaluatedConfig.env,
|
|
96
96
|
workflow,
|
|
97
97
|
platforms: [platform],
|
|
98
98
|
});
|
|
@@ -157,7 +157,7 @@ class BuildDev extends EasCommand_1.default {
|
|
|
157
157
|
actor,
|
|
158
158
|
getDynamicPrivateProjectConfigAsync,
|
|
159
159
|
downloadSimBuildAutoConfirm: true,
|
|
160
|
-
|
|
160
|
+
evaluatedConfig,
|
|
161
161
|
});
|
|
162
162
|
if (!flags['skip-bundler']) {
|
|
163
163
|
await this.startDevServerAsync({ projectDir, platform });
|
|
@@ -12,7 +12,7 @@ const prompts_1 = require("../../prompts");
|
|
|
12
12
|
const json_1 = require("../../utils/json");
|
|
13
13
|
const pollForBackgroundJobReceiptAsync_1 = require("../../utils/pollForBackgroundJobReceiptAsync");
|
|
14
14
|
class ChannelDelete extends EasCommand_1.default {
|
|
15
|
-
static description = '
|
|
15
|
+
static description = 'delete a channel';
|
|
16
16
|
static args = {
|
|
17
17
|
name: core_1.Args.string({
|
|
18
18
|
required: false,
|
|
@@ -17,7 +17,7 @@ var ActionRawFlagValue;
|
|
|
17
17
|
ActionRawFlagValue["VIEW"] = "view";
|
|
18
18
|
})(ActionRawFlagValue || (ActionRawFlagValue = {}));
|
|
19
19
|
class ChannelRollout extends EasCommand_1.default {
|
|
20
|
-
static description = '
|
|
20
|
+
static description = 'roll a new branch out on a channel incrementally';
|
|
21
21
|
static args = {
|
|
22
22
|
channel: core_1.Args.string({
|
|
23
23
|
description: 'channel on which the rollout should be done',
|
|
@@ -8,7 +8,7 @@ const SelectBuildProfileFromEasJson_1 = require("../../credentials/manager/Selec
|
|
|
8
8
|
const SetUpBuildCredentialsCommandAction_1 = require("../../credentials/manager/SetUpBuildCredentialsCommandAction");
|
|
9
9
|
const platform_1 = require("../../platform");
|
|
10
10
|
class InitializeBuildCredentials extends EasCommand_1.default {
|
|
11
|
-
static description = '
|
|
11
|
+
static description = 'set up credentials for building your project';
|
|
12
12
|
static flags = {
|
|
13
13
|
platform: core_1.Flags.option({
|
|
14
14
|
char: 'p',
|
|
@@ -11,7 +11,7 @@ const prompts_1 = require("../../../prompts");
|
|
|
11
11
|
const json_1 = require("../../../utils/json");
|
|
12
12
|
const deployment_1 = require("../../../worker/deployment");
|
|
13
13
|
class WorkerAliasDelete extends EasCommand_1.default {
|
|
14
|
-
static description = '
|
|
14
|
+
static description = 'delete deployment aliases';
|
|
15
15
|
static aliases = ['worker:alias:delete'];
|
|
16
16
|
static state = 'preview';
|
|
17
17
|
static args = {
|
|
@@ -12,7 +12,7 @@ const json_1 = require("../../../utils/json");
|
|
|
12
12
|
const deployment_1 = require("../../../worker/deployment");
|
|
13
13
|
const logs_1 = require("../../../worker/utils/logs");
|
|
14
14
|
class WorkerAlias extends EasCommand_1.default {
|
|
15
|
-
static description = '
|
|
15
|
+
static description = 'assign deployment aliases';
|
|
16
16
|
static aliases = ['worker:alias', 'deploy:promote'];
|
|
17
17
|
static state = 'preview';
|
|
18
18
|
static flags = {
|
|
@@ -11,7 +11,7 @@ const prompts_1 = require("../../prompts");
|
|
|
11
11
|
const json_1 = require("../../utils/json");
|
|
12
12
|
const deployment_1 = require("../../worker/deployment");
|
|
13
13
|
class WorkerDelete extends EasCommand_1.default {
|
|
14
|
-
static description = '
|
|
14
|
+
static description = 'delete a deployment';
|
|
15
15
|
static aliases = ['worker:delete'];
|
|
16
16
|
static state = 'preview';
|
|
17
17
|
static args = {
|
package/build/commands/go.js
CHANGED
|
@@ -83,7 +83,7 @@ async function withSuppressedOutputAsync(fn) {
|
|
|
83
83
|
}
|
|
84
84
|
/* eslint-enable no-console */
|
|
85
85
|
class Go extends EasCommand_1.default {
|
|
86
|
-
static description = '
|
|
86
|
+
static description = 'create a custom Expo Go and submit to TestFlight';
|
|
87
87
|
static hidden = true;
|
|
88
88
|
static flags = {
|
|
89
89
|
'bundle-id': core_1.Flags.string({
|
|
@@ -15,7 +15,7 @@ const formatEvents_1 = require("../../observe/formatEvents");
|
|
|
15
15
|
const planGating_1 = require("../../observe/planGating");
|
|
16
16
|
const json_1 = require("../../utils/json");
|
|
17
17
|
class ObserveEvent extends EasCommand_1.default {
|
|
18
|
-
static description = 'display a single Observe event (metric, log, or error) by its ID. IDs are included in event data when the `--json` flag is passed to `eas observe:session`, `eas observe:metrics`, or `eas observe:events
|
|
18
|
+
static description = 'display a single Observe event (metric, log, or error) by its ID. IDs are included in event data when the `--json` flag is passed to `eas observe:session`, `eas observe:metrics`, or `eas observe:events`';
|
|
19
19
|
static args = {
|
|
20
20
|
id: core_1.Args.string({
|
|
21
21
|
description: 'ID of the event to display',
|
|
@@ -16,7 +16,7 @@ const startAndEndTime_1 = require("../../observe/startAndEndTime");
|
|
|
16
16
|
const json_1 = require("../../utils/json");
|
|
17
17
|
const DEFAULT_EVENTS_LIMIT = 10;
|
|
18
18
|
class ObserveEvents extends EasCommand_1.default {
|
|
19
|
-
static description = 'display individual events emitted by the app via `logEvent`, filtered by the event name in the argument. With no arguments, a list of the available event names and associated event counts is returned
|
|
19
|
+
static description = 'display individual events emitted by the app via `logEvent`, filtered by the event name in the argument. With no arguments, a list of the available event names and associated event counts is returned';
|
|
20
20
|
static args = {
|
|
21
21
|
eventName: core_1.Args.string({
|
|
22
22
|
description: 'Event name to filter by',
|
|
@@ -71,7 +71,7 @@ async function generateProjectFilesAsync(projectDir, app, packageManager) {
|
|
|
71
71
|
}
|
|
72
72
|
class New extends EasCommand_1.default {
|
|
73
73
|
static aliases = ['new'];
|
|
74
|
-
static description = '
|
|
74
|
+
static description = 'create a new project configured with Expo Application Services (EAS)';
|
|
75
75
|
static args = {
|
|
76
76
|
path: core_1.Args.string({
|
|
77
77
|
description: 'Path to create the project (defaults to current directory)',
|
|
@@ -17,7 +17,7 @@ const utils_1 = require("../../simulator/utils");
|
|
|
17
17
|
const json_1 = require("../../utils/json");
|
|
18
18
|
class SimulatorControl extends EasCommand_1.default {
|
|
19
19
|
static aliases = ['sim:control'];
|
|
20
|
-
static description = '[EXPERIMENTAL] run a serve-sim action on a remote iOS simulator session on EAS. Run without an action to list the actions the session supports. To save a screenshot locally, run `eas simulator:control screenshot.capture --output ./screenshot.png
|
|
20
|
+
static description = '[EXPERIMENTAL] run a serve-sim action on a remote iOS simulator session on EAS. Run without an action to list the actions the session supports. To save a screenshot locally, run `eas simulator:control screenshot.capture --output ./screenshot.png`';
|
|
21
21
|
static strict = false;
|
|
22
22
|
static examples = [
|
|
23
23
|
'$ eas simulator:control',
|
|
@@ -10,13 +10,14 @@ const DeviceRunSessionQuery_1 = require("../../graphql/queries/DeviceRunSessionQ
|
|
|
10
10
|
const log_1 = tslib_1.__importStar(require("../../log"));
|
|
11
11
|
const ora_1 = require("../../ora");
|
|
12
12
|
const env_1 = require("../../simulator/env");
|
|
13
|
+
const jobRunErrors_1 = require("../../simulator/jobRunErrors");
|
|
13
14
|
const utils_1 = require("../../simulator/utils");
|
|
14
15
|
const files_1 = require("../../utils/files");
|
|
15
16
|
const formatFields_1 = tslib_1.__importDefault(require("../../utils/formatFields"));
|
|
16
17
|
const json_1 = require("../../utils/json");
|
|
17
18
|
class SimulatorGet extends EasCommand_1.default {
|
|
18
19
|
static aliases = ['sim:get'];
|
|
19
|
-
static description = "[EXPERIMENTAL] get info about a remote simulator session on EAS by its simulator session ID. Preview links follow the session's saved sharing preference
|
|
20
|
+
static description = "[EXPERIMENTAL] get info about a remote simulator session on EAS by its simulator session ID. Preview links follow the session's saved sharing preference";
|
|
20
21
|
static flags = {
|
|
21
22
|
id: core_1.Flags.string({
|
|
22
23
|
description: `Simulator session ID. Defaults to ${env_1.SIMULATOR_DOTENV_FILE_NAME}.`,
|
|
@@ -53,6 +54,10 @@ class SimulatorGet extends EasCommand_1.default {
|
|
|
53
54
|
}
|
|
54
55
|
const deviceRunSessionUrl = (0, url_1.getDeviceRunSessionUrl)(session.app.ownerAccount.name, session.app.slug, session.id);
|
|
55
56
|
const deviceRunSessionPreviewUrl = (0, url_1.getDeviceRunSessionPreviewUrl)(session.app.ownerAccount.name, session.app.slug, session.id);
|
|
57
|
+
const errors = session.status === generated_1.DeviceRunSessionStatus.Errored ||
|
|
58
|
+
session.turtleJobRun?.status === generated_1.JobRunStatus.Errored
|
|
59
|
+
? await (0, jobRunErrors_1.fetchSimulatorSessionErrorsAsync)(graphqlClient, session.id)
|
|
60
|
+
: [];
|
|
56
61
|
if (jsonFlag) {
|
|
57
62
|
(0, json_1.printJsonOnlyOutput)({
|
|
58
63
|
id: session.id,
|
|
@@ -70,11 +75,19 @@ class SimulatorGet extends EasCommand_1.default {
|
|
|
70
75
|
? (0, utils_1.sanitizeRemoteConfigForJson)(session.remoteConfig, deviceRunSessionPreviewUrl, session.publicPreview)
|
|
71
76
|
: session.remoteConfig,
|
|
72
77
|
artifacts: session.artifacts,
|
|
78
|
+
errors,
|
|
73
79
|
});
|
|
74
80
|
return;
|
|
75
81
|
}
|
|
76
82
|
log_1.default.newLine();
|
|
77
83
|
log_1.default.log(formatSessionFields(session, deviceRunSessionUrl));
|
|
84
|
+
if (errors.length > 0) {
|
|
85
|
+
log_1.default.newLine();
|
|
86
|
+
log_1.default.gray('Session errors:');
|
|
87
|
+
for (const error of errors) {
|
|
88
|
+
log_1.default.error(` ${(0, jobRunErrors_1.formatSimulatorSessionError)(error)}`);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
78
91
|
if (session.status === generated_1.DeviceRunSessionStatus.InProgress) {
|
|
79
92
|
log_1.default.newLine();
|
|
80
93
|
if (session.remoteConfig) {
|
|
@@ -21,6 +21,7 @@ const frameAncestors_1 = require("../../simulator/frameAncestors");
|
|
|
21
21
|
const networkCapture_1 = require("../../simulator/networkCapture");
|
|
22
22
|
const env_1 = require("../../simulator/env");
|
|
23
23
|
const expoGo_1 = require("../../simulator/expoGo");
|
|
24
|
+
const jobRunErrors_1 = require("../../simulator/jobRunErrors");
|
|
24
25
|
const requestAnalytics_1 = require("../../simulator/requestAnalytics");
|
|
25
26
|
const utils_1 = require("../../simulator/utils");
|
|
26
27
|
const json_1 = require("../../utils/json");
|
|
@@ -40,7 +41,7 @@ const APP_PLATFORM_BY_FLAG_VALUE = {
|
|
|
40
41
|
class Simulator extends EasCommand_1.default {
|
|
41
42
|
static aliases = ['simulator:start', 'sim:start'];
|
|
42
43
|
static hiddenAliases = ['sim'];
|
|
43
|
-
static description = '[EXPERIMENTAL] start a remote simulator session on EAS and get instructions to connect to it. The default browser preview link requires sign-in
|
|
44
|
+
static description = '[EXPERIMENTAL] start a remote simulator session on EAS and get instructions to connect to it. The default browser preview link requires sign-in';
|
|
44
45
|
static flags = {
|
|
45
46
|
platform: core_1.Flags.option({
|
|
46
47
|
char: 'p',
|
|
@@ -341,13 +342,13 @@ class Simulator extends EasCommand_1.default {
|
|
|
341
342
|
}
|
|
342
343
|
if (session.status === generated_1.DeviceRunSessionStatus.Errored ||
|
|
343
344
|
session.status === generated_1.DeviceRunSessionStatus.Stopped) {
|
|
344
|
-
throw new Error(`Simulator session ${deviceRunSessionId} ${session.status.toLowerCase()} before the ${flags.type} session was ready. ${(0, log_1.link)(deviceRunSessionUrl)}`);
|
|
345
|
+
throw new Error(`Simulator session ${deviceRunSessionId} ${session.status.toLowerCase()} before the ${flags.type} session was ready. ${(0, log_1.link)(deviceRunSessionUrl)}${await formatJobRunErrorsAsync(graphqlClient, deviceRunSessionId, sessionInterrupt.signal)}`);
|
|
345
346
|
}
|
|
346
347
|
const jobRunStatus = session.turtleJobRun?.status;
|
|
347
348
|
if (jobRunStatus === generated_1.JobRunStatus.Errored ||
|
|
348
349
|
jobRunStatus === generated_1.JobRunStatus.Canceled ||
|
|
349
350
|
jobRunStatus === generated_1.JobRunStatus.Finished) {
|
|
350
|
-
throw new Error(`Turtle job run for simulator session ${deviceRunSessionId} ${jobRunStatus.toLowerCase()} before the ${flags.type} session was ready. ${(0, log_1.link)(deviceRunSessionUrl)}`);
|
|
351
|
+
throw new Error(`Turtle job run for simulator session ${deviceRunSessionId} ${jobRunStatus.toLowerCase()} before the ${flags.type} session was ready. ${(0, log_1.link)(deviceRunSessionUrl)}${await formatJobRunErrorsAsync(graphqlClient, deviceRunSessionId, sessionInterrupt.signal)}`);
|
|
351
352
|
}
|
|
352
353
|
if (session.remoteConfig) {
|
|
353
354
|
remoteConfig = session.remoteConfig;
|
|
@@ -479,6 +480,13 @@ class Simulator extends EasCommand_1.default {
|
|
|
479
480
|
}
|
|
480
481
|
}
|
|
481
482
|
exports.default = Simulator;
|
|
483
|
+
// Returns the reasons the session's job run failed, one per line, or an empty string when none are available.
|
|
484
|
+
async function formatJobRunErrorsAsync(graphqlClient, deviceRunSessionId, signal) {
|
|
485
|
+
const errors = await (0, jobRunErrors_1.fetchSimulatorSessionErrorsAsync)(graphqlClient, deviceRunSessionId, {
|
|
486
|
+
signal,
|
|
487
|
+
});
|
|
488
|
+
return errors.map(error => `\n${(0, jobRunErrors_1.formatSimulatorSessionError)(error)}`).join('');
|
|
489
|
+
}
|
|
482
490
|
async function resolvePlatformAsync(platform, nonInteractive) {
|
|
483
491
|
if (platform) {
|
|
484
492
|
return APP_PLATFORM_BY_FLAG_VALUE[platform];
|
|
@@ -528,7 +536,7 @@ async function waitForSessionEndOrInterruptAsync({ graphqlClient, deviceRunSessi
|
|
|
528
536
|
if (session.status === generated_1.DeviceRunSessionStatus.Errored ||
|
|
529
537
|
jobRunStatus === generated_1.JobRunStatus.Errored) {
|
|
530
538
|
spinner.fail(`Simulator session errored. ${(0, log_1.link)(deviceRunSessionUrl)}`);
|
|
531
|
-
throw new Error(`Simulator session ${deviceRunSessionId} errored
|
|
539
|
+
throw new Error(`Simulator session ${deviceRunSessionId} errored.${await formatJobRunErrorsAsync(graphqlClient, deviceRunSessionId, signal)}`);
|
|
532
540
|
}
|
|
533
541
|
if (session.status === generated_1.DeviceRunSessionStatus.Stopped ||
|
|
534
542
|
jobRunStatus === generated_1.JobRunStatus.Canceled ||
|
|
@@ -10,7 +10,7 @@ const AppQuery_1 = require("../../graphql/queries/AppQuery");
|
|
|
10
10
|
const log_1 = tslib_1.__importDefault(require("../../log"));
|
|
11
11
|
const prompts_1 = require("../../prompts");
|
|
12
12
|
class WorkflowRunCancel extends EasCommand_1.default {
|
|
13
|
-
static description = '
|
|
13
|
+
static description = 'cancel one or more workflow runs. If no workflow run IDs are provided, you will be prompted to select IN_PROGRESS runs to cancel';
|
|
14
14
|
static strict = false;
|
|
15
15
|
static contextDefinition = {
|
|
16
16
|
...this.ContextOptions.ProjectId,
|