@expo/cli 0.23.2 → 0.23.3

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/build/bin/cli CHANGED
@@ -123,7 +123,7 @@ const args = (0, _arg().default)({
123
123
  });
124
124
  if (args['--version']) {
125
125
  // Version is added in the build script.
126
- console.log("0.23.2");
126
+ console.log("0.23.3");
127
127
  process.exit(0);
128
128
  }
129
129
  if (args['--non-interactive']) {
@@ -8,6 +8,13 @@ Object.defineProperty(exports, "runAndroidAsync", {
8
8
  return runAndroidAsync;
9
9
  }
10
10
  });
11
+ function _config() {
12
+ const data = require("@expo/config");
13
+ _config = function() {
14
+ return data;
15
+ };
16
+ return data;
17
+ }
11
18
  function _chalk() {
12
19
  const data = /*#__PURE__*/ _interop_require_default(require("chalk"));
13
20
  _chalk = function() {
@@ -40,6 +47,7 @@ const _port = require("../../utils/port");
40
47
  const _scheme = require("../../utils/scheme");
41
48
  const _ensureNativeProject = require("../ensureNativeProject");
42
49
  const _hints = require("../hints");
50
+ const _remoteBuildCache = require("../remoteBuildCache");
43
51
  const _startBundler = require("../startBundler");
44
52
  function _interop_require_default(obj) {
45
53
  return obj && obj.__esModule ? obj : {
@@ -48,11 +56,22 @@ function _interop_require_default(obj) {
48
56
  }
49
57
  const debug = require('debug')('expo:run:android');
50
58
  async function runAndroidAsync(projectRoot, { install, ...options }) {
51
- var _options_variant, _this;
59
+ var _options_variant, _projectConfig_exp_experiments, _this, _projectConfig_exp_experiments1;
52
60
  // NOTE: This is a guess, the developer can overwrite with `NODE_ENV`.
53
61
  const isProduction = (_options_variant = options.variant) == null ? void 0 : _options_variant.toLowerCase().endsWith('release');
54
62
  (0, _nodeEnv.setNodeEnv)(isProduction ? 'production' : 'development');
55
63
  require('@expo/env').load(projectRoot);
64
+ const projectConfig = (0, _config().getConfig)(projectRoot);
65
+ if (!options.binary && ((_projectConfig_exp_experiments = projectConfig.exp.experiments) == null ? void 0 : _projectConfig_exp_experiments.remoteBuildCache)) {
66
+ var _projectConfig_exp_experiments2;
67
+ const localPath = await (0, _remoteBuildCache.resolveRemoteBuildCache)(projectRoot, {
68
+ platform: 'android',
69
+ provider: (_projectConfig_exp_experiments2 = projectConfig.exp.experiments) == null ? void 0 : _projectConfig_exp_experiments2.remoteBuildCache.provider
70
+ });
71
+ if (localPath) {
72
+ options.binary = localPath;
73
+ }
74
+ }
56
75
  await (0, _ensureNativeProject.ensureNativeProjectAsync)(projectRoot, {
57
76
  platform: 'android',
58
77
  install
@@ -61,6 +80,7 @@ async function runAndroidAsync(projectRoot, { install, ...options }) {
61
80
  debug('Package name: ' + props.packageName);
62
81
  _log.Log.log('› Building app...');
63
82
  const androidProjectRoot = _path().default.join(projectRoot, 'android');
83
+ let shouldUpdateBuildCache = false;
64
84
  if (!options.binary) {
65
85
  let eagerBundleOptions;
66
86
  if (isProduction) {
@@ -77,6 +97,7 @@ async function runAndroidAsync(projectRoot, { install, ...options }) {
77
97
  architectures: props.architectures,
78
98
  eagerBundleOptions
79
99
  });
100
+ shouldUpdateBuildCache = true;
80
101
  // Ensure the port hasn't become busy during the build.
81
102
  if (props.shouldStartBundler && !await (0, _port.ensurePortAvailabilityAsync)(projectRoot, props)) {
82
103
  props.shouldStartBundler = false;
@@ -111,6 +132,13 @@ async function runAndroidAsync(projectRoot, { install, ...options }) {
111
132
  } else {
112
133
  await manager.stopAsync();
113
134
  }
135
+ if (shouldUpdateBuildCache && ((_projectConfig_exp_experiments1 = projectConfig.exp.experiments) == null ? void 0 : _projectConfig_exp_experiments1.remoteBuildCache)) {
136
+ var _projectConfig_exp_experiments3;
137
+ await (0, _remoteBuildCache.uploadRemoteBuildCache)(projectRoot, {
138
+ platform: 'android',
139
+ provider: (_projectConfig_exp_experiments3 = projectConfig.exp.experiments) == null ? void 0 : _projectConfig_exp_experiments3.remoteBuildCache.provider
140
+ });
141
+ }
114
142
  }
115
143
  async function installAppAsync(androidProjectRoot, props) {
116
144
  // Find the APK file path
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/run/android/runAndroidAsync.ts"],"sourcesContent":["import chalk from 'chalk';\nimport fs from 'fs';\nimport path from 'path';\n\nimport { resolveInstallApkNameAsync } from './resolveInstallApkName';\nimport { Options, ResolvedOptions, resolveOptionsAsync } from './resolveOptions';\nimport { exportEagerAsync } from '../../export/embed/exportEager';\nimport { Log } from '../../log';\nimport type { AndroidOpenInCustomProps } from '../../start/platforms/android/AndroidPlatformManager';\nimport { assembleAsync, installAsync } from '../../start/platforms/android/gradle';\nimport { CommandError } from '../../utils/errors';\nimport { setNodeEnv } from '../../utils/nodeEnv';\nimport { ensurePortAvailabilityAsync } from '../../utils/port';\nimport { getSchemesForAndroidAsync } from '../../utils/scheme';\nimport { ensureNativeProjectAsync } from '../ensureNativeProject';\nimport { logProjectLogsLocation } from '../hints';\nimport { startBundlerAsync } from '../startBundler';\n\nconst debug = require('debug')('expo:run:android');\n\nexport async function runAndroidAsync(projectRoot: string, { install, ...options }: Options) {\n // NOTE: This is a guess, the developer can overwrite with `NODE_ENV`.\n const isProduction = options.variant?.toLowerCase().endsWith('release');\n setNodeEnv(isProduction ? 'production' : 'development');\n require('@expo/env').load(projectRoot);\n\n await ensureNativeProjectAsync(projectRoot, { platform: 'android', install });\n\n const props = await resolveOptionsAsync(projectRoot, options);\n\n debug('Package name: ' + props.packageName);\n Log.log('› Building app...');\n\n const androidProjectRoot = path.join(projectRoot, 'android');\n\n if (!options.binary) {\n let eagerBundleOptions: string | undefined;\n\n if (isProduction) {\n eagerBundleOptions = JSON.stringify(\n await exportEagerAsync(projectRoot, {\n dev: false,\n platform: 'android',\n })\n );\n }\n\n await assembleAsync(androidProjectRoot, {\n variant: props.variant,\n port: props.port,\n appName: props.appName,\n buildCache: props.buildCache,\n architectures: props.architectures,\n eagerBundleOptions,\n });\n\n // Ensure the port hasn't become busy during the build.\n if (props.shouldStartBundler && !(await ensurePortAvailabilityAsync(projectRoot, props))) {\n props.shouldStartBundler = false;\n }\n }\n\n const manager = await startBundlerAsync(projectRoot, {\n port: props.port,\n // If a scheme is specified then use that instead of the package name.\n scheme: (await getSchemesForAndroidAsync(projectRoot))?.[0],\n headless: !props.shouldStartBundler,\n });\n\n if (options.binary) {\n // Attempt to install the APK from the file path\n const binaryPath = path.join(options.binary);\n\n if (!fs.existsSync(binaryPath)) {\n throw new CommandError(`The path to the custom Android binary does not exist: ${binaryPath}`);\n }\n Log.log(chalk.gray`\\u203A Installing ${binaryPath}`);\n await props.device.installAppAsync(binaryPath);\n } else {\n await installAppAsync(androidProjectRoot, props);\n }\n\n await manager.getDefaultDevServer().openCustomRuntimeAsync<AndroidOpenInCustomProps>(\n 'emulator',\n {\n applicationId: props.packageName,\n customAppId: props.customAppId,\n launchActivity: props.launchActivity,\n },\n { device: props.device.device }\n );\n\n if (props.shouldStartBundler) {\n logProjectLogsLocation();\n } else {\n await manager.stopAsync();\n }\n}\n\nasync function installAppAsync(androidProjectRoot: string, props: ResolvedOptions) {\n // Find the APK file path\n const apkFile = await resolveInstallApkNameAsync(props.device.device, props);\n\n if (apkFile) {\n // Attempt to install the APK from the file path\n const binaryPath = path.join(props.apkVariantDirectory, apkFile);\n Log.log(chalk.gray`\\u203A Installing ${binaryPath}`);\n await props.device.installAppAsync(binaryPath);\n } else {\n // If we cannot resolve the APK file path then we can attempt to install using Gradle.\n // This offers more advanced resolution that we may not have first class support for.\n Log.log('› Failed to locate binary file, installing with Gradle...');\n await installAsync(androidProjectRoot, {\n variant: props.variant ?? 'debug',\n appName: props.appName ?? 'app',\n port: props.port,\n });\n }\n}\n"],"names":["runAndroidAsync","debug","require","projectRoot","install","options","isProduction","variant","toLowerCase","endsWith","setNodeEnv","load","ensureNativeProjectAsync","platform","props","resolveOptionsAsync","packageName","Log","log","androidProjectRoot","path","join","binary","eagerBundleOptions","JSON","stringify","exportEagerAsync","dev","assembleAsync","port","appName","buildCache","architectures","shouldStartBundler","ensurePortAvailabilityAsync","manager","startBundlerAsync","scheme","getSchemesForAndroidAsync","headless","binaryPath","fs","existsSync","CommandError","chalk","gray","device","installAppAsync","getDefaultDevServer","openCustomRuntimeAsync","applicationId","customAppId","launchActivity","logProjectLogsLocation","stopAsync","apkFile","resolveInstallApkNameAsync","apkVariantDirectory","installAsync"],"mappings":";;;;+BAoBsBA;;;eAAAA;;;;gEApBJ;;;;;;;gEACH;;;;;;;gEACE;;;;;;uCAE0B;gCACmB;6BAC7B;qBACb;wBAEwB;wBACf;yBACF;sBACiB;wBACF;qCACD;uBACF;8BACL;;;;;;AAElC,MAAMC,QAAQC,QAAQ,SAAS;AAExB,eAAeF,gBAAgBG,WAAmB,EAAE,EAAEC,OAAO,EAAE,GAAGC,SAAkB;QAEpEA,kBA2CV;IA5CX,sEAAsE;IACtE,MAAMC,gBAAeD,mBAAAA,QAAQE,OAAO,qBAAfF,iBAAiBG,WAAW,GAAGC,QAAQ,CAAC;IAC7DC,IAAAA,mBAAU,EAACJ,eAAe,eAAe;IACzCJ,QAAQ,aAAaS,IAAI,CAACR;IAE1B,MAAMS,IAAAA,6CAAwB,EAACT,aAAa;QAAEU,UAAU;QAAWT;IAAQ;IAE3E,MAAMU,QAAQ,MAAMC,IAAAA,mCAAmB,EAACZ,aAAaE;IAErDJ,MAAM,mBAAmBa,MAAME,WAAW;IAC1CC,QAAG,CAACC,GAAG,CAAC;IAER,MAAMC,qBAAqBC,eAAI,CAACC,IAAI,CAAClB,aAAa;IAElD,IAAI,CAACE,QAAQiB,MAAM,EAAE;QACnB,IAAIC;QAEJ,IAAIjB,cAAc;YAChBiB,qBAAqBC,KAAKC,SAAS,CACjC,MAAMC,IAAAA,6BAAgB,EAACvB,aAAa;gBAClCwB,KAAK;gBACLd,UAAU;YACZ;QAEJ;QAEA,MAAMe,IAAAA,qBAAa,EAACT,oBAAoB;YACtCZ,SAASO,MAAMP,OAAO;YACtBsB,MAAMf,MAAMe,IAAI;YAChBC,SAAShB,MAAMgB,OAAO;YACtBC,YAAYjB,MAAMiB,UAAU;YAC5BC,eA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IAAAA,iDAA0B,EAAC1C,MAAMgC,MAAM,CAACA,MAAM,EAAEhC;IAEtE,IAAIyC,SAAS;QACX,gDAAgD;QAChD,MAAMf,aAAapB,eAAI,CAACC,IAAI,CAACP,MAAM2C,mBAAmB,EAAEF;QACxDtC,QAAG,CAACC,GAAG,CAAC0B,gBAAK,CAACC,IAAI,CAAC,kBAAkB,EAAEL,WAAW,CAAC;QACnD,MAAM1B,MAAMgC,MAAM,CAACC,eAAe,CAACP;IACrC,OAAO;QACL,sFAAsF;QACtF,qFAAqF;QACrFvB,QAAG,CAACC,GAAG,CAAC;QACR,MAAMwC,IAAAA,oBAAY,EAACvC,oBAAoB;YACrCZ,SAASO,MAAMP,OAAO,IAAI;YAC1BuB,SAAShB,MAAMgB,OAAO,IAAI;YAC1BD,MAAMf,MAAMe,IAAI;QAClB;IACF;AACF"}
1
+ {"version":3,"sources":["../../../../src/run/android/runAndroidAsync.ts"],"sourcesContent":["import { getConfig } from '@expo/config';\nimport chalk from 'chalk';\nimport fs from 'fs';\nimport path from 'path';\n\nimport { resolveInstallApkNameAsync } from './resolveInstallApkName';\nimport { Options, ResolvedOptions, resolveOptionsAsync } from './resolveOptions';\nimport { exportEagerAsync } from '../../export/embed/exportEager';\nimport { Log } from '../../log';\nimport type { AndroidOpenInCustomProps } from '../../start/platforms/android/AndroidPlatformManager';\nimport { assembleAsync, installAsync } from '../../start/platforms/android/gradle';\nimport { CommandError } from '../../utils/errors';\nimport { setNodeEnv } from '../../utils/nodeEnv';\nimport { ensurePortAvailabilityAsync } from '../../utils/port';\nimport { getSchemesForAndroidAsync } from '../../utils/scheme';\nimport { ensureNativeProjectAsync } from '../ensureNativeProject';\nimport { logProjectLogsLocation } from '../hints';\nimport { resolveRemoteBuildCache, uploadRemoteBuildCache } from '../remoteBuildCache';\nimport { startBundlerAsync } from '../startBundler';\n\nconst debug = require('debug')('expo:run:android');\n\nexport async function runAndroidAsync(projectRoot: string, { install, ...options }: Options) {\n // NOTE: This is a guess, the developer can overwrite with `NODE_ENV`.\n const isProduction = options.variant?.toLowerCase().endsWith('release');\n setNodeEnv(isProduction ? 'production' : 'development');\n require('@expo/env').load(projectRoot);\n\n const projectConfig = getConfig(projectRoot);\n if (!options.binary && projectConfig.exp.experiments?.remoteBuildCache) {\n const localPath = await resolveRemoteBuildCache(projectRoot, {\n platform: 'android',\n provider: projectConfig.exp.experiments?.remoteBuildCache.provider,\n });\n if (localPath) {\n options.binary = localPath;\n }\n }\n\n await ensureNativeProjectAsync(projectRoot, { platform: 'android', install });\n\n const props = await resolveOptionsAsync(projectRoot, options);\n\n debug('Package name: ' + props.packageName);\n Log.log('› Building app...');\n\n const androidProjectRoot = path.join(projectRoot, 'android');\n\n let shouldUpdateBuildCache = false;\n if (!options.binary) {\n let eagerBundleOptions: string | undefined;\n\n if (isProduction) {\n eagerBundleOptions = JSON.stringify(\n await exportEagerAsync(projectRoot, {\n dev: false,\n platform: 'android',\n })\n );\n }\n\n await assembleAsync(androidProjectRoot, {\n variant: props.variant,\n port: props.port,\n appName: props.appName,\n buildCache: props.buildCache,\n architectures: props.architectures,\n eagerBundleOptions,\n });\n shouldUpdateBuildCache = true;\n\n // Ensure the port hasn't become busy during the build.\n if (props.shouldStartBundler && !(await ensurePortAvailabilityAsync(projectRoot, props))) {\n props.shouldStartBundler = false;\n }\n }\n\n const manager = await startBundlerAsync(projectRoot, {\n port: props.port,\n // If a scheme is specified then use that instead of the package name.\n scheme: (await getSchemesForAndroidAsync(projectRoot))?.[0],\n headless: !props.shouldStartBundler,\n });\n\n if (options.binary) {\n // Attempt to install the APK from the file path\n const binaryPath = path.join(options.binary);\n\n if (!fs.existsSync(binaryPath)) {\n throw new CommandError(`The path to the custom Android binary does not exist: ${binaryPath}`);\n }\n Log.log(chalk.gray`\\u203A Installing ${binaryPath}`);\n await props.device.installAppAsync(binaryPath);\n } else {\n await installAppAsync(androidProjectRoot, props);\n }\n\n await manager.getDefaultDevServer().openCustomRuntimeAsync<AndroidOpenInCustomProps>(\n 'emulator',\n {\n applicationId: props.packageName,\n customAppId: props.customAppId,\n launchActivity: props.launchActivity,\n },\n { device: props.device.device }\n );\n\n if (props.shouldStartBundler) {\n logProjectLogsLocation();\n } else {\n await manager.stopAsync();\n }\n\n if (shouldUpdateBuildCache && projectConfig.exp.experiments?.remoteBuildCache) {\n await uploadRemoteBuildCache(projectRoot, {\n platform: 'android',\n provider: projectConfig.exp.experiments?.remoteBuildCache.provider,\n });\n }\n}\n\nasync function installAppAsync(androidProjectRoot: string, props: ResolvedOptions) {\n // Find the APK file path\n const apkFile = await resolveInstallApkNameAsync(props.device.device, props);\n\n if (apkFile) {\n // Attempt to install the APK from the file path\n const binaryPath = path.join(props.apkVariantDirectory, apkFile);\n Log.log(chalk.gray`\\u203A Installing ${binaryPath}`);\n await props.device.installAppAsync(binaryPath);\n } else {\n // If we cannot resolve the APK file path then we can attempt to install using Gradle.\n // This offers more advanced resolution that we may not have first class support for.\n Log.log('› Failed to locate binary file, installing with Gradle...');\n await installAsync(androidProjectRoot, {\n variant: props.variant ?? 'debug',\n appName: props.appName ?? 'app',\n port: props.port,\n });\n }\n}\n"],"names":["runAndroidAsync","debug","require","projectRoot","install","options","projectConfig","isProduction","variant","toLowerCase","endsWith","setNodeEnv","load","getConfig","binary","exp","experiments","remoteBuildCache","localPath","resolveRemoteBuildCache","platform","provider","ensureNativeProjectAsync","props","resolveOptionsAsync","packageName","Log","log","androidProjectRoot","path","join","shouldUpdateBuildCache","eagerBundleOptions","JSON","stringify","exportEagerAsync","dev","assembleAsync","port","appName","buildCache","architectures","shouldStartBundler","ensurePortAvailabilityAsync","manager","startBundlerAsync","scheme","getSchemesForAndroidAsync","headless","binaryPath","fs","existsSync","CommandError","chalk","gray","device","installAppAsync","getDefaultDevServer","openCustomRuntimeAsync","applicationId","customAppId","launchActivity","logProjectLogsLocation","stopAsync","uploadRemoteBuildCache","apkFile","resolveInstallApkNameAsync","apkVariantDirectory","installAsync"],"mappings":";;;;+BAsBsBA;;;e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9BC,gBAAgBtC,MAAMsC,cAAc;IACtC,GACA;QAAEN,QAAQhC,MAAMgC,MAAM,CAACA,MAAM;IAAC;IAGhC,IAAIhC,MAAMmB,kBAAkB,EAAE;QAC5BoB,IAAAA,6BAAsB;IACxB,OAAO;QACL,MAAMlB,QAAQmB,SAAS;IACzB;IAEA,IAAIhC,4BAA0BzB,kCAAAA,cAAcS,GAAG,CAACC,WAAW,qBAA7BV,gCAA+BW,gBAAgB,GAAE;YAGjEX;QAFZ,MAAM0D,IAAAA,wCAAsB,EAAC7D,aAAa;YACxCiB,UAAU;YACVC,QAAQ,GAAEf,kCAAAA,cAAcS,GAAG,CAACC,WAAW,qBAA7BV,gCAA+BW,gBAAgB,CAACI,QAAQ;QACpE;IACF;AACF;AAEA,eAAemC,gBAAgB5B,kBAA0B,EAAEL,KAAsB;IAC/E,yBAAyB;IACzB,MAAM0C,UAAU,MAAMC,IAAAA,iDAA0B,EAAC3C,MAAMgC,MAAM,CAACA,MAAM,EAAEhC;IAEtE,IAAI0C,SAAS;QACX,gDAAgD;QAChD,MAAMhB,aAAapB,eAAI,CAACC,IAAI,CAACP,MAAM4C,mBAAmB,EAAEF;QACxDvC,QAAG,CAACC,GAAG,CAAC0B,gBAAK,CAACC,IAAI,CAAC,kBAAkB,EAAEL,WAAW,CAAC;QACnD,MAAM1B,MAAMgC,MAAM,CAACC,eAAe,CAACP;IACrC,OAAO;QACL,sFAAsF;QACtF,qFAAqF;QACrFvB,QAAG,CAACC,GAAG,CAAC;QACR,MAAMyC,IAAAA,oBAAY,EAACxC,oBAAoB;YACrCpB,SAASe,MAAMf,OAAO,IAAI;YAC1B+B,SAAShB,MAAMgB,OAAO,IAAI;YAC1BD,MAAMf,MAAMe,IAAI;QAClB;IACF;AACF"}
@@ -8,6 +8,13 @@ Object.defineProperty(exports, "runIosAsync", {
8
8
  return runIosAsync;
9
9
  }
10
10
  });
11
+ function _config() {
12
+ const data = require("@expo/config");
13
+ _config = function() {
14
+ return data;
15
+ };
16
+ return data;
17
+ }
11
18
  function _spawnasync() {
12
19
  const data = /*#__PURE__*/ _interop_require_default(require("@expo/spawn-async"));
13
20
  _spawnasync = function() {
@@ -45,6 +52,7 @@ const _profile = require("../../utils/profile");
45
52
  const _scheme = require("../../utils/scheme");
46
53
  const _ensureNativeProject = require("../ensureNativeProject");
47
54
  const _hints = require("../hints");
55
+ const _remoteBuildCache = require("../remoteBuildCache");
48
56
  const _startBundler = require("../startBundler");
49
57
  const _XcodeBuild = /*#__PURE__*/ _interop_require_wildcard(require("./XcodeBuild"));
50
58
  const _launchApp = require("./launchApp");
@@ -101,7 +109,7 @@ function _interop_require_wildcard(obj, nodeInterop) {
101
109
  }
102
110
  const debug = require('debug')('expo:run:ios');
103
111
  async function runIosAsync(projectRoot, options) {
104
- var _this;
112
+ var _projectConfig_exp_experiments, _this, _projectConfig_exp_experiments1;
105
113
  (0, _nodeEnv.setNodeEnv)(options.configuration === 'Release' ? 'production' : 'development');
106
114
  require('@expo/env').load(projectRoot);
107
115
  assertPlatform();
@@ -114,6 +122,17 @@ async function runIosAsync(projectRoot, options) {
114
122
  }
115
123
  // Resolve the CLI arguments into useable options.
116
124
  const props = await (0, _profile.profile)(_resolveOptions.resolveOptionsAsync)(projectRoot, options);
125
+ const projectConfig = (0, _config().getConfig)(projectRoot);
126
+ if (!options.binary && ((_projectConfig_exp_experiments = projectConfig.exp.experiments) == null ? void 0 : _projectConfig_exp_experiments.remoteBuildCache) && props.isSimulator) {
127
+ var _projectConfig_exp_experiments2;
128
+ const localPath = await (0, _remoteBuildCache.resolveRemoteBuildCache)(projectRoot, {
129
+ platform: 'ios',
130
+ provider: (_projectConfig_exp_experiments2 = projectConfig.exp.experiments) == null ? void 0 : _projectConfig_exp_experiments2.remoteBuildCache.provider
131
+ });
132
+ if (localPath) {
133
+ options.binary = localPath;
134
+ }
135
+ }
117
136
  if (options.rebundle) {
118
137
  _log.warn(`The --unstable-rebundle flag is experimental and may not work as expected.`);
119
138
  // Get the existing binary path to re-bundle the app.
@@ -157,6 +176,7 @@ async function runIosAsync(projectRoot, options) {
157
176
  }
158
177
  }
159
178
  let binaryPath;
179
+ let shouldUpdateBuildCache = false;
160
180
  if (options.binary) {
161
181
  binaryPath = await (0, _validateExternalBinary.getValidBinaryPathAsync)(options.binary, props);
162
182
  _log.log('Using custom binary path:', binaryPath);
@@ -176,6 +196,7 @@ async function runIosAsync(projectRoot, options) {
176
196
  // Find the path to the built app binary, this will be used to install the binary
177
197
  // on a device.
178
198
  binaryPath = await (0, _profile.profile)(_XcodeBuild.getAppBinaryPath)(buildOutput);
199
+ shouldUpdateBuildCache = true;
179
200
  }
180
201
  debug('Binary path:', binaryPath);
181
202
  // Ensure the port hasn't become busy during the build.
@@ -217,6 +238,13 @@ async function runIosAsync(projectRoot, options) {
217
238
  } else {
218
239
  await manager.stopAsync();
219
240
  }
241
+ if (shouldUpdateBuildCache && ((_projectConfig_exp_experiments1 = projectConfig.exp.experiments) == null ? void 0 : _projectConfig_exp_experiments1.remoteBuildCache)) {
242
+ var _projectConfig_exp_experiments3;
243
+ await (0, _remoteBuildCache.uploadRemoteBuildCache)(projectRoot, {
244
+ platform: 'ios',
245
+ provider: (_projectConfig_exp_experiments3 = projectConfig.exp.experiments) == null ? void 0 : _projectConfig_exp_experiments3.remoteBuildCache.provider
246
+ });
247
+ }
220
248
  }
221
249
  function assertPlatform() {
222
250
  if (process.platform !== 'darwin') {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/run/ios/runIosAsync.ts"],"sourcesContent":["import spawnAsync from '@expo/spawn-async';\nimport chalk from 'chalk';\nimport fs from 'fs';\nimport path from 'path';\n\nimport * as Log from '../../log';\nimport { AppleAppIdResolver } from '../../start/platforms/ios/AppleAppIdResolver';\nimport { maybePromptToSyncPodsAsync } from '../../utils/cocoapods';\nimport { setNodeEnv } from '../../utils/nodeEnv';\nimport { ensurePortAvailabilityAsync } from '../../utils/port';\nimport { profile } from '../../utils/profile';\nimport { getSchemesForIosAsync } from '../../utils/scheme';\nimport { ensureNativeProjectAsync } from '../ensureNativeProject';\nimport { logProjectLogsLocation } from '../hints';\nimport { startBundlerAsync } from '../startBundler';\nimport * as XcodeBuild from './XcodeBuild';\nimport { Options } from './XcodeBuild.types';\nimport { getLaunchInfoForBinaryAsync, launchAppAsync } from './launchApp';\nimport { resolveOptionsAsync } from './options/resolveOptions';\nimport { getValidBinaryPathAsync } from './validateExternalBinary';\nimport { exportEagerAsync } from '../../export/embed/exportEager';\nimport { getContainerPathAsync, simctlAsync } from '../../start/platforms/ios/simctl';\nimport { CommandError } from '../../utils/errors';\n\nconst debug = require('debug')('expo:run:ios');\n\nexport async function runIosAsync(projectRoot: string, options: Options) {\n setNodeEnv(options.configuration === 'Release' ? 'production' : 'development');\n require('@expo/env').load(projectRoot);\n\n assertPlatform();\n\n const install = !!options.install;\n\n if ((await ensureNativeProjectAsync(projectRoot, { platform: 'ios', install })) && install) {\n await maybePromptToSyncPodsAsync(projectRoot);\n }\n\n // Resolve the CLI arguments into useable options.\n const props = await profile(resolveOptionsAsync)(projectRoot, options);\n\n if (options.rebundle) {\n Log.warn(`The --unstable-rebundle flag is experimental and may not work as expected.`);\n // Get the existing binary path to re-bundle the app.\n\n let binaryPath: string;\n if (!options.binary) {\n if (!props.isSimulator) {\n throw new Error('Re-bundling on physical devices requires the --binary flag.');\n }\n const appId = await new AppleAppIdResolver(projectRoot).getAppIdAsync();\n const possibleBinaryPath = await getContainerPathAsync(props.device, {\n appId,\n });\n if (!possibleBinaryPath) {\n throw new CommandError(\n `Cannot rebundle because no --binary was provided and no existing binary was found on the device for ID: ${appId}.`\n );\n }\n binaryPath = possibleBinaryPath;\n Log.log('Re-using existing binary path:', binaryPath);\n // Set the binary path to the existing binary path.\n options.binary = binaryPath;\n }\n\n Log.log('Rebundling the Expo config file');\n // Re-bundle the config file the same way the app was originally bundled.\n await spawnAsync('node', [\n path.join(require.resolve('expo-constants/package.json'), '../scripts/getAppConfig.js'),\n projectRoot,\n path.join(options.binary, 'EXConstants.bundle'),\n ]);\n // Re-bundle the app.\n\n const possibleBundleOutput = path.join(options.binary, 'main.jsbundle');\n\n if (fs.existsSync(possibleBundleOutput)) {\n Log.log('Rebundling the app...');\n await exportEagerAsync(projectRoot, {\n resetCache: false,\n dev: false,\n platform: 'ios',\n assetsDest: path.join(options.binary, 'assets'),\n bundleOutput: possibleBundleOutput,\n });\n } else {\n Log.warn('Bundle output not found at expected location:', possibleBundleOutput);\n }\n }\n\n let binaryPath: string;\n if (options.binary) {\n binaryPath = await getValidBinaryPathAsync(options.binary, props);\n Log.log('Using custom binary path:', binaryPath);\n } else {\n let eagerBundleOptions: string | undefined;\n\n if (options.configuration === 'Release') {\n eagerBundleOptions = JSON.stringify(\n await exportEagerAsync(projectRoot, {\n dev: false,\n platform: 'ios',\n })\n );\n }\n\n // Spawn the `xcodebuild` process to create the app binary.\n const buildOutput = await XcodeBuild.buildAsync({\n ...props,\n eagerBundleOptions,\n });\n\n // Find the path to the built app binary, this will be used to install the binary\n // on a device.\n binaryPath = await profile(XcodeBuild.getAppBinaryPath)(buildOutput);\n }\n debug('Binary path:', binaryPath);\n\n // Ensure the port hasn't become busy during the build.\n if (props.shouldStartBundler && !(await ensurePortAvailabilityAsync(projectRoot, props))) {\n props.shouldStartBundler = false;\n }\n\n const launchInfo = await getLaunchInfoForBinaryAsync(binaryPath);\n const isCustomBinary = !!options.binary;\n\n // Always close the app before launching on a simulator. Otherwise certain cached resources like the splashscreen will not be available.\n if (props.isSimulator) {\n try {\n await simctlAsync(['terminate', props.device.udid, launchInfo.bundleId]);\n } catch (error) {\n // If we failed it's likely that the app was not running to begin with and we will get an `invalid device` error\n debug('Failed to terminate app (possibly because it was not running):', error);\n }\n }\n\n // Start the dev server which creates all of the required info for\n // launching the app on a simulator.\n const manager = await startBundlerAsync(projectRoot, {\n port: props.port,\n headless: !props.shouldStartBundler,\n // If a scheme is specified then use that instead of the package name.\n\n scheme: isCustomBinary\n ? // If launching a custom binary, use the schemes in the Info.plist.\n launchInfo.schemes[0]\n : // If a scheme is specified then use that instead of the package name.\n (await getSchemesForIosAsync(projectRoot))?.[0],\n });\n\n // Install and launch the app binary on a device.\n await launchAppAsync(\n binaryPath,\n manager,\n {\n isSimulator: props.isSimulator,\n device: props.device,\n shouldStartBundler: props.shouldStartBundler,\n },\n launchInfo.bundleId\n );\n\n // Log the location of the JS logs for the device.\n if (props.shouldStartBundler) {\n logProjectLogsLocation();\n } else {\n await manager.stopAsync();\n }\n}\n\nfunction assertPlatform() {\n if (process.platform !== 'darwin') {\n Log.exit(\n chalk`iOS apps can only be built on macOS devices. Use {cyan eas build -p ios} to build in the cloud.`\n );\n }\n}\n"],"names":["runIosAsync","debug","require","projectRoot","options","setNodeEnv","configuration","load","assertPlatform","install","ensureNativeProjectAsync","platform","maybePromptToSyncPodsAsync","props","profile","resolveOptionsAsync","rebundle","Log","warn","binaryPath","binary","isSimulator","Error","appId","AppleAppIdResolver","getAppIdAsync","possibleBinaryPath","getContainerPathAsync","device","CommandError","log","spawnAsync","path","join","resolve","possibleBundleOutput","fs","existsSync","exportEagerAsync","resetCache","dev","assetsDest","bundleOutput","getValidBinaryPathAsync","eagerBundleOptions","JSON","stringify","buildOutput","XcodeBuild","buildAsync","getAppBinaryPath","shouldStartBundler","ensurePortAvailabilityAsync","launchInfo","getLaunchInfoForBinaryAsync","isCustomBinary","simctlAsync","udid","bundleId","error","manager","startBundlerAsync","port","headless","scheme","schemes","getSchemesForIosAsync","launchAppAsync","logProjectLogsLocation","stopAsync","process","exit","chalk"],"mappings":";;;;+BA0BsBA;;;eAAAA;;;;gEA1BC;;;;;;;gEACL;;;;;;;gEACH;;;;;;;gEACE;;;;;;6DAEI;oCACc;2BACQ;yBAChB;sBACiB;yBACpB;wBACc;qCACG;uBACF;8BACL;oEACN;2BAEgC;gCACxB;wCACI;6BACP;wBACkB;wBACtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE7B,MAAMC,QA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;YACF,MAAMmC,IAAAA,mBAAW,EAAC;gBAAC;gBAAa3C,MAAMe,MAAM,CAAC6B,IAAI;gBAAEJ,WAAWK,QAAQ;aAAC;QACzE,EAAE,OAAOC,OAAO;YACd,gHAAgH;YAChH1D,MAAM,kEAAkE0D;QAC1E;IACF;IAEA,kEAAkE;IAClE,oCAAoC;IACpC,MAAMC,UAAU,MAAMC,IAAAA,+BAAiB,EAAC1D,aAAa;QACnD2D,MAAMjD,MAAMiD,IAAI;QAChBC,UAAU,CAAClD,MAAMsC,kBAAkB;QACnC,sEAAsE;QAEtEa,QAAQT,iBAEJF,WAAWY,OAAO,CAAC,EAAE,IAEpB,QAAA,MAAMC,IAAAA,6BAAqB,EAAC/D,iCAA7B,AAAC,KAA2C,CAAC,EAAE;IACrD;IAEA,iDAAiD;IACjD,MAAMgE,IAAAA,yBAAc,EAClBhD,YACAyC,SACA;QACEvC,aAAaR,MAAMQ,WAAW;QAC9BO,QAAQf,MAAMe,MAAM;QACpBuB,oBAAoBtC,MAAMsC,kBAAkB;IAC9C,GACAE,WAAWK,QAAQ;IAGrB,kDAAkD;IAClD,IAAI7C,MAAMsC,kBAAkB,EAAE;QAC5BiB,IAAAA,6BAAsB;IACxB,OAAO;QACL,MAAMR,QAAQS,SAAS;IACzB;AACF;AAEA,SAAS7D;IACP,IAAI8D,QAAQ3D,QAAQ,KAAK,UAAU;QACjCM,KAAIsD,IAAI,CACNC,IAAAA,gBAAK,CAAA,CAAC,+FAA+F,CAAC;IAE1G;AACF"}
1
+ {"version":3,"sources":["../../../../src/run/ios/runIosAsync.ts"],"sourcesContent":["import { getConfig } from '@expo/config';\nimport spawnAsync from '@expo/spawn-async';\nimport chalk from 'chalk';\nimport fs from 'fs';\nimport path from 'path';\n\nimport * as Log from '../../log';\nimport { AppleAppIdResolver } from '../../start/platforms/ios/AppleAppIdResolver';\nimport { maybePromptToSyncPodsAsync } from '../../utils/cocoapods';\nimport { setNodeEnv } from '../../utils/nodeEnv';\nimport { ensurePortAvailabilityAsync } from '../../utils/port';\nimport { profile } from '../../utils/profile';\nimport { getSchemesForIosAsync } from '../../utils/scheme';\nimport { ensureNativeProjectAsync } from '../ensureNativeProject';\nimport { logProjectLogsLocation } from '../hints';\nimport { uploadRemoteBuildCache, resolveRemoteBuildCache } from '../remoteBuildCache';\nimport { startBundlerAsync } from '../startBundler';\nimport * as XcodeBuild from './XcodeBuild';\nimport { Options } from './XcodeBuild.types';\nimport { getLaunchInfoForBinaryAsync, launchAppAsync } from './launchApp';\nimport { resolveOptionsAsync } from './options/resolveOptions';\nimport { getValidBinaryPathAsync } from './validateExternalBinary';\nimport { exportEagerAsync } from '../../export/embed/exportEager';\nimport { getContainerPathAsync, simctlAsync } from '../../start/platforms/ios/simctl';\nimport { CommandError } from '../../utils/errors';\n\nconst debug = require('debug')('expo:run:ios');\n\nexport async function runIosAsync(projectRoot: string, options: Options) {\n setNodeEnv(options.configuration === 'Release' ? 'production' : 'development');\n require('@expo/env').load(projectRoot);\n\n assertPlatform();\n\n const install = !!options.install;\n\n if ((await ensureNativeProjectAsync(projectRoot, { platform: 'ios', install })) && install) {\n await maybePromptToSyncPodsAsync(projectRoot);\n }\n\n // Resolve the CLI arguments into useable options.\n const props = await profile(resolveOptionsAsync)(projectRoot, options);\n\n const projectConfig = getConfig(projectRoot);\n if (!options.binary && projectConfig.exp.experiments?.remoteBuildCache && props.isSimulator) {\n const localPath = await resolveRemoteBuildCache(projectRoot, {\n platform: 'ios',\n provider: projectConfig.exp.experiments?.remoteBuildCache.provider,\n });\n if (localPath) {\n options.binary = localPath;\n }\n }\n\n if (options.rebundle) {\n Log.warn(`The --unstable-rebundle flag is experimental and may not work as expected.`);\n // Get the existing binary path to re-bundle the app.\n\n let binaryPath: string;\n if (!options.binary) {\n if (!props.isSimulator) {\n throw new Error('Re-bundling on physical devices requires the --binary flag.');\n }\n const appId = await new AppleAppIdResolver(projectRoot).getAppIdAsync();\n const possibleBinaryPath = await getContainerPathAsync(props.device, {\n appId,\n });\n if (!possibleBinaryPath) {\n throw new CommandError(\n `Cannot rebundle because no --binary was provided and no existing binary was found on the device for ID: ${appId}.`\n );\n }\n binaryPath = possibleBinaryPath;\n Log.log('Re-using existing binary path:', binaryPath);\n // Set the binary path to the existing binary path.\n options.binary = binaryPath;\n }\n\n Log.log('Rebundling the Expo config file');\n // Re-bundle the config file the same way the app was originally bundled.\n await spawnAsync('node', [\n path.join(require.resolve('expo-constants/package.json'), '../scripts/getAppConfig.js'),\n projectRoot,\n path.join(options.binary, 'EXConstants.bundle'),\n ]);\n // Re-bundle the app.\n\n const possibleBundleOutput = path.join(options.binary, 'main.jsbundle');\n\n if (fs.existsSync(possibleBundleOutput)) {\n Log.log('Rebundling the app...');\n await exportEagerAsync(projectRoot, {\n resetCache: false,\n dev: false,\n platform: 'ios',\n assetsDest: path.join(options.binary, 'assets'),\n bundleOutput: possibleBundleOutput,\n });\n } else {\n Log.warn('Bundle output not found at expected location:', possibleBundleOutput);\n }\n }\n\n let binaryPath: string;\n let shouldUpdateBuildCache = false;\n if (options.binary) {\n binaryPath = await getValidBinaryPathAsync(options.binary, props);\n Log.log('Using custom binary path:', binaryPath);\n } else {\n let eagerBundleOptions: string | undefined;\n\n if (options.configuration === 'Release') {\n eagerBundleOptions = JSON.stringify(\n await exportEagerAsync(projectRoot, {\n dev: false,\n platform: 'ios',\n })\n );\n }\n\n // Spawn the `xcodebuild` process to create the app binary.\n const buildOutput = await XcodeBuild.buildAsync({\n ...props,\n eagerBundleOptions,\n });\n\n // Find the path to the built app binary, this will be used to install the binary\n // on a device.\n binaryPath = await profile(XcodeBuild.getAppBinaryPath)(buildOutput);\n shouldUpdateBuildCache = true;\n }\n debug('Binary path:', binaryPath);\n\n // Ensure the port hasn't become busy during the build.\n if (props.shouldStartBundler && !(await ensurePortAvailabilityAsync(projectRoot, props))) {\n props.shouldStartBundler = false;\n }\n\n const launchInfo = await getLaunchInfoForBinaryAsync(binaryPath);\n const isCustomBinary = !!options.binary;\n\n // Always close the app before launching on a simulator. Otherwise certain cached resources like the splashscreen will not be available.\n if (props.isSimulator) {\n try {\n await simctlAsync(['terminate', props.device.udid, launchInfo.bundleId]);\n } catch (error) {\n // If we failed it's likely that the app was not running to begin with and we will get an `invalid device` error\n debug('Failed to terminate app (possibly because it was not running):', error);\n }\n }\n\n // Start the dev server which creates all of the required info for\n // launching the app on a simulator.\n const manager = await startBundlerAsync(projectRoot, {\n port: props.port,\n headless: !props.shouldStartBundler,\n // If a scheme is specified then use that instead of the package name.\n\n scheme: isCustomBinary\n ? // If launching a custom binary, use the schemes in the Info.plist.\n launchInfo.schemes[0]\n : // If a scheme is specified then use that instead of the package name.\n (await getSchemesForIosAsync(projectRoot))?.[0],\n });\n\n // Install and launch the app binary on a device.\n await launchAppAsync(\n binaryPath,\n manager,\n {\n isSimulator: props.isSimulator,\n device: props.device,\n shouldStartBundler: props.shouldStartBundler,\n },\n launchInfo.bundleId\n );\n\n // Log the location of the JS logs for the device.\n if (props.shouldStartBundler) {\n logProjectLogsLocation();\n } else {\n await manager.stopAsync();\n }\n\n if (shouldUpdateBuildCache && projectConfig.exp.experiments?.remoteBuildCache) {\n await uploadRemoteBuildCache(projectRoot, {\n platform: 'ios',\n provider: projectConfig.exp.experiments?.remoteBuildCache.provider,\n });\n }\n}\n\nfunction assertPlatform() {\n if (process.platform !== 'darwin') {\n Log.exit(\n chalk`iOS apps can only be built on macOS devices. Use {cyan eas build -p ios} to build in the cloud.`\n );\n }\n}\n"],"names":["runIosAsync","debug","require","projectRoot","options","projectConfig","setNodeEnv","configuration","load","assertPlatform","install","ensureNativeProjectAsync","platform","maybePromptToSyncPodsAsync","props","profile","resolveOptionsAsync","getConfig","binary","exp","experiments","remoteBuildCache","isSimulator","localPath","resolveRemoteBuildCache","provider","rebundle","Log","warn","binaryPath","Error","appId","AppleAppIdResolver","getAppIdAsync","possibleBinaryPath","getContainerPathAsync","device","CommandError","log","spawnAsync","path","join","resolve","possibleBundleOutput","fs","existsSync","exportEagerAsync","resetCache","dev","assetsDest","bundleOutput","shouldUpdateBuildCache","getValidBinaryPathAsync","eagerBundleOptions","JSON","stringify","buildOutput","XcodeBuild","buildAsync","getAppBinaryPath","shouldStartBundler","ensurePortAvailabilityAsync","launchInfo","getLaunchInfoForBinaryAsync","isCustomBinary","simctlAsync","udid","bundleId","error","manager","startBundlerAsync","port","headless","scheme","schemes","getSchemesForIosAsync","launchAppAsync","logProjectLogsLocation","stopAsync","uploadRemoteBuildCache","process","exit","chalk"],"mappings":";;;;+BA4BsBA;;;eAAAA;;;;yBA5BI;;;;;;;gEACH;;;;;;;gEACL;;;;;;;gEACH;;;;;;;gEACE;;;;;;6DAEI;oCACc;2BACQ;yBAChB;sBACiB;yBACpB;wBACc;qCACG;uBACF;kCACyB;8BAC9B;oEACN;2BAEgC;gCACxB;wCACI;6BACP;wBACkB;wBACtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE7B,MAAMC,QAAQC,QAAQ,SAAS;AAExB,eAAeF,YAAYG,WAAmB,EAAEC,OAAgB;QAgB9CC,gCAsHhB,OAsBuBA;IA3J9BC,IAAAA,mBAAU,EAACF,QAAQG,aAAa,KAAK,YAAY,eAAe;IAChEL,QAAQ,aAAaM,IAAI,CAACL;IAE1BM;IAEA,MAAMC,UAAU,CAAC,CAACN,QAAQM,OAAO;IAEjC,IAAI,AAAC,MAAMC,IAAAA,6CAAwB,EAACR,aAAa;QAAES,UAAU;QAAOF;IAAQ,MAAOA,SAAS;QAC1F,MAAMG,IAAAA,qCAA0B,EAACV;IACnC;IAEA,kDAAkD;IAClD,MAAMW,QAAQ,MAAMC,IAAAA,gBAAO,EAACC,mCAAmB,EAAEb,aAAaC;IAE9D,MAAMC,gBAAgBY,IAAAA,mBAAS,EAACd;IAChC,IAAI,CAACC,QAAQc,MAAM,MAAIb,iCAAAA,cAAcc,GAAG,CAACC,WAAW,qBAA7Bf,+BAA+BgB,gBAAgB,KAAIP,MAAMQ,WAAW,EA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E,MAAM,kEAAkEmE;QAC1E;IACF;IAEA,kEAAkE;IAClE,oCAAoC;IACpC,MAAMC,UAAU,MAAMC,IAAAA,+BAAiB,EAACnE,aAAa;QACnDoE,MAAMzD,MAAMyD,IAAI;QAChBC,UAAU,CAAC1D,MAAM8C,kBAAkB;QACnC,sEAAsE;QAEtEa,QAAQT,iBAEJF,WAAWY,OAAO,CAAC,EAAE,IAEpB,QAAA,MAAMC,IAAAA,6BAAqB,EAACxE,iCAA7B,AAAC,KAA2C,CAAC,EAAE;IACrD;IAEA,iDAAiD;IACjD,MAAMyE,IAAAA,yBAAc,EAClB/C,YACAwC,SACA;QACE/C,aAAaR,MAAMQ,WAAW;QAC9Bc,QAAQtB,MAAMsB,MAAM;QACpBwB,oBAAoB9C,MAAM8C,kBAAkB;IAC9C,GACAE,WAAWK,QAAQ;IAGrB,kDAAkD;IAClD,IAAIrD,MAAM8C,kBAAkB,EAAE;QAC5BiB,IAAAA,6BAAsB;IACxB,OAAO;QACL,MAAMR,QAAQS,SAAS;IACzB;IAEA,IAAI3B,4BAA0B9C,kCAAAA,cAAcc,GAAG,CAACC,WAAW,qBAA7Bf,gCAA+BgB,gBAAgB,GAAE;YAGjEhB;QAFZ,MAAM0E,IAAAA,wCAAsB,EAAC5E,aAAa;YACxCS,UAAU;YACVa,QAAQ,GAAEpB,kCAAAA,cAAcc,GAAG,CAACC,WAAW,qBAA7Bf,gCAA+BgB,gBAAgB,CAACI,QAAQ;QACpE;IACF;AACF;AAEA,SAAShB;IACP,IAAIuE,QAAQpE,QAAQ,KAAK,UAAU;QACjCe,KAAIsD,IAAI,CACNC,IAAAA,gBAAK,CAAA,CAAC,+FAA+F,CAAC;IAE1G;AACF"}
@@ -0,0 +1,135 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: all[name]
9
+ });
10
+ }
11
+ _export(exports, {
12
+ resolveRemoteBuildCache: function() {
13
+ return resolveRemoteBuildCache;
14
+ },
15
+ uploadRemoteBuildCache: function() {
16
+ return uploadRemoteBuildCache;
17
+ }
18
+ });
19
+ function _spawnasync() {
20
+ const data = /*#__PURE__*/ _interop_require_default(require("@expo/spawn-async"));
21
+ _spawnasync = function() {
22
+ return data;
23
+ };
24
+ return data;
25
+ }
26
+ function _fs() {
27
+ const data = /*#__PURE__*/ _interop_require_default(require("fs"));
28
+ _fs = function() {
29
+ return data;
30
+ };
31
+ return data;
32
+ }
33
+ function _path() {
34
+ const data = /*#__PURE__*/ _interop_require_default(require("path"));
35
+ _path = function() {
36
+ return data;
37
+ };
38
+ return data;
39
+ }
40
+ const _log = require("../log");
41
+ function _interop_require_default(obj) {
42
+ return obj && obj.__esModule ? obj : {
43
+ default: obj
44
+ };
45
+ }
46
+ const debug = require('debug')('expo:run:remote-build');
47
+ async function resolveRemoteBuildCache(projectRoot, { platform, provider }) {
48
+ const Fingerprint = importFingerprintForDev(projectRoot);
49
+ if (!Fingerprint) {
50
+ debug('@expo/fingerprint is not installed in the project, skip checking for remote builds');
51
+ return null;
52
+ }
53
+ const fingerprint = await Fingerprint.createFingerprintAsync(projectRoot);
54
+ if (provider === 'eas') {
55
+ const easJsonPath = _path().default.join(projectRoot, 'eas.json');
56
+ if (!_fs().default.existsSync(easJsonPath)) {
57
+ debug('eas.json not found, skip checking for remote builds');
58
+ return null;
59
+ }
60
+ _log.Log.log(`Searching builds with matching fingerprint on EAS servers`);
61
+ try {
62
+ const results = await (0, _spawnasync().default)('npx', [
63
+ 'eas-cli',
64
+ 'build:download',
65
+ `--platform=${platform}`,
66
+ `--fingerprint=${fingerprint.hash}`,
67
+ '--non-interactive',
68
+ '--dev-client',
69
+ '--json'
70
+ ], {
71
+ cwd: projectRoot
72
+ });
73
+ _log.Log.log(`Successfully downloaded cached build`);
74
+ // {
75
+ // "path": "/var/folders/03/lppcpcnn61q3mz5ckzmzd8w80000gn/T/eas-cli-nodejs/eas-build-run-cache/c0f9ba9c-0cf1-4c5c-8566-b28b7971050f_22f1bbfa-1c09-4b67-9e4a-721906546b58.app"
76
+ // }
77
+ const json = JSON.parse(results.stdout.trim());
78
+ return json == null ? void 0 : json.path;
79
+ } catch (error) {
80
+ debug('eas-cli error:', error);
81
+ return null;
82
+ }
83
+ }
84
+ return null;
85
+ }
86
+ async function uploadRemoteBuildCache(projectRoot, { platform, provider }) {
87
+ const Fingerprint = importFingerprintForDev(projectRoot);
88
+ if (!Fingerprint) {
89
+ debug('@expo/fingerprint is not installed in the project, skip checking for remote builds');
90
+ return null;
91
+ }
92
+ const fingerprint = await Fingerprint.createFingerprintAsync(projectRoot);
93
+ if (provider === 'eas') {
94
+ const easJsonPath = _path().default.join(projectRoot, 'eas.json');
95
+ if (!_fs().default.existsSync(easJsonPath)) {
96
+ debug('eas.json not found, skip checking for remote builds');
97
+ return null;
98
+ }
99
+ try {
100
+ _log.Log.log('Uploading build to remote cache');
101
+ const results = await (0, _spawnasync().default)('npx', [
102
+ 'eas-cli',
103
+ 'upload',
104
+ `--platform=${platform}`,
105
+ `--fingerprint=${fingerprint.hash}`,
106
+ '--non-interactive',
107
+ '--json'
108
+ ], {
109
+ cwd: projectRoot
110
+ });
111
+ // {
112
+ // "url": "/var/folders/03/lppcpcnn61q3mz5ckzmzd8w80000gn/T/eas-cli-nodejs/eas-build-run-cache/c0f9ba9c-0cf1-4c5c-8566-b28b7971050f_22f1bbfa-1c09-4b67-9e4a-721906546b58.app"
113
+ // }
114
+ const json = JSON.parse(results.stdout.trim());
115
+ _log.Log.log(`Build successfully uploaded: ${json == null ? void 0 : json.url}`);
116
+ } catch (error) {
117
+ debug('eas-cli error:', error);
118
+ return null;
119
+ }
120
+ }
121
+ return null;
122
+ }
123
+ function importFingerprintForDev(projectRoot) {
124
+ try {
125
+ return require(require.resolve('@expo/fingerprint', {
126
+ paths: [
127
+ projectRoot
128
+ ]
129
+ }));
130
+ } catch {
131
+ return null;
132
+ }
133
+ }
134
+
135
+ //# sourceMappingURL=remoteBuildCache.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/run/remoteBuildCache.ts"],"sourcesContent":["import { ExpoConfig } from '@expo/config';\nimport { ModPlatform } from '@expo/config-plugins';\nimport spawnAsync from '@expo/spawn-async';\nimport fs from 'fs';\nimport path from 'path';\n\nimport { Log } from '../log';\n\nconst debug = require('debug')('expo:run:remote-build') as typeof console.log;\n\nexport async function resolveRemoteBuildCache(\n projectRoot: string,\n {\n platform,\n provider,\n }: {\n platform: ModPlatform;\n provider?: Required<Required<ExpoConfig>['experiments']>['remoteBuildCache']['provider'];\n }\n): Promise<string | null> {\n const Fingerprint = importFingerprintForDev(projectRoot);\n if (!Fingerprint) {\n debug('@expo/fingerprint is not installed in the project, skip checking for remote builds');\n return null;\n }\n const fingerprint = await Fingerprint.createFingerprintAsync(projectRoot);\n\n if (provider === 'eas') {\n const easJsonPath = path.join(projectRoot, 'eas.json');\n if (!fs.existsSync(easJsonPath)) {\n debug('eas.json not found, skip checking for remote builds');\n return null;\n }\n\n Log.log(`Searching builds with matching fingerprint on EAS servers`);\n try {\n const results = await spawnAsync(\n 'npx',\n [\n 'eas-cli',\n 'build:download',\n `--platform=${platform}`,\n `--fingerprint=${fingerprint.hash}`,\n '--non-interactive',\n '--dev-client',\n '--json',\n ],\n {\n cwd: projectRoot,\n }\n );\n\n Log.log(`Successfully downloaded cached build`);\n // {\n // \"path\": \"/var/folders/03/lppcpcnn61q3mz5ckzmzd8w80000gn/T/eas-cli-nodejs/eas-build-run-cache/c0f9ba9c-0cf1-4c5c-8566-b28b7971050f_22f1bbfa-1c09-4b67-9e4a-721906546b58.app\"\n // }\n const json = JSON.parse(results.stdout.trim());\n return json?.path;\n } catch (error) {\n debug('eas-cli error:', error);\n return null;\n }\n }\n\n return null;\n}\n\nexport async function uploadRemoteBuildCache(\n projectRoot: string,\n {\n platform,\n provider,\n }: {\n platform: ModPlatform;\n provider?: Required<Required<ExpoConfig>['experiments']>['remoteBuildCache']['provider'];\n }\n): Promise<string | null> {\n const Fingerprint = importFingerprintForDev(projectRoot);\n if (!Fingerprint) {\n debug('@expo/fingerprint is not installed in the project, skip checking for remote builds');\n return null;\n }\n const fingerprint = await Fingerprint.createFingerprintAsync(projectRoot);\n\n if (provider === 'eas') {\n const easJsonPath = path.join(projectRoot, 'eas.json');\n if (!fs.existsSync(easJsonPath)) {\n debug('eas.json not found, skip checking for remote builds');\n return null;\n }\n\n try {\n Log.log('Uploading build to remote cache');\n const results = await spawnAsync(\n 'npx',\n [\n 'eas-cli',\n 'upload',\n `--platform=${platform}`,\n `--fingerprint=${fingerprint.hash}`,\n '--non-interactive',\n '--json',\n ],\n {\n cwd: projectRoot,\n }\n );\n // {\n // \"url\": \"/var/folders/03/lppcpcnn61q3mz5ckzmzd8w80000gn/T/eas-cli-nodejs/eas-build-run-cache/c0f9ba9c-0cf1-4c5c-8566-b28b7971050f_22f1bbfa-1c09-4b67-9e4a-721906546b58.app\"\n // }\n const json = JSON.parse(results.stdout.trim());\n Log.log(`Build successfully uploaded: ${json?.url}`);\n } catch (error) {\n debug('eas-cli error:', error);\n return null;\n }\n }\n\n return null;\n}\n\nfunction importFingerprintForDev(projectRoot: string): null | typeof import('@expo/fingerprint') {\n try {\n return require(require.resolve('@expo/fingerprint', { paths: [projectRoot] }));\n } catch {\n return null;\n }\n}\n"],"names":["resolveRemoteBuildCache","uploadRemoteBuildCache","debug","require","projectRoot","platform","provider","Fingerprint","importFingerprintForDev","fingerprint","createFingerprintAsync","easJsonPath","path","join","fs","existsSync","Log","log","results","spawnAsync","hash","cwd","json","JSON","parse","stdout","trim","error","url","resolve","paths"],"mappings":";;;;;;;;;;;IAUsBA,uBAAuB;eAAvBA;;IAyDAC,sBAAsB;eAAtBA;;;;gEAjEC;;;;;;;gEACR;;;;;;;gEACE;;;;;;qBAEG;;;;;;AAEpB,MAAMC,QAAQC,QAAQ,SAAS;AAExB,eAAeH,wBACpBI,WAAmB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YACFc,QAAG,CAACC,GAAG,CAAC;YACR,MAAMC,UAAU,MAAMC,IAAAA,qBAAU,EAC9B,OACA;gBACE;gBACA;gBACA,CAAC,WAAW,EAAEd,UAAU;gBACxB,CAAC,cAAc,EAAEI,YAAYW,IAAI,EAAE;gBACnC;gBACA;aACD,EACD;gBACEC,KAAKjB;YACP;YAEF,IAAI;YACJ,+KAA+K;YAC/K,IAAI;YACJ,MAAMkB,OAAOC,KAAKC,KAAK,CAACN,QAAQO,MAAM,CAACC,IAAI;YAC3CV,QAAG,CAACC,GAAG,CAAC,CAAC,6BAA6B,EAAEK,wBAAAA,KAAMM,GAAG,EAAE;QACrD,EAAE,OAAOD,OAAO;YACdzB,MAAM,kBAAkByB;YACxB,OAAO;QACT;IACF;IAEA,OAAO;AACT;AAEA,SAASnB,wBAAwBJ,WAAmB;IAClD,IAAI;QACF,OAAOD,QAAQA,QAAQ0B,OAAO,CAAC,qBAAqB;YAAEC,OAAO;gBAAC1B;aAAY;QAAC;IAC7E,EAAE,OAAM;QACN,OAAO;IACT;AACF"}
@@ -33,7 +33,7 @@ class FetchClient {
33
33
  this.headers = {
34
34
  accept: 'application/json',
35
35
  'content-type': 'application/json',
36
- 'user-agent': `expo-cli/${"0.23.2"}`,
36
+ 'user-agent': `expo-cli/${"0.23.3"}`,
37
37
  authorization: 'Basic ' + _nodebuffer().Buffer.from(`${target}:`).toString('base64')
38
38
  };
39
39
  }
@@ -83,7 +83,7 @@ function createContext() {
83
83
  cpu: summarizeCpuInfo(),
84
84
  app: {
85
85
  name: 'expo/cli',
86
- version: "0.23.2"
86
+ version: "0.23.3"
87
87
  },
88
88
  ci: _ciinfo().isCI ? {
89
89
  name: _ciinfo().name,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@expo/cli",
3
- "version": "0.23.2",
3
+ "version": "0.23.3",
4
4
  "description": "The Expo CLI",
5
5
  "main": "build/bin/cli",
6
6
  "bin": {
@@ -152,5 +152,5 @@
152
152
  "tree-kill": "^1.2.2",
153
153
  "tsd": "^0.28.1"
154
154
  },
155
- "gitHead": "1914bb35d23af23078da37e70988261844436505"
155
+ "gitHead": "c0356b18430ea33f7a0be93e173dfd2ca00edc88"
156
156
  }