feat: add cdkVersion option to AlmaCdkConstructLibraryOptions#12
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds first-class support for configuring the AWS CDK version used by AlmaCdkConstructLibrary via a new cdkVersion option, with a centralized default (CDK_DEFAULT_VERSION) that is exported for consumers and tests.
Changes:
- Added
cdkVersion?: stringtoAlmaCdkConstructLibraryOptionsand introducedCDK_DEFAULT_VERSION(2.220.0) as the default. - Updated option parsing/schema and removed the previously hardcoded CDK version in
AlmaCdkConstructLibrary. - Updated API docs and tests to cover the new default and override behavior.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| test/schemas/almaCdkConstructLibraryOptions.test.ts | Adds assertions for cdkVersion defaulting and override behavior. |
| src/schemas/almaCdkConstructLibraryOptions.ts | Introduces cdkVersion option, exports CDK_DEFAULT_VERSION, and wires defaulting into the schema. |
| src/index.ts | Re-exports CDK_DEFAULT_VERSION from the package entrypoint. |
| src/AlmaCdkConstructLibrary.ts | Removes hardcoded CDK version so cdkVersion flows from validated options. |
| API.md | Documents the new cdkVersion option in the generated API reference. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This pull request introduces support for specifying the AWS CDK version via a new
cdkVersionoption in theAlmaCdkConstructLibraryOptionsinterface. If not provided, the version defaults to a new exported constant,CDK_DEFAULT_VERSION. The changes ensure the CDK version is validated, documented, and tested throughout the codebase.CDK version configuration support:
cdkVersionproperty to theAlmaCdkConstructLibraryOptionsinterface, allowing consumers to specify the AWS CDK version for generated libraries. If omitted, it defaults to the newCDK_DEFAULT_VERSIONconstant. [1] [2]CDK_DEFAULT_VERSION('2.220.0') inalmaCdkConstructLibraryOptions.tsand re-exported it fromsrc/index.ts. [1] [2]almaCdkConstructLibraryOptionsSchema) to useCDK_DEFAULT_VERSIONas the default forcdkVersion.API.md) to include and describe the newcdkVersionproperty. [1] [2]Testing improvements:
cdkVersiondefaults correctly and can be overridden, using the exportedCDK_DEFAULT_VERSION. [1] [2] [3]Code cleanup:
CDK_VERSIONconstant fromAlmaCdkConstructLibrary.ts, ensuring the version is now sourced from the schema. [1] [2]