@expo/cli 0.14.0 → 0.16.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 (225) hide show
  1. package/build/bin/cli +13 -5
  2. package/build/bin/cli.map +1 -1
  3. package/build/src/api/getVersions.js.map +1 -1
  4. package/build/src/api/rest/cache/response.js.map +1 -1
  5. package/build/src/api/rest/client.js +2 -2
  6. package/build/src/api/rest/client.js.map +1 -1
  7. package/build/src/api/user/actions.js +1 -1
  8. package/build/src/api/user/actions.js.map +1 -1
  9. package/build/src/customize/typescript.js +3 -1
  10. package/build/src/customize/typescript.js.map +1 -1
  11. package/build/src/export/createMetadataJson.js +5 -3
  12. package/build/src/export/createMetadataJson.js.map +1 -1
  13. package/build/src/export/embed/exportEmbedAsync.js +92 -18
  14. package/build/src/export/embed/exportEmbedAsync.js.map +1 -1
  15. package/build/src/export/embed/resolveOptions.js +3 -3
  16. package/build/src/export/embed/resolveOptions.js.map +1 -1
  17. package/build/src/export/embed/xcodeCompilerLogger.js +97 -0
  18. package/build/src/export/embed/xcodeCompilerLogger.js.map +1 -0
  19. package/build/src/export/exportApp.js +106 -130
  20. package/build/src/export/exportApp.js.map +1 -1
  21. package/build/src/export/exportAssets.js +93 -38
  22. package/build/src/export/exportAssets.js.map +1 -1
  23. package/build/src/export/exportAsync.js +1 -1
  24. package/build/src/export/exportAsync.js.map +1 -1
  25. package/build/src/export/exportHermes.js +0 -90
  26. package/build/src/export/exportHermes.js.map +1 -1
  27. package/build/src/export/exportStaticAsync.js +165 -101
  28. package/build/src/export/exportStaticAsync.js.map +1 -1
  29. package/build/src/export/favicon.js +13 -5
  30. package/build/src/export/favicon.js.map +1 -1
  31. package/build/src/export/fork-bundleAsync.js +84 -57
  32. package/build/src/export/fork-bundleAsync.js.map +1 -1
  33. package/build/src/export/index.js +9 -7
  34. package/build/src/export/index.js.map +1 -1
  35. package/build/src/export/metroAssetLocalPath.js +101 -0
  36. package/build/src/export/metroAssetLocalPath.js.map +1 -0
  37. package/build/src/export/persistMetroAssets.js +115 -31
  38. package/build/src/export/persistMetroAssets.js.map +1 -1
  39. package/build/src/export/publicFolder.js +7 -0
  40. package/build/src/export/publicFolder.js.map +1 -1
  41. package/build/src/export/resolveOptions.js +1 -1
  42. package/build/src/export/resolveOptions.js.map +1 -1
  43. package/build/src/export/saveAssets.js +168 -43
  44. package/build/src/export/saveAssets.js.map +1 -1
  45. package/build/src/export/web/exportWebAsync.js +1 -1
  46. package/build/src/export/web/exportWebAsync.js.map +1 -1
  47. package/build/src/export/writeContents.js +8 -106
  48. package/build/src/export/writeContents.js.map +1 -1
  49. package/build/src/install/applyPlugins.js +52 -0
  50. package/build/src/install/applyPlugins.js.map +1 -0
  51. package/build/src/install/checkPackages.js +2 -2
  52. package/build/src/install/checkPackages.js.map +1 -1
  53. package/build/src/install/fixPackages.js +84 -0
  54. package/build/src/install/fixPackages.js.map +1 -0
  55. package/build/src/install/installAsync.js +50 -60
  56. package/build/src/install/installAsync.js.map +1 -1
  57. package/build/src/install/installExpoPackage.js +79 -0
  58. package/build/src/install/installExpoPackage.js.map +1 -0
  59. package/build/src/prebuild/clearNativeFolder.js +1 -1
  60. package/build/src/prebuild/clearNativeFolder.js.map +1 -1
  61. package/build/src/prebuild/configureProjectAsync.js +3 -3
  62. package/build/src/prebuild/configureProjectAsync.js.map +1 -1
  63. package/build/src/prebuild/copyTemplateFiles.js +21 -30
  64. package/build/src/prebuild/copyTemplateFiles.js.map +1 -1
  65. package/build/src/prebuild/prebuildAsync.js +45 -16
  66. package/build/src/prebuild/prebuildAsync.js.map +1 -1
  67. package/build/src/prebuild/resolveOptions.js +2 -2
  68. package/build/src/prebuild/resolveOptions.js.map +1 -1
  69. package/build/src/prebuild/updateFromTemplate.js +6 -6
  70. package/build/src/prebuild/updateFromTemplate.js.map +1 -1
  71. package/build/src/prebuild/updatePackageJson.js +49 -36
  72. package/build/src/prebuild/updatePackageJson.js.map +1 -1
  73. package/build/src/prebuild/validateTemplatePlatforms.js +2 -2
  74. package/build/src/prebuild/validateTemplatePlatforms.js.map +1 -1
  75. package/build/src/run/hints.js +4 -0
  76. package/build/src/run/hints.js.map +1 -1
  77. package/build/src/run/index.js +101 -0
  78. package/build/src/run/index.js.map +1 -0
  79. package/build/src/start/doctor/dependencies/bundledNativeModules.js +2 -2
  80. package/build/src/start/doctor/dependencies/bundledNativeModules.js.map +1 -1
  81. package/build/src/start/doctor/dependencies/getVersionedPackages.js +22 -7
  82. package/build/src/start/doctor/dependencies/getVersionedPackages.js.map +1 -1
  83. package/build/src/start/doctor/dependencies/resolvePackages.js +66 -0
  84. package/build/src/start/doctor/dependencies/resolvePackages.js.map +1 -0
  85. package/build/src/start/doctor/dependencies/validateDependenciesVersions.js +22 -33
  86. package/build/src/start/doctor/dependencies/validateDependenciesVersions.js.map +1 -1
  87. package/build/src/start/interface/interactiveActions.js +54 -19
  88. package/build/src/start/interface/interactiveActions.js.map +1 -1
  89. package/build/src/start/server/BundlerDevServer.js +14 -10
  90. package/build/src/start/server/BundlerDevServer.js.map +1 -1
  91. package/build/src/start/server/DevServerManager.js +6 -1
  92. package/build/src/start/server/DevServerManager.js.map +1 -1
  93. package/build/src/start/server/DevToolsPluginManager.js +63 -0
  94. package/build/src/start/server/DevToolsPluginManager.js.map +1 -0
  95. package/build/src/start/server/getStaticRenderFunctions.js +25 -23
  96. package/build/src/start/server/getStaticRenderFunctions.js.map +1 -1
  97. package/build/src/start/server/metro/MetroBundlerDevServer.js +76 -69
  98. package/build/src/start/server/metro/MetroBundlerDevServer.js.map +1 -1
  99. package/build/src/start/server/metro/MetroTerminalReporter.js +6 -2
  100. package/build/src/start/server/metro/MetroTerminalReporter.js.map +1 -1
  101. package/build/src/start/server/metro/TerminalReporter.js +18 -1
  102. package/build/src/start/server/metro/TerminalReporter.js.map +1 -1
  103. package/build/src/start/server/metro/bundleApiRoutes.js +5 -3
  104. package/build/src/start/server/metro/bundleApiRoutes.js.map +1 -1
  105. package/build/src/start/server/metro/createExpoMetroResolver.js +80 -46
  106. package/build/src/start/server/metro/createExpoMetroResolver.js.map +1 -1
  107. package/build/src/start/server/metro/createJResolver.js +152 -0
  108. package/build/src/start/server/metro/createJResolver.js.map +1 -0
  109. package/build/src/start/server/metro/createServerRouteMiddleware.js +15 -2
  110. package/build/src/start/server/metro/createServerRouteMiddleware.js.map +1 -1
  111. package/build/src/start/server/metro/{inspector-proxy/device.js → debugging/InspectorDevice.js} +10 -38
  112. package/build/src/start/server/metro/debugging/InspectorDevice.js.map +1 -0
  113. package/build/src/start/server/metro/debugging/InspectorProxy.js +116 -0
  114. package/build/src/start/server/metro/debugging/InspectorProxy.js.map +1 -0
  115. package/build/src/start/server/metro/debugging/createDebugMiddleware.js +45 -0
  116. package/build/src/start/server/metro/debugging/createDebugMiddleware.js.map +1 -0
  117. package/build/src/start/server/metro/{inspector-proxy/handlers → debugging/inspectorHandlers}/NetworkResponse.js +3 -4
  118. package/build/src/start/server/metro/debugging/inspectorHandlers/NetworkResponse.js.map +1 -0
  119. package/build/src/start/server/metro/debugging/inspectorHandlers/PageReload.js.map +1 -0
  120. package/build/src/start/server/metro/{inspector-proxy/handlers → debugging/inspectorHandlers}/VscodeDebuggerGetPossibleBreakpoints.js +5 -6
  121. package/build/src/start/server/metro/debugging/inspectorHandlers/VscodeDebuggerGetPossibleBreakpoints.js.map +1 -0
  122. package/build/src/start/server/metro/{inspector-proxy/handlers → debugging/inspectorHandlers}/VscodeDebuggerScriptParsed.js +3 -2
  123. package/build/src/start/server/metro/debugging/inspectorHandlers/VscodeDebuggerScriptParsed.js.map +1 -0
  124. package/build/src/start/server/metro/{inspector-proxy/handlers → debugging/inspectorHandlers}/VscodeDebuggerSetBreakpointByUrl.js +3 -2
  125. package/build/src/start/server/metro/debugging/inspectorHandlers/VscodeDebuggerSetBreakpointByUrl.js.map +1 -0
  126. package/build/src/start/server/metro/debugging/inspectorHandlers/VscodeRuntimeCallFunctionOn.js +24 -0
  127. package/build/src/start/server/metro/debugging/inspectorHandlers/VscodeRuntimeCallFunctionOn.js.map +1 -0
  128. package/build/src/start/server/metro/{inspector-proxy/handlers → debugging/inspectorHandlers}/VscodeRuntimeGetProperties.js +5 -4
  129. package/build/src/start/server/metro/debugging/inspectorHandlers/VscodeRuntimeGetProperties.js.map +1 -0
  130. package/build/src/start/server/metro/debugging/inspectorHandlers/types.js.map +1 -0
  131. package/build/src/start/server/metro/debugging/inspectorHandlers/utils.js +20 -0
  132. package/build/src/start/server/metro/debugging/inspectorHandlers/utils.js.map +1 -0
  133. package/build/src/start/server/metro/externals.js +25 -3
  134. package/build/src/start/server/metro/externals.js.map +1 -1
  135. package/build/src/start/server/metro/getCssModulesFromBundler.js.map +1 -1
  136. package/build/src/start/server/metro/instantiateMetro.js +40 -15
  137. package/build/src/start/server/metro/instantiateMetro.js.map +1 -1
  138. package/build/src/start/server/metro/metroErrorInterface.js +3 -2
  139. package/build/src/start/server/metro/metroErrorInterface.js.map +1 -1
  140. package/build/src/start/server/metro/router.js +5 -6
  141. package/build/src/start/server/metro/router.js.map +1 -1
  142. package/build/src/start/server/metro/runServer-fork.js +17 -27
  143. package/build/src/start/server/metro/runServer-fork.js.map +1 -1
  144. package/build/src/start/server/metro/serializeHtml.js +59 -0
  145. package/build/src/start/server/metro/serializeHtml.js.map +1 -0
  146. package/build/src/start/server/metro/waitForMetroToObserveTypeScriptFile.js +1 -2
  147. package/build/src/start/server/metro/waitForMetroToObserveTypeScriptFile.js.map +1 -1
  148. package/build/src/start/server/metro/withMetroMultiPlatform.js +237 -214
  149. package/build/src/start/server/metro/withMetroMultiPlatform.js.map +1 -1
  150. package/build/src/start/server/metro/withMetroResolvers.js +114 -40
  151. package/build/src/start/server/metro/withMetroResolvers.js.map +1 -1
  152. package/build/src/start/server/middleware/DevToolsPluginMiddleware.js +61 -0
  153. package/build/src/start/server/middleware/DevToolsPluginMiddleware.js.map +1 -0
  154. package/build/src/start/server/middleware/ExpoMiddleware.js +2 -2
  155. package/build/src/start/server/middleware/ExpoMiddleware.js.map +1 -1
  156. package/build/src/start/server/middleware/ManifestMiddleware.js +22 -66
  157. package/build/src/start/server/middleware/ManifestMiddleware.js.map +1 -1
  158. package/build/src/start/server/middleware/inspector/JsInspector.js +23 -2
  159. package/build/src/start/server/middleware/inspector/JsInspector.js.map +1 -1
  160. package/build/src/start/server/middleware/inspector/LaunchBrowser.js +30 -26
  161. package/build/src/start/server/middleware/inspector/LaunchBrowser.js.map +1 -1
  162. package/build/src/start/server/middleware/inspector/LaunchBrowser.types.js +7 -7
  163. package/build/src/start/server/middleware/inspector/LaunchBrowser.types.js.map +1 -1
  164. package/build/src/start/server/middleware/inspector/LaunchBrowserImplLinux.js +5 -2
  165. package/build/src/start/server/middleware/inspector/LaunchBrowserImplLinux.js.map +1 -1
  166. package/build/src/start/server/middleware/inspector/LaunchBrowserImplMacOS.js +3 -2
  167. package/build/src/start/server/middleware/inspector/LaunchBrowserImplMacOS.js.map +1 -1
  168. package/build/src/start/server/middleware/inspector/LaunchBrowserImplWindows.js +8 -7
  169. package/build/src/start/server/middleware/inspector/LaunchBrowserImplWindows.js.map +1 -1
  170. package/build/src/start/server/middleware/metroOptions.js +176 -0
  171. package/build/src/start/server/middleware/metroOptions.js.map +1 -0
  172. package/build/src/start/server/type-generation/__typetests__/fixtures/basic.js.map +1 -1
  173. package/build/src/start/server/type-generation/__typetests__/route.test.js +11 -3
  174. package/build/src/start/server/type-generation/__typetests__/route.test.js.map +1 -1
  175. package/build/src/start/server/type-generation/routes.js +6 -4
  176. package/build/src/start/server/type-generation/routes.js.map +1 -1
  177. package/build/src/start/server/type-generation/startTypescriptTypeGeneration.js +1 -1
  178. package/build/src/start/server/type-generation/startTypescriptTypeGeneration.js.map +1 -1
  179. package/build/src/utils/analytics/getMetroDebugProperties.js +1 -2
  180. package/build/src/utils/analytics/getMetroDebugProperties.js.map +1 -1
  181. package/build/src/utils/analytics/getMetroProperties.js +1 -2
  182. package/build/src/utils/analytics/getMetroProperties.js.map +1 -1
  183. package/build/src/utils/analytics/rudderstackClient.js +2 -2
  184. package/build/src/utils/args.js +4 -2
  185. package/build/src/utils/args.js.map +1 -1
  186. package/build/src/utils/cocoapods.js +1 -1
  187. package/build/src/utils/cocoapods.js.map +1 -1
  188. package/build/src/utils/codesigning.js +11 -1
  189. package/build/src/utils/codesigning.js.map +1 -1
  190. package/build/src/utils/dir.js +18 -8
  191. package/build/src/utils/dir.js.map +1 -1
  192. package/build/src/utils/env.js +10 -1
  193. package/build/src/utils/env.js.map +1 -1
  194. package/build/src/utils/getOrPromptApplicationId.js +2 -4
  195. package/build/src/utils/getOrPromptApplicationId.js.map +1 -1
  196. package/build/src/utils/prompts.js +1 -28
  197. package/build/src/utils/prompts.js.map +1 -1
  198. package/build/src/utils/tsconfig/loadTsConfigPaths.js +3 -11
  199. package/build/src/utils/tsconfig/loadTsConfigPaths.js.map +1 -1
  200. package/build/src/utils/tsconfig/resolveWithTsConfigPaths.js +22 -12
  201. package/build/src/utils/tsconfig/resolveWithTsConfigPaths.js.map +1 -1
  202. package/package.json +19 -18
  203. package/static/shims/react-native-web/dist/cjs/exports/AppRegistry/AppContainer.js +13 -0
  204. package/static/shims/react-native-web/dist/exports/AppRegistry/AppContainer.js +12 -0
  205. package/static/template/index.html +14 -95
  206. package/build/src/export/printBundleSizes.js +0 -101
  207. package/build/src/export/printBundleSizes.js.map +0 -1
  208. package/build/src/start/server/metro/inspector-proxy/device.js.map +0 -1
  209. package/build/src/start/server/metro/inspector-proxy/handlers/NetworkResponse.js.map +0 -1
  210. package/build/src/start/server/metro/inspector-proxy/handlers/PageReload.js.map +0 -1
  211. package/build/src/start/server/metro/inspector-proxy/handlers/VscodeDebuggerGetPossibleBreakpoints.js.map +0 -1
  212. package/build/src/start/server/metro/inspector-proxy/handlers/VscodeDebuggerScriptParsed.js.map +0 -1
  213. package/build/src/start/server/metro/inspector-proxy/handlers/VscodeDebuggerSetBreakpointByUrl.js.map +0 -1
  214. package/build/src/start/server/metro/inspector-proxy/handlers/VscodeRuntimeGetProperties.js.map +0 -1
  215. package/build/src/start/server/metro/inspector-proxy/handlers/types.js.map +0 -1
  216. package/build/src/start/server/metro/inspector-proxy/index.js +0 -27
  217. package/build/src/start/server/metro/inspector-proxy/index.js.map +0 -1
  218. package/build/src/start/server/metro/inspector-proxy/proxy.js +0 -169
  219. package/build/src/start/server/metro/inspector-proxy/proxy.js.map +0 -1
  220. package/build/src/start/server/metro/resolveFromProject.js +0 -90
  221. package/build/src/start/server/metro/resolveFromProject.js.map +0 -1
  222. package/build/src/start/server/middleware/inspector/createJsInspectorMiddleware.js +0 -64
  223. package/build/src/start/server/middleware/inspector/createJsInspectorMiddleware.js.map +0 -1
  224. /package/build/src/start/server/metro/{inspector-proxy/handlers → debugging/inspectorHandlers}/PageReload.js +0 -0
  225. /package/build/src/start/server/metro/{inspector-proxy/handlers → debugging/inspectorHandlers}/types.js +0 -0
@@ -1,101 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- exports.printBundleSizes = printBundleSizes;
6
- exports.createFilesTable = createFilesTable;
7
- var _chalk = _interopRequireDefault(require("chalk"));
8
- var _prettyBytes = _interopRequireDefault(require("pretty-bytes"));
9
- var _textTable = _interopRequireDefault(require("text-table"));
10
- var Log = _interopRequireWildcard(require("../log"));
11
- var _ansi = require("../utils/ansi");
12
- var _link = require("../utils/link");
13
- function _interopRequireDefault(obj) {
14
- return obj && obj.__esModule ? obj : {
15
- default: obj
16
- };
17
- }
18
- function _interopRequireWildcard(obj) {
19
- if (obj && obj.__esModule) {
20
- return obj;
21
- } else {
22
- var newObj = {};
23
- if (obj != null) {
24
- for(var key in obj){
25
- if (Object.prototype.hasOwnProperty.call(obj, key)) {
26
- var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};
27
- if (desc.get || desc.set) {
28
- Object.defineProperty(newObj, key, desc);
29
- } else {
30
- newObj[key] = obj[key];
31
- }
32
- }
33
- }
34
- }
35
- newObj.default = obj;
36
- return newObj;
37
- }
38
- }
39
- function printBundleSizes(bundles) {
40
- const files = [];
41
- for (const [platform, bundleOutput] of Object.entries(bundles)){
42
- if (bundleOutput.hermesBytecodeBundle) {
43
- files.push([
44
- _chalk.default.bold(`index.${platform}.hbc`),
45
- bundleOutput.hermesBytecodeBundle
46
- ]);
47
- } else if (bundleOutput.code) {
48
- files.push([
49
- _chalk.default.bold(`index.${platform}.js`),
50
- bundleOutput.code
51
- ]);
52
- }
53
- if (bundleOutput.hermesSourcemap) {
54
- files.push([
55
- _chalk.default.dim(`index.${platform}.hbc.map`),
56
- bundleOutput.hermesSourcemap
57
- ]);
58
- } else if (bundleOutput.map) {
59
- files.push([
60
- _chalk.default.dim(`index.${platform}.js.map`),
61
- bundleOutput.map
62
- ]);
63
- }
64
- }
65
- Log.log();
66
- Log.log(createFilesTable(files.sort((a, b)=>a[1].length - b[1].length
67
- )));
68
- Log.log();
69
- Log.log(_chalk.default`💡 JavaScript bundle sizes affect startup time. {dim ${(0, _link).learnMore(`https://expo.fyi/javascript-bundle-sizes`)}}`);
70
- Log.log();
71
- return files;
72
- }
73
- function createFilesTable(files) {
74
- const tableData = files.map((item, index)=>{
75
- const fileBranch = index === 0 ? files.length > 1 ? "\u250C" : "\u2500" : index === files.length - 1 ? "\u2514" : "\u251C";
76
- return [
77
- `${fileBranch} ${item[0]}`,
78
- (0, _prettyBytes).default(Buffer.byteLength(item[1], "utf8"))
79
- ];
80
- });
81
- var ref;
82
- return (0, _textTable).default([
83
- [
84
- "Bundle",
85
- "Size"
86
- ].map((v)=>_chalk.default.underline(v)
87
- ),
88
- ...tableData
89
- ], {
90
- align: [
91
- "l",
92
- "r"
93
- ],
94
- stringLength: (str)=>{
95
- var ref1;
96
- return (ref = (ref1 = (0, _ansi).stripAnsi(str)) == null ? void 0 : ref1.length) != null ? ref : 0;
97
- }
98
- });
99
- }
100
-
101
- //# sourceMappingURL=printBundleSizes.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/export/printBundleSizes.ts"],"sourcesContent":["import { Platform } from '@expo/config';\nimport chalk from 'chalk';\nimport prettyBytes from 'pretty-bytes';\nimport table from 'text-table';\n\nimport { BundleOutput } from './fork-bundleAsync';\nimport * as Log from '../log';\nimport { stripAnsi } from '../utils/ansi';\nimport { learnMore } from '../utils/link';\n\nexport function printBundleSizes(bundles: Partial<Record<Platform, BundleOutput>>) {\n const files: [string, string | Uint8Array][] = [];\n\n for (const [platform, bundleOutput] of Object.entries(bundles) as [\n Platform,\n Pick<BundleOutput, 'hermesBytecodeBundle' | 'code' | 'hermesSourcemap' | 'map'>,\n ][]) {\n if (bundleOutput.hermesBytecodeBundle) {\n files.push([chalk.bold(`index.${platform}.hbc`), bundleOutput.hermesBytecodeBundle]);\n } else if (bundleOutput.code) {\n files.push([chalk.bold(`index.${platform}.js`), bundleOutput.code]);\n }\n if (bundleOutput.hermesSourcemap) {\n files.push([chalk.dim(`index.${platform}.hbc.map`), bundleOutput.hermesSourcemap]);\n } else if (bundleOutput.map) {\n files.push([chalk.dim(`index.${platform}.js.map`), bundleOutput.map]);\n }\n }\n\n Log.log();\n Log.log(createFilesTable(files.sort((a, b) => a[1].length - b[1].length)));\n Log.log();\n Log.log(\n chalk`💡 JavaScript bundle sizes affect startup time. {dim ${learnMore(\n `https://expo.fyi/javascript-bundle-sizes`\n )}}`\n );\n Log.log();\n\n return files;\n}\n\nexport function createFilesTable(files: [string, string | Uint8Array][]): string {\n const tableData = files.map((item, index) => {\n const fileBranch =\n index === 0 ? (files.length > 1 ? '┌' : '─') : index === files.length - 1 ? '└' : '├';\n\n return [`${fileBranch} ${item[0]}`, prettyBytes(Buffer.byteLength(item[1], 'utf8'))];\n });\n return table([['Bundle', 'Size'].map((v) => chalk.underline(v)), ...tableData], {\n align: ['l', 'r'],\n stringLength: (str) => stripAnsi(str)?.length ?? 0,\n });\n}\n"],"names":["printBundleSizes","createFilesTable","Log","bundles","files","platform","bundleOutput","Object","entries","hermesBytecodeBundle","push","chalk","bold","code","hermesSourcemap","dim","map","log","sort","a","b","length","learnMore","tableData","item","index","fileBranch","prettyBytes","Buffer","byteLength","stripAnsi","table","v","underline","align","stringLength","str"],"mappings":"AAAA;;;;QAUgBA,gBAAgB,GAAhBA,gBAAgB;QAgChBC,gBAAgB,GAAhBA,gBAAgB;AAzCd,IAAA,MAAO,kCAAP,OAAO,EAAA;AACD,IAAA,YAAc,kCAAd,cAAc,EAAA;AACpB,IAAA,UAAY,kCAAZ,YAAY,EAAA;AAGlBC,IAAAA,GAAG,mCAAM,QAAQ,EAAd;AACW,IAAA,KAAe,WAAf,eAAe,CAAA;AACf,IAAA,KAAe,WAAf,eAAe,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;AAElC,SAASF,gBAAgB,CAACG,OAAgD,EAAE;IACjF,MAAMC,KAAK,GAAoC,EAAE,AAAC;IAElD,KAAK,MAAM,CAACC,QAAQ,EAAEC,YAAY,CAAC,IAAIC,MAAM,CAACC,OAAO,CAACL,OAAO,CAAC,CAGzD;QACH,IAAIG,YAAY,CAACG,oBAAoB,EAAE;YACrCL,KAAK,CAACM,IAAI,CAAC;gBAACC,MAAK,QAAA,CAACC,IAAI,CAAC,CAAC,MAAM,EAAEP,QAAQ,CAAC,IAAI,CAAC,CAAC;gBAAEC,YAAY,CAACG,oBAAoB;aAAC,CAAC,CAAC;SACtF,MAAM,IAAIH,YAAY,CAACO,IAAI,EAAE;YAC5BT,KAAK,CAACM,IAAI,CAAC;gBAACC,MAAK,QAAA,CAACC,IAAI,CAAC,CAAC,MAAM,EAAEP,QAAQ,CAAC,GAAG,CAAC,CAAC;gBAAEC,YAAY,CAACO,IAAI;aAAC,CAAC,CAAC;SACrE;QACD,IAAIP,YAAY,CAACQ,eAAe,EAAE;YAChCV,KAAK,CAACM,IAAI,CAAC;gBAACC,MAAK,QAAA,CAACI,GAAG,CAAC,CAAC,MAAM,EAAEV,QAAQ,CAAC,QAAQ,CAA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AW,AAAoC,CAAA,QAApC,CAACC,MAAM,CAACC,UAAU,CAACL,IAAI,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;SAAC,CAAC;KACtF,CAAC,AAAC;QAGsBM,GAAsB;IAF/C,OAAOC,CAAAA,GAAAA,UAAK,AAGV,CAAA,QAHU,CAAC;QAAC;YAAC,QAAQ;YAAE,MAAM;SAAC,CAACf,GAAG,CAAC,CAACgB,CAAC,GAAKrB,MAAK,QAAA,CAACsB,SAAS,CAACD,CAAC,CAAC;QAAA,CAAC;WAAKT,SAAS;KAAC,EAAE;QAC9EW,KAAK,EAAE;YAAC,GAAG;YAAE,GAAG;SAAC;QACjBC,YAAY,EAAE,CAACC,GAAG;gBAAKN,IAAc;YAAdA,OAAAA,CAAAA,GAAsB,GAAtBA,CAAAA,IAAc,GAAdA,CAAAA,GAAAA,KAAS,AAAK,CAAA,UAAL,CAACM,GAAG,CAAC,SAAQ,GAAtBN,KAAAA,CAAsB,GAAtBA,IAAc,CAAET,MAAM,YAAtBS,GAAsB,GAAI,CAAC,CAAA;SAAA;KACnD,CAAC,CAAC;CACJ"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../src/start/server/metro/inspector-proxy/device.ts"],"sourcesContent":["import type { DebuggerInfo, Device as MetroDevice } from 'metro-inspector-proxy';\nimport fetch from 'node-fetch';\nimport type WS from 'ws';\n\nimport { NetworkResponseHandler } from './handlers/NetworkResponse';\nimport { PageReloadHandler } from './handlers/PageReload';\nimport { VscodeDebuggerGetPossibleBreakpointsHandler } from './handlers/VscodeDebuggerGetPossibleBreakpoints';\nimport { VscodeDebuggerScriptParsedHandler } from './handlers/VscodeDebuggerScriptParsed';\nimport { VscodeDebuggerSetBreakpointByUrlHandler } from './handlers/VscodeDebuggerSetBreakpointByUrl';\nimport { VscodeRuntimeGetPropertiesHandler } from './handlers/VscodeRuntimeGetProperties';\nimport { DeviceRequest, InspectorHandler, DebuggerRequest } from './handlers/types';\nimport { MetroBundlerDevServer } from '../MetroBundlerDevServer';\n\n/** Export the supported debugger types this inspector proxy can handle */\nexport type DebuggerType = 'vscode' | 'generic';\n\n/** The debugger information being tracked by this device class */\nexport type ExpoDebuggerInfo = DebuggerInfo & { debuggerType?: DebuggerType };\n\nexport function createInspectorDeviceClass(\n metroBundler: MetroBundlerDevServer,\n MetroDeviceClass: typeof MetroDevice\n) {\n return class ExpoInspectorDevice extends MetroDeviceClass implements InspectorHandler {\n /** Stores information about currently connected debugger (if any). */\n _debuggerConnection: ExpoDebuggerInfo | null = null;\n\n /** All handlers that should be used to intercept or reply to CDP events */\n public handlers: InspectorHandler[] = [\n // Generic handlers\n new NetworkResponseHandler(),\n new PageReloadHandler(metroBundler),\n // Vscode-specific handlers\n new VscodeDebuggerGetPossibleBreakpointsHandler(),\n new VscodeDebuggerScriptParsedHandler(this),\n new VscodeDebuggerSetBreakpointByUrlHandler(),\n new VscodeRuntimeGetPropertiesHandler(),\n ];\n\n onDeviceMessage(message: any, info: DebuggerInfo): boolean {\n return this.handlers.some((handler) => handler.onDeviceMessage?.(message, info) ?? false);\n }\n\n onDebuggerMessage(message: any, info: DebuggerInfo): boolean {\n return this.handlers.some((handler) => handler.onDebuggerMessage?.(message, info) ?? false);\n }\n\n /**\n * Handle a new device connection with the same device identifier.\n * When the app and device name matches, we can reuse the debugger connection.\n * Else, we have to shut the debugger connection down.\n */\n handleDuplicateDeviceConnection(newDevice: InstanceType<typeof MetroDeviceClass>) {\n if (this._app !== newDevice._app || this._name !== newDevice._name) {\n this._deviceSocket.close();\n this._debuggerConnection?.socket.close();\n return;\n }\n\n const oldDebugger = this._debuggerConnection;\n this._debuggerConnection = null;\n\n if (oldDebugger) {\n oldDebugger.socket.removeAllListeners();\n this._deviceSocket.close();\n newDevice.handleDebuggerConnection(oldDebugger.socket, oldDebugger.pageId);\n }\n }\n\n /**\n * Handle a new debugger connection to this device.\n * This adds the `debuggerType` property to the `DebuggerInfo` object.\n * With that information, we can enable or disable debugger-specific handlers.\n */\n handleDebuggerConnectionWithType(socket: WS, pageId: string, debuggerType: DebuggerType): void {\n this.handleDebuggerConnection(socket, pageId);\n\n if (this._debuggerConnection) {\n this._debuggerConnection.debuggerType = debuggerType;\n }\n }\n\n /** Hook into the message life cycle to answer more complex CDP messages */\n async _processMessageFromDevice(message: DeviceRequest<any>, info: DebuggerInfo) {\n if (!this.onDeviceMessage(message, info)) {\n await super._processMessageFromDevice(message, info);\n }\n }\n\n /** Hook into the message life cycle to answer more complex CDP messages */\n _interceptMessageFromDebugger(\n request: DebuggerRequest,\n info: DebuggerInfo,\n socket: WS\n ): boolean {\n // Note, `socket` is the exact same as `info.socket`\n if (this.onDebuggerMessage(request, info)) {\n return true;\n }\n\n return super._interceptMessageFromDebugger(request, info, socket);\n }\n\n /**\n * Overwrite the default text fetcher, to load sourcemaps from sources other than `localhost`.\n * @todo Cedric: remove the custom `DebuggerScriptSource` handler when switching over to `metro@>=0.75.1`\n * @see https://github.com/facebook/metro/blob/77f445f1bcd2264ad06174dbf8d542bc75834d29/packages/metro-inspector-proxy/src/Device.js#L573-L588\n * @since metro-inspector-proxy@0.75.1\n */\n async _fetchText(url: URL): Promise<string> {\n const LENGTH_LIMIT_BYTES = 350_000_000; // 350mb\n\n const response = await fetch(url);\n if (!response.ok) {\n throw new Error(`Received status ${response.status} while fetching: ${url}`);\n }\n\n const contentLength = response.headers.get('Content-Length');\n if (contentLength && Number(contentLength) > LENGTH_LIMIT_BYTES) {\n throw new Error('Expected file size is too large (more than 350mb)');\n }\n\n const text = await response.text();\n if (Buffer.byteLength(text, 'utf8') > LENGTH_LIMIT_BYTES) {\n throw new Error('File size is too large (more than 350mb)');\n }\n\n return text;\n }\n };\n}\n"],"names":["createInspectorDeviceClass","metroBundler","MetroDeviceClass","ExpoInspectorDevice","_debuggerConnection","handlers","NetworkResponseHandler","PageReloadHandler","VscodeDebuggerGetPossibleBreakpointsHandler","VscodeDebuggerScriptParsedHandler","VscodeDebuggerSetBreakpointByUrlHandler","VscodeRuntimeGetPropertiesHandler","onDeviceMessage","message","info","handler","some","onDebuggerMessage","handleDuplicateDeviceConnection","newDevice","_app","_name","_deviceSocket","close","socket","oldDebugger","removeAllListeners","handleDebuggerConnection","pageId","handleDebuggerConnectionWithType","debuggerType","_processMessageFromDevice","_interceptMessageFromDebugger","request","_fetchText","url","LENGTH_LIMIT_BYTES","response","fetch","ok","Error","status","contentLength","headers","get","Number","text","Buffer","byteLength"],"mappings":"AAAA;;;;QAmBgBA,0BAA0B,GAA1BA,0BAA0B;AAlBxB,IAAA,UAAY,kCAAZ,YAAY,EAAA;AAGS,IAAA,gBAA4B,WAA5B,4BAA4B,CAAA;AACjC,IAAA,WAAuB,WAAvB,uBAAuB,CAAA;AACG,IAAA,qCAAiD,WAAjD,iDAAiD,CAAA;AAC3D,IAAA,2BAAuC,WAAvC,uCAAuC,CAAA;AACjC,IAAA,iCAA6C,WAA7C,6CAA6C,CAAA;AACnD,IAAA,2BAAuC,WAAvC,uCAAuC,CAAA;;;;;;AAUlF,SAASA,0BAA0B,CACxCC,YAAmC,EACnCC,gBAAoC,EACpC;IACA,OAAO,MAAMC,mBAAmB,SAASD,gBAAgB;QACvD,sEAAsE,CACtEE,mBAAmB,GAA4B,IAAI,CAAC;QAEpD,2EAA2E,CAC3E,AAAOC,QAAQ,GAAuB;YACpC,mBAAmB;YACnB,IAAIC,gBAAsB,uBAAA,EAAE;YAC5B,IAAIC,WAAiB,kBAAA,CAACN,YAAY,CAAC;YACnC,2BAA2B;YAC3B,IAAIO,qCAA2C,4CAAA,EAAE;YACjD,IAAIC,2BAAiC,kCAAA,CAAC,IAAI,CAAC;YAC3C,IAAIC,iCAAuC,wCAAA,EAAE;YAC7C,IAAIC,2BAAiC,kCAAA,EAAE;SACxC,CAAC;QAEFC,eAAe,CAACC,OAAY,EAAEC,IAAkB,EAAW;gBAClBC,GAAwC;YAA/E,OAAO,IAAI,CAACV,QAAQ,CAACW,IAAI,CAAC,CAACD,OAAO;gBAAKA,OAAAA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AC;YAC7D,IAAIF,aAAa,IAAIG,MAAM,CAACH,aAAa,CAAC,GAAGN,kBAAkB,EAAE;gBAC/D,MAAM,IAAII,KAAK,CAAC,mDAAmD,CAAC,CAAC;aACtE;YAED,MAAMM,IAAI,GAAG,MAAMT,QAAQ,CAACS,IAAI,EAAE,AAAC;YACnC,IAAIC,MAAM,CAACC,UAAU,CAACF,IAAI,EAAE,MAAM,CAAC,GAAGV,kBAAkB,EAAE;gBACxD,MAAM,IAAII,KAAK,CAAC,0CAA0C,CAAC,CAAC;aAC7D;YAED,OAAOM,IAAI,CAAC;SACb;KACF,CAAC;CACH"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../../src/start/server/metro/inspector-proxy/handlers/NetworkResponse.ts"],"sourcesContent":["import type { Protocol } from 'devtools-protocol';\n\nimport {\n CdpMessage,\n InspectorHandler,\n DeviceRequest,\n DebuggerRequest,\n DebuggerResponse,\n DeviceResponse,\n} from './types';\nimport { ExpoDebuggerInfo } from '../device';\n\nexport class NetworkResponseHandler implements InspectorHandler {\n /** All known responses, mapped by request id */\n storage = new Map<string, DebuggerResponse<NetworkGetResponseBody>['result']>();\n\n onDeviceMessage(message: DeviceRequest<NetworkReceivedResponseBody>) {\n if (message.method === 'Expo(Network.receivedResponseBody)') {\n const { requestId, ...requestInfo } = message.params;\n this.storage.set(requestId, requestInfo);\n return true;\n }\n\n return false;\n }\n\n onDebuggerMessage(\n message: DebuggerRequest<NetworkGetResponseBody>,\n { socket }: ExpoDebuggerInfo\n ) {\n if (\n message.method === 'Network.getResponseBody' &&\n this.storage.has(message.params.requestId)\n ) {\n const response: DeviceResponse<NetworkGetResponseBody> = {\n id: message.id,\n result: this.storage.get(message.params.requestId)!,\n };\n\n socket.send(JSON.stringify(response));\n return true;\n }\n\n return false;\n }\n}\n\n/** Custom message to transfer the response body data to the proxy */\nexport type NetworkReceivedResponseBody = CdpMessage<\n 'Expo(Network.receivedResponseBody)',\n Protocol.Network.GetResponseBodyRequest & Protocol.Network.GetResponseBodyResponse,\n never\n>;\n\n/** @see https://chromedevtools.github.io/devtools-protocol/1-2/Network/#method-getResponseBody */\nexport type NetworkGetResponseBody = CdpMessage<\n 'Network.getResponseBody',\n Protocol.Network.GetResponseBodyRequest,\n Protocol.Network.GetResponseBodyResponse\n>;\n"],"names":["NetworkResponseHandler","storage","Map","onDeviceMessage","message","method","requestId","requestInfo","params","set","onDebuggerMessage","socket","has","response","id","result","get","send","JSON","stringify"],"mappings":"AAAA;;;;AAYO,MAAMA,sBAAsB;IACjC,gDAAgD,CAChDC,OAAO,GAAG,IAAIC,GAAG,EAA8D,CAAC;IAEhFC,eAAe,CAACC,OAAmD,EAAE;QACnE,IAAIA,OAAO,CAACC,MAAM,KAAK,oCAAoC,EAAE;YAC3D,MAAM,EAAEC,SAAS,CAAA,EAAE,GAAGC,WAAW,EAAE,GAAGH,OAAO,CAACI,MAAM,AAAC;YACrD,IAAI,CAACP,OAAO,CAACQ,GAAG,CAACH,SAAS,EAAEC,WAAW,CAAC,CAAC;YACzC,OAAO,IAAI,CAAC;SACb;QAED,OAAO,KAAK,CAAC;KACd;IAEDG,iBAAiB,CACfN,OAAgD,EAChD,EAAEO,MAAM,CAAA,EAAoB,EAC5B;QACA,IACEP,OAAO,CAACC,MAAM,KAAK,yBAAyB,IAC5C,IAAI,CAACJ,OAAO,CAACW,GAAG,CAACR,OAAO,CAACI,MAAM,CAACF,SAAS,CAAC,EAC1C;YACA,MAAMO,QAAQ,GAA2C;gBACvDC,EAAE,EAAEV,OAAO,CAACU,EAAE;gBACdC,MAAM,EAAE,IAAI,CAACd,OAAO,CAACe,GAAG,CAACZ,OAAO,CAACI,MAAM,CAACF,SAAS,CAAC;aACnD,AAAC;YAEFK,MAAM,CAACM,IAAI,CAACC,IAAI,CAACC,SAAS,CAACN,QAAQ,CAAC,CAAC,CAAC;YACtC,OAAO,IAAI,CAAC;SACb;QAED,OAAO,KAAK,CAAC;KACd;CACF;QAjCYb,sBAAsB,GAAtBA,sBAAsB"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../../src/start/server/metro/inspector-proxy/handlers/PageReload.ts"],"sourcesContent":["import type { Protocol } from 'devtools-protocol';\n\nimport { CdpMessage, DebuggerRequest, InspectorHandler } from './types';\nimport { MetroBundlerDevServer } from '../../MetroBundlerDevServer';\nimport { ExpoDebuggerInfo } from '../device';\n\nexport class PageReloadHandler implements InspectorHandler {\n constructor(private readonly metroBundler: MetroBundlerDevServer) {}\n\n onDebuggerMessage(message: DebuggerRequest<PageReload>, { socket }: ExpoDebuggerInfo) {\n if (message.method === 'Page.reload') {\n this.metroBundler.broadcastMessage('reload');\n socket.send(JSON.stringify({ id: message.id }));\n return true;\n }\n\n return false;\n }\n}\n\n/** @see https://chromedevtools.github.io/devtools-protocol/1-2/Page/#method-reload */\nexport type PageReload = CdpMessage<'Page.reload', Protocol.Page.ReloadRequest, never>;\n"],"names":["PageReloadHandler","constructor","metroBundler","onDebuggerMessage","message","socket","method","broadcastMessage","send","JSON","stringify","id"],"mappings":"AAAA;;;;AAMO,MAAMA,iBAAiB;IAC5BC,YAA6BC,YAAmC,CAAE;aAArCA,YAAmC,GAAnCA,YAAmC;KAAI;IAEpEC,iBAAiB,CAACC,OAAoC,EAAE,EAAEC,MAAM,CAAA,EAAoB,EAAE;QACpF,IAAID,OAAO,CAACE,MAAM,KAAK,aAAa,EAAE;YACpC,IAAI,CAACJ,YAAY,CAACK,gBAAgB,CAAC,QAAQ,CAAC,CAAC;YAC7CF,MAAM,CAACG,IAAI,CAACC,IAAI,CAACC,SAAS,CAAC;gBAAEC,EAAE,EAAEP,OAAO,CAACO,EAAE;aAAE,CAAC,CAAC,CAAC;YAChD,OAAO,IAAI,CAAC;SACb;QAED,OAAO,KAAK,CAAC;KACd;CACF;QAZYX,iBAAiB,GAAjBA,iBAAiB"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../../src/start/server/metro/inspector-proxy/handlers/VscodeDebuggerGetPossibleBreakpoints.ts"],"sourcesContent":["import Protocol from 'devtools-protocol';\n\nimport { CdpMessage, DebuggerRequest, DeviceResponse, InspectorHandler } from './types';\nimport { ExpoDebuggerInfo } from '../device';\n\n/**\n * Hermes doesn't seem to handle this request, but `locations` have to be returned.\n * Respond with an empty location to make it \"spec compliant\" with Chrome DevTools.\n */\nexport class VscodeDebuggerGetPossibleBreakpointsHandler implements InspectorHandler {\n onDebuggerMessage(\n message: DebuggerRequest<DebuggerGetPossibleBreakpoints>,\n { socket, debuggerType }: ExpoDebuggerInfo\n ): boolean {\n if (debuggerType === 'vscode' && message.method === 'Debugger.getPossibleBreakpoints') {\n const response: DeviceResponse<DebuggerGetPossibleBreakpoints> = {\n id: message.id,\n result: { locations: [] },\n };\n socket.send(JSON.stringify(response));\n return true;\n }\n\n return false;\n }\n}\n\n/** @see https://chromedevtools.github.io/devtools-protocol/v8/Debugger/#method-getPossibleBreakpoints */\nexport type DebuggerGetPossibleBreakpoints = CdpMessage<\n 'Debugger.getPossibleBreakpoints',\n Protocol.Debugger.GetPossibleBreakpointsRequest,\n Protocol.Debugger.GetPossibleBreakpointsResponse\n>;\n"],"names":["VscodeDebuggerGetPossibleBreakpointsHandler","onDebuggerMessage","message","socket","debuggerType","method","response","id","result","locations","send","JSON","stringify"],"mappings":"AAAA;;;;AASO,MAAMA,2CAA2C;IACtDC,iBAAiB,CACfC,OAAwD,EACxD,EAAEC,MAAM,CAAA,EAAEC,YAAY,CAAA,EAAoB,EACjC;QACT,IAAIA,YAAY,KAAK,QAAQ,IAAIF,OAAO,CAACG,MAAM,KAAK,iCAAiC,EAAE;YACrF,MAAMC,QAAQ,GAAmD;gBAC/DC,EAAE,EAAEL,OAAO,CAACK,EAAE;gBACdC,MAAM,EAAE;oBAAEC,SAAS,EAAE,EAAE;iBAAE;aAC1B,AAAC;YACFN,MAAM,CAACO,IAAI,CAACC,IAAI,CAACC,SAAS,CAACN,QAAQ,CAAC,CAAC,CAAC;YACtC,OAAO,IAAI,CAAC;SACb;QAED,OAAO,KAAK,CAAC;KACd;CACF;QAhBYN,2CAA2C,GAA3CA,2CAA2C"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../../src/start/server/metro/inspector-proxy/handlers/VscodeDebuggerScriptParsed.ts"],"sourcesContent":["import Protocol from 'devtools-protocol';\nimport { Device as MetroDevice } from 'metro-inspector-proxy';\n\nimport { CdpMessage, DeviceRequest, InspectorHandler } from './types';\nimport { ExpoDebuggerInfo } from '../device';\n\n/** Android's stock emulator and other emulators such as genymotion use a standard localhost alias. */\nconst EMULATOR_LOCALHOST_ADDRESSES: Readonly<string[]> = ['10.0.2.2', '10.0.3.2'];\n/** Prefix for script URLs that are alphanumeric IDs. */\nconst FILE_PREFIX = 'file://';\n\n/**\n * Some debug clients does not support fetching source maps by URL.\n * By default, the `metro-inspector-proxy` inlines the source map as base64 string.\n * Unfortunately, that causes a multi-second delay in VS Code (±5s).\n * This handler disables inlining the source maps for VS Code only.\n */\nexport class VscodeDebuggerScriptParsedHandler implements InspectorHandler {\n constructor(private readonly device: MetroDevice) {}\n\n onDeviceMessage(message: DeviceRequest<DebuggerScriptParsed>, debuggerInfo: ExpoDebuggerInfo) {\n if (debuggerInfo.debuggerType !== 'vscode' || message.method !== 'Debugger.scriptParsed') {\n return false;\n }\n\n // See: https://github.com/facebook/metro/blob/f43caa371a813b257cb0b42028079645a1e85e0e/packages/metro-inspector-proxy/src/Device.js#L401-L410\n if (message.params.sourceMapURL) {\n for (let i = 0; i < EMULATOR_LOCALHOST_ADDRESSES.length; ++i) {\n const address = EMULATOR_LOCALHOST_ADDRESSES[i];\n if (message.params.sourceMapURL.indexOf(address) >= 0) {\n message.params.sourceMapURL = message.params.sourceMapURL.replace(address, 'localhost');\n debuggerInfo.originalSourceURLAddress = address;\n }\n }\n }\n\n // See: https://github.com/facebook/metro/blob/f43caa371a813b257cb0b42028079645a1e85e0e/packages/metro-inspector-proxy/src/Device.js#L431-L453\n if (message.params.url) {\n for (let i = 0; i < EMULATOR_LOCALHOST_ADDRESSES.length; ++i) {\n const address = EMULATOR_LOCALHOST_ADDRESSES[i];\n if (message.params.url.indexOf(address) >= 0) {\n message.params.url = message.params.url.replace(address, 'localhost');\n debuggerInfo.originalSourceURLAddress = address;\n }\n }\n\n // Chrome doesn't download source maps if URL param is not a valid\n // URL. Some frameworks pass alphanumeric script ID instead of URL which causes\n // Chrome to not download source maps. In this case we want to prepend script ID\n // with 'file://' prefix.\n if (message.params.url.match(/^[0-9a-z]+$/)) {\n message.params.url = FILE_PREFIX + message.params.url;\n debuggerInfo.prependedFilePrefix = true;\n }\n\n if (message.params.scriptId != null) {\n this.device._scriptIdToSourcePathMapping.set(message.params.scriptId, message.params.url);\n }\n }\n\n // Block `metro-inspector-proxy`'s default source map inlining\n return true;\n }\n}\n\n/** @see https://chromedevtools.github.io/devtools-protocol/v8/Debugger/#event-scriptParsed */\nexport type DebuggerScriptParsed = CdpMessage<\n 'Debugger.scriptParsed',\n Protocol.Debugger.ScriptParsedEvent,\n never\n>;\n"],"names":["EMULATOR_LOCALHOST_ADDRESSES","FILE_PREFIX","VscodeDebuggerScriptParsedHandler","constructor","device","onDeviceMessage","message","debuggerInfo","debuggerType","method","params","sourceMapURL","i","length","address","indexOf","replace","originalSourceURLAddress","url","match","prependedFilePrefix","scriptId","_scriptIdToSourcePathMapping","set"],"mappings":"AAAA;;;;AAMA,sGAAsG,CACtG,MAAMA,4BAA4B,GAAuB;IAAC,UAAU;IAAE,UAAU;CAAC,AAAC;AAClF,wDAAwD,CACxD,MAAMC,WAAW,GAAG,SAAS,AAAC;AAQvB,MAAMC,iCAAiC;IAC5CC,YAA6BC,MAAmB,CAAE;aAArBA,MAAmB,GAAnBA,MAAmB;KAAI;IAEpDC,eAAe,CAACC,OAA4C,EAAEC,YAA8B,EAAE;QAC5F,IAAIA,YAAY,CAACC,YAAY,KAAK,QAAQ,IAAIF,OAAO,CAACG,MAAM,KAAK,uBAAuB,EAAE;YACxF,OAAO,KAAK,CAA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AAM,CAACQ,GAAG,CAAC;gBACtDX,YAAY,CAACa,mBAAmB,GAAG,IAAI,CAAC;aACzC;YAED,IAAId,OAAO,CAACI,MAAM,CAACW,QAAQ,IAAI,IAAI,EAAE;gBACnC,IAAI,CAACjB,MAAM,CAACkB,4BAA4B,CAACC,GAAG,CAACjB,OAAO,CAACI,MAAM,CAACW,QAAQ,EAAEf,OAAO,CAACI,MAAM,CAACQ,GAAG,CAAC,CAAC;aAC3F;SACF;QAED,8DAA8D;QAC9D,OAAO,IAAI,CAAC;KACb;CACF;QA9CYhB,iCAAiC,GAAjCA,iCAAiC"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../../src/start/server/metro/inspector-proxy/handlers/VscodeDebuggerSetBreakpointByUrl.ts"],"sourcesContent":["import Protocol from 'devtools-protocol';\n\nimport { CdpMessage, DebuggerRequest, InspectorHandler } from './types';\nimport { ExpoDebuggerInfo } from '../device';\n\n/**\n * Hermes and vscode have trouble setting breakpoints by `urlRegex` through `Debugger.setBreakpointByUrl`.\n * Vscode adds `file://` to a URL containing `http://`, which confuses Hermes and sets it to the wrong location.\n * Hermes needs to create the breakpoint to get the proper ID, but it must be unbounded.\n * Once the sourcemap is loaded, vscode will rebind the unbounded breakpoint to the correct location (using `Debugger.setBreakpoint`).\n */\nexport class VscodeDebuggerSetBreakpointByUrlHandler implements InspectorHandler {\n onDebuggerMessage(\n message: DebuggerRequest<DebuggerSetBreakpointByUrl>,\n { debuggerType }: ExpoDebuggerInfo\n ): boolean {\n if (\n debuggerType === 'vscode' &&\n message.method === 'Debugger.setBreakpointByUrl' &&\n message.params.urlRegex\n ) {\n // Explicitly force the breakpoint to be unbounded\n message.params.url = 'file://__invalid_url__';\n delete message.params.urlRegex;\n }\n\n return false;\n }\n}\n\n/** @see https://chromedevtools.github.io/devtools-protocol/v8/Debugger/#method-setBreakpointByUrl */\nexport type DebuggerSetBreakpointByUrl = CdpMessage<\n 'Debugger.setBreakpointByUrl',\n Protocol.Debugger.SetBreakpointByUrlRequest,\n Protocol.Debugger.SetBreakpointByUrlResponse\n>;\n"],"names":["VscodeDebuggerSetBreakpointByUrlHandler","onDebuggerMessage","message","debuggerType","method","params","urlRegex","url"],"mappings":"AAAA;;;;AAWO,MAAMA,uCAAuC;IAClDC,iBAAiB,CACfC,OAAoD,EACpD,EAAEC,YAAY,CAAA,EAAoB,EACzB;QACT,IACEA,YAAY,KAAK,QAAQ,IACzBD,OAAO,CAACE,MAAM,KAAK,6BAA6B,IAChDF,OAAO,CAACG,MAAM,CAACC,QAAQ,EACvB;YACA,kDAAkD;YAClDJ,OAAO,CAACG,MAAM,CAACE,GAAG,GAAG,wBAAwB,CAAC;YAC9C,OAAOL,OAAO,CAACG,MAAM,CAACC,QAAQ,CAAC;SAChC;QAED,OAAO,KAAK,CAAC;KACd;CACF;QAjBYN,uCAAuC,GAAvCA,uCAAuC"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../../src/start/server/metro/inspector-proxy/handlers/VscodeRuntimeGetProperties.ts"],"sourcesContent":["import Protocol from 'devtools-protocol';\n\nimport { CdpMessage, DebuggerRequest, DeviceResponse, InspectorHandler } from './types';\nimport { ExpoDebuggerInfo } from '../device';\n\n/**\n * Vscode doesn't seem to work nicely with missing `description` fields on `RemoteObject` instances.\n * It also tries to invoke `Runtime.callFunctionOn` on `Symbol` types, which crashes Hermes.\n * This handler tries to compensate for these two separate issues.\n *\n * @see https://github.com/facebook/hermes/issues/114\n * @see https://github.com/microsoft/vscode-js-debug/issues/1583\n */\nexport class VscodeRuntimeGetPropertiesHandler implements InspectorHandler {\n /** Keep track of `Runtime.getProperties` responses to intercept, by request id */\n interceptGetProperties = new Set<number>();\n\n onDebuggerMessage(\n message: DebuggerRequest<RuntimeGetProperties>,\n { debuggerType }: ExpoDebuggerInfo\n ): boolean {\n if (debuggerType === 'vscode' && message.method === 'Runtime.getProperties') {\n this.interceptGetProperties.add(message.id);\n }\n\n // Do not block propagation of this message\n return false;\n }\n\n onDeviceMessage(\n message: DeviceResponse<RuntimeGetProperties>,\n { debuggerType }: ExpoDebuggerInfo\n ) {\n if (\n debuggerType === 'vscode' &&\n 'id' in message &&\n this.interceptGetProperties.has(message.id)\n ) {\n this.interceptGetProperties.delete(message.id);\n\n for (const item of message.result.result ?? []) {\n // Force-fully format the properties description to be an empty string\n if (item.value) {\n item.value.description = item.value.description ?? '';\n }\n\n // Avoid passing the `objectId` for symbol types.\n // When collapsing in vscode, it will fetch information about the symbol using the `objectId`.\n // The `Runtime.getProperties` request of the symbol hard-crashes Hermes.\n if (item.value?.type === 'symbol' && item.value.objectId) {\n delete item.value.objectId;\n }\n }\n }\n\n // Do not block propagation of this message\n return false;\n }\n}\n\n/** @see https://chromedevtools.github.io/devtools-protocol/v8/Runtime/#method-getProperties */\nexport type RuntimeGetProperties = CdpMessage<\n 'Runtime.getProperties',\n Protocol.Runtime.GetPropertiesRequest,\n Protocol.Runtime.GetPropertiesResponse\n>;\n"],"names":["VscodeRuntimeGetPropertiesHandler","interceptGetProperties","Set","onDebuggerMessage","message","debuggerType","method","add","id","onDeviceMessage","has","delete","item","result","value","description","type","objectId"],"mappings":"AAAA;;;;AAaO,MAAMA,iCAAiC;IAC5C,kFAAkF,CAClFC,sBAAsB,GAAG,IAAIC,GAAG,EAAU,CAAC;IAE3CC,iBAAiB,CACfC,OAA8C,EAC9C,EAAEC,YAAY,CAAA,EAAoB,EACzB;QACT,IAAIA,YAAY,KAAK,QAAQ,IAAID,OAAO,CAACE,MAAM,KAAK,uBAAuB,EAAE;YAC3E,IAAI,CAACL,sBAAsB,CAACM,GAAG,CAACH,OAAO,CAACI,EAAE,CAAC,CAAC;SAC7C;QAED,2CAA2C;QAC3C,OAAO,KAAK,CAAC;KACd;IAEDC,eAAe,CACbL,OAA6C,EAC7C,EAAEC,YAAY,CAAA,EAAoB,EAClC;QACA,IACEA,YAAY,KAAK,QAAQ,IACzB,IAAI,IAAID,OAAO,IACf,IAAI,CAACH,sBAAsB,CAACS,GAAG,CAACN,OAAO,CAACI,EAAE,CAAC,EAC3C;YACA,IAAI,CAACP,sBAAsB,CAACU,MAAM,CAACP,OAAO,CAACI,EAAE,CAAC,CAAC;gBAE5BJ,OAAqB;YAAxC,KAAK,MAAMQ,IAAI,IAAIR,CAAAA,OAAqB,GAArBA,OAAO,CAACS,MAAM,CAACA,MAAM,YAArBT,OAAqB,GAAI,EAAE,CAAE;oBAS1CQ,GAAU;gBARd,sEAAsE;gBACtE,IAAIA,IAAI,CAACE,KAAK,EAAE;wBACWF,YAAsB;oBAA/CA,IAAI,CAACE,KAAK,CAACC,WAAW,GAAGH,CAAAA,YAAsB,GAAtBA,IAAI,CAACE,KAAK,CAACC,WAAW,YAAtBH,YAAsB,GAAI,EAAE,CAAC;iBACvD;gBAED,iDAAiD;gBACjD,8FAA8F;gBAC9F,yEAAyE;gBACzE,IAAIA,CAAAA,CAAAA,GAAU,GAAVA,IAAI,CAACE,KAAK,SAAM,GAAhBF,KAAAA,CAAgB,GAAhBA,GAAU,CAAEI,IAAI,CAAA,KAAK,QAAQ,IAAIJ,IAAI,CAACE,KAAK,CAACG,QAAQ,EAAE;oBACxD,OAAOL,IAAI,CAACE,KAAK,CAACG,QAAQ,CAAC;iBAC5B;aACF;SACF;QAED,2CAA2C;QAC3C,OAAO,KAAK,CAAC;KACd;CACF;QA7CYjB,iCAAiC,GAAjCA,iCAAiC"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../../src/start/server/metro/inspector-proxy/handlers/types.ts"],"sourcesContent":["import { ExpoDebuggerInfo } from '../device';\n\nexport interface InspectorHandler {\n /**\n * Intercept a message coming from the device, modify or respond to it through `this._sendMessageToDevice`.\n * Return `true` if the message was handled, this will stop the message propagation.\n */\n onDeviceMessage?(message: DeviceRequest | DeviceResponse, info: ExpoDebuggerInfo): boolean;\n\n /**\n * Intercept a message coming from the debugger, modify or respond to it through `socket.send`.\n * Return `true` if the message was handled, this will stop the message propagation.\n */\n onDebuggerMessage?(message: DebuggerRequest, info: ExpoDebuggerInfo): boolean;\n}\n\n/**\n * The outline of a basic Chrome DevTools Protocol request, either from device or debugger.\n * Both the request and response parameters could be optional, use `never` to enforce these fields.\n */\nexport type CdpMessage<\n Method extends string = string,\n Request extends object = object,\n Response extends object = object,\n> = {\n id: number;\n method: Method;\n params: Request;\n result: Response;\n};\n\nexport type DeviceRequest<M extends CdpMessage = CdpMessage> = Pick<M, 'method' | 'params'>;\nexport type DeviceResponse<M extends CdpMessage = CdpMessage> = Pick<M, 'id' | 'result'>;\n\nexport type DebuggerRequest<M extends CdpMessage = CdpMessage> = Pick<\n M,\n 'id' | 'method' | 'params'\n>;\nexport type DebuggerResponse<M extends CdpMessage = CdpMessage> = Pick<M, 'result'>;\n"],"names":[],"mappings":"AAAA"}
@@ -1,27 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "ExpoInspectorProxy", {
6
- enumerable: true,
7
- get: function() {
8
- return _proxy.ExpoInspectorProxy;
9
- }
10
- });
11
- exports.createInspectorProxy = createInspectorProxy;
12
- var _device = require("./device");
13
- var _proxy = require("./proxy");
14
- var _resolveFromProject = require("../resolveFromProject");
15
- const debug = require("debug")("expo:metro:inspector-proxy");
16
- function createInspectorProxy(metroBundler, projectRoot) {
17
- debug("Expo inspector proxy enabled");
18
- // Import the installed `metro-inspector-proxy` from the project
19
- // We use these base classes to extend functionality
20
- const { InspectorProxy: MetroInspectorProxy } = (0, _resolveFromProject).importMetroInspectorProxyFromProject(projectRoot);
21
- // The device is slightly more complicated, we need to extend that class
22
- const ExpoInspectorDevice = (0, _device).createInspectorDeviceClass(metroBundler, (0, _resolveFromProject).importMetroInspectorDeviceFromProject(projectRoot));
23
- const inspectorProxy = new _proxy.ExpoInspectorProxy(new MetroInspectorProxy(projectRoot), ExpoInspectorDevice);
24
- return inspectorProxy;
25
- }
26
-
27
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../src/start/server/metro/inspector-proxy/index.ts"],"sourcesContent":["import { createInspectorDeviceClass } from './device';\nimport { ExpoInspectorProxy } from './proxy';\nimport { MetroBundlerDevServer } from '../MetroBundlerDevServer';\nimport {\n importMetroInspectorDeviceFromProject,\n importMetroInspectorProxyFromProject,\n} from '../resolveFromProject';\n\nexport { ExpoInspectorProxy } from './proxy';\n\nconst debug = require('debug')('expo:metro:inspector-proxy') as typeof console.log;\n\nexport function createInspectorProxy(metroBundler: MetroBundlerDevServer, projectRoot: string) {\n debug('Expo inspector proxy enabled');\n\n // Import the installed `metro-inspector-proxy` from the project\n // We use these base classes to extend functionality\n const { InspectorProxy: MetroInspectorProxy } = importMetroInspectorProxyFromProject(projectRoot);\n // The device is slightly more complicated, we need to extend that class\n const ExpoInspectorDevice = createInspectorDeviceClass(\n metroBundler,\n importMetroInspectorDeviceFromProject(projectRoot)\n );\n\n const inspectorProxy = new ExpoInspectorProxy(\n new MetroInspectorProxy(projectRoot),\n ExpoInspectorDevice\n );\n\n return inspectorProxy;\n}\n"],"names":["ExpoInspectorProxy","createInspectorProxy","debug","require","metroBundler","projectRoot","InspectorProxy","MetroInspectorProxy","importMetroInspectorProxyFromProject","ExpoInspectorDevice","createInspectorDeviceClass","importMetroInspectorDeviceFromProject","inspectorProxy"],"mappings":"AAAA;;;;+BAQSA,oBAAkB;;;eAPQ,MAAS,CAOnCA,kBAAkB;;;QAIXC,oBAAoB,GAApBA,oBAAoB;AAZO,IAAA,OAAU,WAAV,UAAU,CAAA;AAClB,IAAA,MAAS,WAAT,SAAS,CAAA;AAKrC,IAAA,mBAAuB,WAAvB,uBAAuB,CAAA;AAI9B,MAAMC,KAAK,GAAGC,OAAO,CAAC,OAAO,CAAC,CAAC,4BAA4B,CAAC,AAAsB,AAAC;AAE5E,SAASF,oBAAoB,CAACG,YAAmC,EAAEC,WAAmB,EAAE;IAC7FH,KAAK,CAAC,8BAA8B,CAAC,CAAC;IAEtC,gEAAgE;IAChE,oDAAoD;IACpD,MAAM,EAAEI,cAAc,EAAEC,mBAAmB,CAAA,EAAE,GAAGC,CAAAA,GAAAA,mBAAoC,AAAa,CAAA,qCAAb,CAACH,WAAW,CAAC,AAAC;IAClG,wEAAwE;IACxE,MAAMI,mBAAmB,GAAGC,CAAAA,GAAAA,OAA0B,AAGrD,CAAA,2BAHqD,CACpDN,YAAY,EACZO,CAAAA,GAAAA,mBAAqC,AAAa,CAAA,sCAAb,CAACN,WAAW,CAAC,CACnD,AAAC;IAEF,MAAMO,cAAc,GAAG,IAAIZ,MAAkB,mBAAA,CAC3C,IAAIO,mBAAmB,CAACF,WAAW,CAAC,EACpCI,mBAAmB,CACpB,AAAC;IAEF,OAAOG,cAAc,CAAC;CACvB"}
@@ -1,169 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- var _url = require("url");
6
- var _ws = _interopRequireDefault(require("ws"));
7
- var _log = require("../../../../log");
8
- function _interopRequireDefault(obj) {
9
- return obj && obj.__esModule ? obj : {
10
- default: obj
11
- };
12
- }
13
- const WS_DEVICE_URL = "/inspector/device";
14
- const WS_DEBUGGER_URL = "/inspector/debug";
15
- const WS_GENERIC_ERROR_STATUS = 1011;
16
- const debug = require("debug")("expo:metro:inspector-proxy:proxy");
17
- class ExpoInspectorProxy {
18
- constructor(metroProxy, DeviceClass, devices = new Map()){
19
- this.metroProxy = metroProxy;
20
- this.DeviceClass = DeviceClass;
21
- this.devices = devices;
22
- // monkey-patch the device list to expose it within the metro inspector
23
- // See https://github.com/facebook/metro/pull/991
24
- // @ts-expect-error - Device ID is changing from `number` to `string`
25
- this.metroProxy._devices = this.devices;
26
- // force httpEndpointMiddleware to be bound to this proxy instance
27
- this.processRequest = this.processRequest.bind(this);
28
- }
29
- /**
30
- * Normalize the server address for clients to connect to.
31
- * @param addressInfo the server address returned by `HttpServer.address()` or `HttpsServer.address()`.
32
- * @returns "address:port"
33
- */ static normalizeServerAddress(addressInfo) {
34
- if (typeof addressInfo === "string") {
35
- throw new Error(`Inspector proxy could not resolve the server address, got "${addressInfo}"`);
36
- } else if (addressInfo === null) {
37
- throw new Error(`Inspector proxy could not resolve the server address, got "null"`);
38
- }
39
- let address = addressInfo.address;
40
- if (addressInfo.family === "IPv6") {
41
- address = address === "::" ? `[::1]` : `[${address}]`;
42
- } else {
43
- address = address === "0.0.0.0" ? "localhost" : address;
44
- }
45
- return `${address}:${addressInfo.port}`;
46
- }
47
- /** @see https://chromedevtools.github.io/devtools-protocol/#endpoints */ processRequest(req, res, next) {
48
- this.metroProxy.processRequest(req, res, next);
49
- }
50
- createWebSocketListeners(server) {
51
- // Initialize the server address from the metro server.
52
- // This is required to properly reference sourcemaps for the debugger.
53
- this.metroProxy._serverAddressWithPort = ExpoInspectorProxy.normalizeServerAddress(server.address());
54
- return {
55
- [WS_DEVICE_URL]: this.createDeviceWebSocketServer(),
56
- [WS_DEBUGGER_URL]: this.createDebuggerWebSocketServer()
57
- };
58
- }
59
- createDeviceWebSocketServer() {
60
- const wss = new _ws.default.Server({
61
- noServer: true,
62
- perMessageDeflate: false
63
- });
64
- // See: https://github.com/facebook/metro/blob/eeb211fdcfdcb9e7f8a51721bd0f48bc7d0d211f/packages/metro-inspector-proxy/src/InspectorProxy.js#L157
65
- wss.on("connection", (socket, request)=>{
66
- try {
67
- const fallbackDeviceId = String(this.metroProxy._deviceCounter++);
68
- const { deviceId: newDeviceId , deviceName , appName } = getDeviceInfo(request.url);
69
- const deviceId = newDeviceId != null ? newDeviceId : fallbackDeviceId;
70
- const oldDevice = this.devices.get(deviceId);
71
- const newDevice = new this.DeviceClass(deviceId, deviceName, appName, socket, this.metroProxy._projectRoot);
72
- if (oldDevice) {
73
- debug("Device reconnected: device=%s, app=%s, id=%s", deviceName, appName, deviceId);
74
- // See: https://github.com/facebook/metro/pull/991
75
- // @ts-expect-error - Newly introduced method coming to metro-inspector-proxy soon
76
- oldDevice.handleDuplicateDeviceConnection(newDevice);
77
- } else {
78
- debug("New device connected: device=%s, app=%s, id=%s", deviceName, appName, deviceId);
79
- }
80
- this.devices.set(deviceId, newDevice);
81
- socket.on("close", ()=>{
82
- if (this.devices.get(deviceId) === newDevice) {
83
- this.devices.delete(deviceId);
84
- debug("Device disconnected: device=%s, app=%s, id=%s", deviceName, appName, deviceId);
85
- }
86
- });
87
- } catch (error) {
88
- let message = "";
89
- debug("Could not establish a connection to on-device debugger:", error);
90
- if (error instanceof Error) {
91
- message = error.toString();
92
- _log.Log.error("Failed to create a socket connection to on-device debugger (Hermes engine).");
93
- _log.Log.exception(error);
94
- } else {
95
- _log.Log.error("Failed to create a socket connection to on-device debugger (Hermes engine), unknown error.");
96
- }
97
- socket.close(WS_GENERIC_ERROR_STATUS, message || "Unknown error");
98
- }
99
- });
100
- return wss;
101
- }
102
- createDebuggerWebSocketServer() {
103
- const wss = new _ws.default.Server({
104
- noServer: true,
105
- perMessageDeflate: false
106
- });
107
- // See: https://github.com/facebook/metro/blob/eeb211fdcfdcb9e7f8a51721bd0f48bc7d0d211f/packages/metro-inspector-proxy/src/InspectorProxy.js#L193
108
- wss.on("connection", (socket, request)=>{
109
- try {
110
- const { deviceId , pageId , debuggerType } = getDebuggerInfo(request.url);
111
- if (!deviceId || !pageId) {
112
- // TODO(cedric): change these errors to proper error types
113
- throw new Error(`Missing "device" and/or "page" IDs in query parameters`);
114
- }
115
- const device = this.devices.get(deviceId);
116
- if (!device) {
117
- // TODO(cedric): change these errors to proper error types
118
- throw new Error(`Device with ID "${deviceId}" not found.`);
119
- }
120
- debug("New debugger connected: device=%s, app=%s", device._name, device._app);
121
- // @ts-expect-error The `handleDebuggerConnectionWithType` is part of our device implementation, not Metro's device
122
- if (debuggerType && typeof device.handleDebuggerConnectionWithType === "function") {
123
- // @ts-expect-error The `handleDebuggerConnectionWithType` is part of our device implementation, not Metro's device
124
- device.handleDebuggerConnectionWithType(socket, pageId, debuggerType);
125
- } else {
126
- device.handleDebuggerConnection(socket, pageId);
127
- }
128
- socket.on("close", ()=>{
129
- debug("Debugger disconnected: device=%s, app=%s", device._name, device._app);
130
- });
131
- } catch (error) {
132
- let message = "";
133
- debug("Could not establish a connection to debugger:", error);
134
- if (error instanceof Error) {
135
- message = error.toString();
136
- _log.Log.error("Failed to create a socket connection to the debugger.");
137
- _log.Log.exception(error);
138
- } else {
139
- _log.Log.error("Failed to create a socket connection to the debugger, unkown error.");
140
- }
141
- socket.close(WS_GENERIC_ERROR_STATUS, message || "Unknown error");
142
- }
143
- });
144
- return wss;
145
- }
146
- }
147
- exports.ExpoInspectorProxy = ExpoInspectorProxy;
148
- function asString(value = "") {
149
- return Array.isArray(value) ? value.join() : value;
150
- }
151
- function getDeviceInfo(url) {
152
- const { query } = (0, _url).parse(url != null ? url : "", true);
153
- return {
154
- deviceId: asString(query.device) || undefined,
155
- deviceName: asString(query.name) || "Unknown device name",
156
- appName: asString(query.app) || "Unknown app name"
157
- };
158
- }
159
- function getDebuggerInfo(url) {
160
- const { query } = (0, _url).parse(url != null ? url : "", true);
161
- var ref;
162
- return {
163
- deviceId: asString(query.device),
164
- pageId: asString(query.page),
165
- debuggerType: (ref = asString(query.type)) != null ? ref : undefined
166
- };
167
- }
168
-
169
- //# sourceMappingURL=proxy.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../src/start/server/metro/inspector-proxy/proxy.ts"],"sourcesContent":["import type { Server as HttpServer, IncomingMessage, ServerResponse } from 'http';\nimport type { Server as HttpsServer } from 'https';\nimport type { InspectorProxy as MetroProxy, Device as MetroDevice } from 'metro-inspector-proxy';\nimport { parse } from 'url';\nimport WS, { Server as WSServer } from 'ws';\n\nimport { Log } from '../../../../log';\n\nconst WS_DEVICE_URL = '/inspector/device';\nconst WS_DEBUGGER_URL = '/inspector/debug';\nconst WS_GENERIC_ERROR_STATUS = 1011;\n\nconst debug = require('debug')('expo:metro:inspector-proxy:proxy') as typeof console.log;\n\n// This is a workaround for `ConstructorType` not working on dynamically generated classes\ntype Instantiatable<Instance> = new (...args: any) => Instance;\n\nexport class ExpoInspectorProxy<D extends MetroDevice = MetroDevice> {\n constructor(\n public readonly metroProxy: MetroProxy,\n private DeviceClass: Instantiatable<D>,\n public readonly devices: Map<string, D> = new Map()\n ) {\n // monkey-patch the device list to expose it within the metro inspector\n // See https://github.com/facebook/metro/pull/991\n // @ts-expect-error - Device ID is changing from `number` to `string`\n this.metroProxy._devices = this.devices;\n\n // force httpEndpointMiddleware to be bound to this proxy instance\n this.processRequest = this.processRequest.bind(this);\n }\n\n /**\n * Normalize the server address for clients to connect to.\n * @param addressInfo the server address returned by `HttpServer.address()` or `HttpsServer.address()`.\n * @returns \"address:port\"\n */\n public static normalizeServerAddress(addressInfo: ReturnType<HttpServer['address']>): string {\n if (typeof addressInfo === 'string') {\n throw new Error(`Inspector proxy could not resolve the server address, got \"${addressInfo}\"`);\n } else if (addressInfo === null) {\n throw new Error(`Inspector proxy could not resolve the server address, got \"null\"`);\n }\n\n let address = addressInfo.address;\n if (addressInfo.family === 'IPv6') {\n address = address === '::' ? `[::1]` : `[${address}]`;\n } else {\n address = address === '0.0.0.0' ? 'localhost' : address;\n }\n return `${address}:${addressInfo.port}`;\n }\n\n /** @see https://chromedevtools.github.io/devtools-protocol/#endpoints */\n public processRequest(req: IncomingMessage, res: ServerResponse, next: (error?: Error) => any) {\n this.metroProxy.processRequest(req, res, next);\n }\n\n public createWebSocketListeners(server: HttpServer | HttpsServer): Record<string, WSServer> {\n // Initialize the server address from the metro server.\n // This is required to properly reference sourcemaps for the debugger.\n this.metroProxy._serverAddressWithPort = ExpoInspectorProxy.normalizeServerAddress(\n server.address()\n );\n\n return {\n [WS_DEVICE_URL]: this.createDeviceWebSocketServer(),\n [WS_DEBUGGER_URL]: this.createDebuggerWebSocketServer(),\n };\n }\n\n private createDeviceWebSocketServer() {\n const wss = new WS.Server({\n noServer: true,\n perMessageDeflate: false,\n });\n\n // See: https://github.com/facebook/metro/blob/eeb211fdcfdcb9e7f8a51721bd0f48bc7d0d211f/packages/metro-inspector-proxy/src/InspectorProxy.js#L157\n wss.on('connection', (socket, request) => {\n try {\n const fallbackDeviceId = String(this.metroProxy._deviceCounter++);\n const { deviceId: newDeviceId, deviceName, appName } = getDeviceInfo(request.url);\n\n const deviceId = newDeviceId ?? fallbackDeviceId;\n\n const oldDevice = this.devices.get(deviceId);\n const newDevice = new this.DeviceClass(\n deviceId,\n deviceName,\n appName,\n socket,\n this.metroProxy._projectRoot\n );\n\n if (oldDevice) {\n debug('Device reconnected: device=%s, app=%s, id=%s', deviceName, appName, deviceId);\n // See: https://github.com/facebook/metro/pull/991\n // @ts-expect-error - Newly introduced method coming to metro-inspector-proxy soon\n oldDevice.handleDuplicateDeviceConnection(newDevice);\n } else {\n debug('New device connected: device=%s, app=%s, id=%s', deviceName, appName, deviceId);\n }\n\n this.devices.set(deviceId, newDevice);\n\n socket.on('close', () => {\n if (this.devices.get(deviceId) === newDevice) {\n this.devices.delete(deviceId);\n debug('Device disconnected: device=%s, app=%s, id=%s', deviceName, appName, deviceId);\n }\n });\n } catch (error: unknown) {\n let message = '';\n\n debug('Could not establish a connection to on-device debugger:', error);\n\n if (error instanceof Error) {\n message = error.toString();\n Log.error('Failed to create a socket connection to on-device debugger (Hermes engine).');\n Log.exception(error);\n } else {\n Log.error(\n 'Failed to create a socket connection to on-device debugger (Hermes engine), unknown error.'\n );\n }\n\n socket.close(WS_GENERIC_ERROR_STATUS, message || 'Unknown error');\n }\n });\n\n return wss;\n }\n\n private createDebuggerWebSocketServer() {\n const wss = new WS.Server({\n noServer: true,\n perMessageDeflate: false,\n });\n\n // See: https://github.com/facebook/metro/blob/eeb211fdcfdcb9e7f8a51721bd0f48bc7d0d211f/packages/metro-inspector-proxy/src/InspectorProxy.js#L193\n wss.on('connection', (socket, request) => {\n try {\n const { deviceId, pageId, debuggerType } = getDebuggerInfo(request.url);\n if (!deviceId || !pageId) {\n // TODO(cedric): change these errors to proper error types\n throw new Error(`Missing \"device\" and/or \"page\" IDs in query parameters`);\n }\n\n const device = this.devices.get(deviceId);\n if (!device) {\n // TODO(cedric): change these errors to proper error types\n throw new Error(`Device with ID \"${deviceId}\" not found.`);\n }\n\n debug('New debugger connected: device=%s, app=%s', device._name, device._app);\n\n // @ts-expect-error The `handleDebuggerConnectionWithType` is part of our device implementation, not Metro's device\n if (debuggerType && typeof device.handleDebuggerConnectionWithType === 'function') {\n // @ts-expect-error The `handleDebuggerConnectionWithType` is part of our device implementation, not Metro's device\n device.handleDebuggerConnectionWithType(socket, pageId, debuggerType);\n } else {\n device.handleDebuggerConnection(socket, pageId);\n }\n\n socket.on('close', () => {\n debug('Debugger disconnected: device=%s, app=%s', device._name, device._app);\n });\n } catch (error: unknown) {\n let message = '';\n\n debug('Could not establish a connection to debugger:', error);\n\n if (error instanceof Error) {\n message = error.toString();\n Log.error('Failed to create a socket connection to the debugger.');\n Log.exception(error);\n } else {\n Log.error('Failed to create a socket connection to the debugger, unkown error.');\n }\n\n socket.close(WS_GENERIC_ERROR_STATUS, message || 'Unknown error');\n }\n });\n\n return wss;\n }\n}\n\nfunction asString(value: string | string[] = ''): string {\n return Array.isArray(value) ? value.join() : value;\n}\n\nfunction getDeviceInfo(url: IncomingMessage['url']) {\n const { query } = parse(url ?? '', true);\n return {\n deviceId: asString(query.device) || undefined,\n deviceName: asString(query.name) || 'Unknown device name',\n appName: asString(query.app) || 'Unknown app name',\n };\n}\n\nfunction getDebuggerInfo(url: IncomingMessage['url']) {\n const { query } = parse(url ?? '', true);\n return {\n deviceId: asString(query.device),\n pageId: asString(query.page),\n debuggerType: asString(query.type) ?? undefined,\n };\n}\n"],"names":["WS_DEVICE_URL","WS_DEBUGGER_URL","WS_GENERIC_ERROR_STATUS","debug","require","ExpoInspectorProxy","constructor","metroProxy","DeviceClass","devices","Map","_devices","processRequest","bind","normalizeServerAddress","addressInfo","Error","address","family","port","req","res","next","createWebSocketListeners","server","_serverAddressWithPort","createDeviceWebSocketServer","createDebuggerWebSocketServer","wss","WS","Server","noServer","perMessageDeflate","on","socket","request","fallbackDeviceId","String","_deviceCounter","deviceId","newDeviceId","deviceName","appName","getDeviceInfo","url","oldDevice","get","newDevice","_projectRoot","handleDuplicateDeviceConnection","set","delete","error","message","toString","Log","exception","close","pageId","debuggerType","getDebuggerInfo","device","_name","_app","handleDebuggerConnectionWithType","handleDebuggerConnection","asString","value","Array","isArray","join","query","parse","undefined","name","app","page","type"],"mappings":"AAAA;;;;AAGsB,IAAA,IAAK,WAAL,KAAK,CAAA;AACY,IAAA,GAAI,kCAAJ,IAAI,EAAA;AAEvB,IAAA,IAAiB,WAAjB,iBAAiB,CAAA;;;;;;AAErC,MAAMA,aAAa,GAAG,mBAAmB,AAAC;AAC1C,MAAMC,eAAe,GAAG,kBAAkB,AAAC;AAC3C,MAAMC,uBAAuB,GAAG,IAAI,AAAC;AAErC,MAAMC,KAAK,GAAGC,OAAO,CAAC,OAAO,CAAC,CAAC,kCAAkC,CAAC,AAAsB,AAAC;AAKlF,MAAMC,kBAAkB;IAC7BC,YACkBC,UAAsB,EAC9BC,WAA8B,EACtBC,OAAuB,GAAG,IAAIC,GAAG,EAAE,CACnD;aAHgBH,UAAsB,GAAtBA,UAAsB;aAC9BC,WAA8B,GAA9BA,WAA8B;aACtBC,OAAuB,GAAvBA,OAAuB;QAEvC,uEAAuE;QACvE,iDAAiD;QACjD,qEAAqE;QACrE,IAAI,CAACF,UAAU,CAACI,QAAQ,GAAG,IAAI,CAACF,OAAO,CAAC;QAExC,kEAAkE;QAClE,IAAI,CAACG,cAAc,GAAG,IAAI,CAACA,cAAc,CAACC,IAAI,CAAC,IAAI,CAAC,CAAC;KACtD;IAED;;;;KAIG,CACH,OAAcC,sBAAsB,CAACC,WAA8C,EAAU;QAC3F,IAAI,OAAOA,WAAW,KAAK,QAAQ,EAAE;YACnC,MAAM,IAAIC,KAAK,CAAC,CAAC,2DAA2D,EAAED,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;SAC/F,MAAM,IAAIA,WAAW,KAAK,IAAI,EA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,GAAlBA,kBAAkB;AA2K/B,SAAS6D,QAAQ,CAACC,KAAwB,GAAG,EAAE,EAAU;IACvD,OAAOC,KAAK,CAACC,OAAO,CAACF,KAAK,CAAC,GAAGA,KAAK,CAACG,IAAI,EAAE,GAAGH,KAAK,CAAC;CACpD;AAED,SAASxB,aAAa,CAACC,GAA2B,EAAE;IAClD,MAAM,EAAE2B,KAAK,CAAA,EAAE,GAAGC,CAAAA,GAAAA,IAAK,AAAiB,CAAA,MAAjB,CAAC5B,GAAG,WAAHA,GAAG,GAAI,EAAE,EAAE,IAAI,CAAC,AAAC;IACzC,OAAO;QACLL,QAAQ,EAAE2B,QAAQ,CAACK,KAAK,CAACV,MAAM,CAAC,IAAIY,SAAS;QAC7ChC,UAAU,EAAEyB,QAAQ,CAACK,KAAK,CAACG,IAAI,CAAC,IAAI,qBAAqB;QACzDhC,OAAO,EAAEwB,QAAQ,CAACK,KAAK,CAACI,GAAG,CAAC,IAAI,kBAAkB;KACnD,CAAC;CACH;AAED,SAASf,eAAe,CAAChB,GAA2B,EAAE;IACpD,MAAM,EAAE2B,KAAK,CAAA,EAAE,GAAGC,CAAAA,GAAAA,IAAK,AAAiB,CAAA,MAAjB,CAAC5B,GAAG,WAAHA,GAAG,GAAI,EAAE,EAAE,IAAI,CAAC,AAAC;QAIzBsB,GAAoB;IAHpC,OAAO;QACL3B,QAAQ,EAAE2B,QAAQ,CAACK,KAAK,CAACV,MAAM,CAAC;QAChCH,MAAM,EAAEQ,QAAQ,CAACK,KAAK,CAACK,IAAI,CAAC;QAC5BjB,YAAY,EAAEO,CAAAA,GAAoB,GAApBA,QAAQ,CAACK,KAAK,CAACM,IAAI,CAAC,YAApBX,GAAoB,GAAIO,SAAS;KAChD,CAAC;CACH"}
@@ -1,90 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- exports.importCliServerApiFromProject = importCliServerApiFromProject;
6
- exports.importMetroSourceMapComposeSourceMapsFromProject = importMetroSourceMapComposeSourceMapsFromProject;
7
- exports.resolveFromProject = resolveFromProject;
8
- exports.importMetroFromProject = importMetroFromProject;
9
- exports.importMetroServerFromProject = importMetroServerFromProject;
10
- exports.importMetroCreateWebsocketServerFromProject = importMetroCreateWebsocketServerFromProject;
11
- exports.importMetroHmrServerFromProject = importMetroHmrServerFromProject;
12
- exports.importExpoMetroConfig = importExpoMetroConfig;
13
- exports.importFromProjectOrFallback = importFromProjectOrFallback;
14
- exports.importMetroResolverFromProject = importMetroResolverFromProject;
15
- exports.importMetroInspectorProxyFromProject = importMetroInspectorProxyFromProject;
16
- exports.importMetroInspectorDeviceFromProject = importMetroInspectorDeviceFromProject;
17
- exports.importCliSaveAssetsFromProject = importCliSaveAssetsFromProject;
18
- exports.resolveMetroVersionFromProject = resolveMetroVersionFromProject;
19
- var _resolveFrom = _interopRequireDefault(require("resolve-from"));
20
- function _interopRequireDefault(obj) {
21
- return obj && obj.__esModule ? obj : {
22
- default: obj
23
- };
24
- }
25
- const debug = require("debug")("expo:metro:import");
26
- // These resolvers enable us to test the CLI in older projects.
27
- // We may be able to get rid of this in the future.
28
- // TODO: Maybe combine with AsyncResolver?
29
- class MetroImportError extends Error {
30
- constructor(projectRoot, moduleId){
31
- super(`Missing package "${moduleId}" in the project at: ${projectRoot}\n` + 'This usually means "react-native" is not installed. ' + 'Please verify that dependencies in package.json include "react-native" ' + "and run `yarn` or `npm install`.");
32
- }
33
- }
34
- function importCliServerApiFromProject(projectRoot) {
35
- return importFromProject(projectRoot, "@react-native-community/cli-server-api");
36
- }
37
- function importMetroSourceMapComposeSourceMapsFromProject(projectRoot) {
38
- return importFromProject(projectRoot, "metro-source-map/src/composeSourceMaps");
39
- }
40
- function resolveFromProject(projectRoot, moduleId) {
41
- const resolvedPath = _resolveFrom.default.silent(projectRoot, moduleId);
42
- if (!resolvedPath) {
43
- throw new MetroImportError(projectRoot, moduleId);
44
- }
45
- return resolvedPath;
46
- }
47
- function importFromProject(projectRoot, moduleId) {
48
- return require(resolveFromProject(projectRoot, moduleId));
49
- }
50
- function importMetroFromProject(projectRoot) {
51
- return importFromProject(projectRoot, "metro");
52
- }
53
- function importMetroServerFromProject(projectRoot) {
54
- return importFromProject(projectRoot, "metro/src/Server");
55
- }
56
- function importMetroCreateWebsocketServerFromProject(projectRoot) {
57
- return importFromProject(projectRoot, "metro/src/lib/createWebsocketServer");
58
- }
59
- function importMetroHmrServerFromProject(projectRoot) {
60
- return importFromProject(projectRoot, "metro/src/HmrServer");
61
- }
62
- function importExpoMetroConfig(projectRoot) {
63
- return importFromProjectOrFallback(projectRoot, "@expo/metro-config");
64
- }
65
- function importFromProjectOrFallback(projectRoot, moduleId) {
66
- const resolvedPath = _resolveFrom.default.silent(projectRoot, moduleId);
67
- if (!resolvedPath) {
68
- debug(`requiring "${moduleId}" relative to the CLI`);
69
- return require(require.resolve(moduleId));
70
- }
71
- debug(`requiring "${moduleId}" from the project:`, resolvedPath);
72
- return require(resolvedPath);
73
- }
74
- function importMetroResolverFromProject(projectRoot) {
75
- return importFromProject(projectRoot, "metro-resolver");
76
- }
77
- function importMetroInspectorProxyFromProject(projectRoot) {
78
- return importFromProject(projectRoot, "metro-inspector-proxy");
79
- }
80
- function importMetroInspectorDeviceFromProject(projectRoot) {
81
- return importFromProject(projectRoot, "metro-inspector-proxy/src/Device");
82
- }
83
- function importCliSaveAssetsFromProject(projectRoot) {
84
- return importFromProject(projectRoot, "@react-native-community/cli-plugin-metro/build/commands/bundle/saveAssets").default;
85
- }
86
- function resolveMetroVersionFromProject(projectRoot) {
87
- return importFromProject(projectRoot, "metro/package.json").version;
88
- }
89
-
90
- //# sourceMappingURL=resolveFromProject.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../src/start/server/metro/resolveFromProject.ts"],"sourcesContent":["import resolveFrom from 'resolve-from';\n\nconst debug = require('debug')('expo:metro:import');\n\n// These resolvers enable us to test the CLI in older projects.\n// We may be able to get rid of this in the future.\n// TODO: Maybe combine with AsyncResolver?\nclass MetroImportError extends Error {\n constructor(projectRoot: string, moduleId: string) {\n super(\n `Missing package \"${moduleId}\" in the project at: ${projectRoot}\\n` +\n 'This usually means \"react-native\" is not installed. ' +\n 'Please verify that dependencies in package.json include \"react-native\" ' +\n 'and run `yarn` or `npm install`.'\n );\n }\n}\n\nexport function importCliServerApiFromProject(\n projectRoot: string\n): typeof import('@react-native-community/cli-server-api') {\n return importFromProject(projectRoot, '@react-native-community/cli-server-api');\n}\n\nexport function importMetroSourceMapComposeSourceMapsFromProject(\n projectRoot: string\n): typeof import('metro-source-map').composeSourceMaps {\n return importFromProject(projectRoot, 'metro-source-map/src/composeSourceMaps');\n}\n\nexport function resolveFromProject(projectRoot: string, moduleId: string) {\n const resolvedPath = resolveFrom.silent(projectRoot, moduleId);\n if (!resolvedPath) {\n throw new MetroImportError(projectRoot, moduleId);\n }\n return resolvedPath;\n}\n\nfunction importFromProject(projectRoot: string, moduleId: string) {\n return require(resolveFromProject(projectRoot, moduleId));\n}\n\n/** Import `metro` from the project. */\nexport function importMetroFromProject(projectRoot: string): typeof import('metro') {\n return importFromProject(projectRoot, 'metro');\n}\nexport function importMetroServerFromProject(projectRoot: string): typeof import('metro').Server {\n return importFromProject(projectRoot, 'metro/src/Server');\n}\nexport function importMetroCreateWebsocketServerFromProject(\n projectRoot: string\n): typeof import('metro/src/lib/createWebsocketServer').createWebsocketServer {\n return importFromProject(projectRoot, 'metro/src/lib/createWebsocketServer');\n}\nexport function importMetroHmrServerFromProject(\n projectRoot: string\n): typeof import('metro/src/HmrServer').MetroHmrServer {\n return importFromProject(projectRoot, 'metro/src/HmrServer');\n}\n\nexport function importExpoMetroConfig(projectRoot: string) {\n return importFromProjectOrFallback<typeof import('@expo/metro-config')>(\n projectRoot,\n '@expo/metro-config'\n );\n}\n\n/**\n * Attempt to use the local version of a module or fallback on the CLI version.\n * This should only ever happen when testing Expo CLI in development.\n */\nexport function importFromProjectOrFallback<TModule>(\n projectRoot: string,\n moduleId: string\n): TModule {\n const resolvedPath = resolveFrom.silent(projectRoot, moduleId);\n if (!resolvedPath) {\n debug(`requiring \"${moduleId}\" relative to the CLI`);\n return require(require.resolve(moduleId));\n }\n debug(`requiring \"${moduleId}\" from the project:`, resolvedPath);\n return require(resolvedPath);\n}\n\n/** Import `metro-resolver` from the project. */\nexport function importMetroResolverFromProject(\n projectRoot: string\n): typeof import('metro-resolver') {\n return importFromProject(projectRoot, 'metro-resolver');\n}\n\n/** Import `metro-inspector-proxy` from the project. */\nexport function importMetroInspectorProxyFromProject(\n projectRoot: string\n): typeof import('metro-inspector-proxy') {\n return importFromProject(projectRoot, 'metro-inspector-proxy');\n}\n\n/** Import `metro-inspector-proxy/src/Device` from the project. */\nexport function importMetroInspectorDeviceFromProject(\n projectRoot: string\n): typeof import('metro-inspector-proxy/src/Device') {\n return importFromProject(projectRoot, 'metro-inspector-proxy/src/Device');\n}\n\n/**\n * Import the internal `saveAssets()` function from `react-native` for the purpose\n * of saving production assets as-is instead of converting them to a hash.\n */\nexport function importCliSaveAssetsFromProject(\n projectRoot: string\n): typeof import('@react-native-community/cli-plugin-metro/build/commands/bundle/saveAssets').default {\n return importFromProject(\n projectRoot,\n '@react-native-community/cli-plugin-metro/build/commands/bundle/saveAssets'\n ).default;\n}\n\n/** Resolve the installed Metro version from project */\nexport function resolveMetroVersionFromProject(projectRoot: string): string {\n return importFromProject(projectRoot, 'metro/package.json').version;\n}\n"],"names":["importCliServerApiFromProject","importMetroSourceMapComposeSourceMapsFromProject","resolveFromProject","importMetroFromProject","importMetroServerFromProject","importMetroCreateWebsocketServerFromProject","importMetroHmrServerFromProject","importExpoMetroConfig","importFromProjectOrFallback","importMetroResolverFromProject","importMetroInspectorProxyFromProject","importMetroInspectorDeviceFromProject","importCliSaveAssetsFromProject","resolveMetroVersionFromProject","debug","require","MetroImportError","Error","constructor","projectRoot","moduleId","importFromProject","resolvedPath","resolveFrom","silent","resolve","default","version"],"mappings":"AAAA;;;;QAkBgBA,6BAA6B,GAA7B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