eas-cli 16.26.0 → 16.28.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.
@@ -3,6 +3,14 @@ import { AppPlatform, BranchesBasicPaginatedOnAppQuery, BranchesBasicPaginatedOn
3
3
  export type UpdateBranchOnChannelObject = NonNullable<ViewBranchesOnUpdateChannelQuery['app']['byId']['updateChannelByName']>['updateBranches'][number];
4
4
  export declare const BranchQuery: {
5
5
  getBranchByNameAsync(graphqlClient: ExpoGraphqlClient, { appId, name }: ViewBranchQueryVariables): Promise<UpdateBranchBasicInfoFragment>;
6
+ getUpdateIdsOnBranchAsync(graphqlClient: ExpoGraphqlClient, { appId, branchName, platform, runtimeVersion, offset, limit, }: {
7
+ appId: string;
8
+ branchName: string;
9
+ platform: AppPlatform;
10
+ runtimeVersion: string;
11
+ offset?: number | undefined;
12
+ limit?: number | undefined;
13
+ }): Promise<string[]>;
6
14
  getLatestUpdateIdOnBranchAsync(graphqlClient: ExpoGraphqlClient, { appId, branchName, platform, runtimeVersion, }: {
7
15
  appId: string;
8
16
  branchName: string;
@@ -36,7 +36,7 @@ exports.BranchQuery = {
36
36
  }
37
37
  return updateBranchByName;
38
38
  },
39
- async getLatestUpdateIdOnBranchAsync(graphqlClient, { appId, branchName, platform, runtimeVersion, }) {
39
+ async getUpdateIdsOnBranchAsync(graphqlClient, { appId, branchName, platform, runtimeVersion, offset = 0, limit = 1, }) {
40
40
  const response = await (0, client_1.withErrorHandlingAsync)(graphqlClient
41
41
  .query((0, graphql_tag_1.default) `
42
42
  query ViewLatestUpdateOnBranch(
@@ -44,6 +44,8 @@ exports.BranchQuery = {
44
44
  $branchName: String!
45
45
  $platform: AppPlatform!
46
46
  $runtimeVersion: String!
47
+ $offset: Int!
48
+ $limit: Int!
47
49
  ) {
48
50
  app {
49
51
  byId(appId: $appId) {
@@ -51,8 +53,8 @@ exports.BranchQuery = {
51
53
  updateBranchByName(name: $branchName) {
52
54
  id
53
55
  updates(
54
- offset: 0
55
- limit: 1
56
+ offset: $offset
57
+ limit: $limit
56
58
  filter: { platform: $platform, runtimeVersions: [$runtimeVersion] }
57
59
  ) {
58
60
  id
@@ -66,17 +68,26 @@ exports.BranchQuery = {
66
68
  branchName,
67
69
  platform,
68
70
  runtimeVersion,
71
+ offset,
72
+ limit,
69
73
  }, { additionalTypenames: ['UpdateBranch'] })
70
74
  .toPromise());
71
75
  const { updateBranchByName } = response.app.byId;
72
76
  if (!updateBranchByName) {
73
77
  throw new utils_1.BranchNotFoundError(`Could not find a branch named "${branchName}".`);
74
78
  }
75
- const latestUpdate = updateBranchByName.updates[0];
76
- if (!latestUpdate) {
77
- return null;
78
- }
79
- return latestUpdate.id;
79
+ return updateBranchByName.updates.map(update => update.id);
80
+ },
81
+ async getLatestUpdateIdOnBranchAsync(graphqlClient, { appId, branchName, platform, runtimeVersion, }) {
82
+ const updateIds = await this.getUpdateIdsOnBranchAsync(graphqlClient, {
83
+ appId,
84
+ branchName,
85
+ platform,
86
+ runtimeVersion,
87
+ offset: 0,
88
+ limit: 1,
89
+ });
90
+ return updateIds[0] ?? null;
80
91
  },
81
92
  async listBranchesOnAppAsync(graphqlClient, { appId, limit, offset }) {
82
93
  const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
@@ -4,11 +4,10 @@ import { Env, Platform, Workflow } from '@expo/eas-build-job';
4
4
  import Joi from 'joi';
5
5
  import { ExpoGraphqlClient } from '../commandUtils/context/contextUtils/createGraphqlClient';
6
6
  import { PaginatedQueryOptions } from '../commandUtils/pagination';
7
- import { AppPlatform, BuildFragment, FingerprintSourceInput, PartialManifestAsset, UpdateRolloutInfoGroup } from '../graphql/generated';
7
+ import { BuildFragment, FingerprintSourceInput, PartialManifestAsset, UpdateRolloutInfoGroup } from '../graphql/generated';
8
8
  import { RequestedPlatform } from '../platform';
9
- import { UpdateJsonInfo } from '../update/utils';
9
+ import { UpdateJsonInfo, UpdatePublishPlatform } from '../update/utils';
10
10
  import { Client } from '../vcs/vcs';
11
- export type UpdatePublishPlatform = 'ios' | 'android';
12
11
  type Metadata = {
13
12
  version: number;
14
13
  bundler: 'metro';
@@ -203,7 +202,6 @@ export declare function findCompatibleBuildsAsync(graphqlClient: ExpoGraphqlClie
203
202
  };
204
203
  }>;
205
204
  export declare const platformDisplayNames: Record<UpdatePublishPlatform, string>;
206
- export declare const updatePublishPlatformToAppPlatform: Record<UpdatePublishPlatform, AppPlatform>;
207
205
  export declare function getRuntimeToUpdateRolloutInfoGroupMappingAsync(graphqlClient: ExpoGraphqlClient, { appId, branchName, rolloutPercentage, runtimeToPlatformsAndFingerprintInfoMapping, }: {
208
206
  appId: string;
209
207
  branchName: string;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getUpdateRolloutInfoGroupAsync = exports.getRuntimeToUpdateRolloutInfoGroupMappingAsync = exports.updatePublishPlatformToAppPlatform = exports.platformDisplayNames = exports.findCompatibleBuildsAsync = exports.maybeCalculateFingerprintForRuntimeVersionInfoObjectsWithoutExpoUpdatesAsync = exports.getRuntimeToPlatformsAndFingerprintInfoMappingFromRuntimeVersionInfoObjects = exports.getRuntimeVersionInfoObjectsAsync = exports.defaultPublishPlatforms = exports.getUpdateMessageForCommandAsync = exports.getBranchNameForCommandAsync = exports.isUploadedAssetCountAboveWarningThreshold = exports.uploadAssetsAsync = exports.filterOutAssetsThatAlreadyExistAsync = exports.collectAssetsAsync = exports.getOriginalPathFromAssetMap = exports.getAssetHashFromPath = 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.getUpdateRolloutInfoGroupAsync = exports.getRuntimeToUpdateRolloutInfoGroupMappingAsync = exports.platformDisplayNames = exports.findCompatibleBuildsAsync = exports.maybeCalculateFingerprintForRuntimeVersionInfoObjectsWithoutExpoUpdatesAsync = exports.getRuntimeToPlatformsAndFingerprintInfoMappingFromRuntimeVersionInfoObjects = exports.getRuntimeVersionInfoObjectsAsync = exports.defaultPublishPlatforms = exports.getUpdateMessageForCommandAsync = exports.getBranchNameForCommandAsync = exports.isUploadedAssetCountAboveWarningThreshold = exports.uploadAssetsAsync = exports.filterOutAssetsThatAlreadyExistAsync = exports.collectAssetsAsync = exports.getOriginalPathFromAssetMap = exports.getAssetHashFromPath = 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");
@@ -626,10 +626,6 @@ exports.platformDisplayNames = {
626
626
  android: 'Android',
627
627
  ios: 'iOS',
628
628
  };
629
- exports.updatePublishPlatformToAppPlatform = {
630
- android: generated_1.AppPlatform.Android,
631
- ios: generated_1.AppPlatform.Ios,
632
- };
633
629
  async function getRuntimeToUpdateRolloutInfoGroupMappingAsync(graphqlClient, { appId, branchName, rolloutPercentage, runtimeToPlatformsAndFingerprintInfoMapping, }) {
634
630
  const runtimeToPlatformsMap = new Map(runtimeToPlatformsAndFingerprintInfoMapping.map(r => [r.runtimeVersion, r.platforms]));
635
631
  return await (0, mapMapAsync_1.default)(runtimeToPlatformsMap, async (platforms, runtimeVersion) => {
@@ -650,7 +646,7 @@ async function getUpdateRolloutInfoGroupAsync(graphqlClient, { appId, branchName
650
646
  appId,
651
647
  branchName,
652
648
  runtimeVersion,
653
- platform: exports.updatePublishPlatformToAppPlatform[platform],
649
+ platform: utils_2.updatePublishPlatformToAppPlatform[platform],
654
650
  });
655
651
  return [platform, { rolloutPercentage, rolloutControlUpdateId: updateIdForPlatform }];
656
652
  })));
@@ -1,7 +1,7 @@
1
+ import { UpdatePublishPlatform } from './utils';
1
2
  import { ExpoGraphqlClient } from '../commandUtils/context/contextUtils/createGraphqlClient';
2
3
  import { PaginatedQueryOptions } from '../commandUtils/pagination';
3
4
  import { RuntimeFragment, UpdateFragment } from '../graphql/generated';
4
- import { UpdatePublishPlatform } from '../project/publish';
5
5
  export declare const UPDATES_LIMIT = 50;
6
6
  export declare const UPDATE_GROUPS_LIMIT = 25;
7
7
  export declare const RUNTIME_VERSIONS_LIMIT = 25;
@@ -1,7 +1,7 @@
1
1
  import { ExpoConfig } from '@expo/config';
2
+ import { UpdatePublishPlatform } from './utils';
2
3
  import { ExpoGraphqlClient } from '../commandUtils/context/contextUtils/createGraphqlClient';
3
4
  import { UpdateFragment } from '../graphql/generated';
4
- import { UpdatePublishPlatform } from '../project/publish';
5
5
  import { CodeSigningInfo } from '../utils/code-signing';
6
6
  export type UpdateToRepublish = {
7
7
  groupId: string;
@@ -1,6 +1,6 @@
1
1
  import { ExpoConfig } from '@expo/config';
2
+ import { UpdatePublishPlatform } from './utils';
2
3
  import { ExpoGraphqlClient } from '../commandUtils/context/contextUtils/createGraphqlClient';
3
- import { UpdatePublishPlatform } from '../project/publish';
4
4
  import { CodeSigningInfo } from '../utils/code-signing';
5
5
  export declare function publishRollBackToEmbeddedUpdateAsync({ graphqlClient, projectId, exp, updateMessage, branch, codeSigningInfo, platforms, runtimeVersion, json, }: {
6
6
  graphqlClient: ExpoGraphqlClient;
@@ -1,5 +1,6 @@
1
1
  import { ExpoConfig } from '@expo/config';
2
- import { Robot, SsoUser, Update, UpdateBranchFragment, UpdateFragment, User } from '../graphql/generated';
2
+ import { ExpoGraphqlClient } from '../commandUtils/context/contextUtils/createGraphqlClient';
3
+ import { AppPlatform, Robot, SsoUser, Update, UpdateBranchFragment, UpdateFragment, UpdatePublishMutation, User } from '../graphql/generated';
3
4
  import { RequestedPlatform } from '../platform';
4
5
  export type FormatUpdateParameter = Pick<Update, 'id' | 'createdAt' | 'message'> & {
5
6
  actor?: Pick<Robot, '__typename' | 'firstName'> | Pick<User, '__typename' | 'username'> | Pick<SsoUser, '__typename' | 'username'> | null;
@@ -53,3 +54,7 @@ export declare function getUpdateJsonInfosForUpdates(updates: UpdateFragment[]):
53
54
  export declare function getUpdateGroupDescriptions(updateGroups: UpdateFragment[][]): FormattedUpdateGroupDescription[];
54
55
  export declare function getUpdateGroupDescriptionsWithBranch(updateGroups: UpdateFragment[][]): FormattedUpdateGroupDescriptionWithBranch[];
55
56
  export declare function getBranchDescription(branch: UpdateBranchFragment): FormattedBranchDescription;
57
+ export declare function isBundleDiffingEnabled(exp: ExpoConfig): boolean;
58
+ export declare function prewarmDiffingAsync(graphqlClient: ExpoGraphqlClient, appId: string, newUpdates: UpdatePublishMutation['updateBranch']['publishUpdateGroups']): Promise<void>;
59
+ export type UpdatePublishPlatform = 'ios' | 'android';
60
+ export declare const updatePublishPlatformToAppPlatform: Record<UpdatePublishPlatform, AppPlatform>;
@@ -1,10 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getBranchDescription = exports.getUpdateGroupDescriptionsWithBranch = exports.getUpdateGroupDescriptions = exports.getUpdateJsonInfosForUpdates = exports.formatUpdateTitle = exports.ensureValidVersions = exports.formatUpdateMessage = exports.truncateString = exports.formatPlatformForUpdateGroup = exports.getPlatformsForGroup = exports.formatBranch = exports.formatUpdateGroup = exports.UPDATE_COLUMNS_WITH_BRANCH = exports.UPDATE_COLUMNS = void 0;
3
+ exports.updatePublishPlatformToAppPlatform = exports.prewarmDiffingAsync = exports.isBundleDiffingEnabled = exports.getBranchDescription = exports.getUpdateGroupDescriptionsWithBranch = exports.getUpdateGroupDescriptions = exports.getUpdateJsonInfosForUpdates = exports.formatUpdateTitle = exports.ensureValidVersions = exports.formatUpdateMessage = exports.truncateString = exports.formatPlatformForUpdateGroup = exports.getPlatformsForGroup = exports.formatBranch = exports.formatUpdateGroup = exports.UPDATE_COLUMNS_WITH_BRANCH = exports.UPDATE_COLUMNS = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const timeago_js_1 = require("@expo/timeago.js");
6
6
  const chalk_1 = tslib_1.__importDefault(require("chalk"));
7
7
  const dateformat_1 = tslib_1.__importDefault(require("dateformat"));
8
+ const generated_1 = require("../graphql/generated");
9
+ const AssetQuery_1 = require("../graphql/queries/AssetQuery");
10
+ const BranchQuery_1 = require("../graphql/queries/BranchQuery");
8
11
  const log_1 = require("../log");
9
12
  const platform_1 = require("../platform");
10
13
  const User_1 = require("../user/User");
@@ -172,3 +175,68 @@ function getBranchDescription(branch) {
172
175
  };
173
176
  }
174
177
  exports.getBranchDescription = getBranchDescription;
178
+ function isBundleDiffingEnabled(exp) {
179
+ return exp.updates?.enableBsdiffPatchSupport === true;
180
+ }
181
+ exports.isBundleDiffingEnabled = isBundleDiffingEnabled;
182
+ // Make authenticated requests to the launch asset URL with diffing headers
183
+ async function prewarmDiffingAsync(graphqlClient, appId, newUpdates) {
184
+ const DUMMY_EMBEDDED_UPDATE_ID = '00000000-0000-0000-0000-000000000000';
185
+ const toPrewarm = [];
186
+ for (const update of newUpdates) {
187
+ const manifest = JSON.parse(update.manifestFragment);
188
+ const launchAssetKey = manifest.launchAsset?.storageKey;
189
+ const requestedUpdateId = update.id;
190
+ if (!launchAssetKey || !requestedUpdateId) {
191
+ continue;
192
+ }
193
+ toPrewarm.push({
194
+ update,
195
+ launchAssetKey,
196
+ });
197
+ }
198
+ await Promise.allSettled(toPrewarm.map(async ({ update, launchAssetKey }) => {
199
+ try {
200
+ // Check to see if there's a second most recent update so we can pre-emptively generate a patch for it
201
+ const updatePublishPlatform = update.platform;
202
+ const updateIds = await BranchQuery_1.BranchQuery.getUpdateIdsOnBranchAsync(graphqlClient, {
203
+ appId,
204
+ branchName: update.branch.name,
205
+ platform: exports.updatePublishPlatformToAppPlatform[updatePublishPlatform],
206
+ runtimeVersion: update.runtimeVersion,
207
+ limit: 2,
208
+ });
209
+ if (updateIds.length !== 2) {
210
+ return;
211
+ }
212
+ const nextMostRecentUpdateId = updateIds[1];
213
+ const signed = await AssetQuery_1.AssetQuery.getSignedUrlsAsync(graphqlClient, update.id, [
214
+ launchAssetKey,
215
+ ]);
216
+ const first = signed?.[0];
217
+ if (!first) {
218
+ return;
219
+ }
220
+ const headers = {
221
+ ...first.headers,
222
+ 'expo-current-update-id': nextMostRecentUpdateId,
223
+ 'expo-requested-update-id': update.id,
224
+ 'expo-embedded-update-id': DUMMY_EMBEDDED_UPDATE_ID,
225
+ 'a-im': 'bsdiff',
226
+ };
227
+ await fetch(first.url, {
228
+ method: 'HEAD',
229
+ headers,
230
+ signal: AbortSignal.timeout(2500),
231
+ });
232
+ }
233
+ catch {
234
+ // ignore errors, best-effort optimization
235
+ }
236
+ }));
237
+ }
238
+ exports.prewarmDiffingAsync = prewarmDiffingAsync;
239
+ exports.updatePublishPlatformToAppPlatform = {
240
+ android: generated_1.AppPlatform.Android,
241
+ ios: generated_1.AppPlatform.Ios,
242
+ };
@@ -54,6 +54,5 @@ function displayOverageWarning({ percentUsed, hasFreePlan, name, }) {
54
54
  dim: false,
55
55
  });
56
56
  log_1.default.warn(warning);
57
- log_1.default.newLine();
58
57
  }
59
58
  exports.displayOverageWarning = displayOverageWarning;
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "16.26.0",
2
+ "version": "16.28.0",
3
3
  "commands": {
4
4
  "analytics": {
5
5
  "id": "analytics",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "eas-cli",
3
3
  "description": "EAS command line tool",
4
- "version": "16.26.0",
4
+ "version": "16.28.0",
5
5
  "author": "Expo <support@expo.dev>",
6
6
  "bin": {
7
7
  "eas": "./bin/run"
@@ -226,11 +226,12 @@
226
226
  "prepack": "yarn rebuild && node ./scripts/prepack.js",
227
227
  "rebuild": "rimraf build && yarn build",
228
228
  "pretarball-ci": "./scripts/pretarball-ci.sh",
229
- "build": "tsc --project tsconfig.build.json && yarn copy-new-templates",
229
+ "build": "yarn typecheck-for-build && yarn copy-new-templates",
230
230
  "build-allow-unused": "tsc --project tsconfig.allowUnused.json",
231
- "watch": "yarn build --watch --preserveWatchOutput",
231
+ "watch": "yarn typecheck-for-build --watch --preserveWatchOutput",
232
232
  "watch-allow-unused": "yarn build-allow-unused --watch --preserveWatchOutput",
233
233
  "typecheck": "tsc",
234
+ "typecheck-for-build": "tsc --project tsconfig.build.json",
234
235
  "test": "jest",
235
236
  "version": "yarn oclif readme && node scripts/patch-readme && git add README.md",
236
237
  "generate-graphql-code": "graphql-codegen --config graphql-codegen.yml",
@@ -242,5 +243,5 @@
242
243
  "node": "20.11.0",
243
244
  "yarn": "1.22.21"
244
245
  },
245
- "gitHead": "dc62d228167d89bc0bfc9cdbd915571072a425e0"
246
+ "gitHead": "18ecd0844ac4acbdfb5e4576b5b95f29f9277ae9"
246
247
  }