eas-cli 13.3.0 → 13.4.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 +299 -165
- package/build/build/build.js +3 -3
- package/build/build/evaluateConfigWithEnvVarsAsync.js +18 -2
- package/build/commandUtils/flags.d.ts +5 -4
- package/build/commandUtils/flags.js +6 -8
- package/build/commands/env/create.d.ts +6 -6
- package/build/commands/env/create.js +27 -28
- package/build/commands/env/delete.d.ts +5 -5
- package/build/commands/env/delete.js +15 -13
- package/build/commands/env/exec.d.ts +0 -1
- package/build/commands/env/exec.js +1 -2
- package/build/commands/env/get.d.ts +5 -5
- package/build/commands/env/get.js +16 -13
- package/build/commands/env/link.d.ts +1 -1
- package/build/commands/env/link.js +12 -13
- package/build/commands/env/list.d.ts +5 -5
- package/build/commands/env/list.js +14 -12
- package/build/commands/env/pull.d.ts +1 -2
- package/build/commands/env/pull.js +11 -12
- package/build/commands/env/push.d.ts +1 -2
- package/build/commands/env/push.js +9 -10
- package/build/commands/env/unlink.d.ts +1 -1
- package/build/commands/env/unlink.js +11 -10
- package/build/commands/env/update.d.ts +6 -6
- package/build/commands/env/update.js +18 -15
- package/build/commands/secret/create.d.ts +1 -0
- package/build/commands/secret/create.js +3 -0
- package/build/commands/secret/delete.d.ts +1 -0
- package/build/commands/secret/delete.js +3 -0
- package/build/commands/secret/list.d.ts +1 -0
- package/build/commands/secret/list.js +3 -0
- package/build/commands/secret/push.d.ts +1 -0
- package/build/commands/secret/push.js +3 -0
- package/build/commands/update/index.js +19 -2
- package/build/graphql/generated.d.ts +140 -26
- package/build/graphql/generated.js +2 -0
- package/build/graphql/mutations/EnvironmentVariableMutation.d.ts +1 -0
- package/build/graphql/types/Update.js +9 -0
- package/build/project/publish.d.ts +23 -1
- package/build/project/publish.js +71 -11
- package/build/project/resolveRuntimeVersionAsync.d.ts +2 -0
- package/build/project/resolveRuntimeVersionAsync.js +4 -0
- package/build/update/republish.js +19 -0
- package/build/utils/expodash/mapMapAsync.d.ts +1 -0
- package/build/utils/expodash/mapMapAsync.js +12 -0
- package/build/utils/fingerprintCli.d.ts +21 -3
- package/build/utils/fingerprintCli.js +62 -13
- package/build/utils/prompts.d.ts +1 -1
- package/build/utils/prompts.js +1 -1
- package/oclif.manifest.json +43 -48
- package/package.json +7 -4
|
@@ -38,10 +38,10 @@ async function getVariablesForScopeAsync(graphqlClient, { scope, includingSensit
|
|
|
38
38
|
includeFileContent,
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
|
-
class
|
|
41
|
+
class EnvList extends EasCommand_1.default {
|
|
42
42
|
async runAsync() {
|
|
43
43
|
const { args, flags } = await this.parse(_a);
|
|
44
|
-
let { format, environment: environments, scope, 'include-sensitive': includeSensitive, 'include-file-content': includeFileContent, 'non-interactive': nonInteractive, } = this.
|
|
44
|
+
let { format, environment: environments, scope, 'include-sensitive': includeSensitive, 'include-file-content': includeFileContent, 'non-interactive': nonInteractive, } = this.sanitizeInputs(flags, args);
|
|
45
45
|
const { projectId, loggedIn: { graphqlClient }, } = await this.getContextAsync(_a, {
|
|
46
46
|
nonInteractive: true,
|
|
47
47
|
});
|
|
@@ -71,7 +71,7 @@ class EnvironmentValueList extends EasCommand_1.default {
|
|
|
71
71
|
}
|
|
72
72
|
else {
|
|
73
73
|
if (scope === generated_1.EnvironmentVariableScope.Shared) {
|
|
74
|
-
log_1.default.log(chalk_1.default.bold('
|
|
74
|
+
log_1.default.log(chalk_1.default.bold('Account-wide variables for this account:'));
|
|
75
75
|
}
|
|
76
76
|
else {
|
|
77
77
|
log_1.default.log(chalk_1.default.bold(`Variables for this project:`));
|
|
@@ -80,7 +80,7 @@ class EnvironmentValueList extends EasCommand_1.default {
|
|
|
80
80
|
}
|
|
81
81
|
});
|
|
82
82
|
}
|
|
83
|
-
|
|
83
|
+
sanitizeInputs(flags, { environment }) {
|
|
84
84
|
if (environment && !(0, variableUtils_1.isEnvironment)(environment.toUpperCase())) {
|
|
85
85
|
throw new Error("Invalid environment. Use one of 'production', 'preview', or 'development'.");
|
|
86
86
|
}
|
|
@@ -93,17 +93,19 @@ class EnvironmentValueList extends EasCommand_1.default {
|
|
|
93
93
|
...flags,
|
|
94
94
|
'non-interactive': flags['non-interactive'] ?? false,
|
|
95
95
|
environment: environments,
|
|
96
|
+
scope: flags.scope === 'account'
|
|
97
|
+
? generated_1.EnvironmentVariableScope.Shared
|
|
98
|
+
: generated_1.EnvironmentVariableScope.Project,
|
|
96
99
|
};
|
|
97
100
|
}
|
|
98
101
|
}
|
|
99
|
-
_a =
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
EnvironmentValueList.contextDefinition = {
|
|
102
|
+
_a = EnvList;
|
|
103
|
+
EnvList.description = 'list environment variables for the current project or account';
|
|
104
|
+
EnvList.contextDefinition = {
|
|
103
105
|
..._a.ContextOptions.ProjectId,
|
|
104
106
|
..._a.ContextOptions.LoggedIn,
|
|
105
107
|
};
|
|
106
|
-
|
|
108
|
+
EnvList.flags = {
|
|
107
109
|
'include-sensitive': core_1.Flags.boolean({
|
|
108
110
|
description: 'Display sensitive values in the output',
|
|
109
111
|
default: false,
|
|
@@ -114,13 +116,13 @@ EnvironmentValueList.flags = {
|
|
|
114
116
|
}),
|
|
115
117
|
...flags_1.EASMultiEnvironmentFlag,
|
|
116
118
|
...flags_1.EASVariableFormatFlag,
|
|
117
|
-
...flags_1.
|
|
119
|
+
...flags_1.EASEnvironmentVariableScopeFlag,
|
|
118
120
|
};
|
|
119
|
-
|
|
121
|
+
EnvList.args = [
|
|
120
122
|
{
|
|
121
123
|
name: 'environment',
|
|
122
124
|
description: "Environment to list the variables from. One of 'production', 'preview', or 'development'.",
|
|
123
125
|
required: false,
|
|
124
126
|
},
|
|
125
127
|
];
|
|
126
|
-
exports.default =
|
|
128
|
+
exports.default = EnvList;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import EasCommand from '../../commandUtils/EasCommand';
|
|
2
|
-
export default class
|
|
2
|
+
export default class EnvPull extends EasCommand {
|
|
3
3
|
static description: string;
|
|
4
|
-
static hidden: boolean;
|
|
5
4
|
static contextDefinition: {
|
|
6
5
|
projectDir: import("../../commandUtils/context/ProjectDirContextField").default;
|
|
7
6
|
loggedIn: import("../../commandUtils/context/LoggedInContextField").default;
|
|
@@ -14,7 +14,7 @@ const log_1 = tslib_1.__importDefault(require("../../log"));
|
|
|
14
14
|
const prompts_1 = require("../../prompts");
|
|
15
15
|
const prompts_2 = require("../../utils/prompts");
|
|
16
16
|
const variableUtils_1 = require("../../utils/variableUtils");
|
|
17
|
-
class
|
|
17
|
+
class EnvPull extends EasCommand_1.default {
|
|
18
18
|
async runAsync() {
|
|
19
19
|
let { args: { environment: argEnvironment }, flags: { environment: flagEnvironment, path: targetPath, 'non-interactive': nonInteractive }, } = await this.parse(_a);
|
|
20
20
|
let environment = flagEnvironment?.toUpperCase() ?? argEnvironment?.toUpperCase();
|
|
@@ -63,7 +63,7 @@ class EnvironmentVariablePull extends EasCommand_1.default {
|
|
|
63
63
|
return `${variable.name}=${currentEnvLocal[variable.name]}`;
|
|
64
64
|
}
|
|
65
65
|
skippedSecretVariables.push(variable.name);
|
|
66
|
-
return `# ${variable.name}=***** (secret
|
|
66
|
+
return `# ${variable.name}=***** (secret)`;
|
|
67
67
|
}
|
|
68
68
|
if (variable.type === generated_1.EnvironmentSecretType.FileBase64 && variable.valueWithFileContent) {
|
|
69
69
|
const filePath = path_1.default.join(envDir, variable.name);
|
|
@@ -73,33 +73,32 @@ class EnvironmentVariablePull extends EasCommand_1.default {
|
|
|
73
73
|
return `${variable.name}=${variable.value}`;
|
|
74
74
|
}));
|
|
75
75
|
await fs.writeFile(targetPath, filePrefix + envFileContentLines.join('\n'));
|
|
76
|
-
log_1.default.log(`Pulled environment variables from ${environment.toLowerCase()} environment to ${targetPath}.`);
|
|
76
|
+
log_1.default.log(`Pulled plain text and sensitive environment variables from "${environment.toLowerCase()}" environment to ${targetPath}.`);
|
|
77
77
|
if (overridenSecretVariables.length > 0) {
|
|
78
78
|
log_1.default.addNewLineIfNone();
|
|
79
|
-
log_1.default.log(`Reused local values for following secrets: ${overridenSecretVariables.join('\n')}
|
|
79
|
+
log_1.default.log(`Reused local values for following secrets: ${overridenSecretVariables.join('\n')}.`);
|
|
80
80
|
}
|
|
81
81
|
if (skippedSecretVariables.length > 0) {
|
|
82
82
|
log_1.default.addNewLineIfNone();
|
|
83
|
-
log_1.default.
|
|
83
|
+
log_1.default.log(`The following variables have the secret visibility and can't be read outside of EAS servers. Set their values manually in your .env file: ${skippedSecretVariables.join(', ')}.`);
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
|
-
_a =
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
EnvironmentVariablePull.contextDefinition = {
|
|
87
|
+
_a = EnvPull;
|
|
88
|
+
EnvPull.description = 'pull environment variables for the selected environment to .env file';
|
|
89
|
+
EnvPull.contextDefinition = {
|
|
91
90
|
..._a.ContextOptions.ProjectId,
|
|
92
91
|
..._a.ContextOptions.LoggedIn,
|
|
93
92
|
..._a.ContextOptions.ProjectDir,
|
|
94
93
|
};
|
|
95
|
-
|
|
94
|
+
EnvPull.args = [
|
|
96
95
|
{
|
|
97
96
|
name: 'environment',
|
|
98
97
|
description: "Environment to pull variables from. One of 'production', 'preview', or 'development'.",
|
|
99
98
|
required: false,
|
|
100
99
|
},
|
|
101
100
|
];
|
|
102
|
-
|
|
101
|
+
EnvPull.flags = {
|
|
103
102
|
...flags_1.EASNonInteractiveFlag,
|
|
104
103
|
...flags_1.EASEnvironmentFlag,
|
|
105
104
|
path: core_1.Flags.string({
|
|
@@ -107,4 +106,4 @@ EnvironmentVariablePull.flags = {
|
|
|
107
106
|
default: '.env.local',
|
|
108
107
|
}),
|
|
109
108
|
};
|
|
110
|
-
exports.default =
|
|
109
|
+
exports.default = EnvPull;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import EasCommand from '../../commandUtils/EasCommand';
|
|
2
2
|
import { EnvironmentVariableEnvironment } from '../../graphql/generated';
|
|
3
|
-
export default class
|
|
3
|
+
export default class EnvPush extends EasCommand {
|
|
4
4
|
static description: string;
|
|
5
|
-
static hidden: boolean;
|
|
6
5
|
static contextDefinition: {
|
|
7
6
|
loggedIn: import("../../commandUtils/context/LoggedInContextField").default;
|
|
8
7
|
projectId: import("../../commandUtils/context/ProjectIdContextField").ProjectIdContextField;
|
|
@@ -15,7 +15,7 @@ const log_1 = tslib_1.__importDefault(require("../../log"));
|
|
|
15
15
|
const prompts_1 = require("../../prompts");
|
|
16
16
|
const prompts_2 = require("../../utils/prompts");
|
|
17
17
|
const variableUtils_1 = require("../../utils/variableUtils");
|
|
18
|
-
class
|
|
18
|
+
class EnvPush extends EasCommand_1.default {
|
|
19
19
|
async runAsync() {
|
|
20
20
|
const { args, flags } = await this.parse(_a);
|
|
21
21
|
let { environment: environments, path: envPath } = this.parseFlagsAndArgs(flags, args);
|
|
@@ -54,12 +54,12 @@ class EnvironmentVariablePush extends EasCommand_1.default {
|
|
|
54
54
|
const existingDifferentSharedVariables = existingDifferentVariables.filter(variable => variable.scope === generated_1.EnvironmentVariableScope.Shared);
|
|
55
55
|
if (existingDifferentSharedVariables.length > 0) {
|
|
56
56
|
const existingDifferentSharedVariablesNames = existingDifferentSharedVariables.map(variable => variable.name);
|
|
57
|
-
log_1.default.error('
|
|
57
|
+
log_1.default.error('Account-wide variables cannot be overwritten by eas env:push command.');
|
|
58
58
|
log_1.default.error('Remove them from the env file or unlink them from the project to continue:');
|
|
59
59
|
existingDifferentSharedVariablesNames.forEach(name => {
|
|
60
60
|
log_1.default.error(`- ${name}`);
|
|
61
61
|
});
|
|
62
|
-
throw new Error('
|
|
62
|
+
throw new Error('Account-wide variables cannot be overwritten by eas env:push command');
|
|
63
63
|
}
|
|
64
64
|
if (existingDifferentVariables.length > 0) {
|
|
65
65
|
log_1.default.warn(`Some variables already exist in the ${displayedEnvironment} environment.`);
|
|
@@ -161,25 +161,24 @@ class EnvironmentVariablePush extends EasCommand_1.default {
|
|
|
161
161
|
return pushInput;
|
|
162
162
|
}
|
|
163
163
|
}
|
|
164
|
-
_a =
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
EnvironmentVariablePush.contextDefinition = {
|
|
164
|
+
_a = EnvPush;
|
|
165
|
+
EnvPush.description = 'push environment variables from .env file to the selected environment';
|
|
166
|
+
EnvPush.contextDefinition = {
|
|
168
167
|
..._a.ContextOptions.ProjectId,
|
|
169
168
|
..._a.ContextOptions.LoggedIn,
|
|
170
169
|
};
|
|
171
|
-
|
|
170
|
+
EnvPush.flags = {
|
|
172
171
|
...flags_1.EASMultiEnvironmentFlag,
|
|
173
172
|
path: core_1.Flags.string({
|
|
174
173
|
description: 'Path to the input `.env` file',
|
|
175
174
|
default: '.env.local',
|
|
176
175
|
}),
|
|
177
176
|
};
|
|
178
|
-
|
|
177
|
+
EnvPush.args = [
|
|
179
178
|
{
|
|
180
179
|
name: 'environment',
|
|
181
180
|
description: "Environment to push variables to. One of 'production', 'preview', or 'development'.",
|
|
182
181
|
required: false,
|
|
183
182
|
},
|
|
184
183
|
];
|
|
185
|
-
exports.default =
|
|
184
|
+
exports.default = EnvPush;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import EasCommand from '../../commandUtils/EasCommand';
|
|
2
2
|
import { EnvironmentVariableEnvironment } from '../../graphql/generated';
|
|
3
|
-
export default class
|
|
3
|
+
export default class EnvUnlink extends EasCommand {
|
|
4
4
|
static description: string;
|
|
5
5
|
static hidden: boolean;
|
|
6
6
|
static flags: {
|
|
@@ -14,7 +14,7 @@ const projectUtils_1 = require("../../project/projectUtils");
|
|
|
14
14
|
const prompts_1 = require("../../prompts");
|
|
15
15
|
const prompts_2 = require("../../utils/prompts");
|
|
16
16
|
const variableUtils_1 = require("../../utils/variableUtils");
|
|
17
|
-
class
|
|
17
|
+
class EnvUnlink extends EasCommand_1.default {
|
|
18
18
|
async runAsync() {
|
|
19
19
|
const { args, flags } = await this.parse(_a);
|
|
20
20
|
let { 'variable-name': name, 'non-interactive': nonInteractive, environment: unlinkEnvironments, } = this.validateInputs(flags, args);
|
|
@@ -31,13 +31,13 @@ class EnvironmentVariableUnlink extends EasCommand_1.default {
|
|
|
31
31
|
if (nonInteractive) {
|
|
32
32
|
throw new Error("Multiple variables found, please select one using '--variable-name'");
|
|
33
33
|
}
|
|
34
|
-
selectedVariable = await (0, prompts_1.selectAsync)('Select
|
|
34
|
+
selectedVariable = await (0, prompts_1.selectAsync)('Select account-wide variable', variables.map(variable => ({
|
|
35
35
|
title: (0, variableUtils_1.formatVariableName)(variable),
|
|
36
36
|
value: variable,
|
|
37
37
|
})));
|
|
38
38
|
}
|
|
39
39
|
if (!selectedVariable) {
|
|
40
|
-
throw new Error(`
|
|
40
|
+
throw new Error(`Account-wide variable ${name} doesn't exist`);
|
|
41
41
|
}
|
|
42
42
|
let explicitSelect = false;
|
|
43
43
|
if (!nonInteractive && !unlinkEnvironments) {
|
|
@@ -94,25 +94,26 @@ class EnvironmentVariableUnlink extends EasCommand_1.default {
|
|
|
94
94
|
return flags;
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
|
-
_a =
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
97
|
+
_a = EnvUnlink;
|
|
98
|
+
EnvUnlink.description = 'unlink an account-wide environment variable from the current project';
|
|
99
|
+
// for now we only roll out global account-wide env variables so this should stay hidden
|
|
100
|
+
EnvUnlink.hidden = true;
|
|
101
|
+
EnvUnlink.flags = {
|
|
101
102
|
'variable-name': core_1.Flags.string({
|
|
102
103
|
description: 'Name of the variable',
|
|
103
104
|
}),
|
|
104
105
|
...flags_1.EASMultiEnvironmentFlag,
|
|
105
106
|
...flags_1.EASNonInteractiveFlag,
|
|
106
107
|
};
|
|
107
|
-
|
|
108
|
+
EnvUnlink.contextDefinition = {
|
|
108
109
|
..._a.ContextOptions.ProjectId,
|
|
109
110
|
..._a.ContextOptions.LoggedIn,
|
|
110
111
|
};
|
|
111
|
-
|
|
112
|
+
EnvUnlink.args = [
|
|
112
113
|
{
|
|
113
114
|
name: 'environment',
|
|
114
115
|
description: "Environment to unlink the variable from. One of 'production', 'preview', or 'development'.",
|
|
115
116
|
required: false,
|
|
116
117
|
},
|
|
117
118
|
];
|
|
118
|
-
exports.default =
|
|
119
|
+
exports.default = EnvUnlink;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import EasCommand from '../../commandUtils/EasCommand';
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import { EASEnvironmentVariableScopeFlagValue } from '../../commandUtils/flags';
|
|
3
|
+
import { EnvironmentVariableEnvironment } from '../../graphql/generated';
|
|
4
|
+
export default class EnvUpdate extends EasCommand {
|
|
4
5
|
static description: string;
|
|
5
|
-
static hidden: boolean;
|
|
6
6
|
static flags: {
|
|
7
7
|
'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
8
8
|
environment: import("@oclif/core/lib/interfaces").OptionFlag<EnvironmentVariableEnvironment[] | undefined>;
|
|
9
|
-
scope: import("@oclif/core/lib/interfaces").OptionFlag<
|
|
10
|
-
visibility: import("@oclif/core/lib/interfaces").OptionFlag<"
|
|
9
|
+
scope: import("@oclif/core/lib/interfaces").OptionFlag<EASEnvironmentVariableScopeFlagValue>;
|
|
10
|
+
visibility: import("@oclif/core/lib/interfaces").OptionFlag<"secret" | "plaintext" | "sensitive" | undefined>;
|
|
11
11
|
'variable-name': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
12
12
|
'variable-environment': import("@oclif/core/lib/interfaces").OptionFlag<EnvironmentVariableEnvironment | undefined>;
|
|
13
13
|
name: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
@@ -25,6 +25,6 @@ export default class EnvironmentVariableUpdate extends EasCommand {
|
|
|
25
25
|
projectId: import("../../commandUtils/context/ProjectIdContextField").ProjectIdContextField;
|
|
26
26
|
};
|
|
27
27
|
runAsync(): Promise<void>;
|
|
28
|
-
private
|
|
28
|
+
private sanitizeInputs;
|
|
29
29
|
private promptForMissingFlagsAsync;
|
|
30
30
|
}
|
|
@@ -17,10 +17,10 @@ const projectUtils_1 = require("../../project/projectUtils");
|
|
|
17
17
|
const prompts_1 = require("../../prompts");
|
|
18
18
|
const prompts_2 = require("../../utils/prompts");
|
|
19
19
|
const variableUtils_1 = require("../../utils/variableUtils");
|
|
20
|
-
class
|
|
20
|
+
class EnvUpdate extends EasCommand_1.default {
|
|
21
21
|
async runAsync() {
|
|
22
22
|
const { args, flags } = await this.parse(_a);
|
|
23
|
-
const { name, value: rawValue, scope, 'variable-name': currentName, 'variable-environment': currentEnvironment, 'non-interactive': nonInteractive, environment: environments, type, visibility, } = this.
|
|
23
|
+
const { name, value: rawValue, scope, 'variable-name': currentName, 'variable-environment': currentEnvironment, 'non-interactive': nonInteractive, environment: environments, type, visibility, } = this.sanitizeInputs(flags, args);
|
|
24
24
|
const { projectId, loggedIn: { graphqlClient }, } = await this.getContextAsync(_a, {
|
|
25
25
|
nonInteractive,
|
|
26
26
|
});
|
|
@@ -67,6 +67,7 @@ class EnvironmentVariableUpdate extends EasCommand_1.default {
|
|
|
67
67
|
visibility,
|
|
68
68
|
'non-interactive': nonInteractive,
|
|
69
69
|
type,
|
|
70
|
+
scope,
|
|
70
71
|
});
|
|
71
72
|
const variable = await EnvironmentVariableMutation_1.EnvironmentVariableMutation.updateAsync(graphqlClient, {
|
|
72
73
|
id: selectedVariable.id,
|
|
@@ -82,7 +83,7 @@ class EnvironmentVariableUpdate extends EasCommand_1.default {
|
|
|
82
83
|
}
|
|
83
84
|
log_1.default.withTick(`Updated variable ${chalk_1.default.bold(selectedVariable.name)} ${suffix}.`);
|
|
84
85
|
}
|
|
85
|
-
|
|
86
|
+
sanitizeInputs(flags, { environment }) {
|
|
86
87
|
if (flags['non-interactive']) {
|
|
87
88
|
if (!flags['variable-name']) {
|
|
88
89
|
throw new Error('Current name is required in non-interactive mode. Run the command with --variable-name flag.');
|
|
@@ -91,17 +92,21 @@ class EnvironmentVariableUpdate extends EasCommand_1.default {
|
|
|
91
92
|
throw new Error('Value is required when type is set. Run the command with --value flag.');
|
|
92
93
|
}
|
|
93
94
|
}
|
|
95
|
+
const scope = flags.scope === 'account'
|
|
96
|
+
? generated_1.EnvironmentVariableScope.Shared
|
|
97
|
+
: generated_1.EnvironmentVariableScope.Project;
|
|
94
98
|
if (environment) {
|
|
95
99
|
environment = environment.toUpperCase();
|
|
96
100
|
if (!(0, variableUtils_1.isEnvironment)(environment)) {
|
|
97
101
|
throw new Error("Invalid environment. Use one of 'production', 'preview', or 'development'.");
|
|
98
102
|
}
|
|
99
103
|
return {
|
|
100
|
-
'variable-environment': environment,
|
|
101
104
|
...flags,
|
|
105
|
+
'variable-environment': environment,
|
|
106
|
+
scope,
|
|
102
107
|
};
|
|
103
108
|
}
|
|
104
|
-
return flags;
|
|
109
|
+
return { ...flags, scope };
|
|
105
110
|
}
|
|
106
111
|
async promptForMissingFlagsAsync(selectedVariable, { name, value, environment: environments, visibility, 'non-interactive': nonInteractive, type, ...rest }) {
|
|
107
112
|
let newType;
|
|
@@ -169,22 +174,20 @@ class EnvironmentVariableUpdate extends EasCommand_1.default {
|
|
|
169
174
|
newVisibility = (0, prompts_2.parseVisibility)(visibility);
|
|
170
175
|
}
|
|
171
176
|
return {
|
|
177
|
+
...rest,
|
|
172
178
|
name,
|
|
173
179
|
value,
|
|
174
180
|
environment: environments,
|
|
175
181
|
visibility: newVisibility,
|
|
176
|
-
scope: rest.scope ?? generated_1.EnvironmentVariableScope.Project,
|
|
177
182
|
'non-interactive': nonInteractive,
|
|
178
183
|
type: newType,
|
|
179
184
|
fileName,
|
|
180
|
-
...rest,
|
|
181
185
|
};
|
|
182
186
|
}
|
|
183
187
|
}
|
|
184
|
-
_a =
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
EnvironmentVariableUpdate.flags = {
|
|
188
|
+
_a = EnvUpdate;
|
|
189
|
+
EnvUpdate.description = 'update an environment variable on the current project or account';
|
|
190
|
+
EnvUpdate.flags = {
|
|
188
191
|
'variable-name': core_1.Flags.string({
|
|
189
192
|
description: 'Current name of the variable',
|
|
190
193
|
}),
|
|
@@ -203,20 +206,20 @@ EnvironmentVariableUpdate.flags = {
|
|
|
203
206
|
options: ['string', 'file'],
|
|
204
207
|
}),
|
|
205
208
|
...flags_1.EASVariableVisibilityFlag,
|
|
206
|
-
...flags_1.
|
|
209
|
+
...flags_1.EASEnvironmentVariableScopeFlag,
|
|
207
210
|
...flags_1.EASMultiEnvironmentFlag,
|
|
208
211
|
...flags_1.EASNonInteractiveFlag,
|
|
209
212
|
};
|
|
210
|
-
|
|
213
|
+
EnvUpdate.args = [
|
|
211
214
|
{
|
|
212
215
|
name: 'environment',
|
|
213
216
|
description: "Current environment of the variable to update. One of 'production', 'preview', or 'development'.",
|
|
214
217
|
required: false,
|
|
215
218
|
},
|
|
216
219
|
];
|
|
217
|
-
|
|
220
|
+
EnvUpdate.contextDefinition = {
|
|
218
221
|
..._a.ContextOptions.ProjectId,
|
|
219
222
|
..._a.ContextOptions.Analytics,
|
|
220
223
|
..._a.ContextOptions.LoggedIn,
|
|
221
224
|
};
|
|
222
|
-
exports.default =
|
|
225
|
+
exports.default = EnvUpdate;
|
|
@@ -3,6 +3,7 @@ import { EnvironmentSecretScope } from '../../graphql/queries/EnvironmentSecrets
|
|
|
3
3
|
import { SecretType } from '../../graphql/types/EnvironmentSecret';
|
|
4
4
|
export default class EnvironmentSecretCreate extends EasCommand {
|
|
5
5
|
static description: string;
|
|
6
|
+
static hidden: boolean;
|
|
6
7
|
static flags: {
|
|
7
8
|
'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
8
9
|
scope: import("@oclif/core/lib/interfaces").OptionFlag<EnvironmentSecretScope>;
|
|
@@ -17,6 +17,8 @@ const projectUtils_1 = require("../../project/projectUtils");
|
|
|
17
17
|
const prompts_1 = require("../../prompts");
|
|
18
18
|
class EnvironmentSecretCreate extends EasCommand_1.default {
|
|
19
19
|
async runAsync() {
|
|
20
|
+
log_1.default.warn('This command is deprecated. Use eas env:create instead.');
|
|
21
|
+
log_1.default.newLine();
|
|
20
22
|
let { flags: { name, value: secretValue, scope, force, type: secretType, 'non-interactive': nonInteractive, }, } = await this.parse(_a);
|
|
21
23
|
const { projectId, loggedIn: { graphqlClient }, } = await this.getContextAsync(_a, {
|
|
22
24
|
nonInteractive,
|
|
@@ -156,6 +158,7 @@ class EnvironmentSecretCreate extends EasCommand_1.default {
|
|
|
156
158
|
}
|
|
157
159
|
_a = EnvironmentSecretCreate;
|
|
158
160
|
EnvironmentSecretCreate.description = 'create an environment secret on the current project or owner account';
|
|
161
|
+
EnvironmentSecretCreate.hidden = true;
|
|
159
162
|
EnvironmentSecretCreate.flags = {
|
|
160
163
|
scope: core_1.Flags.enum({
|
|
161
164
|
description: 'Scope for the secret',
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import EasCommand from '../../commandUtils/EasCommand';
|
|
2
2
|
export default class EnvironmentSecretDelete extends EasCommand {
|
|
3
3
|
static description: string;
|
|
4
|
+
static hidden: boolean;
|
|
4
5
|
static flags: {
|
|
5
6
|
'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
6
7
|
id: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
@@ -11,6 +11,8 @@ const log_1 = tslib_1.__importDefault(require("../../log"));
|
|
|
11
11
|
const prompts_1 = require("../../prompts");
|
|
12
12
|
class EnvironmentSecretDelete extends EasCommand_1.default {
|
|
13
13
|
async runAsync() {
|
|
14
|
+
log_1.default.warn('This command is deprecated. Use eas env:delete instead.');
|
|
15
|
+
log_1.default.newLine();
|
|
14
16
|
let { flags: { id, 'non-interactive': nonInteractive }, } = await this.parse(_a);
|
|
15
17
|
const { projectId, loggedIn: { graphqlClient }, } = await this.getContextAsync(_a, {
|
|
16
18
|
nonInteractive,
|
|
@@ -56,6 +58,7 @@ class EnvironmentSecretDelete extends EasCommand_1.default {
|
|
|
56
58
|
}
|
|
57
59
|
_a = EnvironmentSecretDelete;
|
|
58
60
|
EnvironmentSecretDelete.description = 'delete an environment secret by ID';
|
|
61
|
+
EnvironmentSecretDelete.hidden = true;
|
|
59
62
|
EnvironmentSecretDelete.flags = {
|
|
60
63
|
id: core_1.Flags.string({
|
|
61
64
|
description: 'ID of the secret to delete',
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import EasCommand from '../../commandUtils/EasCommand';
|
|
2
2
|
export default class EnvironmentSecretList extends EasCommand {
|
|
3
3
|
static description: string;
|
|
4
|
+
static hidden: boolean;
|
|
4
5
|
static contextDefinition: {
|
|
5
6
|
loggedIn: import("../../commandUtils/context/LoggedInContextField").default;
|
|
6
7
|
projectId: import("../../commandUtils/context/ProjectIdContextField").ProjectIdContextField;
|
|
@@ -10,6 +10,8 @@ const log_1 = tslib_1.__importDefault(require("../../log"));
|
|
|
10
10
|
const formatFields_1 = tslib_1.__importDefault(require("../../utils/formatFields"));
|
|
11
11
|
class EnvironmentSecretList extends EasCommand_1.default {
|
|
12
12
|
async runAsync() {
|
|
13
|
+
log_1.default.warn('This command is deprecated. Use eas env:list instead.');
|
|
14
|
+
log_1.default.newLine();
|
|
13
15
|
const { projectId, loggedIn: { graphqlClient }, } = await this.getContextAsync(_a, {
|
|
14
16
|
nonInteractive: true,
|
|
15
17
|
});
|
|
@@ -20,6 +22,7 @@ class EnvironmentSecretList extends EasCommand_1.default {
|
|
|
20
22
|
}
|
|
21
23
|
_a = EnvironmentSecretList;
|
|
22
24
|
EnvironmentSecretList.description = 'list environment secrets available for your current app';
|
|
25
|
+
EnvironmentSecretList.hidden = true;
|
|
23
26
|
EnvironmentSecretList.contextDefinition = {
|
|
24
27
|
..._a.ContextOptions.ProjectId,
|
|
25
28
|
..._a.ContextOptions.LoggedIn,
|
|
@@ -2,6 +2,7 @@ import EasCommand from '../../commandUtils/EasCommand';
|
|
|
2
2
|
import { EnvironmentSecretScope } from '../../graphql/queries/EnvironmentSecretsQuery';
|
|
3
3
|
export default class EnvironmentSecretPush extends EasCommand {
|
|
4
4
|
static description: string;
|
|
5
|
+
static hidden: boolean;
|
|
5
6
|
static flags: {
|
|
6
7
|
'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
7
8
|
scope: import("@oclif/core/lib/interfaces").OptionFlag<EnvironmentSecretScope>;
|
|
@@ -19,6 +19,8 @@ const prompts_1 = require("../../prompts");
|
|
|
19
19
|
const intersection_1 = tslib_1.__importDefault(require("../../utils/expodash/intersection"));
|
|
20
20
|
class EnvironmentSecretPush extends EasCommand_1.default {
|
|
21
21
|
async runAsync() {
|
|
22
|
+
log_1.default.warn('This command is deprecated. Use eas env:push instead.');
|
|
23
|
+
log_1.default.newLine();
|
|
22
24
|
const { flags: { scope, force, 'env-file': maybeEnvFilePath, 'non-interactive': nonInteractive }, } = await this.parse(_a);
|
|
23
25
|
const { projectId, loggedIn: { graphqlClient }, } = await this.getContextAsync(_a, {
|
|
24
26
|
nonInteractive,
|
|
@@ -46,6 +48,7 @@ class EnvironmentSecretPush extends EasCommand_1.default {
|
|
|
46
48
|
}
|
|
47
49
|
_a = EnvironmentSecretPush;
|
|
48
50
|
EnvironmentSecretPush.description = 'read environment secrets from env file and store on the server';
|
|
51
|
+
EnvironmentSecretPush.hidden = true;
|
|
49
52
|
EnvironmentSecretPush.flags = {
|
|
50
53
|
scope: core_1.Flags.enum({
|
|
51
54
|
description: 'Scope for the secrets',
|
|
@@ -206,7 +206,7 @@ class UpdatePublish extends EasCommand_1.default {
|
|
|
206
206
|
appId: projectId,
|
|
207
207
|
branchName,
|
|
208
208
|
});
|
|
209
|
-
const
|
|
209
|
+
const runtimeToPlatformsAndFingerprintInfoAndFingerprintSourceMappingFromExpoUpdates = await Promise.all(runtimeToPlatformsAndFingerprintInfoMapping.map(async (info) => {
|
|
210
210
|
return {
|
|
211
211
|
...info,
|
|
212
212
|
fingerprintSource: info.fingerprint
|
|
@@ -218,6 +218,13 @@ class UpdatePublish extends EasCommand_1.default {
|
|
|
218
218
|
: null,
|
|
219
219
|
};
|
|
220
220
|
}));
|
|
221
|
+
const runtimeToPlatformsAndFingerprintInfoAndFingerprintSourceMapping = await (0, publish_1.maybeCalculateFingerprintForRuntimeVersionInfoObjectsWithoutExpoUpdatesAsync)({
|
|
222
|
+
projectDir,
|
|
223
|
+
graphqlClient,
|
|
224
|
+
runtimeToPlatformsAndFingerprintInfoAndFingerprintSourceMapping: runtimeToPlatformsAndFingerprintInfoAndFingerprintSourceMappingFromExpoUpdates,
|
|
225
|
+
workflowsByPlatform: workflows,
|
|
226
|
+
env: undefined,
|
|
227
|
+
});
|
|
221
228
|
const runtimeVersionToRolloutInfoGroup = rolloutPercentage !== undefined
|
|
222
229
|
? await (0, publish_1.getRuntimeToUpdateRolloutInfoGroupMappingAsync)(graphqlClient, {
|
|
223
230
|
appId: projectId,
|
|
@@ -229,7 +236,7 @@ class UpdatePublish extends EasCommand_1.default {
|
|
|
229
236
|
const gitCommitHash = await vcsClient.getCommitHashAsync();
|
|
230
237
|
const isGitWorkingTreeDirty = await vcsClient.hasUncommittedChangesAsync();
|
|
231
238
|
// Sort the updates into different groups based on their platform specific runtime versions
|
|
232
|
-
const updateGroups = runtimeToPlatformsAndFingerprintInfoAndFingerprintSourceMapping.map(({ runtimeVersion, platforms, fingerprintSource }) => {
|
|
239
|
+
const updateGroups = runtimeToPlatformsAndFingerprintInfoAndFingerprintSourceMapping.map(({ runtimeVersion, platforms, fingerprintSource, fingerprintInfoGroup }) => {
|
|
233
240
|
const localUpdateInfoGroup = Object.fromEntries(platforms.map(platform => [
|
|
234
241
|
platform,
|
|
235
242
|
unsortedUpdateInfoGroups[platform],
|
|
@@ -243,6 +250,15 @@ class UpdatePublish extends EasCommand_1.default {
|
|
|
243
250
|
rolloutInfoGroupForRuntimeVersion[platform],
|
|
244
251
|
]))
|
|
245
252
|
: null;
|
|
253
|
+
const transformedFingerprintInfoGroup = Object.entries(fingerprintInfoGroup).reduce((prev, [platform, fingerprintInfo]) => {
|
|
254
|
+
return {
|
|
255
|
+
...prev,
|
|
256
|
+
[platform]: {
|
|
257
|
+
...fingerprintInfo,
|
|
258
|
+
fingerprintSource: (0, graphql_1.transformFingerprintSource)(fingerprintInfo.fingerprintSource),
|
|
259
|
+
},
|
|
260
|
+
};
|
|
261
|
+
}, {});
|
|
246
262
|
return {
|
|
247
263
|
branchId,
|
|
248
264
|
updateInfoGroup: localUpdateInfoGroup,
|
|
@@ -250,6 +266,7 @@ class UpdatePublish extends EasCommand_1.default {
|
|
|
250
266
|
runtimeFingerprintSource: fingerprintSource
|
|
251
267
|
? (0, graphql_1.transformFingerprintSource)(fingerprintSource)
|
|
252
268
|
: null,
|
|
269
|
+
fingerprintInfoGroup: transformedFingerprintInfoGroup,
|
|
253
270
|
runtimeVersion,
|
|
254
271
|
message: updateMessage,
|
|
255
272
|
gitCommitHash,
|