refactor(spec2cdk): relocate cfn-prop-mixins builder and detangle gen.ts orchestration#37204
Merged
mergify[bot] merged 2 commits intomainfrom Mar 9, 2026
Merged
refactor(spec2cdk): relocate cfn-prop-mixins builder and detangle gen.ts orchestration#37204mergify[bot] merged 2 commits intomainfrom
mergify[bot] merged 2 commits intomainfrom
Conversation
8838e8e to
2724709
Compare
…ributions Each generator now declares its submodule contributions (barrel file, export lines, jsiirc namespace) via a GeneratorResult type. The gen.ts orchestrator consumes these contributions dynamically instead of hardcoding generator-specific logic. Extract shared writeJsiiRc and ensureFileContains utilities into lib/util/submodule-files.ts. Refactor cfn2ts/submodules.ts to use writeJsiiRc instead of inline jsiirc construction. Move mergeModuleMaps to module-topology.ts.
2724709 to
1382eb2
Compare
rix0rrr
approved these changes
Mar 9, 2026
Contributor
|
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Contributor
Merge Queue Status
This pull request spent 10 seconds in the queue, including 1 second running CI. Required conditions to merge
|
Contributor
|
Comments on closed issues and PRs are hard for our team to see. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reason for this change
The
spec2mixinscode inmixins-preview/scripts/was tightly coupled to@aws-cdk/spec2cdkinternals, importing directly from deep paths like@aws-cdk/spec2cdk/lib/cdk/resource-decider. Since this code is fundamentally a spec2cdk builder (extendingLibraryBuilder), it belongs in the spec2cdk package itself. Similarly, thegen.tsorchestration script contained shared utilities (mergeModuleMaps,ensureFileContains,writeJsiiModuleMetadata) and hardcoded knowledge about each generator's output files, making it difficult to add new generators without modifying the orchestrator.Description of changes
The cfn-prop-mixins builder, its generate function, helpers, and tests are relocated from
packages/@aws-cdk/mixins-preview/scripts/spec2mixins/totools/@aws-cdk/spec2cdk/lib/cfn-prop-mixins/. ThegenerateAllfunction now acceptspackageBasesas a parameter instead of importingMIXINS_PREVIEW_BASE_NAMESdirectly, making it reusable for other packages.A thin wrapper remains in
mixins-preview/scripts/spec2mixins/index.tsthat re-exportsMixinsBuilderandMixinsBuilderProps, and provides agenerateAll()that passes the mixins-preview-specific package base names. This preserves the existing API for consumers within the mixins-preview package.The
gen.tsorchestration is detangled by introducing aSubmoduleContributioninterface andGeneratorResulttype in spec2cdk. Each generator now declares what barrel files and export lines it contributes, rather than the orchestrator hardcoding this knowledge. The shared utilitiesmergeModuleMaps,ensureFileContains, andwriteJsiiModuleMetadataare moved to spec2cdk where they operate on spec2cdk types (ModuleMap,ModuleDefinition).The
logs-delivery.test.tsis updated to importLogsDeliveryBuilderPropsfrom its own package instead of borrowingMixinsBuilderPropsfrom spec2mixins.Describe any new or updated permissions being added
No new permissions.
Description of how you validated changes
Both
@aws-cdk/spec2cdkand@aws-cdk/mixins-previewbuild successfully, including full codegen of all 274 service modules.Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license