eas-cli 0.39.0 → 0.42.3
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 +457 -104
- package/bin/run +3 -4
- package/build/api.d.ts +1 -0
- package/build/api.js +13 -1
- package/build/build/build.js +3 -3
- package/build/build/configure.js +3 -3
- package/build/build/context.d.ts +2 -1
- package/build/build/createContext.d.ts +3 -2
- package/build/build/createContext.js +3 -3
- package/build/build/local.d.ts +9 -1
- package/build/build/local.js +35 -5
- package/build/build/runBuildAndSubmit.d.ts +15 -0
- package/build/build/runBuildAndSubmit.js +173 -0
- package/build/build/utils/devClient.js +3 -3
- package/build/commandUtils/EasCommand.d.ts +2 -1
- package/build/commandUtils/EasCommand.js +7 -4
- package/build/commands/account/login.d.ts +1 -0
- package/build/commands/account/login.js +1 -0
- package/build/commands/account/logout.d.ts +1 -0
- package/build/commands/account/logout.js +1 -0
- package/build/commands/account/view.d.ts +1 -0
- package/build/commands/account/view.js +1 -0
- package/build/commands/analytics.js +1 -1
- package/build/commands/branch/create.d.ts +1 -2
- package/build/commands/branch/create.js +3 -4
- package/build/commands/branch/delete.d.ts +1 -2
- package/build/commands/branch/delete.js +4 -5
- package/build/commands/branch/list.d.ts +1 -2
- package/build/commands/branch/list.js +4 -5
- package/build/commands/branch/publish.d.ts +1 -18
- package/build/commands/branch/publish.js +2 -354
- package/build/commands/branch/rename.d.ts +3 -5
- package/build/commands/branch/rename.js +5 -6
- package/build/commands/branch/view.d.ts +1 -2
- package/build/commands/branch/view.js +3 -4
- package/build/commands/build/cancel.js +1 -1
- package/build/commands/build/configure.d.ts +1 -2
- package/build/commands/build/configure.js +3 -3
- package/build/commands/build/index.d.ts +11 -17
- package/build/commands/build/index.js +28 -178
- package/build/commands/build/inspect.d.ts +21 -0
- package/build/commands/build/inspect.js +129 -0
- package/build/commands/build/list.d.ts +13 -14
- package/build/commands/build/list.js +15 -15
- package/build/commands/build/view.d.ts +1 -1
- package/build/commands/build/view.js +3 -3
- package/build/commands/channel/create.d.ts +1 -2
- package/build/commands/channel/create.js +3 -4
- package/build/commands/channel/edit.d.ts +2 -4
- package/build/commands/channel/edit.js +4 -5
- package/build/commands/channel/list.d.ts +1 -2
- package/build/commands/channel/list.js +3 -4
- package/build/commands/channel/rollout.d.ts +4 -5
- package/build/commands/channel/rollout.js +6 -7
- package/build/commands/channel/view.d.ts +1 -2
- package/build/commands/channel/view.js +3 -4
- package/build/commands/config.d.ts +2 -3
- package/build/commands/config.js +4 -4
- package/build/commands/credentials.js +1 -7
- package/build/commands/device/list.d.ts +1 -2
- package/build/commands/device/list.js +3 -3
- package/build/commands/device/view.js +1 -1
- package/build/commands/diagnostics.js +1 -0
- package/build/commands/secret/create.d.ts +4 -5
- package/build/commands/secret/create.js +6 -6
- package/build/commands/secret/delete.d.ts +1 -2
- package/build/commands/secret/delete.js +3 -3
- package/build/commands/submit.d.ts +9 -10
- package/build/commands/submit.js +14 -15
- package/build/commands/update/configure.d.ts +0 -2
- package/build/commands/update/configure.js +14 -14
- package/build/commands/update/delete.d.ts +1 -2
- package/build/commands/update/delete.js +3 -4
- package/build/commands/update/index.d.ts +18 -0
- package/build/commands/update/index.js +392 -0
- package/build/commands/update/view.d.ts +1 -2
- package/build/commands/update/view.js +3 -4
- package/build/commands/webhook/create.d.ts +3 -4
- package/build/commands/webhook/create.js +5 -5
- package/build/commands/webhook/delete.js +1 -1
- package/build/commands/webhook/list.d.ts +1 -2
- package/build/commands/webhook/list.js +3 -3
- package/build/commands/webhook/update.d.ts +4 -5
- package/build/commands/webhook/update.js +6 -6
- package/build/commands/webhook/view.js +1 -1
- package/build/credentials/context.d.ts +5 -0
- package/build/credentials/context.js +12 -7
- package/build/credentials/manager/ManageAndroid.d.ts +3 -3
- package/build/credentials/manager/ManageAndroid.js +21 -13
- package/build/credentials/manager/ManageIos.d.ts +3 -3
- package/build/credentials/manager/ManageIos.js +23 -13
- package/build/credentials/manager/SelectBuildProfileFromEasJson.d.ts +2 -3
- package/build/credentials/manager/SelectBuildProfileFromEasJson.js +3 -6
- package/build/credentials/manager/SelectPlatform.d.ts +1 -2
- package/build/credentials/manager/SelectPlatform.js +3 -3
- package/build/graphql/generated.d.ts +31 -11
- package/build/graphql/generated.js +6 -1
- package/build/graphql/types/Submission.js +1 -0
- package/build/index.d.ts +1 -1
- package/build/index.js +2 -2
- package/build/project/expoSdk.d.ts +3 -0
- package/build/project/expoSdk.js +30 -0
- package/build/project/metroConfig.js +2 -2
- package/build/project/publish.js +1 -3
- package/build/prompts.d.ts +3 -3
- package/build/submit/context.js +0 -1
- package/build/submit/ios/IosSubmitCommand.js +6 -1
- package/build/submit/utils/urls.js +1 -1
- package/build/update/utils.js +4 -4
- package/build/user/actions.js +2 -2
- package/build/utils/expoCli.d.ts +3 -1
- package/build/utils/expoCli.js +13 -11
- package/build/utils/profiles.d.ts +1 -1
- package/build/utils/profiles.js +80 -30
- package/build/vcs/clients/git.js +2 -2
- package/oclif.manifest.json +1 -1
- package/package.json +16 -12
package/bin/run
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
require('@oclif/
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
.catch(require('@oclif/errors/handle'));
|
|
3
|
+
const oclif = require('@oclif/core')
|
|
4
|
+
|
|
5
|
+
oclif.run().then(require('@oclif/core/flush')).catch(require('@oclif/core/handle'))
|
package/build/api.d.ts
CHANGED
package/build/api.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getExpoWebsiteBaseUrl = exports.getExpoApiBaseUrl = exports.apiClient = void 0;
|
|
3
|
+
exports.getEASUpdateURL = exports.getExpoWebsiteBaseUrl = exports.getExpoApiBaseUrl = exports.apiClient = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const got_1 = (0, tslib_1.__importStar)(require("got"));
|
|
6
6
|
const ApiV2Error_1 = (0, tslib_1.__importDefault)(require("./ApiV2Error"));
|
|
@@ -65,3 +65,15 @@ function getExpoWebsiteBaseUrl() {
|
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
exports.getExpoWebsiteBaseUrl = getExpoWebsiteBaseUrl;
|
|
68
|
+
function getEASUpdateURL(projectId) {
|
|
69
|
+
if (process.env.EXPO_STAGING) {
|
|
70
|
+
return new URL(projectId, `https://staging-u.expo.dev`).href;
|
|
71
|
+
}
|
|
72
|
+
else if (process.env.EXPO_LOCAL) {
|
|
73
|
+
return new URL(`expo-updates/${projectId}`, `http://127.0.0.1:3000`).href;
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
return new URL(projectId, `https://u.expo.dev`).href;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
exports.getEASUpdateURL = getEASUpdateURL;
|
package/build/build/build.js
CHANGED
|
@@ -41,7 +41,7 @@ async function prepareBuildRequestForPlatformAsync(builder) {
|
|
|
41
41
|
log_1.default.addNewLineIfNone();
|
|
42
42
|
await (0, repository_1.reviewAndCommitChangesAsync)(`[EAS Build] Run EAS Build for ${platform_1.requestedPlatformDisplayNames[ctx.platform]}`, { nonInteractive: ctx.nonInteractive });
|
|
43
43
|
}
|
|
44
|
-
const projectArchive = ctx.
|
|
44
|
+
const projectArchive = ctx.localBuildOptions.enable
|
|
45
45
|
? {
|
|
46
46
|
type: eas_build_job_1.ArchiveSourceType.PATH,
|
|
47
47
|
path: (await (0, repository_1.makeProjectTarballAsync)()).path,
|
|
@@ -57,8 +57,8 @@ async function prepareBuildRequestForPlatformAsync(builder) {
|
|
|
57
57
|
});
|
|
58
58
|
return async () => {
|
|
59
59
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
60
|
-
if (ctx.
|
|
61
|
-
await (0, local_1.runLocalBuildAsync)(job);
|
|
60
|
+
if (ctx.localBuildOptions.enable) {
|
|
61
|
+
await (0, local_1.runLocalBuildAsync)(job, ctx.localBuildOptions);
|
|
62
62
|
return undefined;
|
|
63
63
|
}
|
|
64
64
|
else {
|
package/build/build/configure.js
CHANGED
|
@@ -5,7 +5,7 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const config_1 = require("@expo/config");
|
|
6
6
|
const eas_build_job_1 = require("@expo/eas-build-job");
|
|
7
7
|
const eas_json_1 = require("@expo/eas-json");
|
|
8
|
-
const
|
|
8
|
+
const core_1 = require("@oclif/core");
|
|
9
9
|
const chalk_1 = (0, tslib_1.__importDefault)(require("chalk"));
|
|
10
10
|
const fs_extra_1 = (0, tslib_1.__importDefault)(require("fs-extra"));
|
|
11
11
|
const log_1 = (0, tslib_1.__importStar)(require("../log"));
|
|
@@ -35,11 +35,11 @@ async function ensureProjectConfiguredAsync(projectDir, requestedPlatform) {
|
|
|
35
35
|
platform: requestedPlatform,
|
|
36
36
|
});
|
|
37
37
|
if (await (0, vcs_1.getVcsClient)().isCommitRequiredAsync()) {
|
|
38
|
-
|
|
38
|
+
core_1.Errors.error('Build process requires clean working tree, please commit all your changes and run `eas build` again', { exit: 1 });
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
else {
|
|
42
|
-
|
|
42
|
+
core_1.Errors.error(`Aborting, please run ${chalk_1.default.bold('eas build:configure')} or create eas.json (${(0, log_1.learnMore)('https://docs.expo.dev/build/eas-json')})`, { exit: 1 });
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
exports.ensureProjectConfiguredAsync = ensureProjectConfiguredAsync;
|
package/build/build/context.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ import { RequestedPlatform } from '../platform';
|
|
|
9
9
|
import { GradleBuildContext } from '../project/android/gradle';
|
|
10
10
|
import { XcodeBuildContext } from '../project/ios/scheme';
|
|
11
11
|
import { Actor } from '../user/User';
|
|
12
|
+
import { LocalBuildOptions } from './local';
|
|
12
13
|
export interface ConfigureContext {
|
|
13
14
|
user: Actor;
|
|
14
15
|
projectDir: string;
|
|
@@ -38,7 +39,7 @@ export interface BuildContext<T extends Platform> {
|
|
|
38
39
|
clearCache: boolean;
|
|
39
40
|
credentialsCtx: CredentialsContext;
|
|
40
41
|
exp: ExpoConfig;
|
|
41
|
-
|
|
42
|
+
localBuildOptions: LocalBuildOptions;
|
|
42
43
|
nonInteractive: boolean;
|
|
43
44
|
platform: T;
|
|
44
45
|
projectDir: string;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { Platform } from '@expo/eas-build-job';
|
|
2
2
|
import { BuildProfile } from '@expo/eas-json';
|
|
3
3
|
import { BuildContext } from './context';
|
|
4
|
-
|
|
4
|
+
import { LocalBuildOptions } from './local';
|
|
5
|
+
export declare function createBuildContextAsync<T extends Platform>({ buildProfileName, buildProfile, clearCache, localBuildOptions, nonInteractive, platform, projectDir, skipProjectConfiguration, }: {
|
|
5
6
|
buildProfileName: string;
|
|
6
7
|
buildProfile: BuildProfile<T>;
|
|
7
8
|
clearCache: boolean;
|
|
8
|
-
|
|
9
|
+
localBuildOptions: LocalBuildOptions;
|
|
9
10
|
nonInteractive: boolean;
|
|
10
11
|
platform: T;
|
|
11
12
|
projectDir: string;
|
|
@@ -15,7 +15,7 @@ const Account_1 = require("../user/Account");
|
|
|
15
15
|
const actions_1 = require("../user/actions");
|
|
16
16
|
const build_1 = require("./android/build");
|
|
17
17
|
const build_2 = require("./ios/build");
|
|
18
|
-
async function createBuildContextAsync({ buildProfileName, buildProfile, clearCache = false,
|
|
18
|
+
async function createBuildContextAsync({ buildProfileName, buildProfile, clearCache = false, localBuildOptions, nonInteractive = false, platform, projectDir, skipProjectConfiguration = false, }) {
|
|
19
19
|
var _a;
|
|
20
20
|
const exp = (0, expoConfig_1.getExpoConfig)(projectDir, { env: buildProfile.env });
|
|
21
21
|
const user = await (0, actions_1.ensureLoggedInAsync)();
|
|
@@ -29,6 +29,7 @@ async function createBuildContextAsync({ buildProfileName, buildProfile, clearCa
|
|
|
29
29
|
nonInteractive,
|
|
30
30
|
projectDir,
|
|
31
31
|
user,
|
|
32
|
+
env: buildProfile.env,
|
|
32
33
|
});
|
|
33
34
|
const devClientProperties = getDevClientEventProperties({
|
|
34
35
|
platform,
|
|
@@ -39,7 +40,6 @@ async function createBuildContextAsync({ buildProfileName, buildProfile, clearCa
|
|
|
39
40
|
tracking_id: (0, uuid_1.v4)(),
|
|
40
41
|
platform,
|
|
41
42
|
...(accountId && { account_id: accountId }),
|
|
42
|
-
account_name: accountName,
|
|
43
43
|
project_id: projectId,
|
|
44
44
|
project_type: workflow,
|
|
45
45
|
...devClientProperties,
|
|
@@ -52,7 +52,7 @@ async function createBuildContextAsync({ buildProfileName, buildProfile, clearCa
|
|
|
52
52
|
clearCache,
|
|
53
53
|
credentialsCtx,
|
|
54
54
|
exp,
|
|
55
|
-
|
|
55
|
+
localBuildOptions,
|
|
56
56
|
nonInteractive,
|
|
57
57
|
platform,
|
|
58
58
|
projectDir,
|
package/build/build/local.d.ts
CHANGED
|
@@ -1,2 +1,10 @@
|
|
|
1
1
|
import { Job } from '@expo/eas-build-job';
|
|
2
|
-
export
|
|
2
|
+
export interface LocalBuildOptions {
|
|
3
|
+
enable: boolean;
|
|
4
|
+
skipCleanup?: boolean;
|
|
5
|
+
skipNativeBuild?: boolean;
|
|
6
|
+
artifactsDir?: string;
|
|
7
|
+
workingdir?: string;
|
|
8
|
+
verbose?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare function runLocalBuildAsync(job: Job, options: LocalBuildOptions): Promise<void>;
|
package/build/build/local.js
CHANGED
|
@@ -4,13 +4,43 @@ exports.runLocalBuildAsync = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const spawn_async_1 = (0, tslib_1.__importDefault)(require("@expo/spawn-async"));
|
|
6
6
|
const semver_1 = (0, tslib_1.__importDefault)(require("semver"));
|
|
7
|
+
const ora_1 = require("../ora");
|
|
7
8
|
const PLUGIN_PACKAGE_NAME = 'eas-cli-local-build-plugin';
|
|
8
|
-
const PLUGIN_PACKAGE_VERSION = '0.0.
|
|
9
|
-
async function runLocalBuildAsync(job) {
|
|
9
|
+
const PLUGIN_PACKAGE_VERSION = '0.0.57';
|
|
10
|
+
async function runLocalBuildAsync(job, options) {
|
|
11
|
+
var _a;
|
|
10
12
|
const { command, args } = await getCommandAndArgsAsync(job);
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
let spinner;
|
|
14
|
+
if (!options.verbose) {
|
|
15
|
+
spinner = (0, ora_1.ora)().start(options.skipNativeBuild ? 'Preparing project' : 'Building project');
|
|
16
|
+
}
|
|
17
|
+
let childProcess;
|
|
18
|
+
const interruptHandler = () => {
|
|
19
|
+
if (childProcess) {
|
|
20
|
+
childProcess.kill();
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
process.on('SIGINT', interruptHandler);
|
|
24
|
+
try {
|
|
25
|
+
const spawnPromise = (0, spawn_async_1.default)(command, args, {
|
|
26
|
+
stdio: options.verbose ? 'inherit' : 'pipe',
|
|
27
|
+
env: {
|
|
28
|
+
...process.env,
|
|
29
|
+
EAS_LOCAL_BUILD_WORKINGDIR: (_a = options.workingdir) !== null && _a !== void 0 ? _a : process.env.EAS_LOCAL_BUILD_WORKINGDIR,
|
|
30
|
+
...(options.skipCleanup || options.skipNativeBuild
|
|
31
|
+
? { EAS_LOCAL_BUILD_SKIP_CLEANUP: '1' }
|
|
32
|
+
: {}),
|
|
33
|
+
...(options.skipNativeBuild ? { EAS_LOCAL_BUILD_SKIP_NATIVE_BUILD: '1' } : {}),
|
|
34
|
+
...(options.artifactsDir ? { EAS_LOCAL_BUILD_ARTIFACTS_DIR: options.artifactsDir } : {}),
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
childProcess = spawnPromise.child;
|
|
38
|
+
await spawnPromise;
|
|
39
|
+
}
|
|
40
|
+
finally {
|
|
41
|
+
process.removeListener('SIGINT', interruptHandler);
|
|
42
|
+
spinner === null || spinner === void 0 ? void 0 : spinner.stop();
|
|
43
|
+
}
|
|
14
44
|
}
|
|
15
45
|
exports.runLocalBuildAsync = runLocalBuildAsync;
|
|
16
46
|
async function getCommandAndArgsAsync(job) {
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { RequestedPlatform } from '../platform';
|
|
2
|
+
import { LocalBuildOptions } from './local';
|
|
3
|
+
export interface BuildFlags {
|
|
4
|
+
requestedPlatform: RequestedPlatform;
|
|
5
|
+
skipProjectConfiguration: boolean;
|
|
6
|
+
profile?: string;
|
|
7
|
+
nonInteractive: boolean;
|
|
8
|
+
wait: boolean;
|
|
9
|
+
clearCache: boolean;
|
|
10
|
+
json: boolean;
|
|
11
|
+
autoSubmit: boolean;
|
|
12
|
+
submitProfile?: string;
|
|
13
|
+
localBuildOptions: LocalBuildOptions;
|
|
14
|
+
}
|
|
15
|
+
export declare function runBuildAndSubmitAsync(projectDir: string, flags: BuildFlags): Promise<void>;
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.runBuildAndSubmitAsync = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const eas_build_job_1 = require("@expo/eas-build-job");
|
|
6
|
+
const chalk_1 = (0, tslib_1.__importDefault)(require("chalk"));
|
|
7
|
+
const nullthrows_1 = (0, tslib_1.__importDefault)(require("nullthrows"));
|
|
8
|
+
const generated_1 = require("../graphql/generated");
|
|
9
|
+
const AppPlatform_1 = require("../graphql/types/AppPlatform");
|
|
10
|
+
const log_1 = (0, tslib_1.__importDefault)(require("../log"));
|
|
11
|
+
const platform_1 = require("../platform");
|
|
12
|
+
const expoSdk_1 = require("../project/expoSdk");
|
|
13
|
+
const metroConfig_1 = require("../project/metroConfig");
|
|
14
|
+
const context_1 = require("../submit/context");
|
|
15
|
+
const submit_1 = require("../submit/submit");
|
|
16
|
+
const urls_1 = require("../submit/utils/urls");
|
|
17
|
+
const profiles_1 = require("../utils/profiles");
|
|
18
|
+
const vcs_1 = require("../vcs");
|
|
19
|
+
const build_1 = require("./android/build");
|
|
20
|
+
const build_2 = require("./build");
|
|
21
|
+
const configure_1 = require("./configure");
|
|
22
|
+
const createContext_1 = require("./createContext");
|
|
23
|
+
const build_3 = require("./ios/build");
|
|
24
|
+
const devClient_1 = require("./utils/devClient");
|
|
25
|
+
const printBuildInfo_1 = require("./utils/printBuildInfo");
|
|
26
|
+
const repository_1 = require("./utils/repository");
|
|
27
|
+
let metroConfigValidated = false;
|
|
28
|
+
let sdkVersionChecked = false;
|
|
29
|
+
async function runBuildAndSubmitAsync(projectDir, flags) {
|
|
30
|
+
var _a;
|
|
31
|
+
await (0, vcs_1.getVcsClient)().ensureRepoExistsAsync();
|
|
32
|
+
await (0, repository_1.ensureRepoIsCleanAsync)(flags.nonInteractive);
|
|
33
|
+
await (0, configure_1.ensureProjectConfiguredAsync)(projectDir, flags.requestedPlatform);
|
|
34
|
+
const platforms = (0, platform_1.toPlatforms)(flags.requestedPlatform);
|
|
35
|
+
const buildProfiles = await (0, profiles_1.getProfilesAsync)({
|
|
36
|
+
type: 'build',
|
|
37
|
+
projectDir,
|
|
38
|
+
platforms,
|
|
39
|
+
profileName: (_a = flags.profile) !== null && _a !== void 0 ? _a : undefined,
|
|
40
|
+
});
|
|
41
|
+
await (0, devClient_1.ensureExpoDevClientInstalledForDevClientBuildsAsync)({
|
|
42
|
+
projectDir,
|
|
43
|
+
nonInteractive: flags.nonInteractive,
|
|
44
|
+
buildProfiles,
|
|
45
|
+
});
|
|
46
|
+
const startedBuilds = [];
|
|
47
|
+
const buildCtxByPlatform = {};
|
|
48
|
+
for (const buildProfile of buildProfiles) {
|
|
49
|
+
const { build: maybeBuild, buildCtx } = await prepareAndStartBuildAsync({
|
|
50
|
+
projectDir,
|
|
51
|
+
flags,
|
|
52
|
+
moreBuilds: platforms.length > 1,
|
|
53
|
+
buildProfile,
|
|
54
|
+
});
|
|
55
|
+
if (maybeBuild) {
|
|
56
|
+
startedBuilds.push({ build: maybeBuild, buildProfile });
|
|
57
|
+
}
|
|
58
|
+
buildCtxByPlatform[(0, AppPlatform_1.toAppPlatform)(buildProfile.platform)] = buildCtx;
|
|
59
|
+
}
|
|
60
|
+
if (flags.localBuildOptions.enable) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
log_1.default.newLine();
|
|
64
|
+
(0, printBuildInfo_1.printLogsUrls)(startedBuilds.map(startedBuild => startedBuild.build));
|
|
65
|
+
log_1.default.newLine();
|
|
66
|
+
const submissions = [];
|
|
67
|
+
if (flags.autoSubmit) {
|
|
68
|
+
const submitProfiles = await (0, profiles_1.getProfilesAsync)({
|
|
69
|
+
projectDir,
|
|
70
|
+
platforms,
|
|
71
|
+
profileName: flags.submitProfile,
|
|
72
|
+
type: 'submit',
|
|
73
|
+
});
|
|
74
|
+
for (const startedBuild of startedBuilds) {
|
|
75
|
+
const submitProfile = (0, nullthrows_1.default)(submitProfiles.find(({ platform }) => (0, AppPlatform_1.toAppPlatform)(platform) === startedBuild.build.platform)).profile;
|
|
76
|
+
const submission = await prepareAndStartSubmissionAsync({
|
|
77
|
+
build: startedBuild.build,
|
|
78
|
+
buildCtx: (0, nullthrows_1.default)(buildCtxByPlatform[startedBuild.build.platform]),
|
|
79
|
+
moreBuilds: startedBuilds.length > 1,
|
|
80
|
+
projectDir,
|
|
81
|
+
buildProfile: startedBuild.buildProfile.profile,
|
|
82
|
+
submitProfile,
|
|
83
|
+
nonInteractive: flags.nonInteractive,
|
|
84
|
+
});
|
|
85
|
+
submissions.push(submission);
|
|
86
|
+
}
|
|
87
|
+
log_1.default.newLine();
|
|
88
|
+
(0, urls_1.printSubmissionDetailsUrls)(submissions);
|
|
89
|
+
log_1.default.newLine();
|
|
90
|
+
}
|
|
91
|
+
if (!flags.wait) {
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
const builds = await (0, build_2.waitForBuildEndAsync)(startedBuilds.map(({ build }) => build.id));
|
|
95
|
+
(0, printBuildInfo_1.printBuildResults)(builds, flags.json);
|
|
96
|
+
const haveAllBuildsFailedOrCanceled = builds.every(build => (build === null || build === void 0 ? void 0 : build.status) && [generated_1.BuildStatus.Errored, generated_1.BuildStatus.Canceled].includes(build === null || build === void 0 ? void 0 : build.status));
|
|
97
|
+
if (haveAllBuildsFailedOrCanceled || !flags.autoSubmit) {
|
|
98
|
+
exitWithNonZeroCodeIfSomeBuildsFailed(builds);
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
// the following function also exits with non zero code if any of the submissions failed
|
|
102
|
+
await (0, submit_1.waitToCompleteAsync)(submissions);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
exports.runBuildAndSubmitAsync = runBuildAndSubmitAsync;
|
|
106
|
+
async function prepareAndStartBuildAsync({ projectDir, flags, moreBuilds, buildProfile, }) {
|
|
107
|
+
const buildCtx = await (0, createContext_1.createBuildContextAsync)({
|
|
108
|
+
buildProfileName: buildProfile.profileName,
|
|
109
|
+
clearCache: flags.clearCache,
|
|
110
|
+
buildProfile: buildProfile.profile,
|
|
111
|
+
nonInteractive: flags.nonInteractive,
|
|
112
|
+
platform: buildProfile.platform,
|
|
113
|
+
projectDir,
|
|
114
|
+
skipProjectConfiguration: flags.skipProjectConfiguration,
|
|
115
|
+
localBuildOptions: flags.localBuildOptions,
|
|
116
|
+
});
|
|
117
|
+
if (moreBuilds) {
|
|
118
|
+
log_1.default.newLine();
|
|
119
|
+
const appPlatform = (0, AppPlatform_1.toAppPlatform)(buildProfile.platform);
|
|
120
|
+
log_1.default.log(`${platform_1.appPlatformEmojis[appPlatform]} ${chalk_1.default.bold(`${platform_1.appPlatformDisplayNames[appPlatform]} build`)}`);
|
|
121
|
+
}
|
|
122
|
+
if (buildCtx.workflow === eas_build_job_1.Workflow.MANAGED) {
|
|
123
|
+
if (!sdkVersionChecked) {
|
|
124
|
+
await (0, expoSdk_1.checkExpoSdkIsSupportedAsync)(buildCtx);
|
|
125
|
+
sdkVersionChecked = true;
|
|
126
|
+
}
|
|
127
|
+
if (!metroConfigValidated) {
|
|
128
|
+
await (0, metroConfig_1.validateMetroConfigForManagedWorkflowAsync)(buildCtx);
|
|
129
|
+
metroConfigValidated = true;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
const build = await startBuildAsync(buildCtx);
|
|
133
|
+
return {
|
|
134
|
+
build,
|
|
135
|
+
buildCtx,
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
async function startBuildAsync(ctx) {
|
|
139
|
+
let sendBuildRequestAsync;
|
|
140
|
+
if (ctx.platform === eas_build_job_1.Platform.ANDROID) {
|
|
141
|
+
sendBuildRequestAsync = await (0, build_1.prepareAndroidBuildAsync)(ctx);
|
|
142
|
+
}
|
|
143
|
+
else {
|
|
144
|
+
sendBuildRequestAsync = await (0, build_3.prepareIosBuildAsync)(ctx);
|
|
145
|
+
}
|
|
146
|
+
return await sendBuildRequestAsync();
|
|
147
|
+
}
|
|
148
|
+
async function prepareAndStartSubmissionAsync({ build, buildCtx, moreBuilds, projectDir, buildProfile, submitProfile, nonInteractive, }) {
|
|
149
|
+
var _a, _b, _c;
|
|
150
|
+
const platform = (0, AppPlatform_1.toPlatform)(build.platform);
|
|
151
|
+
const submissionCtx = await (0, context_1.createSubmissionContextAsync)({
|
|
152
|
+
platform,
|
|
153
|
+
projectDir,
|
|
154
|
+
projectId: build.project.id,
|
|
155
|
+
profile: submitProfile,
|
|
156
|
+
archiveFlags: { id: build.id },
|
|
157
|
+
nonInteractive,
|
|
158
|
+
env: buildProfile.env,
|
|
159
|
+
credentialsCtx: buildCtx.credentialsCtx,
|
|
160
|
+
applicationIdentifier: (_b = (_a = buildCtx.android) === null || _a === void 0 ? void 0 : _a.applicationId) !== null && _b !== void 0 ? _b : (_c = buildCtx.ios) === null || _c === void 0 ? void 0 : _c.bundleIdentifier,
|
|
161
|
+
});
|
|
162
|
+
if (moreBuilds) {
|
|
163
|
+
log_1.default.newLine();
|
|
164
|
+
log_1.default.log(`${platform_1.appPlatformEmojis[build.platform]} ${chalk_1.default.bold(`${platform_1.appPlatformDisplayNames[build.platform]} submission`)}`);
|
|
165
|
+
}
|
|
166
|
+
return await (0, submit_1.submitAsync)(submissionCtx);
|
|
167
|
+
}
|
|
168
|
+
function exitWithNonZeroCodeIfSomeBuildsFailed(maybeBuilds) {
|
|
169
|
+
const failedBuilds = maybeBuilds.filter(i => i).filter(i => i.status === generated_1.BuildStatus.Errored);
|
|
170
|
+
if (failedBuilds.length > 0) {
|
|
171
|
+
process.exit(1);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ensureExpoDevClientInstalledForDevClientBuildsAsync = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const eas_build_job_1 = require("@expo/eas-build-job");
|
|
6
|
-
const
|
|
6
|
+
const core_1 = require("@oclif/core");
|
|
7
7
|
const chalk_1 = (0, tslib_1.__importDefault)(require("chalk"));
|
|
8
8
|
const resolve_from_1 = (0, tslib_1.__importDefault)(require("resolve-from"));
|
|
9
9
|
const AppPlatform_1 = require("../../graphql/types/AppPlatform");
|
|
@@ -40,7 +40,7 @@ async function ensureExpoDevClientInstalledForDevClientBuildsAsync({ projectDir,
|
|
|
40
40
|
await installExpoDevClientAsync(projectDir, { nonInteractive });
|
|
41
41
|
}
|
|
42
42
|
else {
|
|
43
|
-
|
|
43
|
+
core_1.Errors.error(`Install ${chalk_1.default.bold('expo-dev-client')} manually and come back later.`, {
|
|
44
44
|
exit: 1,
|
|
45
45
|
});
|
|
46
46
|
}
|
|
@@ -58,7 +58,7 @@ async function ensureExpoDevClientInstalledForDevClientBuildsAsync({ projectDir,
|
|
|
58
58
|
initial: false,
|
|
59
59
|
});
|
|
60
60
|
if (!shouldContinue) {
|
|
61
|
-
|
|
61
|
+
core_1.Errors.error('Come back later', { exit: 1 });
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { Command } from '@oclif/
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
2
|
export default abstract class EasCommand extends Command {
|
|
3
3
|
/**
|
|
4
4
|
* When user data is unavailable locally, determines if the command will
|
|
5
5
|
* force the user to log in
|
|
6
6
|
*/
|
|
7
7
|
protected requiresAuthentication: boolean;
|
|
8
|
+
protected mustBeRunInsideProject: boolean;
|
|
8
9
|
protected abstract runAsync(): Promise<any>;
|
|
9
10
|
run(): Promise<any>;
|
|
10
11
|
finally(err: Error): Promise<any>;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const eas_json_1 = require("@expo/eas-json");
|
|
5
|
-
const
|
|
5
|
+
const core_1 = require("@oclif/core");
|
|
6
6
|
const semver_1 = (0, tslib_1.__importDefault)(require("semver"));
|
|
7
7
|
const rudderstackClient_1 = require("../analytics/rudderstackClient");
|
|
8
8
|
const projectUtils_1 = require("../project/projectUtils");
|
|
@@ -11,7 +11,7 @@ const actions_1 = require("../user/actions");
|
|
|
11
11
|
const easCli_1 = require("../utils/easCli");
|
|
12
12
|
const vcs_1 = require("../vcs");
|
|
13
13
|
const git_1 = (0, tslib_1.__importDefault)(require("../vcs/clients/git"));
|
|
14
|
-
class EasCommand extends
|
|
14
|
+
class EasCommand extends core_1.Command {
|
|
15
15
|
constructor() {
|
|
16
16
|
super(...arguments);
|
|
17
17
|
/**
|
|
@@ -19,14 +19,17 @@ class EasCommand extends command_1.Command {
|
|
|
19
19
|
* force the user to log in
|
|
20
20
|
*/
|
|
21
21
|
this.requiresAuthentication = true;
|
|
22
|
+
this.mustBeRunInsideProject = true;
|
|
22
23
|
}
|
|
23
24
|
// eslint-disable-next-line async-protect/async-suffix
|
|
24
25
|
async run() {
|
|
25
26
|
var _a;
|
|
26
27
|
await (0, rudderstackClient_1.initAsync)();
|
|
27
|
-
|
|
28
|
+
if (this.mustBeRunInsideProject) {
|
|
29
|
+
await this.applyCliConfigAsync();
|
|
30
|
+
}
|
|
28
31
|
if (this.requiresAuthentication) {
|
|
29
|
-
const { flags } = this.parse();
|
|
32
|
+
const { flags } = await this.parse();
|
|
30
33
|
const nonInteractive = (_a = flags['non-interactive']) !== null && _a !== void 0 ? _a : false;
|
|
31
34
|
await (0, actions_1.ensureLoggedInAsync)({ nonInteractive });
|
|
32
35
|
}
|
|
@@ -2,6 +2,7 @@ import EasCommand from '../../commandUtils/EasCommand';
|
|
|
2
2
|
export default class AccountLogin extends EasCommand {
|
|
3
3
|
static description: string;
|
|
4
4
|
static aliases: string[];
|
|
5
|
+
protected mustBeRunInsideProject: boolean;
|
|
5
6
|
protected requiresAuthentication: boolean;
|
|
6
7
|
runAsync(): Promise<void>;
|
|
7
8
|
}
|
|
@@ -2,6 +2,7 @@ import EasCommand from '../../commandUtils/EasCommand';
|
|
|
2
2
|
export default class AccountLogout extends EasCommand {
|
|
3
3
|
static description: string;
|
|
4
4
|
static aliases: string[];
|
|
5
|
+
protected mustBeRunInsideProject: boolean;
|
|
5
6
|
protected requiresAuthentication: boolean;
|
|
6
7
|
runAsync(): Promise<void>;
|
|
7
8
|
}
|
|
@@ -2,6 +2,7 @@ import EasCommand from '../../commandUtils/EasCommand';
|
|
|
2
2
|
export default class AccountView extends EasCommand {
|
|
3
3
|
static description: string;
|
|
4
4
|
static aliases: string[];
|
|
5
|
+
protected mustBeRunInsideProject: boolean;
|
|
5
6
|
protected requiresAuthentication: boolean;
|
|
6
7
|
runAsync(): Promise<void>;
|
|
7
8
|
}
|
|
@@ -10,7 +10,7 @@ class AnalyticsView extends EasCommand_1.default {
|
|
|
10
10
|
this.requiresAuthentication = false;
|
|
11
11
|
}
|
|
12
12
|
async runAsync() {
|
|
13
|
-
const { STATUS: status } = this.parse(AnalyticsView).args;
|
|
13
|
+
const { STATUS: status } = (await this.parse(AnalyticsView)).args;
|
|
14
14
|
if (status) {
|
|
15
15
|
await UserSettings_1.default.setAsync('analyticsEnabled', status === 'on');
|
|
16
16
|
log_1.default.withTick(`${status === 'on' ? 'Enabling' : 'Disabling'} analytics.`);
|
|
@@ -2,7 +2,6 @@ import EasCommand from '../../commandUtils/EasCommand';
|
|
|
2
2
|
import { CreateUpdateBranchForAppMutationVariables, UpdateBranch } from '../../graphql/generated';
|
|
3
3
|
export declare function createUpdateBranchOnAppAsync({ appId, name, }: CreateUpdateBranchForAppMutationVariables): Promise<Pick<UpdateBranch, 'id' | 'name'>>;
|
|
4
4
|
export default class BranchCreate extends EasCommand {
|
|
5
|
-
static hidden: boolean;
|
|
6
5
|
static description: string;
|
|
7
6
|
static args: {
|
|
8
7
|
name: string;
|
|
@@ -10,7 +9,7 @@ export default class BranchCreate extends EasCommand {
|
|
|
10
9
|
description: string;
|
|
11
10
|
}[];
|
|
12
11
|
static flags: {
|
|
13
|
-
json: import("@oclif/
|
|
12
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
14
13
|
};
|
|
15
14
|
runAsync(): Promise<void>;
|
|
16
15
|
}
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.createUpdateBranchOnAppAsync = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const config_1 = require("@expo/config");
|
|
6
|
-
const
|
|
6
|
+
const core_1 = require("@oclif/core");
|
|
7
7
|
const chalk_1 = (0, tslib_1.__importDefault)(require("chalk"));
|
|
8
8
|
const graphql_tag_1 = (0, tslib_1.__importDefault)(require("graphql-tag"));
|
|
9
9
|
const EasCommand_1 = (0, tslib_1.__importDefault)(require("../../commandUtils/EasCommand"));
|
|
@@ -37,7 +37,7 @@ async function createUpdateBranchOnAppAsync({ appId, name, }) {
|
|
|
37
37
|
exports.createUpdateBranchOnAppAsync = createUpdateBranchOnAppAsync;
|
|
38
38
|
class BranchCreate extends EasCommand_1.default {
|
|
39
39
|
async runAsync() {
|
|
40
|
-
let { args: { name }, flags, } = this.parse(BranchCreate);
|
|
40
|
+
let { args: { name }, flags, } = await this.parse(BranchCreate);
|
|
41
41
|
const projectDir = await (0, projectUtils_1.findProjectRootAsync)();
|
|
42
42
|
const { exp } = (0, config_1.getConfig)(projectDir, { skipSDKVersionRequirement: true });
|
|
43
43
|
const fullName = await (0, projectUtils_1.getProjectFullNameAsync)(exp);
|
|
@@ -65,7 +65,6 @@ class BranchCreate extends EasCommand_1.default {
|
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
exports.default = BranchCreate;
|
|
68
|
-
BranchCreate.hidden = true;
|
|
69
68
|
BranchCreate.description = 'Create a branch on the current project.';
|
|
70
69
|
BranchCreate.args = [
|
|
71
70
|
{
|
|
@@ -75,7 +74,7 @@ BranchCreate.args = [
|
|
|
75
74
|
},
|
|
76
75
|
];
|
|
77
76
|
BranchCreate.flags = {
|
|
78
|
-
json:
|
|
77
|
+
json: core_1.Flags.boolean({
|
|
79
78
|
description: 'return a json with the new branch ID and name.',
|
|
80
79
|
default: false,
|
|
81
80
|
}),
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import EasCommand from '../../commandUtils/EasCommand';
|
|
2
2
|
export default class BranchDelete extends EasCommand {
|
|
3
|
-
static hidden: boolean;
|
|
4
3
|
static description: string;
|
|
5
4
|
static args: {
|
|
6
5
|
name: string;
|
|
@@ -8,7 +7,7 @@ export default class BranchDelete extends EasCommand {
|
|
|
8
7
|
description: string;
|
|
9
8
|
}[];
|
|
10
9
|
static flags: {
|
|
11
|
-
json: import("@oclif/
|
|
10
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
12
11
|
};
|
|
13
12
|
runAsync(): Promise<void>;
|
|
14
13
|
}
|