cdklabs / cdk-monitoring-constructs

Easy-to-use CDK constructs for monitoring your AWS infrastructure
https://constructs.dev/packages/cdk-monitoring-constructs
Apache License 2.0
443 stars 56 forks source link

Peer dependency resolution with 2.106 and greater #457

Closed Erry91 closed 7 months ago

Erry91 commented 7 months ago

Feature scope

Peer Dependencies

Describe your suggested feature

I am trying to integrate the cdk-monitoring-constructs with my CDK project, which is using the following versions:

"@aws-cdk/aws-apigatewayv2-alpha": "^2.106.0-alpha.0",
"@aws-cdk/aws-apigatewayv2-integrations-alpha": "^2.106.0-alpha.0",
"@aws-cdk/aws-sagemaker-alpha": "^2.106.0-alpha.0",
"aws-cdk-lib": "^2.106.0",
"constructs": "^10.3.0",

I am incurring in a peer dependencies error probably due to the fact that the "alpha" cdk libraries are not subject to Semantic Versioning. Doing a clean "npm install" with these dependencies throws an error of the type:

Found: @aws-cdk/aws-apigatewayv2-alpha@2.106.0-alpha.0
npm ERR! node_modules/@aws-cdk/aws-apigatewayv2-alpha
npm ERR!   @aws-cdk/aws-apigatewayv2-alpha@"^2.106.0-alpha.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @aws-cdk/aws-apigatewayv2-alpha@"^2.99.0-alpha.0" from cdk-monitoring-constructs@6.4.1
npm ERR! node_modules/cdk-monitoring-constructs
npm ERR!   cdk-monitoring-constructs@"^6.4.1" from the root project

Do you know if the only way to proceed is through a --legacy-peer-deps ? I was wondering if you have in plan to update the dependencies to the most recent versions of the cdk libraries or why npm is not resolving the dependencies correctly.

Thank you in advance.

echeung-amzn commented 7 months ago

Duplicate of #212

(See https://github.com/cdklabs/cdk-monitoring-constructs/issues/212#issuecomment-1814618188 for a more concrete example of how to work around it)