eas-cli 3.11.0 → 3.12.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 +80 -58
- package/build/build/context.d.ts +2 -0
- package/build/build/createContext.d.ts +3 -1
- package/build/build/createContext.js +2 -1
- package/build/build/metadata.js +2 -1
- package/build/build/runBuildAndSubmit.js +10 -3
- package/build/commandUtils/EasCommand.d.ts +2 -3
- package/build/commands/build/version/get.d.ts +16 -0
- package/build/commands/build/version/get.js +105 -0
- package/build/commands/build/version/set.js +2 -2
- package/build/commands/build/version/sync.js +2 -2
- package/build/graphql/generated.d.ts +76 -48
- package/build/graphql/generated.js +10 -2
- package/build/graphql/types/Build.js +1 -0
- package/build/platform.js +1 -1
- package/build/project/customBuildConfig.d.ts +4 -1
- package/build/project/customBuildConfig.js +7 -2
- package/build/project/remoteVersionSource.d.ts +3 -1
- package/build/project/remoteVersionSource.js +4 -1
- package/build/submit/ArchiveSource.js +12 -0
- package/oclif.manifest.json +1 -1
- package/package.json +5 -5
|
@@ -8,12 +8,12 @@ import { OptionalProjectConfigContextField } from './context/OptionalProjectConf
|
|
|
8
8
|
import ProjectConfigContextField from './context/ProjectConfigContextField';
|
|
9
9
|
import ProjectDirContextField from './context/ProjectDirContextField';
|
|
10
10
|
import SessionManagementContextField from './context/SessionManagementContextField';
|
|
11
|
-
type ContextInput<T extends {
|
|
11
|
+
export type ContextInput<T extends {
|
|
12
12
|
[name: string]: any;
|
|
13
13
|
} = object> = {
|
|
14
14
|
[P in keyof T]: ContextField<T[P]>;
|
|
15
15
|
};
|
|
16
|
-
type ContextOutput<T extends {
|
|
16
|
+
export type ContextOutput<T extends {
|
|
17
17
|
[name: string]: any;
|
|
18
18
|
} = object> = {
|
|
19
19
|
[P in keyof T]: T[P];
|
|
@@ -112,4 +112,3 @@ export default abstract class EasCommand extends Command {
|
|
|
112
112
|
finally(err: Error): Promise<any>;
|
|
113
113
|
protected catch(err: Error): Promise<any>;
|
|
114
114
|
}
|
|
115
|
-
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import EasCommand from '../../../commandUtils/EasCommand';
|
|
2
|
+
export default class BuildVersionGetView extends EasCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static flags: {
|
|
5
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
6
|
+
'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
7
|
+
platform: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
8
|
+
profile: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
9
|
+
};
|
|
10
|
+
static contextDefinition: {
|
|
11
|
+
projectDir: import("../../../commandUtils/context/ProjectDirContextField").default;
|
|
12
|
+
getDynamicProjectConfigAsync: import("../../../commandUtils/context/DynamicProjectConfigContextField").DynamicProjectConfigContextField;
|
|
13
|
+
loggedIn: import("../../../commandUtils/context/LoggedInContextField").default;
|
|
14
|
+
};
|
|
15
|
+
runAsync(): Promise<void>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var _a;
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const eas_json_1 = require("@expo/eas-json");
|
|
6
|
+
const core_1 = require("@oclif/core");
|
|
7
|
+
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
8
|
+
const EasCommand_1 = tslib_1.__importDefault(require("../../../commandUtils/EasCommand"));
|
|
9
|
+
const flags_1 = require("../../../commandUtils/flags");
|
|
10
|
+
const AppVersionQuery_1 = require("../../../graphql/queries/AppVersionQuery");
|
|
11
|
+
const AppPlatform_1 = require("../../../graphql/types/AppPlatform");
|
|
12
|
+
const log_1 = tslib_1.__importDefault(require("../../../log"));
|
|
13
|
+
const platform_1 = require("../../../platform");
|
|
14
|
+
const applicationIdentifier_1 = require("../../../project/applicationIdentifier");
|
|
15
|
+
const remoteVersionSource_1 = require("../../../project/remoteVersionSource");
|
|
16
|
+
const json_1 = require("../../../utils/json");
|
|
17
|
+
const profiles_1 = require("../../../utils/profiles");
|
|
18
|
+
class BuildVersionGetView extends EasCommand_1.default {
|
|
19
|
+
async runAsync() {
|
|
20
|
+
var _b;
|
|
21
|
+
const { flags } = await this.parse(BuildVersionGetView);
|
|
22
|
+
if (flags.json) {
|
|
23
|
+
(0, json_1.enableJsonOutput)();
|
|
24
|
+
}
|
|
25
|
+
const { loggedIn: { graphqlClient }, getDynamicProjectConfigAsync, projectDir, } = await this.getContextAsync(BuildVersionGetView, {
|
|
26
|
+
nonInteractive: true,
|
|
27
|
+
});
|
|
28
|
+
if (!flags.platform && flags['non-interactive']) {
|
|
29
|
+
throw new Error('"--platform" flag is required in non-interactive mode.');
|
|
30
|
+
}
|
|
31
|
+
const requestedPlatform = await (0, platform_1.selectRequestedPlatformAsync)(flags.platform);
|
|
32
|
+
const easJsonAccessor = eas_json_1.EasJsonAccessor.fromProjectPath(projectDir);
|
|
33
|
+
await (0, remoteVersionSource_1.ensureVersionSourceIsRemoteAsync)(easJsonAccessor, {
|
|
34
|
+
nonInteractive: flags['non-interactive'],
|
|
35
|
+
});
|
|
36
|
+
const platforms = (0, platform_1.toPlatforms)(requestedPlatform);
|
|
37
|
+
const buildProfiles = await (0, profiles_1.getProfilesAsync)({
|
|
38
|
+
type: 'build',
|
|
39
|
+
easJsonAccessor,
|
|
40
|
+
platforms,
|
|
41
|
+
profileName: (_b = flags.profile) !== null && _b !== void 0 ? _b : undefined,
|
|
42
|
+
});
|
|
43
|
+
const results = {};
|
|
44
|
+
for (const { profile, platform } of buildProfiles) {
|
|
45
|
+
const { exp, projectId } = await getDynamicProjectConfigAsync({
|
|
46
|
+
env: profile.env,
|
|
47
|
+
});
|
|
48
|
+
(0, remoteVersionSource_1.validateAppConfigForRemoteVersionSource)(exp, platform);
|
|
49
|
+
const applicationIdentifier = await (0, applicationIdentifier_1.getApplicationIdentifierAsync)({
|
|
50
|
+
graphqlClient,
|
|
51
|
+
projectDir,
|
|
52
|
+
projectId,
|
|
53
|
+
exp,
|
|
54
|
+
buildProfile: profile,
|
|
55
|
+
platform,
|
|
56
|
+
});
|
|
57
|
+
const remoteVersions = await AppVersionQuery_1.AppVersionQuery.latestVersionAsync(graphqlClient, projectId, (0, AppPlatform_1.toAppPlatform)(platform), applicationIdentifier);
|
|
58
|
+
if (remoteVersions === null || remoteVersions === void 0 ? void 0 : remoteVersions.buildVersion) {
|
|
59
|
+
results[platform] = remoteVersions === null || remoteVersions === void 0 ? void 0 : remoteVersions.buildVersion;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
if (flags.json) {
|
|
63
|
+
const jsonResults = {};
|
|
64
|
+
if (results.android) {
|
|
65
|
+
jsonResults.versionCode = results.android;
|
|
66
|
+
}
|
|
67
|
+
if (results.ios) {
|
|
68
|
+
jsonResults.buildNumber = results.ios;
|
|
69
|
+
}
|
|
70
|
+
(0, json_1.printJsonOnlyOutput)(jsonResults);
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
if (Object.keys(results).length === 0) {
|
|
74
|
+
log_1.default.log('No remote versions are configured for this project.');
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
if (results.android) {
|
|
78
|
+
log_1.default.log(`Android versionCode - ${chalk_1.default.bold(results.android)}`);
|
|
79
|
+
}
|
|
80
|
+
if (results.ios) {
|
|
81
|
+
log_1.default.log(`iOS buildNumber - ${chalk_1.default.bold(results.ios)}`);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
exports.default = BuildVersionGetView;
|
|
87
|
+
_a = BuildVersionGetView;
|
|
88
|
+
BuildVersionGetView.description = 'get the latest version from EAS servers';
|
|
89
|
+
BuildVersionGetView.flags = {
|
|
90
|
+
platform: core_1.Flags.enum({
|
|
91
|
+
char: 'p',
|
|
92
|
+
options: ['android', 'ios', 'all'],
|
|
93
|
+
}),
|
|
94
|
+
profile: core_1.Flags.string({
|
|
95
|
+
char: 'e',
|
|
96
|
+
description: 'Name of the build profile from eas.json. Defaults to "production" if defined in eas.json.',
|
|
97
|
+
helpValue: 'PROFILE_NAME',
|
|
98
|
+
}),
|
|
99
|
+
...flags_1.EasNonInteractiveAndJsonFlags,
|
|
100
|
+
};
|
|
101
|
+
BuildVersionGetView.contextDefinition = {
|
|
102
|
+
..._a.ContextOptions.LoggedIn,
|
|
103
|
+
..._a.ContextOptions.DynamicProjectConfig,
|
|
104
|
+
..._a.ContextOptions.ProjectDir,
|
|
105
|
+
};
|
|
@@ -28,7 +28,7 @@ class BuildVersionSetView extends EasCommand_1.default {
|
|
|
28
28
|
});
|
|
29
29
|
const platform = await (0, platform_1.selectPlatformAsync)(flags.platform);
|
|
30
30
|
const easJsonAccessor = eas_json_1.EasJsonAccessor.fromProjectPath(projectDir);
|
|
31
|
-
await (0, remoteVersionSource_1.ensureVersionSourceIsRemoteAsync)(easJsonAccessor);
|
|
31
|
+
await (0, remoteVersionSource_1.ensureVersionSourceIsRemoteAsync)(easJsonAccessor, { nonInteractive: false });
|
|
32
32
|
const profile = await eas_json_1.EasJsonUtils.getBuildProfileAsync(easJsonAccessor, platform, (_b = flags.profile) !== null && _b !== void 0 ? _b : undefined);
|
|
33
33
|
const { exp, projectId } = await getDynamicProjectConfigAsync({ env: profile.env });
|
|
34
34
|
const displayName = await (0, projectUtils_1.getDisplayNameForProjectIdAsync)(graphqlClient, projectId);
|
|
@@ -69,7 +69,7 @@ class BuildVersionSetView extends EasCommand_1.default {
|
|
|
69
69
|
}
|
|
70
70
|
exports.default = BuildVersionSetView;
|
|
71
71
|
_a = BuildVersionSetView;
|
|
72
|
-
BuildVersionSetView.description = '
|
|
72
|
+
BuildVersionSetView.description = 'update version of an app';
|
|
73
73
|
BuildVersionSetView.flags = {
|
|
74
74
|
platform: core_1.Flags.enum({
|
|
75
75
|
char: 'p',
|
|
@@ -31,7 +31,7 @@ class BuildVersionSyncView extends EasCommand_1.default {
|
|
|
31
31
|
});
|
|
32
32
|
const requestedPlatform = await (0, platform_1.selectRequestedPlatformAsync)(flags.platform);
|
|
33
33
|
const easJsonAccessor = eas_json_1.EasJsonAccessor.fromProjectPath(projectDir);
|
|
34
|
-
await (0, remoteVersionSource_1.ensureVersionSourceIsRemoteAsync)(easJsonAccessor);
|
|
34
|
+
await (0, remoteVersionSource_1.ensureVersionSourceIsRemoteAsync)(easJsonAccessor, { nonInteractive: false });
|
|
35
35
|
const platforms = (0, platform_1.toPlatforms)(requestedPlatform);
|
|
36
36
|
const buildProfiles = await (0, profiles_1.getProfilesAsync)({
|
|
37
37
|
type: 'build',
|
|
@@ -120,7 +120,7 @@ class BuildVersionSyncView extends EasCommand_1.default {
|
|
|
120
120
|
}
|
|
121
121
|
exports.default = BuildVersionSyncView;
|
|
122
122
|
_a = BuildVersionSyncView;
|
|
123
|
-
BuildVersionSyncView.description = '
|
|
123
|
+
BuildVersionSyncView.description = 'update a version in native code with a value stored on EAS servers';
|
|
124
124
|
BuildVersionSyncView.flags = {
|
|
125
125
|
platform: core_1.Flags.enum({
|
|
126
126
|
char: 'p',
|