aws-amplify / amplify-cli

The AWS Amplify CLI is a toolchain for simplifying serverless web and mobile development.
Apache License 2.0
2.81k stars 819 forks source link

Function amplify.state files should be displayed in IDE #13761

Open GlenTiki opened 5 months ago

GlenTiki commented 5 months ago

How did you install the Amplify CLI?

npm

If applicable, what version of Node.js are you using?

18

Amplify CLI Version

12.11.2

What operating system are you using?

MacOS Sonoma

Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.

No manual changes made.

Describe the bug

The amplify.state file contains a configurable option for custom lambda "build" commands.

I have a setup in an npm monorepo where:

To make the final step work, I have a custom "build" command in my amplify.state file. With the build command npm install --workspaces=false --install-links --no-bin-links --production I ensure that my database utils monorepo package is copied to the node_modules folder in my lambdas when I run amplify deploy.

Expected behavior

Because I needed to customise the lambda build command, I needed to get into the amplify.state file. I think this file shouldn't be hidden in the IDE anymore to ensure users can easily access it (as it stands, I'm removing it from being hidden in my IDE settings .vscode/settings.json).

Users should probably be able to customise this command when running function update.

The customised command could be stored in backend-config.json too, and updated in the amplify.state when building for deployment.

Reproduction steps

Project Identifier

9f0ac5b025abe4eeaef38d0a8f34c06f

Log output

``` # Put your logs below this line ```

Additional information

(Aside; I also have a problem where amplify can't detect changes in a symlinked hoisted dependency of my functions when I run amplify deploy, so I have a custom pre-deploy command where I write a checksum to a file in each of the functions that depend on these monorepo packages. This checksum is generated by hashing the files tracked in git of the symlinked dependency)

Before submitting, please confirm:

ykethan commented 5 months ago

Hey @GlenTiki, thank you for reaching out. Marking this as feature request to remove amplify-state.json from .vscode/settings.json.