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
|
@@ -1,29 +1,33 @@
|
|
|
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");
|
|
6
|
+
const assert_1 = tslib_1.__importDefault(require("assert"));
|
|
5
7
|
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
8
|
+
const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
|
|
9
|
+
const path_1 = tslib_1.__importDefault(require("path"));
|
|
6
10
|
const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
|
|
11
|
+
const flags_1 = require("../../commandUtils/flags");
|
|
7
12
|
const EnvironmentSecretMutation_1 = require("../../graphql/mutations/EnvironmentSecretMutation");
|
|
8
13
|
const EnvironmentSecretsQuery_1 = require("../../graphql/queries/EnvironmentSecretsQuery");
|
|
14
|
+
const EnvironmentSecret_1 = require("../../graphql/types/EnvironmentSecret");
|
|
9
15
|
const log_1 = tslib_1.__importDefault(require("../../log"));
|
|
10
|
-
const expoConfig_1 = require("../../project/expoConfig");
|
|
11
16
|
const projectUtils_1 = require("../../project/projectUtils");
|
|
12
17
|
const prompts_1 = require("../../prompts");
|
|
13
|
-
const Account_1 = require("../../user/Account");
|
|
14
|
-
const User_1 = require("../../user/User");
|
|
15
|
-
const actions_1 = require("../../user/actions");
|
|
16
18
|
class EnvironmentSecretCreate extends EasCommand_1.default {
|
|
17
19
|
async runAsync() {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
const
|
|
23
|
-
const
|
|
24
|
-
const projectId = await (0, projectUtils_1.getProjectIdAsync)(exp);
|
|
20
|
+
let { flags: { name, value: secretValue, scope, force, type: secretType, 'non-interactive': nonInteractive, }, } = await this.parse(EnvironmentSecretCreate);
|
|
21
|
+
const { projectConfig: { projectId }, } = await this.getContextAsync(EnvironmentSecretCreate, {
|
|
22
|
+
nonInteractive,
|
|
23
|
+
});
|
|
24
|
+
const projectDisplayName = await (0, projectUtils_1.getDisplayNameForProjectIdAsync)(projectId);
|
|
25
|
+
const ownerAccount = await (0, projectUtils_1.getOwnerAccountForProjectIdAsync)(projectId);
|
|
25
26
|
if (!scope) {
|
|
26
27
|
const validationMessage = 'Secret scope may not be empty.';
|
|
28
|
+
if (nonInteractive) {
|
|
29
|
+
throw new Error(validationMessage);
|
|
30
|
+
}
|
|
27
31
|
({ scope } = await (0, prompts_1.promptAsync)({
|
|
28
32
|
type: 'select',
|
|
29
33
|
name: 'scope',
|
|
@@ -36,13 +40,17 @@ class EnvironmentSecretCreate extends EasCommand_1.default {
|
|
|
36
40
|
}));
|
|
37
41
|
}
|
|
38
42
|
if (!name) {
|
|
43
|
+
const validationMessage = 'Secret name may not be empty.';
|
|
44
|
+
if (nonInteractive) {
|
|
45
|
+
throw new Error(validationMessage);
|
|
46
|
+
}
|
|
39
47
|
({ name } = await (0, prompts_1.promptAsync)({
|
|
40
48
|
type: 'text',
|
|
41
49
|
name: 'name',
|
|
42
50
|
message: `Secret name:`,
|
|
43
51
|
validate: value => {
|
|
44
52
|
if (!value) {
|
|
45
|
-
return
|
|
53
|
+
return validationMessage;
|
|
46
54
|
}
|
|
47
55
|
// this validation regex here is just to shorten the feedback loop
|
|
48
56
|
// the source of truth is in www's EnvironmentSecretValidator class
|
|
@@ -53,59 +61,100 @@ class EnvironmentSecretCreate extends EasCommand_1.default {
|
|
|
53
61
|
},
|
|
54
62
|
}));
|
|
55
63
|
if (!name) {
|
|
56
|
-
throw new Error(
|
|
64
|
+
throw new Error(validationMessage);
|
|
57
65
|
}
|
|
58
66
|
}
|
|
67
|
+
if (!secretType) {
|
|
68
|
+
if (nonInteractive) {
|
|
69
|
+
throw new Error('Secret type may not be empty in non-interactive mode');
|
|
70
|
+
}
|
|
71
|
+
secretType = await (0, prompts_1.selectAsync)('Select secret type', [
|
|
72
|
+
{
|
|
73
|
+
title: 'string',
|
|
74
|
+
value: EnvironmentSecret_1.SecretType.STRING,
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
title: 'file',
|
|
78
|
+
value: EnvironmentSecret_1.SecretType.FILE,
|
|
79
|
+
},
|
|
80
|
+
]);
|
|
81
|
+
}
|
|
59
82
|
if (!secretValue) {
|
|
60
83
|
const validationMessage = 'Secret value may not be empty.';
|
|
84
|
+
if (nonInteractive) {
|
|
85
|
+
throw new Error(validationMessage);
|
|
86
|
+
}
|
|
61
87
|
({ secretValue } = await (0, prompts_1.promptAsync)({
|
|
62
88
|
type: 'text',
|
|
63
89
|
name: 'secretValue',
|
|
64
|
-
message: 'Secret value:',
|
|
65
|
-
|
|
90
|
+
message: secretType === EnvironmentSecret_1.SecretType.STRING ? 'Secret value:' : 'Local file path:',
|
|
91
|
+
// eslint-disable-next-line async-protect/async-suffix
|
|
92
|
+
validate: async (secretValue) => {
|
|
93
|
+
if (!secretValue) {
|
|
94
|
+
return 'Secret value may not be empty.';
|
|
95
|
+
}
|
|
96
|
+
if (secretType === EnvironmentSecret_1.SecretType.FILE) {
|
|
97
|
+
const secretFilePath = path_1.default.resolve(secretValue);
|
|
98
|
+
if (!(await fs_extra_1.default.pathExists(secretFilePath))) {
|
|
99
|
+
return `File "${secretValue}" does not exist.`;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
return true;
|
|
103
|
+
},
|
|
66
104
|
}));
|
|
67
|
-
|
|
68
|
-
|
|
105
|
+
}
|
|
106
|
+
(0, assert_1.default)(secretValue);
|
|
107
|
+
let secretFilePath;
|
|
108
|
+
if (secretType === EnvironmentSecret_1.SecretType.FILE) {
|
|
109
|
+
secretFilePath = path_1.default.resolve(secretValue);
|
|
110
|
+
if (!(await fs_extra_1.default.pathExists(secretFilePath))) {
|
|
111
|
+
throw new Error(`File "${secretValue}" does not exist`);
|
|
69
112
|
}
|
|
70
113
|
}
|
|
71
114
|
if (scope === EnvironmentSecretsQuery_1.EnvironmentSecretScope.PROJECT) {
|
|
72
115
|
if (force) {
|
|
73
|
-
const existingSecrets = await EnvironmentSecretsQuery_1.EnvironmentSecretsQuery.byAppIdAsync(projectId);
|
|
116
|
+
const { appSecrets: existingSecrets } = await EnvironmentSecretsQuery_1.EnvironmentSecretsQuery.byAppIdAsync(projectId);
|
|
74
117
|
const existingSecret = existingSecrets.find(secret => secret.name === name);
|
|
75
118
|
if (existingSecret) {
|
|
76
119
|
await EnvironmentSecretMutation_1.EnvironmentSecretMutation.deleteAsync(existingSecret.id);
|
|
77
|
-
log_1.default.withTick(`Deleting existing secret ${chalk_1.default.bold(name)} on project ${chalk_1.default.bold(
|
|
120
|
+
log_1.default.withTick(`Deleting existing secret ${chalk_1.default.bold(name)} on project ${chalk_1.default.bold(projectDisplayName)}.`);
|
|
78
121
|
}
|
|
79
122
|
}
|
|
80
|
-
const secret = await EnvironmentSecretMutation_1.EnvironmentSecretMutation.createForAppAsync({ name, value: secretValue }, projectId);
|
|
123
|
+
const secret = await EnvironmentSecretMutation_1.EnvironmentSecretMutation.createForAppAsync({ name, value: secretValue, type: EnvironmentSecret_1.SecretTypeToEnvironmentSecretType[secretType] }, projectId);
|
|
81
124
|
if (!secret) {
|
|
82
125
|
throw new Error(`Could not create secret with name ${name} on project with id ${projectId}`);
|
|
83
126
|
}
|
|
84
|
-
|
|
127
|
+
if (secretType === EnvironmentSecret_1.SecretType.STRING) {
|
|
128
|
+
log_1.default.withTick(`️Created a new secret ${chalk_1.default.bold(name)} with value ${chalk_1.default.bold(secretValue)} on project ${chalk_1.default.bold(projectDisplayName)}.`);
|
|
129
|
+
}
|
|
130
|
+
else {
|
|
131
|
+
log_1.default.withTick(`️Created a new secret ${chalk_1.default.bold(name)} from file ${chalk_1.default.bold(secretFilePath)} on project ${chalk_1.default.bold(projectDisplayName)}.`);
|
|
132
|
+
}
|
|
85
133
|
}
|
|
86
134
|
else if (scope === EnvironmentSecretsQuery_1.EnvironmentSecretScope.ACCOUNT) {
|
|
87
|
-
const ownerAccount = (0, Account_1.findAccountByName)(actor.accounts, accountName);
|
|
88
|
-
if (!ownerAccount) {
|
|
89
|
-
log_1.default.warn(`Your account (${(0, User_1.getActorDisplayName)(actor)}) doesn't have access to the ${chalk_1.default.bold(accountName)} account`);
|
|
90
|
-
return;
|
|
91
|
-
}
|
|
92
135
|
if (force) {
|
|
93
|
-
const existingSecrets = await EnvironmentSecretsQuery_1.EnvironmentSecretsQuery.
|
|
136
|
+
const { accountSecrets: existingSecrets } = await EnvironmentSecretsQuery_1.EnvironmentSecretsQuery.byAppIdAsync(projectId);
|
|
94
137
|
const existingSecret = existingSecrets.find(secret => secret.name === name);
|
|
95
138
|
if (existingSecret) {
|
|
96
139
|
await EnvironmentSecretMutation_1.EnvironmentSecretMutation.deleteAsync(existingSecret.id);
|
|
97
140
|
log_1.default.withTick(`Deleting existing secret ${chalk_1.default.bold(name)} on account ${chalk_1.default.bold(ownerAccount.name)}.`);
|
|
98
141
|
}
|
|
99
142
|
}
|
|
100
|
-
const secret = await EnvironmentSecretMutation_1.EnvironmentSecretMutation.createForAccountAsync({ name, value: secretValue }, ownerAccount.id);
|
|
143
|
+
const secret = await EnvironmentSecretMutation_1.EnvironmentSecretMutation.createForAccountAsync({ name, value: secretValue, type: EnvironmentSecret_1.SecretTypeToEnvironmentSecretType[secretType] }, ownerAccount.id);
|
|
101
144
|
if (!secret) {
|
|
102
145
|
throw new Error(`Could not create secret with name ${name} on account with id ${ownerAccount.id}`);
|
|
103
146
|
}
|
|
104
|
-
|
|
147
|
+
if (secretType === EnvironmentSecret_1.SecretType.STRING) {
|
|
148
|
+
log_1.default.withTick(`️Created a new secret ${chalk_1.default.bold(name)} with value ${chalk_1.default.bold(secretValue)} on account ${chalk_1.default.bold(ownerAccount.name)}.`);
|
|
149
|
+
}
|
|
150
|
+
else {
|
|
151
|
+
log_1.default.withTick(`️Created a new secret ${chalk_1.default.bold(name)} from file ${chalk_1.default.bold(secretFilePath)} on account ${chalk_1.default.bold(ownerAccount.name)}.`);
|
|
152
|
+
}
|
|
105
153
|
}
|
|
106
154
|
}
|
|
107
155
|
}
|
|
108
156
|
exports.default = EnvironmentSecretCreate;
|
|
157
|
+
_a = EnvironmentSecretCreate;
|
|
109
158
|
EnvironmentSecretCreate.description = 'create an environment secret on the current project or owner account';
|
|
110
159
|
EnvironmentSecretCreate.flags = {
|
|
111
160
|
scope: core_1.Flags.enum({
|
|
@@ -117,10 +166,18 @@ EnvironmentSecretCreate.flags = {
|
|
|
117
166
|
description: 'Name of the secret',
|
|
118
167
|
}),
|
|
119
168
|
value: core_1.Flags.string({
|
|
120
|
-
description: '
|
|
169
|
+
description: 'Text value or path to a file to store in the secret',
|
|
170
|
+
}),
|
|
171
|
+
type: core_1.Flags.enum({
|
|
172
|
+
description: 'The type of secret',
|
|
173
|
+
options: [EnvironmentSecret_1.SecretType.STRING, EnvironmentSecret_1.SecretType.FILE],
|
|
121
174
|
}),
|
|
122
175
|
force: core_1.Flags.boolean({
|
|
123
176
|
description: 'Delete and recreate existing secrets',
|
|
124
177
|
default: false,
|
|
125
178
|
}),
|
|
179
|
+
...flags_1.EASNonInteractiveFlag,
|
|
180
|
+
};
|
|
181
|
+
EnvironmentSecretCreate.contextDefinition = {
|
|
182
|
+
..._a.ContextOptions.ProjectConfig,
|
|
126
183
|
};
|
|
@@ -2,7 +2,11 @@ import EasCommand from '../../commandUtils/EasCommand';
|
|
|
2
2
|
export default class EnvironmentSecretDelete extends EasCommand {
|
|
3
3
|
static description: string;
|
|
4
4
|
static flags: {
|
|
5
|
+
'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
5
6
|
id: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
6
7
|
};
|
|
8
|
+
static contextDefinition: {
|
|
9
|
+
projectConfig: import("../../commandUtils/context/ProjectConfigContextField").default;
|
|
10
|
+
};
|
|
7
11
|
runAsync(): Promise<void>;
|
|
8
12
|
}
|
|
@@ -1,25 +1,27 @@
|
|
|
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 EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
|
|
7
|
+
const flags_1 = require("../../commandUtils/flags");
|
|
6
8
|
const EnvironmentSecretMutation_1 = require("../../graphql/mutations/EnvironmentSecretMutation");
|
|
7
9
|
const EnvironmentSecretsQuery_1 = require("../../graphql/queries/EnvironmentSecretsQuery");
|
|
8
10
|
const log_1 = tslib_1.__importDefault(require("../../log"));
|
|
9
|
-
const expoConfig_1 = require("../../project/expoConfig");
|
|
10
|
-
const projectUtils_1 = require("../../project/projectUtils");
|
|
11
11
|
const prompts_1 = require("../../prompts");
|
|
12
12
|
class EnvironmentSecretDelete extends EasCommand_1.default {
|
|
13
13
|
async runAsync() {
|
|
14
|
-
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
let { flags: { id }, } = await this.parse(EnvironmentSecretDelete);
|
|
14
|
+
let { flags: { id, 'non-interactive': nonInteractive }, } = await this.parse(EnvironmentSecretDelete);
|
|
15
|
+
const { projectConfig: { projectId }, } = await this.getContextAsync(EnvironmentSecretDelete, {
|
|
16
|
+
nonInteractive,
|
|
17
|
+
});
|
|
19
18
|
let secret;
|
|
20
19
|
if (!id) {
|
|
21
20
|
const validationMessage = 'You must select which secret to delete.';
|
|
22
|
-
|
|
21
|
+
if (nonInteractive) {
|
|
22
|
+
throw new Error(validationMessage);
|
|
23
|
+
}
|
|
24
|
+
const secrets = await EnvironmentSecretsQuery_1.EnvironmentSecretsQuery.allAsync(projectId);
|
|
23
25
|
({ secret } = await (0, prompts_1.promptAsync)({
|
|
24
26
|
type: 'autocomplete',
|
|
25
27
|
name: 'secret',
|
|
@@ -34,26 +36,33 @@ class EnvironmentSecretDelete extends EasCommand_1.default {
|
|
|
34
36
|
throw new Error(validationMessage);
|
|
35
37
|
}
|
|
36
38
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
39
|
+
if (!nonInteractive) {
|
|
40
|
+
log_1.default.addNewLineIfNone();
|
|
41
|
+
log_1.default.warn(`You are about to permanently delete secret${(secret === null || secret === void 0 ? void 0 : secret.name) ? ` "${secret === null || secret === void 0 ? void 0 : secret.name}"` : ''} with id: "${id}".\nThis action is irreversible.`);
|
|
42
|
+
log_1.default.newLine();
|
|
43
|
+
const confirmed = await (0, prompts_1.toggleConfirmAsync)({
|
|
44
|
+
message: `Are you sure you wish to proceed?${(secret === null || secret === void 0 ? void 0 : secret.scope) === EnvironmentSecretsQuery_1.EnvironmentSecretScope.ACCOUNT
|
|
45
|
+
? ' This secret is applied across your whole account and may affect multiple apps.'
|
|
46
|
+
: ''}`,
|
|
47
|
+
});
|
|
48
|
+
if (!confirmed) {
|
|
49
|
+
log_1.default.error(`Canceled deletion of secret${(secret === null || secret === void 0 ? void 0 : secret.name) ? ` "${secret === null || secret === void 0 ? void 0 : secret.name}"` : ''} with id: "${id}".`);
|
|
50
|
+
process.exit(1);
|
|
51
|
+
}
|
|
48
52
|
}
|
|
49
53
|
await EnvironmentSecretMutation_1.EnvironmentSecretMutation.deleteAsync(id);
|
|
50
54
|
log_1.default.withTick(`️Deleted secret${(secret === null || secret === void 0 ? void 0 : secret.name) ? ` "${secret === null || secret === void 0 ? void 0 : secret.name}"` : ''} with id "${id}".`);
|
|
51
55
|
}
|
|
52
56
|
}
|
|
53
57
|
exports.default = EnvironmentSecretDelete;
|
|
58
|
+
_a = EnvironmentSecretDelete;
|
|
54
59
|
EnvironmentSecretDelete.description = 'delete an environment secret by ID';
|
|
55
60
|
EnvironmentSecretDelete.flags = {
|
|
56
61
|
id: core_1.Flags.string({
|
|
57
62
|
description: 'ID of the secret to delete',
|
|
58
63
|
}),
|
|
64
|
+
...flags_1.EASNonInteractiveFlag,
|
|
65
|
+
};
|
|
66
|
+
EnvironmentSecretDelete.contextDefinition = {
|
|
67
|
+
..._a.ContextOptions.ProjectConfig,
|
|
59
68
|
};
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import EasCommand from '../../commandUtils/EasCommand';
|
|
2
2
|
export default class EnvironmentSecretList extends EasCommand {
|
|
3
3
|
static description: string;
|
|
4
|
+
static contextDefinition: {
|
|
5
|
+
projectConfig: import("../../commandUtils/context/ProjectConfigContextField").default;
|
|
6
|
+
};
|
|
4
7
|
runAsync(): Promise<void>;
|
|
5
8
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
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 chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
@@ -6,30 +7,35 @@ const cli_table3_1 = tslib_1.__importDefault(require("cli-table3"));
|
|
|
6
7
|
const dateformat_1 = tslib_1.__importDefault(require("dateformat"));
|
|
7
8
|
const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
|
|
8
9
|
const EnvironmentSecretsQuery_1 = require("../../graphql/queries/EnvironmentSecretsQuery");
|
|
10
|
+
const EnvironmentSecret_1 = require("../../graphql/types/EnvironmentSecret");
|
|
9
11
|
const log_1 = tslib_1.__importDefault(require("../../log"));
|
|
10
|
-
const expoConfig_1 = require("../../project/expoConfig");
|
|
11
|
-
const projectUtils_1 = require("../../project/projectUtils");
|
|
12
12
|
class EnvironmentSecretList extends EasCommand_1.default {
|
|
13
13
|
async runAsync() {
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const
|
|
18
|
-
if (!projectDir) {
|
|
19
|
-
throw new Error("Run this command inside your project's directory");
|
|
20
|
-
}
|
|
21
|
-
const secrets = await EnvironmentSecretsQuery_1.EnvironmentSecretsQuery.allAsync(projectAccountName, projectId);
|
|
14
|
+
const { projectConfig: { projectId }, } = await this.getContextAsync(EnvironmentSecretList, {
|
|
15
|
+
nonInteractive: true,
|
|
16
|
+
});
|
|
17
|
+
const secrets = await EnvironmentSecretsQuery_1.EnvironmentSecretsQuery.allAsync(projectId);
|
|
22
18
|
const table = new cli_table3_1.default({
|
|
23
|
-
head: ['Name', 'Scope', 'ID', 'Updated at'],
|
|
19
|
+
head: ['Name', 'Type', 'Scope', 'ID', 'Updated at'],
|
|
24
20
|
wordWrap: true,
|
|
25
21
|
});
|
|
26
22
|
for (const secret of secrets) {
|
|
27
|
-
const { name, createdAt: updatedAt, scope, id } = secret;
|
|
28
|
-
table.push([
|
|
23
|
+
const { name, createdAt: updatedAt, scope, id, type } = secret;
|
|
24
|
+
table.push([
|
|
25
|
+
name,
|
|
26
|
+
EnvironmentSecret_1.EnvironmentSecretTypeToSecretType[type],
|
|
27
|
+
scope,
|
|
28
|
+
id,
|
|
29
|
+
(0, dateformat_1.default)(updatedAt, 'mmm dd HH:MM:ss'),
|
|
30
|
+
]);
|
|
29
31
|
}
|
|
30
32
|
log_1.default.log((0, chalk_1.default) `{bold Secrets for this account and project:}`);
|
|
31
33
|
log_1.default.log(table.toString());
|
|
32
34
|
}
|
|
33
35
|
}
|
|
34
36
|
exports.default = EnvironmentSecretList;
|
|
37
|
+
_a = EnvironmentSecretList;
|
|
35
38
|
EnvironmentSecretList.description = 'list environment secrets available for your current app';
|
|
39
|
+
EnvironmentSecretList.contextDefinition = {
|
|
40
|
+
..._a.ContextOptions.ProjectConfig,
|
|
41
|
+
};
|
|
@@ -13,6 +13,11 @@ export default class Submit extends EasCommand {
|
|
|
13
13
|
wait: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
14
14
|
'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
15
15
|
};
|
|
16
|
+
static contextDefinition: {
|
|
17
|
+
projectDir: import("../commandUtils/context/ProjectDirContextField").default;
|
|
18
|
+
projectConfig: import("../commandUtils/context/ProjectConfigContextField").default;
|
|
19
|
+
actor: import("../commandUtils/context/ActorContextField").default;
|
|
20
|
+
};
|
|
16
21
|
runAsync(): Promise<void>;
|
|
17
22
|
private sanitizeFlags;
|
|
18
23
|
private ensurePlatformSelectedAsync;
|
package/build/commands/submit.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
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 eas_json_1 = require("@expo/eas-json");
|
|
@@ -9,8 +10,6 @@ const generated_1 = require("../graphql/generated");
|
|
|
9
10
|
const AppPlatform_1 = require("../graphql/types/AppPlatform");
|
|
10
11
|
const log_1 = tslib_1.__importDefault(require("../log"));
|
|
11
12
|
const platform_1 = require("../platform");
|
|
12
|
-
const expoConfig_1 = require("../project/expoConfig");
|
|
13
|
-
const projectUtils_1 = require("../project/projectUtils");
|
|
14
13
|
const context_1 = require("../submit/context");
|
|
15
14
|
const submit_1 = require("../submit/submit");
|
|
16
15
|
const urls_1 = require("../submit/utils/urls");
|
|
@@ -19,28 +18,31 @@ const statuspageService_1 = require("../utils/statuspageService");
|
|
|
19
18
|
class Submit extends EasCommand_1.default {
|
|
20
19
|
async runAsync() {
|
|
21
20
|
const { flags: rawFlags } = await this.parse(Submit);
|
|
21
|
+
const { actor, projectConfig: { exp, projectId, projectDir }, } = await this.getContextAsync(Submit, {
|
|
22
|
+
nonInteractive: false,
|
|
23
|
+
});
|
|
22
24
|
const flags = this.sanitizeFlags(rawFlags);
|
|
23
|
-
const projectDir = await (0, projectUtils_1.findProjectRootAsync)();
|
|
24
|
-
const exp = (0, expoConfig_1.getExpoConfig)(projectDir);
|
|
25
|
-
const projectId = await (0, projectUtils_1.getProjectIdAsync)(exp);
|
|
26
25
|
await (0, statuspageService_1.maybeWarnAboutEasOutagesAsync)([generated_1.StatuspageServiceName.EasSubmit]);
|
|
27
26
|
const flagsWithPlatform = await this.ensurePlatformSelectedAsync(flags);
|
|
28
27
|
const platforms = (0, platform_1.toPlatforms)(flagsWithPlatform.requestedPlatform);
|
|
29
28
|
const submissionProfiles = await (0, profiles_1.getProfilesAsync)({
|
|
30
29
|
type: 'submit',
|
|
31
|
-
|
|
30
|
+
easJsonAccessor: new eas_json_1.EasJsonAccessor(projectDir),
|
|
32
31
|
platforms,
|
|
33
32
|
profileName: flagsWithPlatform.profile,
|
|
34
33
|
});
|
|
35
34
|
const submissions = [];
|
|
36
35
|
for (const submissionProfile of submissionProfiles) {
|
|
36
|
+
// this command doesn't make use of env when getting the project config
|
|
37
37
|
const ctx = await (0, context_1.createSubmissionContextAsync)({
|
|
38
38
|
platform: submissionProfile.platform,
|
|
39
39
|
projectDir,
|
|
40
|
-
projectId,
|
|
41
40
|
profile: submissionProfile.profile,
|
|
42
41
|
archiveFlags: flagsWithPlatform.archiveFlags,
|
|
43
42
|
nonInteractive: flagsWithPlatform.nonInteractive,
|
|
43
|
+
actor,
|
|
44
|
+
exp,
|
|
45
|
+
projectId,
|
|
44
46
|
});
|
|
45
47
|
if (submissionProfiles.length > 1) {
|
|
46
48
|
log_1.default.newLine();
|
|
@@ -91,6 +93,7 @@ class Submit extends EasCommand_1.default {
|
|
|
91
93
|
}
|
|
92
94
|
}
|
|
93
95
|
exports.default = Submit;
|
|
96
|
+
_a = Submit;
|
|
94
97
|
Submit.description = 'submit app binary to App Store and/or Play Store';
|
|
95
98
|
Submit.aliases = ['build:submit'];
|
|
96
99
|
Submit.flags = {
|
|
@@ -99,6 +102,7 @@ Submit.flags = {
|
|
|
99
102
|
options: ['android', 'ios', 'all'],
|
|
100
103
|
}),
|
|
101
104
|
profile: core_1.Flags.string({
|
|
105
|
+
char: 'e',
|
|
102
106
|
description: 'Name of the submit profile from eas.json. Defaults to "production" if defined in eas.json.',
|
|
103
107
|
}),
|
|
104
108
|
latest: core_1.Flags.boolean({
|
|
@@ -131,3 +135,8 @@ Submit.flags = {
|
|
|
131
135
|
description: 'Run command in non-interactive mode',
|
|
132
136
|
}),
|
|
133
137
|
};
|
|
138
|
+
Submit.contextDefinition = {
|
|
139
|
+
..._a.ContextOptions.LoggedIn,
|
|
140
|
+
..._a.ContextOptions.ProjectConfig,
|
|
141
|
+
..._a.ContextOptions.ProjectDir,
|
|
142
|
+
};
|
|
@@ -4,5 +4,8 @@ export default class UpdateConfigure extends EasCommand {
|
|
|
4
4
|
static flags: {
|
|
5
5
|
platform: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
6
6
|
};
|
|
7
|
+
static contextDefinition: {
|
|
8
|
+
projectConfig: import("../../commandUtils/context/ProjectConfigContextField").default;
|
|
9
|
+
};
|
|
7
10
|
runAsync(): Promise<void>;
|
|
8
11
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
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 config_1 = require("@expo/config");
|
|
@@ -11,7 +12,6 @@ const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasComm
|
|
|
11
12
|
const generated_1 = require("../../graphql/generated");
|
|
12
13
|
const log_1 = tslib_1.__importStar(require("../../log"));
|
|
13
14
|
const platform_1 = require("../../platform");
|
|
14
|
-
const expoConfig_1 = require("../../project/expoConfig");
|
|
15
15
|
const projectUtils_1 = require("../../project/projectUtils");
|
|
16
16
|
const workflow_1 = require("../../project/workflow");
|
|
17
17
|
const UpdatesModule_1 = require("../../update/android/UpdatesModule");
|
|
@@ -22,9 +22,10 @@ class UpdateConfigure extends EasCommand_1.default {
|
|
|
22
22
|
async runAsync() {
|
|
23
23
|
log_1.default.log('💡 The following process will configure your project to run EAS Update. These changes only apply to your local project files and you can safely revert them at any time.');
|
|
24
24
|
const { flags } = await this.parse(UpdateConfigure);
|
|
25
|
+
const { projectConfig: { projectId, exp, projectDir }, } = await this.getContextAsync(UpdateConfigure, {
|
|
26
|
+
nonInteractive: true,
|
|
27
|
+
});
|
|
25
28
|
const platform = flags.platform;
|
|
26
|
-
const projectDir = await (0, projectUtils_1.findProjectRootAsync)();
|
|
27
|
-
const exp = (0, expoConfig_1.getExpoConfig)(projectDir);
|
|
28
29
|
if (!(0, projectUtils_1.isExpoUpdatesInstalledOrAvailable)(projectDir, exp.sdkVersion)) {
|
|
29
30
|
await (0, projectUtils_1.installExpoUpdatesAsync)(projectDir);
|
|
30
31
|
}
|
|
@@ -40,17 +41,18 @@ class UpdateConfigure extends EasCommand_1.default {
|
|
|
40
41
|
android: androidWorkflow,
|
|
41
42
|
ios: iosWorkflow,
|
|
42
43
|
},
|
|
44
|
+
projectId,
|
|
43
45
|
});
|
|
44
46
|
log_1.default.withTick(`Configured ${chalk_1.default.bold('app.json')} for EAS Update`);
|
|
45
47
|
// configure native files for EAS Update
|
|
46
48
|
if ([platform_1.RequestedPlatform.Android, platform_1.RequestedPlatform.All].includes(platform) &&
|
|
47
49
|
androidWorkflow === eas_build_job_1.Workflow.GENERIC) {
|
|
48
|
-
await (0, UpdatesModule_1.syncUpdatesConfigurationAsync)(projectDir, updatedExp);
|
|
50
|
+
await (0, UpdatesModule_1.syncUpdatesConfigurationAsync)(projectDir, updatedExp, projectId);
|
|
49
51
|
log_1.default.withTick(`Configured ${chalk_1.default.bold('AndroidManifest.xml')} for EAS Update`);
|
|
50
52
|
}
|
|
51
53
|
if ([platform_1.RequestedPlatform.Ios, platform_1.RequestedPlatform.All].includes(platform) &&
|
|
52
54
|
iosWorkflow === eas_build_job_1.Workflow.GENERIC) {
|
|
53
|
-
await (0, UpdatesModule_2.syncUpdatesConfigurationAsync)(projectDir, updatedExp);
|
|
55
|
+
await (0, UpdatesModule_2.syncUpdatesConfigurationAsync)(projectDir, updatedExp, projectId);
|
|
54
56
|
log_1.default.withTick(`Configured ${chalk_1.default.bold('Expo.plist')} for EAS Update`);
|
|
55
57
|
}
|
|
56
58
|
log_1.default.addNewLineIfNone();
|
|
@@ -58,6 +60,7 @@ class UpdateConfigure extends EasCommand_1.default {
|
|
|
58
60
|
}
|
|
59
61
|
}
|
|
60
62
|
exports.default = UpdateConfigure;
|
|
63
|
+
_a = UpdateConfigure;
|
|
61
64
|
UpdateConfigure.description = 'configure the project to support EAS Update';
|
|
62
65
|
UpdateConfigure.flags = {
|
|
63
66
|
platform: core_1.Flags.enum({
|
|
@@ -67,9 +70,12 @@ UpdateConfigure.flags = {
|
|
|
67
70
|
default: 'all',
|
|
68
71
|
}),
|
|
69
72
|
};
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
+
UpdateConfigure.contextDefinition = {
|
|
74
|
+
..._a.ContextOptions.ProjectConfig,
|
|
75
|
+
};
|
|
76
|
+
async function configureAppJSONForEASUpdateAsync({ projectDir, exp, platform, workflows, projectId, }) {
|
|
77
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
|
78
|
+
// this command is non-interactive in the way it was designed
|
|
73
79
|
const easUpdateURL = (0, api_1.getEASUpdateURL)(projectId);
|
|
74
80
|
const updates = { ...exp.updates, url: easUpdateURL };
|
|
75
81
|
const androidDefaultRuntimeVersion = workflows['android'] === eas_build_job_1.Workflow.GENERIC
|
|
@@ -78,8 +84,8 @@ async function configureAppJSONForEASUpdateAsync({ projectDir, exp, platform, wo
|
|
|
78
84
|
const iosDefaultRuntimeVersion = workflows['ios'] === eas_build_job_1.Workflow.GENERIC
|
|
79
85
|
? DEFAULT_BARE_RUNTIME_VERSION
|
|
80
86
|
: DEFAULT_MANAGED_RUNTIME_VERSION;
|
|
81
|
-
const newAndroidRuntimeVersion = (
|
|
82
|
-
const newIosRuntimeVersion = (
|
|
87
|
+
const newAndroidRuntimeVersion = (_d = (_c = (_b = exp.android) === null || _b === void 0 ? void 0 : _b.runtimeVersion) !== null && _c !== void 0 ? _c : exp.runtimeVersion) !== null && _d !== void 0 ? _d : androidDefaultRuntimeVersion;
|
|
88
|
+
const newIosRuntimeVersion = (_g = (_f = (_e = exp.ios) === null || _e === void 0 ? void 0 : _e.runtimeVersion) !== null && _f !== void 0 ? _f : exp.runtimeVersion) !== null && _g !== void 0 ? _g : iosDefaultRuntimeVersion;
|
|
83
89
|
let newConfig;
|
|
84
90
|
let newConfigOnlyAddedValues;
|
|
85
91
|
switch (platform) {
|
|
@@ -188,13 +194,13 @@ async function configureAppJSONForEASUpdateAsync({ projectDir, exp, platform, wo
|
|
|
188
194
|
}
|
|
189
195
|
}
|
|
190
196
|
const result = await (0, config_1.modifyConfigAsync)(projectDir, newConfig);
|
|
191
|
-
const preexistingAndroidRuntimeVersion = (
|
|
192
|
-
const preexistingIosRuntimeVersion = (
|
|
197
|
+
const preexistingAndroidRuntimeVersion = (_j = (_h = exp.android) === null || _h === void 0 ? void 0 : _h.runtimeVersion) !== null && _j !== void 0 ? _j : exp.runtimeVersion;
|
|
198
|
+
const preexistingIosRuntimeVersion = (_l = (_k = exp.ios) === null || _k === void 0 ? void 0 : _k.runtimeVersion) !== null && _l !== void 0 ? _l : exp.runtimeVersion;
|
|
193
199
|
switch (result.type) {
|
|
194
200
|
case 'success':
|
|
195
|
-
if ((
|
|
201
|
+
if ((_m = exp.updates) === null || _m === void 0 ? void 0 : _m.url) {
|
|
196
202
|
if (exp.updates.url !== easUpdateURL) {
|
|
197
|
-
log_1.default.withTick(`Overwrote "${(
|
|
203
|
+
log_1.default.withTick(`Overwrote "${(_o = exp.updates) === null || _o === void 0 ? void 0 : _o.url}" with "${easUpdateURL}" for the updates.url value in app.json`);
|
|
198
204
|
}
|
|
199
205
|
}
|
|
200
206
|
else {
|
|
@@ -202,11 +208,11 @@ async function configureAppJSONForEASUpdateAsync({ projectDir, exp, platform, wo
|
|
|
202
208
|
}
|
|
203
209
|
if (!preexistingAndroidRuntimeVersion &&
|
|
204
210
|
[platform_1.RequestedPlatform.Android, platform_1.RequestedPlatform.All].includes(platform)) {
|
|
205
|
-
log_1.default.withTick(`Set ${platform_1.appPlatformDisplayNames[generated_1.AppPlatform.Android]} runtimeVersion to "${JSON.stringify((
|
|
211
|
+
log_1.default.withTick(`Set ${platform_1.appPlatformDisplayNames[generated_1.AppPlatform.Android]} runtimeVersion to "${JSON.stringify((_q = (_p = newConfig.android) === null || _p === void 0 ? void 0 : _p.runtimeVersion) !== null && _q !== void 0 ? _q : newConfig.runtimeVersion)}" in app.json`);
|
|
206
212
|
}
|
|
207
213
|
if (!preexistingIosRuntimeVersion &&
|
|
208
214
|
[platform_1.RequestedPlatform.Ios, platform_1.RequestedPlatform.All].includes(platform)) {
|
|
209
|
-
log_1.default.withTick(`Set ${platform_1.appPlatformDisplayNames[generated_1.AppPlatform.Ios]} runtimeVersion to "${JSON.stringify((
|
|
215
|
+
log_1.default.withTick(`Set ${platform_1.appPlatformDisplayNames[generated_1.AppPlatform.Ios]} runtimeVersion to "${JSON.stringify((_s = (_r = newConfig.ios) === null || _r === void 0 ? void 0 : _r.runtimeVersion) !== null && _s !== void 0 ? _s : newConfig.runtimeVersion)}" in app.json`);
|
|
210
216
|
}
|
|
211
217
|
break;
|
|
212
218
|
case 'warn': {
|
|
@@ -8,6 +8,7 @@ export default class UpdateDelete extends EasCommand {
|
|
|
8
8
|
}[];
|
|
9
9
|
static flags: {
|
|
10
10
|
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
11
12
|
};
|
|
12
13
|
runAsync(): Promise<void>;
|
|
13
14
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const core_1 = require("@oclif/core");
|
|
5
4
|
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
6
5
|
const graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag"));
|
|
7
6
|
const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
|
|
7
|
+
const flags_1 = require("../../commandUtils/flags");
|
|
8
8
|
const client_1 = require("../../graphql/client");
|
|
9
9
|
const log_1 = tslib_1.__importDefault(require("../../log"));
|
|
10
10
|
const prompts_1 = require("../../prompts");
|
|
@@ -24,11 +24,11 @@ async function deleteUpdateGroupAsync({ group, }) {
|
|
|
24
24
|
}
|
|
25
25
|
class UpdateDelete extends EasCommand_1.default {
|
|
26
26
|
async runAsync() {
|
|
27
|
-
const { args: { groupId: group }, flags: { json: jsonFlag }, } = await this.parse(UpdateDelete);
|
|
27
|
+
const { args: { groupId: group }, flags: { json: jsonFlag, 'non-interactive': nonInteractive }, } = await this.parse(UpdateDelete);
|
|
28
28
|
if (jsonFlag) {
|
|
29
29
|
(0, json_1.enableJsonOutput)();
|
|
30
30
|
}
|
|
31
|
-
|
|
31
|
+
if (!nonInteractive) {
|
|
32
32
|
const shouldAbort = await (0, prompts_1.confirmAsync)({
|
|
33
33
|
message: `🚨${chalk_1.default.red('CAUTION')}🚨\n\n` +
|
|
34
34
|
`${chalk_1.default.yellow(`This will delete all of the updates in group "${group}".`)} ${chalk_1.default.red('This is a permanent operation.')}\n\n` +
|
|
@@ -60,8 +60,5 @@ UpdateDelete.args = [
|
|
|
60
60
|
},
|
|
61
61
|
];
|
|
62
62
|
UpdateDelete.flags = {
|
|
63
|
-
|
|
64
|
-
description: `Return a json with the group ID of the deleted updates.`,
|
|
65
|
-
default: false,
|
|
66
|
-
}),
|
|
63
|
+
...flags_1.EasNonInteractiveAndJsonFlags,
|
|
67
64
|
};
|