Skip to content

Conversation

@mrgrain
Copy link
Contributor

@mrgrain mrgrain commented Jan 6, 2026

Using cdk init with a pre-release version via --lib-version (e.g., cdk init --lib-version 2.234.0-rc.0) failed because the rangeFromSemver function could not parse versions with pre-release identifiers or build metadata.

This fix updates the regex to correctly handle these semver suffixes, allowing cdk init to work with pre-release versions.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@github-actions github-actions bot added the p2 label Jan 6, 2026
@mrgrain mrgrain changed the title fix(toolkit-lib): handle semver pre-release and build metadata in version ranges fix(toolkit-lib): cdk init fails with pre-release --lib-version Jan 6, 2026
@mrgrain mrgrain changed the title fix(toolkit-lib): cdk init fails with pre-release --lib-version fix(cli): cdk init fails with pre-release --lib-version Jan 6, 2026
@mrgrain mrgrain changed the title fix(cli): cdk init fails with pre-release --lib-version fix(cli): cdk init fails with pre-release --lib-version Jan 6, 2026
@aws-cdk-automation aws-cdk-automation requested a review from a team January 6, 2026 12:21
@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.59%. Comparing base (3b11750) to head (12425b9).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1013      +/-   ##
==========================================
- Coverage   87.60%   87.59%   -0.01%     
==========================================
  Files          72       72              
  Lines       10069    10069              
  Branches     1326     1326              
==========================================
- Hits         8821     8820       -1     
- Misses       1223     1224       +1     
  Partials       25       25              
Flag Coverage Δ
suite.unit 87.59% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@aws-cdk-automation aws-cdk-automation added this pull request to the merge queue Jan 6, 2026
Merged via the queue into main with commit 0aa3e98 Jan 6, 2026
51 checks passed
@aws-cdk-automation aws-cdk-automation deleted the mrgrain/fix/toolkit-lib/version-range-prerelease branch January 6, 2026 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants