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 1
1
import { RC } from "../../src/rc" ;
2
2
import { Options } from "../../src/options" ;
3
- import { Command } from "../../src/command" ;
4
3
import { ExtensionContext } from "vscode" ;
5
4
import { setInquirerOptions } from "./stubs/inquirer-stub" ;
6
5
import { Config } from "../../src/config" ;
Original file line number Diff line number Diff line change @@ -97,7 +97,8 @@ export function maybeUsePortForwarding(i: EmulatorInfo): EmulatorInfo {
97
97
}
98
98
const url = `${ info . port } -${ portForwardingHost } ` ;
99
99
info . host = url ;
100
- info . listen = info . listen ?. map ( ( l ) => {
100
+ info . listen = info . listen ?. map ( ( listen ) => {
101
+ const l = { ...listen } ;
101
102
l . address = url ;
102
103
l . port = 443 ;
103
104
return l ;
Original file line number Diff line number Diff line change @@ -13,7 +13,6 @@ import { ExpressBasedEmulator } from "./ExpressBasedEmulator";
13
13
import { PortName } from "./portUtils" ;
14
14
import { DataConnectEmulator } from "./dataconnectEmulator" ;
15
15
import { isVSCodeExtension } from "../vsCodeUtils" ;
16
- import { maybeUsePortForwarding } from "./env" ;
17
16
18
17
// We use the CLI version from package.json
19
18
const pkg = require ( "../../package.json" ) ;
@@ -83,10 +82,10 @@ export class EmulatorHub extends ExpressBasedEmulator {
83
82
getRunningEmulatorsMapping ( ) : GetEmulatorsResponse {
84
83
const emulators : GetEmulatorsResponse = { } ;
85
84
for ( const info of EmulatorRegistry . listRunningWithInfo ( ) ) {
86
- emulators [ info . name ] = maybeUsePortForwarding ( {
85
+ emulators [ info . name ] = {
87
86
listen : this . args . listenForEmulator [ info . name ] ,
88
87
...info ,
89
- } ) ;
88
+ } ;
90
89
}
91
90
return emulators ;
92
91
}
Original file line number Diff line number Diff line change @@ -10,6 +10,8 @@ import { AnalyticsSession, emulatorSession } from "../track";
10
10
import { ExpressBasedEmulator } from "./ExpressBasedEmulator" ;
11
11
import { ALL_EXPERIMENTS , ExperimentName , isEnabled } from "../experiments" ;
12
12
import { EmulatorHub , GetEmulatorsResponse } from "./hub" ;
13
+ import { mapObject } from "../functional" ;
14
+ import { maybeUsePortForwarding } from "./env" ;
13
15
14
16
export interface EmulatorUIOptions {
15
17
listen : ListenSpec [ ] ;
@@ -60,7 +62,10 @@ export class EmulatorUI extends ExpressBasedEmulator {
60
62
app . get (
61
63
"/api/config" ,
62
64
this . jsonHandler ( ( ) => {
63
- const emulatorInfos = ( hub ! as EmulatorHub ) . getRunningEmulatorsMapping ( ) ;
65
+ const emulatorInfos = mapObject (
66
+ ( hub ! as EmulatorHub ) . getRunningEmulatorsMapping ( ) ,
67
+ maybeUsePortForwarding ,
68
+ ) ;
64
69
const json : EmulatorConfigInfo = {
65
70
projectId,
66
71
experiments : enabledExperiments ?? [ ] ,
You can’t perform that action at this time.
0 commit comments