Skip to content

Commit 2b18e0b

Browse files
authored
Revert emulators changes (#6030)
1 parent 380390f commit 2b18e0b

File tree

4 files changed

+1
-88
lines changed

4 files changed

+1
-88
lines changed

firebase-vscode/src/cli.ts

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,13 @@ import { requireAuth } from "../../src/requireAuth";
1414
import { deploy } from "../../src/deploy";
1515
import { getDefaultHostingSite } from "../../src/getDefaultHostingSite";
1616
import { initAction } from "../../src/commands/init";
17-
import { startAll as startAllEmulators, cleanShutdown as stopAllEmulators } from "../../src/emulator/controller";
18-
import { EmulatorRegistry } from "../../src/emulator/registry";
19-
import { EmulatorInfo, Emulators } from "../../src/emulator/types";
2017
import { Account, User } from "../../src/types/auth";
2118
import { Options } from "../../src/options";
2219
import { currentOptions, getCommandOptions } from "./options";
2320
import { setInquirerOptions } from "./stubs/inquirer-stub";
2421
import { ServiceAccount } from "../common/types";
2522
import { listChannels } from "../../src/hosting/api";
26-
import * as commandUtils from "../../src/emulator/commandUtils";
27-
import { EmulatorUiSelections, ChannelWithId } from "../common/messaging/types";
23+
import { ChannelWithId } from "../common/messaging/types";
2824
import { pluginLogger } from "./logger-wrapper";
2925
import { Config } from "../../src/config";
3026

@@ -170,33 +166,6 @@ export async function initHosting(
170166
setInquirerOptions(inquirerOptions);
171167
await initAction("hosting", commandOptions);
172168
}
173-
174-
export async function emulatorsStart(emulatorUiSelections: EmulatorUiSelections) {
175-
const commandOptions = await getCommandOptions(undefined, {
176-
...currentOptions,
177-
project: emulatorUiSelections.projectId,
178-
exportOnExit: emulatorUiSelections.exportStateOnExit,
179-
import: emulatorUiSelections.importStateFolderPath,
180-
only: emulatorUiSelections.mode === "hosting" ? "hosting" : ""
181-
});
182-
// Adjusts some options, export on exit can be a boolean or a path.
183-
commandUtils.setExportOnExitOptions(commandOptions as commandUtils.ExportOnExitOptions);
184-
return startAllEmulators(commandOptions, /*showUi=*/ true);
185-
}
186-
187-
export async function stopEmulators() {
188-
await stopAllEmulators();
189-
}
190-
191-
export function listRunningEmulators(): EmulatorInfo[] {
192-
return EmulatorRegistry.listRunningWithInfo();
193-
}
194-
195-
export function getEmulatorUiUrl(): string | undefined {
196-
const url: URL = EmulatorRegistry.url(Emulators.UI);
197-
return url.hostname === "unknown" ? undefined : url.toString();
198-
}
199-
200169
export async function deployToHosting(
201170
firebaseJSON: Config,
202171
deployTarget: string

firebase-vscode/src/extension.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import {
1111
import { setupSidebar } from "./sidebar";
1212
import { setupWorkflow } from "./workflow";
1313
import { pluginLogger } from "./logger-wrapper";
14-
import { onShutdown } from "./workflow";
1514

1615
const broker = createBroker<
1716
ExtensionToWebviewParamsMap,
@@ -26,9 +25,3 @@ export function activate(context: vscode.ExtensionContext) {
2625
setupWorkflow(context, broker);
2726
setupSidebar(context, broker);
2827
}
29-
30-
// This method is called when the extension is deactivated
31-
export async function deactivate() {
32-
// This await is optimistic but it might wait for a moment longer while we run cleanup activities
33-
await onShutdown();
34-
}

firebase-vscode/src/workflow.ts

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,12 @@ import { FirebaseProjectMetadata } from "../../src/types/project";
99
import { ExtensionBrokerImpl } from "./extension-broker";
1010
import {
1111
deployToHosting,
12-
emulatorsStart,
1312
getAccounts,
1413
getChannels,
15-
getEmulatorUiUrl,
1614
initHosting,
1715
listProjects,
18-
listRunningEmulators,
1916
login,
2017
logoutUser,
21-
stopEmulators,
2218
} from "./cli";
2319
import { User } from "../../src/types/auth";
2420
import { currentOptions } from "./options";
@@ -364,47 +360,4 @@ export async function setupWorkflow(
364360
{ projectId, folderPath: currentOptions.cwd });
365361
await fetchChannels(true);
366362
}
367-
broker.on(
368-
"launchEmulators",
369-
async ({ emulatorUiSelections }) => {
370-
await emulatorsStart(emulatorUiSelections);
371-
broker.send("notifyRunningEmulatorInfo", { uiUrl: getEmulatorUiUrl(), displayInfo: listRunningEmulators() });
372-
}
373-
);
374-
375-
broker.on(
376-
"stopEmulators",
377-
async () => {
378-
await stopEmulators();
379-
// Update the UI
380-
broker.send("notifyEmulatorsStopped");
381-
}
382-
);
383-
384-
broker.on(
385-
"selectEmulatorImportFolder",
386-
async () => {
387-
const options: vscode.OpenDialogOptions = {
388-
canSelectMany: false,
389-
openLabel: `Pick an import folder`,
390-
title: `Pick an import folder`,
391-
canSelectFiles: false,
392-
canSelectFolders: true,
393-
};
394-
const fileUri = await vscode.window.showOpenDialog(options);
395-
// Update the UI of the selection
396-
if (!fileUri || fileUri.length < 1) {
397-
vscode.window.showErrorMessage("Invalid import folder selected.");
398-
return;
399-
}
400-
broker.send("notifyEmulatorImportFolder", { folder: fileUri[0].fsPath });
401-
}
402-
);
403-
}
404-
405-
/**
406-
* Cleans up any open resources before shutting down.
407-
*/
408-
export async function onShutdown() {
409-
await stopEmulators();
410363
}

firebase-vscode/webviews/SidebarApp.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import { ServiceAccountUser } from "../common/types";
99
import { DeployPanel } from "./components/DeployPanel";
1010
import { HostingState } from "./webview-types";
1111
import { ChannelWithId } from "./messaging/types";
12-
import { EmulatorPanel } from "./components/EmulatorPanel";
1312

1413
import { webLogger } from "./globals/web-logger";
1514
import { InitFirebasePanel } from "./components/InitPanel";
@@ -146,7 +145,6 @@ export function SidebarApp() {
146145
}}
147146
/>
148147
)}
149-
{(!!userEmail && !!firebaseJson) && <EmulatorPanel firebaseJson={firebaseJson} projectId={projectId} />}
150148
</>
151149
);
152150
}

0 commit comments

Comments
 (0)