eas-cli 27.7.1 → 27.8.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 +252 -226
- package/build/build/build.js +1 -2
- package/build/build/utils/repository.js +4 -4
- package/build/commands/build/download.js +1 -2
- package/build/commands/simulator/availability.js +4 -3
- package/build/commands/simulator/control.js +12 -3
- package/build/commands/simulator/events.js +1 -1
- package/build/commands/simulator/exec.js +1 -1
- package/build/commands/simulator/get.js +3 -3
- package/build/commands/simulator/index.d.ts +1 -0
- package/build/commands/simulator/index.js +25 -19
- package/build/commands/simulator/list.js +1 -1
- package/build/commands/simulator/logs.js +1 -1
- package/build/commands/simulator/stop.js +1 -1
- package/build/commands/update/embedded/view.js +2 -2
- package/build/commands/workflow/ssh.d.ts +2 -0
- package/build/commands/workflow/ssh.js +5 -0
- package/build/graphql/generated.d.ts +7 -0
- package/build/graphql/queries/WorkflowJobSshQuery.js +3 -2
- package/build/project/maybeUploadAssetMapAsync.js +2 -2
- package/build/project/maybeUploadSourceMapsAsync.js +3 -3
- package/build/project/uploadAccountScopedFileAsync.js +3 -3
- package/build/project/uploadAccountScopedProjectSourceAsync.js +2 -2
- package/build/simulator/appArchive.d.ts +6 -0
- package/build/simulator/appArchive.js +61 -0
- package/build/simulator/artifacts.js +2 -2
- package/build/simulator/controlActions.d.ts +8 -2
- package/build/simulator/controlActions.js +40 -10
- package/build/simulator/controlConfig.d.ts +2 -1
- package/build/simulator/controlConfig.js +8 -3
- package/build/simulator/hostActions.d.ts +2 -0
- package/build/simulator/hostActions.js +1 -0
- package/build/simulator/startSetup.js +5 -1
- package/build/simulator/utils.d.ts +3 -3
- package/build/simulator/utils.js +8 -6
- package/build/utils/download.js +3 -3
- package/build/utils/files.d.ts +0 -1
- package/build/utils/files.js +0 -29
- package/oclif.manifest.json +57 -41
- package/package.json +6 -6
package/build/build/build.js
CHANGED
|
@@ -35,7 +35,6 @@ const maybeUploadFingerprintAsync_1 = require("../project/maybeUploadFingerprint
|
|
|
35
35
|
const resolveRuntimeVersionAsync_1 = require("../project/resolveRuntimeVersionAsync");
|
|
36
36
|
const uploads_1 = require("../uploads");
|
|
37
37
|
const centrifuge_1 = require("../utils/centrifuge");
|
|
38
|
-
const files_1 = require("../utils/files");
|
|
39
38
|
const json_1 = require("../utils/json");
|
|
40
39
|
const progress_1 = require("../utils/progress");
|
|
41
40
|
const promise_1 = require("../utils/promise");
|
|
@@ -282,7 +281,7 @@ async function uploadProjectAsync(ctx) {
|
|
|
282
281
|
const [bucketKey, { metadataLocation }] = await Promise.all([
|
|
283
282
|
(0, uploads_1.uploadFileAtPathToGCSAsync)(ctx.graphqlClient, generated_1.UploadSessionType.EasBuildGcsProjectSources, projectTarball.path, (0, progress_1.createProgressTracker)({
|
|
284
283
|
total: projectTarball.size,
|
|
285
|
-
message: ratio => `Uploading to EAS Build (${(0,
|
|
284
|
+
message: ratio => `Uploading to EAS Build (${(0, eas_build_job_1.formatBytes)(projectTarball.size * ratio)} / ${(0, eas_build_job_1.formatBytes)(projectTarball.size)})`,
|
|
286
285
|
completedMessage: (duration) => `Uploaded to EAS ${chalk_1.default.dim(duration)}`,
|
|
287
286
|
})),
|
|
288
287
|
uploadMetadataFileAsync(projectTarball, ctx),
|
|
@@ -9,6 +9,7 @@ exports.maybeWarnAboutProjectTarballSize = maybeWarnAboutProjectTarballSize;
|
|
|
9
9
|
exports.assertProjectTarballSizeDoesNotExceedLimit = assertProjectTarballSizeDoesNotExceedLimit;
|
|
10
10
|
exports.reviewAndCommitChangesAsync = reviewAndCommitChangesAsync;
|
|
11
11
|
const tslib_1 = require("tslib");
|
|
12
|
+
const eas_build_job_1 = require("@expo/eas-build-job");
|
|
12
13
|
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
13
14
|
const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
|
|
14
15
|
const path_1 = tslib_1.__importDefault(require("path"));
|
|
@@ -17,7 +18,6 @@ const uuid_1 = require("uuid");
|
|
|
17
18
|
const log_1 = tslib_1.__importStar(require("../../log"));
|
|
18
19
|
const ora_1 = require("../../ora");
|
|
19
20
|
const prompts_1 = require("../../prompts");
|
|
20
|
-
const files_1 = require("../../utils/files");
|
|
21
21
|
const paths_1 = require("../../utils/paths");
|
|
22
22
|
const timer_1 = require("../../utils/timer");
|
|
23
23
|
async function maybeBailOnRepoStatusAsync(vcsClient, nonInteractive) {
|
|
@@ -139,7 +139,7 @@ async function makeProjectTarballAsync(vcsClient) {
|
|
|
139
139
|
const duration = (0, timer_1.endTimer)(compressTimerLabel);
|
|
140
140
|
if (spinner.isSpinning) {
|
|
141
141
|
const prettyTime = (0, timer_1.formatMilliseconds)(duration);
|
|
142
|
-
spinner.succeed(`Compressed project files ${chalk_1.default.dim(`${prettyTime} (${(0,
|
|
142
|
+
spinner.succeed(`Compressed project files ${chalk_1.default.dim(`${prettyTime} (${(0, eas_build_job_1.formatBytes)(size)})`)}`);
|
|
143
143
|
}
|
|
144
144
|
return { size, path: tarPath };
|
|
145
145
|
}
|
|
@@ -147,14 +147,14 @@ function maybeWarnAboutProjectTarballSize(size) {
|
|
|
147
147
|
if (size <= 150 /* MiB */ * 1024 /* KiB */ * 1024 /* B */) {
|
|
148
148
|
return;
|
|
149
149
|
}
|
|
150
|
-
log_1.default.warn(`Your project archive is ${(0,
|
|
150
|
+
log_1.default.warn(`Your project archive is ${(0, eas_build_job_1.formatBytes)(size)}. You can reduce its size and the time it takes to upload by excluding files that are unnecessary for the build process in ${chalk_1.default.bold('.easignore')} file. ${(0, log_1.learnMore)('https://expo.fyi/eas-build-archive')}`);
|
|
151
151
|
}
|
|
152
152
|
const MAX_ALLOWED_PROJECT_TARBALL_SIZE = 2 /* GiB */ * 1024 /* MiB */ * 1024 /* KiB */ * 1024; /* B */
|
|
153
153
|
function assertProjectTarballSizeDoesNotExceedLimit(size) {
|
|
154
154
|
if (size <= MAX_ALLOWED_PROJECT_TARBALL_SIZE) {
|
|
155
155
|
return;
|
|
156
156
|
}
|
|
157
|
-
throw new Error(`Project archive is too big. Maximum allowed size is ${(0,
|
|
157
|
+
throw new Error(`Project archive is too big. Maximum allowed size is ${(0, eas_build_job_1.formatBytes)(MAX_ALLOWED_PROJECT_TARBALL_SIZE)}.`);
|
|
158
158
|
}
|
|
159
159
|
var ShouldCommitChanges;
|
|
160
160
|
(function (ShouldCommitChanges) {
|
|
@@ -15,7 +15,6 @@ const log_1 = tslib_1.__importDefault(require("../../log"));
|
|
|
15
15
|
const prompts_1 = require("../../prompts");
|
|
16
16
|
const run_1 = require("../../run/run");
|
|
17
17
|
const download_1 = require("../../utils/download");
|
|
18
|
-
const files_1 = require("../../utils/files");
|
|
19
18
|
const json_1 = require("../../utils/json");
|
|
20
19
|
const paths_1 = require("../../utils/paths");
|
|
21
20
|
class Download extends EasCommand_1.default {
|
|
@@ -134,7 +133,7 @@ class Download extends EasCommand_1.default {
|
|
|
134
133
|
for (const { name, url } of extraArtifacts) {
|
|
135
134
|
const fileName = getFileNameFromUrl(url, name);
|
|
136
135
|
const outputPath = path_1.default.join(outputDir, fileName);
|
|
137
|
-
await (0, download_1.downloadFileWithProgressTrackerAsync)(url, outputPath, (ratio, total) => `Downloading ${name} (${(0,
|
|
136
|
+
await (0, download_1.downloadFileWithProgressTrackerAsync)(url, outputPath, (ratio, total) => `Downloading ${name} (${(0, eas_build_job_1.formatBytes)(total * ratio)} / ${(0, eas_build_job_1.formatBytes)(total)})`, `Successfully downloaded ${name}`);
|
|
138
137
|
downloaded[name] = outputPath;
|
|
139
138
|
}
|
|
140
139
|
return downloaded;
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
|
|
5
5
|
const flags_1 = require("../../commandUtils/flags");
|
|
6
|
+
const url_1 = require("../../build/utils/url");
|
|
6
7
|
const DeviceRunSessionAvailabilityQuery_1 = require("../../graphql/queries/DeviceRunSessionAvailabilityQuery");
|
|
7
8
|
const log_1 = tslib_1.__importDefault(require("../../log"));
|
|
8
9
|
const ora_1 = require("../../ora");
|
|
@@ -12,7 +13,7 @@ const commandAliases_1 = require("../../simulator/commandAliases");
|
|
|
12
13
|
class SimulatorAvailability extends EasCommand_1.default {
|
|
13
14
|
static aliases = (0, commandAliases_1.getSimulatorCommandAliases)('availability');
|
|
14
15
|
static hiddenAliases = (0, commandAliases_1.getSimulatorCommandHiddenAliases)('availability');
|
|
15
|
-
static description = '
|
|
16
|
+
static description = 'check whether EAS Simulator is enabled for the current project account';
|
|
16
17
|
static flags = {
|
|
17
18
|
...flags_1.EasNonInteractiveAndJsonFlags,
|
|
18
19
|
};
|
|
@@ -45,8 +46,8 @@ class SimulatorAvailability extends EasCommand_1.default {
|
|
|
45
46
|
(0, json_1.printJsonOnlyOutput)({
|
|
46
47
|
available,
|
|
47
48
|
accountName,
|
|
48
|
-
// Only present when gated, so scripts and agents can pass the
|
|
49
|
-
...(available ? {} : {
|
|
49
|
+
// Only present when gated, so scripts and agents can pass the upgrade link on.
|
|
50
|
+
...(available ? {} : { billingUrl: (0, url_1.getAccountBillingUrl)(accountName) }),
|
|
50
51
|
});
|
|
51
52
|
return;
|
|
52
53
|
}
|
|
@@ -23,7 +23,7 @@ const timer_1 = require("../../utils/timer");
|
|
|
23
23
|
class SimulatorControl extends EasCommand_1.default {
|
|
24
24
|
static aliases = (0, commandAliases_1.getSimulatorCommandAliases)('control');
|
|
25
25
|
static hiddenAliases = (0, commandAliases_1.getSimulatorCommandHiddenAliases)('control');
|
|
26
|
-
static description = `
|
|
26
|
+
static description = `control a remote iOS simulator session on EAS
|
|
27
27
|
|
|
28
28
|
Run without an action to list available actions. Use <action> --help for usage.
|
|
29
29
|
|
|
@@ -51,7 +51,7 @@ Existing output files are overwritten. When saving to a directory, an existing f
|
|
|
51
51
|
'$ eas simulator:control --import ./simulator-control.json',
|
|
52
52
|
'$ eas simulator:control hardwareKeyboard.set off',
|
|
53
53
|
'$ eas simulator:control permissions.set grant camera com.example.app',
|
|
54
|
-
'$ eas simulator:control app.install ./MyApp.
|
|
54
|
+
'$ eas simulator:control app.install ./MyApp.app',
|
|
55
55
|
'$ eas simulator:control screenshot.capture --output ./screenshot.png',
|
|
56
56
|
'$ eas simulator:control screenshot.capture --output ./screenshot.png --id <session-id>',
|
|
57
57
|
];
|
|
@@ -376,7 +376,16 @@ Existing output files are overwritten. When saving to a directory, an existing f
|
|
|
376
376
|
let output;
|
|
377
377
|
let savedFile;
|
|
378
378
|
try {
|
|
379
|
-
({ output, file: savedFile } = await (0, controlActions_1.executeControlActionAsync)(connection, plan
|
|
379
|
+
({ output, file: savedFile } = await (0, controlActions_1.executeControlActionAsync)(connection, plan, {
|
|
380
|
+
onProgress: phase => {
|
|
381
|
+
spinner.text =
|
|
382
|
+
phase === 'packaging'
|
|
383
|
+
? 'Packaging app'
|
|
384
|
+
: phase === 'uploading'
|
|
385
|
+
? `Uploading ${plan.localFile.path}`
|
|
386
|
+
: `Running ${action} on simulator session ${session.id}`;
|
|
387
|
+
},
|
|
388
|
+
}));
|
|
380
389
|
spinner.succeed(`Ran ${action} on simulator session ${session.id}`);
|
|
381
390
|
}
|
|
382
391
|
catch (err) {
|
|
@@ -17,7 +17,7 @@ const POST_STOP_REFRESH_COUNT = 2;
|
|
|
17
17
|
class SimulatorEvents extends EasCommand_1.default {
|
|
18
18
|
static aliases = (0, commandAliases_1.getSimulatorCommandAliases)('events');
|
|
19
19
|
static hiddenAliases = (0, commandAliases_1.getSimulatorCommandHiddenAliases)('events');
|
|
20
|
-
static description = '
|
|
20
|
+
static description = 'show activity events from a remote simulator session';
|
|
21
21
|
static flags = {
|
|
22
22
|
id: core_1.Flags.string({
|
|
23
23
|
description: `Simulator session ID. Defaults to ${env_1.SIMULATOR_DOTENV_FILE_NAME}.`,
|
|
@@ -8,7 +8,7 @@ const commandAliases_1 = require("../../simulator/commandAliases");
|
|
|
8
8
|
class SimulatorExec extends EasCommand_1.default {
|
|
9
9
|
static aliases = (0, commandAliases_1.getSimulatorCommandAliases)('exec');
|
|
10
10
|
static hiddenAliases = (0, commandAliases_1.getSimulatorCommandHiddenAliases)('exec');
|
|
11
|
-
static description = `
|
|
11
|
+
static description = `execute a simulator command with ${env_1.SIMULATOR_DOTENV_FILE_NAME} environment loaded`;
|
|
12
12
|
static strict = false;
|
|
13
13
|
static contextDefinition = {
|
|
14
14
|
...this.ContextOptions.ProjectDir,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
+
const eas_build_job_1 = require("@expo/eas-build-job");
|
|
4
5
|
const core_1 = require("@oclif/core");
|
|
5
6
|
const url_1 = require("../../build/utils/url");
|
|
6
7
|
const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
|
|
@@ -12,14 +13,13 @@ const ora_1 = require("../../ora");
|
|
|
12
13
|
const env_1 = require("../../simulator/env");
|
|
13
14
|
const jobRunErrors_1 = require("../../simulator/jobRunErrors");
|
|
14
15
|
const utils_1 = require("../../simulator/utils");
|
|
15
|
-
const files_1 = require("../../utils/files");
|
|
16
16
|
const formatFields_1 = tslib_1.__importDefault(require("../../utils/formatFields"));
|
|
17
17
|
const json_1 = require("../../utils/json");
|
|
18
18
|
const commandAliases_1 = require("../../simulator/commandAliases");
|
|
19
19
|
class SimulatorGet extends EasCommand_1.default {
|
|
20
20
|
static aliases = (0, commandAliases_1.getSimulatorCommandAliases)('get');
|
|
21
21
|
static hiddenAliases = (0, commandAliases_1.getSimulatorCommandHiddenAliases)('get');
|
|
22
|
-
static description = "
|
|
22
|
+
static description = "get info about a remote simulator session on EAS by its simulator session ID. Preview links follow the session's saved sharing preference";
|
|
23
23
|
static flags = {
|
|
24
24
|
id: core_1.Flags.string({
|
|
25
25
|
description: `Simulator session ID. Defaults to ${env_1.SIMULATOR_DOTENV_FILE_NAME}.`,
|
|
@@ -148,7 +148,7 @@ function formatDeviceRunSessionArtifactFields(artifact) {
|
|
|
148
148
|
}
|
|
149
149
|
function formatFileSize(fileSizeBytes) {
|
|
150
150
|
return typeof fileSizeBytes === 'number'
|
|
151
|
-
? `${(0,
|
|
151
|
+
? `${(0, eas_build_job_1.formatBytes)(fileSizeBytes)} (${fileSizeBytes} B)`
|
|
152
152
|
: 'null';
|
|
153
153
|
}
|
|
154
154
|
function formatMetadata(metadata) {
|
|
@@ -22,6 +22,7 @@ export default class Simulator extends EasCommand {
|
|
|
22
22
|
'open-url': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
23
23
|
type: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
24
24
|
'package-version': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
25
|
+
'log-source': import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
25
26
|
'network-capture': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
26
27
|
'network-capture-field': import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
27
28
|
'max-duration-minutes': import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
@@ -51,7 +51,7 @@ class Simulator extends EasCommand_1.default {
|
|
|
51
51
|
...commandAliases_1.SIMULATOR_HIDDEN_TOPIC_ALIASES,
|
|
52
52
|
...(0, commandAliases_1.getSimulatorCommandHiddenAliases)('start'),
|
|
53
53
|
];
|
|
54
|
-
static description = `
|
|
54
|
+
static description = `start a remote simulator session on EAS
|
|
55
55
|
|
|
56
56
|
Preview links require sign-in by default.
|
|
57
57
|
|
|
@@ -126,6 +126,11 @@ With local egress, actions wait for the connection and require interactive mode.
|
|
|
126
126
|
'package-version': core_1.Flags.string({
|
|
127
127
|
description: 'Version of the package backing the simulator session (e.g. "0.1.3-alpha.3"). Defaults to "latest" when omitted.',
|
|
128
128
|
}),
|
|
129
|
+
'log-source': core_1.Flags.option({
|
|
130
|
+
description: 'Android logs to record during the session and upload afterward. Repeat to select both sources; replaces the default emulator-output selection. Device-wide device-logcat may contain credentials and personal data. Logs are not redacted.',
|
|
131
|
+
options: ['emulator-output', 'device-logcat'],
|
|
132
|
+
multiple: true,
|
|
133
|
+
})(),
|
|
129
134
|
'network-capture': core_1.Flags.boolean({
|
|
130
135
|
allowNo: true,
|
|
131
136
|
description: 'Record HTTP(S) traffic from apps on the device (iOS only). HTTPS is decrypted, so recordings contain credentials in cleartext and certificate-pinned apps fail to connect.',
|
|
@@ -149,7 +154,7 @@ With local egress, actions wait for the connection and require interactive mode.
|
|
|
149
154
|
options: Object.values(utils_1.DEVICE_RUN_SESSION_RESOURCE_CLASS_FLAG_VALUES),
|
|
150
155
|
})(),
|
|
151
156
|
egress: core_1.Flags.option({
|
|
152
|
-
description: 'With "local", the simulator\'s network traffic exits from this machine and fails while the egress client is disconnected. On iOS, the simulator system proxy points at this machine: HTTP(S) and WebSocket requests that honor it (WebKit, URLSession) and clients that read proxy environment variables (gRPC, libcurl) use it, and connections that ignore both are refused inside the simulator and listed, with the library that tried, in the Logs section of the session page on expo.dev. On Android, all TCP traffic from the emulator goes through its proxy to this machine; traffic that cannot (UDP, such as QUIC) is refused and listed in the same Logs section, and DNS for apps that ignore the system proxy resolves on the device host. The egress client must keep running for the life of the session.',
|
|
157
|
+
description: '[EXPERIMENTAL] With "local", the simulator\'s network traffic exits from this machine and fails while the egress client is disconnected. On iOS, the simulator system proxy points at this machine: HTTP(S) and WebSocket requests that honor it (WebKit, URLSession) and clients that read proxy environment variables (gRPC, libcurl) use it, and connections that ignore both are refused inside the simulator and listed, with the library that tried, in the Logs section of the session page on expo.dev. On Android, all TCP traffic from the emulator goes through its proxy to this machine; traffic that cannot (UDP, such as QUIC) is refused and listed in the same Logs section, and DNS for apps that ignore the system proxy resolves on the device host. The egress client must keep running for the life of the session.',
|
|
153
158
|
options: EGRESS_FLAG_VALUES,
|
|
154
159
|
})(),
|
|
155
160
|
'egress-allow': core_1.Flags.string({
|
|
@@ -199,7 +204,7 @@ With local egress, actions wait for the connection and require interactive mode.
|
|
|
199
204
|
nonInteractive,
|
|
200
205
|
});
|
|
201
206
|
// The server would reject the session anyway, but check the gate first so gated
|
|
202
|
-
// accounts get the
|
|
207
|
+
// accounts get the upgrade link instead of a generic permission error. Expo admins
|
|
203
208
|
// skip the check so they can work on any account and let the server decide.
|
|
204
209
|
if (!actor.isExpoAdmin) {
|
|
205
210
|
const { accountName, available } = await DeviceRunSessionAvailabilityQuery_1.DeviceRunSessionAvailabilityQuery.byAppIdAsync(graphqlClient, projectId);
|
|
@@ -213,6 +218,7 @@ With local egress, actions wait for the connection and require interactive mode.
|
|
|
213
218
|
const tags = flags.tag?.map(tag => tag.trim()).filter(tag => tag.length > 0);
|
|
214
219
|
const deviceIdentifier = flags.device?.trim() || undefined;
|
|
215
220
|
const systemImagePackage = flags['system-image']?.trim() || undefined;
|
|
221
|
+
const logSources = flags['log-source'];
|
|
216
222
|
const buildId = flags['build-id']?.trim() || undefined;
|
|
217
223
|
const buildFingerprint = flags['build-fingerprint']?.trim() || undefined;
|
|
218
224
|
const applicationArchiveUrlFromFlag = flags['application-archive-url']?.trim() || undefined;
|
|
@@ -250,6 +256,9 @@ With local egress, actions wait for the connection and require interactive mode.
|
|
|
250
256
|
}
|
|
251
257
|
const platform = await resolvePlatformAsync(flags.platform, nonInteractive);
|
|
252
258
|
const egress = flags.egress === 'local' ? generated_1.DeviceRunSessionEgress.Local : undefined;
|
|
259
|
+
if (logSources && platform !== generated_1.AppPlatform.Android) {
|
|
260
|
+
throw new errors_1.EasCommandError('--log-source selects Android emulator logs. Pass --platform android.');
|
|
261
|
+
}
|
|
253
262
|
if (systemImagePackage && platform !== generated_1.AppPlatform.Android) {
|
|
254
263
|
throw new errors_1.EasCommandError('--system-image is only supported with --platform android.');
|
|
255
264
|
}
|
|
@@ -283,10 +292,6 @@ With local egress, actions wait for the connection and require interactive mode.
|
|
|
283
292
|
if (nonInteractive && egress && imported.config?.actions?.length) {
|
|
284
293
|
throw new errors_1.EasCommandError('Imported actions with local egress require interactive mode. Start without actions, connect eas simulator:egress, then run eas simulator:control --import with the same file.');
|
|
285
294
|
}
|
|
286
|
-
if (platform === generated_1.AppPlatform.Android) {
|
|
287
|
-
log_1.default.warn('Android emulator support in EAS Simulator is still in development. Some features available on iOS may not work on Android yet. Full parity with iOS is coming soon.');
|
|
288
|
-
log_1.default.newLine();
|
|
289
|
-
}
|
|
290
295
|
const expoGoSdkVersion = flags['expo-go']
|
|
291
296
|
? await (0, expoGo_1.resolveExpoGoSdkVersionAsync)({ projectDir, sdkVersion: sdkVersionFromFlag })
|
|
292
297
|
: undefined;
|
|
@@ -313,6 +318,18 @@ With local egress, actions wait for the connection and require interactive mode.
|
|
|
313
318
|
packageVersion: flags['package-version'],
|
|
314
319
|
nonInteractive,
|
|
315
320
|
});
|
|
321
|
+
const android = {
|
|
322
|
+
...(deviceIdentifier ? { deviceIdentifier } : {}),
|
|
323
|
+
...(systemImagePackage ? { systemImagePackage } : {}),
|
|
324
|
+
...(logSources ? { logSources } : {}),
|
|
325
|
+
};
|
|
326
|
+
const platformInput = platform === generated_1.AppPlatform.Ios
|
|
327
|
+
? deviceIdentifier
|
|
328
|
+
? { ios: { deviceIdentifier } }
|
|
329
|
+
: {}
|
|
330
|
+
: Object.keys(android).length
|
|
331
|
+
? { android }
|
|
332
|
+
: {};
|
|
316
333
|
const session = await withSimulatorRequestAnalyticsAsync(analytics, requestProperties, createSpinner, () => DeviceRunSessionMutation_1.DeviceRunSessionMutation.createDeviceRunSessionAsync(graphqlClient, {
|
|
317
334
|
appId: projectId,
|
|
318
335
|
name,
|
|
@@ -323,18 +340,7 @@ With local egress, actions wait for the connection and require interactive mode.
|
|
|
323
340
|
packageVersion: flags['package-version'],
|
|
324
341
|
networkCapture: flags['network-capture'],
|
|
325
342
|
...(networkCaptureFields.length ? { networkCaptureFields } : {}),
|
|
326
|
-
...
|
|
327
|
-
? deviceIdentifier
|
|
328
|
-
? { ios: { deviceIdentifier } }
|
|
329
|
-
: {}
|
|
330
|
-
: deviceIdentifier || systemImagePackage
|
|
331
|
-
? {
|
|
332
|
-
android: {
|
|
333
|
-
...(deviceIdentifier ? { deviceIdentifier } : {}),
|
|
334
|
-
...(systemImagePackage ? { systemImagePackage } : {}),
|
|
335
|
-
},
|
|
336
|
-
}
|
|
337
|
-
: {}),
|
|
343
|
+
...platformInput,
|
|
338
344
|
...(buildId ? { buildId } : {}),
|
|
339
345
|
...(buildFingerprint ? { buildFingerprint } : {}),
|
|
340
346
|
...(applicationArchiveUrlFromFlag
|
|
@@ -37,7 +37,7 @@ const PLATFORM_BY_FLAG_VALUE = Object.fromEntries(Object.entries(PLATFORM_FLAG_V
|
|
|
37
37
|
class SimulatorList extends EasCommand_1.default {
|
|
38
38
|
static aliases = (0, commandAliases_1.getSimulatorCommandAliases)('list');
|
|
39
39
|
static hiddenAliases = (0, commandAliases_1.getSimulatorCommandHiddenAliases)('list');
|
|
40
|
-
static description = '
|
|
40
|
+
static description = 'list remote simulator sessions for the current project';
|
|
41
41
|
static flags = {
|
|
42
42
|
status: core_1.Flags.option({
|
|
43
43
|
description: 'Filter by session status (repeatable)',
|
|
@@ -18,7 +18,7 @@ const LOG_SOURCE_HEALTH_CHECK_INTERVAL_MS = 10_000;
|
|
|
18
18
|
class SimulatorLogs extends EasCommand_1.default {
|
|
19
19
|
static aliases = (0, commandAliases_1.getSimulatorCommandAliases)('logs');
|
|
20
20
|
static hiddenAliases = (0, commandAliases_1.getSimulatorCommandHiddenAliases)('logs');
|
|
21
|
-
static description = '
|
|
21
|
+
static description = 'show buffered logs from a remote iOS simulator session';
|
|
22
22
|
static examples = [
|
|
23
23
|
'<%= config.bin %> simulator:logs --follow',
|
|
24
24
|
'<%= config.bin %> simulator:logs --json',
|
|
@@ -12,7 +12,7 @@ const commandAliases_1 = require("../../simulator/commandAliases");
|
|
|
12
12
|
class SimulatorStop extends EasCommand_1.default {
|
|
13
13
|
static aliases = (0, commandAliases_1.getSimulatorCommandAliases)('stop');
|
|
14
14
|
static hiddenAliases = (0, commandAliases_1.getSimulatorCommandHiddenAliases)('stop');
|
|
15
|
-
static description = '
|
|
15
|
+
static description = 'stop a remote simulator session on EAS by its simulator session ID';
|
|
16
16
|
static flags = {
|
|
17
17
|
id: core_1.Flags.string({
|
|
18
18
|
description: `Simulator session ID. Defaults to ${env_1.SIMULATOR_DOTENV_FILE_NAME}.`,
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.formatEmbeddedUpdate = formatEmbeddedUpdate;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
+
const eas_build_job_1 = require("@expo/eas-build-job");
|
|
5
6
|
const core_1 = require("@oclif/core");
|
|
6
7
|
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
7
8
|
const EasCommand_1 = tslib_1.__importDefault(require("../../../commandUtils/EasCommand"));
|
|
@@ -9,7 +10,6 @@ const flags_1 = require("../../../commandUtils/flags");
|
|
|
9
10
|
const EmbeddedUpdateQuery_1 = require("../../../graphql/queries/EmbeddedUpdateQuery");
|
|
10
11
|
const log_1 = tslib_1.__importDefault(require("../../../log"));
|
|
11
12
|
const date_1 = require("../../../utils/date");
|
|
12
|
-
const files_1 = require("../../../utils/files");
|
|
13
13
|
const formatFields_1 = tslib_1.__importDefault(require("../../../utils/formatFields"));
|
|
14
14
|
const json_1 = require("../../../utils/json");
|
|
15
15
|
class UpdateEmbeddedView extends EasCommand_1.default {
|
|
@@ -65,7 +65,7 @@ function formatEmbeddedUpdate(embeddedUpdate) {
|
|
|
65
65
|
{ label: 'Platform', value: embeddedUpdate.platform.toLowerCase() },
|
|
66
66
|
{ label: 'Runtime version', value: embeddedUpdate.runtimeVersion },
|
|
67
67
|
{ label: 'Channel', value: embeddedUpdate.channel },
|
|
68
|
-
{ label: 'Bundle size', value: (0,
|
|
68
|
+
{ label: 'Bundle size', value: (0, eas_build_job_1.formatBytes)(bundleSize) },
|
|
69
69
|
{ label: 'Bundle SHA-256', value: embeddedUpdate.launchAsset.fileSHA256 },
|
|
70
70
|
{
|
|
71
71
|
label: 'Created at',
|
|
@@ -17,6 +17,8 @@ export declare function parseSshArgv(rawArgv: readonly string[]): {
|
|
|
17
17
|
};
|
|
18
18
|
export default class WorkflowSsh extends EasCommand {
|
|
19
19
|
static description: string;
|
|
20
|
+
static usage: string;
|
|
21
|
+
static examples: string[];
|
|
20
22
|
static strict: boolean;
|
|
21
23
|
static flags: {
|
|
22
24
|
'show-connect': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
@@ -79,6 +79,11 @@ function parseSshArgv(rawArgv) {
|
|
|
79
79
|
}
|
|
80
80
|
class WorkflowSsh extends EasCommand_1.default {
|
|
81
81
|
static description = '[EXPERIMENTAL] open an ssh session on the worker running a workflow job';
|
|
82
|
+
static usage = 'workflow:ssh [--show-connect] ID';
|
|
83
|
+
static examples = [
|
|
84
|
+
'$ eas workflow:ssh <ID> \t # Open an SSH session on the worker. Use the ID in the job logs ("Start SSH session" step)',
|
|
85
|
+
'$ eas workflow:ssh --show-connect <ID> \t # Print the ssh command to connect, without opening the SSH session',
|
|
86
|
+
];
|
|
82
87
|
static strict = false;
|
|
83
88
|
static flags = {
|
|
84
89
|
'show-connect': core_1.Flags.boolean({
|
|
@@ -5749,6 +5749,13 @@ export type CreateAndConfigureRepositoryInput = {
|
|
|
5749
5749
|
export type CreateAndroidDeviceRunSessionInput = {
|
|
5750
5750
|
/** AVD hardware profile id to use for the emulator (e.g. "pixel_9"). Defaults to "medium_phone". */
|
|
5751
5751
|
deviceIdentifier?: InputMaybe<Scalars['String']['input']>;
|
|
5752
|
+
/**
|
|
5753
|
+
* Logs to record during the session and upload afterward: emulator-output and device-logcat. Defaults to
|
|
5754
|
+
* ["emulator-output"]. An empty list disables recording and uploading both sources. Device-wide logcat can contain
|
|
5755
|
+
* credentials and personal data; include device-logcat only when you want to retain it.
|
|
5756
|
+
* Logs are not redacted and use the existing 90-day artifact retention policy.
|
|
5757
|
+
*/
|
|
5758
|
+
logSources?: InputMaybe<Array<Scalars['String']['input']>>;
|
|
5752
5759
|
/**
|
|
5753
5760
|
* Android SDK system image package to use for the emulator (e.g.
|
|
5754
5761
|
* "system-images;android-35;google_apis;x86_64").
|
|
@@ -126,9 +126,10 @@ exports.WorkflowJobSshQuery = {
|
|
|
126
126
|
throw error;
|
|
127
127
|
}
|
|
128
128
|
const build = data.builds.byId;
|
|
129
|
+
const jobCompleted = FINAL_BUILD_STATUSES.has(build.status);
|
|
129
130
|
return {
|
|
130
|
-
sshRequested: build.sshSession !== null,
|
|
131
|
-
jobCompleted
|
|
131
|
+
sshRequested: build.sshSession !== null || jobCompleted,
|
|
132
|
+
jobCompleted,
|
|
132
133
|
session: build.sshSession,
|
|
133
134
|
};
|
|
134
135
|
},
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.maybeUploadAssetMapAsync = maybeUploadAssetMapAsync;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
+
const eas_build_job_1 = require("@expo/eas-build-job");
|
|
5
6
|
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
6
7
|
const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
|
|
7
8
|
const path_1 = tslib_1.__importDefault(require("path"));
|
|
8
9
|
const generated_1 = require("../graphql/generated");
|
|
9
10
|
const log_1 = tslib_1.__importDefault(require("../log"));
|
|
10
11
|
const uploads_1 = require("../uploads");
|
|
11
|
-
const files_1 = require("../utils/files");
|
|
12
12
|
const progress_1 = require("../utils/progress");
|
|
13
13
|
async function maybeUploadAssetMapAsync(distRoot, graphqlClient) {
|
|
14
14
|
const assetMapPath = path_1.default.join(distRoot, 'assetmap.json');
|
|
@@ -20,7 +20,7 @@ async function maybeUploadAssetMapAsync(distRoot, graphqlClient) {
|
|
|
20
20
|
try {
|
|
21
21
|
gcsBucketKey = await (0, uploads_1.uploadFileAtPathToGCSAsync)(graphqlClient, generated_1.UploadSessionType.EasUpdateAssetsMetadata, assetMapPath, (0, progress_1.createProgressTracker)({
|
|
22
22
|
total: fileStat.size,
|
|
23
|
-
message: ratio => `Uploading assetmap.json (${(0,
|
|
23
|
+
message: ratio => `Uploading assetmap.json (${(0, eas_build_job_1.formatBytes)(fileStat.size * ratio)} / ${(0, eas_build_job_1.formatBytes)(fileStat.size)})`,
|
|
24
24
|
completedMessage: (duration) => `Uploaded assetmap.json ${chalk_1.default.dim(duration)}`,
|
|
25
25
|
}));
|
|
26
26
|
}
|
|
@@ -6,6 +6,7 @@ exports.maybeUploadSourceMapsAsync = maybeUploadSourceMapsAsync;
|
|
|
6
6
|
exports.resolveSourceMapPathsAsync = resolveSourceMapPathsAsync;
|
|
7
7
|
exports.stripSourcesContentAsync = stripSourcesContentAsync;
|
|
8
8
|
const tslib_1 = require("tslib");
|
|
9
|
+
const eas_build_job_1 = require("@expo/eas-build-job");
|
|
9
10
|
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
10
11
|
const fast_glob_1 = tslib_1.__importDefault(require("fast-glob"));
|
|
11
12
|
const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
|
|
@@ -15,7 +16,6 @@ const publish_1 = require("./publish");
|
|
|
15
16
|
const generated_1 = require("../graphql/generated");
|
|
16
17
|
const log_1 = tslib_1.__importDefault(require("../log"));
|
|
17
18
|
const uploads_1 = require("../uploads");
|
|
18
|
-
const files_1 = require("../utils/files");
|
|
19
19
|
const paths_1 = require("../utils/paths");
|
|
20
20
|
const progress_1 = require("../utils/progress");
|
|
21
21
|
/** Platforms for which EAS stores a source map. The GraphQL SourceMapGroup input has no `web`. */
|
|
@@ -63,12 +63,12 @@ async function uploadSourceMapForPlatformAsync(graphqlClient, sourceMapPath, pla
|
|
|
63
63
|
const strippedPath = await stripSourcesContentAsync(sourceMapPath, platform);
|
|
64
64
|
const { size } = await fs_extra_1.default.promises.stat(strippedPath);
|
|
65
65
|
if (size > exports.MAX_SOURCE_MAP_SIZE_BYTES) {
|
|
66
|
-
log_1.default.warn(`Skipping the ${platform} source map because it is ${(0,
|
|
66
|
+
log_1.default.warn(`Skipping the ${platform} source map because it is ${(0, eas_build_job_1.formatBytes)(size)}, above the ${(0, eas_build_job_1.formatBytes)(exports.MAX_SOURCE_MAP_SIZE_BYTES)} limit for source map uploads.`);
|
|
67
67
|
return null;
|
|
68
68
|
}
|
|
69
69
|
const bucketKey = await (0, uploads_1.uploadFileAtPathToGCSAsync)(graphqlClient, generated_1.UploadSessionType.EasUpdateSourceMaps, strippedPath, (0, progress_1.createProgressTracker)({
|
|
70
70
|
total: size,
|
|
71
|
-
message: ratio => `Uploading ${platform} source map (${(0,
|
|
71
|
+
message: ratio => `Uploading ${platform} source map (${(0, eas_build_job_1.formatBytes)(size * ratio)} / ${(0, eas_build_job_1.formatBytes)(size)})`,
|
|
72
72
|
completedMessage: (duration) => `Uploaded ${platform} source map ${chalk_1.default.dim(duration)}`,
|
|
73
73
|
}));
|
|
74
74
|
return { type: generated_1.SourceMapSourceType.Gcs, bucketKey };
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.uploadAccountScopedFileAsync = uploadAccountScopedFileAsync;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
+
const eas_build_job_1 = require("@expo/eas-build-job");
|
|
5
6
|
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
6
7
|
const node_fs_1 = tslib_1.__importDefault(require("node:fs"));
|
|
7
8
|
const node_path_1 = tslib_1.__importDefault(require("node:path"));
|
|
8
9
|
const generated_1 = require("../graphql/generated");
|
|
9
10
|
const uploads_1 = require("../uploads");
|
|
10
|
-
const files_1 = require("../utils/files");
|
|
11
11
|
const progress_1 = require("../utils/progress");
|
|
12
12
|
/**
|
|
13
13
|
* Uploads a file to GCS as account-scoped object.
|
|
@@ -18,7 +18,7 @@ async function uploadAccountScopedFileAsync({ graphqlClient, accountId, filePath
|
|
|
18
18
|
const fileName = node_path_1.default.basename(filePath);
|
|
19
19
|
const fileStat = await node_fs_1.default.promises.stat(filePath);
|
|
20
20
|
if (fileStat.size > maxSizeBytes) {
|
|
21
|
-
throw new Error(`File is too big. Maximum allowed size is ${(0,
|
|
21
|
+
throw new Error(`File is too big. Maximum allowed size is ${(0, eas_build_job_1.formatBytes)(maxSizeBytes)}.`);
|
|
22
22
|
}
|
|
23
23
|
const fileBucketKey = await (0, uploads_1.uploadAccountScopedFileAtPathToGCSAsync)(graphqlClient, {
|
|
24
24
|
accountId,
|
|
@@ -26,7 +26,7 @@ async function uploadAccountScopedFileAsync({ graphqlClient, accountId, filePath
|
|
|
26
26
|
path: filePath,
|
|
27
27
|
handleProgressEvent: (0, progress_1.createProgressTracker)({
|
|
28
28
|
total: fileStat.size,
|
|
29
|
-
message: ratio => `Uploading ${fileName} to EAS (${(0,
|
|
29
|
+
message: ratio => `Uploading ${fileName} to EAS (${(0, eas_build_job_1.formatBytes)(fileStat.size * ratio)} / ${(0, eas_build_job_1.formatBytes)(fileStat.size)})`,
|
|
30
30
|
completedMessage: (duration) => `Uploaded ${fileName} to EAS ${chalk_1.default.dim(duration)}`,
|
|
31
31
|
}),
|
|
32
32
|
});
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.uploadAccountScopedProjectSourceAsync = uploadAccountScopedProjectSourceAsync;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
+
const eas_build_job_1 = require("@expo/eas-build-job");
|
|
5
6
|
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
6
7
|
const node_fs_1 = tslib_1.__importDefault(require("node:fs"));
|
|
7
8
|
const repository_1 = require("../build/utils/repository");
|
|
8
9
|
const generated_1 = require("../graphql/generated");
|
|
9
10
|
const log_1 = tslib_1.__importStar(require("../log"));
|
|
10
11
|
const uploads_1 = require("../uploads");
|
|
11
|
-
const files_1 = require("../utils/files");
|
|
12
12
|
const progress_1 = require("../utils/progress");
|
|
13
13
|
/**
|
|
14
14
|
* Archives the project and uploads it to GCS as account-scoped object.
|
|
@@ -29,7 +29,7 @@ async function uploadAccountScopedProjectSourceAsync({ graphqlClient, vcsClient,
|
|
|
29
29
|
path: projectTarball.path,
|
|
30
30
|
handleProgressEvent: (0, progress_1.createProgressTracker)({
|
|
31
31
|
total: projectTarball.size,
|
|
32
|
-
message: ratio => `Uploading project archive to EAS (${(0,
|
|
32
|
+
message: ratio => `Uploading project archive to EAS (${(0, eas_build_job_1.formatBytes)(projectTarball.size * ratio)} / ${(0, eas_build_job_1.formatBytes)(projectTarball.size)})`,
|
|
33
33
|
completedMessage: (duration) => `Uploaded project archive to EAS ${chalk_1.default.dim(duration)}`,
|
|
34
34
|
}),
|
|
35
35
|
});
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createAppArchiveAsync = createAppArchiveAsync;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const fs = tslib_1.__importStar(require("fs-extra"));
|
|
6
|
+
const os_1 = tslib_1.__importDefault(require("os"));
|
|
7
|
+
const path_1 = tslib_1.__importDefault(require("path"));
|
|
8
|
+
const tar = tslib_1.__importStar(require("tar"));
|
|
9
|
+
async function createAppArchiveAsync(value, { handleInterrupt = true } = {}) {
|
|
10
|
+
const bundle = await fs.realpath(value);
|
|
11
|
+
// Create and register cleanup in one synchronous turn so an interrupt cannot
|
|
12
|
+
// leave a newly created directory without its exit handler.
|
|
13
|
+
const directory = fs.mkdtempSync(path_1.default.join(os_1.default.tmpdir(), 'eas-simulator-app-'));
|
|
14
|
+
const archive = path_1.default.join(directory, 'app.tar.gz');
|
|
15
|
+
const cleanupOnExit = () => {
|
|
16
|
+
try {
|
|
17
|
+
fs.removeSync(directory);
|
|
18
|
+
}
|
|
19
|
+
catch {
|
|
20
|
+
// Exit cleanup is best effort; do not prevent the interrupted process from stopping.
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
const interrupt = () => {
|
|
24
|
+
cleanupOnExit();
|
|
25
|
+
process.exit(130);
|
|
26
|
+
};
|
|
27
|
+
const terminate = () => {
|
|
28
|
+
cleanupOnExit();
|
|
29
|
+
process.exit(143);
|
|
30
|
+
};
|
|
31
|
+
process.once('exit', cleanupOnExit);
|
|
32
|
+
if (handleInterrupt) {
|
|
33
|
+
process.once('SIGINT', interrupt);
|
|
34
|
+
}
|
|
35
|
+
process.once('SIGTERM', terminate);
|
|
36
|
+
const cleanupAsync = async () => {
|
|
37
|
+
try {
|
|
38
|
+
await fs.remove(directory);
|
|
39
|
+
}
|
|
40
|
+
finally {
|
|
41
|
+
process.removeListener('exit', cleanupOnExit);
|
|
42
|
+
process.removeListener('SIGINT', interrupt);
|
|
43
|
+
process.removeListener('SIGTERM', terminate);
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
try {
|
|
47
|
+
await tar.create({
|
|
48
|
+
cwd: bundle,
|
|
49
|
+
file: archive,
|
|
50
|
+
prefix: path_1.default.basename(path_1.default.resolve(value)),
|
|
51
|
+
gzip: true,
|
|
52
|
+
portable: true,
|
|
53
|
+
jobs: 1,
|
|
54
|
+
}, ['.']);
|
|
55
|
+
return { path: archive, cleanupAsync };
|
|
56
|
+
}
|
|
57
|
+
catch (error) {
|
|
58
|
+
await cleanupAsync();
|
|
59
|
+
throw error;
|
|
60
|
+
}
|
|
61
|
+
}
|