eas-cli 10.2.4 → 11.0.0
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 +63 -65
- package/build/branch/actions/SelectBranch.d.ts +1 -1
- package/build/branch/actions/SelectBranch.js +2 -2
- package/build/branch/queries.js +3 -1
- package/build/build/android/build.js +1 -1
- package/build/build/android/version.js +1 -1
- package/build/build/build.js +21 -10
- package/build/build/context.d.ts +1 -0
- package/build/build/createContext.d.ts +2 -1
- package/build/build/createContext.js +6 -3
- package/build/build/evaluateConfigWithEnvVarsAsync.d.ts +16 -0
- package/build/build/evaluateConfigWithEnvVarsAsync.js +44 -0
- package/build/build/ios/build.js +4 -4
- package/build/build/local.d.ts +1 -1
- package/build/build/local.js +2 -1
- package/build/build/queries.js +3 -1
- package/build/build/runBuildAndSubmit.d.ts +2 -0
- package/build/build/runBuildAndSubmit.js +14 -7
- package/build/build/utils/printBuildInfo.js +6 -2
- package/build/build/validate.js +2 -2
- package/build/channel/actions/SelectChannel.d.ts +1 -1
- package/build/channel/actions/SelectChannel.js +2 -2
- package/build/channel/queries.js +6 -2
- package/build/commandUtils/EasCommand.js +2 -2
- package/build/commandUtils/context/contextUtils/createGraphqlClient.js +1 -1
- package/build/commandUtils/flags.d.ts +3 -0
- package/build/commandUtils/flags.js +15 -1
- package/build/commandUtils/gating/FeatureGating.js +6 -2
- package/build/commands/analytics.js +1 -1
- package/build/commands/build/index.d.ts +4 -1
- package/build/commands/build/index.js +3 -0
- package/build/commands/build/resign.d.ts +4 -1
- package/build/commands/build/resign.js +12 -3
- package/build/commands/build/version/get.d.ts +1 -0
- package/build/commands/build/version/get.js +9 -2
- package/build/commands/build/version/set.d.ts +1 -0
- package/build/commands/build/version/set.js +11 -1
- package/build/commands/build/version/sync.d.ts +1 -0
- package/build/commands/build/version/sync.js +13 -5
- package/build/commands/config.d.ts +2 -0
- package/build/commands/config.js +10 -3
- package/build/commands/device/delete.js +1 -1
- package/build/commands/device/rename.js +1 -1
- package/build/commands/env/create.js +7 -2
- package/build/commands/env/delete.js +5 -2
- package/build/commands/env/get.js +12 -4
- package/build/commands/env/link.js +3 -1
- package/build/commands/env/list.d.ts +4 -2
- package/build/commands/env/list.js +31 -4
- package/build/commands/env/pull.d.ts +15 -0
- package/build/commands/env/pull.js +64 -0
- package/build/commands/env/push.d.ts +17 -0
- package/build/commands/env/push.js +148 -0
- package/build/commands/env/unlink.js +4 -1
- package/build/commands/env/update.js +7 -2
- package/build/commands/metadata/lint.js +4 -2
- package/build/commands/project/onboarding.js +1 -1
- package/build/commands/update/edit.d.ts +19 -0
- package/build/commands/update/edit.js +102 -0
- package/build/commands/update/index.d.ts +1 -2
- package/build/commands/update/index.js +53 -25
- package/build/commands/update/list.js +6 -3
- package/build/commands/update/roll-back-to-embedded.js +1 -1
- package/build/credentials/android/AndroidCredentialsProvider.d.ts +2 -2
- package/build/credentials/android/actions/AssignFcm.d.ts +1 -1
- package/build/credentials/android/actions/AssignGoogleServiceAccountKeyForFcmV1.d.ts +1 -1
- package/build/credentials/android/actions/AssignGoogleServiceAccountKeyForSubmissions.d.ts +1 -1
- package/build/credentials/android/actions/CreateFcm.d.ts +1 -1
- package/build/credentials/android/actions/CreateGoogleServiceAccountKey.d.ts +1 -1
- package/build/credentials/android/actions/CreateKeystore.d.ts +1 -1
- package/build/credentials/android/actions/DownloadKeystore.d.ts +2 -2
- package/build/credentials/android/actions/RemoveFcm.d.ts +1 -1
- package/build/credentials/android/actions/RemoveGoogleServiceAccountKey.d.ts +2 -2
- package/build/credentials/android/actions/RemoveKeystore.d.ts +1 -1
- package/build/credentials/android/actions/SetUpBuildCredentials.d.ts +1 -1
- package/build/credentials/android/actions/SetUpBuildCredentialsFromCredentialsJson.d.ts +1 -1
- package/build/credentials/android/actions/SetUpGoogleServiceAccountKeyForFcmV1.d.ts +1 -1
- package/build/credentials/android/actions/SetUpGoogleServiceAccountKeyForSubmissions.d.ts +1 -1
- package/build/credentials/android/actions/UseExistingGoogleServiceAccountKey.d.ts +1 -1
- package/build/credentials/android/api/GraphqlClient.js +3 -3
- package/build/credentials/context.d.ts +2 -2
- package/build/credentials/context.js +1 -1
- package/build/credentials/ios/IosCredentialsProvider.d.ts +2 -2
- package/build/credentials/ios/IosCredentialsProvider.js +1 -1
- package/build/credentials/ios/actions/AscApiKeyUtils.js +1 -1
- package/build/credentials/ios/actions/AssignAscApiKey.d.ts +1 -1
- package/build/credentials/ios/actions/AssignPushKey.d.ts +1 -1
- package/build/credentials/ios/actions/ConfigureProvisioningProfile.d.ts +4 -4
- package/build/credentials/ios/actions/CreateAscApiKey.d.ts +1 -1
- package/build/credentials/ios/actions/CreateDistributionCertificate.d.ts +1 -1
- package/build/credentials/ios/actions/CreateProvisioningProfile.d.ts +3 -3
- package/build/credentials/ios/actions/CreatePushKey.d.ts +1 -1
- package/build/credentials/ios/actions/DistributionCertificateUtils.js +5 -5
- package/build/credentials/ios/actions/ProvisioningProfileUtils.js +1 -1
- package/build/credentials/ios/actions/PushKeyUtils.js +2 -2
- package/build/credentials/ios/actions/RemoveAscApiKey.d.ts +2 -2
- package/build/credentials/ios/actions/RemoveDistributionCertificate.d.ts +3 -3
- package/build/credentials/ios/actions/RemoveProvisioningProfile.d.ts +2 -2
- package/build/credentials/ios/actions/RemovePushKey.d.ts +2 -2
- package/build/credentials/ios/actions/SetUpAdhocProvisioningProfile.d.ts +1 -1
- package/build/credentials/ios/actions/SetUpAdhocProvisioningProfile.js +1 -1
- package/build/credentials/ios/actions/SetUpAscApiKey.d.ts +2 -2
- package/build/credentials/ios/actions/SetUpBuildCredentials.d.ts +1 -1
- package/build/credentials/ios/actions/SetUpBuildCredentialsFromCredentialsJson.d.ts +3 -3
- package/build/credentials/ios/actions/SetUpDistributionCertificate.d.ts +2 -2
- package/build/credentials/ios/actions/SetUpDistributionCertificate.js +1 -1
- package/build/credentials/ios/actions/SetUpInternalProvisioningProfile.d.ts +1 -1
- package/build/credentials/ios/actions/SetUpProvisioningProfile.d.ts +3 -3
- package/build/credentials/ios/actions/SetUpProvisioningProfile.js +1 -1
- package/build/credentials/ios/actions/SetUpPushKey.d.ts +1 -1
- package/build/credentials/ios/actions/SetUpTargetBuildCredentials.d.ts +1 -1
- package/build/credentials/ios/actions/SetUpTargetBuildCredentialsFromCredentialsJson.d.ts +3 -3
- package/build/credentials/ios/actions/UpdateCredentialsJson.d.ts +3 -3
- package/build/credentials/ios/api/GraphqlClient.js +4 -4
- package/build/credentials/ios/appstore/AppStoreApi.js +4 -4
- package/build/credentials/ios/appstore/authenticate.js +1 -1
- package/build/credentials/ios/appstore/bundleId.js +1 -1
- package/build/credentials/ios/appstore/bundleIdCapabilities.js +1 -1
- package/build/credentials/ios/appstore/ensureAppExists.js +1 -1
- package/build/credentials/ios/appstore/keychain.js +8 -6
- package/build/credentials/ios/appstore/provisioningProfile.js +1 -1
- package/build/credentials/ios/appstore/pushKey.js +1 -1
- package/build/credentials/ios/appstore/resolveCredentials.js +2 -2
- package/build/credentials/ios/credentials.js +1 -1
- package/build/credentials/ios/utils/convertHTMLToASCII.js +1 -1
- package/build/credentials/ios/validators/validateProvisioningProfile.js +2 -4
- package/build/credentials/manager/CheckBuildProfileFlagAgainstEasJson.d.ts +3 -3
- package/build/credentials/manager/CreateAndroidBuildCredentials.d.ts +1 -1
- package/build/credentials/manager/ManageAndroid.js +2 -1
- package/build/credentials/manager/ManageIos.js +3 -2
- package/build/credentials/manager/SelectAndroidBuildCredentials.d.ts +2 -2
- package/build/credentials/manager/SelectBuildProfileFromEasJson.d.ts +2 -2
- package/build/credentials/manager/SelectIosDistributionTypeGraphqlFromBuildProfile.d.ts +1 -1
- package/build/credentials/manager/SelectIosDistributionTypeGraphqlFromBuildProfile.js +1 -1
- package/build/credentials/manager/SelectPlatform.js +3 -2
- package/build/credentials/manager/SetDefaultAndroidKeystore.d.ts +1 -1
- package/build/credentials/manager/SetUpAndroidBuildCredentials.d.ts +1 -1
- package/build/credentials/manager/SetUpBuildCredentialsCommandAction.js +3 -2
- package/build/credentials/manager/SetUpIosBuildCredentials.d.ts +1 -1
- package/build/devices/actions/create/action.d.ts +4 -4
- package/build/devices/actions/create/registrationUrlMethod.js +3 -1
- package/build/devices/manager.d.ts +4 -4
- package/build/devices/queries.js +3 -1
- package/build/easMultiselect.js +6 -2
- package/build/graphql/generated.d.ts +342 -33
- package/build/graphql/generated.js +52 -2
- package/build/graphql/mutations/EnvironmentVariableMutation.d.ts +1 -0
- package/build/graphql/mutations/EnvironmentVariableMutation.js +20 -0
- package/build/graphql/mutations/PublishMutation.d.ts +1 -0
- package/build/graphql/mutations/PublishMutation.js +16 -0
- package/build/graphql/queries/BranchQuery.d.ts +7 -1
- package/build/graphql/queries/BranchQuery.js +42 -0
- package/build/graphql/queries/EnvironmentVariablesQuery.d.ts +16 -7
- package/build/graphql/queries/EnvironmentVariablesQuery.js +29 -6
- package/build/graphql/types/Update.js +4 -0
- package/build/metadata/apple/config/reader.js +1 -1
- package/build/metadata/apple/tasks/age-rating.js +1 -1
- package/build/metadata/apple/tasks/app-review-detail.js +2 -1
- package/build/metadata/apple/tasks/app-version.d.ts +1 -1
- package/build/metadata/config/resolve.js +2 -1
- package/build/metadata/errors.js +2 -1
- package/build/metadata/utils/log.js +1 -1
- package/build/metadata/utils/retry.js +1 -1
- package/build/onboarding/runCommand.js +1 -1
- package/build/ora.js +12 -4
- package/build/project/android/applicationId.js +1 -1
- package/build/project/applicationIdentifier.d.ts +3 -2
- package/build/project/applicationIdentifier.js +2 -2
- package/build/project/expoConfig.js +2 -2
- package/build/project/ios/entitlements.js +1 -1
- package/build/project/publish.d.ts +31 -18
- package/build/project/publish.js +61 -37
- package/build/project/resolveRuntimeVersionAsync.d.ts +4 -1
- package/build/project/resolveRuntimeVersionAsync.js +9 -3
- package/build/rollout/actions/CreateRollout.d.ts +2 -2
- package/build/rollout/actions/EditRollout.d.ts +2 -2
- package/build/rollout/actions/EndRollout.d.ts +2 -2
- package/build/rollout/actions/ManageRollout.d.ts +2 -2
- package/build/rollout/actions/NonInteractiveRollout.d.ts +1 -1
- package/build/rollout/actions/RolloutMainMenu.d.ts +1 -1
- package/build/rollout/actions/SelectRuntime.d.ts +3 -3
- package/build/run/android/adb.js +1 -1
- package/build/run/ios/simctl.js +1 -1
- package/build/run/ios/systemRequirements.js +1 -1
- package/build/submit/ArchiveSource.js +15 -15
- package/build/submit/BaseSubmitter.js +2 -2
- package/build/submit/submit.js +1 -1
- package/build/update/android/UpdatesModule.js +1 -1
- package/build/update/configure.d.ts +1 -1
- package/build/update/queries.js +8 -3
- package/build/update/republish.js +2 -1
- package/build/update/utils.d.ts +1 -0
- package/build/update/utils.js +7 -0
- package/build/user/expoSsoLauncher.js +1 -1
- package/build/utils/download.js +2 -2
- package/build/utils/filterAsync.js +1 -1
- package/build/utils/image.js +2 -2
- package/build/utils/progress.js +1 -1
- package/build/utils/promise.js +1 -1
- package/build/utils/queries.js +2 -2
- package/build/vcs/clients/git.d.ts +1 -1
- package/build/vcs/local.d.ts +1 -1
- package/oclif.manifest.json +218 -22
- package/package.json +14 -14
package/build/build/build.js
CHANGED
|
@@ -47,7 +47,9 @@ async function prepareBuildRequestForPlatformAsync(builder) {
|
|
|
47
47
|
failureEvent: AnalyticsManager_1.BuildEvent.GATHER_CREDENTIALS_FAIL,
|
|
48
48
|
properties: ctx.analyticsEventProperties,
|
|
49
49
|
});
|
|
50
|
-
await (0, common_1.withAnalyticsAsync)(ctx.analytics, async () =>
|
|
50
|
+
await (0, common_1.withAnalyticsAsync)(ctx.analytics, async () => {
|
|
51
|
+
await builder.syncProjectConfigurationAsync(ctx);
|
|
52
|
+
}, {
|
|
51
53
|
attemptEvent: AnalyticsManager_1.BuildEvent.CONFIGURE_PROJECT_ATTEMPT,
|
|
52
54
|
successEvent: AnalyticsManager_1.BuildEvent.CONFIGURE_PROJECT_SUCCESS,
|
|
53
55
|
failureEvent: AnalyticsManager_1.BuildEvent.CONFIGURE_PROJECT_FAIL,
|
|
@@ -55,7 +57,11 @@ async function prepareBuildRequestForPlatformAsync(builder) {
|
|
|
55
57
|
});
|
|
56
58
|
if (await ctx.vcsClient.isCommitRequiredAsync()) {
|
|
57
59
|
log_1.default.addNewLineIfNone();
|
|
58
|
-
|
|
60
|
+
const platformToRequestedPlatform = {
|
|
61
|
+
[eas_build_job_1.Platform.ANDROID]: platform_1.RequestedPlatform.Android,
|
|
62
|
+
[eas_build_job_1.Platform.IOS]: platform_1.RequestedPlatform.Ios,
|
|
63
|
+
};
|
|
64
|
+
await (0, repository_1.reviewAndCommitChangesAsync)(ctx.vcsClient, `[EAS Build] Run EAS Build for ${platform_1.requestedPlatformDisplayNames[platformToRequestedPlatform[ctx.platform]]}`, { nonInteractive: ctx.nonInteractive });
|
|
59
65
|
}
|
|
60
66
|
let projectArchive;
|
|
61
67
|
if (ctx.localBuildOptions.localBuildMode === local_1.LocalBuildMode.LOCAL_BUILD_PLUGIN) {
|
|
@@ -87,7 +93,7 @@ async function prepareBuildRequestForPlatformAsync(builder) {
|
|
|
87
93
|
});
|
|
88
94
|
return async () => {
|
|
89
95
|
if (ctx.localBuildOptions.localBuildMode === local_1.LocalBuildMode.LOCAL_BUILD_PLUGIN) {
|
|
90
|
-
await (0, local_1.runLocalBuildAsync)(job, metadata, ctx.localBuildOptions);
|
|
96
|
+
await (0, local_1.runLocalBuildAsync)(job, metadata, ctx.localBuildOptions, ctx.env);
|
|
91
97
|
return undefined;
|
|
92
98
|
}
|
|
93
99
|
else if (ctx.localBuildOptions.localBuildMode === local_1.LocalBuildMode.INTERNAL) {
|
|
@@ -433,30 +439,34 @@ async function createAndMaybeUploadFingerprintAsync(ctx) {
|
|
|
433
439
|
platform: ctx.platform,
|
|
434
440
|
workflow: ctx.workflow,
|
|
435
441
|
projectDir: ctx.projectDir,
|
|
436
|
-
env: ctx.
|
|
442
|
+
env: ctx.env,
|
|
437
443
|
cwd: ctx.projectDir,
|
|
438
444
|
});
|
|
445
|
+
if (!resolvedRuntimeVersion) {
|
|
446
|
+
return {};
|
|
447
|
+
}
|
|
439
448
|
/**
|
|
440
449
|
* It's ok for fingerprintSources to be empty
|
|
441
450
|
* fingerprintSources only exist if the project is using runtimeVersion.policy: fingerprint
|
|
442
451
|
*/
|
|
443
|
-
if (!resolvedRuntimeVersion
|
|
452
|
+
if (!resolvedRuntimeVersion.fingerprint) {
|
|
444
453
|
return {
|
|
445
|
-
runtimeVersion: resolvedRuntimeVersion
|
|
454
|
+
runtimeVersion: resolvedRuntimeVersion.runtimeVersion ?? undefined,
|
|
446
455
|
};
|
|
447
456
|
}
|
|
448
457
|
await fs_extra_1.default.mkdirp((0, paths_1.getTmpDirectory)());
|
|
449
458
|
const fingerprintLocation = path_1.default.join((0, paths_1.getTmpDirectory)(), `${(0, uuid_1.v4)()}-runtime-fingerprint.json`);
|
|
450
459
|
await fs_extra_1.default.writeJSON(fingerprintLocation, {
|
|
451
460
|
hash: resolvedRuntimeVersion.runtimeVersion,
|
|
452
|
-
sources: resolvedRuntimeVersion.fingerprintSources,
|
|
461
|
+
sources: resolvedRuntimeVersion.fingerprint.fingerprintSources,
|
|
453
462
|
});
|
|
454
463
|
if (ctx.localBuildOptions.localBuildMode === local_1.LocalBuildMode.LOCAL_BUILD_PLUGIN) {
|
|
455
464
|
return {
|
|
456
|
-
runtimeVersion: resolvedRuntimeVersion
|
|
465
|
+
runtimeVersion: resolvedRuntimeVersion.runtimeVersion ?? undefined,
|
|
457
466
|
fingerprintSource: {
|
|
458
467
|
type: eas_build_job_1.FingerprintSourceType.PATH,
|
|
459
468
|
path: fingerprintLocation,
|
|
469
|
+
isDebugFingerprint: resolvedRuntimeVersion.fingerprint.isDebugFingerprintSource,
|
|
460
470
|
},
|
|
461
471
|
};
|
|
462
472
|
}
|
|
@@ -471,17 +481,18 @@ async function createAndMaybeUploadFingerprintAsync(ctx) {
|
|
|
471
481
|
}
|
|
472
482
|
log_1.default.warn(errMessage);
|
|
473
483
|
return {
|
|
474
|
-
runtimeVersion: resolvedRuntimeVersion
|
|
484
|
+
runtimeVersion: resolvedRuntimeVersion.runtimeVersion ?? undefined,
|
|
475
485
|
};
|
|
476
486
|
}
|
|
477
487
|
finally {
|
|
478
488
|
await fs_extra_1.default.remove(fingerprintLocation);
|
|
479
489
|
}
|
|
480
490
|
return {
|
|
481
|
-
runtimeVersion: resolvedRuntimeVersion
|
|
491
|
+
runtimeVersion: resolvedRuntimeVersion.runtimeVersion ?? undefined,
|
|
482
492
|
fingerprintSource: {
|
|
483
493
|
type: eas_build_job_1.FingerprintSourceType.GCS,
|
|
484
494
|
bucketKey: fingerprintGCSBucketKey,
|
|
495
|
+
isDebugFingerprint: resolvedRuntimeVersion.fingerprint.isDebugFingerprintSource,
|
|
485
496
|
},
|
|
486
497
|
};
|
|
487
498
|
}
|
package/build/build/context.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ import { ExpoGraphqlClient } from '../commandUtils/context/contextUtils/createGr
|
|
|
9
9
|
import { CustomBuildConfigMetadata } from '../project/customBuildConfig';
|
|
10
10
|
import { Actor } from '../user/User';
|
|
11
11
|
import { Client } from '../vcs/vcs';
|
|
12
|
-
export declare function createBuildContextAsync<T extends Platform>({ buildProfileName, buildProfile, easJsonCliConfig, clearCache, localBuildOptions, nonInteractive, noWait, platform, projectDir, resourceClassFlag, message, actor, graphqlClient, analytics, vcsClient, getDynamicPrivateProjectConfigAsync, customBuildConfigMetadata, buildLoggerLevel, freezeCredentials, repack, }: {
|
|
12
|
+
export declare function createBuildContextAsync<T extends Platform>({ buildProfileName, buildProfile, easJsonCliConfig, clearCache, localBuildOptions, nonInteractive, noWait, platform, projectDir, resourceClassFlag, message, actor, graphqlClient, analytics, vcsClient, getDynamicPrivateProjectConfigAsync, customBuildConfigMetadata, buildLoggerLevel, freezeCredentials, repack, env, }: {
|
|
13
13
|
buildProfileName: string;
|
|
14
14
|
buildProfile: BuildProfile<T>;
|
|
15
15
|
easJsonCliConfig: EasJson['cli'];
|
|
@@ -30,4 +30,5 @@ export declare function createBuildContextAsync<T extends Platform>({ buildProfi
|
|
|
30
30
|
buildLoggerLevel?: LoggerLevel;
|
|
31
31
|
freezeCredentials: boolean;
|
|
32
32
|
repack: boolean;
|
|
33
|
+
env: Record<string, string>;
|
|
33
34
|
}): Promise<BuildContext<T>>;
|
|
@@ -16,8 +16,10 @@ const AnalyticsManager_1 = require("../analytics/AnalyticsManager");
|
|
|
16
16
|
const context_1 = require("../credentials/context");
|
|
17
17
|
const projectUtils_1 = require("../project/projectUtils");
|
|
18
18
|
const workflow_1 = require("../project/workflow");
|
|
19
|
-
async function createBuildContextAsync({ buildProfileName, buildProfile, easJsonCliConfig, clearCache = false, localBuildOptions, nonInteractive, noWait, platform, projectDir, resourceClassFlag, message, actor, graphqlClient, analytics, vcsClient, getDynamicPrivateProjectConfigAsync, customBuildConfigMetadata, buildLoggerLevel, freezeCredentials, repack, }) {
|
|
20
|
-
const { exp, projectId } = await getDynamicPrivateProjectConfigAsync({
|
|
19
|
+
async function createBuildContextAsync({ buildProfileName, buildProfile, easJsonCliConfig, clearCache = false, localBuildOptions, nonInteractive, noWait, platform, projectDir, resourceClassFlag, message, actor, graphqlClient, analytics, vcsClient, getDynamicPrivateProjectConfigAsync, customBuildConfigMetadata, buildLoggerLevel, freezeCredentials, repack, env, }) {
|
|
20
|
+
const { exp, projectId } = await getDynamicPrivateProjectConfigAsync({
|
|
21
|
+
env,
|
|
22
|
+
});
|
|
21
23
|
const projectName = exp.slug;
|
|
22
24
|
const account = await (0, projectUtils_1.getOwnerAccountForProjectIdAsync)(graphqlClient, projectId);
|
|
23
25
|
const workflow = await (0, workflow_1.resolveWorkflowAsync)(projectDir, platform, vcsClient);
|
|
@@ -36,7 +38,7 @@ async function createBuildContextAsync({ buildProfileName, buildProfile, easJson
|
|
|
36
38
|
user: actor,
|
|
37
39
|
graphqlClient,
|
|
38
40
|
analytics,
|
|
39
|
-
env
|
|
41
|
+
env,
|
|
40
42
|
easJsonCliConfig,
|
|
41
43
|
vcsClient,
|
|
42
44
|
freezeCredentials,
|
|
@@ -89,6 +91,7 @@ async function createBuildContextAsync({ buildProfileName, buildProfile, easJson
|
|
|
89
91
|
requiredPackageManager,
|
|
90
92
|
loggerLevel: buildLoggerLevel,
|
|
91
93
|
repack,
|
|
94
|
+
env,
|
|
92
95
|
};
|
|
93
96
|
if (platform === eas_build_job_1.Platform.ANDROID) {
|
|
94
97
|
const common = commonContext;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Env } from '@expo/eas-build-job';
|
|
2
|
+
import { BuildProfile } from '@expo/eas-json';
|
|
3
|
+
import { ExpoGraphqlClient } from '../commandUtils/context/contextUtils/createGraphqlClient';
|
|
4
|
+
export declare function evaluateConfigWithEnvVarsAsync<Config extends {
|
|
5
|
+
projectId: string;
|
|
6
|
+
}, Opts>({ flags, buildProfile, graphqlClient, getProjectConfig, opts, }: {
|
|
7
|
+
flags: {
|
|
8
|
+
environment?: string;
|
|
9
|
+
};
|
|
10
|
+
buildProfile: BuildProfile;
|
|
11
|
+
graphqlClient: ExpoGraphqlClient | null;
|
|
12
|
+
opts: Opts;
|
|
13
|
+
getProjectConfig(opts: Opts): Promise<Config>;
|
|
14
|
+
}): Promise<Config & {
|
|
15
|
+
env: Env;
|
|
16
|
+
}>;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.evaluateConfigWithEnvVarsAsync = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const generated_1 = require("../graphql/generated");
|
|
6
|
+
const EnvironmentVariablesQuery_1 = require("../graphql/queries/EnvironmentVariablesQuery");
|
|
7
|
+
const log_1 = tslib_1.__importDefault(require("../log"));
|
|
8
|
+
function isEnvironment(env) {
|
|
9
|
+
return Object.values(generated_1.EnvironmentVariableEnvironment).includes(env.toUpperCase());
|
|
10
|
+
}
|
|
11
|
+
async function evaluateConfigWithEnvVarsAsync({ flags, buildProfile, graphqlClient, getProjectConfig, opts, }) {
|
|
12
|
+
if (!graphqlClient) {
|
|
13
|
+
log_1.default.warn('An Expo user account is required to fetch environment variables.');
|
|
14
|
+
const config = await getProjectConfig(opts);
|
|
15
|
+
return { env: buildProfile.env ?? {}, ...config };
|
|
16
|
+
}
|
|
17
|
+
const { projectId } = await getProjectConfig({ env: buildProfile.env, ...opts });
|
|
18
|
+
const env = await resolveEnvVarsAsync({ flags, buildProfile, graphqlClient, projectId });
|
|
19
|
+
const config = await getProjectConfig({ ...opts, env });
|
|
20
|
+
return { env, ...config };
|
|
21
|
+
}
|
|
22
|
+
exports.evaluateConfigWithEnvVarsAsync = evaluateConfigWithEnvVarsAsync;
|
|
23
|
+
async function resolveEnvVarsAsync({ flags, buildProfile, graphqlClient, projectId, }) {
|
|
24
|
+
const environment = flags.environment ?? buildProfile.environment ?? process.env.EAS_CURRENT_ENVIRONMENT;
|
|
25
|
+
if (!environment || !isEnvironment(environment)) {
|
|
26
|
+
return { ...buildProfile.env };
|
|
27
|
+
}
|
|
28
|
+
try {
|
|
29
|
+
const environmentVariables = await EnvironmentVariablesQuery_1.EnvironmentVariablesQuery.byAppIdWithSensitiveAsync(graphqlClient, {
|
|
30
|
+
appId: projectId,
|
|
31
|
+
environment,
|
|
32
|
+
});
|
|
33
|
+
const envVars = Object.fromEntries(environmentVariables
|
|
34
|
+
.filter(({ name, value }) => name && value)
|
|
35
|
+
.map(({ name, value }) => [name, value]));
|
|
36
|
+
return { ...envVars, ...buildProfile.env };
|
|
37
|
+
}
|
|
38
|
+
catch (e) {
|
|
39
|
+
log_1.default.error('Failed to pull env variables for environment ${environment} from EAS servers');
|
|
40
|
+
log_1.default.error(e);
|
|
41
|
+
log_1.default.error('This can possibly be a bug in EAS/EAS CLI. Report it here: https://github.com/expo/eas-cli/issues');
|
|
42
|
+
return { ...buildProfile.env };
|
|
43
|
+
}
|
|
44
|
+
}
|
package/build/build/ios/build.js
CHANGED
|
@@ -16,7 +16,7 @@ const build_1 = require("../build");
|
|
|
16
16
|
const graphql_2 = require("../graphql");
|
|
17
17
|
const validate_1 = require("../validate");
|
|
18
18
|
async function createIosContextAsync(ctx) {
|
|
19
|
-
const { buildProfile } = ctx;
|
|
19
|
+
const { buildProfile, env } = ctx;
|
|
20
20
|
if (ctx.workflow === eas_build_job_1.Workflow.MANAGED) {
|
|
21
21
|
await (0, bundleIdentifier_1.ensureBundleIdentifierIsDefinedForManagedProjectAsync)(ctx);
|
|
22
22
|
}
|
|
@@ -33,7 +33,7 @@ async function createIosContextAsync(ctx) {
|
|
|
33
33
|
projectDir: ctx.projectDir,
|
|
34
34
|
exp: ctx.exp,
|
|
35
35
|
xcodeBuildContext,
|
|
36
|
-
env
|
|
36
|
+
env,
|
|
37
37
|
vcsClient: ctx.vcsClient,
|
|
38
38
|
});
|
|
39
39
|
const applicationTarget = (0, target_1.findApplicationTarget)(targets);
|
|
@@ -60,7 +60,7 @@ async function prepareIosBuildAsync(ctx) {
|
|
|
60
60
|
return await (0, build_1.prepareBuildRequestForPlatformAsync)({
|
|
61
61
|
ctx,
|
|
62
62
|
ensureCredentialsAsync: async (ctx) => {
|
|
63
|
-
return (0, credentials_1.ensureIosCredentialsAsync)(ctx, ctx.ios.targets);
|
|
63
|
+
return await (0, credentials_1.ensureIosCredentialsAsync)(ctx, ctx.ios.targets);
|
|
64
64
|
},
|
|
65
65
|
syncProjectConfigurationAsync: async () => {
|
|
66
66
|
await (0, syncProjectConfiguration_1.syncProjectConfigurationAsync)({
|
|
@@ -71,7 +71,7 @@ async function prepareIosBuildAsync(ctx) {
|
|
|
71
71
|
? false
|
|
72
72
|
: ctx.buildProfile.autoIncrement,
|
|
73
73
|
vcsClient: ctx.vcsClient,
|
|
74
|
-
env: ctx.
|
|
74
|
+
env: ctx.env,
|
|
75
75
|
});
|
|
76
76
|
},
|
|
77
77
|
prepareJobAsync: async (ctx, jobData) => {
|
package/build/build/local.d.ts
CHANGED
|
@@ -25,4 +25,4 @@ export interface LocalBuildOptions {
|
|
|
25
25
|
workingdir?: string;
|
|
26
26
|
verbose?: boolean;
|
|
27
27
|
}
|
|
28
|
-
export declare function runLocalBuildAsync(job: Job, metadata: Metadata, options: LocalBuildOptions): Promise<void>;
|
|
28
|
+
export declare function runLocalBuildAsync(job: Job, metadata: Metadata, options: LocalBuildOptions, env: Record<string, string>): Promise<void>;
|
package/build/build/local.js
CHANGED
|
@@ -25,7 +25,7 @@ var LocalBuildMode;
|
|
|
25
25
|
*/
|
|
26
26
|
LocalBuildMode["INTERNAL"] = "internal";
|
|
27
27
|
})(LocalBuildMode || (exports.LocalBuildMode = LocalBuildMode = {}));
|
|
28
|
-
async function runLocalBuildAsync(job, metadata, options) {
|
|
28
|
+
async function runLocalBuildAsync(job, metadata, options, env) {
|
|
29
29
|
const { command, args } = await getCommandAndArgsAsync(job, metadata);
|
|
30
30
|
let spinner;
|
|
31
31
|
if (!options.verbose) {
|
|
@@ -42,6 +42,7 @@ async function runLocalBuildAsync(job, metadata, options) {
|
|
|
42
42
|
const spawnPromise = (0, spawn_async_1.default)(command, args, {
|
|
43
43
|
stdio: options.verbose ? 'inherit' : 'pipe',
|
|
44
44
|
env: {
|
|
45
|
+
...env,
|
|
45
46
|
...process.env,
|
|
46
47
|
EAS_LOCAL_BUILD_WORKINGDIR: options.workingdir ?? process.env.EAS_LOCAL_BUILD_WORKINGDIR,
|
|
47
48
|
...(options.skipCleanup || options.skipNativeBuild
|
package/build/build/queries.js
CHANGED
|
@@ -33,7 +33,9 @@ async function listAndRenderBuildsOnAppAsync(graphqlClient, { projectId, project
|
|
|
33
33
|
}),
|
|
34
34
|
promptOptions: {
|
|
35
35
|
title: 'Load more builds?',
|
|
36
|
-
renderListItems: builds =>
|
|
36
|
+
renderListItems: builds => {
|
|
37
|
+
renderPageOfBuilds({ builds, projectDisplayName, paginatedQueryOptions });
|
|
38
|
+
},
|
|
37
39
|
},
|
|
38
40
|
});
|
|
39
41
|
}
|
|
@@ -4,6 +4,7 @@ import { LocalBuildOptions } from './local';
|
|
|
4
4
|
import { Analytics } from '../analytics/AnalyticsManager';
|
|
5
5
|
import { DynamicConfigContextFn } from '../commandUtils/context/DynamicProjectConfigContextField';
|
|
6
6
|
import { ExpoGraphqlClient } from '../commandUtils/context/contextUtils/createGraphqlClient';
|
|
7
|
+
import { EnvironmentVariableEnvironment } from '../graphql/generated';
|
|
7
8
|
import { RequestedPlatform } from '../platform';
|
|
8
9
|
import { Actor } from '../user/User';
|
|
9
10
|
import { Client } from '../vcs/vcs';
|
|
@@ -22,6 +23,7 @@ export interface BuildFlags {
|
|
|
22
23
|
buildLoggerLevel?: LoggerLevel;
|
|
23
24
|
freezeCredentials: boolean;
|
|
24
25
|
repack: boolean;
|
|
26
|
+
environment?: EnvironmentVariableEnvironment;
|
|
25
27
|
}
|
|
26
28
|
export declare function runBuildAndSubmitAsync(graphqlClient: ExpoGraphqlClient, analytics: Analytics, vcsClient: Client, projectDir: string, flags: BuildFlags, actor: Actor, getDynamicPrivateProjectConfigAsync: DynamicConfigContextFn): Promise<{
|
|
27
29
|
buildIds: string[];
|
|
@@ -11,6 +11,7 @@ const build_1 = require("./android/build");
|
|
|
11
11
|
const build_2 = require("./build");
|
|
12
12
|
const configure_1 = require("./configure");
|
|
13
13
|
const createContext_1 = require("./createContext");
|
|
14
|
+
const evaluateConfigWithEnvVarsAsync_1 = require("./evaluateConfigWithEnvVarsAsync");
|
|
14
15
|
const build_3 = require("./ios/build");
|
|
15
16
|
const local_1 = require("./local");
|
|
16
17
|
const devClient_1 = require("./utils/devClient");
|
|
@@ -58,9 +59,6 @@ async function runBuildAndSubmitAsync(graphqlClient, analytics, vcsClient, proje
|
|
|
58
59
|
profileName: flags.profile ?? undefined,
|
|
59
60
|
projectDir,
|
|
60
61
|
});
|
|
61
|
-
log_1.default.log(`Loaded "env" configuration for the "${buildProfiles[0].profileName}" profile: ${buildProfiles[0].profile.env
|
|
62
|
-
? Object.keys(buildProfiles[0].profile.env).join(', ')
|
|
63
|
-
: 'no environment variables specified'}. ${(0, log_1.learnMore)('https://docs.expo.dev/build-reference/variables/')}`);
|
|
64
62
|
for (const buildProfile of buildProfiles) {
|
|
65
63
|
if (buildProfile.profile.image && ['default', 'stable'].includes(buildProfile.profile.image)) {
|
|
66
64
|
log_1.default.warn(`The "image" field in the build profile "${buildProfile.profileName}" is set to "${buildProfile.profile.image}". This tag is deprecated and will be removed in the future. Use other images or tags listed here: https://docs.expo.dev/build-reference/infrastructure/`);
|
|
@@ -99,6 +97,14 @@ async function runBuildAndSubmitAsync(graphqlClient, analytics, vcsClient, proje
|
|
|
99
97
|
const buildCtxByPlatform = {};
|
|
100
98
|
for (const buildProfile of buildProfiles) {
|
|
101
99
|
const platform = (0, AppPlatform_1.toAppPlatform)(buildProfile.platform);
|
|
100
|
+
const { env } = await (0, evaluateConfigWithEnvVarsAsync_1.evaluateConfigWithEnvVarsAsync)({
|
|
101
|
+
flags,
|
|
102
|
+
buildProfile: buildProfile.profile,
|
|
103
|
+
graphqlClient,
|
|
104
|
+
getProjectConfig: getDynamicPrivateProjectConfigAsync,
|
|
105
|
+
opts: { env: buildProfile.profile.env },
|
|
106
|
+
});
|
|
107
|
+
log_1.default.log(`Loaded "env" configuration for the "${buildProfile.profileName}" profile: ${env ? Object.keys(env).join(', ') : 'no environment variables specified'}. ${(0, log_1.learnMore)('https://docs.expo.dev/build-reference/variables/')}`);
|
|
102
108
|
const { build: maybeBuild, buildCtx } = await prepareAndStartBuildAsync({
|
|
103
109
|
projectDir,
|
|
104
110
|
flags,
|
|
@@ -111,6 +117,7 @@ async function runBuildAndSubmitAsync(graphqlClient, analytics, vcsClient, proje
|
|
|
111
117
|
vcsClient,
|
|
112
118
|
getDynamicPrivateProjectConfigAsync,
|
|
113
119
|
customBuildConfigMetadata: customBuildConfigMetadataByPlatform[platform],
|
|
120
|
+
env,
|
|
114
121
|
});
|
|
115
122
|
if (maybeBuild) {
|
|
116
123
|
startedBuilds.push({ build: maybeBuild, buildProfile });
|
|
@@ -147,7 +154,6 @@ async function runBuildAndSubmitAsync(graphqlClient, analytics, vcsClient, proje
|
|
|
147
154
|
buildCtx: (0, nullthrows_1.default)(buildCtxByPlatform[startedBuild.build.platform]),
|
|
148
155
|
moreBuilds: startedBuilds.length > 1,
|
|
149
156
|
projectDir,
|
|
150
|
-
buildProfile: startedBuild.buildProfile.profile,
|
|
151
157
|
submitProfile,
|
|
152
158
|
nonInteractive: flags.nonInteractive,
|
|
153
159
|
selectedSubmitProfileName: flags.submitProfile,
|
|
@@ -205,7 +211,7 @@ async function runBuildAndSubmitAsync(graphqlClient, analytics, vcsClient, proje
|
|
|
205
211
|
};
|
|
206
212
|
}
|
|
207
213
|
exports.runBuildAndSubmitAsync = runBuildAndSubmitAsync;
|
|
208
|
-
async function prepareAndStartBuildAsync({ projectDir, flags, moreBuilds, buildProfile, easJsonCliConfig, actor, graphqlClient, analytics, vcsClient, getDynamicPrivateProjectConfigAsync, customBuildConfigMetadata, }) {
|
|
214
|
+
async function prepareAndStartBuildAsync({ projectDir, flags, moreBuilds, buildProfile, easJsonCliConfig, actor, graphqlClient, analytics, vcsClient, getDynamicPrivateProjectConfigAsync, customBuildConfigMetadata, env, }) {
|
|
209
215
|
const buildCtx = await (0, createContext_1.createBuildContextAsync)({
|
|
210
216
|
buildProfileName: buildProfile.profileName,
|
|
211
217
|
resourceClassFlag: flags.resourceClass,
|
|
@@ -227,6 +233,7 @@ async function prepareAndStartBuildAsync({ projectDir, flags, moreBuilds, buildP
|
|
|
227
233
|
buildLoggerLevel: flags.buildLoggerLevel,
|
|
228
234
|
freezeCredentials: flags.freezeCredentials,
|
|
229
235
|
repack: flags.repack,
|
|
236
|
+
env,
|
|
230
237
|
});
|
|
231
238
|
if (moreBuilds) {
|
|
232
239
|
log_1.default.newLine();
|
|
@@ -287,7 +294,7 @@ async function startBuildAsync(ctx) {
|
|
|
287
294
|
}
|
|
288
295
|
return await sendBuildRequestAsync();
|
|
289
296
|
}
|
|
290
|
-
async function prepareAndStartSubmissionAsync({ build, buildCtx, moreBuilds, projectDir,
|
|
297
|
+
async function prepareAndStartSubmissionAsync({ build, buildCtx, moreBuilds, projectDir, submitProfile, selectedSubmitProfileName, nonInteractive, }) {
|
|
291
298
|
const platform = (0, AppPlatform_1.toPlatform)(build.platform);
|
|
292
299
|
const submissionCtx = await (0, context_1.createSubmissionContextAsync)({
|
|
293
300
|
platform,
|
|
@@ -295,7 +302,7 @@ async function prepareAndStartSubmissionAsync({ build, buildCtx, moreBuilds, pro
|
|
|
295
302
|
profile: submitProfile,
|
|
296
303
|
archiveFlags: { id: build.id },
|
|
297
304
|
nonInteractive,
|
|
298
|
-
env:
|
|
305
|
+
env: buildCtx.env,
|
|
299
306
|
credentialsCtx: buildCtx.credentialsCtx,
|
|
300
307
|
applicationIdentifier: buildCtx.android?.applicationId ?? buildCtx.ios?.bundleIdentifier,
|
|
301
308
|
actor: buildCtx.user,
|
|
@@ -44,7 +44,9 @@ function printBuildResults(builds) {
|
|
|
44
44
|
printBuildResult(build);
|
|
45
45
|
}
|
|
46
46
|
else {
|
|
47
|
-
builds.filter(i => i).forEach(build =>
|
|
47
|
+
builds.filter(i => i).forEach(build => {
|
|
48
|
+
printBuildResult(build);
|
|
49
|
+
});
|
|
48
50
|
}
|
|
49
51
|
}
|
|
50
52
|
exports.printBuildResults = printBuildResults;
|
|
@@ -69,7 +71,9 @@ function printBuildResult(build) {
|
|
|
69
71
|
// It's tricky to install the .apk file directly on Android so let's fallback
|
|
70
72
|
// to the build details page and let people press the button to download there
|
|
71
73
|
const qrcodeUrl = build.platform === generated_1.AppPlatform.Ios ? (0, url_1.getInternalDistributionInstallUrl)(build) : logsUrl;
|
|
72
|
-
qrcode_terminal_1.default.generate(qrcodeUrl, { small: true }, code =>
|
|
74
|
+
qrcode_terminal_1.default.generate(qrcodeUrl, { small: true }, code => {
|
|
75
|
+
log_1.default.log(`${(0, indent_string_1.default)(code, 2)}\n`);
|
|
76
|
+
});
|
|
73
77
|
log_1.default.log(`${platform_1.appPlatformEmojis[build.platform]} Open this link on your ${platform_1.appPlatformDisplayNames[build.platform]} devices (or scan the QR code) to install the app:`);
|
|
74
78
|
log_1.default.log(`${(0, log_1.link)(logsUrl)}`);
|
|
75
79
|
}
|
package/build/build/validate.js
CHANGED
|
@@ -10,8 +10,8 @@ const semver_1 = tslib_1.__importDefault(require("semver"));
|
|
|
10
10
|
const log_1 = tslib_1.__importStar(require("../log"));
|
|
11
11
|
const image_1 = require("../utils/image");
|
|
12
12
|
function checkNodeEnvVariable(ctx) {
|
|
13
|
-
if (ctx.
|
|
14
|
-
log_1.default.warn('You set NODE_ENV=production in the build profile. Remember that it will be available during the entire build process. In particular, it will make yarn/npm install only production packages.');
|
|
13
|
+
if (ctx.env?.NODE_ENV === 'production') {
|
|
14
|
+
log_1.default.warn('You set NODE_ENV=production in the build profile or environment variables. Remember that it will be available during the entire build process. In particular, it will make yarn/npm install only production packages.');
|
|
15
15
|
log_1.default.newLine();
|
|
16
16
|
}
|
|
17
17
|
}
|
|
@@ -19,7 +19,7 @@ import { Connection, Edge, QueryParams } from '../../utils/relay';
|
|
|
19
19
|
* @args willFetchAgain If the query will fetch again to get a complete page.
|
|
20
20
|
*/
|
|
21
21
|
export declare class SelectChannel implements EASUpdateAction<UpdateChannelBasicInfoFragment | null> {
|
|
22
|
-
private options;
|
|
22
|
+
private readonly options;
|
|
23
23
|
constructor(options?: {
|
|
24
24
|
filterPredicate?: (channelInfo: UpdateChannelBasicInfoFragment) => boolean;
|
|
25
25
|
printedType?: string;
|
|
@@ -52,8 +52,8 @@ class SelectChannel {
|
|
|
52
52
|
throw new utils_1.NonInteractiveError(`${printedType} selection cannot be run in non-interactive mode.`);
|
|
53
53
|
}
|
|
54
54
|
const queryAsync = async (queryParams) => filterPredicate
|
|
55
|
-
? this.filterQueryAsync(ctx, queryParams, filterPredicate)
|
|
56
|
-
: this.queryAsync(ctx, queryParams);
|
|
55
|
+
? await this.filterQueryAsync(ctx, queryParams, filterPredicate)
|
|
56
|
+
: await this.queryAsync(ctx, queryParams);
|
|
57
57
|
const getTitleAsync = async (channelInfo) => channelInfo.name;
|
|
58
58
|
return await (0, relay_1.selectPaginatedAsync)({
|
|
59
59
|
queryAsync,
|
package/build/channel/queries.js
CHANGED
|
@@ -55,7 +55,9 @@ async function listAndRenderChannelsOnAppAsync(graphqlClient, { projectId, pagin
|
|
|
55
55
|
queryToPerform: (limit, offset) => queryChannelsOnAppAsync(graphqlClient, { limit, offset, appId: projectId }),
|
|
56
56
|
promptOptions: {
|
|
57
57
|
title: 'Load more channels?',
|
|
58
|
-
renderListItems: channels =>
|
|
58
|
+
renderListItems: channels => {
|
|
59
|
+
renderPageOfChannels(channels, paginatedQueryOptions);
|
|
60
|
+
},
|
|
59
61
|
},
|
|
60
62
|
});
|
|
61
63
|
}
|
|
@@ -85,7 +87,9 @@ async function listAndRenderBranchesAndUpdatesOnChannelAsync(graphqlClient, { pr
|
|
|
85
87
|
}),
|
|
86
88
|
promptOptions: {
|
|
87
89
|
title: 'Load more channels?',
|
|
88
|
-
renderListItems: branches =>
|
|
90
|
+
renderListItems: branches => {
|
|
91
|
+
renderPageOfBranchesOnChannel(channel, branches, paginatedQueryOptions);
|
|
92
|
+
},
|
|
89
93
|
},
|
|
90
94
|
});
|
|
91
95
|
}
|
|
@@ -58,12 +58,12 @@ class EasCommand extends core_1.Command {
|
|
|
58
58
|
// commands/submit === submit, commands/build/list === build:list
|
|
59
59
|
action: `eas ${this.id}`,
|
|
60
60
|
});
|
|
61
|
-
return this.runAsync();
|
|
61
|
+
return await this.runAsync();
|
|
62
62
|
}
|
|
63
63
|
// eslint-disable-next-line async-protect/async-suffix
|
|
64
64
|
async finally(err) {
|
|
65
65
|
await this.analytics.flushAsync();
|
|
66
|
-
return super.finally(err);
|
|
66
|
+
return await super.finally(err);
|
|
67
67
|
}
|
|
68
68
|
catch(err) {
|
|
69
69
|
let baseMessage = `${this.id} command failed.`;
|
|
@@ -17,7 +17,7 @@ function createGraphqlClient(authInfo) {
|
|
|
17
17
|
retryIf: (err, operation) => {
|
|
18
18
|
return !!(err &&
|
|
19
19
|
!operation.context.noRetry &&
|
|
20
|
-
(err.networkError
|
|
20
|
+
(err.networkError ?? err.graphQLErrors.some(e => e?.extensions?.isTransient)));
|
|
21
21
|
},
|
|
22
22
|
}),
|
|
23
23
|
core_1.fetchExchange,
|
|
@@ -6,6 +6,9 @@ export declare const EasNonInteractiveAndJsonFlags: {
|
|
|
6
6
|
export declare const EASEnvironmentFlag: {
|
|
7
7
|
environment: import("@oclif/core/lib/interfaces").OptionFlag<EnvironmentVariableEnvironment | undefined>;
|
|
8
8
|
};
|
|
9
|
+
export declare const EASEnvironmentFlagHidden: {
|
|
10
|
+
environment: import("@oclif/core/lib/interfaces").OptionFlag<EnvironmentVariableEnvironment | undefined>;
|
|
11
|
+
};
|
|
9
12
|
export declare const EASVariableFormatFlag: {
|
|
10
13
|
format: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
11
14
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EasJsonOnlyFlag = exports.EASNonInteractiveFlag = exports.EASVariableScopeFlag = exports.EASVariableVisibilityFlag = exports.EASVariableFormatFlag = exports.EASEnvironmentFlag = exports.EasNonInteractiveAndJsonFlags = void 0;
|
|
3
|
+
exports.EasJsonOnlyFlag = exports.EASNonInteractiveFlag = exports.EASVariableScopeFlag = exports.EASVariableVisibilityFlag = exports.EASVariableFormatFlag = exports.EASEnvironmentFlagHidden = exports.EASEnvironmentFlag = exports.EasNonInteractiveAndJsonFlags = void 0;
|
|
4
4
|
const core_1 = require("@oclif/core");
|
|
5
5
|
const generated_1 = require("../graphql/generated");
|
|
6
6
|
// NOTE: not exactly true, but, provided mapToLowercase and upperCaseAsync
|
|
@@ -31,6 +31,20 @@ exports.EASEnvironmentFlag = {
|
|
|
31
31
|
]),
|
|
32
32
|
}),
|
|
33
33
|
};
|
|
34
|
+
// NOTE: Used in build commands, should be replaced with EASEnvironmentFlag when
|
|
35
|
+
// the feature is public
|
|
36
|
+
exports.EASEnvironmentFlagHidden = {
|
|
37
|
+
environment: core_1.Flags.enum({
|
|
38
|
+
description: "Environment variable's environment",
|
|
39
|
+
parse: upperCaseAsync,
|
|
40
|
+
hidden: true,
|
|
41
|
+
options: mapToLowercase([
|
|
42
|
+
generated_1.EnvironmentVariableEnvironment.Development,
|
|
43
|
+
generated_1.EnvironmentVariableEnvironment.Preview,
|
|
44
|
+
generated_1.EnvironmentVariableEnvironment.Production,
|
|
45
|
+
]),
|
|
46
|
+
}),
|
|
47
|
+
};
|
|
34
48
|
exports.EASVariableFormatFlag = {
|
|
35
49
|
format: core_1.Flags.enum({
|
|
36
50
|
description: 'Output format',
|
|
@@ -48,8 +48,12 @@ class FeatureGating {
|
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
static overrideKeyForEachInTest(key, enabled) {
|
|
51
|
-
beforeEach(() =>
|
|
52
|
-
|
|
51
|
+
beforeEach(() => {
|
|
52
|
+
FeatureGateTestOverrides.setOverride(key, enabled);
|
|
53
|
+
});
|
|
54
|
+
afterEach(() => {
|
|
55
|
+
FeatureGateTestOverrides.removeOverride(key);
|
|
56
|
+
});
|
|
53
57
|
}
|
|
54
58
|
}
|
|
55
59
|
exports.default = FeatureGating;
|
|
@@ -8,7 +8,7 @@ class AnalyticsView extends EasCommand_1.default {
|
|
|
8
8
|
async runAsync() {
|
|
9
9
|
const { STATUS: status } = (await this.parse(AnalyticsView)).args;
|
|
10
10
|
if (status) {
|
|
11
|
-
(0, AnalyticsManager_1.setAnalyticsEnabledAsync)(status === 'on');
|
|
11
|
+
await (0, AnalyticsManager_1.setAnalyticsEnabledAsync)(status === 'on');
|
|
12
12
|
log_1.default.withTick(`${status === 'on' ? 'Enabling' : 'Disabling'} analytics.`);
|
|
13
13
|
}
|
|
14
14
|
else {
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { ResourceClass } from '@expo/eas-json';
|
|
2
2
|
import { LoggerLevel } from '@expo/logger';
|
|
3
3
|
import EasCommand from '../../commandUtils/EasCommand';
|
|
4
|
+
import { EnvironmentVariableEnvironment } from '../../graphql/generated';
|
|
4
5
|
export default class Build extends EasCommand {
|
|
5
6
|
static description: string;
|
|
6
7
|
static flags: {
|
|
8
|
+
environment: import("@oclif/core/lib/interfaces").OptionFlag<EnvironmentVariableEnvironment | undefined>;
|
|
7
9
|
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
8
10
|
'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
9
11
|
platform: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
@@ -25,10 +27,11 @@ export default class Build extends EasCommand {
|
|
|
25
27
|
static contextDefinition: {
|
|
26
28
|
vcsClient: import("../../commandUtils/context/VcsClientContextField").default;
|
|
27
29
|
analytics: import("../../commandUtils/context/AnalyticsContextField").default;
|
|
30
|
+
loggedIn: import("../../commandUtils/context/LoggedInContextField").default;
|
|
31
|
+
privateProjectConfig: import("../../commandUtils/context/PrivateProjectConfigContextField").PrivateProjectConfigContextField;
|
|
28
32
|
projectDir: import("../../commandUtils/context/ProjectDirContextField").default;
|
|
29
33
|
getDynamicPublicProjectConfigAsync: import("../../commandUtils/context/DynamicProjectConfigContextField").DynamicPublicProjectConfigContextField;
|
|
30
34
|
getDynamicPrivateProjectConfigAsync: import("../../commandUtils/context/DynamicProjectConfigContextField").DynamicPrivateProjectConfigContextField;
|
|
31
|
-
loggedIn: import("../../commandUtils/context/LoggedInContextField").default;
|
|
32
35
|
};
|
|
33
36
|
runAsync(): Promise<void>;
|
|
34
37
|
private sanitizeFlags;
|
|
@@ -90,6 +90,7 @@ class Build extends EasCommand_1.default {
|
|
|
90
90
|
buildLoggerLevel: flags['build-logger-level'],
|
|
91
91
|
freezeCredentials: flags['freeze-credentials'],
|
|
92
92
|
repack: flags.repack,
|
|
93
|
+
environment: flags.environment,
|
|
93
94
|
};
|
|
94
95
|
}
|
|
95
96
|
async ensurePlatformSelectedAsync(flags) {
|
|
@@ -192,11 +193,13 @@ Build.flags = {
|
|
|
192
193
|
description: 'Use the golden dev client build repack flow as it works for onboarding',
|
|
193
194
|
}),
|
|
194
195
|
...flags_1.EasNonInteractiveAndJsonFlags,
|
|
196
|
+
...flags_1.EASEnvironmentFlagHidden,
|
|
195
197
|
};
|
|
196
198
|
Build.contextDefinition = {
|
|
197
199
|
..._a.ContextOptions.LoggedIn,
|
|
198
200
|
..._a.ContextOptions.DynamicProjectConfig,
|
|
199
201
|
..._a.ContextOptions.ProjectDir,
|
|
202
|
+
..._a.ContextOptions.ProjectConfig,
|
|
200
203
|
..._a.ContextOptions.Analytics,
|
|
201
204
|
..._a.ContextOptions.Vcs,
|
|
202
205
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Platform } from '@expo/eas-build-job';
|
|
2
2
|
import EasCommand from '../../commandUtils/EasCommand';
|
|
3
3
|
import { ExpoGraphqlClient } from '../../commandUtils/context/contextUtils/createGraphqlClient';
|
|
4
|
-
import { BuildFragment } from '../../graphql/generated';
|
|
4
|
+
import { BuildFragment, EnvironmentVariableEnvironment } from '../../graphql/generated';
|
|
5
5
|
interface BuildResignFlags {
|
|
6
6
|
json: boolean;
|
|
7
7
|
nonInteractive: boolean;
|
|
@@ -12,6 +12,7 @@ interface BuildResignFlags {
|
|
|
12
12
|
sourceProfile?: string;
|
|
13
13
|
maybeBuildId?: string;
|
|
14
14
|
wait: boolean;
|
|
15
|
+
environment?: EnvironmentVariableEnvironment;
|
|
15
16
|
}
|
|
16
17
|
interface RawBuildResignFlags {
|
|
17
18
|
json: boolean;
|
|
@@ -23,10 +24,12 @@ interface RawBuildResignFlags {
|
|
|
23
24
|
'source-profile': string | undefined;
|
|
24
25
|
wait: boolean;
|
|
25
26
|
id: string | undefined;
|
|
27
|
+
environment: EnvironmentVariableEnvironment | undefined;
|
|
26
28
|
}
|
|
27
29
|
export default class BuildResign extends EasCommand {
|
|
28
30
|
static description: string;
|
|
29
31
|
static flags: {
|
|
32
|
+
environment: import("@oclif/core/lib/interfaces").OptionFlag<EnvironmentVariableEnvironment | undefined>;
|
|
30
33
|
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
31
34
|
'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
32
35
|
offset: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined>;
|