firebase / firebase-tools

The Firebase Command Line Tools
MIT License
4.01k stars 930 forks source link

Detect platform during `init dataconnect:sdk` instead of asking #7522

Closed joehan closed 1 month ago

joehan commented 2 months ago

Description

Asking users to type in paths is the worst. Just knowing is better.

Still have a few more things to test here:

Scenarios Tested

Tested auto-detection of a web app, from the firebase.json directory and from the app directory

Screenshot 2024-08-01 at 5 07 13 PM Screenshot 2024-08-01 at 5 06 54 PM

IOS (tested with friendlyeats-ios app)

Screenshot 2024-08-02 at 11 53 09 AM

Android (tested with friendlyeats-android app)

Screenshot 2024-08-02 at 11 48 16 AM
joehan commented 1 month ago

Two random comments:

  1. An irrelevant message about adding the project to Xcode is emitted when initializing the Kotlin SDK. Consider only emitting this message when configuring the Swift SDK:
i  Generated SDK code for foo
i  Please follow the instructions here to add your generated sdk to your XCode project:
        https://firebase.google.com/docs/data-connect/gp/ios-sdk#set-client

Good catch, will refactor to avoid that.

  1. Any comments in the yaml file are discarded. I would expect comments to remain after "editing" the yaml file to add the new information.

This one is an unfortunate side effect of us marshalling + unmarshalling the YAML to edit it. I think the effort required to avoid this is not worth the time ATM. Adding a TODO to remember this tho

dconeybe commented 1 month ago

My final comments were not addressed. Please fix as the output is suboptimal.

Specifically, use app/src/main/java instead of app/src/main and only append generated if not using app/src/main/java.