Open WillieCubed opened 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.
There's several options when it comes to implementing this, and they all have some trade-offs.
It would add a command named "Deploy current project to Firebase Hosting", which would be triggered from the command palette. Some issues:
.firebaserc
and firebase.json
files. The easiest option here is to simply show an error saying to initialize it using the CLI. Another option would be to replicate the whole firebase init
functionality (the extension doesn't depend on firebase-tools
), but I'd rather not.When right-clicking on a folder in the open workspace, it would show an entry saying "Deploy this folder to Firebase Hosting". Some issues:
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.
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?