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

@ninetailed/nx-firebase

v0.4.0

Published

A Firebase plugin for Nx monorepo workspaces.

Downloads

4

Readme

@simondotm/nx-firebase

A plugin for Nx >= 12.1.1 that provides support for Firebase projects in an Nx monorepo workspace.

This project has been renamed from @simondotm/nxfirebase to @simondotm/nx-firebase

See CHANGELOG for more details.

Overview

Nx provides a great way to manage monorepo workflows, however if you have a development setup where your Nx workspace uses one or more Firebase projects that use different combinations and configurations of Firebase features such as hosting, storage, database rules/indexes, and functions, then some extra tooling is necessary in order to maintain a familiar Firebase workflow within your monorepo.

This plugin aims to help with this by:

  1. Enabling & promoting use of shared Typescript code libraries within Firebase functions
  2. Retaining a familiar usage of all Firebase features in a way that feels integrated with Nx workflow
  3. Requiring minimal friction/setup for configuration of an Nx workspace in order to be productive with development, building & deployment of Firebase projects

Quick Start

Installation

npm install @simondotm/nx-firebase

Installs this plugin into your Nx workspace.

nx g @simondotm/nx-firebase:init

Installs firebase dependencies (both for backend and frontend) to your root workspace package.json (or you can just npm install firebase dependencies manually)

Create Firebase Application

nx g @simondotm/nx-firebase:app <appname> [--directory dir]

Generates a new Nx Firebase application in the workspace - /apps/[dir]/appname

The app generator will also create a Firebase configuration file called firebase.appname.json in the root of your workspace (along with a default .firebaserc and firebase.json if they don't already exist)

Build Project

nx build appname [--with-deps]

Compiles & builds the target Nx Firebase (functions) application to dist/apps/[dir]/appname. It will also auto-generate a package.json that is compatible with the Firebase CLI for functions deployment.

Deploy Project (Firebase functions)

For inital 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.

Then:

firebase deploy --only functions --config firebase.appname.json

Or

nx deploy appname --only functions

Serve Project

nx serve appname - will run tsc in watch mode on the app function code and start the Firebase emulators

See the full plugin README for more details.

Nx-Firebase Features

Supports:

  • Typescript Firebase functions
  • Single or multiple Firebase projects in one Nx workspace
  • Firebase applications in app subdirectories
  • Use of Nx buildable node libraries in Firebase functions
  • Nx dependency checking for builds
  • Building functions with tsc --watch mode
  • Firebase Emulators
  • Convenience Nx getconfig target to fetch remote firebase functions configuration variables to local .runtimeconfig.json file
  • Convenience Nx deploy, emulate, and serve targets for functions

Additionally:

  • Auto generates Firebase functions package.json ready for no fuss deployment using the Firebase CLI
  • Auto generates default firebase.json configurations, rules and indexes for each Firebase app
  • Only very lightly opinionated about your Firebase configurations and workspace layouts; you can just use the Firebase CLI as usual
  • Keeps all of your firebase rules and indexes within your app folder, to keep your workspace root free of clutter