eas-cli 19.1.0 → 20.1.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 +371 -100
- package/build/commands/go.d.ts +1 -0
- package/build/commands/go.js +29 -1
- package/build/commands/observe/events.d.ts +3 -3
- package/build/commands/observe/events.js +69 -51
- package/build/commands/observe/{logs.d.ts → metrics-summary.d.ts} +3 -11
- package/build/commands/observe/metrics-summary.js +95 -0
- package/build/commands/observe/metrics.d.ts +8 -3
- package/build/commands/observe/metrics.js +63 -47
- package/build/commands/observe/routes.d.ts +0 -1
- package/build/commands/observe/routes.js +0 -4
- package/build/commands/observe/versions.d.ts +0 -1
- package/build/commands/observe/versions.js +0 -4
- package/build/commands/simulator/exec.d.ts +12 -0
- package/build/commands/simulator/exec.js +42 -0
- package/build/commands/simulator/get.d.ts +2 -1
- package/build/commands/simulator/get.js +13 -7
- package/build/commands/simulator/start.d.ts +3 -0
- package/build/commands/simulator/start.js +65 -5
- package/build/commands/simulator/stop.d.ts +2 -1
- package/build/commands/simulator/stop.js +16 -9
- package/build/commands/update/embedded/delete.d.ts +15 -0
- package/build/commands/update/embedded/delete.js +55 -0
- package/build/commands/update/embedded/list.d.ts +19 -0
- package/build/commands/update/embedded/list.js +132 -0
- package/build/commands/update/embedded/upload.d.ts +20 -0
- package/build/commands/update/embedded/upload.js +129 -0
- package/build/commands/update/embedded/view.d.ts +17 -0
- package/build/commands/update/embedded/view.js +75 -0
- package/build/graphql/client.js +1 -0
- package/build/graphql/generated.d.ts +434 -4
- package/build/graphql/generated.js +35 -1
- package/build/graphql/mutations/EmbeddedUpdateAssetMutation.d.ts +13 -0
- package/build/graphql/mutations/EmbeddedUpdateAssetMutation.js +32 -0
- package/build/graphql/mutations/EmbeddedUpdateMutation.d.ts +19 -0
- package/build/graphql/mutations/EmbeddedUpdateMutation.js +51 -0
- package/build/graphql/queries/EmbeddedUpdateQuery.d.ts +18 -0
- package/build/graphql/queries/EmbeddedUpdateQuery.js +81 -0
- package/build/graphql/queries/WorkflowRunQuery.d.ts +2 -1
- package/build/graphql/queries/WorkflowRunQuery.js +19 -6
- package/build/observe/formatCustomEvents.js +5 -5
- package/build/observe/metricNames.js +2 -0
- package/build/simulator/env.d.ts +7 -0
- package/build/simulator/env.js +44 -0
- package/build/simulator/utils.d.ts +3 -1
- package/build/simulator/utils.js +26 -7
- package/build/update/embeddedManifest.d.ts +3 -0
- package/build/update/embeddedManifest.js +28 -0
- package/oclif.manifest.json +2803 -2309
- package/package.json +6 -6
- package/build/commands/observe/logs.js +0 -141
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ExpoGraphqlClient } from '../../commandUtils/context/contextUtils/createGraphqlClient';
|
|
2
|
+
export type EmbeddedUpdateAssetUploadSpec = {
|
|
3
|
+
storageKey: string;
|
|
4
|
+
presignedUrl: string;
|
|
5
|
+
fields: Record<string, string>;
|
|
6
|
+
};
|
|
7
|
+
export declare const EmbeddedUpdateAssetMutation: {
|
|
8
|
+
getSignedUploadSpecAsync(graphqlClient: ExpoGraphqlClient, { appId, embeddedUpdateId, contentType, }: {
|
|
9
|
+
appId: string;
|
|
10
|
+
embeddedUpdateId: string;
|
|
11
|
+
contentType: string;
|
|
12
|
+
}): Promise<EmbeddedUpdateAssetUploadSpec>;
|
|
13
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EmbeddedUpdateAssetMutation = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag"));
|
|
6
|
+
const client_1 = require("../client");
|
|
7
|
+
exports.EmbeddedUpdateAssetMutation = {
|
|
8
|
+
async getSignedUploadSpecAsync(graphqlClient, { appId, embeddedUpdateId, contentType, }) {
|
|
9
|
+
const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
|
|
10
|
+
.mutation((0, graphql_tag_1.default) `
|
|
11
|
+
mutation GetSignedEmbeddedUpdateAssetUploadSpec(
|
|
12
|
+
$appId: ID!
|
|
13
|
+
$embeddedUpdateId: ID!
|
|
14
|
+
$contentType: String!
|
|
15
|
+
) {
|
|
16
|
+
embeddedUpdateAsset {
|
|
17
|
+
getSignedEmbeddedUpdateAssetUploadSpecifications(
|
|
18
|
+
appId: $appId
|
|
19
|
+
embeddedUpdateId: $embeddedUpdateId
|
|
20
|
+
contentType: $contentType
|
|
21
|
+
) {
|
|
22
|
+
storageKey
|
|
23
|
+
presignedUrl
|
|
24
|
+
fields
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
`, { appId, embeddedUpdateId, contentType })
|
|
29
|
+
.toPromise());
|
|
30
|
+
return data.embeddedUpdateAsset.getSignedEmbeddedUpdateAssetUploadSpecifications;
|
|
31
|
+
},
|
|
32
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ExpoGraphqlClient } from '../../commandUtils/context/contextUtils/createGraphqlClient';
|
|
2
|
+
import { AppPlatform, UploadEmbeddedUpdateInput } from '../generated';
|
|
3
|
+
export type EmbeddedUpdateResult = {
|
|
4
|
+
id: string;
|
|
5
|
+
platform: AppPlatform;
|
|
6
|
+
runtimeVersion: string;
|
|
7
|
+
channel: string;
|
|
8
|
+
createdAt: string;
|
|
9
|
+
};
|
|
10
|
+
export declare function isEmbeddedUpdateAssetNotAvailableError(error: unknown): boolean;
|
|
11
|
+
export declare function isEmbeddedUpdateAlreadyExistsError(error: unknown): boolean;
|
|
12
|
+
export declare const EmbeddedUpdateMutation: {
|
|
13
|
+
uploadEmbeddedUpdateAsync(graphqlClient: ExpoGraphqlClient, input: UploadEmbeddedUpdateInput): Promise<EmbeddedUpdateResult>;
|
|
14
|
+
deleteEmbeddedUpdateAsync(graphqlClient: ExpoGraphqlClient, { id }: {
|
|
15
|
+
id: string;
|
|
16
|
+
}): Promise<{
|
|
17
|
+
id: string;
|
|
18
|
+
}>;
|
|
19
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EmbeddedUpdateMutation = void 0;
|
|
4
|
+
exports.isEmbeddedUpdateAssetNotAvailableError = isEmbeddedUpdateAssetNotAvailableError;
|
|
5
|
+
exports.isEmbeddedUpdateAlreadyExistsError = isEmbeddedUpdateAlreadyExistsError;
|
|
6
|
+
const tslib_1 = require("tslib");
|
|
7
|
+
const core_1 = require("@urql/core");
|
|
8
|
+
const graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag"));
|
|
9
|
+
const client_1 = require("../client");
|
|
10
|
+
function isEmbeddedUpdateAssetNotAvailableError(error) {
|
|
11
|
+
return (error instanceof core_1.CombinedError &&
|
|
12
|
+
error.graphQLErrors.some(e => e.extensions?.['errorCode'] === 'EMBEDDED_UPDATE_ASSET_NOT_AVAILABLE'));
|
|
13
|
+
}
|
|
14
|
+
function isEmbeddedUpdateAlreadyExistsError(error) {
|
|
15
|
+
return (error instanceof core_1.CombinedError &&
|
|
16
|
+
error.graphQLErrors.some(e => e.extensions?.['errorCode'] === 'EMBEDDED_UPDATE_ALREADY_EXISTS'));
|
|
17
|
+
}
|
|
18
|
+
exports.EmbeddedUpdateMutation = {
|
|
19
|
+
async uploadEmbeddedUpdateAsync(graphqlClient, input) {
|
|
20
|
+
const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
|
|
21
|
+
.mutation((0, graphql_tag_1.default) `
|
|
22
|
+
mutation UploadEmbeddedUpdate($input: UploadEmbeddedUpdateInput!) {
|
|
23
|
+
embeddedUpdate {
|
|
24
|
+
uploadEmbeddedUpdate(input: $input) {
|
|
25
|
+
id
|
|
26
|
+
platform
|
|
27
|
+
runtimeVersion
|
|
28
|
+
channel
|
|
29
|
+
createdAt
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
`, { input })
|
|
34
|
+
.toPromise());
|
|
35
|
+
return data.embeddedUpdate.uploadEmbeddedUpdate;
|
|
36
|
+
},
|
|
37
|
+
async deleteEmbeddedUpdateAsync(graphqlClient, { id }) {
|
|
38
|
+
const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
|
|
39
|
+
.mutation((0, graphql_tag_1.default) `
|
|
40
|
+
mutation DeleteEmbeddedUpdate($id: ID!) {
|
|
41
|
+
embeddedUpdate {
|
|
42
|
+
deleteEmbeddedUpdate(id: $id) {
|
|
43
|
+
id
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
`, { id })
|
|
48
|
+
.toPromise());
|
|
49
|
+
return data.embeddedUpdate.deleteEmbeddedUpdate;
|
|
50
|
+
},
|
|
51
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ExpoGraphqlClient } from '../../commandUtils/context/contextUtils/createGraphqlClient';
|
|
2
|
+
import { Connection } from '../../utils/relay';
|
|
3
|
+
import { EmbeddedUpdateFilterInput, ViewEmbeddedUpdateByIdQuery } from '../generated';
|
|
4
|
+
export declare function isEmbeddedUpdateNotFoundError(error: unknown): boolean;
|
|
5
|
+
export type EmbeddedUpdateFragment = ViewEmbeddedUpdateByIdQuery['embeddedUpdates']['byId'];
|
|
6
|
+
export type EmbeddedUpdateFilter = EmbeddedUpdateFilterInput;
|
|
7
|
+
export declare const EmbeddedUpdateQuery: {
|
|
8
|
+
viewByIdAsync(graphqlClient: ExpoGraphqlClient, { embeddedUpdateId, appId }: {
|
|
9
|
+
embeddedUpdateId: string;
|
|
10
|
+
appId: string;
|
|
11
|
+
}): Promise<EmbeddedUpdateFragment>;
|
|
12
|
+
viewPaginatedAsync(graphqlClient: ExpoGraphqlClient, { appId, filter, first, after, }: {
|
|
13
|
+
appId: string;
|
|
14
|
+
filter?: EmbeddedUpdateFilter;
|
|
15
|
+
first: number;
|
|
16
|
+
after?: string;
|
|
17
|
+
}): Promise<Connection<EmbeddedUpdateFragment>>;
|
|
18
|
+
};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EmbeddedUpdateQuery = void 0;
|
|
4
|
+
exports.isEmbeddedUpdateNotFoundError = isEmbeddedUpdateNotFoundError;
|
|
5
|
+
const tslib_1 = require("tslib");
|
|
6
|
+
const core_1 = require("@urql/core");
|
|
7
|
+
const graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag"));
|
|
8
|
+
const client_1 = require("../client");
|
|
9
|
+
function isEmbeddedUpdateNotFoundError(error) {
|
|
10
|
+
return (error instanceof core_1.CombinedError &&
|
|
11
|
+
error.graphQLErrors.some(e => e.extensions?.['errorCode'] === 'EMBEDDED_UPDATE_NOT_FOUND'));
|
|
12
|
+
}
|
|
13
|
+
exports.EmbeddedUpdateQuery = {
|
|
14
|
+
async viewByIdAsync(graphqlClient, { embeddedUpdateId, appId }) {
|
|
15
|
+
const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
|
|
16
|
+
.query((0, graphql_tag_1.default) `
|
|
17
|
+
query ViewEmbeddedUpdateById($embeddedUpdateId: ID!, $appId: ID!) {
|
|
18
|
+
embeddedUpdates {
|
|
19
|
+
byId(embeddedUpdateId: $embeddedUpdateId, appId: $appId) {
|
|
20
|
+
id
|
|
21
|
+
platform
|
|
22
|
+
runtimeVersion
|
|
23
|
+
channel
|
|
24
|
+
createdAt
|
|
25
|
+
launchAsset {
|
|
26
|
+
id
|
|
27
|
+
fileSize
|
|
28
|
+
finalFileSize
|
|
29
|
+
fileSHA256
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
`, { embeddedUpdateId, appId }, { additionalTypenames: ['EmbeddedUpdate'] })
|
|
35
|
+
.toPromise());
|
|
36
|
+
return data.embeddedUpdates.byId;
|
|
37
|
+
},
|
|
38
|
+
async viewPaginatedAsync(graphqlClient, { appId, filter, first, after, }) {
|
|
39
|
+
const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
|
|
40
|
+
.query((0, graphql_tag_1.default) `
|
|
41
|
+
query ViewEmbeddedUpdatesPaginated(
|
|
42
|
+
$appId: String!
|
|
43
|
+
$first: Int!
|
|
44
|
+
$after: String
|
|
45
|
+
$filter: EmbeddedUpdateFilterInput
|
|
46
|
+
) {
|
|
47
|
+
app {
|
|
48
|
+
byId(appId: $appId) {
|
|
49
|
+
id
|
|
50
|
+
embeddedUpdatesPaginated(first: $first, after: $after, filter: $filter) {
|
|
51
|
+
edges {
|
|
52
|
+
cursor
|
|
53
|
+
node {
|
|
54
|
+
id
|
|
55
|
+
platform
|
|
56
|
+
runtimeVersion
|
|
57
|
+
channel
|
|
58
|
+
createdAt
|
|
59
|
+
launchAsset {
|
|
60
|
+
id
|
|
61
|
+
fileSize
|
|
62
|
+
finalFileSize
|
|
63
|
+
fileSHA256
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
pageInfo {
|
|
68
|
+
hasNextPage
|
|
69
|
+
hasPreviousPage
|
|
70
|
+
startCursor
|
|
71
|
+
endCursor
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
`, { appId, first, after, filter }, { additionalTypenames: ['EmbeddedUpdate'] })
|
|
78
|
+
.toPromise());
|
|
79
|
+
return data.app.byId.embeddedUpdatesPaginated;
|
|
80
|
+
},
|
|
81
|
+
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ExpoGraphqlClient } from '../../commandUtils/context/contextUtils/createGraphqlClient';
|
|
2
|
-
import { ExpoGoProjectConfiguration, ExpoGoRepackInput, WorkflowRunByIdQuery, WorkflowRunByIdWithJobsQuery, WorkflowRunFragment, WorkflowRunStatus } from '../generated';
|
|
2
|
+
import { ExpoGoProjectConfiguration, ExpoGoRepackInput, ExpoGoSdkVersion, WorkflowRunByIdQuery, WorkflowRunByIdWithJobsQuery, WorkflowRunFragment, WorkflowRunStatus } from '../generated';
|
|
3
3
|
export declare const WorkflowRunQuery: {
|
|
4
|
+
expoGoSupportedSdkVersionsAsync(graphqlClient: ExpoGraphqlClient): Promise<ExpoGoSdkVersion[]>;
|
|
4
5
|
expoGoRepackConfigurationAsync(graphqlClient: ExpoGraphqlClient, input: ExpoGoRepackInput): Promise<ExpoGoProjectConfiguration>;
|
|
5
6
|
byIdAsync(graphqlClient: ExpoGraphqlClient, workflowRunId: string, { useCache }?: {
|
|
6
7
|
useCache?: boolean;
|
|
@@ -9,11 +9,26 @@ const client_1 = require("../client");
|
|
|
9
9
|
const WorkflowJob_1 = require("../types/WorkflowJob");
|
|
10
10
|
const WorkflowRun_1 = require("../types/WorkflowRun");
|
|
11
11
|
exports.WorkflowRunQuery = {
|
|
12
|
+
async expoGoSupportedSdkVersionsAsync(graphqlClient) {
|
|
13
|
+
const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
|
|
14
|
+
.query((0, graphql_tag_1.default) `
|
|
15
|
+
query ExpoGoSupportedSdkVersions {
|
|
16
|
+
expoGoBuild {
|
|
17
|
+
supportedSdkVersions {
|
|
18
|
+
sdkVersion
|
|
19
|
+
isLatest
|
|
20
|
+
isBeta
|
|
21
|
+
isDeprecated
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
`, {}, { requestPolicy: 'network-only' })
|
|
26
|
+
.toPromise());
|
|
27
|
+
return data.expoGoBuild.supportedSdkVersions;
|
|
28
|
+
},
|
|
12
29
|
async expoGoRepackConfigurationAsync(graphqlClient, input) {
|
|
13
30
|
const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
|
|
14
|
-
.query(
|
|
15
|
-
/* eslint-disable graphql/template-strings */
|
|
16
|
-
(0, graphql_tag_1.default) `
|
|
31
|
+
.query((0, graphql_tag_1.default) `
|
|
17
32
|
query ExpoGoRepackConfiguration($input: ExpoGoRepackInput!) {
|
|
18
33
|
expoGoBuild {
|
|
19
34
|
repackConfiguration(input: $input) {
|
|
@@ -25,9 +40,7 @@ exports.WorkflowRunQuery = {
|
|
|
25
40
|
}
|
|
26
41
|
}
|
|
27
42
|
}
|
|
28
|
-
`,
|
|
29
|
-
/* eslint-enable graphql/template-strings */
|
|
30
|
-
{ input }, { requestPolicy: 'network-only' })
|
|
43
|
+
`, { input }, { requestPolicy: 'network-only' })
|
|
31
44
|
.toPromise());
|
|
32
45
|
return data.expoGoBuild.repackConfiguration;
|
|
33
46
|
},
|
|
@@ -21,7 +21,7 @@ function formatSeverity(event) {
|
|
|
21
21
|
}
|
|
22
22
|
function buildObserveCustomEventsTable(events, pageInfo, options) {
|
|
23
23
|
if (events.length === 0) {
|
|
24
|
-
return chalk_1.default.yellow('No
|
|
24
|
+
return chalk_1.default.yellow('No events found.');
|
|
25
25
|
}
|
|
26
26
|
const showEventName = !options?.eventName;
|
|
27
27
|
const hasSeverity = events.some(e => e.severityText != null || e.severityNumber != null);
|
|
@@ -49,7 +49,7 @@ function buildObserveCustomEventsTable(events, pageInfo, options) {
|
|
|
49
49
|
const totalDesc = options.totalEventCount != null
|
|
50
50
|
? ` — ${options.totalEventCount.toLocaleString()} total events`
|
|
51
51
|
: '';
|
|
52
|
-
const subject = options.eventName ? `${options.eventName} events` : '
|
|
52
|
+
const subject = options.eventName ? `${options.eventName} events` : 'Events';
|
|
53
53
|
lines.push(chalk_1.default.bold(`${subject} ${timeDesc}${totalDesc}`.trim()), '');
|
|
54
54
|
}
|
|
55
55
|
lines.push((0, renderTextTable_1.default)(headers, rows));
|
|
@@ -94,7 +94,7 @@ function buildObserveCustomEventsEmptyWithSuggestionsTable(eventName, names, opt
|
|
|
94
94
|
const timeDesc = options ? (0, formatUtils_1.buildTimeRangeDescription)(options) : '';
|
|
95
95
|
lines.push(chalk_1.default.yellow(`No events found matching "${eventName}" ${timeDesc}.`.trim()));
|
|
96
96
|
if (names.length === 0) {
|
|
97
|
-
lines.push('', chalk_1.default.yellow('No
|
|
97
|
+
lines.push('', chalk_1.default.yellow('No event names found in this time range.'));
|
|
98
98
|
return lines.join('\n');
|
|
99
99
|
}
|
|
100
100
|
lines.push('', 'Available event names in this time range:', '');
|
|
@@ -116,14 +116,14 @@ function buildObserveCustomEventsEmptyWithSuggestionsJson(eventName, names, isTr
|
|
|
116
116
|
}
|
|
117
117
|
function buildObserveCustomEventNamesTable(names, options) {
|
|
118
118
|
if (names.length === 0) {
|
|
119
|
-
return chalk_1.default.yellow('No
|
|
119
|
+
return chalk_1.default.yellow('No event names found.');
|
|
120
120
|
}
|
|
121
121
|
const headers = ['Event Name', 'Count'];
|
|
122
122
|
const rows = names.map(n => [n.eventName, n.count.toLocaleString()]);
|
|
123
123
|
const lines = [];
|
|
124
124
|
if (options) {
|
|
125
125
|
const timeDesc = (0, formatUtils_1.buildTimeRangeDescription)(options);
|
|
126
|
-
const subject = '
|
|
126
|
+
const subject = 'Event names';
|
|
127
127
|
lines.push(chalk_1.default.bold(`${subject} ${timeDesc}`.trim()), '');
|
|
128
128
|
}
|
|
129
129
|
lines.push((0, renderTextTable_1.default)(headers, rows));
|
|
@@ -11,6 +11,7 @@ exports.METRIC_ALIASES = {
|
|
|
11
11
|
cold_launch: 'expo.app_startup.cold_launch_time',
|
|
12
12
|
warm_launch: 'expo.app_startup.warm_launch_time',
|
|
13
13
|
bundle_load: 'expo.app_startup.bundle_load_time',
|
|
14
|
+
update_download: 'expo.updates.download_time',
|
|
14
15
|
};
|
|
15
16
|
exports.NAVIGATION_METRIC_ALIASES = {
|
|
16
17
|
cold_ttr: 'expo.navigation.cold_ttr',
|
|
@@ -25,6 +26,7 @@ exports.METRIC_SHORT_NAMES = {
|
|
|
25
26
|
'expo.app_startup.tti': 'Startup TTI',
|
|
26
27
|
'expo.app_startup.ttr': 'Startup TTR',
|
|
27
28
|
'expo.app_startup.bundle_load_time': 'Bundle Load',
|
|
29
|
+
'expo.updates.download_time': 'Update Download',
|
|
28
30
|
'expo.navigation.cold_ttr': 'Nav Cold TTR',
|
|
29
31
|
'expo.navigation.warm_ttr': 'Nav Warm TTR',
|
|
30
32
|
'expo.navigation.tti': 'Nav TTI',
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const SIMULATOR_DOTENV_FILE_NAME = ".env.eas-simulator";
|
|
2
|
+
export declare const EAS_SIMULATOR_SESSION_ID = "EAS_SIMULATOR_SESSION_ID";
|
|
3
|
+
export declare const SIMULATOR_DOTENV_FILE_HEADER = "# Do not commit this file.\n# Do not modify these values manually. They are managed by eas-cli.\n# It holds configuration only for the current simulator session.\n\n";
|
|
4
|
+
export declare function getSimulatorEnvFilePath(projectDir: string): string;
|
|
5
|
+
export declare function loadSimulatorEnvAsync(projectDir: string): Promise<void>;
|
|
6
|
+
export declare function writeSimulatorEnvAsync(projectDir: string, environmentVariables: Record<string, string>): Promise<void>;
|
|
7
|
+
export declare function resetSimulatorEnvAsync(projectDir: string): Promise<void>;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SIMULATOR_DOTENV_FILE_HEADER = exports.EAS_SIMULATOR_SESSION_ID = exports.SIMULATOR_DOTENV_FILE_NAME = void 0;
|
|
4
|
+
exports.getSimulatorEnvFilePath = getSimulatorEnvFilePath;
|
|
5
|
+
exports.loadSimulatorEnvAsync = loadSimulatorEnvAsync;
|
|
6
|
+
exports.writeSimulatorEnvAsync = writeSimulatorEnvAsync;
|
|
7
|
+
exports.resetSimulatorEnvAsync = resetSimulatorEnvAsync;
|
|
8
|
+
const tslib_1 = require("tslib");
|
|
9
|
+
const env_1 = require("@expo/env");
|
|
10
|
+
const fs = tslib_1.__importStar(require("fs-extra"));
|
|
11
|
+
const path_1 = tslib_1.__importDefault(require("path"));
|
|
12
|
+
exports.SIMULATOR_DOTENV_FILE_NAME = '.env.eas-simulator';
|
|
13
|
+
exports.EAS_SIMULATOR_SESSION_ID = 'EAS_SIMULATOR_SESSION_ID';
|
|
14
|
+
exports.SIMULATOR_DOTENV_FILE_HEADER = '# Do not commit this file.\n# Do not modify these values manually. They are managed by eas-cli.\n# It holds configuration only for the current simulator session.\n\n';
|
|
15
|
+
function getSimulatorEnvFilePath(projectDir) {
|
|
16
|
+
return path_1.default.join(projectDir, exports.SIMULATOR_DOTENV_FILE_NAME);
|
|
17
|
+
}
|
|
18
|
+
async function loadSimulatorEnvAsync(projectDir) {
|
|
19
|
+
const simulatorDotenvFilePath = getSimulatorEnvFilePath(projectDir);
|
|
20
|
+
(0, env_1.loadProjectEnv)(projectDir, { silent: true });
|
|
21
|
+
(0, env_1.loadEnvFiles)([simulatorDotenvFilePath], { force: true });
|
|
22
|
+
}
|
|
23
|
+
async function writeSimulatorEnvAsync(projectDir, environmentVariables) {
|
|
24
|
+
const simulatorDotenvFilePath = getSimulatorEnvFilePath(projectDir);
|
|
25
|
+
const simulatorDotenvContent = exports.SIMULATOR_DOTENV_FILE_HEADER +
|
|
26
|
+
Object.entries(environmentVariables)
|
|
27
|
+
.map(([key, value]) => `${key}=${JSON.stringify(value)}`)
|
|
28
|
+
.join('\n') +
|
|
29
|
+
'\n';
|
|
30
|
+
await fs.writeFile(simulatorDotenvFilePath, simulatorDotenvContent);
|
|
31
|
+
}
|
|
32
|
+
async function resetSimulatorEnvAsync(projectDir) {
|
|
33
|
+
const simulatorDotenvFilePath = getSimulatorEnvFilePath(projectDir);
|
|
34
|
+
try {
|
|
35
|
+
await fs.writeFile(simulatorDotenvFilePath, exports.SIMULATOR_DOTENV_FILE_HEADER, { flag: 'r+' });
|
|
36
|
+
await fs.truncate(simulatorDotenvFilePath, Buffer.byteLength(exports.SIMULATOR_DOTENV_FILE_HEADER));
|
|
37
|
+
}
|
|
38
|
+
catch (err) {
|
|
39
|
+
if (typeof err === 'object' && err !== null && 'code' in err && err.code === 'ENOENT') {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
throw err;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -4,5 +4,7 @@ export type DeviceRunSessionRemoteConfig = NonNullable<DeviceRunSessionByIdResul
|
|
|
4
4
|
export declare const DEVICE_RUN_SESSION_TYPE_FLAG_VALUES: Record<DeviceRunSessionType, string>;
|
|
5
5
|
export declare const DEVICE_RUN_SESSION_TYPE_BY_FLAG_VALUE: Record<string, DeviceRunSessionType>;
|
|
6
6
|
export declare function deviceRunSessionTypeToFlagValue(type: DeviceRunSessionType): string;
|
|
7
|
-
export declare function
|
|
7
|
+
export declare function getRemoteSessionEnvironmentVariables(remoteConfig: DeviceRunSessionRemoteConfig): Record<string, string>;
|
|
8
|
+
type RemoteSessionInstructionsConfigType = 'env' | 'dotenv';
|
|
9
|
+
export declare function formatRemoteSessionInstructions(remoteConfig: DeviceRunSessionRemoteConfig, configType: RemoteSessionInstructionsConfigType): string;
|
|
8
10
|
export {};
|
package/build/simulator/utils.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DEVICE_RUN_SESSION_TYPE_BY_FLAG_VALUE = exports.DEVICE_RUN_SESSION_TYPE_FLAG_VALUES = void 0;
|
|
4
4
|
exports.deviceRunSessionTypeToFlagValue = deviceRunSessionTypeToFlagValue;
|
|
5
|
+
exports.getRemoteSessionEnvironmentVariables = getRemoteSessionEnvironmentVariables;
|
|
5
6
|
exports.formatRemoteSessionInstructions = formatRemoteSessionInstructions;
|
|
6
7
|
const generated_1 = require("../graphql/generated");
|
|
7
8
|
// Mapping enum -> CLI flag value. Declared as Record<DeviceRunSessionType, string>
|
|
@@ -15,15 +16,33 @@ exports.DEVICE_RUN_SESSION_TYPE_BY_FLAG_VALUE = Object.fromEntries(Object.entrie
|
|
|
15
16
|
function deviceRunSessionTypeToFlagValue(type) {
|
|
16
17
|
return exports.DEVICE_RUN_SESSION_TYPE_FLAG_VALUES[type];
|
|
17
18
|
}
|
|
18
|
-
function
|
|
19
|
+
function getRemoteSessionEnvironmentVariables(remoteConfig) {
|
|
20
|
+
switch (remoteConfig.__typename) {
|
|
21
|
+
case 'AgentDeviceRunSessionRemoteConfig':
|
|
22
|
+
return {
|
|
23
|
+
AGENT_DEVICE_DAEMON_BASE_URL: remoteConfig.agentDeviceRemoteSessionUrl,
|
|
24
|
+
AGENT_DEVICE_DAEMON_AUTH_TOKEN: remoteConfig.agentDeviceRemoteSessionToken,
|
|
25
|
+
};
|
|
26
|
+
case 'ArgentRunSessionRemoteConfig':
|
|
27
|
+
case 'ServeSimRunSessionRemoteConfig':
|
|
28
|
+
return {};
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
function formatRemoteSessionInstructions(remoteConfig, configType) {
|
|
19
32
|
switch (remoteConfig.__typename) {
|
|
20
33
|
case 'AgentDeviceRunSessionRemoteConfig': {
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
34
|
+
const environmentVariables = getRemoteSessionEnvironmentVariables(remoteConfig);
|
|
35
|
+
const lines = configType === 'dotenv'
|
|
36
|
+
? [
|
|
37
|
+
'🔑 Run the following to use agent-device with the simulator:',
|
|
38
|
+
'',
|
|
39
|
+
'eas simulator:exec agent-device <command>',
|
|
40
|
+
]
|
|
41
|
+
: [
|
|
42
|
+
'🔑 Run the following in your shell to attach to the agent-device daemon:',
|
|
43
|
+
'',
|
|
44
|
+
...Object.entries(environmentVariables).map(([key, value]) => `export ${key}='${value}'`),
|
|
45
|
+
];
|
|
27
46
|
if (remoteConfig.webPreviewUrl) {
|
|
28
47
|
lines.push('', '🌐 Open the following URL in your browser to preview the simulator:', '', remoteConfig.webPreviewUrl);
|
|
29
48
|
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.readEmbeddedManifestAsync = readEmbeddedManifestAsync;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
|
|
6
|
+
const uuid = tslib_1.__importStar(require("uuid"));
|
|
7
|
+
async function readEmbeddedManifestAsync(manifestPath) {
|
|
8
|
+
let parsed;
|
|
9
|
+
try {
|
|
10
|
+
parsed = JSON.parse(await fs_extra_1.default.readFile(manifestPath, 'utf8'));
|
|
11
|
+
}
|
|
12
|
+
catch {
|
|
13
|
+
throw new Error(`Could not read or parse manifest at "${manifestPath}". ` +
|
|
14
|
+
`Check the file exists, is readable, and contains valid JSON.`);
|
|
15
|
+
}
|
|
16
|
+
if (typeof parsed !== 'object' ||
|
|
17
|
+
parsed === null ||
|
|
18
|
+
typeof parsed.id !== 'string') {
|
|
19
|
+
throw new Error(`Manifest at "${manifestPath}" is missing the required "id" field. ` +
|
|
20
|
+
`Make sure you're pointing at the app.manifest generated by expo-updates during your native build, not a different JSON file.`);
|
|
21
|
+
}
|
|
22
|
+
const id = parsed.id;
|
|
23
|
+
if (!uuid.validate(id)) {
|
|
24
|
+
throw new Error(`Manifest at "${manifestPath}" has an invalid "id" field ("${id}" is not a UUID). ` +
|
|
25
|
+
`Make sure you're pointing at the app.manifest generated by expo-updates during your native build.`);
|
|
26
|
+
}
|
|
27
|
+
return { id };
|
|
28
|
+
}
|