kevlened / fireway

A schema migration tool for firestore
MIT License
277 stars 41 forks source link

feat: support dotenv vars to set up credentials and projectId #69

Open HelderSi opened 1 year ago

HelderSi commented 1 year ago

Hi,

first of all, thanks for this amazing project. It's helping me a lot.

I opened this PR to add support to .env vars using dotenv lib. I think it's very useful, especially, in the development environment.

Dotenv is a well-known lib to storing environment variables. Supporting .env vars file on fireway we don't need to manually export credentials var or pass projectId option on cli, we can set fireway vars on the same file(.env) we are used to using, and it makes cli migrate command less verbose.

The vars that this feature uses are:

GOOGLE_PROJECT_ID=project-id
GOOGLE_APPLICATION_CREDENTIALS=path/to/googe-service-account.json

Doing so we can run fireway migrate command without --projectId option and we don't need to run export GOOGLE_APPLICATION_CREDENTIALS="path/to/googe-service-account.json" on the terminal.

I hope this helps other devs as helped me.

HelderSi commented 1 year ago

Hi.

Any notes about this PR?

tks.