eas-cli 0.41.0 → 0.43.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 +23 -465
- package/bin/dev +17 -0
- package/bin/dev.cmd +3 -0
- package/bin/run +3 -3
- package/build/api.d.ts +1 -0
- package/build/api.js +13 -1
- package/build/build/configure.js +3 -3
- package/build/build/local.js +1 -1
- package/build/build/utils/devClient.js +3 -3
- package/build/commandUtils/EasCommand.d.ts +2 -1
- package/build/commandUtils/EasCommand.js +7 -4
- package/build/commands/account/login.d.ts +1 -0
- package/build/commands/account/login.js +1 -0
- package/build/commands/account/logout.d.ts +1 -0
- package/build/commands/account/logout.js +1 -0
- package/build/commands/account/view.d.ts +1 -0
- package/build/commands/account/view.js +1 -0
- package/build/commands/analytics.js +1 -1
- package/build/commands/branch/create.d.ts +1 -2
- package/build/commands/branch/create.js +11 -7
- package/build/commands/branch/delete.d.ts +1 -2
- package/build/commands/branch/delete.js +12 -7
- package/build/commands/branch/list.d.ts +1 -2
- package/build/commands/branch/list.js +8 -5
- package/build/commands/branch/rename.d.ts +3 -5
- package/build/commands/branch/rename.js +13 -9
- package/build/commands/branch/view.d.ts +1 -2
- package/build/commands/branch/view.js +33 -29
- package/build/commands/build/cancel.js +1 -1
- package/build/commands/build/configure.d.ts +1 -2
- package/build/commands/build/configure.js +3 -3
- package/build/commands/build/index.d.ts +11 -12
- package/build/commands/build/index.js +20 -19
- package/build/commands/build/inspect.d.ts +7 -7
- package/build/commands/build/inspect.js +31 -24
- package/build/commands/build/list.d.ts +13 -14
- package/build/commands/build/list.js +15 -15
- package/build/commands/build/view.d.ts +1 -1
- package/build/commands/build/view.js +3 -3
- package/build/commands/channel/create.d.ts +1 -2
- package/build/commands/channel/create.js +24 -20
- package/build/commands/channel/delete.d.ts +15 -0
- package/build/commands/channel/delete.js +124 -0
- package/build/commands/channel/edit.d.ts +2 -4
- package/build/commands/channel/edit.js +14 -10
- package/build/commands/channel/list.d.ts +1 -2
- package/build/commands/channel/list.js +17 -13
- package/build/commands/channel/rollout.d.ts +4 -5
- package/build/commands/channel/rollout.js +14 -10
- package/build/commands/channel/view.d.ts +1 -2
- package/build/commands/channel/view.js +19 -15
- package/build/commands/config.d.ts +2 -3
- package/build/commands/config.js +4 -4
- package/build/commands/device/list.d.ts +1 -2
- package/build/commands/device/list.js +3 -3
- package/build/commands/device/view.js +1 -1
- package/build/commands/diagnostics.js +1 -0
- package/build/commands/secret/create.d.ts +4 -5
- package/build/commands/secret/create.js +6 -6
- package/build/commands/secret/delete.d.ts +1 -2
- package/build/commands/secret/delete.js +3 -3
- package/build/commands/submit.d.ts +9 -10
- package/build/commands/submit.js +13 -14
- package/build/commands/update/configure.d.ts +0 -3
- package/build/commands/update/configure.js +4 -10
- package/build/commands/update/delete.d.ts +1 -2
- package/build/commands/update/delete.js +12 -8
- package/build/commands/update/index.d.ts +9 -11
- package/build/commands/update/index.js +30 -18
- package/build/commands/update/view.d.ts +1 -2
- package/build/commands/update/view.js +25 -21
- package/build/commands/webhook/create.d.ts +3 -4
- package/build/commands/webhook/create.js +5 -5
- package/build/commands/webhook/delete.js +1 -1
- package/build/commands/webhook/list.d.ts +1 -2
- package/build/commands/webhook/list.js +3 -3
- package/build/commands/webhook/update.d.ts +4 -5
- package/build/commands/webhook/update.js +6 -6
- package/build/commands/webhook/view.js +1 -1
- package/build/graphql/generated.d.ts +33 -0
- package/build/index.d.ts +1 -1
- package/build/index.js +2 -2
- package/build/project/expoSdk.js +2 -2
- package/build/project/metroConfig.js +2 -2
- package/build/project/publish.js +1 -3
- package/build/submit/ios/IosSubmitCommand.js +6 -1
- package/build/user/actions.js +2 -2
- package/build/utils/expoCli.d.ts +3 -1
- package/build/utils/expoCli.js +13 -11
- package/build/vcs/clients/git.js +2 -2
- package/oclif.manifest.json +1 -1
- package/package.json +20 -13
|
@@ -3,8 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.handleDeprecatedEasJsonAsync = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const eas_json_1 = require("@expo/eas-json");
|
|
6
|
-
const
|
|
7
|
-
const errors_1 = require("@oclif/errors");
|
|
6
|
+
const core_1 = require("@oclif/core");
|
|
8
7
|
const chalk_1 = (0, tslib_1.__importDefault)(require("chalk"));
|
|
9
8
|
const figures_1 = (0, tslib_1.__importDefault)(require("figures"));
|
|
10
9
|
const fs_extra_1 = (0, tslib_1.__importDefault)(require("fs-extra"));
|
|
@@ -21,7 +20,7 @@ const vcs_1 = require("../../vcs");
|
|
|
21
20
|
const git_1 = (0, tslib_1.__importDefault)(require("../../vcs/clients/git"));
|
|
22
21
|
class Build extends EasCommand_1.default {
|
|
23
22
|
async runAsync() {
|
|
24
|
-
const { flags: rawFlags } = this.parse(Build);
|
|
23
|
+
const { flags: rawFlags } = await this.parse(Build);
|
|
25
24
|
if (rawFlags.json) {
|
|
26
25
|
(0, json_1.enableJsonOutput)();
|
|
27
26
|
}
|
|
@@ -34,22 +33,24 @@ class Build extends EasCommand_1.default {
|
|
|
34
33
|
var _a;
|
|
35
34
|
const nonInteractive = flags['non-interactive'];
|
|
36
35
|
if (!flags.platform && nonInteractive) {
|
|
37
|
-
|
|
36
|
+
core_1.Errors.error('--platform is required when building in non-interactive mode', { exit: 1 });
|
|
38
37
|
}
|
|
39
38
|
if (flags.json && !nonInteractive) {
|
|
40
|
-
|
|
39
|
+
core_1.Errors.error('--json is allowed only when building in non-interactive mode', { exit: 1 });
|
|
41
40
|
}
|
|
42
41
|
const requestedPlatform = await (0, platform_1.selectRequestedPlatformAsync)(flags.platform);
|
|
43
42
|
if (flags.local) {
|
|
44
43
|
if (flags['auto-submit'] || flags['auto-submit-with-profile'] !== undefined) {
|
|
45
44
|
// TODO: implement this
|
|
46
|
-
|
|
45
|
+
core_1.Errors.error('Auto-submits are not yet supported when building locally', { exit: 1 });
|
|
47
46
|
}
|
|
48
47
|
if (requestedPlatform === platform_1.RequestedPlatform.All) {
|
|
49
|
-
|
|
48
|
+
core_1.Errors.error('Builds for multiple platforms are not supported with flag --local', {
|
|
49
|
+
exit: 1,
|
|
50
|
+
});
|
|
50
51
|
}
|
|
51
52
|
else if (process.platform !== 'darwin' && requestedPlatform === platform_1.RequestedPlatform.Ios) {
|
|
52
|
-
|
|
53
|
+
core_1.Errors.error('Unsupported platform, macOS is required to build apps for iOS', { exit: 1 });
|
|
53
54
|
}
|
|
54
55
|
}
|
|
55
56
|
if (flags['skip-credentials-check']) {
|
|
@@ -78,49 +79,49 @@ class Build extends EasCommand_1.default {
|
|
|
78
79
|
exports.default = Build;
|
|
79
80
|
Build.description = 'Start a build';
|
|
80
81
|
Build.flags = {
|
|
81
|
-
platform:
|
|
82
|
+
platform: core_1.Flags.enum({
|
|
82
83
|
char: 'p',
|
|
83
84
|
options: ['android', 'ios', 'all'],
|
|
84
85
|
}),
|
|
85
|
-
'skip-credentials-check':
|
|
86
|
+
'skip-credentials-check': core_1.Flags.boolean({
|
|
86
87
|
default: false,
|
|
87
88
|
hidden: true,
|
|
88
89
|
}),
|
|
89
|
-
json:
|
|
90
|
+
json: core_1.Flags.boolean({
|
|
90
91
|
description: 'Enable JSON output, non-JSON messages will be printed to stderr',
|
|
91
92
|
default: false,
|
|
92
93
|
}),
|
|
93
|
-
'skip-project-configuration':
|
|
94
|
+
'skip-project-configuration': core_1.Flags.boolean({
|
|
94
95
|
default: false,
|
|
95
96
|
description: 'Skip project configuration',
|
|
96
97
|
}),
|
|
97
|
-
profile:
|
|
98
|
+
profile: core_1.Flags.string({
|
|
98
99
|
description: 'Name of the build profile from eas.json. Defaults to "production" if defined in eas.json.',
|
|
99
100
|
helpValue: 'PROFILE_NAME',
|
|
100
101
|
}),
|
|
101
|
-
'non-interactive':
|
|
102
|
+
'non-interactive': core_1.Flags.boolean({
|
|
102
103
|
default: false,
|
|
103
104
|
description: 'Run command in non-interactive mode',
|
|
104
105
|
}),
|
|
105
|
-
local:
|
|
106
|
+
local: core_1.Flags.boolean({
|
|
106
107
|
default: false,
|
|
107
108
|
description: 'Run build locally [experimental]',
|
|
108
109
|
}),
|
|
109
|
-
wait:
|
|
110
|
+
wait: core_1.Flags.boolean({
|
|
110
111
|
default: true,
|
|
111
112
|
allowNo: true,
|
|
112
113
|
description: 'Wait for build(s) to complete',
|
|
113
114
|
}),
|
|
114
|
-
'clear-cache':
|
|
115
|
+
'clear-cache': core_1.Flags.boolean({
|
|
115
116
|
default: false,
|
|
116
117
|
description: 'Clear cache before the build',
|
|
117
118
|
}),
|
|
118
|
-
'auto-submit':
|
|
119
|
+
'auto-submit': core_1.Flags.boolean({
|
|
119
120
|
default: false,
|
|
120
121
|
description: 'Submit on build complete using the submit profile with the same name as the build profile',
|
|
121
122
|
exclusive: ['auto-submit-with-profile'],
|
|
122
123
|
}),
|
|
123
|
-
'auto-submit-with-profile':
|
|
124
|
+
'auto-submit-with-profile': core_1.Flags.string({
|
|
124
125
|
description: 'Submit on build complete using the submit profile with provided name',
|
|
125
126
|
helpValue: 'PROFILE_NAME',
|
|
126
127
|
exclusive: ['auto-submit'],
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { flags } from '@oclif/command';
|
|
2
1
|
import EasCommand from '../../commandUtils/EasCommand';
|
|
3
2
|
import { RequestedPlatform } from '../../platform';
|
|
4
3
|
declare enum InspectStage {
|
|
@@ -9,14 +8,15 @@ declare enum InspectStage {
|
|
|
9
8
|
export default class BuildInspect extends EasCommand {
|
|
10
9
|
static description: string;
|
|
11
10
|
static flags: {
|
|
12
|
-
platform:
|
|
13
|
-
profile:
|
|
14
|
-
stage:
|
|
15
|
-
output:
|
|
16
|
-
force: import("@oclif/
|
|
17
|
-
verbose: import("@oclif/
|
|
11
|
+
platform: import("@oclif/core/lib/interfaces").OptionFlag<RequestedPlatform>;
|
|
12
|
+
profile: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
13
|
+
stage: import("@oclif/core/lib/interfaces").OptionFlag<InspectStage>;
|
|
14
|
+
output: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
15
|
+
force: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
16
|
+
verbose: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
18
17
|
};
|
|
19
18
|
runAsync(): Promise<void>;
|
|
20
19
|
private prepareOutputDirAsync;
|
|
20
|
+
private copyToOutputDirAsync;
|
|
21
21
|
}
|
|
22
22
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const
|
|
4
|
+
const core_1 = require("@oclif/core");
|
|
5
5
|
const chalk_1 = (0, tslib_1.__importDefault)(require("chalk"));
|
|
6
6
|
const fs_extra_1 = (0, tslib_1.__importDefault)(require("fs-extra"));
|
|
7
7
|
const path_1 = (0, tslib_1.__importDefault)(require("path"));
|
|
@@ -26,18 +26,21 @@ const STAGE_DESCRIPTION = `Stage of the build you want to inspect.
|
|
|
26
26
|
post-build - builds the native project and leaves the output directory for inspection`;
|
|
27
27
|
class BuildInspect extends EasCommand_1.default {
|
|
28
28
|
async runAsync() {
|
|
29
|
-
const { flags } = this.parse(BuildInspect);
|
|
29
|
+
const { flags } = await this.parse(BuildInspect);
|
|
30
30
|
const outputDirectory = path_1.default.resolve(process.cwd(), flags.output);
|
|
31
|
+
const tmpWorkingdir = path_1.default.join((0, paths_1.getTmpDirectory)(), (0, uuid_1.v4)());
|
|
32
|
+
if (flags.force && process.cwd().startsWith(outputDirectory)) {
|
|
33
|
+
throw new Error(`This operation is not allowed, it would delete all files in ${outputDirectory} including the current project.`);
|
|
34
|
+
}
|
|
31
35
|
await this.prepareOutputDirAsync(outputDirectory, flags.force);
|
|
32
36
|
if (flags.stage === InspectStage.ARCHIVE) {
|
|
33
37
|
const vcs = (0, vcs_1.getVcsClient)();
|
|
34
38
|
await vcs.ensureRepoExistsAsync();
|
|
35
|
-
await vcs.makeShallowCopyAsync(
|
|
36
|
-
|
|
39
|
+
await vcs.makeShallowCopyAsync(tmpWorkingdir);
|
|
40
|
+
await this.copyToOutputDirAsync(tmpWorkingdir, outputDirectory);
|
|
37
41
|
}
|
|
38
42
|
else {
|
|
39
43
|
const projectDir = await (0, projectUtils_1.findProjectRootAsync)();
|
|
40
|
-
const tmpWorkingdir = path_1.default.join((0, paths_1.getTmpDirectory)(), (0, uuid_1.v4)());
|
|
41
44
|
try {
|
|
42
45
|
await (0, runBuildAndSubmit_1.runBuildAndSubmitAsync)(projectDir, {
|
|
43
46
|
skipProjectConfiguration: false,
|
|
@@ -68,19 +71,7 @@ class BuildInspect extends EasCommand_1.default {
|
|
|
68
71
|
}
|
|
69
72
|
}
|
|
70
73
|
finally {
|
|
71
|
-
|
|
72
|
-
try {
|
|
73
|
-
const tmpBuildDirectory = path_1.default.join(tmpWorkingdir, 'build');
|
|
74
|
-
if (await fs_extra_1.default.pathExists(tmpBuildDirectory)) {
|
|
75
|
-
await fs_extra_1.default.copy(tmpBuildDirectory, outputDirectory);
|
|
76
|
-
}
|
|
77
|
-
await fs_extra_1.default.remove(tmpWorkingdir);
|
|
78
|
-
spinner.succeed(`Project build directory saved to ${outputDirectory}`);
|
|
79
|
-
}
|
|
80
|
-
catch (err) {
|
|
81
|
-
spinner.fail();
|
|
82
|
-
throw err;
|
|
83
|
-
}
|
|
74
|
+
await this.copyToOutputDirAsync(path_1.default.join(tmpWorkingdir, 'build'), outputDirectory);
|
|
84
75
|
}
|
|
85
76
|
}
|
|
86
77
|
}
|
|
@@ -95,35 +86,51 @@ class BuildInspect extends EasCommand_1.default {
|
|
|
95
86
|
}
|
|
96
87
|
await fs_extra_1.default.mkdirp(outputDir);
|
|
97
88
|
}
|
|
89
|
+
async copyToOutputDirAsync(src, dst) {
|
|
90
|
+
const spinner = (0, ora_1.ora)().start(`Copying project directory to ${dst}`);
|
|
91
|
+
try {
|
|
92
|
+
if (await fs_extra_1.default.pathExists(src)) {
|
|
93
|
+
await fs_extra_1.default.copy(src, dst);
|
|
94
|
+
}
|
|
95
|
+
await fs_extra_1.default.remove(src);
|
|
96
|
+
spinner.succeed(`Project directory saved to ${dst}`);
|
|
97
|
+
}
|
|
98
|
+
catch (err) {
|
|
99
|
+
spinner.fail();
|
|
100
|
+
throw err;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
98
103
|
}
|
|
99
104
|
exports.default = BuildInspect;
|
|
100
105
|
BuildInspect.description = 'Inspect the state of the project at specific build stages. Useful for troubleshooting.';
|
|
101
106
|
BuildInspect.flags = {
|
|
102
|
-
platform:
|
|
107
|
+
platform: core_1.Flags.enum({
|
|
103
108
|
char: 'p',
|
|
104
109
|
options: [platform_1.RequestedPlatform.Android, platform_1.RequestedPlatform.Ios],
|
|
105
110
|
required: true,
|
|
106
111
|
}),
|
|
107
|
-
profile:
|
|
112
|
+
profile: core_1.Flags.string({
|
|
108
113
|
description: 'Name of the build profile from eas.json. Defaults to "production" if defined in eas.json.',
|
|
109
114
|
helpValue: 'PROFILE_NAME',
|
|
110
115
|
}),
|
|
111
|
-
stage:
|
|
116
|
+
stage: core_1.Flags.enum({
|
|
112
117
|
char: 's',
|
|
113
118
|
description: STAGE_DESCRIPTION,
|
|
114
119
|
options: [InspectStage.ARCHIVE, InspectStage.PRE_BUILD, InspectStage.POST_BUILD],
|
|
115
120
|
required: true,
|
|
116
121
|
}),
|
|
117
|
-
output:
|
|
122
|
+
output: core_1.Flags.string({
|
|
123
|
+
char: 'o',
|
|
118
124
|
description: 'Output directory.',
|
|
119
125
|
required: true,
|
|
120
126
|
helpValue: 'OUTPUT_DIRECTORY',
|
|
121
127
|
}),
|
|
122
|
-
force:
|
|
128
|
+
force: core_1.Flags.boolean({
|
|
123
129
|
description: 'Delete OUTPUT_DIRECTORY if it already exists.',
|
|
124
130
|
default: false,
|
|
125
131
|
}),
|
|
126
|
-
verbose:
|
|
132
|
+
verbose: core_1.Flags.boolean({
|
|
133
|
+
char: 'v',
|
|
127
134
|
default: false,
|
|
128
135
|
}),
|
|
129
136
|
};
|
|
@@ -1,23 +1,22 @@
|
|
|
1
|
-
import { flags } from '@oclif/command';
|
|
2
1
|
import { BuildDistributionType, BuildStatus } from '../../build/types';
|
|
3
2
|
import EasCommand from '../../commandUtils/EasCommand';
|
|
4
3
|
import { RequestedPlatform } from '../../platform';
|
|
5
4
|
export default class BuildList extends EasCommand {
|
|
6
5
|
static description: string;
|
|
7
6
|
static flags: {
|
|
8
|
-
platform:
|
|
9
|
-
json: import("@oclif/
|
|
10
|
-
status:
|
|
11
|
-
distribution:
|
|
12
|
-
channel:
|
|
13
|
-
appVersion:
|
|
14
|
-
appBuildVersion:
|
|
15
|
-
sdkVersion:
|
|
16
|
-
runtimeVersion:
|
|
17
|
-
appIdentifier:
|
|
18
|
-
buildProfile:
|
|
19
|
-
gitCommitHash:
|
|
20
|
-
limit: import("@oclif/
|
|
7
|
+
platform: import("@oclif/core/lib/interfaces").OptionFlag<RequestedPlatform>;
|
|
8
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
9
|
+
status: import("@oclif/core/lib/interfaces").OptionFlag<BuildStatus>;
|
|
10
|
+
distribution: import("@oclif/core/lib/interfaces").OptionFlag<BuildDistributionType>;
|
|
11
|
+
channel: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
12
|
+
appVersion: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
13
|
+
appBuildVersion: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
14
|
+
sdkVersion: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
15
|
+
runtimeVersion: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
16
|
+
appIdentifier: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
17
|
+
buildProfile: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
18
|
+
gitCommitHash: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
19
|
+
limit: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined>;
|
|
21
20
|
};
|
|
22
21
|
runAsync(): Promise<void>;
|
|
23
22
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const config_1 = require("@expo/config");
|
|
5
|
-
const
|
|
5
|
+
const core_1 = require("@oclif/core");
|
|
6
6
|
const chalk_1 = (0, tslib_1.__importDefault)(require("chalk"));
|
|
7
7
|
const types_1 = require("../../build/types");
|
|
8
8
|
const formatBuild_1 = require("../../build/utils/formatBuild");
|
|
@@ -16,7 +16,7 @@ const projectUtils_1 = require("../../project/projectUtils");
|
|
|
16
16
|
const json_1 = require("../../utils/json");
|
|
17
17
|
class BuildList extends EasCommand_1.default {
|
|
18
18
|
async runAsync() {
|
|
19
|
-
const { flags } = this.parse(BuildList);
|
|
19
|
+
const { flags } = await this.parse(BuildList);
|
|
20
20
|
const { json, platform: requestedPlatform, status: buildStatus, distribution: buildDistribution, limit = 10, } = flags;
|
|
21
21
|
if (json) {
|
|
22
22
|
(0, json_1.enableJsonOutput)();
|
|
@@ -76,13 +76,13 @@ class BuildList extends EasCommand_1.default {
|
|
|
76
76
|
exports.default = BuildList;
|
|
77
77
|
BuildList.description = 'list all builds for your project';
|
|
78
78
|
BuildList.flags = {
|
|
79
|
-
platform:
|
|
79
|
+
platform: core_1.Flags.enum({
|
|
80
80
|
options: [platform_1.RequestedPlatform.All, platform_1.RequestedPlatform.Android, platform_1.RequestedPlatform.Ios],
|
|
81
81
|
}),
|
|
82
|
-
json:
|
|
82
|
+
json: core_1.Flags.boolean({
|
|
83
83
|
description: 'Enable JSON output, non-JSON messages will be printed to stderr',
|
|
84
84
|
}),
|
|
85
|
-
status:
|
|
85
|
+
status: core_1.Flags.enum({
|
|
86
86
|
options: [
|
|
87
87
|
types_1.BuildStatus.NEW,
|
|
88
88
|
types_1.BuildStatus.IN_QUEUE,
|
|
@@ -92,22 +92,22 @@ BuildList.flags = {
|
|
|
92
92
|
types_1.BuildStatus.CANCELED,
|
|
93
93
|
],
|
|
94
94
|
}),
|
|
95
|
-
distribution:
|
|
95
|
+
distribution: core_1.Flags.enum({
|
|
96
96
|
options: [
|
|
97
97
|
types_1.BuildDistributionType.STORE,
|
|
98
98
|
types_1.BuildDistributionType.INTERNAL,
|
|
99
99
|
types_1.BuildDistributionType.SIMULATOR,
|
|
100
100
|
],
|
|
101
101
|
}),
|
|
102
|
-
channel:
|
|
103
|
-
appVersion:
|
|
104
|
-
appBuildVersion:
|
|
105
|
-
sdkVersion:
|
|
106
|
-
runtimeVersion:
|
|
107
|
-
appIdentifier:
|
|
108
|
-
buildProfile:
|
|
109
|
-
gitCommitHash:
|
|
110
|
-
limit:
|
|
102
|
+
channel: core_1.Flags.string(),
|
|
103
|
+
appVersion: core_1.Flags.string(),
|
|
104
|
+
appBuildVersion: core_1.Flags.string(),
|
|
105
|
+
sdkVersion: core_1.Flags.string(),
|
|
106
|
+
runtimeVersion: core_1.Flags.string(),
|
|
107
|
+
appIdentifier: core_1.Flags.string(),
|
|
108
|
+
buildProfile: core_1.Flags.string(),
|
|
109
|
+
gitCommitHash: core_1.Flags.string(),
|
|
110
|
+
limit: core_1.Flags.integer(),
|
|
111
111
|
};
|
|
112
112
|
const toAppPlatform = (requestedPlatform) => {
|
|
113
113
|
if (!requestedPlatform || requestedPlatform === platform_1.RequestedPlatform.All) {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const config_1 = require("@expo/config");
|
|
5
|
-
const
|
|
5
|
+
const core_1 = require("@oclif/core");
|
|
6
6
|
const formatBuild_1 = require("../../build/utils/formatBuild");
|
|
7
7
|
const EasCommand_1 = (0, tslib_1.__importDefault)(require("../../commandUtils/EasCommand"));
|
|
8
8
|
const BuildQuery_1 = require("../../graphql/queries/BuildQuery");
|
|
@@ -12,7 +12,7 @@ const projectUtils_1 = require("../../project/projectUtils");
|
|
|
12
12
|
const json_1 = require("../../utils/json");
|
|
13
13
|
class BuildView extends EasCommand_1.default {
|
|
14
14
|
async runAsync() {
|
|
15
|
-
const { args: { BUILD_ID: buildId }, flags, } = this.parse(BuildView);
|
|
15
|
+
const { args: { BUILD_ID: buildId }, flags, } = await this.parse(BuildView);
|
|
16
16
|
if (flags.json) {
|
|
17
17
|
(0, json_1.enableJsonOutput)();
|
|
18
18
|
}
|
|
@@ -62,7 +62,7 @@ exports.default = BuildView;
|
|
|
62
62
|
BuildView.description = 'view a build for your project';
|
|
63
63
|
BuildView.args = [{ name: 'BUILD_ID' }];
|
|
64
64
|
BuildView.flags = {
|
|
65
|
-
json:
|
|
65
|
+
json: core_1.Flags.boolean({
|
|
66
66
|
description: 'Enable JSON output, non-JSON messages will be printed to stderr',
|
|
67
67
|
}),
|
|
68
68
|
};
|
|
@@ -6,7 +6,6 @@ export declare function createUpdateChannelOnAppAsync({ appId, channelName, bran
|
|
|
6
6
|
branchId: string;
|
|
7
7
|
}): Promise<CreateUpdateChannelOnAppMutation>;
|
|
8
8
|
export default class ChannelCreate extends EasCommand {
|
|
9
|
-
static hidden: boolean;
|
|
10
9
|
static description: string;
|
|
11
10
|
static args: {
|
|
12
11
|
name: string;
|
|
@@ -14,7 +13,7 @@ export default class ChannelCreate extends EasCommand {
|
|
|
14
13
|
description: string;
|
|
15
14
|
}[];
|
|
16
15
|
static flags: {
|
|
17
|
-
json: import("@oclif/
|
|
16
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
18
17
|
};
|
|
19
18
|
runAsync(): Promise<void>;
|
|
20
19
|
}
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.createUpdateChannelOnAppAsync = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const config_1 = require("@expo/config");
|
|
6
|
-
const
|
|
6
|
+
const core_1 = require("@oclif/core");
|
|
7
7
|
const chalk_1 = (0, tslib_1.__importDefault)(require("chalk"));
|
|
8
8
|
const graphql_tag_1 = (0, tslib_1.__importDefault)(require("graphql-tag"));
|
|
9
9
|
const EasCommand_1 = (0, tslib_1.__importDefault)(require("../../commandUtils/EasCommand"));
|
|
@@ -12,6 +12,7 @@ const log_1 = (0, tslib_1.__importDefault)(require("../../log"));
|
|
|
12
12
|
const projectUtils_1 = require("../../project/projectUtils");
|
|
13
13
|
const prompts_1 = require("../../prompts");
|
|
14
14
|
const formatFields_1 = (0, tslib_1.__importDefault)(require("../../utils/formatFields"));
|
|
15
|
+
const json_1 = require("../../utils/json");
|
|
15
16
|
const create_1 = require("../branch/create");
|
|
16
17
|
async function createUpdateChannelOnAppAsync({ appId, channelName, branchId, }) {
|
|
17
18
|
// Point the new channel at a branch with its same name.
|
|
@@ -40,7 +41,10 @@ async function createUpdateChannelOnAppAsync({ appId, channelName, branchId, })
|
|
|
40
41
|
exports.createUpdateChannelOnAppAsync = createUpdateChannelOnAppAsync;
|
|
41
42
|
class ChannelCreate extends EasCommand_1.default {
|
|
42
43
|
async runAsync() {
|
|
43
|
-
let { args: { name: channelName }, flags: { json: jsonFlag }, } = this.parse(ChannelCreate);
|
|
44
|
+
let { args: { name: channelName }, flags: { json: jsonFlag }, } = await this.parse(ChannelCreate);
|
|
45
|
+
if (jsonFlag) {
|
|
46
|
+
(0, json_1.enableJsonOutput)();
|
|
47
|
+
}
|
|
44
48
|
const projectDir = await (0, projectUtils_1.findProjectRootAsync)();
|
|
45
49
|
const { exp } = (0, config_1.getConfig)(projectDir, { skipSDKVersionRequirement: true });
|
|
46
50
|
const projectId = await (0, projectUtils_1.getProjectIdAsync)(exp);
|
|
@@ -83,27 +87,27 @@ class ChannelCreate extends EasCommand_1.default {
|
|
|
83
87
|
throw new Error(`Could not create channel with name ${channelName} on app with id ${projectId}`);
|
|
84
88
|
}
|
|
85
89
|
if (jsonFlag) {
|
|
86
|
-
|
|
87
|
-
|
|
90
|
+
(0, json_1.printJsonOnlyOutput)(newChannel);
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
log_1.default.addNewLineIfNone();
|
|
94
|
+
log_1.default.withTick(`Created a new channel on project ${chalk_1.default.bold(await (0, projectUtils_1.getProjectFullNameAsync)(exp))}`);
|
|
95
|
+
log_1.default.log((0, formatFields_1.default)([
|
|
96
|
+
{ label: 'Name', value: newChannel.name },
|
|
97
|
+
{ label: 'ID', value: newChannel.id },
|
|
98
|
+
]));
|
|
99
|
+
log_1.default.addNewLineIfNone();
|
|
100
|
+
log_1.default.withTick(`${branchMessage} and have pointed the channel at it.`);
|
|
101
|
+
log_1.default.log((0, formatFields_1.default)([
|
|
102
|
+
{ label: 'Name', value: newChannel.name },
|
|
103
|
+
{ label: 'ID', value: branchId },
|
|
104
|
+
]));
|
|
105
|
+
log_1.default.addNewLineIfNone();
|
|
106
|
+
log_1.default.log(chalk_1.default.bold('You can now update your app by publishing!'));
|
|
88
107
|
}
|
|
89
|
-
log_1.default.addNewLineIfNone();
|
|
90
|
-
log_1.default.withTick(`Created a new channel on project ${chalk_1.default.bold(await (0, projectUtils_1.getProjectFullNameAsync)(exp))}`);
|
|
91
|
-
log_1.default.log((0, formatFields_1.default)([
|
|
92
|
-
{ label: 'Name', value: newChannel.name },
|
|
93
|
-
{ label: 'ID', value: newChannel.id },
|
|
94
|
-
]));
|
|
95
|
-
log_1.default.addNewLineIfNone();
|
|
96
|
-
log_1.default.withTick(`${branchMessage} and have pointed the channel at it.`);
|
|
97
|
-
log_1.default.log((0, formatFields_1.default)([
|
|
98
|
-
{ label: 'Name', value: newChannel.name },
|
|
99
|
-
{ label: 'ID', value: branchId },
|
|
100
|
-
]));
|
|
101
|
-
log_1.default.addNewLineIfNone();
|
|
102
|
-
log_1.default.log(chalk_1.default.bold('You can now update your app by publishing!'));
|
|
103
108
|
}
|
|
104
109
|
}
|
|
105
110
|
exports.default = ChannelCreate;
|
|
106
|
-
ChannelCreate.hidden = true;
|
|
107
111
|
ChannelCreate.description = 'Create a channel on the current project.';
|
|
108
112
|
ChannelCreate.args = [
|
|
109
113
|
{
|
|
@@ -113,7 +117,7 @@ ChannelCreate.args = [
|
|
|
113
117
|
},
|
|
114
118
|
];
|
|
115
119
|
ChannelCreate.flags = {
|
|
116
|
-
json:
|
|
120
|
+
json: core_1.Flags.boolean({
|
|
117
121
|
description: 'print output as a JSON object with the new channel ID, name and branch mapping.',
|
|
118
122
|
default: false,
|
|
119
123
|
}),
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import EasCommand from '../../commandUtils/EasCommand';
|
|
2
|
+
export default class ChannelDelete extends EasCommand {
|
|
3
|
+
static hidden: boolean;
|
|
4
|
+
static description: string;
|
|
5
|
+
static args: {
|
|
6
|
+
name: string;
|
|
7
|
+
required: boolean;
|
|
8
|
+
description: string;
|
|
9
|
+
}[];
|
|
10
|
+
static flags: {
|
|
11
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
12
|
+
'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
13
|
+
};
|
|
14
|
+
runAsync(): Promise<void>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const config_1 = require("@expo/config");
|
|
5
|
+
const core_1 = require("@oclif/core");
|
|
6
|
+
const graphql_tag_1 = (0, tslib_1.__importDefault)(require("graphql-tag"));
|
|
7
|
+
const EasCommand_1 = (0, tslib_1.__importDefault)(require("../../commandUtils/EasCommand"));
|
|
8
|
+
const client_1 = require("../../graphql/client");
|
|
9
|
+
const log_1 = (0, tslib_1.__importDefault)(require("../../log"));
|
|
10
|
+
const projectUtils_1 = require("../../project/projectUtils");
|
|
11
|
+
const prompts_1 = require("../../prompts");
|
|
12
|
+
const json_1 = require("../../utils/json");
|
|
13
|
+
class ChannelDelete extends EasCommand_1.default {
|
|
14
|
+
async runAsync() {
|
|
15
|
+
var _a, _b;
|
|
16
|
+
const { args: { name: nameArg }, flags: { json: jsonFlag, 'non-interactive': nonInteractiveFlag }, } = await this.parse(ChannelDelete);
|
|
17
|
+
if (jsonFlag && !nonInteractiveFlag) {
|
|
18
|
+
throw new Error('--json is allowed only in non-interactive mode');
|
|
19
|
+
}
|
|
20
|
+
if (jsonFlag) {
|
|
21
|
+
(0, json_1.enableJsonOutput)();
|
|
22
|
+
}
|
|
23
|
+
const projectDir = await (0, projectUtils_1.findProjectRootAsync)();
|
|
24
|
+
const { exp } = (0, config_1.getConfig)(projectDir, { skipSDKVersionRequirement: true });
|
|
25
|
+
const fullName = await (0, projectUtils_1.getProjectFullNameAsync)(exp);
|
|
26
|
+
const projectId = await (0, projectUtils_1.getProjectIdAsync)(exp);
|
|
27
|
+
let name;
|
|
28
|
+
if (nameArg) {
|
|
29
|
+
name = nameArg;
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
if (nonInteractiveFlag) {
|
|
33
|
+
throw new Error('Channel name must be set when running in non-interactive mode');
|
|
34
|
+
}
|
|
35
|
+
name = (await (0, prompts_1.promptAsync)({
|
|
36
|
+
type: 'text',
|
|
37
|
+
name: 'name',
|
|
38
|
+
message: 'Please enter the name of the channel to delete:',
|
|
39
|
+
validate: (value) => (value ? true : 'Channel name may not be empty.'),
|
|
40
|
+
})).name;
|
|
41
|
+
}
|
|
42
|
+
const data = await getChannelInfoAsync({ appId: projectId, name });
|
|
43
|
+
const channelId = (_b = (_a = data.app) === null || _a === void 0 ? void 0 : _a.byId.updateChannelByName) === null || _b === void 0 ? void 0 : _b.id;
|
|
44
|
+
if (!channelId) {
|
|
45
|
+
throw new Error(`Could not find channel ${name} on ${fullName}`);
|
|
46
|
+
}
|
|
47
|
+
if (!nonInteractiveFlag) {
|
|
48
|
+
log_1.default.addNewLineIfNone();
|
|
49
|
+
log_1.default.warn(`You are about to permamently delete channel: "${name}".\nThis action is irreversible.`);
|
|
50
|
+
log_1.default.newLine();
|
|
51
|
+
const confirmed = await (0, prompts_1.toggleConfirmAsync)({ message: 'Are you sure you wish to proceed?' });
|
|
52
|
+
if (!confirmed) {
|
|
53
|
+
log_1.default.error(`Canceled deletion of channel: "${name}".`);
|
|
54
|
+
process.exit(1);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
const deletionResult = await deleteChannelOnAppAsync({
|
|
58
|
+
channelId,
|
|
59
|
+
});
|
|
60
|
+
if (jsonFlag) {
|
|
61
|
+
(0, json_1.printJsonOnlyOutput)(deletionResult);
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
log_1.default.withTick(`️Deleted channel "${name}".`);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
exports.default = ChannelDelete;
|
|
69
|
+
ChannelDelete.hidden = true;
|
|
70
|
+
ChannelDelete.description = 'Delete a channel on the current project';
|
|
71
|
+
ChannelDelete.args = [
|
|
72
|
+
{
|
|
73
|
+
name: 'name',
|
|
74
|
+
required: false,
|
|
75
|
+
description: 'Name of the channel to delete',
|
|
76
|
+
},
|
|
77
|
+
];
|
|
78
|
+
ChannelDelete.flags = {
|
|
79
|
+
json: core_1.Flags.boolean({
|
|
80
|
+
description: `Delete a channel on the current project`,
|
|
81
|
+
default: false,
|
|
82
|
+
}),
|
|
83
|
+
'non-interactive': core_1.Flags.boolean({
|
|
84
|
+
default: false,
|
|
85
|
+
description: 'Run command in non-interactive mode',
|
|
86
|
+
}),
|
|
87
|
+
};
|
|
88
|
+
async function getChannelInfoAsync({ appId, name, }) {
|
|
89
|
+
const data = await (0, client_1.withErrorHandlingAsync)(client_1.graphqlClient
|
|
90
|
+
.query((0, graphql_tag_1.default) `
|
|
91
|
+
query GetChannelInfo($appId: String!, $name: String!) {
|
|
92
|
+
app {
|
|
93
|
+
byId(appId: $appId) {
|
|
94
|
+
id
|
|
95
|
+
updateChannelByName(name: $name) {
|
|
96
|
+
id
|
|
97
|
+
name
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
`, {
|
|
103
|
+
appId,
|
|
104
|
+
name,
|
|
105
|
+
}, { additionalTypenames: ['UpdateChannel'] })
|
|
106
|
+
.toPromise());
|
|
107
|
+
return data;
|
|
108
|
+
}
|
|
109
|
+
async function deleteChannelOnAppAsync({ channelId, }) {
|
|
110
|
+
const data = await (0, client_1.withErrorHandlingAsync)(client_1.graphqlClient
|
|
111
|
+
.mutation((0, graphql_tag_1.default) `
|
|
112
|
+
mutation DeleteUpdateChannel($channelId: ID!) {
|
|
113
|
+
updateChannel {
|
|
114
|
+
deleteUpdateChannel(channelId: $channelId) {
|
|
115
|
+
id
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
`, {
|
|
120
|
+
channelId,
|
|
121
|
+
})
|
|
122
|
+
.toPromise());
|
|
123
|
+
return data.updateChannel.deleteUpdateChannel;
|
|
124
|
+
}
|