eas-cli 2.1.0 → 2.2.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 +6 -1047
- package/build/branch/queries.d.ts +10 -2
- package/build/branch/queries.js +30 -30
- package/build/branch/utils.d.ts +4 -0
- package/build/branch/utils.js +15 -0
- package/build/build/android/build.js +3 -3
- package/build/build/android/prepareJob.js +1 -2
- package/build/build/android/syncProjectConfiguration.d.ts +2 -1
- package/build/build/android/syncProjectConfiguration.js +2 -2
- package/build/build/build.js +15 -4
- package/build/build/configure.js +2 -2
- package/build/build/createContext.d.ts +5 -1
- package/build/build/createContext.js +8 -14
- package/build/build/ios/build.js +2 -1
- package/build/build/ios/credentials.js +1 -1
- package/build/build/ios/prepareJob.js +1 -2
- package/build/build/ios/syncProjectConfiguration.d.ts +2 -1
- package/build/build/ios/syncProjectConfiguration.js +2 -2
- package/build/build/local.js +1 -1
- package/build/build/metadata.js +1 -2
- package/build/build/queries.d.ts +9 -0
- package/build/build/queries.js +51 -0
- package/build/build/runBuildAndSubmit.d.ts +3 -1
- package/build/build/runBuildAndSubmit.js +15 -7
- package/build/build/utils/repository.js +5 -1
- package/build/channel/queries.d.ts +17 -0
- package/build/channel/queries.js +137 -0
- package/build/channel/utils.d.ts +22 -0
- package/build/channel/utils.js +87 -0
- package/build/commandUtils/EasCommand.d.ts +68 -7
- package/build/commandUtils/EasCommand.js +60 -79
- package/build/commandUtils/context/ActorContextField.d.ts +5 -0
- package/build/commandUtils/context/ActorContextField.js +11 -0
- package/build/commandUtils/context/ContextField.d.ts +6 -0
- package/build/commandUtils/context/ContextField.js +5 -0
- package/build/commandUtils/context/DynamicProjectConfigContextField.d.ts +11 -0
- package/build/commandUtils/context/DynamicProjectConfigContextField.js +27 -0
- package/build/commandUtils/context/OptionalProjectConfigContextField.d.ts +13 -0
- package/build/commandUtils/context/OptionalProjectConfigContextField.js +37 -0
- package/build/commandUtils/context/ProjectConfigContextField.d.ts +13 -0
- package/build/commandUtils/context/ProjectConfigContextField.js +23 -0
- package/build/commandUtils/context/ProjectDirContextField.d.ts +4 -0
- package/build/commandUtils/context/ProjectDirContextField.js +11 -0
- package/build/commandUtils/context/contextUtils/ensureLoggedInAsync.d.ts +21 -0
- package/build/commandUtils/context/contextUtils/ensureLoggedInAsync.js +75 -0
- package/build/commandUtils/context/contextUtils/findProjectDirAndVerifyProjectSetupAsync.d.ts +17 -0
- package/build/commandUtils/context/contextUtils/findProjectDirAndVerifyProjectSetupAsync.js +102 -0
- package/build/commandUtils/context/contextUtils/getProjectIdAsync.d.ts +24 -0
- package/build/commandUtils/context/contextUtils/getProjectIdAsync.js +108 -0
- package/build/commandUtils/flags.d.ts +10 -0
- package/build/commandUtils/flags.js +23 -0
- package/build/commandUtils/pagination.d.ts +7 -4
- package/build/commandUtils/pagination.js +11 -15
- package/build/commands/account/login.d.ts +0 -2
- package/build/commands/account/login.js +2 -7
- package/build/commands/account/logout.d.ts +0 -2
- package/build/commands/account/logout.js +0 -5
- package/build/commands/account/view.d.ts +0 -2
- package/build/commands/account/view.js +0 -5
- package/build/commands/analytics.d.ts +0 -1
- package/build/commands/analytics.js +0 -4
- package/build/commands/branch/create.d.ts +4 -0
- package/build/commands/branch/create.js +18 -18
- package/build/commands/branch/delete.d.ts +4 -0
- package/build/commands/branch/delete.js +29 -26
- package/build/commands/branch/list.d.ts +5 -2
- package/build/commands/branch/list.js +13 -8
- package/build/commands/branch/rename.d.ts +5 -1
- package/build/commands/branch/rename.js +15 -13
- package/build/commands/branch/view.d.ts +5 -2
- package/build/commands/branch/view.js +31 -13
- package/build/commands/build/cancel.d.ts +7 -0
- package/build/commands/build/cancel.js +50 -23
- package/build/commands/build/configure.d.ts +3 -0
- package/build/commands/build/configure.js +12 -7
- package/build/commands/build/index.d.ts +7 -2
- package/build/commands/build/index.js +31 -23
- package/build/commands/build/inspect.d.ts +5 -0
- package/build/commands/build/inspect.js +12 -3
- package/build/commands/build/list.d.ts +7 -2
- package/build/commands/build/list.js +36 -59
- package/build/commands/build/version/set.d.ts +5 -0
- package/build/commands/build/version/set.js +22 -14
- package/build/commands/build/version/sync.d.ts +5 -0
- package/build/commands/build/version/sync.js +22 -13
- package/build/commands/build/view.d.ts +3 -0
- package/build/commands/build/view.js +20 -14
- package/build/commands/channel/create.d.ts +4 -0
- package/build/commands/channel/create.js +32 -25
- package/build/commands/channel/delete.d.ts +3 -0
- package/build/commands/channel/delete.js +36 -59
- package/build/commands/channel/edit.d.ts +7 -7
- package/build/commands/channel/edit.js +39 -72
- package/build/commands/channel/list.d.ts +6 -0
- package/build/commands/channel/list.js +20 -76
- package/build/commands/channel/rollout.d.ts +5 -1
- package/build/commands/channel/rollout.js +34 -35
- package/build/commands/channel/view.d.ts +6 -33
- package/build/commands/channel/view.js +31 -132
- package/build/commands/config.d.ts +6 -2
- package/build/commands/config.js +22 -13
- package/build/commands/credentials.d.ts +4 -0
- package/build/commands/credentials.js +10 -1
- package/build/commands/device/create.d.ts +4 -0
- package/build/commands/device/create.js +15 -3
- package/build/commands/device/delete.d.ts +13 -8
- package/build/commands/device/delete.js +81 -130
- package/build/commands/device/list.d.ts +7 -0
- package/build/commands/device/list.js +42 -63
- package/build/commands/device/view.d.ts +3 -0
- package/build/commands/device/view.js +10 -5
- package/build/commands/diagnostics.d.ts +3 -1
- package/build/commands/diagnostics.js +10 -8
- package/build/commands/metadata/pull.d.ts +4 -0
- package/build/commands/metadata/pull.js +13 -8
- package/build/commands/metadata/push.d.ts +4 -0
- package/build/commands/metadata/push.js +13 -8
- package/build/commands/open.d.ts +3 -0
- package/build/commands/open.js +11 -9
- package/build/commands/project/info.d.ts +3 -0
- package/build/commands/project/info.js +9 -6
- package/build/commands/project/init.d.ts +12 -0
- package/build/commands/project/init.js +155 -8
- package/build/commands/secret/create.d.ts +6 -0
- package/build/commands/secret/create.js +87 -30
- package/build/commands/secret/delete.d.ts +4 -0
- package/build/commands/secret/delete.js +28 -19
- package/build/commands/secret/list.d.ts +3 -0
- package/build/commands/secret/list.js +19 -13
- package/build/commands/submit.d.ts +5 -0
- package/build/commands/submit.js +16 -7
- package/build/commands/update/configure.d.ts +3 -0
- package/build/commands/update/configure.js +22 -16
- package/build/commands/update/delete.d.ts +1 -0
- package/build/commands/update/delete.js +4 -7
- package/build/commands/update/index.d.ts +8 -12
- package/build/commands/update/index.js +90 -166
- package/build/commands/update/list.d.ts +8 -2
- package/build/commands/update/list.js +51 -81
- package/build/commands/update/view.d.ts +0 -4
- package/build/commands/update/view.js +14 -51
- package/build/commands/webhook/create.d.ts +4 -0
- package/build/commands/webhook/create.js +10 -5
- package/build/commands/webhook/delete.d.ts +6 -0
- package/build/commands/webhook/delete.js +26 -14
- package/build/commands/webhook/list.d.ts +3 -0
- package/build/commands/webhook/list.js +13 -9
- package/build/commands/webhook/update.d.ts +1 -0
- package/build/commands/webhook/update.js +3 -1
- package/build/credentials/android/actions/BuildCredentialsUtils.js +2 -6
- package/build/credentials/android/actions/CreateFcm.d.ts +2 -3
- package/build/credentials/android/actions/CreateGoogleServiceAccountKey.d.ts +2 -3
- package/build/credentials/android/actions/CreateKeystore.d.ts +2 -3
- package/build/credentials/android/actions/CreateKeystore.js +1 -2
- package/build/credentials/android/actions/RemoveGoogleServiceAccountKey.d.ts +2 -3
- package/build/credentials/android/actions/UseExistingGoogleServiceAccountKey.d.ts +2 -3
- package/build/credentials/android/api/GraphqlClient.d.ts +6 -7
- package/build/credentials/context.d.ts +8 -4
- package/build/credentials/context.js +8 -23
- package/build/credentials/ios/IosCredentialsProvider.js +11 -6
- package/build/credentials/ios/actions/AppleTeamFormatting.d.ts +2 -0
- package/build/credentials/ios/actions/AppleTeamFormatting.js +7 -0
- package/build/credentials/ios/actions/AppleTeamUtils.d.ts +1 -2
- package/build/credentials/ios/actions/AppleTeamUtils.js +1 -5
- package/build/credentials/ios/actions/AscApiKeyUtils.d.ts +3 -4
- package/build/credentials/ios/actions/AscApiKeyUtils.js +2 -2
- package/build/credentials/ios/actions/AssignAscApiKey.d.ts +1 -1
- package/build/credentials/ios/actions/AssignPushKey.d.ts +1 -1
- package/build/credentials/ios/actions/BuildCredentialsUtils.d.ts +3 -3
- package/build/credentials/ios/actions/BuildCredentialsUtils.js +8 -12
- package/build/credentials/ios/actions/ConfigureProvisioningProfile.d.ts +1 -1
- package/build/credentials/ios/actions/CreateAscApiKey.d.ts +2 -3
- package/build/credentials/ios/actions/CreateDistributionCertificate.d.ts +2 -2
- package/build/credentials/ios/actions/CreateProvisioningProfile.d.ts +1 -1
- package/build/credentials/ios/actions/CreatePushKey.d.ts +2 -3
- package/build/credentials/ios/actions/DeviceUtils.d.ts +0 -1
- package/build/credentials/ios/actions/DeviceUtils.js +3 -19
- package/build/credentials/ios/actions/DistributionCertificateUtils.d.ts +3 -4
- package/build/credentials/ios/actions/DistributionCertificateUtils.js +2 -2
- package/build/credentials/ios/actions/PushKeyUtils.d.ts +2 -3
- package/build/credentials/ios/actions/PushKeyUtils.js +2 -2
- package/build/credentials/ios/actions/RemoveAscApiKey.d.ts +2 -3
- package/build/credentials/ios/actions/RemoveDistributionCertificate.d.ts +3 -4
- package/build/credentials/ios/actions/RemoveProvisioningProfile.d.ts +1 -1
- package/build/credentials/ios/actions/RemovePushKey.d.ts +2 -3
- package/build/credentials/ios/actions/SetUpAdhocProvisioningProfile.d.ts +1 -1
- package/build/credentials/ios/actions/SetUpAscApiKey.d.ts +1 -1
- package/build/credentials/ios/actions/SetUpDistributionCertificate.d.ts +1 -1
- package/build/credentials/ios/actions/SetUpInternalProvisioningProfile.d.ts +1 -1
- package/build/credentials/ios/actions/SetUpProvisioningProfile.d.ts +1 -1
- package/build/credentials/ios/actions/SetUpPushKey.d.ts +1 -1
- package/build/credentials/ios/actions/SetUpSubmissionCredentials.d.ts +1 -1
- package/build/credentials/ios/actions/SetUpTargetBuildCredentials.d.ts +1 -1
- package/build/credentials/ios/actions/SetUpTargetBuildCredentialsFromCredentialsJson.d.ts +1 -1
- package/build/credentials/ios/api/GraphqlClient.d.ts +9 -15
- package/build/credentials/ios/api/graphql/mutations/AppleTeamMutation.d.ts +2 -3
- package/build/credentials/ios/api/graphql/mutations/AppleTeamMutation.js +3 -1
- package/build/credentials/ios/api/graphql/queries/AppleDeviceQuery.d.ts +3 -3
- package/build/credentials/ios/api/graphql/queries/AppleDeviceQuery.js +20 -6
- package/build/credentials/ios/api/graphql/queries/AppleTeamQuery.d.ts +2 -2
- package/build/credentials/ios/api/graphql/queries/AppleTeamQuery.js +8 -7
- package/build/credentials/ios/api/graphql/types/AppLookupParams.d.ts +7 -0
- package/build/credentials/ios/api/graphql/types/AppLookupParams.js +2 -0
- package/build/credentials/ios/types.d.ts +2 -3
- package/build/credentials/ios/utils/printCredentials.d.ts +1 -1
- package/build/credentials/ios/validators/validateProvisioningProfile.d.ts +1 -1
- package/build/credentials/manager/HelperActions.d.ts +4 -1
- package/build/credentials/manager/ManageAndroid.js +4 -14
- package/build/credentials/manager/ManageIos.js +12 -15
- package/build/credentials/manager/SelectBuildProfileFromEasJson.d.ts +1 -1
- package/build/credentials/manager/SelectBuildProfileFromEasJson.js +3 -3
- package/build/credentials/manager/SelectPlatform.d.ts +5 -1
- package/build/credentials/manager/SelectPlatform.js +5 -3
- package/build/devices/actions/create/action.d.ts +2 -3
- package/build/devices/context.d.ts +3 -5
- package/build/devices/context.js +2 -11
- package/build/devices/manager.d.ts +4 -5
- package/build/devices/manager.js +9 -16
- package/build/devices/queries.d.ts +21 -0
- package/build/devices/queries.js +121 -0
- package/build/devices/utils/errors.d.ts +3 -0
- package/build/devices/utils/errors.js +9 -0
- package/build/devices/utils/formatDevice.d.ts +3 -3
- package/build/devices/utils/formatDevice.js +8 -3
- package/build/graphql/generated.d.ts +1101 -191
- package/build/graphql/generated.js +13 -2
- package/build/graphql/mutations/EnvironmentSecretMutation.d.ts +3 -1
- package/build/graphql/queries/AppQuery.d.ts +1 -0
- package/build/graphql/queries/AppQuery.js +19 -0
- package/build/graphql/queries/BranchQuery.d.ts +5 -6
- package/build/graphql/queries/BranchQuery.js +44 -3
- package/build/graphql/queries/BuildQuery.d.ts +2 -20
- package/build/graphql/queries/BuildQuery.js +2 -2
- package/build/graphql/queries/ChannelQuery.d.ts +5 -2
- package/build/graphql/queries/ChannelQuery.js +45 -19
- package/build/graphql/queries/EnvironmentSecretsQuery.d.ts +5 -3
- package/build/graphql/queries/EnvironmentSecretsQuery.js +14 -28
- package/build/graphql/queries/UpdateQuery.d.ts +4 -6
- package/build/graphql/queries/UpdateQuery.js +59 -50
- package/build/graphql/queries/UserQuery.js +8 -1
- package/build/graphql/types/Account.d.ts +1 -0
- package/build/graphql/types/Account.js +17 -0
- package/build/graphql/types/App.js +7 -0
- package/build/graphql/types/EnvironmentSecret.d.ts +7 -0
- package/build/graphql/types/EnvironmentSecret.js +16 -1
- package/build/graphql/types/Update.d.ts +1 -0
- package/build/graphql/types/Update.js +30 -0
- package/build/graphql/types/UpdateBranch.js +4 -15
- package/build/metadata/context.d.ts +1 -1
- package/build/metadata/context.js +7 -9
- package/build/project/android/applicationId.d.ts +2 -1
- package/build/project/android/applicationId.js +7 -7
- package/build/project/android/versions.js +1 -1
- package/build/project/applicationIdentifier.d.ts +2 -1
- package/build/project/applicationIdentifier.js +2 -2
- package/build/project/expoConfig.d.ts +3 -3
- package/build/project/fetchOrCreateProjectIDForWriteToConfigWithConfirmationAsync.d.ts +22 -0
- package/build/project/fetchOrCreateProjectIDForWriteToConfigWithConfirmationAsync.js +93 -0
- package/build/project/ios/bundleIdentifier.d.ts +2 -1
- package/build/project/ios/bundleIdentifier.js +7 -7
- package/build/project/ios/scheme.d.ts +1 -1
- package/build/project/projectUtils.d.ts +4 -31
- package/build/project/projectUtils.js +13 -123
- package/build/project/remoteVersionSource.d.ts +2 -2
- package/build/project/remoteVersionSource.js +8 -7
- package/build/submit/android/ServiceAccountSource.js +1 -2
- package/build/submit/context.d.ts +3 -1
- package/build/submit/context.js +12 -14
- package/build/submit/ios/CredentialsServiceSource.js +1 -2
- package/build/submit/utils/builds.js +3 -1
- package/build/update/android/UpdatesModule.d.ts +1 -1
- package/build/update/android/UpdatesModule.js +2 -3
- package/build/update/ios/UpdatesModule.d.ts +1 -1
- package/build/update/ios/UpdatesModule.js +2 -3
- package/build/update/queries.d.ts +16 -1
- package/build/update/queries.js +96 -30
- package/build/update/utils.d.ts +21 -8
- package/build/update/utils.js +75 -14
- package/build/user/actions.d.ts +2 -8
- package/build/user/actions.js +4 -63
- package/build/utils/profiles.d.ts +3 -3
- package/build/utils/profiles.js +6 -5
- package/build/vcs/clients/git.d.ts +1 -1
- package/build/vcs/clients/git.js +1 -1
- package/build/vcs/vcs.d.ts +1 -1
- package/build/webhooks/input.d.ts +2 -1
- package/build/webhooks/input.js +10 -1
- package/oclif.manifest.json +1 -1
- package/package.json +4 -4
- package/build/project/ensureProjectExists.d.ts +0 -21
- package/build/project/ensureProjectExists.js +0 -88
- package/build/user/Account.d.ts +0 -3
- package/build/user/Account.js +0 -7
|
@@ -6,11 +6,6 @@ const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasComm
|
|
|
6
6
|
const log_1 = tslib_1.__importDefault(require("../../log"));
|
|
7
7
|
const User_1 = require("../../user/User");
|
|
8
8
|
class AccountView extends EasCommand_1.default {
|
|
9
|
-
constructor() {
|
|
10
|
-
super(...arguments);
|
|
11
|
-
this.mustBeRunInsideProject = false;
|
|
12
|
-
this.requiresAuthentication = false;
|
|
13
|
-
}
|
|
14
9
|
async runAsync() {
|
|
15
10
|
const user = await (0, User_1.getUserAsync)();
|
|
16
11
|
if (user) {
|
|
@@ -5,10 +5,6 @@ const EasCommand_1 = tslib_1.__importDefault(require("../commandUtils/EasCommand
|
|
|
5
5
|
const log_1 = tslib_1.__importDefault(require("../log"));
|
|
6
6
|
const UserSettings_1 = tslib_1.__importDefault(require("../user/UserSettings"));
|
|
7
7
|
class AnalyticsView extends EasCommand_1.default {
|
|
8
|
-
constructor() {
|
|
9
|
-
super(...arguments);
|
|
10
|
-
this.requiresAuthentication = false;
|
|
11
|
-
}
|
|
12
8
|
async runAsync() {
|
|
13
9
|
const { STATUS: status } = (await this.parse(AnalyticsView)).args;
|
|
14
10
|
if (status) {
|
|
@@ -10,6 +10,10 @@ export default class BranchCreate extends EasCommand {
|
|
|
10
10
|
}[];
|
|
11
11
|
static flags: {
|
|
12
12
|
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
13
|
+
'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
14
|
+
};
|
|
15
|
+
static contextDefinition: {
|
|
16
|
+
projectConfig: import("../../commandUtils/context/ProjectConfigContextField").default;
|
|
13
17
|
};
|
|
14
18
|
runAsync(): Promise<void>;
|
|
15
19
|
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var _a;
|
|
2
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
4
|
exports.createUpdateBranchOnAppAsync = void 0;
|
|
4
5
|
const tslib_1 = require("tslib");
|
|
5
|
-
const core_1 = require("@oclif/core");
|
|
6
6
|
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
7
7
|
const graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag"));
|
|
8
|
+
const utils_1 = require("../../branch/utils");
|
|
8
9
|
const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
|
|
10
|
+
const flags_1 = require("../../commandUtils/flags");
|
|
9
11
|
const client_1 = require("../../graphql/client");
|
|
10
12
|
const log_1 = tslib_1.__importDefault(require("../../log"));
|
|
11
|
-
const expoConfig_1 = require("../../project/expoConfig");
|
|
12
13
|
const projectUtils_1 = require("../../project/projectUtils");
|
|
13
14
|
const prompts_1 = require("../../prompts");
|
|
14
15
|
const json_1 = require("../../utils/json");
|
|
15
|
-
const vcs_1 = require("../../vcs");
|
|
16
16
|
async function createUpdateBranchOnAppAsync({ appId, name, }) {
|
|
17
17
|
const result = await (0, client_1.withErrorHandlingAsync)(client_1.graphqlClient
|
|
18
18
|
.mutation((0, graphql_tag_1.default) `
|
|
@@ -38,38 +38,38 @@ async function createUpdateBranchOnAppAsync({ appId, name, }) {
|
|
|
38
38
|
exports.createUpdateBranchOnAppAsync = createUpdateBranchOnAppAsync;
|
|
39
39
|
class BranchCreate extends EasCommand_1.default {
|
|
40
40
|
async runAsync() {
|
|
41
|
-
let { args: { name }, flags, } = await this.parse(BranchCreate);
|
|
42
|
-
|
|
41
|
+
let { args: { name }, flags: { json: jsonFlag, 'non-interactive': nonInteractive }, } = await this.parse(BranchCreate);
|
|
42
|
+
const { projectConfig: { projectId }, } = await this.getContextAsync(BranchCreate, {
|
|
43
|
+
nonInteractive,
|
|
44
|
+
});
|
|
45
|
+
if (jsonFlag) {
|
|
43
46
|
(0, json_1.enableJsonOutput)();
|
|
44
47
|
}
|
|
45
|
-
const
|
|
46
|
-
const exp = (0, expoConfig_1.getExpoConfig)(projectDir);
|
|
47
|
-
const fullName = await (0, projectUtils_1.getProjectFullNameAsync)(exp);
|
|
48
|
-
const projectId = await (0, projectUtils_1.getProjectIdAsync)(exp);
|
|
48
|
+
const projectDisplayName = await (0, projectUtils_1.getDisplayNameForProjectIdAsync)(projectId);
|
|
49
49
|
if (!name) {
|
|
50
50
|
const validationMessage = 'Branch name may not be empty.';
|
|
51
|
-
if (
|
|
51
|
+
if (nonInteractive) {
|
|
52
52
|
throw new Error(validationMessage);
|
|
53
53
|
}
|
|
54
54
|
({ name } = await (0, prompts_1.promptAsync)({
|
|
55
55
|
type: 'text',
|
|
56
56
|
name: 'name',
|
|
57
57
|
message: 'Provide a branch name:',
|
|
58
|
-
initial:
|
|
59
|
-
`branch-${Math.random().toString(36).substr(2, 4)}`,
|
|
58
|
+
initial: await (0, utils_1.getDefaultBranchNameAsync)(),
|
|
60
59
|
validate: value => (value ? true : validationMessage),
|
|
61
60
|
}));
|
|
62
61
|
}
|
|
63
62
|
const newBranch = await createUpdateBranchOnAppAsync({ appId: projectId, name });
|
|
64
|
-
if (
|
|
63
|
+
if (jsonFlag) {
|
|
65
64
|
(0, json_1.printJsonOnlyOutput)(newBranch);
|
|
66
65
|
}
|
|
67
66
|
else {
|
|
68
|
-
log_1.default.withTick(`️Created a new branch: ${chalk_1.default.bold(newBranch.name)} on project ${chalk_1.default.bold(
|
|
67
|
+
log_1.default.withTick(`️Created a new branch: ${chalk_1.default.bold(newBranch.name)} on project ${chalk_1.default.bold(projectDisplayName)}.`);
|
|
69
68
|
}
|
|
70
69
|
}
|
|
71
70
|
}
|
|
72
71
|
exports.default = BranchCreate;
|
|
72
|
+
_a = BranchCreate;
|
|
73
73
|
BranchCreate.description = 'create a branch';
|
|
74
74
|
BranchCreate.args = [
|
|
75
75
|
{
|
|
@@ -79,8 +79,8 @@ BranchCreate.args = [
|
|
|
79
79
|
},
|
|
80
80
|
];
|
|
81
81
|
BranchCreate.flags = {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
82
|
+
...flags_1.EasNonInteractiveAndJsonFlags,
|
|
83
|
+
};
|
|
84
|
+
BranchCreate.contextDefinition = {
|
|
85
|
+
..._a.ContextOptions.ProjectConfig,
|
|
86
86
|
};
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import EasCommand from '../../commandUtils/EasCommand';
|
|
2
2
|
export default class BranchDelete extends EasCommand {
|
|
3
3
|
static description: string;
|
|
4
|
+
static contextDefinition: {
|
|
5
|
+
projectConfig: import("../../commandUtils/context/ProjectConfigContextField").default;
|
|
6
|
+
};
|
|
4
7
|
static args: {
|
|
5
8
|
name: string;
|
|
6
9
|
required: boolean;
|
|
@@ -8,6 +11,7 @@ export default class BranchDelete extends EasCommand {
|
|
|
8
11
|
}[];
|
|
9
12
|
static flags: {
|
|
10
13
|
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
14
|
+
'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
11
15
|
};
|
|
12
16
|
runAsync(): Promise<void>;
|
|
13
17
|
}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var _a;
|
|
2
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
4
|
const tslib_1 = require("tslib");
|
|
4
|
-
const core_1 = require("@oclif/core");
|
|
5
5
|
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
6
6
|
const graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag"));
|
|
7
|
+
const queries_1 = require("../../branch/queries");
|
|
7
8
|
const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
|
|
9
|
+
const flags_1 = require("../../commandUtils/flags");
|
|
10
|
+
const pagination_1 = require("../../commandUtils/pagination");
|
|
8
11
|
const client_1 = require("../../graphql/client");
|
|
9
12
|
const log_1 = tslib_1.__importDefault(require("../../log"));
|
|
10
|
-
const expoConfig_1 = require("../../project/expoConfig");
|
|
11
13
|
const projectUtils_1 = require("../../project/projectUtils");
|
|
12
14
|
const prompts_1 = require("../../prompts");
|
|
13
15
|
const json_1 = require("../../utils/json");
|
|
@@ -50,40 +52,40 @@ async function deleteBranchOnAppAsync({ branchId, }) {
|
|
|
50
52
|
}
|
|
51
53
|
class BranchDelete extends EasCommand_1.default {
|
|
52
54
|
async runAsync() {
|
|
53
|
-
var
|
|
54
|
-
let { args: { name }, flags
|
|
55
|
+
var _b, _c;
|
|
56
|
+
let { args: { name: branchName }, flags, } = await this.parse(BranchDelete);
|
|
57
|
+
const { json: jsonFlag, 'non-interactive': nonInteractive } = flags;
|
|
58
|
+
const paginatedQueryOptions = (0, pagination_1.getPaginatedQueryOptions)(flags);
|
|
55
59
|
if (jsonFlag) {
|
|
56
60
|
(0, json_1.enableJsonOutput)();
|
|
57
61
|
}
|
|
58
|
-
const
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
const projectId = await (0, projectUtils_1.getProjectIdAsync)(exp);
|
|
62
|
-
if (!name) {
|
|
62
|
+
const { projectConfig: { projectId }, } = await this.getContextAsync(BranchDelete, { nonInteractive });
|
|
63
|
+
const projectDisplayName = await (0, projectUtils_1.getDisplayNameForProjectIdAsync)(projectId);
|
|
64
|
+
if (!branchName) {
|
|
63
65
|
const validationMessage = 'branch name may not be empty.';
|
|
64
|
-
if (
|
|
66
|
+
if (nonInteractive) {
|
|
65
67
|
throw new Error(validationMessage);
|
|
66
68
|
}
|
|
67
|
-
({ name } = await (0,
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
69
|
+
({ name: branchName } = await (0, queries_1.selectBranchOnAppAsync)({
|
|
70
|
+
projectId,
|
|
71
|
+
displayTextForListItem: updateBranch => updateBranch.name,
|
|
72
|
+
promptTitle: 'Which branch would you like to delete?',
|
|
73
|
+
paginatedQueryOptions,
|
|
72
74
|
}));
|
|
73
75
|
}
|
|
74
|
-
const data = await getBranchInfoAsync({ appId: projectId, name });
|
|
75
|
-
const branchId = (
|
|
76
|
+
const data = await getBranchInfoAsync({ appId: projectId, name: branchName });
|
|
77
|
+
const branchId = (_c = (_b = data.app) === null || _b === void 0 ? void 0 : _b.byId.updateBranchByName) === null || _c === void 0 ? void 0 : _c.id;
|
|
76
78
|
if (!branchId) {
|
|
77
|
-
throw new Error(`Could not find branch ${
|
|
79
|
+
throw new Error(`Could not find branch ${branchName} on ${projectDisplayName}`);
|
|
78
80
|
}
|
|
79
|
-
if (!
|
|
81
|
+
if (!nonInteractive) {
|
|
80
82
|
log_1.default.addNewLineIfNone();
|
|
81
|
-
log_1.default.warn(`You are about to permanently delete branch: "${
|
|
83
|
+
log_1.default.warn(`You are about to permanently delete branch: "${branchName}" and all of the updates published on it.` +
|
|
82
84
|
`\nThis action is irreversible.`);
|
|
83
85
|
log_1.default.newLine();
|
|
84
86
|
const confirmed = await (0, prompts_1.toggleConfirmAsync)({ message: 'Are you sure you wish to proceed?' });
|
|
85
87
|
if (!confirmed) {
|
|
86
|
-
log_1.default.error(`Cancelled deletion of branch: "${
|
|
88
|
+
log_1.default.error(`Cancelled deletion of branch: "${branchName}".`);
|
|
87
89
|
process.exit(1);
|
|
88
90
|
}
|
|
89
91
|
}
|
|
@@ -94,12 +96,16 @@ class BranchDelete extends EasCommand_1.default {
|
|
|
94
96
|
(0, json_1.printJsonOnlyOutput)(deletionResult);
|
|
95
97
|
}
|
|
96
98
|
else {
|
|
97
|
-
log_1.default.withTick(`️Deleted branch "${
|
|
99
|
+
log_1.default.withTick(`️Deleted branch "${branchName}" and all of its updates on project ${chalk_1.default.bold(projectDisplayName)}.`);
|
|
98
100
|
}
|
|
99
101
|
}
|
|
100
102
|
}
|
|
101
103
|
exports.default = BranchDelete;
|
|
104
|
+
_a = BranchDelete;
|
|
102
105
|
BranchDelete.description = 'delete a branch';
|
|
106
|
+
BranchDelete.contextDefinition = {
|
|
107
|
+
..._a.ContextOptions.ProjectConfig,
|
|
108
|
+
};
|
|
103
109
|
BranchDelete.args = [
|
|
104
110
|
{
|
|
105
111
|
name: 'name',
|
|
@@ -108,8 +114,5 @@ BranchDelete.args = [
|
|
|
108
114
|
},
|
|
109
115
|
];
|
|
110
116
|
BranchDelete.flags = {
|
|
111
|
-
|
|
112
|
-
description: `return JSON with the edited branch's ID and name.`,
|
|
113
|
-
default: false,
|
|
114
|
-
}),
|
|
117
|
+
...flags_1.EasNonInteractiveAndJsonFlags,
|
|
115
118
|
};
|
|
@@ -2,10 +2,13 @@ import EasCommand from '../../commandUtils/EasCommand';
|
|
|
2
2
|
export default class BranchList extends EasCommand {
|
|
3
3
|
static description: string;
|
|
4
4
|
static flags: {
|
|
5
|
-
offset: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined>;
|
|
6
|
-
limit: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined>;
|
|
7
5
|
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
8
6
|
'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
7
|
+
offset: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined>;
|
|
8
|
+
limit: any;
|
|
9
|
+
};
|
|
10
|
+
static contextDefinition: {
|
|
11
|
+
projectConfig: import("../../commandUtils/context/ProjectConfigContextField").default;
|
|
9
12
|
};
|
|
10
13
|
runAsync(): Promise<void>;
|
|
11
14
|
}
|
|
@@ -1,27 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var _a;
|
|
2
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
4
|
const tslib_1 = require("tslib");
|
|
4
5
|
const queries_1 = require("../../branch/queries");
|
|
5
6
|
const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
|
|
7
|
+
const flags_1 = require("../../commandUtils/flags");
|
|
6
8
|
const pagination_1 = require("../../commandUtils/pagination");
|
|
7
|
-
const expoConfig_1 = require("../../project/expoConfig");
|
|
8
|
-
const projectUtils_1 = require("../../project/projectUtils");
|
|
9
9
|
const json_1 = require("../../utils/json");
|
|
10
10
|
class BranchList extends EasCommand_1.default {
|
|
11
11
|
async runAsync() {
|
|
12
12
|
const { flags } = await this.parse(BranchList);
|
|
13
|
-
const
|
|
14
|
-
|
|
13
|
+
const { projectConfig: { projectId }, } = await this.getContextAsync(BranchList, {
|
|
14
|
+
nonInteractive: flags['non-interactive'],
|
|
15
|
+
});
|
|
16
|
+
const paginatedQueryOptions = (0, pagination_1.getPaginatedQueryOptions)(flags);
|
|
17
|
+
if (paginatedQueryOptions.json) {
|
|
15
18
|
(0, json_1.enableJsonOutput)();
|
|
16
19
|
}
|
|
17
|
-
|
|
18
|
-
const exp = (0, expoConfig_1.getExpoConfig)(projectDir);
|
|
19
|
-
const projectId = await (0, projectUtils_1.getProjectIdAsync)(exp);
|
|
20
|
-
await (0, queries_1.listAndRenderPaginatedBranchesAsync)(projectId, options);
|
|
20
|
+
await (0, queries_1.listAndRenderBranchesOnAppAsync)({ projectId, paginatedQueryOptions });
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
exports.default = BranchList;
|
|
24
|
+
_a = BranchList;
|
|
24
25
|
BranchList.description = 'list all branches';
|
|
25
26
|
BranchList.flags = {
|
|
26
27
|
...pagination_1.EasPaginatedQueryFlags,
|
|
28
|
+
...flags_1.EasNonInteractiveAndJsonFlags,
|
|
29
|
+
};
|
|
30
|
+
BranchList.contextDefinition = {
|
|
31
|
+
..._a.ContextOptions.ProjectConfig,
|
|
27
32
|
};
|
|
@@ -2,9 +2,13 @@ import EasCommand from '../../commandUtils/EasCommand';
|
|
|
2
2
|
export default class BranchRename extends EasCommand {
|
|
3
3
|
static description: string;
|
|
4
4
|
static flags: {
|
|
5
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
6
|
+
'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
5
7
|
from: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
6
8
|
to: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
7
|
-
|
|
9
|
+
};
|
|
10
|
+
static contextDefinition: {
|
|
11
|
+
projectConfig: import("../../commandUtils/context/ProjectConfigContextField").default;
|
|
8
12
|
};
|
|
9
13
|
runAsync(): Promise<void>;
|
|
10
14
|
}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var _a;
|
|
2
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
4
|
const tslib_1 = require("tslib");
|
|
4
5
|
const core_1 = require("@oclif/core");
|
|
5
6
|
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
6
7
|
const graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag"));
|
|
7
8
|
const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
|
|
9
|
+
const flags_1 = require("../../commandUtils/flags");
|
|
8
10
|
const client_1 = require("../../graphql/client");
|
|
9
11
|
const log_1 = tslib_1.__importDefault(require("../../log"));
|
|
10
|
-
const expoConfig_1 = require("../../project/expoConfig");
|
|
11
12
|
const projectUtils_1 = require("../../project/projectUtils");
|
|
12
13
|
const prompts_1 = require("../../prompts");
|
|
13
14
|
const json_1 = require("../../utils/json");
|
|
@@ -34,17 +35,17 @@ async function renameUpdateBranchOnAppAsync({ appId, name, newName, }) {
|
|
|
34
35
|
}
|
|
35
36
|
class BranchRename extends EasCommand_1.default {
|
|
36
37
|
async runAsync() {
|
|
37
|
-
let { flags: { json: jsonFlag, from: currentName, to: newName }, } = await this.parse(BranchRename);
|
|
38
|
+
let { flags: { json: jsonFlag, from: currentName, to: newName, 'non-interactive': nonInteractive }, } = await this.parse(BranchRename);
|
|
39
|
+
const { projectConfig: { projectId }, } = await this.getContextAsync(BranchRename, {
|
|
40
|
+
nonInteractive,
|
|
41
|
+
});
|
|
38
42
|
if (jsonFlag) {
|
|
39
43
|
(0, json_1.enableJsonOutput)();
|
|
40
44
|
}
|
|
41
|
-
const
|
|
42
|
-
const exp = (0, expoConfig_1.getExpoConfig)(projectDir);
|
|
43
|
-
const fullName = await (0, projectUtils_1.getProjectFullNameAsync)(exp);
|
|
44
|
-
const projectId = await (0, projectUtils_1.getProjectIdAsync)(exp);
|
|
45
|
+
const projectDisplayName = await (0, projectUtils_1.getDisplayNameForProjectIdAsync)(projectId);
|
|
45
46
|
if (!currentName) {
|
|
46
47
|
const validationMessage = 'current name may not be empty.';
|
|
47
|
-
if (
|
|
48
|
+
if (nonInteractive) {
|
|
48
49
|
throw new Error(validationMessage);
|
|
49
50
|
}
|
|
50
51
|
({ currentName } = await (0, prompts_1.promptAsync)({
|
|
@@ -56,7 +57,7 @@ class BranchRename extends EasCommand_1.default {
|
|
|
56
57
|
}
|
|
57
58
|
if (!newName) {
|
|
58
59
|
const validationMessage = 'new name may not be empty.';
|
|
59
|
-
if (
|
|
60
|
+
if (nonInteractive) {
|
|
60
61
|
throw new Error(validationMessage);
|
|
61
62
|
}
|
|
62
63
|
({ newName } = await (0, prompts_1.promptAsync)({
|
|
@@ -75,11 +76,12 @@ class BranchRename extends EasCommand_1.default {
|
|
|
75
76
|
(0, json_1.printJsonOnlyOutput)(editedBranch);
|
|
76
77
|
}
|
|
77
78
|
else {
|
|
78
|
-
log_1.default.withTick(`️Renamed branch from ${currentName} to ${chalk_1.default.bold(editedBranch.name)} on project ${chalk_1.default.bold(
|
|
79
|
+
log_1.default.withTick(`️Renamed branch from ${currentName} to ${chalk_1.default.bold(editedBranch.name)} on project ${chalk_1.default.bold(projectDisplayName)}.`);
|
|
79
80
|
}
|
|
80
81
|
}
|
|
81
82
|
}
|
|
82
83
|
exports.default = BranchRename;
|
|
84
|
+
_a = BranchRename;
|
|
83
85
|
BranchRename.description = 'rename a branch';
|
|
84
86
|
BranchRename.flags = {
|
|
85
87
|
from: core_1.Flags.string({
|
|
@@ -90,8 +92,8 @@ BranchRename.flags = {
|
|
|
90
92
|
description: 'new name of the branch.',
|
|
91
93
|
required: false,
|
|
92
94
|
}),
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
95
|
+
...flags_1.EasNonInteractiveAndJsonFlags,
|
|
96
|
+
};
|
|
97
|
+
BranchRename.contextDefinition = {
|
|
98
|
+
..._a.ContextOptions.ProjectConfig,
|
|
97
99
|
};
|
|
@@ -7,10 +7,13 @@ export default class BranchView extends EasCommand {
|
|
|
7
7
|
description: string;
|
|
8
8
|
}[];
|
|
9
9
|
static flags: {
|
|
10
|
-
|
|
11
|
-
limit: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined>;
|
|
10
|
+
limit: any;
|
|
12
11
|
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
13
12
|
'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
13
|
+
offset: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined>;
|
|
14
|
+
};
|
|
15
|
+
static contextDefinition: {
|
|
16
|
+
projectConfig: import("../../commandUtils/context/ProjectConfigContextField").default;
|
|
14
17
|
};
|
|
15
18
|
runAsync(): Promise<void>;
|
|
16
19
|
}
|
|
@@ -1,36 +1,49 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var _a;
|
|
2
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
4
|
const tslib_1 = require("tslib");
|
|
4
5
|
const queries_1 = require("../../branch/queries");
|
|
5
6
|
const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
|
|
7
|
+
const flags_1 = require("../../commandUtils/flags");
|
|
6
8
|
const pagination_1 = require("../../commandUtils/pagination");
|
|
7
|
-
const expoConfig_1 = require("../../project/expoConfig");
|
|
8
|
-
const projectUtils_1 = require("../../project/projectUtils");
|
|
9
9
|
const queries_2 = require("../../update/queries");
|
|
10
10
|
const json_1 = require("../../utils/json");
|
|
11
11
|
class BranchView extends EasCommand_1.default {
|
|
12
12
|
async runAsync() {
|
|
13
13
|
let { args: { name: branchName }, flags, } = await this.parse(BranchView);
|
|
14
|
-
const
|
|
15
|
-
|
|
14
|
+
const { 'non-interactive': nonInteractive } = flags;
|
|
15
|
+
const { projectConfig: { projectId }, } = await this.getContextAsync(BranchView, {
|
|
16
|
+
nonInteractive,
|
|
17
|
+
});
|
|
18
|
+
const paginatedQueryOptions = (0, pagination_1.getPaginatedQueryOptions)(flags);
|
|
19
|
+
if (paginatedQueryOptions.json) {
|
|
16
20
|
(0, json_1.enableJsonOutput)();
|
|
17
21
|
}
|
|
18
|
-
const projectDir = await (0, projectUtils_1.findProjectRootAsync)();
|
|
19
|
-
const exp = (0, expoConfig_1.getExpoConfig)(projectDir);
|
|
20
|
-
const projectId = await (0, projectUtils_1.getProjectIdAsync)(exp);
|
|
21
|
-
// provide help to a user if they ran the command with missing args
|
|
22
22
|
if (!branchName) {
|
|
23
|
-
if (
|
|
23
|
+
if (nonInteractive) {
|
|
24
24
|
throw new Error('Branch name may not be empty.');
|
|
25
25
|
}
|
|
26
|
-
({ name: branchName } = await (0, queries_1.
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
({ name: branchName } = await (0, queries_1.selectBranchOnAppAsync)({
|
|
27
|
+
projectId,
|
|
28
|
+
promptTitle: 'Which branch would you like to view?',
|
|
29
|
+
displayTextForListItem: updateBranch => updateBranch.name,
|
|
30
|
+
// discard limit and offset because this query is not their intended target
|
|
31
|
+
paginatedQueryOptions: {
|
|
32
|
+
json: paginatedQueryOptions.json,
|
|
33
|
+
nonInteractive,
|
|
34
|
+
offset: 0,
|
|
35
|
+
},
|
|
36
|
+
}));
|
|
29
37
|
}
|
|
30
|
-
await (0, queries_2.
|
|
38
|
+
await (0, queries_2.listAndRenderUpdateGroupsOnBranchAsync)({
|
|
39
|
+
projectId,
|
|
40
|
+
branchName,
|
|
41
|
+
paginatedQueryOptions,
|
|
42
|
+
});
|
|
31
43
|
}
|
|
32
44
|
}
|
|
33
45
|
exports.default = BranchView;
|
|
46
|
+
_a = BranchView;
|
|
34
47
|
BranchView.description = 'view a branch';
|
|
35
48
|
BranchView.args = [
|
|
36
49
|
{
|
|
@@ -41,4 +54,9 @@ BranchView.args = [
|
|
|
41
54
|
];
|
|
42
55
|
BranchView.flags = {
|
|
43
56
|
...pagination_1.EasPaginatedQueryFlags,
|
|
57
|
+
...flags_1.EasNonInteractiveAndJsonFlags,
|
|
58
|
+
limit: (0, pagination_1.getLimitFlagWithCustomValues)({ defaultTo: 25, limit: 50 }),
|
|
59
|
+
};
|
|
60
|
+
BranchView.contextDefinition = {
|
|
61
|
+
..._a.ContextOptions.ProjectConfig,
|
|
44
62
|
};
|
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
import EasCommand from '../../commandUtils/EasCommand';
|
|
2
|
+
export declare function selectBuildToCancelAsync(projectId: string, projectDisplayName: string): Promise<string | null>;
|
|
2
3
|
export default class BuildCancel extends EasCommand {
|
|
3
4
|
static description: string;
|
|
4
5
|
static args: {
|
|
5
6
|
name: string;
|
|
6
7
|
}[];
|
|
8
|
+
static flags: {
|
|
9
|
+
'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
};
|
|
11
|
+
static contextDefinition: {
|
|
12
|
+
projectConfig: import("../../commandUtils/context/ProjectConfigContextField").default;
|
|
13
|
+
};
|
|
7
14
|
runAsync(): Promise<void>;
|
|
8
15
|
}
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var _a;
|
|
2
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.selectBuildToCancelAsync = void 0;
|
|
3
5
|
const tslib_1 = require("tslib");
|
|
4
6
|
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
5
7
|
const graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag"));
|
|
6
8
|
const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
|
|
9
|
+
const flags_1 = require("../../commandUtils/flags");
|
|
7
10
|
const client_1 = require("../../graphql/client");
|
|
8
11
|
const generated_1 = require("../../graphql/generated");
|
|
9
12
|
const BuildQuery_1 = require("../../graphql/queries/BuildQuery");
|
|
10
13
|
const log_1 = tslib_1.__importDefault(require("../../log"));
|
|
11
14
|
const ora_1 = require("../../ora");
|
|
12
15
|
const platform_1 = require("../../platform");
|
|
13
|
-
const expoConfig_1 = require("../../project/expoConfig");
|
|
14
16
|
const projectUtils_1 = require("../../project/projectUtils");
|
|
15
17
|
const prompts_1 = require("../../prompts");
|
|
16
18
|
async function cancelBuildAsync(buildId) {
|
|
@@ -44,42 +46,54 @@ function formatUnfinishedBuild(build) {
|
|
|
44
46
|
const status = chalk_1.default.blue(statusText);
|
|
45
47
|
return `${platform} Started at: ${startTime}, Status: ${status}, Id: ${build.id}`;
|
|
46
48
|
}
|
|
47
|
-
async function selectBuildToCancelAsync(projectId,
|
|
49
|
+
async function selectBuildToCancelAsync(projectId, projectDisplayName) {
|
|
48
50
|
const spinner = (0, ora_1.ora)().start('Fetching the uncompleted builds…');
|
|
49
51
|
let builds;
|
|
50
52
|
try {
|
|
51
53
|
const [newBuilds, inQueueBuilds, inProgressBuilds] = await Promise.all([
|
|
52
|
-
BuildQuery_1.BuildQuery.
|
|
53
|
-
|
|
54
|
-
|
|
54
|
+
BuildQuery_1.BuildQuery.viewBuildsOnAppAsync({
|
|
55
|
+
appId: projectId,
|
|
56
|
+
offset: 0,
|
|
57
|
+
limit: 10,
|
|
58
|
+
filter: { status: generated_1.BuildStatus.New },
|
|
59
|
+
}),
|
|
60
|
+
BuildQuery_1.BuildQuery.viewBuildsOnAppAsync({
|
|
61
|
+
appId: projectId,
|
|
62
|
+
offset: 0,
|
|
63
|
+
limit: 10,
|
|
64
|
+
filter: { status: generated_1.BuildStatus.InQueue },
|
|
65
|
+
}),
|
|
66
|
+
BuildQuery_1.BuildQuery.viewBuildsOnAppAsync({
|
|
67
|
+
appId: projectId,
|
|
68
|
+
offset: 0,
|
|
69
|
+
limit: 10,
|
|
70
|
+
filter: { status: generated_1.BuildStatus.InProgress },
|
|
71
|
+
}),
|
|
55
72
|
]);
|
|
56
73
|
spinner.stop();
|
|
57
74
|
builds = [...newBuilds, ...inQueueBuilds, ...inProgressBuilds];
|
|
58
75
|
}
|
|
59
76
|
catch (error) {
|
|
60
|
-
spinner.fail(`Something went wrong and we couldn't fetch the builds for the project ${
|
|
77
|
+
spinner.fail(`Something went wrong and we couldn't fetch the builds for the project ${projectDisplayName}.`);
|
|
61
78
|
throw error;
|
|
62
79
|
}
|
|
63
80
|
if (builds.length === 0) {
|
|
64
|
-
log_1.default.warn(`There aren't any uncompleted builds for the project ${
|
|
81
|
+
log_1.default.warn(`There aren't any uncompleted builds for the project ${projectDisplayName}.`);
|
|
65
82
|
return null;
|
|
66
83
|
}
|
|
67
|
-
else if (builds.length === 1) {
|
|
68
|
-
log_1.default.log('Found one build');
|
|
69
|
-
log_1.default.log(formatUnfinishedBuild(builds[0]));
|
|
70
|
-
await (0, prompts_1.confirmAsync)({
|
|
71
|
-
message: 'Do you want to cancel it?',
|
|
72
|
-
});
|
|
73
|
-
return builds[0].id;
|
|
74
|
-
}
|
|
75
84
|
else {
|
|
76
85
|
const buildId = await (0, prompts_1.selectAsync)('Which build do you want to cancel?', builds.map(build => ({
|
|
77
86
|
title: formatUnfinishedBuild(build),
|
|
78
87
|
value: build.id,
|
|
79
88
|
})));
|
|
80
|
-
return
|
|
89
|
+
return (await (0, prompts_1.confirmAsync)({
|
|
90
|
+
message: 'Are you sure you want to cancel it?',
|
|
91
|
+
}))
|
|
92
|
+
? buildId
|
|
93
|
+
: null;
|
|
81
94
|
}
|
|
82
95
|
}
|
|
96
|
+
exports.selectBuildToCancelAsync = selectBuildToCancelAsync;
|
|
83
97
|
async function ensureBuildExistsAsync(buildId) {
|
|
84
98
|
try {
|
|
85
99
|
await BuildQuery_1.BuildQuery.byIdAsync(buildId);
|
|
@@ -90,17 +104,23 @@ async function ensureBuildExistsAsync(buildId) {
|
|
|
90
104
|
}
|
|
91
105
|
class BuildCancel extends EasCommand_1.default {
|
|
92
106
|
async runAsync() {
|
|
93
|
-
const { BUILD_ID: buildIdFromArg } =
|
|
94
|
-
const
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
const
|
|
107
|
+
const { args: { BUILD_ID: buildIdFromArg }, flags: { 'non-interactive': nonInteractive }, } = await this.parse(BuildCancel);
|
|
108
|
+
const { projectConfig: { projectId }, } = await this.getContextAsync(BuildCancel, {
|
|
109
|
+
nonInteractive,
|
|
110
|
+
});
|
|
111
|
+
const displayName = await (0, projectUtils_1.getDisplayNameForProjectIdAsync)(projectId);
|
|
98
112
|
if (buildIdFromArg) {
|
|
99
113
|
await ensureBuildExistsAsync(buildIdFromArg);
|
|
100
114
|
}
|
|
101
|
-
|
|
115
|
+
let buildId = buildIdFromArg;
|
|
102
116
|
if (!buildId) {
|
|
103
|
-
|
|
117
|
+
if (nonInteractive) {
|
|
118
|
+
throw new Error('BUILD_ID must not be empty in non-interactive mode');
|
|
119
|
+
}
|
|
120
|
+
buildId = await selectBuildToCancelAsync(projectId, displayName);
|
|
121
|
+
if (!buildId) {
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
104
124
|
}
|
|
105
125
|
const spinner = (0, ora_1.ora)().start('Canceling the build…');
|
|
106
126
|
try {
|
|
@@ -120,5 +140,12 @@ class BuildCancel extends EasCommand_1.default {
|
|
|
120
140
|
}
|
|
121
141
|
}
|
|
122
142
|
exports.default = BuildCancel;
|
|
143
|
+
_a = BuildCancel;
|
|
123
144
|
BuildCancel.description = 'cancel a build';
|
|
124
145
|
BuildCancel.args = [{ name: 'BUILD_ID' }];
|
|
146
|
+
BuildCancel.flags = {
|
|
147
|
+
...flags_1.EASNonInteractiveFlag,
|
|
148
|
+
};
|
|
149
|
+
BuildCancel.contextDefinition = {
|
|
150
|
+
..._a.ContextOptions.ProjectConfig,
|
|
151
|
+
};
|