eas-cli 12.5.4 → 12.6.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 +131 -60
- package/build/build/evaluateConfigWithEnvVarsAsync.js +27 -11
- package/build/channel/queries.js +12 -3
- package/build/commandUtils/EasCommand.d.ts +36 -5
- package/build/commandUtils/EasCommand.js +27 -2
- package/build/commandUtils/context/ContextField.d.ts +5 -0
- package/build/commandUtils/context/DynamicLoggedInContextField.d.ts +14 -0
- package/build/commandUtils/context/DynamicLoggedInContextField.js +25 -0
- package/build/commandUtils/context/DynamicProjectConfigContextField.d.ts +2 -2
- package/build/commandUtils/context/DynamicProjectConfigContextField.js +40 -2
- package/build/commandUtils/context/LoggedInContextField.d.ts +7 -7
- package/build/commandUtils/context/LoggedInContextField.js +2 -1
- package/build/commandUtils/context/MaybeLoggedInContextField.d.ts +9 -7
- package/build/commandUtils/context/MaybeLoggedInContextField.js +1 -0
- package/build/commandUtils/context/OptionalPrivateProjectConfigContextField.d.ts +1 -1
- package/build/commandUtils/context/OptionalPrivateProjectConfigContextField.js +17 -2
- package/build/commandUtils/context/PrivateProjectConfigContextField.d.ts +1 -1
- package/build/commandUtils/context/PrivateProjectConfigContextField.js +17 -2
- package/build/commandUtils/context/ProjectIdContextField.d.ts +4 -0
- package/build/commandUtils/context/ProjectIdContextField.js +19 -0
- package/build/commandUtils/context/ServerSideEnvironmentVariablesContextField.d.ts +6 -0
- package/build/commandUtils/context/ServerSideEnvironmentVariablesContextField.js +36 -0
- package/build/commandUtils/context/contextUtils/loadServerSideEnvironmentVariablesAsync.d.ts +7 -0
- package/build/commandUtils/context/contextUtils/loadServerSideEnvironmentVariablesAsync.js +42 -0
- package/build/commands/account/view.d.ts +0 -1
- package/build/commands/account/view.js +2 -3
- package/build/commands/branch/create.d.ts +1 -1
- package/build/commands/branch/create.js +2 -2
- package/build/commands/branch/delete.d.ts +1 -1
- package/build/commands/branch/delete.js +2 -2
- package/build/commands/branch/list.d.ts +1 -1
- package/build/commands/branch/list.js +2 -2
- package/build/commands/branch/rename.d.ts +1 -1
- package/build/commands/branch/rename.js +2 -2
- package/build/commands/branch/view.d.ts +1 -1
- package/build/commands/branch/view.js +2 -2
- package/build/commands/build/cancel.d.ts +1 -1
- package/build/commands/build/cancel.js +2 -2
- package/build/commands/build/configure.js +1 -0
- package/build/commands/build/delete.d.ts +1 -1
- package/build/commands/build/delete.js +2 -2
- package/build/commands/build/index.js +1 -0
- package/build/commands/build/inspect.js +1 -0
- package/build/commands/build/internal.js +1 -0
- package/build/commands/build/list.d.ts +1 -1
- package/build/commands/build/list.js +2 -2
- package/build/commands/build/resign.js +1 -0
- package/build/commands/build/run.d.ts +1 -2
- package/build/commands/build/run.js +2 -3
- package/build/commands/build/version/get.js +1 -0
- package/build/commands/build/version/set.js +1 -0
- package/build/commands/build/version/sync.js +1 -0
- package/build/commands/build/view.d.ts +1 -1
- package/build/commands/build/view.js +2 -2
- package/build/commands/channel/create.d.ts +1 -1
- package/build/commands/channel/create.js +2 -2
- package/build/commands/channel/delete.d.ts +1 -1
- package/build/commands/channel/delete.js +2 -2
- package/build/commands/channel/edit.d.ts +1 -1
- package/build/commands/channel/edit.js +2 -2
- package/build/commands/channel/list.d.ts +1 -1
- package/build/commands/channel/list.js +2 -2
- package/build/commands/channel/pause.d.ts +22 -0
- package/build/commands/channel/pause.js +90 -0
- package/build/commands/channel/resume.d.ts +22 -0
- package/build/commands/channel/resume.js +90 -0
- package/build/commands/channel/rollout.js +1 -0
- package/build/commands/channel/view.d.ts +1 -1
- package/build/commands/channel/view.js +2 -2
- package/build/commands/config.d.ts +1 -1
- package/build/commands/config.js +4 -7
- package/build/commands/credentials/configure-build.js +1 -0
- package/build/commands/credentials/index.d.ts +1 -1
- package/build/commands/credentials/index.js +2 -1
- package/build/commands/device/create.d.ts +1 -1
- package/build/commands/device/create.js +2 -1
- package/build/commands/device/delete.d.ts +1 -1
- package/build/commands/device/delete.js +2 -2
- package/build/commands/device/list.d.ts +1 -1
- package/build/commands/device/list.js +2 -2
- package/build/commands/device/rename.d.ts +1 -1
- package/build/commands/device/rename.js +2 -2
- package/build/commands/device/view.d.ts +1 -1
- package/build/commands/device/view.js +2 -2
- package/build/commands/env/create.d.ts +1 -1
- package/build/commands/env/create.js +8 -3
- package/build/commands/env/delete.d.ts +1 -1
- package/build/commands/env/delete.js +2 -2
- package/build/commands/env/exec.d.ts +1 -1
- package/build/commands/env/exec.js +2 -2
- package/build/commands/env/get.d.ts +1 -1
- package/build/commands/env/get.js +2 -2
- package/build/commands/env/link.d.ts +1 -1
- package/build/commands/env/link.js +2 -2
- package/build/commands/env/list.d.ts +1 -1
- package/build/commands/env/list.js +2 -2
- package/build/commands/env/pull.d.ts +2 -1
- package/build/commands/env/pull.js +22 -8
- package/build/commands/env/push.d.ts +1 -2
- package/build/commands/env/push.js +21 -10
- package/build/commands/env/unlink.d.ts +1 -1
- package/build/commands/env/unlink.js +2 -2
- package/build/commands/env/update.d.ts +1 -1
- package/build/commands/env/update.js +8 -6
- package/build/commands/metadata/pull.js +1 -0
- package/build/commands/metadata/push.js +1 -0
- package/build/commands/open.js +1 -0
- package/build/commands/project/info.d.ts +1 -1
- package/build/commands/project/info.js +2 -2
- package/build/commands/secret/create.d.ts +1 -1
- package/build/commands/secret/create.js +2 -2
- package/build/commands/secret/delete.d.ts +1 -1
- package/build/commands/secret/delete.js +2 -2
- package/build/commands/secret/list.d.ts +1 -1
- package/build/commands/secret/list.js +2 -2
- package/build/commands/secret/push.d.ts +1 -1
- package/build/commands/secret/push.js +2 -2
- package/build/commands/submit/internal.js +1 -0
- package/build/commands/submit.js +1 -0
- package/build/commands/update/configure.js +1 -0
- package/build/commands/update/edit.d.ts +2 -2
- package/build/commands/update/edit.js +41 -4
- package/build/commands/update/index.d.ts +2 -0
- package/build/commands/update/index.js +29 -3
- package/build/commands/update/list.d.ts +1 -1
- package/build/commands/update/list.js +2 -2
- package/build/commands/update/republish.js +1 -0
- package/build/commands/update/roll-back-to-embedded.js +1 -0
- package/build/commands/webhook/create.d.ts +1 -1
- package/build/commands/webhook/create.js +2 -2
- package/build/commands/webhook/delete.d.ts +1 -1
- package/build/commands/webhook/delete.js +2 -2
- package/build/commands/webhook/list.d.ts +1 -1
- package/build/commands/webhook/list.js +2 -2
- package/build/commands/worker/alias.js +1 -0
- package/build/commands/worker/deploy.js +1 -1
- package/build/graphql/generated.d.ts +147 -19
- package/build/graphql/generated.js +19 -2
- package/build/graphql/mutations/EnvironmentVariableMutation.d.ts +1 -0
- package/build/graphql/queries/ChannelQuery.js +2 -0
- package/build/project/publish.d.ts +2 -1
- package/build/project/publish.js +10 -4
- package/build/user/SessionManager.d.ts +1 -1
- package/build/utils/expoCli.d.ts +2 -1
- package/build/utils/expoCli.js +5 -1
- package/oclif.manifest.json +187 -82
- package/package.json +2 -2
|
@@ -41,17 +41,33 @@ async function resolveEnvVarsAsync({ buildProfile, buildProfileName, graphqlClie
|
|
|
41
41
|
const serverEnvVars = Object.fromEntries(environmentVariables
|
|
42
42
|
.filter(({ name, value }) => name && value)
|
|
43
43
|
.map(({ name, value }) => [name, value]));
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
.
|
|
54
|
-
|
|
44
|
+
if (Object.keys(serverEnvVars).length > 0) {
|
|
45
|
+
log_1.default.log(`Environment variables loaded from the "${environment.toLowerCase()}" environment on EAS servers: ${Object.keys(serverEnvVars).join(', ')}.`);
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
log_1.default.log(`No environment variables found for the "${environment.toLowerCase()}" environment on EAS servers.`);
|
|
49
|
+
}
|
|
50
|
+
const encryptedEnvVars = environmentVariables.filter(({ name, value }) => name && !value);
|
|
51
|
+
if (encryptedEnvVars.length > 0) {
|
|
52
|
+
log_1.default.warn(`Some environment variables defined in the "${environment.toLowerCase()}" environment on EAS servers are of "encrypted" type and cannot be read outside of the EAS servers (including EAS CLI): ${encryptedEnvVars
|
|
53
|
+
.map(({ name }) => name)
|
|
54
|
+
.join(', ')}. However, they will be available during the build process happening on the EAS servers. This can lead to potential configuration mismatches between the local development environment and the build environment if the encrypted environment variables are used to resolve the app config.`);
|
|
55
|
+
}
|
|
56
|
+
if (buildProfile.env && Object.keys(buildProfile.env).length > 0) {
|
|
57
|
+
log_1.default.log(`Environment variables loaded from the "${buildProfileName}" build profile "env" configuration: ${buildProfile.env && Object.keys(buildProfile.env).join(', ')}.`);
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
log_1.default.log(`No environment variables specified in the "${buildProfileName}" build profile "env" configuration.`);
|
|
61
|
+
}
|
|
62
|
+
if (buildProfile.env &&
|
|
63
|
+
Object.keys(buildProfile.env).length > 0 &&
|
|
64
|
+
Object.keys(serverEnvVars).length > 0) {
|
|
65
|
+
const overlappingKeys = Object.keys(serverEnvVars).filter(key => buildProfile.env && Object.keys(buildProfile.env).includes(key));
|
|
66
|
+
if (overlappingKeys.length > 0) {
|
|
67
|
+
log_1.default.warn(`The following environment variables are defined in both the "${buildProfileName}" build profile "env" configuration and the "${environment.toLowerCase()}" environment on EAS servers: ${overlappingKeys.join(', ')}. The values from the build profile configuration will be used.`);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
log_1.default.newLine();
|
|
55
71
|
return { ...serverEnvVars, ...buildProfile.env };
|
|
56
72
|
}
|
|
57
73
|
catch (e) {
|
package/build/channel/queries.js
CHANGED
|
@@ -65,7 +65,11 @@ async function listAndRenderChannelsOnAppAsync(graphqlClient, { projectId, pagin
|
|
|
65
65
|
exports.listAndRenderChannelsOnAppAsync = listAndRenderChannelsOnAppAsync;
|
|
66
66
|
async function listAndRenderBranchesAndUpdatesOnChannelAsync(graphqlClient, { projectId: appId, channelName, paginatedQueryOptions, }) {
|
|
67
67
|
const channel = await ChannelQuery_1.ChannelQuery.viewUpdateChannelAsync(graphqlClient, { appId, channelName });
|
|
68
|
-
renderChannelHeaderContent({
|
|
68
|
+
renderChannelHeaderContent({
|
|
69
|
+
channelName: channel.name,
|
|
70
|
+
channelId: channel.id,
|
|
71
|
+
isPaused: channel.isPaused,
|
|
72
|
+
});
|
|
69
73
|
if (paginatedQueryOptions.nonInteractive) {
|
|
70
74
|
const branches = await queryBranchesAndUpdateGroupsOnChannelAsync(graphqlClient, {
|
|
71
75
|
appId,
|
|
@@ -111,7 +115,11 @@ function renderPageOfChannels(currentPage, { json }) {
|
|
|
111
115
|
}
|
|
112
116
|
else {
|
|
113
117
|
for (const channel of currentPage) {
|
|
114
|
-
renderChannelHeaderContent({
|
|
118
|
+
renderChannelHeaderContent({
|
|
119
|
+
channelName: channel.name,
|
|
120
|
+
channelId: channel.id,
|
|
121
|
+
isPaused: channel.isPaused,
|
|
122
|
+
});
|
|
115
123
|
log_1.default.addNewLineIfNone();
|
|
116
124
|
(0, print_utils_1.logChannelDetails)(channel);
|
|
117
125
|
if (currentPage.indexOf(channel) < currentPage.length - 1) {
|
|
@@ -131,12 +139,13 @@ function renderPageOfBranchesOnChannel(channel, currentPage, { json }) {
|
|
|
131
139
|
(0, print_utils_1.logChannelDetails)(channelWithNewBranches);
|
|
132
140
|
}
|
|
133
141
|
}
|
|
134
|
-
function renderChannelHeaderContent({ channelName, channelId, }) {
|
|
142
|
+
function renderChannelHeaderContent({ channelName, channelId, isPaused, }) {
|
|
135
143
|
log_1.default.addNewLineIfNone();
|
|
136
144
|
log_1.default.log(chalk_1.default.bold('Channel:'));
|
|
137
145
|
log_1.default.log((0, formatFields_1.default)([
|
|
138
146
|
{ label: 'Name', value: channelName },
|
|
139
147
|
{ label: 'ID', value: channelId },
|
|
148
|
+
{ label: 'Status', value: isPaused ? 'Paused' : 'Active' },
|
|
140
149
|
]));
|
|
141
150
|
log_1.default.addNewLineIfNone();
|
|
142
151
|
log_1.default.log((0, chalk_1.default) `{bold Branches pointed at this channel and their most recent update group:}`);
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import { Command } from '@oclif/core';
|
|
2
2
|
import AnalyticsContextField from './context/AnalyticsContextField';
|
|
3
3
|
import ContextField from './context/ContextField';
|
|
4
|
+
import DynamicLoggedInContextField from './context/DynamicLoggedInContextField';
|
|
4
5
|
import { DynamicPrivateProjectConfigContextField, DynamicPublicProjectConfigContextField } from './context/DynamicProjectConfigContextField';
|
|
5
6
|
import LoggedInContextField from './context/LoggedInContextField';
|
|
6
7
|
import MaybeLoggedInContextField from './context/MaybeLoggedInContextField';
|
|
7
8
|
import { OptionalPrivateProjectConfigContextField } from './context/OptionalPrivateProjectConfigContextField';
|
|
8
9
|
import { PrivateProjectConfigContextField } from './context/PrivateProjectConfigContextField';
|
|
9
10
|
import ProjectDirContextField from './context/ProjectDirContextField';
|
|
11
|
+
import { ProjectIdContextField } from './context/ProjectIdContextField';
|
|
12
|
+
import { ServerSideEnvironmentVariablesContextField } from './context/ServerSideEnvironmentVariablesContextField';
|
|
10
13
|
import SessionManagementContextField from './context/SessionManagementContextField';
|
|
11
14
|
import VcsClientContextField from './context/VcsClientContextField';
|
|
15
|
+
import { EnvironmentVariableEnvironment } from '../graphql/generated';
|
|
12
16
|
import { Client } from '../vcs/vcs';
|
|
13
17
|
export type ContextInput<T extends {
|
|
14
18
|
[name: string]: any;
|
|
@@ -20,6 +24,19 @@ export type ContextOutput<T extends {
|
|
|
20
24
|
} = object> = {
|
|
21
25
|
[P in keyof T]: T[P];
|
|
22
26
|
};
|
|
27
|
+
type GetContextType<Type> = {
|
|
28
|
+
[Property in keyof Type]: any;
|
|
29
|
+
};
|
|
30
|
+
interface BaseGetContextAsyncArgs {
|
|
31
|
+
nonInteractive: boolean;
|
|
32
|
+
vcsClientOverride?: Client;
|
|
33
|
+
}
|
|
34
|
+
interface GetContextAsyncArgsWithRequiredServerSideEnvironmentArgument extends BaseGetContextAsyncArgs {
|
|
35
|
+
withServerSideEnvironment: EnvironmentVariableEnvironment | null;
|
|
36
|
+
}
|
|
37
|
+
interface GetContextAsyncArgsWithoutServerSideEnvironmentArgument extends BaseGetContextAsyncArgs {
|
|
38
|
+
withServerSideEnvironment?: never;
|
|
39
|
+
}
|
|
23
40
|
export default abstract class EasCommand extends Command {
|
|
24
41
|
protected static readonly ContextOptions: {
|
|
25
42
|
/**
|
|
@@ -36,8 +53,15 @@ export default abstract class EasCommand extends Command {
|
|
|
36
53
|
MaybeLoggedIn: {
|
|
37
54
|
maybeLoggedIn: MaybeLoggedInContextField;
|
|
38
55
|
};
|
|
56
|
+
/**
|
|
57
|
+
* Specify this context if the logged-in requirement is only necessary in a particular execution of the command.
|
|
58
|
+
*/
|
|
59
|
+
DynamicLoggedIn: {
|
|
60
|
+
getDynamicLoggedInAsync: DynamicLoggedInContextField;
|
|
61
|
+
};
|
|
39
62
|
/**
|
|
40
63
|
* Specify this context requirement if the command needs to mutate the user session.
|
|
64
|
+
* @deprecated Should not be used outside of session management commands, which currently only includes `login` and `logout`.
|
|
41
65
|
*/
|
|
42
66
|
SessionManagment: {
|
|
43
67
|
sessionManager: SessionManagementContextField;
|
|
@@ -47,7 +71,7 @@ export default abstract class EasCommand extends Command {
|
|
|
47
71
|
* run within a project directory, null otherwise.
|
|
48
72
|
*/
|
|
49
73
|
OptionalProjectConfig: {
|
|
50
|
-
|
|
74
|
+
optionalPrivateProjectConfig: OptionalPrivateProjectConfigContextField;
|
|
51
75
|
};
|
|
52
76
|
/**
|
|
53
77
|
* Require this command to be run in a project directory. Return the project directory in the context.
|
|
@@ -80,6 +104,15 @@ export default abstract class EasCommand extends Command {
|
|
|
80
104
|
Vcs: {
|
|
81
105
|
vcsClient: VcsClientContextField;
|
|
82
106
|
};
|
|
107
|
+
ServerSideEnvironmentVariables: {
|
|
108
|
+
getServerSideEnvironmentVariablesAsync: ServerSideEnvironmentVariablesContextField;
|
|
109
|
+
};
|
|
110
|
+
/**
|
|
111
|
+
* Require the project to be identified and registered on server. Returns the project ID evaluated from the app config.
|
|
112
|
+
*/
|
|
113
|
+
ProjectId: {
|
|
114
|
+
projectId: ProjectIdContextField;
|
|
115
|
+
};
|
|
83
116
|
};
|
|
84
117
|
/**
|
|
85
118
|
* Context allows for subclasses (commands) to declare their prerequisites in a type-safe manner.
|
|
@@ -108,10 +141,7 @@ export default abstract class EasCommand extends Command {
|
|
|
108
141
|
[name: string]: any;
|
|
109
142
|
} = object>(commandClass: {
|
|
110
143
|
contextDefinition: ContextInput<C>;
|
|
111
|
-
}, { nonInteractive, vcsClientOverride }:
|
|
112
|
-
nonInteractive: boolean;
|
|
113
|
-
vcsClientOverride?: Client;
|
|
114
|
-
}): Promise<ContextOutput<C>>;
|
|
144
|
+
}, { nonInteractive, vcsClientOverride, withServerSideEnvironment, }: C extends GetContextType<typeof EasCommand.ContextOptions.ProjectConfig> | GetContextType<typeof EasCommand.ContextOptions.DynamicProjectConfig> | GetContextType<typeof EasCommand.ContextOptions.OptionalProjectConfig> | GetContextType<typeof EasCommand.ContextOptions.ServerSideEnvironmentVariables> ? GetContextAsyncArgsWithRequiredServerSideEnvironmentArgument : GetContextAsyncArgsWithoutServerSideEnvironmentArgument): Promise<ContextOutput<C>>;
|
|
115
145
|
private get sessionManager();
|
|
116
146
|
private get analytics();
|
|
117
147
|
protected abstract runAsync(): Promise<any>;
|
|
@@ -119,3 +149,4 @@ export default abstract class EasCommand extends Command {
|
|
|
119
149
|
finally(err: Error): Promise<any>;
|
|
120
150
|
protected catch(err: Error): Promise<any>;
|
|
121
151
|
}
|
|
152
|
+
export {};
|
|
@@ -6,12 +6,15 @@ const core_2 = require("@urql/core");
|
|
|
6
6
|
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
7
7
|
const nullthrows_1 = tslib_1.__importDefault(require("nullthrows"));
|
|
8
8
|
const AnalyticsContextField_1 = tslib_1.__importDefault(require("./context/AnalyticsContextField"));
|
|
9
|
+
const DynamicLoggedInContextField_1 = tslib_1.__importDefault(require("./context/DynamicLoggedInContextField"));
|
|
9
10
|
const DynamicProjectConfigContextField_1 = require("./context/DynamicProjectConfigContextField");
|
|
10
11
|
const LoggedInContextField_1 = tslib_1.__importDefault(require("./context/LoggedInContextField"));
|
|
11
12
|
const MaybeLoggedInContextField_1 = tslib_1.__importDefault(require("./context/MaybeLoggedInContextField"));
|
|
12
13
|
const OptionalPrivateProjectConfigContextField_1 = require("./context/OptionalPrivateProjectConfigContextField");
|
|
13
14
|
const PrivateProjectConfigContextField_1 = require("./context/PrivateProjectConfigContextField");
|
|
14
15
|
const ProjectDirContextField_1 = tslib_1.__importDefault(require("./context/ProjectDirContextField"));
|
|
16
|
+
const ProjectIdContextField_1 = require("./context/ProjectIdContextField");
|
|
17
|
+
const ServerSideEnvironmentVariablesContextField_1 = require("./context/ServerSideEnvironmentVariablesContextField");
|
|
15
18
|
const SessionManagementContextField_1 = tslib_1.__importDefault(require("./context/SessionManagementContextField"));
|
|
16
19
|
const VcsClientContextField_1 = tslib_1.__importDefault(require("./context/VcsClientContextField"));
|
|
17
20
|
const errors_1 = require("./errors");
|
|
@@ -23,7 +26,10 @@ class EasCommand extends core_1.Command {
|
|
|
23
26
|
/**
|
|
24
27
|
* Execute the context in the contextDefinition to satisfy command prerequisites.
|
|
25
28
|
*/
|
|
26
|
-
async getContextAsync(commandClass, { nonInteractive, vcsClientOverride
|
|
29
|
+
async getContextAsync(commandClass, { nonInteractive, vcsClientOverride,
|
|
30
|
+
// if specified and not null, the env vars from the selected environment will be fetched from the server
|
|
31
|
+
// to resolve dynamic config (if dynamic config context is used) and enable getServerSideEnvironmentVariablesAsync function (if server side environment variables context is used)
|
|
32
|
+
withServerSideEnvironment, }) {
|
|
27
33
|
const contextDefinition = commandClass.contextDefinition;
|
|
28
34
|
// do these serially so that they don't do things like ask for login twice in parallel
|
|
29
35
|
const contextValuePairs = [];
|
|
@@ -35,6 +41,7 @@ class EasCommand extends core_1.Command {
|
|
|
35
41
|
sessionManager: this.sessionManager,
|
|
36
42
|
analytics: this.analytics,
|
|
37
43
|
vcsClientOverride,
|
|
44
|
+
withServerSideEnvironment,
|
|
38
45
|
}),
|
|
39
46
|
]);
|
|
40
47
|
}
|
|
@@ -114,8 +121,16 @@ EasCommand.ContextOptions = {
|
|
|
114
121
|
MaybeLoggedIn: {
|
|
115
122
|
maybeLoggedIn: new MaybeLoggedInContextField_1.default(),
|
|
116
123
|
},
|
|
124
|
+
/**
|
|
125
|
+
* Specify this context if the logged-in requirement is only necessary in a particular execution of the command.
|
|
126
|
+
*/
|
|
127
|
+
DynamicLoggedIn: {
|
|
128
|
+
// eslint-disable-next-line async-protect/async-suffix
|
|
129
|
+
getDynamicLoggedInAsync: new DynamicLoggedInContextField_1.default(),
|
|
130
|
+
},
|
|
117
131
|
/**
|
|
118
132
|
* Specify this context requirement if the command needs to mutate the user session.
|
|
133
|
+
* @deprecated Should not be used outside of session management commands, which currently only includes `login` and `logout`.
|
|
119
134
|
*/
|
|
120
135
|
SessionManagment: {
|
|
121
136
|
sessionManager: new SessionManagementContextField_1.default(),
|
|
@@ -125,7 +140,7 @@ EasCommand.ContextOptions = {
|
|
|
125
140
|
* run within a project directory, null otherwise.
|
|
126
141
|
*/
|
|
127
142
|
OptionalProjectConfig: {
|
|
128
|
-
|
|
143
|
+
optionalPrivateProjectConfig: new OptionalPrivateProjectConfigContextField_1.OptionalPrivateProjectConfigContextField(),
|
|
129
144
|
},
|
|
130
145
|
/**
|
|
131
146
|
* Require this command to be run in a project directory. Return the project directory in the context.
|
|
@@ -160,6 +175,16 @@ EasCommand.ContextOptions = {
|
|
|
160
175
|
Vcs: {
|
|
161
176
|
vcsClient: new VcsClientContextField_1.default(),
|
|
162
177
|
},
|
|
178
|
+
ServerSideEnvironmentVariables: {
|
|
179
|
+
// eslint-disable-next-line async-protect/async-suffix
|
|
180
|
+
getServerSideEnvironmentVariablesAsync: new ServerSideEnvironmentVariablesContextField_1.ServerSideEnvironmentVariablesContextField(),
|
|
181
|
+
},
|
|
182
|
+
/**
|
|
183
|
+
* Require the project to be identified and registered on server. Returns the project ID evaluated from the app config.
|
|
184
|
+
*/
|
|
185
|
+
ProjectId: {
|
|
186
|
+
projectId: new ProjectIdContextField_1.ProjectIdContextField(),
|
|
187
|
+
},
|
|
163
188
|
};
|
|
164
189
|
/**
|
|
165
190
|
* Context allows for subclasses (commands) to declare their prerequisites in a type-safe manner.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Analytics } from '../../analytics/AnalyticsManager';
|
|
2
|
+
import { EnvironmentVariableEnvironment } from '../../graphql/generated';
|
|
2
3
|
import SessionManager from '../../user/SessionManager';
|
|
3
4
|
import { Client } from '../../vcs/vcs';
|
|
4
5
|
export interface ContextOptions {
|
|
@@ -6,6 +7,10 @@ export interface ContextOptions {
|
|
|
6
7
|
analytics: Analytics;
|
|
7
8
|
nonInteractive: boolean;
|
|
8
9
|
vcsClientOverride?: Client;
|
|
10
|
+
/**
|
|
11
|
+
* If specified, env variables from the selected environment will be fetched from the server and used to evaluate the dynamic config.
|
|
12
|
+
*/
|
|
13
|
+
withServerSideEnvironment?: EnvironmentVariableEnvironment | null;
|
|
9
14
|
}
|
|
10
15
|
export default abstract class ContextField<T> {
|
|
11
16
|
abstract getValueAsync(options: ContextOptions): Promise<T>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import ContextField, { ContextOptions } from './ContextField';
|
|
2
|
+
import { ExpoGraphqlClient } from './contextUtils/createGraphqlClient';
|
|
3
|
+
import { LoggedInAuthenticationInfo } from '../../user/SessionManager';
|
|
4
|
+
import { Actor } from '../../user/User';
|
|
5
|
+
import FeatureGating from '../gating/FeatureGating';
|
|
6
|
+
export type DynamicLoggedInContextFn = () => Promise<{
|
|
7
|
+
actor: Actor;
|
|
8
|
+
featureGating: FeatureGating;
|
|
9
|
+
graphqlClient: ExpoGraphqlClient;
|
|
10
|
+
authenticationInfo: LoggedInAuthenticationInfo;
|
|
11
|
+
}>;
|
|
12
|
+
export default class DynamicLoggedInContextField extends ContextField<DynamicLoggedInContextFn> {
|
|
13
|
+
getValueAsync({ nonInteractive, sessionManager, }: ContextOptions): Promise<DynamicLoggedInContextFn>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
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 createGraphqlClient_1 = require("./contextUtils/createGraphqlClient");
|
|
6
|
+
const FeatureGateEnvOverrides_1 = tslib_1.__importDefault(require("../gating/FeatureGateEnvOverrides"));
|
|
7
|
+
const FeatureGating_1 = tslib_1.__importDefault(require("../gating/FeatureGating"));
|
|
8
|
+
class DynamicLoggedInContextField extends ContextField_1.default {
|
|
9
|
+
async getValueAsync({ nonInteractive, sessionManager, }) {
|
|
10
|
+
return async () => {
|
|
11
|
+
const { actor, authenticationInfo } = await sessionManager.ensureLoggedInAsync({
|
|
12
|
+
nonInteractive,
|
|
13
|
+
});
|
|
14
|
+
const featureGateServerValues = actor?.featureGates ?? {};
|
|
15
|
+
const graphqlClient = (0, createGraphqlClient_1.createGraphqlClient)(authenticationInfo);
|
|
16
|
+
return {
|
|
17
|
+
actor,
|
|
18
|
+
featureGating: new FeatureGating_1.default(featureGateServerValues, new FeatureGateEnvOverrides_1.default()),
|
|
19
|
+
graphqlClient,
|
|
20
|
+
authenticationInfo,
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.default = DynamicLoggedInContextField;
|
|
@@ -7,8 +7,8 @@ export type DynamicConfigContextFn = (options?: ExpoConfigOptions) => Promise<{
|
|
|
7
7
|
projectDir: string;
|
|
8
8
|
}>;
|
|
9
9
|
export declare class DynamicPublicProjectConfigContextField extends ContextField<DynamicConfigContextFn> {
|
|
10
|
-
getValueAsync({ nonInteractive, sessionManager, }: ContextOptions): Promise<DynamicConfigContextFn>;
|
|
10
|
+
getValueAsync({ nonInteractive, sessionManager, withServerSideEnvironment, }: ContextOptions): Promise<DynamicConfigContextFn>;
|
|
11
11
|
}
|
|
12
12
|
export declare class DynamicPrivateProjectConfigContextField extends ContextField<DynamicConfigContextFn> {
|
|
13
|
-
getValueAsync({ nonInteractive, sessionManager, }: ContextOptions): Promise<DynamicConfigContextFn>;
|
|
13
|
+
getValueAsync({ nonInteractive, sessionManager, withServerSideEnvironment, }: ContextOptions): Promise<DynamicConfigContextFn>;
|
|
14
14
|
}
|
|
@@ -3,11 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.DynamicPrivateProjectConfigContextField = exports.DynamicPublicProjectConfigContextField = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const ContextField_1 = tslib_1.__importDefault(require("./ContextField"));
|
|
6
|
+
const createGraphqlClient_1 = require("./contextUtils/createGraphqlClient");
|
|
6
7
|
const findProjectDirAndVerifyProjectSetupAsync_1 = require("./contextUtils/findProjectDirAndVerifyProjectSetupAsync");
|
|
7
8
|
const getProjectIdAsync_1 = require("./contextUtils/getProjectIdAsync");
|
|
9
|
+
const loadServerSideEnvironmentVariablesAsync_1 = require("./contextUtils/loadServerSideEnvironmentVariablesAsync");
|
|
8
10
|
const expoConfig_1 = require("../../project/expoConfig");
|
|
9
11
|
class DynamicPublicProjectConfigContextField extends ContextField_1.default {
|
|
10
|
-
async getValueAsync({ nonInteractive, sessionManager, }) {
|
|
12
|
+
async getValueAsync({ nonInteractive, sessionManager, withServerSideEnvironment, }) {
|
|
11
13
|
const projectDir = await (0, findProjectDirAndVerifyProjectSetupAsync_1.findProjectDirAndVerifyProjectSetupAsync)();
|
|
12
14
|
return async (options) => {
|
|
13
15
|
const expBefore = (0, expoConfig_1.getPublicExpoConfig)(projectDir, options);
|
|
@@ -15,6 +17,24 @@ class DynamicPublicProjectConfigContextField extends ContextField_1.default {
|
|
|
15
17
|
nonInteractive,
|
|
16
18
|
env: options?.env,
|
|
17
19
|
});
|
|
20
|
+
if (withServerSideEnvironment) {
|
|
21
|
+
const { authenticationInfo } = await sessionManager.ensureLoggedInAsync({
|
|
22
|
+
nonInteractive,
|
|
23
|
+
});
|
|
24
|
+
const graphqlClient = (0, createGraphqlClient_1.createGraphqlClient)(authenticationInfo);
|
|
25
|
+
const serverSideEnvironmentVariables = await (0, loadServerSideEnvironmentVariablesAsync_1.loadServerSideEnvironmentVariablesAsync)({
|
|
26
|
+
environment: withServerSideEnvironment,
|
|
27
|
+
projectId,
|
|
28
|
+
graphqlClient,
|
|
29
|
+
});
|
|
30
|
+
options = {
|
|
31
|
+
...options,
|
|
32
|
+
env: {
|
|
33
|
+
...options?.env,
|
|
34
|
+
...serverSideEnvironmentVariables,
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
}
|
|
18
38
|
const exp = (0, expoConfig_1.getPublicExpoConfig)(projectDir, options);
|
|
19
39
|
return {
|
|
20
40
|
exp,
|
|
@@ -26,7 +46,7 @@ class DynamicPublicProjectConfigContextField extends ContextField_1.default {
|
|
|
26
46
|
}
|
|
27
47
|
exports.DynamicPublicProjectConfigContextField = DynamicPublicProjectConfigContextField;
|
|
28
48
|
class DynamicPrivateProjectConfigContextField extends ContextField_1.default {
|
|
29
|
-
async getValueAsync({ nonInteractive, sessionManager, }) {
|
|
49
|
+
async getValueAsync({ nonInteractive, sessionManager, withServerSideEnvironment, }) {
|
|
30
50
|
const projectDir = await (0, findProjectDirAndVerifyProjectSetupAsync_1.findProjectDirAndVerifyProjectSetupAsync)();
|
|
31
51
|
return async (options) => {
|
|
32
52
|
const expBefore = (0, expoConfig_1.getPrivateExpoConfig)(projectDir, options);
|
|
@@ -34,6 +54,24 @@ class DynamicPrivateProjectConfigContextField extends ContextField_1.default {
|
|
|
34
54
|
nonInteractive,
|
|
35
55
|
env: options?.env,
|
|
36
56
|
});
|
|
57
|
+
if (withServerSideEnvironment) {
|
|
58
|
+
const { authenticationInfo } = await sessionManager.ensureLoggedInAsync({
|
|
59
|
+
nonInteractive,
|
|
60
|
+
});
|
|
61
|
+
const graphqlClient = (0, createGraphqlClient_1.createGraphqlClient)(authenticationInfo);
|
|
62
|
+
const serverSideEnvironmentVariables = await (0, loadServerSideEnvironmentVariablesAsync_1.loadServerSideEnvironmentVariablesAsync)({
|
|
63
|
+
environment: withServerSideEnvironment,
|
|
64
|
+
projectId,
|
|
65
|
+
graphqlClient,
|
|
66
|
+
});
|
|
67
|
+
options = {
|
|
68
|
+
...options,
|
|
69
|
+
env: {
|
|
70
|
+
...options?.env,
|
|
71
|
+
...serverSideEnvironmentVariables,
|
|
72
|
+
},
|
|
73
|
+
};
|
|
74
|
+
}
|
|
37
75
|
const exp = (0, expoConfig_1.getPrivateExpoConfig)(projectDir, options);
|
|
38
76
|
return {
|
|
39
77
|
exp,
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import ContextField, { ContextOptions } from './ContextField';
|
|
2
2
|
import { ExpoGraphqlClient } from './contextUtils/createGraphqlClient';
|
|
3
|
+
import { LoggedInAuthenticationInfo } from '../../user/SessionManager';
|
|
3
4
|
import { Actor } from '../../user/User';
|
|
4
5
|
import FeatureGating from '../gating/FeatureGating';
|
|
5
|
-
|
|
6
|
+
type LoggedInContextType = {
|
|
6
7
|
actor: Actor;
|
|
7
8
|
featureGating: FeatureGating;
|
|
8
9
|
graphqlClient: ExpoGraphqlClient;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
graphqlClient: ExpoGraphqlClient;
|
|
14
|
-
}>;
|
|
10
|
+
authenticationInfo: LoggedInAuthenticationInfo;
|
|
11
|
+
};
|
|
12
|
+
export default class LoggedInContextField extends ContextField<LoggedInContextType> {
|
|
13
|
+
getValueAsync({ nonInteractive, sessionManager, }: ContextOptions): Promise<LoggedInContextType>;
|
|
15
14
|
}
|
|
15
|
+
export {};
|
|
@@ -6,7 +6,7 @@ const createGraphqlClient_1 = require("./contextUtils/createGraphqlClient");
|
|
|
6
6
|
const FeatureGateEnvOverrides_1 = tslib_1.__importDefault(require("../gating/FeatureGateEnvOverrides"));
|
|
7
7
|
const FeatureGating_1 = tslib_1.__importDefault(require("../gating/FeatureGating"));
|
|
8
8
|
class LoggedInContextField extends ContextField_1.default {
|
|
9
|
-
async getValueAsync({ nonInteractive, sessionManager }) {
|
|
9
|
+
async getValueAsync({ nonInteractive, sessionManager, }) {
|
|
10
10
|
const { actor, authenticationInfo } = await sessionManager.ensureLoggedInAsync({
|
|
11
11
|
nonInteractive,
|
|
12
12
|
});
|
|
@@ -16,6 +16,7 @@ class LoggedInContextField extends ContextField_1.default {
|
|
|
16
16
|
actor,
|
|
17
17
|
featureGating: new FeatureGating_1.default(featureGateServerValues, new FeatureGateEnvOverrides_1.default()),
|
|
18
18
|
graphqlClient,
|
|
19
|
+
authenticationInfo,
|
|
19
20
|
};
|
|
20
21
|
}
|
|
21
22
|
}
|
|
@@ -2,14 +2,16 @@ import ContextField, { ContextOptions } from './ContextField';
|
|
|
2
2
|
import { ExpoGraphqlClient } from './contextUtils/createGraphqlClient';
|
|
3
3
|
import { Actor } from '../../user/User';
|
|
4
4
|
import FeatureGating from '../gating/FeatureGating';
|
|
5
|
-
|
|
5
|
+
type MaybeLoggedInContextType = {
|
|
6
6
|
actor: Actor | null;
|
|
7
7
|
featureGating: FeatureGating;
|
|
8
8
|
graphqlClient: ExpoGraphqlClient;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
authenticationInfo: {
|
|
10
|
+
accessToken: string | null;
|
|
11
|
+
sessionSecret: string | null;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export default class MaybeLoggedInContextField extends ContextField<MaybeLoggedInContextType> {
|
|
15
|
+
getValueAsync({ sessionManager }: ContextOptions): Promise<MaybeLoggedInContextType>;
|
|
15
16
|
}
|
|
17
|
+
export {};
|
|
@@ -5,7 +5,7 @@ export declare class OptionalPrivateProjectConfigContextField extends ContextFie
|
|
|
5
5
|
exp: ExpoConfig;
|
|
6
6
|
projectDir: string;
|
|
7
7
|
} | undefined> {
|
|
8
|
-
getValueAsync({ nonInteractive, sessionManager }: ContextOptions): Promise<{
|
|
8
|
+
getValueAsync({ nonInteractive, sessionManager, withServerSideEnvironment, }: ContextOptions): Promise<{
|
|
9
9
|
projectId: string;
|
|
10
10
|
exp: ExpoConfig;
|
|
11
11
|
projectDir: string;
|
|
@@ -4,11 +4,13 @@ exports.OptionalPrivateProjectConfigContextField = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const errors_1 = require("@expo/eas-json/build/errors");
|
|
6
6
|
const ContextField_1 = tslib_1.__importDefault(require("./ContextField"));
|
|
7
|
+
const createGraphqlClient_1 = require("./contextUtils/createGraphqlClient");
|
|
7
8
|
const findProjectDirAndVerifyProjectSetupAsync_1 = require("./contextUtils/findProjectDirAndVerifyProjectSetupAsync");
|
|
8
9
|
const getProjectIdAsync_1 = require("./contextUtils/getProjectIdAsync");
|
|
10
|
+
const loadServerSideEnvironmentVariablesAsync_1 = require("./contextUtils/loadServerSideEnvironmentVariablesAsync");
|
|
9
11
|
const expoConfig_1 = require("../../project/expoConfig");
|
|
10
12
|
class OptionalPrivateProjectConfigContextField extends ContextField_1.default {
|
|
11
|
-
async getValueAsync({ nonInteractive, sessionManager }) {
|
|
13
|
+
async getValueAsync({ nonInteractive, sessionManager, withServerSideEnvironment, }) {
|
|
12
14
|
let projectDir;
|
|
13
15
|
try {
|
|
14
16
|
projectDir = await (0, findProjectDirAndVerifyProjectSetupAsync_1.findProjectDirAndVerifyProjectSetupAsync)();
|
|
@@ -26,7 +28,20 @@ class OptionalPrivateProjectConfigContextField extends ContextField_1.default {
|
|
|
26
28
|
const projectId = await (0, getProjectIdAsync_1.getProjectIdAsync)(sessionManager, expBefore, {
|
|
27
29
|
nonInteractive,
|
|
28
30
|
});
|
|
29
|
-
|
|
31
|
+
let serverSideEnvVars;
|
|
32
|
+
if (withServerSideEnvironment) {
|
|
33
|
+
const { authenticationInfo } = await sessionManager.ensureLoggedInAsync({
|
|
34
|
+
nonInteractive,
|
|
35
|
+
});
|
|
36
|
+
const graphqlClient = (0, createGraphqlClient_1.createGraphqlClient)(authenticationInfo);
|
|
37
|
+
const serverSideEnvironmentVariables = await (0, loadServerSideEnvironmentVariablesAsync_1.loadServerSideEnvironmentVariablesAsync)({
|
|
38
|
+
environment: withServerSideEnvironment,
|
|
39
|
+
projectId,
|
|
40
|
+
graphqlClient,
|
|
41
|
+
});
|
|
42
|
+
serverSideEnvVars = serverSideEnvironmentVariables;
|
|
43
|
+
}
|
|
44
|
+
const exp = (0, expoConfig_1.getPrivateExpoConfig)(projectDir, { env: serverSideEnvVars });
|
|
30
45
|
return {
|
|
31
46
|
exp,
|
|
32
47
|
projectDir,
|
|
@@ -5,7 +5,7 @@ export declare class PrivateProjectConfigContextField extends ContextField<{
|
|
|
5
5
|
exp: ExpoConfig;
|
|
6
6
|
projectDir: string;
|
|
7
7
|
}> {
|
|
8
|
-
getValueAsync({ nonInteractive, sessionManager }: ContextOptions): Promise<{
|
|
8
|
+
getValueAsync({ nonInteractive, sessionManager, withServerSideEnvironment, }: ContextOptions): Promise<{
|
|
9
9
|
projectId: string;
|
|
10
10
|
exp: ExpoConfig;
|
|
11
11
|
projectDir: string;
|
|
@@ -3,17 +3,32 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.PrivateProjectConfigContextField = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const ContextField_1 = tslib_1.__importDefault(require("./ContextField"));
|
|
6
|
+
const createGraphqlClient_1 = require("./contextUtils/createGraphqlClient");
|
|
6
7
|
const findProjectDirAndVerifyProjectSetupAsync_1 = require("./contextUtils/findProjectDirAndVerifyProjectSetupAsync");
|
|
7
8
|
const getProjectIdAsync_1 = require("./contextUtils/getProjectIdAsync");
|
|
9
|
+
const loadServerSideEnvironmentVariablesAsync_1 = require("./contextUtils/loadServerSideEnvironmentVariablesAsync");
|
|
8
10
|
const expoConfig_1 = require("../../project/expoConfig");
|
|
9
11
|
class PrivateProjectConfigContextField extends ContextField_1.default {
|
|
10
|
-
async getValueAsync({ nonInteractive, sessionManager }) {
|
|
12
|
+
async getValueAsync({ nonInteractive, sessionManager, withServerSideEnvironment, }) {
|
|
11
13
|
const projectDir = await (0, findProjectDirAndVerifyProjectSetupAsync_1.findProjectDirAndVerifyProjectSetupAsync)();
|
|
12
14
|
const expBefore = (0, expoConfig_1.getPrivateExpoConfig)(projectDir);
|
|
13
15
|
const projectId = await (0, getProjectIdAsync_1.getProjectIdAsync)(sessionManager, expBefore, {
|
|
14
16
|
nonInteractive,
|
|
15
17
|
});
|
|
16
|
-
|
|
18
|
+
let serverSideEnvVars;
|
|
19
|
+
if (withServerSideEnvironment) {
|
|
20
|
+
const { authenticationInfo } = await sessionManager.ensureLoggedInAsync({
|
|
21
|
+
nonInteractive,
|
|
22
|
+
});
|
|
23
|
+
const graphqlClient = (0, createGraphqlClient_1.createGraphqlClient)(authenticationInfo);
|
|
24
|
+
const serverSideEnvironmentVariables = await (0, loadServerSideEnvironmentVariablesAsync_1.loadServerSideEnvironmentVariablesAsync)({
|
|
25
|
+
environment: withServerSideEnvironment,
|
|
26
|
+
projectId,
|
|
27
|
+
graphqlClient,
|
|
28
|
+
});
|
|
29
|
+
serverSideEnvVars = serverSideEnvironmentVariables;
|
|
30
|
+
}
|
|
31
|
+
const exp = (0, expoConfig_1.getPrivateExpoConfig)(projectDir, { env: serverSideEnvVars });
|
|
17
32
|
return {
|
|
18
33
|
projectId,
|
|
19
34
|
exp,
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ProjectIdContextField = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const ContextField_1 = tslib_1.__importDefault(require("./ContextField"));
|
|
6
|
+
const findProjectDirAndVerifyProjectSetupAsync_1 = require("./contextUtils/findProjectDirAndVerifyProjectSetupAsync");
|
|
7
|
+
const getProjectIdAsync_1 = require("./contextUtils/getProjectIdAsync");
|
|
8
|
+
const expoConfig_1 = require("../../project/expoConfig");
|
|
9
|
+
class ProjectIdContextField extends ContextField_1.default {
|
|
10
|
+
async getValueAsync({ nonInteractive, sessionManager }) {
|
|
11
|
+
const projectDir = await (0, findProjectDirAndVerifyProjectSetupAsync_1.findProjectDirAndVerifyProjectSetupAsync)();
|
|
12
|
+
const expBefore = (0, expoConfig_1.getPrivateExpoConfig)(projectDir);
|
|
13
|
+
const projectId = await (0, getProjectIdAsync_1.getProjectIdAsync)(sessionManager, expBefore, {
|
|
14
|
+
nonInteractive,
|
|
15
|
+
});
|
|
16
|
+
return projectId;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
exports.ProjectIdContextField = ProjectIdContextField;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import ContextField, { ContextOptions } from './ContextField';
|
|
2
|
+
type GetServerSideEnvironmentVariablesFn = (maybeEnv?: Record<string, string>) => Promise<Record<string, string>>;
|
|
3
|
+
export declare class ServerSideEnvironmentVariablesContextField extends ContextField<GetServerSideEnvironmentVariablesFn> {
|
|
4
|
+
getValueAsync({ nonInteractive, sessionManager, withServerSideEnvironment, }: ContextOptions): Promise<GetServerSideEnvironmentVariablesFn>;
|
|
5
|
+
}
|
|
6
|
+
export {};
|