eas-cli 20.5.0 → 21.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +128 -175
- package/build/analytics/AnalyticsManager.js +3 -0
- package/build/analytics/agent.d.ts +5 -0
- package/build/analytics/agent.js +26 -0
- package/build/build/context.d.ts +2 -2
- package/build/build/createContext.d.ts +2 -2
- package/build/build/local.d.ts +2 -2
- package/build/commandUtils/workflow/buildProfileUtils.d.ts +11 -29
- package/build/commandUtils/workflow/buildProfileUtils.js +47 -126
- package/build/commandUtils/workflow/creation.d.ts +11 -3
- package/build/commandUtils/workflow/creation.js +151 -261
- package/build/commands/integrations/posthog/dashboard.d.ts +1 -0
- package/build/commands/integrations/posthog/dashboard.js +30 -6
- package/build/commands/observe/metrics.js +1 -1
- package/build/commands/project/init.d.ts +0 -7
- package/build/commands/project/init.js +4 -274
- package/build/commands/simulator/get.js +57 -4
- package/build/commands/workflow/create.d.ts +3 -0
- package/build/commands/workflow/create.js +118 -87
- package/build/credentials/ios/appstore/bundleIdCapabilities.js +9 -3
- package/build/fingerprint/utils.d.ts +2 -2
- package/build/graphql/generated.d.ts +204 -242
- package/build/graphql/generated.js +41 -4
- package/build/graphql/mutations/PostHogMutation.d.ts +2 -1
- package/build/graphql/mutations/PostHogMutation.js +14 -0
- package/build/graphql/queries/DeviceRunSessionQuery.js +15 -0
- package/build/graphql/queries/UserQuery.js +0 -10
- package/build/graphql/queries/WorkflowRunQuery.js +1 -0
- package/build/integrations/asc/utils.js +6 -4
- package/build/observe/metricNames.d.ts +1 -1
- package/build/observe/metricNames.js +7 -6
- package/build/project/android/applicationId.d.ts +2 -1
- package/build/project/android/applicationId.js +19 -11
- package/build/project/ios/bundleIdentifier.d.ts +2 -1
- package/build/project/ios/bundleIdentifier.js +19 -11
- package/build/project/ios/entitlements.d.ts +2 -1
- package/build/project/ios/target.d.ts +15 -1
- package/build/project/ios/target.js +23 -0
- package/build/project/projectInitialization.d.ts +9 -0
- package/build/project/projectInitialization.js +277 -0
- package/build/project/publish.js +73 -40
- package/build/submit/context.d.ts +2 -2
- package/build/utils/usage/checkForOverages.d.ts +3 -1
- package/build/utils/usage/checkForOverages.js +11 -3
- package/oclif.manifest.json +2603 -2649
- package/package.json +9 -8
- package/build/commands/project/onboarding.d.ts +0 -14
- package/build/commands/project/onboarding.js +0 -362
- package/build/graphql/mutations/UserPreferencesMutation.d.ts +0 -10
- package/build/graphql/mutations/UserPreferencesMutation.js +0 -41
|
@@ -1,23 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const config_1 = require("@expo/config");
|
|
5
4
|
const core_1 = require("@oclif/core");
|
|
6
|
-
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
7
|
-
const nullthrows_1 = tslib_1.__importDefault(require("nullthrows"));
|
|
8
|
-
const url_1 = require("../../build/utils/url");
|
|
9
5
|
const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
|
|
10
|
-
const getProjectIdAsync_1 = require("../../commandUtils/context/contextUtils/getProjectIdAsync");
|
|
11
6
|
const flags_1 = require("../../commandUtils/flags");
|
|
12
|
-
const
|
|
13
|
-
const generated_1 = require("../../graphql/generated");
|
|
14
|
-
const AppMutation_1 = require("../../graphql/mutations/AppMutation");
|
|
15
|
-
const AppQuery_1 = require("../../graphql/queries/AppQuery");
|
|
16
|
-
const log_1 = tslib_1.__importStar(require("../../log"));
|
|
17
|
-
const ora_1 = require("../../ora");
|
|
18
|
-
const expoConfig_1 = require("../../project/expoConfig");
|
|
19
|
-
const fetchOrCreateProjectIDForWriteToConfigWithConfirmationAsync_1 = require("../../project/fetchOrCreateProjectIDForWriteToConfigWithConfirmationAsync");
|
|
20
|
-
const prompts_1 = require("../../prompts");
|
|
7
|
+
const projectInitialization_1 = require("../../project/projectInitialization");
|
|
21
8
|
class ProjectInit extends EasCommand_1.default {
|
|
22
9
|
static description = 'create or link an EAS project';
|
|
23
10
|
static aliases = ['init'];
|
|
@@ -34,281 +21,24 @@ class ProjectInit extends EasCommand_1.default {
|
|
|
34
21
|
...this.ContextOptions.LoggedIn,
|
|
35
22
|
...this.ContextOptions.ProjectDir,
|
|
36
23
|
};
|
|
37
|
-
static async saveProjectIdAndLogSuccessAsync(projectDir, projectId) {
|
|
38
|
-
await (0, getProjectIdAsync_1.saveProjectIdToAppConfigAsync)(projectDir, projectId);
|
|
39
|
-
log_1.default.withTick(`Project successfully linked (ID: ${chalk_1.default.bold(projectId)}) (modified app.json)`);
|
|
40
|
-
}
|
|
41
|
-
static async modifyExpoConfigAsync(projectDir, modifications) {
|
|
42
|
-
let result;
|
|
43
|
-
try {
|
|
44
|
-
result = await (0, expoConfig_1.createOrModifyExpoConfigAsync)(projectDir, modifications);
|
|
45
|
-
}
|
|
46
|
-
catch (error) {
|
|
47
|
-
if (error instanceof config_1.ConfigError && error.code === 'MODULE_NOT_FOUND') {
|
|
48
|
-
log_1.default.warn('Cannot determine which native SDK version your project uses because the module `expo` is not installed.');
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
else {
|
|
52
|
-
throw error;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
switch (result.type) {
|
|
56
|
-
case 'success':
|
|
57
|
-
break;
|
|
58
|
-
case 'warn': {
|
|
59
|
-
log_1.default.warn();
|
|
60
|
-
log_1.default.warn(`Warning: Your project uses dynamic app configuration, and cannot be automatically modified.`);
|
|
61
|
-
log_1.default.warn(chalk_1.default.dim('https://docs.expo.dev/workflow/configuration/#dynamic-configuration-with-appconfigjs'));
|
|
62
|
-
log_1.default.warn();
|
|
63
|
-
log_1.default.warn(`To complete the setup process, add the following in your ${chalk_1.default.bold((0, config_1.getProjectConfigDescription)(projectDir))}:`);
|
|
64
|
-
log_1.default.warn();
|
|
65
|
-
log_1.default.warn(chalk_1.default.bold(JSON.stringify(modifications, null, 2)));
|
|
66
|
-
log_1.default.warn();
|
|
67
|
-
throw new Error(result.message);
|
|
68
|
-
}
|
|
69
|
-
case 'fail':
|
|
70
|
-
throw new Error(result.message);
|
|
71
|
-
default:
|
|
72
|
-
throw new Error('Unexpected result type from modifyConfigAsync');
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
static async ensureOwnerSlugConsistencyAsync(graphqlClient, projectId, projectDir, { force, nonInteractive }) {
|
|
76
|
-
const exp = await (0, expoConfig_1.getPrivateExpoConfigAsync)(projectDir);
|
|
77
|
-
const appForProjectId = await AppQuery_1.AppQuery.byIdAsync(graphqlClient, projectId);
|
|
78
|
-
const correctOwner = appForProjectId.ownerAccount.name;
|
|
79
|
-
const correctSlug = appForProjectId.slug;
|
|
80
|
-
if (exp.owner && exp.owner !== correctOwner) {
|
|
81
|
-
if (force) {
|
|
82
|
-
await this.modifyExpoConfigAsync(projectDir, { owner: correctOwner });
|
|
83
|
-
}
|
|
84
|
-
else {
|
|
85
|
-
const message = `Project owner (${correctOwner}) does not match the value configured in the "owner" field (${exp.owner}).`;
|
|
86
|
-
if (nonInteractive) {
|
|
87
|
-
throw new Error(`Project config error: ${message} Use --force flag to overwrite.`);
|
|
88
|
-
}
|
|
89
|
-
const confirm = await (0, prompts_1.confirmAsync)({
|
|
90
|
-
message: `${message}. Do you wish to overwrite it?`,
|
|
91
|
-
});
|
|
92
|
-
if (!confirm) {
|
|
93
|
-
throw new Error('Aborting');
|
|
94
|
-
}
|
|
95
|
-
await this.modifyExpoConfigAsync(projectDir, { owner: correctOwner });
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
else if (!exp.owner) {
|
|
99
|
-
await this.modifyExpoConfigAsync(projectDir, { owner: correctOwner });
|
|
100
|
-
}
|
|
101
|
-
if (exp.slug && exp.slug !== correctSlug) {
|
|
102
|
-
if (force) {
|
|
103
|
-
await this.modifyExpoConfigAsync(projectDir, { slug: correctSlug });
|
|
104
|
-
}
|
|
105
|
-
else {
|
|
106
|
-
const message = `Project slug (${correctSlug}) does not match the value configured in the "slug" field (${exp.slug}).`;
|
|
107
|
-
if (nonInteractive) {
|
|
108
|
-
throw new Error(`Project config error: ${message} Use --force flag to overwrite.`);
|
|
109
|
-
}
|
|
110
|
-
const confirm = await (0, prompts_1.confirmAsync)({
|
|
111
|
-
message: `${message}. Do you wish to overwrite it?`,
|
|
112
|
-
});
|
|
113
|
-
if (!confirm) {
|
|
114
|
-
throw new Error('Aborting');
|
|
115
|
-
}
|
|
116
|
-
await this.modifyExpoConfigAsync(projectDir, { slug: correctSlug });
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
else if (!exp.slug) {
|
|
120
|
-
await this.modifyExpoConfigAsync(projectDir, { slug: correctSlug });
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
static async setExplicitIDAsync(projectId, projectDir, { force, nonInteractive }) {
|
|
124
|
-
const exp = await (0, expoConfig_1.getPrivateExpoConfigAsync)(projectDir);
|
|
125
|
-
const existingProjectId = exp.extra?.eas?.projectId;
|
|
126
|
-
if (projectId === existingProjectId) {
|
|
127
|
-
log_1.default.succeed(`Project already linked (ID: ${chalk_1.default.bold(existingProjectId)})`);
|
|
128
|
-
return;
|
|
129
|
-
}
|
|
130
|
-
if (!existingProjectId) {
|
|
131
|
-
await ProjectInit.saveProjectIdAndLogSuccessAsync(projectDir, projectId);
|
|
132
|
-
return;
|
|
133
|
-
}
|
|
134
|
-
if (projectId !== existingProjectId) {
|
|
135
|
-
if (force) {
|
|
136
|
-
await ProjectInit.saveProjectIdAndLogSuccessAsync(projectDir, projectId);
|
|
137
|
-
return;
|
|
138
|
-
}
|
|
139
|
-
if (nonInteractive) {
|
|
140
|
-
throw new Error(`Project is already linked to a different ID: ${chalk_1.default.bold(existingProjectId)}. Use --force flag to overwrite.`);
|
|
141
|
-
}
|
|
142
|
-
const confirm = await (0, prompts_1.confirmAsync)({
|
|
143
|
-
message: `Project is already linked to a different ID: ${chalk_1.default.bold(existingProjectId)}. Do you wish to overwrite it?`,
|
|
144
|
-
});
|
|
145
|
-
if (!confirm) {
|
|
146
|
-
throw new Error('Aborting');
|
|
147
|
-
}
|
|
148
|
-
await ProjectInit.saveProjectIdAndLogSuccessAsync(projectDir, projectId);
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
static async initializeWithExplicitIDAsync(projectId, projectDir, { force, nonInteractive }) {
|
|
152
|
-
await this.setExplicitIDAsync(projectId, projectDir, {
|
|
153
|
-
force,
|
|
154
|
-
nonInteractive,
|
|
155
|
-
});
|
|
156
|
-
}
|
|
157
|
-
static async initializeWithoutExplicitIDAsync(graphqlClient, actor, projectDir, { force, nonInteractive }) {
|
|
158
|
-
const exp = await (0, expoConfig_1.getPrivateExpoConfigAsync)(projectDir);
|
|
159
|
-
const existingProjectId = exp.extra?.eas?.projectId;
|
|
160
|
-
if (existingProjectId) {
|
|
161
|
-
log_1.default.succeed(`Project already linked (ID: ${chalk_1.default.bold(existingProjectId)}). To re-configure, remove the "extra.eas.projectId" field from your app config.`);
|
|
162
|
-
return existingProjectId;
|
|
163
|
-
}
|
|
164
|
-
const allAccounts = actor.accounts;
|
|
165
|
-
const accountNamesWhereUserHasSufficientPermissionsToCreateApp = new Set(allAccounts
|
|
166
|
-
.filter(a => a.users.find(it => it.actor.id === actor.id)?.role !== generated_1.Role.ViewOnly)
|
|
167
|
-
.map(it => it.name));
|
|
168
|
-
// if no owner field, ask the user which account they want to use to create/link the project
|
|
169
|
-
let accountName = exp.owner;
|
|
170
|
-
if (!accountName) {
|
|
171
|
-
if (allAccounts.length === 1) {
|
|
172
|
-
accountName = allAccounts[0].name;
|
|
173
|
-
}
|
|
174
|
-
else if (nonInteractive) {
|
|
175
|
-
if (!force) {
|
|
176
|
-
throw new Error(`There are multiple accounts that you have access to: ${allAccounts
|
|
177
|
-
.map(a => a.name)
|
|
178
|
-
.join(', ')}. Explicitly set the owner property in your app config or run this command with the --force flag to proceed with a default account: ${allAccounts[0].name}.`);
|
|
179
|
-
}
|
|
180
|
-
accountName = allAccounts[0].name;
|
|
181
|
-
log_1.default.log(`Using default account ${accountName} for non-interactive and force mode`);
|
|
182
|
-
}
|
|
183
|
-
else {
|
|
184
|
-
const choices = ProjectInit.getAccountChoices(actor, accountNamesWhereUserHasSufficientPermissionsToCreateApp);
|
|
185
|
-
accountName = (await (0, prompts_1.promptAsync)({
|
|
186
|
-
type: 'select',
|
|
187
|
-
name: 'account',
|
|
188
|
-
message: 'Which account should own this project?',
|
|
189
|
-
choices,
|
|
190
|
-
})).account.name;
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
if (!accountName) {
|
|
194
|
-
throw new Error('No account selected for project. Canceling.');
|
|
195
|
-
}
|
|
196
|
-
const projectName = (0, projectNameValidation_1.validSlugName)(exp.slug); // This filters out invalid characters
|
|
197
|
-
const projectFullName = `@${accountName}/${projectName}`;
|
|
198
|
-
(0, projectNameValidation_1.validateFullNameAndSlug)(projectFullName, projectName);
|
|
199
|
-
const existingProjectIdOnServer = await (0, fetchOrCreateProjectIDForWriteToConfigWithConfirmationAsync_1.findProjectIdByAccountNameAndSlugNullableAsync)(graphqlClient, accountName, projectName);
|
|
200
|
-
if (existingProjectIdOnServer) {
|
|
201
|
-
if (!force) {
|
|
202
|
-
if (nonInteractive) {
|
|
203
|
-
throw new Error(`Existing project found: ${projectFullName} (ID: ${existingProjectIdOnServer}). Use --force flag to continue with this project.`);
|
|
204
|
-
}
|
|
205
|
-
const affirmedLink = await (0, prompts_1.confirmAsync)({
|
|
206
|
-
message: `Existing project found: ${projectFullName} (ID: ${existingProjectIdOnServer}). Link this project?`,
|
|
207
|
-
});
|
|
208
|
-
if (!affirmedLink) {
|
|
209
|
-
throw new Error(`Project ID configuration canceled. Re-run the command to select a different account/project.`);
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
await ProjectInit.saveProjectIdAndLogSuccessAsync(projectDir, existingProjectIdOnServer);
|
|
213
|
-
return existingProjectIdOnServer;
|
|
214
|
-
}
|
|
215
|
-
if (!accountNamesWhereUserHasSufficientPermissionsToCreateApp.has(accountName)) {
|
|
216
|
-
throw new Error(`You don't have permission to create a new project on the ${accountName} account and no matching project already exists on the account.`);
|
|
217
|
-
}
|
|
218
|
-
if (!force) {
|
|
219
|
-
if (nonInteractive) {
|
|
220
|
-
throw new Error(`Project does not exist: ${projectFullName}. Use --force flag to create this project.`);
|
|
221
|
-
}
|
|
222
|
-
const affirmedCreate = await (0, prompts_1.confirmAsync)({
|
|
223
|
-
message: `Would you like to create a project for ${projectFullName}?`,
|
|
224
|
-
});
|
|
225
|
-
if (!affirmedCreate) {
|
|
226
|
-
throw new Error(`Project ID configuration canceled for ${projectFullName}.`);
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
const projectDashboardUrl = (0, url_1.getProjectDashboardUrl)(accountName, projectName);
|
|
230
|
-
const projectLink = (0, log_1.link)(projectDashboardUrl, { text: projectFullName });
|
|
231
|
-
const account = (0, nullthrows_1.default)(allAccounts.find(a => a.name === accountName));
|
|
232
|
-
const spinner = (0, ora_1.ora)(`Creating ${chalk_1.default.bold(projectFullName)}`).start();
|
|
233
|
-
let createdProjectId;
|
|
234
|
-
try {
|
|
235
|
-
createdProjectId = await AppMutation_1.AppMutation.createAppAsync(graphqlClient, {
|
|
236
|
-
accountId: account.id,
|
|
237
|
-
projectName,
|
|
238
|
-
});
|
|
239
|
-
spinner.succeed(`Created ${chalk_1.default.bold(projectLink)}`);
|
|
240
|
-
}
|
|
241
|
-
catch (err) {
|
|
242
|
-
spinner.fail();
|
|
243
|
-
throw err;
|
|
244
|
-
}
|
|
245
|
-
await ProjectInit.saveProjectIdAndLogSuccessAsync(projectDir, createdProjectId);
|
|
246
|
-
return createdProjectId;
|
|
247
|
-
}
|
|
248
|
-
static getAccountChoices(actor, namesWithSufficientPermissions) {
|
|
249
|
-
const allAccounts = actor.accounts;
|
|
250
|
-
const sortedAccounts = actor.__typename === 'Robot'
|
|
251
|
-
? allAccounts
|
|
252
|
-
: [...allAccounts].sort((a, _b) => actor.__typename === 'User' ? (a.name === actor.username ? -1 : 1) : 0);
|
|
253
|
-
if (actor.__typename !== 'Robot') {
|
|
254
|
-
const personalAccount = allAccounts?.find(account => account?.ownerUserActor?.id === actor.id);
|
|
255
|
-
const personalAccountChoice = personalAccount
|
|
256
|
-
? {
|
|
257
|
-
title: personalAccount.name,
|
|
258
|
-
value: personalAccount,
|
|
259
|
-
description: !namesWithSufficientPermissions.has(personalAccount.name)
|
|
260
|
-
? '(Personal) (Viewer Role)'
|
|
261
|
-
: '(Personal)',
|
|
262
|
-
}
|
|
263
|
-
: undefined;
|
|
264
|
-
const userAccounts = allAccounts
|
|
265
|
-
?.filter(account => account.ownerUserActor && account.name !== actor.username)
|
|
266
|
-
.map(account => ({
|
|
267
|
-
title: account.name,
|
|
268
|
-
value: account,
|
|
269
|
-
description: !namesWithSufficientPermissions.has(account.name)
|
|
270
|
-
? '(Team) (Viewer Role)'
|
|
271
|
-
: '(Team)',
|
|
272
|
-
}));
|
|
273
|
-
const organizationAccounts = allAccounts
|
|
274
|
-
?.filter(account => account.name !== actor.username && !account.ownerUserActor)
|
|
275
|
-
.map(account => ({
|
|
276
|
-
title: account.name,
|
|
277
|
-
value: account,
|
|
278
|
-
description: !namesWithSufficientPermissions.has(account.name)
|
|
279
|
-
? '(Organization) (Viewer Role)'
|
|
280
|
-
: '(Organization)',
|
|
281
|
-
}));
|
|
282
|
-
let choices = [];
|
|
283
|
-
if (personalAccountChoice) {
|
|
284
|
-
choices = [personalAccountChoice];
|
|
285
|
-
}
|
|
286
|
-
return [...choices, ...userAccounts, ...organizationAccounts].sort((a, _b) => actor.__typename === 'User' ? (a.value.name === actor.username ? -1 : 1) : 0);
|
|
287
|
-
}
|
|
288
|
-
return sortedAccounts.map(account => ({
|
|
289
|
-
title: account.name,
|
|
290
|
-
value: account,
|
|
291
|
-
description: !namesWithSufficientPermissions.has(account.name) ? '(Viewer Role)' : undefined,
|
|
292
|
-
}));
|
|
293
|
-
}
|
|
294
24
|
async runAsync() {
|
|
295
25
|
const { flags: { id: idArgument, force, 'non-interactive': nonInteractive }, } = await this.parse(ProjectInit);
|
|
296
26
|
const { loggedIn: { actor, graphqlClient }, projectDir, } = await this.getContextAsync(ProjectInit, { nonInteractive });
|
|
297
27
|
let idForConsistency;
|
|
298
28
|
if (idArgument) {
|
|
299
|
-
await
|
|
29
|
+
await (0, projectInitialization_1.initializeWithExplicitIDAsync)(idArgument, projectDir, {
|
|
300
30
|
force,
|
|
301
31
|
nonInteractive,
|
|
302
32
|
});
|
|
303
33
|
idForConsistency = idArgument;
|
|
304
34
|
}
|
|
305
35
|
else {
|
|
306
|
-
idForConsistency = await
|
|
36
|
+
idForConsistency = await (0, projectInitialization_1.initializeWithoutExplicitIDAsync)(graphqlClient, actor, projectDir, {
|
|
307
37
|
force,
|
|
308
38
|
nonInteractive,
|
|
309
39
|
});
|
|
310
40
|
}
|
|
311
|
-
await
|
|
41
|
+
await (0, projectInitialization_1.ensureOwnerSlugConsistencyAsync)(graphqlClient, idForConsistency, projectDir, {
|
|
312
42
|
force,
|
|
313
43
|
nonInteractive,
|
|
314
44
|
});
|
|
@@ -11,6 +11,8 @@ const log_1 = tslib_1.__importStar(require("../../log"));
|
|
|
11
11
|
const ora_1 = require("../../ora");
|
|
12
12
|
const env_1 = require("../../simulator/env");
|
|
13
13
|
const utils_1 = require("../../simulator/utils");
|
|
14
|
+
const files_1 = require("../../utils/files");
|
|
15
|
+
const formatFields_1 = tslib_1.__importDefault(require("../../utils/formatFields"));
|
|
14
16
|
const json_1 = require("../../utils/json");
|
|
15
17
|
class SimulatorGet extends EasCommand_1.default {
|
|
16
18
|
static hidden = true;
|
|
@@ -55,16 +57,19 @@ class SimulatorGet extends EasCommand_1.default {
|
|
|
55
57
|
id: session.id,
|
|
56
58
|
type: (0, utils_1.deviceRunSessionTypeToFlagValue)(session.type),
|
|
57
59
|
status: session.status,
|
|
60
|
+
platform: session.platform,
|
|
61
|
+
createdAt: session.createdAt,
|
|
62
|
+
startedAt: session.startedAt ?? undefined,
|
|
63
|
+
finishedAt: session.finishedAt ?? undefined,
|
|
64
|
+
updatedAt: session.updatedAt,
|
|
58
65
|
deviceRunSessionUrl,
|
|
59
66
|
remoteConfig: session.remoteConfig,
|
|
67
|
+
artifacts: session.artifacts,
|
|
60
68
|
});
|
|
61
69
|
return;
|
|
62
70
|
}
|
|
63
71
|
log_1.default.newLine();
|
|
64
|
-
log_1.default.log(
|
|
65
|
-
log_1.default.log(`Type: ${session.type}`);
|
|
66
|
-
log_1.default.log(`Status: ${session.status}`);
|
|
67
|
-
log_1.default.log(`URL: ${(0, log_1.link)(deviceRunSessionUrl)}`);
|
|
72
|
+
log_1.default.log(formatSessionFields(session, deviceRunSessionUrl));
|
|
68
73
|
if (session.status === generated_1.DeviceRunSessionStatus.InProgress) {
|
|
69
74
|
log_1.default.newLine();
|
|
70
75
|
if (session.remoteConfig) {
|
|
@@ -74,6 +79,54 @@ class SimulatorGet extends EasCommand_1.default {
|
|
|
74
79
|
log_1.default.log('⏳ Session is starting up — remote config is not available yet. Re-run this command in a moment.');
|
|
75
80
|
}
|
|
76
81
|
}
|
|
82
|
+
printArtifacts('Session artifacts', session.artifacts, formatDeviceRunSessionArtifactFields);
|
|
77
83
|
}
|
|
78
84
|
}
|
|
79
85
|
exports.default = SimulatorGet;
|
|
86
|
+
function formatSessionFields(session, deviceRunSessionUrl) {
|
|
87
|
+
return (0, formatFields_1.default)([
|
|
88
|
+
{ label: 'ID', value: session.id },
|
|
89
|
+
{ label: 'Type', value: session.type },
|
|
90
|
+
{ label: 'Status', value: session.status },
|
|
91
|
+
{ label: 'Platform', value: session.platform },
|
|
92
|
+
{ label: 'Created at', value: String(session.createdAt) },
|
|
93
|
+
{ label: 'Started at', value: formatNullable(session.startedAt) },
|
|
94
|
+
{ label: 'Finished at', value: formatNullable(session.finishedAt) },
|
|
95
|
+
{ label: 'Updated at', value: String(session.updatedAt) },
|
|
96
|
+
{ label: 'URL', value: (0, log_1.link)(deviceRunSessionUrl) },
|
|
97
|
+
]);
|
|
98
|
+
}
|
|
99
|
+
function printArtifacts(title, artifacts, formatArtifactFields) {
|
|
100
|
+
if (artifacts.length === 0) {
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
log_1.default.addNewLineIfNone();
|
|
104
|
+
log_1.default.gray(`${title}:`);
|
|
105
|
+
for (const artifact of artifacts) {
|
|
106
|
+
log_1.default.log((0, formatFields_1.default)(formatArtifactFields(artifact)));
|
|
107
|
+
log_1.default.addNewLineIfNone();
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
function formatDeviceRunSessionArtifactFields(artifact) {
|
|
111
|
+
return [
|
|
112
|
+
{ label: ' ID', value: artifact.id },
|
|
113
|
+
{ label: ' Name', value: artifact.name },
|
|
114
|
+
{ label: ' Filename', value: artifact.filename },
|
|
115
|
+
{ label: ' File size', value: formatFileSize(artifact.fileSizeBytes) },
|
|
116
|
+
{ label: ' Created at', value: String(artifact.createdAt) },
|
|
117
|
+
{ label: ' Updated at', value: String(artifact.updatedAt) },
|
|
118
|
+
{ label: ' Metadata', value: formatMetadata(artifact.metadata) },
|
|
119
|
+
{ label: ' Download URL', value: (0, log_1.link)(artifact.downloadUrl) },
|
|
120
|
+
];
|
|
121
|
+
}
|
|
122
|
+
function formatFileSize(fileSizeBytes) {
|
|
123
|
+
return typeof fileSizeBytes === 'number'
|
|
124
|
+
? `${(0, files_1.formatBytes)(fileSizeBytes)} (${fileSizeBytes} B)`
|
|
125
|
+
: 'null';
|
|
126
|
+
}
|
|
127
|
+
function formatMetadata(metadata) {
|
|
128
|
+
return metadata ? JSON.stringify(metadata) : 'null';
|
|
129
|
+
}
|
|
130
|
+
function formatNullable(value) {
|
|
131
|
+
return value ? String(value) : 'null';
|
|
132
|
+
}
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import EasCommand from '../../commandUtils/EasCommand';
|
|
2
|
+
import { WorkflowStarterName } from '../../commandUtils/workflow/creation';
|
|
2
3
|
export declare class WorkflowCreate extends EasCommand {
|
|
3
4
|
static description: string;
|
|
4
5
|
static args: {
|
|
5
6
|
name: import("@oclif/core/lib/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
6
7
|
};
|
|
7
8
|
static flags: {
|
|
9
|
+
template: import("@oclif/core/lib/interfaces").OptionFlag<WorkflowStarterName | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
8
10
|
'skip-validation': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
9
11
|
};
|
|
10
12
|
static contextDefinition: {
|
|
13
|
+
vcsClient: import("../../commandUtils/context/VcsClientContextField").default;
|
|
11
14
|
loggedIn: import("../../commandUtils/context/LoggedInContextField").default;
|
|
12
15
|
projectDir: import("../../commandUtils/context/ProjectDirContextField").default;
|
|
13
16
|
getDynamicPublicProjectConfigAsync: import("../../commandUtils/context/DynamicProjectConfigContextField").DynamicPublicProjectConfigContextField;
|