You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unfortunately we're either doing smth wrong or there might be a conceptual problem in the way cdkDependencies are handled.
The Problem (and solution i think) is described in this blogpost https://dev.to/udondan/correctly-defining-dependencies-in-l3-cdk-constructs-45p , basically: defining cdk deps as real dependencies puts limitations on your downward consumers, therefore they should be added to peerDependencies and devDependencies, as this enables to use them during development but allows consumers to use their own specified version.
At the moment we add deps as both "peer" and normal deps since previous versions of npm did not install peer dependencies automatically. This means that users would need to manually add all the transitive deps to their projects.
This will be solved once we released CDK 2.0 which will be published as a single module, so libs could just define it as a peer dep and consumers will bring the correct version.
Happy to accept a contribution to add a switch which disables this behavior though, especially given its a hack.
Allows disabling the default behavior in which CDK dependencies are also added as normal dependencies (and not just peer dependencies).
Resolves#577
---
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Hi there and thanks for the great project!
We're currently building https://github.com/superluminar-io/super-eks/ with it and are very happy.
Unfortunately we're either doing smth wrong or there might be a conceptual problem in the way
cdkDependencies
are handled.The Problem (and solution i think) is described in this blogpost https://dev.to/udondan/correctly-defining-dependencies-in-l3-cdk-constructs-45p , basically: defining cdk deps as real
dependencies
puts limitations on your downward consumers, therefore they should be added topeerDependencies
anddevDependencies
, as this enables to use them during development but allows consumers to use their own specified version.If this is correct thinking on my side, this line https://github.com/projen/projen/blob/main/src/awscdk-construct.ts#L150 would probably has to be changed? Or is there another way that I sould be using? Also the comment (and therefore reasoning) above the method is probably outdated, since npm 7 is actually installing
peerDependencies
(https://github.blog/2021-02-02-npm-7-is-now-generally-available/#peer-dependencies)If you're agreeing with me I can submit a PR if you'd like.
Thanks again!
The text was updated successfully, but these errors were encountered: