eas-cli 25.2.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 +234 -216
- package/build/analytics/AnalyticsManager.d.ts +1 -0
- package/build/analytics/AnalyticsManager.js +1 -0
- package/build/billing/resolveAccount.d.ts +12 -0
- package/build/billing/resolveAccount.js +1 -0
- package/build/build/build.d.ts +2 -1
- package/build/build/build.js +12 -11
- package/build/build/context.d.ts +2 -0
- package/build/build/createContext.d.ts +6 -3
- package/build/build/createContext.js +2 -4
- package/build/build/freeTierLimitCheckout.d.ts +39 -0
- package/build/build/freeTierLimitCheckout.js +106 -0
- package/build/build/runBuildAndSubmit.d.ts +11 -3
- package/build/build/runBuildAndSubmit.js +11 -8
- package/build/build/utils/url.d.ts +1 -0
- package/build/build/utils/url.js +4 -0
- package/build/commandUtils/EasCommand.js +3 -1
- 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/commandUtils/errors.d.ts +5 -1
- package/build/commandUtils/errors.js +4 -3
- package/build/commands/browse.js +1 -1
- package/build/commands/build/dev.js +3 -3
- package/build/commands/build/index.js +2 -1
- 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.d.ts +1 -0
- package/build/commands/simulator/index.js +30 -8
- 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 +275 -268
- package/package.json +7 -7
|
@@ -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) {
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
export declare class EasCommandError extends Error {
|
|
2
|
-
|
|
2
|
+
/** True when the command already printed the message, so `EasCommand.catch` must not print it again. */
|
|
3
|
+
readonly messageAlreadyPrinted: boolean;
|
|
4
|
+
constructor(message: string, { messageAlreadyPrinted }?: {
|
|
5
|
+
messageAlreadyPrinted?: boolean;
|
|
6
|
+
});
|
|
3
7
|
}
|
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.EasCommandError = void 0;
|
|
4
4
|
class EasCommandError extends Error {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
constructor(message) {
|
|
5
|
+
/** True when the command already printed the message, so `EasCommand.catch` must not print it again. */
|
|
6
|
+
messageAlreadyPrinted;
|
|
7
|
+
constructor(message, { messageAlreadyPrinted = false } = {}) {
|
|
8
8
|
super(message);
|
|
9
|
+
this.messageAlreadyPrinted = messageAlreadyPrinted;
|
|
9
10
|
}
|
|
10
11
|
}
|
|
11
12
|
exports.EasCommandError = EasCommandError;
|
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 });
|
|
@@ -116,7 +116,7 @@ class Build extends EasCommand_1.default {
|
|
|
116
116
|
(0, json_1.enableJsonOutput)();
|
|
117
117
|
}
|
|
118
118
|
const flags = this.sanitizeFlags(rawFlags);
|
|
119
|
-
const { loggedIn: { actor, graphqlClient }, getDynamicPrivateProjectConfigAsync, projectDir, analytics, vcsClient, experimentation, } = await this.getContextAsync(Build, {
|
|
119
|
+
const { loggedIn: { actor, graphqlClient, authenticationInfo }, getDynamicPrivateProjectConfigAsync, projectDir, analytics, vcsClient, experimentation, } = await this.getContextAsync(Build, {
|
|
120
120
|
nonInteractive: flags.nonInteractive,
|
|
121
121
|
withServerSideEnvironment: null,
|
|
122
122
|
});
|
|
@@ -136,6 +136,7 @@ class Build extends EasCommand_1.default {
|
|
|
136
136
|
actor,
|
|
137
137
|
getDynamicPrivateProjectConfigAsync,
|
|
138
138
|
experimentation,
|
|
139
|
+
authenticationInfo,
|
|
139
140
|
});
|
|
140
141
|
this.maybeSuggestUsingEasBuildDev({
|
|
141
142
|
buildProfiles,
|
|
@@ -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) {
|
|
@@ -10,6 +10,7 @@ export default class Simulator extends EasCommand {
|
|
|
10
10
|
name: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
11
|
tag: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
12
12
|
device: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
13
|
+
'system-image': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
13
14
|
'build-id': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
14
15
|
'build-fingerprint': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
15
16
|
'application-archive-url': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
@@ -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',
|
|
@@ -57,6 +58,9 @@ class Simulator extends EasCommand_1.default {
|
|
|
57
58
|
device: core_1.Flags.string({
|
|
58
59
|
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.',
|
|
59
60
|
}),
|
|
61
|
+
'system-image': core_1.Flags.string({
|
|
62
|
+
description: 'Android SDK system image package to use for the emulator (e.g. "system-images;android-35-ext15;google_apis_playstore;x86_64"). Defaults to a system image chosen by the runner. Only supported with --platform android.',
|
|
63
|
+
}),
|
|
60
64
|
'build-id': core_1.Flags.string({
|
|
61
65
|
description: 'EAS Build to install and launch before the simulator session is ready.',
|
|
62
66
|
exclusive: ['build-fingerprint', 'application-archive-url', 'expo-go'],
|
|
@@ -173,6 +177,7 @@ class Simulator extends EasCommand_1.default {
|
|
|
173
177
|
const name = flags.name?.trim() || undefined;
|
|
174
178
|
const tags = flags.tag?.map(tag => tag.trim()).filter(tag => tag.length > 0);
|
|
175
179
|
const deviceIdentifier = flags.device?.trim() || undefined;
|
|
180
|
+
const systemImagePackage = flags['system-image']?.trim() || undefined;
|
|
176
181
|
const buildId = flags['build-id']?.trim() || undefined;
|
|
177
182
|
const buildFingerprint = flags['build-fingerprint']?.trim() || undefined;
|
|
178
183
|
const applicationArchiveUrlFromFlag = flags['application-archive-url']?.trim() || undefined;
|
|
@@ -207,6 +212,9 @@ class Simulator extends EasCommand_1.default {
|
|
|
207
212
|
}
|
|
208
213
|
const platform = await resolvePlatformAsync(flags.platform, nonInteractive);
|
|
209
214
|
const egress = flags.egress === 'local' ? generated_1.DeviceRunSessionEgress.Local : undefined;
|
|
215
|
+
if (systemImagePackage && platform !== generated_1.AppPlatform.Android) {
|
|
216
|
+
throw new errors_1.EasCommandError('--system-image is only supported with --platform android.');
|
|
217
|
+
}
|
|
210
218
|
let egressAllow = [];
|
|
211
219
|
try {
|
|
212
220
|
egressAllow = (0, egress_1.parseEgressAllowList)(flags['egress-allow'] ?? []);
|
|
@@ -271,11 +279,18 @@ class Simulator extends EasCommand_1.default {
|
|
|
271
279
|
packageVersion: flags['package-version'],
|
|
272
280
|
networkCapture: flags['network-capture'],
|
|
273
281
|
...(networkCaptureFields.length ? { networkCaptureFields } : {}),
|
|
274
|
-
...(
|
|
275
|
-
?
|
|
282
|
+
...(platform === generated_1.AppPlatform.Ios
|
|
283
|
+
? deviceIdentifier
|
|
276
284
|
? { ios: { deviceIdentifier } }
|
|
277
|
-
: {
|
|
278
|
-
:
|
|
285
|
+
: {}
|
|
286
|
+
: deviceIdentifier || systemImagePackage
|
|
287
|
+
? {
|
|
288
|
+
android: {
|
|
289
|
+
...(deviceIdentifier ? { deviceIdentifier } : {}),
|
|
290
|
+
...(systemImagePackage ? { systemImagePackage } : {}),
|
|
291
|
+
},
|
|
292
|
+
}
|
|
293
|
+
: {}),
|
|
279
294
|
...(buildId ? { buildId } : {}),
|
|
280
295
|
...(buildFingerprint ? { buildFingerprint } : {}),
|
|
281
296
|
...(applicationArchiveUrlFromFlag
|
|
@@ -327,13 +342,13 @@ class Simulator extends EasCommand_1.default {
|
|
|
327
342
|
}
|
|
328
343
|
if (session.status === generated_1.DeviceRunSessionStatus.Errored ||
|
|
329
344
|
session.status === generated_1.DeviceRunSessionStatus.Stopped) {
|
|
330
|
-
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)}`);
|
|
331
346
|
}
|
|
332
347
|
const jobRunStatus = session.turtleJobRun?.status;
|
|
333
348
|
if (jobRunStatus === generated_1.JobRunStatus.Errored ||
|
|
334
349
|
jobRunStatus === generated_1.JobRunStatus.Canceled ||
|
|
335
350
|
jobRunStatus === generated_1.JobRunStatus.Finished) {
|
|
336
|
-
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)}`);
|
|
337
352
|
}
|
|
338
353
|
if (session.remoteConfig) {
|
|
339
354
|
remoteConfig = session.remoteConfig;
|
|
@@ -465,6 +480,13 @@ class Simulator extends EasCommand_1.default {
|
|
|
465
480
|
}
|
|
466
481
|
}
|
|
467
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
|
+
}
|
|
468
490
|
async function resolvePlatformAsync(platform, nonInteractive) {
|
|
469
491
|
if (platform) {
|
|
470
492
|
return APP_PLATFORM_BY_FLAG_VALUE[platform];
|
|
@@ -514,7 +536,7 @@ async function waitForSessionEndOrInterruptAsync({ graphqlClient, deviceRunSessi
|
|
|
514
536
|
if (session.status === generated_1.DeviceRunSessionStatus.Errored ||
|
|
515
537
|
jobRunStatus === generated_1.JobRunStatus.Errored) {
|
|
516
538
|
spinner.fail(`Simulator session errored. ${(0, log_1.link)(deviceRunSessionUrl)}`);
|
|
517
|
-
throw new Error(`Simulator session ${deviceRunSessionId} errored
|
|
539
|
+
throw new Error(`Simulator session ${deviceRunSessionId} errored.${await formatJobRunErrorsAsync(graphqlClient, deviceRunSessionId, signal)}`);
|
|
518
540
|
}
|
|
519
541
|
if (session.status === generated_1.DeviceRunSessionStatus.Stopped ||
|
|
520
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,
|
|
@@ -9,7 +9,7 @@ const formatFields_1 = tslib_1.__importDefault(require("../../utils/formatFields
|
|
|
9
9
|
const json_1 = require("../../utils/json");
|
|
10
10
|
class WorkflowList extends EasCommand_1.default {
|
|
11
11
|
static hidden = true;
|
|
12
|
-
static description = '
|
|
12
|
+
static description = 'list workflows for the current project';
|
|
13
13
|
static flags = {
|
|
14
14
|
...flags_1.EasJsonOnlyFlag,
|
|
15
15
|
};
|
|
@@ -20,7 +20,7 @@ function printLogsForAllSteps(logs) {
|
|
|
20
20
|
});
|
|
21
21
|
}
|
|
22
22
|
class WorkflowLogView extends EasCommand_1.default {
|
|
23
|
-
static description = 'view logs for a workflow run, selecting a job and step to view. You can pass in either a workflow run ID or a job ID. If no ID is passed in, you will be prompted to select from recent workflow runs for the current project
|
|
23
|
+
static description = 'view logs for a workflow run, selecting a job and step to view. You can pass in either a workflow run ID or a job ID. If no ID is passed in, you will be prompted to select from recent workflow runs for the current project';
|
|
24
24
|
static flags = {
|
|
25
25
|
...flags_1.EasJsonOnlyFlag,
|
|
26
26
|
...flags_1.EASNonInteractiveFlag,
|
|
@@ -72,7 +72,7 @@ function resolveWorkflowRunSshInput({ ssh, idleTimeoutSeconds, }) {
|
|
|
72
72
|
return ssh ? { idleTimeoutSeconds } : null;
|
|
73
73
|
}
|
|
74
74
|
class WorkflowRun extends EasCommand_1.default {
|
|
75
|
-
static description = 'run an EAS workflow. The entire local project directory will be packaged and uploaded to EAS servers for the workflow run, unless the --ref flag is used
|
|
75
|
+
static description = 'run an EAS workflow. The entire local project directory will be packaged and uploaded to EAS servers for the workflow run, unless the --ref flag is used';
|
|
76
76
|
static args = {
|
|
77
77
|
file: core_1.Args.string({
|
|
78
78
|
description: 'Path to the workflow file to run',
|