eas-cli 18.9.1 → 18.11.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 +230 -95
- package/build/build/runBuildAndSubmit.d.ts +3 -1
- package/build/build/runBuildAndSubmit.js +12 -4
- package/build/build/utils/repository.js +15 -3
- package/build/build/validateLockfile.d.ts +1 -0
- package/build/build/validateLockfile.js +37 -0
- package/build/commandUtils/buildFlags.d.ts +1 -0
- package/build/commandUtils/buildFlags.js +18 -0
- package/build/commandUtils/convex.d.ts +12 -0
- package/build/commandUtils/convex.js +77 -0
- package/build/commands/build/dev.d.ts +1 -0
- package/build/commands/build/dev.js +12 -2
- package/build/commands/build/resign.js +0 -1
- package/build/commands/build/run.d.ts +1 -0
- package/build/commands/build/run.js +12 -3
- package/build/commands/integrations/convex/connect.d.ts +24 -0
- package/build/commands/integrations/convex/connect.js +266 -0
- package/build/commands/integrations/convex/dashboard.d.ts +9 -0
- package/build/commands/integrations/convex/dashboard.js +42 -0
- package/build/commands/integrations/convex/project/delete.d.ts +13 -0
- package/build/commands/integrations/convex/project/delete.js +65 -0
- package/build/commands/integrations/convex/project.d.ts +9 -0
- package/build/commands/integrations/convex/project.js +28 -0
- package/build/commands/integrations/convex/team/delete.d.ts +17 -0
- package/build/commands/integrations/convex/team/delete.js +93 -0
- package/build/commands/integrations/convex/team/invite.d.ts +19 -0
- package/build/commands/integrations/convex/team/invite.js +113 -0
- package/build/commands/integrations/convex/team.d.ts +9 -0
- package/build/commands/integrations/convex/team.js +35 -0
- package/build/commands/observe/events.js +12 -24
- package/build/commands/observe/logs.d.ts +29 -0
- package/build/commands/observe/logs.js +163 -0
- package/build/commands/observe/metrics.js +11 -19
- package/build/commands/observe/versions.js +11 -19
- package/build/commands/simulator/start.js +84 -5
- package/build/commands/simulator/stop.js +1 -1
- package/build/fingerprint/cli.js +1 -0
- package/build/graphql/generated.d.ts +421 -7
- package/build/graphql/generated.js +16 -3
- package/build/graphql/mutations/ConvexMutation.d.ts +10 -0
- package/build/graphql/mutations/ConvexMutation.js +89 -0
- package/build/graphql/mutations/DeviceRunSessionMutation.d.ts +2 -2
- package/build/graphql/mutations/DeviceRunSessionMutation.js +4 -4
- package/build/graphql/queries/ConvexQuery.d.ts +6 -0
- package/build/graphql/queries/ConvexQuery.js +49 -0
- package/build/graphql/queries/ObserveQuery.d.ts +21 -1
- package/build/graphql/queries/ObserveQuery.js +80 -0
- package/build/graphql/types/ConvexTeamConnection.d.ts +11 -0
- package/build/graphql/types/ConvexTeamConnection.js +43 -0
- package/build/graphql/types/Observe.d.ts +1 -0
- package/build/graphql/types/Observe.js +26 -1
- package/build/observe/fetchCustomEvents.d.ts +19 -0
- package/build/observe/fetchCustomEvents.js +21 -0
- package/build/observe/formatCustomEvents.d.ts +70 -0
- package/build/observe/formatCustomEvents.js +140 -0
- package/build/observe/formatEvents.js +5 -34
- package/build/observe/formatMetrics.js +2 -7
- package/build/observe/formatUtils.d.ts +27 -0
- package/build/observe/formatUtils.js +64 -0
- package/build/observe/formatVersions.js +2 -9
- package/build/observe/platforms.d.ts +21 -0
- package/build/observe/platforms.js +48 -0
- package/build/observe/resolveProjectContext.d.ts +22 -0
- package/build/observe/resolveProjectContext.js +21 -0
- package/build/run/ios/run.d.ts +2 -1
- package/build/run/ios/run.js +6 -2
- package/build/run/ios/simulator.d.ts +4 -1
- package/build/run/ios/simulator.js +14 -2
- package/build/run/run.d.ts +2 -1
- package/build/run/run.js +2 -2
- package/oclif.manifest.json +3984 -3243
- package/package.json +4 -4
|
@@ -4,25 +4,9 @@ exports.buildObserveEventsTable = buildObserveEventsTable;
|
|
|
4
4
|
exports.buildObserveEventsJson = buildObserveEventsJson;
|
|
5
5
|
const tslib_1 = require("tslib");
|
|
6
6
|
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
7
|
+
const renderTextTable_1 = tslib_1.__importDefault(require("../utils/renderTextTable"));
|
|
8
|
+
const formatUtils_1 = require("./formatUtils");
|
|
7
9
|
const metricNames_1 = require("./metricNames");
|
|
8
|
-
function formatTimestamp(isoString) {
|
|
9
|
-
const date = new Date(isoString);
|
|
10
|
-
return date.toLocaleDateString('en-US', {
|
|
11
|
-
year: 'numeric',
|
|
12
|
-
month: 'short',
|
|
13
|
-
day: 'numeric',
|
|
14
|
-
hour: '2-digit',
|
|
15
|
-
minute: '2-digit',
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
function formatDate(isoString) {
|
|
19
|
-
const date = new Date(isoString);
|
|
20
|
-
return date.toLocaleDateString('en-US', {
|
|
21
|
-
year: 'numeric',
|
|
22
|
-
month: 'short',
|
|
23
|
-
day: 'numeric',
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
10
|
function resolveCustomParams(event) {
|
|
27
11
|
return event.customParams ?? null;
|
|
28
12
|
}
|
|
@@ -47,31 +31,18 @@ function buildObserveEventsTable(events, pageInfo, options) {
|
|
|
47
31
|
`${event.deviceOs} ${event.deviceOsVersion}`,
|
|
48
32
|
event.deviceModel,
|
|
49
33
|
event.countryCode ?? '-',
|
|
50
|
-
formatTimestamp(event.timestamp),
|
|
34
|
+
(0, formatUtils_1.formatTimestamp)(event.timestamp),
|
|
51
35
|
]);
|
|
52
|
-
const colWidths = headers.map((h, i) => Math.max(h.length, ...rows.map(r => r[i].length)));
|
|
53
|
-
const headerLine = headers.map((h, i) => h.padEnd(colWidths[i])).join(' ');
|
|
54
|
-
const separatorLine = colWidths.map(w => '-'.repeat(w)).join(' ');
|
|
55
|
-
const dataLines = rows.map(row => row.map((cell, i) => cell.padEnd(colWidths[i])).join(' '));
|
|
56
36
|
const lines = [];
|
|
57
37
|
if (options) {
|
|
58
38
|
const metricDisplay = (0, metricNames_1.getMetricDisplayName)(options.metricName);
|
|
59
|
-
|
|
60
|
-
if (options.daysBack) {
|
|
61
|
-
timeDesc = `for the last ${options.daysBack} days`;
|
|
62
|
-
}
|
|
63
|
-
else if (options.startTime && options.endTime) {
|
|
64
|
-
timeDesc = `from ${formatDate(options.startTime)} to ${formatDate(options.endTime)}`;
|
|
65
|
-
}
|
|
66
|
-
else {
|
|
67
|
-
timeDesc = '';
|
|
68
|
-
}
|
|
39
|
+
const timeDesc = (0, formatUtils_1.buildTimeRangeDescription)(options);
|
|
69
40
|
const totalDesc = options.totalEventCount != null
|
|
70
41
|
? ` — ${options.totalEventCount.toLocaleString()} total events`
|
|
71
42
|
: '';
|
|
72
43
|
lines.push(chalk_1.default.bold(`${metricDisplay} events ${timeDesc}${totalDesc}`.trim()), '');
|
|
73
44
|
}
|
|
74
|
-
lines.push(
|
|
45
|
+
lines.push((0, renderTextTable_1.default)(headers, rows));
|
|
75
46
|
if (pageInfo.hasNextPage && pageInfo.endCursor) {
|
|
76
47
|
lines.push('', `Next page: --after ${pageInfo.endCursor}`);
|
|
77
48
|
}
|
|
@@ -10,6 +10,7 @@ const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
|
10
10
|
const errors_1 = require("../commandUtils/errors");
|
|
11
11
|
const platform_1 = require("../platform");
|
|
12
12
|
const renderTextTable_1 = tslib_1.__importDefault(require("../utils/renderTextTable"));
|
|
13
|
+
const formatUtils_1 = require("./formatUtils");
|
|
13
14
|
const metricNames_1 = require("./metricNames");
|
|
14
15
|
exports.STAT_ALIASES = {
|
|
15
16
|
min: 'min',
|
|
@@ -105,12 +106,6 @@ function buildObserveMetricsJson(metricsMap, metricNames, stats, totalEventCount
|
|
|
105
106
|
function buildStatsDescription(displayStats) {
|
|
106
107
|
return displayStats.map(s => exports.STAT_DISPLAY_NAMES[s]).join(', ');
|
|
107
108
|
}
|
|
108
|
-
function buildTimeRangeDescription(daysBack) {
|
|
109
|
-
if (daysBack) {
|
|
110
|
-
return `for the last ${daysBack} days`;
|
|
111
|
-
}
|
|
112
|
-
return '';
|
|
113
|
-
}
|
|
114
109
|
function buildObserveMetricsTable(metricsMap, metricNames, stats, options) {
|
|
115
110
|
const { versions: results } = buildObserveMetricsJson(metricsMap, metricNames, stats);
|
|
116
111
|
if (results.length === 0) {
|
|
@@ -120,7 +115,7 @@ function buildObserveMetricsTable(metricsMap, metricNames, stats, options) {
|
|
|
120
115
|
const hasEventCount = stats.includes('eventCount');
|
|
121
116
|
// Build summary header
|
|
122
117
|
const statsDesc = displayStats.length > 0 ? buildStatsDescription(displayStats) : 'Event count';
|
|
123
|
-
const timeDesc = buildTimeRangeDescription(options?.daysBack);
|
|
118
|
+
const timeDesc = (0, formatUtils_1.buildTimeRangeDescription)({ daysBack: options?.daysBack });
|
|
124
119
|
const countSuffix = hasEventCount && displayStats.length > 0 ? ' (event count)' : '';
|
|
125
120
|
const summaryLine = `${statsDesc} values${countSuffix}${timeDesc ? ` ${timeDesc}` : ''}`;
|
|
126
121
|
// Group results by platform
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Format an ISO timestamp for display in event tables (minute precision).
|
|
3
|
+
* Uses the runtime's default locale.
|
|
4
|
+
*/
|
|
5
|
+
export declare function formatTimestamp(isoString: string): string;
|
|
6
|
+
/**
|
|
7
|
+
* Format an ISO timestamp for display in log tables (millisecond precision).
|
|
8
|
+
* Use this instead of formatTimestamp when the table represents individual
|
|
9
|
+
* log entries where sub-minute resolution matters. Uses the runtime's
|
|
10
|
+
* default locale.
|
|
11
|
+
*/
|
|
12
|
+
export declare function formatLogTimestamp(isoString: string): string;
|
|
13
|
+
/**
|
|
14
|
+
* Format an ISO timestamp for display as a date only (no time). Uses the
|
|
15
|
+
* runtime's default locale.
|
|
16
|
+
*/
|
|
17
|
+
export declare function formatDate(isoString: string): string;
|
|
18
|
+
/**
|
|
19
|
+
* Build the time-range fragment used in summary headers, e.g.
|
|
20
|
+
* "for the last 7 days" or "from Jan 1, 2025 to Feb 1, 2025".
|
|
21
|
+
* Returns an empty string when no range information is provided.
|
|
22
|
+
*/
|
|
23
|
+
export declare function buildTimeRangeDescription(options: {
|
|
24
|
+
daysBack?: number;
|
|
25
|
+
startTime?: string;
|
|
26
|
+
endTime?: string;
|
|
27
|
+
}): string;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.formatTimestamp = formatTimestamp;
|
|
4
|
+
exports.formatLogTimestamp = formatLogTimestamp;
|
|
5
|
+
exports.formatDate = formatDate;
|
|
6
|
+
exports.buildTimeRangeDescription = buildTimeRangeDescription;
|
|
7
|
+
/**
|
|
8
|
+
* Format an ISO timestamp for display in event tables (minute precision).
|
|
9
|
+
* Uses the runtime's default locale.
|
|
10
|
+
*/
|
|
11
|
+
function formatTimestamp(isoString) {
|
|
12
|
+
const date = new Date(isoString);
|
|
13
|
+
return date.toLocaleDateString(undefined, {
|
|
14
|
+
year: 'numeric',
|
|
15
|
+
month: 'short',
|
|
16
|
+
day: 'numeric',
|
|
17
|
+
hour: '2-digit',
|
|
18
|
+
minute: '2-digit',
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Format an ISO timestamp for display in log tables (millisecond precision).
|
|
23
|
+
* Use this instead of formatTimestamp when the table represents individual
|
|
24
|
+
* log entries where sub-minute resolution matters. Uses the runtime's
|
|
25
|
+
* default locale.
|
|
26
|
+
*/
|
|
27
|
+
function formatLogTimestamp(isoString) {
|
|
28
|
+
const date = new Date(isoString);
|
|
29
|
+
return date.toLocaleDateString(undefined, {
|
|
30
|
+
year: 'numeric',
|
|
31
|
+
month: 'short',
|
|
32
|
+
day: 'numeric',
|
|
33
|
+
hour: '2-digit',
|
|
34
|
+
minute: '2-digit',
|
|
35
|
+
second: '2-digit',
|
|
36
|
+
fractionalSecondDigits: 3,
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Format an ISO timestamp for display as a date only (no time). Uses the
|
|
41
|
+
* runtime's default locale.
|
|
42
|
+
*/
|
|
43
|
+
function formatDate(isoString) {
|
|
44
|
+
const date = new Date(isoString);
|
|
45
|
+
return date.toLocaleDateString(undefined, {
|
|
46
|
+
year: 'numeric',
|
|
47
|
+
month: 'short',
|
|
48
|
+
day: 'numeric',
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Build the time-range fragment used in summary headers, e.g.
|
|
53
|
+
* "for the last 7 days" or "from Jan 1, 2025 to Feb 1, 2025".
|
|
54
|
+
* Returns an empty string when no range information is provided.
|
|
55
|
+
*/
|
|
56
|
+
function buildTimeRangeDescription(options) {
|
|
57
|
+
if (options.daysBack) {
|
|
58
|
+
return `for the last ${options.daysBack} days`;
|
|
59
|
+
}
|
|
60
|
+
if (options.startTime && options.endTime) {
|
|
61
|
+
return `from ${formatDate(options.startTime)} to ${formatDate(options.endTime)}`;
|
|
62
|
+
}
|
|
63
|
+
return '';
|
|
64
|
+
}
|
|
@@ -6,14 +6,7 @@ const tslib_1 = require("tslib");
|
|
|
6
6
|
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
7
7
|
const platform_1 = require("../platform");
|
|
8
8
|
const renderTextTable_1 = tslib_1.__importDefault(require("../utils/renderTextTable"));
|
|
9
|
-
|
|
10
|
-
const date = new Date(isoString);
|
|
11
|
-
return date.toLocaleDateString('en-US', {
|
|
12
|
-
year: 'numeric',
|
|
13
|
-
month: 'short',
|
|
14
|
-
day: 'numeric',
|
|
15
|
-
});
|
|
16
|
-
}
|
|
9
|
+
const formatUtils_1 = require("./formatUtils");
|
|
17
10
|
function mapEasBuilds(easBuilds) {
|
|
18
11
|
return easBuilds.map(b => ({
|
|
19
12
|
easBuildId: b.easBuildId,
|
|
@@ -74,7 +67,7 @@ function buildObserveVersionsTable(results) {
|
|
|
74
67
|
sections.push(chalk_1.default.bold(platform_1.appPlatformDisplayNames[platform]));
|
|
75
68
|
const rows = appVersions.map(version => [
|
|
76
69
|
version.appVersion,
|
|
77
|
-
formatDate(version.firstSeenAt),
|
|
70
|
+
(0, formatUtils_1.formatDate)(version.firstSeenAt),
|
|
78
71
|
String(version.eventCount),
|
|
79
72
|
String(version.uniqueUserCount),
|
|
80
73
|
String(version.buildNumbers.length),
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { AppObservePlatform, AppPlatform } from '../graphql/generated';
|
|
2
|
+
/**
|
|
3
|
+
* Allowed values for the --platform flag in observe commands.
|
|
4
|
+
* Derived from the AppObservePlatform enum so new platforms added on
|
|
5
|
+
* the server are automatically picked up.
|
|
6
|
+
*/
|
|
7
|
+
export declare const allowedPlatformFlagValues: string[];
|
|
8
|
+
type PlatformFlagValue = (typeof allowedPlatformFlagValues)[number];
|
|
9
|
+
/**
|
|
10
|
+
* Resolve a single AppObservePlatform from a --platform flag value.
|
|
11
|
+
* Returns undefined when no flag was provided.
|
|
12
|
+
*/
|
|
13
|
+
export declare function appObservePlatformFromFlag(flag: PlatformFlagValue | undefined): AppObservePlatform | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* Resolve a list of AppPlatform values from a --platform flag value.
|
|
16
|
+
* Returns the single matching platform when a flag is provided, or all
|
|
17
|
+
* known platforms when no flag is provided (so the caller queries every
|
|
18
|
+
* platform).
|
|
19
|
+
*/
|
|
20
|
+
export declare function appPlatformsFromFlag(flag: PlatformFlagValue | undefined): AppPlatform[];
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.allowedPlatformFlagValues = void 0;
|
|
4
|
+
exports.appObservePlatformFromFlag = appObservePlatformFromFlag;
|
|
5
|
+
exports.appPlatformsFromFlag = appPlatformsFromFlag;
|
|
6
|
+
const generated_1 = require("../graphql/generated");
|
|
7
|
+
/**
|
|
8
|
+
* Allowed values for the --platform flag in observe commands.
|
|
9
|
+
* Derived from the AppObservePlatform enum so new platforms added on
|
|
10
|
+
* the server are automatically picked up.
|
|
11
|
+
*/
|
|
12
|
+
exports.allowedPlatformFlagValues = Object.values(generated_1.AppObservePlatform).map(s => s.toLowerCase());
|
|
13
|
+
const defaultAppObservePlatform = generated_1.AppObservePlatform.Ios;
|
|
14
|
+
const defaultAppPlatform = generated_1.AppPlatform.Ios;
|
|
15
|
+
/**
|
|
16
|
+
* Resolve a single AppObservePlatform from a --platform flag value.
|
|
17
|
+
* Returns undefined when no flag was provided.
|
|
18
|
+
*/
|
|
19
|
+
function appObservePlatformFromFlag(flag) {
|
|
20
|
+
if (!flag) {
|
|
21
|
+
return undefined;
|
|
22
|
+
}
|
|
23
|
+
switch (flag) {
|
|
24
|
+
case 'android':
|
|
25
|
+
return generated_1.AppObservePlatform.Android;
|
|
26
|
+
case 'ios':
|
|
27
|
+
return generated_1.AppObservePlatform.Ios;
|
|
28
|
+
}
|
|
29
|
+
return defaultAppObservePlatform;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Resolve a list of AppPlatform values from a --platform flag value.
|
|
33
|
+
* Returns the single matching platform when a flag is provided, or all
|
|
34
|
+
* known platforms when no flag is provided (so the caller queries every
|
|
35
|
+
* platform).
|
|
36
|
+
*/
|
|
37
|
+
function appPlatformsFromFlag(flag) {
|
|
38
|
+
if (!flag) {
|
|
39
|
+
return [generated_1.AppPlatform.Android, generated_1.AppPlatform.Ios];
|
|
40
|
+
}
|
|
41
|
+
switch (flag) {
|
|
42
|
+
case 'android':
|
|
43
|
+
return [generated_1.AppPlatform.Android];
|
|
44
|
+
case 'ios':
|
|
45
|
+
return [generated_1.AppPlatform.Ios];
|
|
46
|
+
}
|
|
47
|
+
return [defaultAppPlatform];
|
|
48
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import EasCommand, { ContextInput } from '../commandUtils/EasCommand';
|
|
2
|
+
import { ExpoGraphqlClient } from '../commandUtils/context/contextUtils/createGraphqlClient';
|
|
3
|
+
/**
|
|
4
|
+
* Shared context resolution for observe commands.
|
|
5
|
+
*
|
|
6
|
+
* If `projectIdOverride` is provided (typically via `--project-id`), the
|
|
7
|
+
* helper only requires the LoggedIn context (so the command can run outside
|
|
8
|
+
* of a project directory). Otherwise it uses the full context definition,
|
|
9
|
+
* which derives the project ID from the local app config.
|
|
10
|
+
*/
|
|
11
|
+
export declare function resolveObserveCommandContextAsync({ command, commandClass, loggedInOnlyContextDefinition, projectIdOverride, nonInteractive, }: {
|
|
12
|
+
command: EasCommand;
|
|
13
|
+
commandClass: {
|
|
14
|
+
contextDefinition: ContextInput<any>;
|
|
15
|
+
};
|
|
16
|
+
loggedInOnlyContextDefinition: ContextInput<any>;
|
|
17
|
+
projectIdOverride?: string;
|
|
18
|
+
nonInteractive: boolean;
|
|
19
|
+
}): Promise<{
|
|
20
|
+
projectId: string;
|
|
21
|
+
graphqlClient: ExpoGraphqlClient;
|
|
22
|
+
}>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolveObserveCommandContextAsync = resolveObserveCommandContextAsync;
|
|
4
|
+
/**
|
|
5
|
+
* Shared context resolution for observe commands.
|
|
6
|
+
*
|
|
7
|
+
* If `projectIdOverride` is provided (typically via `--project-id`), the
|
|
8
|
+
* helper only requires the LoggedIn context (so the command can run outside
|
|
9
|
+
* of a project directory). Otherwise it uses the full context definition,
|
|
10
|
+
* which derives the project ID from the local app config.
|
|
11
|
+
*/
|
|
12
|
+
async function resolveObserveCommandContextAsync({ command, commandClass, loggedInOnlyContextDefinition, projectIdOverride, nonInteractive, }) {
|
|
13
|
+
// `getContextAsync` is `protected` on EasCommand; cast to access from this helper.
|
|
14
|
+
const commandWithContextAccess = command;
|
|
15
|
+
if (projectIdOverride) {
|
|
16
|
+
const ctx = await commandWithContextAccess.getContextAsync({ contextDefinition: loggedInOnlyContextDefinition }, { nonInteractive });
|
|
17
|
+
return { projectId: projectIdOverride, graphqlClient: ctx.loggedIn.graphqlClient };
|
|
18
|
+
}
|
|
19
|
+
const ctx = await commandWithContextAccess.getContextAsync(commandClass, { nonInteractive });
|
|
20
|
+
return { projectId: ctx.projectId, graphqlClient: ctx.loggedIn.graphqlClient };
|
|
21
|
+
}
|
package/build/run/ios/run.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type SimulatorRunTarget = true | string | undefined;
|
|
2
|
+
export declare function runAppOnIosSimulatorAsync(appPath: string, simulatorRunTarget?: SimulatorRunTarget): Promise<void>;
|
package/build/run/ios/run.js
CHANGED
|
@@ -6,9 +6,13 @@ const spawn_async_1 = tslib_1.__importDefault(require("@expo/spawn-async"));
|
|
|
6
6
|
const path_1 = tslib_1.__importDefault(require("path"));
|
|
7
7
|
const simulator = tslib_1.__importStar(require("./simulator"));
|
|
8
8
|
const systemRequirements_1 = require("./systemRequirements");
|
|
9
|
-
async function runAppOnIosSimulatorAsync(appPath) {
|
|
9
|
+
async function runAppOnIosSimulatorAsync(appPath, simulatorRunTarget) {
|
|
10
10
|
await (0, systemRequirements_1.validateSystemRequirementsAsync)();
|
|
11
|
-
const selectedSimulator =
|
|
11
|
+
const selectedSimulator = simulatorRunTarget === true
|
|
12
|
+
? await simulator.selectSimulatorAsync({ forcePrompt: true })
|
|
13
|
+
: simulatorRunTarget
|
|
14
|
+
? await simulator.getIosSimulatorByIdOrNameAsync(simulatorRunTarget)
|
|
15
|
+
: await simulator.selectSimulatorAsync();
|
|
12
16
|
await simulator.ensureSimulatorBootedAsync(selectedSimulator);
|
|
13
17
|
await simulator.ensureSimulatorAppOpenedAsync(selectedSimulator.udid);
|
|
14
18
|
const bundleIdentifier = await getAppBundleIdentifierAsync(appPath);
|
|
@@ -9,7 +9,10 @@ interface IosSimulator {
|
|
|
9
9
|
udid: string;
|
|
10
10
|
lastBootedAt?: Date;
|
|
11
11
|
}
|
|
12
|
-
export declare function selectSimulatorAsync(
|
|
12
|
+
export declare function selectSimulatorAsync({ forcePrompt, }?: {
|
|
13
|
+
forcePrompt?: boolean;
|
|
14
|
+
}): Promise<IosSimulator>;
|
|
15
|
+
export declare function getIosSimulatorByIdOrNameAsync(simulator: string): Promise<IosSimulator>;
|
|
13
16
|
export declare function getFirstBootedIosSimulatorAsync(): Promise<IosSimulator | undefined>;
|
|
14
17
|
export declare function getAvaliableIosSimulatorsListAsync(query?: string): Promise<IosSimulator[]>;
|
|
15
18
|
export declare function ensureSimulatorBootedAsync(simulator: IosSimulator): Promise<void>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.selectSimulatorAsync = selectSimulatorAsync;
|
|
4
|
+
exports.getIosSimulatorByIdOrNameAsync = getIosSimulatorByIdOrNameAsync;
|
|
4
5
|
exports.getFirstBootedIosSimulatorAsync = getFirstBootedIosSimulatorAsync;
|
|
5
6
|
exports.getAvaliableIosSimulatorsListAsync = getAvaliableIosSimulatorsListAsync;
|
|
6
7
|
exports.ensureSimulatorBootedAsync = ensureSimulatorBootedAsync;
|
|
@@ -16,8 +17,8 @@ const simctl_1 = require("./simctl");
|
|
|
16
17
|
const log_1 = tslib_1.__importDefault(require("../../log"));
|
|
17
18
|
const prompts_1 = require("../../prompts");
|
|
18
19
|
const promise_1 = require("../../utils/promise");
|
|
19
|
-
async function selectSimulatorAsync() {
|
|
20
|
-
const bootedSimulator = await getFirstBootedIosSimulatorAsync();
|
|
20
|
+
async function selectSimulatorAsync({ forcePrompt = false, } = {}) {
|
|
21
|
+
const bootedSimulator = forcePrompt ? undefined : await getFirstBootedIosSimulatorAsync();
|
|
21
22
|
if (bootedSimulator) {
|
|
22
23
|
return bootedSimulator;
|
|
23
24
|
}
|
|
@@ -32,6 +33,17 @@ async function selectSimulatorAsync() {
|
|
|
32
33
|
value: simulator,
|
|
33
34
|
})),
|
|
34
35
|
});
|
|
36
|
+
if (!selectedSimulator) {
|
|
37
|
+
throw new Error('No simulator selected.');
|
|
38
|
+
}
|
|
39
|
+
return selectedSimulator;
|
|
40
|
+
}
|
|
41
|
+
async function getIosSimulatorByIdOrNameAsync(simulator) {
|
|
42
|
+
const simulators = await getAvaliableIosSimulatorsListAsync();
|
|
43
|
+
const selectedSimulator = simulators.find(availableSimulator => availableSimulator.udid === simulator || availableSimulator.name === simulator);
|
|
44
|
+
if (!selectedSimulator) {
|
|
45
|
+
throw new Error(`Could not find an available iOS simulator with name or UDID "${simulator}".`);
|
|
46
|
+
}
|
|
35
47
|
return selectedSimulator;
|
|
36
48
|
}
|
|
37
49
|
async function getFirstBootedIosSimulatorAsync() {
|
package/build/run/run.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SimulatorRunTarget } from './ios/run';
|
|
1
2
|
import { AppPlatform } from '../graphql/generated';
|
|
2
3
|
export interface RunArchiveFlags {
|
|
3
4
|
latest?: boolean;
|
|
@@ -5,5 +6,5 @@ export interface RunArchiveFlags {
|
|
|
5
6
|
path?: string;
|
|
6
7
|
url?: string;
|
|
7
8
|
}
|
|
8
|
-
export declare function runAsync(simulatorBuildPath: string, selectedPlatform: AppPlatform): Promise<void>;
|
|
9
|
+
export declare function runAsync(simulatorBuildPath: string, selectedPlatform: AppPlatform, simulator?: SimulatorRunTarget): Promise<void>;
|
|
9
10
|
export declare function getEasBuildRunCachedAppPath(projectId: string, buildId: string, platform: AppPlatform): string;
|
package/build/run/run.js
CHANGED
|
@@ -8,9 +8,9 @@ const run_1 = require("./android/run");
|
|
|
8
8
|
const run_2 = require("./ios/run");
|
|
9
9
|
const generated_1 = require("../graphql/generated");
|
|
10
10
|
const paths_1 = require("../utils/paths");
|
|
11
|
-
async function runAsync(simulatorBuildPath, selectedPlatform) {
|
|
11
|
+
async function runAsync(simulatorBuildPath, selectedPlatform, simulator) {
|
|
12
12
|
if (selectedPlatform === generated_1.AppPlatform.Ios) {
|
|
13
|
-
await (0, run_2.runAppOnIosSimulatorAsync)(simulatorBuildPath);
|
|
13
|
+
await (0, run_2.runAppOnIosSimulatorAsync)(simulatorBuildPath, simulator);
|
|
14
14
|
}
|
|
15
15
|
else {
|
|
16
16
|
await (0, run_1.runAppOnAndroidEmulatorAsync)(simulatorBuildPath);
|