Skip to content

Commit 0851ffd

Browse files
authored
chore(mixins-preview): typed L1 property mixins (#36062)
### Reason for this change Adds auto-generated L1 property mixins for all CloudFormation resources, providing type-safe property application with merge strategies. **Note:** Still a chore as package is still not yet released. This will come next. ### Description of changes - Generates type-safe property mixins for every CloudFormation resource across all AWS services - Adds package.json exports for all service-specific mixin modules (e.g., `@aws-cdk/mixins-preview/aws-s3/mixins`) - Supports two merge strategies: MERGE (deep merge, default) and OVERWRITE (shallow assign) - Enables applying L1 properties to both L1 and L2 constructs with full TypeScript support - Updates README with L1 Property Mixins documentation and examples Example usage: ```typescript import '@aws-cdk/mixins-preview/with'; import { CfnBucketPropsMixin } from '@aws-cdk/mixins-preview/aws-s3/mixins'; const bucket = new s3.Bucket(scope, "Bucket") .with(new CfnBucketPropsMixin({ versioningConfiguration: { status: "Enabled" }, publicAccessBlockConfiguration: { blockPublicAcls: true, blockPublicPolicy: true } })); ``` ### Describe any new or updated permissions being added No new or updated IAM permissions. ### Description of how you validated changes - Generated mixins for all AWS services - Verified type safety and merge strategies - Updated documentation with examples ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent c6881e9 commit 0851ffd

File tree

288 files changed

+1888
-67
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

288 files changed

+1888
-67
lines changed

packages/@aws-cdk/mixins-preview/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,7 @@ junit.xml
2020
!**/*.snapshot/**/asset.*/*.d.ts
2121

2222
!**/*.snapshot/**/asset.*/**
23+
24+
# we ignore generated files that cannot contain hand-written info
25+
lib/services/*/index.ts
26+
lib/services/**/*.jsiirc.json

packages/@aws-cdk/mixins-preview/README.md

Lines changed: 37 additions & 33 deletions
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
export * as core from './core';
22
export * as mixins from './mixins';
3+
export * from './services';
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './ask.generated';
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './accessanalyzer.generated';
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './acmpca.generated';
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './aiops.generated';
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './amazonmq.generated';
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './amplify.generated';
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './amplifyuibuilder.generated';

0 commit comments

Comments
 (0)