@depup/expo__cli 55.0.22-depup.0 → 55.0.23-depup.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/README.md +5 -8
  2. package/build/bin/cli +1 -1
  3. package/build/src/events/index.js +1 -1
  4. package/build/src/expoUpdatesExports.js +46 -3
  5. package/build/src/expoUpdatesExports.js.map +1 -1
  6. package/build/src/export/embed/exportEmbedAsync.js +13 -4
  7. package/build/src/export/embed/exportEmbedAsync.js.map +1 -1
  8. package/build/src/export/embed/index.js +1 -1
  9. package/build/src/export/embed/index.js.map +1 -1
  10. package/build/src/export/exportApp.js +8 -2
  11. package/build/src/export/exportApp.js.map +1 -1
  12. package/build/src/export/exportDomComponents.js +11 -4
  13. package/build/src/export/exportDomComponents.js.map +1 -1
  14. package/build/src/start/doctor/ngrok/ExternalModule.js +11 -6
  15. package/build/src/start/doctor/ngrok/ExternalModule.js.map +1 -1
  16. package/build/src/start/server/metro/MetroBundlerDevServer.js +6 -6
  17. package/build/src/start/server/metro/MetroBundlerDevServer.js.map +1 -1
  18. package/build/src/start/server/metro/createExpoFallbackResolver.js +39 -0
  19. package/build/src/start/server/metro/createExpoFallbackResolver.js.map +1 -1
  20. package/build/src/start/server/middleware/DomComponentsMiddleware.js +14 -5
  21. package/build/src/start/server/middleware/DomComponentsMiddleware.js.map +1 -1
  22. package/build/src/start/server/middleware/ManifestMiddleware.js +4 -41
  23. package/build/src/start/server/middleware/ManifestMiddleware.js.map +1 -1
  24. package/build/src/utils/filePath.js +3 -29
  25. package/build/src/utils/filePath.js.map +1 -1
  26. package/build/src/utils/telemetry/clients/FetchClient.js +1 -1
  27. package/build/src/utils/telemetry/utils/context.js +1 -1
  28. package/changes.json +4 -16
  29. package/package.json +15 -27
  30. package/build/src/utils/resolveGlobal.js +0 -195
  31. package/build/src/utils/resolveGlobal.js.map +0 -1
package/README.md CHANGED
@@ -13,28 +13,25 @@ npm install @depup/expo__cli
13
13
 
14
14
  | Field | Value |
15
15
  |-------|-------|
16
- | Original | [@expo/cli](https://www.npmjs.com/package/@expo/cli) @ 55.0.22 |
17
- | Processed | 2026-04-07 |
16
+ | Original | [@expo/cli](https://www.npmjs.com/package/@expo/cli) @ 55.0.23 |
17
+ | Processed | 2026-04-09 |
18
18
  | Smoke test | failed |
19
- | Deps updated | 29 |
19
+ | Deps updated | 26 |
20
20
 
21
21
  ## Dependency Changes
22
22
 
23
23
  | Dependency | From | To |
24
24
  |------------|------|-----|
25
25
  | @expo/ws-tunnel | ^1.0.1 | ^1.0.6 |
26
- | @expo/xcpretty | ^4.4.0 | ^4.4.1 |
27
- | @react-native/dev-middleware | 0.83.4 | ^0.84.1 |
26
+ | @expo/xcpretty | ^4.4.0 | ^4.4.2 |
27
+ | @react-native/dev-middleware | 0.83.4 | ^0.85.0 |
28
28
  | bplist-creator | 0.1.0 | ^0.1.1 |
29
29
  | bplist-parser | ^0.3.1 | ^0.3.2 |
30
30
  | chalk | ^4.0.0 | ^5.6.2 |
31
31
  | ci-info | ^3.3.0 | ^4.4.0 |
32
32
  | compression | ^1.7.4 | ^1.8.1 |
33
33
  | debug | ^4.3.4 | ^4.4.3 |
34
- | dnssd-advertise | ^1.1.3 | ^1.1.4 |
35
- | fetch-nodeshim | ^0.4.6 | ^0.4.10 |
36
34
  | glob | ^13.0.0 | ^13.0.6 |
37
- | lan-network | ^0.2.0 | ^0.2.1 |
38
35
  | multitars | ^0.2.3 | ^0.2.4 |
39
36
  | node-forge | ^1.3.3 | ^1.4.0 |
40
37
  | npm-package-arg | ^11.0.0 | ^13.0.2 |
package/build/bin/cli CHANGED
@@ -139,7 +139,7 @@ const args = (0, _arg().default)({
139
139
  });
140
140
  if (args['--version']) {
141
141
  // Version is added in the build script.
142
- console.log("55.0.22");
142
+ console.log("55.0.23");
143
143
  process.exit(0);
144
144
  }
145
145
  if (args['--non-interactive']) {
@@ -70,7 +70,7 @@ function getInitMetadata() {
70
70
  return {
71
71
  format: 'v0-jsonl',
72
72
  // Version is added in the build script.
73
- version: "55.0.22" ?? 'UNVERSIONED'
73
+ version: "55.0.23" ?? 'UNVERSIONED'
74
74
  };
75
75
  }
76
76
  function installEventLogger(env = process.env.LOG_EVENTS) {
@@ -1,6 +1,5 @@
1
1
  // NOTE(@kitten): These are currently only used by expo-updates (expo-updates/utols/src/createManifestForBuildAsync)
2
2
  // They're re-exported via `expo/internal/cli-unstable-expo-updates-exports` to establish a valid dependency chain
3
- // NOTE for Expo Maintainers: Do not add to this file. We want to remove this
4
3
  "use strict";
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
@@ -13,7 +12,7 @@ function _export(target, all) {
13
12
  }
14
13
  _export(exports, {
15
14
  createMetroServerAndBundleRequestAsync: function() {
16
- return _exportEmbedAsync.createMetroServerAndBundleRequestAsync;
15
+ return createMetroServerAndBundleRequestAsync;
17
16
  },
18
17
  drawableFileTypes: function() {
19
18
  return _metroAssetLocalPath.drawableFileTypes;
@@ -22,7 +21,51 @@ _export(exports, {
22
21
  return _exportEmbedAsync.exportEmbedAssetsAsync;
23
22
  }
24
23
  });
25
- const _metroAssetLocalPath = require("./export/metroAssetLocalPath");
24
+ function _paths() {
25
+ const data = require("@expo/config/paths");
26
+ _paths = function() {
27
+ return data;
28
+ };
29
+ return data;
30
+ }
31
+ function _nodefs() {
32
+ const data = /*#__PURE__*/ _interop_require_default(require("node:fs"));
33
+ _nodefs = function() {
34
+ return data;
35
+ };
36
+ return data;
37
+ }
38
+ function _nodepath() {
39
+ const data = /*#__PURE__*/ _interop_require_default(require("node:path"));
40
+ _nodepath = function() {
41
+ return data;
42
+ };
43
+ return data;
44
+ }
26
45
  const _exportEmbedAsync = require("./export/embed/exportEmbedAsync");
46
+ const _metroAssetLocalPath = require("./export/metroAssetLocalPath");
47
+ function _interop_require_default(obj) {
48
+ return obj && obj.__esModule ? obj : {
49
+ default: obj
50
+ };
51
+ }
52
+ /** Older versions of expo-updates may pass a path relative to the server root. But relative paths are expected to be relative to `projectRoot`, so we turn them into absolute paths */ function fixupServerRelativePath(projectRoot, entryFile) {
53
+ const serverRoot = (0, _paths().getMetroServerRoot)(projectRoot);
54
+ if (!_nodepath().default.isAbsolute(entryFile)) {
55
+ let candidate;
56
+ if (_nodefs().default.existsSync(candidate = _nodepath().default.resolve(serverRoot, entryFile))) {
57
+ entryFile = candidate;
58
+ } else if (!entryFile.endsWith('.js') && _nodefs().default.existsSync(candidate = _nodepath().default.resolve(serverRoot, entryFile + '.js'))) {
59
+ entryFile = candidate;
60
+ }
61
+ }
62
+ return entryFile;
63
+ }
64
+ const createMetroServerAndBundleRequestAsync = async (projectRoot, options)=>{
65
+ return await (0, _exportEmbedAsync.createMetroServerAndBundleRequestAsync)(projectRoot, {
66
+ ...options,
67
+ entryFile: fixupServerRelativePath(projectRoot, options.entryFile)
68
+ });
69
+ };
27
70
 
28
71
  //# sourceMappingURL=expoUpdatesExports.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/expoUpdatesExports.ts"],"sourcesContent":["// NOTE(@kitten): These are currently only used by expo-updates (expo-updates/utols/src/createManifestForBuildAsync)\n// They're re-exported via `expo/internal/cli-unstable-expo-updates-exports` to establish a valid dependency chain\n// NOTE for Expo Maintainers: Do not add to this file. We want to remove this\nexport { drawableFileTypes } from './export/metroAssetLocalPath';\nexport {\n createMetroServerAndBundleRequestAsync,\n exportEmbedAssetsAsync,\n} from './export/embed/exportEmbedAsync';\n"],"names":["createMetroServerAndBundleRequestAsync","drawableFileTypes","exportEmbedAssetsAsync"],"mappings":"AAAA,oHAAoH;AACpH,kHAAkH;AAClH,6EAA6E;;;;;;;;;;;;IAG3EA,sCAAsC;eAAtCA,wDAAsC;;IAF/BC,iBAAiB;eAAjBA,sCAAiB;;IAGxBC,sBAAsB;eAAtBA,wCAAsB;;;qCAHU;kCAI3B"}
1
+ {"version":3,"sources":["../../src/expoUpdatesExports.ts"],"sourcesContent":["// NOTE(@kitten): These are currently only used by expo-updates (expo-updates/utols/src/createManifestForBuildAsync)\n// They're re-exported via `expo/internal/cli-unstable-expo-updates-exports` to establish a valid dependency chain\n\nimport { getMetroServerRoot } from '@expo/config/paths';\nimport fs from 'node:fs';\nimport path from 'node:path';\n\nimport { createMetroServerAndBundleRequestAsync as internal_createMetroServerAndBundleRequestAsync } from './export/embed/exportEmbedAsync';\n\n// NOTE for Expo Maintainers: Do not add to this file. We want to remove this\nexport { drawableFileTypes } from './export/metroAssetLocalPath';\nexport { exportEmbedAssetsAsync } from './export/embed/exportEmbedAsync';\n\n/** Older versions of expo-updates may pass a path relative to the server root. But relative paths are expected to be relative to `projectRoot`, so we turn them into absolute paths */\nfunction fixupServerRelativePath(projectRoot: string, entryFile: string) {\n const serverRoot = getMetroServerRoot(projectRoot);\n if (!path.isAbsolute(entryFile)) {\n let candidate: string;\n if (fs.existsSync((candidate = path.resolve(serverRoot, entryFile)))) {\n entryFile = candidate;\n } else if (\n !entryFile.endsWith('.js') &&\n fs.existsSync((candidate = path.resolve(serverRoot, entryFile + '.js')))\n ) {\n entryFile = candidate;\n }\n }\n return entryFile;\n}\n\nexport const createMetroServerAndBundleRequestAsync: typeof internal_createMetroServerAndBundleRequestAsync =\n async (projectRoot, options) => {\n return await internal_createMetroServerAndBundleRequestAsync(projectRoot, {\n ...options,\n entryFile: fixupServerRelativePath(projectRoot, options.entryFile),\n });\n };\n"],"names":["createMetroServerAndBundleRequestAsync","drawableFileTypes","exportEmbedAssetsAsync","fixupServerRelativePath","projectRoot","entryFile","serverRoot","getMetroServerRoot","path","isAbsolute","candidate","fs","existsSync","resolve","endsWith","options","internal_createMetroServerAndBundleRequestAsync"],"mappings":"AAAA,oHAAoH;AACpH,kHAAkH;;;;;;;;;;;;IA6BrGA,sCAAsC;eAAtCA;;IApBJC,iBAAiB;eAAjBA,sCAAiB;;IACjBC,sBAAsB;eAAtBA,wCAAsB;;;;yBARI;;;;;;;gEACpB;;;;;;;gEACE;;;;;;kCAEyF;qCAGxE;;;;;;AAGlC,qLAAqL,GACrL,SAASC,wBAAwBC,WAAmB,EAAEC,SAAiB;IACrE,MAAMC,aAAaC,IAAAA,2BAAkB,EAACH;IACtC,IAAI,CAACI,mBAAI,CAACC,UAAU,CAACJ,YAAY;QAC/B,IAAIK;QACJ,IAAIC,iBAAE,CAACC,UAAU,CAAEF,YAAYF,mBAAI,CAACK,OAAO,CAACP,YAAYD,aAAc;YACpEA,YAAYK;QACd,OAAO,IACL,CAACL,UAAUS,QAAQ,CAAC,UACpBH,iBAAE,CAACC,UAAU,CAAEF,YAAYF,mBAAI,CAACK,OAAO,CAACP,YAAYD,YAAY,SAChE;YACAA,YAAYK;QACd;IACF;IACA,OAAOL;AACT;AAEO,MAAML,yCACX,OAAOI,aAAaW;IAClB,OAAO,MAAMC,IAAAA,wDAA+C,EAACZ,aAAa;QACxE,GAAGW,OAAO;QACVV,WAAWF,wBAAwBC,aAAaW,QAAQV,SAAS;IACnE;AACF"}
@@ -37,6 +37,13 @@ function _config() {
37
37
  };
38
38
  return data;
39
39
  }
40
+ function _paths() {
41
+ const data = require("@expo/config/paths");
42
+ _paths = function() {
43
+ return data;
44
+ };
45
+ return data;
46
+ }
40
47
  function _Server() {
41
48
  const data = /*#__PURE__*/ _interop_require_default(require("@expo/metro/metro/Server"));
42
49
  _Server = function() {
@@ -112,7 +119,6 @@ const _publicFolder = require("../publicFolder");
112
119
  const _saveAssets = require("../saveAssets");
113
120
  const _exportServer = require("./exportServer");
114
121
  const _exit = require("../../utils/exit");
115
- const _filePath = require("../../utils/filePath");
116
122
  function _interop_require_default(obj) {
117
123
  return obj && obj.__esModule ? obj : {
118
124
  default: obj
@@ -278,7 +284,7 @@ async function exportEmbedBundleAndAssetsAsync(projectRoot, options) {
278
284
  const bundles = await devServer.nativeExportBundleAsync(exp, {
279
285
  // TODO: Re-enable when we get bytecode chunk splitting working again.
280
286
  splitChunks: false,
281
- mainModuleName: (0, _filePath.resolveRealEntryFilePath)(projectRoot, options.entryFile),
287
+ mainModuleName: (0, _paths().convertEntryPointToRelative)(projectRoot, options.entryFile),
282
288
  platform: options.platform,
283
289
  minify: options.minify,
284
290
  mode: options.dev ? 'development' : 'production',
@@ -382,7 +388,8 @@ async function createMetroServerAndBundleRequestAsync(projectRoot, options) {
382
388
  }
383
389
  const directBundleOptions = (0, _metroOptions.getMetroDirectBundleOptionsForExpoConfig)(projectRoot, exp, {
384
390
  splitChunks: false,
385
- mainModuleName: (0, _filePath.resolveRealEntryFilePath)(projectRoot, options.entryFile),
391
+ // TODO(@kitten): This currently has to match a filename exactly
392
+ mainModuleName: (0, _paths().convertEntryPointToRelative)(projectRoot, options.entryFile, null),
386
393
  platform: options.platform,
387
394
  minify: options.minify,
388
395
  mode: options.dev ? 'development' : 'production',
@@ -418,7 +425,9 @@ async function exportEmbedAssetsAsync(server, bundleRequest, projectRoot, option
418
425
  // @ts-ignore-error TODO(@kitten): Very unclear why this is here. Remove?
419
426
  bundleType: 'todo'
420
427
  });
421
- const dependencies = await server._bundler.getDependencies([
428
+ const dependencies = await server._bundler.getDependencies(// NOTE(@kitten): This isn't an `entryFile`, but instead a `mainModuleName`, that's been renamed
429
+ // in `getMetroDirectBundleOptions`, where we've passed the already converted name
430
+ [
422
431
  entryFile
423
432
  ], transformOptions, resolverOptions, {
424
433
  onProgress,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/export/embed/exportEmbedAsync.ts"],"sourcesContent":["/**\n * Copyright © 2023 650 Industries.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { getConfig } from '@expo/config';\nimport Server from '@expo/metro/metro/Server';\nimport splitBundleOptions from '@expo/metro/metro/lib/splitBundleOptions';\nimport * as output from '@expo/metro/metro/shared/output/bundle';\nimport type { BundleOptions } from '@expo/metro/metro/shared/types';\nimport getMetroAssets from '@expo/metro-config/build/transform-worker/getAssets';\nimport assert from 'assert';\nimport fs from 'fs';\nimport { sync as globSync } from 'glob';\nimport path from 'path';\n\nimport { deserializeEagerKey, getExportEmbedOptionsKey, Options } from './resolveOptions';\nimport { isExecutingFromXcodebuild, logMetroErrorInXcode } from './xcodeCompilerLogger';\nimport { Log } from '../../log';\nimport { DevServerManager } from '../../start/server/DevServerManager';\nimport { MetroBundlerDevServer } from '../../start/server/metro/MetroBundlerDevServer';\nimport { loadMetroConfigAsync } from '../../start/server/metro/instantiateMetro';\nimport { DOM_COMPONENTS_BUNDLE_DIR } from '../../start/server/middleware/DomComponentsMiddleware';\nimport { getMetroDirectBundleOptionsForExpoConfig } from '../../start/server/middleware/metroOptions';\nimport { stripAnsi } from '../../utils/ansi';\nimport { copyAsync, removeAsync } from '../../utils/dir';\nimport { env } from '../../utils/env';\nimport { setNodeEnv, loadEnvFiles } from '../../utils/nodeEnv';\nimport { exportDomComponentAsync } from '../exportDomComponents';\nimport { isEnableHermesManaged } from '../exportHermes';\nimport { persistMetroAssetsAsync } from '../persistMetroAssets';\nimport { copyPublicFolderAsync } from '../publicFolder';\nimport { BundleAssetWithFileHashes, ExportAssetMap, persistMetroFilesAsync } from '../saveAssets';\nimport { exportStandaloneServerAsync } from './exportServer';\nimport { ensureProcessExitsAfterDelay } from '../../utils/exit';\nimport { resolveRealEntryFilePath } from '../../utils/filePath';\n\nconst debug = require('debug')('expo:export:embed');\n\nfunction guessCopiedAppleBundlePath(bundleOutput: string) {\n // Ensure the path is familiar before guessing.\n if (\n !bundleOutput.match(/\\/Xcode\\/DerivedData\\/.*\\/Build\\/Products\\//) &&\n !bundleOutput.match(/\\/CoreSimulator\\/Devices\\/.*\\/data\\/Containers\\/Bundle\\/Application\\//)\n ) {\n debug('Bundling to non-standard location:', bundleOutput);\n return false;\n }\n const bundleName = path.basename(bundleOutput);\n const bundleParent = path.dirname(bundleOutput);\n const possiblePath = globSync(`*.app/${bundleName}`, {\n cwd: bundleParent,\n absolute: true,\n // bundle identifiers can start with dots.\n dot: true,\n })[0];\n debug('Possible path for previous bundle:', possiblePath);\n return possiblePath;\n}\n\nexport async function exportEmbedAsync(projectRoot: string, options: Options) {\n // The React Native build scripts always enable the cache reset but we shouldn't need this in CI environments.\n // By disabling it, we can eagerly bundle code before the build and reuse the cached artifacts in subsequent builds.\n if (env.CI && options.resetCache) {\n debug('CI environment detected, disabling automatic cache reset');\n options.resetCache = false;\n }\n\n setNodeEnv(options.dev ? 'development' : 'production');\n loadEnvFiles(projectRoot);\n\n // This is an optimized codepath that can occur during `npx expo run` and does not occur during builds from Xcode or Android Studio.\n // Here we reconcile a bundle pass that was run before the native build process. This order can fail faster and is show better errors since the logs won't be obscured by Xcode and Android Studio.\n // This path is also used for automatically deploying server bundles to a remote host.\n const eagerBundleOptions = env.__EXPO_EAGER_BUNDLE_OPTIONS\n ? deserializeEagerKey(env.__EXPO_EAGER_BUNDLE_OPTIONS)\n : null;\n if (eagerBundleOptions) {\n // Get the cache key for the current process to compare against the eager key.\n const inputKey = getExportEmbedOptionsKey(options);\n\n // If the app was bundled previously in the same process, then we should reuse the Metro cache.\n options.resetCache = false;\n\n if (eagerBundleOptions.key === inputKey) {\n // Copy the eager bundleOutput and assets to the new locations.\n await removeAsync(options.bundleOutput);\n\n copyAsync(eagerBundleOptions.options.bundleOutput, options.bundleOutput);\n\n if (eagerBundleOptions.options.assetsDest && options.assetsDest) {\n copyAsync(eagerBundleOptions.options.assetsDest, options.assetsDest);\n }\n\n console.log('info: Copied output to binary:', options.bundleOutput);\n return;\n }\n // TODO: sourcemapOutput is set on Android but not during eager. This is tolerable since it doesn't invalidate the Metro cache.\n console.log(' Eager key:', eagerBundleOptions.key);\n console.log('Request key:', inputKey);\n\n // TODO: We may want an analytic event here in the future to understand when this happens.\n console.warn('warning: Eager bundle does not match new options, bundling again.');\n }\n\n await exportEmbedInternalAsync(projectRoot, options);\n\n // Ensure the process closes after bundling\n ensureProcessExitsAfterDelay();\n}\n\nexport async function exportEmbedInternalAsync(projectRoot: string, options: Options) {\n // Ensure we delete the old bundle to trigger a failure if the bundle cannot be created.\n await removeAsync(options.bundleOutput);\n\n // The iOS bundle is copied in to the Xcode project, so we need to remove the old one\n // to prevent Xcode from loading the old one after a build failure.\n if (options.platform === 'ios') {\n const previousPath = guessCopiedAppleBundlePath(options.bundleOutput);\n if (previousPath && fs.existsSync(previousPath)) {\n debug('Removing previous iOS bundle:', previousPath);\n await removeAsync(previousPath);\n }\n }\n\n const { bundle, assets, files } = await exportEmbedBundleAndAssetsAsync(projectRoot, options);\n\n fs.mkdirSync(path.dirname(options.bundleOutput), { recursive: true, mode: 0o755 });\n\n // On Android, dom components proxy files should write to the assets directory instead of the res directory.\n // We use the bundleOutput directory to get the assets directory.\n const domComponentProxyOutputDir =\n options.platform === 'android' ? path.dirname(options.bundleOutput) : options.assetsDest;\n const hasDomComponents = domComponentProxyOutputDir && files.size > 0;\n\n // Persist bundle and source maps.\n await Promise.all([\n output.save(bundle, options, Log.log),\n\n // Write dom components proxy files.\n hasDomComponents ? persistMetroFilesAsync(files, domComponentProxyOutputDir) : null,\n // Copy public folder for dom components only if\n hasDomComponents\n ? copyPublicFolderAsync(\n path.resolve(projectRoot, env.EXPO_PUBLIC_FOLDER),\n path.join(domComponentProxyOutputDir, DOM_COMPONENTS_BUNDLE_DIR)\n )\n : null,\n\n // NOTE(EvanBacon): This may need to be adjusted in the future if want to support baseUrl on native\n // platforms when doing production embeds (unlikely).\n options.assetsDest\n ? persistMetroAssetsAsync(projectRoot, assets, {\n platform: options.platform,\n outputDirectory: options.assetsDest,\n iosAssetCatalogDirectory: options.assetCatalogDest,\n })\n : null,\n ]);\n}\n\nexport async function exportEmbedBundleAndAssetsAsync(\n projectRoot: string,\n options: Options\n): Promise<{\n bundle: Awaited<ReturnType<Server['build']>>;\n assets: readonly BundleAssetWithFileHashes[];\n files: ExportAssetMap;\n}> {\n const devServerManager = await DevServerManager.startMetroAsync(projectRoot, {\n minify: options.minify,\n mode: options.dev ? 'development' : 'production',\n port: 8081,\n isExporting: true,\n location: {},\n resetDevServer: options.resetCache,\n maxWorkers: options.maxWorkers,\n });\n\n const devServer = devServerManager.getDefaultDevServer();\n assert(devServer instanceof MetroBundlerDevServer);\n\n const { exp, pkg } = getConfig(projectRoot, { skipSDKVersionRequirement: true });\n const isHermes = isEnableHermesManaged(exp, options.platform);\n\n let sourceMapUrl = options.sourcemapOutput;\n if (sourceMapUrl && !options.sourcemapUseAbsolutePath) {\n sourceMapUrl = path.basename(sourceMapUrl);\n }\n\n const files: ExportAssetMap = new Map();\n\n try {\n const bundles = await devServer.nativeExportBundleAsync(\n exp,\n {\n // TODO: Re-enable when we get bytecode chunk splitting working again.\n splitChunks: false, //devServer.isReactServerComponentsEnabled,\n mainModuleName: resolveRealEntryFilePath(projectRoot, options.entryFile),\n platform: options.platform,\n minify: options.minify,\n mode: options.dev ? 'development' : 'production',\n engine: isHermes ? 'hermes' : undefined,\n serializerIncludeMaps: !!sourceMapUrl,\n bytecode: options.bytecode ?? false,\n // source map inline\n reactCompiler: !!exp.experiments?.reactCompiler,\n },\n files,\n {\n sourceMapUrl,\n unstable_transformProfile: (options.unstableTransformProfile ||\n (isHermes ? 'hermes-stable' : 'default')) as BundleOptions['unstable_transformProfile'],\n }\n );\n\n // We optimistically build the server-side API routes code here, to ensure they're\n // valid or to enable parallel deployment in the future (TBD). This is disabled using\n // the explicit `--skip-server` flag.\n const apiRoutesEnabled =\n devServer.isReactServerComponentsEnabled || exp.web?.output === 'server';\n if (!options.skipServer && apiRoutesEnabled) {\n await exportStandaloneServerAsync(projectRoot, devServer, {\n exp,\n pkg,\n files,\n options,\n });\n }\n\n const expoDomComponentReferences = [\n ...new Set(\n bundles.artifacts\n .map((artifact) =>\n Array.isArray(artifact.metadata.expoDomComponentReferences)\n ? artifact.metadata.expoDomComponentReferences\n : []\n )\n .flat()\n ),\n ];\n if (expoDomComponentReferences.length > 0) {\n await Promise.all(\n // TODO: Make a version of this which uses `this.metro.getBundler().buildGraphForEntries([])` to bundle all the DOM components at once.\n expoDomComponentReferences.map(async (filePath) => {\n const { bundle } = await exportDomComponentAsync({\n filePath,\n projectRoot,\n dev: options.dev,\n devServer,\n isHermes,\n includeSourceMaps: !!sourceMapUrl,\n exp,\n files,\n });\n\n if (options.assetsDest) {\n // Save assets like a typical bundler, preserving the file paths on web.\n // This is saving web-style inside of a native app's binary.\n await persistMetroAssetsAsync(\n projectRoot,\n bundle.assets.map((asset) => ({\n ...asset,\n httpServerLocation: path.join(DOM_COMPONENTS_BUNDLE_DIR, asset.httpServerLocation),\n })),\n {\n files,\n platform: 'web',\n outputDirectory: options.assetsDest,\n }\n );\n }\n })\n );\n }\n\n return {\n files,\n bundle: {\n code: bundles.artifacts.filter((a: any) => a.type === 'js')[0].source,\n // Can be optional when source maps aren't enabled.\n map: bundles.artifacts.filter((a: any) => a.type === 'map')[0]?.source.toString(),\n },\n assets: bundles.assets,\n };\n } catch (error: any) {\n if (isError(error)) {\n // Log using Xcode error format so the errors are picked up by xcodebuild.\n // https://developer.apple.com/documentation/xcode/running-custom-scripts-during-a-build#Log-errors-and-warnings-from-your-script\n if (options.platform === 'ios') {\n // If the error is about to be presented in Xcode, strip the ansi characters from the message.\n if ('message' in error && isExecutingFromXcodebuild()) {\n error.message = stripAnsi(error.message) as string;\n }\n logMetroErrorInXcode(projectRoot, error);\n }\n }\n throw error;\n } finally {\n devServerManager.stopAsync();\n }\n}\n\n// Exports for expo-updates\nexport async function createMetroServerAndBundleRequestAsync(\n projectRoot: string,\n options: Pick<\n Options,\n | 'maxWorkers'\n | 'config'\n | 'platform'\n | 'sourcemapOutput'\n | 'sourcemapUseAbsolutePath'\n | 'entryFile'\n | 'minify'\n | 'dev'\n | 'resetCache'\n | 'unstableTransformProfile'\n >\n): Promise<{ server: Server; bundleRequest: BundleOptions }> {\n const exp = getConfig(projectRoot, { skipSDKVersionRequirement: true }).exp;\n\n // TODO: This is slow ~40ms\n const { config } = await loadMetroConfigAsync(\n projectRoot,\n {\n // TODO: This is always enabled in the native script and there's no way to disable it.\n resetCache: options.resetCache,\n maxWorkers: options.maxWorkers,\n },\n {\n exp,\n isExporting: true,\n getMetroBundler() {\n return server.getBundler().getBundler();\n },\n }\n );\n\n const isHermes = isEnableHermesManaged(exp, options.platform);\n\n let sourceMapUrl = options.sourcemapOutput;\n if (sourceMapUrl && !options.sourcemapUseAbsolutePath) {\n sourceMapUrl = path.basename(sourceMapUrl);\n }\n\n const directBundleOptions = getMetroDirectBundleOptionsForExpoConfig(projectRoot, exp, {\n splitChunks: false,\n mainModuleName: resolveRealEntryFilePath(projectRoot, options.entryFile),\n platform: options.platform,\n minify: options.minify,\n mode: options.dev ? 'development' : 'production',\n engine: isHermes ? 'hermes' : undefined,\n isExporting: true,\n // Never output bytecode in the exported bundle since that is hardcoded in the native run script.\n bytecode: false,\n hosted: false,\n });\n\n // TODO(cedric): check if we can use the proper `bundleType=bundle` and `entryPoint=mainModuleName` properties\n const bundleRequest: BundleOptions = {\n ...Server.DEFAULT_BUNDLE_OPTIONS,\n ...directBundleOptions,\n\n // NOTE(@kitten): Cast non-optional defaults\n lazy: directBundleOptions.lazy ?? Server.DEFAULT_BUNDLE_OPTIONS.lazy,\n modulesOnly: directBundleOptions.modulesOnly ?? Server.DEFAULT_BUNDLE_OPTIONS.modulesOnly,\n runModule: directBundleOptions.runModule ?? Server.DEFAULT_BUNDLE_OPTIONS.runModule,\n\n sourceMapUrl,\n unstable_transformProfile: (options.unstableTransformProfile ||\n (isHermes ? 'hermes-stable' : 'default')) as BundleOptions['unstable_transformProfile'],\n };\n\n const server = new Server(config, {\n watch: false,\n });\n\n return { server, bundleRequest };\n}\n\nexport async function exportEmbedAssetsAsync(\n server: Server,\n bundleRequest: BundleOptions,\n projectRoot: string,\n options: Pick<Options, 'platform'>\n) {\n try {\n const { entryFile, onProgress, resolverOptions, transformOptions } = splitBundleOptions({\n ...bundleRequest,\n // @ts-ignore-error TODO(@kitten): Very unclear why this is here. Remove?\n bundleType: 'todo',\n });\n\n const dependencies = await server._bundler.getDependencies(\n [entryFile],\n transformOptions,\n resolverOptions,\n { onProgress, shallow: false, lazy: false }\n );\n\n const config = server._config;\n\n return getMetroAssets(dependencies, {\n processModuleFilter: config.serializer.processModuleFilter,\n assetPlugins: config.transformer.assetPlugins,\n platform: transformOptions.platform!,\n // Forked out of Metro because the `this._getServerRootDir()` doesn't match the development\n // behavior.\n projectRoot: config.projectRoot, // this._getServerRootDir(),\n publicPath: config.transformer.publicPath,\n isHosted: false,\n });\n } catch (error: any) {\n if (isError(error)) {\n // Log using Xcode error format so the errors are picked up by xcodebuild.\n // https://developer.apple.com/documentation/xcode/running-custom-scripts-during-a-build#Log-errors-and-warnings-from-your-script\n if (options.platform === 'ios') {\n // If the error is about to be presented in Xcode, strip the ansi characters from the message.\n if ('message' in error && isExecutingFromXcodebuild()) {\n error.message = stripAnsi(error.message) as string;\n }\n logMetroErrorInXcode(projectRoot, error);\n }\n }\n throw error;\n }\n}\n\nfunction isError(error: any): error is Error {\n return error instanceof Error;\n}\n"],"names":["createMetroServerAndBundleRequestAsync","exportEmbedAssetsAsync","exportEmbedAsync","exportEmbedBundleAndAssetsAsync","exportEmbedInternalAsync","debug","require","guessCopiedAppleBundlePath","bundleOutput","match","bundleName","path","basename","bundleParent","dirname","possiblePath","globSync","cwd","absolute","dot","projectRoot","options","env","CI","resetCache","setNodeEnv","dev","loadEnvFiles","eagerBundleOptions","__EXPO_EAGER_BUNDLE_OPTIONS","deserializeEagerKey","inputKey","getExportEmbedOptionsKey","key","removeAsync","copyAsync","assetsDest","console","log","warn","ensureProcessExitsAfterDelay","platform","previousPath","fs","existsSync","bundle","assets","files","mkdirSync","recursive","mode","domComponentProxyOutputDir","hasDomComponents","size","Promise","all","output","save","Log","persistMetroFilesAsync","copyPublicFolderAsync","resolve","EXPO_PUBLIC_FOLDER","join","DOM_COMPONENTS_BUNDLE_DIR","persistMetroAssetsAsync","outputDirectory","iosAssetCatalogDirectory","assetCatalogDest","devServerManager","DevServerManager","startMetroAsync","minify","port","isExporting","location","resetDevServer","maxWorkers","devServer","getDefaultDevServer","assert","MetroBundlerDevServer","exp","pkg","getConfig","skipSDKVersionRequirement","isHermes","isEnableHermesManaged","sourceMapUrl","sourcemapOutput","sourcemapUseAbsolutePath","Map","bundles","nativeExportBundleAsync","splitChunks","mainModuleName","resolveRealEntryFilePath","entryFile","engine","undefined","serializerIncludeMaps","bytecode","reactCompiler","experiments","unstable_transformProfile","unstableTransformProfile","apiRoutesEnabled","isReactServerComponentsEnabled","web","skipServer","exportStandaloneServerAsync","expoDomComponentReferences","Set","artifacts","map","artifact","Array","isArray","metadata","flat","length","filePath","exportDomComponentAsync","includeSourceMaps","asset","httpServerLocation","code","filter","a","type","source","toString","error","isError","isExecutingFromXcodebuild","message","stripAnsi","logMetroErrorInXcode","stopAsync","config","loadMetroConfigAsync","getMetroBundler","server","getBundler","directBundleOptions","getMetroDirectBundleOptionsForExpoConfig","hosted","bundleRequest","Server","DEFAULT_BUNDLE_OPTIONS","lazy","modulesOnly","runModule","watch","onProgress","resolverOptions","transformOptions","splitBundleOptions","bundleType","dependencies","_bundler","getDependencies","shallow","_config","getMetroAssets","processModuleFilter","serializer","assetPlugins","transformer","publicPath","isHosted","Error"],"mappings":"AAAA;;;;;CAKC;;;;;;;;;;;IA4SqBA,sCAAsC;eAAtCA;;IA6EAC,sBAAsB;eAAtBA;;IAjUAC,gBAAgB;eAAhBA;;IAqGAC,+BAA+B;eAA/BA;;IAlDAC,wBAAwB;eAAxBA;;;;yBA1GI;;;;;;;gEACP;;;;;;;gEACY;;;;;;;iEACP;;;;;;;gEAEG;;;;;;;gEACR;;;;;;;gEACJ;;;;;;;yBACkB;;;;;;;gEAChB;;;;;;gCAEsD;qCACP;qBAC5C;kCACa;uCACK;kCACD;yCACK;8BACe;sBAC/B;qBACa;qBACnB;yBACqB;qCACD;8BACF;oCACE;8BACF;4BAC4C;8BACtC;sBACC;0BACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEzC,MAAMC,QAAQC,QAAQ,SAAS;AAE/B,SAASC,2BAA2BC,YA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OAAOA,iBAAiBuC;AAC1B"}
1
+ {"version":3,"sources":["../../../../src/export/embed/exportEmbedAsync.ts"],"sourcesContent":["/**\n * Copyright © 2023 650 Industries.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { getConfig } from '@expo/config';\nimport { convertEntryPointToRelative } from '@expo/config/paths';\nimport Server from '@expo/metro/metro/Server';\nimport splitBundleOptions from '@expo/metro/metro/lib/splitBundleOptions';\nimport * as output from '@expo/metro/metro/shared/output/bundle';\nimport type { BundleOptions } from '@expo/metro/metro/shared/types';\nimport getMetroAssets from '@expo/metro-config/build/transform-worker/getAssets';\nimport assert from 'assert';\nimport fs from 'fs';\nimport { sync as globSync } from 'glob';\nimport path from 'path';\n\nimport { deserializeEagerKey, getExportEmbedOptionsKey, Options } from './resolveOptions';\nimport { isExecutingFromXcodebuild, logMetroErrorInXcode } from './xcodeCompilerLogger';\nimport { Log } from '../../log';\nimport { DevServerManager } from '../../start/server/DevServerManager';\nimport { MetroBundlerDevServer } from '../../start/server/metro/MetroBundlerDevServer';\nimport { loadMetroConfigAsync } from '../../start/server/metro/instantiateMetro';\nimport { DOM_COMPONENTS_BUNDLE_DIR } from '../../start/server/middleware/DomComponentsMiddleware';\nimport { getMetroDirectBundleOptionsForExpoConfig } from '../../start/server/middleware/metroOptions';\nimport { stripAnsi } from '../../utils/ansi';\nimport { copyAsync, removeAsync } from '../../utils/dir';\nimport { env } from '../../utils/env';\nimport { setNodeEnv, loadEnvFiles } from '../../utils/nodeEnv';\nimport { exportDomComponentAsync } from '../exportDomComponents';\nimport { isEnableHermesManaged } from '../exportHermes';\nimport { persistMetroAssetsAsync } from '../persistMetroAssets';\nimport { copyPublicFolderAsync } from '../publicFolder';\nimport { BundleAssetWithFileHashes, ExportAssetMap, persistMetroFilesAsync } from '../saveAssets';\nimport { exportStandaloneServerAsync } from './exportServer';\nimport { ensureProcessExitsAfterDelay } from '../../utils/exit';\n\nconst debug = require('debug')('expo:export:embed');\n\nfunction guessCopiedAppleBundlePath(bundleOutput: string) {\n // Ensure the path is familiar before guessing.\n if (\n !bundleOutput.match(/\\/Xcode\\/DerivedData\\/.*\\/Build\\/Products\\//) &&\n !bundleOutput.match(/\\/CoreSimulator\\/Devices\\/.*\\/data\\/Containers\\/Bundle\\/Application\\//)\n ) {\n debug('Bundling to non-standard location:', bundleOutput);\n return false;\n }\n const bundleName = path.basename(bundleOutput);\n const bundleParent = path.dirname(bundleOutput);\n const possiblePath = globSync(`*.app/${bundleName}`, {\n cwd: bundleParent,\n absolute: true,\n // bundle identifiers can start with dots.\n dot: true,\n })[0];\n debug('Possible path for previous bundle:', possiblePath);\n return possiblePath;\n}\n\nexport async function exportEmbedAsync(projectRoot: string, options: Options) {\n // The React Native build scripts always enable the cache reset but we shouldn't need this in CI environments.\n // By disabling it, we can eagerly bundle code before the build and reuse the cached artifacts in subsequent builds.\n if (env.CI && options.resetCache) {\n debug('CI environment detected, disabling automatic cache reset');\n options.resetCache = false;\n }\n\n setNodeEnv(options.dev ? 'development' : 'production');\n loadEnvFiles(projectRoot);\n\n // This is an optimized codepath that can occur during `npx expo run` and does not occur during builds from Xcode or Android Studio.\n // Here we reconcile a bundle pass that was run before the native build process. This order can fail faster and is show better errors since the logs won't be obscured by Xcode and Android Studio.\n // This path is also used for automatically deploying server bundles to a remote host.\n const eagerBundleOptions = env.__EXPO_EAGER_BUNDLE_OPTIONS\n ? deserializeEagerKey(env.__EXPO_EAGER_BUNDLE_OPTIONS)\n : null;\n if (eagerBundleOptions) {\n // Get the cache key for the current process to compare against the eager key.\n const inputKey = getExportEmbedOptionsKey(options);\n\n // If the app was bundled previously in the same process, then we should reuse the Metro cache.\n options.resetCache = false;\n\n if (eagerBundleOptions.key === inputKey) {\n // Copy the eager bundleOutput and assets to the new locations.\n await removeAsync(options.bundleOutput);\n\n copyAsync(eagerBundleOptions.options.bundleOutput, options.bundleOutput);\n\n if (eagerBundleOptions.options.assetsDest && options.assetsDest) {\n copyAsync(eagerBundleOptions.options.assetsDest, options.assetsDest);\n }\n\n console.log('info: Copied output to binary:', options.bundleOutput);\n return;\n }\n // TODO: sourcemapOutput is set on Android but not during eager. This is tolerable since it doesn't invalidate the Metro cache.\n console.log(' Eager key:', eagerBundleOptions.key);\n console.log('Request key:', inputKey);\n\n // TODO: We may want an analytic event here in the future to understand when this happens.\n console.warn('warning: Eager bundle does not match new options, bundling again.');\n }\n\n await exportEmbedInternalAsync(projectRoot, options);\n\n // Ensure the process closes after bundling\n ensureProcessExitsAfterDelay();\n}\n\nexport async function exportEmbedInternalAsync(projectRoot: string, options: Options) {\n // Ensure we delete the old bundle to trigger a failure if the bundle cannot be created.\n await removeAsync(options.bundleOutput);\n\n // The iOS bundle is copied in to the Xcode project, so we need to remove the old one\n // to prevent Xcode from loading the old one after a build failure.\n if (options.platform === 'ios') {\n const previousPath = guessCopiedAppleBundlePath(options.bundleOutput);\n if (previousPath && fs.existsSync(previousPath)) {\n debug('Removing previous iOS bundle:', previousPath);\n await removeAsync(previousPath);\n }\n }\n\n const { bundle, assets, files } = await exportEmbedBundleAndAssetsAsync(projectRoot, options);\n\n fs.mkdirSync(path.dirname(options.bundleOutput), { recursive: true, mode: 0o755 });\n\n // On Android, dom components proxy files should write to the assets directory instead of the res directory.\n // We use the bundleOutput directory to get the assets directory.\n const domComponentProxyOutputDir =\n options.platform === 'android' ? path.dirname(options.bundleOutput) : options.assetsDest;\n const hasDomComponents = domComponentProxyOutputDir && files.size > 0;\n\n // Persist bundle and source maps.\n await Promise.all([\n output.save(bundle, options, Log.log),\n\n // Write dom components proxy files.\n hasDomComponents ? persistMetroFilesAsync(files, domComponentProxyOutputDir) : null,\n // Copy public folder for dom components only if\n hasDomComponents\n ? copyPublicFolderAsync(\n path.resolve(projectRoot, env.EXPO_PUBLIC_FOLDER),\n path.join(domComponentProxyOutputDir, DOM_COMPONENTS_BUNDLE_DIR)\n )\n : null,\n\n // NOTE(EvanBacon): This may need to be adjusted in the future if want to support baseUrl on native\n // platforms when doing production embeds (unlikely).\n options.assetsDest\n ? persistMetroAssetsAsync(projectRoot, assets, {\n platform: options.platform,\n outputDirectory: options.assetsDest,\n iosAssetCatalogDirectory: options.assetCatalogDest,\n })\n : null,\n ]);\n}\n\nexport async function exportEmbedBundleAndAssetsAsync(\n projectRoot: string,\n options: Options\n): Promise<{\n bundle: Awaited<ReturnType<Server['build']>>;\n assets: readonly BundleAssetWithFileHashes[];\n files: ExportAssetMap;\n}> {\n const devServerManager = await DevServerManager.startMetroAsync(projectRoot, {\n minify: options.minify,\n mode: options.dev ? 'development' : 'production',\n port: 8081,\n isExporting: true,\n location: {},\n resetDevServer: options.resetCache,\n maxWorkers: options.maxWorkers,\n });\n\n const devServer = devServerManager.getDefaultDevServer();\n assert(devServer instanceof MetroBundlerDevServer);\n\n const { exp, pkg } = getConfig(projectRoot, { skipSDKVersionRequirement: true });\n const isHermes = isEnableHermesManaged(exp, options.platform);\n\n let sourceMapUrl = options.sourcemapOutput;\n if (sourceMapUrl && !options.sourcemapUseAbsolutePath) {\n sourceMapUrl = path.basename(sourceMapUrl);\n }\n\n const files: ExportAssetMap = new Map();\n\n try {\n const bundles = await devServer.nativeExportBundleAsync(\n exp,\n {\n // TODO: Re-enable when we get bytecode chunk splitting working again.\n splitChunks: false, //devServer.isReactServerComponentsEnabled,\n mainModuleName: convertEntryPointToRelative(projectRoot, options.entryFile),\n platform: options.platform,\n minify: options.minify,\n mode: options.dev ? 'development' : 'production',\n engine: isHermes ? 'hermes' : undefined,\n serializerIncludeMaps: !!sourceMapUrl,\n bytecode: options.bytecode ?? false,\n // source map inline\n reactCompiler: !!exp.experiments?.reactCompiler,\n },\n files,\n {\n sourceMapUrl,\n unstable_transformProfile: (options.unstableTransformProfile ||\n (isHermes ? 'hermes-stable' : 'default')) as BundleOptions['unstable_transformProfile'],\n }\n );\n\n // We optimistically build the server-side API routes code here, to ensure they're\n // valid or to enable parallel deployment in the future (TBD). This is disabled using\n // the explicit `--skip-server` flag.\n const apiRoutesEnabled =\n devServer.isReactServerComponentsEnabled || exp.web?.output === 'server';\n if (!options.skipServer && apiRoutesEnabled) {\n await exportStandaloneServerAsync(projectRoot, devServer, {\n exp,\n pkg,\n files,\n options,\n });\n }\n\n const expoDomComponentReferences = [\n ...new Set(\n bundles.artifacts\n .map((artifact) =>\n Array.isArray(artifact.metadata.expoDomComponentReferences)\n ? artifact.metadata.expoDomComponentReferences\n : []\n )\n .flat()\n ),\n ];\n if (expoDomComponentReferences.length > 0) {\n await Promise.all(\n // TODO: Make a version of this which uses `this.metro.getBundler().buildGraphForEntries([])` to bundle all the DOM components at once.\n expoDomComponentReferences.map(async (filePath) => {\n const { bundle } = await exportDomComponentAsync({\n filePath,\n projectRoot,\n dev: options.dev,\n devServer,\n isHermes,\n includeSourceMaps: !!sourceMapUrl,\n exp,\n files,\n });\n\n if (options.assetsDest) {\n // Save assets like a typical bundler, preserving the file paths on web.\n // This is saving web-style inside of a native app's binary.\n await persistMetroAssetsAsync(\n projectRoot,\n bundle.assets.map((asset) => ({\n ...asset,\n httpServerLocation: path.join(DOM_COMPONENTS_BUNDLE_DIR, asset.httpServerLocation),\n })),\n {\n files,\n platform: 'web',\n outputDirectory: options.assetsDest,\n }\n );\n }\n })\n );\n }\n\n return {\n files,\n bundle: {\n code: bundles.artifacts.filter((a: any) => a.type === 'js')[0].source,\n // Can be optional when source maps aren't enabled.\n map: bundles.artifacts.filter((a: any) => a.type === 'map')[0]?.source.toString(),\n },\n assets: bundles.assets,\n };\n } catch (error: any) {\n if (isError(error)) {\n // Log using Xcode error format so the errors are picked up by xcodebuild.\n // https://developer.apple.com/documentation/xcode/running-custom-scripts-during-a-build#Log-errors-and-warnings-from-your-script\n if (options.platform === 'ios') {\n // If the error is about to be presented in Xcode, strip the ansi characters from the message.\n if ('message' in error && isExecutingFromXcodebuild()) {\n error.message = stripAnsi(error.message) as string;\n }\n logMetroErrorInXcode(projectRoot, error);\n }\n }\n throw error;\n } finally {\n devServerManager.stopAsync();\n }\n}\n\n// Exports for expo-updates\nexport async function createMetroServerAndBundleRequestAsync(\n projectRoot: string,\n options: Pick<\n Options,\n | 'maxWorkers'\n | 'config'\n | 'platform'\n | 'sourcemapOutput'\n | 'sourcemapUseAbsolutePath'\n | 'entryFile'\n | 'minify'\n | 'dev'\n | 'resetCache'\n | 'unstableTransformProfile'\n >\n): Promise<{ server: Server; bundleRequest: BundleOptions }> {\n const exp = getConfig(projectRoot, { skipSDKVersionRequirement: true }).exp;\n\n // TODO: This is slow ~40ms\n const { config } = await loadMetroConfigAsync(\n projectRoot,\n {\n // TODO: This is always enabled in the native script and there's no way to disable it.\n resetCache: options.resetCache,\n maxWorkers: options.maxWorkers,\n },\n {\n exp,\n isExporting: true,\n getMetroBundler() {\n return server.getBundler().getBundler();\n },\n }\n );\n\n const isHermes = isEnableHermesManaged(exp, options.platform);\n\n let sourceMapUrl = options.sourcemapOutput;\n if (sourceMapUrl && !options.sourcemapUseAbsolutePath) {\n sourceMapUrl = path.basename(sourceMapUrl);\n }\n\n const directBundleOptions = getMetroDirectBundleOptionsForExpoConfig(projectRoot, exp, {\n splitChunks: false,\n // TODO(@kitten): This currently has to match a filename exactly\n mainModuleName: convertEntryPointToRelative(projectRoot, options.entryFile, null),\n platform: options.platform,\n minify: options.minify,\n mode: options.dev ? 'development' : 'production',\n engine: isHermes ? 'hermes' : undefined,\n isExporting: true,\n // Never output bytecode in the exported bundle since that is hardcoded in the native run script.\n bytecode: false,\n hosted: false,\n });\n\n // TODO(cedric): check if we can use the proper `bundleType=bundle` and `entryPoint=mainModuleName` properties\n const bundleRequest: BundleOptions = {\n ...Server.DEFAULT_BUNDLE_OPTIONS,\n ...directBundleOptions,\n\n // NOTE(@kitten): Cast non-optional defaults\n lazy: directBundleOptions.lazy ?? Server.DEFAULT_BUNDLE_OPTIONS.lazy,\n modulesOnly: directBundleOptions.modulesOnly ?? Server.DEFAULT_BUNDLE_OPTIONS.modulesOnly,\n runModule: directBundleOptions.runModule ?? Server.DEFAULT_BUNDLE_OPTIONS.runModule,\n\n sourceMapUrl,\n unstable_transformProfile: (options.unstableTransformProfile ||\n (isHermes ? 'hermes-stable' : 'default')) as BundleOptions['unstable_transformProfile'],\n };\n\n const server = new Server(config, {\n watch: false,\n });\n\n return { server, bundleRequest };\n}\n\nexport async function exportEmbedAssetsAsync(\n server: Server,\n bundleRequest: BundleOptions,\n projectRoot: string,\n options: Pick<Options, 'platform'>\n) {\n try {\n const { entryFile, onProgress, resolverOptions, transformOptions } = splitBundleOptions({\n ...bundleRequest,\n // @ts-ignore-error TODO(@kitten): Very unclear why this is here. Remove?\n bundleType: 'todo',\n });\n\n const dependencies = await server._bundler.getDependencies(\n // NOTE(@kitten): This isn't an `entryFile`, but instead a `mainModuleName`, that's been renamed\n // in `getMetroDirectBundleOptions`, where we've passed the already converted name\n [entryFile],\n transformOptions,\n resolverOptions,\n { onProgress, shallow: false, lazy: false }\n );\n\n const config = server._config;\n\n return getMetroAssets(dependencies, {\n processModuleFilter: config.serializer.processModuleFilter,\n assetPlugins: config.transformer.assetPlugins,\n platform: transformOptions.platform!,\n // Forked out of Metro because the `this._getServerRootDir()` doesn't match the development\n // behavior.\n projectRoot: config.projectRoot, // this._getServerRootDir(),\n publicPath: config.transformer.publicPath,\n isHosted: false,\n });\n } catch (error: any) {\n if (isError(error)) {\n // Log using Xcode error format so the errors are picked up by xcodebuild.\n // https://developer.apple.com/documentation/xcode/running-custom-scripts-during-a-build#Log-errors-and-warnings-from-your-script\n if (options.platform === 'ios') {\n // If the error is about to be presented in Xcode, strip the ansi characters from the message.\n if ('message' in error && isExecutingFromXcodebuild()) {\n error.message = stripAnsi(error.message) as string;\n }\n logMetroErrorInXcode(projectRoot, error);\n }\n }\n throw error;\n }\n}\n\nfunction isError(error: any): error is Error {\n return error instanceof Error;\n}\n"],"names":["createMetroServerAndBundleRequestAsync","exportEmbedAssetsAsync","exportEmbedAsync","exportEmbedBundleAndAssetsAsync","exportEmbedInternalAsync","debug","require","guessCopiedAppleBundlePath","bundleOutput","match","bundleName","path","basename","bundleParent","dirname","possiblePath","globSync","cwd","absolute","dot","projectRoot","options","env","CI","resetCache","setNodeEnv","dev","loadEnvFiles","eagerBundleOptions","__EXPO_EAGER_BUNDLE_OPTIONS","deserializeEagerKey","inputKey","getExportEmbedOptionsKey","key","removeAsync","copyAsync","assetsDest","console","log","warn","ensureProcessExitsAfterDelay","platform","previousPath","fs","existsSync","bundle","assets","files","mkdirSync","recursive","mode","domComponentProxyOutputDir","hasDomComponents","size","Promise","all","output","save","Log","persistMetroFilesAsync","copyPublicFolderAsync","resolve","EXPO_PUBLIC_FOLDER","join","DOM_COMPONENTS_BUNDLE_DIR","persistMetroAssetsAsync","outputDirectory","iosAssetCatalogDirectory","assetCatalogDest","devServerManager","DevServerManager","startMetroAsync","minify","port","isExporting","location","resetDevServer","maxWorkers","devServer","getDefaultDevServer","assert","MetroBundlerDevServer","exp","pkg","getConfig","skipSDKVersionRequirement","isHermes","isEnableHermesManaged","sourceMapUrl","sourcemapOutput","sourcemapUseAbsolutePath","Map","bundles","nativeExportBundleAsync","splitChunks","mainModuleName","convertEntryPointToRelative","entryFile","engine","undefined","serializerIncludeMaps","bytecode","reactCompiler","experiments","unstable_transformProfile","unstableTransformProfile","apiRoutesEnabled","isReactServerComponentsEnabled","web","skipServer","exportStandaloneServerAsync","expoDomComponentReferences","Set","artifacts","map","artifact","Array","isArray","metadata","flat","length","filePath","exportDomComponentAsync","includeSourceMaps","asset","httpServerLocation","code","filter","a","type","source","toString","error","isError","isExecutingFromXcodebuild","message","stripAnsi","logMetroErrorInXcode","stopAsync","config","loadMetroConfigAsync","getMetroBundler","server","getBundler","directBundleOptions","getMetroDirectBundleOptionsForExpoConfig","hosted","bundleRequest","Server","DEFAULT_BUNDLE_OPTIONS","lazy","modulesOnly","runModule","watch","onProgress","resolverOptions","transformOptions","splitBundleOptions","bundleType","dependencies","_bundler","getDependencies","shallow","_config","getMetroAssets","processModuleFilter","serializer","assetPlugins","transformer","publ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c,EAACL,cAAc;YAClCM,qBAAqB1B,OAAO2B,UAAU,CAACD,mBAAmB;YAC1DE,cAAc5B,OAAO6B,WAAW,CAACD,YAAY;YAC7C9H,UAAUmH,iBAAiBnH,QAAQ;YACnC,2FAA2F;YAC3F,YAAY;YACZrB,aAAauH,OAAOvH,WAAW;YAC/BqJ,YAAY9B,OAAO6B,WAAW,CAACC,UAAU;YACzCC,UAAU;QACZ;IACF,EAAE,OAAOtC,OAAY;QACnB,IAAIC,QAAQD,QAAQ;YAClB,0EAA0E;YAC1E,iIAAiI;YACjI,IAAI/G,QAAQoB,QAAQ,KAAK,OAAO;gBAC9B,8FAA8F;gBAC9F,IAAI,aAAa2F,SAASE,IAAAA,8CAAyB,KAAI;oBACrDF,MAAMG,OAAO,GAAGC,IAAAA,eAAS,EAACJ,MAAMG,OAAO;gBACzC;gBACAE,IAAAA,yCAAoB,EAACrH,aAAagH;YACpC;QACF;QACA,MAAMA;IACR;AACF;AAEA,SAASC,QAAQD,KAAU;IACzB,OAAOA,iBAAiBuC;AAC1B"}
@@ -113,7 +113,7 @@ const expoExportEmbed = async (argv)=>{
113
113
  if (args['--help']) {
114
114
  (0, _args.printHelp)(`(Internal) Export the JavaScript bundle during a native build script for embedding in a native binary`, (0, _chalk().default)`npx expo export:embed {dim <dir>}`, [
115
115
  (0, _chalk().default)`<dir> Directory of the Expo project. {dim Default: Current working directory}`,
116
- `--entry-file <path> Path to the root JS file, either absolute or relative to JS root`,
116
+ `--entry-file <path> Path to the root JS file, either absolute or relative to current working directory`,
117
117
  `--platform <string> Either "ios" or "android" (default: "ios")`,
118
118
  `--transformer <string> Specify a custom transformer to be used`,
119
119
  `--dev [boolean] If false, warnings are disabled and the bundle is minified (default: true)`,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/export/embed/index.ts"],"sourcesContent":["#!/usr/bin/env node\nimport arg from 'arg';\nimport chalk from 'chalk';\nimport path from 'path';\n\nimport { Command } from '../../../bin/cli';\nimport { assertWithOptionsArgs, printHelp } from '../../utils/args';\n\nexport const expoExportEmbed: Command = async (argv) => {\n const rawArgsMap: arg.Spec = {\n // Types\n '--entry-file': String,\n '--platform': String,\n '--transformer': String,\n '--bundle-output': String,\n '--bundle-encoding': String,\n '--max-workers': Number,\n '--sourcemap-output': String,\n '--sourcemap-sources-root': String,\n '--assets-dest': String,\n '--asset-catalog-dest': String,\n '--unstable-transform-profile': String,\n '--config': String,\n\n // By default we also export a standalone server, which is mostly done\n // during the `export:embed` native build to ensure that the server is\n // valid, or to deploy it later (TBD). This can be skipped using this\n // flag explicitly\n '--skip-server': Boolean,\n\n // Hack: This is added because react-native-xcode.sh script always includes this value.\n // If supplied, we'll do nothing with the value, but at least the process won't crash.\n // Note that we also don't show this value in the `--help` prompt since we don't want people to use it.\n '--config-cmd': String,\n\n // New flag to guess the other flags based on the environment.\n '--eager': Boolean,\n // Export the bundle as Hermes bytecode bundle\n '--bytecode': Boolean,\n\n // This is here for compatibility with the `npx react-native bundle` command.\n // devs should use `DEBUG=expo:*` instead.\n '--verbose': Boolean,\n '--help': Boolean,\n // Aliases\n '-h': '--help',\n '-v': '--verbose',\n };\n const args = assertWithOptionsArgs(rawArgsMap, {\n argv,\n permissive: true,\n });\n\n if (args['--help']) {\n printHelp(\n `(Internal) Export the JavaScript bundle during a native build script for embedding in a native binary`,\n chalk`npx expo export:embed {dim <dir>}`,\n [\n chalk`<dir> Directory of the Expo project. {dim Default: Current working directory}`,\n `--entry-file <path> Path to the root JS file, either absolute or relative to JS root`,\n `--platform <string> Either \"ios\" or \"android\" (default: \"ios\")`,\n `--transformer <string> Specify a custom transformer to be used`,\n `--dev [boolean] If false, warnings are disabled and the bundle is minified (default: true)`,\n `--minify [boolean] Allows overriding whether bundle is minified. This defaults to false if dev is true, and true if dev is false. Disabling minification can be useful for speeding up production builds for testing purposes.`,\n `--bundle-output <string> File name where to store the resulting bundle, ex. /tmp/groups.bundle`,\n `--bundle-encoding <string> Encoding the bundle should be written in (https://nodejs.org/api/buffer.html#buffer_buffer). (default: \"utf8\")`,\n `--max-workers <number> Specifies the maximum number of workers the worker-pool will spawn for transforming files. This defaults to the number of the cores available on your machine.`,\n `--sourcemap-output <string> File name where to store the sourcemap file for resulting bundle, ex. /tmp/groups.map`,\n `--sourcemap-sources-root <string> Path to make sourcemap's sources entries relative to, ex. /root/dir`,\n `--sourcemap-use-absolute-path Report SourceMapURL using its full path`,\n `--assets-dest <string> Directory name where to store assets referenced in the bundle`,\n `--asset-catalog-dest <string> Directory to create an iOS Asset Catalog for images`,\n `--unstable-transform-profile <string> Experimental, transform JS for a specific JS engine. Currently supported: hermes, hermes-canary, default`,\n `--reset-cache Removes cached files`,\n `--eager Eagerly export the bundle with default options`,\n `--bytecode Export the bundle as Hermes bytecode bundle`,\n `-v, --verbose Enables debug logging`,\n\n `--config <string> Path to the CLI configuration file`,\n // This is seemingly unused.\n `--read-global-cache Try to fetch transformed JS code from the global cache, if configured.`,\n\n `-h, --help Usage info`,\n ].join('\\n')\n );\n }\n\n const [\n { exportEmbedAsync },\n { resolveOptions },\n { logCmdError },\n { resolveCustomBooleanArgsAsync },\n ] = await Promise.all([\n import('./exportEmbedAsync.js'),\n import('./resolveOptions.js'),\n import('../../utils/errors.js'),\n import('../../utils/resolveArgs.js'),\n ]);\n\n return (async () => {\n const parsed = await resolveCustomBooleanArgsAsync(argv ?? [], rawArgsMap, {\n '--eager': Boolean,\n '--bytecode': Boolean,\n '--dev': Boolean,\n '--minify': Boolean,\n '--sourcemap-use-absolute-path': Boolean,\n '--reset-cache': Boolean,\n '--read-global-cache': Boolean,\n });\n\n const projectRoot = path.resolve(parsed.projectRoot);\n return exportEmbedAsync(projectRoot, resolveOptions(projectRoot, args, parsed));\n })().catch(logCmdError);\n};\n"],"names":["expoExportEmbed","argv","rawArgsMap","String","Number","Boolean","args","assertWithOptionsArgs","permissive","printHelp","chalk","join","exportEmbedAsync","resolveOptions","logCmdError","resolveCustomBooleanArgsAsync","Promise","all","parsed","projectRoot","path","resol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AAoG,CAAC;YACtG,CAAC,0FAA0F,CAAC;YAC5F,CAAC,+IAA+I,CAAC;YACjJ,CAAC,2DAA2D,CAAC;YAC7D,CAAC,qFAAqF,CAAC;YACvF,CAAC,kFAAkF,CAAC;YACpF,CAAC,4DAA4D,CAAC;YAE9D,CAAC,yEAAyE,CAAC;YAC3E,4BAA4B;YAC5B,CAAC,6GAA6G,CAAC;YAE/G,CAAC,iDAAiD,CAAC;SACpD,CAACC,IAAI,CAAC;IAEX;IAEA,MAAM,CACJ,EAAEC,gBAAgB,EAAE,EACpB,EAAEC,cAAc,EAAE,EAClB,EAAEC,WAAW,EAAE,EACf,EAAEC,6BAA6B,EAAE,CAClC,GAAG,MAAMC,QAAQC,GAAG,CAAC;QACpB,mEAAA,QAAO;QACP,mEAAA,QAAO;QACP,mEAAA,QAAO;QACP,mEAAA,QAAO;KACR;IAED,OAAO,AAAC,CAAA;QACN,MAAMC,SAAS,MAAMH,8BAA8Bd,QAAQ,EAAE,EAAEC,YAAY;YACzE,WAAWG;YACX,cAAcA;YACd,SAASA;YACT,YAAYA;YACZ,iCAAiCA;YACjC,iBAAiBA;YACjB,uBAAuBA;QACzB;QAEA,MAAMc,cAAcC,eAAI,CAACC,OAAO,CAACH,OAAOC,WAAW;QACnD,OAAOP,iBAAiBO,aAAaN,eAAeM,aAAab,MAAMY;IACzE,CAAA,IAAKI,KAAK,CAACR;AACb"}
1
+ {"version":3,"sources":["../../../../src/export/embed/index.ts"],"sourcesContent":["#!/usr/bin/env node\nimport arg from 'arg';\nimport chalk from 'chalk';\nimport path from 'path';\n\nimport { Command } from '../../../bin/cli';\nimport { assertWithOptionsArgs, printHelp } from '../../utils/args';\n\nexport const expoExportEmbed: Command = async (argv) => {\n const rawArgsMap: arg.Spec = {\n // Types\n '--entry-file': String,\n '--platform': String,\n '--transformer': String,\n '--bundle-output': String,\n '--bundle-encoding': String,\n '--max-workers': Number,\n '--sourcemap-output': String,\n '--sourcemap-sources-root': String,\n '--assets-dest': String,\n '--asset-catalog-dest': String,\n '--unstable-transform-profile': String,\n '--config': String,\n\n // By default we also export a standalone server, which is mostly done\n // during the `export:embed` native build to ensure that the server is\n // valid, or to deploy it later (TBD). This can be skipped using this\n // flag explicitly\n '--skip-server': Boolean,\n\n // Hack: This is added because react-native-xcode.sh script always includes this value.\n // If supplied, we'll do nothing with the value, but at least the process won't crash.\n // Note that we also don't show this value in the `--help` prompt since we don't want people to use it.\n '--config-cmd': String,\n\n // New flag to guess the other flags based on the environment.\n '--eager': Boolean,\n // Export the bundle as Hermes bytecode bundle\n '--bytecode': Boolean,\n\n // This is here for compatibility with the `npx react-native bundle` command.\n // devs should use `DEBUG=expo:*` instead.\n '--verbose': Boolean,\n '--help': Boolean,\n // Aliases\n '-h': '--help',\n '-v': '--verbose',\n };\n const args = assertWithOptionsArgs(rawArgsMap, {\n argv,\n permissive: true,\n });\n\n if (args['--help']) {\n printHelp(\n `(Internal) Export the JavaScript bundle during a native build script for embedding in a native binary`,\n chalk`npx expo export:embed {dim <dir>}`,\n [\n chalk`<dir> Directory of the Expo project. {dim Default: Current working directory}`,\n `--entry-file <path> Path to the root JS file, either absolute or relative to current working directory`,\n `--platform <string> Either \"ios\" or \"android\" (default: \"ios\")`,\n `--transformer <string> Specify a custom transformer to be used`,\n `--dev [boolean] If false, warnings are disabled and the bundle is minified (default: true)`,\n `--minify [boolean] Allows overriding whether bundle is minified. This defaults to false if dev is true, and true if dev is false. Disabling minification can be useful for speeding up production builds for testing purposes.`,\n `--bundle-output <string> File name where to store the resulting bundle, ex. /tmp/groups.bundle`,\n `--bundle-encoding <string> Encoding the bundle should be written in (https://nodejs.org/api/buffer.html#buffer_buffer). (default: \"utf8\")`,\n `--max-workers <number> Specifies the maximum number of workers the worker-pool will spawn for transforming files. This defaults to the number of the cores available on your machine.`,\n `--sourcemap-output <string> File name where to store the sourcemap file for resulting bundle, ex. /tmp/groups.map`,\n `--sourcemap-sources-root <string> Path to make sourcemap's sources entries relative to, ex. /root/dir`,\n `--sourcemap-use-absolute-path Report SourceMapURL using its full path`,\n `--assets-dest <string> Directory name where to store assets referenced in the bundle`,\n `--asset-catalog-dest <string> Directory to create an iOS Asset Catalog for images`,\n `--unstable-transform-profile <string> Experimental, transform JS for a specific JS engine. Currently supported: hermes, hermes-canary, default`,\n `--reset-cache Removes cached files`,\n `--eager Eagerly export the bundle with default options`,\n `--bytecode Export the bundle as Hermes bytecode bundle`,\n `-v, --verbose Enables debug logging`,\n\n `--config <string> Path to the CLI configuration file`,\n // This is seemingly unused.\n `--read-global-cache Try to fetch transformed JS code from the global cache, if configured.`,\n\n `-h, --help Usage info`,\n ].join('\\n')\n );\n }\n\n const [\n { exportEmbedAsync },\n { resolveOptions },\n { logCmdError },\n { resolveCustomBooleanArgsAsync },\n ] = await Promise.all([\n import('./exportEmbedAsync.js'),\n import('./resolveOptions.js'),\n import('../../utils/errors.js'),\n import('../../utils/resolveArgs.js'),\n ]);\n\n return (async () => {\n const parsed = await resolveCustomBooleanArgsAsync(argv ?? [], rawArgsMap, {\n '--eager': Boolean,\n '--bytecode': Boolean,\n '--dev': Boolean,\n '--minify': Boolean,\n '--sourcemap-use-absolute-path': Boolean,\n '--reset-cache': Boolean,\n '--read-global-cache': Boolean,\n });\n\n const projectRoot = path.resolve(parsed.projectRoot);\n return exportEmbedAsync(projectRoot, resolveOptions(projectRoot, args, parsed));\n })().catch(logCmdError);\n};\n"],"names":["expoExportEmbed","argv","rawArgsMap","String","Number","Boolean","args","assertWithOptionsArgs","permissive","printHelp","chalk","join","exportEmbedAsync","resolveOptions","logCmdError","resolveCustomBooleanArgsAsync","Promise","all","parsed","projectRoot","path","resolve","catch"],"mappings":";;;;;+BAQaA;;;eAAAA;;;;gEANK;;;;;;;gEACD;;;;;;sBAGgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE1C,MAAMA,kBAA2B,OAAOC;IAC7C,MAAMC,aAAuB;QAC3B,QAAQ;QACR,gBAAgBC;QACh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A4B;YAC5B,CAAC,6GAA6G,CAAC;YAE/G,CAAC,iDAAiD,CAAC;SACpD,CAACC,IAAI,CAAC;IAEX;IAEA,MAAM,CACJ,EAAEC,gBAAgB,EAAE,EACpB,EAAEC,cAAc,EAAE,EAClB,EAAEC,WAAW,EAAE,EACf,EAAEC,6BAA6B,EAAE,CAClC,GAAG,MAAMC,QAAQC,GAAG,CAAC;QACpB,mEAAA,QAAO;QACP,mEAAA,QAAO;QACP,mEAAA,QAAO;QACP,mEAAA,QAAO;KACR;IAED,OAAO,AAAC,CAAA;QACN,MAAMC,SAAS,MAAMH,8BAA8Bd,QAAQ,EAAE,EAAEC,YAAY;YACzE,WAAWG;YACX,cAAcA;YACd,SAASA;YACT,YAAYA;YACZ,iCAAiCA;YACjC,iBAAiBA;YACjB,uBAAuBA;QACzB;QAEA,MAAMc,cAAcC,eAAI,CAACC,OAAO,CAACH,OAAOC,WAAW;QACnD,OAAOP,iBAAiBO,aAAaN,eAAeM,aAAab,MAAMY;IACzE,CAAA,IAAKI,KAAK,CAACR;AACb"}
@@ -15,6 +15,13 @@ function _config() {
15
15
  };
16
16
  return data;
17
17
  }
18
+ function _paths() {
19
+ const data = require("@expo/config/paths");
20
+ _paths = function() {
21
+ return data;
22
+ };
23
+ return data;
24
+ }
18
25
  function _assert() {
19
26
  const data = /*#__PURE__*/ _interop_require_default(require("assert"));
20
27
  _assert = function() {
@@ -59,7 +66,6 @@ const _DevServerManager = require("../start/server/DevServerManager");
59
66
  const _MetroBundlerDevServer = require("../start/server/metro/MetroBundlerDevServer");
60
67
  const _router = require("../start/server/metro/router");
61
68
  const _serializeHtml = require("../start/server/metro/serializeHtml");
62
- const _ManifestMiddleware = require("../start/server/middleware/ManifestMiddleware");
63
69
  const _metroOptions = require("../start/server/middleware/metroOptions");
64
70
  const _webTemplate = require("../start/server/webTemplate");
65
71
  const _env = require("../utils/env");
@@ -198,7 +204,7 @@ async function exportAppAsync(projectRoot, { platforms, outputDir, clear, dev, d
198
204
  bundle = await devServer.nativeExportBundleAsync(exp, {
199
205
  platform,
200
206
  splitChunks: !_env.env.EXPO_NO_BUNDLE_SPLITTING && (devServer.isReactServerComponentsEnabled && !bytecode || platform === 'web'),
201
- mainModuleName: (0, _ManifestMiddleware.getEntryWithServerRoot)(projectRoot, {
207
+ mainModuleName: (0, _paths().resolveRelativeEntryPoint)(projectRoot, {
202
208
  platform,
203
209
  pkg: projectConfig.pkg
204
210
  }),
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/export/exportApp.ts"],"sourcesContent":["import { getConfig } from '@expo/config';\nimport type { Platform } from '@expo/config';\nimport { SerialAsset } from '@expo/metro-config/build/serializer/serializerAssets';\nimport assert from 'assert';\nimport chalk from 'chalk';\nimport fs from 'fs';\nimport path from 'path';\n\nimport { type PlatformMetadata, createMetadataJson } from './createMetadataJson';\nimport { exportAssetsAsync } from './exportAssets';\nimport {\n addDomBundleToMetadataAsync,\n exportDomComponentAsync,\n transformNativeBundleForMd5Filename,\n transformDomEntryForMd5Filename,\n} from './exportDomComponents';\nimport { assertEngineMismatchAsync, isEnableHermesManaged } from './exportHermes';\nimport { exportApiRoutesStandaloneAsync, exportFromServerAsync } from './exportStaticAsync';\nimport { getVirtualFaviconAssetsAsync } from './favicon';\nimport { getPublicExpoManifestAsync } from './getPublicExpoManifest';\nimport { copyPublicFolderAsync } from './publicFolder';\nimport { Options } from './resolveOptions';\nimport {\n ExportAssetMap,\n BundleOutput,\n getFilesFromSerialAssets,\n persistMetroFilesAsync,\n BundleAssetWithFileHashes,\n} from './saveAssets';\nimport { createAssetMap } from './writeContents';\nimport * as Log from '../log';\nimport { WebSupportProjectPrerequisite } from '../start/doctor/web/WebSupportProjectPrerequisite';\nimport { DevServerManager } from '../start/server/DevServerManager';\nimport { MetroBundlerDevServer } from '../start/server/metro/MetroBundlerDevServer';\nimport { getRouterDirectoryModuleIdWithManifest } from '../start/server/metro/router';\nimport { serializeHtmlWithAssets } from '../start/server/metro/serializeHtml';\nimport { getEntryWithServerRoot } from '../start/server/middleware/ManifestMiddleware';\nimport { getBaseUrlFromExpoConfig } from '../start/server/middleware/metroOptions';\nimport { createTemplateHtmlFromExpoConfigAsync } from '../start/server/webTemplate';\nimport { env } from '../utils/env';\nimport { CommandError } from '../utils/errors';\nimport { setNodeEnv, loadEnvFiles } from '../utils/nodeEnv';\n\nexport async function exportAppAsync(\n projectRoot: string,\n {\n platforms,\n outputDir,\n clear,\n dev,\n dumpAssetmap,\n sourceMaps,\n inlineSourceMaps,\n minify,\n bytecode,\n maxWorkers,\n skipSSG,\n hostedNative,\n }: Pick<\n Options,\n | 'dumpAssetmap'\n | 'sourceMaps'\n | 'inlineSourceMaps'\n | 'dev'\n | 'clear'\n | 'outputDir'\n | 'platforms'\n | 'minify'\n | 'bytecode'\n | 'maxWorkers'\n | 'skipSSG'\n | 'hostedNative'\n >\n): Promise<void> {\n // Force the environment during export and do not allow overriding it.\n const environment = dev ? 'development' : 'production';\n process.env.NODE_ENV = environment;\n setNodeEnv(environment);\n loadEnvFiles(projectRoot);\n\n const projectConfig = getConfig(projectRoot);\n const exp = await getPublicExpoManifestAsync(projectRoot, {\n // Web doesn't require validation.\n skipValidation: platforms.length === 1 && platforms[0] === 'web',\n });\n\n if (platforms.includes('web')) {\n await new WebSupportProjectPrerequisite(projectRoot).assertAsync();\n }\n\n const useServerRendering = ['static', 'server'].includes(exp.web?.output ?? '');\n\n if (skipSSG && exp.web?.output !== 'server') {\n throw new CommandError('--no-ssg can only be used with `web.output: server`');\n }\n\n const baseUrl = getBaseUrlFromExpoConfig(exp);\n\n if (!bytecode && (platforms.includes('ios') || platforms.includes('android'))) {\n Log.warn(\n `Bytecode makes the app startup faster, disabling bytecode is highly discouraged and should only be used for debugging purposes.`\n );\n }\n\n // Print out logs\n if (baseUrl) {\n Log.log();\n Log.log(chalk.gray`Using (experimental) base path: ${baseUrl}`);\n // Warn if not using an absolute path.\n if (!baseUrl.startsWith('/')) {\n Log.log(\n chalk.yellow` Base path does not start with a slash. Requests will not be absolute.`\n );\n }\n }\n\n const mode = dev ? 'development' : 'production';\n const publicPath = path.resolve(projectRoot, env.EXPO_PUBLIC_FOLDER);\n const outputPath = path.resolve(projectRoot, outputDir);\n\n // Write the JS bundles to disk, and get the bundle file names (this could change with async chunk loading support).\n\n const files: ExportAssetMap = new Map();\n\n const devServerManager = await DevServerManager.startMetroAsync(projectRoot, {\n minify,\n mode,\n port: 8081,\n isExporting: true,\n location: {},\n resetDevServer: clear,\n maxWorkers,\n });\n\n const devServer = devServerManager.getDefaultDevServer();\n assert(devServer instanceof MetroBundlerDevServer);\n\n const bundles: Partial<Record<Platform, BundleOutput>> = {};\n const domComponentAssetsMetadata: Partial<Record<Platform, PlatformMetadata['assets']>> = {};\n\n const spaPlatforms =\n // TODO: Support server and static rendering for server component exports.\n useServerRendering && !devServer.isReactServerComponentsEnabled\n ? platforms.filter((platform) => platform !== 'web')\n : platforms;\n\n try {\n if (devServer.isReactServerComponentsEnabled) {\n // In RSC mode, we only need these to be in the client dir.\n // TODO: Merge back with other copy after we add SSR.\n try {\n await copyPublicFolderAsync(publicPath, path.join(outputPath, 'client'));\n } catch (error) {\n Log.error('Failed to copy public directory to dist directory');\n throw error;\n }\n } else {\n // NOTE(kitten): The public folder is currently always copied, regardless of targetDomain\n // split. Hence, there's another separate `copyPublicFolderAsync` call below for `web`\n await copyPublicFolderAsync(publicPath, outputPath);\n }\n\n let templateHtml: string | undefined;\n // Can be empty during web-only SSG.\n if (spaPlatforms.length) {\n await Promise.all(\n spaPlatforms.map(async (platform) => {\n // Assert early so the user doesn't have to wait until bundling is complete to find out that\n // Hermes won't be available.\n const isHermes = isEnableHermesManaged(exp, platform);\n if (isHermes) {\n await assertEngineMismatchAsync(projectRoot, exp, platform);\n }\n\n let bundle: {\n artifacts: SerialAsset[];\n assets: readonly BundleAssetWithFileHashes[];\n files?: ExportAssetMap;\n };\n\n try {\n // Run metro bundler and create the JS bundles/source maps.\n bundle = await devServer.nativeExportBundleAsync(\n exp,\n {\n platform,\n splitChunks:\n !env.EXPO_NO_BUNDLE_SPLITTING &&\n ((devServer.isReactServerComponentsEnabled && !bytecode) || platform === 'web'),\n mainModuleName: getEntryWithServerRoot(projectRoot, {\n platform,\n pkg: projectConfig.pkg,\n }),\n mode: dev ? 'development' : 'production',\n engine: isHermes ? 'hermes' : undefined,\n serializerIncludeMaps: sourceMaps || inlineSourceMaps,\n inlineSourceMap: inlineSourceMaps,\n bytecode: bytecode && isHermes,\n reactCompiler: !!exp.experiments?.reactCompiler,\n hosted: hostedNative,\n },\n files\n );\n } catch (error) {\n Log.log('');\n if (error instanceof Error) {\n Log.exception(error);\n } else {\n Log.error('Failed to bundle the app');\n Log.log(error as any);\n }\n process.exit(1);\n }\n\n bundles[platform] = bundle;\n\n getFilesFromSerialAssets(bundle.artifacts, {\n includeSourceMaps: sourceMaps,\n files,\n isServerHosted: devServer.isReactServerComponentsEnabled || hostedNative,\n });\n\n const expoDomComponentReferences = [\n ...new Set(\n bundle.artifacts\n .map((artifact) =>\n Array.isArray(artifact.metadata.expoDomComponentReferences)\n ? artifact.metadata.expoDomComponentReferences\n : []\n )\n .flat()\n ),\n ];\n await Promise.all(\n // TODO: Make a version of this which uses `this.metro.getBundler().buildGraphForEntries([])` to bundle all the DOM components at once.\n expoDomComponentReferences.map(async (filePath) => {\n const { bundle: platformDomComponentsBundle, htmlOutputName } =\n await exportDomComponentAsync({\n filePath,\n projectRoot,\n dev,\n devServer,\n isHermes,\n includeSourceMaps: sourceMaps,\n exp,\n files,\n useMd5Filename: true,\n });\n\n // Merge the assets from the DOM component into the output assets, deduplicating by hash.\n const existingHashes = new Set(bundle.assets.map((a) => a.hash));\n (bundle.assets as (typeof bundle.assets)[0][]).push(\n ...platformDomComponentsBundle.assets.filter((a) => !existingHashes.has(a.hash))\n );\n\n transformNativeBundleForMd5Filename({\n domComponentReference: filePath,\n nativeBundle: bundle,\n files,\n htmlOutputName,\n });\n domComponentAssetsMetadata[platform] = [\n ...(domComponentAssetsMetadata[platform] || []),\n ...(await addDomBundleToMetadataAsync(platformDomComponentsBundle)),\n ...transformDomEntryForMd5Filename({\n files,\n htmlOutputName,\n }),\n ];\n })\n );\n\n if (platform === 'web') {\n // TODO: Unify with exportStaticAsync\n // TODO: Maybe move to the serializer.\n let html = await serializeHtmlWithAssets({\n isExporting: true,\n resources: bundle.artifacts,\n template: await createTemplateHtmlFromExpoConfigAsync(projectRoot, {\n scripts: [],\n cssLinks: [],\n exp: projectConfig.exp,\n }),\n baseUrl,\n });\n\n // Add the favicon assets to the HTML.\n const modifyHtml = await getVirtualFaviconAssetsAsync(projectRoot, {\n outputDir,\n baseUrl,\n files,\n exp: projectConfig.exp,\n });\n if (modifyHtml) {\n html = modifyHtml(html);\n }\n\n // HACK: This is used for adding SSR shims in React Server Components.\n templateHtml = html;\n\n // Generate SPA-styled HTML file.\n // If web exists, then write the template HTML file.\n files.set('index.html', {\n contents: html,\n targetDomain: devServer.isReactServerComponentsEnabled ? 'server' : 'client',\n });\n }\n })\n );\n\n if (devServer.isReactServerComponentsEnabled) {\n const isWeb = platforms.includes('web');\n\n await exportApiRoutesStandaloneAsync(devServer, {\n files,\n platform: 'web',\n apiRoutesOnly: !isWeb,\n templateHtml,\n });\n }\n\n // TODO: Use same asset system across platforms again.\n const { assets, embeddedHashSet } = await exportAssetsAsync(projectRoot, {\n files,\n exp,\n outputDir: outputPath,\n bundles,\n baseUrl,\n hostedNative,\n });\n\n if (dumpAssetmap) {\n Log.log('Creating asset map');\n files.set('assetmap.json', { contents: JSON.stringify(createAssetMap({ assets })) });\n }\n\n const targetDomain = devServer.isReactServerComponentsEnabled ? 'client/' : '';\n const fileNames = Object.fromEntries(\n Object.entries(bundles).map(([platform, bundle]) => [\n platform,\n bundle.artifacts\n .filter((asset) => asset.type === 'js')\n .map((asset) => targetDomain + asset.filename),\n ])\n );\n\n // Generate a `metadata.json` for EAS Update.\n const contents = createMetadataJson({\n bundles,\n fileNames,\n embeddedHashSet,\n domComponentAssetsMetadata,\n });\n files.set('metadata.json', { contents: JSON.stringify(contents) });\n }\n\n // Additional web-only steps...\n\n if (platforms.includes('web') && useServerRendering) {\n const exportServer = exp.web?.output === 'server';\n\n if (exportServer) {\n // TODO: Remove when this is abstracted into the files map\n await copyPublicFolderAsync(publicPath, path.resolve(outputPath, 'client'));\n }\n\n if (skipSSG) {\n Log.log('Skipping static site generation');\n await exportApiRoutesStandaloneAsync(devServer, {\n files,\n platform: 'web',\n apiRoutesOnly: true,\n });\n\n // Output a placeholder index.html if one doesn't exist in the public directory.\n // This ensures native + API routes have some content at the root URL.\n const placeholderIndex = path.resolve(outputPath, 'client/index.html');\n if (!fs.existsSync(placeholderIndex)) {\n files.set('index.html', {\n contents: `<html><body></body></html>`,\n targetDomain: 'client',\n });\n }\n } else if (\n // TODO: Support static export with RSC.\n !devServer.isReactServerComponentsEnabled\n ) {\n await exportFromServerAsync(projectRoot, devServer, {\n mode,\n files,\n clear: !!clear,\n outputDir: outputPath,\n minify,\n baseUrl,\n includeSourceMaps: sourceMaps,\n routerRoot: getRouterDirectoryModuleIdWithManifest(projectRoot, exp),\n reactCompiler: !!exp.experiments?.reactCompiler,\n exportServer,\n maxWorkers,\n isExporting: true,\n exp: projectConfig.exp,\n });\n }\n }\n } finally {\n await devServerManager.stopAsync();\n }\n\n // Write all files at the end for unified logging.\n await persistMetroFilesAsync(files, outputPath);\n}\n"],"names":["exportAppAsync","projectRoot","platforms","outputDir","clear","dev","dumpAssetmap","sourceMaps","inlineSourceMaps","minify","bytecode","maxWorkers","skipSSG","hostedNative","exp","environment","process","env","NODE_ENV","setNodeEnv","loadEnvFiles","projectConfig","getConfig","getPublicExpoManifestAsync","skipValidation","length","includes","WebSupportProjectPrerequisite","assertAsync","useServerRendering","web","output","CommandError","baseUrl","getBaseUrlFromExpoConfig","Log","warn","log","chalk","gray","startsWith","yellow","mode","publicPath","path","resolve","EXPO_PUBLIC_FOLDER","outputPath","files","Map","devServerManager","DevServerManager","startMetroAsync","port","isExporting","location","resetDevServer","devServer","getDefaultDevServer","assert","MetroBundlerDevServer","bundles","domComponentAssetsMetadata","spaPlatforms","isReactServerComponentsEnabled","filter","platform","copyPublicFolderAsync","join","error","templateHtml","Promise","all","map","isHermes","isEnableHermesManaged","assertEngineMismatchAsync","bundle","nativeExportBundleAsync","splitChunks","EXPO_NO_BUNDLE_SPLITTING","mainModuleName","getEntryWithServerRoot","pkg","engine","undefined","serializerIncludeMaps","inlineSourceMap","reactCompiler","experiments","hosted","Error","exception","exit","getFilesFromSerialAssets","artifacts","includeSourceMaps","isServerHosted","expoDomComponentReferences","Set","artifact","Array","isArray","metadata","flat","filePath","platformDomComponentsBundle","htmlOutputName","exportDomComponentAsync","useMd5Filename","existingHashes","assets","a","hash","push","has","transformNativeBundleForMd5Filename","domComponentReference","nativeBundle","addDomBundleToMetadataAsync","transformDomEntryForMd5Filename","html","serializeHtmlWithAssets","resources","template","createTemplateHtmlFromExpoConfigAsync","scripts","cssLinks","modifyHtml","getVirtualFaviconAssetsAsync","set","contents","targetDomain","isWeb","exportApiRoutesStandaloneAsync","apiRoutesOnly","embeddedHashSet","exportAssetsAsync","JSON","stringify","createAssetMap","fileNames","Object","fromEntries","entries","asset","type","filename","createMetadataJson","exportServer","placeholderIndex","fs","existsSync","exportFromServerAsync","routerRoot","getRouterDirectoryModuleIdWithManifest","stopAsync","persistMetroFilesAsync"],"mappings":";;;;+BA2CsBA;;;eAAAA;;;;yBA3CI;;;;;;;gEAGP;;;;;;;gEACD;;;;;;;gEACH;;;;;;;gEACE;;;;;;oCAEyC;8BACxB;qCAM3B;8BAC0D;mCACK;yBACzB;uCACF;8BACL;4BAQ/B;+BACwB;6DACV;+CACyB;kCACb;uCACK;wBACiB;+BACf;oCACD;8BACE;6BACa;qBAClC;wBACS;yBACY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAElC,eAAeA,eACpBC,WAAmB,EACnB,EACEC,SAAS,EACTC,SAAS,EACTC,K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EAAC7G,OAAOD;AACtC"}
1
+ {"version":3,"sources":["../../../src/export/exportApp.ts"],"sourcesContent":["import { getConfig } from '@expo/config';\nimport type { Platform } from '@expo/config';\nimport { resolveRelativeEntryPoint } from '@expo/config/paths';\nimport { SerialAsset } from '@expo/metro-config/build/serializer/serializerAssets';\nimport assert from 'assert';\nimport chalk from 'chalk';\nimport fs from 'fs';\nimport path from 'path';\n\nimport { type PlatformMetadata, createMetadataJson } from './createMetadataJson';\nimport { exportAssetsAsync } from './exportAssets';\nimport {\n addDomBundleToMetadataAsync,\n exportDomComponentAsync,\n transformNativeBundleForMd5Filename,\n transformDomEntryForMd5Filename,\n} from './exportDomComponents';\nimport { assertEngineMismatchAsync, isEnableHermesManaged } from './exportHermes';\nimport { exportApiRoutesStandaloneAsync, exportFromServerAsync } from './exportStaticAsync';\nimport { getVirtualFaviconAssetsAsync } from './favicon';\nimport { getPublicExpoManifestAsync } from './getPublicExpoManifest';\nimport { copyPublicFolderAsync } from './publicFolder';\nimport { Options } from './resolveOptions';\nimport {\n ExportAssetMap,\n BundleOutput,\n getFilesFromSerialAssets,\n persistMetroFilesAsync,\n BundleAssetWithFileHashes,\n} from './saveAssets';\nimport { createAssetMap } from './writeContents';\nimport * as Log from '../log';\nimport { WebSupportProjectPrerequisite } from '../start/doctor/web/WebSupportProjectPrerequisite';\nimport { DevServerManager } from '../start/server/DevServerManager';\nimport { MetroBundlerDevServer } from '../start/server/metro/MetroBundlerDevServer';\nimport { getRouterDirectoryModuleIdWithManifest } from '../start/server/metro/router';\nimport { serializeHtmlWithAssets } from '../start/server/metro/serializeHtml';\nimport { getBaseUrlFromExpoConfig } from '../start/server/middleware/metroOptions';\nimport { createTemplateHtmlFromExpoConfigAsync } from '../start/server/webTemplate';\nimport { env } from '../utils/env';\nimport { CommandError } from '../utils/errors';\nimport { setNodeEnv, loadEnvFiles } from '../utils/nodeEnv';\n\nexport async function exportAppAsync(\n projectRoot: string,\n {\n platforms,\n outputDir,\n clear,\n dev,\n dumpAssetmap,\n sourceMaps,\n inlineSourceMaps,\n minify,\n bytecode,\n maxWorkers,\n skipSSG,\n hostedNative,\n }: Pick<\n Options,\n | 'dumpAssetmap'\n | 'sourceMaps'\n | 'inlineSourceMaps'\n | 'dev'\n | 'clear'\n | 'outputDir'\n | 'platforms'\n | 'minify'\n | 'bytecode'\n | 'maxWorkers'\n | 'skipSSG'\n | 'hostedNative'\n >\n): Promise<void> {\n // Force the environment during export and do not allow overriding it.\n const environment = dev ? 'development' : 'production';\n process.env.NODE_ENV = environment;\n setNodeEnv(environment);\n loadEnvFiles(projectRoot);\n\n const projectConfig = getConfig(projectRoot);\n const exp = await getPublicExpoManifestAsync(projectRoot, {\n // Web doesn't require validation.\n skipValidation: platforms.length === 1 && platforms[0] === 'web',\n });\n\n if (platforms.includes('web')) {\n await new WebSupportProjectPrerequisite(projectRoot).assertAsync();\n }\n\n const useServerRendering = ['static', 'server'].includes(exp.web?.output ?? '');\n\n if (skipSSG && exp.web?.output !== 'server') {\n throw new CommandError('--no-ssg can only be used with `web.output: server`');\n }\n\n const baseUrl = getBaseUrlFromExpoConfig(exp);\n\n if (!bytecode && (platforms.includes('ios') || platforms.includes('android'))) {\n Log.warn(\n `Bytecode makes the app startup faster, disabling bytecode is highly discouraged and should only be used for debugging purposes.`\n );\n }\n\n // Print out logs\n if (baseUrl) {\n Log.log();\n Log.log(chalk.gray`Using (experimental) base path: ${baseUrl}`);\n // Warn if not using an absolute path.\n if (!baseUrl.startsWith('/')) {\n Log.log(\n chalk.yellow` Base path does not start with a slash. Requests will not be absolute.`\n );\n }\n }\n\n const mode = dev ? 'development' : 'production';\n const publicPath = path.resolve(projectRoot, env.EXPO_PUBLIC_FOLDER);\n const outputPath = path.resolve(projectRoot, outputDir);\n\n // Write the JS bundles to disk, and get the bundle file names (this could change with async chunk loading support).\n\n const files: ExportAssetMap = new Map();\n\n const devServerManager = await DevServerManager.startMetroAsync(projectRoot, {\n minify,\n mode,\n port: 8081,\n isExporting: true,\n location: {},\n resetDevServer: clear,\n maxWorkers,\n });\n\n const devServer = devServerManager.getDefaultDevServer();\n assert(devServer instanceof MetroBundlerDevServer);\n\n const bundles: Partial<Record<Platform, BundleOutput>> = {};\n const domComponentAssetsMetadata: Partial<Record<Platform, PlatformMetadata['assets']>> = {};\n\n const spaPlatforms =\n // TODO: Support server and static rendering for server component exports.\n useServerRendering && !devServer.isReactServerComponentsEnabled\n ? platforms.filter((platform) => platform !== 'web')\n : platforms;\n\n try {\n if (devServer.isReactServerComponentsEnabled) {\n // In RSC mode, we only need these to be in the client dir.\n // TODO: Merge back with other copy after we add SSR.\n try {\n await copyPublicFolderAsync(publicPath, path.join(outputPath, 'client'));\n } catch (error) {\n Log.error('Failed to copy public directory to dist directory');\n throw error;\n }\n } else {\n // NOTE(kitten): The public folder is currently always copied, regardless of targetDomain\n // split. Hence, there's another separate `copyPublicFolderAsync` call below for `web`\n await copyPublicFolderAsync(publicPath, outputPath);\n }\n\n let templateHtml: string | undefined;\n // Can be empty during web-only SSG.\n if (spaPlatforms.length) {\n await Promise.all(\n spaPlatforms.map(async (platform) => {\n // Assert early so the user doesn't have to wait until bundling is complete to find out that\n // Hermes won't be available.\n const isHermes = isEnableHermesManaged(exp, platform);\n if (isHermes) {\n await assertEngineMismatchAsync(projectRoot, exp, platform);\n }\n\n let bundle: {\n artifacts: SerialAsset[];\n assets: readonly BundleAssetWithFileHashes[];\n files?: ExportAssetMap;\n };\n\n try {\n // Run metro bundler and create the JS bundles/source maps.\n bundle = await devServer.nativeExportBundleAsync(\n exp,\n {\n platform,\n splitChunks:\n !env.EXPO_NO_BUNDLE_SPLITTING &&\n ((devServer.isReactServerComponentsEnabled && !bytecode) || platform === 'web'),\n mainModuleName: resolveRelativeEntryPoint(projectRoot, {\n platform,\n pkg: projectConfig.pkg,\n }),\n mode: dev ? 'development' : 'production',\n engine: isHermes ? 'hermes' : undefined,\n serializerIncludeMaps: sourceMaps || inlineSourceMaps,\n inlineSourceMap: inlineSourceMaps,\n bytecode: bytecode && isHermes,\n reactCompiler: !!exp.experiments?.reactCompiler,\n hosted: hostedNative,\n },\n files\n );\n } catch (error) {\n Log.log('');\n if (error instanceof Error) {\n Log.exception(error);\n } else {\n Log.error('Failed to bundle the app');\n Log.log(error as any);\n }\n process.exit(1);\n }\n\n bundles[platform] = bundle;\n\n getFilesFromSerialAssets(bundle.artifacts, {\n includeSourceMaps: sourceMaps,\n files,\n isServerHosted: devServer.isReactServerComponentsEnabled || hostedNative,\n });\n\n const expoDomComponentReferences = [\n ...new Set(\n bundle.artifacts\n .map((artifact) =>\n Array.isArray(artifact.metadata.expoDomComponentReferences)\n ? artifact.metadata.expoDomComponentReferences\n : []\n )\n .flat()\n ),\n ];\n await Promise.all(\n // TODO: Make a version of this which uses `this.metro.getBundler().buildGraphForEntries([])` to bundle all the DOM components at once.\n expoDomComponentReferences.map(async (filePath) => {\n const { bundle: platformDomComponentsBundle, htmlOutputName } =\n await exportDomComponentAsync({\n filePath,\n projectRoot,\n dev,\n devServer,\n isHermes,\n includeSourceMaps: sourceMaps,\n exp,\n files,\n useMd5Filename: true,\n });\n\n // Merge the assets from the DOM component into the output assets, deduplicating by hash.\n const existingHashes = new Set(bundle.assets.map((a) => a.hash));\n (bundle.assets as (typeof bundle.assets)[0][]).push(\n ...platformDomComponentsBundle.assets.filter((a) => !existingHashes.has(a.hash))\n );\n\n transformNativeBundleForMd5Filename({\n domComponentReference: filePath,\n nativeBundle: bundle,\n files,\n htmlOutputName,\n });\n domComponentAssetsMetadata[platform] = [\n ...(domComponentAssetsMetadata[platform] || []),\n ...(await addDomBundleToMetadataAsync(platformDomComponentsBundle)),\n ...transformDomEntryForMd5Filename({\n files,\n htmlOutputName,\n }),\n ];\n })\n );\n\n if (platform === 'web') {\n // TODO: Unify with exportStaticAsync\n // TODO: Maybe move to the serializer.\n let html = await serializeHtmlWithAssets({\n isExporting: true,\n resources: bundle.artifacts,\n template: await createTemplateHtmlFromExpoConfigAsync(projectRoot, {\n scripts: [],\n cssLinks: [],\n exp: projectConfig.exp,\n }),\n baseUrl,\n });\n\n // Add the favicon assets to the HTML.\n const modifyHtml = await getVirtualFaviconAssetsAsync(projectRoot, {\n outputDir,\n baseUrl,\n files,\n exp: projectConfig.exp,\n });\n if (modifyHtml) {\n html = modifyHtml(html);\n }\n\n // HACK: This is used for adding SSR shims in React Server Components.\n templateHtml = html;\n\n // Generate SPA-styled HTML file.\n // If web exists, then write the template HTML file.\n files.set('index.html', {\n contents: html,\n targetDomain: devServer.isReactServerComponentsEnabled ? 'server' : 'client',\n });\n }\n })\n );\n\n if (devServer.isReactServerComponentsEnabled) {\n const isWeb = platforms.includes('web');\n\n await exportApiRoutesStandaloneAsync(devServer, {\n files,\n platform: 'web',\n apiRoutesOnly: !isWeb,\n templateHtml,\n });\n }\n\n // TODO: Use same asset system across platforms again.\n const { assets, embeddedHashSet } = await exportAssetsAsync(projectRoot, {\n files,\n exp,\n outputDir: outputPath,\n bundles,\n baseUrl,\n hostedNative,\n });\n\n if (dumpAssetmap) {\n Log.log('Creating asset map');\n files.set('assetmap.json', { contents: JSON.stringify(createAssetMap({ assets })) });\n }\n\n const targetDomain = devServer.isReactServerComponentsEnabled ? 'client/' : '';\n const fileNames = Object.fromEntries(\n Object.entries(bundles).map(([platform, bundle]) => [\n platform,\n bundle.artifacts\n .filter((asset) => asset.type === 'js')\n .map((asset) => targetDomain + asset.filename),\n ])\n );\n\n // Generate a `metadata.json` for EAS Update.\n const contents = createMetadataJson({\n bundles,\n fileNames,\n embeddedHashSet,\n domComponentAssetsMetadata,\n });\n files.set('metadata.json', { contents: JSON.stringify(contents) });\n }\n\n // Additional web-only steps...\n\n if (platforms.includes('web') && useServerRendering) {\n const exportServer = exp.web?.output === 'server';\n\n if (exportServer) {\n // TODO: Remove when this is abstracted into the files map\n await copyPublicFolderAsync(publicPath, path.resolve(outputPath, 'client'));\n }\n\n if (skipSSG) {\n Log.log('Skipping static site generation');\n await exportApiRoutesStandaloneAsync(devServer, {\n files,\n platform: 'web',\n apiRoutesOnly: true,\n });\n\n // Output a placeholder index.html if one doesn't exist in the public directory.\n // This ensures native + API routes have some content at the root URL.\n const placeholderIndex = path.resolve(outputPath, 'client/index.html');\n if (!fs.existsSync(placeholderIndex)) {\n files.set('index.html', {\n contents: `<html><body></body></html>`,\n targetDomain: 'client',\n });\n }\n } else if (\n // TODO: Support static export with RSC.\n !devServer.isReactServerComponentsEnabled\n ) {\n await exportFromServerAsync(projectRoot, devServer, {\n mode,\n files,\n clear: !!clear,\n outputDir: outputPath,\n minify,\n baseUrl,\n includeSourceMaps: sourceMaps,\n routerRoot: getRouterDirectoryModuleIdWithManifest(projectRoot, exp),\n reactCompiler: !!exp.experiments?.reactCompiler,\n exportServer,\n maxWorkers,\n isExporting: true,\n exp: projectConfig.exp,\n });\n }\n }\n } finally {\n await devServerManager.stopAsync();\n }\n\n // Write all files at the end for unified logging.\n await persistMetroFilesAsync(files, outputPath);\n}\n"],"names":["exportAppAsync","projectRoot","platforms","outputDir","clear","dev","dumpAssetmap","sourceMaps","inlineSourceMaps","minify","bytecode","maxWorkers","skipSSG","hostedNative","exp","environment","process","env","NODE_ENV","setNodeEnv","loadEnvFiles","projectConfig","getConfig","getPublicExpoManifestAsync","skipValidation","length","includes","WebSupportProjectPrerequisite","assertAsync","useServerRendering","web","output","CommandError","baseUrl","getBaseUrlFromExpoConfig","Log","warn","log","chalk","gray","startsWith","yellow","mode","publicPath","path","resolve","EXPO_PUBLIC_FOLDER","outputPath","files","Map","devServerManager","DevServerManager","startMetroAsync","port","isExporting","location","resetDevServer","devServer","getDefaultDevServer","assert","MetroBundlerDevServer","bundles","domComponentAssetsMetadata","spaPlatforms","isReactServerComponentsEnabled","filter","platform","copyPublicFolderAsync","join","error","templateHtml","Promise","all","map","isHermes","isEnableHermesManaged","assertEngineMismatchAsync","bundle","nativeExportBundleAsync","splitChunks","EXPO_NO_BUNDLE_SPLITTING","mainModuleName","resolveRelativeEntryPoint","pkg","engine","undefined","serializerIncludeMaps","inlineSourceMap","reactCompiler","experiments","hosted","Error","exception","exit","getFilesFromSerialAssets","artifacts","includeSourceMaps","isServerHosted","expoDomComponentReferences","Set","artifact","Array","isArray","metadata","flat","filePath","platformDomComponentsBundle","htmlOutputName","exportDomComponentAsync","useMd5Filename","existingHashes","assets","a","hash","push","has","transformNativeBundleForMd5Filename","domComponentReference","nativeBundle","addDomBundleToMetadataAsync","transformDomEntryForMd5Filename","html","serializeHtmlWithAssets","resources","template","createTemplateHtmlFromExpoConfigAsync","scripts","cssLinks","modifyHtml","getVirtualFaviconAssetsAsync","set","contents","targetDomain","isWeb","exportApiRoutesStandaloneAsync","apiRoutesOnly","embeddedHashSet","exportAssetsAsync","JSON","stringify","createAssetMap","fileNames","Object","fromEntries","entries","asset","type","filename","createMetadataJson","exportServer","placeholderIndex","fs","existsSync","exportFromServerAsync","routerRoot","getRouterDirectoryModuleIdWithManifest","stopAsync","persistMetroFilesAsync"],"mappings":";;;;+BA2CsBA;;;eAAAA;;;;yBA3CI;;;;;;;yBAEgB;;;;;;;gEAEvB;;;;;;;gEACD;;;;;;;gEACH;;;;;;;gEACE;;;;;;oCAEyC;8BACxB;qCAM3B;8BAC0D;mCACK;yBACzB;uCACF;8BACL;4BAQ/B;+BACwB;6DACV;+CACyB;kCACb;uCACK;wBACiB;+BACf;8BACC;6BACa;qBAClC;wBACS;yBACY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAElC,eAAeA,eACpBC,WAAmB,EACnB,EACEC,SAAS,EACTC,SAAS,EACTC,KAAK,EACLC,GAAG,EACHC,YAAY,EACZC,UAAU,EACVC,gBAAgB,EAChBC,MAAM,EACNC,QAAQ,EACRC,UAAU,EACVC,OAAO,EACPC,YAAY,EAeb;QAkBwDC,UAE1CA;IAlBf,sEAAsE;IACtE,MAAMC,cAAcV,MAAM,gBAAgB;IAC1CW,QAAQC,GAAG,CAACC,QAAQ,GAAGH;IACvBI,IAAAA,mBAAU,EAAC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AC1D,MAAMlF,IAAAA,mCAAqB,EAACxB,YAAYC,eAAI,CAACC,OAAO,CAACE,YAAY;YACnE;YAEA,IAAInC,SAAS;gBACXuB,KAAIE,GAAG,CAAC;gBACR,MAAMiG,IAAAA,iDAA8B,EAAC7E,WAAW;oBAC9CT;oBACAkB,UAAU;oBACVqE,eAAe;gBACjB;gBAEA,gFAAgF;gBAChF,sEAAsE;gBACtE,MAAMe,mBAAmB1G,eAAI,CAACC,OAAO,CAACE,YAAY;gBAClD,IAAI,CAACwG,aAAE,CAACC,UAAU,CAACF,mBAAmB;oBACpCtG,MAAMkF,GAAG,CAAC,cAAc;wBACtBC,UAAU,CAAC,0BAA0B,CAAC;wBACtCC,cAAc;oBAChB;gBACF;YACF,OAAO,IACL,wCAAwC;YACxC,CAAC3E,UAAUO,8BAA8B,EACzC;oBAUmBlD;gBATnB,MAAM2I,IAAAA,wCAAqB,EAACxJ,aAAawD,WAAW;oBAClDf;oBACAM;oBACA5C,OAAO,CAAC,CAACA;oBACTD,WAAW4C;oBACXtC;oBACAwB;oBACA+D,mBAAmBzF;oBACnBmJ,YAAYC,IAAAA,8CAAsC,EAAC1J,aAAaa;oBAChE0E,eAAe,CAAC,GAAC1E,mBAAAA,IAAI2E,WAAW,qBAAf3E,iBAAiB0E,aAAa;oBAC/C6D;oBACA1I;oBACA2C,aAAa;oBACbxC,KAAKO,cAAcP,GAAG;gBACxB;YACF;QACF;IACF,SAAU;QACR,MAAMoC,iBAAiB0G,SAAS;IAClC;IAEA,kDAAkD;IAClD,MAAMC,IAAAA,kCAAsB,EAAC7G,OAAOD;AACtC"}
@@ -22,6 +22,13 @@ _export(exports, {
22
22
  return transformNativeBundleForMd5Filename;
23
23
  }
24
24
  });
25
+ function _paths() {
26
+ const data = require("@expo/config/paths");
27
+ _paths = function() {
28
+ return data;
29
+ };
30
+ return data;
31
+ }
25
32
  function _assert() {
26
33
  const data = /*#__PURE__*/ _interop_require_default(require("assert"));
27
34
  _assert = function() {
@@ -70,21 +77,21 @@ function _interop_require_default(obj) {
70
77
  const debug = require('debug')('expo:export:exportDomComponents');
71
78
  async function exportDomComponentAsync({ filePath, projectRoot, dev, devServer, isHermes, includeSourceMaps, exp, files, useMd5Filename = false }) {
72
79
  var _exp_experiments;
73
- const virtualEntry = (0, _filePath.toPosixPath)((0, _resolvefrom().default)(projectRoot, 'expo/dom/entry.js'));
80
+ const virtualEntry = (0, _resolvefrom().default)(projectRoot, 'expo/dom/entry.js');
74
81
  debug('Bundle DOM Component:', filePath);
75
82
  // MUST MATCH THE BABEL PLUGIN!
76
83
  const hash = _crypto().default.createHash('md5').update(filePath).digest('hex');
77
84
  const outputName = `${_DomComponentsMiddleware.DOM_COMPONENTS_BUNDLE_DIR}/${hash}.html`;
78
- const generatedEntryPath = (0, _filePath.toPosixPath)(filePath.startsWith('file://') ? _url().default.fileURLToPath(filePath) : filePath);
85
+ const generatedEntryPath = _path().default.resolve(filePath.startsWith('file://') ? _url().default.fileURLToPath(filePath) : filePath);
79
86
  const baseUrl = `/${_DomComponentsMiddleware.DOM_COMPONENTS_BUNDLE_DIR}`;
80
87
  // The relative import path will be used like URI so it must be POSIX.
81
- const relativeImport = './' + _path().default.posix.relative(_path().default.dirname(virtualEntry), generatedEntryPath);
88
+ const relativeImport = './' + (0, _filePath.toPosixPath)(_path().default.relative(_path().default.dirname(virtualEntry), generatedEntryPath));
82
89
  // Run metro bundler and create the JS bundles/source maps.
83
90
  const bundle = await devServer.legacySinglePageExportBundleAsync({
84
91
  platform: 'web',
85
92
  domRoot: encodeURI(relativeImport),
86
93
  splitChunks: !_env.env.EXPO_NO_BUNDLE_SPLITTING,
87
- mainModuleName: (0, _filePath.resolveRealEntryFilePath)(projectRoot, virtualEntry),
94
+ mainModuleName: (0, _paths().convertEntryPointToRelative)(projectRoot, virtualEntry),
88
95
  mode: dev ? 'development' : 'production',
89
96
  engine: isHermes ? 'hermes' : undefined,
90
97
  serializerIncludeMaps: includeSourceMaps,