eas-cli 0.43.0 → 0.45.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 +845 -1
- package/build/build/android/UpdatesModule.d.ts +0 -1
- package/build/build/android/UpdatesModule.js +4 -37
- package/build/build/android/build.js +3 -3
- package/build/build/android/graphql.js +1 -0
- package/build/build/android/prepareJob.js +3 -0
- package/build/build/android/{configure.d.ts → syncProjectConfiguration.d.ts} +2 -3
- package/build/build/android/{configure.js → syncProjectConfiguration.js} +22 -23
- package/build/build/build.d.ts +1 -1
- package/build/build/build.js +6 -8
- package/build/build/configure.d.ts +12 -7
- package/build/build/configure.js +25 -99
- package/build/build/context.d.ts +0 -12
- package/build/build/createContext.d.ts +1 -2
- package/build/build/createContext.js +1 -2
- package/build/build/ios/UpdatesModule.d.ts +0 -1
- package/build/build/ios/UpdatesModule.js +8 -39
- package/build/build/ios/build.js +3 -3
- package/build/build/ios/graphql.js +1 -0
- package/build/build/ios/prepareJob.js +3 -0
- package/build/build/ios/{configure.d.ts → syncProjectConfiguration.d.ts} +1 -3
- package/build/build/ios/{configure.js → syncProjectConfiguration.js} +3 -18
- package/build/build/local.d.ts +1 -0
- package/build/build/local.js +2 -1
- package/build/build/runBuildAndSubmit.d.ts +0 -1
- package/build/build/runBuildAndSubmit.js +8 -2
- package/build/commands/branch/view.d.ts +0 -2
- package/build/commands/branch/view.js +2 -46
- package/build/commands/build/configure.js +43 -25
- package/build/commands/build/index.d.ts +1 -0
- package/build/commands/build/index.js +12 -2
- package/build/commands/build/inspect.js +0 -1
- package/build/commands/device/delete.d.ts +17 -0
- package/build/commands/device/delete.js +181 -0
- package/build/commands/device/list.js +1 -1
- package/build/commands/update/index.js +2 -2
- package/build/commands/update/list.d.ts +10 -0
- package/build/commands/update/list.js +114 -0
- package/build/commands/webhook/update.js +1 -1
- package/build/credentials/ios/actions/DeviceUtils.d.ts +1 -0
- package/build/credentials/ios/actions/DeviceUtils.js +16 -1
- package/build/credentials/ios/api/graphql/mutations/AppleDeviceMutation.d.ts +1 -0
- package/build/credentials/ios/api/graphql/mutations/AppleDeviceMutation.js +16 -0
- package/build/credentials/ios/appstore/bundleIdCapabilities.js +0 -2
- package/build/credentials/ios/appstore/ensureAppExists.js +3 -1
- package/build/graphql/generated.d.ts +5838 -3523
- package/build/graphql/generated.js +223 -223
- package/build/graphql/queries/UpdateQuery.d.ts +7 -0
- package/build/graphql/queries/UpdateQuery.js +85 -0
- package/build/submit/ArchiveSource.js +0 -1
- package/build/vcs/local.js +5 -1
- package/oclif.manifest.json +1 -1
- package/package.json +44 -45
|
@@ -1,27 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
3
|
+
exports.syncProjectConfigurationAsync = void 0;
|
|
5
4
|
const eas_build_job_1 = require("@expo/eas-build-job");
|
|
6
|
-
const log_1 = (0, tslib_1.__importDefault)(require("../../log"));
|
|
7
|
-
const bundleIdentifier_1 = require("../../project/ios/bundleIdentifier");
|
|
8
5
|
const workflow_1 = require("../../project/workflow");
|
|
9
6
|
const updates_1 = require("../utils/updates");
|
|
10
7
|
const UpdatesModule_1 = require("./UpdatesModule");
|
|
11
8
|
const version_1 = require("./version");
|
|
12
|
-
async function
|
|
13
|
-
if (!ctx.hasIosNativeProject) {
|
|
14
|
-
await (0, bundleIdentifier_1.ensureBundleIdentifierIsDefinedForManagedProjectAsync)(ctx.projectDir, ctx.exp);
|
|
15
|
-
return;
|
|
16
|
-
}
|
|
17
|
-
(0, bundleIdentifier_1.warnIfBundleIdentifierDefinedInAppConfigForBareWorkflowProject)(ctx.projectDir, ctx.exp);
|
|
18
|
-
if ((0, updates_1.isExpoUpdatesInstalled)(ctx.projectDir)) {
|
|
19
|
-
await (0, UpdatesModule_1.configureUpdatesAsync)(ctx.projectDir, ctx.exp);
|
|
20
|
-
}
|
|
21
|
-
log_1.default.withTick('iOS project configured');
|
|
22
|
-
}
|
|
23
|
-
exports.configureIosAsync = configureIosAsync;
|
|
24
|
-
async function validateAndSyncProjectConfigurationAsync({ projectDir, exp, buildProfile, buildSettings, }) {
|
|
9
|
+
async function syncProjectConfigurationAsync({ projectDir, exp, buildProfile, buildSettings, }) {
|
|
25
10
|
const workflow = await (0, workflow_1.resolveWorkflowAsync)(projectDir, eas_build_job_1.Platform.IOS);
|
|
26
11
|
const { autoIncrement } = buildProfile;
|
|
27
12
|
const versionBumpStrategy = resolveVersionBumpStrategy(autoIncrement !== null && autoIncrement !== void 0 ? autoIncrement : false);
|
|
@@ -35,7 +20,7 @@ async function validateAndSyncProjectConfigurationAsync({ projectDir, exp, build
|
|
|
35
20
|
await (0, version_1.bumpVersionInAppJsonAsync)({ projectDir, exp, bumpStrategy: versionBumpStrategy });
|
|
36
21
|
}
|
|
37
22
|
}
|
|
38
|
-
exports.
|
|
23
|
+
exports.syncProjectConfigurationAsync = syncProjectConfigurationAsync;
|
|
39
24
|
function resolveVersionBumpStrategy(autoIncrement) {
|
|
40
25
|
if (autoIncrement === true) {
|
|
41
26
|
return version_1.BumpStrategy.BUILD_NUMBER;
|
package/build/build/local.d.ts
CHANGED
package/build/build/local.js
CHANGED
|
@@ -6,7 +6,7 @@ const spawn_async_1 = (0, tslib_1.__importDefault)(require("@expo/spawn-async"))
|
|
|
6
6
|
const semver_1 = (0, tslib_1.__importDefault)(require("semver"));
|
|
7
7
|
const ora_1 = require("../ora");
|
|
8
8
|
const PLUGIN_PACKAGE_NAME = 'eas-cli-local-build-plugin';
|
|
9
|
-
const PLUGIN_PACKAGE_VERSION = '0.0.
|
|
9
|
+
const PLUGIN_PACKAGE_VERSION = '0.0.62';
|
|
10
10
|
async function runLocalBuildAsync(job, options) {
|
|
11
11
|
var _a;
|
|
12
12
|
const { command, args } = await getCommandAndArgsAsync(job);
|
|
@@ -32,6 +32,7 @@ async function runLocalBuildAsync(job, options) {
|
|
|
32
32
|
: {}),
|
|
33
33
|
...(options.skipNativeBuild ? { EAS_LOCAL_BUILD_SKIP_NATIVE_BUILD: '1' } : {}),
|
|
34
34
|
...(options.artifactsDir ? { EAS_LOCAL_BUILD_ARTIFACTS_DIR: options.artifactsDir } : {}),
|
|
35
|
+
...(options.artifactPath ? { EAS_LOCAL_BUILD_ARTIFACT_PATH: options.artifactPath } : {}),
|
|
35
36
|
},
|
|
36
37
|
});
|
|
37
38
|
childProcess = spawnPromise.child;
|
|
@@ -14,6 +14,7 @@ const metroConfig_1 = require("../project/metroConfig");
|
|
|
14
14
|
const context_1 = require("../submit/context");
|
|
15
15
|
const submit_1 = require("../submit/submit");
|
|
16
16
|
const urls_1 = require("../submit/utils/urls");
|
|
17
|
+
const json_1 = require("../utils/json");
|
|
17
18
|
const profiles_1 = require("../utils/profiles");
|
|
18
19
|
const vcs_1 = require("../vcs");
|
|
19
20
|
const build_1 = require("./android/build");
|
|
@@ -30,7 +31,10 @@ async function runBuildAndSubmitAsync(projectDir, flags) {
|
|
|
30
31
|
var _a;
|
|
31
32
|
await (0, vcs_1.getVcsClient)().ensureRepoExistsAsync();
|
|
32
33
|
await (0, repository_1.ensureRepoIsCleanAsync)(flags.nonInteractive);
|
|
33
|
-
await (0, configure_1.ensureProjectConfiguredAsync)(
|
|
34
|
+
await (0, configure_1.ensureProjectConfiguredAsync)({
|
|
35
|
+
projectDir,
|
|
36
|
+
nonInteractive: flags.nonInteractive,
|
|
37
|
+
});
|
|
34
38
|
const platforms = (0, platform_1.toPlatforms)(flags.requestedPlatform);
|
|
35
39
|
const buildProfiles = await (0, profiles_1.getProfilesAsync)({
|
|
36
40
|
type: 'build',
|
|
@@ -89,6 +93,9 @@ async function runBuildAndSubmitAsync(projectDir, flags) {
|
|
|
89
93
|
log_1.default.newLine();
|
|
90
94
|
}
|
|
91
95
|
if (!flags.wait) {
|
|
96
|
+
if (flags.json) {
|
|
97
|
+
(0, json_1.printJsonOnlyOutput)(startedBuilds.map(buildInfo => buildInfo.build));
|
|
98
|
+
}
|
|
92
99
|
return;
|
|
93
100
|
}
|
|
94
101
|
const builds = await (0, build_2.waitForBuildEndAsync)(startedBuilds.map(({ build }) => build.id));
|
|
@@ -111,7 +118,6 @@ async function prepareAndStartBuildAsync({ projectDir, flags, moreBuilds, buildP
|
|
|
111
118
|
nonInteractive: flags.nonInteractive,
|
|
112
119
|
platform: buildProfile.platform,
|
|
113
120
|
projectDir,
|
|
114
|
-
skipProjectConfiguration: flags.skipProjectConfiguration,
|
|
115
121
|
localBuildOptions: flags.localBuildOptions,
|
|
116
122
|
});
|
|
117
123
|
if (moreBuilds) {
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import EasCommand from '../../commandUtils/EasCommand';
|
|
2
|
-
import { ViewBranchQuery, ViewBranchQueryVariables } from '../../graphql/generated';
|
|
3
|
-
export declare function viewUpdateBranchAsync({ appId, name, }: Pick<ViewBranchQueryVariables, 'appId' | 'name'>): Promise<ViewBranchQuery>;
|
|
4
2
|
export default class BranchView extends EasCommand {
|
|
5
3
|
static description: string;
|
|
6
4
|
static args: {
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.viewUpdateBranchAsync = void 0;
|
|
4
3
|
const tslib_1 = require("tslib");
|
|
5
4
|
const config_1 = require("@expo/config");
|
|
6
5
|
const core_1 = require("@oclif/core");
|
|
7
6
|
const chalk_1 = (0, tslib_1.__importDefault)(require("chalk"));
|
|
8
7
|
const cli_table3_1 = (0, tslib_1.__importDefault)(require("cli-table3"));
|
|
9
|
-
const graphql_tag_1 = (0, tslib_1.__importDefault)(require("graphql-tag"));
|
|
10
8
|
const EasCommand_1 = (0, tslib_1.__importDefault)(require("../../commandUtils/EasCommand"));
|
|
11
|
-
const
|
|
9
|
+
const UpdateQuery_1 = require("../../graphql/queries/UpdateQuery");
|
|
12
10
|
const log_1 = (0, tslib_1.__importDefault)(require("../../log"));
|
|
13
11
|
const projectUtils_1 = require("../../project/projectUtils");
|
|
14
12
|
const prompts_1 = require("../../prompts");
|
|
@@ -16,48 +14,6 @@ const utils_1 = require("../../update/utils");
|
|
|
16
14
|
const groupBy_1 = (0, tslib_1.__importDefault)(require("../../utils/expodash/groupBy"));
|
|
17
15
|
const formatFields_1 = (0, tslib_1.__importDefault)(require("../../utils/formatFields"));
|
|
18
16
|
const json_1 = require("../../utils/json");
|
|
19
|
-
const PAGE_LIMIT = 10000;
|
|
20
|
-
async function viewUpdateBranchAsync({ appId, name, }) {
|
|
21
|
-
const data = await (0, client_1.withErrorHandlingAsync)(client_1.graphqlClient
|
|
22
|
-
.query((0, graphql_tag_1.default) `
|
|
23
|
-
query ViewBranch($appId: String!, $name: String!, $limit: Int!) {
|
|
24
|
-
app {
|
|
25
|
-
byId(appId: $appId) {
|
|
26
|
-
id
|
|
27
|
-
updateBranchByName(name: $name) {
|
|
28
|
-
id
|
|
29
|
-
name
|
|
30
|
-
updates(offset: 0, limit: $limit) {
|
|
31
|
-
id
|
|
32
|
-
group
|
|
33
|
-
message
|
|
34
|
-
createdAt
|
|
35
|
-
runtimeVersion
|
|
36
|
-
platform
|
|
37
|
-
manifestFragment
|
|
38
|
-
actor {
|
|
39
|
-
id
|
|
40
|
-
... on User {
|
|
41
|
-
username
|
|
42
|
-
}
|
|
43
|
-
... on Robot {
|
|
44
|
-
firstName
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
`, {
|
|
53
|
-
appId,
|
|
54
|
-
name,
|
|
55
|
-
limit: PAGE_LIMIT,
|
|
56
|
-
}, { additionalTypenames: ['UpdateBranch', 'Update'] })
|
|
57
|
-
.toPromise());
|
|
58
|
-
return data;
|
|
59
|
-
}
|
|
60
|
-
exports.viewUpdateBranchAsync = viewUpdateBranchAsync;
|
|
61
17
|
class BranchView extends EasCommand_1.default {
|
|
62
18
|
async runAsync() {
|
|
63
19
|
let { args: { name }, flags: { json: jsonFlag }, } = await this.parse(BranchView);
|
|
@@ -79,7 +35,7 @@ class BranchView extends EasCommand_1.default {
|
|
|
79
35
|
validate: value => (value ? true : validationMessage),
|
|
80
36
|
}));
|
|
81
37
|
}
|
|
82
|
-
const { app } = await
|
|
38
|
+
const { app } = await UpdateQuery_1.UpdateQuery.viewBranchAsync({
|
|
83
39
|
appId: projectId,
|
|
84
40
|
name,
|
|
85
41
|
});
|
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
+
const config_1 = require("@expo/config");
|
|
5
|
+
const eas_build_job_1 = require("@expo/eas-build-job");
|
|
4
6
|
const core_1 = require("@oclif/core");
|
|
5
7
|
const chalk_1 = (0, tslib_1.__importDefault)(require("chalk"));
|
|
8
|
+
const UpdatesModule_1 = require("../../build/android/UpdatesModule");
|
|
9
|
+
const syncProjectConfiguration_1 = require("../../build/android/syncProjectConfiguration");
|
|
6
10
|
const configure_1 = require("../../build/configure");
|
|
11
|
+
const UpdatesModule_2 = require("../../build/ios/UpdatesModule");
|
|
12
|
+
const updates_1 = require("../../build/utils/updates");
|
|
7
13
|
const EasCommand_1 = (0, tslib_1.__importDefault)(require("../../commandUtils/EasCommand"));
|
|
8
14
|
const log_1 = (0, tslib_1.__importStar)(require("../../log"));
|
|
9
15
|
const platform_1 = require("../../platform");
|
|
10
16
|
const projectUtils_1 = require("../../project/projectUtils");
|
|
17
|
+
const workflow_1 = require("../../project/workflow");
|
|
11
18
|
const prompts_1 = require("../../prompts");
|
|
12
19
|
const vcs_1 = require("../../vcs");
|
|
13
20
|
class BuildConfigure extends EasCommand_1.default {
|
|
@@ -15,15 +22,44 @@ class BuildConfigure extends EasCommand_1.default {
|
|
|
15
22
|
var _a;
|
|
16
23
|
const { flags } = await this.parse(BuildConfigure);
|
|
17
24
|
log_1.default.log('💡 The following process will configure your iOS and/or Android project to be compatible with EAS Build. These changes only apply to your local project files and you can safely revert them at any time.');
|
|
18
|
-
log_1.default.newLine();
|
|
19
25
|
await (0, vcs_1.getVcsClient)().ensureRepoExistsAsync();
|
|
26
|
+
const projectDir = await (0, projectUtils_1.findProjectRootAsync)();
|
|
27
|
+
const expoUpdatesIsInstalled = (0, updates_1.isExpoUpdatesInstalled)(projectDir);
|
|
20
28
|
const platform = (_a = flags.platform) !== null && _a !== void 0 ? _a : (await promptForPlatformAsync());
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
29
|
+
// clean up old Android configuration
|
|
30
|
+
if ([platform_1.RequestedPlatform.Android, platform_1.RequestedPlatform.All].includes(platform)) {
|
|
31
|
+
await (0, syncProjectConfiguration_1.cleanUpOldEasBuildGradleScriptAsync)(projectDir);
|
|
32
|
+
}
|
|
33
|
+
// ensure eas.json exists
|
|
25
34
|
log_1.default.newLine();
|
|
26
|
-
|
|
35
|
+
await (0, configure_1.ensureProjectConfiguredAsync)({
|
|
36
|
+
projectDir,
|
|
37
|
+
nonInteractive: false,
|
|
38
|
+
});
|
|
39
|
+
// configure expo-updates
|
|
40
|
+
if (expoUpdatesIsInstalled) {
|
|
41
|
+
const { exp } = (0, config_1.getConfig)(projectDir, { skipSDKVersionRequirement: true });
|
|
42
|
+
if ([platform_1.RequestedPlatform.Android, platform_1.RequestedPlatform.All].includes(platform)) {
|
|
43
|
+
const workflow = await (0, workflow_1.resolveWorkflowAsync)(projectDir, eas_build_job_1.Platform.ANDROID);
|
|
44
|
+
if (workflow === eas_build_job_1.Workflow.GENERIC) {
|
|
45
|
+
await (0, UpdatesModule_1.syncUpdatesConfigurationAsync)(projectDir, exp);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
if ([platform_1.RequestedPlatform.Ios, platform_1.RequestedPlatform.All].includes(platform)) {
|
|
49
|
+
const workflow = await (0, workflow_1.resolveWorkflowAsync)(projectDir, eas_build_job_1.Platform.IOS);
|
|
50
|
+
if (workflow === eas_build_job_1.Workflow.GENERIC) {
|
|
51
|
+
await (0, UpdatesModule_2.syncUpdatesConfigurationAsync)(projectDir, exp);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
log_1.default.addNewLineIfNone();
|
|
56
|
+
log_1.default.log(`🎉 Your project is ready to build.
|
|
57
|
+
|
|
58
|
+
- Run ${chalk_1.default.bold('eas build')} when you are ready to create your first build.
|
|
59
|
+
- Once the build is completed, run ${chalk_1.default.bold('eas submit')} to upload the app to app stores.
|
|
60
|
+
- ${(0, log_1.learnMore)('https://docs.expo.dev/build/introduction', {
|
|
61
|
+
learnMoreMessage: 'Learn more about other capabilities of EAS Build',
|
|
62
|
+
})}`);
|
|
27
63
|
}
|
|
28
64
|
}
|
|
29
65
|
exports.default = BuildConfigure;
|
|
@@ -35,26 +71,8 @@ BuildConfigure.flags = {
|
|
|
35
71
|
options: ['android', 'ios', 'all'],
|
|
36
72
|
}),
|
|
37
73
|
};
|
|
38
|
-
function logSuccess(platform) {
|
|
39
|
-
let platformsText = 'iOS and Android projects are';
|
|
40
|
-
let storesText = 'the Apple App Store or Google Play Store';
|
|
41
|
-
if (platform === 'android') {
|
|
42
|
-
platformsText = 'Android project is';
|
|
43
|
-
storesText = 'the Google Play Store';
|
|
44
|
-
}
|
|
45
|
-
else if (platform === 'ios') {
|
|
46
|
-
platformsText = 'iOS project is';
|
|
47
|
-
storesText = 'the Apple App Store Connect';
|
|
48
|
-
}
|
|
49
|
-
log_1.default.log(`🎉 Your ${platformsText} ready to build.
|
|
50
|
-
|
|
51
|
-
- Run ${chalk_1.default.bold('eas build')} when you are ready to create your first build.
|
|
52
|
-
- Once the build is completed, run ${chalk_1.default.bold('eas submit')} to upload the app to ${storesText}
|
|
53
|
-
- ${(0, log_1.learnMore)('https://docs.expo.dev/build/introduction', {
|
|
54
|
-
learnMoreMessage: 'Learn more about other capabilities of EAS Build',
|
|
55
|
-
})}`);
|
|
56
|
-
}
|
|
57
74
|
async function promptForPlatformAsync() {
|
|
75
|
+
log_1.default.addNewLineIfNone();
|
|
58
76
|
const { platform } = await (0, prompts_1.promptAsync)({
|
|
59
77
|
type: 'select',
|
|
60
78
|
message: 'Which platforms would you like to configure for EAS Build?',
|
|
@@ -9,6 +9,7 @@ export default class Build extends EasCommand {
|
|
|
9
9
|
profile: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
10
10
|
'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
11
11
|
local: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
12
|
+
output: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
12
13
|
wait: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
13
14
|
'clear-cache': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
14
15
|
'auto-submit': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
@@ -7,6 +7,7 @@ const core_1 = require("@oclif/core");
|
|
|
7
7
|
const chalk_1 = (0, tslib_1.__importDefault)(require("chalk"));
|
|
8
8
|
const figures_1 = (0, tslib_1.__importDefault)(require("figures"));
|
|
9
9
|
const fs_extra_1 = (0, tslib_1.__importDefault)(require("fs-extra"));
|
|
10
|
+
const path_1 = (0, tslib_1.__importDefault)(require("path"));
|
|
10
11
|
const runBuildAndSubmit_1 = require("../../build/runBuildAndSubmit");
|
|
11
12
|
const repository_1 = require("../../build/utils/repository");
|
|
12
13
|
const EasCommand_1 = (0, tslib_1.__importDefault)(require("../../commandUtils/EasCommand"));
|
|
@@ -32,6 +33,9 @@ class Build extends EasCommand_1.default {
|
|
|
32
33
|
async sanitizeFlagsAsync(flags) {
|
|
33
34
|
var _a;
|
|
34
35
|
const nonInteractive = flags['non-interactive'];
|
|
36
|
+
if (!flags.local && flags.output) {
|
|
37
|
+
core_1.Errors.error('--output is allowed only for local builds', { exit: 1 });
|
|
38
|
+
}
|
|
35
39
|
if (!flags.platform && nonInteractive) {
|
|
36
40
|
core_1.Errors.error('--platform is required when building in non-interactive mode', { exit: 1 });
|
|
37
41
|
}
|
|
@@ -60,11 +64,14 @@ class Build extends EasCommand_1.default {
|
|
|
60
64
|
const profile = flags['profile'];
|
|
61
65
|
return {
|
|
62
66
|
requestedPlatform,
|
|
63
|
-
skipProjectConfiguration: flags['skip-project-configuration'],
|
|
64
67
|
profile,
|
|
65
68
|
nonInteractive,
|
|
66
69
|
localBuildOptions: flags['local']
|
|
67
|
-
? {
|
|
70
|
+
? {
|
|
71
|
+
enable: true,
|
|
72
|
+
verbose: true,
|
|
73
|
+
artifactPath: flags.output && path_1.default.resolve(process.cwd(), flags.output),
|
|
74
|
+
}
|
|
68
75
|
: {
|
|
69
76
|
enable: false,
|
|
70
77
|
},
|
|
@@ -107,6 +114,9 @@ Build.flags = {
|
|
|
107
114
|
default: false,
|
|
108
115
|
description: 'Run build locally [experimental]',
|
|
109
116
|
}),
|
|
117
|
+
output: core_1.Flags.string({
|
|
118
|
+
description: 'Output path for local build',
|
|
119
|
+
}),
|
|
110
120
|
wait: core_1.Flags.boolean({
|
|
111
121
|
default: true,
|
|
112
122
|
allowNo: true,
|
|
@@ -43,7 +43,6 @@ class BuildInspect extends EasCommand_1.default {
|
|
|
43
43
|
const projectDir = await (0, projectUtils_1.findProjectRootAsync)();
|
|
44
44
|
try {
|
|
45
45
|
await (0, runBuildAndSubmit_1.runBuildAndSubmitAsync)(projectDir, {
|
|
46
|
-
skipProjectConfiguration: false,
|
|
47
46
|
nonInteractive: false,
|
|
48
47
|
wait: true,
|
|
49
48
|
clearCache: false,
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import EasCommand from '../../commandUtils/EasCommand';
|
|
2
|
+
import { AppleDeviceQueryResult, AppleDevicesByTeamIdentifierQueryResult } from '../../credentials/ios/api/graphql/queries/AppleDeviceQuery';
|
|
3
|
+
import { AppleDevice, Maybe } from '../../graphql/generated';
|
|
4
|
+
export default class DeviceDelete extends EasCommand {
|
|
5
|
+
static description: string;
|
|
6
|
+
static flags: {
|
|
7
|
+
'apple-team-id': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
8
|
+
udid: import("@oclif/core/lib/interfaces").OptionFlag<string[]>;
|
|
9
|
+
};
|
|
10
|
+
runAsync(): Promise<void>;
|
|
11
|
+
askAndDisableOnAppleAsync(chosenDevices: (AppleDevice | AppleDeviceQueryResult)[], appleTeamIdentifier: string): Promise<void>;
|
|
12
|
+
askAndRemoveFromExpoAsync(chosenDevices: (AppleDevice | AppleDeviceQueryResult)[]): Promise<boolean>;
|
|
13
|
+
logChosenDevices(chosenDevices: (AppleDevice | AppleDeviceQueryResult)[], appleTeamName: Maybe<string> | undefined, appleTeamIdentifier: string): void;
|
|
14
|
+
chooseDevicesToDeleteAsync(appleDevices: AppleDeviceQueryResult[], udids: string[]): Promise<(AppleDevice | AppleDeviceQueryResult)[]>;
|
|
15
|
+
getDevicesForTeamAsync(accountName: string, appleTeamIdentifier: string): Promise<AppleDevicesByTeamIdentifierQueryResult | undefined>;
|
|
16
|
+
askForAppleTeamAsync(accountName: string): Promise<string | undefined>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const apple_utils_1 = require("@expo/apple-utils");
|
|
5
|
+
const config_1 = require("@expo/config");
|
|
6
|
+
const core_1 = require("@oclif/core");
|
|
7
|
+
const assert_1 = (0, tslib_1.__importDefault)(require("assert"));
|
|
8
|
+
const EasCommand_1 = (0, tslib_1.__importDefault)(require("../../commandUtils/EasCommand"));
|
|
9
|
+
const DeviceUtils_1 = require("../../credentials/ios/actions/DeviceUtils");
|
|
10
|
+
const AppleDeviceMutation_1 = require("../../credentials/ios/api/graphql/mutations/AppleDeviceMutation");
|
|
11
|
+
const AppleDeviceQuery_1 = require("../../credentials/ios/api/graphql/queries/AppleDeviceQuery");
|
|
12
|
+
const AppleTeamQuery_1 = require("../../credentials/ios/api/graphql/queries/AppleTeamQuery");
|
|
13
|
+
const authenticate_1 = require("../../credentials/ios/appstore/authenticate");
|
|
14
|
+
const formatDevice_1 = (0, tslib_1.__importDefault)(require("../../devices/utils/formatDevice"));
|
|
15
|
+
const log_1 = (0, tslib_1.__importDefault)(require("../../log"));
|
|
16
|
+
const ora_1 = require("../../ora");
|
|
17
|
+
const projectUtils_1 = require("../../project/projectUtils");
|
|
18
|
+
const prompts_1 = require("../../prompts");
|
|
19
|
+
class DeviceDelete extends EasCommand_1.default {
|
|
20
|
+
async runAsync() {
|
|
21
|
+
let { flags: { 'apple-team-id': appleTeamIdentifier, udid: udids }, } = await this.parse(DeviceDelete);
|
|
22
|
+
const projectDir = await (0, projectUtils_1.findProjectRootAsync)();
|
|
23
|
+
const { exp } = (0, config_1.getConfig)(projectDir, { skipSDKVersionRequirement: true });
|
|
24
|
+
const accountName = await (0, projectUtils_1.getProjectAccountNameAsync)(exp);
|
|
25
|
+
if (!appleTeamIdentifier) {
|
|
26
|
+
appleTeamIdentifier = await this.askForAppleTeamAsync(accountName);
|
|
27
|
+
}
|
|
28
|
+
(0, assert_1.default)(appleTeamIdentifier, 'No team identifier is specified');
|
|
29
|
+
const appleDevicesResult = await this.getDevicesForTeamAsync(accountName, appleTeamIdentifier);
|
|
30
|
+
if (!appleDevicesResult) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
const { appleTeamName, appleDevices } = appleDevicesResult;
|
|
34
|
+
const chosenDevices = await this.chooseDevicesToDeleteAsync(appleDevices, udids);
|
|
35
|
+
if (chosenDevices.length === 0) {
|
|
36
|
+
log_1.default.newLine();
|
|
37
|
+
log_1.default.warn('No devices were chosen to be removed.');
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
this.logChosenDevices(chosenDevices, appleTeamName, appleTeamIdentifier);
|
|
41
|
+
const hasRemoved = await this.askAndRemoveFromExpoAsync(chosenDevices);
|
|
42
|
+
if (!hasRemoved) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
await this.askAndDisableOnAppleAsync(chosenDevices, appleTeamIdentifier);
|
|
46
|
+
}
|
|
47
|
+
async askAndDisableOnAppleAsync(chosenDevices, appleTeamIdentifier) {
|
|
48
|
+
log_1.default.newLine();
|
|
49
|
+
const deleteOnApple = await (0, prompts_1.toggleConfirmAsync)({
|
|
50
|
+
message: 'Do you want to disable these devices on your Apple account as well?',
|
|
51
|
+
});
|
|
52
|
+
if (!deleteOnApple) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
const ctx = await (0, authenticate_1.authenticateAsync)({ teamId: appleTeamIdentifier });
|
|
56
|
+
const context = (0, authenticate_1.getRequestContext)(ctx);
|
|
57
|
+
log_1.default.addNewLineIfNone();
|
|
58
|
+
const removeAppleSpinner = (0, ora_1.ora)('Disabling devices on Apple').start();
|
|
59
|
+
try {
|
|
60
|
+
let realDevices = await apple_utils_1.Device.getAllIOSProfileDevicesAsync(context);
|
|
61
|
+
realDevices = realDevices.filter(d => chosenDevices.map(cd => cd.identifier).includes(d.attributes.udid));
|
|
62
|
+
for (const device of realDevices) {
|
|
63
|
+
await device.updateAsync({ status: apple_utils_1.DeviceStatus.DISABLED });
|
|
64
|
+
}
|
|
65
|
+
removeAppleSpinner.succeed('Disabled devices on Apple');
|
|
66
|
+
}
|
|
67
|
+
catch (err) {
|
|
68
|
+
removeAppleSpinner.fail();
|
|
69
|
+
throw err;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
async askAndRemoveFromExpoAsync(chosenDevices) {
|
|
73
|
+
log_1.default.warn(`You are about to remove the Apple device${chosenDevices.length > 1 ? 's' : ''} listed above from your Expo account.`);
|
|
74
|
+
log_1.default.newLine();
|
|
75
|
+
const confirmed = await (0, prompts_1.toggleConfirmAsync)({
|
|
76
|
+
message: 'Are you sure you wish to proceed?',
|
|
77
|
+
});
|
|
78
|
+
if (confirmed) {
|
|
79
|
+
const removalSpinner = (0, ora_1.ora)(`Removing Apple devices on Expo`).start();
|
|
80
|
+
try {
|
|
81
|
+
for (const chosenDevice of chosenDevices) {
|
|
82
|
+
await AppleDeviceMutation_1.AppleDeviceMutation.deleteAppleDeviceAsync(chosenDevice.id);
|
|
83
|
+
}
|
|
84
|
+
removalSpinner.succeed('Removed Apple devices from Expo');
|
|
85
|
+
}
|
|
86
|
+
catch (err) {
|
|
87
|
+
removalSpinner.fail();
|
|
88
|
+
throw err;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
return confirmed;
|
|
92
|
+
}
|
|
93
|
+
logChosenDevices(chosenDevices, appleTeamName, appleTeamIdentifier) {
|
|
94
|
+
log_1.default.addNewLineIfNone();
|
|
95
|
+
chosenDevices.forEach(device => {
|
|
96
|
+
log_1.default.log((0, formatDevice_1.default)(device, {
|
|
97
|
+
appleTeamName,
|
|
98
|
+
appleTeamIdentifier: appleTeamIdentifier,
|
|
99
|
+
}));
|
|
100
|
+
log_1.default.newLine();
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
async chooseDevicesToDeleteAsync(appleDevices, udids) {
|
|
104
|
+
let chosenDevices = [];
|
|
105
|
+
log_1.default.newLine();
|
|
106
|
+
if (udids) {
|
|
107
|
+
udids.forEach(udid => {
|
|
108
|
+
const foundDevice = appleDevices.find(device => device.identifier === udid);
|
|
109
|
+
if (foundDevice) {
|
|
110
|
+
chosenDevices.push(foundDevice);
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
log_1.default.warn(`No device found with UDID ${udid}.`);
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
if (chosenDevices.length === 0) {
|
|
118
|
+
log_1.default.addNewLineIfNone();
|
|
119
|
+
chosenDevices = await (0, DeviceUtils_1.chooseDevicesToDeleteAsync)(appleDevices);
|
|
120
|
+
log_1.default.newLine();
|
|
121
|
+
}
|
|
122
|
+
return chosenDevices;
|
|
123
|
+
}
|
|
124
|
+
async getDevicesForTeamAsync(accountName, appleTeamIdentifier) {
|
|
125
|
+
const devicesSpinner = (0, ora_1.ora)().start('Fetching the list of devices for the team…');
|
|
126
|
+
try {
|
|
127
|
+
const result = await AppleDeviceQuery_1.AppleDeviceQuery.getAllForAppleTeamAsync(accountName, appleTeamIdentifier);
|
|
128
|
+
if (result === null || result === void 0 ? void 0 : result.appleDevices.length) {
|
|
129
|
+
const { appleTeamName, appleDevices } = result;
|
|
130
|
+
devicesSpinner.succeed(`Found ${appleDevices.length} devices for team ${appleTeamName !== null && appleTeamName !== void 0 ? appleTeamName : appleTeamIdentifier}`);
|
|
131
|
+
return result;
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
devicesSpinner.fail(`Couldn't find any devices for the team ${appleTeamIdentifier}`);
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
catch (e) {
|
|
139
|
+
devicesSpinner.fail(`Something went wrong and we couldn't fetch the device list`);
|
|
140
|
+
throw e;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
async askForAppleTeamAsync(accountName) {
|
|
144
|
+
const teamSpinner = (0, ora_1.ora)().start('Fetching the list of teams for the project…');
|
|
145
|
+
try {
|
|
146
|
+
const teams = await AppleTeamQuery_1.AppleTeamQuery.getAllForAccountAsync(accountName);
|
|
147
|
+
if (teams.length > 0) {
|
|
148
|
+
teamSpinner.succeed('Fetched the list of teams for the project');
|
|
149
|
+
if (teams.length === 1) {
|
|
150
|
+
return teams[0].appleTeamIdentifier;
|
|
151
|
+
}
|
|
152
|
+
const result = await (0, prompts_1.promptAsync)({
|
|
153
|
+
type: 'select',
|
|
154
|
+
name: 'appleTeamIdentifier',
|
|
155
|
+
message: 'What Apple Team would you like to list devices for?',
|
|
156
|
+
choices: teams.map(team => ({
|
|
157
|
+
title: team.appleTeamName
|
|
158
|
+
? `${team.appleTeamName} (ID: ${team.appleTeamIdentifier})`
|
|
159
|
+
: team.appleTeamIdentifier,
|
|
160
|
+
value: team.appleTeamIdentifier,
|
|
161
|
+
})),
|
|
162
|
+
});
|
|
163
|
+
return result.appleTeamIdentifier;
|
|
164
|
+
}
|
|
165
|
+
else {
|
|
166
|
+
teamSpinner.fail(`Couldn't find any teams for the account ${accountName}`);
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
catch (e) {
|
|
171
|
+
teamSpinner.fail(`Something went wrong and we couldn't fetch the list of teams`);
|
|
172
|
+
throw e;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
exports.default = DeviceDelete;
|
|
177
|
+
DeviceDelete.description = 'remove a registered device from your account';
|
|
178
|
+
DeviceDelete.flags = {
|
|
179
|
+
'apple-team-id': core_1.Flags.string(),
|
|
180
|
+
udid: core_1.Flags.string({ multiple: true }),
|
|
181
|
+
};
|
|
@@ -24,7 +24,7 @@ class BuildList extends EasCommand_1.default {
|
|
|
24
24
|
spinner = (0, ora_1.ora)().start('Fetching the list of teams for the project…');
|
|
25
25
|
try {
|
|
26
26
|
const teams = await AppleTeamQuery_1.AppleTeamQuery.getAllForAccountAsync(accountName);
|
|
27
|
-
if (teams.length) {
|
|
27
|
+
if (teams.length > 0) {
|
|
28
28
|
spinner.succeed();
|
|
29
29
|
if (teams.length === 1) {
|
|
30
30
|
appleTeamIdentifier = teams[0].appleTeamIdentifier;
|
|
@@ -14,6 +14,7 @@ const api_1 = require("../../api");
|
|
|
14
14
|
const EasCommand_1 = (0, tslib_1.__importDefault)(require("../../commandUtils/EasCommand"));
|
|
15
15
|
const client_1 = require("../../graphql/client");
|
|
16
16
|
const PublishMutation_1 = require("../../graphql/mutations/PublishMutation");
|
|
17
|
+
const UpdateQuery_1 = require("../../graphql/queries/UpdateQuery");
|
|
17
18
|
const log_1 = (0, tslib_1.__importDefault)(require("../../log"));
|
|
18
19
|
const ora_1 = require("../../ora");
|
|
19
20
|
const projectUtils_1 = require("../../project/projectUtils");
|
|
@@ -27,7 +28,6 @@ const json_1 = require("../../utils/json");
|
|
|
27
28
|
const vcs_1 = require("../../vcs");
|
|
28
29
|
const create_1 = require("../branch/create");
|
|
29
30
|
const list_1 = require("../branch/list");
|
|
30
|
-
const view_1 = require("../branch/view");
|
|
31
31
|
const create_2 = require("../channel/create");
|
|
32
32
|
exports.defaultPublishPlatforms = ['android', 'ios'];
|
|
33
33
|
async function getUpdateGroupAsync({ group, }) {
|
|
@@ -68,7 +68,7 @@ async function ensureChannelExistsAsync({ appId, branchId, channelName, }) {
|
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
async function ensureBranchExistsAsync({ appId, name: branchName, }) {
|
|
71
|
-
const { app } = await
|
|
71
|
+
const { app } = await UpdateQuery_1.UpdateQuery.viewBranchAsync({
|
|
72
72
|
appId,
|
|
73
73
|
name: branchName,
|
|
74
74
|
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import EasCommand from '../../commandUtils/EasCommand';
|
|
2
|
+
export default class BranchView extends EasCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static flags: {
|
|
5
|
+
branch: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
6
|
+
all: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
7
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
8
|
+
};
|
|
9
|
+
runAsync(): Promise<void>;
|
|
10
|
+
}
|