@expo/build-tools 22.2.0 → 22.4.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 (35) hide show
  1. package/dist/builders/android.js +2 -2
  2. package/dist/builders/ios.js +2 -2
  3. package/dist/ios/xcode.d.ts +3 -0
  4. package/dist/ios/xcode.js +22 -0
  5. package/dist/steps/easFunctions.js +4 -0
  6. package/dist/steps/functions/downloadBuild.d.ts +9 -2
  7. package/dist/steps/functions/downloadBuild.js +108 -15
  8. package/dist/steps/functions/installBuild.d.ts +12 -0
  9. package/dist/steps/functions/installBuild.js +85 -0
  10. package/dist/steps/functions/installMaestro.js +92 -11
  11. package/dist/steps/functions/launchApplication.d.ts +12 -0
  12. package/dist/steps/functions/launchApplication.js +121 -0
  13. package/dist/steps/functions/readIpaInfo.d.ts +1 -0
  14. package/dist/steps/functions/readIpaInfo.js +2 -0
  15. package/dist/steps/functions/repack.d.ts +5 -2
  16. package/dist/steps/functions/repack.js +50 -2
  17. package/dist/steps/functions/restoreBuildCache.d.ts +3 -3
  18. package/dist/steps/functions/restoreBuildCache.js +19 -6
  19. package/dist/steps/functions/saveBuildCache.d.ts +3 -3
  20. package/dist/steps/functions/saveBuildCache.js +17 -4
  21. package/dist/steps/functions/startServeSimRemoteSession.js +7 -0
  22. package/dist/steps/functions/uploadToAsc.js +11 -1
  23. package/dist/steps/utils/ios/AscApiClient.d.ts +1 -0
  24. package/dist/steps/utils/ios/AscApiUtils.d.ts +11 -2
  25. package/dist/steps/utils/ios/AscApiUtils.js +36 -2
  26. package/dist/steps/utils/ios/xcactivitylog.js +2 -8
  27. package/dist/steps/utils/remoteDeviceRunSession.d.ts +4 -2
  28. package/dist/steps/utils/remoteDeviceRunSession.js +9 -6
  29. package/dist/utils/IosSimulatorUtils.d.ts +8 -0
  30. package/dist/utils/IosSimulatorUtils.js +9 -0
  31. package/dist/utils/cacheKey.d.ts +8 -2
  32. package/dist/utils/cacheKey.js +12 -8
  33. package/dist/utils/download.d.ts +4 -0
  34. package/dist/utils/download.js +10 -0
  35. package/package.json +6 -4
@@ -69,7 +69,7 @@ const sentry_1 = require("../../sentry");
69
69
  const retry_1 = require("../../utils/retry");
70
70
  const turtleFetch_1 = require("../../utils/turtleFetch");
71
71
  const XCODE_DEVELOPER_DIR = '/Applications/Xcode.app/Contents/Developer';
72
- const SERVE_SIM_PACKAGE_SPEC = '@expo/serve-sim@latest';
72
+ const SERVE_SIM_PACKAGE_NAME = '@expo/serve-sim';
73
73
  const SERVE_SIM_HOST = '127.0.0.1';
74
74
  const SERVE_SIM_MAX_DIMENSION = '1280';
75
75
  const SERVE_SIM_MJPEG_QUALITY = '0.55';
@@ -473,10 +473,13 @@ function metricsCorsOriginToServeSimArgs(env) {
473
473
  }
474
474
  return args;
475
475
  }
476
- function createServeSimArgs({ port, turnArgs = [], metricsCorsArgs = [], }) {
476
+ function createServeSimPackageSpec(packageVersion) {
477
+ return `${SERVE_SIM_PACKAGE_NAME}@${packageVersion ?? 'latest'}`;
478
+ }
479
+ function createServeSimArgs({ port, turnArgs = [], metricsCorsArgs = [], packageVersion, }) {
477
480
  return [
478
481
  '--yes',
479
- SERVE_SIM_PACKAGE_SPEC,
482
+ createServeSimPackageSpec(packageVersion),
480
483
  '--port',
481
484
  String(port),
482
485
  '--host',
@@ -540,14 +543,14 @@ async function waitForServeSimReadyAsync({ serveSim, port, timeoutMs, }) {
540
543
  }
541
544
  throw new eas_build_job_1.SystemError(`Timed out waiting for serve-sim readiness at ${readyUrl}${lastError instanceof Error ? `: ${lastError.message}` : ''}. Last output:\n${serveSim.getOutput() || '<empty>'}`);
542
545
  }
543
- async function startServeSimWithTunnelAsync(ctx, { baseDomain, env, logger, timeoutMs, }) {
546
+ async function startServeSimWithTunnelAsync(ctx, { baseDomain, env, logger, timeoutMs, packageVersion, }) {
544
547
  const port = await findAvailablePortAsync();
545
- logger.info(`Launching ${SERVE_SIM_PACKAGE_SPEC} on ${SERVE_SIM_HOST}:${port}.`);
548
+ logger.info(`Launching ${createServeSimPackageSpec(packageVersion)} on ${SERVE_SIM_HOST}:${port}.`);
546
549
  const turnArgs = await fetchServeSimTurnArgsAsync(ctx, { env, logger });
547
550
  const metricsCorsArgs = metricsCorsOriginToServeSimArgs(env);
548
551
  const serveSim = spawnDetached({
549
552
  command: 'npx',
550
- args: createServeSimArgs({ port, turnArgs, metricsCorsArgs }),
553
+ args: createServeSimArgs({ port, turnArgs, metricsCorsArgs, packageVersion }),
551
554
  env,
552
555
  });
553
556
  try {
@@ -27,6 +27,14 @@ export declare namespace IosSimulatorUtils {
27
27
  runtimeDisplayName: string;
28
28
  displayName: string;
29
29
  };
30
+ export type IosSimulatorRuntime = {
31
+ identifier: string;
32
+ isAvailable?: boolean;
33
+ version?: string;
34
+ };
35
+ export function getAvailableRuntimesAsync({ env, }: {
36
+ env: NodeJS.ProcessEnv;
37
+ }): Promise<IosSimulatorRuntime[]>;
30
38
  export function getAvailableDevicesAsync({ env, filter, }: {
31
39
  env: NodeJS.ProcessEnv;
32
40
  filter: 'available' | 'booted';
@@ -13,6 +13,15 @@ const promises_1 = require("node:timers/promises");
13
13
  const retry_1 = require("./retry");
14
14
  var IosSimulatorUtils;
15
15
  (function (IosSimulatorUtils) {
16
+ async function getAvailableRuntimesAsync({ env, }) {
17
+ const { stdout } = await (0, turtle_spawn_1.default)('xcrun', ['simctl', 'list', 'runtimes', '--json'], { env });
18
+ const { runtimes } = JSON.parse(stdout);
19
+ return runtimes.flatMap(runtime => runtime.isAvailable !== false &&
20
+ runtime.identifier?.startsWith('com.apple.CoreSimulator.SimRuntime.iOS-')
21
+ ? [{ ...runtime, identifier: runtime.identifier }]
22
+ : []);
23
+ }
24
+ IosSimulatorUtils.getAvailableRuntimesAsync = getAvailableRuntimesAsync;
16
25
  async function getAvailableDevicesAsync({ env, filter, }) {
17
26
  const result = await (0, turtle_spawn_1.default)('xcrun', ['simctl', 'list', 'devices', '--json', '--no-escape-slashes', filter], { env });
18
27
  const xcrunData = JSON.parse(result.stdout);
@@ -1,5 +1,11 @@
1
1
  import { Platform } from '@expo/eas-build-job';
2
- export declare const CACHE_KEY_PREFIX_BY_PLATFORM: Record<Platform, string>;
2
+ export type CcacheBuildTarget = {
3
+ platform: Platform.ANDROID;
4
+ } | {
5
+ platform: Platform.IOS;
6
+ simulator: boolean;
7
+ };
8
+ export declare function getCcacheKeyPrefix(target: CcacheBuildTarget): string;
3
9
  export declare const PUBLIC_CACHE_KEY_PREFIX_BY_PLATFORM: Record<Platform, string>;
4
10
  export declare function getCcachePath(env: Record<string, string | undefined>): string;
5
- export declare function generateDefaultBuildCacheKeyAsync(workingDirectory: string, platform: Platform): Promise<string>;
11
+ export declare function generateDefaultBuildCacheKeyAsync(workingDirectory: string, target: CcacheBuildTarget): Promise<string>;
@@ -36,7 +36,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
36
36
  return (mod && mod.__esModule) ? mod : { "default": mod };
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.PUBLIC_CACHE_KEY_PREFIX_BY_PLATFORM = exports.CACHE_KEY_PREFIX_BY_PLATFORM = void 0;
39
+ exports.PUBLIC_CACHE_KEY_PREFIX_BY_PLATFORM = void 0;
40
+ exports.getCcacheKeyPrefix = getCcacheKeyPrefix;
40
41
  exports.getCcachePath = getCcachePath;
41
42
  exports.generateDefaultBuildCacheKeyAsync = generateDefaultBuildCacheKeyAsync;
42
43
  const eas_build_job_1 = require("@expo/eas-build-job");
@@ -46,16 +47,19 @@ const assert_1 = __importDefault(require("assert"));
46
47
  const os_1 = __importDefault(require("os"));
47
48
  const path_1 = __importDefault(require("path"));
48
49
  const packageManager_1 = require("./packageManager");
49
- const IOS_CACHE_KEY_PREFIX = 'ios-ccache-';
50
+ const IOS_DEVICE_CACHE_KEY_PREFIX = 'ios-device-ccache-';
51
+ const IOS_SIMULATOR_CACHE_KEY_PREFIX = 'ios-simulator-ccache-';
50
52
  const ANDROID_CACHE_KEY_PREFIX = 'android-ccache-';
51
53
  const PUBLIC_IOS_CACHE_KEY_PREFIX = 'public-ios-ccache-';
52
54
  const PUBLIC_ANDROID_CACHE_KEY_PREFIX = 'public-android-ccache-';
53
55
  const DARWIN_CACHE_PATH = 'Library/Caches/ccache';
54
56
  const LINUX_CACHE_PATH = '.cache/ccache';
55
- exports.CACHE_KEY_PREFIX_BY_PLATFORM = {
56
- [eas_build_job_1.Platform.ANDROID]: ANDROID_CACHE_KEY_PREFIX,
57
- [eas_build_job_1.Platform.IOS]: IOS_CACHE_KEY_PREFIX,
58
- };
57
+ function getCcacheKeyPrefix(target) {
58
+ if (target.platform === eas_build_job_1.Platform.IOS) {
59
+ return target.simulator ? IOS_SIMULATOR_CACHE_KEY_PREFIX : IOS_DEVICE_CACHE_KEY_PREFIX;
60
+ }
61
+ return ANDROID_CACHE_KEY_PREFIX;
62
+ }
59
63
  exports.PUBLIC_CACHE_KEY_PREFIX_BY_PLATFORM = {
60
64
  [eas_build_job_1.Platform.ANDROID]: PUBLIC_ANDROID_CACHE_KEY_PREFIX,
61
65
  [eas_build_job_1.Platform.IOS]: PUBLIC_IOS_CACHE_KEY_PREFIX,
@@ -68,14 +72,14 @@ function getCcachePath(env) {
68
72
  (0, assert_1.default)(env.HOME, 'Failed to infer directory: $HOME environment variable is empty.');
69
73
  return path_1.default.join(env.HOME, PATH_BY_PLATFORM[os_1.default.platform()]);
70
74
  }
71
- async function generateDefaultBuildCacheKeyAsync(workingDirectory, platform) {
75
+ async function generateDefaultBuildCacheKeyAsync(workingDirectory, target) {
72
76
  // This will resolve which package manager and use the relevant lock file
73
77
  // The lock file hash is the key and ensures cache is fresh
74
78
  const packagerRunDir = (0, packageManager_1.findPackagerRootDir)(workingDirectory);
75
79
  const manager = PackageManagerUtils.createForProject(packagerRunDir);
76
80
  const lockPath = path_1.default.join(packagerRunDir, manager.lockFile);
77
81
  try {
78
- return `${exports.CACHE_KEY_PREFIX_BY_PLATFORM[platform]}${(0, steps_1.hashFiles)([lockPath])}`;
82
+ return `${getCcacheKeyPrefix(target)}${(0, steps_1.hashFiles)([lockPath])}`;
79
83
  }
80
84
  catch (err) {
81
85
  throw new Error(`Failed to read lockfile for cache key generation: ${err.message}`);
@@ -0,0 +1,4 @@
1
+ export declare function getProxiedDownloadUrl({ directUrl, proxyBaseUrl, }: {
2
+ directUrl: string;
3
+ proxyBaseUrl?: string;
4
+ }): string | null;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getProxiedDownloadUrl = getProxiedDownloadUrl;
4
+ function getProxiedDownloadUrl({ directUrl, proxyBaseUrl, }) {
5
+ if (!proxyBaseUrl) {
6
+ return null;
7
+ }
8
+ const parsedUrl = new URL(directUrl);
9
+ return directUrl.replace(`${parsedUrl.protocol}//${parsedUrl.host}`, `${proxyBaseUrl.replace(/\/$/, '')}/${parsedUrl.host}`);
10
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@expo/build-tools",
3
- "version": "22.2.0",
3
+ "version": "22.4.0",
4
4
  "bugs": "https://github.com/expo/eas-cli/issues",
5
5
  "license": "BUSL-1.1",
6
6
  "author": "Expo <support@expo.io>",
@@ -46,7 +46,7 @@
46
46
  "@expo/plist": "^0.3.5",
47
47
  "@expo/results": "^1.0.0",
48
48
  "@expo/spawn-async": "1.7.2",
49
- "@expo/steps": "22.1.0",
49
+ "@expo/steps": "22.4.0",
50
50
  "@expo/template-file": "22.0.0",
51
51
  "@expo/turtle-spawn": "22.0.0",
52
52
  "@expo/xcpretty": "^4.3.1",
@@ -54,6 +54,7 @@
54
54
  "@sentry/node": "7.77.0",
55
55
  "@urql/core": "^6.0.1",
56
56
  "bplist-parser": "0.3.2",
57
+ "content-disposition": "1.0.1",
57
58
  "fast-glob": "^3.3.2",
58
59
  "fast-xml-parser": "^4.4.1",
59
60
  "fs-extra": "^11.2.0",
@@ -77,7 +78,8 @@
77
78
  "zod": "^4.3.5"
78
79
  },
79
80
  "devDependencies": {
80
- "@expo/repack-app": "~0.6.1",
81
+ "@expo/repack-app": "~0.9.0",
82
+ "@types/content-disposition": "0.5.9",
81
83
  "@types/fs-extra": "^11.0.4",
82
84
  "@types/jest": "^29.5.12",
83
85
  "@types/lodash": "^4.17.4",
@@ -100,5 +102,5 @@
100
102
  "typescript": "^5.5.4",
101
103
  "uuid": "^9.0.1"
102
104
  },
103
- "gitHead": "5484dd607468c7711d915a2521df10531f8b9908"
105
+ "gitHead": "39c39ad4bfdd1e7e74417bb6f7178b011ce61bbe"
104
106
  }