eas-cli 21.3.0 → 21.5.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 +338 -149
- package/build/build/build.js +102 -17
- package/build/build/local.js +64 -7
- package/build/commandUtils/workflow/compositeFunctions.d.ts +1 -0
- package/build/commandUtils/workflow/compositeFunctions.js +64 -0
- package/build/commandUtils/workflow/validation.js +3 -0
- package/build/commands/account/usage.d.ts +3 -0
- package/build/commands/account/usage.js +6 -5
- package/build/commands/integrations/posthog/connect.js +1 -1
- package/build/commands/observe/events.js +5 -2
- package/build/commands/project/new.d.ts +1 -1
- package/build/commands/simulator/events.d.ts +16 -0
- package/build/commands/simulator/events.js +136 -0
- package/build/commands/simulator/get.js +2 -0
- package/build/commands/simulator/list.js +2 -0
- package/build/commands/simulator/start.d.ts +1 -0
- package/build/commands/simulator/start.js +91 -24
- package/build/commands/submit/cancel.d.ts +20 -0
- package/build/commands/submit/cancel.js +116 -0
- package/build/commands/submit/list.d.ts +27 -0
- package/build/commands/submit/list.js +100 -0
- package/build/commands/submit/retry.d.ts +18 -0
- package/build/commands/submit/retry.js +123 -0
- package/build/commands/submit/status.d.ts +19 -0
- package/build/commands/submit/status.js +116 -0
- package/build/commands/submit/view.d.ts +17 -0
- package/build/commands/submit/view.js +96 -0
- package/build/graphql/generated.d.ts +780 -40
- package/build/graphql/generated.js +3 -0
- package/build/graphql/mutations/SubmissionMutation.d.ts +3 -1
- package/build/graphql/mutations/SubmissionMutation.js +33 -0
- package/build/graphql/queries/DeviceRunSessionQuery.d.ts +2 -1
- package/build/graphql/queries/DeviceRunSessionQuery.js +22 -0
- package/build/graphql/queries/SubmissionQuery.d.ts +3 -2
- package/build/graphql/queries/SubmissionQuery.js +19 -2
- package/build/graphql/types/SubmissionWithSubmittedBuild.d.ts +1 -0
- package/build/graphql/types/SubmissionWithSubmittedBuild.js +25 -0
- package/build/simulator/events.d.ts +7 -0
- package/build/simulator/events.js +95 -0
- package/build/simulator/utils.js +1 -1
- package/build/submit/queries.d.ts +34 -0
- package/build/submit/queries.js +94 -0
- package/build/submit/status.d.ts +31 -0
- package/build/submit/status.js +187 -0
- package/build/submit/utils/formatSubmission.d.ts +2 -0
- package/build/submit/utils/formatSubmission.js +78 -0
- package/build/utils/promise.d.ts +3 -2
- package/build/utils/promise.js +17 -3
- package/build/utils/terminalText.d.ts +1 -0
- package/build/utils/terminalText.js +14 -0
- package/build/utils/usage/checkForOverages.js +1 -1
- package/oclif.manifest.json +3229 -2628
- package/package.json +5 -5
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const core_1 = require("@oclif/core");
|
|
5
|
+
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
6
|
+
const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
|
|
7
|
+
const flags_1 = require("../../commandUtils/flags");
|
|
8
|
+
const generated_1 = require("../../graphql/generated");
|
|
9
|
+
const log_1 = tslib_1.__importDefault(require("../../log"));
|
|
10
|
+
const ora_1 = require("../../ora");
|
|
11
|
+
const platform_1 = require("../../platform");
|
|
12
|
+
const queries_1 = require("../../submit/queries");
|
|
13
|
+
const status_1 = require("../../submit/status");
|
|
14
|
+
const app_1 = require("../../testflight/app");
|
|
15
|
+
const json_1 = require("../../utils/json");
|
|
16
|
+
const ANDROID_STATUS_UNAVAILABLE_MESSAGE = 'Google Play app status is not available through EAS yet. Run `eas submit:list -p android` to see recent Android submissions.';
|
|
17
|
+
class SubmissionStatus extends EasCommand_1.default {
|
|
18
|
+
static description = 'show the status of your app on the App Store: the live version and TestFlight builds\n\n' +
|
|
19
|
+
'This command reads from App Store Connect and requires an ASC API key. Provide one via:\n' +
|
|
20
|
+
' - Environment variables: EXPO_ASC_API_KEY_PATH, EXPO_ASC_KEY_ID, EXPO_ASC_ISSUER_ID\n' +
|
|
21
|
+
' - eas.json submit profile: ascApiKeyPath, ascApiKeyId, ascApiKeyIssuerId\n' +
|
|
22
|
+
' - EAS credentials service: run `eas credentials` to set up an API key\n' +
|
|
23
|
+
'Without a key, the command offers an interactive Apple login; in non-interactive mode it fails.\n\n' +
|
|
24
|
+
'Google Play app status is not available through EAS yet. Run `eas submit:list -p android` to see recent Android submissions.';
|
|
25
|
+
static examples = [
|
|
26
|
+
'$ eas submit:status \t # live App Store version and TestFlight builds',
|
|
27
|
+
'$ eas submit:status --json --non-interactive \t # machine-readable output',
|
|
28
|
+
];
|
|
29
|
+
static flags = {
|
|
30
|
+
platform: core_1.Flags.option({
|
|
31
|
+
char: 'p',
|
|
32
|
+
options: Object.values(platform_1.RequestedPlatform),
|
|
33
|
+
})(),
|
|
34
|
+
profile: core_1.Flags.string({
|
|
35
|
+
char: 'e',
|
|
36
|
+
description: 'Name of the submit profile from eas.json used to resolve the App Store Connect API key. Defaults to "production".',
|
|
37
|
+
}),
|
|
38
|
+
...flags_1.EasNonInteractiveAndJsonFlags,
|
|
39
|
+
};
|
|
40
|
+
static contextDefinition = {
|
|
41
|
+
...this.ContextOptions.ProjectConfig,
|
|
42
|
+
...this.ContextOptions.LoggedIn,
|
|
43
|
+
...this.ContextOptions.Analytics,
|
|
44
|
+
...this.ContextOptions.Vcs,
|
|
45
|
+
};
|
|
46
|
+
async runAsync() {
|
|
47
|
+
const { flags } = await this.parse(SubmissionStatus);
|
|
48
|
+
const { json: jsonFlag, nonInteractive } = (0, flags_1.resolveNonInteractiveAndJsonFlags)(flags);
|
|
49
|
+
const requestedPlatform = flags.platform ?? platform_1.RequestedPlatform.All;
|
|
50
|
+
// Redirect stdout before context setup — resolving the project config can log messages,
|
|
51
|
+
// and with --json those must go to stderr.
|
|
52
|
+
if (jsonFlag) {
|
|
53
|
+
(0, json_1.enableJsonOutput)();
|
|
54
|
+
}
|
|
55
|
+
const { loggedIn: { actor, graphqlClient }, privateProjectConfig: { exp, projectId, projectDir }, analytics, vcsClient, } = await this.getContextAsync(SubmissionStatus, {
|
|
56
|
+
nonInteractive,
|
|
57
|
+
withServerSideEnvironment: null,
|
|
58
|
+
});
|
|
59
|
+
const includeIos = [platform_1.RequestedPlatform.All, platform_1.RequestedPlatform.Ios].includes(requestedPlatform);
|
|
60
|
+
const includeAndroid = [platform_1.RequestedPlatform.All, platform_1.RequestedPlatform.Android].includes(requestedPlatform);
|
|
61
|
+
let iosStatus = null;
|
|
62
|
+
let iosSubmissions = [];
|
|
63
|
+
if (includeIos) {
|
|
64
|
+
const spinner = (0, ora_1.ora)().start('Fetching submissions…');
|
|
65
|
+
try {
|
|
66
|
+
iosSubmissions = await (0, queries_1.getRecentSubmissionsAsync)(graphqlClient, {
|
|
67
|
+
projectId,
|
|
68
|
+
filter: { platform: generated_1.AppPlatform.Ios },
|
|
69
|
+
});
|
|
70
|
+
spinner.stop();
|
|
71
|
+
}
|
|
72
|
+
catch (error) {
|
|
73
|
+
spinner.fail("Something went wrong and we couldn't fetch the submissions for this project.");
|
|
74
|
+
throw error;
|
|
75
|
+
}
|
|
76
|
+
const app = await (0, app_1.resolveTestFlightAppAsync)({
|
|
77
|
+
actor,
|
|
78
|
+
analytics,
|
|
79
|
+
exp,
|
|
80
|
+
graphqlClient,
|
|
81
|
+
nonInteractive,
|
|
82
|
+
profileName: flags.profile,
|
|
83
|
+
projectDir,
|
|
84
|
+
projectId,
|
|
85
|
+
vcsClient,
|
|
86
|
+
});
|
|
87
|
+
const ascSpinner = (0, ora_1.ora)().start('Fetching App Store status…');
|
|
88
|
+
try {
|
|
89
|
+
iosStatus = await (0, status_1.getIosStoreStatusAsync)(app, iosSubmissions);
|
|
90
|
+
ascSpinner.stop();
|
|
91
|
+
}
|
|
92
|
+
catch (error) {
|
|
93
|
+
ascSpinner.fail("Something went wrong and we couldn't fetch the App Store status.");
|
|
94
|
+
throw error;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
if (jsonFlag) {
|
|
98
|
+
(0, json_1.printJsonOnlyOutput)({
|
|
99
|
+
...(includeIos && { ios: iosStatus }),
|
|
100
|
+
...(includeAndroid && {
|
|
101
|
+
android: { available: false, message: ANDROID_STATUS_UNAVAILABLE_MESSAGE },
|
|
102
|
+
}),
|
|
103
|
+
});
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
if (iosStatus) {
|
|
107
|
+
(0, status_1.renderIosStoreStatus)(iosStatus, iosSubmissions);
|
|
108
|
+
}
|
|
109
|
+
if (includeAndroid) {
|
|
110
|
+
log_1.default.addNewLineIfNone();
|
|
111
|
+
log_1.default.log(chalk_1.default.bold('Android — Google Play'));
|
|
112
|
+
log_1.default.log(chalk_1.default.dim(` ${ANDROID_STATUS_UNAVAILABLE_MESSAGE}`));
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
exports.default = SubmissionStatus;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import EasCommand from '../../commandUtils/EasCommand';
|
|
2
|
+
import { RequestedPlatform } from '../../platform';
|
|
3
|
+
export default class SubmissionView extends EasCommand {
|
|
4
|
+
static description: string;
|
|
5
|
+
static args: {
|
|
6
|
+
SUBMISSION_ID: import("@oclif/core/lib/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
7
|
+
};
|
|
8
|
+
static flags: {
|
|
9
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
platform: import("@oclif/core/lib/interfaces").OptionFlag<RequestedPlatform | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
|
+
};
|
|
12
|
+
static contextDefinition: {
|
|
13
|
+
loggedIn: import("../../commandUtils/context/LoggedInContextField").default;
|
|
14
|
+
projectId: import("../../commandUtils/context/ProjectIdContextField").ProjectIdContextField;
|
|
15
|
+
};
|
|
16
|
+
runAsync(): Promise<void>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const core_1 = require("@oclif/core");
|
|
5
|
+
const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
|
|
6
|
+
const flags_1 = require("../../commandUtils/flags");
|
|
7
|
+
const generated_1 = require("../../graphql/generated");
|
|
8
|
+
const SubmissionQuery_1 = require("../../graphql/queries/SubmissionQuery");
|
|
9
|
+
const log_1 = tslib_1.__importDefault(require("../../log"));
|
|
10
|
+
const ora_1 = require("../../ora");
|
|
11
|
+
const platform_1 = require("../../platform");
|
|
12
|
+
const projectUtils_1 = require("../../project/projectUtils");
|
|
13
|
+
const queries_1 = require("../../submit/queries");
|
|
14
|
+
const formatSubmission_1 = require("../../submit/utils/formatSubmission");
|
|
15
|
+
const json_1 = require("../../utils/json");
|
|
16
|
+
class SubmissionView extends EasCommand_1.default {
|
|
17
|
+
static description = 'view a submission for your project';
|
|
18
|
+
static args = {
|
|
19
|
+
SUBMISSION_ID: core_1.Args.string({}),
|
|
20
|
+
};
|
|
21
|
+
static flags = {
|
|
22
|
+
platform: core_1.Flags.option({
|
|
23
|
+
char: 'p',
|
|
24
|
+
description: 'Show the most recent submission for the platform when submission ID is not provided',
|
|
25
|
+
options: Object.values(platform_1.RequestedPlatform),
|
|
26
|
+
})(),
|
|
27
|
+
...flags_1.EasJsonOnlyFlag,
|
|
28
|
+
};
|
|
29
|
+
static contextDefinition = {
|
|
30
|
+
...this.ContextOptions.ProjectId,
|
|
31
|
+
...this.ContextOptions.LoggedIn,
|
|
32
|
+
};
|
|
33
|
+
async runAsync() {
|
|
34
|
+
const { args: { SUBMISSION_ID: submissionId }, flags, } = await this.parse(SubmissionView);
|
|
35
|
+
if (submissionId && flags.platform) {
|
|
36
|
+
throw new Error('Submission ID cannot be used together with the platform flag. The platform flag filters the submissions when no submission ID is provided');
|
|
37
|
+
}
|
|
38
|
+
if (flags.json) {
|
|
39
|
+
(0, json_1.enableJsonOutput)();
|
|
40
|
+
}
|
|
41
|
+
const { projectId, loggedIn: { graphqlClient }, } = await this.getContextAsync(SubmissionView, {
|
|
42
|
+
nonInteractive: true,
|
|
43
|
+
});
|
|
44
|
+
const displayName = await (0, projectUtils_1.getDisplayNameForProjectIdAsync)(graphqlClient, projectId);
|
|
45
|
+
const spinner = (0, ora_1.ora)().start('Fetching the submission…');
|
|
46
|
+
try {
|
|
47
|
+
let submission;
|
|
48
|
+
if (submissionId) {
|
|
49
|
+
submission = await SubmissionQuery_1.SubmissionQuery.byIdWithSubmittedBuildAsync(graphqlClient, submissionId);
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
submission = await (0, queries_1.getLatestSubmissionAsync)(graphqlClient, {
|
|
53
|
+
projectId,
|
|
54
|
+
filter: { platform: toAppPlatform(flags.platform) },
|
|
55
|
+
});
|
|
56
|
+
if (!submission) {
|
|
57
|
+
spinner.fail(`Couldn't find any submissions for the project ${displayName}`);
|
|
58
|
+
throw new Error(`No submissions found for the project ${displayName}`);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
if (submissionId) {
|
|
62
|
+
spinner.succeed(`Found a matching submission for the project ${displayName}`);
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
spinner.succeed(`Showing the last submission for the project ${displayName}`);
|
|
66
|
+
}
|
|
67
|
+
if (flags.json) {
|
|
68
|
+
(0, json_1.printJsonOnlyOutput)(submission);
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
log_1.default.log(`\n${(0, formatSubmission_1.formatGraphQLSubmission)(submission)}`);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
catch (err) {
|
|
75
|
+
if (submissionId) {
|
|
76
|
+
spinner.fail(`Something went wrong and we couldn't fetch the submission with id ${submissionId}`);
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
spinner.fail(`Something went wrong and we couldn't fetch the last submission for the project ${displayName}`);
|
|
80
|
+
}
|
|
81
|
+
throw err;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
exports.default = SubmissionView;
|
|
86
|
+
const toAppPlatform = (requestedPlatform) => {
|
|
87
|
+
if (!requestedPlatform || requestedPlatform === platform_1.RequestedPlatform.All) {
|
|
88
|
+
return undefined;
|
|
89
|
+
}
|
|
90
|
+
else if (requestedPlatform === platform_1.RequestedPlatform.Android) {
|
|
91
|
+
return generated_1.AppPlatform.Android;
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
return generated_1.AppPlatform.Ios;
|
|
95
|
+
}
|
|
96
|
+
};
|