feat: allow override of constructs version#13
Conversation
There was a problem hiding this comment.
Pull request overview
Adds first-class support for overriding the constructs dependency version used when generating an AwsCdkConstructLibrary project, while keeping a stable default consistent with the previous hardcoded value.
Changes:
- Introduces
constructsVersiontoAlmaCdkConstructLibraryOptionswith validation + a newCONSTRUCTS_DEFAULT_VERSIONdefault. - Removes the previously hardcoded
constructsVersionfromAlmaCdkConstructLibraryso the validated option/default flows through to projen. - Updates public exports, tests, and generated API docs to reflect the new option and default.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| test/schemas/almaCdkConstructLibraryOptions.test.ts | Adds assertions for the new default and override/validation behavior for constructsVersion. |
| src/schemas/almaCdkConstructLibraryOptions.ts | Adds constructsVersion, introduces CONSTRUCTS_DEFAULT_VERSION, and wires it into the Zod schema defaults. |
| src/index.ts | Exports CONSTRUCTS_DEFAULT_VERSION alongside CDK_DEFAULT_VERSION. |
| src/AlmaCdkConstructLibrary.ts | Removes hardcoded constructs version so the schema-provided value is used. |
| API.md | Documents the new constructsVersion option and its default constant. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthroughThis PR adds a new optional ChangesConstructs Version Configuration
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Comment |
This pull request adds support for specifying the version of the
constructslibrary when generating a CDK construct library project. It introduces a newconstructsVersionoption, provides a default version, and ensures this option is validated and documented. The changes also include corresponding updates to tests and exports.New option for constructs library version:
constructsVersionproperty to theAlmaCdkConstructLibraryOptionsinterface, allowing users to specify the version of theconstructslibrary for the generated project. If omitted, it defaults to the newCONSTRUCTS_DEFAULT_VERSIONconstant. (src/schemas/almaCdkConstructLibraryOptions.ts,API.md) [1] [2] [3]Defaults and validation:
CONSTRUCTS_DEFAULT_VERSIONconstant (set to'10.3.0') and ensured it is used as the default in the schema validation forconstructsVersion. (src/schemas/almaCdkConstructLibraryOptions.ts) [1] [2]constructsVersionas a semver string and included test cases for defaulting, overriding, and rejecting invalid values. (test/schemas/almaCdkConstructLibraryOptions.test.ts) [1] [2]Exports and documentation:
CONSTRUCTS_DEFAULT_VERSIONfrom the main entry point for external usage. (src/index.ts)constructsVersionoption and its default behavior. (API.md) [1] [2]Code cleanup:
CONSTRUCTS_VERSIONconstant from the implementation file, ensuring the new default constant is used consistently. (src/AlmaCdkConstructLibrary.ts) [1] [2]Summary by CodeRabbit
constructsVersionconfiguration option to customize the constructs library version. Defaults to 10.3.0 if not specified.