amazon-archives / awsmobile-cli

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

Configuration conflicts in versioning #69

Closed superandrew closed 6 years ago

superandrew commented 6 years ago

When we share a awsmobile-cli project between developers, we find that 3 files are conflicting:

  1. a json file in /.awsmobilejs/project-aws-config/-xvOIo.json
  2. /awsmobilejs/.awsmobile/info/aws-info.json
  3. /awsmobilejs/.awsmobile/info/project-info.json

I'm not sure if we did something wrong, but in those files there are absolute references to path that contain the username, so the're not versioning-friendly.

We tried to change the path to relative (and to ~ for user home). But we've got errors:

fs.js:663
  return binding.open(pathModule.toNamespacedPath(path),
             ^

Error: ENOENT: no such file or directory, open '~/.awsmobilejs/project-aws-config/<PROJECTNAME>-1ONfI.json'
at Object.fs.openSync (fs.js:663:18)
at Object.fs.writeFileSync (fs.js:1314:33)
at resolve_project_awsConfig 

Is this by design? Or are we doing something wrong? In the first case, probably it would be better to handle differently relative paths.

UnleashedMind commented 6 years ago

You can not change the info or the config files paths, those files are only meant to be used by the cli, and their paths are internally set by the cli.

After version v1.0.16, the cli separates the project config from the project info. Project info contains absolute paths and is specific to a local development and backend mobile hub project, it is not supposed to be checked into codebase repo. Only the project config file is supposed to be checked in. Collaborators set up their own local dev and backend mobile project by running awsmobile init on the project after cloning it from the github.
Please check the release notes: https://github.com/aws/awsmobile-cli/releases

UnleashedMind commented 6 years ago

closing the issue for now, feel free to re-open it or continue the conversion here.

goatandsheep commented 6 years ago

@UnleashedMind is there any way to change the config after it has been initialized? For example, if one team member has setup a graphql instance and you want to switch to it from another