Commit f96e94c
authored
chore: centralize storage of submodule names (#36018)
### Reason for this change
Currently, `.jsiirc.json` files in aws-cdk-lib submodules contain historical naming deviations (e.g., `Amazon.CDK.AWS.Sagemaker` instead of the standard `Amazon.CDK.AWS.SageMaker`). These files are manually maintained and scattered across hundreds of subdirectories, making it:
- **Difficult to discover** what deviations exist and why
- **Risky to change** because there's no central source of truth
- **Hard to maintain consistency** when adding new modules
- **Impossible to audit** without checking every subdirectory
This creates technical debt and makes it harder to evolve the codebase.
### Description of changes
Centralizes all jsii target configurations into a single `scope-map.json` file that serves as the source of truth. The submodule generation script now always regenerates `.jsiirc.json` files from this central configuration, ensuring consistency and making deviations explicit and auditable.
Supporting changes:
- Created `module-topology.ts` to manage the scope map
- Moved jsii utilities from `util/pkglint.ts` to `util/jsii.ts`
- Removed unused `cfn2ts` CLI tool
- Updated all imports to use the new module topology exports
This makes historical deviations visible in one place and prevents future drift.
### Describe any new or updated permissions being added
No new permissions are being added.
### Description of how you validated changes
- Verified that the scope-map.json correctly captures all existing module configurations
- Confirmed that regenerated .jsiirc.json files match the expected format
- Ensured all imports and type references were updated correctly
Basically the proof that this works is that (aside from `scope-map.json`) only codegen files have changed. In particular `jsii-diff` doesn't report anything and no `.jsiirc.json` files changed.
### 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 24d2adf commit f96e94c
File tree
16 files changed
+2162
-1660
lines changed- packages/aws-cdk-lib/scripts
- submodules
- tools/@aws-cdk/spec2cdk
- lib
- cdk
- cfn2ts
- naming
- util
16 files changed
+2162
-1660
lines changedThis file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
| 3 | + | |
2 | 4 | | |
3 | | - | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
28 | | - | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
| 33 | + | |
45 | 34 | | |
46 | 35 | | |
47 | 36 | | |
| |||
53 | 42 | | |
54 | 43 | | |
55 | 44 | | |
56 | | - | |
| 45 | + | |
57 | 46 | | |
58 | 47 | | |
59 | 48 | | |
| |||
0 commit comments