aws-amplify / amplify-hosting

AWS Amplify Hosting provides a Git-based workflow for deploying and hosting fullstack serverless web applications.
https://aws.amazon.com/amplify/hosting/
Apache License 2.0
459 stars 116 forks source link

Can I specify amplify/ directory location for Yarn Workspaces compatibility? #1750

Open ctjlewis opened 3 years ago

ctjlewis commented 3 years ago

I have the following project structure:

workspaces
├── amplify/
├── backend/
└── frontend/

Where each workspace is its own git submodule. I would like to tell the CLI that it can find the amplify/ directory not in ./, but in ./workspaces, so that I can call the CLI from the root folder.

As a workaround, I can eliminate the workspaces/ parent dir and move everything to directory root ./, so that ./amplify/ is the natural location of the submodule, but ideally I could override this.

I have looked at using amplify.yml in root dir ./ to specify artifacts: baseDirectory: ... but to not much success.

ctjlewis commented 3 years ago

Is this perhaps better suited to the https://github.com/aws-amplify/amplify-cli directory?

ctjlewis commented 3 years ago

Literally any way to set up the amplify/ directory in a different place than where yarn build will be run is all I need. The docs point you to configure Build Settings that are not loaded.

Aside from lazily loading everything in the same directory, I don't see how I can add AWS Amplify to my project.

siegerts commented 3 years ago

Hi @ctjlewis, thanks for raising this. Currently, this isn't supported so I'm going to label this as a feature request. Given your experience, are there any other details around how you would envision this so that its a low friction configuration step given your use case? - Thanks again.

ctjlewis commented 3 years ago

Thanks @siegerts, this is really just a request for a baseDir-like option globally for Amplify. Yarn basically allows this with yarn --cwd [dir], that option could be replicated:

# Run as if executing in workspaces/, i.e. configs in workspaces/amplify/
amplify --cwd workspaces/ publish

This basically lets us "hook in" to an amplify init directory from wherever we want. Also is this the right repo for this issue?