amazon-archives / awsmobile-cli

CLI experience for Frontend developers in the JavaScript ecosystem.
Apache License 2.0
142 stars 35 forks source link

Any way around committing project-info.json? #47

Closed d0ruk closed 6 years ago

d0ruk commented 6 years ago

Hello,

One of the files awsmobile-cli needs to operate is the project-info.json. It contains app-specific information such as; ProjectPath, BackendProjectConsoleUrl etc. Since the CLI doesn't work without the said file, right now, one must check it in.

Wouldn't it be possible for the CLI to generate the mobilehub app without the project-info? I imagine generating some sane defaults in the absence of previous stack would be enough. Thus, the CLI wouldn't require the project-info file be present.

Is this feasible? If so, is it desirable?

UnleashedMind commented 6 years ago

project-info.json is where the cli keeps the project specific information, so it's needed. It's actually in the validation logic to check the existence of that file before the cli carries out any project specific operations. Mobile hub project can be generated in different ways, e.g. on the mobile hub web console or by awsmobile init. Executing 'awsmobile init \<mobile-hub-project-id>' allows you to "attach" your frontend project with existing mobile hub projects as the backend.

UnleashedMind commented 6 years ago

The values of ProjectPath and BackendProjectConsoleUrl are updated by the cli when the project is cloned to a different dev environment, so checking in the file with your local values shouldn't cause any problem for your teammates. If you don't want to reveal such information, just hide it before you check in. But the cli needs other information such as BuildCommand to function.

d0ruk commented 6 years ago

when the project is cloned to a different dev environment

So, let's say the project was init in home/user1 and then pushed to origin. If I now clone it to a machine with home/user2, the CLI will figure that out and update the values?

Yes

You are correct, I am asking this to figure out how to collaborate on mobilehub projects.

just hide it before you check in.

Do you mean manually editing the files? If the ProjectPath is missing in project-info.json, the CLI will carry on?

Yes

UnleashedMind commented 6 years ago

Please see the answers inline. The project-info.json file is inside the umbrella .awsmobilejs/ folder, files inside that folder are only meant to be used (and viewed) by the awsmobile-cli. As the cli user, you can safely ignore their contents.

d0ruk commented 6 years ago

Thanks for the answers.