@expo/cli 0.24.6 → 0.24.8

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 (28) hide show
  1. package/build/bin/cli +1 -1
  2. package/build/src/run/android/resolveOptions.js +13 -1
  3. package/build/src/run/android/resolveOptions.js.map +1 -1
  4. package/build/src/run/android/runAndroidAsync.js +17 -24
  5. package/build/src/run/android/runAndroidAsync.js.map +1 -1
  6. package/build/src/run/ios/options/resolveOptions.js +13 -1
  7. package/build/src/run/ios/options/resolveOptions.js.map +1 -1
  8. package/build/src/run/ios/runIosAsync.js +20 -19
  9. package/build/src/run/ios/runIosAsync.js.map +1 -1
  10. package/build/src/start/server/metro/createExpoFallbackResolver.js +6 -4
  11. package/build/src/start/server/metro/createExpoFallbackResolver.js.map +1 -1
  12. package/build/src/start/server/metro/instantiateMetro.js +2 -2
  13. package/build/src/start/server/metro/instantiateMetro.js.map +1 -1
  14. package/build/src/start/server/metro/withMetroMultiPlatform.js +1 -0
  15. package/build/src/start/server/metro/withMetroMultiPlatform.js.map +1 -1
  16. package/build/src/utils/remote-build-cache-providers/eas.js +12 -2
  17. package/build/src/utils/remote-build-cache-providers/eas.js.map +1 -1
  18. package/build/src/utils/remote-build-cache-providers/helpers.js +55 -3
  19. package/build/src/utils/remote-build-cache-providers/helpers.js.map +1 -1
  20. package/build/src/utils/remote-build-cache-providers/index.js +168 -0
  21. package/build/src/utils/remote-build-cache-providers/index.js.map +1 -0
  22. package/build/src/utils/telemetry/clients/FetchClient.js +1 -1
  23. package/build/src/utils/telemetry/utils/context.js +1 -1
  24. package/build/src/utils/tsconfig/evaluateTsConfig.js +7 -2
  25. package/build/src/utils/tsconfig/evaluateTsConfig.js.map +1 -1
  26. package/package.json +6 -6
  27. package/build/src/run/remoteBuildCache.js +0 -80
  28. package/build/src/run/remoteBuildCache.js.map +0 -1
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.24.6");
126
+ console.log("0.24.8");
127
127
  process.exit(0);
128
128
  }
129
129
  if (args['--non-interactive']) {
@@ -8,13 +8,24 @@ Object.defineProperty(exports, "resolveOptionsAsync", {
8
8
  return resolveOptionsAsync;
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
  const _resolveDevice = require("./resolveDevice");
12
19
  const _resolveGradlePropsAsync = require("./resolveGradlePropsAsync");
13
20
  const _resolveLaunchProps = require("./resolveLaunchProps");
21
+ const _remotebuildcacheproviders = require("../../utils/remote-build-cache-providers");
14
22
  const _resolveBundlerProps = require("../resolveBundlerProps");
15
23
  async function resolveOptionsAsync(projectRoot, options) {
24
+ var _projectConfig_exp_experiments_remoteBuildCache, _projectConfig_exp_experiments;
16
25
  // Resolve the device before the gradle props because we need the device to be running to get the ABI.
17
26
  const device = await (0, _resolveDevice.resolveDeviceAsync)(options.device);
27
+ const projectConfig = (0, _config().getConfig)(projectRoot);
28
+ const buildCacheProvider = (0, _remotebuildcacheproviders.resolveRemoteBuildCacheProvider)((_projectConfig_exp_experiments = projectConfig.exp.experiments) == null ? void 0 : (_projectConfig_exp_experiments_remoteBuildCache = _projectConfig_exp_experiments.remoteBuildCache) == null ? void 0 : _projectConfig_exp_experiments_remoteBuildCache.provider, projectRoot);
18
29
  return {
19
30
  ...await (0, _resolveBundlerProps.resolveBundlerPropsAsync)(projectRoot, options),
20
31
  ...await (0, _resolveGradlePropsAsync.resolveGradlePropsAsync)(projectRoot, options, device.device),
@@ -24,7 +35,8 @@ async function resolveOptionsAsync(projectRoot, options) {
24
35
  // from a list of devices (connected or simulated) that are filtered by the scheme.
25
36
  device,
26
37
  buildCache: !!options.buildCache,
27
- install: !!options.install
38
+ install: !!options.install,
39
+ buildCacheProvider
28
40
  };
29
41
  }
30
42
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/run/android/resolveOptions.ts"],"sourcesContent":["import { resolveDeviceAsync } from './resolveDevice';\nimport { GradleProps, resolveGradlePropsAsync } from './resolveGradlePropsAsync';\nimport { LaunchProps, resolveLaunchPropsAsync } from './resolveLaunchProps';\nimport { AndroidDeviceManager } from '../../start/platforms/android/AndroidDeviceManager';\nimport { BundlerProps, resolveBundlerPropsAsync } from '../resolveBundlerProps';\n\nexport type Options = {\n variant?: string;\n device?: boolean | string;\n port?: number;\n bundler?: boolean;\n install?: boolean;\n buildCache?: boolean;\n allArch?: boolean;\n binary?: string;\n appId?: string;\n};\n\nexport type ResolvedOptions = GradleProps &\n BundlerProps &\n LaunchProps & {\n variant: string;\n buildCache: boolean;\n device: AndroidDeviceManager;\n install: boolean;\n architectures?: string;\n appId?: string;\n };\n\nexport async function resolveOptionsAsync(\n projectRoot: string,\n options: Options\n): Promise<ResolvedOptions> {\n // Resolve the device before the gradle props because we need the device to be running to get the ABI.\n const device = await resolveDeviceAsync(options.device);\n\n return {\n ...(await resolveBundlerPropsAsync(projectRoot, options)),\n ...(await resolveGradlePropsAsync(projectRoot, options, device.device)),\n ...(await resolveLaunchPropsAsync(projectRoot, options)),\n variant: options.variant ?? 'debug',\n // Resolve the device based on the provided device id or prompt\n // from a list of devices (connected or simulated) that are filtered by the scheme.\n device,\n buildCache: !!options.buildCache,\n install: !!options.install,\n };\n}\n"],"names":["resolveOptionsAsync","projectRoot","options","device","resolveDeviceAsync","resolveBundlerPropsAsync","resolveGradlePropsAsync","resolveLaunchPropsAsync","variant","buildCache","install"],"mappings":";;;;+BA6BsBA;;;eAAAA;;;+BA7Ba;yCACkB;oCACA;qCAEE;AAyBhD,eAAeA,oBACpBC,WAAmB,EACnBC,OAAgB;IAEhB,sGAAsG;IACtG,MAAMC,SAAS,MAAMC,IAAAA,iCAAkB,EAACF,QAAQC,MAAM;IAEtD,OAAO;QACL,GAAI,MAAME,IAAAA,6CAAwB,EAACJ,aAAaC,QAAQ;QACxD,GAAI,MAAMI,IAAAA,gDAAuB,EAACL,aAAaC,SAASC,OAAOA,MAAM,CAAC;QACtE,GAAI,MAAMI,IAAAA,2CAAuB,EAACN,aAAaC,QAAQ;QACvDM,SAASN,QAAQM,OAAO,IAAI;QAC5B,+DAA+D;QAC/D,mFAAmF;QACnFL;QACAM,YAAY,CAAC,CAACP,QAAQO,UAAU;QAChCC,SAAS,CAAC,CAACR,QAAQQ,OAAO;IAC5B;AACF"}
1
+ {"version":3,"sources":["../../../../src/run/android/resolveOptions.ts"],"sourcesContent":["import { getConfig, RemoteBuildCacheProvider } from '@expo/config';\n\nimport { resolveDeviceAsync } from './resolveDevice';\nimport { GradleProps, resolveGradlePropsAsync } from './resolveGradlePropsAsync';\nimport { LaunchProps, resolveLaunchPropsAsync } from './resolveLaunchProps';\nimport { AndroidDeviceManager } from '../../start/platforms/android/AndroidDeviceManager';\nimport { resolveRemoteBuildCacheProvider } from '../../utils/remote-build-cache-providers';\nimport { BundlerProps, resolveBundlerPropsAsync } from '../resolveBundlerProps';\n\nexport type Options = {\n variant?: string;\n device?: boolean | string;\n port?: number;\n bundler?: boolean;\n install?: boolean;\n buildCache?: boolean;\n allArch?: boolean;\n binary?: string;\n appId?: string;\n};\n\nexport type ResolvedOptions = GradleProps &\n BundlerProps &\n LaunchProps & {\n variant: string;\n buildCache: boolean;\n device: AndroidDeviceManager;\n install: boolean;\n architectures?: string;\n appId?: string;\n buildCacheProvider?: RemoteBuildCacheProvider;\n };\n\nexport async function resolveOptionsAsync(\n projectRoot: string,\n options: Options\n): Promise<ResolvedOptions> {\n // Resolve the device before the gradle props because we need the device to be running to get the ABI.\n const device = await resolveDeviceAsync(options.device);\n\n const projectConfig = getConfig(projectRoot);\n const buildCacheProvider = resolveRemoteBuildCacheProvider(\n projectConfig.exp.experiments?.remoteBuildCache?.provider,\n projectRoot\n );\n\n return {\n ...(await resolveBundlerPropsAsync(projectRoot, options)),\n ...(await resolveGradlePropsAsync(projectRoot, options, device.device)),\n ...(await resolveLaunchPropsAsync(projectRoot, options)),\n variant: options.variant ?? 'debug',\n // Resolve the device based on the provided device id or prompt\n // from a list of devices (connected or simulated) that are filtered by the scheme.\n device,\n buildCache: !!options.buildCache,\n install: !!options.install,\n buildCacheProvider,\n };\n}\n"],"names":["resolveOptionsAsync","projectRoot","options","projectConfig","device","resolveDeviceAsync","getConfig","buildCacheProvider","resolveRemoteBuildCacheProvider","exp","experiments","remoteBuildCache","provider","resolveBundlerPropsAsync","resolveGradlePropsAsync","resolveLaunchPropsAsync","variant","buildCache","install"],"mappings":";;;;+BAiCsBA;;;eAAAA;;;;yBAjC8B;;;;;;+BAEjB;yCACkB;oCACA;2CAEL;qCACO;AA0BhD,eAAeA,oBACpBC,WAAmB,EACnBC,OAAgB;QAOdC,iDAAAA;IALF,sGAAsG;IACtG,MAAMC,SAAS,MAAMC,IAAAA,iCAAkB,EAACH,QAAQE,MAAM;IAEtD,MAAMD,gBAAgBG,IAAAA,mBAAS,EAACL;IAChC,MAAMM,qBAAqBC,IAAAA,0DAA+B,GACxDL,iCAAAA,cAAcM,GAAG,CAACC,WAAW,sBAA7BP,kDAAAA,+BAA+BQ,gBAAgB,qBAA/CR,gDAAiDS,QAAQ,EACzDX;IAGF,OAAO;QACL,GAAI,MAAMY,IAAAA,6CAAwB,EAACZ,aAAaC,QAAQ;QACxD,GAAI,MAAMY,IAAAA,gDAAuB,EAACb,aAAaC,SAASE,OAAOA,MAAM,CAAC;QACtE,GAAI,MAAMW,IAAAA,2CAAuB,EAACd,aAAaC,QAAQ;QACvDc,SAASd,QAAQc,OAAO,IAAI;QAC5B,+DAA+D;QAC/D,mFAAmF;QACnFZ;QACAa,YAAY,CAAC,CAACf,QAAQe,UAAU;QAChCC,SAAS,CAAC,CAAChB,QAAQgB,OAAO;QAC1BX;IACF;AACF"}
@@ -8,13 +8,6 @@ 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
- }
18
11
  function _chalk() {
19
12
  const data = /*#__PURE__*/ _interop_require_default(require("chalk"));
20
13
  _chalk = function() {
@@ -44,10 +37,10 @@ const _gradle = require("../../start/platforms/android/gradle");
44
37
  const _errors = require("../../utils/errors");
45
38
  const _nodeEnv = require("../../utils/nodeEnv");
46
39
  const _port = require("../../utils/port");
40
+ const _remotebuildcacheproviders = require("../../utils/remote-build-cache-providers");
47
41
  const _scheme = require("../../utils/scheme");
48
42
  const _ensureNativeProject = require("../ensureNativeProject");
49
43
  const _hints = require("../hints");
50
- const _remoteBuildCache = require("../remoteBuildCache");
51
44
  const _startBundler = require("../startBundler");
52
45
  function _interop_require_default(obj) {
53
46
  return obj && obj.__esModule ? obj : {
@@ -56,28 +49,27 @@ function _interop_require_default(obj) {
56
49
  }
57
50
  const debug = require('debug')('expo:run:android');
58
51
  async function runAndroidAsync(projectRoot, { install, ...options }) {
59
- var _options_variant, _projectConfig_exp_experiments, _this, _projectConfig_exp_experiments1;
52
+ var _options_variant, _this;
60
53
  // NOTE: This is a guess, the developer can overwrite with `NODE_ENV`.
61
54
  const isProduction = (_options_variant = options.variant) == null ? void 0 : _options_variant.toLowerCase().endsWith('release');
62
55
  (0, _nodeEnv.setNodeEnv)(isProduction ? 'production' : 'development');
63
56
  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, {
57
+ await (0, _ensureNativeProject.ensureNativeProjectAsync)(projectRoot, {
58
+ platform: 'android',
59
+ install
60
+ });
61
+ const props = await (0, _resolveOptions.resolveOptionsAsync)(projectRoot, options);
62
+ if (!options.binary && props.buildCacheProvider) {
63
+ const localPath = await (0, _remotebuildcacheproviders.resolveRemoteBuildCache)({
64
+ projectRoot,
68
65
  platform: 'android',
69
- provider: (_projectConfig_exp_experiments2 = projectConfig.exp.experiments) == null ? void 0 : _projectConfig_exp_experiments2.remoteBuildCache.provider,
66
+ provider: props.buildCacheProvider,
70
67
  runOptions: options
71
68
  });
72
69
  if (localPath) {
73
70
  options.binary = localPath;
74
71
  }
75
72
  }
76
- await (0, _ensureNativeProject.ensureNativeProjectAsync)(projectRoot, {
77
- platform: 'android',
78
- install
79
- });
80
- const props = await (0, _resolveOptions.resolveOptionsAsync)(projectRoot, options);
81
73
  debug('Package name: ' + props.packageName);
82
74
  _log.Log.log('› Building app...');
83
75
  const androidProjectRoot = _path().default.join(projectRoot, 'android');
@@ -141,12 +133,13 @@ async function runAndroidAsync(projectRoot, { install, ...options }) {
141
133
  } else {
142
134
  await manager.stopAsync();
143
135
  }
144
- if (shouldUpdateBuildCache && ((_projectConfig_exp_experiments1 = projectConfig.exp.experiments) == null ? void 0 : _projectConfig_exp_experiments1.remoteBuildCache)) {
145
- var _projectConfig_exp_experiments3;
146
- await (0, _remoteBuildCache.uploadRemoteBuildCache)(projectRoot, {
136
+ if (options.binary && shouldUpdateBuildCache && props.buildCacheProvider) {
137
+ await (0, _remotebuildcacheproviders.uploadRemoteBuildCache)({
138
+ projectRoot,
147
139
  platform: 'android',
148
- provider: (_projectConfig_exp_experiments3 = projectConfig.exp.experiments) == null ? void 0 : _projectConfig_exp_experiments3.remoteBuildCache.provider,
149
- buildPath: options.binary
140
+ provider: props.buildCacheProvider,
141
+ buildPath: options.binary,
142
+ runOptions: options
150
143
  });
151
144
  }
152
145
  }
@@ -1 +1 @@
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 runOptions: options,\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 // Find the APK file path\n const apkFile = await resolveInstallApkNameAsync(props.device.device, props);\n if (apkFile) {\n // Attempt to install the APK from the file path\n options.binary = path.join(props.apkVariantDirectory, apkFile);\n }\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 buildPath: options.binary,\n });\n }\n}\n\nasync function installAppAsync(androidProjectRoot: string, props: ResolvedOptions) {\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"],"names":["runAndroidAsync","debug","require","projectRoot","install","options","projectConfig","isProduction","variant","toLowerCase","endsWith","setNodeEnv","load","getConfig","binary","exp","experiments","remoteBuildCache","localPath","resolveRemoteBuildCache","platform","provider","runOptions","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","apkFile","resolveInstallApkNameAsync","device","apkVariantDirectory","binaryPath","fs","existsSync","CommandError","chalk","gray","installAppAsync","getDefaultDevServer","openCustomRuntimeAsync","applicationId","customAppId","launchActivity","logProjectLogsLocation","stopAsync","uploadRemoteBuildCache","buildPath","installAsync"],"mappings":";;;;+BAsBsBA;;;eAAAA;;;;yBAtBI;;;;;;;gEACR;;;;;;;gEACH;;;;;;;gEACE;;;;;;uCAE0B;gCACmB;6BAC7B;qBACb;wBAEwB;wBACf;yBACF;sBACiB;wBACF;qCACD;uBACF;kCACyB;8BAC9B;;;;;;AAElC,MAAMC,QAAQC,QAAQ,SAAS;AAExB,eAAeF,gBAAgBG,WAAmB,EAAE,EAAEC,OAAO,EAAE,GAAGC,SAAkB;QAEpEA,kBAKEC,gCAoDZ,OA0CmBA;IApG9B,sEAAsE;IACtE,MAAMC,gBAAeF,mBAAAA,QAAQG,OAAO,qBAAfH,iBAAiBI,WAAW,GAAGC,QAAQ,CAAC;IAC7DC,IAAAA,mBAAU,EAACJ,eAAe,eAAe;IACzCL,QAAQ,aAAaU,IAAI,CAACT;IAE1B,MAAMG,gBAAgBO,IAAAA,mBAAS,EAACV;IAChC,IAAI,CAACE,QAAQS,MAAM,MAAIR,iCAAAA,cAAcS,GAAG,CAACC,WAAW,qBAA7BV,+BAA+BW,gBAAgB,GAAE;YAG1DX;QAFZ,MAAMY,YAAY,MAAMC,IAAAA,yCAAuB,EAAChB,aAAa;YAC3DiB,UAAU;YACVC,QAAQ,GAAEf,kCAAAA,cAAcS,GAAG,C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QAAQS,MAAM;QAC3B;IACF;AACF;AAEA,eAAe8C,gBAAgB/B,kBAA0B,EAAEL,KAAsB;IAC/E,sFAAsF;IACtF,qFAAqF;IACrFG,QAAG,CAACC,GAAG,CAAC;IACR,MAAM0C,IAAAA,oBAAY,EAACzC,oBAAoB;QACrCrB,SAASgB,MAAMhB,OAAO,IAAI;QAC1BgC,SAAShB,MAAMgB,OAAO,IAAI;QAC1BD,MAAMf,MAAMe,IAAI;IAClB;AACF"}
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 {\n resolveRemoteBuildCache,\n uploadRemoteBuildCache,\n} from '../../utils/remote-build-cache-providers';\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 if (!options.binary && props.buildCacheProvider) {\n const localPath = await resolveRemoteBuildCache({\n projectRoot,\n platform: 'android',\n provider: props.buildCacheProvider,\n runOptions: options,\n });\n if (localPath) {\n options.binary = localPath;\n }\n }\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 // Find the APK file path\n const apkFile = await resolveInstallApkNameAsync(props.device.device, props);\n if (apkFile) {\n // Attempt to install the APK from the file path\n options.binary = path.join(props.apkVariantDirectory, apkFile);\n }\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 (options.binary && shouldUpdateBuildCache && props.buildCacheProvider) {\n await uploadRemoteBuildCache({\n projectRoot,\n platform: 'android',\n provider: props.buildCacheProvider,\n buildPath: options.binary,\n runOptions: options,\n });\n }\n}\n\nasync function installAppAsync(androidProjectRoot: string, props: ResolvedOptions) {\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"],"names":["runAndroidAsync","debug","require","projectRoot","install","options","isProduction","variant","toLowerCase","endsWith","setNodeEnv","load","ensureNativeProjectAsync","platform","props","resolveOptionsAsync","binary","buildCacheProvider","localPath","resolveRemoteBuildCache","provider","runOptions","packageName","Log","log","androidProjectRoot","path","join","shouldUpdateBuildCache","eagerBundleOptions","JSON","stringify","exportEagerAsync","dev","assembleAsync","port","appName","buildCache","architectures","shouldStartBundler","ensurePortAvailabilityAsync","manager","startBundlerAsync","scheme","getSchemesForAndroidAsync","headless","apkFile","resolveInstallApkNameAsync","device","apkVariantDirectory","binaryPath","fs","existsSync","CommandError","chalk","gray","installAppAsync","getDefaultDevServer","openCustomRuntimeAsync","applicationId","customAppId","launchActivity","logProjectLogsLocation","stopAsync","uploadRemoteBuildCache","buildPath","installAsync"],"mappings":";;;;+BAwBsBA;;;eAAAA;;;;gEAxBJ;;;;;;;gEACH;;;;;;;gEACE;;;;;;uCAE0B;gCACmB;6BAC7B;qBACb;wBAEwB;wBACf;yBACF;sBACiB;2CAIrC;wBACmC;qCACD;uBACF;8BACL;;;;;;AAElC,MAAMC,QAAQC,QAAQ,SAAS;AAExB,eAAeF,gBAAgBG,WAAmB,EAAE,EAAEC,OAAO,EAAE,GAAGC,SAAkB;QAEpEA,kBAyDV;IA1DX,sEAAsE;IACtE,MAAMC,gBAAeD,mBAAAA,QAAQE,OAAO,qBAAfF,iBAAiBG,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QACxE,MAAM+C,IAAAA,iDAAsB,EAAC;YAC3B7D;YACAU,UAAU;YACVO,UAAUN,MAAMG,kBAAkB;YAClCgD,WAAW5D,QAAQW,MAAM;YACzBK,YAAYhB;QACd;IACF;AACF;AAEA,eAAemD,gBAAgB/B,kBAA0B,EAAEX,KAAsB;IAC/E,sFAAsF;IACtF,qFAAqF;IACrFS,QAAG,CAACC,GAAG,CAAC;IACR,MAAM0C,IAAAA,oBAAY,EAACzC,oBAAoB;QACrClB,SAASO,MAAMP,OAAO,IAAI;QAC1B6B,SAAStB,MAAMsB,OAAO,IAAI;QAC1BD,MAAMrB,MAAMqB,IAAI;IAClB;AACF"}
@@ -8,13 +8,22 @@ Object.defineProperty(exports, "resolveOptionsAsync", {
8
8
  return resolveOptionsAsync;
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
  const _resolveDevice = require("./resolveDevice");
12
19
  const _resolveNativeScheme = require("./resolveNativeScheme");
13
20
  const _resolveXcodeProject = require("./resolveXcodeProject");
14
21
  const _simctl = require("../../../start/platforms/ios/simctl");
15
22
  const _profile = require("../../../utils/profile");
23
+ const _remotebuildcacheproviders = require("../../../utils/remote-build-cache-providers");
16
24
  const _resolveBundlerProps = require("../../resolveBundlerProps");
17
25
  async function resolveOptionsAsync(projectRoot, options) {
26
+ var _projectConfig_exp_experiments_remoteBuildCache, _projectConfig_exp_experiments;
18
27
  const xcodeProject = (0, _resolveXcodeProject.resolveXcodeProject)(projectRoot);
19
28
  const bundlerProps = await (0, _resolveBundlerProps.resolveBundlerPropsAsync)(projectRoot, options);
20
29
  // Resolve the scheme before the device so we can filter devices based on
@@ -32,6 +41,8 @@ async function resolveOptionsAsync(projectRoot, options) {
32
41
  configuration
33
42
  });
34
43
  const isSimulator = (0, _resolveDevice.isSimulatorDevice)(device);
44
+ const projectConfig = (0, _config().getConfig)(projectRoot);
45
+ const buildCacheProvider = (0, _remotebuildcacheproviders.resolveRemoteBuildCacheProvider)((_projectConfig_exp_experiments = projectConfig.exp.experiments) == null ? void 0 : (_projectConfig_exp_experiments_remoteBuildCache = _projectConfig_exp_experiments.remoteBuildCache) == null ? void 0 : _projectConfig_exp_experiments_remoteBuildCache.provider, projectRoot);
35
46
  // This optimization skips resetting the Metro cache needlessly.
36
47
  // The cache is reset in `../node_modules/react-native/scripts/react-native-xcode.sh` when the
37
48
  // project is running in Debug and built onto a physical device. It seems that this is done because
@@ -47,7 +58,8 @@ async function resolveOptionsAsync(projectRoot, options) {
47
58
  configuration,
48
59
  shouldSkipInitialBundling,
49
60
  buildCache: options.buildCache !== false,
50
- scheme
61
+ scheme,
62
+ buildCacheProvider
51
63
  };
52
64
  }
53
65
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/run/ios/options/resolveOptions.ts"],"sourcesContent":["import { isSimulatorDevice, resolveDeviceAsync } from './resolveDevice';\nimport { resolveNativeSchemePropsAsync } from './resolveNativeScheme';\nimport { resolveXcodeProject } from './resolveXcodeProject';\nimport { isOSType } from '../../../start/platforms/ios/simctl';\nimport { profile } from '../../../utils/profile';\nimport { resolveBundlerPropsAsync } from '../../resolveBundlerProps';\nimport { BuildProps, Options } from '../XcodeBuild.types';\n\n/** Resolve arguments for the `run:ios` command. */\nexport async function resolveOptionsAsync(\n projectRoot: string,\n options: Options\n): Promise<BuildProps> {\n const xcodeProject = resolveXcodeProject(projectRoot);\n\n const bundlerProps = await resolveBundlerPropsAsync(projectRoot, options);\n\n // Resolve the scheme before the device so we can filter devices based on\n // whichever scheme is selected (i.e. don't present TV devices if the scheme cannot be run on a TV).\n const { osType, name: scheme } = await resolveNativeSchemePropsAsync(\n projectRoot,\n options,\n xcodeProject\n );\n\n // Use the configuration or `Debug` if none is provided.\n const configuration = options.configuration || 'Debug';\n\n // Resolve the device based on the provided device id or prompt\n // from a list of devices (connected or simulated) that are filtered by the scheme.\n const device = await profile(resolveDeviceAsync)(options.device, {\n // It's unclear if there's any value to asserting that we haven't hardcoded the os type in the CLI.\n osType: isOSType(osType) ? osType : undefined,\n xcodeProject,\n scheme,\n configuration,\n });\n\n const isSimulator = isSimulatorDevice(device);\n\n // This optimization skips resetting the Metro cache needlessly.\n // The cache is reset in `../node_modules/react-native/scripts/react-native-xcode.sh` when the\n // project is running in Debug and built onto a physical device. It seems that this is done because\n // the script is run from Xcode and unaware of the CLI instance.\n const shouldSkipInitialBundling = configuration === 'Debug' && !isSimulator;\n\n return {\n ...bundlerProps,\n shouldStartBundler: options.configuration === 'Debug' || bundlerProps.shouldStartBundler,\n projectRoot,\n isSimulator,\n xcodeProject,\n device,\n configuration,\n shouldSkipInitialBundling,\n buildCache: options.buildCache !== false,\n scheme,\n };\n}\n"],"names":["resolveOptionsAsync","projectRoot","options","xcodeProject","resolveXcodeProject","bundlerProps","resolveBundlerPropsAsync","osType","name","scheme","resolveNativeSchemePropsAsync","configuration","device","profile","resolveDeviceAsync","isOSType","undefined","isSimulator","isSimulatorDevice","shouldSkipInitialBundling","shouldStartBundler","buildCache"],"mappings":";;;;+BASsBA;;;eAAAA;;;+BATgC;qCACR;qCACV;wBACX;yBACD;qCACiB;AAIlC,eAAeA,oBACpBC,WAAmB,EACnBC,OAAgB;IAEhB,MAAMC,eAAeC,IAAAA,wCAAmB,EAACH;IAEzC,MAAMI,eAAe,MAAMC,IAAAA,6CAAwB,EAACL,aAAaC;IAEjE,yEAAyE;IACzE,oGAAoG;IACpG,MAAM,EAAEK,MAAM,EAAEC,MAAMC,MAAM,EAAE,GAAG,MAAMC,IAAAA,kDAA6B,EAClET,aACAC,SACAC;IAGF,wDAAwD;IACxD,MAAMQ,gBAAgBT,QAAQS,aAAa,IAAI;IAE/C,+DAA+D;IAC/D,mFAAmF;IACnF,MAAMC,SAAS,MAAMC,IAAAA,gBAAO,EAACC,iCAAkB,EAAEZ,QAAQU,MAAM,EAAE;QAC/D,mGAAmG;QACnGL,QAAQQ,IAAAA,gBAAQ,EAACR,UAAUA,SAASS;QACpCb;QACAM;QACAE;IACF;IAEA,MAAMM,cAAcC,IAAAA,gCAAiB,EAACN;IAEtC,gEAAgE;IAChE,8FAA8F;IAC9F,mGAAmG;IACnG,gEAAgE;IAChE,MAAMO,4BAA4BR,kBAAkB,WAAW,CAACM;IAEhE,OAAO;QACL,GAAGZ,YAAY;QACfe,oBAAoBlB,QAAQS,aAAa,KAAK,WAAWN,aAAae,kBAAkB;QACxFnB;QACAgB;QACAd;QACAS;QACAD;QACAQ;QACAE,YAAYnB,QAAQmB,UAAU,KAAK;QACnCZ;IACF;AACF"}
1
+ {"version":3,"sources":["../../../../../src/run/ios/options/resolveOptions.ts"],"sourcesContent":["import { getConfig } from '@expo/config';\n\nimport { isSimulatorDevice, resolveDeviceAsync } from './resolveDevice';\nimport { resolveNativeSchemePropsAsync } from './resolveNativeScheme';\nimport { resolveXcodeProject } from './resolveXcodeProject';\nimport { isOSType } from '../../../start/platforms/ios/simctl';\nimport { profile } from '../../../utils/profile';\nimport { resolveRemoteBuildCacheProvider } from '../../../utils/remote-build-cache-providers';\nimport { resolveBundlerPropsAsync } from '../../resolveBundlerProps';\nimport { BuildProps, Options } from '../XcodeBuild.types';\n\n/** Resolve arguments for the `run:ios` command. */\nexport async function resolveOptionsAsync(\n projectRoot: string,\n options: Options\n): Promise<BuildProps> {\n const xcodeProject = resolveXcodeProject(projectRoot);\n\n const bundlerProps = await resolveBundlerPropsAsync(projectRoot, options);\n\n // Resolve the scheme before the device so we can filter devices based on\n // whichever scheme is selected (i.e. don't present TV devices if the scheme cannot be run on a TV).\n const { osType, name: scheme } = await resolveNativeSchemePropsAsync(\n projectRoot,\n options,\n xcodeProject\n );\n\n // Use the configuration or `Debug` if none is provided.\n const configuration = options.configuration || 'Debug';\n\n // Resolve the device based on the provided device id or prompt\n // from a list of devices (connected or simulated) that are filtered by the scheme.\n const device = await profile(resolveDeviceAsync)(options.device, {\n // It's unclear if there's any value to asserting that we haven't hardcoded the os type in the CLI.\n osType: isOSType(osType) ? osType : undefined,\n xcodeProject,\n scheme,\n configuration,\n });\n\n const isSimulator = isSimulatorDevice(device);\n\n const projectConfig = getConfig(projectRoot);\n const buildCacheProvider = resolveRemoteBuildCacheProvider(\n projectConfig.exp.experiments?.remoteBuildCache?.provider,\n projectRoot\n );\n\n // This optimization skips resetting the Metro cache needlessly.\n // The cache is reset in `../node_modules/react-native/scripts/react-native-xcode.sh` when the\n // project is running in Debug and built onto a physical device. It seems that this is done because\n // the script is run from Xcode and unaware of the CLI instance.\n const shouldSkipInitialBundling = configuration === 'Debug' && !isSimulator;\n\n return {\n ...bundlerProps,\n shouldStartBundler: options.configuration === 'Debug' || bundlerProps.shouldStartBundler,\n projectRoot,\n isSimulator,\n xcodeProject,\n device,\n configuration,\n shouldSkipInitialBundling,\n buildCache: options.buildCache !== false,\n scheme,\n buildCacheProvider,\n };\n}\n"],"names":["resolveOptionsAsync","projectRoot","options","projectConfig","xcodeProject","resolveXcodeProject","bundlerProps","resolveBundlerPropsAsync","osType","name","scheme","resolveNativeSchemePropsAsync","configuration","device","profile","resolveDeviceAsync","isOSType","undefined","isSimulator","isSimulatorDevice","getConfig","buildCacheProvider","resolveRemoteBuildCacheProvider","exp","experiments","remoteBuildCache","provider","shouldSkipInitialBundling","shouldStartBundler","buildCache"],"mappings":";;;;+BAYsBA;;;eAAAA;;;;yBAZI;;;;;;+BAE4B;qCACR;qCACV;wBACX;yBACD;2CACwB;qCACP;AAIlC,eAAeA,oBACpBC,WAAmB,EACnBC,OAAgB;QA+BdC,iDAAAA;IA7BF,MAAMC,eAAeC,IAAAA,wCAAmB,EAACJ;IAEzC,MAAMK,eAAe,MAAMC,IAAAA,6CAAwB,EAACN,aAAaC;IAEjE,yEAAyE;IACzE,oGAAoG;IACpG,MAAM,EAAEM,MAAM,EAAEC,MAAMC,MAAM,EAAE,GAAG,MAAMC,IAAAA,kDAA6B,EAClEV,aACAC,SACAE;IAGF,wDAAwD;IACxD,MAAMQ,gBAAgBV,QAAQU,aAAa,IAAI;IAE/C,+DAA+D;IAC/D,mFAAmF;IACnF,MAAMC,SAAS,MAAMC,IAAAA,gBAAO,EAACC,iCAAkB,EAAEb,QAAQW,MAAM,EAAE;QAC/D,mGAAmG;QACnGL,QAAQQ,IAAAA,gBAAQ,EAACR,UAAUA,SAASS;QACpCb;QACAM;QACAE;IACF;IAEA,MAAMM,cAAcC,IAAAA,gCAAiB,EAACN;IAEtC,MAAMV,gBAAgBiB,IAAAA,mBAAS,EAACnB;IAChC,MAAMoB,qBAAqBC,IAAAA,0DAA+B,GACxDnB,iCAAAA,cAAcoB,GAAG,CAACC,WAAW,sBAA7BrB,kDAAAA,+BAA+BsB,gBAAgB,qBAA/CtB,gDAAiDuB,QAAQ,EACzDzB;IAGF,gEAAgE;IAChE,8FAA8F;IAC9F,mGAAmG;IACnG,gEAAgE;IAChE,MAAM0B,4BAA4Bf,kBAAkB,WAAW,CAACM;IAEhE,OAAO;QACL,GAAGZ,YAAY;QACfsB,oBAAoB1B,QAAQU,aAAa,KAAK,WAAWN,aAAasB,kBAAkB;QACxF3B;QACAiB;QACAd;QACAS;QACAD;QACAe;QACAE,YAAY3B,QAAQ2B,UAAU,KAAK;QACnCnB;QACAW;IACF;AACF"}
@@ -43,24 +43,24 @@ function _path() {
43
43
  };
44
44
  return data;
45
45
  }
46
+ const _XcodeBuild = /*#__PURE__*/ _interop_require_wildcard(require("./XcodeBuild"));
47
+ const _launchApp = require("./launchApp");
48
+ const _resolveOptions = require("./options/resolveOptions");
49
+ const _validateExternalBinary = require("./validateExternalBinary");
50
+ const _exportEager = require("../../export/embed/exportEager");
46
51
  const _log = /*#__PURE__*/ _interop_require_wildcard(require("../../log"));
47
52
  const _AppleAppIdResolver = require("../../start/platforms/ios/AppleAppIdResolver");
53
+ const _simctl = require("../../start/platforms/ios/simctl");
48
54
  const _cocoapods = require("../../utils/cocoapods");
55
+ const _errors = require("../../utils/errors");
49
56
  const _nodeEnv = require("../../utils/nodeEnv");
50
57
  const _port = require("../../utils/port");
51
58
  const _profile = require("../../utils/profile");
59
+ const _remotebuildcacheproviders = require("../../utils/remote-build-cache-providers");
52
60
  const _scheme = require("../../utils/scheme");
53
61
  const _ensureNativeProject = require("../ensureNativeProject");
54
62
  const _hints = require("../hints");
55
- const _remoteBuildCache = require("../remoteBuildCache");
56
63
  const _startBundler = require("../startBundler");
57
- const _XcodeBuild = /*#__PURE__*/ _interop_require_wildcard(require("./XcodeBuild"));
58
- const _launchApp = require("./launchApp");
59
- const _resolveOptions = require("./options/resolveOptions");
60
- const _validateExternalBinary = require("./validateExternalBinary");
61
- const _exportEager = require("../../export/embed/exportEager");
62
- const _simctl = require("../../start/platforms/ios/simctl");
63
- const _errors = require("../../utils/errors");
64
64
  function _interop_require_default(obj) {
65
65
  return obj && obj.__esModule ? obj : {
66
66
  default: obj
@@ -109,7 +109,7 @@ function _interop_require_wildcard(obj, nodeInterop) {
109
109
  }
110
110
  const debug = require('debug')('expo:run:ios');
111
111
  async function runIosAsync(projectRoot, options) {
112
- var _projectConfig_exp_experiments, _this, _projectConfig_exp_experiments1;
112
+ var _this;
113
113
  (0, _nodeEnv.setNodeEnv)(options.configuration === 'Release' ? 'production' : 'development');
114
114
  require('@expo/env').load(projectRoot);
115
115
  assertPlatform();
@@ -123,12 +123,12 @@ async function runIosAsync(projectRoot, options) {
123
123
  // Resolve the CLI arguments into useable options.
124
124
  const props = await (0, _profile.profile)(_resolveOptions.resolveOptionsAsync)(projectRoot, options);
125
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, {
126
+ if (!options.binary && props.buildCacheProvider && props.isSimulator) {
127
+ const localPath = await (0, _remotebuildcacheproviders.resolveRemoteBuildCache)({
128
+ projectRoot,
129
129
  platform: 'ios',
130
- provider: (_projectConfig_exp_experiments2 = projectConfig.exp.experiments) == null ? void 0 : _projectConfig_exp_experiments2.remoteBuildCache.provider,
131
- runOptions: options
130
+ runOptions: options,
131
+ provider: props.buildCacheProvider
132
132
  });
133
133
  if (localPath) {
134
134
  options.binary = localPath;
@@ -239,12 +239,13 @@ async function runIosAsync(projectRoot, options) {
239
239
  } else {
240
240
  await manager.stopAsync();
241
241
  }
242
- if (shouldUpdateBuildCache && ((_projectConfig_exp_experiments1 = projectConfig.exp.experiments) == null ? void 0 : _projectConfig_exp_experiments1.remoteBuildCache)) {
243
- var _projectConfig_exp_experiments3;
244
- await (0, _remoteBuildCache.uploadRemoteBuildCache)(projectRoot, {
242
+ if (shouldUpdateBuildCache && props.buildCacheProvider) {
243
+ await (0, _remotebuildcacheproviders.uploadRemoteBuildCache)({
244
+ projectRoot,
245
245
  platform: 'ios',
246
- provider: (_projectConfig_exp_experiments3 = projectConfig.exp.experiments) == null ? void 0 : _projectConfig_exp_experiments3.remoteBuildCache.provider,
247
- buildPath: binaryPath
246
+ provider: props.buildCacheProvider,
247
+ buildPath: binaryPath,
248
+ runOptions: options
248
249
  });
249
250
  }
250
251
  }
@@ -1 +1 @@
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 { hasDirectDevClientDependency } from '../../start/detectDevClient';\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 runOptions: options,\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 buildPath: binaryPath,\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","runOptions","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","buildPath","process","exit","chalk"],"mappings":";;;;+BA6BsBA;;;eAAAA;;;;yBA7BI;;;;;;;gEACH;;;;;;;gEACL;;;;;;;gEACH;;;;;;;gEACE;;;;;;6DAEI;oCAEc;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,gCAuHhB,OAsBuBA;IA5J9BC,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,EAAE;YAG/EjB;QAFZ,MAAMkB,YAAY,MAAMC,IAAAA,yCAAuB,EAACrB,aAAa;YAC3DS,UAAU;YACVa,QAAQ,GAAEpB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AAA,+BAAiB,EAACpE,aAAa;QACnDqE,MAAM1D,MAAM0D,IAAI;QAChBC,UAAU,CAAC3D,MAAM+C,kBAAkB;QACnC,sEAAsE;QAEtEa,QAAQT,iBAEJF,WAAWY,OAAO,CAAC,EAAE,IAEpB,QAAA,MAAMC,IAAAA,6BAAqB,EAACzE,iCAA7B,AAAC,KAA2C,CAAC,EAAE;IACrD;IAEA,iDAAiD;IACjD,MAAM0E,IAAAA,yBAAc,EAClB/C,YACAwC,SACA;QACEhD,aAAaR,MAAMQ,WAAW;QAC9Be,QAAQvB,MAAMuB,MAAM;QACpBwB,oBAAoB/C,MAAM+C,kBAAkB;IAC9C,GACAE,WAAWK,QAAQ;IAGrB,kDAAkD;IAClD,IAAItD,MAAM+C,kBAAkB,EAAE;QAC5BiB,IAAAA,6BAAsB;IACxB,OAAO;QACL,MAAMR,QAAQS,SAAS;IACzB;IAEA,IAAI3B,4BAA0B/C,kCAAAA,cAAcc,GAAG,CAACC,WAAW,qBAA7Bf,gCAA+BgB,gBAAgB,GAAE;YAGjEhB;QAFZ,MAAM2E,IAAAA,wCAAsB,EAAC7E,aAAa;YACxCS,UAAU;YACVa,QAAQ,GAAEpB,kCAAAA,cAAcc,GAAG,CAACC,WAAW,qBAA7Bf,gCAA+BgB,gBAAgB,CAACI,QAAQ;YAClEwD,WAAWnD;QACb;IACF;AACF;AAEA,SAASrB;IACP,IAAIyE,QAAQtE,QAAQ,KAAK,UAAU;QACjCgB,KAAIuD,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 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 * as Log from '../../log';\nimport { AppleAppIdResolver } from '../../start/platforms/ios/AppleAppIdResolver';\nimport { getContainerPathAsync, simctlAsync } from '../../start/platforms/ios/simctl';\nimport { maybePromptToSyncPodsAsync } from '../../utils/cocoapods';\nimport { CommandError } from '../../utils/errors';\nimport { setNodeEnv } from '../../utils/nodeEnv';\nimport { ensurePortAvailabilityAsync } from '../../utils/port';\nimport { profile } from '../../utils/profile';\nimport {\n resolveRemoteBuildCache,\n uploadRemoteBuildCache,\n} from '../../utils/remote-build-cache-providers';\nimport { getSchemesForIosAsync } from '../../utils/scheme';\nimport { ensureNativeProjectAsync } from '../ensureNativeProject';\nimport { logProjectLogsLocation } from '../hints';\nimport { startBundlerAsync } from '../startBundler';\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 && props.buildCacheProvider && props.isSimulator) {\n const localPath = await resolveRemoteBuildCache({\n projectRoot,\n platform: 'ios',\n runOptions: options,\n provider: props.buildCacheProvider,\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 && props.buildCacheProvider) {\n await uploadRemoteBuildCache({\n projectRoot,\n platform: 'ios',\n provider: props.buildCacheProvider,\n buildPath: binaryPath,\n runOptions: options,\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","setNodeEnv","configuration","load","assertPlatform","install","ensureNativeProjectAsync","platform","maybePromptToSyncPodsAsync","props","profile","resolveOptionsAsync","projectConfig","getConfig","binary","buildCacheProvider","isSimulator","localPath","resolveRemoteBuildCache","runOptions","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","buildPath","process","exit","chalk"],"mappings":";;;;+BA+BsBA;;;eAAAA;;;;yBA/BI;;;;;;;gEACH;;;;;;;gEACL;;;;;;;gEACH;;;;;;;gEACE;;;;;;oEAEW;2BAEgC;gCACxB;wCACI;6BACP;6DACZ;oCACc;wBACgB;2BACR;wBACd;yBACF;sBACiB;yBACpB;2CAIjB;wBAC+B;qCACG;uBACF;8BACL;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAElC,MAAMC,QAAQC,QAAQ,SAAS;AAExB,eAAeF,YAAYG,WAAmB,EAAEC,OAAgB;QAwI9D;IAvIPC,IAAAA,mBAAU,EAACD,QAAQE,aAAa,KAAK,YAAY,eAAe;IAChEJ,QAAQ,aAAaK,IAAI,CAACJ;IAE1BK;IAEA,MAAMC,UAAU,CAAC,CAACL,QAAQK,OAAO;IAEjC,IAAI,AAAC,MAAMC,IAAAA,6CAAwB,EAACP,aAAa;QAAEQ,UAAU;QAAOF;IAAQ,MAAOA,SAAS;QAC1F,MAAMG,IAAAA,qCAA0B,EAACT;IACnC;IAEA,kDAAkD;IAClD,MAAMU,QAAQ,MAAMC,IAAAA,gBAAO,EAACC,mCAAmB,EAAEZ,aAAaC;IAE9D,MAAMY,gBAAgBC,IAAAA,mBAAS,EAACd;IAChC,IAAI,CAACC,QAAQc,MAAM,IAAIL,MAAMM,kBAAkB,IAAIN,MAAMO,WAAW,EAAE;QACpE,MAAMC,YAAY,MAAMC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B,EAAClE,aAAa;QACnDmE,MAAMzD,MAAMyD,IAAI;QAChBC,UAAU,CAAC1D,MAAM8C,kBAAkB;QACnC,sEAAsE;QAEtEa,QAAQT,iBAEJF,WAAWY,OAAO,CAAC,EAAE,IAEpB,QAAA,MAAMC,IAAAA,6BAAqB,EAACvE,iCAA7B,AAAC,KAA2C,CAAC,EAAE;IACrD;IAEA,iDAAiD;IACjD,MAAMwE,IAAAA,yBAAc,EAClB/C,YACAwC,SACA;QACEhD,aAAaP,MAAMO,WAAW;QAC9Be,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,0BAA0BrC,MAAMM,kBAAkB,EAAE;QACtD,MAAM2D,IAAAA,iDAAsB,EAAC;YAC3B3E;YACAQ,UAAU;YACVa,UAAUX,MAAMM,kBAAkB;YAClC4D,WAAWnD;YACXL,YAAYnB;QACd;IACF;AACF;AAEA,SAASI;IACP,IAAIwE,QAAQrE,QAAQ,KAAK,UAAU;QACjCe,KAAIuD,IAAI,CACNC,IAAAA,gBAAK,CAAA,CAAC,+FAA+F,CAAC;IAE1G;AACF"}
@@ -49,7 +49,7 @@ const debug = require('debug')('expo:start:server:metro:fallback-resolver');
49
49
  let filePath;
50
50
  let packageMeta;
51
51
  try {
52
- const resolution = resolve(`${originModuleName}/package.json`);
52
+ const resolution = resolve(_path().default.join(originModuleName, 'package.json'));
53
53
  if (resolution.type !== 'sourceFile') {
54
54
  debug(`Fallback module resolution failed for origin module: ${originModuleName})`);
55
55
  return null;
@@ -95,16 +95,18 @@ const debug = require('debug')('expo:start:server:metro:fallback-resolver');
95
95
  moduleTestRe: dependenciesToRegex(dependencies)
96
96
  } : null;
97
97
  };
98
- function createFallbackModuleResolver({ originModuleNames, getStrictResolver }) {
98
+ function createFallbackModuleResolver({ projectRoot, originModuleNames, getStrictResolver }) {
99
99
  const _moduleDescriptionsCache = {};
100
100
  const getModuleDescription = (immutableContext, originModuleName, platform)=>{
101
101
  if (_moduleDescriptionsCache[originModuleName] !== undefined) {
102
102
  return _moduleDescriptionsCache[originModuleName];
103
103
  }
104
- // Resolve the origin module itself through `<module>/.`
104
+ // Resolve the origin module itself via the project root rather than the file that requested the missing module
105
+ // The addition of `package.json` doesn't matter here. We just need a file path that'll be turned into a directory path
106
+ // We don't need to modify `nodeModulesPaths` since it's guaranteed to contain the project's node modules paths
105
107
  const context = {
106
108
  ...immutableContext,
107
- originModulePath: `${originModuleName}/package.json`
109
+ originModulePath: _path().default.join(projectRoot, 'package.json')
108
110
  };
109
111
  return _moduleDescriptionsCache[originModuleName] = getModuleDescriptionWithResolver(context, getStrictResolver(context, platform), originModuleName);
110
112
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/start/server/metro/createExpoFallbackResolver.ts"],"sourcesContent":["// This file creates the fallback resolver\n// The fallback resolver applies only to module imports and should be the last resolver\n// in the chain. It applies to failed Node module resolution of modules and will attempt\n// to resolve them to `expo` and `expo-router` dependencies that couldn't be resolved.\n// This resolves isolated dependency issues, where we expect dependencies of `expo`\n// and `expo-router` to be resolvable, due to hoisting, but they aren't hoisted in\n// a user's project.\n// See: https://github.com/expo/expo/pull/34286\n\nimport type { ResolutionContext } from 'metro-resolver';\nimport path from 'path';\n\nimport type { StrictResolver, StrictResolverFactory } from './withMetroMultiPlatform';\nimport type { ExpoCustomMetroResolver } from './withMetroResolvers';\n\n/** A record of dependencies that we know are only used for scripts and config-plugins\n * @privateRemarks\n * This includes dependencies we never resolve indirectly. Generally, we only want\n * to add fallback resolutions for dependencies of `expo` and `expo-router` that\n * are either transpiled into output code or resolved from other Expo packages\n * without them having direct dependencies on these dependencies.\n * Meaning: If you update this list, exclude what a user might use when they\n * forget to specify their own dependencies, rather than what we use ourselves\n * only in `expo` and `expo-router`.\n */\nconst EXCLUDE_ORIGIN_MODULES: Record<string, true | undefined> = {\n '@expo/config': true,\n '@expo/config-plugins': true,\n 'schema-utils': true, // Used by `expo-router/plugin`\n semver: true, // Used by `expo-router/doctor`\n};\n\ninterface PackageMetaPeerDependenciesMetaEntry {\n [propName: string]: unknown;\n optional?: boolean;\n}\n\ninterface PackageMeta {\n readonly [propName: string]: unknown;\n readonly name?: string;\n readonly main?: string;\n readonly exports?: any; // unused\n readonly dependencies?: Record<string, unknown>;\n readonly peerDependencies?: Record<string, unknown>;\n readonly peerDependenciesMeta?: Record<\n string,\n PackageMetaPeerDependenciesMetaEntry | undefined | null\n >;\n}\n\ninterface ModuleDescription {\n originModulePath: string;\n moduleTestRe: RegExp;\n}\n\nconst debug = require('debug')('expo:start:server:metro:fallback-resolver') as typeof console.log;\n\n/** Converts a list of module names to a regex that may either match bare module names or sub-modules of modules */\nconst dependenciesToRegex = (dependencies: string[]) =>\n new RegExp(`^(?:${dependencies.join('|')})(?:$|/)`);\n\n/** Resolves an origin module and outputs a filter regex and target path for it */\nconst getModuleDescriptionWithResolver = (\n context: ResolutionContext,\n resolve: StrictResolver,\n originModuleName: string\n): ModuleDescription | null => {\n let filePath: string | undefined;\n let packageMeta: PackageMeta | undefined | null;\n try {\n const resolution = resolve(`${originModuleName}/package.json`);\n if (resolution.type !== 'sourceFile') {\n debug(`Fallback module resolution failed for origin module: ${originModuleName})`);\n return null;\n }\n filePath = resolution.filePath;\n packageMeta = context.getPackage(filePath);\n if (!packageMeta) {\n return null;\n }\n } catch (error: any) {\n debug(\n `Fallback module resolution threw: ${error.constructor.name}. (module: ${filePath || originModuleName})`\n );\n return null;\n }\n let dependencies: string[] = [];\n if (packageMeta.dependencies) dependencies.push(...Object.keys(packageMeta.dependencies));\n if (packageMeta.peerDependencies) {\n const peerDependenciesMeta = packageMeta.peerDependenciesMeta;\n let peerDependencies = Object.keys(packageMeta.peerDependencies);\n // We explicitly include non-optional peer dependencies. Non-optional peer dependencies of\n // `expo` and `expo-router` are either expected to be accessible on a project-level, since\n // both are meant to be installed is direct dependencies, or shouldn't be accessible when\n // they're fulfilled as isolated dependencies.\n // The exception are only *optional* peer dependencies, since when they're installed\n // automatically by newer package manager behaviour, they may become isolated dependencies\n // that we still wish to access.\n if (peerDependenciesMeta) {\n peerDependencies = peerDependencies.filter((dependency) => {\n const peerMeta = peerDependenciesMeta[dependency];\n return peerMeta && typeof peerMeta === 'object' && peerMeta.optional === true;\n });\n }\n dependencies.push(...peerDependencies);\n }\n // We deduplicate the dependencies and exclude modules that we know are only used for scripts or config-plugins\n dependencies = dependencies.filter((moduleName, index, dependenciesArr) => {\n if (EXCLUDE_ORIGIN_MODULES[moduleName]) return false;\n return dependenciesArr.indexOf(moduleName) === index;\n });\n // Return test regex for dependencies and full origin module path to resolve through\n const originModulePath = path.dirname(filePath);\n return dependencies.length\n ? { originModulePath, moduleTestRe: dependenciesToRegex(dependencies) }\n : null;\n};\n\n/** Creates a fallback module resolver that resolves dependencis of modules named in `originModuleNames` via their path.\n * @remarks\n * The fallback resolver targets modules dependended on by modules named in `originModuleNames` and resolves\n * them from the module root of these origin modules instead.\n * It should only be used as a fallback after normal Node resolution (and other resolvers) have failed for:\n * - the `expo` package\n * - the `expo-router` package\n * Dependencies mentioned as either optional peer dependencies or direct dependencies by these modules may be isolated\n * and inaccessible via standard Node module resolution. This may happen when either transpilation adds these\n * dependencies to other parts of the tree (e.g. `@babel/runtime`) or when a dependency fails to hoist due to either\n * a corrupted dependency tree or when a peer dependency is fulfilled incorrectly (e.g. `expo-asset`)\n * @privateRemarks\n * This does NOT follow Node resolution and is *only* intended to provide a fallback for modules that we depend on\n * ourselves and know we can resolve (via expo or expo-router)!\n */\nexport function createFallbackModuleResolver({\n originModuleNames,\n getStrictResolver,\n}: {\n originModuleNames: string[];\n getStrictResolver: StrictResolverFactory;\n}): ExpoCustomMetroResolver {\n const _moduleDescriptionsCache: Record<string, ModuleDescription | null> = {};\n\n const getModuleDescription = (\n immutableContext: ResolutionContext,\n originModuleName: string,\n platform: string | null\n ) => {\n if (_moduleDescriptionsCache[originModuleName] !== undefined) {\n return _moduleDescriptionsCache[originModuleName];\n }\n // Resolve the origin module itself through `<module>/.`\n const context: ResolutionContext = {\n ...immutableContext,\n originModulePath: `${originModuleName}/package.json`,\n };\n return (_moduleDescriptionsCache[originModuleName] = getModuleDescriptionWithResolver(\n context,\n getStrictResolver(context, platform),\n originModuleName\n ));\n };\n\n const fileSpecifierRe = /^[\\\\/]|^\\.\\.?(?:$|[\\\\/])/i;\n\n return function requestFallbackModule(immutableContext, moduleName, platform) {\n // Early return if `moduleName` cannot be a module specifier\n // This doesn't have to be accurate as this resolver is a fallback for failed resolutions and\n // we're only doing this to avoid unnecessary resolution work\n if (fileSpecifierRe.test(moduleName)) {\n return null;\n }\n\n for (const originModuleName of originModuleNames) {\n const moduleDescription = getModuleDescription(immutableContext, originModuleName, platform);\n if (moduleDescription && moduleDescription.moduleTestRe.test(moduleName)) {\n // We instead resolve as if it was depended on by the `originModulePath` (the module named in `originModuleNames`)\n const context: ResolutionContext = {\n ...immutableContext,\n nodeModulesPaths: [moduleDescription.originModulePath],\n originModulePath: moduleDescription.originModulePath,\n };\n const res = getStrictResolver(context, platform)(moduleName);\n debug(\n `Fallback resolution for ${platform}: ${moduleName} -> from origin: ${originModuleName}`\n );\n return res;\n }\n }\n\n return null;\n };\n}\n"],"names":["createFallbackModuleResolver","EXCLUDE_ORIGIN_MODULES","semver","debug","require","dependenciesToRegex","dependencies","RegExp","join","getModuleDescriptionWithResolver","context","resolve","originModuleName","filePath","packageMeta","resolution","type","getPackage","error","constructor","name","push","Object","keys","peerDependencies","peerDependenciesMeta","filter","dependency","peerMeta","optional","moduleName","index","dependenciesArr","indexOf","originModulePath","path","dirname","length","moduleTestRe","originModuleNames","getStrictResolver","_moduleDescriptionsCache","getModuleDescription","immutableContext","platform","undefined","fileSpecifierRe","requestFallbackModule","test","moduleDescription","nodeMod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YACpC,OAAO;QACT;QAEA,KAAK,MAAMlB,oBAAoB2B,kBAAmB;YAChD,MAAMU,oBAAoBP,qBAAqBC,kBAAkB/B,kBAAkBgC;YACnF,IAAIK,qBAAqBA,kBAAkBX,YAAY,CAACU,IAAI,CAAClB,aAAa;gBACxE,kHAAkH;gBAClH,MAAMpB,UAA6B;oBACjC,GAAGiC,gBAAgB;oBACnBO,kBAAkB;wBAACD,kBAAkBf,gBAAgB;qBAAC;oBACtDA,kBAAkBe,kBAAkBf,gBAAgB;gBACtD;gBACA,MAAMiB,MAAMX,kBAAkB9B,SAASkC,UAAUd;gBACjD3B,MACE,CAAC,wBAAwB,EAAEyC,SAAS,EAAE,EAAEd,WAAW,iBAAiB,EAAElB,kBAAkB;gBAE1F,OAAOuC;YACT;QACF;QAEA,OAAO;IACT;AACF"}
1
+ {"version":3,"sources":["../../../../../src/start/server/metro/createExpoFallbackResolver.ts"],"sourcesContent":["// This file creates the fallback resolver\n// The fallback resolver applies only to module imports and should be the last resolver\n// in the chain. It applies to failed Node module resolution of modules and will attempt\n// to resolve them to `expo` and `expo-router` dependencies that couldn't be resolved.\n// This resolves isolated dependency issues, where we expect dependencies of `expo`\n// and `expo-router` to be resolvable, due to hoisting, but they aren't hoisted in\n// a user's project.\n// See: https://github.com/expo/expo/pull/34286\n\nimport type { ResolutionContext } from 'metro-resolver';\nimport path from 'path';\n\nimport type { StrictResolver, StrictResolverFactory } from './withMetroMultiPlatform';\nimport type { ExpoCustomMetroResolver } from './withMetroResolvers';\n\n/** A record of dependencies that we know are only used for scripts and config-plugins\n * @privateRemarks\n * This includes dependencies we never resolve indirectly. Generally, we only want\n * to add fallback resolutions for dependencies of `expo` and `expo-router` that\n * are either transpiled into output code or resolved from other Expo packages\n * without them having direct dependencies on these dependencies.\n * Meaning: If you update this list, exclude what a user might use when they\n * forget to specify their own dependencies, rather than what we use ourselves\n * only in `expo` and `expo-router`.\n */\nconst EXCLUDE_ORIGIN_MODULES: Record<string, true | undefined> = {\n '@expo/config': true,\n '@expo/config-plugins': true,\n 'schema-utils': true, // Used by `expo-router/plugin`\n semver: true, // Used by `expo-router/doctor`\n};\n\ninterface PackageMetaPeerDependenciesMetaEntry {\n [propName: string]: unknown;\n optional?: boolean;\n}\n\ninterface PackageMeta {\n readonly [propName: string]: unknown;\n readonly name?: string;\n readonly main?: string;\n readonly exports?: any; // unused\n readonly dependencies?: Record<string, unknown>;\n readonly peerDependencies?: Record<string, unknown>;\n readonly peerDependenciesMeta?: Record<\n string,\n PackageMetaPeerDependenciesMetaEntry | undefined | null\n >;\n}\n\ninterface ModuleDescription {\n originModulePath: string;\n moduleTestRe: RegExp;\n}\n\nconst debug = require('debug')('expo:start:server:metro:fallback-resolver') as typeof console.log;\n\n/** Converts a list of module names to a regex that may either match bare module names or sub-modules of modules */\nconst dependenciesToRegex = (dependencies: string[]) =>\n new RegExp(`^(?:${dependencies.join('|')})(?:$|/)`);\n\n/** Resolves an origin module and outputs a filter regex and target path for it */\nconst getModuleDescriptionWithResolver = (\n context: ResolutionContext,\n resolve: StrictResolver,\n originModuleName: string\n): ModuleDescription | null => {\n let filePath: string | undefined;\n let packageMeta: PackageMeta | undefined | null;\n try {\n const resolution = resolve(path.join(originModuleName, 'package.json'));\n if (resolution.type !== 'sourceFile') {\n debug(`Fallback module resolution failed for origin module: ${originModuleName})`);\n return null;\n }\n filePath = resolution.filePath;\n packageMeta = context.getPackage(filePath);\n if (!packageMeta) {\n return null;\n }\n } catch (error: any) {\n debug(\n `Fallback module resolution threw: ${error.constructor.name}. (module: ${filePath || originModuleName})`\n );\n return null;\n }\n let dependencies: string[] = [];\n if (packageMeta.dependencies) dependencies.push(...Object.keys(packageMeta.dependencies));\n if (packageMeta.peerDependencies) {\n const peerDependenciesMeta = packageMeta.peerDependenciesMeta;\n let peerDependencies = Object.keys(packageMeta.peerDependencies);\n // We explicitly include non-optional peer dependencies. Non-optional peer dependencies of\n // `expo` and `expo-router` are either expected to be accessible on a project-level, since\n // both are meant to be installed is direct dependencies, or shouldn't be accessible when\n // they're fulfilled as isolated dependencies.\n // The exception are only *optional* peer dependencies, since when they're installed\n // automatically by newer package manager behaviour, they may become isolated dependencies\n // that we still wish to access.\n if (peerDependenciesMeta) {\n peerDependencies = peerDependencies.filter((dependency) => {\n const peerMeta = peerDependenciesMeta[dependency];\n return peerMeta && typeof peerMeta === 'object' && peerMeta.optional === true;\n });\n }\n dependencies.push(...peerDependencies);\n }\n // We deduplicate the dependencies and exclude modules that we know are only used for scripts or config-plugins\n dependencies = dependencies.filter((moduleName, index, dependenciesArr) => {\n if (EXCLUDE_ORIGIN_MODULES[moduleName]) return false;\n return dependenciesArr.indexOf(moduleName) === index;\n });\n // Return test regex for dependencies and full origin module path to resolve through\n const originModulePath = path.dirname(filePath);\n return dependencies.length\n ? { originModulePath, moduleTestRe: dependenciesToRegex(dependencies) }\n : null;\n};\n\n/** Creates a fallback module resolver that resolves dependencis of modules named in `originModuleNames` via their path.\n * @remarks\n * The fallback resolver targets modules dependended on by modules named in `originModuleNames` and resolves\n * them from the module root of these origin modules instead.\n * It should only be used as a fallback after normal Node resolution (and other resolvers) have failed for:\n * - the `expo` package\n * - the `expo-router` package\n * Dependencies mentioned as either optional peer dependencies or direct dependencies by these modules may be isolated\n * and inaccessible via standard Node module resolution. This may happen when either transpilation adds these\n * dependencies to other parts of the tree (e.g. `@babel/runtime`) or when a dependency fails to hoist due to either\n * a corrupted dependency tree or when a peer dependency is fulfilled incorrectly (e.g. `expo-asset`)\n * @privateRemarks\n * This does NOT follow Node resolution and is *only* intended to provide a fallback for modules that we depend on\n * ourselves and know we can resolve (via expo or expo-router)!\n */\nexport function createFallbackModuleResolver({\n projectRoot,\n originModuleNames,\n getStrictResolver,\n}: {\n projectRoot: string;\n originModuleNames: string[];\n getStrictResolver: StrictResolverFactory;\n}): ExpoCustomMetroResolver {\n const _moduleDescriptionsCache: Record<string, ModuleDescription | null> = {};\n\n const getModuleDescription = (\n immutableContext: ResolutionContext,\n originModuleName: string,\n platform: string | null\n ) => {\n if (_moduleDescriptionsCache[originModuleName] !== undefined) {\n return _moduleDescriptionsCache[originModuleName];\n }\n // Resolve the origin module itself via the project root rather than the file that requested the missing module\n // The addition of `package.json` doesn't matter here. We just need a file path that'll be turned into a directory path\n // We don't need to modify `nodeModulesPaths` since it's guaranteed to contain the project's node modules paths\n const context: ResolutionContext = {\n ...immutableContext,\n originModulePath: path.join(projectRoot, 'package.json'),\n };\n return (_moduleDescriptionsCache[originModuleName] = getModuleDescriptionWithResolver(\n context,\n getStrictResolver(context, platform),\n originModuleName\n ));\n };\n\n const fileSpecifierRe = /^[\\\\/]|^\\.\\.?(?:$|[\\\\/])/i;\n\n return function requestFallbackModule(immutableContext, moduleName, platform) {\n // Early return if `moduleName` cannot be a module specifier\n // This doesn't have to be accurate as this resolver is a fallback for failed resolutions and\n // we're only doing this to avoid unnecessary resolution work\n if (fileSpecifierRe.test(moduleName)) {\n return null;\n }\n\n for (const originModuleName of originModuleNames) {\n const moduleDescription = getModuleDescription(immutableContext, originModuleName, platform);\n if (moduleDescription && moduleDescription.moduleTestRe.test(moduleName)) {\n // We instead resolve as if it was depended on by the `originModulePath` (the module named in `originModuleNames`)\n const context: ResolutionContext = {\n ...immutableContext,\n nodeModulesPaths: [moduleDescription.originModulePath],\n originModulePath: moduleDescription.originModulePath,\n };\n const res = getStrictResolver(context, platform)(moduleName);\n debug(\n `Fallback resolution for ${platform}: ${moduleName} -> from origin: ${originModuleName}`\n );\n return res;\n }\n }\n\n return null;\n };\n}\n"],"names":["createFallbackModuleResolver","EXCLUDE_ORIGIN_MODULES","semver","debug","require","dependenciesToRegex","dependencies","RegExp","join","getModuleDescriptionWithResolver","context","resolve","originModuleName","filePath","packageMeta","resolution","path","type","getPackage","error","constructor","name","push","Object","keys","peerDependencies","peerDependenciesMeta","filter","dependency","peerMeta","optional","moduleName","index","dependenciesArr","indexOf","originModulePath","dirname","length","moduleTestRe","projectRoot","originModuleNames","getStrictResolver","_moduleDescriptionsCache","getModuleDescription","immutableContext","platform","undefined","fileSpecifierRe","requestFallbackModule","test","moduleDescription","nodeModulesPaths","res"],"mappings":"AAAA,0CAA0C;AAC1C,uFAAuF;AACvF,wFAAwF;AACxF,sFAAsF;AACtF,mFAAmF;AACnF,kFAAkF;AAClF,oBAAoB;AACpB,+CAA+C;;;;;+BA8H/BA;;;eAAAA;;;;gEA3HC;;;;;;;;;;;AAKjB;;;;;;;;;CASC,GACD,MAAMC,yBAA2D;IAC/D,gBAAgB;IAChB,wBAAwB;IACxB,gBAAgB;IAChBC,QAAQ;AACV;AAyBA,MAAMC,QAAQC,QAAQ,SAAS;AAE/B,iHAAiH,GACjH,MAAMC,sBAAsB,CAACC,eAC3B,IAAIC,OAAO,CAAC,IAAI,EAAED,aAAaE,IAAI,CAAC,KAAK,QAAQ,CAAC;AAEpD,gFAAgF,GAChF,MAAMC,mCAAmC,CACvCC,SACAC,SACAC;IAEA,IAAIC;IACJ,IAAIC;IACJ,IAAI;QACF,MAAMC,aAAaJ,QAAQK,eAAI,CAACR,IAAI,CAACI,kBAAkB;QACvD,IAAIG,WAAWE,IAAI,KAAK,cAAc;YACpCd,MAAM,CAAC,qDAAqD,EAAES,iBAAiB,CAAC,CAAC;YACjF,OAAO;QACT;QACAC,WAAWE,WAAWF,QAAQ;QAC9BC,cAAcJ,QAAQQ,UAAU,CAACL;QACjC,IAAI,CAACC,aAAa;YAChB,OAAO;QACT;IACF,EAAE,OAAOK,OAAY;QACnBhB,MACE,CAAC,kCAAkC,EAAEgB,MAAMC,WAAW,CAACC,IAAI,CAAC,WAAW,EAAER,YAAYD,iBAAiB,CAAC,CAAC;QAE1G,OAAO;IACT;IACA,IAAIN,eAAyB,EAAE;IAC/B,IAAIQ,YAAYR,YAAY,EAAEA,aAAagB,IAAI,IAAIC,OAAOC,IAAI,CAACV,YAAYR,YAAY;IACvF,IAAIQ,YAAYW,gBAAgB,EAAE;QAChC,MAAMC,uBAAuBZ,YAAYY,oBAAoB;QAC7D,IAAID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AAgB,EAAEb,UAAU,EAAEc,QAAQ;QAC1E,4DAA4D;QAC5D,6FAA6F;QAC7F,6DAA6D;QAC7D,IAAIE,gBAAgBE,IAAI,CAAClB,aAAa;YACpC,OAAO;QACT;QAEA,KAAK,MAAMnB,oBAAoB4B,kBAAmB;YAChD,MAAMU,oBAAoBP,qBAAqBC,kBAAkBhC,kBAAkBiC;YACnF,IAAIK,qBAAqBA,kBAAkBZ,YAAY,CAACW,IAAI,CAAClB,aAAa;gBACxE,kHAAkH;gBAClH,MAAMrB,UAA6B;oBACjC,GAAGkC,gBAAgB;oBACnBO,kBAAkB;wBAACD,kBAAkBf,gBAAgB;qBAAC;oBACtDA,kBAAkBe,kBAAkBf,gBAAgB;gBACtD;gBACA,MAAMiB,MAAMX,kBAAkB/B,SAASmC,UAAUd;gBACjD5B,MACE,CAAC,wBAAwB,EAAE0C,SAAS,EAAE,EAAEd,WAAW,iBAAiB,EAAEnB,kBAAkB;gBAE1F,OAAOwC;YACT;QACF;QAEA,OAAO;IACT;AACF"}
@@ -392,8 +392,8 @@ function pruneCustomTransformOptions(filePath, transformOptions) {
392
392
  !(filePath.match(/\/expo-router\/_ctx/) || filePath.match(/\/expo-router\/build\//))) {
393
393
  delete transformOptions.customTransformOptions.asyncRoutes;
394
394
  }
395
- if (((_transformOptions_customTransformOptions3 = transformOptions.customTransformOptions) == null ? void 0 : _transformOptions_customTransformOptions3.clientBoundaries) && // The client boundaries are only used in `@expo/metro-runtime/src/virtual.js` for production RSC exports.
396
- !filePath.match(/\/@expo\/metro-runtime\/rsc\/virtual\.js$/)) {
395
+ if (((_transformOptions_customTransformOptions3 = transformOptions.customTransformOptions) == null ? void 0 : _transformOptions_customTransformOptions3.clientBoundaries) && // The client boundaries are only used in `expo/virtual/rsc.js` for production RSC exports.
396
+ !filePath.match(/\/expo\/virtual\/rsc\.js$/)) {
397
397
  delete transformOptions.customTransformOptions.clientBoundaries;
398
398
  }
399
399
  return transformOptions;