npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

fcf-deployer

v1.0.1

Published

A GUI to help you deploy your Firebase Cloud Functions when working locally

Downloads

46

Readme

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.

| Property | Description | Required | Default Value | | ------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ | ---------------- | | functionsEntrypoint | The file that containst the exports for all your cloud functions. See below what you need to do for functions written in Typescript | No (Yes in case of TypeScript) | ./functions.js | | firebasercFile | The path to ./firebaserc file if any | No | ../.firebaserc | | prerunScript | Script to run before the GUI is started | No | '' | | port | The localhost port on which to run the GUI | No | 10444 |

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.