eas-cli 11.0.3 → 12.1.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.
Files changed (41) hide show
  1. package/README.md +60 -60
  2. package/build/build/build.js +8 -45
  3. package/build/build/configure.js +4 -1
  4. package/build/build/evaluateConfigWithEnvVarsAsync.d.ts +2 -1
  5. package/build/build/evaluateConfigWithEnvVarsAsync.js +31 -9
  6. package/build/build/graphql.d.ts +2 -1
  7. package/build/build/graphql.js +13 -2
  8. package/build/build/local.js +1 -1
  9. package/build/build/runBuildAndSubmit.js +12 -2
  10. package/build/build/types.d.ts +20 -0
  11. package/build/commands/build/resign.js +1 -0
  12. package/build/commands/build/version/get.js +1 -0
  13. package/build/commands/build/version/set.js +1 -0
  14. package/build/commands/build/version/sync.js +1 -0
  15. package/build/commands/config.js +1 -0
  16. package/build/commands/project/onboarding.js +3 -0
  17. package/build/commands/update/index.js +22 -5
  18. package/build/commands/update/roll-back-to-embedded.js +6 -6
  19. package/build/commands/worker/deploy.d.ts +15 -0
  20. package/build/commands/worker/deploy.js +181 -0
  21. package/build/credentials/ios/appstore/bundleIdCapabilities.js +41 -0
  22. package/build/graphql/generated.d.ts +301 -53
  23. package/build/graphql/generated.js +72 -12
  24. package/build/project/maybeUploadFingerprintAsync.d.ts +15 -0
  25. package/build/project/maybeUploadFingerprintAsync.js +57 -0
  26. package/build/project/publish.d.ts +16 -11
  27. package/build/project/publish.js +33 -30
  28. package/build/project/remoteVersionSource.d.ts +8 -1
  29. package/build/project/remoteVersionSource.js +94 -5
  30. package/build/project/resolveRuntimeVersionAsync.d.ts +13 -0
  31. package/build/project/resolveRuntimeVersionAsync.js +21 -17
  32. package/build/worker/assets.d.ts +25 -0
  33. package/build/worker/assets.js +110 -0
  34. package/build/worker/deployment.d.ts +6 -0
  35. package/build/worker/deployment.js +57 -0
  36. package/build/worker/mutations.d.ts +11 -0
  37. package/build/worker/mutations.js +45 -0
  38. package/build/worker/upload.d.ts +20 -0
  39. package/build/worker/upload.js +141 -0
  40. package/oclif.manifest.json +22 -1
  41. package/package.json +8 -5
@@ -6,8 +6,9 @@
6
6
  * For more info and docs, visit https://graphql-code-generator.com/
7
7
  */
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.GitHubAppInstallationStatus = exports.GitHubAppEnvironment = exports.FingerprintSourceType = exports.Feature = exports.Experiment = exports.EnvironmentVariableVisibility = exports.EnvironmentVariableScope = exports.EnvironmentVariableEnvironment = exports.EnvironmentSecretType = exports.EntityTypeName = exports.EasTotalPlanEnablementUnit = exports.EasServiceMetric = exports.EasService = exports.EasBuildWaiverType = exports.EasBuildDeprecationInfoType = exports.EasBuildBillingResourceClass = exports.DistributionType = exports.CustomDomainStatus = exports.CustomDomainDnsRecordType = exports.ContinentCode = exports.BuildWorkflow = exports.BuildTrigger = exports.BuildStatus = exports.BuildRetryDisabledReason = exports.BuildResourceClass = exports.BuildPriority = exports.BuildPhase = exports.BuildMode = exports.BuildLimitThresholdExceededMetadataType = exports.BuildIosEnterpriseProvisioning = exports.BuildCredentialsSource = exports.BackgroundJobState = exports.BackgroundJobResultType = exports.AuthProviderIdentifier = exports.AuthProtocolType = exports.AuditLogsExportFormat = exports.AssetMetadataStatus = exports.AppsFilter = exports.AppleTeamType = exports.AppleDeviceClass = exports.AppStoreConnectUserRole = exports.AppSort = exports.AppPrivacy = exports.AppPlatform = exports.AppInternalDistributionBuildPrivacy = exports.AndroidKeystoreType = exports.AndroidFcmVersion = exports.AndroidBuildType = exports.ActivityTimelineProjectActivityType = exports.AccountAppsSortByField = void 0;
10
- exports.WorkerLoggerLevel = exports.WorkerDeploymentLogLevel = exports.WebhookType = exports.UsageMetricsGranularity = exports.UsageMetricType = exports.UploadSessionType = exports.TargetEntityMutationType = exports.SubmissionStatus = exports.SubmissionPriority = exports.SubmissionArchiveSourceType = exports.SubmissionAndroidTrack = exports.SubmissionAndroidReleaseStatus = exports.SubmissionAndroidArchiveType = exports.StatuspageServiceStatus = exports.StatuspageServiceName = exports.StatuspageIncidentStatus = exports.StatuspageIncidentImpact = exports.StandardOffer = exports.SecondFactorMethod = exports.Role = exports.ResourceClassExperiment = exports.RequestStatusPattern = exports.ProjectArchiveSourceType = exports.Permission = exports.Order = exports.OnboardingEnvironment = exports.OnboardingDeviceType = exports.OfferType = exports.NotificationType = exports.NotificationEvent = exports.MailchimpTag = exports.MailchimpAudience = exports.JobRunStatus = exports.JobRunPriority = exports.IosSchemeBuildConfiguration = exports.IosManagedBuildType = exports.IosDistributionType = exports.IosBuildType = exports.InvoiceDiscountType = exports.InsightsFilterType = exports.GitHubJobRunTriggerType = exports.GitHubJobRunTriggerRunStatus = exports.GitHubJobRunJobType = exports.GitHubBuildTriggerType = exports.GitHubBuildTriggerRunStatus = exports.GitHubBuildTriggerExecutionBehavior = void 0;
9
+ exports.GitHubAppEnvironment = exports.FingerprintSourceType = exports.Feature = exports.Experiment = exports.EnvironmentVariableVisibility = exports.EnvironmentVariableScope = exports.EnvironmentVariableEnvironment = exports.EnvironmentSecretType = exports.EntityTypeName = exports.EasTotalPlanEnablementUnit = exports.EasServiceMetric = exports.EasService = exports.EasBuildWaiverType = exports.EasBuildDeprecationInfoType = exports.EasBuildBillingResourceClass = exports.DistributionType = exports.CustomDomainStatus = exports.CustomDomainDnsRecordType = exports.CrashSampleFor = exports.ContinentCode = exports.BuildWorkflow = exports.BuildTrigger = exports.BuildStatus = exports.BuildRetryDisabledReason = exports.BuildResourceClass = exports.BuildPriority = exports.BuildPhase = exports.BuildMode = exports.BuildLimitThresholdExceededMetadataType = exports.BuildIosEnterpriseProvisioning = exports.BuildCredentialsSource = exports.BackgroundJobState = exports.BackgroundJobResultType = exports.AuthProviderIdentifier = exports.AuthProtocolType = exports.AuditLogsExportFormat = exports.AssetMetadataStatus = exports.AppsFilter = exports.AppleTeamType = exports.AppleDeviceClass = exports.AppStoreConnectUserRole = exports.AppSort = exports.AppPrivacy = exports.AppPlatform = exports.AppInternalDistributionBuildPrivacy = exports.AndroidKeystoreType = exports.AndroidFcmVersion = exports.AndroidBuildType = exports.ActivityTimelineProjectActivityType = exports.AccountAppsSortByField = void 0;
10
+ exports.WebhookType = exports.UserAgentOs = exports.UserAgentBrowser = exports.UsageMetricsGranularity = exports.UsageMetricType = exports.UploadSessionType = exports.TargetEntityMutationType = exports.SubmissionStatus = exports.SubmissionPriority = exports.SubmissionArchiveSourceType = exports.SubmissionAndroidTrack = exports.SubmissionAndroidReleaseStatus = exports.SubmissionAndroidArchiveType = exports.StatuspageServiceStatus = exports.StatuspageServiceName = exports.StatuspageIncidentStatus = exports.StatuspageIncidentImpact = exports.StandardOffer = exports.SecondFactorMethod = exports.Role = exports.ResourceClassExperiment = exports.RequestStatusPattern = exports.ProjectArchiveSourceType = exports.Permission = exports.Order = exports.OnboardingEnvironment = exports.OnboardingDeviceType = exports.OfferType = exports.NotificationType = exports.NotificationEvent = exports.MetricsStatusType = exports.MetricsRequestMethod = exports.MetricsCacheStatus = exports.MailchimpTag = exports.MailchimpAudience = exports.JobRunStatus = exports.JobRunPriority = exports.IosSchemeBuildConfiguration = exports.IosManagedBuildType = exports.IosDistributionType = exports.IosBuildType = exports.InvoiceDiscountType = exports.InsightsFilterType = exports.GitHubJobRunTriggerType = exports.GitHubJobRunTriggerRunStatus = exports.GitHubJobRunJobType = exports.GitHubBuildTriggerType = exports.GitHubBuildTriggerRunStatus = exports.GitHubBuildTriggerExecutionBehavior = exports.GitHubAppInstallationStatus = void 0;
11
+ exports.WorkerLoggerLevel = exports.WorkerDeploymentRequestsInclude = exports.WorkerDeploymentRequestKind = exports.WorkerDeploymentLogLevel = void 0;
11
12
  var AccountAppsSortByField;
12
13
  (function (AccountAppsSortByField) {
13
14
  AccountAppsSortByField["LatestActivityTime"] = "LATEST_ACTIVITY_TIME";
@@ -271,6 +272,11 @@ var ContinentCode;
271
272
  ContinentCode["Sa"] = "SA";
272
273
  ContinentCode["T1"] = "T1";
273
274
  })(ContinentCode || (exports.ContinentCode = ContinentCode = {}));
275
+ var CrashSampleFor;
276
+ (function (CrashSampleFor) {
277
+ CrashSampleFor["Newest"] = "NEWEST";
278
+ CrashSampleFor["Oldest"] = "OLDEST";
279
+ })(CrashSampleFor || (exports.CrashSampleFor = CrashSampleFor = {}));
274
280
  var CustomDomainDnsRecordType;
275
281
  (function (CustomDomainDnsRecordType) {
276
282
  CustomDomainDnsRecordType["Cname"] = "CNAME";
@@ -279,17 +285,9 @@ var CustomDomainDnsRecordType;
279
285
  var CustomDomainStatus;
280
286
  (function (CustomDomainStatus) {
281
287
  CustomDomainStatus["Active"] = "ACTIVE";
282
- CustomDomainStatus["ActiveRedeploying"] = "ACTIVE_REDEPLOYING";
283
- CustomDomainStatus["Blocked"] = "BLOCKED";
284
- CustomDomainStatus["Deleted"] = "DELETED";
285
- CustomDomainStatus["Moved"] = "MOVED";
288
+ CustomDomainStatus["Error"] = "ERROR";
286
289
  CustomDomainStatus["Pending"] = "PENDING";
287
- CustomDomainStatus["PendingBlocked"] = "PENDING_BLOCKED";
288
- CustomDomainStatus["PendingDeletion"] = "PENDING_DELETION";
289
- CustomDomainStatus["PendingMigration"] = "PENDING_MIGRATION";
290
- CustomDomainStatus["PendingProvisioned"] = "PENDING_PROVISIONED";
291
- CustomDomainStatus["Provisioned"] = "PROVISIONED";
292
- CustomDomainStatus["Unknown"] = "UNKNOWN";
290
+ CustomDomainStatus["TimedOut"] = "TIMED_OUT";
293
291
  })(CustomDomainStatus || (exports.CustomDomainStatus = CustomDomainStatus = {}));
294
292
  var DistributionType;
295
293
  (function (DistributionType) {
@@ -502,6 +500,28 @@ var MailchimpTag;
502
500
  MailchimpTag["EasMasterList"] = "EAS_MASTER_LIST";
503
501
  MailchimpTag["NewsletterSignupList"] = "NEWSLETTER_SIGNUP_LIST";
504
502
  })(MailchimpTag || (exports.MailchimpTag = MailchimpTag = {}));
503
+ var MetricsCacheStatus;
504
+ (function (MetricsCacheStatus) {
505
+ MetricsCacheStatus["Hit"] = "HIT";
506
+ MetricsCacheStatus["Miss"] = "MISS";
507
+ MetricsCacheStatus["Pass"] = "PASS";
508
+ })(MetricsCacheStatus || (exports.MetricsCacheStatus = MetricsCacheStatus = {}));
509
+ var MetricsRequestMethod;
510
+ (function (MetricsRequestMethod) {
511
+ MetricsRequestMethod["Delete"] = "DELETE";
512
+ MetricsRequestMethod["Get"] = "GET";
513
+ MetricsRequestMethod["Options"] = "OPTIONS";
514
+ MetricsRequestMethod["Post"] = "POST";
515
+ MetricsRequestMethod["Put"] = "PUT";
516
+ })(MetricsRequestMethod || (exports.MetricsRequestMethod = MetricsRequestMethod = {}));
517
+ var MetricsStatusType;
518
+ (function (MetricsStatusType) {
519
+ MetricsStatusType["ClientError"] = "CLIENT_ERROR";
520
+ MetricsStatusType["None"] = "NONE";
521
+ MetricsStatusType["Redirect"] = "REDIRECT";
522
+ MetricsStatusType["ServerError"] = "SERVER_ERROR";
523
+ MetricsStatusType["Successful"] = "SUCCESSFUL";
524
+ })(MetricsStatusType || (exports.MetricsStatusType = MetricsStatusType = {}));
505
525
  var NotificationEvent;
506
526
  (function (NotificationEvent) {
507
527
  NotificationEvent["BuildComplete"] = "BUILD_COMPLETE";
@@ -566,6 +586,7 @@ var RequestStatusPattern;
566
586
  var ResourceClassExperiment;
567
587
  (function (ResourceClassExperiment) {
568
588
  ResourceClassExperiment["C3D"] = "C3D";
589
+ ResourceClassExperiment["N2"] = "N2";
569
590
  })(ResourceClassExperiment || (exports.ResourceClassExperiment = ResourceClassExperiment = {}));
570
591
  var Role;
571
592
  (function (Role) {
@@ -706,6 +727,34 @@ var UsageMetricsGranularity;
706
727
  UsageMetricsGranularity["Minute"] = "MINUTE";
707
728
  UsageMetricsGranularity["Total"] = "TOTAL";
708
729
  })(UsageMetricsGranularity || (exports.UsageMetricsGranularity = UsageMetricsGranularity = {}));
730
+ var UserAgentBrowser;
731
+ (function (UserAgentBrowser) {
732
+ UserAgentBrowser["AndroidMobile"] = "ANDROID_MOBILE";
733
+ UserAgentBrowser["Chrome"] = "CHROME";
734
+ UserAgentBrowser["ChromeIos"] = "CHROME_IOS";
735
+ UserAgentBrowser["Edge"] = "EDGE";
736
+ UserAgentBrowser["FacebookMobile"] = "FACEBOOK_MOBILE";
737
+ UserAgentBrowser["Firefox"] = "FIREFOX";
738
+ UserAgentBrowser["FirefoxIos"] = "FIREFOX_IOS";
739
+ UserAgentBrowser["InternetExplorer"] = "INTERNET_EXPLORER";
740
+ UserAgentBrowser["Konqueror"] = "KONQUEROR";
741
+ UserAgentBrowser["Mozilla"] = "MOZILLA";
742
+ UserAgentBrowser["Opera"] = "OPERA";
743
+ UserAgentBrowser["Safari"] = "SAFARI";
744
+ UserAgentBrowser["SafariMobile"] = "SAFARI_MOBILE";
745
+ UserAgentBrowser["SamsungInternet"] = "SAMSUNG_INTERNET";
746
+ UserAgentBrowser["UcBrowser"] = "UC_BROWSER";
747
+ })(UserAgentBrowser || (exports.UserAgentBrowser = UserAgentBrowser = {}));
748
+ var UserAgentOs;
749
+ (function (UserAgentOs) {
750
+ UserAgentOs["Android"] = "ANDROID";
751
+ UserAgentOs["ChromeOs"] = "CHROME_OS";
752
+ UserAgentOs["Ios"] = "IOS";
753
+ UserAgentOs["IpadOs"] = "IPAD_OS";
754
+ UserAgentOs["Linux"] = "LINUX";
755
+ UserAgentOs["MacOs"] = "MAC_OS";
756
+ UserAgentOs["Windows"] = "WINDOWS";
757
+ })(UserAgentOs || (exports.UserAgentOs = UserAgentOs = {}));
709
758
  var WebhookType;
710
759
  (function (WebhookType) {
711
760
  WebhookType["Build"] = "BUILD";
@@ -720,6 +769,17 @@ var WorkerDeploymentLogLevel;
720
769
  WorkerDeploymentLogLevel["Log"] = "LOG";
721
770
  WorkerDeploymentLogLevel["Warn"] = "WARN";
722
771
  })(WorkerDeploymentLogLevel || (exports.WorkerDeploymentLogLevel = WorkerDeploymentLogLevel = {}));
772
+ var WorkerDeploymentRequestKind;
773
+ (function (WorkerDeploymentRequestKind) {
774
+ WorkerDeploymentRequestKind["Asset"] = "ASSET";
775
+ WorkerDeploymentRequestKind["Crash"] = "CRASH";
776
+ WorkerDeploymentRequestKind["Rejected"] = "REJECTED";
777
+ })(WorkerDeploymentRequestKind || (exports.WorkerDeploymentRequestKind = WorkerDeploymentRequestKind = {}));
778
+ var WorkerDeploymentRequestsInclude;
779
+ (function (WorkerDeploymentRequestsInclude) {
780
+ WorkerDeploymentRequestsInclude["Assets"] = "ASSETS";
781
+ WorkerDeploymentRequestsInclude["Routes"] = "ROUTES";
782
+ })(WorkerDeploymentRequestsInclude || (exports.WorkerDeploymentRequestsInclude = WorkerDeploymentRequestsInclude = {}));
723
783
  var WorkerLoggerLevel;
724
784
  (function (WorkerLoggerLevel) {
725
785
  WorkerLoggerLevel["Debug"] = "DEBUG";
@@ -0,0 +1,15 @@
1
+ import { FingerprintSource } from '@expo/eas-build-job';
2
+ import { LocalBuildMode } from '../build/local';
3
+ import { ExpoGraphqlClient } from '../commandUtils/context/contextUtils/createGraphqlClient';
4
+ export declare function maybeUploadFingerprintAsync({ runtimeVersion, fingerprint, graphqlClient, localBuildMode, }: {
5
+ runtimeVersion: string;
6
+ fingerprint: {
7
+ fingerprintSources: object[];
8
+ isDebugFingerprintSource: boolean;
9
+ };
10
+ graphqlClient: ExpoGraphqlClient;
11
+ localBuildMode?: LocalBuildMode;
12
+ }): Promise<{
13
+ runtimeVersion: string;
14
+ fingerprintSource?: FingerprintSource;
15
+ }>;
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.maybeUploadFingerprintAsync = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const eas_build_job_1 = require("@expo/eas-build-job");
6
+ const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
7
+ const path_1 = tslib_1.__importDefault(require("path"));
8
+ const uuid_1 = require("uuid");
9
+ const local_1 = require("../build/local");
10
+ const generated_1 = require("../graphql/generated");
11
+ const log_1 = tslib_1.__importDefault(require("../log"));
12
+ const uploads_1 = require("../uploads");
13
+ const paths_1 = require("../utils/paths");
14
+ async function maybeUploadFingerprintAsync({ runtimeVersion, fingerprint, graphqlClient, localBuildMode, }) {
15
+ await fs_extra_1.default.mkdirp((0, paths_1.getTmpDirectory)());
16
+ const fingerprintLocation = path_1.default.join((0, paths_1.getTmpDirectory)(), `${(0, uuid_1.v4)()}-runtime-fingerprint.json`);
17
+ await fs_extra_1.default.writeJSON(fingerprintLocation, {
18
+ hash: runtimeVersion,
19
+ sources: fingerprint.fingerprintSources,
20
+ });
21
+ if (localBuildMode === local_1.LocalBuildMode.LOCAL_BUILD_PLUGIN) {
22
+ return {
23
+ runtimeVersion,
24
+ fingerprintSource: {
25
+ type: eas_build_job_1.FingerprintSourceType.PATH,
26
+ path: fingerprintLocation,
27
+ isDebugFingerprint: fingerprint.isDebugFingerprintSource,
28
+ },
29
+ };
30
+ }
31
+ let fingerprintGCSBucketKey = undefined;
32
+ try {
33
+ fingerprintGCSBucketKey = await (0, uploads_1.uploadFileAtPathToGCSAsync)(graphqlClient, generated_1.UploadSessionType.EasUpdateFingerprint, fingerprintLocation);
34
+ }
35
+ catch (err) {
36
+ let errMessage = 'Failed to upload fingerprint to EAS';
37
+ if (err.message) {
38
+ errMessage += `\n\nReason: ${err.message}`;
39
+ }
40
+ log_1.default.warn(errMessage);
41
+ return {
42
+ runtimeVersion,
43
+ };
44
+ }
45
+ finally {
46
+ await fs_extra_1.default.remove(fingerprintLocation);
47
+ }
48
+ return {
49
+ runtimeVersion,
50
+ fingerprintSource: {
51
+ type: eas_build_job_1.FingerprintSourceType.GCS,
52
+ bucketKey: fingerprintGCSBucketKey,
53
+ isDebugFingerprint: fingerprint.isDebugFingerprintSource,
54
+ },
55
+ };
56
+ }
57
+ exports.maybeUploadFingerprintAsync = maybeUploadFingerprintAsync;
@@ -142,7 +142,14 @@ export declare function getUpdateMessageForCommandAsync(vcsClient: Client, { upd
142
142
  jsonFlag: boolean;
143
143
  }): Promise<string | undefined>;
144
144
  export declare const defaultPublishPlatforms: UpdatePublishPlatform[];
145
- export declare function getRuntimeVersionObjectAsync({ exp, platforms, workflows, projectDir, env, }: {
145
+ export type RuntimeVersionInfo = {
146
+ runtimeVersion: string;
147
+ fingerprint: {
148
+ fingerprintSources: object[];
149
+ isDebugFingerprintSource: boolean;
150
+ } | null;
151
+ };
152
+ export declare function getRuntimeVersionInfoObjectsAsync({ exp, platforms, workflows, projectDir, env, }: {
146
153
  exp: ExpoConfig;
147
154
  platforms: UpdatePublishPlatform[];
148
155
  workflows: Record<ExpoConfigPlatform, Workflow>;
@@ -150,24 +157,22 @@ export declare function getRuntimeVersionObjectAsync({ exp, platforms, workflows
150
157
  env: Env | undefined;
151
158
  }): Promise<{
152
159
  platform: UpdatePublishPlatform;
153
- runtimeVersion: string;
160
+ runtimeVersionInfo: RuntimeVersionInfo;
154
161
  }[]>;
155
- export declare function getRuntimeToPlatformMappingFromRuntimeVersions(runtimeVersions: {
162
+ export declare function getRuntimeToPlatformsAndFingerprintInfoMappingFromRuntimeVersionInfoObjects(runtimeVersionInfoObjects: {
156
163
  platform: UpdatePublishPlatform;
157
- runtimeVersion: string;
158
- }[]): {
159
- runtimeVersion: string;
164
+ runtimeVersionInfo: RuntimeVersionInfo;
165
+ }[]): (RuntimeVersionInfo & {
160
166
  platforms: UpdatePublishPlatform[];
161
- }[];
167
+ })[];
162
168
  export declare const platformDisplayNames: Record<UpdatePublishPlatform, string>;
163
169
  export declare const updatePublishPlatformToAppPlatform: Record<UpdatePublishPlatform, AppPlatform>;
164
- export declare function getRuntimeToUpdateRolloutInfoGroupMappingAsync(graphqlClient: ExpoGraphqlClient, { appId, branchName, rolloutPercentage, runtimeToPlatformMapping, }: {
170
+ export declare function getRuntimeToUpdateRolloutInfoGroupMappingAsync(graphqlClient: ExpoGraphqlClient, { appId, branchName, rolloutPercentage, runtimeToPlatformsAndFingerprintInfoMapping, }: {
165
171
  appId: string;
166
172
  branchName: string;
167
173
  rolloutPercentage: number;
168
- runtimeToPlatformMapping: {
169
- runtimeVersion: string;
174
+ runtimeToPlatformsAndFingerprintInfoMapping: (RuntimeVersionInfo & {
170
175
  platforms: UpdatePublishPlatform[];
171
- }[];
176
+ })[];
172
177
  }): Promise<Map<string, UpdateRolloutInfoGroup>>;
173
178
  export {};
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getRuntimeToUpdateRolloutInfoGroupMappingAsync = exports.updatePublishPlatformToAppPlatform = exports.platformDisplayNames = exports.getRuntimeToPlatformMappingFromRuntimeVersions = exports.getRuntimeVersionObjectAsync = exports.defaultPublishPlatforms = exports.getUpdateMessageForCommandAsync = exports.getBranchNameForCommandAsync = exports.isUploadedAssetCountAboveWarningThreshold = exports.uploadAssetsAsync = exports.filterOutAssetsThatAlreadyExistAsync = exports.collectAssetsAsync = exports.getOriginalPathFromAssetMap = exports.getAssetHashFromPath = exports.loadAssetMapAsync = exports.filterCollectedAssetsByRequestedPlatforms = exports.generateEasMetadataAsync = exports.loadMetadata = exports.resolveInputDirectoryAsync = exports.buildBundlesAsync = exports.buildUnsortedUpdateInfoGroupAsync = exports.convertAssetToUpdateInfoGroupFormatAsync = exports.getStorageKeyForAssetAsync = exports.getStorageKey = exports.getBase64URLEncoding = exports.guessContentTypeFromExtension = exports.MetadataJoi = void 0;
3
+ exports.getRuntimeToUpdateRolloutInfoGroupMappingAsync = exports.updatePublishPlatformToAppPlatform = exports.platformDisplayNames = exports.getRuntimeToPlatformsAndFingerprintInfoMappingFromRuntimeVersionInfoObjects = exports.getRuntimeVersionInfoObjectsAsync = exports.defaultPublishPlatforms = exports.getUpdateMessageForCommandAsync = exports.getBranchNameForCommandAsync = exports.isUploadedAssetCountAboveWarningThreshold = exports.uploadAssetsAsync = exports.filterOutAssetsThatAlreadyExistAsync = exports.collectAssetsAsync = exports.getOriginalPathFromAssetMap = exports.getAssetHashFromPath = exports.loadAssetMapAsync = exports.filterCollectedAssetsByRequestedPlatforms = exports.generateEasMetadataAsync = exports.loadMetadata = exports.resolveInputDirectoryAsync = exports.buildBundlesAsync = exports.buildUnsortedUpdateInfoGroupAsync = exports.convertAssetToUpdateInfoGroupFormatAsync = exports.getStorageKeyForAssetAsync = exports.getStorageKey = exports.getBase64URLEncoding = exports.guessContentTypeFromExtension = exports.MetadataJoi = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const config_plugins_1 = require("@expo/config-plugins");
6
6
  const eas_build_job_1 = require("@expo/eas-build-job");
@@ -15,6 +15,7 @@ const nullthrows_1 = tslib_1.__importDefault(require("nullthrows"));
15
15
  const path_1 = tslib_1.__importDefault(require("path"));
16
16
  const promise_limit_1 = tslib_1.__importDefault(require("promise-limit"));
17
17
  const projectUtils_1 = require("./projectUtils");
18
+ const resolveRuntimeVersionAsync_1 = require("./resolveRuntimeVersionAsync");
18
19
  const queries_1 = require("../branch/queries");
19
20
  const utils_1 = require("../branch/utils");
20
21
  const generated_1 = require("../graphql/generated");
@@ -31,6 +32,7 @@ const expoCli_1 = require("../utils/expoCli");
31
32
  const expoUpdatesCli_1 = require("../utils/expoUpdatesCli");
32
33
  const chunk_1 = tslib_1.__importDefault(require("../utils/expodash/chunk"));
33
34
  const filter_1 = require("../utils/expodash/filter");
35
+ const groupBy_1 = tslib_1.__importDefault(require("../utils/expodash/groupBy"));
34
36
  const uniqBy_1 = tslib_1.__importDefault(require("../utils/expodash/uniqBy"));
35
37
  const fileMetadataJoi = joi_1.default.object({
36
38
  assets: joi_1.default.array()
@@ -455,11 +457,11 @@ async function getUpdateMessageForCommandAsync(vcsClient, { updateMessageArg, au
455
457
  }
456
458
  exports.getUpdateMessageForCommandAsync = getUpdateMessageForCommandAsync;
457
459
  exports.defaultPublishPlatforms = ['android', 'ios'];
458
- async function getRuntimeVersionObjectAsync({ exp, platforms, workflows, projectDir, env, }) {
460
+ async function getRuntimeVersionInfoObjectsAsync({ exp, platforms, workflows, projectDir, env, }) {
459
461
  return await Promise.all(platforms.map(async (platform) => {
460
462
  return {
461
463
  platform,
462
- runtimeVersion: await getRuntimeVersionForPlatformAsync({
464
+ runtimeVersionInfo: await getRuntimeVersionInfoForPlatformAsync({
463
465
  exp,
464
466
  platform,
465
467
  workflow: workflows[platform],
@@ -469,17 +471,20 @@ async function getRuntimeVersionObjectAsync({ exp, platforms, workflows, project
469
471
  };
470
472
  }));
471
473
  }
472
- exports.getRuntimeVersionObjectAsync = getRuntimeVersionObjectAsync;
473
- async function getRuntimeVersionForPlatformAsync({ exp, platform, workflow, projectDir, env, }) {
474
+ exports.getRuntimeVersionInfoObjectsAsync = getRuntimeVersionInfoObjectsAsync;
475
+ async function getRuntimeVersionInfoForPlatformAsync({ exp, platform, workflow, projectDir, env, }) {
474
476
  if (await (0, projectUtils_1.isModernExpoUpdatesCLIWithRuntimeVersionCommandSupportedAsync)(projectDir)) {
475
477
  try {
476
- log_1.default.debug('Using expo-updates runtimeversion:resolve CLI for runtime version resolution');
477
- const extraArgs = log_1.default.isDebug ? ['--debug'] : [];
478
- const resolvedRuntimeVersionJSONResult = await (0, expoUpdatesCli_1.expoUpdatesCommandAsync)(projectDir, ['runtimeversion:resolve', '--platform', platform, '--workflow', workflow, ...extraArgs], { env });
479
- const runtimeVersionResult = JSON.parse(resolvedRuntimeVersionJSONResult);
480
- log_1.default.debug('runtimeversion:resolve output:');
481
- log_1.default.debug(resolvedRuntimeVersionJSONResult);
482
- return (0, nullthrows_1.default)(runtimeVersionResult.runtimeVersion, `Unable to determine runtime version for ${platform_1.requestedPlatformDisplayNames[platform]}. ${(0, log_1.learnMore)('https://docs.expo.dev/eas-update/runtime-versions/')}`);
478
+ const runtimeVersionResult = await (0, resolveRuntimeVersionAsync_1.resolveRuntimeVersionUsingCLIAsync)({
479
+ platform,
480
+ workflow,
481
+ projectDir,
482
+ env,
483
+ });
484
+ return {
485
+ ...runtimeVersionResult,
486
+ runtimeVersion: (0, nullthrows_1.default)(runtimeVersionResult.runtimeVersion, `Unable to determine runtime version for ${platform_1.requestedPlatformDisplayNames[platform]}. ${(0, log_1.learnMore)('https://docs.expo.dev/eas-update/runtime-versions/')}`),
487
+ };
483
488
  }
484
489
  catch (e) {
485
490
  // if it's a known set of errors thrown by the CLI it means that we need to default back to the
@@ -499,21 +504,22 @@ async function getRuntimeVersionForPlatformAsync({ exp, platform, workflow, proj
499
504
  if (!resolvedRuntimeVersion) {
500
505
  throw new Error(`Unable to determine runtime version for ${platform_1.requestedPlatformDisplayNames[platform]}. ${(0, log_1.learnMore)('https://docs.expo.dev/eas-update/runtime-versions/')}`);
501
506
  }
502
- return resolvedRuntimeVersion;
507
+ return {
508
+ runtimeVersion: resolvedRuntimeVersion,
509
+ fingerprint: null,
510
+ };
503
511
  }
504
- function getRuntimeToPlatformMappingFromRuntimeVersions(runtimeVersions) {
505
- const runtimeToPlatformMapping = [];
506
- for (const runtime of runtimeVersions) {
507
- const platforms = runtimeVersions
508
- .filter(({ runtimeVersion }) => runtimeVersion === runtime.runtimeVersion)
509
- .map(({ platform }) => platform);
510
- if (!runtimeToPlatformMapping.find(item => item.runtimeVersion === runtime.runtimeVersion)) {
511
- runtimeToPlatformMapping.push({ runtimeVersion: runtime.runtimeVersion, platforms });
512
- }
513
- }
514
- return runtimeToPlatformMapping;
512
+ function getRuntimeToPlatformsAndFingerprintInfoMappingFromRuntimeVersionInfoObjects(runtimeVersionInfoObjects) {
513
+ const groupedRuntimeVersionInfoObjects = (0, groupBy_1.default)(runtimeVersionInfoObjects, runtimeVersionInfoObject => runtimeVersionInfoObject.runtimeVersionInfo.runtimeVersion);
514
+ return Object.entries(groupedRuntimeVersionInfoObjects).map(([runtimeVersion, runtimeVersionInfoObjects]) => {
515
+ return {
516
+ runtimeVersion,
517
+ platforms: runtimeVersionInfoObjects.map(runtimeVersionInfoObject => runtimeVersionInfoObject.platform),
518
+ fingerprint: runtimeVersionInfoObjects.map(runtimeVersionInfoObject => runtimeVersionInfoObject.runtimeVersionInfo.fingerprint)[0] ?? null,
519
+ };
520
+ });
515
521
  }
516
- exports.getRuntimeToPlatformMappingFromRuntimeVersions = getRuntimeToPlatformMappingFromRuntimeVersions;
522
+ exports.getRuntimeToPlatformsAndFingerprintInfoMappingFromRuntimeVersionInfoObjects = getRuntimeToPlatformsAndFingerprintInfoMappingFromRuntimeVersionInfoObjects;
517
523
  exports.platformDisplayNames = {
518
524
  android: 'Android',
519
525
  ios: 'iOS',
@@ -531,11 +537,8 @@ const mapMapAsync = async function (map, mapper) {
531
537
  }));
532
538
  return resultingMap;
533
539
  };
534
- async function getRuntimeToUpdateRolloutInfoGroupMappingAsync(graphqlClient, { appId, branchName, rolloutPercentage, runtimeToPlatformMapping, }) {
535
- const runtimeToPlatformsMap = new Map(runtimeToPlatformMapping.map(r => [
536
- r.runtimeVersion,
537
- r.platforms,
538
- ]));
540
+ async function getRuntimeToUpdateRolloutInfoGroupMappingAsync(graphqlClient, { appId, branchName, rolloutPercentage, runtimeToPlatformsAndFingerprintInfoMapping, }) {
541
+ const runtimeToPlatformsMap = new Map(runtimeToPlatformsAndFingerprintInfoMapping.map(r => [r.runtimeVersion, r.platforms]));
539
542
  return await mapMapAsync(runtimeToPlatformsMap, async (platforms, runtimeVersion) => {
540
543
  return Object.fromEntries(await Promise.all(platforms.map(async (platform) => {
541
544
  const updateIdForPlatform = await BranchQuery_1.BranchQuery.getLatestUpdateIdOnBranchAsync(graphqlClient, {
@@ -1,10 +1,17 @@
1
1
  import { ExpoConfig } from '@expo/config';
2
2
  import { Platform } from '@expo/eas-build-job';
3
3
  import { EasJson, EasJsonAccessor } from '@expo/eas-json';
4
+ import { BuildFlags } from '../build/types';
4
5
  import { ProfileData } from '../utils/profiles';
6
+ export declare enum AppVersionSourceUpdateOption {
7
+ SET_TO_REMOTE = 0,
8
+ SET_TO_LOCAL = 1,
9
+ ABORT = 2
10
+ }
5
11
  export declare function ensureVersionSourceIsRemoteAsync(easJsonAccessor: EasJsonAccessor, { nonInteractive }: {
6
12
  nonInteractive: boolean;
7
13
  }): Promise<void>;
8
- export declare function validateBuildProfileVersionSettings(profileInfo: ProfileData<'build'>, cliConfig: EasJson['cli']): void;
14
+ export declare function validateBuildProfileVersionSettingsAsync(profileInfo: ProfileData<'build'>, cliConfig: EasJson['cli'], projectDir: string, flags: BuildFlags): Promise<void>;
9
15
  export declare function validateAppConfigForRemoteVersionSource(exp: ExpoConfig, platform: Platform): void;
10
16
  export declare function getBuildVersionName(platform: Platform): string;
17
+ export declare function ensureAppVersionSourceIsSetAsync(easJsonAccessor: EasJsonAccessor, easJsonCliConfig: EasJson['cli'] | undefined, nonInteractive: boolean): Promise<EasJson['cli'] | undefined>;
@@ -1,14 +1,24 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getBuildVersionName = exports.validateAppConfigForRemoteVersionSource = exports.validateBuildProfileVersionSettings = exports.ensureVersionSourceIsRemoteAsync = void 0;
3
+ exports.ensureAppVersionSourceIsSetAsync = exports.getBuildVersionName = exports.validateAppConfigForRemoteVersionSource = exports.validateBuildProfileVersionSettingsAsync = exports.ensureVersionSourceIsRemoteAsync = exports.AppVersionSourceUpdateOption = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const eas_build_job_1 = require("@expo/eas-build-job");
6
6
  const eas_json_1 = require("@expo/eas-json");
7
+ const core_1 = require("@oclif/core");
7
8
  const chalk_1 = tslib_1.__importDefault(require("chalk"));
8
- const log_1 = tslib_1.__importDefault(require("../log"));
9
+ const log_1 = tslib_1.__importStar(require("../log"));
9
10
  const prompts_1 = require("../prompts");
11
+ var AppVersionSourceUpdateOption;
12
+ (function (AppVersionSourceUpdateOption) {
13
+ AppVersionSourceUpdateOption[AppVersionSourceUpdateOption["SET_TO_REMOTE"] = 0] = "SET_TO_REMOTE";
14
+ AppVersionSourceUpdateOption[AppVersionSourceUpdateOption["SET_TO_LOCAL"] = 1] = "SET_TO_LOCAL";
15
+ AppVersionSourceUpdateOption[AppVersionSourceUpdateOption["ABORT"] = 2] = "ABORT";
16
+ })(AppVersionSourceUpdateOption || (exports.AppVersionSourceUpdateOption = AppVersionSourceUpdateOption = {}));
10
17
  async function ensureVersionSourceIsRemoteAsync(easJsonAccessor, { nonInteractive }) {
11
- const easJsonCliConfig = await eas_json_1.EasJsonUtils.getCliConfigAsync(easJsonAccessor);
18
+ let easJsonCliConfig = await eas_json_1.EasJsonUtils.getCliConfigAsync(easJsonAccessor);
19
+ if (easJsonCliConfig?.appVersionSource === undefined) {
20
+ easJsonCliConfig = await ensureAppVersionSourceIsSetAsync(easJsonAccessor, easJsonCliConfig ?? undefined, nonInteractive);
21
+ }
12
22
  if (easJsonCliConfig?.appVersionSource === eas_json_1.AppVersionSource.REMOTE) {
13
23
  return;
14
24
  }
@@ -32,7 +42,17 @@ async function ensureVersionSourceIsRemoteAsync(easJsonAccessor, { nonInteractiv
32
42
  log_1.default.withTick('Updated eas.json');
33
43
  }
34
44
  exports.ensureVersionSourceIsRemoteAsync = ensureVersionSourceIsRemoteAsync;
35
- function validateBuildProfileVersionSettings(profileInfo, cliConfig) {
45
+ async function validateBuildProfileVersionSettingsAsync(profileInfo, cliConfig, projectDir, flags) {
46
+ if (cliConfig?.appVersionSource === undefined &&
47
+ profileInfo.profile.autoIncrement !== 'version') {
48
+ if (profileInfo.profile.autoIncrement !== true) {
49
+ log_1.default.warn(`The field "cli.appVersionSource" is not set, but it will be required in the future. ${(0, log_1.learnMore)('https://docs.expo.dev/build-reference/app-versions/')}`);
50
+ }
51
+ else {
52
+ const easJsonAccessor = eas_json_1.EasJsonAccessor.fromProjectPath(projectDir);
53
+ cliConfig = await ensureAppVersionSourceIsSetAsync(easJsonAccessor, cliConfig, flags.nonInteractive);
54
+ }
55
+ }
36
56
  if (cliConfig?.appVersionSource !== eas_json_1.AppVersionSource.REMOTE) {
37
57
  return;
38
58
  }
@@ -40,7 +60,7 @@ function validateBuildProfileVersionSettings(profileInfo, cliConfig) {
40
60
  throw new Error(`${chalk_1.default.bold('{"autoIncrement": "version"}')} is not supported when app version source is set to remote.`);
41
61
  }
42
62
  }
43
- exports.validateBuildProfileVersionSettings = validateBuildProfileVersionSettings;
63
+ exports.validateBuildProfileVersionSettingsAsync = validateBuildProfileVersionSettingsAsync;
44
64
  function validateAppConfigForRemoteVersionSource(exp, platform) {
45
65
  if (typeof exp.runtimeVersion === 'object' && exp.runtimeVersion?.policy === 'nativeVersion') {
46
66
  throw new Error(`${chalk_1.default.bold('nativeVersion')} policy for ${chalk_1.default.bold('runtimeVersion')} is currently not supported when version source is set to remote. Switch policy e.g. to ${chalk_1.default.bold('appVersion')} or define version explicitly.`);
@@ -62,3 +82,72 @@ function getBuildVersionName(platform) {
62
82
  }
63
83
  }
64
84
  exports.getBuildVersionName = getBuildVersionName;
85
+ async function ensureAppVersionSourceIsSetAsync(easJsonAccessor, easJsonCliConfig, nonInteractive) {
86
+ let selectOption, updateEasJson;
87
+ if (nonInteractive) {
88
+ log_1.default.warn(`The field "cli.appVersionSource" is not set, but it will be required in the future Proceeding with the default "local" value. ${(0, log_1.learnMore)('https://docs.expo.dev/build-reference/app-versions/')}`);
89
+ selectOption = AppVersionSourceUpdateOption.SET_TO_LOCAL;
90
+ updateEasJson = false;
91
+ }
92
+ else {
93
+ log_1.default.log('Since EAS CLI version `12.0.0` explicitly specifying app version source is required. Please select your app version source:');
94
+ log_1.default.log(`\t1) With the "local" app version source and "autoIncrement" option enabled, the build number/version code is sourced from local project files and incremented automatically if possible, by editing local project files. ${(0, log_1.learnMore)('https://docs.expo.dev/build-reference/app-versions/#local-version-source')}`);
95
+ log_1.default.log(`\t2) With the "remote" app version source and "autoIncrement" option enabled, the build number/version code is stored on EAS servers and updated every time you create a new build. Remote auto-incrementation won't edit the version in the local project files, but instead, the new version will be injected automatically during the build process. ${(0, log_1.learnMore)('https://docs.expo.dev/build-reference/app-versions/#remote-version-source')}`);
96
+ log_1.default.log(`Until now, this project has been using the "local" version source (which was the previous default). App version source can now be set for you automatically, or you can configure it manually by setting the "appVersionSource" value in your eas.json.`);
97
+ selectOption = await (0, prompts_1.selectAsync)(`What would you like to do?`, [
98
+ {
99
+ title: 'Update eas.json to use the default "remote" version source (recommended)',
100
+ value: AppVersionSourceUpdateOption.SET_TO_REMOTE,
101
+ },
102
+ {
103
+ title: 'Update eas.json to use "local" version source (old behavior)',
104
+ value: AppVersionSourceUpdateOption.SET_TO_LOCAL,
105
+ },
106
+ {
107
+ title: "Don't update eas.json, abort command and configure manually",
108
+ value: AppVersionSourceUpdateOption.ABORT,
109
+ },
110
+ ]);
111
+ updateEasJson = true;
112
+ }
113
+ if (selectOption === AppVersionSourceUpdateOption.SET_TO_LOCAL) {
114
+ if (updateEasJson) {
115
+ await easJsonAccessor.readRawJsonAsync();
116
+ easJsonAccessor.patch(easJsonRawObject => {
117
+ easJsonRawObject.cli = {
118
+ ...easJsonRawObject?.cli,
119
+ appVersionSource: eas_json_1.AppVersionSource.LOCAL,
120
+ };
121
+ return easJsonRawObject;
122
+ });
123
+ await easJsonAccessor.writeAsync();
124
+ }
125
+ if (easJsonCliConfig) {
126
+ easJsonCliConfig.appVersionSource = eas_json_1.AppVersionSource.LOCAL;
127
+ }
128
+ log_1.default.withTick('Updated eas.json');
129
+ }
130
+ else if (selectOption === AppVersionSourceUpdateOption.SET_TO_REMOTE) {
131
+ if (updateEasJson) {
132
+ await easJsonAccessor.readRawJsonAsync();
133
+ easJsonAccessor.patch(easJsonRawObject => {
134
+ easJsonRawObject.cli = {
135
+ ...easJsonRawObject?.cli,
136
+ appVersionSource: eas_json_1.AppVersionSource.REMOTE,
137
+ };
138
+ return easJsonRawObject;
139
+ });
140
+ await easJsonAccessor.writeAsync();
141
+ }
142
+ if (easJsonCliConfig) {
143
+ easJsonCliConfig.appVersionSource = eas_json_1.AppVersionSource.REMOTE;
144
+ }
145
+ log_1.default.withTick('Updated eas.json');
146
+ }
147
+ else {
148
+ log_1.default.warn(`You'll need to configure ${chalk_1.default.bold('appVersionSource')} manually. ${(0, log_1.learnMore)('https://docs.expo.dev/build-reference/app-versions/')}`);
149
+ core_1.Errors.error('Aborted.', { exit: 1 });
150
+ }
151
+ return easJsonCliConfig;
152
+ }
153
+ exports.ensureAppVersionSourceIsSetAsync = ensureAppVersionSourceIsSetAsync;
@@ -1,5 +1,18 @@
1
1
  import { ExpoConfig } from '@expo/config';
2
2
  import { Env, Workflow } from '@expo/eas-build-job';
3
+ export declare function resolveRuntimeVersionUsingCLIAsync({ platform, workflow, projectDir, env, cwd, }: {
4
+ platform: 'ios' | 'android';
5
+ workflow: Workflow;
6
+ projectDir: string;
7
+ env: Env | undefined;
8
+ cwd?: string;
9
+ }): Promise<{
10
+ runtimeVersion: string | null;
11
+ fingerprint: {
12
+ fingerprintSources: object[];
13
+ isDebugFingerprintSource: boolean;
14
+ } | null;
15
+ }>;
3
16
  export declare function resolveRuntimeVersionAsync({ exp, platform, workflow, projectDir, env, cwd, }: {
4
17
  exp: ExpoConfig;
5
18
  platform: 'ios' | 'android';
@@ -1,11 +1,30 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.resolveRuntimeVersionAsync = void 0;
3
+ exports.resolveRuntimeVersionAsync = exports.resolveRuntimeVersionUsingCLIAsync = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const config_plugins_1 = require("@expo/config-plugins");
6
6
  const projectUtils_1 = require("./projectUtils");
7
7
  const log_1 = tslib_1.__importDefault(require("../log"));
8
8
  const expoUpdatesCli_1 = require("../utils/expoUpdatesCli");
9
+ async function resolveRuntimeVersionUsingCLIAsync({ platform, workflow, projectDir, env, cwd, }) {
10
+ log_1.default.debug('Using expo-updates runtimeversion:resolve CLI for runtime version resolution');
11
+ const useDebugFingerprintSource = log_1.default.isDebug;
12
+ const extraArgs = useDebugFingerprintSource ? ['--debug'] : [];
13
+ const resolvedRuntimeVersionJSONResult = await (0, expoUpdatesCli_1.expoUpdatesCommandAsync)(projectDir, ['runtimeversion:resolve', '--platform', platform, '--workflow', workflow, ...extraArgs], { env, cwd });
14
+ const runtimeVersionResult = JSON.parse(resolvedRuntimeVersionJSONResult);
15
+ log_1.default.debug('runtimeversion:resolve output:');
16
+ log_1.default.debug(resolvedRuntimeVersionJSONResult);
17
+ return {
18
+ runtimeVersion: runtimeVersionResult.runtimeVersion ?? null,
19
+ fingerprint: runtimeVersionResult.fingerprintSources
20
+ ? {
21
+ fingerprintSources: runtimeVersionResult.fingerprintSources,
22
+ isDebugFingerprintSource: useDebugFingerprintSource,
23
+ }
24
+ : null,
25
+ };
26
+ }
27
+ exports.resolveRuntimeVersionUsingCLIAsync = resolveRuntimeVersionUsingCLIAsync;
9
28
  async function resolveRuntimeVersionAsync({ exp, platform, workflow, projectDir, env, cwd, }) {
10
29
  if (!(await (0, projectUtils_1.isModernExpoUpdatesCLIWithRuntimeVersionCommandSupportedAsync)(projectDir))) {
11
30
  // fall back to the previous behavior (using the @expo/config-plugins eas-cli dependency rather
@@ -16,22 +35,7 @@ async function resolveRuntimeVersionAsync({ exp, platform, workflow, projectDir,
16
35
  };
17
36
  }
18
37
  try {
19
- log_1.default.debug('Using expo-updates runtimeversion:resolve CLI for runtime version resolution');
20
- const useDebugFingerprintSource = log_1.default.isDebug;
21
- const extraArgs = useDebugFingerprintSource ? ['--debug'] : [];
22
- const resolvedRuntimeVersionJSONResult = await (0, expoUpdatesCli_1.expoUpdatesCommandAsync)(projectDir, ['runtimeversion:resolve', '--platform', platform, '--workflow', workflow, ...extraArgs], { env, cwd });
23
- const runtimeVersionResult = JSON.parse(resolvedRuntimeVersionJSONResult);
24
- log_1.default.debug('runtimeversion:resolve output:');
25
- log_1.default.debug(resolvedRuntimeVersionJSONResult);
26
- return {
27
- runtimeVersion: runtimeVersionResult.runtimeVersion ?? null,
28
- fingerprint: runtimeVersionResult.fingerprintSources
29
- ? {
30
- fingerprintSources: runtimeVersionResult.fingerprintSources,
31
- isDebugFingerprintSource: useDebugFingerprintSource,
32
- }
33
- : null,
34
- };
38
+ return await resolveRuntimeVersionUsingCLIAsync({ platform, workflow, projectDir, env, cwd });
35
39
  }
36
40
  catch (e) {
37
41
  // if expo-updates is not installed, there's no need for a runtime version in the build
@@ -0,0 +1,25 @@
1
+ /// <reference types="node" />
2
+ /// <reference types="node" />
3
+ import { GzipOptions } from 'minizlib';
4
+ import { HashOptions } from 'node:crypto';
5
+ interface AssetMapOptions {
6
+ hashOptions?: HashOptions;
7
+ }
8
+ /** Mapping of normalized file paths to a SHA512 hash */
9
+ export type AssetMap = Record<string, string>;
10
+ /** Creates an asset map of a given target path */
11
+ declare function createAssetMapAsync(assetPath: string, options?: AssetMapOptions): Promise<AssetMap>;
12
+ interface WorkerFileEntry {
13
+ normalizedPath: string;
14
+ path: string;
15
+ data: Buffer | string;
16
+ }
17
+ /** Reads worker files while normalizing sourcemaps and providing normalized paths */
18
+ declare function listWorkerFilesAsync(workerPath: string): AsyncGenerator<WorkerFileEntry>;
19
+ /** Reads files of an asset maps and enumerates normalized paths and data */
20
+ declare function listAssetMapFilesAsync(assetPath: string, assetMap: AssetMap): AsyncGenerator<WorkerFileEntry>;
21
+ /** Entry of a normalized (gzip-safe) path and file data */
22
+ export type FileEntry = readonly [normalizedPath: string, data: Buffer | string];
23
+ /** Packs file entries into a tar.gz file (path to tgz returned) */
24
+ declare function packFilesIterableAsync(iterable: Iterable<FileEntry> | AsyncIterable<FileEntry>, options?: GzipOptions): Promise<string>;
25
+ export { createAssetMapAsync, listWorkerFilesAsync, listAssetMapFilesAsync, packFilesIterableAsync, };