eas-cli 0.32.0 → 0.34.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 +29 -28
- package/build/analytics.js +3 -9
- package/build/build/android/UpdatesModule.js +4 -15
- package/build/build/android/configure.js +3 -3
- package/build/build/android/graphql.js +2 -4
- package/build/build/android/prepareJob.js +4 -3
- package/build/build/build.js +2 -2
- package/build/build/configure.js +26 -13
- package/build/build/ios/UpdatesModule.js +6 -18
- package/build/build/ios/configure.js +1 -1
- package/build/build/ios/graphql.js +2 -23
- package/build/build/ios/prepareJob.js +4 -6
- package/build/build/metadata.js +5 -10
- package/build/build/utils/appJson.d.ts +1 -0
- package/build/build/utils/appJson.js +13 -4
- package/build/build/utils/devClient.d.ts +4 -4
- package/build/build/utils/devClient.js +16 -21
- package/build/build/utils/repository.js +10 -7
- package/build/build/validate.js +4 -4
- package/build/commandUtils/EasCommand.d.ts +1 -0
- package/build/commandUtils/EasCommand.js +21 -0
- package/build/commands/branch/create.js +3 -2
- package/build/commands/branch/delete.js +1 -1
- package/build/commands/branch/list.js +1 -1
- package/build/commands/branch/publish.js +20 -48
- package/build/commands/branch/view.js +1 -1
- package/build/commands/build/index.d.ts +1 -1
- package/build/commands/build/index.js +64 -49
- package/build/commands/channel/edit.js +1 -1
- package/build/commands/channel/list.js +1 -1
- package/build/commands/channel/view.js +1 -1
- package/build/commands/diagnostics.js +2 -2
- package/build/commands/project/info.js +1 -1
- package/build/commands/submit.js +15 -8
- package/build/commands/update/view.js +1 -1
- package/build/credentials/android/api/graphql/queries/GoogleServiceAccountKeyQuery.js +2 -0
- package/build/credentials/credentialsJson/update.js +5 -4
- package/build/credentials/ios/IosCredentialsProvider.js +1 -1
- package/build/credentials/ios/actions/CreateDistributionCertificate.js +1 -1
- package/build/credentials/ios/actions/CreatePushKey.js +1 -1
- package/build/credentials/ios/actions/DistributionCertificateUtils.d.ts +1 -1
- package/build/credentials/ios/actions/DistributionCertificateUtils.js +5 -7
- package/build/credentials/ios/actions/PushKeyUtils.d.ts +1 -1
- package/build/credentials/ios/actions/PushKeyUtils.js +5 -5
- package/build/credentials/ios/actions/SetupTargetBuildCredentials.js +1 -1
- package/build/credentials/ios/api/graphql/queries/AppQuery.js +3 -1
- package/build/credentials/ios/api/graphql/queries/AppleDeviceQuery.js +6 -2
- package/build/credentials/ios/api/graphql/queries/AppleDistributionCertificateQuery.js +7 -1
- package/build/credentials/ios/api/graphql/queries/AppleProvisioningProfileQuery.js +5 -1
- package/build/credentials/ios/api/graphql/queries/ApplePushKeyQuery.js +2 -0
- package/build/credentials/ios/api/graphql/queries/AppleTeamQuery.js +5 -1
- package/build/credentials/ios/utils/printCredentials.js +30 -1
- package/build/credentials/manager/Actions.d.ts +47 -0
- package/build/credentials/manager/Actions.js +48 -0
- package/build/credentials/manager/AndroidActions.d.ts +6 -0
- package/build/credentials/manager/AndroidActions.js +114 -0
- package/build/credentials/manager/IosActions.d.ts +6 -0
- package/build/credentials/manager/IosActions.js +110 -0
- package/build/credentials/manager/ManageAndroid.d.ts +1 -29
- package/build/credentials/manager/ManageAndroid.js +26 -159
- package/build/credentials/manager/ManageIos.d.ts +1 -29
- package/build/credentials/manager/ManageIos.js +28 -155
- package/build/graphql/client.d.ts +8 -2
- package/build/graphql/generated.d.ts +131 -143
- package/build/graphql/generated.js +44 -28
- package/build/graphql/queries/BuildQuery.js +4 -1
- package/build/graphql/queries/EnvironmentSecretsQuery.js +4 -2
- package/build/graphql/queries/ProjectQuery.js +3 -1
- package/build/graphql/queries/PublishQuery.js +4 -1
- package/build/graphql/queries/SubmissionQuery.js +5 -2
- package/build/graphql/queries/UserQuery.js +4 -1
- package/build/graphql/queries/WebhookQuery.js +6 -2
- package/build/graphql/types/credentials/AppStoreConnectApiKey.d.ts +1 -0
- package/build/graphql/types/credentials/AppStoreConnectApiKey.js +23 -0
- package/build/graphql/types/credentials/IosAppCredentials.js +6 -0
- package/build/log.d.ts +0 -2
- package/build/log.js +2 -12
- package/build/project/android/applicationId.d.ts +1 -1
- package/build/project/android/applicationId.js +7 -6
- package/build/project/ios/bundleIdentifier.d.ts +1 -1
- package/build/project/ios/bundleIdentifier.js +7 -6
- package/build/project/projectUtils.js +1 -1
- package/build/project/publish.js +2 -2
- package/build/project/workflow.js +2 -2
- package/build/submit/ArchiveSource.js +4 -4
- package/build/submit/ios/IosSubmitCommand.js +4 -0
- package/build/submit/ios/IosSubmitter.js +1 -1
- package/build/user/User.js +1 -0
- package/build/utils/easCli.d.ts +1 -0
- package/build/utils/easCli.js +5 -0
- package/build/utils/{expoCommand.d.ts → expoCli.d.ts} +0 -0
- package/build/utils/{expoCommand.js → expoCli.js} +0 -0
- package/build/utils/profiles.d.ts +11 -0
- package/build/utils/profiles.js +46 -0
- package/build/vcs/clients/git.d.ts +26 -0
- package/build/vcs/clients/git.js +184 -0
- package/build/vcs/clients/gitNoCommit.d.ts +7 -0
- package/build/vcs/clients/gitNoCommit.js +27 -0
- package/build/vcs/clients/noVcs.d.ts +6 -0
- package/build/vcs/clients/noVcs.js +19 -0
- package/build/vcs/git.d.ts +10 -17
- package/build/vcs/git.js +7 -175
- package/build/vcs/index.d.ts +2 -2
- package/build/vcs/index.js +15 -6
- package/build/vcs/local.d.ts +18 -5
- package/build/vcs/local.js +61 -32
- package/build/vcs/vcs.d.ts +2 -1
- package/build/vcs/vcs.js +8 -4
- package/oclif.manifest.json +1 -1
- package/package.json +9 -9
|
@@ -7,14 +7,14 @@ const path_1 = (0, tslib_1.__importDefault)(require("path"));
|
|
|
7
7
|
const slash_1 = (0, tslib_1.__importDefault)(require("slash"));
|
|
8
8
|
const projectUtils_1 = require("../../project/projectUtils");
|
|
9
9
|
const actions_1 = require("../../user/actions");
|
|
10
|
-
const vcs_1 =
|
|
10
|
+
const vcs_1 = require("../../vcs");
|
|
11
11
|
const cacheDefaults = {
|
|
12
12
|
disabled: false,
|
|
13
13
|
customPaths: [],
|
|
14
14
|
cacheDefaultPaths: true,
|
|
15
15
|
};
|
|
16
16
|
async function prepareJobAsync(ctx, jobData) {
|
|
17
|
-
const projectRootDirectory = (0, slash_1.default)(path_1.default.relative(await vcs_1.
|
|
17
|
+
const projectRootDirectory = (0, slash_1.default)(path_1.default.relative(await (0, vcs_1.getVcsClient)().getRootPathAsync(), ctx.projectDir)) || '.';
|
|
18
18
|
const username = (0, projectUtils_1.getUsername)(ctx.exp, await (0, actions_1.ensureLoggedInAsync)());
|
|
19
19
|
const buildCredentials = {};
|
|
20
20
|
if (jobData.credentials) {
|
|
@@ -28,7 +28,6 @@ async function prepareJobAsync(ctx, jobData) {
|
|
|
28
28
|
platform: eas_build_job_1.Platform.IOS,
|
|
29
29
|
projectArchive: jobData.projectArchive,
|
|
30
30
|
projectRootDirectory,
|
|
31
|
-
distribution: ctx.buildProfile.simulator ? 'simulator' : ctx.buildProfile.distribution,
|
|
32
31
|
builderEnvironment: {
|
|
33
32
|
image: ctx.buildProfile.image,
|
|
34
33
|
node: ctx.buildProfile.node,
|
|
@@ -49,12 +48,11 @@ async function prepareJobAsync(ctx, jobData) {
|
|
|
49
48
|
},
|
|
50
49
|
releaseChannel: ctx.buildProfile.releaseChannel,
|
|
51
50
|
updates: { channel: ctx.buildProfile.channel },
|
|
51
|
+
developmentClient: ctx.buildProfile.developmentClient,
|
|
52
|
+
simulator: ctx.buildProfile.simulator,
|
|
52
53
|
scheme: jobData.buildScheme,
|
|
53
54
|
buildConfiguration: ctx.buildProfile.buildConfiguration,
|
|
54
55
|
artifactPath: ctx.buildProfile.artifactPath,
|
|
55
|
-
buildType: ctx.buildProfile.developmentClient
|
|
56
|
-
? eas_build_job_1.Ios.BuildType.DEVELOPMENT_CLIENT
|
|
57
|
-
: eas_build_job_1.Ios.BuildType.RELEASE,
|
|
58
56
|
username,
|
|
59
57
|
};
|
|
60
58
|
return (0, eas_build_job_1.sanitizeJob)(job);
|
package/build/build/metadata.js
CHANGED
|
@@ -1,24 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.collectMetadataAsync = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
4
|
const eas_build_job_1 = require("@expo/eas-build-job");
|
|
6
5
|
const applicationId_1 = require("../project/android/applicationId");
|
|
7
6
|
const bundleIdentifier_1 = require("../project/ios/bundleIdentifier");
|
|
8
7
|
const projectUtils_1 = require("../project/projectUtils");
|
|
9
8
|
const actions_1 = require("../user/actions");
|
|
10
|
-
const
|
|
9
|
+
const easCli_1 = require("../utils/easCli");
|
|
10
|
+
const vcs_1 = require("../vcs");
|
|
11
11
|
const UpdatesModule_1 = require("./android/UpdatesModule");
|
|
12
12
|
const version_1 = require("./android/version");
|
|
13
13
|
const UpdatesModule_2 = require("./ios/UpdatesModule");
|
|
14
14
|
const version_2 = require("./ios/version");
|
|
15
15
|
const updates_1 = require("./utils/updates");
|
|
16
|
-
/**
|
|
17
|
-
* We use require() to exclude package.json from TypeScript's analysis since it lives outside
|
|
18
|
-
* the src directory and would change the directory structure of the emitted files
|
|
19
|
-
* under the build directory
|
|
20
|
-
*/
|
|
21
|
-
const packageJSON = require('../../package.json');
|
|
22
16
|
async function collectMetadataAsync(ctx, platformContext) {
|
|
23
17
|
var _a;
|
|
24
18
|
const channelOrReleaseChannel = await resolveChannelOrReleaseChannelAsync(ctx);
|
|
@@ -28,7 +22,7 @@ async function collectMetadataAsync(ctx, platformContext) {
|
|
|
28
22
|
const metadata = {
|
|
29
23
|
trackingContext: ctx.trackingCtx,
|
|
30
24
|
...(await maybeResolveVersionsAsync(ctx, platformContext)),
|
|
31
|
-
cliVersion:
|
|
25
|
+
cliVersion: easCli_1.easCliVersion,
|
|
32
26
|
workflow: ctx.workflow,
|
|
33
27
|
credentialsSource: ctx.buildProfile.credentialsSource,
|
|
34
28
|
sdkVersion: ctx.exp.sdkVersion,
|
|
@@ -38,7 +32,8 @@ async function collectMetadataAsync(ctx, platformContext) {
|
|
|
38
32
|
appName: ctx.exp.name,
|
|
39
33
|
appIdentifier: await resolveAppIdentifierAsync(ctx, platformContext),
|
|
40
34
|
buildProfile: ctx.buildProfileName,
|
|
41
|
-
gitCommitHash: await vcs_1.
|
|
35
|
+
gitCommitHash: await (0, vcs_1.getVcsClient)().getCommitHashAsync(),
|
|
36
|
+
isGitWorkingTreeDirty: await (0, vcs_1.getVcsClient)().hasUncommittedChangesAsync(),
|
|
42
37
|
username: (0, projectUtils_1.getUsername)(ctx.exp, await (0, actions_1.ensureLoggedInAsync)()),
|
|
43
38
|
...(ctx.platform === eas_build_job_1.Platform.IOS && {
|
|
44
39
|
iosEnterpriseProvisioning: resolveIosEnterpriseProvisioning(ctx),
|
|
@@ -1,18 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.updateAppJsonConfigAsync = void 0;
|
|
3
|
+
exports.readAppJson = exports.updateAppJsonConfigAsync = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const ExpoConfig = (0, tslib_1.__importStar)(require("@expo/config"));
|
|
6
|
+
const json_file_1 = (0, tslib_1.__importDefault)(require("@expo/json-file"));
|
|
6
7
|
const assert_1 = (0, tslib_1.__importDefault)(require("assert"));
|
|
7
|
-
const fs_extra_1 = (0, tslib_1.__importDefault)(require("fs-extra"));
|
|
8
8
|
async function updateAppJsonConfigAsync({ projectDir, exp, }, modifyConfig) {
|
|
9
9
|
var _a;
|
|
10
10
|
const paths = ExpoConfig.getConfigFilePaths(projectDir);
|
|
11
11
|
(0, assert_1.default)(paths.staticConfigPath, "can't update dynamic config");
|
|
12
|
-
const rawStaticConfig =
|
|
12
|
+
const rawStaticConfig = readAppJson(paths.staticConfigPath);
|
|
13
13
|
rawStaticConfig.expo = (_a = rawStaticConfig.expo) !== null && _a !== void 0 ? _a : {};
|
|
14
14
|
modifyConfig(rawStaticConfig.expo);
|
|
15
|
-
await
|
|
15
|
+
await json_file_1.default.writeAsync(paths.staticConfigPath, rawStaticConfig, { json5: false });
|
|
16
16
|
modifyConfig(exp);
|
|
17
17
|
}
|
|
18
18
|
exports.updateAppJsonConfigAsync = updateAppJsonConfigAsync;
|
|
19
|
+
// TODO: remove this once @expo/config exports getStaticConfig
|
|
20
|
+
function readAppJson(appJsonPath) {
|
|
21
|
+
const config = json_file_1.default.read(appJsonPath, { json5: true });
|
|
22
|
+
if (config) {
|
|
23
|
+
return config;
|
|
24
|
+
}
|
|
25
|
+
throw new Error(`Failed to read app.json`);
|
|
26
|
+
}
|
|
27
|
+
exports.readAppJson = readAppJson;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { BuildProfile } from '@expo/eas-json';
|
|
2
|
+
import { ProfileData } from '../../utils/profiles';
|
|
3
|
+
export declare function ensureExpoDevClientInstalledForDevClientBuildsAsync({ projectDir, nonInteractive, buildProfiles, }: {
|
|
3
4
|
projectDir: string;
|
|
4
|
-
platforms: Platform[];
|
|
5
|
-
profile: string;
|
|
6
5
|
nonInteractive?: boolean;
|
|
6
|
+
buildProfiles?: ProfileData<BuildProfile>[];
|
|
7
7
|
}): Promise<void>;
|
|
@@ -3,7 +3,6 @@ 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 eas_json_1 = require("@expo/eas-json");
|
|
7
6
|
const errors_1 = require("@oclif/errors");
|
|
8
7
|
const chalk_1 = (0, tslib_1.__importDefault)(require("chalk"));
|
|
9
8
|
const resolve_from_1 = (0, tslib_1.__importDefault)(require("resolve-from"));
|
|
@@ -12,25 +11,19 @@ const log_1 = (0, tslib_1.__importStar)(require("../../log"));
|
|
|
12
11
|
const platform_1 = require("../../platform");
|
|
13
12
|
const workflow_1 = require("../../project/workflow");
|
|
14
13
|
const prompts_1 = require("../../prompts");
|
|
15
|
-
const
|
|
16
|
-
const
|
|
14
|
+
const expoCli_1 = require("../../utils/expoCli");
|
|
15
|
+
const vcs_1 = require("../../vcs");
|
|
17
16
|
const repository_1 = require("./repository");
|
|
18
|
-
async function ensureExpoDevClientInstalledForDevClientBuildsAsync({ projectDir,
|
|
17
|
+
async function ensureExpoDevClientInstalledForDevClientBuildsAsync({ projectDir, nonInteractive = false, buildProfiles = [], }) {
|
|
19
18
|
if (await isExpoDevClientInstalledAsync(projectDir)) {
|
|
20
19
|
return;
|
|
21
20
|
}
|
|
22
|
-
const
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
const buildProfile = await easJsonReader.readBuildProfileAsync(platform, profile);
|
|
26
|
-
return (_a = buildProfile.developmentClient) !== null && _a !== void 0 ? _a : false;
|
|
27
|
-
}));
|
|
28
|
-
const isDevClientRequired = devClientPerPlatformList.some(i => i);
|
|
29
|
-
if (!isDevClientRequired) {
|
|
21
|
+
const buildProfilesWithDevelopmentClientRequired = buildProfiles.filter(buildProfile => buildProfile.profile.developmentClient);
|
|
22
|
+
const isDevelopmentClientRequired = buildProfilesWithDevelopmentClientRequired.some(Boolean);
|
|
23
|
+
if (!isDevelopmentClientRequired) {
|
|
30
24
|
return;
|
|
31
25
|
}
|
|
32
|
-
const
|
|
33
|
-
const platformsToCheck = platforms.filter(platform => devClientPerPlatform[platform]);
|
|
26
|
+
const platformsToCheck = buildProfilesWithDevelopmentClientRequired.map(({ platform }) => platform);
|
|
34
27
|
const workflowPerPlatformList = await Promise.all(platformsToCheck.map(platform => (0, workflow_1.resolveWorkflowAsync)(projectDir, platform)));
|
|
35
28
|
log_1.default.newLine();
|
|
36
29
|
log_1.default.error(`You want to build a development client build for platforms: ${platformsToCheck
|
|
@@ -47,15 +40,15 @@ async function ensureExpoDevClientInstalledForDevClientBuildsAsync({ projectDir,
|
|
|
47
40
|
await installExpoDevClientAsync(projectDir, { nonInteractive });
|
|
48
41
|
}
|
|
49
42
|
else {
|
|
50
|
-
(0, errors_1.error)(`Install ${chalk_1.default.bold('expo-dev-client')}
|
|
43
|
+
(0, errors_1.error)(`Install ${chalk_1.default.bold('expo-dev-client')} manually and come back later.`, {
|
|
51
44
|
exit: 1,
|
|
52
45
|
});
|
|
53
46
|
}
|
|
54
47
|
}
|
|
55
48
|
else {
|
|
56
|
-
log_1.default.warn(`
|
|
49
|
+
log_1.default.warn(`You'll need to install ${chalk_1.default.bold('expo-dev-client')} manually.`);
|
|
57
50
|
log_1.default.warn((0, log_1.learnMore)('https://docs.expo.dev/clients/installation/', {
|
|
58
|
-
learnMoreMessage: 'See installation instructions on how to do it',
|
|
51
|
+
learnMoreMessage: 'See installation instructions on how to do it.',
|
|
59
52
|
dim: false,
|
|
60
53
|
}));
|
|
61
54
|
log_1.default.warn('If you proceed anyway, you might not get the build you want.');
|
|
@@ -84,9 +77,11 @@ async function installExpoDevClientAsync(projectDir, { nonInteractive }) {
|
|
|
84
77
|
log_1.default.newLine();
|
|
85
78
|
log_1.default.log(`Running ${chalk_1.default.bold('expo install expo-dev-client')}`);
|
|
86
79
|
log_1.default.newLine();
|
|
87
|
-
await (0,
|
|
80
|
+
await (0, expoCli_1.expoCommandAsync)(projectDir, ['install', 'expo-dev-client']);
|
|
88
81
|
log_1.default.newLine();
|
|
89
|
-
await (0,
|
|
90
|
-
|
|
91
|
-
|
|
82
|
+
if (await (0, vcs_1.getVcsClient)().isCommitRequiredAsync()) {
|
|
83
|
+
await (0, repository_1.reviewAndCommitChangesAsync)('Install expo-dev-client', {
|
|
84
|
+
nonInteractive,
|
|
85
|
+
});
|
|
86
|
+
}
|
|
92
87
|
}
|
|
@@ -13,9 +13,9 @@ const prompts_1 = require("../../prompts");
|
|
|
13
13
|
const files_1 = require("../../utils/files");
|
|
14
14
|
const paths_1 = require("../../utils/paths");
|
|
15
15
|
const timer_1 = require("../../utils/timer");
|
|
16
|
-
const vcs_1 =
|
|
16
|
+
const vcs_1 = require("../../vcs");
|
|
17
17
|
async function maybeBailOnRepoStatusAsync() {
|
|
18
|
-
if (!(await vcs_1.
|
|
18
|
+
if (!(await (0, vcs_1.getVcsClient)().isCommitRequiredAsync())) {
|
|
19
19
|
return;
|
|
20
20
|
}
|
|
21
21
|
log_1.default.addNewLineIfNone();
|
|
@@ -30,7 +30,7 @@ async function maybeBailOnRepoStatusAsync() {
|
|
|
30
30
|
}
|
|
31
31
|
exports.maybeBailOnRepoStatusAsync = maybeBailOnRepoStatusAsync;
|
|
32
32
|
async function ensureRepoIsCleanAsync(nonInteractive = false) {
|
|
33
|
-
if (!(await vcs_1.
|
|
33
|
+
if (!(await (0, vcs_1.getVcsClient)().isCommitRequiredAsync())) {
|
|
34
34
|
return;
|
|
35
35
|
}
|
|
36
36
|
log_1.default.addNewLineIfNone();
|
|
@@ -58,7 +58,7 @@ async function commitPromptAsync({ initialCommitMessage, commitAllFiles, } = {})
|
|
|
58
58
|
initial: initialCommitMessage,
|
|
59
59
|
validate: (input) => input !== '',
|
|
60
60
|
});
|
|
61
|
-
await vcs_1.
|
|
61
|
+
await (0, vcs_1.getVcsClient)().commitAsync({ commitAllFiles, commitMessage: message });
|
|
62
62
|
}
|
|
63
63
|
exports.commitPromptAsync = commitPromptAsync;
|
|
64
64
|
async function makeProjectTarballAsync() {
|
|
@@ -77,7 +77,7 @@ async function makeProjectTarballAsync() {
|
|
|
77
77
|
const compressTimerLabel = 'makeProjectTarballAsync';
|
|
78
78
|
(0, timer_1.startTimer)(compressTimerLabel);
|
|
79
79
|
try {
|
|
80
|
-
await vcs_1.
|
|
80
|
+
await (0, vcs_1.getVcsClient)().makeShallowCopyAsync(shallowClonePath);
|
|
81
81
|
await tar_1.default.create({ cwd: shallowClonePath, file: tarPath, prefix: 'project', gzip: true }, [
|
|
82
82
|
'.',
|
|
83
83
|
]);
|
|
@@ -110,7 +110,10 @@ var ShouldCommitChanges;
|
|
|
110
110
|
})(ShouldCommitChanges || (ShouldCommitChanges = {}));
|
|
111
111
|
async function reviewAndCommitChangesAsync(initialCommitMessage, { nonInteractive, askedFirstTime = true }) {
|
|
112
112
|
if (process.env.EAS_BUILD_AUTOCOMMIT) {
|
|
113
|
-
await vcs_1.
|
|
113
|
+
await (0, vcs_1.getVcsClient)().commitAsync({
|
|
114
|
+
commitMessage: initialCommitMessage,
|
|
115
|
+
commitAllFiles: false,
|
|
116
|
+
});
|
|
114
117
|
log_1.default.withTick('Committed changes.');
|
|
115
118
|
return;
|
|
116
119
|
}
|
|
@@ -140,7 +143,7 @@ async function reviewAndCommitChangesAsync(initialCommitMessage, { nonInteractiv
|
|
|
140
143
|
log_1.default.withTick('Committed changes.');
|
|
141
144
|
}
|
|
142
145
|
else if (selected === ShouldCommitChanges.ShowDiffFirst) {
|
|
143
|
-
await vcs_1.
|
|
146
|
+
await (0, vcs_1.getVcsClient)().showDiffAsync();
|
|
144
147
|
await reviewAndCommitChangesAsync(initialCommitMessage, {
|
|
145
148
|
nonInteractive,
|
|
146
149
|
askedFirstTime: false,
|
package/build/build/validate.js
CHANGED
|
@@ -6,7 +6,7 @@ const eas_build_job_1 = require("@expo/eas-build-job");
|
|
|
6
6
|
const fs_extra_1 = (0, tslib_1.__importDefault)(require("fs-extra"));
|
|
7
7
|
const path_1 = (0, tslib_1.__importDefault)(require("path"));
|
|
8
8
|
const log_1 = (0, tslib_1.__importStar)(require("../log"));
|
|
9
|
-
const vcs_1 =
|
|
9
|
+
const vcs_1 = require("../vcs");
|
|
10
10
|
function checkNodeEnvVariable(ctx) {
|
|
11
11
|
var _a;
|
|
12
12
|
if (((_a = ctx.buildProfile.env) === null || _a === void 0 ? void 0 : _a.NODE_ENV) === 'production') {
|
|
@@ -24,14 +24,14 @@ async function checkGoogleServicesFileAsync(ctx) {
|
|
|
24
24
|
if (!googleServicesFilePath) {
|
|
25
25
|
return;
|
|
26
26
|
}
|
|
27
|
-
const rootDir = path_1.default.normalize(await vcs_1.
|
|
27
|
+
const rootDir = path_1.default.normalize(await (0, vcs_1.getVcsClient)().getRootPathAsync());
|
|
28
28
|
const absGoogleServicesFilePath = path_1.default.resolve(ctx.projectDir, googleServicesFilePath);
|
|
29
29
|
if ((await fs_extra_1.default.pathExists(absGoogleServicesFilePath)) &&
|
|
30
30
|
(!isInsideDirectory(absGoogleServicesFilePath, rootDir) ||
|
|
31
|
-
(await vcs_1.
|
|
31
|
+
(await (0, vcs_1.getVcsClient)().isFileIgnoredAsync(path_1.default.relative(rootDir, absGoogleServicesFilePath))))) {
|
|
32
32
|
log_1.default.warn(`File specified via "${ctx.platform}.googleServicesFile" field in your app.json is not checked in to your repository and won't be uploaded to the builder.`);
|
|
33
33
|
log_1.default.warn(`Use EAS Secret to pass all values that you don't want to include in your version control. ${(0, log_1.learnMore)('https://docs.expo.dev/build-reference/variables/#using-secrets-in-environment-variables')}`);
|
|
34
|
-
log_1.default.warn(
|
|
34
|
+
log_1.default.warn(`If you are using that file for compatibility with the classic build service (expo build) you can silence this warning by setting your build profile's env.GOOGLE_SERVICES_FILE in eas.json to any non-empty string.`);
|
|
35
35
|
log_1.default.newLine();
|
|
36
36
|
}
|
|
37
37
|
}
|
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const eas_json_1 = require("@expo/eas-json");
|
|
3
5
|
const command_1 = require("@oclif/command");
|
|
6
|
+
const semver_1 = (0, tslib_1.__importDefault)(require("semver"));
|
|
4
7
|
const analytics_1 = require("../analytics");
|
|
8
|
+
const log_1 = (0, tslib_1.__importDefault)(require("../log"));
|
|
9
|
+
const projectUtils_1 = require("../project/projectUtils");
|
|
5
10
|
const User_1 = require("../user/User");
|
|
6
11
|
const actions_1 = require("../user/actions");
|
|
12
|
+
const easCli_1 = require("../utils/easCli");
|
|
13
|
+
const vcs_1 = require("../vcs");
|
|
14
|
+
const git_1 = (0, tslib_1.__importDefault)(require("../vcs/clients/git"));
|
|
7
15
|
class EasCommand extends command_1.Command {
|
|
8
16
|
constructor() {
|
|
9
17
|
super(...arguments);
|
|
@@ -16,7 +24,9 @@ class EasCommand extends command_1.Command {
|
|
|
16
24
|
// eslint-disable-next-line async-protect/async-suffix
|
|
17
25
|
async run() {
|
|
18
26
|
var _a;
|
|
27
|
+
eas_json_1.EasJsonReader.setLog(log_1.default);
|
|
19
28
|
await (0, analytics_1.initAsync)();
|
|
29
|
+
await this.applyCliConfigAsync();
|
|
20
30
|
if (this.requiresAuthentication) {
|
|
21
31
|
const { flags } = this.parse();
|
|
22
32
|
const nonInteractive = (_a = flags['non-interactive']) !== null && _a !== void 0 ? _a : false;
|
|
@@ -37,5 +47,16 @@ class EasCommand extends command_1.Command {
|
|
|
37
47
|
await (0, analytics_1.flushAsync)();
|
|
38
48
|
return super.finally(err);
|
|
39
49
|
}
|
|
50
|
+
async applyCliConfigAsync() {
|
|
51
|
+
const projectDir = await (0, projectUtils_1.findProjectRootAsync)();
|
|
52
|
+
const easJsonReader = new eas_json_1.EasJsonReader(projectDir);
|
|
53
|
+
const config = await easJsonReader.getCliConfigAsync();
|
|
54
|
+
if ((config === null || config === void 0 ? void 0 : config.version) && !semver_1.default.satisfies(easCli_1.easCliVersion, config.version)) {
|
|
55
|
+
throw new Error(`You are on eas-cli@${easCli_1.easCliVersion} which does not satisfy the CLI version constraint in eas.json (${config.version})`);
|
|
56
|
+
}
|
|
57
|
+
if (config === null || config === void 0 ? void 0 : config.requireCommit) {
|
|
58
|
+
(0, vcs_1.setVcsClient)(new git_1.default());
|
|
59
|
+
}
|
|
60
|
+
}
|
|
40
61
|
}
|
|
41
62
|
exports.default = EasCommand;
|
|
@@ -11,7 +11,7 @@ const client_1 = require("../../graphql/client");
|
|
|
11
11
|
const log_1 = (0, tslib_1.__importDefault)(require("../../log"));
|
|
12
12
|
const projectUtils_1 = require("../../project/projectUtils");
|
|
13
13
|
const prompts_1 = require("../../prompts");
|
|
14
|
-
const vcs_1 =
|
|
14
|
+
const vcs_1 = require("../../vcs");
|
|
15
15
|
async function createUpdateBranchOnAppAsync({ appId, name, }) {
|
|
16
16
|
const result = await (0, client_1.withErrorHandlingAsync)(client_1.graphqlClient
|
|
17
17
|
.mutation((0, graphql_tag_1.default) `
|
|
@@ -51,7 +51,8 @@ class BranchCreate extends EasCommand_1.default {
|
|
|
51
51
|
type: 'text',
|
|
52
52
|
name: 'name',
|
|
53
53
|
message: 'Please name the branch:',
|
|
54
|
-
initial: (await vcs_1.
|
|
54
|
+
initial: (await (0, vcs_1.getVcsClient)().getBranchNameAsync()) ||
|
|
55
|
+
`branch-${Math.random().toString(36).substr(2, 4)}`,
|
|
55
56
|
validate: value => (value ? true : validationMessage),
|
|
56
57
|
}));
|
|
57
58
|
}
|
|
@@ -34,7 +34,7 @@ async function listBranchesAsync({ projectId, }) {
|
|
|
34
34
|
`, {
|
|
35
35
|
appId: projectId,
|
|
36
36
|
limit: BRANCHES_LIMIT,
|
|
37
|
-
})
|
|
37
|
+
}, { additionalTypenames: ['UpdateBranch'] })
|
|
38
38
|
.toPromise());
|
|
39
39
|
return (_b = (_a = data === null || data === void 0 ? void 0 : data.app) === null || _a === void 0 ? void 0 : _a.byId.updateBranches) !== null && _b !== void 0 ? _b : [];
|
|
40
40
|
}
|
|
@@ -3,7 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.defaultPublishPlatforms = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const config_1 = require("@expo/config");
|
|
6
|
-
const
|
|
6
|
+
const config_plugins_1 = require("@expo/config-plugins");
|
|
7
|
+
const eas_build_job_1 = require("@expo/eas-build-job");
|
|
7
8
|
const command_1 = require("@oclif/command");
|
|
8
9
|
const assert_1 = (0, tslib_1.__importDefault)(require("assert"));
|
|
9
10
|
const chalk_1 = (0, tslib_1.__importDefault)(require("chalk"));
|
|
@@ -16,11 +17,12 @@ const log_1 = (0, tslib_1.__importDefault)(require("../../log"));
|
|
|
16
17
|
const ora_1 = require("../../ora");
|
|
17
18
|
const projectUtils_1 = require("../../project/projectUtils");
|
|
18
19
|
const publish_1 = require("../../project/publish");
|
|
20
|
+
const workflow_1 = require("../../project/workflow");
|
|
19
21
|
const prompts_1 = require("../../prompts");
|
|
20
22
|
const utils_1 = require("../../update/utils");
|
|
21
23
|
const uniqBy_1 = (0, tslib_1.__importDefault)(require("../../utils/expodash/uniqBy"));
|
|
22
24
|
const formatFields_1 = (0, tslib_1.__importDefault)(require("../../utils/formatFields"));
|
|
23
|
-
const vcs_1 =
|
|
25
|
+
const vcs_1 = require("../../vcs");
|
|
24
26
|
const create_1 = require("./create");
|
|
25
27
|
const list_1 = require("./list");
|
|
26
28
|
const view_1 = require("./view");
|
|
@@ -40,7 +42,7 @@ async function getUpdateGroupAsync({ group, }) {
|
|
|
40
42
|
}
|
|
41
43
|
`, {
|
|
42
44
|
group,
|
|
43
|
-
})
|
|
45
|
+
}, { additionalTypenames: ['Update'] })
|
|
44
46
|
.toPromise());
|
|
45
47
|
return updatesByGroup;
|
|
46
48
|
}
|
|
@@ -69,11 +71,12 @@ class BranchPublish extends EasCommand_1.default {
|
|
|
69
71
|
skipSDKVersionRequirement: true,
|
|
70
72
|
isPublicConfig: true,
|
|
71
73
|
});
|
|
72
|
-
const runtimeVersions =
|
|
74
|
+
const runtimeVersions = await getRuntimeVersionObjectAsync(exp, platformFlag, projectDir);
|
|
73
75
|
const projectId = await (0, projectUtils_1.getProjectIdAsync)(exp);
|
|
74
76
|
if (!branchName && autoFlag) {
|
|
75
77
|
branchName =
|
|
76
|
-
(await vcs_1.
|
|
78
|
+
(await (0, vcs_1.getVcsClient)().getBranchNameAsync()) ||
|
|
79
|
+
`branch-${Math.random().toString(36).substr(2, 4)}`;
|
|
77
80
|
}
|
|
78
81
|
if (!branchName) {
|
|
79
82
|
const validationMessage = 'branch name may not be empty.';
|
|
@@ -170,7 +173,7 @@ class BranchPublish extends EasCommand_1.default {
|
|
|
170
173
|
}
|
|
171
174
|
}
|
|
172
175
|
if (!message && autoFlag) {
|
|
173
|
-
message = (_b = (await vcs_1.
|
|
176
|
+
message = (_b = (await (0, vcs_1.getVcsClient)().getLastCommitMessageAsync())) === null || _b === void 0 ? void 0 : _b.trim();
|
|
174
177
|
}
|
|
175
178
|
if (!message) {
|
|
176
179
|
const validationMessage = 'publish message may not be empty.';
|
|
@@ -183,7 +186,7 @@ class BranchPublish extends EasCommand_1.default {
|
|
|
183
186
|
message: `Please enter a publication message.`,
|
|
184
187
|
initial: republish
|
|
185
188
|
? `Republish "${oldMessage}" - group: ${group}`
|
|
186
|
-
: (_c = (await vcs_1.
|
|
189
|
+
: (_c = (await (0, vcs_1.getVcsClient)().getLastCommitMessageAsync())) === null || _c === void 0 ? void 0 : _c.trim(),
|
|
187
190
|
validate: value => (value ? true : validationMessage),
|
|
188
191
|
}));
|
|
189
192
|
}
|
|
@@ -295,50 +298,19 @@ BranchPublish.flags = {
|
|
|
295
298
|
default: false,
|
|
296
299
|
}),
|
|
297
300
|
};
|
|
298
|
-
function
|
|
301
|
+
async function getRuntimeVersionObjectAsync(exp, platformFlag, projectDir) {
|
|
299
302
|
var _a, _b;
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
}
|
|
309
|
-
const iOSRuntimeVersion = (_a = exp.ios) === null || _a === void 0 ? void 0 : _a.runtimeVersion; // TODO-JJ remove cast to any
|
|
310
|
-
const androidRuntimeVersion = (_b = exp.android) === null || _b === void 0 ? void 0 : _b.runtimeVersion; // TODO-JJ remove cast to any
|
|
311
|
-
let runtimeVersions;
|
|
312
|
-
switch (platformFlag) {
|
|
313
|
-
case 'ios': {
|
|
314
|
-
runtimeVersions = {
|
|
315
|
-
ios: iOSRuntimeVersion !== null && iOSRuntimeVersion !== void 0 ? iOSRuntimeVersion : defaultRuntimeVersion,
|
|
316
|
-
};
|
|
317
|
-
break;
|
|
318
|
-
}
|
|
319
|
-
case 'android': {
|
|
320
|
-
runtimeVersions = {
|
|
321
|
-
android: androidRuntimeVersion !== null && androidRuntimeVersion !== void 0 ? androidRuntimeVersion : defaultRuntimeVersion,
|
|
322
|
-
};
|
|
323
|
-
break;
|
|
324
|
-
}
|
|
325
|
-
case 'all': {
|
|
326
|
-
runtimeVersions = {
|
|
327
|
-
ios: iOSRuntimeVersion !== null && iOSRuntimeVersion !== void 0 ? iOSRuntimeVersion : defaultRuntimeVersion,
|
|
328
|
-
android: androidRuntimeVersion !== null && androidRuntimeVersion !== void 0 ? androidRuntimeVersion : defaultRuntimeVersion,
|
|
329
|
-
};
|
|
330
|
-
break;
|
|
303
|
+
const platforms = (platformFlag === 'all' ? ['android', 'ios'] : [platformFlag]);
|
|
304
|
+
for (const platform of platforms) {
|
|
305
|
+
const isPolicy = typeof ((_b = (_a = exp[platform]) === null || _a === void 0 ? void 0 : _a.runtimeVersion) !== null && _b !== void 0 ? _b : exp.runtimeVersion) === 'object';
|
|
306
|
+
if (isPolicy) {
|
|
307
|
+
const isManaged = (await (0, workflow_1.resolveWorkflowAsync)(projectDir, platform)) === eas_build_job_1.Workflow.MANAGED;
|
|
308
|
+
if (!isManaged) {
|
|
309
|
+
throw new Error('Runtime version policies are only supported in the managed workflow.');
|
|
310
|
+
}
|
|
331
311
|
}
|
|
332
|
-
default:
|
|
333
|
-
throw new Error('Platform flag must be "ios", "android", or "all"');
|
|
334
|
-
}
|
|
335
|
-
if (Object.values(runtimeVersions).some(runtime => !runtime)) {
|
|
336
|
-
throw new Error("Couldn't find a 'runtimeVersion' for every platform. Please specify it under the 'expo' key in 'app.json'");
|
|
337
|
-
}
|
|
338
|
-
if (Object.values(runtimeVersions).some(runtime => typeof runtime !== 'string')) {
|
|
339
|
-
throw new Error(`Please ensure that all of the runtime versions defined in the app.json are strings.`);
|
|
340
312
|
}
|
|
341
|
-
return
|
|
313
|
+
return Object.fromEntries(platforms.map(platform => [platform, config_plugins_1.Updates.getRuntimeVersion(exp, platform)]));
|
|
342
314
|
}
|
|
343
315
|
function formatUpdateTitle(update) {
|
|
344
316
|
const { message, createdAt, actor, runtimeVersion } = update;
|
|
@@ -7,7 +7,7 @@ export default class Build extends EasCommand {
|
|
|
7
7
|
'skip-credentials-check': import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
|
|
8
8
|
json: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
|
|
9
9
|
'skip-project-configuration': import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
|
|
10
|
-
profile: flags.IOptionFlag<string>;
|
|
10
|
+
profile: flags.IOptionFlag<string | undefined>;
|
|
11
11
|
'non-interactive': import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
|
|
12
12
|
local: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
|
|
13
13
|
wait: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
|