jsayol / vscode-firebase-explorer

Visual Studio Code extension to explore and manage your Firebase projects
https://devlibrary.withgoogle.com/products/firebase/repos/jsayol-vscode-firebase-explorer
MIT License
148 stars 22 forks source link

Deploying a site to Firebase Hosting using the IDE #2

Open WillieCubed opened 5 years ago

WillieCubed commented 5 years ago

I think this extension has great promise, so I propose an addition to the current Firebase Hosting functionality: a button that allows for easy deployment of an open folder to Firebase Hosting. The new functionality would: 1) Check if the user is signed in and launch a sign-in flow if it isn't 2) Check if the currently opened folder has been initialized with Firebase Hosting 3) Use the Firebase Hosting REST API to upload the files 4) Show the result with a link to the deployed site when finished (or error)

What do you think, @jsayol? Is this outside the scope of the project, or is it a worthwhile feature?

jsayol commented 5 years ago

Thanks @TheCraftKid, that's a great idea :)

This is something I've wanted to add to the extension and I thought about it a few days ago, but I couldn't come up with a good way to integrate it.

Options

There's several options when it comes to implementing this, and they all have some trade-offs.

As a global command

It would add a command named "Deploy current project to Firebase Hosting", which would be triggered from the command palette. Some issues:

As a right-click context menu on a folder

When right-clicking on a folder in the open workspace, it would show an entry saying "Deploy this folder to Firebase Hosting". Some issues:

As a right-click context menu anywhere on the list of files

Similar to the previous one, but it would only work if the root of the workspace folder is an initialized Firebase project (it has .firebaserc and firebase.json files). It would deploy the public folder specified in firebase.json to the default project specified in .firebaserc. It would basically do the same as running firebase deploy --only hosting from that folder.

Other considerations