-
Notifications
You must be signed in to change notification settings - Fork 941
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vscode emulators #6256
Merged
Merged
Vscode emulators #6256
Changes from 7 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
7b791ff
Development branch for emulator features in the VSCode extension.
christhompsongoogle abb82e9
Merge branch 'master' into vscode-emulators
christhompsongoogle 4562cbd
Webpack angry
christhompsongoogle 0d3b37e
ok
christhompsongoogle 5697247
WEBPACK ARE YOU HAPPY?
christhompsongoogle 428a996
Remove copy
christhompsongoogle 6ddd8fd
TODOs
christhompsongoogle 35fc3c4
Merge branch 'master' into vscode-emulators
christhompsongoogle 8028ec6
Merge marker fix
christhompsongoogle File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,10 @@ import { | |
listProjects, | ||
login, | ||
logoutUser, | ||
stopEmulators, | ||
listRunningEmulators, | ||
getEmulatorUiUrl, | ||
emulatorsStart | ||
} from "./cli"; | ||
import { User } from "../../src/types/auth"; | ||
import { currentOptions } from "./options"; | ||
|
@@ -230,6 +234,43 @@ export async function setupWorkflow( | |
broker.send("notifyPreviewChannelResponse", { id: response }); | ||
}); | ||
|
||
broker.on( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do we want all the emulator registration in workflow (what does workflow mean)? I think the amount of code warrants an emulator.ts file. |
||
"launchEmulators", | ||
async ({ emulatorUiSelections }) => { | ||
await emulatorsStart(emulatorUiSelections); | ||
broker.send("notifyRunningEmulatorInfo", { uiUrl: getEmulatorUiUrl(), displayInfo: listRunningEmulators() }); | ||
} | ||
); | ||
|
||
broker.on( | ||
"stopEmulators", | ||
async () => { | ||
await stopEmulators(); | ||
// Update the UI | ||
broker.send("notifyEmulatorsStopped"); | ||
} | ||
); | ||
|
||
broker.on( | ||
"selectEmulatorImportFolder", | ||
async () => { | ||
const options: vscode.OpenDialogOptions = { | ||
canSelectMany: false, | ||
openLabel: `Pick an import folder`, | ||
title: `Pick an import folder`, | ||
canSelectFiles: false, | ||
canSelectFolders: true, | ||
}; | ||
const fileUri = await vscode.window.showOpenDialog(options); | ||
// Update the UI of the selection | ||
if (!fileUri || fileUri.length < 1) { | ||
vscode.window.showErrorMessage("Invalid import folder selected."); | ||
return; | ||
} | ||
broker.send("notifyEmulatorImportFolder", { folder: fileUri[0].fsPath }); | ||
} | ||
); | ||
|
||
context.subscriptions.push( | ||
setupFirebaseJsonAndRcFileSystemWatcher(broker, context) | ||
); | ||
|
@@ -346,3 +387,10 @@ export async function setupWorkflow( | |
} | ||
} | ||
} | ||
|
||
/** | ||
* Cleans up any open resources before shutting down. | ||
*/ | ||
export async function onShutdown() { | ||
await stopEmulators(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we make an enum for modes? eventually we'll add firemat :)