Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
2 tasks done
GlenTiki opened this issue May 3, 2024 · 1 comment
Open
2 tasks done

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

GlenTiki opened this issue May 3, 2024 · 1 comment
Labels
feature-request Request a new feature functions Issues tied to the functions category

Comments

@GlenTiki
Copy link

GlenTiki commented May 3, 2024

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:

  • My functions are monorepo "packages"
  • I have other shared "packages" that are dependencies of the functions (e.g. a database utility used by some functions)
  • I need to make sure that when I install these packages during amplify build, they're embedded in node_modules as is and not installed as symlinks.

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

  • Amplify init a project
  • select vscode as IDE
  • check .vscode/settings.json to see the config of the file being hidden: "amplify/**/amplify.state": true,

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:

  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
  • I have removed any sensitive information from my code snippets and submission.
@GlenTiki GlenTiki added the pending-triage Issue is pending triage label May 3, 2024
@ykethan
Copy link
Contributor

ykethan commented May 3, 2024

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

@ykethan ykethan added functions Issues tied to the functions category feature-request Request a new feature and removed pending-triage Issue is pending triage labels May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request a new feature functions Issues tied to the functions category
Projects
None yet
Development

No branches or pull requests

2 participants