diff --git a/text/0079-cdk-2.0.md b/text/0079-cdk-2.0.md index 2960b155f..d09b82577 100644 --- a/text/0079-cdk-2.0.md +++ b/text/0079-cdk-2.0.md @@ -241,7 +241,31 @@ is needed once the `v2` branch has been forked from `master`, as the renaming of `monocdk-experiment` to `aws-cdk-lib` and marking all bundled packages `private` is taken care of at that time. -However, since users will all use a single `aws-cdk-lib` library, the +### Framework X CLI Shared Libraries + +There are some packages that both the CLI and the framework depend on: + +- [@aws-cdk/cloud-assembly-schema](https://github.com/aws/aws-cdk/tree/master/packages/%40aws-cdk/cloud-assembly-schema) +- [@aws-cdk/cx-api](https://github.com/aws/aws-cdk/tree/master/packages/%40aws-cdk/cx-api) +- [@aws-cdk/region-info](https://github.com/aws/aws-cdk/tree/master/packages/%40aws-cdk/region-info) +- [@aws-cdk/yaml-cfn](https://github.com/aws/aws-cdk/tree/master/packages/%40aws-cdk/yaml-cfn) + +This means we cannot move these packages under `aws-cdk-lib`, as they need to consumable by the CLI. +The simplest approach would be to keep publishing them as is, and have the framework and CLI continue to declare a dependency on them. + +However, since [@aws-cdk/cx-api](https://github.com/aws/aws-cdk/blob/master/packages/@aws-cdk/core/lib/stage.ts#L186) +and [@aws-cdk/cloud-assembly-schema](https://github.com/aws/aws-cdk/blob/master/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/shared/base-load-balancer.ts#L99) +are exposed in the public API of `aws-cdk-lib`, this would require `aws-cdk-lib` to take a `peerDependency` on them, which we cannot afford. + +The approach we take here is as follows: + +- `@aws-cdk/cloud-assembly-schema`, `@aws-cdk/cx-api`, and `@aws-cdk/region-info` will continue to published as is to support the CLI. To support the +framework, they will also be copied over under `aws-cdk-lib`, in the same way all other packages are. +- `@aws-cdk/yaml-cfn` is a utility package that isn't meant for public consumption. It can easily converted to pure JS and bundled inside `aws-cdk-lib`. + +### Metadata Reporting + +Since users will all use a single `aws-cdk-lib` library, the granularity of information collected via the `AWS::CDK::Metadata` resource (injected by the [version reporting] feature) will be significantly reduced. In order to retain ability to provide a signal to customers affected by a security