terraform-cdk icon indicating copy to clipboard operation
terraform-cdk copied to clipboard

CLI: pnpm detection in a subdirectory of a mopnorepo does not work

Open lkleen opened this issue 1 year ago • 2 comments

Description

The detection of the usage of pnpm is based on the assumption that there is a pnpm.lock.yaml file in the same directory as the cdktf configuration. In a monorepo project which has a separate folder for infrastructure code this is not the case. pnpm usage is not correctly detected as the pnpm lock file is located in the root directory of the project by default.

I would suggest to avoid automatic detection based on assumptions and add a packageManager parameter to cdktf.json. This would ensure the correct package manager is utilized in every case and provides a clearly spcified and visible configuration. It would also simplify the implementation.

References

https://github.com/hashicorp/terraform-cdk/pull/2959/commits/69b13becd5244bac348cd0e7b39ef02144ccf2e5#

Help Wanted

  • [X] I'm interested in contributing a fix myself

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

lkleen avatar Jan 19 '24 08:01 lkleen

I would suggest to avoid automatic detection based on assumptions and add a packageManager parameter to cdktf.json.

I would fear this adding a point of confusion since it is one more thing people could misconfigure. I'd vote for fixing the bug at hand and see if similar issues arise in the future.

DanielMSchmidt avatar Jan 19 '24 13:01 DanielMSchmidt