akauppi / GroundLevel-firebase-es

[ANCHORED] Stencil for operational web apps
https://groundlevel-sep22.web.app/
Other
23 stars 3 forks source link

Filtering out Firebase Emulator warnings that are out-of-place #74

Closed akauppi closed 3 years ago

akauppi commented 3 years ago

Especially with app-deploy-ops, the developer experience is not optimal.

Case A

"watch": "concurrently --kill-others-on-fail -n roll,host \"npm run -s _watchRoll\" \"npm run serve\"",

This uses a pipe to filter out some warnings, but no messages come through to the terminal. That is not the purpose!!!

Case B

"watch": "concurrently --kill-others-on-fail -n roll,host \"npm run -s _watchRoll\" \"npm run //serve:pipeless\"",

This doesn't pipe. Firebase Emulator prints out messages that are confusing to the developer.

[host] ⚠ emulators: You are not currently authenticated so some features may not work correctly. Please run firebase login to authenticate the CLI.

We don't want to be authenticated.

[host] i emulators: Detected demo project ID "demo-9", emulated services will use a demo configuration and attempts to access non-emulated services for this project will fail.

  1. Attempts to use non-emulated services (Firestore cloud instance) work just fine. (we're only hosting and hosting is not aware of other emulators)
  2. Since we're using demo-..., why the "you are not currently authenticated" warning above?

[host] ⚠ emulators: The Emulator UI requires a project ID to start. Configure your default project with 'firebase use' or pass the --project flag.

Tried disabling the emulator UI by firebase.json: emulators.ui: { enabled: false } but that doesn't seem to cut it (how to disable the UI?)

akauppi commented 3 years ago

This filters beautifully (piping done within Docker):

$(docker-run-cmd) /bin/bash -c "firebase emulators:start --project=demo-9 | grep -v -E \"You are not currently authenticated|Detected demo project ID|The Emulator UI requires a project ID to start"\"

..but fails to recognise Ctrl-C for closing it down.

akauppi commented 3 years ago

Got it working, for app-deploy-ops. The trick is to -a stdin in the Docker launch command; in addition to -t.