@expo/cli 0.22.27 → 0.22.28
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 +1 -1
- package/build/src/install/applyPlugins.js.map +1 -1
- package/build/src/start/server/metro/DevToolsPluginWebsocketEndpoint.js +1 -1
- package/build/src/start/server/metro/DevToolsPluginWebsocketEndpoint.js.map +1 -1
- package/build/src/start/server/metro/debugging/createDebugMiddleware.js +24 -10
- package/build/src/start/server/metro/debugging/createDebugMiddleware.js.map +1 -1
- package/build/src/start/server/metro/instantiateMetro.js +12 -5
- package/build/src/start/server/metro/instantiateMetro.js.map +1 -1
- package/build/src/utils/net.js +39 -0
- package/build/src/utils/net.js.map +1 -0
- package/build/src/utils/telemetry/clients/FetchClient.js +1 -1
- package/build/src/utils/telemetry/utils/context.js +1 -1
- package/package.json +4 -4
package/build/bin/cli
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/install/applyPlugins.ts"],"sourcesContent":["import { getConfig } from '@expo/config';\n\nimport * as Log from '../log';\nimport { parsePackageSpecifier } from './utils/parsePackageSpecifier';\n\n/**\n * A convenience feature for automatically applying Expo Config Plugins to the `app.json` after installing them.\n * This should be dropped in favor of autolinking in the future.\n */\nexport async function applyPluginsAsync(projectRoot: string, packages: string[]) {\n const { autoAddConfigPluginsAsync } = await import('./utils/autoAddConfigPlugins.js');\n\n try {\n const { exp } = getConfig(projectRoot, { skipSDKVersionRequirement: true });\n\n // Only auto add plugins if the plugins array is defined or if the project is using SDK +42.\n await autoAddConfigPluginsAsync(\n projectRoot,\n exp,\n // Split any possible NPM tags. i.e. `expo@latest` -> `expo`\n packages.map(parsePackageSpecifier).filter((x) => x != null)\n );\n } catch (error: any) {\n // If we fail to apply plugins, the log a warning and continue.\n if (error.isPluginError) {\n Log.warn(`Skipping config plugin check: ` + error.message);\n return;\n }\n // Any other error, rethrow.\n throw error;\n }\n}\n"],"names":["applyPluginsAsync","projectRoot","packages","autoAddConfigPluginsAsync","exp","getConfig","skipSDKVersionRequirement","map","parsePackageSpecifier","filter","x","error","isPluginError","Log","warn","message"],"mappings":"AAAA;;;;+BASsBA,mBAAiB;;aAAjBA,iBAAiB;;;yBATb,cAAc;;;;;;2DAEnB,QAAQ;uCACS,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAM9D,eAAeA,iBAAiB,CAACC,WAAmB,EAAEC,QAAkB,EAAE;IAC/E,MAAM,EAAEC,yBAAyB,CAAA,EAAE,GAAG,MAAM,iEAAA,OAAM,CAAC,iCAAiC,GAAC,AAAC;IAEtF,IAAI;QACF,MAAM,EAAEC,GAAG,CAAA,EAAE,GAAGC,IAAAA,OAAS,EAAA,UAAA,EAACJ,WAAW,EAAE;YAAEK,yBAAyB,EAAE,IAAI;SAAE,CAAC,AAAC;QAE5E,4FAA4F;QAC5F,MAAMH,yBAAyB,CAC7BF,WAAW,EACXG,GAAG,EACH,4DAA4D;QAC5DF,QAAQ,CAACK,GAAG,CAACC,sBAAqB,sBAAA,CAAC,CAACC,MAAM,CAAC,CAACC,CAAC,
|
|
1
|
+
{"version":3,"sources":["../../../src/install/applyPlugins.ts"],"sourcesContent":["import { getConfig } from '@expo/config';\n\nimport * as Log from '../log';\nimport { parsePackageSpecifier } from './utils/parsePackageSpecifier';\n\n/**\n * A convenience feature for automatically applying Expo Config Plugins to the `app.json` after installing them.\n * This should be dropped in favor of autolinking in the future.\n */\nexport async function applyPluginsAsync(projectRoot: string, packages: string[]) {\n const { autoAddConfigPluginsAsync } = await import('./utils/autoAddConfigPlugins.js');\n\n try {\n const { exp } = getConfig(projectRoot, { skipSDKVersionRequirement: true });\n\n // Only auto add plugins if the plugins array is defined or if the project is using SDK +42.\n await autoAddConfigPluginsAsync(\n projectRoot,\n exp,\n // Split any possible NPM tags. i.e. `expo@latest` -> `expo`\n packages.map(parsePackageSpecifier).filter((x): x is string => x != null)\n );\n } catch (error: any) {\n // If we fail to apply plugins, the log a warning and continue.\n if (error.isPluginError) {\n Log.warn(`Skipping config plugin check: ` + error.message);\n return;\n }\n // Any other error, rethrow.\n throw error;\n }\n}\n"],"names":["applyPluginsAsync","projectRoot","packages","autoAddConfigPluginsAsync","exp","getConfig","skipSDKVersionRequirement","map","parsePackageSpecifier","filter","x","error","isPluginError","Log","warn","message"],"mappings":"AAAA;;;;+BASsBA,mBAAiB;;aAAjBA,iBAAiB;;;yBATb,cAAc;;;;;;2DAEnB,QAAQ;uCACS,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAM9D,eAAeA,iBAAiB,CAACC,WAAmB,EAAEC,QAAkB,EAAE;IAC/E,MAAM,EAAEC,yBAAyB,CAAA,EAAE,GAAG,MAAM,iEAAA,OAAM,CAAC,iCAAiC,GAAC,AAAC;IAEtF,IAAI;QACF,MAAM,EAAEC,GAAG,CAAA,EAAE,GAAGC,IAAAA,OAAS,EAAA,UAAA,EAACJ,WAAW,EAAE;YAAEK,yBAAyB,EAAE,IAAI;SAAE,CAAC,AAAC;QAE5E,4FAA4F;QAC5F,MAAMH,yBAAyB,CAC7BF,WAAW,EACXG,GAAG,EACH,4DAA4D;QAC5DF,QAAQ,CAACK,GAAG,CAACC,sBAAqB,sBAAA,CAAC,CAACC,MAAM,CAAC,CAACC,CAAC,GAAkBA,CAAC,IAAI,IAAI,CAAC,CAC1E,CAAC;IACJ,EAAE,OAAOC,KAAK,EAAO;QACnB,+DAA+D;QAC/D,IAAIA,KAAK,CAACC,aAAa,EAAE;YACvBC,IAAG,CAACC,IAAI,CAAC,CAAC,8BAA8B,CAAC,GAAGH,KAAK,CAACI,OAAO,CAAC,CAAC;YAC3D,OAAO;QACT,CAAC;QACD,4BAA4B;QAC5B,MAAMJ,KAAK,CAAC;IACd,CAAC;AACH,CAAC"}
|
|
@@ -17,7 +17,7 @@ function createDevToolsPluginWebsocketEndpoint() {
|
|
|
17
17
|
const wss = new (_ws()).WebSocketServer({
|
|
18
18
|
noServer: true
|
|
19
19
|
});
|
|
20
|
-
wss.on("connection", (ws)=>{
|
|
20
|
+
wss.on("connection", (ws, request)=>{
|
|
21
21
|
ws.on("message", (message, isBinary)=>{
|
|
22
22
|
// Broadcast the received message to all other connected clients
|
|
23
23
|
wss.clients.forEach((client)=>{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/start/server/metro/DevToolsPluginWebsocketEndpoint.ts"],"sourcesContent":["import { WebSocket, WebSocketServer } from 'ws';\n\nexport function createDevToolsPluginWebsocketEndpoint(): Record<string, WebSocketServer> {\n const wss = new WebSocketServer({ noServer: true });\n\n wss.on('connection', (ws
|
|
1
|
+
{"version":3,"sources":["../../../../../src/start/server/metro/DevToolsPluginWebsocketEndpoint.ts"],"sourcesContent":["import { WebSocket, WebSocketServer } from 'ws';\n\nexport function createDevToolsPluginWebsocketEndpoint(): Record<string, WebSocketServer> {\n const wss = new WebSocketServer({ noServer: true });\n\n wss.on('connection', (ws, request) => {\n ws.on('message', (message, isBinary) => {\n // Broadcast the received message to all other connected clients\n wss.clients.forEach((client) => {\n if (client !== ws && client.readyState === WebSocket.OPEN) {\n client.send(message, { binary: isBinary });\n }\n });\n });\n });\n\n return { '/expo-dev-plugins/broadcast': wss };\n}\n"],"names":["createDevToolsPluginWebsocketEndpoint","wss","WebSocketServer","noServer","on","ws","request","message","isBinary","clients","forEach","client","readyState","WebSocket","OPEN","send","binary"],"mappings":"AAAA;;;;+BAEgBA,uCAAqC;;aAArCA,qCAAqC;;;yBAFV,IAAI;;;;;;AAExC,SAASA,qCAAqC,GAAoC;IACvF,MAAMC,GAAG,GAAG,IAAIC,CAAAA,GAAe,EAAA,CAAA,gBAAA,CAAC;QAAEC,QAAQ,EAAE,IAAI;KAAE,CAAC,AAAC;IAEpDF,GAAG,CAACG,EAAE,CAAC,YAAY,EAAE,CAACC,EAAE,EAAEC,OAAO,GAAK;QACpCD,EAAE,CAACD,EAAE,CAAC,SAAS,EAAE,CAACG,OAAO,EAAEC,QAAQ,GAAK;YACtC,gEAAgE;YAChEP,GAAG,CAACQ,OAAO,CAACC,OAAO,CAAC,CAACC,MAAM,GAAK;gBAC9B,IAAIA,MAAM,KAAKN,EAAE,IAAIM,MAAM,CAACC,UAAU,KAAKC,GAAS,EAAA,UAAA,CAACC,IAAI,EAAE;oBACzDH,MAAM,CAACI,IAAI,CAACR,OAAO,EAAE;wBAAES,MAAM,EAAER,QAAQ;qBAAE,CAAC,CAAC;gBAC7C,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO;QAAE,6BAA6B,EAAEP,GAAG;KAAE,CAAC;AAChD,CAAC"}
|
|
@@ -21,25 +21,23 @@ function _ws() {
|
|
|
21
21
|
return data;
|
|
22
22
|
}
|
|
23
23
|
const _createHandlersFactory = require("./createHandlersFactory");
|
|
24
|
+
const _networkResponse = require("./messageHandlers/NetworkResponse");
|
|
24
25
|
const _log = require("../../../../log");
|
|
25
26
|
const _env = require("../../../../utils/env");
|
|
26
|
-
const
|
|
27
|
+
const _net = require("../../../../utils/net");
|
|
27
28
|
function _interopRequireDefault(obj) {
|
|
28
29
|
return obj && obj.__esModule ? obj : {
|
|
29
30
|
default: obj
|
|
30
31
|
};
|
|
31
32
|
}
|
|
32
33
|
const debug = require("debug")("expo:metro:debugging:middleware");
|
|
33
|
-
function createDebugMiddleware(
|
|
34
|
+
function createDebugMiddleware({ projectRoot , serverBaseUrl }) {
|
|
34
35
|
// Load the React Native debugging tools from project
|
|
35
36
|
// TODO: check if this works with isolated modules
|
|
36
37
|
const { createDevMiddleware } = require("@react-native/dev-middleware");
|
|
37
38
|
const { middleware , websocketEndpoints } = createDevMiddleware({
|
|
38
|
-
projectRoot
|
|
39
|
-
serverBaseUrl
|
|
40
|
-
scheme: "http",
|
|
41
|
-
hostType: "localhost"
|
|
42
|
-
}),
|
|
39
|
+
projectRoot,
|
|
40
|
+
serverBaseUrl,
|
|
43
41
|
logger: createLogger(_chalk().default.bold("Debug:")),
|
|
44
42
|
unstable_customInspectorMessageHandler: (0, _createHandlersFactory.createHandlersFactory)(),
|
|
45
43
|
unstable_experiments: {
|
|
@@ -50,10 +48,26 @@ function createDebugMiddleware(metroBundler) {
|
|
|
50
48
|
enableOpenDebuggerRedirect: _env.env.EXPO_DEBUG
|
|
51
49
|
}
|
|
52
50
|
});
|
|
51
|
+
const debuggerWebsocketEndpoint = websocketEndpoints["/inspector/debug"];
|
|
53
52
|
// NOTE(cedric): add a temporary websocket to handle Network-related CDP events
|
|
54
|
-
websocketEndpoints["/inspector/network"] = createNetworkWebsocket(
|
|
53
|
+
websocketEndpoints["/inspector/network"] = createNetworkWebsocket(debuggerWebsocketEndpoint);
|
|
54
|
+
// Explicitly limit debugger websocket to loopback requests
|
|
55
|
+
debuggerWebsocketEndpoint.on("connection", (socket, request)=>{
|
|
56
|
+
if (!(0, _net.isLocalSocket)(request.socket) || !(0, _net.isMatchingOrigin)(request, serverBaseUrl)) {
|
|
57
|
+
// NOTE: `socket.close` nicely closes the websocket, which will still allow incoming messages
|
|
58
|
+
// `socket.terminate` instead forcefully closes down the socket
|
|
59
|
+
socket.terminate();
|
|
60
|
+
}
|
|
61
|
+
});
|
|
55
62
|
return {
|
|
56
|
-
debugMiddleware
|
|
63
|
+
debugMiddleware (req, res, next) {
|
|
64
|
+
// The debugger middleware is skipped entirely if the connection isn't a loopback request
|
|
65
|
+
if ((0, _net.isLocalSocket)(req.socket)) {
|
|
66
|
+
return middleware(req, res, next);
|
|
67
|
+
} else {
|
|
68
|
+
return next();
|
|
69
|
+
}
|
|
70
|
+
},
|
|
57
71
|
debugWebsocketEndpoints: websocketEndpoints
|
|
58
72
|
};
|
|
59
73
|
}
|
|
@@ -86,7 +100,7 @@ function createLogger(logPrefix) {
|
|
|
86
100
|
// If its a response body, write it to the global storage
|
|
87
101
|
const { requestId , ...requestInfo } = message.params;
|
|
88
102
|
_networkResponse.NETWORK_RESPONSE_STORAGE.set(requestId, requestInfo);
|
|
89
|
-
} else {
|
|
103
|
+
} else if (message.method.startsWith("Network.")) {
|
|
90
104
|
// Otherwise, directly re-broadcast the Network events to all connected debuggers
|
|
91
105
|
debuggerWebsocket.clients.forEach((debuggerSocket)=>{
|
|
92
106
|
if (debuggerSocket.readyState === debuggerSocket.OPEN) {
|
|
@@ -1 +1 @@
|
|
|
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 {
|
|
1
|
+
{"version":3,"sources":["../../../../../../src/start/server/metro/debugging/createDebugMiddleware.ts"],"sourcesContent":["import chalk from 'chalk';\nimport type { NextHandleFunction } from 'connect';\nimport { WebSocketServer } from 'ws';\n\nimport { createHandlersFactory } from './createHandlersFactory';\nimport { NETWORK_RESPONSE_STORAGE } from './messageHandlers/NetworkResponse';\nimport { Log } from '../../../../log';\nimport { env } from '../../../../utils/env';\nimport { isLocalSocket, isMatchingOrigin } from '../../../../utils/net';\n\nconst debug = require('debug')('expo:metro:debugging:middleware') as typeof console.log;\n\ninterface DebugMiddleware {\n debugMiddleware: NextHandleFunction;\n debugWebsocketEndpoints: Record<string, WebSocketServer>;\n}\n\ninterface DebugMiddlewareParams {\n projectRoot: string;\n serverBaseUrl: string;\n}\n\nexport function createDebugMiddleware({\n projectRoot,\n serverBaseUrl,\n}: DebugMiddlewareParams): DebugMiddleware {\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,\n serverBaseUrl,\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 const debuggerWebsocketEndpoint = websocketEndpoints['/inspector/debug'] as WebSocketServer;\n\n // NOTE(cedric): add a temporary websocket to handle Network-related CDP events\n websocketEndpoints['/inspector/network'] = createNetworkWebsocket(debuggerWebsocketEndpoint);\n\n // Explicitly limit debugger websocket to loopback requests\n debuggerWebsocketEndpoint.on('connection', (socket, request) => {\n if (!isLocalSocket(request.socket) || !isMatchingOrigin(request, serverBaseUrl)) {\n // NOTE: `socket.close` nicely closes the websocket, which will still allow incoming messages\n // `socket.terminate` instead forcefully closes down the socket\n socket.terminate();\n }\n });\n\n return {\n debugMiddleware(req, res, next) {\n // The debugger middleware is skipped entirely if the connection isn't a loopback request\n if (isLocalSocket(req.socket)) {\n return middleware(req, res, next);\n } else {\n return next();\n }\n },\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 if (message.method.startsWith('Network.')) {\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","projectRoot","serverBaseUrl","createDevMiddleware","middleware","websocketEndpoints","logger","createLogger","chalk","bold","unstable_customInspectorMessageHandler","createHandlersFactory","unstable_experiments","enableNetworkInspector","enableOpenDebuggerRedirect","env","EXPO_DEBUG","debuggerWebsocketEndpoint","createNetworkWebsocket","on","socket","request","isLocalSocket","isMatchingOrigin","terminate","debugMiddleware","req","res","next","debugWebsocketEndpoints","logPrefix","info","args","Log","log","warn","error","debuggerWebsocket","wss","WebSocketServer","noServer","perMessageDeflate","maxPayload","networkSocket","data","message","JSON","parse","toString","method","params","requestId","requestInfo","NETWORK_RESPONSE_STORAGE","set","startsWith","clients","forEach","debuggerSocket","readyState","OPEN","send"],"mappings":"AAAA;;;;+BAsBgBA,uBAAqB;;aAArBA,qBAAqB;;;8DAtBnB,OAAO;;;;;;;yBAEO,IAAI;;;;;;uCAEE,yBAAyB;iCACtB,mCAAmC;qBACxD,iBAAiB;qBACjB,uBAAuB;qBACK,uBAAuB;;;;;;AAEvE,MAAMC,KAAK,GAAGC,OAAO,CAAC,OAAO,CAAC,CAAC,iCAAiC,CAAC,AAAsB,AAAC;AAYjF,SAASF,qBAAqB,CAAC,EACpCG,WAAW,CAAA,EACXC,aAAa,CAAA,EACS,EAAmB;IACzC,qDAAqD;IACrD,kDAAkD;IAClD,MAAM,EAAEC,mBAAmB,CAAA,EAAE,GAC3BH,OAAO,CAAC,8BAA8B,CAAC,AAAiD,AAAC;IAE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AAC,UAAU,CAAC,EAAE;oBAChD,iFAAiF;oBACjFlB,iBAAiB,CAACmB,OAAO,CAACC,OAAO,CAAC,CAACC,cAAc,GAAK;wBACpD,IAAIA,cAAc,CAACC,UAAU,KAAKD,cAAc,CAACE,IAAI,EAAE;4BACrDF,cAAc,CAACG,IAAI,CAACjB,IAAI,CAACI,QAAQ,EAAE,CAAC,CAAC;wBACvC,CAAC;oBACH,CAAC,CAAC,CAAC;gBACL,CAAC;YACH,EAAE,OAAOZ,KAAK,EAAE;gBACdrC,KAAK,CAAC,oCAAoC,EAAEqC,KAAK,CAAC,CAAC;YACrD,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAOE,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -219,11 +219,19 @@ async function instantiateMetroAsync(metroBundler, options, { isExporting , exp
|
|
|
219
219
|
});
|
|
220
220
|
// Create the core middleware stack for Metro, including websocket listeners
|
|
221
221
|
const { middleware , messagesSocket , eventsSocket , websocketEndpoints } = (0, _createMetroMiddleware.createMetroMiddleware)(metroConfig);
|
|
222
|
+
// Get local URL to Metro bundler server (typically configured as 127.0.0.1:8081)
|
|
223
|
+
const serverBaseUrl = metroBundler.getUrlCreator().constructUrl({
|
|
224
|
+
scheme: "http",
|
|
225
|
+
hostType: "localhost"
|
|
226
|
+
});
|
|
222
227
|
if (!isExporting) {
|
|
223
228
|
// Enable correct CORS headers for Expo Router features
|
|
224
229
|
(0, _mutations.prependMiddleware)(middleware, (0, _corsMiddleware.createCorsMiddleware)(exp));
|
|
225
230
|
// Enable debug middleware for CDP-related debugging
|
|
226
|
-
const { debugMiddleware , debugWebsocketEndpoints } = (0, _createDebugMiddleware.createDebugMiddleware)(
|
|
231
|
+
const { debugMiddleware , debugWebsocketEndpoints } = (0, _createDebugMiddleware.createDebugMiddleware)({
|
|
232
|
+
projectRoot: metroBundler.projectRoot,
|
|
233
|
+
serverBaseUrl
|
|
234
|
+
});
|
|
227
235
|
Object.assign(websocketEndpoints, debugWebsocketEndpoints);
|
|
228
236
|
middleware.use(debugMiddleware);
|
|
229
237
|
middleware.use("/_expo/debugger", (0, _createJsInspectorMiddleware.createJsInspectorMiddleware)());
|
|
@@ -238,6 +246,8 @@ async function instantiateMetroAsync(metroBundler, options, { isExporting , exp
|
|
|
238
246
|
}
|
|
239
247
|
return middleware.use(metroMiddleware);
|
|
240
248
|
};
|
|
249
|
+
const devtoolsWebsocketEndpoints = (0, _devToolsPluginWebsocketEndpoint.createDevToolsPluginWebsocketEndpoint)();
|
|
250
|
+
Object.assign(websocketEndpoints, devtoolsWebsocketEndpoints);
|
|
241
251
|
}
|
|
242
252
|
// Attach Expo Atlas if enabled
|
|
243
253
|
await (0, _attachAtlas.attachAtlasAsync)({
|
|
@@ -250,10 +260,7 @@ async function instantiateMetroAsync(metroBundler, options, { isExporting , exp
|
|
|
250
260
|
resetAtlasFile: isExporting
|
|
251
261
|
});
|
|
252
262
|
const { server , hmrServer , metro } = await (0, _runServerFork.runServer)(metroBundler, metroConfig, {
|
|
253
|
-
websocketEndpoints
|
|
254
|
-
...websocketEndpoints,
|
|
255
|
-
...(0, _devToolsPluginWebsocketEndpoint.createDevToolsPluginWebsocketEndpoint)()
|
|
256
|
-
},
|
|
263
|
+
websocketEndpoints,
|
|
257
264
|
watch: !isExporting && isWatchEnabled()
|
|
258
265
|
}, {
|
|
259
266
|
mockServer: isExporting
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/start/server/metro/instantiateMetro.ts"],"sourcesContent":["import { ExpoConfig, getConfig } from '@expo/config';\nimport { getMetroServerRoot } from '@expo/config/paths';\nimport { getDefaultConfig, LoadOptions } from '@expo/metro-config';\nimport chalk from 'chalk';\nimport http from 'http';\nimport type Metro from 'metro';\nimport { ReadOnlyGraph } from 'metro';\nimport Bundler from 'metro/src/Bundler';\nimport hmrJSBundle from 'metro/src/DeltaBundler/Serializers/hmrJSBundle';\nimport type { TransformOptions } from 'metro/src/DeltaBundler/Worker';\nimport MetroHmrServer from 'metro/src/HmrServer';\nimport RevisionNotFoundError from 'metro/src/IncrementalBundler/RevisionNotFoundError';\nimport formatBundlingError from 'metro/src/lib/formatBundlingError';\nimport { loadConfig, resolveConfig, ConfigT } from 'metro-config';\nimport { Terminal } from 'metro-core';\nimport util from 'node:util';\nimport path from 'path';\n\nimport { createDevToolsPluginWebsocketEndpoint } from './DevToolsPluginWebsocketEndpoint';\nimport { MetroBundlerDevServer } from './MetroBundlerDevServer';\nimport { MetroTerminalReporter } from './MetroTerminalReporter';\nimport { attachAtlasAsync } from './debugging/attachAtlas';\nimport { createDebugMiddleware } from './debugging/createDebugMiddleware';\nimport { createMetroMiddleware } from './dev-server/createMetroMiddleware';\nimport { runServer } from './runServer-fork';\nimport { withMetroMultiPlatformAsync } from './withMetroMultiPlatform';\nimport { Log } from '../../../log';\nimport { env } from '../../../utils/env';\nimport { CommandError } from '../../../utils/errors';\nimport { createCorsMiddleware } from '../middleware/CorsMiddleware';\nimport { createJsInspectorMiddleware } from '../middleware/inspector/createJsInspectorMiddleware';\nimport { prependMiddleware } from '../middleware/mutations';\nimport { getPlatformBundlers } from '../platformBundlers';\n\n// From expo/dev-server but with ability to use custom logger.\ntype MessageSocket = {\n broadcast: (method: string, params?: Record<string, any> | undefined) => void;\n};\n\n// Wrap terminal and polyfill console.log so we can log during bundling without breaking the indicator.\nclass LogRespectingTerminal extends Terminal {\n constructor(stream: import('node:net').Socket | import('node:stream').Writable) {\n super(stream);\n\n const sendLog = (...args: any[]) => {\n this._logLines.push(\n // format args like console.log\n util.format(...args)\n );\n this._scheduleUpdate();\n\n // Flush the logs to the terminal immediately so logs at the end of the process are not lost.\n this.flush();\n };\n\n console.log = sendLog;\n console.info = sendLog;\n }\n}\n\n// Share one instance of Terminal for all instances of Metro.\nconst terminal = new LogRespectingTerminal(process.stdout);\n\nexport async function loadMetroConfigAsync(\n projectRoot: string,\n options: LoadOptions,\n {\n exp,\n isExporting,\n getMetroBundler,\n }: { exp: ExpoConfig; isExporting: boolean; getMetroBundler: () => Bundler }\n) {\n let reportEvent: ((event: any) => void) | undefined;\n\n const serverActionsEnabled =\n exp.experiments?.reactServerFunctions ?? env.EXPO_UNSTABLE_SERVER_FUNCTIONS;\n\n if (serverActionsEnabled) {\n process.env.EXPO_UNSTABLE_SERVER_FUNCTIONS = '1';\n }\n\n // NOTE: Enable all the experimental Metro flags when RSC is enabled.\n if (exp.experiments?.reactServerComponentRoutes || serverActionsEnabled) {\n process.env.EXPO_USE_METRO_REQUIRE = '1';\n process.env.EXPO_USE_FAST_RESOLVER = '1';\n }\n\n const serverRoot = getMetroServerRoot(projectRoot);\n const terminalReporter = new MetroTerminalReporter(serverRoot, terminal);\n\n const hasConfig = await resolveConfig(options.config, projectRoot);\n let config: ConfigT = {\n ...(await loadConfig(\n { cwd: projectRoot, projectRoot, ...options },\n // If the project does not have a metro.config.js, then we use the default config.\n hasConfig.isEmpty ? getDefaultConfig(projectRoot) : undefined\n )),\n reporter: {\n update(event: any) {\n terminalReporter.update(event);\n if (reportEvent) {\n reportEvent(event);\n }\n },\n },\n };\n\n // @ts-expect-error: Set the global require cycle ignore patterns for SSR bundles. This won't work with custom global prefixes, but we don't use those.\n globalThis.__requireCycleIgnorePatterns = config.resolver?.requireCycleIgnorePatterns;\n\n if (isExporting) {\n // This token will be used in the asset plugin to ensure the path is correct for writing locally.\n // @ts-expect-error: typed as readonly.\n config.transformer.publicPath = `/assets?export_path=${\n (exp.experiments?.baseUrl ?? '') + '/assets'\n }`;\n } else {\n // @ts-expect-error: typed as readonly\n config.transformer.publicPath = '/assets/?unstable_path=.';\n }\n\n const platformBundlers = getPlatformBundlers(projectRoot, exp);\n\n if (exp.experiments?.reactCompiler) {\n Log.warn(`Experimental React Compiler is enabled.`);\n }\n\n if (env.EXPO_UNSTABLE_TREE_SHAKING && !env.EXPO_UNSTABLE_METRO_OPTIMIZE_GRAPH) {\n throw new CommandError(\n 'EXPO_UNSTABLE_TREE_SHAKING requires EXPO_UNSTABLE_METRO_OPTIMIZE_GRAPH to be enabled.'\n );\n }\n\n if (env.EXPO_UNSTABLE_METRO_OPTIMIZE_GRAPH) {\n Log.warn(`Experimental bundle optimization is enabled.`);\n }\n if (env.EXPO_UNSTABLE_TREE_SHAKING) {\n Log.warn(`Experimental tree shaking is enabled.`);\n }\n\n if (serverActionsEnabled) {\n Log.warn(\n `Experimental React Server Functions are enabled. Production exports are not supported yet.`\n );\n if (!exp.experiments?.reactServerComponentRoutes) {\n Log.warn(\n `- React Server Component routes are NOT enabled. Routes will render in client mode.`\n );\n }\n }\n\n config = await withMetroMultiPlatformAsync(projectRoot, {\n config,\n exp,\n platformBundlers,\n isTsconfigPathsEnabled: exp.experiments?.tsconfigPaths ?? true,\n isFastResolverEnabled: env.EXPO_USE_FAST_RESOLVER,\n isExporting,\n isReactCanaryEnabled:\n (exp.experiments?.reactServerComponentRoutes ||\n serverActionsEnabled ||\n exp.experiments?.reactCanary) ??\n false,\n isNamedRequiresEnabled: env.EXPO_USE_METRO_REQUIRE,\n isReactServerComponentsEnabled: !!exp.experiments?.reactServerComponentRoutes,\n getMetroBundler,\n });\n\n return {\n config,\n setEventReporter: (logger: (event: any) => void) => (reportEvent = logger),\n reporter: terminalReporter,\n };\n}\n\n/** The most generic possible setup for Metro bundler. */\nexport async function instantiateMetroAsync(\n metroBundler: MetroBundlerDevServer,\n options: Omit<LoadOptions, 'logger'>,\n {\n isExporting,\n exp = getConfig(metroBundler.projectRoot, {\n skipSDKVersionRequirement: true,\n }).exp,\n }: { isExporting: boolean; exp?: ExpoConfig }\n): Promise<{\n metro: Metro.Server;\n hmrServer: MetroHmrServer | null;\n server: http.Server;\n middleware: any;\n messageSocket: MessageSocket;\n}> {\n const projectRoot = metroBundler.projectRoot;\n\n const { config: metroConfig, setEventReporter } = await loadMetroConfigAsync(\n projectRoot,\n options,\n {\n exp,\n isExporting,\n getMetroBundler() {\n return metro.getBundler().getBundler();\n },\n }\n );\n\n // Create the core middleware stack for Metro, including websocket listeners\n const { middleware, messagesSocket, eventsSocket, websocketEndpoints } =\n createMetroMiddleware(metroConfig);\n\n if (!isExporting) {\n // Enable correct CORS headers for Expo Router features\n prependMiddleware(middleware, createCorsMiddleware(exp));\n\n // Enable debug middleware for CDP-related debugging\n const { debugMiddleware, debugWebsocketEndpoints } = createDebugMiddleware(metroBundler);\n Object.assign(websocketEndpoints, debugWebsocketEndpoints);\n middleware.use(debugMiddleware);\n middleware.use('/_expo/debugger', createJsInspectorMiddleware());\n\n // TODO(cedric): `enhanceMiddleware` is deprecated, but is currently used to unify the middleware stacks\n // See: https://github.com/facebook/metro/commit/22e85fde85ec454792a1b70eba4253747a2587a9\n // See: https://github.com/facebook/metro/commit/d0d554381f119bb80ab09dbd6a1d310b54737e52\n const customEnhanceMiddleware = metroConfig.server.enhanceMiddleware;\n // @ts-expect-error: can't mutate readonly config\n metroConfig.server.enhanceMiddleware = (metroMiddleware: any, server: Metro.Server) => {\n if (customEnhanceMiddleware) {\n metroMiddleware = customEnhanceMiddleware(metroMiddleware, server);\n }\n return middleware.use(metroMiddleware);\n };\n }\n\n // Attach Expo Atlas if enabled\n await attachAtlasAsync({\n isExporting,\n exp,\n projectRoot,\n middleware,\n metroConfig,\n // NOTE(cedric): reset the Atlas file once, and reuse it for static exports\n resetAtlasFile: isExporting,\n });\n\n const { server, hmrServer, metro } = await runServer(\n metroBundler,\n metroConfig,\n {\n websocketEndpoints: {\n ...websocketEndpoints,\n ...createDevToolsPluginWebsocketEndpoint(),\n },\n watch: !isExporting && isWatchEnabled(),\n },\n {\n mockServer: isExporting,\n }\n );\n\n // Patch transform file to remove inconvenient customTransformOptions which are only used in single well-known files.\n const originalTransformFile = metro\n .getBundler()\n .getBundler()\n .transformFile.bind(metro.getBundler().getBundler());\n\n metro.getBundler().getBundler().transformFile = async function (\n filePath: string,\n transformOptions: TransformOptions,\n fileBuffer?: Buffer\n ) {\n return originalTransformFile(\n filePath,\n pruneCustomTransformOptions(\n filePath,\n // Clone the options so we don't mutate the original.\n {\n ...transformOptions,\n customTransformOptions: {\n __proto__: null,\n ...transformOptions.customTransformOptions,\n },\n }\n ),\n fileBuffer\n );\n };\n\n setEventReporter(eventsSocket.reportMetroEvent);\n\n // This function ensures that modules in source maps are sorted in the same\n // order as in a plain JS bundle.\n metro._getSortedModules = function (this: Metro.Server, graph: ReadOnlyGraph) {\n const modules = [...graph.dependencies.values()];\n\n const ctx = {\n platform: graph.transformOptions.platform,\n environment: graph.transformOptions.customTransformOptions?.environment,\n };\n // Assign IDs to modules in a consistent order\n for (const module of modules) {\n // @ts-expect-error\n this._createModuleId(module.path, ctx);\n }\n // Sort by IDs\n return modules.sort(\n // @ts-expect-error\n (a, b) => this._createModuleId(a.path, ctx) - this._createModuleId(b.path, ctx)\n );\n };\n\n if (hmrServer) {\n // Patch HMR Server to send more info to the `_createModuleId` function for deterministic module IDs.\n hmrServer._prepareMessage = async function (this: MetroHmrServer, group, options, changeEvent) {\n // Fork of https://github.com/facebook/metro/blob/3b3e0aaf725cfa6907bf2c8b5fbc0da352d29efe/packages/metro/src/HmrServer.js#L327-L393\n // with patch for `_createModuleId`.\n const logger = !options.isInitialUpdate ? changeEvent?.logger : null;\n try {\n const revPromise = this._bundler.getRevision(group.revisionId);\n if (!revPromise) {\n return {\n type: 'error',\n body: formatBundlingError(new RevisionNotFoundError(group.revisionId)),\n };\n }\n logger?.point('updateGraph_start');\n const { revision, delta } = await this._bundler.updateGraph(await revPromise, false);\n logger?.point('updateGraph_end');\n this._clientGroups.delete(group.revisionId);\n group.revisionId = revision.id;\n for (const client of group.clients) {\n client.revisionIds = client.revisionIds.filter(\n (revisionId) => revisionId !== group.revisionId\n );\n client.revisionIds.push(revision.id);\n }\n this._clientGroups.set(group.revisionId, group);\n logger?.point('serialize_start');\n // NOTE(EvanBacon): This is the patch\n const moduleIdContext = {\n platform: revision.graph.transformOptions.platform,\n environment: revision.graph.transformOptions.customTransformOptions?.environment,\n };\n const hmrUpdate = hmrJSBundle(delta, revision.graph, {\n clientUrl: group.clientUrl,\n // NOTE(EvanBacon): This is also the patch\n createModuleId: (moduleId: string) => {\n // @ts-expect-error\n return this._createModuleId(moduleId, moduleIdContext);\n },\n includeAsyncPaths: group.graphOptions.lazy,\n projectRoot: this._config.projectRoot,\n serverRoot: this._config.server.unstable_serverRoot ?? this._config.projectRoot,\n });\n logger?.point('serialize_end');\n return {\n type: 'update',\n body: {\n revisionId: revision.id,\n isInitialUpdate: options.isInitialUpdate,\n ...hmrUpdate,\n },\n };\n } catch (error: any) {\n const formattedError = formatBundlingError(error);\n this._config.reporter.update({\n type: 'bundling_error',\n error,\n });\n return {\n type: 'error',\n body: formattedError,\n };\n }\n };\n }\n\n return {\n metro,\n hmrServer,\n server,\n middleware,\n messageSocket: messagesSocket,\n };\n}\n\n// TODO: Fork the entire transform function so we can simply regex the file contents for keywords instead.\nfunction pruneCustomTransformOptions(\n filePath: string,\n transformOptions: TransformOptions\n): TransformOptions {\n // Normalize the filepath for cross platform checking.\n filePath = filePath.split(path.sep).join('/');\n\n if (\n transformOptions.customTransformOptions?.dom &&\n // The only generated file that needs the dom root is `expo/dom/entry.js`\n !filePath.match(/expo\\/dom\\/entry\\.js$/)\n ) {\n // Clear the dom root option if we aren't transforming the magic entry file, this ensures\n // that cached artifacts from other DOM component bundles can be reused.\n transformOptions.customTransformOptions.dom = 'true';\n }\n\n if (\n transformOptions.customTransformOptions?.routerRoot &&\n // The router root is used all over expo-router (`process.env.EXPO_ROUTER_ABS_APP_ROOT`, `process.env.EXPO_ROUTER_APP_ROOT`) so we'll just ignore the entire package.\n !(filePath.match(/\\/expo-router\\/_ctx/) || filePath.match(/\\/expo-router\\/build\\//))\n ) {\n // Set to the default value.\n transformOptions.customTransformOptions.routerRoot = 'app';\n }\n if (\n transformOptions.customTransformOptions?.asyncRoutes &&\n // The async routes settings are also used in `expo-router/_ctx.ios.js` (and other platform variants) via `process.env.EXPO_ROUTER_IMPORT_MODE`\n !(filePath.match(/\\/expo-router\\/_ctx/) || filePath.match(/\\/expo-router\\/build\\//))\n ) {\n delete transformOptions.customTransformOptions.asyncRoutes;\n }\n\n if (\n transformOptions.customTransformOptions?.clientBoundaries &&\n // The client boundaries are only used in `@expo/metro-runtime/src/virtual.js` for production RSC exports.\n !filePath.match(/\\/@expo\\/metro-runtime\\/rsc\\/virtual\\.js$/)\n ) {\n delete transformOptions.customTransformOptions.clientBoundaries;\n }\n\n return transformOptions;\n}\n\n/**\n * Simplify and communicate if Metro is running without watching file updates,.\n * Exposed for testing.\n */\nexport function isWatchEnabled() {\n if (env.CI) {\n Log.log(\n chalk`Metro is running in CI mode, reloads are disabled. Remove {bold CI=true} to enable watch mode.`\n );\n }\n\n return !env.CI;\n}\n"],"names":["loadMetroConfigAsync","instantiateMetroAsync","isWatchEnabled","LogRespectingTerminal","Terminal","constructor","stream","sendLog","args","_logLines","push","util","format","_scheduleUpdate","flush","console","log","info","terminal","process","stdout","projectRoot","options","exp","isExporting","getMetroBundler","config","reportEvent","serverActionsEnabled","experiments","reactServerFunctions","env","EXPO_UNSTABLE_SERVER_FUNCTIONS","reactServerComponentRoutes","EXPO_USE_METRO_REQUIRE","EXPO_USE_FAST_RESOLVER","serverRoot","getMetroServerRoot","terminalReporter","MetroTerminalReporter","hasConfig","resolveConfig","loadConfig","cwd","isEmpty","getDefaultConfig","undefined","reporter","update","event","globalThis","__requireCycleIgnorePatterns","resolver","requireCycleIgnorePatterns","transformer","publicPath","baseUrl","platformBundlers","getPlatformBundlers","reactCompiler","Log","warn","EXPO_UNSTABLE_TREE_SHAKING","EXPO_UNSTABLE_METRO_OPTIMIZE_GRAPH","CommandError","withMetroMultiPlatformAsync","isTsconfigPathsEnabled","tsconfigPaths","isFastResolverEnabled","isReactCanaryEnabled","reactCanary","isNamedRequiresEnabled","isReactServerComponentsEnabled","setEventReporter","logger","metroBundler","getConfig","skipSDKVersionRequirement","metroConfig","metro","getBundler","middleware","messagesSocket","eventsSocket","websocketEndpoints","createMetroMiddleware","prependMiddleware","createCorsMiddleware","debugMiddleware","debugWebsocketEndpoints","createDebugMiddleware","Object","assign","use","createJsInspectorMiddleware","customEnhanceMiddleware","server","enhanceMiddleware","metroMiddleware","attachAtlasAsync","resetAtlasFile","hmrServer","runServer","createDevToolsPluginWebsocketEndpoint","watch","mockServer","originalTransformFile","transformFile","bind","filePath","transformOptions","fileBuffer","pruneCustomTransformOptions","customTransformOptions","__proto__","reportMetroEvent","_getSortedModules","graph","modules","dependencies","values","ctx","platform","environment","module","_createModuleId","path","sort","a","b","_prepareMessage","group","changeEvent","isInitialUpdate","revision","revPromise","_bundler","getRevision","revisionId","type","body","formatBundlingError","RevisionNotFoundError","point","delta","updateGraph","_clientGroups","delete","id","client","clients","revisionIds","filter","set","moduleIdContext","hmrUpdate","hmrJSBundle","clientUrl","createModuleId","moduleId","includeAsyncPaths","graphOptions","lazy","_config","unstable_serverRoot","error","formattedError","messageSocket","split","sep","join","dom","match","routerRoot","asyncRoutes","clientBoundaries","CI","chalk"],"mappings":"AAAA;;;;;;;;;;;IA+DsBA,oBAAoB,MAApBA,oBAAoB;IAiHpBC,qBAAqB,MAArBA,qBAAqB;IAkQ3BC,cAAc,MAAdA,cAAc;;;yBAlbQ,cAAc;;;;;;;yBACjB,oBAAoB;;;;;;;yBACT,oBAAoB;;;;;;;8DAChD,OAAO;;;;;;;8DAKD,gDAAgD;;;;;;;8DAGtC,oDAAoD;;;;;;;8DACtD,mCAAmC;;;;;;;yBAChB,cAAc;;;;;;;yBACxC,YAAY;;;;;;;8DACpB,WAAW;;;;;;;8DACX,MAAM;;;;;;iDAE+B,mCAAmC;uCAEnD,yBAAyB;6BAC9B,yBAAyB;uCACpB,mCAAmC;uCACnC,oCAAoC;+BAChD,kBAAkB;wCACA,0BAA0B;qBAClD,cAAc;qBACd,oBAAoB;wBACX,uBAAuB;gCACf,8BAA8B;6CACvB,qDAAqD;2BAC/D,yBAAyB;kCACvB,qBAAqB;;;;;;AAOzD,uGAAuG;AACv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EACpF;QACA,4BAA4B;QAC5B9D,gBAAgB,CAACG,sBAAsB,CAAC4D,UAAU,GAAG,KAAK,CAAC;IAC7D,CAAC;IACD,IACE/D,CAAAA,CAAAA,IAAuC,GAAvCA,gBAAgB,CAACG,sBAAsB,SAAa,GAApDH,KAAAA,CAAoD,GAApDA,IAAuC,CAAEgE,WAAW,CAAA,IACpD,+IAA+I;IAC/I,CAAC,CAACjE,QAAQ,CAAC+D,KAAK,uBAAuB,IAAI/D,QAAQ,CAAC+D,KAAK,0BAA0B,CAAC,EACpF;QACA,OAAO9D,gBAAgB,CAACG,sBAAsB,CAAC6D,WAAW,CAAC;IAC7D,CAAC;IAED,IACEhE,CAAAA,CAAAA,IAAuC,GAAvCA,gBAAgB,CAACG,sBAAsB,SAAkB,GAAzDH,KAAAA,CAAyD,GAAzDA,IAAuC,CAAEiE,gBAAgB,CAAA,IACzD,0GAA0G;IAC1G,CAAClE,QAAQ,CAAC+D,KAAK,6CAA6C,EAC5D;QACA,OAAO9D,gBAAgB,CAACG,sBAAsB,CAAC8D,gBAAgB,CAAC;IAClE,CAAC;IAED,OAAOjE,gBAAgB,CAAC;AAC1B,CAAC;AAMM,SAAS5G,cAAc,GAAG;IAC/B,IAAI6B,IAAG,IAAA,CAACiJ,EAAE,EAAE;QACVpH,IAAG,IAAA,CAAC5C,GAAG,CACLiK,IAAAA,MAAK,EAAA,QAAA,CAAA,CAAC,8FAA8F,CAAC,CACtG,CAAC;IACJ,CAAC;IAED,OAAO,CAAClJ,IAAG,IAAA,CAACiJ,EAAE,CAAC;AACjB,CAAC"}
|
|
1
|
+
{"version":3,"sources":["../../../../../src/start/server/metro/instantiateMetro.ts"],"sourcesContent":["import { ExpoConfig, getConfig } from '@expo/config';\nimport { getMetroServerRoot } from '@expo/config/paths';\nimport { getDefaultConfig, LoadOptions } from '@expo/metro-config';\nimport chalk from 'chalk';\nimport http from 'http';\nimport type Metro from 'metro';\nimport { ReadOnlyGraph } from 'metro';\nimport Bundler from 'metro/src/Bundler';\nimport hmrJSBundle from 'metro/src/DeltaBundler/Serializers/hmrJSBundle';\nimport type { TransformOptions } from 'metro/src/DeltaBundler/Worker';\nimport MetroHmrServer from 'metro/src/HmrServer';\nimport RevisionNotFoundError from 'metro/src/IncrementalBundler/RevisionNotFoundError';\nimport formatBundlingError from 'metro/src/lib/formatBundlingError';\nimport { loadConfig, resolveConfig, ConfigT } from 'metro-config';\nimport { Terminal } from 'metro-core';\nimport util from 'node:util';\nimport path from 'path';\n\nimport { createDevToolsPluginWebsocketEndpoint } from './DevToolsPluginWebsocketEndpoint';\nimport { MetroBundlerDevServer } from './MetroBundlerDevServer';\nimport { MetroTerminalReporter } from './MetroTerminalReporter';\nimport { attachAtlasAsync } from './debugging/attachAtlas';\nimport { createDebugMiddleware } from './debugging/createDebugMiddleware';\nimport { createMetroMiddleware } from './dev-server/createMetroMiddleware';\nimport { runServer } from './runServer-fork';\nimport { withMetroMultiPlatformAsync } from './withMetroMultiPlatform';\nimport { Log } from '../../../log';\nimport { env } from '../../../utils/env';\nimport { CommandError } from '../../../utils/errors';\nimport { createCorsMiddleware } from '../middleware/CorsMiddleware';\nimport { createJsInspectorMiddleware } from '../middleware/inspector/createJsInspectorMiddleware';\nimport { prependMiddleware } from '../middleware/mutations';\nimport { getPlatformBundlers } from '../platformBundlers';\n\n// From expo/dev-server but with ability to use custom logger.\ntype MessageSocket = {\n broadcast: (method: string, params?: Record<string, any> | undefined) => void;\n};\n\n// Wrap terminal and polyfill console.log so we can log during bundling without breaking the indicator.\nclass LogRespectingTerminal extends Terminal {\n constructor(stream: import('node:net').Socket | import('node:stream').Writable) {\n super(stream);\n\n const sendLog = (...args: any[]) => {\n this._logLines.push(\n // format args like console.log\n util.format(...args)\n );\n this._scheduleUpdate();\n\n // Flush the logs to the terminal immediately so logs at the end of the process are not lost.\n this.flush();\n };\n\n console.log = sendLog;\n console.info = sendLog;\n }\n}\n\n// Share one instance of Terminal for all instances of Metro.\nconst terminal = new LogRespectingTerminal(process.stdout);\n\nexport async function loadMetroConfigAsync(\n projectRoot: string,\n options: LoadOptions,\n {\n exp,\n isExporting,\n getMetroBundler,\n }: { exp: ExpoConfig; isExporting: boolean; getMetroBundler: () => Bundler }\n) {\n let reportEvent: ((event: any) => void) | undefined;\n\n const serverActionsEnabled =\n exp.experiments?.reactServerFunctions ?? env.EXPO_UNSTABLE_SERVER_FUNCTIONS;\n\n if (serverActionsEnabled) {\n process.env.EXPO_UNSTABLE_SERVER_FUNCTIONS = '1';\n }\n\n // NOTE: Enable all the experimental Metro flags when RSC is enabled.\n if (exp.experiments?.reactServerComponentRoutes || serverActionsEnabled) {\n process.env.EXPO_USE_METRO_REQUIRE = '1';\n process.env.EXPO_USE_FAST_RESOLVER = '1';\n }\n\n const serverRoot = getMetroServerRoot(projectRoot);\n const terminalReporter = new MetroTerminalReporter(serverRoot, terminal);\n\n const hasConfig = await resolveConfig(options.config, projectRoot);\n let config: ConfigT = {\n ...(await loadConfig(\n { cwd: projectRoot, projectRoot, ...options },\n // If the project does not have a metro.config.js, then we use the default config.\n hasConfig.isEmpty ? getDefaultConfig(projectRoot) : undefined\n )),\n reporter: {\n update(event: any) {\n terminalReporter.update(event);\n if (reportEvent) {\n reportEvent(event);\n }\n },\n },\n };\n\n // @ts-expect-error: Set the global require cycle ignore patterns for SSR bundles. This won't work with custom global prefixes, but we don't use those.\n globalThis.__requireCycleIgnorePatterns = config.resolver?.requireCycleIgnorePatterns;\n\n if (isExporting) {\n // This token will be used in the asset plugin to ensure the path is correct for writing locally.\n // @ts-expect-error: typed as readonly.\n config.transformer.publicPath = `/assets?export_path=${\n (exp.experiments?.baseUrl ?? '') + '/assets'\n }`;\n } else {\n // @ts-expect-error: typed as readonly\n config.transformer.publicPath = '/assets/?unstable_path=.';\n }\n\n const platformBundlers = getPlatformBundlers(projectRoot, exp);\n\n if (exp.experiments?.reactCompiler) {\n Log.warn(`Experimental React Compiler is enabled.`);\n }\n\n if (env.EXPO_UNSTABLE_TREE_SHAKING && !env.EXPO_UNSTABLE_METRO_OPTIMIZE_GRAPH) {\n throw new CommandError(\n 'EXPO_UNSTABLE_TREE_SHAKING requires EXPO_UNSTABLE_METRO_OPTIMIZE_GRAPH to be enabled.'\n );\n }\n\n if (env.EXPO_UNSTABLE_METRO_OPTIMIZE_GRAPH) {\n Log.warn(`Experimental bundle optimization is enabled.`);\n }\n if (env.EXPO_UNSTABLE_TREE_SHAKING) {\n Log.warn(`Experimental tree shaking is enabled.`);\n }\n\n if (serverActionsEnabled) {\n Log.warn(\n `Experimental React Server Functions are enabled. Production exports are not supported yet.`\n );\n if (!exp.experiments?.reactServerComponentRoutes) {\n Log.warn(\n `- React Server Component routes are NOT enabled. Routes will render in client mode.`\n );\n }\n }\n\n config = await withMetroMultiPlatformAsync(projectRoot, {\n config,\n exp,\n platformBundlers,\n isTsconfigPathsEnabled: exp.experiments?.tsconfigPaths ?? true,\n isFastResolverEnabled: env.EXPO_USE_FAST_RESOLVER,\n isExporting,\n isReactCanaryEnabled:\n (exp.experiments?.reactServerComponentRoutes ||\n serverActionsEnabled ||\n exp.experiments?.reactCanary) ??\n false,\n isNamedRequiresEnabled: env.EXPO_USE_METRO_REQUIRE,\n isReactServerComponentsEnabled: !!exp.experiments?.reactServerComponentRoutes,\n getMetroBundler,\n });\n\n return {\n config,\n setEventReporter: (logger: (event: any) => void) => (reportEvent = logger),\n reporter: terminalReporter,\n };\n}\n\n/** The most generic possible setup for Metro bundler. */\nexport async function instantiateMetroAsync(\n metroBundler: MetroBundlerDevServer,\n options: Omit<LoadOptions, 'logger'>,\n {\n isExporting,\n exp = getConfig(metroBundler.projectRoot, {\n skipSDKVersionRequirement: true,\n }).exp,\n }: { isExporting: boolean; exp?: ExpoConfig }\n): Promise<{\n metro: Metro.Server;\n hmrServer: MetroHmrServer | null;\n server: http.Server;\n middleware: any;\n messageSocket: MessageSocket;\n}> {\n const projectRoot = metroBundler.projectRoot;\n\n const { config: metroConfig, setEventReporter } = await loadMetroConfigAsync(\n projectRoot,\n options,\n {\n exp,\n isExporting,\n getMetroBundler() {\n return metro.getBundler().getBundler();\n },\n }\n );\n\n // Create the core middleware stack for Metro, including websocket listeners\n const { middleware, messagesSocket, eventsSocket, websocketEndpoints } =\n createMetroMiddleware(metroConfig);\n\n // Get local URL to Metro bundler server (typically configured as 127.0.0.1:8081)\n const serverBaseUrl = metroBundler\n .getUrlCreator()\n .constructUrl({ scheme: 'http', hostType: 'localhost' });\n\n if (!isExporting) {\n // Enable correct CORS headers for Expo Router features\n prependMiddleware(middleware, createCorsMiddleware(exp));\n\n // Enable debug middleware for CDP-related debugging\n const { debugMiddleware, debugWebsocketEndpoints } = createDebugMiddleware({\n projectRoot: metroBundler.projectRoot,\n serverBaseUrl,\n });\n Object.assign(websocketEndpoints, debugWebsocketEndpoints);\n middleware.use(debugMiddleware);\n middleware.use('/_expo/debugger', createJsInspectorMiddleware());\n\n // TODO(cedric): `enhanceMiddleware` is deprecated, but is currently used to unify the middleware stacks\n // See: https://github.com/facebook/metro/commit/22e85fde85ec454792a1b70eba4253747a2587a9\n // See: https://github.com/facebook/metro/commit/d0d554381f119bb80ab09dbd6a1d310b54737e52\n const customEnhanceMiddleware = metroConfig.server.enhanceMiddleware;\n // @ts-expect-error: can't mutate readonly config\n metroConfig.server.enhanceMiddleware = (metroMiddleware: any, server: Metro.Server) => {\n if (customEnhanceMiddleware) {\n metroMiddleware = customEnhanceMiddleware(metroMiddleware, server);\n }\n return middleware.use(metroMiddleware);\n };\n\n const devtoolsWebsocketEndpoints = createDevToolsPluginWebsocketEndpoint();\n Object.assign(websocketEndpoints, devtoolsWebsocketEndpoints);\n }\n\n // Attach Expo Atlas if enabled\n await attachAtlasAsync({\n isExporting,\n exp,\n projectRoot,\n middleware,\n metroConfig,\n // NOTE(cedric): reset the Atlas file once, and reuse it for static exports\n resetAtlasFile: isExporting,\n });\n\n const { server, hmrServer, metro } = await runServer(\n metroBundler,\n metroConfig,\n {\n websocketEndpoints,\n watch: !isExporting && isWatchEnabled(),\n },\n {\n mockServer: isExporting,\n }\n );\n\n // Patch transform file to remove inconvenient customTransformOptions which are only used in single well-known files.\n const originalTransformFile = metro\n .getBundler()\n .getBundler()\n .transformFile.bind(metro.getBundler().getBundler());\n\n metro.getBundler().getBundler().transformFile = async function (\n filePath: string,\n transformOptions: TransformOptions,\n fileBuffer?: Buffer\n ) {\n return originalTransformFile(\n filePath,\n pruneCustomTransformOptions(\n filePath,\n // Clone the options so we don't mutate the original.\n {\n ...transformOptions,\n customTransformOptions: {\n __proto__: null,\n ...transformOptions.customTransformOptions,\n },\n }\n ),\n fileBuffer\n );\n };\n\n setEventReporter(eventsSocket.reportMetroEvent);\n\n // This function ensures that modules in source maps are sorted in the same\n // order as in a plain JS bundle.\n metro._getSortedModules = function (this: Metro.Server, graph: ReadOnlyGraph) {\n const modules = [...graph.dependencies.values()];\n\n const ctx = {\n platform: graph.transformOptions.platform,\n environment: graph.transformOptions.customTransformOptions?.environment,\n };\n // Assign IDs to modules in a consistent order\n for (const module of modules) {\n // @ts-expect-error\n this._createModuleId(module.path, ctx);\n }\n // Sort by IDs\n return modules.sort(\n // @ts-expect-error\n (a, b) => this._createModuleId(a.path, ctx) - this._createModuleId(b.path, ctx)\n );\n };\n\n if (hmrServer) {\n // Patch HMR Server to send more info to the `_createModuleId` function for deterministic module IDs.\n hmrServer._prepareMessage = async function (this: MetroHmrServer, group, options, changeEvent) {\n // Fork of https://github.com/facebook/metro/blob/3b3e0aaf725cfa6907bf2c8b5fbc0da352d29efe/packages/metro/src/HmrServer.js#L327-L393\n // with patch for `_createModuleId`.\n const logger = !options.isInitialUpdate ? changeEvent?.logger : null;\n try {\n const revPromise = this._bundler.getRevision(group.revisionId);\n if (!revPromise) {\n return {\n type: 'error',\n body: formatBundlingError(new RevisionNotFoundError(group.revisionId)),\n };\n }\n logger?.point('updateGraph_start');\n const { revision, delta } = await this._bundler.updateGraph(await revPromise, false);\n logger?.point('updateGraph_end');\n this._clientGroups.delete(group.revisionId);\n group.revisionId = revision.id;\n for (const client of group.clients) {\n client.revisionIds = client.revisionIds.filter(\n (revisionId) => revisionId !== group.revisionId\n );\n client.revisionIds.push(revision.id);\n }\n this._clientGroups.set(group.revisionId, group);\n logger?.point('serialize_start');\n // NOTE(EvanBacon): This is the patch\n const moduleIdContext = {\n platform: revision.graph.transformOptions.platform,\n environment: revision.graph.transformOptions.customTransformOptions?.environment,\n };\n const hmrUpdate = hmrJSBundle(delta, revision.graph, {\n clientUrl: group.clientUrl,\n // NOTE(EvanBacon): This is also the patch\n createModuleId: (moduleId: string) => {\n // @ts-expect-error\n return this._createModuleId(moduleId, moduleIdContext);\n },\n includeAsyncPaths: group.graphOptions.lazy,\n projectRoot: this._config.projectRoot,\n serverRoot: this._config.server.unstable_serverRoot ?? this._config.projectRoot,\n });\n logger?.point('serialize_end');\n return {\n type: 'update',\n body: {\n revisionId: revision.id,\n isInitialUpdate: options.isInitialUpdate,\n ...hmrUpdate,\n },\n };\n } catch (error: any) {\n const formattedError = formatBundlingError(error);\n this._config.reporter.update({\n type: 'bundling_error',\n error,\n });\n return {\n type: 'error',\n body: formattedError,\n };\n }\n };\n }\n\n return {\n metro,\n hmrServer,\n server,\n middleware,\n messageSocket: messagesSocket,\n };\n}\n\n// TODO: Fork the entire transform function so we can simply regex the file contents for keywords instead.\nfunction pruneCustomTransformOptions(\n filePath: string,\n transformOptions: TransformOptions\n): TransformOptions {\n // Normalize the filepath for cross platform checking.\n filePath = filePath.split(path.sep).join('/');\n\n if (\n transformOptions.customTransformOptions?.dom &&\n // The only generated file that needs the dom root is `expo/dom/entry.js`\n !filePath.match(/expo\\/dom\\/entry\\.js$/)\n ) {\n // Clear the dom root option if we aren't transforming the magic entry file, this ensures\n // that cached artifacts from other DOM component bundles can be reused.\n transformOptions.customTransformOptions.dom = 'true';\n }\n\n if (\n transformOptions.customTransformOptions?.routerRoot &&\n // The router root is used all over expo-router (`process.env.EXPO_ROUTER_ABS_APP_ROOT`, `process.env.EXPO_ROUTER_APP_ROOT`) so we'll just ignore the entire package.\n !(filePath.match(/\\/expo-router\\/_ctx/) || filePath.match(/\\/expo-router\\/build\\//))\n ) {\n // Set to the default value.\n transformOptions.customTransformOptions.routerRoot = 'app';\n }\n if (\n transformOptions.customTransformOptions?.asyncRoutes &&\n // The async routes settings are also used in `expo-router/_ctx.ios.js` (and other platform variants) via `process.env.EXPO_ROUTER_IMPORT_MODE`\n !(filePath.match(/\\/expo-router\\/_ctx/) || filePath.match(/\\/expo-router\\/build\\//))\n ) {\n delete transformOptions.customTransformOptions.asyncRoutes;\n }\n\n if (\n transformOptions.customTransformOptions?.clientBoundaries &&\n // The client boundaries are only used in `@expo/metro-runtime/src/virtual.js` for production RSC exports.\n !filePath.match(/\\/@expo\\/metro-runtime\\/rsc\\/virtual\\.js$/)\n ) {\n delete transformOptions.customTransformOptions.clientBoundaries;\n }\n\n return transformOptions;\n}\n\n/**\n * Simplify and communicate if Metro is running without watching file updates,.\n * Exposed for testing.\n */\nexport function isWatchEnabled() {\n if (env.CI) {\n Log.log(\n chalk`Metro is running in CI mode, reloads are disabled. Remove {bold CI=true} to enable watch mode.`\n );\n }\n\n return !env.CI;\n}\n"],"names":["loadMetroConfigAsync","instantiateMetroAsync","isWatchEnabled","LogRespectingTerminal","Terminal","constructor","stream","sendLog","args","_logLines","push","util","format","_scheduleUpdate","flush","console","log","info","terminal","process","stdout","projectRoot","options","exp","isExporting","getMetroBundler","config","reportEvent","serverActionsEnabled","experiments","reactServerFunctions","env","EXPO_UNSTABLE_SERVER_FUNCTIONS","reactServerComponentRoutes","EXPO_USE_METRO_REQUIRE","EXPO_USE_FAST_RESOLVER","serverRoot","getMetroServerRoot","terminalReporter","MetroTerminalReporter","hasConfig","resolveConfig","loadConfig","cwd","isEmpty","getDefaultConfig","undefined","reporter","update","event","globalThis","__requireCycleIgnorePatterns","resolver","requireCycleIgnorePatterns","transformer","publicPath","baseUrl","platformBundlers","getPlatformBundlers","reactCompiler","Log","warn","EXPO_UNSTABLE_TREE_SHAKING","EXPO_UNSTABLE_METRO_OPTIMIZE_GRAPH","CommandError","withMetroMultiPlatformAsync","isTsconfigPathsEnabled","tsconfigPaths","isFastResolverEnabled","isReactCanaryEnabled","reactCanary","isNamedRequiresEnabled","isReactServerComponentsEnabled","setEventReporter","logger","metroBundler","getConfig","skipSDKVersionRequirement","metroConfig","metro","getBundler","middleware","messagesSocket","eventsSocket","websocketEndpoints","createMetroMiddleware","serverBaseUrl","getUrlCreator","constructUrl","scheme","hostType","prependMiddleware","createCorsMiddleware","debugMiddleware","debugWebsocketEndpoints","createDebugMiddleware","Object","assign","use","createJsInspectorMiddleware","customEnhanceMiddleware","server","enhanceMiddleware","metroMiddleware","devtoolsWebsocketEndpoints","createDevToolsPluginWebsocketEndpoint","attachAtlasAsync","resetAtlasFile","hmrServer","runServer","watch","mockServer","originalTransformFile","transformFile","bind","filePath","transformOptions","fileBuffer","pruneCustomTransformOptions","customTransformOptions","__proto__","reportMetroEvent","_getSortedModules","graph","modules","dependencies","values","ctx","platform","environment","module","_createModuleId","path","sort","a","b","_prepareMessage","group","changeEvent","isInitialUpdate","revision","revPromise","_bundler","getRevision","revisionId","type","body","formatBundlingError","RevisionNotFoundError","point","delta","updateGraph","_clientGroups","delete","id","client","clients","revisionIds","filter","set","moduleIdContext","hmrUpdate","hmrJSBundle","clientUrl","createModuleId","moduleId","includeAsyncPaths","graphOptions","lazy","_config","unstable_serverRoot","error","formattedError","messageSocket","split","sep","join","dom","match","routerRoot","asyncRoutes","clientBoundaries","CI","chalk"],"mappings":"AAAA;;;;;;;;;;;IA+DsBA,oBAAoB,MAApBA,oBAAoB;IAiHpBC,qBAAqB,MAArBA,qBAAqB;IA0Q3BC,cAAc,MAAdA,cAAc;;;yBA1bQ,cAAc;;;;;;;yBACjB,oBAAoB;;;;;;;yBACT,oBAAoB;;;;;;;8DAChD,OAAO;;;;;;;8DAKD,gDAAgD;;;;;;;8DAGtC,oDAAoD;;;;;;;8DACtD,mCAAmC;;;;;;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B,CAAC8D,gBAAgB,CAAC;IAClE,CAAC;IAED,OAAOjE,gBAAgB,CAAC;AAC1B,CAAC;AAMM,SAASlH,cAAc,GAAG;IAC/B,IAAI6B,IAAG,IAAA,CAACuJ,EAAE,EAAE;QACV1H,IAAG,IAAA,CAAC5C,GAAG,CACLuK,IAAAA,MAAK,EAAA,QAAA,CAAA,CAAC,8FAA8F,CAAC,CACtG,CAAC;IACJ,CAAC;IAED,OAAO,CAACxJ,IAAG,IAAA,CAACuJ,EAAE,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
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
|
+
isLocalSocket: ()=>isLocalSocket,
|
|
13
|
+
isMatchingOrigin: ()=>isMatchingOrigin
|
|
14
|
+
});
|
|
15
|
+
const ipv6To4Prefix = "::ffff:";
|
|
16
|
+
const isLocalSocket = (socket)=>{
|
|
17
|
+
let { localAddress , remoteAddress , remoteFamily } = socket;
|
|
18
|
+
const isLoopbackRequest = localAddress && localAddress === remoteAddress;
|
|
19
|
+
if (isLoopbackRequest) {
|
|
20
|
+
return true;
|
|
21
|
+
} else if (!remoteAddress || !remoteFamily) {
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
if (remoteFamily === "IPv6" && remoteAddress.startsWith(ipv6To4Prefix)) {
|
|
25
|
+
remoteAddress = remoteAddress.slice(ipv6To4Prefix.length);
|
|
26
|
+
}
|
|
27
|
+
return remoteAddress === "::1" || remoteAddress.startsWith("127.");
|
|
28
|
+
};
|
|
29
|
+
const isMatchingOrigin = (request, serverBaseUrl)=>{
|
|
30
|
+
// NOTE(@kitten): The browser will always send an origin header for websocket upgrade connections
|
|
31
|
+
if (!request.headers.origin) {
|
|
32
|
+
return true;
|
|
33
|
+
}
|
|
34
|
+
const actualHost = new URL(`${request.headers.origin}`).host;
|
|
35
|
+
const expectedHost = new URL(serverBaseUrl).host;
|
|
36
|
+
return actualHost === expectedHost;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
//# sourceMappingURL=net.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/net.ts"],"sourcesContent":["import type { IncomingHttpHeaders } from 'node:http';\nimport type { Socket } from 'node:net';\n\nconst ipv6To4Prefix = '::ffff:';\n\nexport const isLocalSocket = (socket: Socket): boolean => {\n let { localAddress, remoteAddress, remoteFamily } = socket;\n\n const isLoopbackRequest = localAddress && localAddress === remoteAddress;\n if (isLoopbackRequest) {\n return true;\n } else if (!remoteAddress || !remoteFamily) {\n return false;\n }\n\n if (remoteFamily === 'IPv6' && remoteAddress.startsWith(ipv6To4Prefix)) {\n remoteAddress = remoteAddress.slice(ipv6To4Prefix.length);\n }\n\n return remoteAddress === '::1' || remoteAddress.startsWith('127.');\n};\n\ninterface AbstractIncomingMessage {\n headers: IncomingHttpHeaders | Record<string, string | string[]>;\n}\n\nexport const isMatchingOrigin = (\n request: AbstractIncomingMessage,\n serverBaseUrl: string\n): boolean => {\n // NOTE(@kitten): The browser will always send an origin header for websocket upgrade connections\n if (!request.headers.origin) {\n return true;\n }\n const actualHost = new URL(`${request.headers.origin}`).host;\n const expectedHost = new URL(serverBaseUrl).host;\n return actualHost === expectedHost;\n};\n"],"names":["isLocalSocket","isMatchingOrigin","ipv6To4Prefix","socket","localAddress","remoteAddress","remoteFamily","isLoopbackRequest","startsWith","slice","length","request","serverBaseUrl","headers","origin","actualHost","URL","host","expectedHost"],"mappings":"AAAA;;;;;;;;;;;IAKaA,aAAa,MAAbA,aAAa;IAqBbC,gBAAgB,MAAhBA,gBAAgB;;AAvB7B,MAAMC,aAAa,GAAG,SAAS,AAAC;AAEzB,MAAMF,aAAa,GAAG,CAACG,MAAc,GAAc;IACxD,IAAI,EAAEC,YAAY,CAAA,EAAEC,aAAa,CAAA,EAAEC,YAAY,CAAA,EAAE,GAAGH,MAAM,AAAC;IAE3D,MAAMI,iBAAiB,GAAGH,YAAY,IAAIA,YAAY,KAAKC,aAAa,AAAC;IACzE,IAAIE,iBAAiB,EAAE;QACrB,OAAO,IAAI,CAAC;IACd,OAAO,IAAI,CAACF,aAAa,IAAI,CAACC,YAAY,EAAE;QAC1C,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAIA,YAAY,KAAK,MAAM,IAAID,aAAa,CAACG,UAAU,CAACN,aAAa,CAAC,EAAE;QACtEG,aAAa,GAAGA,aAAa,CAACI,KAAK,CAACP,aAAa,CAACQ,MAAM,CAAC,CAAC;IAC5D,CAAC;IAED,OAAOL,aAAa,KAAK,KAAK,IAAIA,aAAa,CAACG,UAAU,CAAC,MAAM,CAAC,CAAC;AACrE,CAAC,AAAC;AAMK,MAAMP,gBAAgB,GAAG,CAC9BU,OAAgC,EAChCC,aAAqB,GACT;IACZ,iGAAiG;IACjG,IAAI,CAACD,OAAO,CAACE,OAAO,CAACC,MAAM,EAAE;QAC3B,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAMC,UAAU,GAAG,IAAIC,GAAG,CAAC,CAAC,EAAEL,OAAO,CAACE,OAAO,CAACC,MAAM,CAAC,CAAC,CAAC,CAACG,IAAI,AAAC;IAC7D,MAAMC,YAAY,GAAG,IAAIF,GAAG,CAACJ,aAAa,CAAC,CAACK,IAAI,AAAC;IACjD,OAAOF,UAAU,KAAKG,YAAY,CAAC;AACrC,CAAC,AAAC"}
|
|
@@ -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.22.
|
|
34
|
+
"user-agent": `expo-cli/${"0.22.28"}`,
|
|
35
35
|
authorization: "Basic " + _nodeBuffer().Buffer.from(`${target}:`).toString("base64")
|
|
36
36
|
};
|
|
37
37
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expo/cli",
|
|
3
|
-
"version": "0.22.
|
|
3
|
+
"version": "0.22.28",
|
|
4
4
|
"description": "The Expo CLI",
|
|
5
5
|
"main": "build/bin/cli",
|
|
6
6
|
"bin": {
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@0no-co/graphql.web": "^1.0.8",
|
|
43
43
|
"@babel/runtime": "^7.20.0",
|
|
44
|
-
"@expo/code-signing-certificates": "^0.0.
|
|
44
|
+
"@expo/code-signing-certificates": "^0.0.6",
|
|
45
45
|
"@expo/config": "~10.0.11",
|
|
46
46
|
"@expo/config-plugins": "~9.0.17",
|
|
47
47
|
"@expo/devcert": "^1.1.2",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"is-wsl": "^2.1.1",
|
|
84
84
|
"lodash.debounce": "^4.0.8",
|
|
85
85
|
"minimatch": "^3.0.4",
|
|
86
|
-
"node-forge": "^1.3.
|
|
86
|
+
"node-forge": "^1.3.3",
|
|
87
87
|
"npm-package-arg": "^11.0.0",
|
|
88
88
|
"ora": "^3.4.0",
|
|
89
89
|
"picomatch": "^3.0.1",
|
|
@@ -168,5 +168,5 @@
|
|
|
168
168
|
"tree-kill": "^1.2.2",
|
|
169
169
|
"tsd": "^0.28.1"
|
|
170
170
|
},
|
|
171
|
-
"gitHead": "
|
|
171
|
+
"gitHead": "e8d745201d9f24e4f6ca7f977c56741b549c1c15"
|
|
172
172
|
}
|