File tree Expand file tree Collapse file tree 4 files changed +10
-6
lines changed Expand file tree Collapse file tree 4 files changed +10
-6
lines changed Original file line number Diff line number Diff line change 11import { RC } from "../../src/rc" ;
22import { Options } from "../../src/options" ;
3- import { Command } from "../../src/command" ;
43import { ExtensionContext } from "vscode" ;
54import { setInquirerOptions } from "./stubs/inquirer-stub" ;
65import { Config } from "../../src/config" ;
Original file line number Diff line number Diff line change @@ -97,7 +97,8 @@ export function maybeUsePortForwarding(i: EmulatorInfo): EmulatorInfo {
9797 }
9898 const url = `${ info . port } -${ portForwardingHost } ` ;
9999 info . host = url ;
100- info . listen = info . listen ?. map ( ( l ) => {
100+ info . listen = info . listen ?. map ( ( listen ) => {
101+ const l = { ...listen } ;
101102 l . address = url ;
102103 l . port = 443 ;
103104 return l ;
Original file line number Diff line number Diff line change @@ -13,7 +13,6 @@ import { ExpressBasedEmulator } from "./ExpressBasedEmulator";
1313import { PortName } from "./portUtils" ;
1414import { DataConnectEmulator } from "./dataconnectEmulator" ;
1515import { isVSCodeExtension } from "../vsCodeUtils" ;
16- import { maybeUsePortForwarding } from "./env" ;
1716
1817// We use the CLI version from package.json
1918const pkg = require ( "../../package.json" ) ;
@@ -83,10 +82,10 @@ export class EmulatorHub extends ExpressBasedEmulator {
8382 getRunningEmulatorsMapping ( ) : GetEmulatorsResponse {
8483 const emulators : GetEmulatorsResponse = { } ;
8584 for ( const info of EmulatorRegistry . listRunningWithInfo ( ) ) {
86- emulators [ info . name ] = maybeUsePortForwarding ( {
85+ emulators [ info . name ] = {
8786 listen : this . args . listenForEmulator [ info . name ] ,
8887 ...info ,
89- } ) ;
88+ } ;
9089 }
9190 return emulators ;
9291 }
Original file line number Diff line number Diff line change @@ -10,6 +10,8 @@ import { AnalyticsSession, emulatorSession } from "../track";
1010import { ExpressBasedEmulator } from "./ExpressBasedEmulator" ;
1111import { ALL_EXPERIMENTS , ExperimentName , isEnabled } from "../experiments" ;
1212import { EmulatorHub , GetEmulatorsResponse } from "./hub" ;
13+ import { mapObject } from "../functional" ;
14+ import { maybeUsePortForwarding } from "./env" ;
1315
1416export interface EmulatorUIOptions {
1517 listen : ListenSpec [ ] ;
@@ -60,7 +62,10 @@ export class EmulatorUI extends ExpressBasedEmulator {
6062 app . get (
6163 "/api/config" ,
6264 this . jsonHandler ( ( ) => {
63- const emulatorInfos = ( hub ! as EmulatorHub ) . getRunningEmulatorsMapping ( ) ;
65+ const emulatorInfos = mapObject (
66+ ( hub ! as EmulatorHub ) . getRunningEmulatorsMapping ( ) ,
67+ maybeUsePortForwarding ,
68+ ) ;
6469 const json : EmulatorConfigInfo = {
6570 projectId,
6671 experiments : enabledExperiments ?? [ ] ,
You can’t perform that action at this time.
0 commit comments