Socket
Book a DemoInstallSign in
Socket

firebase-yarn-workspaces

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

firebase-yarn-workspaces

Copies and links local yarn workspaces into Firebase projects for deployment

latest
Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

firebase-yarn-workspaces

Yarn workspaces + Firebase deployments made easy.

Problem

Firebase functions does not support deployment of dependencies from a monorepo structure. To use dependencies which are not published to a registry, dependency code must be copied into the functions directory & referenced accordingly, prior to running firebase deploy --functions.

Solution

npx firebase-yarn-workspaces --scope <FIREBASE_FUNCTIONS_WORKSPACE_NAME>

This command, run at the root of your monorepo:

  • Automatically builds a yarn dependency graph of workspaces used in your firebase functions package.json
  • Copies all necessary package code into a .firebase-yarn-workspaces tmp folder inside your firebase functions workspace
  • Modifies package.json in firebase functions workspace and in all nested dependencies to point to file: references

NOTE: Rollback of package.json changes is still TODO. Recommended use is currently only in an ephemeral environment, such as CI or in a pruned Turborepo 'out' folder (see examples)

Options

FlagAliasDefaultRequired?Description
--scope-s-Firebase functions workspace name.
Example:
--scope firebase-fns
--dir-dprocess.cwd()Path to workspace root
Example:
--dir ./out
--tmpDir-t.firebase-yarn-workspacesCustom tmp directory folder where dependency packages will be placed
Example:
--tmpDir custom-tmp-folder

Examples

  • Local pruned Turborepo (Link coming soon)
  • Vanilla CI via GitHub Actions (Link coming soon)
  • Turborepo CI via GitHub Actions (Link coming soon)s

FAQs

Package last updated on 01 Feb 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts