@expo/cli 0.18.16 → 0.18.18

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 (56) hide show
  1. package/build/bin/cli +1 -1
  2. package/build/src/export/createMetadataJson.js.map +1 -1
  3. package/build/src/export/embed/exportEmbedAsync.js +110 -41
  4. package/build/src/export/embed/exportEmbedAsync.js.map +1 -1
  5. package/build/src/export/embed/resolveOptions.js +0 -1
  6. package/build/src/export/embed/resolveOptions.js.map +1 -1
  7. package/build/src/export/exportApp.js +130 -92
  8. package/build/src/export/exportApp.js.map +1 -1
  9. package/build/src/export/exportAssets.js.map +1 -1
  10. package/build/src/export/exportHermes.js +15 -0
  11. package/build/src/export/exportHermes.js.map +1 -1
  12. package/build/src/export/exportStaticAsync.js +3 -48
  13. package/build/src/export/exportStaticAsync.js.map +1 -1
  14. package/build/src/export/saveAssets.js.map +1 -1
  15. package/build/src/run/startBundler.js +1 -8
  16. package/build/src/run/startBundler.js.map +1 -1
  17. package/build/src/start/platforms/DeviceManager.js.map +1 -1
  18. package/build/src/start/platforms/PlatformManager.js +7 -2
  19. package/build/src/start/platforms/PlatformManager.js.map +1 -1
  20. package/build/src/start/platforms/android/AndroidDeviceManager.js +3 -0
  21. package/build/src/start/platforms/android/AndroidDeviceManager.js.map +1 -1
  22. package/build/src/start/platforms/ios/AppleDeviceManager.js +6 -2
  23. package/build/src/start/platforms/ios/AppleDeviceManager.js.map +1 -1
  24. package/build/src/start/platforms/ios/simctl.js +80 -0
  25. package/build/src/start/platforms/ios/simctl.js.map +1 -1
  26. package/build/src/start/server/BundlerDevServer.js +9 -2
  27. package/build/src/start/server/BundlerDevServer.js.map +1 -1
  28. package/build/src/start/server/DevServerManager.js +13 -1
  29. package/build/src/start/server/DevServerManager.js.map +1 -1
  30. package/build/src/start/server/getStaticRenderFunctions.js +9 -123
  31. package/build/src/start/server/getStaticRenderFunctions.js.map +1 -1
  32. package/build/src/start/server/metro/MetroBundlerDevServer.js +391 -102
  33. package/build/src/start/server/metro/MetroBundlerDevServer.js.map +1 -1
  34. package/build/src/start/server/metro/createServerRouteMiddleware.js +0 -9
  35. package/build/src/start/server/metro/createServerRouteMiddleware.js.map +1 -1
  36. package/build/src/start/server/metro/instantiateMetro.js +19 -12
  37. package/build/src/start/server/metro/instantiateMetro.js.map +1 -1
  38. package/build/src/start/server/metro/metroErrorInterface.js +49 -2
  39. package/build/src/start/server/metro/metroErrorInterface.js.map +1 -1
  40. package/build/src/start/server/metro/metroPrivateServer.js +26 -0
  41. package/build/src/start/server/metro/metroPrivateServer.js.map +1 -0
  42. package/build/src/start/server/metro/runServer-fork.js +28 -20
  43. package/build/src/start/server/metro/runServer-fork.js.map +1 -1
  44. package/build/src/start/server/metro/withMetroMultiPlatform.js +5 -13
  45. package/build/src/start/server/metro/withMetroMultiPlatform.js.map +1 -1
  46. package/build/src/start/server/middleware/ManifestMiddleware.js +6 -3
  47. package/build/src/start/server/middleware/ManifestMiddleware.js.map +1 -1
  48. package/build/src/start/server/middleware/metroOptions.js +11 -3
  49. package/build/src/start/server/middleware/metroOptions.js.map +1 -1
  50. package/build/src/start/server/middleware/resolveAssets.js.map +1 -1
  51. package/build/src/utils/port.js +1 -1
  52. package/build/src/utils/port.js.map +1 -1
  53. package/build/src/utils/telemetry/getContext.js +1 -1
  54. package/package.json +5 -4
  55. package/build/src/export/fork-bundleAsync.js +0 -284
  56. package/build/src/export/fork-bundleAsync.js.map +0 -1
@@ -14,10 +14,9 @@ function _export(target, all) {
14
14
  });
15
15
  }
16
16
  _export(exports, {
17
+ cachedSourceMaps: ()=>cachedSourceMaps,
17
18
  createMetroEndpointAsync: ()=>createMetroEndpointAsync,
18
- requireFileContentsWithMetro: ()=>requireFileContentsWithMetro,
19
- getStaticRenderFunctionsForEntry: ()=>getStaticRenderFunctionsForEntry,
20
- evalMetro: ()=>evalMetro,
19
+ evalMetroAndWrapFunctions: ()=>evalMetroAndWrapFunctions,
21
20
  evalMetroNoHandling: ()=>evalMetroNoHandling
22
21
  });
23
22
  function _fs() {
@@ -27,13 +26,6 @@ function _fs() {
27
26
  };
28
27
  return data;
29
28
  }
30
- function _nodeFetch() {
31
- const data = /*#__PURE__*/ _interopRequireDefault(require("node-fetch"));
32
- _nodeFetch = function() {
33
- return data;
34
- };
35
- return data;
36
- }
37
29
  function _path() {
38
30
  const data = /*#__PURE__*/ _interopRequireDefault(require("path"));
39
31
  _path = function() {
@@ -48,34 +40,18 @@ function _requireFromString() {
48
40
  };
49
41
  return data;
50
42
  }
51
- function _resolveFrom() {
52
- const data = /*#__PURE__*/ _interopRequireDefault(require("resolve-from"));
53
- _resolveFrom = function() {
54
- return data;
55
- };
56
- return data;
57
- }
58
43
  const _metroErrorInterface = require("./metro/metroErrorInterface");
59
44
  const _manifestMiddleware = require("./middleware/ManifestMiddleware");
60
45
  const _metroOptions = require("./middleware/metroOptions");
61
46
  const _serverLogLikeMetro = require("./serverLogLikeMetro");
62
- const _ansi = require("../../utils/ansi");
63
47
  const _delay = require("../../utils/delay");
64
48
  const _errors = require("../../utils/errors");
65
- const _fn = require("../../utils/fn");
66
49
  const _profile = require("../../utils/profile");
67
50
  function _interopRequireDefault(obj) {
68
51
  return obj && obj.__esModule ? obj : {
69
52
  default: obj
70
53
  };
71
54
  }
72
- class MetroNodeError extends Error {
73
- constructor(message, rawObject){
74
- super(message);
75
- this.rawObject = rawObject;
76
- }
77
- }
78
- const debug = require("debug")("expo:start:server:node-renderer");
79
55
  const cachedSourceMaps = new Map();
80
56
  // Support unhandled rejections
81
57
  // Detect if running in Bun
@@ -90,44 +66,6 @@ if (!process.isBun) {
90
66
  }
91
67
  });
92
68
  }
93
- function wrapBundle(str) {
94
- // Skip the metro runtime so debugging is a bit easier.
95
- // Replace the __r() call with an export statement.
96
- // Use gm to apply to the last require line. This is needed when the bundle has side-effects.
97
- return str.replace(/^(__r\(.*\);)$/gm, "module.exports = $1");
98
- }
99
- // TODO(EvanBacon): Group all the code together and version.
100
- const getRenderModuleId = (projectRoot, entry = "expo-router/node/render.js")=>{
101
- const moduleId = _resolveFrom().default.silent(projectRoot, entry);
102
- if (!moduleId) {
103
- throw new Error(`A version of expo-router with Node.js support is not installed in the project.`);
104
- }
105
- return moduleId;
106
- };
107
- const moveStaticRenderFunction = (0, _fn.memoize)(async (projectRoot, requiredModuleId)=>{
108
- // Copy the file into the project to ensure it works in monorepos.
109
- // This means the file cannot have any relative imports.
110
- const tempDir = _path().default.join(projectRoot, ".expo/static");
111
- await _fs().default.promises.mkdir(tempDir, {
112
- recursive: true
113
- });
114
- const moduleId = _path().default.join(tempDir, "render.js");
115
- await _fs().default.promises.writeFile(moduleId, await _fs().default.promises.readFile(requiredModuleId, "utf8"));
116
- // Sleep to give watchman time to register the file.
117
- await (0, _delay.delayAsync)(50);
118
- return moduleId;
119
- });
120
- /** @returns the js file contents required to generate the static generation function. */ async function getStaticRenderFunctionsContentAsync(projectRoot, devServerUrl, props, entry) {
121
- const root = (0, _manifestMiddleware.getMetroServerRoot)(projectRoot);
122
- const requiredModuleId = getRenderModuleId(root, entry);
123
- let moduleId = requiredModuleId;
124
- // Cannot be accessed using Metro's server API, we need to move the file
125
- // into the project root and try again.
126
- if (_path().default.relative(root, moduleId).startsWith("..")) {
127
- moduleId = await moveStaticRenderFunction(projectRoot, requiredModuleId);
128
- }
129
- return requireFileContentsWithMetro(root, devServerUrl, moduleId, props);
130
- }
131
69
  async function ensureFileInRootDirectory(projectRoot, otherFile) {
132
70
  // Cannot be accessed using Metro's server API, we need to move the file
133
71
  // into the project root and try again.
@@ -168,48 +106,14 @@ async function createMetroEndpointAsync(projectRoot, devServerUrl, absoluteFileP
168
106
  }
169
107
  return url;
170
108
  }
171
- async function requireFileContentsWithMetro(projectRoot, devServerUrl, absoluteFilePath, props) {
172
- const url = await createMetroEndpointAsync(projectRoot, devServerUrl, absoluteFilePath, props);
173
- return await metroFetchAsync(projectRoot, url);
174
- }
175
- async function metroFetchAsync(projectRoot, url) {
176
- debug("Fetching from Metro:", url);
177
- // TODO: Skip the dev server and use the Metro instance directly for better results, faster.
178
- const res = await (0, _nodeFetch().default)(url);
179
- // TODO: Improve error handling
180
- if (res.status === 500) {
181
- const text = await res.text();
182
- if (text.startsWith('{"originModulePath"') || text.startsWith('{"type":"TransformError"') || text.startsWith('{"type":"InternalError"')) {
183
- const errorObject = JSON.parse(text);
184
- var ref;
185
- throw new MetroNodeError((ref = (0, _ansi.stripAnsi)(errorObject.message)) != null ? ref : errorObject.message, errorObject);
186
- }
187
- throw new Error(`[${res.status}]: ${res.statusText}\n${text}`);
188
- }
189
- if (!res.ok) {
190
- throw new Error(`Error fetching bundle for static rendering: ${res.status} ${res.statusText}`);
191
- }
192
- const content = await res.text();
193
- const map = await (0, _nodeFetch().default)(url.replace(".bundle?", ".map?")).then((r)=>r.json());
194
- cachedSourceMaps.set(url, {
195
- url: projectRoot,
196
- map
197
- });
198
- return {
199
- src: wrapBundle(content),
200
- filename: url,
201
- map
202
- };
203
- }
204
- async function getStaticRenderFunctionsForEntry(projectRoot, devServerUrl, options, entry) {
205
- const { src: scriptContents , filename } = await getStaticRenderFunctionsContentAsync(projectRoot, devServerUrl, options, entry);
206
- return {
207
- filename,
208
- fn: await evalMetroAndWrapFunctions(projectRoot, scriptContents, filename)
209
- };
210
- }
211
109
  function evalMetroAndWrapFunctions(projectRoot, script, filename) {
212
- const contents = evalMetro(projectRoot, script, filename);
110
+ // TODO: Add back stack trace logic that hides traces from metro-runtime and other internal modules.
111
+ const contents = evalMetroNoHandling(projectRoot, script, filename);
112
+ if (!contents) {
113
+ // This can happen if ErrorUtils isn't working correctly on web and failing to throw an error when a module throws.
114
+ // This is unexpected behavior and should not be pretty formatted, therefore we're avoiding CommandError.
115
+ throw new Error("[Expo SSR] Module returned undefined, this could be due to a misconfiguration in Metro error handling");
116
+ }
213
117
  // wrap each function with a try/catch that uses Metro's error formatter
214
118
  return Object.keys(contents).reduce((acc, key)=>{
215
119
  const fn = contents[key];
@@ -232,24 +136,6 @@ function evalMetroAndWrapFunctions(projectRoot, script, filename) {
232
136
  return acc;
233
137
  }, {});
234
138
  }
235
- function evalMetro(projectRoot, src, filename) {
236
- try {
237
- return evalMetroNoHandling(projectRoot, src, filename);
238
- } catch (error) {
239
- // Format any errors that were thrown in the global scope of the evaluation.
240
- if (error instanceof Error) {
241
- (0, _metroErrorInterface.logMetroErrorAsync)({
242
- projectRoot,
243
- error
244
- }).catch((internalError)=>{
245
- debug("Failed to log metro error:", internalError);
246
- throw error;
247
- });
248
- } else {
249
- throw error;
250
- }
251
- }
252
- }
253
139
  function evalMetroNoHandling(projectRoot, src, filename) {
254
140
  (0, _serverLogLikeMetro.augmentLogs)(projectRoot);
255
141
  return (0, _profile.profile)(_requireFromString().default, "eval-metro-bundle")(src, filename);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/start/server/getStaticRenderFunctions.ts"],"sourcesContent":["/**\n * Copyright © 2022 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 fs from 'fs';\nimport fetch from 'node-fetch';\nimport path from 'path';\nimport requireString from 'require-from-string';\nimport resolveFrom from 'resolve-from';\n\nimport { logMetroError, logMetroErrorAsync } from './metro/metroErrorInterface';\nimport { getMetroServerRoot } from './middleware/ManifestMiddleware';\nimport { createBundleUrlPath, ExpoMetroOptions } from './middleware/metroOptions';\nimport { augmentLogs } from './serverLogLikeMetro';\nimport { stripAnsi } from '../../utils/ansi';\nimport { delayAsync } from '../../utils/delay';\nimport { SilentError } from '../../utils/errors';\nimport { memoize } from '../../utils/fn';\nimport { profile } from '../../utils/profile';\n\n/** The list of input keys will become optional, everything else will remain the same. */\nexport type PickPartial<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;\n\nclass MetroNodeError extends Error {\n constructor(\n message: string,\n public rawObject: any\n ) {\n super(message);\n }\n}\n\nconst debug = require('debug')('expo:start:server:node-renderer') as typeof console.log;\n\nconst cachedSourceMaps: Map<string, { url: string; map: string }> = new Map();\n\n// Support unhandled rejections\n// Detect if running in Bun\n\n// @ts-expect-error: This is a global variable that is set by Bun.\nif (!process.isBun) {\n require('source-map-support').install({\n retrieveSourceMap(source: string) {\n if (cachedSourceMaps.has(source)) {\n return cachedSourceMaps.get(source);\n }\n return null;\n },\n });\n}\n\nfunction wrapBundle(str: string) {\n // Skip the metro runtime so debugging is a bit easier.\n // Replace the __r() call with an export statement.\n // Use gm to apply to the last require line. This is needed when the bundle has side-effects.\n return str.replace(/^(__r\\(.*\\);)$/gm, 'module.exports = $1');\n}\n\n// TODO(EvanBacon): Group all the code together and version.\nconst getRenderModuleId = (\n projectRoot: string,\n entry: string = 'expo-router/node/render.js'\n): string => {\n const moduleId = resolveFrom.silent(projectRoot, entry);\n if (!moduleId) {\n throw new Error(\n `A version of expo-router with Node.js support is not installed in the project.`\n );\n }\n\n return moduleId;\n};\n\nconst moveStaticRenderFunction = memoize(async (projectRoot: string, requiredModuleId: string) => {\n // Copy the file into the project to ensure it works in monorepos.\n // This means the file cannot have any relative imports.\n const tempDir = path.join(projectRoot, '.expo/static');\n await fs.promises.mkdir(tempDir, { recursive: true });\n const moduleId = path.join(tempDir, 'render.js');\n await fs.promises.writeFile(moduleId, await fs.promises.readFile(requiredModuleId, 'utf8'));\n // Sleep to give watchman time to register the file.\n await delayAsync(50);\n return moduleId;\n});\n\n/** @returns the js file contents required to generate the static generation function. */\nasync function getStaticRenderFunctionsContentAsync(\n projectRoot: string,\n devServerUrl: string,\n props: PickPartial<ExpoMetroOptions, 'mainModuleName' | 'bytecode'>,\n entry?: string\n): Promise<{ src: string; filename: string }> {\n const root = getMetroServerRoot(projectRoot);\n const requiredModuleId = getRenderModuleId(root, entry);\n let moduleId = requiredModuleId;\n\n // Cannot be accessed using Metro's server API, we need to move the file\n // into the project root and try again.\n if (path.relative(root, moduleId).startsWith('..')) {\n moduleId = await moveStaticRenderFunction(projectRoot, requiredModuleId);\n }\n\n return requireFileContentsWithMetro(root, devServerUrl, moduleId, props);\n}\n\nasync function ensureFileInRootDirectory(projectRoot: string, otherFile: string) {\n // Cannot be accessed using Metro's server API, we need to move the file\n // into the project root and try again.\n if (!path.relative(projectRoot, otherFile).startsWith('..' + path.sep)) {\n return otherFile;\n }\n\n // Copy the file into the project to ensure it works in monorepos.\n // This means the file cannot have any relative imports.\n const tempDir = path.join(projectRoot, '.expo/static-tmp');\n await fs.promises.mkdir(tempDir, { recursive: true });\n const moduleId = path.join(tempDir, path.basename(otherFile));\n await fs.promises.writeFile(moduleId, await fs.promises.readFile(otherFile, 'utf8'));\n // Sleep to give watchman time to register the file.\n await delayAsync(50);\n return moduleId;\n}\n\nexport async function createMetroEndpointAsync(\n projectRoot: string,\n devServerUrl: string,\n absoluteFilePath: string,\n props: PickPartial<ExpoMetroOptions, 'mainModuleName' | 'bytecode'>\n): Promise<string> {\n const root = getMetroServerRoot(projectRoot);\n const safeOtherFile = await ensureFileInRootDirectory(projectRoot, absoluteFilePath);\n const serverPath = path.relative(root, safeOtherFile).replace(/\\.[jt]sx?$/, '');\n\n const urlFragment = createBundleUrlPath({\n mainModuleName: serverPath,\n lazy: false,\n asyncRoutes: false,\n inlineSourceMap: false,\n engine: 'hermes',\n minify: false,\n bytecode: false,\n ...props,\n });\n\n let url: string;\n if (devServerUrl) {\n url = new URL(urlFragment.replace(/^\\//, ''), devServerUrl).toString();\n } else {\n url = '/' + urlFragment.replace(/^\\/+/, '');\n }\n return url;\n}\n\nexport async function requireFileContentsWithMetro(\n projectRoot: string,\n devServerUrl: string,\n absoluteFilePath: string,\n props: PickPartial<ExpoMetroOptions, 'mainModuleName' | 'bytecode'>\n): Promise<{ src: string; filename: string }> {\n const url = await createMetroEndpointAsync(projectRoot, devServerUrl, absoluteFilePath, props);\n return await metroFetchAsync(projectRoot, url);\n}\n\nasync function metroFetchAsync(\n projectRoot: string,\n url: string\n): Promise<{ src: string; filename: string; map?: any }> {\n debug('Fetching from Metro:', url);\n // TODO: Skip the dev server and use the Metro instance directly for better results, faster.\n const res = await fetch(url);\n\n // TODO: Improve error handling\n if (res.status === 500) {\n const text = await res.text();\n if (\n text.startsWith('{\"originModulePath\"') ||\n text.startsWith('{\"type\":\"TransformError\"') ||\n text.startsWith('{\"type\":\"InternalError\"')\n ) {\n const errorObject = JSON.parse(text);\n\n throw new MetroNodeError(stripAnsi(errorObject.message) ?? errorObject.message, errorObject);\n }\n throw new Error(`[${res.status}]: ${res.statusText}\\n${text}`);\n }\n\n if (!res.ok) {\n throw new Error(`Error fetching bundle for static rendering: ${res.status} ${res.statusText}`);\n }\n\n const content = await res.text();\n\n const map = await fetch(url.replace('.bundle?', '.map?')).then((r) => r.json());\n cachedSourceMaps.set(url, { url: projectRoot, map });\n\n return {\n src: wrapBundle(content),\n filename: url,\n map,\n };\n}\n\nexport async function getStaticRenderFunctionsForEntry<T = any>(\n projectRoot: string,\n devServerUrl: string,\n options: PickPartial<ExpoMetroOptions, 'mainModuleName' | 'bytecode'>,\n entry: string\n) {\n const { src: scriptContents, filename } = await getStaticRenderFunctionsContentAsync(\n projectRoot,\n devServerUrl,\n options,\n entry\n );\n\n return {\n filename,\n fn: await evalMetroAndWrapFunctions<T>(projectRoot, scriptContents, filename),\n };\n}\n\nfunction evalMetroAndWrapFunctions<T = Record<string, any>>(\n projectRoot: string,\n script: string,\n filename: string\n): Promise<T> {\n const contents = evalMetro(projectRoot, script, filename);\n // wrap each function with a try/catch that uses Metro's error formatter\n return Object.keys(contents).reduce((acc, key) => {\n const fn = contents[key];\n if (typeof fn !== 'function') {\n return { ...acc, [key]: fn };\n }\n\n acc[key] = async function (...props: any[]) {\n try {\n return await fn.apply(this, props);\n } catch (error: any) {\n await logMetroError(projectRoot, { error });\n throw new SilentError(error);\n }\n };\n return acc;\n }, {} as any);\n}\n\nexport function evalMetro(projectRoot: string, src: string, filename: string) {\n try {\n return evalMetroNoHandling(projectRoot, src, filename);\n } catch (error: any) {\n // Format any errors that were thrown in the global scope of the evaluation.\n if (error instanceof Error) {\n logMetroErrorAsync({ projectRoot, error }).catch((internalError) => {\n debug('Failed to log metro error:', internalError);\n throw error;\n });\n } else {\n throw error;\n }\n }\n}\n\nexport function evalMetroNoHandling(projectRoot: string, src: string, filename: string) {\n augmentLogs(projectRoot);\n\n return profile(requireString, 'eval-metro-bundle')(src, filename);\n}\n"],"names":["createMetroEndpointAsync","requireFileContentsWithMetro","getStaticRenderFunctionsForEntry","evalMetro","evalMetroNoHandling","MetroNodeError","Error","constructor","message","rawObject","debug","require","cachedSourceMaps","Map","process","isBun","install","retrieveSourceMap","source","has","get","wrapBundle","str","replace","getRenderModuleId","projectRoot","entry","moduleId","resolveFrom","silent","moveStaticRenderFunction","memoize","requiredModuleId","tempDir","path","join","fs","promises","mkdir","recursive","writeFile","readFile","delayAsync","getStaticRenderFunctionsContentAsync","devServerUrl","props","root","getMetroServerRoot","relative","startsWith","ensureFileInRootDirectory","otherFile","sep","basename","absoluteFilePath","safeOtherFile","serverPath","urlFragment","createBundleUrlPath","mainModuleName","lazy","asyncRoutes","inlineSourceMap","engine","minify","bytecode","url","URL","toString","metroFetchAsync","res","fetch","status","text","errorObject","JSON","parse","stripAnsi","statusText","ok","content","map","then","r","json","set","src","filename","options","scriptContents","fn","evalMetroAndWrapFunctions","script","contents","Object","keys","reduce","acc","key","apply","error","logMetroError","SilentError","logMetroErrorAsync","catch","internalError","augmentLogs","profile","requireString"],"mappings":"AAAA;;;;;CAKC,GACD;;;;;;;;;;;IAuHsBA,wBAAwB,MAAxBA,wBAAwB;IA8BxBC,4BAA4B,MAA5BA,4BAA4B;IAiD5BC,gCAAgC,MAAhCA,gCAAgC;IA4CtCC,SAAS,MAATA,SAAS;IAgBTC,mBAAmB,MAAnBA,mBAAmB;;;8DAlQpB,IAAI;;;;;;;8DACD,YAAY;;;;;;;8DACb,MAAM;;;;;;;8DACG,qBAAqB;;;;;;;8DACvB,cAAc;;;;;;qCAEY,6BAA6B;oCAC5C,iCAAiC;8BACd,2BAA2B;oCACrD,sBAAsB;sBACx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AC,CAAC;YACrC,EAAE,OAAOuD,KAAK,EAAO;gBACnB,MAAMC,IAAAA,oBAAa,cAAA,EAAC5E,WAAW,EAAE;oBAAE2E,KAAK;iBAAE,CAAC,CAAC;gBAC5C,MAAM,IAAIE,OAAW,YAAA,CAACF,KAAK,CAAC,CAAC;YAC/B,CAAC;QACH,CAAC,CAAC;QACF,OAAOH,GAAG,CAAC;IACb,CAAC,EAAE,EAAE,CAAQ,CAAC;AAChB,CAAC;AAEM,SAAS9F,SAAS,CAACsB,WAAmB,EAAE6D,GAAW,EAAEC,QAAgB,EAAE;IAC5E,IAAI;QACF,OAAOnF,mBAAmB,CAACqB,WAAW,EAAE6D,GAAG,EAAEC,QAAQ,CAAC,CAAC;IACzD,EAAE,OAAOa,KAAK,EAAO;QACnB,4EAA4E;QAC5E,IAAIA,KAAK,YAAY9F,KAAK,EAAE;YAC1BiG,IAAAA,oBAAkB,mBAAA,EAAC;gBAAE9E,WAAW;gBAAE2E,KAAK;aAAE,CAAC,CAACI,KAAK,CAAC,CAACC,aAAa,GAAK;gBAClE/F,KAAK,CAAC,4BAA4B,EAAE+F,aAAa,CAAC,CAAC;gBACnD,MAAML,KAAK,CAAC;YACd,CAAC,CAAC,CAAC;QACL,OAAO;YACL,MAAMA,KAAK,CAAC;QACd,CAAC;IACH,CAAC;AACH,CAAC;AAEM,SAAShG,mBAAmB,CAACqB,WAAmB,EAAE6D,GAAW,EAAEC,QAAgB,EAAE;IACtFmB,IAAAA,mBAAW,YAAA,EAACjF,WAAW,CAAC,CAAC;IAEzB,OAAOkF,IAAAA,QAAO,QAAA,EAACC,kBAAa,EAAA,QAAA,EAAE,mBAAmB,CAAC,CAACtB,GAAG,EAAEC,QAAQ,CAAC,CAAC;AACpE,CAAC"}
1
+ {"version":3,"sources":["../../../../src/start/server/getStaticRenderFunctions.ts"],"sourcesContent":["/**\n * Copyright © 2022 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 fs from 'fs';\nimport path from 'path';\nimport requireString from 'require-from-string';\n\nimport { logMetroError } from './metro/metroErrorInterface';\nimport { getMetroServerRoot } from './middleware/ManifestMiddleware';\nimport { createBundleUrlPath, ExpoMetroOptions } from './middleware/metroOptions';\nimport { augmentLogs } from './serverLogLikeMetro';\nimport { delayAsync } from '../../utils/delay';\nimport { SilentError } from '../../utils/errors';\nimport { profile } from '../../utils/profile';\n\n/** The list of input keys will become optional, everything else will remain the same. */\nexport type PickPartial<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;\n\nexport const cachedSourceMaps: Map<string, { url: string; map: string }> = new Map();\n\n// Support unhandled rejections\n// Detect if running in Bun\n\n// @ts-expect-error: This is a global variable that is set by Bun.\nif (!process.isBun) {\n require('source-map-support').install({\n retrieveSourceMap(source: string) {\n if (cachedSourceMaps.has(source)) {\n return cachedSourceMaps.get(source);\n }\n return null;\n },\n });\n}\n\nasync function ensureFileInRootDirectory(projectRoot: string, otherFile: string) {\n // Cannot be accessed using Metro's server API, we need to move the file\n // into the project root and try again.\n if (!path.relative(projectRoot, otherFile).startsWith('..' + path.sep)) {\n return otherFile;\n }\n\n // Copy the file into the project to ensure it works in monorepos.\n // This means the file cannot have any relative imports.\n const tempDir = path.join(projectRoot, '.expo/static-tmp');\n await fs.promises.mkdir(tempDir, { recursive: true });\n const moduleId = path.join(tempDir, path.basename(otherFile));\n await fs.promises.writeFile(moduleId, await fs.promises.readFile(otherFile, 'utf8'));\n // Sleep to give watchman time to register the file.\n await delayAsync(50);\n return moduleId;\n}\n\nexport async function createMetroEndpointAsync(\n projectRoot: string,\n devServerUrl: string,\n absoluteFilePath: string,\n props: PickPartial<ExpoMetroOptions, 'mainModuleName' | 'bytecode'>\n): Promise<string> {\n const root = getMetroServerRoot(projectRoot);\n const safeOtherFile = await ensureFileInRootDirectory(projectRoot, absoluteFilePath);\n const serverPath = path.relative(root, safeOtherFile).replace(/\\.[jt]sx?$/, '');\n\n const urlFragment = createBundleUrlPath({\n mainModuleName: serverPath,\n lazy: false,\n asyncRoutes: false,\n inlineSourceMap: false,\n engine: 'hermes',\n minify: false,\n bytecode: false,\n ...props,\n });\n\n let url: string;\n if (devServerUrl) {\n url = new URL(urlFragment.replace(/^\\//, ''), devServerUrl).toString();\n } else {\n url = '/' + urlFragment.replace(/^\\/+/, '');\n }\n return url;\n}\n\nexport function evalMetroAndWrapFunctions<T = Record<string, any>>(\n projectRoot: string,\n script: string,\n filename: string\n): T {\n // TODO: Add back stack trace logic that hides traces from metro-runtime and other internal modules.\n const contents = evalMetroNoHandling(projectRoot, script, filename);\n\n if (!contents) {\n // This can happen if ErrorUtils isn't working correctly on web and failing to throw an error when a module throws.\n // This is unexpected behavior and should not be pretty formatted, therefore we're avoiding CommandError.\n throw new Error(\n '[Expo SSR] Module returned undefined, this could be due to a misconfiguration in Metro error handling'\n );\n }\n // wrap each function with a try/catch that uses Metro's error formatter\n return Object.keys(contents).reduce((acc, key) => {\n const fn = contents[key];\n if (typeof fn !== 'function') {\n return { ...acc, [key]: fn };\n }\n\n acc[key] = async function (...props: any[]) {\n try {\n return await fn.apply(this, props);\n } catch (error: any) {\n await logMetroError(projectRoot, { error });\n throw new SilentError(error);\n }\n };\n return acc;\n }, {} as any);\n}\n\nexport function evalMetroNoHandling(projectRoot: string, src: string, filename: string) {\n augmentLogs(projectRoot);\n\n return profile(requireString, 'eval-metro-bundle')(src, filename);\n}\n"],"names":["cachedSourceMaps","createMetroEndpointAsync","evalMetroAndWrapFunctions","evalMetroNoHandling","Map","process","isBun","require","install","retrieveSourceMap","source","has","get","ensureFileInRootDirectory","projectRoot","otherFile","path","relative","startsWith","sep","tempDir","join","fs","promises","mkdir","recursive","moduleId","basename","writeFile","readFile","delayAsync","devServerUrl","absoluteFilePath","props","root","getMetroServerRoot","safeOtherFile","serverPath","replace","urlFragment","createBundleUrlPath","mainModuleName","lazy","asyncRoutes","inlineSourceMap","engine","minify","bytecode","url","URL","toString","script","filename","contents","Error","Object","keys","reduce","acc","key","fn","apply","error","logMetroError","SilentError","src","augmentLogs","profile","requireString"],"mappings":"AAAA;;;;;CAKC,GACD;;;;;;;;;;;IAeaA,gBAAgB,MAAhBA,gBAAgB;IAmCPC,wBAAwB,MAAxBA,wBAAwB;IA8B9BC,yBAAyB,MAAzBA,yBAAyB;IAkCzBC,mBAAmB,MAAnBA,mBAAmB;;;8DAlHpB,IAAI;;;;;;;8DACF,MAAM;;;;;;;8DACG,qBAAqB;;;;;;qCAEjB,6BAA6B;oCACxB,iCAAiC;8BACd,2BAA2B;oCACrD,sBAAsB;uBACvB,mBAAmB;wBAClB,oBAAoB;yBACxB,qBAAqB;;;;;;AAKtC,MAAMH,gBAAgB,GAA8C,IAAII,GAAG,EAAE,AAAC;AAErF,+BAA+B;AAC/B,2BAA2B;AAE3B,kEAAkE;AAClE,IAAI,CAACC,OAAO,CAACC,KAAK,EAAE;IAClBC,OAAO,CAAC,oBAAoB,CAAC,CAACC,OAAO,CAAC;QACpCC,iBAAiB,EAACC,MAAc,EAAE;YAChC,IAAIV,gBAAgB,CAACW,GAAG,CAACD,MAAM,CAAC,EAAE;gBAChC,OAAOV,gBAAgB,CAACY,GAAG,CAACF,MAAM,CAAC,CAAC;YACtC,CAAC;YACD,OAAO,IAAI,CAAC;QACd,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AAED,eAAeG,yBAAyB,CAACC,WAAmB,EAAEC,SAAiB,EAAE;IAC/E,wEAAwE;IACxE,uCAAuC;IACvC,IAAI,CAACC,KAAI,EAAA,QAAA,CAACC,QAAQ,CAACH,WAAW,EAAEC,SAAS,CAAC,CAACG,UAAU,CAAC,IAAI,GAAGF,KAAI,EAAA,QAAA,CAACG,GAAG,CAAC,EAAE;QACtE,OAAOJ,SAAS,CAAC;IACnB,CAAC;IAED,kEAAkE;IAClE,wDAAwD;IACxD,MAAMK,OAAO,GAAGJ,KAAI,EAAA,QAAA,CAACK,IAAI,CAACP,WAAW,EAAE,kBAAkB,CAAC,AAAC;IAC3D,M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