@expo/cli 55.0.0-canary-20251210-1f163e3 → 55.0.0-canary-20251212-acb11f2
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/start/interface/interactiveActions.js +1 -1
- package/build/src/start/interface/interactiveActions.js.map +1 -1
- package/build/src/start/platforms/ios/getBestSimulator.js +11 -3
- package/build/src/start/platforms/ios/getBestSimulator.js.map +1 -1
- package/build/src/start/server/metro/MetroBundlerDevServer.js +5 -2
- package/build/src/start/server/metro/MetroBundlerDevServer.js.map +1 -1
- package/build/src/start/server/metro/withMetroMultiPlatform.js +4 -1
- package/build/src/start/server/metro/withMetroMultiPlatform.js.map +1 -1
- package/build/src/start/server/middleware/CorsMiddleware.js +43 -12
- package/build/src/start/server/middleware/CorsMiddleware.js.map +1 -1
- package/build/src/start/server/middleware/CreateFileMiddleware.js +63 -24
- package/build/src/start/server/middleware/CreateFileMiddleware.js.map +1 -1
- package/build/src/utils/telemetry/clients/FetchClient.js +1 -1
- package/build/src/utils/telemetry/utils/context.js +1 -1
- package/package.json +18 -18
package/build/bin/cli
CHANGED
|
@@ -123,7 +123,7 @@ const args = (0, _arg().default)({
|
|
|
123
123
|
});
|
|
124
124
|
if (args['--version']) {
|
|
125
125
|
// Version is added in the build script.
|
|
126
|
-
console.log("55.0.0-canary-
|
|
126
|
+
console.log("55.0.0-canary-20251212-acb11f2");
|
|
127
127
|
process.exit(0);
|
|
128
128
|
}
|
|
129
129
|
if (args['--non-interactive']) {
|
|
@@ -95,7 +95,7 @@ class DevServerManagerActions {
|
|
|
95
95
|
_log.log((0, _commandsTable.printItem)((0, _chalk().default)`Metro waiting on {underline ${nativeRuntimeUrl}}`));
|
|
96
96
|
if (options.devClient === false) {
|
|
97
97
|
// TODO: if development build, change this message!
|
|
98
|
-
_log.log((0, _commandsTable.printItem)('Scan the QR code above
|
|
98
|
+
_log.log((0, _commandsTable.printItem)('Scan the QR code above to open the project in Expo Go.'));
|
|
99
99
|
} else {
|
|
100
100
|
_log.log((0, _commandsTable.printItem)('Scan the QR code above to open the project in a development build. ' + (0, _link.learnMore)('https://expo.fyi/start')));
|
|
101
101
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/start/interface/interactiveActions.ts"],"sourcesContent":["import chalk from 'chalk';\n\nimport { BLT, printHelp, printItem, printQRCode, printUsage, StartOptions } from './commandsTable';\nimport { createDevToolsMenuItems } from './createDevToolsMenuItems';\nimport * as Log from '../../log';\nimport { env } from '../../utils/env';\nimport { learnMore } from '../../utils/link';\nimport { openBrowserAsync } from '../../utils/open';\nimport { ExpoChoice, selectAsync } from '../../utils/prompts';\nimport { DevServerManager } from '../server/DevServerManager';\nimport {\n openJsInspector,\n queryAllInspectorAppsAsync,\n promptInspectorAppAsync,\n} from '../server/middleware/inspector/JsInspector';\n\nconst debug = require('debug')('expo:start:interface:interactiveActions') as typeof console.log;\n\ninterface MoreToolMenuItem extends ExpoChoice<string> {\n action?: () => unknown;\n}\n\n/** Wraps the DevServerManager and adds an interface for user actions. */\nexport class DevServerManagerActions {\n constructor(\n private devServerManager: DevServerManager,\n private options: Pick<StartOptions, 'devClient' | 'platforms'>\n ) {}\n\n printDevServerInfo(\n options: Pick<StartOptions, 'devClient' | 'isWebSocketsEnabled' | 'platforms'>\n ) {\n // If native dev server is running, print its URL.\n if (this.devServerManager.getNativeDevServerPort()) {\n const devServer = this.devServerManager.getDefaultDevServer();\n try {\n const nativeRuntimeUrl = devServer.getNativeRuntimeUrl()!;\n const interstitialPageUrl = devServer.getRedirectUrl();\n\n printQRCode(interstitialPageUrl ?? nativeRuntimeUrl);\n\n if (interstitialPageUrl) {\n Log.log(\n printItem(\n chalk`Choose an app to open your project at {underline ${interstitialPageUrl}}`\n )\n );\n }\n\n if (env.__EXPO_E2E_TEST) {\n // Print the URL to stdout for tests\n console.info(\n `[__EXPO_E2E_TEST:server] ${JSON.stringify({ url: devServer.getDevServerUrl() })}`\n );\n }\n\n Log.log(printItem(chalk`Metro waiting on {underline ${nativeRuntimeUrl}}`));\n if (options.devClient === false) {\n // TODO: if development build, change this message!\n Log.log(\n printItem('Scan the QR code above with Expo Go (Android) or the Camera app (iOS)')\n );\n } else {\n Log.log(\n printItem(\n 'Scan the QR code above to open the project in a development build. ' +\n learnMore('https://expo.fyi/start')\n )\n );\n }\n } catch (error) {\n console.log('err', error);\n // @ts-ignore: If there is no development build scheme, then skip the QR code.\n if (error.code !== 'NO_DEV_CLIENT_SCHEME') {\n throw error;\n } else {\n const serverUrl = devServer.getDevServerUrl();\n Log.log(printItem(chalk`Metro waiting on {underline ${serverUrl}}`));\n Log.log(printItem(`Linking is disabled because the client scheme cannot be resolved.`));\n }\n }\n }\n\n if (this.options.platforms?.includes('web')) {\n const webDevServer = this.devServerManager.getWebDevServer();\n const webUrl = webDevServer?.getDevServerUrl({ hostType: 'localhost' });\n if (webUrl) {\n Log.log();\n Log.log(printItem(chalk`Web is waiting on {underline ${webUrl}}`));\n }\n }\n\n printUsage(options, { verbose: false });\n printHelp();\n Log.log();\n }\n\n async openJsInspectorAsync() {\n try {\n const metroServerOrigin = this.devServerManager.getDefaultDevServer().getJsInspectorBaseUrl();\n const apps = await queryAllInspectorAppsAsync(metroServerOrigin);\n if (!apps.length) {\n return Log.warn(\n chalk`{bold Debug:} No compatible apps connected, React Native DevTools can only be used with Hermes. ${learnMore(\n 'https://docs.expo.dev/guides/using-hermes/'\n )}`\n );\n }\n\n const app = await promptInspectorAppAsync(apps);\n if (!app) {\n return Log.error(chalk`{bold Debug:} No inspectable device selected`);\n }\n\n if (!(await openJsInspector(metroServerOrigin, app))) {\n Log.warn(\n chalk`{bold Debug:} Failed to open the React Native DevTools, see debug logs for more info.`\n );\n }\n } catch (error: any) {\n // Handle aborting prompt\n if (error.code === 'ABORTED') return;\n\n Log.error('Failed to open the React Native DevTools.');\n Log.exception(error);\n }\n }\n\n reloadApp() {\n Log.log(`${BLT} Reloading apps`);\n // Send reload requests over the dev servers\n this.devServerManager.broadcastMessage('reload');\n }\n\n async openMoreToolsAsync() {\n // Options match: Chrome > View > Developer\n try {\n const defaultMenuItems: MoreToolMenuItem[] = [\n { title: 'Inspect elements', value: 'toggleElementInspector' },\n { title: 'Toggle performance monitor', value: 'togglePerformanceMonitor' },\n { title: 'Toggle developer menu', value: 'toggleDevMenu' },\n { title: 'Reload app', value: 'reload' },\n // TODO: Maybe a \"View Source\" option to open code.\n ];\n\n const defaultServerUrl = this.devServerManager\n .getDefaultDevServer()\n .getUrlCreator()\n .constructUrl({ scheme: 'http' });\n\n const metroServerOrigin = this.devServerManager.getDefaultDevServer().getJsInspectorBaseUrl();\n const plugins = await this.devServerManager.devtoolsPluginManager.queryPluginsAsync();\n Log.log();\n const menuItems = [\n ...defaultMenuItems,\n ...createDevToolsMenuItems(plugins, defaultServerUrl, metroServerOrigin),\n ];\n\n const value = await selectAsync(chalk`Dev tools {dim (native only)}`, menuItems);\n const menuItem = menuItems.find((item) => item.value === value);\n if (menuItem?.action) {\n menuItem.action();\n } else if (menuItem?.value) {\n this.devServerManager.broadcastMessage('sendDevCommand', { name: menuItem.value });\n }\n } catch (error: any) {\n debug(error);\n // do nothing\n } finally {\n printHelp();\n }\n }\n\n toggleDevMenu() {\n Log.log(`${BLT} Toggling dev menu`);\n this.devServerManager.broadcastMessage('devMenu');\n }\n}\n"],"names":["DevServerManagerActions","debug","require","constructor","devServerManager","options","printDevServerInfo","getNativeDevServerPort","devServer","getDefaultDevServer","nativeRuntimeUrl","getNativeRuntimeUrl","interstitialPageUrl","getRedirectUrl","printQRCode","Log","log","printItem","chalk","env","__EXPO_E2E_TEST","console","info","JSON","stringify","url","getDevServerUrl","devClient","learnMore","error","code","serverUrl","platforms","includes","webDevServer","getWebDevServer","webUrl","hostType","printUsage","verbose","printHelp","openJsInspectorAsync","metroServerOrigin","getJsInspectorBaseUrl","apps","queryAllInspectorAppsAsync","length","warn","app","promptInspectorAppAsync","openJsInspector","exception","reloadApp","BLT","broadcastMessage","openMoreToolsAsync","defaultMenuItems","title","value","defaultServerUrl","getUrlCreator","constructUrl","scheme","plugins","devtoolsPluginManager","queryPluginsAsync","menuItems","createDevToolsMenuItems","selectAsync","menuItem","find","item","action","name","toggleDevMenu"],"mappings":";;;;+BAuBaA;;;eAAAA;;;;gEAvBK;;;;;;+BAE+D;yCACzC;6DACnB;qBACD;sBACM;yBAEc;6BAMjC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEP,MAAMC,QAAQC,QAAQ,SAAS;AAOxB,MAAMF;IACXG,YACE,AAAQC,gBAAkC,EAC1C,AAAQC,OAAsD,CAC9D;aAFQD,mBAAAA;aACAC,UAAAA;IACP;IAEHC,mBACED,OAA8E,EAC9E;YAoDI;QAnDJ,kDAAkD;QAClD,IAAI,IAAI,CAACD,gBAAgB,CAACG,sBAAsB,IAAI;YAClD,MAAMC,YAAY,IAAI,CAACJ,gBAAgB,CAACK,mBAAmB;YAC3D,IAAI;gBACF,MAAMC,mBAAmBF,UAAUG,mBAAmB;gBACtD,MAAMC,sBAAsBJ,UAAUK,cAAc;gBAEpDC,IAAAA,0BAAW,EAACF,uBAAuBF;gBAEnC,IAAIE,qBAAqB;oBACvBG,KAAIC,GAAG,CACLC,IAAAA,wBAAS,EACPC,IAAAA,gBAAK,CAAA,CAAC,iDAAiD,EAAEN,oBAAoB,CAAC,CAAC;gBAGrF;gBAEA,IAAIO,QAAG,CAACC,eAAe,EAAE;oBACvB,oCAAoC;oBACpCC,QAAQC,IAAI,CACV,CAAC,yBAAyB,EAAEC,KAAKC,SAAS,CAAC;wBAAEC,KAAKjB,UAAUkB,eAAe;oBAAG,IAAI;gBAEtF;gBAEAX,KAAIC,GAAG,CAACC,IAAAA,wBAAS,EAACC,IAAAA,gBAAK,CAAA,CAAC,4BAA4B,EAAER,iBAAiB,CAAC,CAAC;gBACzE,IAAIL,QAAQsB,SAAS,KAAK,OAAO;oBAC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P,MAAMkD,YAAY;mBACbV;mBACAW,IAAAA,gDAAuB,EAACJ,SAASJ,kBAAkBjB;aACvD;YAED,MAAMgB,QAAQ,MAAMU,IAAAA,oBAAW,EAAClD,IAAAA,gBAAK,CAAA,CAAC,6BAA6B,CAAC,EAAEgD;YACtE,MAAMG,WAAWH,UAAUI,IAAI,CAAC,CAACC,OAASA,KAAKb,KAAK,KAAKA;YACzD,IAAIW,4BAAAA,SAAUG,MAAM,EAAE;gBACpBH,SAASG,MAAM;YACjB,OAAO,IAAIH,4BAAAA,SAAUX,KAAK,EAAE;gBAC1B,IAAI,CAACtD,gBAAgB,CAACkD,gBAAgB,CAAC,kBAAkB;oBAAEmB,MAAMJ,SAASX,KAAK;gBAAC;YAClF;QACF,EAAE,OAAO7B,OAAY;YACnB5B,MAAM4B;QACN,aAAa;QACf,SAAU;YACRW,IAAAA,wBAAS;QACX;IACF;IAEAkC,gBAAgB;QACd3D,KAAIC,GAAG,CAAC,GAAGqC,kBAAG,CAAC,kBAAkB,CAAC;QAClC,IAAI,CAACjD,gBAAgB,CAACkD,gBAAgB,CAAC;IACzC;AACF"}
|
|
1
|
+
{"version":3,"sources":["../../../../src/start/interface/interactiveActions.ts"],"sourcesContent":["import chalk from 'chalk';\n\nimport { BLT, printHelp, printItem, printQRCode, printUsage, StartOptions } from './commandsTable';\nimport { createDevToolsMenuItems } from './createDevToolsMenuItems';\nimport * as Log from '../../log';\nimport { env } from '../../utils/env';\nimport { learnMore } from '../../utils/link';\nimport { openBrowserAsync } from '../../utils/open';\nimport { ExpoChoice, selectAsync } from '../../utils/prompts';\nimport { DevServerManager } from '../server/DevServerManager';\nimport {\n openJsInspector,\n queryAllInspectorAppsAsync,\n promptInspectorAppAsync,\n} from '../server/middleware/inspector/JsInspector';\n\nconst debug = require('debug')('expo:start:interface:interactiveActions') as typeof console.log;\n\ninterface MoreToolMenuItem extends ExpoChoice<string> {\n action?: () => unknown;\n}\n\n/** Wraps the DevServerManager and adds an interface for user actions. */\nexport class DevServerManagerActions {\n constructor(\n private devServerManager: DevServerManager,\n private options: Pick<StartOptions, 'devClient' | 'platforms'>\n ) {}\n\n printDevServerInfo(\n options: Pick<StartOptions, 'devClient' | 'isWebSocketsEnabled' | 'platforms'>\n ) {\n // If native dev server is running, print its URL.\n if (this.devServerManager.getNativeDevServerPort()) {\n const devServer = this.devServerManager.getDefaultDevServer();\n try {\n const nativeRuntimeUrl = devServer.getNativeRuntimeUrl()!;\n const interstitialPageUrl = devServer.getRedirectUrl();\n\n printQRCode(interstitialPageUrl ?? nativeRuntimeUrl);\n\n if (interstitialPageUrl) {\n Log.log(\n printItem(\n chalk`Choose an app to open your project at {underline ${interstitialPageUrl}}`\n )\n );\n }\n\n if (env.__EXPO_E2E_TEST) {\n // Print the URL to stdout for tests\n console.info(\n `[__EXPO_E2E_TEST:server] ${JSON.stringify({ url: devServer.getDevServerUrl() })}`\n );\n }\n\n Log.log(printItem(chalk`Metro waiting on {underline ${nativeRuntimeUrl}}`));\n if (options.devClient === false) {\n // TODO: if development build, change this message!\n Log.log(printItem('Scan the QR code above to open the project in Expo Go.'));\n } else {\n Log.log(\n printItem(\n 'Scan the QR code above to open the project in a development build. ' +\n learnMore('https://expo.fyi/start')\n )\n );\n }\n } catch (error) {\n console.log('err', error);\n // @ts-ignore: If there is no development build scheme, then skip the QR code.\n if (error.code !== 'NO_DEV_CLIENT_SCHEME') {\n throw error;\n } else {\n const serverUrl = devServer.getDevServerUrl();\n Log.log(printItem(chalk`Metro waiting on {underline ${serverUrl}}`));\n Log.log(printItem(`Linking is disabled because the client scheme cannot be resolved.`));\n }\n }\n }\n\n if (this.options.platforms?.includes('web')) {\n const webDevServer = this.devServerManager.getWebDevServer();\n const webUrl = webDevServer?.getDevServerUrl({ hostType: 'localhost' });\n if (webUrl) {\n Log.log();\n Log.log(printItem(chalk`Web is waiting on {underline ${webUrl}}`));\n }\n }\n\n printUsage(options, { verbose: false });\n printHelp();\n Log.log();\n }\n\n async openJsInspectorAsync() {\n try {\n const metroServerOrigin = this.devServerManager.getDefaultDevServer().getJsInspectorBaseUrl();\n const apps = await queryAllInspectorAppsAsync(metroServerOrigin);\n if (!apps.length) {\n return Log.warn(\n chalk`{bold Debug:} No compatible apps connected, React Native DevTools can only be used with Hermes. ${learnMore(\n 'https://docs.expo.dev/guides/using-hermes/'\n )}`\n );\n }\n\n const app = await promptInspectorAppAsync(apps);\n if (!app) {\n return Log.error(chalk`{bold Debug:} No inspectable device selected`);\n }\n\n if (!(await openJsInspector(metroServerOrigin, app))) {\n Log.warn(\n chalk`{bold Debug:} Failed to open the React Native DevTools, see debug logs for more info.`\n );\n }\n } catch (error: any) {\n // Handle aborting prompt\n if (error.code === 'ABORTED') return;\n\n Log.error('Failed to open the React Native DevTools.');\n Log.exception(error);\n }\n }\n\n reloadApp() {\n Log.log(`${BLT} Reloading apps`);\n // Send reload requests over the dev servers\n this.devServerManager.broadcastMessage('reload');\n }\n\n async openMoreToolsAsync() {\n // Options match: Chrome > View > Developer\n try {\n const defaultMenuItems: MoreToolMenuItem[] = [\n { title: 'Inspect elements', value: 'toggleElementInspector' },\n { title: 'Toggle performance monitor', value: 'togglePerformanceMonitor' },\n { title: 'Toggle developer menu', value: 'toggleDevMenu' },\n { title: 'Reload app', value: 'reload' },\n // TODO: Maybe a \"View Source\" option to open code.\n ];\n\n const defaultServerUrl = this.devServerManager\n .getDefaultDevServer()\n .getUrlCreator()\n .constructUrl({ scheme: 'http' });\n\n const metroServerOrigin = this.devServerManager.getDefaultDevServer().getJsInspectorBaseUrl();\n const plugins = await this.devServerManager.devtoolsPluginManager.queryPluginsAsync();\n Log.log();\n const menuItems = [\n ...defaultMenuItems,\n ...createDevToolsMenuItems(plugins, defaultServerUrl, metroServerOrigin),\n ];\n\n const value = await selectAsync(chalk`Dev tools {dim (native only)}`, menuItems);\n const menuItem = menuItems.find((item) => item.value === value);\n if (menuItem?.action) {\n menuItem.action();\n } else if (menuItem?.value) {\n this.devServerManager.broadcastMessage('sendDevCommand', { name: menuItem.value });\n }\n } catch (error: any) {\n debug(error);\n // do nothing\n } finally {\n printHelp();\n }\n }\n\n toggleDevMenu() {\n Log.log(`${BLT} Toggling dev menu`);\n this.devServerManager.broadcastMessage('devMenu');\n }\n}\n"],"names":["DevServerManagerActions","debug","require","constructor","devServerManager","options","printDevServerInfo","getNativeDevServerPort","devServer","getDefaultDevServer","nativeRuntimeUrl","getNativeRuntimeUrl","interstitialPageUrl","getRedirectUrl","printQRCode","Log","log","printItem","chalk","env","__EXPO_E2E_TEST","console","info","JSON","stringify","url","getDevServerUrl","devClient","learnMore","error","code","serverUrl","platforms","includes","webDevServer","getWebDevServer","webUrl","hostType","printUsage","verbose","printHelp","openJsInspectorAsync","metroServerOrigin","getJsInspectorBaseUrl","apps","queryAllInspectorAppsAsync","length","warn","app","promptInspectorAppAsync","openJsInspector","exception","reloadApp","BLT","broadcastMessage","openMoreToolsAsync","defaultMenuItems","title","value","defaultServerUrl","getUrlCreator","constructUrl","scheme","plugins","devtoolsPluginManager","queryPluginsAsync","menuItems","createDevToolsMenuItems","selectAsync","menuItem","find","item","action","name","toggleDevMenu"],"mappings":";;;;+BAuBaA;;;eAAAA;;;;gEAvBK;;;;;;+BAE+D;yCACzC;6DACnB;qBACD;sBACM;yBAEc;6BAMjC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEP,MAAMC,QAAQC,QAAQ,SAAS;AAOxB,MAAMF;IACXG,YACE,AAAQC,gBAAkC,EAC1C,AAAQC,OAAsD,CAC9D;aAFQD,mBAAAA;aACAC,UAAAA;IACP;IAEHC,mBACED,OAA8E,EAC9E;YAkDI;QAjDJ,kDAAkD;QAClD,IAAI,IAAI,CAACD,gBAAgB,CAACG,sBAAsB,IAAI;YAClD,MAAMC,YAAY,IAAI,CAACJ,gBAAgB,CAACK,mBAAmB;YAC3D,IAAI;gBACF,MAAMC,mBAAmBF,UAAUG,mBAAmB;gBACtD,MAAMC,sBAAsBJ,UAAUK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132,17 @@ async function getBestSimulatorAsync({ osType }) {
|
|
|
132
132
|
if (simulatorOpenedByApp) {
|
|
133
133
|
return simulatorOpenedByApp.udid;
|
|
134
134
|
}
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
135
|
+
try {
|
|
136
|
+
return await getBestUnbootedSimulatorAsync({
|
|
137
|
+
osType
|
|
138
|
+
});
|
|
139
|
+
} catch (error) {
|
|
140
|
+
// Instead of throwing, return null if no simulators are found
|
|
141
|
+
if (error instanceof _errors.CommandError && error.code === 'UNSUPPORTED_OS_TYPE') {
|
|
142
|
+
return null;
|
|
143
|
+
}
|
|
144
|
+
throw error;
|
|
145
|
+
}
|
|
138
146
|
}
|
|
139
147
|
|
|
140
148
|
//# sourceMappingURL=getBestSimulator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/start/platforms/ios/getBestSimulator.ts"],"sourcesContent":["import { execSync } from 'child_process';\n\nimport * as SimControl from './simctl';\nimport { CommandError } from '../../../utils/errors';\n\nconst debug = require('debug')('expo:start:platforms:ios:getBestSimulator') as typeof console.log;\n\ntype DeviceContext = Partial<Pick<SimControl.Device, 'osType'>>;\n\n/**\n * Returns the default device stored in the Simulator.app settings.\n * This helps us to get the device that the user opened most recently regardless of which tool they used.\n */\nfunction getDefaultSimulatorDeviceUDID() {\n try {\n const defaultDeviceUDID = execSync(\n `defaults read com.apple.iphonesimulator CurrentDeviceUDID`,\n { stdio: 'pipe' }\n ).toString();\n return defaultDeviceUDID.trim();\n } catch {\n return null;\n }\n}\n\nexport async function getBestBootedSimulatorAsync({\n osType,\n}: DeviceContext = {}): Promise<SimControl.Device | null> {\n const [simulatorOpenedByApp] = await SimControl.getBootedSimulatorsAsync();\n // This should prevent opening a second simulator in the chance that default\n // simulator doesn't match what the Simulator app would open by default.\n if (\n simulatorOpenedByApp?.udid &&\n (!osType || (osType && simulatorOpenedByApp.osType === osType))\n ) {\n debug(`First booted simulator: ${simulatorOpenedByApp?.windowName}`);\n return simulatorOpenedByApp;\n }\n\n debug(`No booted simulator matching requirements (osType: ${osType}).`);\n return null;\n}\n\n/**\n * Returns the most preferred simulator UDID without booting anything.\n *\n * 1. If the simulator app defines a default simulator and the osType is not defined.\n * 2. If the osType is defined, then check if the default udid matches the osType.\n * 3. If all else fails, return the first found simulator.\n */\nexport async function getBestUnbootedSimulatorAsync({ osType }: DeviceContext = {}): Promise<\n string | null\n> {\n const defaultId = getDefaultSimulatorDeviceUDID();\n debug(`Default simulator ID: ${defaultId}`);\n\n if (defaultId && !osType) {\n return defaultId;\n }\n\n const simulators = await getSelectableSimulatorsAsync({ osType });\n\n if (!simulators.length) {\n // TODO: Prompt to install the simulators\n throw new CommandError(\n 'UNSUPPORTED_OS_TYPE',\n `No ${osType || 'iOS'} devices available in Simulator.app`\n );\n }\n\n // If the default udid is defined, then check to ensure its osType matches the required os.\n if (defaultId) {\n const defaultSimulator = simulators.find((device) => device.udid === defaultId);\n if (defaultSimulator?.osType === osType) {\n return defaultId;\n }\n }\n\n // Return first selectable device.\n return simulators[0]?.udid ?? null;\n}\n\n/**\n * Get all simulators supported by Expo Go (iOS only).\n */\nexport async function getSelectableSimulatorsAsync({ osType = 'iOS' }: DeviceContext = {}): Promise<\n SimControl.Device[]\n> {\n const simulators = await SimControl.getDevicesAsync();\n return simulators.filter((device) => device.isAvailable && device.osType === osType);\n}\n\n/**\n * Get 'best' simulator for the user based on:\n * 1. Currently booted simulator.\n * 2. Last simulator that was opened.\n * 3. First simulator that was opened.\n */\nexport async function getBestSimulatorAsync({ osType }: DeviceContext): Promise<string | null> {\n const simulatorOpenedByApp = await getBestBootedSimulatorAsync({ osType });\n\n if (simulatorOpenedByApp) {\n return simulatorOpenedByApp.udid;\n }\n\n return await getBestUnbootedSimulatorAsync({ osType });\n}\n"],"names":["getBestBootedSimulatorAsync","getBestSimulatorAsync","getBestUnbootedSimulatorAsync","getSelectableSimulatorsAsync","debug","require","getDefaultSimulatorDeviceUDID","defaultDeviceUDID","execSync","stdio","toString","trim","osType","simulatorOpenedByApp","SimControl","getBootedSimulatorsAsync","udid","windowName","simulators","defaultId","length","CommandError","defaultSimulator","find","device","getDevicesAsync","filter","isAvailable"],"mappings":";;;;;;;;;;;IAyBsBA,2BAA2B;eAA3BA;;IAyEAC,qBAAqB;eAArBA;;IAhDAC,6BAA6B;eAA7BA;;IAmCAC,4BAA4B;eAA5BA;;;;yBArFG;;;;;;gEAEG;wBACC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE7B,MAAMC,QAAQC,QAAQ,SAAS;AAI/B;;;CAGC,GACD,SAASC;IACP,IAAI;QACF,MAAMC,oBAAoBC,IAAAA,yBAAQ,EAChC,CAAC,yDAAyD,CAAC,EAC3D;YAAEC,OAAO;QAAO,GAChBC,QAAQ;QACV,OAAOH,kBAAkBI,IAAI;IAC/B,EAAE,OAAM;QACN,OAAO;IACT;AACF;AAEO,eAAeX,4BAA4B,EAChDY,MAAM,EACQ,GAAG,CAAC,CAAC;IACnB,MAAM,CAACC,qBAAqB,GAAG,MAAMC,QAAWC,wBAAwB;IACxE,4EAA4E;IAC5E,wEAAwE;IACxE,IACEF,CAAAA,wCAAAA,qBAAsBG,IAAI,KACzB,CAAA,CAACJ,UAAWA,UAAUC,qBAAqBD,MAAM,KAAKA,MAAM,GAC7D;QACAR,MAAM,CAAC,wBAAwB,EAAES,wCAAAA,qBAAsBI,UAAU,EAAE;QACnE,OAAOJ;IACT;IAEAT,MAAM,CAAC,mDAAmD,EAAEQ,OAAO,EAAE,CAAC;IACtE,OAAO;AACT;AASO,eAAeV,8BAA8B,EAAEU,MAAM,EAAiB,GAAG,CAAC,CAAC;QA6BzEM;IA1BP,MAAMC,YAAYb;IAClBF,MAAM,CAAC,sBAAsB,EAAEe,WAAW;IAE1C,IAAIA,aAAa,CAACP,QAAQ;QACxB,OAAOO;IACT;IAEA,MAAMD,aAAa,MAAMf,6BAA6B;QAAES;IAAO;IAE/D,IAAI,CAACM,WAAWE,MAAM,EAAE;QACtB,yCAAyC;QACzC,MAAM,IAAIC,oBAAY,CACpB,uBACA,CAAC,GAAG,EAAET,UAAU,MAAM,mCAAmC,CAAC;IAE9D;IAEA,2FAA2F;IAC3F,IAAIO,WAAW;QACb,MAAMG,mBAAmBJ,WAAWK,IAAI,CAAC,CAACC,SAAWA,OAAOR,IAAI,KAAKG;QACrE,IAAIG,CAAAA,oCAAAA,iBAAkBV,MAAM,MAAKA,QAAQ;YACvC,OAAOO;QACT;IACF;IAEA,kCAAkC;IAClC,OAAOD,EAAAA,eAAAA,UAAU,CAAC,EAAE,qBAAbA,aAAeF,IAAI,KAAI;AAChC;AAKO,eAAeb,6BAA6B,EAAES,SAAS,KAAK,EAAiB,GAAG,CAAC,CAAC;IAGvF,MAAMM,aAAa,MAAMJ,QAAWW,eAAe;IACnD,OAAOP,WAAWQ,MAAM,CAAC,CAACF,SAAWA,OAAOG,WAAW,IAAIH,OAAOZ,MAAM,KAAKA;AAC/E;AAQO,eAAeX,sBAAsB,EAAEW,MAAM,EAAiB;IACnE,MAAMC,uBAAuB,MAAMb,4BAA4B;QAAEY;IAAO;IAExE,IAAIC,sBAAsB;QACxB,OAAOA,qBAAqBG,IAAI;IAClC;IAEA,OAAO,MAAMd,8BAA8B;
|
|
1
|
+
{"version":3,"sources":["../../../../../src/start/platforms/ios/getBestSimulator.ts"],"sourcesContent":["import { execSync } from 'child_process';\n\nimport * as SimControl from './simctl';\nimport { CommandError } from '../../../utils/errors';\n\nconst debug = require('debug')('expo:start:platforms:ios:getBestSimulator') as typeof console.log;\n\ntype DeviceContext = Partial<Pick<SimControl.Device, 'osType'>>;\n\n/**\n * Returns the default device stored in the Simulator.app settings.\n * This helps us to get the device that the user opened most recently regardless of which tool they used.\n */\nfunction getDefaultSimulatorDeviceUDID() {\n try {\n const defaultDeviceUDID = execSync(\n `defaults read com.apple.iphonesimulator CurrentDeviceUDID`,\n { stdio: 'pipe' }\n ).toString();\n return defaultDeviceUDID.trim();\n } catch {\n return null;\n }\n}\n\nexport async function getBestBootedSimulatorAsync({\n osType,\n}: DeviceContext = {}): Promise<SimControl.Device | null> {\n const [simulatorOpenedByApp] = await SimControl.getBootedSimulatorsAsync();\n // This should prevent opening a second simulator in the chance that default\n // simulator doesn't match what the Simulator app would open by default.\n if (\n simulatorOpenedByApp?.udid &&\n (!osType || (osType && simulatorOpenedByApp.osType === osType))\n ) {\n debug(`First booted simulator: ${simulatorOpenedByApp?.windowName}`);\n return simulatorOpenedByApp;\n }\n\n debug(`No booted simulator matching requirements (osType: ${osType}).`);\n return null;\n}\n\n/**\n * Returns the most preferred simulator UDID without booting anything.\n *\n * 1. If the simulator app defines a default simulator and the osType is not defined.\n * 2. If the osType is defined, then check if the default udid matches the osType.\n * 3. If all else fails, return the first found simulator.\n */\nexport async function getBestUnbootedSimulatorAsync({ osType }: DeviceContext = {}): Promise<\n string | null\n> {\n const defaultId = getDefaultSimulatorDeviceUDID();\n debug(`Default simulator ID: ${defaultId}`);\n\n if (defaultId && !osType) {\n return defaultId;\n }\n\n const simulators = await getSelectableSimulatorsAsync({ osType });\n\n if (!simulators.length) {\n // TODO: Prompt to install the simulators\n throw new CommandError(\n 'UNSUPPORTED_OS_TYPE',\n `No ${osType || 'iOS'} devices available in Simulator.app`\n );\n }\n\n // If the default udid is defined, then check to ensure its osType matches the required os.\n if (defaultId) {\n const defaultSimulator = simulators.find((device) => device.udid === defaultId);\n if (defaultSimulator?.osType === osType) {\n return defaultId;\n }\n }\n\n // Return first selectable device.\n return simulators[0]?.udid ?? null;\n}\n\n/**\n * Get all simulators supported by Expo Go (iOS only).\n */\nexport async function getSelectableSimulatorsAsync({ osType = 'iOS' }: DeviceContext = {}): Promise<\n SimControl.Device[]\n> {\n const simulators = await SimControl.getDevicesAsync();\n return simulators.filter((device) => device.isAvailable && device.osType === osType);\n}\n\n/**\n * Get 'best' simulator for the user based on:\n * 1. Currently booted simulator.\n * 2. Last simulator that was opened.\n * 3. First simulator that was opened.\n */\nexport async function getBestSimulatorAsync({ osType }: DeviceContext): Promise<string | null> {\n const simulatorOpenedByApp = await getBestBootedSimulatorAsync({ osType });\n\n if (simulatorOpenedByApp) {\n return simulatorOpenedByApp.udid;\n }\n\n try {\n return await getBestUnbootedSimulatorAsync({ osType });\n } catch (error) {\n // Instead of throwing, return null if no simulators are found\n if (error instanceof CommandError && error.code === 'UNSUPPORTED_OS_TYPE') {\n return null;\n }\n throw error;\n }\n}\n"],"names":["getBestBootedSimulatorAsync","getBestSimulatorAsync","getBestUnbootedSimulatorAsync","getSelectableSimulatorsAsync","debug","require","getDefaultSimulatorDeviceUDID","defaultDeviceUDID","execSync","stdio","toString","trim","osType","simulatorOpenedByApp","SimControl","getBootedSimulatorsAsync","udid","windowName","simulators","defaultId","length","CommandError","defaultSimulator","find","device","getDevicesAsync","filter","isAvailable","error","code"],"mappings":";;;;;;;;;;;IAyBsBA,2BAA2B;eAA3BA;;IAyEAC,qBAAqB;eAArBA;;IAhDAC,6BAA6B;eAA7BA;;IAmCAC,4BAA4B;eAA5BA;;;;yBArFG;;;;;;gEAEG;wBACC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE7B,MAAMC,QAAQC,QAAQ,SAAS;AAI/B;;;CAGC,GACD,SAASC;IACP,IAAI;QACF,MAAMC,oBAAoBC,IAAAA,yBAAQ,EAChC,CAAC,yDAAyD,CAAC,EAC3D;YAAEC,OAAO;QAAO,GAChBC,QAAQ;QACV,OAAOH,kBAAkBI,IAAI;IAC/B,EAAE,OAAM;QACN,OAAO;IACT;AACF;AAEO,eAAeX,4BAA4B,EAChDY,MAAM,EACQ,GAAG,CAAC,CAAC;IACnB,MAAM,CAACC,qBAAqB,GAAG,MAAMC,QAAWC,wBAAwB;IACxE,4EAA4E;IAC5E,wEAAwE;IACxE,IACEF,CAAAA,wCAAAA,qBAAsBG,IAAI,KACzB,CAAA,CAACJ,UAAWA,UAAUC,qBAAqBD,MAAM,KAAKA,MAAM,GAC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OAAOgB,OAAO;QACd,8DAA8D;QAC9D,IAAIA,iBAAiBP,oBAAY,IAAIO,MAAMC,IAAI,KAAK,uBAAuB;YACzE,OAAO;QACT;QACA,MAAMD;IACR;AACF"}
|
|
@@ -834,8 +834,11 @@ class MetroBundlerDevServer extends _BundlerDevServer.BundlerDevServer {
|
|
|
834
834
|
// Add support for DOM components.
|
|
835
835
|
// TODO: Maybe put behind a flag for now?
|
|
836
836
|
middleware.use(domComponentRenderer);
|
|
837
|
-
|
|
838
|
-
|
|
837
|
+
middleware.use(new _CreateFileMiddleware.CreateFileMiddleware({
|
|
838
|
+
metroRoot: serverRoot,
|
|
839
|
+
projectRoot: this.projectRoot,
|
|
840
|
+
appDir
|
|
841
|
+
}).getHandler());
|
|
839
842
|
// For providing info to the error overlay.
|
|
840
843
|
middleware.use((req, res, next)=>{
|
|
841
844
|
var _req_url;
|