@expo/cli 0.19.1 → 0.19.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/bin/cli CHANGED
@@ -120,7 +120,7 @@ const args = (0, _arg().default)({
120
120
  });
121
121
  if (args["--version"]) {
122
122
  // Version is added in the build script.
123
- console.log("0.19.1");
123
+ console.log("0.19.2");
124
124
  process.exit(0);
125
125
  }
126
126
  if (args["--non-interactive"]) {
@@ -13,14 +13,23 @@ function _chalk() {
13
13
  };
14
14
  return data;
15
15
  }
16
+ function _ws() {
17
+ const data = require("ws");
18
+ _ws = function() {
19
+ return data;
20
+ };
21
+ return data;
22
+ }
16
23
  const _createHandlersFactory = require("./createHandlersFactory");
17
24
  const _log = require("../../../../log");
18
25
  const _env = require("../../../../utils/env");
26
+ const _networkResponse = require("./messageHandlers/NetworkResponse");
19
27
  function _interopRequireDefault(obj) {
20
28
  return obj && obj.__esModule ? obj : {
21
29
  default: obj
22
30
  };
23
31
  }
32
+ const debug = require("debug")("expo:metro:debugging:middleware");
24
33
  function createDebugMiddleware(metroBundler) {
25
34
  // Load the React Native debugging tools from project
26
35
  // TODO: check if this works with isolated modules
@@ -32,7 +41,7 @@ function createDebugMiddleware(metroBundler) {
32
41
  hostType: "lan"
33
42
  }),
34
43
  logger: createLogger(_chalk().default.bold("Debug:")),
35
- unstable_customInspectorMessageHandler: (0, _createHandlersFactory.createHandlersFactory)(metroBundler),
44
+ unstable_customInspectorMessageHandler: (0, _createHandlersFactory.createHandlersFactory)(),
36
45
  unstable_experiments: {
37
46
  // Enable the Network tab in React Native DevTools
38
47
  enableNetworkInspector: true,
@@ -41,6 +50,8 @@ function createDebugMiddleware(metroBundler) {
41
50
  enableOpenDebuggerRedirect: _env.env.EXPO_DEBUG
42
51
  }
43
52
  });
53
+ // NOTE(cedric): add a temporary websocket to handle Network-related CDP events
54
+ websocketEndpoints["/inspector/network"] = createNetworkWebsocket(websocketEndpoints["/inspector/debug"]);
44
55
  return {
45
56
  debugMiddleware: middleware,
46
57
  debugWebsocketEndpoints: websocketEndpoints
@@ -53,5 +64,42 @@ function createLogger(logPrefix) {
53
64
  error: (...args)=>_log.Log.error(logPrefix, ...args)
54
65
  };
55
66
  }
67
+ /**
68
+ * This adds a dedicated websocket connection that handles Network-related CDP events.
69
+ * It's a temporary solution until Fusebox either implements the Network CDP domain,
70
+ * or allows external domain agents that can send messages over the CDP socket to the debugger.
71
+ * The Network websocket rebroadcasts events on the debugger CDP connections.
72
+ */ function createNetworkWebsocket(debuggerWebsocket) {
73
+ const wss = new (_ws()).WebSocketServer({
74
+ noServer: true,
75
+ perMessageDeflate: true,
76
+ // Don't crash on exceptionally large messages - assume the device is
77
+ // well-behaved and the debugger is prepared to handle large messages.
78
+ maxPayload: 0
79
+ });
80
+ wss.on("connection", (networkSocket)=>{
81
+ networkSocket.on("message", (data)=>{
82
+ try {
83
+ // Parse the network message, to determine how the message should be handled
84
+ const message = JSON.parse(data.toString());
85
+ if (message.method === "Expo(Network.receivedResponseBody)" && message.params) {
86
+ // If its a response body, write it to the global storage
87
+ const { requestId , ...requestInfo } = message.params;
88
+ _networkResponse.NETWORK_RESPONSE_STORAGE.set(requestId, requestInfo);
89
+ } else {
90
+ // Otherwise, directly re-broadcast the Network events to all connected debuggers
91
+ debuggerWebsocket.clients.forEach((debuggerSocket)=>{
92
+ if (debuggerSocket.readyState === debuggerSocket.OPEN) {
93
+ debuggerSocket.send(data.toString());
94
+ }
95
+ });
96
+ }
97
+ } catch (error) {
98
+ debug("Failed to handle Network CDP event", error);
99
+ }
100
+ });
101
+ });
102
+ return wss;
103
+ }
56
104
 
57
105
  //# sourceMappingURL=createDebugMiddleware.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../src/start/server/metro/debugging/createDebugMiddleware.ts"],"sourcesContent":["import chalk from 'chalk';\n\nimport { createHandlersFactory } from './createHandlersFactory';\nimport { Log } from '../../../../log';\nimport { env } from '../../../../utils/env';\nimport { type MetroBundlerDevServer } from '../MetroBundlerDevServer';\n\nexport function createDebugMiddleware(metroBundler: MetroBundlerDevServer) {\n // Load the React Native debugging tools from project\n // TODO: check if this works with isolated modules\n const { createDevMiddleware } =\n require('@react-native/dev-middleware') as typeof import('@react-native/dev-middleware');\n\n const { middleware, websocketEndpoints } = createDevMiddleware({\n projectRoot: metroBundler.projectRoot,\n serverBaseUrl: metroBundler.getUrlCreator().constructUrl({ scheme: 'http', hostType: 'lan' }),\n logger: createLogger(chalk.bold('Debug:')),\n unstable_customInspectorMessageHandler: createHandlersFactory(metroBundler),\n unstable_experiments: {\n // Enable the Network tab in React Native DevTools\n enableNetworkInspector: true,\n // Only enable opening the browser version of React Native DevTools when debugging.\n // This is useful when debugging the React Native DevTools by going to `/open-debugger` in the browser.\n enableOpenDebuggerRedirect: env.EXPO_DEBUG,\n },\n });\n\n return {\n debugMiddleware: middleware,\n debugWebsocketEndpoints: websocketEndpoints,\n };\n}\n\nfunction createLogger(\n logPrefix: string\n): Parameters<typeof import('@react-native/dev-middleware').createDevMiddleware>[0]['logger'] {\n return {\n info: (...args) => Log.log(logPrefix, ...args),\n warn: (...args) => Log.warn(logPrefix, ...args),\n error: (...args) => Log.error(logPrefix, ...args),\n };\n}\n"],"names":["createDebugMiddleware","metroBundler","createDevMiddleware","require","middleware","websocketEndpoints","projectRoot","serverBaseUrl","getUrlCreator","constructUrl","scheme","hostType","logger","createLogger","chalk","bold","unstable_customInspectorMessageHandler","createHandlersFactory","unstable_experiments","enableNetworkInspector","enableOpenDebuggerRedirect","env","EXPO_DEBUG","debugMiddleware","debugWebsocketEndpoints","logPrefix","info","args","Log","log","warn","error"],"mappings":"AAAA;;;;+BAOgBA,uBAAqB;;aAArBA,qBAAqB;;;8DAPnB,OAAO;;;;;;uCAEa,yBAAyB;qBAC3C,iBAAiB;qBACjB,uBAAuB;;;;;;AAGpC,SAASA,qBAAqB,CAACC,YAAmC,EAAE;IACzE,qDAAqD;IACrD,kDAAkD;IAClD,MAAM,EAAEC,mBAAmB,CAAA,EAAE,GAC3BC,OAAO,CAAC,8BAA8B,CAAC,AAAiD,AAAC;IAE3F,MAAM,EAAEC,UAAU,CAAA,EAAEC,kBAAkB,CAAA,EAAE,GAAGH,mBAAmB,CAAC;QAC7DI,WAAW,EAAEL,YAAY,CAACK,WAAW;QACrCC,aAAa,EAAEN,YAAY,CAACO,aAAa,EAAE,CAACC,YAAY,CAAC;YAAEC,MAAM,EAAE,MAAM;YAAEC,QAAQ,EAAE,KAAK;SAAE,CAAC;QAC7FC,MAAM,EAAEC,YAAY,CAACC,MAAK,EAAA,QAAA,CAACC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC1CC,sCAAsC,EAAEC,IAAAA,sBAAqB,sBAAA,EAAChB,YAAY,CAAC;QAC3EiB,oBAAoB,EAAE;YACpB,kDAAkD;YAClDC,sBAAsB,EAAE,IAAI;YAC5B,mFAAmF;YACnF,uGAAuG;YACvGC,0BAA0B,EAAEC,IAAG,IAAA,CAACC,UAAU;SAC3C;KACF,CAAC,AAAC;IAEH,OAAO;QACLC,eAAe,EAAEnB,UAAU;QAC3BoB,uBAAuB,EAAEnB,kBAAkB;KAC5C,CAAC;AACJ,CAAC;AAED,SAASQ,YAAY,CACnBY,SAAiB,EAC2E;IAC5F,OAAO;QACLC,IAAI,EAAE,CAAIC,GAAAA,IAAI,GAAKC,IAAG,IAAA,CAACC,GAAG,CAACJ,SAAS,KAAKE,IAAI,CAAC;QAC9CG,IAAI,EAAE,CAAIH,GAAAA,IAAI,GAAKC,IAAG,IAAA,CAACE,IAAI,CAACL,SAAS,KAAKE,IAAI,CAAC;QAC/CI,KAAK,EAAE,CAAIJ,GAAAA,IAAI,GAAKC,IAAG,IAAA,CAACG,KAAK,CAACN,SAAS,KAAKE,IAAI,CAAC;KAClD,CAAC;AACJ,CAAC"}
1
+ {"version":3,"sources":["../../../../../../src/start/server/metro/debugging/createDebugMiddleware.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { WebSocketServer } from 'ws';\n\nimport { createHandlersFactory } from './createHandlersFactory';\nimport { Log } from '../../../../log';\nimport { env } from '../../../../utils/env';\nimport { type MetroBundlerDevServer } from '../MetroBundlerDevServer';\nimport { NETWORK_RESPONSE_STORAGE } from './messageHandlers/NetworkResponse';\n\nconst debug = require('debug')('expo:metro:debugging:middleware') as typeof console.log;\n\nexport function createDebugMiddleware(metroBundler: MetroBundlerDevServer) {\n // Load the React Native debugging tools from project\n // TODO: check if this works with isolated modules\n const { createDevMiddleware } =\n require('@react-native/dev-middleware') as typeof import('@react-native/dev-middleware');\n\n const { middleware, websocketEndpoints } = createDevMiddleware({\n projectRoot: metroBundler.projectRoot,\n serverBaseUrl: metroBundler.getUrlCreator().constructUrl({ scheme: 'http', hostType: 'lan' }),\n logger: createLogger(chalk.bold('Debug:')),\n unstable_customInspectorMessageHandler: createHandlersFactory(),\n unstable_experiments: {\n // Enable the Network tab in React Native DevTools\n enableNetworkInspector: true,\n // Only enable opening the browser version of React Native DevTools when debugging.\n // This is useful when debugging the React Native DevTools by going to `/open-debugger` in the browser.\n enableOpenDebuggerRedirect: env.EXPO_DEBUG,\n },\n });\n\n // NOTE(cedric): add a temporary websocket to handle Network-related CDP events\n websocketEndpoints['/inspector/network'] = createNetworkWebsocket(\n websocketEndpoints['/inspector/debug']\n );\n\n return {\n debugMiddleware: middleware,\n debugWebsocketEndpoints: websocketEndpoints,\n };\n}\n\nfunction createLogger(\n logPrefix: string\n): Parameters<typeof import('@react-native/dev-middleware').createDevMiddleware>[0]['logger'] {\n return {\n info: (...args) => Log.log(logPrefix, ...args),\n warn: (...args) => Log.warn(logPrefix, ...args),\n error: (...args) => Log.error(logPrefix, ...args),\n };\n}\n\n/**\n * This adds a dedicated websocket connection that handles Network-related CDP events.\n * It's a temporary solution until Fusebox either implements the Network CDP domain,\n * or allows external domain agents that can send messages over the CDP socket to the debugger.\n * The Network websocket rebroadcasts events on the debugger CDP connections.\n */\nfunction createNetworkWebsocket(debuggerWebsocket: WebSocketServer) {\n const wss = new WebSocketServer({\n noServer: true,\n perMessageDeflate: true,\n // Don't crash on exceptionally large messages - assume the device is\n // well-behaved and the debugger is prepared to handle large messages.\n maxPayload: 0,\n });\n\n wss.on('connection', (networkSocket) => {\n networkSocket.on('message', (data) => {\n try {\n // Parse the network message, to determine how the message should be handled\n const message = JSON.parse(data.toString());\n\n if (message.method === 'Expo(Network.receivedResponseBody)' && message.params) {\n // If its a response body, write it to the global storage\n const { requestId, ...requestInfo } = message.params;\n NETWORK_RESPONSE_STORAGE.set(requestId, requestInfo);\n } else {\n // Otherwise, directly re-broadcast the Network events to all connected debuggers\n debuggerWebsocket.clients.forEach((debuggerSocket) => {\n if (debuggerSocket.readyState === debuggerSocket.OPEN) {\n debuggerSocket.send(data.toString());\n }\n });\n }\n } catch (error) {\n debug('Failed to handle Network CDP event', error);\n }\n });\n });\n\n return wss;\n}\n"],"names":["createDebugMiddleware","debug","require","metroBundler","createDevMiddleware","middleware","websocketEndpoints","projectRoot","serverBaseUrl","getUrlCreator","constructUrl","scheme","hostType","logger","createLogger","chalk","bold","unstable_customInspectorMessageHandler","createHandlersFactory","unstable_experiments","enableNetworkInspector","enableOpenDebuggerRedirect","env","EXPO_DEBUG","createNetworkWebsocket","debugMiddleware","debugWebsocketEndpoints","logPrefix","info","args","Log","log","warn","error","debuggerWebsocket","wss","WebSocketServer","noServer","perMessageDeflate","maxPayload","on","networkSocket","data","message","JSON","parse","toString","method","params","requestId","requestInfo","NETWORK_RESPONSE_STORAGE","set","clients","forEach","debuggerSocket","readyState","OPEN","send"],"mappings":"AAAA;;;;+BAWgBA,uBAAqB;;aAArBA,qBAAqB;;;8DAXnB,OAAO;;;;;;;yBACO,IAAI;;;;;;uCAEE,yBAAyB;qBAC3C,iBAAiB;qBACjB,uBAAuB;iCAEF,mCAAmC;;;;;;AAE5E,MAAMC,KAAK,GAAGC,OAAO,CAAC,OAAO,CAAC,CAAC,iCAAiC,CAAC,AAAsB,AAAC;AAEjF,SAASF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L,CAAC,CAAC,CAAC;IAEH,OAAOE,GAAG,CAAC;AACb,CAAC"}
@@ -7,7 +7,6 @@ Object.defineProperty(exports, "createHandlersFactory", {
7
7
  get: ()=>createHandlersFactory
8
8
  });
9
9
  const _networkResponse = require("./messageHandlers/NetworkResponse");
10
- const _pageReload = require("./messageHandlers/PageReload");
11
10
  const _vscodeDebuggerGetPossibleBreakpoints = require("./messageHandlers/VscodeDebuggerGetPossibleBreakpoints");
12
11
  const _vscodeDebuggerSetBreakpointByUrl = require("./messageHandlers/VscodeDebuggerSetBreakpointByUrl");
13
12
  const _vscodeRuntimeCallFunctionOn = require("./messageHandlers/VscodeRuntimeCallFunctionOn");
@@ -15,7 +14,7 @@ const _vscodeRuntimeEvaluate = require("./messageHandlers/VscodeRuntimeEvaluate"
15
14
  const _vscodeRuntimeGetProperties = require("./messageHandlers/VscodeRuntimeGetProperties");
16
15
  const _pageIsSupported = require("./pageIsSupported");
17
16
  const debug = require("debug")("expo:metro:debugging:messageHandlers");
18
- function createHandlersFactory(metroBundler) {
17
+ function createHandlersFactory() {
19
18
  return (connection)=>{
20
19
  debug("Initializing for connection: ", connection.page.title);
21
20
  if (!(0, _pageIsSupported.pageIsSupported)(connection.page)) {
@@ -25,7 +24,6 @@ function createHandlersFactory(metroBundler) {
25
24
  const handlers = [
26
25
  // Generic handlers
27
26
  new _networkResponse.NetworkResponseHandler(connection),
28
- new _pageReload.PageReloadHandler(connection, metroBundler),
29
27
  // Vscode-specific handlers
30
28
  new _vscodeDebuggerGetPossibleBreakpoints.VscodeDebuggerGetPossibleBreakpointsHandler(connection),
31
29
  new _vscodeDebuggerSetBreakpointByUrl.VscodeDebuggerSetBreakpointByUrlHandler(connection),
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../src/start/server/metro/debugging/createHandlersFactory.ts"],"sourcesContent":["import type { CreateCustomMessageHandlerFn } from '@react-native/dev-middleware';\n\nimport { NetworkResponseHandler } from './messageHandlers/NetworkResponse';\nimport { PageReloadHandler } from './messageHandlers/PageReload';\nimport { VscodeDebuggerGetPossibleBreakpointsHandler } from './messageHandlers/VscodeDebuggerGetPossibleBreakpoints';\nimport { VscodeDebuggerSetBreakpointByUrlHandler } from './messageHandlers/VscodeDebuggerSetBreakpointByUrl';\nimport { VscodeRuntimeCallFunctionOnHandler } from './messageHandlers/VscodeRuntimeCallFunctionOn';\nimport { VscodeRuntimeEvaluateHandler } from './messageHandlers/VscodeRuntimeEvaluate';\nimport { VscodeRuntimeGetPropertiesHandler } from './messageHandlers/VscodeRuntimeGetProperties';\nimport { pageIsSupported } from './pageIsSupported';\nimport type { MetroBundlerDevServer } from '../MetroBundlerDevServer';\n\nconst debug = require('debug')('expo:metro:debugging:messageHandlers') as typeof console.log;\n\nexport function createHandlersFactory(\n metroBundler: Pick<MetroBundlerDevServer, 'broadcastMessage'>\n): CreateCustomMessageHandlerFn {\n return (connection) => {\n debug('Initializing for connection: ', connection.page.title);\n\n if (!pageIsSupported(connection.page)) {\n debug('Aborted, unsupported page capabiltiies:', connection.page.capabilities);\n return null;\n }\n\n const handlers = [\n // Generic handlers\n new NetworkResponseHandler(connection),\n new PageReloadHandler(connection, metroBundler),\n // Vscode-specific handlers\n new VscodeDebuggerGetPossibleBreakpointsHandler(connection),\n new VscodeDebuggerSetBreakpointByUrlHandler(connection),\n new VscodeRuntimeGetPropertiesHandler(connection),\n new VscodeRuntimeCallFunctionOnHandler(connection),\n new VscodeRuntimeEvaluateHandler(connection),\n ].filter((middleware) => middleware.isEnabled());\n\n if (!handlers.length) {\n debug('Aborted, all handlers are disabled');\n return null;\n }\n\n debug(\n 'Initialized with handlers: ',\n handlers.map((middleware) => middleware.constructor.name).join(', ')\n );\n\n return {\n handleDeviceMessage: (message: any) =>\n withMessageDebug(\n 'device',\n message,\n handlers.some((middleware) => middleware.handleDeviceMessage?.(message))\n ),\n handleDebuggerMessage: (message: any) =>\n withMessageDebug(\n 'debugger',\n message,\n handlers.some((middleware) => middleware.handleDebuggerMessage?.(message))\n ),\n };\n };\n}\n\nfunction withMessageDebug(type: 'device' | 'debugger', message: any, result?: null | boolean) {\n const status = result ? 'handled' : 'ignored';\n const prefix = type === 'device' ? '(debugger) <- (device)' : '(debugger) -> (device)';\n\n try {\n debug(`%s = %s:`, prefix, status, JSON.stringify(message));\n } catch {\n debug(`%s = %s:`, prefix, status, 'message not serializable');\n }\n\n return result || undefined;\n}\n"],"names":["createHandlersFactory","debug","require","metroBundler","connection","page","title","pageIsSupported","capabilities","handlers","NetworkResponseHandler","PageReloadHandler","VscodeDebuggerGetPossibleBreakpointsHandler","VscodeDebuggerSetBreakpointByUrlHandler","VscodeRuntimeGetPropertiesHandler","VscodeRuntimeCallFunctionOnHandler","VscodeRuntimeEvaluateHandler","filter","middleware","isEnabled","length","map","constructor","name","join","handleDeviceMessage","message","withMessageDebug","some","handleDebuggerMessage","type","result","status","prefix","JSON","stringify","undefined"],"mappings":"AAAA;;;;+BAcgBA,uBAAqB;;aAArBA,qBAAqB;;iCAZE,mCAAmC;4BACxC,8BAA8B;sDACJ,wDAAwD;kDAC5D,oDAAoD;6CACzD,+CAA+C;uCACrD,yCAAyC;4CACpC,8CAA8C;iCAChE,mBAAmB;AAGnD,MAAMC,KAAK,GAAGC,OAAO,CAAC,OAAO,CAAC,CAAC,sCAAsC,CAAC,AAAsB,AAAC;AAEtF,SAASF,qBAAqB,CACnCG,YAA6D,EAC/B;IAC9B,OAAO,CAACC,UAAU,GAAK;QACrBH,KAAK,CAAC,+BAA+B,EAAEG,UAAU,CAACC,IAAI,CAACC,KAAK,CAAC,CAAC;QAE9D,IAAI,CAACC,IAAAA,gBAAe,gBAAA,EAACH,UAAU,CAACC,IAAI,CAAC,EAAE;YACrCJ,KAAK,CAAC,yCAAyC,EAAEG,UAAU,CAACC,IAAI,CAACG,YAAY,CAAC,CAAC;YAC/E,OAAO,IAAI,CAAC;QACd,CAAC;QAED,MAAMC,QAAQ,GAAG;YACf,mBAAmB;YACnB,IAAIC,gBAAsB,uBAAA,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AAC,CAC3E,CAAA;aAAA;SACJ,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC;AAED,SAASC,gBAAgB,CAACG,IAA2B,EAAEJ,OAAY,EAAEK,MAAuB,EAAE;IAC5F,MAAMC,MAAM,GAAGD,MAAM,GAAG,SAAS,GAAG,SAAS,AAAC;IAC9C,MAAME,MAAM,GAAGH,IAAI,KAAK,QAAQ,GAAG,wBAAwB,GAAG,wBAAwB,AAAC;IAEvF,IAAI;QACF7B,KAAK,CAAC,CAAC,QAAQ,CAAC,EAAEgC,MAAM,EAAED,MAAM,EAAEE,IAAI,CAACC,SAAS,CAACT,OAAO,CAAC,CAAC,CAAC;IAC7D,EAAE,OAAM;QACNzB,KAAK,CAAC,CAAC,QAAQ,CAAC,EAAEgC,MAAM,EAAED,MAAM,EAAE,0BAA0B,CAAC,CAAC;IAChE,CAAC;IAED,OAAOD,MAAM,IAAIK,SAAS,CAAC;AAC7B,CAAC"}
1
+ {"version":3,"sources":["../../../../../../src/start/server/metro/debugging/createHandlersFactory.ts"],"sourcesContent":["import type { CreateCustomMessageHandlerFn } from '@react-native/dev-middleware';\n\nimport { NetworkResponseHandler } from './messageHandlers/NetworkResponse';\nimport { VscodeDebuggerGetPossibleBreakpointsHandler } from './messageHandlers/VscodeDebuggerGetPossibleBreakpoints';\nimport { VscodeDebuggerSetBreakpointByUrlHandler } from './messageHandlers/VscodeDebuggerSetBreakpointByUrl';\nimport { VscodeRuntimeCallFunctionOnHandler } from './messageHandlers/VscodeRuntimeCallFunctionOn';\nimport { VscodeRuntimeEvaluateHandler } from './messageHandlers/VscodeRuntimeEvaluate';\nimport { VscodeRuntimeGetPropertiesHandler } from './messageHandlers/VscodeRuntimeGetProperties';\nimport { pageIsSupported } from './pageIsSupported';\n\nconst debug = require('debug')('expo:metro:debugging:messageHandlers') as typeof console.log;\n\nexport function createHandlersFactory(): CreateCustomMessageHandlerFn {\n return (connection) => {\n debug('Initializing for connection: ', connection.page.title);\n\n if (!pageIsSupported(connection.page)) {\n debug('Aborted, unsupported page capabiltiies:', connection.page.capabilities);\n return null;\n }\n\n const handlers = [\n // Generic handlers\n new NetworkResponseHandler(connection),\n // Vscode-specific handlers\n new VscodeDebuggerGetPossibleBreakpointsHandler(connection),\n new VscodeDebuggerSetBreakpointByUrlHandler(connection),\n new VscodeRuntimeGetPropertiesHandler(connection),\n new VscodeRuntimeCallFunctionOnHandler(connection),\n new VscodeRuntimeEvaluateHandler(connection),\n ].filter((middleware) => middleware.isEnabled());\n\n if (!handlers.length) {\n debug('Aborted, all handlers are disabled');\n return null;\n }\n\n debug(\n 'Initialized with handlers: ',\n handlers.map((middleware) => middleware.constructor.name).join(', ')\n );\n\n return {\n handleDeviceMessage: (message: any) =>\n withMessageDebug(\n 'device',\n message,\n handlers.some((middleware) => middleware.handleDeviceMessage?.(message))\n ),\n handleDebuggerMessage: (message: any) =>\n withMessageDebug(\n 'debugger',\n message,\n handlers.some((middleware) => middleware.handleDebuggerMessage?.(message))\n ),\n };\n };\n}\n\nfunction withMessageDebug(type: 'device' | 'debugger', message: any, result?: null | boolean) {\n const status = result ? 'handled' : 'ignored';\n const prefix = type === 'device' ? '(debugger) <- (device)' : '(debugger) -> (device)';\n\n try {\n debug(`%s = %s:`, prefix, status, JSON.stringify(message));\n } catch {\n debug(`%s = %s:`, prefix, status, 'message not serializable');\n }\n\n return result || undefined;\n}\n"],"names":["createHandlersFactory","debug","require","connection","page","title","pageIsSupported","capabilities","handlers","NetworkResponseHandler","VscodeDebuggerGetPossibleBreakpointsHandler","VscodeDebuggerSetBreakpointByUrlHandler","VscodeRuntimeGetPropertiesHandler","VscodeRuntimeCallFunctionOnHandler","VscodeRuntimeEvaluateHandler","filter","middleware","isEnabled","length","map","constructor","name","join","handleDeviceMessage","message","withMessageDebug","some","handleDebuggerMessage","type","result","status","prefix","JSON","stringify","undefined"],"mappings":"AAAA;;;;+BAYgBA,uBAAqB;;aAArBA,qBAAqB;;iCAVE,mCAAmC;sDACd,wDAAwD;kDA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AChCC,OAAAA,gBAAgB,CACd,QAAQ,EACRD,OAAO,EACPhB,QAAQ,CAACkB,IAAI,CAAC,CAACV,UAAU;oBAAKA,OAAAA,UAAU,CAACO,mBAAmB,QAAW,GAAzCP,KAAAA,CAAyC,GAAzCA,UAAU,CAACO,mBAAmB,CAAGC,OAAO,CAAC,CAAA;iBAAA,CAAC,CACzE,CAAA;aAAA;YACHG,qBAAqB,EAAE,CAACH,OAAY;gBAClCC,OAAAA,gBAAgB,CACd,UAAU,EACVD,OAAO,EACPhB,QAAQ,CAACkB,IAAI,CAAC,CAACV,UAAU;oBAAKA,OAAAA,UAAU,CAACW,qBAAqB,QAAW,GAA3CX,KAAAA,CAA2C,GAA3CA,UAAU,CAACW,qBAAqB,CAAGH,OAAO,CAAC,CAAA;iBAAA,CAAC,CAC3E,CAAA;aAAA;SACJ,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC;AAED,SAASC,gBAAgB,CAACG,IAA2B,EAAEJ,OAAY,EAAEK,MAAuB,EAAE;IAC5F,MAAMC,MAAM,GAAGD,MAAM,GAAG,SAAS,GAAG,SAAS,AAAC;IAC9C,MAAME,MAAM,GAAGH,IAAI,KAAK,QAAQ,GAAG,wBAAwB,GAAG,wBAAwB,AAAC;IAEvF,IAAI;QACF3B,KAAK,CAAC,CAAC,QAAQ,CAAC,EAAE8B,MAAM,EAAED,MAAM,EAAEE,IAAI,CAACC,SAAS,CAACT,OAAO,CAAC,CAAC,CAAC;IAC7D,EAAE,OAAM;QACNvB,KAAK,CAAC,CAAC,QAAQ,CAAC,EAAE8B,MAAM,EAAED,MAAM,EAAE,0BAA0B,CAAC,CAAC;IAChE,CAAC;IAED,OAAOD,MAAM,IAAIK,SAAS,CAAC;AAC7B,CAAC"}
@@ -2,13 +2,20 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- Object.defineProperty(exports, "NetworkResponseHandler", {
6
- enumerable: true,
7
- get: ()=>NetworkResponseHandler
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: all[name]
9
+ });
10
+ }
11
+ _export(exports, {
12
+ NETWORK_RESPONSE_STORAGE: ()=>NETWORK_RESPONSE_STORAGE,
13
+ NetworkResponseHandler: ()=>NetworkResponseHandler
8
14
  });
9
15
  const _messageHandler = require("../MessageHandler");
16
+ const NETWORK_RESPONSE_STORAGE = new Map();
10
17
  class NetworkResponseHandler extends _messageHandler.MessageHandler {
11
- /** All known responses, mapped by request id */ storage = new Map();
18
+ /** All known responses, mapped by request id */ storage = NETWORK_RESPONSE_STORAGE;
12
19
  isEnabled() {
13
20
  return this.page.capabilities.nativeNetworkInspection !== true;
14
21
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../../src/start/server/metro/debugging/messageHandlers/NetworkResponse.ts"],"sourcesContent":["import type { Protocol } from 'devtools-protocol';\n\nimport { MessageHandler } from '../MessageHandler';\nimport type {\n CdpMessage,\n DeviceRequest,\n DebuggerRequest,\n DebuggerResponse,\n DeviceResponse,\n} from '../types';\n\nexport class NetworkResponseHandler extends MessageHandler {\n /** All known responses, mapped by request id */\n storage = new Map<string, DebuggerResponse<NetworkGetResponseBody>['result']>();\n\n isEnabled() {\n return this.page.capabilities.nativeNetworkInspection !== true;\n }\n\n handleDeviceMessage(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 handleDebuggerMessage(message: DebuggerRequest<NetworkGetResponseBody>) {\n if (\n message.method === 'Network.getResponseBody' &&\n this.storage.has(message.params.requestId)\n ) {\n return this.sendToDebugger<DeviceResponse<NetworkGetResponseBody>>({\n id: message.id,\n result: this.storage.get(message.params.requestId)!,\n });\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","MessageHandler","storage","Map","isEnabled","page","capabilities","nativeNetworkInspection","handleDeviceMessage","message","method","requestId","requestInfo","params","set","handleDebuggerMessage","has","sendToDebugger","id","result","get"],"mappings":"AAAA;;;;+BAWaA,wBAAsB;;aAAtBA,sBAAsB;;gCATJ,mBAAmB;AAS3C,MAAMA,sBAAsB,SAASC,eAAc,eAAA;IACxD,8CAA8C,GAC9CC,OAAO,GAAG,IAAIC,GAAG,EAA8D,CAAC;IAEhFC,SAAS,GAAG;QACV,OAAO,IAAI,CAACC,IAAI,CAACC,YAAY,CAACC,uBAAuB,KAAK,IAAI,CAAC;IACjE;IAEAC,mBAAmB,CAACC,OAAmD,EAAE;QACvE,IAAIA,OAAO,CAACC,MAAM,KAAK,oCAAoC,EAAE;YAC3D,MAAM,EAAEC,SAAS,CAAA,EAAE,GAAGC,WAAW,EAAE,GAAGH,OAAO,CAACI,MAAM,AAAC;YACrD,IAAI,CAACX,OAAO,CAACY,GAAG,CAACH,SAAS,EAAEC,WAAW,CAAC,CAAC;YACzC,OAAO,IAAI,CAAC;QACd,CAAC;QAED,OAAO,KAAK,CAAC;IACf;IAEAG,qBAAqB,CAACN,OAAgD,EAAE;QACtE,IACEA,OAAO,CAACC,MAAM,KAAK,yBAAyB,IAC5C,IAAI,CAACR,OAAO,CAACc,GAAG,CAACP,OAAO,CAACI,MAAM,CAACF,SAAS,CAAC,EAC1C;YACA,OAAO,IAAI,CAACM,cAAc,CAAyC;gBACjEC,EAAE,EAAET,OAAO,CAACS,EAAE;gBACdC,MAAM,EAAE,IAAI,CAACjB,OAAO,CAACkB,GAAG,CAACX,OAAO,CAACI,MAAM,CAACF,SAAS,CAAC;aACnD,CAAC,CAAC;QACL,CAAC;QAED,OAAO,KAAK,CAAC;IACf;CACD"}
1
+ {"version":3,"sources":["../../../../../../../src/start/server/metro/debugging/messageHandlers/NetworkResponse.ts"],"sourcesContent":["import type { Protocol } from 'devtools-protocol';\n\nimport { MessageHandler } from '../MessageHandler';\nimport type {\n CdpMessage,\n DeviceRequest,\n DebuggerRequest,\n DebuggerResponse,\n DeviceResponse,\n} from '../types';\n\n/**\n * The global network response storage, as a workaround for the network inspector.\n * @see createDebugMiddleware#createNetworkWebsocket\n */\nexport const NETWORK_RESPONSE_STORAGE = new Map<\n string,\n DebuggerResponse<NetworkGetResponseBody>['result']\n>();\n\nexport class NetworkResponseHandler extends MessageHandler {\n /** All known responses, mapped by request id */\n storage = NETWORK_RESPONSE_STORAGE;\n\n isEnabled() {\n return this.page.capabilities.nativeNetworkInspection !== true;\n }\n\n handleDeviceMessage(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 handleDebuggerMessage(message: DebuggerRequest<NetworkGetResponseBody>) {\n if (\n message.method === 'Network.getResponseBody' &&\n this.storage.has(message.params.requestId)\n ) {\n return this.sendToDebugger<DeviceResponse<NetworkGetResponseBody>>({\n id: message.id,\n result: this.storage.get(message.params.requestId)!,\n });\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":["NETWORK_RESPONSE_STORAGE","NetworkResponseHandler","Map","MessageHandler","storage","isEnabled","page","capabilities","nativeNetworkInspection","handleDeviceMessage","message","method","requestId","requestInfo","params","set","handleDebuggerMessage","has","sendToDebugger","id","result","get"],"mappings":"AAAA;;;;;;;;;;;IAeaA,wBAAwB,MAAxBA,wBAAwB;IAKxBC,sBAAsB,MAAtBA,sBAAsB;;gCAlBJ,mBAAmB;AAa3C,MAAMD,wBAAwB,GAAG,IAAIE,GAAG,EAG5C,AAAC;AAEG,MAAMD,sBAAsB,SAASE,eAAc,eAAA;IACxD,8CAA8C,GAC9CC,OAAO,GAAGJ,wBAAwB,CAAC;IAEnCK,SAAS,GAAG;QACV,OAAO,IAAI,CAACC,IAAI,CAACC,YAAY,CAACC,uBAAuB,KAAK,IAAI,CAAC;IACjE;IAEAC,mBAAmB,CAACC,OAAmD,EAAE;QACvE,IAAIA,OAAO,CAACC,MAAM,KAAK,oCAAoC,EAAE;YAC3D,MAAM,EAAEC,SAAS,CAAA,EAAE,GAAGC,WAAW,EAAE,GAAGH,OAAO,CAACI,MAAM,AAAC;YACrD,IAAI,CAACV,OAAO,CAACW,GAAG,CAACH,SAAS,EAAEC,WAAW,CAAC,CAAC;YACzC,OAAO,IAAI,CAAC;QACd,CAAC;QAED,OAAO,KAAK,CAAC;IACf;IAEAG,qBAAqB,CAACN,OAAgD,EAAE;QACtE,IACEA,OAAO,CAACC,MAAM,KAAK,yBAAyB,IAC5C,IAAI,CAACP,OAAO,CAACa,GAAG,CAACP,OAAO,CAACI,MAAM,CAACF,SAAS,CAAC,EAC1C;YACA,OAAO,IAAI,CAACM,cAAc,CAAyC;gBACjEC,EAAE,EAAET,OAAO,CAACS,EAAE;gBACdC,MAAM,EAAE,IAAI,CAAChB,OAAO,CAACiB,GAAG,CAACX,OAAO,CAACI,MAAM,CAACF,SAAS,CAAC;aACnD,CAAC,CAAC;QACL,CAAC;QAED,OAAO,KAAK,CAAC;IACf;CACD"}
@@ -31,7 +31,7 @@ class FetchClient {
31
31
  this.headers = {
32
32
  accept: "application/json",
33
33
  "content-type": "application/json",
34
- "user-agent": `expo-cli/${"0.19.1"}`,
34
+ "user-agent": `expo-cli/${"0.19.2"}`,
35
35
  authorization: "Basic " + _nodeBuffer().Buffer.from(`${target}:`).toString("base64")
36
36
  };
37
37
  }
@@ -79,7 +79,7 @@ function createContext() {
79
79
  cpu: summarizeCpuInfo(),
80
80
  app: {
81
81
  name: "expo/cli",
82
- version: "0.19.1"
82
+ version: "0.19.2"
83
83
  },
84
84
  ci: _ciInfo().isCI ? {
85
85
  name: _ciInfo().name,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@expo/cli",
3
- "version": "0.19.1",
3
+ "version": "0.19.2",
4
4
  "description": "The Expo CLI",
5
5
  "main": "build/bin/cli",
6
6
  "bin": {
@@ -167,5 +167,5 @@
167
167
  "tree-kill": "^1.2.2",
168
168
  "tsd": "^0.28.1"
169
169
  },
170
- "gitHead": "0a07b965c4bef67e7718355a0dc770d524ad3cee"
170
+ "gitHead": "2e4f18d41da033c5ced0a4a045d91cf5250016b7"
171
171
  }
@@ -1,26 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "PageReloadHandler", {
6
- enumerable: true,
7
- get: ()=>PageReloadHandler
8
- });
9
- const _messageHandler = require("../MessageHandler");
10
- class PageReloadHandler extends _messageHandler.MessageHandler {
11
- constructor(connection, metroBundler){
12
- super(connection);
13
- this.metroBundler = metroBundler;
14
- }
15
- handleDebuggerMessage(message) {
16
- if (message.method === "Page.reload") {
17
- this.metroBundler.broadcastMessage("reload");
18
- return this.sendToDebugger({
19
- id: message.id
20
- });
21
- }
22
- return false;
23
- }
24
- }
25
-
26
- //# sourceMappingURL=PageReload.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../../src/start/server/metro/debugging/messageHandlers/PageReload.ts"],"sourcesContent":["import type { Protocol } from 'devtools-protocol';\n\nimport type { MetroBundlerDevServer } from '../../MetroBundlerDevServer';\nimport { MessageHandler } from '../MessageHandler';\nimport type { CdpMessage, Connection, DebuggerRequest } from '../types';\n\nexport class PageReloadHandler extends MessageHandler {\n private metroBundler: Pick<MetroBundlerDevServer, 'broadcastMessage'>;\n\n constructor(\n connection: Connection,\n metroBundler: Pick<MetroBundlerDevServer, 'broadcastMessage'>\n ) {\n super(connection);\n this.metroBundler = metroBundler;\n }\n\n handleDebuggerMessage(message: DebuggerRequest<PageReload>) {\n if (message.method === 'Page.reload') {\n this.metroBundler.broadcastMessage('reload');\n return this.sendToDebugger({ id: message.id });\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","MessageHandler","constructor","connection","metroBundler","handleDebuggerMessage","message","method","broadcastMessage","sendToDebugger","id"],"mappings":"AAAA;;;;+BAMaA,mBAAiB;;aAAjBA,iBAAiB;;gCAHC,mBAAmB;AAG3C,MAAMA,iBAAiB,SAASC,eAAc,eAAA;IAGnDC,YACEC,UAAsB,EACtBC,YAA6D,CAC7D;QACA,KAAK,CAACD,UAAU,CAAC,CAAC;QAClB,IAAI,CAACC,YAAY,GAAGA,YAAY,CAAC;IACnC;IAEAC,qBAAqB,CAACC,OAAoC,EAAE;QAC1D,IAAIA,OAAO,CAACC,MAAM,KAAK,aAAa,EAAE;YACpC,IAAI,CAACH,YAAY,CAACI,gBAAgB,CAAC,QAAQ,CAAC,CAAC;YAC7C,OAAO,IAAI,CAACC,cAAc,CAAC;gBAAEC,EAAE,EAAEJ,OAAO,CAACI,EAAE;aAAE,CAAC,CAAC;QACjD,CAAC;QAED,OAAO,KAAK,CAAC;IACf;CACD"}