eas-cli 2.1.0 → 2.2.1
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 +179 -133
- 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 +88 -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/ConfigureProvisioningProfile.js +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/ProvisioningProfileUtils.js +1 -1
- 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/SetUpAdhocProvisioningProfile.js +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/SetUpProvisioningProfile.js +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/ios/validators/validateProvisioningProfile.js +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/ios/target.d.ts +17 -2
- package/build/project/ios/target.js +51 -4
- 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
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DynamicProjectConfigContextField = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const expoConfig_1 = require("../../project/expoConfig");
|
|
6
|
+
const ContextField_1 = tslib_1.__importDefault(require("./ContextField"));
|
|
7
|
+
const findProjectDirAndVerifyProjectSetupAsync_1 = require("./contextUtils/findProjectDirAndVerifyProjectSetupAsync");
|
|
8
|
+
const getProjectIdAsync_1 = require("./contextUtils/getProjectIdAsync");
|
|
9
|
+
class DynamicProjectConfigContextField extends ContextField_1.default {
|
|
10
|
+
async getValueAsync({ nonInteractive }) {
|
|
11
|
+
return async (options) => {
|
|
12
|
+
const projectDir = await (0, findProjectDirAndVerifyProjectSetupAsync_1.findProjectDirAndVerifyProjectSetupAsync)();
|
|
13
|
+
const expBefore = (0, expoConfig_1.getExpoConfig)(projectDir, options);
|
|
14
|
+
const projectId = await (0, getProjectIdAsync_1.getProjectIdAsync)(expBefore, {
|
|
15
|
+
nonInteractive,
|
|
16
|
+
env: options === null || options === void 0 ? void 0 : options.env,
|
|
17
|
+
});
|
|
18
|
+
const exp = (0, expoConfig_1.getExpoConfig)(projectDir, options);
|
|
19
|
+
return {
|
|
20
|
+
exp,
|
|
21
|
+
projectDir,
|
|
22
|
+
projectId,
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.DynamicProjectConfigContextField = DynamicProjectConfigContextField;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ExpoConfig } from '@expo/config-types';
|
|
2
|
+
import ContextField, { ContextOptions } from './ContextField';
|
|
3
|
+
export declare class OptionalProjectConfigContextField extends ContextField<{
|
|
4
|
+
projectId: string;
|
|
5
|
+
exp: ExpoConfig;
|
|
6
|
+
projectDir: string;
|
|
7
|
+
} | undefined> {
|
|
8
|
+
getValueAsync({ nonInteractive }: ContextOptions): Promise<{
|
|
9
|
+
projectId: string;
|
|
10
|
+
exp: ExpoConfig;
|
|
11
|
+
projectDir: string;
|
|
12
|
+
} | undefined>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OptionalProjectConfigContextField = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const errors_1 = require("@expo/eas-json/build/errors");
|
|
6
|
+
const expoConfig_1 = require("../../project/expoConfig");
|
|
7
|
+
const ContextField_1 = tslib_1.__importDefault(require("./ContextField"));
|
|
8
|
+
const findProjectDirAndVerifyProjectSetupAsync_1 = require("./contextUtils/findProjectDirAndVerifyProjectSetupAsync");
|
|
9
|
+
const getProjectIdAsync_1 = require("./contextUtils/getProjectIdAsync");
|
|
10
|
+
class OptionalProjectConfigContextField extends ContextField_1.default {
|
|
11
|
+
async getValueAsync({ nonInteractive }) {
|
|
12
|
+
let projectDir;
|
|
13
|
+
try {
|
|
14
|
+
projectDir = await (0, findProjectDirAndVerifyProjectSetupAsync_1.findProjectDirAndVerifyProjectSetupAsync)();
|
|
15
|
+
if (!projectDir) {
|
|
16
|
+
return undefined;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
catch (e) {
|
|
20
|
+
if (e instanceof errors_1.InvalidEasJsonError) {
|
|
21
|
+
throw e;
|
|
22
|
+
}
|
|
23
|
+
return undefined;
|
|
24
|
+
}
|
|
25
|
+
const expBefore = (0, expoConfig_1.getExpoConfig)(projectDir);
|
|
26
|
+
const projectId = await (0, getProjectIdAsync_1.getProjectIdAsync)(expBefore, {
|
|
27
|
+
nonInteractive,
|
|
28
|
+
});
|
|
29
|
+
const exp = (0, expoConfig_1.getExpoConfig)(projectDir);
|
|
30
|
+
return {
|
|
31
|
+
exp,
|
|
32
|
+
projectDir,
|
|
33
|
+
projectId,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
exports.OptionalProjectConfigContextField = OptionalProjectConfigContextField;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ExpoConfig } from '@expo/config-types';
|
|
2
|
+
import ContextField, { ContextOptions } from './ContextField';
|
|
3
|
+
export default class ProjectConfigContextField extends ContextField<{
|
|
4
|
+
projectId: string;
|
|
5
|
+
exp: ExpoConfig;
|
|
6
|
+
projectDir: string;
|
|
7
|
+
}> {
|
|
8
|
+
getValueAsync({ nonInteractive }: ContextOptions): Promise<{
|
|
9
|
+
projectId: string;
|
|
10
|
+
exp: ExpoConfig;
|
|
11
|
+
projectDir: string;
|
|
12
|
+
}>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const expoConfig_1 = require("../../project/expoConfig");
|
|
5
|
+
const ContextField_1 = tslib_1.__importDefault(require("./ContextField"));
|
|
6
|
+
const findProjectDirAndVerifyProjectSetupAsync_1 = require("./contextUtils/findProjectDirAndVerifyProjectSetupAsync");
|
|
7
|
+
const getProjectIdAsync_1 = require("./contextUtils/getProjectIdAsync");
|
|
8
|
+
class ProjectConfigContextField extends ContextField_1.default {
|
|
9
|
+
async getValueAsync({ nonInteractive }) {
|
|
10
|
+
const projectDir = await (0, findProjectDirAndVerifyProjectSetupAsync_1.findProjectDirAndVerifyProjectSetupAsync)();
|
|
11
|
+
const expBefore = (0, expoConfig_1.getExpoConfig)(projectDir);
|
|
12
|
+
const projectId = await (0, getProjectIdAsync_1.getProjectIdAsync)(expBefore, {
|
|
13
|
+
nonInteractive,
|
|
14
|
+
});
|
|
15
|
+
const exp = (0, expoConfig_1.getExpoConfig)(projectDir);
|
|
16
|
+
return {
|
|
17
|
+
projectId,
|
|
18
|
+
exp,
|
|
19
|
+
projectDir,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.default = ProjectConfigContextField;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const ContextField_1 = tslib_1.__importDefault(require("./ContextField"));
|
|
5
|
+
const findProjectDirAndVerifyProjectSetupAsync_1 = require("./contextUtils/findProjectDirAndVerifyProjectSetupAsync");
|
|
6
|
+
class ProjectDirContextField extends ContextField_1.default {
|
|
7
|
+
async getValueAsync() {
|
|
8
|
+
return await (0, findProjectDirAndVerifyProjectSetupAsync_1.findProjectDirAndVerifyProjectSetupAsync)();
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
exports.default = ProjectDirContextField;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Actor } from '../../../user/User';
|
|
2
|
+
/**
|
|
3
|
+
* Ensure that there is a logged-in actor. Show a login prompt if not.
|
|
4
|
+
*
|
|
5
|
+
* @param nonInteractive whether the log-in prompt if logged-out should be interactive
|
|
6
|
+
* @returns logged-in Actor
|
|
7
|
+
*
|
|
8
|
+
* @deprecated Should not be used outside of context functions.
|
|
9
|
+
*/
|
|
10
|
+
export declare function ensureLoggedInAsync({ nonInteractive, }: {
|
|
11
|
+
nonInteractive: boolean;
|
|
12
|
+
}): Promise<Actor>;
|
|
13
|
+
/**
|
|
14
|
+
* Prompt the user to log in.
|
|
15
|
+
*
|
|
16
|
+
* @deprecated Should not be used outside of context functions, except in the AccountLogin command.
|
|
17
|
+
*/
|
|
18
|
+
export declare function showLoginPromptAsync({ nonInteractive, printNewLine, }?: {
|
|
19
|
+
nonInteractive?: boolean | undefined;
|
|
20
|
+
printNewLine?: boolean | undefined;
|
|
21
|
+
}): Promise<void>;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.showLoginPromptAsync = exports.ensureLoggedInAsync = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const core_1 = require("@oclif/core");
|
|
6
|
+
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
7
|
+
const nullthrows_1 = tslib_1.__importDefault(require("nullthrows"));
|
|
8
|
+
const api_1 = require("../../../api");
|
|
9
|
+
const log_1 = tslib_1.__importStar(require("../../../log"));
|
|
10
|
+
const prompts_1 = require("../../../prompts");
|
|
11
|
+
const User_1 = require("../../../user/User");
|
|
12
|
+
const otp_1 = require("../../../user/otp");
|
|
13
|
+
/**
|
|
14
|
+
* Ensure that there is a logged-in actor. Show a login prompt if not.
|
|
15
|
+
*
|
|
16
|
+
* @param nonInteractive whether the log-in prompt if logged-out should be interactive
|
|
17
|
+
* @returns logged-in Actor
|
|
18
|
+
*
|
|
19
|
+
* @deprecated Should not be used outside of context functions.
|
|
20
|
+
*/
|
|
21
|
+
async function ensureLoggedInAsync({ nonInteractive, }) {
|
|
22
|
+
let user;
|
|
23
|
+
try {
|
|
24
|
+
user = await (0, User_1.getUserAsync)();
|
|
25
|
+
}
|
|
26
|
+
catch { }
|
|
27
|
+
if (!user) {
|
|
28
|
+
log_1.default.warn('An Expo user account is required to proceed.');
|
|
29
|
+
await showLoginPromptAsync({ nonInteractive, printNewLine: true });
|
|
30
|
+
user = await (0, User_1.getUserAsync)();
|
|
31
|
+
}
|
|
32
|
+
return (0, nullthrows_1.default)(user);
|
|
33
|
+
}
|
|
34
|
+
exports.ensureLoggedInAsync = ensureLoggedInAsync;
|
|
35
|
+
/**
|
|
36
|
+
* Prompt the user to log in.
|
|
37
|
+
*
|
|
38
|
+
* @deprecated Should not be used outside of context functions, except in the AccountLogin command.
|
|
39
|
+
*/
|
|
40
|
+
async function showLoginPromptAsync({ nonInteractive = false, printNewLine = false, } = {}) {
|
|
41
|
+
if (nonInteractive) {
|
|
42
|
+
core_1.Errors.error(`Either log in with ${chalk_1.default.bold('eas login')} or set the ${chalk_1.default.bold('EXPO_TOKEN')} environment variable if you're using EAS CLI on CI (${(0, log_1.learnMore)('https://docs.expo.dev/accounts/programmatic-access/', { dim: false })})`);
|
|
43
|
+
}
|
|
44
|
+
if (printNewLine) {
|
|
45
|
+
log_1.default.newLine();
|
|
46
|
+
}
|
|
47
|
+
log_1.default.log('Log in to EAS');
|
|
48
|
+
const { username, password } = await (0, prompts_1.promptAsync)([
|
|
49
|
+
{
|
|
50
|
+
type: 'text',
|
|
51
|
+
name: 'username',
|
|
52
|
+
message: 'Email or username',
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
type: 'password',
|
|
56
|
+
name: 'password',
|
|
57
|
+
message: 'Password',
|
|
58
|
+
},
|
|
59
|
+
]);
|
|
60
|
+
try {
|
|
61
|
+
await (0, User_1.loginAsync)({
|
|
62
|
+
username,
|
|
63
|
+
password,
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
catch (e) {
|
|
67
|
+
if (e instanceof api_1.ApiV2Error && e.expoApiV2ErrorCode === 'ONE_TIME_PASSWORD_REQUIRED') {
|
|
68
|
+
await (0, otp_1.retryUsernamePasswordAuthWithOTPAsync)(username, password, e.expoApiV2ErrorMetadata);
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
throw e;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
exports.showLoginPromptAsync = showLoginPromptAsync;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @returns the project root directory.
|
|
3
|
+
*
|
|
4
|
+
* @deprecated Should not be used outside of context functions.
|
|
5
|
+
*/
|
|
6
|
+
export declare function findProjectRootAsync({ cwd, defaultToProcessCwd, }?: {
|
|
7
|
+
cwd?: string;
|
|
8
|
+
defaultToProcessCwd?: boolean;
|
|
9
|
+
}): Promise<string>;
|
|
10
|
+
/**
|
|
11
|
+
* Determine the project root directory and ensure some constraints about the project setup
|
|
12
|
+
* like CLI version and dependencies.
|
|
13
|
+
* @returns the project root directory
|
|
14
|
+
*
|
|
15
|
+
* @deprecated Should not be used outside of context functions.
|
|
16
|
+
*/
|
|
17
|
+
export declare function findProjectDirAndVerifyProjectSetupAsync(): Promise<string>;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.findProjectDirAndVerifyProjectSetupAsync = exports.findProjectRootAsync = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const eas_json_1 = require("@expo/eas-json");
|
|
6
|
+
const PackageManagerUtils = tslib_1.__importStar(require("@expo/package-manager"));
|
|
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"));
|
|
10
|
+
const pkg_dir_1 = tslib_1.__importDefault(require("pkg-dir"));
|
|
11
|
+
const semver_1 = tslib_1.__importDefault(require("semver"));
|
|
12
|
+
const log_1 = require("../../../log");
|
|
13
|
+
const easCli_1 = require("../../../utils/easCli");
|
|
14
|
+
const vcs_1 = require("../../../vcs");
|
|
15
|
+
const git_1 = tslib_1.__importDefault(require("../../../vcs/clients/git"));
|
|
16
|
+
async function applyCliConfigAsync(projectDir) {
|
|
17
|
+
const easJsonAccessor = new eas_json_1.EasJsonAccessor(projectDir);
|
|
18
|
+
const config = await eas_json_1.EasJsonUtils.getCliConfigAsync(easJsonAccessor);
|
|
19
|
+
if ((config === null || config === void 0 ? void 0 : config.version) && !semver_1.default.satisfies(easCli_1.easCliVersion, config.version)) {
|
|
20
|
+
throw new Error(`You are on eas-cli@${easCli_1.easCliVersion} which does not satisfy the CLI version constraint in eas.json (${config.version})`);
|
|
21
|
+
}
|
|
22
|
+
if (config === null || config === void 0 ? void 0 : config.requireCommit) {
|
|
23
|
+
(0, vcs_1.setVcsClient)(new git_1.default());
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
async function ensureEasCliIsNotInDependenciesAsync(projectDir) {
|
|
27
|
+
var _a;
|
|
28
|
+
let printCliVersionWarning = false;
|
|
29
|
+
const consoleWarn = (msg) => {
|
|
30
|
+
if (msg) {
|
|
31
|
+
// eslint-disable-next-line no-console
|
|
32
|
+
console.warn(chalk_1.default.yellow(msg));
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
// eslint-disable-next-line no-console
|
|
36
|
+
console.warn();
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
if (await isEasCliInDependenciesAsync(projectDir)) {
|
|
40
|
+
printCliVersionWarning = true;
|
|
41
|
+
consoleWarn(`Found ${chalk_1.default.bold('eas-cli')} in your project dependencies.`);
|
|
42
|
+
}
|
|
43
|
+
const maybeRepoRoot = (_a = PackageManagerUtils.findWorkspaceRoot(projectDir)) !== null && _a !== void 0 ? _a : projectDir;
|
|
44
|
+
if (maybeRepoRoot !== projectDir && (await isEasCliInDependenciesAsync(maybeRepoRoot))) {
|
|
45
|
+
printCliVersionWarning = true;
|
|
46
|
+
consoleWarn(`Found ${chalk_1.default.bold('eas-cli')} in your monorepo dependencies.`);
|
|
47
|
+
}
|
|
48
|
+
if (printCliVersionWarning) {
|
|
49
|
+
consoleWarn(`It's recommended to use the ${chalk_1.default.bold('"cli.version"')} field in eas.json to enforce the ${chalk_1.default.bold('eas-cli')} version for your project.`);
|
|
50
|
+
consoleWarn((0, log_1.learnMore)('https://github.com/expo/eas-cli#enforcing-eas-cli-version-for-your-project'));
|
|
51
|
+
consoleWarn();
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
async function isEasCliInDependenciesAsync(dir) {
|
|
55
|
+
var _a, _b;
|
|
56
|
+
const packageJsonPath = path_1.default.join(dir, 'package.json');
|
|
57
|
+
const packageJson = JSON.parse(await fs_extra_1.default.readFile(packageJsonPath, 'utf8'));
|
|
58
|
+
return (((_a = packageJson === null || packageJson === void 0 ? void 0 : packageJson.dependencies) === null || _a === void 0 ? void 0 : _a['eas-cli']) !== undefined ||
|
|
59
|
+
((_b = packageJson === null || packageJson === void 0 ? void 0 : packageJson.devDependencies) === null || _b === void 0 ? void 0 : _b['eas-cli']) !== undefined);
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* @returns the project root directory.
|
|
63
|
+
*
|
|
64
|
+
* @deprecated Should not be used outside of context functions.
|
|
65
|
+
*/
|
|
66
|
+
async function findProjectRootAsync({ cwd, defaultToProcessCwd = false, } = {}) {
|
|
67
|
+
const projectRootDir = await (0, pkg_dir_1.default)(cwd);
|
|
68
|
+
if (!projectRootDir) {
|
|
69
|
+
if (!defaultToProcessCwd) {
|
|
70
|
+
throw new Error('Run this command inside a project directory.');
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
return process.cwd();
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
let vcsRoot;
|
|
78
|
+
try {
|
|
79
|
+
vcsRoot = path_1.default.normalize(await (0, vcs_1.getVcsClient)().getRootPathAsync());
|
|
80
|
+
}
|
|
81
|
+
catch { }
|
|
82
|
+
if (vcsRoot && vcsRoot.startsWith(projectRootDir) && vcsRoot !== projectRootDir) {
|
|
83
|
+
throw new Error(`package.json is outside of the current git repository (project root: ${projectRootDir}, git root: ${vcsRoot}.`);
|
|
84
|
+
}
|
|
85
|
+
return projectRootDir;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
exports.findProjectRootAsync = findProjectRootAsync;
|
|
89
|
+
/**
|
|
90
|
+
* Determine the project root directory and ensure some constraints about the project setup
|
|
91
|
+
* like CLI version and dependencies.
|
|
92
|
+
* @returns the project root directory
|
|
93
|
+
*
|
|
94
|
+
* @deprecated Should not be used outside of context functions.
|
|
95
|
+
*/
|
|
96
|
+
async function findProjectDirAndVerifyProjectSetupAsync() {
|
|
97
|
+
const projectDir = await findProjectRootAsync();
|
|
98
|
+
await applyCliConfigAsync(projectDir);
|
|
99
|
+
await ensureEasCliIsNotInDependenciesAsync(projectDir);
|
|
100
|
+
return projectDir;
|
|
101
|
+
}
|
|
102
|
+
exports.findProjectDirAndVerifyProjectSetupAsync = findProjectDirAndVerifyProjectSetupAsync;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ExpoConfig } from '@expo/config-types';
|
|
2
|
+
import { Env } from '@expo/eas-build-job';
|
|
3
|
+
/**
|
|
4
|
+
* Save an EAS project ID to the appropriate field in the app config.
|
|
5
|
+
*
|
|
6
|
+
* @deprecated Should not be used outside of context functions except in the init command.
|
|
7
|
+
*/
|
|
8
|
+
export declare function saveProjectIdToAppConfigAsync(projectDir: string, projectId: string, options?: {
|
|
9
|
+
env?: Env;
|
|
10
|
+
}): Promise<void>;
|
|
11
|
+
/**
|
|
12
|
+
* Get the EAS project ID from the app config. If the project ID is not set in the config,
|
|
13
|
+
* use the owner/slug to identify an EAS project on the server (asking for confirmation first),
|
|
14
|
+
* and attempt to save the EAS project ID to the appropriate field in the app config. If unable to
|
|
15
|
+
* save to the app config, throw an error.
|
|
16
|
+
*
|
|
17
|
+
* @returns the EAS project ID
|
|
18
|
+
*
|
|
19
|
+
* @deprecated Should not be used outside of context functions.
|
|
20
|
+
*/
|
|
21
|
+
export declare function getProjectIdAsync(exp: ExpoConfig, options: {
|
|
22
|
+
env?: Env;
|
|
23
|
+
nonInteractive: boolean;
|
|
24
|
+
}): Promise<string>;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getProjectIdAsync = exports.saveProjectIdToAppConfigAsync = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const config_1 = require("@expo/config");
|
|
6
|
+
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
7
|
+
const AppQuery_1 = require("../../../graphql/queries/AppQuery");
|
|
8
|
+
const log_1 = tslib_1.__importStar(require("../../../log"));
|
|
9
|
+
const ora_1 = require("../../../ora");
|
|
10
|
+
const expoConfig_1 = require("../../../project/expoConfig");
|
|
11
|
+
const fetchOrCreateProjectIDForWriteToConfigWithConfirmationAsync_1 = require("../../../project/fetchOrCreateProjectIDForWriteToConfigWithConfirmationAsync");
|
|
12
|
+
const projectUtils_1 = require("../../../project/projectUtils");
|
|
13
|
+
const ensureLoggedInAsync_1 = require("./ensureLoggedInAsync");
|
|
14
|
+
const findProjectDirAndVerifyProjectSetupAsync_1 = require("./findProjectDirAndVerifyProjectSetupAsync");
|
|
15
|
+
/**
|
|
16
|
+
* Save an EAS project ID to the appropriate field in the app config.
|
|
17
|
+
*
|
|
18
|
+
* @deprecated Should not be used outside of context functions except in the init command.
|
|
19
|
+
*/
|
|
20
|
+
async function saveProjectIdToAppConfigAsync(projectDir, projectId, options = {}) {
|
|
21
|
+
var _a;
|
|
22
|
+
const exp = (0, expoConfig_1.getExpoConfig)(projectDir, options);
|
|
23
|
+
const result = await (0, config_1.modifyConfigAsync)(projectDir, {
|
|
24
|
+
extra: { ...exp.extra, eas: { ...(_a = exp.extra) === null || _a === void 0 ? void 0 : _a.eas, projectId } },
|
|
25
|
+
});
|
|
26
|
+
switch (result.type) {
|
|
27
|
+
case 'success':
|
|
28
|
+
break;
|
|
29
|
+
case 'warn': {
|
|
30
|
+
log_1.default.warn();
|
|
31
|
+
log_1.default.warn(`Warning: Your project uses dynamic app configuration, and the EAS project ID can't automatically be added to it.`);
|
|
32
|
+
log_1.default.warn(chalk_1.default.dim('https://docs.expo.dev/workflow/configuration/#dynamic-configuration-with-appconfigjs'));
|
|
33
|
+
log_1.default.warn();
|
|
34
|
+
log_1.default.warn(`To complete the setup process, set "${chalk_1.default.bold('extra.eas.projectId')}" in your ${chalk_1.default.bold((0, config_1.getProjectConfigDescription)(projectDir))}:`);
|
|
35
|
+
log_1.default.warn();
|
|
36
|
+
log_1.default.warn(chalk_1.default.bold(JSON.stringify({ expo: { extra: { eas: { projectId } } } }, null, 2)));
|
|
37
|
+
log_1.default.warn();
|
|
38
|
+
throw new Error(result.message);
|
|
39
|
+
}
|
|
40
|
+
case 'fail':
|
|
41
|
+
throw new Error(result.message);
|
|
42
|
+
default:
|
|
43
|
+
throw new Error('Unexpected result type from modifyConfigAsync');
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
exports.saveProjectIdToAppConfigAsync = saveProjectIdToAppConfigAsync;
|
|
47
|
+
/**
|
|
48
|
+
* Get the EAS project ID from the app config. If the project ID is not set in the config,
|
|
49
|
+
* use the owner/slug to identify an EAS project on the server (asking for confirmation first),
|
|
50
|
+
* and attempt to save the EAS project ID to the appropriate field in the app config. If unable to
|
|
51
|
+
* save to the app config, throw an error.
|
|
52
|
+
*
|
|
53
|
+
* @returns the EAS project ID
|
|
54
|
+
*
|
|
55
|
+
* @deprecated Should not be used outside of context functions.
|
|
56
|
+
*/
|
|
57
|
+
async function getProjectIdAsync(exp, options) {
|
|
58
|
+
var _a, _b;
|
|
59
|
+
const localProjectId = (_b = (_a = exp.extra) === null || _a === void 0 ? void 0 : _a.eas) === null || _b === void 0 ? void 0 : _b.projectId;
|
|
60
|
+
if (localProjectId) {
|
|
61
|
+
// check that the local project ID matches account and slug
|
|
62
|
+
const appForProjectId = await AppQuery_1.AppQuery.byIdAsync(localProjectId);
|
|
63
|
+
if (exp.owner && exp.owner !== appForProjectId.ownerAccount.name) {
|
|
64
|
+
throw new Error(`Project config: Project identified by "extra.eas.projectId" (${appForProjectId.ownerAccount.name}) is not owned by owner specified in the "owner" field (${exp.owner}). ${(0, log_1.learnMore)('https://expo.fyi/eas-project-id')}`);
|
|
65
|
+
}
|
|
66
|
+
if (exp.slug && exp.slug !== appForProjectId.slug) {
|
|
67
|
+
throw new Error(`Project config: Slug for project identified by "extra.eas.projectId" (${appForProjectId.slug}) does not match the "slug" field (${exp.slug}). ${(0, log_1.learnMore)('https://expo.fyi/eas-project-id')}`);
|
|
68
|
+
}
|
|
69
|
+
return localProjectId;
|
|
70
|
+
}
|
|
71
|
+
const projectDir = await (0, findProjectDirAndVerifyProjectSetupAsync_1.findProjectRootAsync)();
|
|
72
|
+
if (!projectDir) {
|
|
73
|
+
throw new Error('This command must be run inside a project directory.');
|
|
74
|
+
}
|
|
75
|
+
log_1.default.warn('EAS project not configured.');
|
|
76
|
+
const getAccountNameForEASProjectSync = (exp, user) => {
|
|
77
|
+
if (exp.owner) {
|
|
78
|
+
return exp.owner;
|
|
79
|
+
}
|
|
80
|
+
switch (user.__typename) {
|
|
81
|
+
case 'User':
|
|
82
|
+
return user.username;
|
|
83
|
+
case 'Robot':
|
|
84
|
+
throw new Error('The "owner" manifest property is required when using robot users. See: https://docs.expo.dev/versions/latest/config/app/#owner');
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
const actor = await (0, ensureLoggedInAsync_1.ensureLoggedInAsync)({
|
|
88
|
+
nonInteractive: options.nonInteractive,
|
|
89
|
+
});
|
|
90
|
+
const projectId = await (0, fetchOrCreateProjectIDForWriteToConfigWithConfirmationAsync_1.fetchOrCreateProjectIDForWriteToConfigWithConfirmationAsync)({
|
|
91
|
+
accountName: getAccountNameForEASProjectSync(exp, actor),
|
|
92
|
+
projectName: exp.slug,
|
|
93
|
+
privacy: (0, projectUtils_1.toAppPrivacy)(exp.privacy),
|
|
94
|
+
}, {
|
|
95
|
+
nonInteractive: options.nonInteractive,
|
|
96
|
+
}, actor);
|
|
97
|
+
const spinner = (0, ora_1.ora)(`Linking local project to EAS project ${projectId}`).start();
|
|
98
|
+
try {
|
|
99
|
+
await saveProjectIdToAppConfigAsync(projectDir, projectId, options);
|
|
100
|
+
spinner.succeed(`Linked local project to EAS project ${projectId}`);
|
|
101
|
+
}
|
|
102
|
+
catch (e) {
|
|
103
|
+
spinner.fail();
|
|
104
|
+
throw e;
|
|
105
|
+
}
|
|
106
|
+
return projectId;
|
|
107
|
+
}
|
|
108
|
+
exports.getProjectIdAsync = getProjectIdAsync;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const EasNonInteractiveAndJsonFlags: {
|
|
2
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
3
|
+
'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
4
|
+
};
|
|
5
|
+
export declare const EASNonInteractiveFlag: {
|
|
6
|
+
'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
7
|
+
};
|
|
8
|
+
export declare const EasJsonOnlyFlag: {
|
|
9
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EasJsonOnlyFlag = exports.EASNonInteractiveFlag = exports.EasNonInteractiveAndJsonFlags = void 0;
|
|
4
|
+
const core_1 = require("@oclif/core");
|
|
5
|
+
exports.EasNonInteractiveAndJsonFlags = {
|
|
6
|
+
json: core_1.Flags.boolean({
|
|
7
|
+
description: 'Enable JSON output, non-JSON messages will be printed to stderr.',
|
|
8
|
+
dependsOn: ['non-interactive'],
|
|
9
|
+
}),
|
|
10
|
+
'non-interactive': core_1.Flags.boolean({
|
|
11
|
+
description: 'Run the command in non-interactive mode.',
|
|
12
|
+
}),
|
|
13
|
+
};
|
|
14
|
+
exports.EASNonInteractiveFlag = {
|
|
15
|
+
'non-interactive': core_1.Flags.boolean({
|
|
16
|
+
description: 'Run the command in non-interactive mode.',
|
|
17
|
+
}),
|
|
18
|
+
};
|
|
19
|
+
exports.EasJsonOnlyFlag = {
|
|
20
|
+
json: core_1.Flags.boolean({
|
|
21
|
+
description: 'Enable JSON output, non-JSON messages will be printed to stderr.',
|
|
22
|
+
}),
|
|
23
|
+
};
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
import { EasNonInteractiveAndJsonFlags } from './flags';
|
|
2
|
+
export declare const getPaginatedQueryOptions: (flags: Partial<Record<keyof typeof EasPaginatedQueryFlags | keyof typeof EasNonInteractiveAndJsonFlags, any>>) => PaginatedQueryOptions;
|
|
3
|
+
export declare const getLimitFlagWithCustomValues: ({ defaultTo, limit, }: {
|
|
4
|
+
defaultTo: number;
|
|
5
|
+
limit: number;
|
|
6
|
+
}) => any;
|
|
2
7
|
export declare const EasPaginatedQueryFlags: {
|
|
3
8
|
offset: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined>;
|
|
4
|
-
limit:
|
|
5
|
-
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
6
|
-
'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
9
|
+
limit: any;
|
|
7
10
|
};
|
|
8
11
|
export declare type PaginatedQueryOptions = {
|
|
9
12
|
nonInteractive: boolean;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EasPaginatedQueryFlags = exports.getPaginatedQueryOptions = void 0;
|
|
3
|
+
exports.EasPaginatedQueryFlags = exports.getLimitFlagWithCustomValues = exports.getPaginatedQueryOptions = void 0;
|
|
4
4
|
const core_1 = require("@oclif/core");
|
|
5
5
|
const getPaginatedQueryOptions = (flags) => {
|
|
6
6
|
var _a, _b, _c;
|
|
7
7
|
return {
|
|
8
|
-
json: (_a = flags.json) !== null && _a !== void 0 ? _a : false,
|
|
9
|
-
offset: (_b = flags.offset) !== null && _b !== void 0 ? _b : 0,
|
|
10
|
-
nonInteractive: (_c = flags['non-interactive']) !== null && _c !== void 0 ? _c : false,
|
|
11
8
|
...('limit' in flags && { limit: flags.limit }),
|
|
9
|
+
offset: (_a = flags.offset) !== null && _a !== void 0 ? _a : 0,
|
|
10
|
+
nonInteractive: (_b = flags['non-interactive']) !== null && _b !== void 0 ? _b : false,
|
|
11
|
+
json: (_c = flags.json) !== null && _c !== void 0 ? _c : false,
|
|
12
12
|
};
|
|
13
13
|
};
|
|
14
14
|
exports.getPaginatedQueryOptions = getPaginatedQueryOptions;
|
|
@@ -22,21 +22,17 @@ const parseFlagInputStringAsInteger = (input, flagName, lowerLimit, upperLimit)
|
|
|
22
22
|
}
|
|
23
23
|
return inputAsNumber;
|
|
24
24
|
};
|
|
25
|
+
const getLimitFlagWithCustomValues = ({ defaultTo, limit, }) => core_1.Flags.integer({
|
|
26
|
+
description: `The number of items to fetch each query. Defaults to ${defaultTo} and is capped at ${limit}.`,
|
|
27
|
+
// eslint-disable-next-line async-protect/async-suffix
|
|
28
|
+
parse: async (input) => parseFlagInputStringAsInteger(input, 'limit', 1, limit),
|
|
29
|
+
});
|
|
30
|
+
exports.getLimitFlagWithCustomValues = getLimitFlagWithCustomValues;
|
|
25
31
|
exports.EasPaginatedQueryFlags = {
|
|
26
32
|
offset: core_1.Flags.integer({
|
|
27
33
|
description: 'Start queries from specified index. Use for paginating results. Defaults to 0.',
|
|
28
34
|
// eslint-disable-next-line async-protect/async-suffix
|
|
29
35
|
parse: async (input) => parseFlagInputStringAsInteger(input, 'offset', 0, Number.MAX_SAFE_INTEGER),
|
|
30
36
|
}),
|
|
31
|
-
limit:
|
|
32
|
-
description: 'The number of query items to list at once. The default value is 50 (the maximum is 100). Using a lower value may help increase command speed.',
|
|
33
|
-
// eslint-disable-next-line async-protect/async-suffix
|
|
34
|
-
parse: async (input) => parseFlagInputStringAsInteger(input, 'limit', 1, 100),
|
|
35
|
-
}),
|
|
36
|
-
json: core_1.Flags.boolean({
|
|
37
|
-
description: 'Enable JSON output, non-JSON messages will be printed to stderr.',
|
|
38
|
-
}),
|
|
39
|
-
'non-interactive': core_1.Flags.boolean({
|
|
40
|
-
description: 'Run the command in non-interactive mode.',
|
|
41
|
-
}),
|
|
37
|
+
limit: (0, exports.getLimitFlagWithCustomValues)({ defaultTo: 50, limit: 100 }),
|
|
42
38
|
};
|
|
@@ -2,7 +2,5 @@ import EasCommand from '../../commandUtils/EasCommand';
|
|
|
2
2
|
export default class AccountLogin extends EasCommand {
|
|
3
3
|
static description: string;
|
|
4
4
|
static aliases: string[];
|
|
5
|
-
protected mustBeRunInsideProject: boolean;
|
|
6
|
-
protected requiresAuthentication: boolean;
|
|
7
5
|
runAsync(): Promise<void>;
|
|
8
6
|
}
|
|
@@ -2,16 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
|
|
5
|
+
const ensureLoggedInAsync_1 = require("../../commandUtils/context/contextUtils/ensureLoggedInAsync");
|
|
5
6
|
const log_1 = tslib_1.__importDefault(require("../../log"));
|
|
6
|
-
const actions_1 = require("../../user/actions");
|
|
7
7
|
class AccountLogin extends EasCommand_1.default {
|
|
8
|
-
constructor() {
|
|
9
|
-
super(...arguments);
|
|
10
|
-
this.mustBeRunInsideProject = false;
|
|
11
|
-
this.requiresAuthentication = false;
|
|
12
|
-
}
|
|
13
8
|
async runAsync() {
|
|
14
|
-
await (0,
|
|
9
|
+
await (0, ensureLoggedInAsync_1.showLoginPromptAsync)();
|
|
15
10
|
log_1.default.log('Logged in');
|
|
16
11
|
}
|
|
17
12
|
}
|
|
@@ -2,7 +2,5 @@ import EasCommand from '../../commandUtils/EasCommand';
|
|
|
2
2
|
export default class AccountLogout extends EasCommand {
|
|
3
3
|
static description: string;
|
|
4
4
|
static aliases: string[];
|
|
5
|
-
protected mustBeRunInsideProject: boolean;
|
|
6
|
-
protected requiresAuthentication: boolean;
|
|
7
5
|
runAsync(): Promise<void>;
|
|
8
6
|
}
|
|
@@ -5,11 +5,6 @@ const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasComm
|
|
|
5
5
|
const log_1 = tslib_1.__importDefault(require("../../log"));
|
|
6
6
|
const User_1 = require("../../user/User");
|
|
7
7
|
class AccountLogout extends EasCommand_1.default {
|
|
8
|
-
constructor() {
|
|
9
|
-
super(...arguments);
|
|
10
|
-
this.mustBeRunInsideProject = false;
|
|
11
|
-
this.requiresAuthentication = false;
|
|
12
|
-
}
|
|
13
8
|
async runAsync() {
|
|
14
9
|
await (0, User_1.logoutAsync)();
|
|
15
10
|
log_1.default.log('Logged out');
|
|
@@ -2,7 +2,5 @@ import EasCommand from '../../commandUtils/EasCommand';
|
|
|
2
2
|
export default class AccountView extends EasCommand {
|
|
3
3
|
static description: string;
|
|
4
4
|
static aliases: string[];
|
|
5
|
-
protected mustBeRunInsideProject: boolean;
|
|
6
|
-
protected requiresAuthentication: boolean;
|
|
7
5
|
runAsync(): Promise<void>;
|
|
8
6
|
}
|