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

@simondotm/nx-firebase

v2.3.0

Published

A Firebase plugin for Nx monorepo workspaces.

Downloads

21,162

Readme

@simondotm/nx-firebase actions nx npm downloads

A plugin for Nx v16.8.1+ that integrates Firebase workflows in an Nx monorepo workspace.

  • Easily generate Firebase applications and functions
  • Uses esbuild for fast Firebase function builds so you can easily create & import shared Nx libraries with the benefits of tree-shaking
  • Supports function environment variables and secrets
  • Supports single or multiple firebase projects/apps within an Nx workspace
  • Full support for the Firebase Emulator suite for local development, with watch mode for functions
  • Keeps your firebase.json configurations in sync when renaming or deleting Firebase apps & functions
  • Only very lightly opinionated about your Firebase configurations and workspace layouts; you can use Nx or the Firebase CLI

See CHANGELOG for release notes.

Install Plugin

npm install @simondotm/nx-firebase --save-dev

  • Installs this plugin into your Nx workspace
  • This will also install @nx/node and firebase SDK's to your root workspace package.json if they are not already installed

Generate Firebase Application

nx g @simondotm/nx-firebase:app my-new-firebase-app [--directory=dir] [--project=proj]

  • Generates a new Nx Firebase application project in the workspace
  • The app generator will also create a Firebase configuration file in the root of your workspace (along with a default .firebaserc and firebase.json if they don't already exist)
  • For the first firebase application you create, the project firebase configuration will be firebase.json
  • If you create additional firebase applications, the project firebase configuration will be firebase.<app-project-name>.json
  • Use --project to link your Firebase App to a Firebase project name in your .firebaserc file

Generate Firebase Function

nx g @simondotm/nx-firebase:function my-new-firebase-function --app=my-new-firebase-app [--directory=dir]

  • Generates a new Nx Firebase function application project in the workspace
  • Firebase Function projects must be linked to a Firebase application project with the --app option
  • Firebase Function projects can contain one or more firebase functions
  • You can generate as many Firebase Function projects as you need for your application

Build

nx build my-new-firebase-app

  • Compiles & builds all Firebase function applications linked to the Nx Firebase application or an individual function

nx build my-new-firebase-function

  • Compiles & builds an individual function

Serve

nx serve my-new-firebase-app

  • Builds & Watches all Firebase functions apps linked to the Firebase application
  • Starts the Firebase emulators

Deploy

Firebase Application

nx deploy my-new-firebase-app [--only ...]

  • By default, deploys ALL of your cloud resources associated with your Firebase application (eg. sites, functions, database rules etc.)
  • Use the --only option to selectively deploy (same as Firebase CLI)

For initial deployment:

  • firebase login if not already authenticated
  • firebase use --add to add your Firebase Project(s) to the .firebaserc file in your workspace. This step must be completed before you can deploy anything to Firebase.

Note that you can also use the firebase CLI directly if you prefer:

  • firebase deploy --config=firebase.<appname>.json --only functions

Firebase Function

nx deploy my-new-firebase-function

  • Deploys only a specific Firebase function

Test

nx test my-new-firebase-app

  • Runs unit tests for all Firebase functions apps linked to the Firebase application

nx test my-new-firebase-function

  • Runs unit tests for an individual function

Lint

nx lint my-new-firebase-app

  • Runs linter for all Firebase functions apps linked to the Firebase application or an individual function

nx lint my-new-firebase-function

  • Runs linter for an individual function

Sync Workspace

nx g @simondotm/nx-firebase:sync

  • Ensures that your firebase.json configurations are kept up to date with your workspace
    • If you rename or move firebase application or firebase function projects
    • If you delete firebase function projects

Further Information

See the full plugin User Guide for more details.