eas-cli 18.12.3 → 18.13.1
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 +100 -100
- package/build/build/metadata.js +10 -0
- package/build/commandUtils/new/commands.js +3 -10
- package/build/commands/observe/events.d.ts +7 -7
- package/build/commands/observe/events.js +7 -29
- package/build/commands/observe/logs.d.ts +8 -8
- package/build/commands/observe/logs.js +7 -29
- package/build/commands/observe/metrics.d.ts +4 -4
- package/build/commands/observe/metrics.js +4 -20
- package/build/commands/observe/routes.d.ts +27 -0
- package/build/commands/observe/routes.js +106 -0
- package/build/commands/observe/versions.d.ts +2 -2
- package/build/commands/observe/versions.js +4 -21
- package/build/commands/project/onboarding.js +7 -17
- package/build/graphql/generated.d.ts +56 -0
- package/build/graphql/queries/ObserveQuery.d.ts +12 -1
- package/build/graphql/queries/ObserveQuery.js +54 -0
- package/build/log.js +4 -3
- package/build/observe/fetchMetrics.js +2 -6
- package/build/observe/fetchNavigationRoutes.d.ts +22 -0
- package/build/observe/fetchNavigationRoutes.js +51 -0
- package/build/observe/flags.d.ts +20 -0
- package/build/observe/flags.js +46 -0
- package/build/observe/formatNavigationRoutes.d.ts +34 -0
- package/build/observe/formatNavigationRoutes.js +170 -0
- package/build/observe/metricNames.d.ts +2 -0
- package/build/observe/metricNames.js +22 -3
- package/build/observe/platforms.d.ts +1 -0
- package/build/observe/platforms.js +5 -1
- package/build/project/expoConfig.js +7 -26
- package/build/project/ios/entitlements.d.ts +1 -2
- package/build/project/ios/entitlements.js +7 -44
- package/build/project/ios/target.js +1 -1
- package/build/utils/expoCli.d.ts +3 -0
- package/build/utils/expoCli.js +15 -7
- package/oclif.manifest.json +281 -87
- package/package.json +7 -5
|
@@ -186,4 +186,58 @@ exports.ObserveQuery = {
|
|
|
186
186
|
.toPromise());
|
|
187
187
|
return data.app.byId.observe.customEventNames;
|
|
188
188
|
},
|
|
189
|
+
async navigationRoutesAsync(graphqlClient, variables) {
|
|
190
|
+
const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
|
|
191
|
+
.query((0, graphql_tag_1.default) `
|
|
192
|
+
query AppObserveNavigationRoutes(
|
|
193
|
+
$appId: String!
|
|
194
|
+
$filter: AppObserveNavigationRoutesFilter!
|
|
195
|
+
$first: Int
|
|
196
|
+
$after: String
|
|
197
|
+
$orderBy: AppObserveNavigationRoutesOrderBy
|
|
198
|
+
) {
|
|
199
|
+
app {
|
|
200
|
+
byId(appId: $appId) {
|
|
201
|
+
id
|
|
202
|
+
observe {
|
|
203
|
+
navigationRoutes(filter: $filter, first: $first, after: $after, orderBy: $orderBy) {
|
|
204
|
+
pageInfo {
|
|
205
|
+
hasNextPage
|
|
206
|
+
hasPreviousPage
|
|
207
|
+
endCursor
|
|
208
|
+
}
|
|
209
|
+
edges {
|
|
210
|
+
cursor
|
|
211
|
+
node {
|
|
212
|
+
routeName
|
|
213
|
+
coldTtr {
|
|
214
|
+
count
|
|
215
|
+
median
|
|
216
|
+
p90
|
|
217
|
+
}
|
|
218
|
+
warmTtr {
|
|
219
|
+
count
|
|
220
|
+
median
|
|
221
|
+
p90
|
|
222
|
+
}
|
|
223
|
+
tti {
|
|
224
|
+
count
|
|
225
|
+
median
|
|
226
|
+
p90
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
`, variables)
|
|
236
|
+
.toPromise());
|
|
237
|
+
const { edges, pageInfo } = data.app.byId.observe.navigationRoutes;
|
|
238
|
+
return {
|
|
239
|
+
routes: edges.map(edge => edge.node),
|
|
240
|
+
pageInfo,
|
|
241
|
+
};
|
|
242
|
+
},
|
|
189
243
|
};
|
package/build/log.js
CHANGED
|
@@ -4,12 +4,12 @@ exports.link = link;
|
|
|
4
4
|
exports.learnMore = learnMore;
|
|
5
5
|
const tslib_1 = require("tslib");
|
|
6
6
|
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
7
|
+
const debug_1 = tslib_1.__importDefault(require("debug"));
|
|
7
8
|
const figures_1 = tslib_1.__importDefault(require("figures"));
|
|
8
9
|
const getenv_1 = require("getenv");
|
|
9
10
|
const log_symbols_1 = tslib_1.__importDefault(require("log-symbols"));
|
|
10
11
|
const terminal_link_1 = tslib_1.__importDefault(require("terminal-link"));
|
|
11
|
-
|
|
12
|
-
const nodeDebug = require('debug')('eas:log:debug');
|
|
12
|
+
const nodeDebug = (0, debug_1.default)('eas:log:debug');
|
|
13
13
|
class Log {
|
|
14
14
|
static isDebug = (0, getenv_1.boolish)('EXPO_DEBUG', false);
|
|
15
15
|
static log(...args) {
|
|
@@ -43,7 +43,8 @@ class Log {
|
|
|
43
43
|
}
|
|
44
44
|
else {
|
|
45
45
|
Log.updateIsLastLineNewLine(args);
|
|
46
|
-
|
|
46
|
+
const [first, ...rest] = args;
|
|
47
|
+
nodeDebug(first, ...rest);
|
|
47
48
|
}
|
|
48
49
|
}
|
|
49
50
|
static gray(...args) {
|
|
@@ -4,14 +4,10 @@ exports.validateDateFlag = validateDateFlag;
|
|
|
4
4
|
exports.fetchObserveMetricsAsync = fetchObserveMetricsAsync;
|
|
5
5
|
const tslib_1 = require("tslib");
|
|
6
6
|
const errors_1 = require("../commandUtils/errors");
|
|
7
|
-
const generated_1 = require("../graphql/generated");
|
|
8
7
|
const ObserveQuery_1 = require("../graphql/queries/ObserveQuery");
|
|
9
8
|
const log_1 = tslib_1.__importDefault(require("../log"));
|
|
10
9
|
const formatMetrics_1 = require("./formatMetrics");
|
|
11
|
-
const
|
|
12
|
-
[generated_1.AppPlatform.Android]: generated_1.AppObservePlatform.Android,
|
|
13
|
-
[generated_1.AppPlatform.Ios]: generated_1.AppObservePlatform.Ios,
|
|
14
|
-
};
|
|
10
|
+
const platforms_1 = require("./platforms");
|
|
15
11
|
function validateDateFlag(value, flagName) {
|
|
16
12
|
const parsed = new Date(value);
|
|
17
13
|
if (isNaN(parsed.getTime())) {
|
|
@@ -20,7 +16,7 @@ function validateDateFlag(value, flagName) {
|
|
|
20
16
|
}
|
|
21
17
|
async function fetchObserveMetricsAsync(graphqlClient, appId, metricNames, platforms, startTime, endTime) {
|
|
22
18
|
const queries = platforms.map(async (appPlatform) => {
|
|
23
|
-
const observePlatform = appPlatformToObservePlatform[appPlatform];
|
|
19
|
+
const observePlatform = platforms_1.appPlatformToObservePlatform[appPlatform];
|
|
24
20
|
try {
|
|
25
21
|
const appVersions = await ObserveQuery_1.ObserveQuery.appVersionsAsync(graphqlClient, {
|
|
26
22
|
appId,
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ExpoGraphqlClient } from '../commandUtils/context/contextUtils/createGraphqlClient';
|
|
2
|
+
import { AppObserveNavigationRoute, AppObserveNavigationRoutesOrderBy, AppPlatform, PageInfo } from '../graphql/generated';
|
|
3
|
+
export interface NavigationRouteWithPlatform {
|
|
4
|
+
platform: AppPlatform;
|
|
5
|
+
route: AppObserveNavigationRoute;
|
|
6
|
+
}
|
|
7
|
+
export interface FetchNavigationRoutesOptions {
|
|
8
|
+
startTime: string;
|
|
9
|
+
endTime: string;
|
|
10
|
+
platforms: AppPlatform[];
|
|
11
|
+
limit: number;
|
|
12
|
+
after?: string;
|
|
13
|
+
appVersion?: string;
|
|
14
|
+
updateId?: string;
|
|
15
|
+
buildNumber?: string;
|
|
16
|
+
orderBy?: AppObserveNavigationRoutesOrderBy;
|
|
17
|
+
}
|
|
18
|
+
export interface FetchNavigationRoutesResult {
|
|
19
|
+
routes: NavigationRouteWithPlatform[];
|
|
20
|
+
pageInfoByPlatform: Map<AppPlatform, PageInfo>;
|
|
21
|
+
}
|
|
22
|
+
export declare function fetchObserveNavigationRoutesAsync(graphqlClient: ExpoGraphqlClient, appId: string, options: FetchNavigationRoutesOptions): Promise<FetchNavigationRoutesResult>;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fetchObserveNavigationRoutesAsync = fetchObserveNavigationRoutesAsync;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const generated_1 = require("../graphql/generated");
|
|
6
|
+
const ObserveQuery_1 = require("../graphql/queries/ObserveQuery");
|
|
7
|
+
const log_1 = tslib_1.__importDefault(require("../log"));
|
|
8
|
+
const platforms_1 = require("./platforms");
|
|
9
|
+
async function fetchObserveNavigationRoutesAsync(graphqlClient, appId, options) {
|
|
10
|
+
const orderBy = options.orderBy ?? {
|
|
11
|
+
field: generated_1.AppObserveNavigationRoutesOrderByField.NavigationCount,
|
|
12
|
+
direction: generated_1.AppObserveEventsOrderByDirection.Desc,
|
|
13
|
+
};
|
|
14
|
+
const queries = options.platforms.map(async (appPlatform) => {
|
|
15
|
+
const observePlatform = platforms_1.appPlatformToObservePlatform[appPlatform];
|
|
16
|
+
try {
|
|
17
|
+
const result = await ObserveQuery_1.ObserveQuery.navigationRoutesAsync(graphqlClient, {
|
|
18
|
+
appId,
|
|
19
|
+
filter: {
|
|
20
|
+
platform: observePlatform,
|
|
21
|
+
startTime: options.startTime,
|
|
22
|
+
endTime: options.endTime,
|
|
23
|
+
...(options.appVersion && { appVersion: options.appVersion }),
|
|
24
|
+
...(options.updateId && { appUpdateId: options.updateId }),
|
|
25
|
+
...(options.buildNumber && { appBuildNumber: options.buildNumber }),
|
|
26
|
+
},
|
|
27
|
+
first: options.limit,
|
|
28
|
+
...(options.after && { after: options.after }),
|
|
29
|
+
orderBy,
|
|
30
|
+
});
|
|
31
|
+
return { appPlatform, ...result };
|
|
32
|
+
}
|
|
33
|
+
catch (error) {
|
|
34
|
+
log_1.default.warn(`Failed to fetch navigation routes on ${observePlatform}: ${error.message}`);
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
const results = await Promise.all(queries);
|
|
39
|
+
const routes = [];
|
|
40
|
+
const pageInfoByPlatform = new Map();
|
|
41
|
+
for (const result of results) {
|
|
42
|
+
if (!result) {
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
pageInfoByPlatform.set(result.appPlatform, result.pageInfo);
|
|
46
|
+
for (const route of result.routes) {
|
|
47
|
+
routes.push({ platform: result.appPlatform, route });
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return { routes, pageInfoByPlatform };
|
|
51
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare const ObserveProjectIdFlag: {
|
|
2
|
+
'project-id': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
3
|
+
};
|
|
4
|
+
export declare const ObservePlatformFlag: {
|
|
5
|
+
platform: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
6
|
+
};
|
|
7
|
+
export declare const ObserveTimeRangeFlags: {
|
|
8
|
+
start: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
9
|
+
end: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
10
|
+
days: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
|
+
};
|
|
12
|
+
export declare const ObserveAfterFlag: {
|
|
13
|
+
after: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
14
|
+
};
|
|
15
|
+
export declare const ObserveAppVersionFlag: {
|
|
16
|
+
'app-version': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
17
|
+
};
|
|
18
|
+
export declare const ObserveUpdateIdFlag: {
|
|
19
|
+
'update-id': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
20
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ObserveUpdateIdFlag = exports.ObserveAppVersionFlag = exports.ObserveAfterFlag = exports.ObserveTimeRangeFlags = exports.ObservePlatformFlag = exports.ObserveProjectIdFlag = void 0;
|
|
4
|
+
const core_1 = require("@oclif/core");
|
|
5
|
+
const platforms_1 = require("./platforms");
|
|
6
|
+
exports.ObserveProjectIdFlag = {
|
|
7
|
+
'project-id': core_1.Flags.string({
|
|
8
|
+
description: 'EAS project ID (defaults to the project ID of the current directory)',
|
|
9
|
+
}),
|
|
10
|
+
};
|
|
11
|
+
exports.ObservePlatformFlag = {
|
|
12
|
+
platform: core_1.Flags.option({
|
|
13
|
+
description: 'Filter by platform',
|
|
14
|
+
options: platforms_1.allowedPlatformFlagValues,
|
|
15
|
+
})(),
|
|
16
|
+
};
|
|
17
|
+
exports.ObserveTimeRangeFlags = {
|
|
18
|
+
start: core_1.Flags.string({
|
|
19
|
+
description: 'Start of time range (ISO date)',
|
|
20
|
+
exclusive: ['days'],
|
|
21
|
+
}),
|
|
22
|
+
end: core_1.Flags.string({
|
|
23
|
+
description: 'End of time range (ISO date)',
|
|
24
|
+
exclusive: ['days'],
|
|
25
|
+
}),
|
|
26
|
+
days: core_1.Flags.integer({
|
|
27
|
+
description: 'Show results from the last N days (mutually exclusive with --start/--end)',
|
|
28
|
+
min: 1,
|
|
29
|
+
exclusive: ['start', 'end'],
|
|
30
|
+
}),
|
|
31
|
+
};
|
|
32
|
+
exports.ObserveAfterFlag = {
|
|
33
|
+
after: core_1.Flags.string({
|
|
34
|
+
description: 'Cursor for pagination. Use the endCursor from a previous query to fetch the next page.',
|
|
35
|
+
}),
|
|
36
|
+
};
|
|
37
|
+
exports.ObserveAppVersionFlag = {
|
|
38
|
+
'app-version': core_1.Flags.string({
|
|
39
|
+
description: 'Filter by app version',
|
|
40
|
+
}),
|
|
41
|
+
};
|
|
42
|
+
exports.ObserveUpdateIdFlag = {
|
|
43
|
+
'update-id': core_1.Flags.string({
|
|
44
|
+
description: 'Filter by EAS update ID',
|
|
45
|
+
}),
|
|
46
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { AppPlatform } from '../graphql/generated';
|
|
2
|
+
import { NavigationRouteWithPlatform } from './fetchNavigationRoutes';
|
|
3
|
+
export type NavigationStatKey = 'median' | 'p90' | 'count';
|
|
4
|
+
export declare const NAVIGATION_STAT_ALIASES: Record<string, NavigationStatKey>;
|
|
5
|
+
export declare const NAVIGATION_STAT_DISPLAY_NAMES: Record<NavigationStatKey, string>;
|
|
6
|
+
export declare function resolveNavigationStatKey(input: string): NavigationStatKey;
|
|
7
|
+
export declare const NAVIGATION_METRIC_NAMES: string[];
|
|
8
|
+
export declare function isNavigationMetric(metricName: string): boolean;
|
|
9
|
+
export interface NavigationRouteValuesJson {
|
|
10
|
+
routeName: string;
|
|
11
|
+
platform: AppPlatform;
|
|
12
|
+
metrics: Record<string, Partial<Record<NavigationStatKey, number | null>>>;
|
|
13
|
+
}
|
|
14
|
+
export interface ObserveNavigationRoutesJsonOutput {
|
|
15
|
+
routes: NavigationRouteValuesJson[];
|
|
16
|
+
pageInfoByPlatform: Record<string, {
|
|
17
|
+
hasNextPage: boolean;
|
|
18
|
+
endCursor: string | null;
|
|
19
|
+
}>;
|
|
20
|
+
}
|
|
21
|
+
export declare function buildObserveNavigationRoutesJson(routes: NavigationRouteWithPlatform[], metricNames: string[], stats: NavigationStatKey[], pageInfoByPlatform: Map<AppPlatform, {
|
|
22
|
+
hasNextPage: boolean;
|
|
23
|
+
endCursor?: string | null;
|
|
24
|
+
}>): ObserveNavigationRoutesJsonOutput;
|
|
25
|
+
export interface BuildNavigationRoutesTableOptions {
|
|
26
|
+
daysBack?: number;
|
|
27
|
+
startTime?: string;
|
|
28
|
+
endTime?: string;
|
|
29
|
+
pageInfoByPlatform?: Map<AppPlatform, {
|
|
30
|
+
hasNextPage: boolean;
|
|
31
|
+
endCursor?: string | null;
|
|
32
|
+
}>;
|
|
33
|
+
}
|
|
34
|
+
export declare function buildObserveNavigationRoutesTable(routes: NavigationRouteWithPlatform[], metricNames: string[], stats: NavigationStatKey[], options?: BuildNavigationRoutesTableOptions): string;
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NAVIGATION_METRIC_NAMES = exports.NAVIGATION_STAT_DISPLAY_NAMES = exports.NAVIGATION_STAT_ALIASES = void 0;
|
|
4
|
+
exports.resolveNavigationStatKey = resolveNavigationStatKey;
|
|
5
|
+
exports.isNavigationMetric = isNavigationMetric;
|
|
6
|
+
exports.buildObserveNavigationRoutesJson = buildObserveNavigationRoutesJson;
|
|
7
|
+
exports.buildObserveNavigationRoutesTable = buildObserveNavigationRoutesTable;
|
|
8
|
+
const tslib_1 = require("tslib");
|
|
9
|
+
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
10
|
+
const errors_1 = require("../commandUtils/errors");
|
|
11
|
+
const platform_1 = require("../platform");
|
|
12
|
+
const renderTextTable_1 = tslib_1.__importDefault(require("../utils/renderTextTable"));
|
|
13
|
+
const formatUtils_1 = require("./formatUtils");
|
|
14
|
+
const metricNames_1 = require("./metricNames");
|
|
15
|
+
exports.NAVIGATION_STAT_ALIASES = {
|
|
16
|
+
med: 'median',
|
|
17
|
+
median: 'median',
|
|
18
|
+
p90: 'p90',
|
|
19
|
+
count: 'count',
|
|
20
|
+
event_count: 'count',
|
|
21
|
+
eventCount: 'count',
|
|
22
|
+
};
|
|
23
|
+
exports.NAVIGATION_STAT_DISPLAY_NAMES = {
|
|
24
|
+
median: 'Med',
|
|
25
|
+
p90: 'P90',
|
|
26
|
+
count: 'Count',
|
|
27
|
+
};
|
|
28
|
+
function resolveNavigationStatKey(input) {
|
|
29
|
+
const resolved = exports.NAVIGATION_STAT_ALIASES[input];
|
|
30
|
+
if (resolved) {
|
|
31
|
+
return resolved;
|
|
32
|
+
}
|
|
33
|
+
throw new errors_1.EasCommandError(`Unknown statistic: "${input}". Valid options: ${Object.keys(exports.NAVIGATION_STAT_ALIASES).join(', ')}`);
|
|
34
|
+
}
|
|
35
|
+
const FULL_METRIC_NAME_TO_FIELD = {
|
|
36
|
+
'expo.navigation.cold_ttr': 'coldTtr',
|
|
37
|
+
'expo.navigation.warm_ttr': 'warmTtr',
|
|
38
|
+
'expo.navigation.tti': 'tti',
|
|
39
|
+
};
|
|
40
|
+
exports.NAVIGATION_METRIC_NAMES = Object.keys(FULL_METRIC_NAME_TO_FIELD);
|
|
41
|
+
function isNavigationMetric(metricName) {
|
|
42
|
+
return metricName in FULL_METRIC_NAME_TO_FIELD;
|
|
43
|
+
}
|
|
44
|
+
function formatStatValue(stat, value) {
|
|
45
|
+
if (value == null) {
|
|
46
|
+
return '-';
|
|
47
|
+
}
|
|
48
|
+
if (stat === 'count') {
|
|
49
|
+
return String(value);
|
|
50
|
+
}
|
|
51
|
+
return `${value.toFixed(2)}s`;
|
|
52
|
+
}
|
|
53
|
+
function formatMergedCell(stat, statValue, count) {
|
|
54
|
+
const formatted = formatStatValue(stat, statValue);
|
|
55
|
+
const countStr = count != null ? String(count) : '-';
|
|
56
|
+
return `${formatted} (${countStr})`;
|
|
57
|
+
}
|
|
58
|
+
function metricStat(node, metricName) {
|
|
59
|
+
const field = FULL_METRIC_NAME_TO_FIELD[metricName];
|
|
60
|
+
if (!field) {
|
|
61
|
+
throw new errors_1.EasCommandError(`Unknown navigation metric: "${metricName}"`);
|
|
62
|
+
}
|
|
63
|
+
const stat = node.route[field];
|
|
64
|
+
return {
|
|
65
|
+
count: stat.count,
|
|
66
|
+
median: stat.median ?? null,
|
|
67
|
+
p90: stat.p90 ?? null,
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
function buildObserveNavigationRoutesJson(routes, metricNames, stats, pageInfoByPlatform) {
|
|
71
|
+
const jsonRoutes = routes.map(node => {
|
|
72
|
+
const metrics = {};
|
|
73
|
+
for (const metricName of metricNames) {
|
|
74
|
+
const values = metricStat(node, metricName);
|
|
75
|
+
const statValues = {};
|
|
76
|
+
for (const stat of stats) {
|
|
77
|
+
statValues[stat] = values[stat] ?? null;
|
|
78
|
+
}
|
|
79
|
+
metrics[metricName] = statValues;
|
|
80
|
+
}
|
|
81
|
+
return {
|
|
82
|
+
routeName: node.route.routeName,
|
|
83
|
+
platform: node.platform,
|
|
84
|
+
metrics,
|
|
85
|
+
};
|
|
86
|
+
});
|
|
87
|
+
const pageInfoByPlatformOutput = {};
|
|
88
|
+
for (const [platform, pageInfo] of pageInfoByPlatform) {
|
|
89
|
+
pageInfoByPlatformOutput[platform] = {
|
|
90
|
+
hasNextPage: pageInfo.hasNextPage,
|
|
91
|
+
endCursor: pageInfo.endCursor ?? null,
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
return { routes: jsonRoutes, pageInfoByPlatform: pageInfoByPlatformOutput };
|
|
95
|
+
}
|
|
96
|
+
function buildObserveNavigationRoutesTable(routes, metricNames, stats, options) {
|
|
97
|
+
if (routes.length === 0) {
|
|
98
|
+
return chalk_1.default.yellow('No navigation routes found.');
|
|
99
|
+
}
|
|
100
|
+
const displayStats = stats.filter(s => s !== 'count');
|
|
101
|
+
const hasCount = stats.includes('count');
|
|
102
|
+
const statsDesc = displayStats.length > 0
|
|
103
|
+
? displayStats.map(s => exports.NAVIGATION_STAT_DISPLAY_NAMES[s]).join(', ')
|
|
104
|
+
: 'Navigation count';
|
|
105
|
+
const timeDesc = (0, formatUtils_1.buildTimeRangeDescription)({
|
|
106
|
+
daysBack: options?.daysBack,
|
|
107
|
+
startTime: options?.startTime,
|
|
108
|
+
endTime: options?.endTime,
|
|
109
|
+
});
|
|
110
|
+
const countSuffix = hasCount && displayStats.length > 0 ? ' (navigation count)' : '';
|
|
111
|
+
const summaryLine = `${statsDesc} values${countSuffix}${timeDesc ? ` ${timeDesc}` : ''}`;
|
|
112
|
+
const byPlatform = new Map();
|
|
113
|
+
for (const node of routes) {
|
|
114
|
+
if (!byPlatform.has(node.platform)) {
|
|
115
|
+
byPlatform.set(node.platform, []);
|
|
116
|
+
}
|
|
117
|
+
byPlatform.get(node.platform).push(node);
|
|
118
|
+
}
|
|
119
|
+
const metricHeaders = [];
|
|
120
|
+
for (const metricName of metricNames) {
|
|
121
|
+
const displayName = (0, metricNames_1.getMetricDisplayName)(metricName);
|
|
122
|
+
if (displayStats.length > 0 && hasCount) {
|
|
123
|
+
for (const stat of displayStats) {
|
|
124
|
+
metricHeaders.push(displayStats.length > 1
|
|
125
|
+
? `${displayName} ${exports.NAVIGATION_STAT_DISPLAY_NAMES[stat]}`
|
|
126
|
+
: displayName);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
for (const stat of displayStats.length > 0
|
|
131
|
+
? displayStats
|
|
132
|
+
: ['count']) {
|
|
133
|
+
metricHeaders.push(displayStats.length === 0
|
|
134
|
+
? `${displayName} Count`
|
|
135
|
+
: `${displayName} ${exports.NAVIGATION_STAT_DISPLAY_NAMES[stat]}`);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
const headers = ['Route', ...metricHeaders];
|
|
140
|
+
const sections = [chalk_1.default.bold(summaryLine)];
|
|
141
|
+
for (const [platform, platformRoutes] of byPlatform) {
|
|
142
|
+
sections.push('');
|
|
143
|
+
sections.push(chalk_1.default.bold(platform_1.appPlatformDisplayNames[platform]));
|
|
144
|
+
const rows = platformRoutes.map(node => {
|
|
145
|
+
const cells = [];
|
|
146
|
+
for (const metricName of metricNames) {
|
|
147
|
+
const values = metricStat(node, metricName);
|
|
148
|
+
if (displayStats.length > 0 && hasCount) {
|
|
149
|
+
for (const stat of displayStats) {
|
|
150
|
+
cells.push(formatMergedCell(stat, values[stat], values.count));
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
else {
|
|
154
|
+
for (const stat of displayStats.length > 0
|
|
155
|
+
? displayStats
|
|
156
|
+
: ['count']) {
|
|
157
|
+
cells.push(formatStatValue(stat, values[stat]));
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
return [node.route.routeName, ...cells];
|
|
162
|
+
});
|
|
163
|
+
sections.push((0, renderTextTable_1.default)(headers, rows));
|
|
164
|
+
const pageInfo = options?.pageInfoByPlatform?.get(platform);
|
|
165
|
+
if (pageInfo?.hasNextPage && pageInfo.endCursor) {
|
|
166
|
+
sections.push(`Next page (${platform_1.appPlatformDisplayNames[platform]}): --after ${pageInfo.endCursor}`);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
return sections.join('\n');
|
|
170
|
+
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export declare const METRIC_ALIASES: Record<string, string>;
|
|
2
|
+
export declare const NAVIGATION_METRIC_ALIASES: Record<string, string>;
|
|
2
3
|
export declare const METRIC_SHORT_NAMES: Record<string, string>;
|
|
3
4
|
export declare function resolveMetricName(input: string): string;
|
|
5
|
+
export declare function resolveNavigationMetricName(input: string): string;
|
|
4
6
|
export declare function getMetricDisplayName(metricName: string): string;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.METRIC_SHORT_NAMES = exports.METRIC_ALIASES = void 0;
|
|
3
|
+
exports.METRIC_SHORT_NAMES = exports.NAVIGATION_METRIC_ALIASES = exports.METRIC_ALIASES = void 0;
|
|
4
4
|
exports.resolveMetricName = resolveMetricName;
|
|
5
|
+
exports.resolveNavigationMetricName = resolveNavigationMetricName;
|
|
5
6
|
exports.getMetricDisplayName = getMetricDisplayName;
|
|
6
7
|
const errors_1 = require("../commandUtils/errors");
|
|
7
8
|
exports.METRIC_ALIASES = {
|
|
@@ -11,13 +12,22 @@ exports.METRIC_ALIASES = {
|
|
|
11
12
|
warm_launch: 'expo.app_startup.warm_launch_time',
|
|
12
13
|
bundle_load: 'expo.app_startup.bundle_load_time',
|
|
13
14
|
};
|
|
15
|
+
exports.NAVIGATION_METRIC_ALIASES = {
|
|
16
|
+
cold_ttr: 'expo.navigation.cold_ttr',
|
|
17
|
+
warm_ttr: 'expo.navigation.warm_ttr',
|
|
18
|
+
nav_tti: 'expo.navigation.tti',
|
|
19
|
+
};
|
|
14
20
|
const KNOWN_FULL_NAMES = new Set(Object.values(exports.METRIC_ALIASES));
|
|
21
|
+
const KNOWN_FULL_NAVIGATION_NAMES = new Set(Object.values(exports.NAVIGATION_METRIC_ALIASES));
|
|
15
22
|
exports.METRIC_SHORT_NAMES = {
|
|
16
23
|
'expo.app_startup.cold_launch_time': 'Cold Launch',
|
|
17
24
|
'expo.app_startup.warm_launch_time': 'Warm Launch',
|
|
18
|
-
'expo.app_startup.tti': 'TTI',
|
|
19
|
-
'expo.app_startup.ttr': 'TTR',
|
|
25
|
+
'expo.app_startup.tti': 'Startup TTI',
|
|
26
|
+
'expo.app_startup.ttr': 'Startup TTR',
|
|
20
27
|
'expo.app_startup.bundle_load_time': 'Bundle Load',
|
|
28
|
+
'expo.navigation.cold_ttr': 'Nav Cold TTR',
|
|
29
|
+
'expo.navigation.warm_ttr': 'Nav Warm TTR',
|
|
30
|
+
'expo.navigation.tti': 'Nav TTI',
|
|
21
31
|
};
|
|
22
32
|
function resolveMetricName(input) {
|
|
23
33
|
if (exports.METRIC_ALIASES[input]) {
|
|
@@ -28,6 +38,15 @@ function resolveMetricName(input) {
|
|
|
28
38
|
}
|
|
29
39
|
throw new errors_1.EasCommandError(`Unknown metric: "${input}". Use a full metric name (e.g. expo.app_startup.tti) or a short alias: ${Object.keys(exports.METRIC_ALIASES).join(', ')}`);
|
|
30
40
|
}
|
|
41
|
+
function resolveNavigationMetricName(input) {
|
|
42
|
+
if (exports.NAVIGATION_METRIC_ALIASES[input]) {
|
|
43
|
+
return exports.NAVIGATION_METRIC_ALIASES[input];
|
|
44
|
+
}
|
|
45
|
+
if (KNOWN_FULL_NAVIGATION_NAMES.has(input)) {
|
|
46
|
+
return input;
|
|
47
|
+
}
|
|
48
|
+
throw new errors_1.EasCommandError(`Unknown navigation metric: "${input}". Use a full metric name (e.g. expo.navigation.cold_ttr) or a short alias: ${Object.keys(exports.NAVIGATION_METRIC_ALIASES).join(', ')}`);
|
|
49
|
+
}
|
|
31
50
|
function getMetricDisplayName(metricName) {
|
|
32
51
|
return exports.METRIC_SHORT_NAMES[metricName] ?? metricName;
|
|
33
52
|
}
|
|
@@ -18,4 +18,5 @@ export declare function appObservePlatformFromFlag(flag: PlatformFlagValue | und
|
|
|
18
18
|
* platform).
|
|
19
19
|
*/
|
|
20
20
|
export declare function appPlatformsFromFlag(flag: PlatformFlagValue | undefined): AppPlatform[];
|
|
21
|
+
export declare const appPlatformToObservePlatform: Record<AppPlatform, AppObservePlatform>;
|
|
21
22
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.allowedPlatformFlagValues = void 0;
|
|
3
|
+
exports.appPlatformToObservePlatform = exports.allowedPlatformFlagValues = void 0;
|
|
4
4
|
exports.appObservePlatformFromFlag = appObservePlatformFromFlag;
|
|
5
5
|
exports.appPlatformsFromFlag = appPlatformsFromFlag;
|
|
6
6
|
const generated_1 = require("../graphql/generated");
|
|
@@ -46,3 +46,7 @@ function appPlatformsFromFlag(flag) {
|
|
|
46
46
|
}
|
|
47
47
|
return [defaultAppPlatform];
|
|
48
48
|
}
|
|
49
|
+
exports.appPlatformToObservePlatform = {
|
|
50
|
+
[generated_1.AppPlatform.Android]: generated_1.AppObservePlatform.Android,
|
|
51
|
+
[generated_1.AppPlatform.Ios]: generated_1.AppObservePlatform.Ios,
|
|
52
|
+
};
|
|
@@ -7,12 +7,11 @@ exports.isUsingStaticExpoConfig = isUsingStaticExpoConfig;
|
|
|
7
7
|
exports.getPublicExpoConfigAsync = getPublicExpoConfigAsync;
|
|
8
8
|
const tslib_1 = require("tslib");
|
|
9
9
|
const config_1 = require("@expo/config");
|
|
10
|
-
const spawn_async_1 = tslib_1.__importDefault(require("@expo/spawn-async"));
|
|
11
10
|
const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
|
|
12
11
|
const joi_1 = tslib_1.__importDefault(require("joi"));
|
|
13
12
|
const path_1 = tslib_1.__importDefault(require("path"));
|
|
14
13
|
const projectUtils_1 = require("./projectUtils");
|
|
15
|
-
const
|
|
14
|
+
const expoCli_1 = require("../utils/expoCli");
|
|
16
15
|
async function createOrModifyExpoConfigAsync(projectDir, exp, readOptions) {
|
|
17
16
|
ensureExpoConfigExists(projectDir);
|
|
18
17
|
if (readOptions) {
|
|
@@ -22,7 +21,6 @@ async function createOrModifyExpoConfigAsync(projectDir, exp, readOptions) {
|
|
|
22
21
|
return await (0, config_1.modifyConfigAsync)(projectDir, exp);
|
|
23
22
|
}
|
|
24
23
|
}
|
|
25
|
-
let wasExpoConfigWarnPrinted = false;
|
|
26
24
|
async function getExpoConfigInternalAsync(projectDir, opts = {}) {
|
|
27
25
|
const originalProcessEnv = process.env;
|
|
28
26
|
try {
|
|
@@ -32,29 +30,12 @@ async function getExpoConfigInternalAsync(projectDir, opts = {}) {
|
|
|
32
30
|
};
|
|
33
31
|
let exp;
|
|
34
32
|
if ((0, projectUtils_1.isExpoInstalled)(projectDir)) {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
EXPO_NO_DOTENV: '1',
|
|
42
|
-
},
|
|
43
|
-
});
|
|
44
|
-
exp = JSON.parse(stdout);
|
|
45
|
-
}
|
|
46
|
-
catch (err) {
|
|
47
|
-
if (!wasExpoConfigWarnPrinted) {
|
|
48
|
-
log_1.default.warn(`Failed to read the app config from the project using "npx expo config" command: ${err.message}.`);
|
|
49
|
-
log_1.default.warn('Falling back to the version of "@expo/config" shipped with the EAS CLI.');
|
|
50
|
-
wasExpoConfigWarnPrinted = true;
|
|
51
|
-
}
|
|
52
|
-
exp = (0, config_1.getConfig)(projectDir, {
|
|
53
|
-
skipSDKVersionRequirement: true,
|
|
54
|
-
...(opts.isPublicConfig ? { isPublicConfig: true } : {}),
|
|
55
|
-
...(opts.skipPlugins ? { skipPlugins: true } : {}),
|
|
56
|
-
}).exp;
|
|
57
|
-
}
|
|
33
|
+
const { stdout } = await (0, expoCli_1.spawnExpoCommand)(projectDir, ['config', '--json', ...(opts.isPublicConfig ? ['--type', 'public'] : [])], {
|
|
34
|
+
env: {
|
|
35
|
+
EXPO_NO_DOTENV: '1',
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
exp = JSON.parse(stdout);
|
|
58
39
|
}
|
|
59
40
|
else {
|
|
60
41
|
exp = (0, config_1.getConfig)(projectDir, {
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { JSONObject } from '@expo/json-file';
|
|
2
|
-
import { Client } from '../../vcs/vcs';
|
|
3
2
|
interface Target {
|
|
4
3
|
buildConfiguration?: string;
|
|
5
4
|
targetName: string;
|
|
6
5
|
}
|
|
7
|
-
export declare function getManagedApplicationTargetEntitlementsAsync(projectDir: string, env: Record<string, string
|
|
6
|
+
export declare function getManagedApplicationTargetEntitlementsAsync(projectDir: string, env: Record<string, string>): Promise<JSONObject>;
|
|
8
7
|
export declare function getNativeTargetEntitlementsAsync(projectDir: string, target: Target): Promise<JSONObject | null>;
|
|
9
8
|
export {};
|