eas-cli 16.26.0 → 16.27.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.
@@ -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
+ };
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "16.26.0",
2
+ "version": "16.27.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.27.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": "ed8170047b9250e228495dda15d37b5a038e0aa2"
246
247
  }