simondotm / nx-firebase

Firebase plugin for Nx Monorepos
https://www.npmjs.com/package/@simondotm/nx-firebase
MIT License
175 stars 31 forks source link

automatically detect project to deploy to #172

Closed ar7casper closed 6 months ago

ar7casper commented 7 months ago

Maybe I'm missing something, after reading the docs. In my mind, if I have two firebase projects setup through this plugin, when I run something like nx deploy foo-function it should automatically know which firebase project to deploy to. Cureently, more often than not, wrong functions get deployed to wrong projects due to human error.

Do you have a solution for that? If not, how can I help in achieving that?

Thanks.

simondotm commented 6 months ago

Hi @ar7casper,

Yes, for each firebase project you have, you can set the target Firebase project for it to use when deploying:

nx g @simondotm/nx-firebase:sync --app=<firebase-app-project-name> --project=<firebase-cli-project-name>

https://github.com/simondotm/nx-firebase/blob/main/docs/nx-firebase-sync.md#changing-firebase-cli-project

Doing this sets the --project CLI option used by the plugin when deploying (or running any other firebase CLI commands)