@expo/cli 0.18.28 → 0.18.30
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/server/BundlerDevServer.js +2 -17
- package/build/src/start/server/BundlerDevServer.js.map +1 -1
- package/build/src/start/server/DevelopmentSession.js +8 -25
- package/build/src/start/server/DevelopmentSession.js.map +1 -1
- package/build/src/start/server/metro/DevToolsPluginWebsocketEndpoint.js +35 -0
- package/build/src/start/server/metro/DevToolsPluginWebsocketEndpoint.js.map +1 -0
- package/build/src/start/server/metro/instantiateMetro.js +3 -1
- package/build/src/start/server/metro/instantiateMetro.js.map +1 -1
- package/build/src/utils/telemetry/getContext.js +1 -1
- package/package.json +3 -3
package/build/bin/cli
CHANGED
|
@@ -188,27 +188,12 @@ class BundlerDevServer {
|
|
|
188
188
|
return this.ngrok;
|
|
189
189
|
}
|
|
190
190
|
async startDevSessionAsync() {
|
|
191
|
-
|
|
191
|
+
// This is used to make Expo Go open the project in either Expo Go, or the web browser.
|
|
192
192
|
// Must come after ngrok (`startTunnelAsync`) setup.
|
|
193
|
-
ref;
|
|
194
|
-
(ref = this.devSession) == null ? void 0 : ref.stopNotifying == null ? void 0 : ref.stopNotifying();
|
|
195
193
|
this.devSession = new _developmentSession.DevelopmentSession(this.projectRoot, // This URL will be used on external devices so the computer IP won't be relevant.
|
|
196
194
|
this.isTargetingNative() ? this.getNativeRuntimeUrl() : this.getDevServerUrl({
|
|
197
195
|
hostType: "localhost"
|
|
198
|
-
})
|
|
199
|
-
var // TODO: This appears to be happening consistently after an hour.
|
|
200
|
-
// We should investigate why this is happening and fix it on our servers.
|
|
201
|
-
// Log.error(
|
|
202
|
-
// chalk.red(
|
|
203
|
-
// '\nAn unexpected error occurred while updating the Dev Session API. This project will not appear in the "Development servers" section of the Expo Go app until this process has been restarted.'
|
|
204
|
-
// )
|
|
205
|
-
// );
|
|
206
|
-
// Log.exception(error);
|
|
207
|
-
ref;
|
|
208
|
-
(ref = this.devSession) == null ? void 0 : ref.closeAsync().catch((error)=>{
|
|
209
|
-
debug("[dev-session] error closing: " + error.message);
|
|
210
|
-
});
|
|
211
|
-
});
|
|
196
|
+
}));
|
|
212
197
|
await this.devSession.startAsync({
|
|
213
198
|
runtime: this.isTargetingNative() ? "native" : "web"
|
|
214
199
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/start/server/BundlerDevServer.ts"],"sourcesContent":["import assert from 'assert';\nimport resolveFrom from 'resolve-from';\n\nimport { AsyncNgrok } from './AsyncNgrok';\nimport DevToolsPluginManager from './DevToolsPluginManager';\nimport { DevelopmentSession } from './DevelopmentSession';\nimport { CreateURLOptions, UrlCreator } from './UrlCreator';\nimport { PlatformBundlers } from './platformBundlers';\nimport * as Log from '../../log';\nimport { FileNotifier } from '../../utils/FileNotifier';\nimport { resolveWithTimeout } from '../../utils/delay';\nimport { env } from '../../utils/env';\nimport { CommandError } from '../../utils/errors';\nimport { openBrowserAsync } from '../../utils/open';\nimport {\n BaseOpenInCustomProps,\n BaseResolveDeviceProps,\n PlatformManager,\n} from '../platforms/PlatformManager';\n\nconst debug = require('debug')('expo:start:server:devServer') as typeof console.log;\n\nexport type MessageSocket = {\n broadcast: (method: string, params?: Record<string, any> | undefined) => void;\n};\n\nexport type ServerLike = {\n close(callback?: (err?: Error) => void): void;\n addListener?(event: string, listener: (...args: any[]) => void): unknown;\n};\n\nexport type DevServerInstance = {\n /** Bundler dev server instance. */\n server: ServerLike;\n /** Dev server URL location properties. */\n location: {\n url: string;\n port: number;\n protocol: 'http' | 'https';\n host?: string;\n };\n /** Additional middleware that's attached to the `server`. */\n middleware: any;\n /** Message socket for communicating with the runtime. */\n messageSocket: MessageSocket;\n};\n\nexport interface BundlerStartOptions {\n /** Should the dev server use `https` protocol. */\n https?: boolean;\n /** Should start the dev servers in development mode (minify). */\n mode?: 'development' | 'production';\n /** Is dev client enabled. */\n devClient?: boolean;\n /** Should run dev servers with clean caches. */\n resetDevServer?: boolean;\n /** Code signing private key path (defaults to same directory as certificate) */\n privateKeyPath?: string;\n\n /** Max amount of workers (threads) to use with Metro bundler, defaults to undefined for max workers. */\n maxWorkers?: number;\n /** Port to start the dev server on. */\n port?: number;\n\n /** Should start a headless dev server e.g. mock representation to approximate info from a server running in a different process. */\n headless?: boolean;\n /** Should instruct the bundler to create minified bundles. */\n minify?: boolean;\n\n /** Will the bundler be used for exporting. NOTE: This is an odd option to pass to the dev server. */\n isExporting?: boolean;\n\n // Webpack options\n /** Should modify and create PWA icons. */\n isImageEditingEnabled?: boolean;\n\n location: CreateURLOptions;\n}\n\nconst PLATFORM_MANAGERS = {\n simulator: () =>\n require('../platforms/ios/ApplePlatformManager')\n .ApplePlatformManager as typeof import('../platforms/ios/ApplePlatformManager').ApplePlatformManager,\n emulator: () =>\n require('../platforms/android/AndroidPlatformManager')\n .AndroidPlatformManager as typeof import('../platforms/android/AndroidPlatformManager').AndroidPlatformManager,\n};\n\nexport abstract class BundlerDevServer {\n /** Name of the bundler. */\n abstract get name(): string;\n\n /** Ngrok instance for managing tunnel connections. */\n protected ngrok: AsyncNgrok | null = null;\n /** Interfaces with the Expo 'Development Session' API. */\n protected devSession: DevelopmentSession | null = null;\n /** Http server and related info. */\n protected instance: DevServerInstance | null = null;\n /** Native platform interfaces for opening projects. */\n private platformManagers: Record<string, PlatformManager<any>> = {};\n /** Manages the creation of dev server URLs. */\n protected urlCreator?: UrlCreator | null = null;\n\n private notifier: FileNotifier | null = null;\n protected readonly devToolsPluginManager: DevToolsPluginManager;\n public isDevClient: boolean;\n\n constructor(\n /** Project root folder. */\n public projectRoot: string,\n /** A mapping of bundlers to platforms. */\n public platformBundlers: PlatformBundlers,\n /** Advanced options */\n options?: {\n /**\n * The instance of DevToolsPluginManager\n * @default new DevToolsPluginManager(projectRoot)\n */\n devToolsPluginManager?: DevToolsPluginManager;\n // TODO: Replace with custom scheme maybe...\n isDevClient?: boolean;\n }\n ) {\n this.devToolsPluginManager =\n options?.devToolsPluginManager ?? new DevToolsPluginManager(projectRoot);\n this.isDevClient = options?.isDevClient ?? false;\n }\n\n protected setInstance(instance: DevServerInstance) {\n this.instance = instance;\n }\n\n /** Get the manifest middleware function. */\n protected async getManifestMiddlewareAsync(\n options: Pick<BundlerStartOptions, 'minify' | 'mode' | 'privateKeyPath'> = {}\n ) {\n const Middleware = require('./middleware/ExpoGoManifestHandlerMiddleware')\n .ExpoGoManifestHandlerMiddleware as typeof import('./middleware/ExpoGoManifestHandlerMiddleware').ExpoGoManifestHandlerMiddleware;\n\n const urlCreator = this.getUrlCreator();\n const middleware = new Middleware(this.projectRoot, {\n constructUrl: urlCreator.constructUrl.bind(urlCreator),\n mode: options.mode,\n minify: options.minify,\n isNativeWebpack: this.name === 'webpack' && this.isTargetingNative(),\n privateKeyPath: options.privateKeyPath,\n });\n return middleware;\n }\n\n /** Start the dev server using settings defined in the start command. */\n public async startAsync(options: BundlerStartOptions): Promise<DevServerInstance> {\n await this.stopAsync();\n\n let instance: DevServerInstance;\n if (options.headless) {\n instance = await this.startHeadlessAsync(options);\n } else {\n instance = await this.startImplementationAsync(options);\n }\n\n this.setInstance(instance);\n await this.postStartAsync(options);\n return instance;\n }\n\n protected abstract startImplementationAsync(\n options: BundlerStartOptions\n ): Promise<DevServerInstance>;\n\n public async waitForTypeScriptAsync(): Promise<boolean> {\n return false;\n }\n\n public abstract startTypeScriptServices(): Promise<void>;\n\n public async watchEnvironmentVariables(): Promise<void> {\n // noop -- We've only implemented this functionality in Metro.\n }\n\n /**\n * Creates a mock server representation that can be used to estimate URLs for a server started in another process.\n * This is used for the run commands where you can reuse the server from a previous run.\n */\n private async startHeadlessAsync(options: BundlerStartOptions): Promise<DevServerInstance> {\n if (!options.port)\n throw new CommandError('HEADLESS_SERVER', 'headless dev server requires a port option');\n this.urlCreator = this.getUrlCreator(options);\n\n return {\n // Create a mock server\n server: {\n close: (callback: () => void) => {\n this.instance = null;\n callback?.();\n },\n addListener() {},\n },\n location: {\n // The port is the main thing we want to send back.\n port: options.port,\n // localhost isn't always correct.\n host: 'localhost',\n // http is the only supported protocol on native.\n url: `http://localhost:${options.port}`,\n protocol: 'http',\n },\n middleware: {},\n messageSocket: {\n broadcast: () => {\n throw new CommandError('HEADLESS_SERVER', 'Cannot broadcast messages to headless server');\n },\n },\n };\n }\n\n /**\n * Runs after the `startAsync` function, performing any additional common operations.\n * You can assume the dev server is started by the time this function is called.\n */\n protected async postStartAsync(options: BundlerStartOptions) {\n if (\n options.location.hostType === 'tunnel' &&\n !env.EXPO_OFFLINE &&\n // This is a hack to prevent using tunnel on web since we block it upstream for some reason.\n this.isTargetingNative()\n ) {\n await this._startTunnelAsync();\n }\n\n if (!options.isExporting) {\n await this.startDevSessionAsync();\n this.watchConfig();\n }\n }\n\n protected abstract getConfigModuleIds(): string[];\n\n protected watchConfig() {\n this.notifier?.stopObserving();\n this.notifier = new FileNotifier(this.projectRoot, this.getConfigModuleIds());\n this.notifier.startObserving();\n }\n\n /** Create ngrok instance and start the tunnel server. Exposed for testing. */\n public async _startTunnelAsync(): Promise<AsyncNgrok | null> {\n const port = this.getInstance()?.location.port;\n if (!port) return null;\n debug('[ngrok] connect to port: ' + port);\n this.ngrok = new AsyncNgrok(this.projectRoot, port);\n await this.ngrok.startAsync();\n return this.ngrok;\n }\n\n protected async startDevSessionAsync() {\n // This is used to make Expo Go open the project in either Expo Go, or the web browser.\n // Must come after ngrok (`startTunnelAsync`) setup.\n this.devSession?.stopNotifying?.();\n this.devSession = new DevelopmentSession(\n this.projectRoot,\n // This URL will be used on external devices so the computer IP won't be relevant.\n this.isTargetingNative()\n ? this.getNativeRuntimeUrl()\n : this.getDevServerUrl({ hostType: 'localhost' }),\n () => {\n // TODO: This appears to be happening consistently after an hour.\n // We should investigate why this is happening and fix it on our servers.\n // Log.error(\n // chalk.red(\n // '\\nAn unexpected error occurred while updating the Dev Session API. This project will not appear in the \"Development servers\" section of the Expo Go app until this process has been restarted.'\n // )\n // );\n // Log.exception(error);\n this.devSession?.closeAsync().catch((error) => {\n debug('[dev-session] error closing: ' + error.message);\n });\n }\n );\n\n await this.devSession.startAsync({\n runtime: this.isTargetingNative() ? 'native' : 'web',\n });\n }\n\n public isTargetingNative() {\n // Temporary hack while we implement multi-bundler dev server proxy.\n return true;\n }\n\n public isTargetingWeb() {\n return this.platformBundlers.web === this.name;\n }\n\n /**\n * Sends a message over web sockets to any connected device,\n * does nothing when the dev server is not running.\n *\n * @param method name of the command. In RN projects `reload`, and `devMenu` are available. In Expo Go, `sendDevCommand` is available.\n * @param params\n */\n public broadcastMessage(\n method: 'reload' | 'devMenu' | 'sendDevCommand',\n params?: Record<string, any>\n ) {\n this.getInstance()?.messageSocket.broadcast(method, params);\n }\n\n /** Get the running dev server instance. */\n public getInstance() {\n return this.instance;\n }\n\n /** Stop the running dev server instance. */\n async stopAsync() {\n // Stop file watching.\n this.notifier?.stopObserving();\n\n // Stop the dev session timer and tell Expo API to remove dev session.\n await this.devSession?.closeAsync();\n\n // Stop ngrok if running.\n await this.ngrok?.stopAsync().catch((e) => {\n Log.error(`Error stopping ngrok:`);\n Log.exception(e);\n });\n\n return resolveWithTimeout(\n () =>\n new Promise<void>((resolve, reject) => {\n // Close the server.\n debug(`Stopping dev server (bundler: ${this.name})`);\n\n if (this.instance?.server) {\n // Check if server is even running.\n this.instance.server.close((error) => {\n debug(`Stopped dev server (bundler: ${this.name})`);\n this.instance = null;\n if (error) {\n if ('code' in error && error.code === 'ERR_SERVER_NOT_RUNNING') {\n resolve();\n } else {\n reject(error);\n }\n } else {\n resolve();\n }\n });\n } else {\n debug(`Stopped dev server (bundler: ${this.name})`);\n this.instance = null;\n resolve();\n }\n }),\n {\n // NOTE(Bacon): Metro dev server doesn't seem to be closing in time.\n timeout: 1000,\n errorMessage: `Timeout waiting for '${this.name}' dev server to close`,\n }\n );\n }\n\n public getUrlCreator(options: Partial<Pick<BundlerStartOptions, 'port' | 'location'>> = {}) {\n if (!this.urlCreator) {\n assert(options?.port, 'Dev server instance not found');\n this.urlCreator = new UrlCreator(options.location, {\n port: options.port,\n getTunnelUrl: this.getTunnelUrl.bind(this),\n });\n }\n return this.urlCreator;\n }\n\n public getNativeRuntimeUrl(opts: Partial<CreateURLOptions> = {}) {\n return this.isDevClient\n ? this.getUrlCreator().constructDevClientUrl(opts) ?? this.getDevServerUrl()\n : this.getUrlCreator().constructUrl({ ...opts, scheme: 'exp' });\n }\n\n /** Get the URL for the running instance of the dev server. */\n public getDevServerUrl(options: { hostType?: 'localhost' } = {}): string | null {\n const instance = this.getInstance();\n if (!instance?.location) {\n return null;\n }\n const { location } = instance;\n if (options.hostType === 'localhost') {\n return `${location.protocol}://localhost:${location.port}`;\n }\n return location.url ?? null;\n }\n\n /** Get the base URL for JS inspector */\n public getJsInspectorBaseUrl(): string {\n if (this.name !== 'metro') {\n throw new CommandError(\n 'DEV_SERVER',\n `Cannot get the JS inspector base url - bundler[${this.name}]`\n );\n }\n return this.getUrlCreator().constructUrl({ scheme: 'http' });\n }\n\n /** Get the tunnel URL from ngrok. */\n public getTunnelUrl(): string | null {\n return this.ngrok?.getActiveUrl() ?? null;\n }\n\n /** Open the dev server in a runtime. */\n public async openPlatformAsync(\n launchTarget: keyof typeof PLATFORM_MANAGERS | 'desktop',\n resolver: BaseResolveDeviceProps<any> = {}\n ) {\n if (launchTarget === 'desktop') {\n const serverUrl = this.getDevServerUrl({ hostType: 'localhost' });\n // Allow opening the tunnel URL when using Metro web.\n const url = this.name === 'metro' ? this.getTunnelUrl() ?? serverUrl : serverUrl;\n await openBrowserAsync(url!);\n return { url };\n }\n\n const runtime = this.isTargetingNative() ? (this.isDevClient ? 'custom' : 'expo') : 'web';\n const manager = await this.getPlatformManagerAsync(launchTarget);\n return manager.openAsync({ runtime }, resolver);\n }\n\n /** Open the dev server in a runtime. */\n public async openCustomRuntimeAsync(\n launchTarget: keyof typeof PLATFORM_MANAGERS,\n launchProps: Partial<BaseOpenInCustomProps> = {},\n resolver: BaseResolveDeviceProps<any> = {}\n ) {\n const runtime = this.isTargetingNative() ? (this.isDevClient ? 'custom' : 'expo') : 'web';\n if (runtime !== 'custom') {\n throw new CommandError(\n `dev server cannot open custom runtimes either because it does not target native platforms or because it is not targeting dev clients. (target: ${runtime})`\n );\n }\n\n const manager = await this.getPlatformManagerAsync(launchTarget);\n return manager.openAsync({ runtime: 'custom', props: launchProps }, resolver);\n }\n\n /** Get the URL for opening in Expo Go. */\n protected getExpoGoUrl(): string {\n return this.getUrlCreator().constructUrl({ scheme: 'exp' });\n }\n\n /** Should use the interstitial page for selecting which runtime to use. */\n protected isRedirectPageEnabled(): boolean {\n return (\n !env.EXPO_NO_REDIRECT_PAGE &&\n // if user passed --dev-client flag, skip interstitial page\n !this.isDevClient &&\n // Checks if dev client is installed.\n !!resolveFrom.silent(this.projectRoot, 'expo-dev-client')\n );\n }\n\n /** Get the redirect URL when redirecting is enabled. */\n public getRedirectUrl(platform: keyof typeof PLATFORM_MANAGERS | null = null): string | null {\n if (!this.isRedirectPageEnabled()) {\n debug('Redirect page is disabled');\n return null;\n }\n\n return (\n this.getUrlCreator().constructLoadingUrl(\n {},\n platform === 'emulator' ? 'android' : platform === 'simulator' ? 'ios' : null\n ) ?? null\n );\n }\n\n public getReactDevToolsUrl(): string {\n return new URL(\n '_expo/react-devtools',\n this.getUrlCreator().constructUrl({ scheme: 'http' })\n ).toString();\n }\n\n protected async getPlatformManagerAsync(platform: keyof typeof PLATFORM_MANAGERS) {\n if (!this.platformManagers[platform]) {\n const Manager = PLATFORM_MANAGERS[platform]();\n const port = this.getInstance()?.location.port;\n if (!port || !this.urlCreator) {\n throw new CommandError(\n 'DEV_SERVER',\n 'Cannot interact with native platforms until dev server has started'\n );\n }\n debug(`Creating platform manager (platform: ${platform}, port: ${port})`);\n this.platformManagers[platform] = new Manager(this.projectRoot, port, {\n getCustomRuntimeUrl: this.urlCreator.constructDevClientUrl.bind(this.urlCreator),\n getExpoGoUrl: this.getExpoGoUrl.bind(this),\n getRedirectUrl: this.getRedirectUrl.bind(this, platform),\n getDevServerUrl: this.getDevServerUrl.bind(this, { hostType: 'localhost' }),\n });\n }\n return this.platformManagers[platform];\n }\n}\n"],"names":["BundlerDevServer","debug","require","PLATFORM_MANAGERS","simulator","ApplePlatformManager","emulator","AndroidPlatformManager","constructor","projectRoot","platformBundlers","options","ngrok","devSession","instance","platformManagers","urlCreator","notifier","devToolsPluginManager","DevToolsPluginManager","isDevClient","setInstance","getManifestMiddlewareAsync","Middleware","ExpoGoManifestHandlerMiddleware","getUrlCreator","middleware","constructUrl","bind","mode","minify","isNativeWebpack","name","isTargetingNative","privateKeyPath","startAsync","stopAsync","headless","startHeadlessAsync","startImplementationAsync","postStartAsync","waitForTypeScriptAsync","watchEnvironmentVariables","port","CommandError","server","close","callback","addListener","location","host","url","protocol","messageSocket","broadcast","hostType","env","EXPO_OFFLINE","_startTunnelAsync","isExporting","startDevSessionAsync","watchConfig","stopObserving","FileNotifier","getConfigModuleIds","startObserving","getInstance","AsyncNgrok","stopNotifying","DevelopmentSession","getNativeRuntimeUrl","getDevServerUrl","closeAsync","catch","error","message","runtime","isTargetingWeb","web","broadcastMessage","method","params","e","Log","exception","resolveWithTimeout","Promise","resolve","reject","code","timeout","errorMessage","assert","UrlCreator","getTunnelUrl","opts","constructDevClientUrl","scheme","getJsInspectorBaseUrl","getActiveUrl","openPlatformAsync","launchTarget","resolver","serverUrl","openBrowserAsync","manager","getPlatformManagerAsync","openAsync","openCustomRuntimeAsync","launchProps","props","getExpoGoUrl","isRedirectPageEnabled","EXPO_NO_REDIRECT_PAGE","resolveFrom","silent","getRedirectUrl","platform","constructLoadingUrl","getReactDevToolsUrl","URL","toString","Manager","getCustomRuntimeUrl"],"mappings":"AAAA;;;;+BAwFsBA,kBAAgB;;aAAhBA,gBAAgB;;;8DAxFnB,QAAQ;;;;;;;8DACH,cAAc;;;;;;4BAEX,cAAc;4EACP,yBAAyB;oCACxB,sBAAsB;4BACZ,cAAc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I,CAACtG,gBAAgB,CAACsG,QAAQ,CAAC,EAAE;gBAEvB,GAAkB;YAD/B,MAAMK,OAAO,GAAGvH,iBAAiB,CAACkH,QAAQ,CAAC,EAAE,AAAC;YAC9C,MAAM1E,IAAI,GAAG,CAAA,GAAkB,GAAlB,IAAI,CAACuB,WAAW,EAAE,SAAU,GAA5B,KAAA,CAA4B,GAA5B,GAAkB,CAAEjB,QAAQ,CAACN,IAAI,AAAC;YAC/C,IAAI,CAACA,IAAI,IAAI,CAAC,IAAI,CAAC3B,UAAU,EAAE;gBAC7B,MAAM,IAAI4B,OAAY,aAAA,CACpB,YAAY,EACZ,oEAAoE,CACrE,CAAC;YACJ,CAAC;YACD3C,KAAK,CAAC,CAAC,qCAAqC,EAAEoH,QAAQ,CAAC,QAAQ,EAAE1E,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;YAC1E,IAAI,CAAC5B,gBAAgB,CAACsG,QAAQ,CAAC,GAAG,IAAIK,OAAO,CAAC,IAAI,CAACjH,WAAW,EAAEkC,IAAI,EAAE;gBACpEgF,mBAAmB,EAAE,IAAI,CAAC3G,UAAU,CAACgF,qBAAqB,CAACpE,IAAI,CAAC,IAAI,CAACZ,UAAU,CAAC;gBAChF+F,YAAY,EAAE,IAAI,CAACA,YAAY,CAACnF,IAAI,CAAC,IAAI,CAAC;gBAC1CwF,cAAc,EAAE,IAAI,CAACA,cAAc,CAACxF,IAAI,CAAC,IAAI,EAAEyF,QAAQ,CAAC;gBACxD9C,eAAe,EAAE,IAAI,CAACA,eAAe,CAAC3C,IAAI,CAAC,IAAI,EAAE;oBAAE2B,QAAQ,EAAE,WAAW;iBAAE,CAAC;aAC5E,CAAC,CAAC;QACL,CAAC;QACD,OAAO,IAAI,CAACxC,gBAAgB,CAACsG,QAAQ,CAAC,CAAC;IACzC;CACD"}
|
|
1
|
+
{"version":3,"sources":["../../../../src/start/server/BundlerDevServer.ts"],"sourcesContent":["import assert from 'assert';\nimport resolveFrom from 'resolve-from';\n\nimport { AsyncNgrok } from './AsyncNgrok';\nimport DevToolsPluginManager from './DevToolsPluginManager';\nimport { DevelopmentSession } from './DevelopmentSession';\nimport { CreateURLOptions, UrlCreator } from './UrlCreator';\nimport { PlatformBundlers } from './platformBundlers';\nimport * as Log from '../../log';\nimport { FileNotifier } from '../../utils/FileNotifier';\nimport { resolveWithTimeout } from '../../utils/delay';\nimport { env } from '../../utils/env';\nimport { CommandError } from '../../utils/errors';\nimport { openBrowserAsync } from '../../utils/open';\nimport {\n BaseOpenInCustomProps,\n BaseResolveDeviceProps,\n PlatformManager,\n} from '../platforms/PlatformManager';\n\nconst debug = require('debug')('expo:start:server:devServer') as typeof console.log;\n\nexport type MessageSocket = {\n broadcast: (method: string, params?: Record<string, any> | undefined) => void;\n};\n\nexport type ServerLike = {\n close(callback?: (err?: Error) => void): void;\n addListener?(event: string, listener: (...args: any[]) => void): unknown;\n};\n\nexport type DevServerInstance = {\n /** Bundler dev server instance. */\n server: ServerLike;\n /** Dev server URL location properties. */\n location: {\n url: string;\n port: number;\n protocol: 'http' | 'https';\n host?: string;\n };\n /** Additional middleware that's attached to the `server`. */\n middleware: any;\n /** Message socket for communicating with the runtime. */\n messageSocket: MessageSocket;\n};\n\nexport interface BundlerStartOptions {\n /** Should the dev server use `https` protocol. */\n https?: boolean;\n /** Should start the dev servers in development mode (minify). */\n mode?: 'development' | 'production';\n /** Is dev client enabled. */\n devClient?: boolean;\n /** Should run dev servers with clean caches. */\n resetDevServer?: boolean;\n /** Code signing private key path (defaults to same directory as certificate) */\n privateKeyPath?: string;\n\n /** Max amount of workers (threads) to use with Metro bundler, defaults to undefined for max workers. */\n maxWorkers?: number;\n /** Port to start the dev server on. */\n port?: number;\n\n /** Should start a headless dev server e.g. mock representation to approximate info from a server running in a different process. */\n headless?: boolean;\n /** Should instruct the bundler to create minified bundles. */\n minify?: boolean;\n\n /** Will the bundler be used for exporting. NOTE: This is an odd option to pass to the dev server. */\n isExporting?: boolean;\n\n // Webpack options\n /** Should modify and create PWA icons. */\n isImageEditingEnabled?: boolean;\n\n location: CreateURLOptions;\n}\n\nconst PLATFORM_MANAGERS = {\n simulator: () =>\n require('../platforms/ios/ApplePlatformManager')\n .ApplePlatformManager as typeof import('../platforms/ios/ApplePlatformManager').ApplePlatformManager,\n emulator: () =>\n require('../platforms/android/AndroidPlatformManager')\n .AndroidPlatformManager as typeof import('../platforms/android/AndroidPlatformManager').AndroidPlatformManager,\n};\n\nexport abstract class BundlerDevServer {\n /** Name of the bundler. */\n abstract get name(): string;\n\n /** Ngrok instance for managing tunnel connections. */\n protected ngrok: AsyncNgrok | null = null;\n /** Interfaces with the Expo 'Development Session' API. */\n protected devSession: DevelopmentSession | null = null;\n /** Http server and related info. */\n protected instance: DevServerInstance | null = null;\n /** Native platform interfaces for opening projects. */\n private platformManagers: Record<string, PlatformManager<any>> = {};\n /** Manages the creation of dev server URLs. */\n protected urlCreator?: UrlCreator | null = null;\n\n private notifier: FileNotifier | null = null;\n protected readonly devToolsPluginManager: DevToolsPluginManager;\n public isDevClient: boolean;\n\n constructor(\n /** Project root folder. */\n public projectRoot: string,\n /** A mapping of bundlers to platforms. */\n public platformBundlers: PlatformBundlers,\n /** Advanced options */\n options?: {\n /**\n * The instance of DevToolsPluginManager\n * @default new DevToolsPluginManager(projectRoot)\n */\n devToolsPluginManager?: DevToolsPluginManager;\n // TODO: Replace with custom scheme maybe...\n isDevClient?: boolean;\n }\n ) {\n this.devToolsPluginManager =\n options?.devToolsPluginManager ?? new DevToolsPluginManager(projectRoot);\n this.isDevClient = options?.isDevClient ?? false;\n }\n\n protected setInstance(instance: DevServerInstance) {\n this.instance = instance;\n }\n\n /** Get the manifest middleware function. */\n protected async getManifestMiddlewareAsync(\n options: Pick<BundlerStartOptions, 'minify' | 'mode' | 'privateKeyPath'> = {}\n ) {\n const Middleware = require('./middleware/ExpoGoManifestHandlerMiddleware')\n .ExpoGoManifestHandlerMiddleware as typeof import('./middleware/ExpoGoManifestHandlerMiddleware').ExpoGoManifestHandlerMiddleware;\n\n const urlCreator = this.getUrlCreator();\n const middleware = new Middleware(this.projectRoot, {\n constructUrl: urlCreator.constructUrl.bind(urlCreator),\n mode: options.mode,\n minify: options.minify,\n isNativeWebpack: this.name === 'webpack' && this.isTargetingNative(),\n privateKeyPath: options.privateKeyPath,\n });\n return middleware;\n }\n\n /** Start the dev server using settings defined in the start command. */\n public async startAsync(options: BundlerStartOptions): Promise<DevServerInstance> {\n await this.stopAsync();\n\n let instance: DevServerInstance;\n if (options.headless) {\n instance = await this.startHeadlessAsync(options);\n } else {\n instance = await this.startImplementationAsync(options);\n }\n\n this.setInstance(instance);\n await this.postStartAsync(options);\n return instance;\n }\n\n protected abstract startImplementationAsync(\n options: BundlerStartOptions\n ): Promise<DevServerInstance>;\n\n public async waitForTypeScriptAsync(): Promise<boolean> {\n return false;\n }\n\n public abstract startTypeScriptServices(): Promise<void>;\n\n public async watchEnvironmentVariables(): Promise<void> {\n // noop -- We've only implemented this functionality in Metro.\n }\n\n /**\n * Creates a mock server representation that can be used to estimate URLs for a server started in another process.\n * This is used for the run commands where you can reuse the server from a previous run.\n */\n private async startHeadlessAsync(options: BundlerStartOptions): Promise<DevServerInstance> {\n if (!options.port)\n throw new CommandError('HEADLESS_SERVER', 'headless dev server requires a port option');\n this.urlCreator = this.getUrlCreator(options);\n\n return {\n // Create a mock server\n server: {\n close: (callback: () => void) => {\n this.instance = null;\n callback?.();\n },\n addListener() {},\n },\n location: {\n // The port is the main thing we want to send back.\n port: options.port,\n // localhost isn't always correct.\n host: 'localhost',\n // http is the only supported protocol on native.\n url: `http://localhost:${options.port}`,\n protocol: 'http',\n },\n middleware: {},\n messageSocket: {\n broadcast: () => {\n throw new CommandError('HEADLESS_SERVER', 'Cannot broadcast messages to headless server');\n },\n },\n };\n }\n\n /**\n * Runs after the `startAsync` function, performing any additional common operations.\n * You can assume the dev server is started by the time this function is called.\n */\n protected async postStartAsync(options: BundlerStartOptions) {\n if (\n options.location.hostType === 'tunnel' &&\n !env.EXPO_OFFLINE &&\n // This is a hack to prevent using tunnel on web since we block it upstream for some reason.\n this.isTargetingNative()\n ) {\n await this._startTunnelAsync();\n }\n\n if (!options.isExporting) {\n await this.startDevSessionAsync();\n this.watchConfig();\n }\n }\n\n protected abstract getConfigModuleIds(): string[];\n\n protected watchConfig() {\n this.notifier?.stopObserving();\n this.notifier = new FileNotifier(this.projectRoot, this.getConfigModuleIds());\n this.notifier.startObserving();\n }\n\n /** Create ngrok instance and start the tunnel server. Exposed for testing. */\n public async _startTunnelAsync(): Promise<AsyncNgrok | null> {\n const port = this.getInstance()?.location.port;\n if (!port) return null;\n debug('[ngrok] connect to port: ' + port);\n this.ngrok = new AsyncNgrok(this.projectRoot, port);\n await this.ngrok.startAsync();\n return this.ngrok;\n }\n\n protected async startDevSessionAsync() {\n // This is used to make Expo Go open the project in either Expo Go, or the web browser.\n // Must come after ngrok (`startTunnelAsync`) setup.\n this.devSession = new DevelopmentSession(\n this.projectRoot,\n // This URL will be used on external devices so the computer IP won't be relevant.\n this.isTargetingNative()\n ? this.getNativeRuntimeUrl()\n : this.getDevServerUrl({ hostType: 'localhost' })\n );\n\n await this.devSession.startAsync({\n runtime: this.isTargetingNative() ? 'native' : 'web',\n });\n }\n\n public isTargetingNative() {\n // Temporary hack while we implement multi-bundler dev server proxy.\n return true;\n }\n\n public isTargetingWeb() {\n return this.platformBundlers.web === this.name;\n }\n\n /**\n * Sends a message over web sockets to any connected device,\n * does nothing when the dev server is not running.\n *\n * @param method name of the command. In RN projects `reload`, and `devMenu` are available. In Expo Go, `sendDevCommand` is available.\n * @param params\n */\n public broadcastMessage(\n method: 'reload' | 'devMenu' | 'sendDevCommand',\n params?: Record<string, any>\n ) {\n this.getInstance()?.messageSocket.broadcast(method, params);\n }\n\n /** Get the running dev server instance. */\n public getInstance() {\n return this.instance;\n }\n\n /** Stop the running dev server instance. */\n async stopAsync() {\n // Stop file watching.\n this.notifier?.stopObserving();\n\n // Stop the dev session timer and tell Expo API to remove dev session.\n await this.devSession?.closeAsync();\n\n // Stop ngrok if running.\n await this.ngrok?.stopAsync().catch((e) => {\n Log.error(`Error stopping ngrok:`);\n Log.exception(e);\n });\n\n return resolveWithTimeout(\n () =>\n new Promise<void>((resolve, reject) => {\n // Close the server.\n debug(`Stopping dev server (bundler: ${this.name})`);\n\n if (this.instance?.server) {\n // Check if server is even running.\n this.instance.server.close((error) => {\n debug(`Stopped dev server (bundler: ${this.name})`);\n this.instance = null;\n if (error) {\n if ('code' in error && error.code === 'ERR_SERVER_NOT_RUNNING') {\n resolve();\n } else {\n reject(error);\n }\n } else {\n resolve();\n }\n });\n } else {\n debug(`Stopped dev server (bundler: ${this.name})`);\n this.instance = null;\n resolve();\n }\n }),\n {\n // NOTE(Bacon): Metro dev server doesn't seem to be closing in time.\n timeout: 1000,\n errorMessage: `Timeout waiting for '${this.name}' dev server to close`,\n }\n );\n }\n\n public getUrlCreator(options: Partial<Pick<BundlerStartOptions, 'port' | 'location'>> = {}) {\n if (!this.urlCreator) {\n assert(options?.port, 'Dev server instance not found');\n this.urlCreator = new UrlCreator(options.location, {\n port: options.port,\n getTunnelUrl: this.getTunnelUrl.bind(this),\n });\n }\n return this.urlCreator;\n }\n\n public getNativeRuntimeUrl(opts: Partial<CreateURLOptions> = {}) {\n return this.isDevClient\n ? this.getUrlCreator().constructDevClientUrl(opts) ?? this.getDevServerUrl()\n : this.getUrlCreator().constructUrl({ ...opts, scheme: 'exp' });\n }\n\n /** Get the URL for the running instance of the dev server. */\n public getDevServerUrl(options: { hostType?: 'localhost' } = {}): string | null {\n const instance = this.getInstance();\n if (!instance?.location) {\n return null;\n }\n const { location } = instance;\n if (options.hostType === 'localhost') {\n return `${location.protocol}://localhost:${location.port}`;\n }\n return location.url ?? null;\n }\n\n /** Get the base URL for JS inspector */\n public getJsInspectorBaseUrl(): string {\n if (this.name !== 'metro') {\n throw new CommandError(\n 'DEV_SERVER',\n `Cannot get the JS inspector base url - bundler[${this.name}]`\n );\n }\n return this.getUrlCreator().constructUrl({ scheme: 'http' });\n }\n\n /** Get the tunnel URL from ngrok. */\n public getTunnelUrl(): string | null {\n return this.ngrok?.getActiveUrl() ?? null;\n }\n\n /** Open the dev server in a runtime. */\n public async openPlatformAsync(\n launchTarget: keyof typeof PLATFORM_MANAGERS | 'desktop',\n resolver: BaseResolveDeviceProps<any> = {}\n ) {\n if (launchTarget === 'desktop') {\n const serverUrl = this.getDevServerUrl({ hostType: 'localhost' });\n // Allow opening the tunnel URL when using Metro web.\n const url = this.name === 'metro' ? this.getTunnelUrl() ?? serverUrl : serverUrl;\n await openBrowserAsync(url!);\n return { url };\n }\n\n const runtime = this.isTargetingNative() ? (this.isDevClient ? 'custom' : 'expo') : 'web';\n const manager = await this.getPlatformManagerAsync(launchTarget);\n return manager.openAsync({ runtime }, resolver);\n }\n\n /** Open the dev server in a runtime. */\n public async openCustomRuntimeAsync(\n launchTarget: keyof typeof PLATFORM_MANAGERS,\n launchProps: Partial<BaseOpenInCustomProps> = {},\n resolver: BaseResolveDeviceProps<any> = {}\n ) {\n const runtime = this.isTargetingNative() ? (this.isDevClient ? 'custom' : 'expo') : 'web';\n if (runtime !== 'custom') {\n throw new CommandError(\n `dev server cannot open custom runtimes either because it does not target native platforms or because it is not targeting dev clients. (target: ${runtime})`\n );\n }\n\n const manager = await this.getPlatformManagerAsync(launchTarget);\n return manager.openAsync({ runtime: 'custom', props: launchProps }, resolver);\n }\n\n /** Get the URL for opening in Expo Go. */\n protected getExpoGoUrl(): string {\n return this.getUrlCreator().constructUrl({ scheme: 'exp' });\n }\n\n /** Should use the interstitial page for selecting which runtime to use. */\n protected isRedirectPageEnabled(): boolean {\n return (\n !env.EXPO_NO_REDIRECT_PAGE &&\n // if user passed --dev-client flag, skip interstitial page\n !this.isDevClient &&\n // Checks if dev client is installed.\n !!resolveFrom.silent(this.projectRoot, 'expo-dev-client')\n );\n }\n\n /** Get the redirect URL when redirecting is enabled. */\n public getRedirectUrl(platform: keyof typeof PLATFORM_MANAGERS | null = null): string | null {\n if (!this.isRedirectPageEnabled()) {\n debug('Redirect page is disabled');\n return null;\n }\n\n return (\n this.getUrlCreator().constructLoadingUrl(\n {},\n platform === 'emulator' ? 'android' : platform === 'simulator' ? 'ios' : null\n ) ?? null\n );\n }\n\n public getReactDevToolsUrl(): string {\n return new URL(\n '_expo/react-devtools',\n this.getUrlCreator().constructUrl({ scheme: 'http' })\n ).toString();\n }\n\n protected async getPlatformManagerAsync(platform: keyof typeof PLATFORM_MANAGERS) {\n if (!this.platformManagers[platform]) {\n const Manager = PLATFORM_MANAGERS[platform]();\n const port = this.getInstance()?.location.port;\n if (!port || !this.urlCreator) {\n throw new CommandError(\n 'DEV_SERVER',\n 'Cannot interact with native platforms until dev server has started'\n );\n }\n debug(`Creating platform manager (platform: ${platform}, port: ${port})`);\n this.platformManagers[platform] = new Manager(this.projectRoot, port, {\n getCustomRuntimeUrl: this.urlCreator.constructDevClientUrl.bind(this.urlCreator),\n getExpoGoUrl: this.getExpoGoUrl.bind(this),\n getRedirectUrl: this.getRedirectUrl.bind(this, platform),\n getDevServerUrl: this.getDevServerUrl.bind(this, { hostType: 'localhost' }),\n });\n }\n return this.platformManagers[platform];\n }\n}\n"],"names":["BundlerDevServer","debug","require","PLATFORM_MANAGERS","simulator","ApplePlatformManager","emulator","AndroidPlatformManager","constructor","projectRoot","platformBundlers","options","ngrok","devSession","instance","platformManagers","urlCreator","notifier","devToolsPluginManager","DevToolsPluginManager","isDevClient","setInstance","getManifestMiddlewareAsync","Middleware","ExpoGoManifestHandlerMiddleware","getUrlCreator","middleware","constructUrl","bind","mode","minify","isNativeWebpack","name","isTargetingNative","privateKeyPath","startAsync","stopAsync","headless","startHeadlessAsync","startImplementationAsync","postStartAsync","waitForTypeScriptAsync","watchEnvironmentVariables","port","CommandError","server","close","callback","addListener","location","host","url","protocol","messageSocket","broadcast","hostType","env","EXPO_OFFLINE","_startTunnelAsync","isExporting","startDevSessionAsync","watchConfig","stopObserving","FileNotifier","getConfigModuleIds","startObserving","getInstance","AsyncNgrok","DevelopmentSession","getNativeRuntimeUrl","getDevServerUrl","runtime","isTargetingWeb","web","broadcastMessage","method","params","closeAsync","catch","e","Log","error","exception","resolveWithTimeout","Promise","resolve","reject","code","timeout","errorMessage","assert","UrlCreator","getTunnelUrl","opts","constructDevClientUrl","scheme","getJsInspectorBaseUrl","getActiveUrl","openPlatformAsync","launchTarget","resolver","serverUrl","openBrowserAsync","manager","getPlatformManagerAsync","openAsync","openCustomRuntimeAsync","launchProps","props","getExpoGoUrl","isRedirectPageEnabled","EXPO_NO_REDIRECT_PAGE","resolveFrom","silent","getRedirectUrl","platform","constructLoadingUrl","getReactDevToolsUrl","URL","toString","Manager","getCustomRuntimeUrl"],"mappings":"AAAA;;;;+BAwFsBA,kBAAgB;;aAAhBA,gBAAgB;;;8DAxFnB,QAAQ;;;;;;;8DACH,cAAc;;;;;;4BAEX,cAAc;4EACP,yBAAyB;oCACxB,sBAAsB;4BACZ,cAAc;2DAEtC,WAAW;8BACH,0BAA0B;uBACpB,mBAAmB;qBAClC,iBAAiB;wBACR,oBAAoB;sBAChB,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOnD,MAAMC,KAAK,GAAGC,OAAO,CAAC,OAAO,CAAC,CAAC,6BAA6B,CAAC,AAAsB,AAAC;AA2DpF,MAAMC,iBAAiB,GAAG;IACxBC,SAAS,EAAE,IACTF,OAAO,CAAC,uCAAuC,CAAC,CAC7CG,oBAAoB,AAA+E;IACxGC,QAAQ,EAAE,IACRJ,OAAO,CAAC,6CAA6C,CAAC,CACnDK,sBAAsB,AAAuF;CACnH,AAAC;AAEK,MAAeP,gBAAgB;IAmBpCQ,YAESC,WAAmB,EAEnBC,gBAAkC,EACzC,qBAAqB,GACrBC,OAQC,CACD;QAbOF,mBAAAA,WAAmB,CAAA;QAEnBC,wBAAAA,gBAAkC,CAAA;aAlBjCE,KAAK,GAAsB,IAAI;aAE/BC,UAAU,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
|
|
|
57
57
|
return newObj;
|
|
58
58
|
}
|
|
59
59
|
const debug = require("debug")("expo:start:server:developmentSession");
|
|
60
|
-
const UPDATE_FREQUENCY = 20 * 1000; // 20 seconds
|
|
61
60
|
async function isAuthenticatedAsync() {
|
|
62
61
|
return !!await (0, _user.getUserAsync)().catch(()=>null);
|
|
63
62
|
}
|
|
64
63
|
class DevelopmentSession {
|
|
65
|
-
constructor(projectRoot, url
|
|
64
|
+
constructor(projectRoot, url){
|
|
66
65
|
this.projectRoot = projectRoot;
|
|
67
66
|
this.url = url;
|
|
68
|
-
this.
|
|
69
|
-
this.timeout = null;
|
|
67
|
+
this.hasActiveSession = false;
|
|
70
68
|
}
|
|
71
69
|
/**
|
|
72
70
|
* Notify the Expo servers that a project is running, this enables the Expo Go app
|
|
73
71
|
* and Dev Clients to offer a "recently in development" section for quick access.
|
|
74
72
|
*
|
|
75
|
-
* This method starts an interval that will continue to ping the servers until we stop it.
|
|
76
|
-
*
|
|
77
73
|
* @param projectRoot Project root folder, used for retrieving device installation IDs.
|
|
78
74
|
* @param props.exp Partial Expo config with values that will be used in the Expo Go app.
|
|
79
75
|
* @param props.runtime which runtime the app should be opened in. `native` for dev clients, `web` for web browsers.
|
|
@@ -81,50 +77,38 @@ class DevelopmentSession {
|
|
|
81
77
|
try {
|
|
82
78
|
if (_env.env.CI || _env.env.EXPO_OFFLINE) {
|
|
83
79
|
debug(_env.env.CI ? "This project will not be suggested in Expo Go or Dev Clients because Expo CLI is running in CI." : "This project will not be suggested in Expo Go or Dev Clients because Expo CLI is running in offline-mode.");
|
|
84
|
-
this.stopNotifying();
|
|
85
80
|
return;
|
|
86
81
|
}
|
|
87
82
|
const deviceIds = await this.getDeviceInstallationIdsAsync();
|
|
88
83
|
if (!await isAuthenticatedAsync() && !(deviceIds == null ? void 0 : deviceIds.length)) {
|
|
89
84
|
debug("Development session will not ping because the user is not authenticated and there are no devices.");
|
|
90
|
-
this.stopNotifying();
|
|
91
85
|
return;
|
|
92
86
|
}
|
|
93
87
|
if (this.url) {
|
|
94
|
-
|
|
88
|
+
debug(`Development session ping (runtime: ${runtime}, url: ${this.url})`);
|
|
95
89
|
await (0, _updateDevelopmentSession.updateDevelopmentSessionAsync)({
|
|
96
90
|
url: this.url,
|
|
97
91
|
runtime,
|
|
98
92
|
exp,
|
|
99
93
|
deviceIds
|
|
100
94
|
});
|
|
95
|
+
this.hasActiveSession = true;
|
|
101
96
|
}
|
|
102
|
-
this.stopNotifying();
|
|
103
|
-
this.timeout = setTimeout(()=>this.startAsync({
|
|
104
|
-
exp,
|
|
105
|
-
runtime
|
|
106
|
-
}), UPDATE_FREQUENCY);
|
|
107
97
|
} catch (error) {
|
|
108
98
|
debug(`Error updating development session API: ${error}`);
|
|
109
|
-
this.stopNotifying();
|
|
110
|
-
this.onError(error);
|
|
111
99
|
}
|
|
112
100
|
}
|
|
113
101
|
/** Get all recent devices for the project. */ async getDeviceInstallationIdsAsync() {
|
|
114
102
|
const { devices } = await _devices.getDevicesInfoAsync(this.projectRoot);
|
|
115
103
|
return devices.map(({ installationId })=>installationId);
|
|
116
104
|
}
|
|
117
|
-
/** Stop notifying the Expo servers that the development session is running. */ stopNotifying() {
|
|
118
|
-
if (this.timeout) {
|
|
119
|
-
clearTimeout(this.timeout);
|
|
120
|
-
}
|
|
121
|
-
this.timeout = null;
|
|
122
|
-
}
|
|
123
105
|
/** Try to close any pending development sessions, but always resolve */ async closeAsync() {
|
|
124
|
-
this.
|
|
125
|
-
if (_env.env.CI || _env.env.EXPO_OFFLINE) {
|
|
106
|
+
if (_env.env.CI || _env.env.EXPO_OFFLINE || !this.hasActiveSession) {
|
|
126
107
|
return false;
|
|
127
108
|
}
|
|
109
|
+
// Clear out the development session, even if the call fails.
|
|
110
|
+
// This blocks subsequent calls to `stopAsync`
|
|
111
|
+
this.hasActiveSession = false;
|
|
128
112
|
try {
|
|
129
113
|
const deviceIds = await this.getDeviceInstallationIdsAsync();
|
|
130
114
|
if (!await isAuthenticatedAsync() && !(deviceIds == null ? void 0 : deviceIds.length)) {
|
|
@@ -139,7 +123,6 @@ class DevelopmentSession {
|
|
|
139
123
|
return true;
|
|
140
124
|
} catch (error) {
|
|
141
125
|
debug(`Error closing development session API: ${error}`);
|
|
142
|
-
this.onError(error);
|
|
143
126
|
return false;
|
|
144
127
|
}
|
|
145
128
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/start/server/DevelopmentSession.ts"],"sourcesContent":["import { ExpoConfig, getConfig } from '@expo/config';\n\nimport {\n closeDevelopmentSessionAsync,\n updateDevelopmentSessionAsync,\n} from '../../api/updateDevelopmentSession';\nimport { getUserAsync } from '../../api/user/user';\nimport { env } from '../../utils/env';\nimport * as ProjectDevices from '../project/devices';\n\nconst debug = require('debug')('expo:start:server:developmentSession') as typeof console.log;\n\
|
|
1
|
+
{"version":3,"sources":["../../../../src/start/server/DevelopmentSession.ts"],"sourcesContent":["import { ExpoConfig, getConfig } from '@expo/config';\n\nimport {\n closeDevelopmentSessionAsync,\n updateDevelopmentSessionAsync,\n} from '../../api/updateDevelopmentSession';\nimport { getUserAsync } from '../../api/user/user';\nimport { env } from '../../utils/env';\nimport * as ProjectDevices from '../project/devices';\n\nconst debug = require('debug')('expo:start:server:developmentSession') as typeof console.log;\n\nasync function isAuthenticatedAsync(): Promise<boolean> {\n return !!(await getUserAsync().catch(() => null));\n}\n\nexport class DevelopmentSession {\n /** If the `startAsync` was successfully called */\n private hasActiveSession = false;\n\n constructor(\n /** Project root directory. */\n private projectRoot: string,\n /** Development Server URL. */\n public url: string | null\n ) {}\n\n /**\n * Notify the Expo servers that a project is running, this enables the Expo Go app\n * and Dev Clients to offer a \"recently in development\" section for quick access.\n *\n * @param projectRoot Project root folder, used for retrieving device installation IDs.\n * @param props.exp Partial Expo config with values that will be used in the Expo Go app.\n * @param props.runtime which runtime the app should be opened in. `native` for dev clients, `web` for web browsers.\n */\n public async startAsync({\n exp = getConfig(this.projectRoot).exp,\n runtime,\n }: {\n exp?: Pick<ExpoConfig, 'name' | 'description' | 'slug' | 'primaryColor'>;\n runtime: 'native' | 'web';\n }): Promise<void> {\n try {\n if (env.CI || env.EXPO_OFFLINE) {\n debug(\n env.CI\n ? 'This project will not be suggested in Expo Go or Dev Clients because Expo CLI is running in CI.'\n : 'This project will not be suggested in Expo Go or Dev Clients because Expo CLI is running in offline-mode.'\n );\n return;\n }\n\n const deviceIds = await this.getDeviceInstallationIdsAsync();\n\n if (!(await isAuthenticatedAsync()) && !deviceIds?.length) {\n debug(\n 'Development session will not ping because the user is not authenticated and there are no devices.'\n );\n return;\n }\n\n if (this.url) {\n debug(`Development session ping (runtime: ${runtime}, url: ${this.url})`);\n await updateDevelopmentSessionAsync({\n url: this.url,\n runtime,\n exp,\n deviceIds,\n });\n this.hasActiveSession = true;\n }\n } catch (error: any) {\n debug(`Error updating development session API: ${error}`);\n }\n }\n\n /** Get all recent devices for the project. */\n private async getDeviceInstallationIdsAsync(): Promise<string[]> {\n const { devices } = await ProjectDevices.getDevicesInfoAsync(this.projectRoot);\n return devices.map(({ installationId }) => installationId);\n }\n\n /** Try to close any pending development sessions, but always resolve */\n public async closeAsync(): Promise<boolean> {\n if (env.CI || env.EXPO_OFFLINE || !this.hasActiveSession) {\n return false;\n }\n\n // Clear out the development session, even if the call fails.\n // This blocks subsequent calls to `stopAsync`\n this.hasActiveSession = false;\n\n try {\n const deviceIds = await this.getDeviceInstallationIdsAsync();\n\n if (!(await isAuthenticatedAsync()) && !deviceIds?.length) {\n return false;\n }\n\n if (this.url) {\n await closeDevelopmentSessionAsync({\n url: this.url,\n deviceIds,\n });\n }\n\n return true;\n } catch (error: any) {\n debug(`Error closing development session API: ${error}`);\n return false;\n }\n }\n}\n"],"names":["DevelopmentSession","debug","require","isAuthenticatedAsync","getUserAsync","catch","constructor","projectRoot","url","hasActiveSession","startAsync","exp","getConfig","runtime","env","CI","EXPO_OFFLINE","deviceIds","getDeviceInstallationIdsAsync","length","updateDevelopmentSessionAsync","error","devices","ProjectDevices","getDevicesInfoAsync","map","installationId","closeAsync","closeDevelopmentSessionAsync"],"mappings":"AAAA;;;;+BAgBaA,oBAAkB;;aAAlBA,kBAAkB;;;yBAhBO,cAAc;;;;;;0CAK7C,oCAAoC;sBACd,qBAAqB;qBAC9B,iBAAiB;+DACL,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEpD,MAAMC,KAAK,GAAGC,OAAO,CAAC,OAAO,CAAC,CAAC,sCAAsC,CAAC,AAAsB,AAAC;AAE7F,eAAeC,oBAAoB,GAAqB;IACtD,OAAO,CAAC,CAAE,MAAMC,IAAAA,KAAY,aAAA,GAAE,CAACC,KAAK,CAAC,IAAM,IAAI,CAAC,AAAC,CAAC;AACpD,CAAC;AAEM,MAAML,kBAAkB;IAI7BM,YAEUC,WAAmB,EAEpBC,GAAkB,CACzB;QAHQD,mBAAAA,WAAmB,CAAA;QAEpBC,WAAAA,GAAkB,CAAA;aANnBC,gBAAgB,GAAG,KAAK;IAO7B;IAEH;;;;;;;GAOC,SACYC,UAAU,CAAC,EACtBC,GAAG,EAAGC,IAAAA,OAAS,EAAA,UAAA,EAAC,IAAI,CAACL,WAAW,CAAC,CAACI,GAAG,CAAA,EACrCE,OAAO,CAAA,EAIR,EAAiB;QAChB,IAAI;YACF,IAAIC,IAAG,IAAA,CAACC,EAAE,IAAID,IAAG,IAAA,CAACE,YAAY,EAAE;gBAC9Bf,KAAK,CACHa,IAAG,IAAA,CAACC,EAAE,GACF,iGAAiG,GACjG,2GAA2G,CAChH,CAAC;gBACF,OAAO;YACT,CAAC;YAED,MAAME,SAAS,GAAG,MAAM,IAAI,CAACC,6BAA6B,EAAE,AAAC;YAE7D,IAAI,CAAE,MAAMf,oBAAoB,EAAE,AAAC,IAAI,CAACc,CAAAA,SAAS,QAAQ,GAAjBA,KAAAA,CAAiB,GAAjBA,SAAS,CAAEE,MAAM,CAAA,EAAE;gBACzDlB,KAAK,CACH,mGAAmG,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OAAO,KAAK,CAAC;YACf,CAAC;YAED,IAAI,IAAI,CAACX,GAAG,EAAE;gBACZ,MAAMoB,IAAAA,yBAA4B,6BAAA,EAAC;oBACjCpB,GAAG,EAAE,IAAI,CAACA,GAAG;oBACbS,SAAS;iBACV,CAAC,CAAC;YACL,CAAC;YAED,OAAO,IAAI,CAAC;QACd,EAAE,OAAOI,KAAK,EAAO;YACnBpB,KAAK,CAAC,CAAC,uCAAuC,EAAEoB,KAAK,CAAC,CAAC,CAAC,CAAC;YACzD,OAAO,KAAK,CAAC;QACf,CAAC;IACH;CACD"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "createDevToolsPluginWebsocketEndpoint", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: ()=>createDevToolsPluginWebsocketEndpoint
|
|
8
|
+
});
|
|
9
|
+
function _ws() {
|
|
10
|
+
const data = require("ws");
|
|
11
|
+
_ws = function() {
|
|
12
|
+
return data;
|
|
13
|
+
};
|
|
14
|
+
return data;
|
|
15
|
+
}
|
|
16
|
+
function createDevToolsPluginWebsocketEndpoint() {
|
|
17
|
+
const wss = new (_ws()).WebSocketServer({
|
|
18
|
+
noServer: true
|
|
19
|
+
});
|
|
20
|
+
wss.on("connection", (ws)=>{
|
|
21
|
+
ws.on("message", (message)=>{
|
|
22
|
+
// Broadcast the received message to all other connected clients
|
|
23
|
+
wss.clients.forEach((client)=>{
|
|
24
|
+
if (client !== ws && client.readyState === _ws().WebSocket.OPEN) {
|
|
25
|
+
client.send(message);
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
return {
|
|
31
|
+
"/expo-dev-plugins/broadcast": wss
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
//# sourceMappingURL=DevToolsPluginWebsocketEndpoint.js.map
|
|
@@ -0,0 +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: WebSocket) => {\n ws.on('message', (message: string) => {\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);\n }\n });\n });\n });\n\n return { '/expo-dev-plugins/broadcast': wss };\n}\n"],"names":["createDevToolsPluginWebsocketEndpoint","wss","WebSocketServer","noServer","on","ws","message","clients","forEach","client","readyState","WebSocket","OPEN","send"],"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,EAAa,GAAK;QACtCA,EAAE,CAACD,EAAE,CAAC,SAAS,EAAE,CAACE,OAAe,GAAK;YACpC,gEAAgE;YAChEL,GAAG,CAACM,OAAO,CAACC,OAAO,CAAC,CAACC,MAAM,GAAK;gBAC9B,IAAIA,MAAM,KAAKJ,EAAE,IAAII,MAAM,CAACC,UAAU,KAAKC,GAAS,EAAA,UAAA,CAACC,IAAI,EAAE;oBACzDH,MAAM,CAACI,IAAI,CAACP,OAAO,CAAC,CAAC;gBACvB,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO;QAAE,6BAA6B,EAAEL,GAAG;KAAE,CAAC;AAChD,CAAC"}
|
|
@@ -69,6 +69,7 @@ function _url() {
|
|
|
69
69
|
};
|
|
70
70
|
return data;
|
|
71
71
|
}
|
|
72
|
+
const _devToolsPluginWebsocketEndpoint = require("./DevToolsPluginWebsocketEndpoint");
|
|
72
73
|
const _metroTerminalReporter = require("./MetroTerminalReporter");
|
|
73
74
|
const _attachAtlas = require("./debugging/attachAtlas");
|
|
74
75
|
const _createDebugMiddleware = require("./debugging/createDebugMiddleware");
|
|
@@ -241,7 +242,8 @@ async function instantiateMetroAsync(metroBundler, options, { isExporting , exp
|
|
|
241
242
|
// @ts-expect-error: Inconsistent `websocketEndpoints` type between metro and @react-native-community/cli-server-api
|
|
242
243
|
websocketEndpoints: {
|
|
243
244
|
...websocketEndpoints,
|
|
244
|
-
...debugWebsocketEndpoints
|
|
245
|
+
...debugWebsocketEndpoints,
|
|
246
|
+
...(0, _devToolsPluginWebsocketEndpoint.createDevToolsPluginWebsocketEndpoint)()
|
|
245
247
|
},
|
|
246
248
|
watch: !isExporting && isWatchEnabled()
|
|
247
249
|
}, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/start/server/metro/instantiateMetro.ts"],"sourcesContent":["import { ExpoConfig, getConfig } from '@expo/config';\nimport { getDefaultConfig, LoadOptions } from '@expo/metro-config';\nimport chalk from 'chalk';\nimport { Server as ConnectServer } from 'connect';\nimport http from 'http';\nimport type Metro from 'metro';\nimport Bundler from 'metro/src/Bundler';\nimport { loadConfig, resolveConfig, ConfigT } from 'metro-config';\nimport { Terminal } from 'metro-core';\nimport util from 'node:util';\nimport semver from 'semver';\nimport { URL } from 'url';\n\nimport { MetroBundlerDevServer } from './MetroBundlerDevServer';\nimport { MetroTerminalReporter } from './MetroTerminalReporter';\nimport { attachAtlasAsync } from './debugging/attachAtlas';\nimport { createDebugMiddleware } from './debugging/createDebugMiddleware';\nimport { runServer } from './runServer-fork';\nimport { withMetroMultiPlatformAsync } from './withMetroMultiPlatform';\nimport { Log } from '../../../log';\nimport { getMetroProperties } from '../../../utils/analytics/getMetroProperties';\nimport { createDebuggerTelemetryMiddleware } from '../../../utils/analytics/metroDebuggerMiddleware';\nimport { env } from '../../../utils/env';\nimport { logEventAsync } from '../../../utils/telemetry';\nimport { createCorsMiddleware } from '../middleware/CorsMiddleware';\nimport { getMetroServerRoot } from '../middleware/ManifestMiddleware';\nimport { createJsInspectorMiddleware } from '../middleware/inspector/createJsInspectorMiddleware';\nimport { prependMiddleware, replaceMiddlewareWith } from '../middleware/mutations';\nimport { ServerNext, ServerRequest, ServerResponse } from '../middleware/server.types';\nimport { suppressRemoteDebuggingErrorMiddleware } from '../middleware/suppressErrorMiddleware';\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\nfunction gteSdkVersion(exp: Pick<ExpoConfig, 'sdkVersion'>, sdkVersion: string): boolean {\n if (!exp.sdkVersion) {\n return false;\n }\n\n if (exp.sdkVersion === 'UNVERSIONED') {\n return true;\n }\n\n try {\n return semver.gte(exp.sdkVersion, sdkVersion);\n } catch {\n throw new Error(`${exp.sdkVersion} is not a valid version. Must be in the form of x.y.z`);\n }\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 // @ts-expect-error\n this._logLines.push(\n // format args like console.log\n util.format(...args)\n );\n // @ts-expect-error\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 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 if (\n // Requires SDK 50 for expo-assets hashAssetPlugin change.\n !exp.sdkVersion ||\n gteSdkVersion(exp, '50.0.0')\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 } else {\n if (isExporting && exp.experiments?.baseUrl) {\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 = exp.experiments?.baseUrl;\n }\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 config = await withMetroMultiPlatformAsync(projectRoot, {\n config,\n exp,\n platformBundlers,\n isTsconfigPathsEnabled: exp.experiments?.tsconfigPaths ?? true,\n webOutput: exp.web?.output ?? 'single',\n isFastResolverEnabled: env.EXPO_USE_FAST_RESOLVER,\n isExporting,\n isReactCanaryEnabled: exp.experiments?.reactCanary ?? false,\n getMetroBundler,\n });\n\n if (process.env.NODE_ENV !== 'test') {\n logEventAsync('metro config', getMetroProperties(projectRoot, exp, config));\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 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 const { createDevServerMiddleware, securityHeadersMiddleware } =\n require('@react-native-community/cli-server-api') as typeof import('@react-native-community/cli-server-api');\n\n const { middleware, messageSocketEndpoint, eventsSocketEndpoint, websocketEndpoints } =\n createDevServerMiddleware({\n port: metroConfig.server.port,\n watchFolders: metroConfig.watchFolders,\n });\n\n let debugWebsocketEndpoints: {\n [path: string]: import('ws').WebSocketServer;\n } = {};\n\n if (!isExporting) {\n // The `securityHeadersMiddleware` does not support cross-origin requests, we replace with the enhanced version.\n replaceMiddlewareWith(\n middleware as ConnectServer,\n securityHeadersMiddleware,\n createCorsMiddleware(exp)\n );\n\n prependMiddleware(middleware, suppressRemoteDebuggingErrorMiddleware);\n\n // TODO: We can probably drop this now.\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 middleware.use(createDebuggerTelemetryMiddleware(projectRoot, exp));\n\n // Initialize all React Native debug features\n const { debugMiddleware, ...options } = createDebugMiddleware(metroBundler);\n debugWebsocketEndpoints = options.debugWebsocketEndpoints;\n prependMiddleware(middleware, debugMiddleware);\n middleware.use('/_expo/debugger', createJsInspectorMiddleware());\n }\n\n // Attach Expo Atlas if enabled\n const atlas = 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, metro } = await runServer(\n metroBundler,\n metroConfig,\n {\n // @ts-expect-error: Inconsistent `websocketEndpoints` type between metro and @react-native-community/cli-server-api\n websocketEndpoints: {\n ...websocketEndpoints,\n ...debugWebsocketEndpoints,\n },\n watch: !isExporting && isWatchEnabled(),\n },\n {\n mockServer: isExporting,\n }\n );\n\n // If Atlas is enabled, and can register to Metro, attach it to listen for changes\n atlas?.registerMetro(metro);\n\n prependMiddleware(middleware, (req: ServerRequest, res: ServerResponse, next: ServerNext) => {\n // If the URL is a Metro asset request, then we need to skip all other middleware to prevent\n // the community CLI's serve-static from hosting `/assets/index.html` in place of all assets if it exists.\n // /assets/?unstable_path=.\n if (req.url) {\n const url = new URL(req.url!, 'http://localhost:8000');\n if (url.pathname.match(/^\\/assets\\/?/) && url.searchParams.get('unstable_path') != null) {\n return metro.processRequest(req, res, next);\n }\n }\n return next();\n });\n\n setEventReporter(eventsSocketEndpoint.reportEvent);\n\n return {\n metro,\n server,\n middleware,\n messageSocket: messageSocketEndpoint,\n };\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","gteSdkVersion","exp","sdkVersion","semver","gte","Error","LogRespectingTerminal","Terminal","constructor","stream","sendLog","args","_logLines","push","util","format","_scheduleUpdate","flush","console","log","info","terminal","process","stdout","projectRoot","options","isExporting","getMetroBundler","reportEvent","serverRoot","getMetroServerRoot","terminalReporter","MetroTerminalReporter","hasConfig","resolveConfig","config","loadConfig","cwd","isEmpty","getDefaultConfig","undefined","reporter","update","event","transformer","publicPath","experiments","baseUrl","platformBundlers","getPlatformBundlers","reactCompiler","Log","warn","withMetroMultiPlatformAsync","isTsconfigPathsEnabled","tsconfigPaths","webOutput","web","output","isFastResolverEnabled","env","EXPO_USE_FAST_RESOLVER","isReactCanaryEnabled","reactCanary","NODE_ENV","logEventAsync","getMetroProperties","setEventReporter","logger","metroBundler","getConfig","skipSDKVersionRequirement","metroConfig","metro","getBundler","createDevServerMiddleware","securityHeadersMiddleware","require","middleware","messageSocketEndpoint","eventsSocketEndpoint","websocketEndpoints","port","server","watchFolders","debugWebsocketEndpoints","replaceMiddlewareWith","createCorsMiddleware","prependMiddleware","suppressRemoteDebuggingErrorMiddleware","customEnhanceMiddleware","enhanceMiddleware","metroMiddleware","use","createDebuggerTelemetryMiddleware","debugMiddleware","createDebugMiddleware","createJsInspectorMiddleware","atlas","attachAtlasAsync","resetAtlasFile","runServer","watch","mockServer","registerMetro","req","res","next","url","URL","pathname","match","searchParams","get","processRequest","messageSocket","CI","chalk"],"mappings":"AAAA;;;;;;;;;;;IA+EsBA,oBAAoB,MAApBA,oBAAoB;IAmFpBC,qBAAqB,MAArBA,qBAAqB;IAgI3BC,cAAc,MAAdA,cAAc;;;yBAlSQ,cAAc;;;;;;;yBACN,oBAAoB;;;;;;;8DAChD,OAAO;;;;;;;yBAK0B,cAAc;;;;;;;yBACxC,YAAY;;;;;;;8DACpB,WAAW;;;;;;;8DACT,QAAQ;;;;;;;yBACP,KAAK;;;;;;uCAGa,yBAAyB;6BAC9B,yBAAyB;uCACpB,mCAAmC;+BAC/C,kBAAkB;wCACA,0BAA0B;qBAClD,cAAc;oCACC,6CAA6C;yCAC9B,kDAAkD;qBAChF,oBAAoB;2BACV,0BAA0B;gCACnB,8BAA8B;oCAChC,kCAAkC;6CACzB,qDAAqD;2BACxC,yBAAyB;yCAE3B,uCAAuC;kCAC1D,qBA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BAAgB,IAAIH,GAAG,CAACI,YAAY,CAACC,GAAG,CAAC,eAAe,CAAC,IAAI,IAAI,EAAE;gBACvF,OAAOxC,KAAK,CAACyC,cAAc,CAACT,GAAG,EAAEC,GAAG,EAAEC,IAAI,CAAC,CAAC;YAC9C,CAAC;QACH,CAAC;QACD,OAAOA,IAAI,EAAE,CAAC;IAChB,CAAC,CAAC,CAAC;IAEHxC,gBAAgB,CAACa,oBAAoB,CAACpD,WAAW,CAAC,CAAC;IAEnD,OAAO;QACL6C,KAAK;QACLU,MAAM;QACNL,UAAU;QACVqC,aAAa,EAAEpC,qBAAqB;KACrC,CAAC;AACJ,CAAC;AAMM,SAAShF,cAAc,GAAG;IAC/B,IAAI6D,IAAG,IAAA,CAACwD,EAAE,EAAE;QACVjE,IAAG,IAAA,CAAChC,GAAG,CACLkG,IAAAA,MAAK,EAAA,QAAA,CAAA,CAAC,8FAA8F,CAAC,CACtG,CAAC;IACJ,CAAC;IAED,OAAO,CAACzD,IAAG,IAAA,CAACwD,EAAE,CAAC;AACjB,CAAC"}
|
|
1
|
+
{"version":3,"sources":["../../../../../src/start/server/metro/instantiateMetro.ts"],"sourcesContent":["import { ExpoConfig, getConfig } from '@expo/config';\nimport { getDefaultConfig, LoadOptions } from '@expo/metro-config';\nimport chalk from 'chalk';\nimport { Server as ConnectServer } from 'connect';\nimport http from 'http';\nimport type Metro from 'metro';\nimport Bundler from 'metro/src/Bundler';\nimport { loadConfig, resolveConfig, ConfigT } from 'metro-config';\nimport { Terminal } from 'metro-core';\nimport util from 'node:util';\nimport semver from 'semver';\nimport { URL } from 'url';\n\nimport { createDevToolsPluginWebsocketEndpoint } from './DevToolsPluginWebsocketEndpoint';\nimport { MetroBundlerDevServer } from './MetroBundlerDevServer';\nimport { MetroTerminalReporter } from './MetroTerminalReporter';\nimport { attachAtlasAsync } from './debugging/attachAtlas';\nimport { createDebugMiddleware } from './debugging/createDebugMiddleware';\nimport { runServer } from './runServer-fork';\nimport { withMetroMultiPlatformAsync } from './withMetroMultiPlatform';\nimport { Log } from '../../../log';\nimport { getMetroProperties } from '../../../utils/analytics/getMetroProperties';\nimport { createDebuggerTelemetryMiddleware } from '../../../utils/analytics/metroDebuggerMiddleware';\nimport { env } from '../../../utils/env';\nimport { logEventAsync } from '../../../utils/telemetry';\nimport { createCorsMiddleware } from '../middleware/CorsMiddleware';\nimport { getMetroServerRoot } from '../middleware/ManifestMiddleware';\nimport { createJsInspectorMiddleware } from '../middleware/inspector/createJsInspectorMiddleware';\nimport { prependMiddleware, replaceMiddlewareWith } from '../middleware/mutations';\nimport { ServerNext, ServerRequest, ServerResponse } from '../middleware/server.types';\nimport { suppressRemoteDebuggingErrorMiddleware } from '../middleware/suppressErrorMiddleware';\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\nfunction gteSdkVersion(exp: Pick<ExpoConfig, 'sdkVersion'>, sdkVersion: string): boolean {\n if (!exp.sdkVersion) {\n return false;\n }\n\n if (exp.sdkVersion === 'UNVERSIONED') {\n return true;\n }\n\n try {\n return semver.gte(exp.sdkVersion, sdkVersion);\n } catch {\n throw new Error(`${exp.sdkVersion} is not a valid version. Must be in the form of x.y.z`);\n }\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 // @ts-expect-error\n this._logLines.push(\n // format args like console.log\n util.format(...args)\n );\n // @ts-expect-error\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 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 if (\n // Requires SDK 50 for expo-assets hashAssetPlugin change.\n !exp.sdkVersion ||\n gteSdkVersion(exp, '50.0.0')\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 } else {\n if (isExporting && exp.experiments?.baseUrl) {\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 = exp.experiments?.baseUrl;\n }\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 config = await withMetroMultiPlatformAsync(projectRoot, {\n config,\n exp,\n platformBundlers,\n isTsconfigPathsEnabled: exp.experiments?.tsconfigPaths ?? true,\n webOutput: exp.web?.output ?? 'single',\n isFastResolverEnabled: env.EXPO_USE_FAST_RESOLVER,\n isExporting,\n isReactCanaryEnabled: exp.experiments?.reactCanary ?? false,\n getMetroBundler,\n });\n\n if (process.env.NODE_ENV !== 'test') {\n logEventAsync('metro config', getMetroProperties(projectRoot, exp, config));\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 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 const { createDevServerMiddleware, securityHeadersMiddleware } =\n require('@react-native-community/cli-server-api') as typeof import('@react-native-community/cli-server-api');\n\n const { middleware, messageSocketEndpoint, eventsSocketEndpoint, websocketEndpoints } =\n createDevServerMiddleware({\n port: metroConfig.server.port,\n watchFolders: metroConfig.watchFolders,\n });\n\n let debugWebsocketEndpoints: {\n [path: string]: import('ws').WebSocketServer;\n } = {};\n\n if (!isExporting) {\n // The `securityHeadersMiddleware` does not support cross-origin requests, we replace with the enhanced version.\n replaceMiddlewareWith(\n middleware as ConnectServer,\n securityHeadersMiddleware,\n createCorsMiddleware(exp)\n );\n\n prependMiddleware(middleware, suppressRemoteDebuggingErrorMiddleware);\n\n // TODO: We can probably drop this now.\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 middleware.use(createDebuggerTelemetryMiddleware(projectRoot, exp));\n\n // Initialize all React Native debug features\n const { debugMiddleware, ...options } = createDebugMiddleware(metroBundler);\n debugWebsocketEndpoints = options.debugWebsocketEndpoints;\n prependMiddleware(middleware, debugMiddleware);\n middleware.use('/_expo/debugger', createJsInspectorMiddleware());\n }\n\n // Attach Expo Atlas if enabled\n const atlas = 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, metro } = await runServer(\n metroBundler,\n metroConfig,\n {\n // @ts-expect-error: Inconsistent `websocketEndpoints` type between metro and @react-native-community/cli-server-api\n websocketEndpoints: {\n ...websocketEndpoints,\n ...debugWebsocketEndpoints,\n ...createDevToolsPluginWebsocketEndpoint(),\n },\n watch: !isExporting && isWatchEnabled(),\n },\n {\n mockServer: isExporting,\n }\n );\n\n // If Atlas is enabled, and can register to Metro, attach it to listen for changes\n atlas?.registerMetro(metro);\n\n prependMiddleware(middleware, (req: ServerRequest, res: ServerResponse, next: ServerNext) => {\n // If the URL is a Metro asset request, then we need to skip all other middleware to prevent\n // the community CLI's serve-static from hosting `/assets/index.html` in place of all assets if it exists.\n // /assets/?unstable_path=.\n if (req.url) {\n const url = new URL(req.url!, 'http://localhost:8000');\n if (url.pathname.match(/^\\/assets\\/?/) && url.searchParams.get('unstable_path') != null) {\n return metro.processRequest(req, res, next);\n }\n }\n return next();\n });\n\n setEventReporter(eventsSocketEndpoint.reportEvent);\n\n return {\n metro,\n server,\n middleware,\n messageSocket: messageSocketEndpoint,\n };\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","gteSdkVersion","exp","sdkVersion","semver","gte","Error","LogRespectingTerminal","Terminal","constructor","stream","sendLog","args","_logLines","push","util","format","_scheduleUpdate","flush","console","log","info","terminal","process","stdout","projectRoot","options","isExporting","getMetroBundler","reportEvent","serverRoot","getMetroServerRoot","terminalReporter","MetroTerminalReporter","hasConfig","resolveConfig","config","loadConfig","cwd","isEmpty","getDefaultConfig","undefined","reporter","update","event","transformer","publicPath","experiments","baseUrl","platformBundlers","getPlatformBundlers","reactCompiler","Log","warn","withMetroMultiPlatformAsync","isTsconfigPathsEnabled","tsconfigPaths","webOutput","web","output","isFastResolverEnabled","env","EXPO_USE_FAST_RESOLVER","isReactCanaryEnabled","reactCanary","NODE_ENV","logEventAsync","getMetroProperties","setEventReporter","logger","metroBundler","getConfig","skipSDKVersionRequirement","metroConfig","metro","getBundler","createDevServerMiddleware","securityHeadersMiddleware","require","middleware","messageSocketEndpoint","eventsSocketEndpoint","websocketEndpoints","port","server","watchFolders","debugWebsocketEndpoints","replaceMiddlewareWith","createCorsMiddleware","prependMiddleware","suppressRemoteDebuggingErrorMiddleware","customEnhanceMiddleware","enhanceMiddleware","metroMiddleware","use","createDebuggerTelemetryMiddleware","debugMiddleware","createDebugMiddleware","createJsInspectorMiddleware","atlas","attachAtlasAsync","resetAtlasFile","runServer","createDevToolsPluginWebsocketEndpoint","watch","mockServer","registerMetro","req","res","next","url","URL","pathname","match","searchParams","get","processRequest","messageSocket","CI","chalk"],"mappings":"AAAA;;;;;;;;;;;IAgFsBA,oBAAoB,MAApBA,oBAAoB;IAmFpBC,qBAAqB,MAArBA,qBAAqB;IAiI3BC,cAAc,MAAdA,cAAc;;;yBApSQ,cAAc;;;;;;;yBACN,oBAAoB;;;;;;;8DAChD,OAAO;;;;;;;yBAK0B,cAAc;;;;;;;yBACxC,YAAY;;;;;;;8DACpB,WAAW;;;;;;;8DACT,QAAQ;;;;;;;yBACP,KAAK;;;;;;iDAE6B,mCAAmC;uCAEnD,yBAAyB;6BAC9B,yBAAyB;uCACpB,mCAAmC;+BAC/C,kBAAkB;wCACA,0BAA0B;qBAClD,cAAc;oCACC,6CAA6C;yCAC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ACG,GAAG,EAAE;YACX,MAAMA,GAAG,GAAG,IAAIC,CAAAA,IAAG,EAAA,CAAA,IAAA,CAACJ,GAAG,CAACG,GAAG,EAAG,uBAAuB,CAAC,AAAC;YACvD,IAAIA,GAAG,CAACE,QAAQ,CAACC,KAAK,gBAAgB,IAAIH,GAAG,CAACI,YAAY,CAACC,GAAG,CAAC,eAAe,CAAC,IAAI,IAAI,EAAE;gBACvF,OAAOzC,KAAK,CAAC0C,cAAc,CAACT,GAAG,EAAEC,GAAG,EAAEC,IAAI,CAAC,CAAC;YAC9C,CAAC;QACH,CAAC;QACD,OAAOA,IAAI,EAAE,CAAC;IAChB,CAAC,CAAC,CAAC;IAEHzC,gBAAgB,CAACa,oBAAoB,CAACpD,WAAW,CAAC,CAAC;IAEnD,OAAO;QACL6C,KAAK;QACLU,MAAM;QACNL,UAAU;QACVsC,aAAa,EAAErC,qBAAqB;KACrC,CAAC;AACJ,CAAC;AAMM,SAAShF,cAAc,GAAG;IAC/B,IAAI6D,IAAG,IAAA,CAACyD,EAAE,EAAE;QACVlE,IAAG,IAAA,CAAChC,GAAG,CACLmG,IAAAA,MAAK,EAAA,QAAA,CAAA,CAAC,8FAA8F,CAAC,CACtG,CAAC;IACJ,CAAC;IAED,OAAO,CAAC1D,IAAG,IAAA,CAACyD,EAAE,CAAC;AACjB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expo/cli",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.30",
|
|
4
4
|
"description": "The Expo CLI",
|
|
5
5
|
"main": "build/bin/cli",
|
|
6
6
|
"bin": {
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"@expo/osascript": "^2.0.31",
|
|
51
51
|
"@expo/package-manager": "^1.5.0",
|
|
52
52
|
"@expo/plist": "^0.1.0",
|
|
53
|
-
"@expo/prebuild-config": "7.0.
|
|
53
|
+
"@expo/prebuild-config": "7.0.9",
|
|
54
54
|
"@expo/rudder-sdk-node": "1.1.1",
|
|
55
55
|
"@expo/spawn-async": "^1.7.2",
|
|
56
56
|
"@expo/xcpretty": "^4.3.0",
|
|
@@ -173,5 +173,5 @@
|
|
|
173
173
|
"tree-kill": "^1.2.2",
|
|
174
174
|
"tsd": "^0.28.1"
|
|
175
175
|
},
|
|
176
|
-
"gitHead": "
|
|
176
|
+
"gitHead": "babb6c584ab401bf9b75574aebd4ead1a423ec81"
|
|
177
177
|
}
|