1.0.1 • Published 8 months ago

fcf-deployer v1.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
8 months ago

Firebase Cloud Functions Deployer

A useful GUI to help you list your Firebase Cloud Functions, their configurations and deploy them when working locally.

Install it to your Cloud Functions directory by:

npm i --save-dev fcf-deployer@latest

Then run it using:

npx open-functions-deployer

And open the URL that is shown in the terminal after running this command.

GUI View

What it can do

  • Deploy Firebase Cloud Functions and view real-time deployment logs in your browser.
  • Change Git branches from the UI to seamlessly run point-in-time Cloud Function deployments.
  • Deploy Cloud Functions for a specific environment/project (Useful for people running multiple Firebase Cloud Functions from a single codebase - For use cases such as staging and production).

Logs View

Possible Configs

The tool supports configuration in two ways:

  • Via the CLI
  • Via a Config File fcf-deployer.config.json that can be created in the functions directory.
PropertyDescriptionRequiredDefault Value
functionsEntrypointThe file that containst the exports for all your cloud functions. See below what you need to do for functions written in TypescriptNo (Yes in case of TypeScript)./functions.js
firebasercFileThe path to ./firebaserc file if anyNo../.firebaserc
prerunScriptScript to run before the GUI is startedNo''
portThe localhost port on which to run the GUINo10444

Via the CLI:

npx open-functions-deployer  -- --functionsEntrypoint=./index.js --firebasercFile=./.firebaserc

Via the Config File:

// fcf-deployer.config.json
{
	"port": 3456,
	"functionsEntryPoint": "./lib/index.js",
	"firebasercFile": "./.firebaserc",
	"prerunScript": "node scripts/prepare-functions"
}

FAQs

I'm using TypeScript, anything I need to do?

This tool automatically compiles your functions at start-time so you don't need to worry about it.

You just have to specify the path of the function's file, in most cases it would be ./lib/index.js.

I need to set some environment variables or run something before I deploy my Cloud Functions. How do I do that?

So in this case you have two options:

  • Use the predeploy config in your firebase.json's functions property.
  • Use the prerunScript property to specify a command that you want to run at the start time, this would ensure what you need before your Firebase Cloud Functions deploy are run.

Issues and Bugs

File An issue

Development Instructions

  • You can run the server with npm run dev:server (Express with Server-Sent events for real-time deployment updates)
  • You can run the client with npm run dev:client (Svelte + Vite)

On production, the client is compiled to static assets and served in the home route by the backend.

When the user runs the npx open-functions-deployer command the compiled server file is loaded, it runs the startup script and establishes an API for the client to work with to get information about context and APIs the browser does not have access to, like whether the user is in a Git Repo, running command line operations and switching Firebase environments.

1.0.1

8 months ago

1.0.0

8 months ago

0.0.95

8 months ago

0.0.94

8 months ago

0.0.93

8 months ago

0.0.92

8 months ago

0.0.9

8 months ago

0.0.8

8 months ago