Skip to content

Conversation

@rohang9000
Copy link
Contributor

This PR adds local template support through the new --from-path CLI option. Users can initialize CDK projects from local custom templates, copying the template as is without placeholder processing.

The feature includes language auto-detection when templates contain a single language option and error handling for invalid paths. 3 new test cases covering basic local template functionality, language auto-detection, and error handling scenarios were added.

Fixes #


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 Aug 4, 2025
@aws-cdk-automation aws-cdk-automation requested a review from a team August 4, 2025 05:03
Copy link
Contributor

@iankhou iankhou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left some comments about code efficiency and validations.

Also, about option exclusivity for the --from-path option.

@codecov-commenter
Copy link

codecov-commenter commented Aug 7, 2025

Codecov Report

❌ Patch coverage is 75.93819% with 109 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.60%. Comparing base (5128946) to head (33dee82).

Files with missing lines Patch % Lines
packages/aws-cdk/lib/commands/init/init.ts 76.74% 98 Missing and 5 partials ⚠️
packages/aws-cdk/lib/cli/cli.ts 0.00% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #763      +/-   ##
==========================================
+ Coverage   80.88%   82.60%   +1.72%     
==========================================
  Files          63       64       +1     
  Lines        8599     9465     +866     
  Branches     1028     1107      +79     
==========================================
+ Hits         6955     7819     +864     
+ Misses       1614     1612       -2     
- Partials       30       34       +4     
Flag Coverage Δ
suite.unit 82.60% <75.93%> (+1.72%) ⬆️

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.

Copy link
Contributor

@iankhou iankhou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's handle flag conflicts at yargs, more details in comments. Some questions about error-handling, other minor corrections.

@rohang9000 rohang9000 force-pushed the feat/local-template-support branch from c882bc2 to 54e20f1 Compare August 8, 2025 19:23
Copy link
Contributor

@kaizencc kaizencc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't want to step on @iankhou's toes on the review but here are some thoughts, mostly surrounding non-essential portions.

Signed-off-by: github-actions <[email protected]>
@rohang9000 rohang9000 marked this pull request as ready for review August 11, 2025 14:42
@iankhou iankhou added this pull request to the merge queue Aug 26, 2025
github-merge-queue bot pushed a commit that referenced this pull request Aug 26, 2025
This PR adds local template support through the new `--from-path` CLI
option. Users can initialize CDK projects from local custom templates,
copying the template as is without placeholder processing.

The feature includes language auto-detection when templates contain a
single language option and error handling for invalid paths. 3 new test
cases covering basic local template functionality, language
auto-detection, and error handling scenarios were added.

Fixes #

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

---------

Signed-off-by: github-actions <[email protected]>
Co-authored-by: github-actions <[email protected]>
Co-authored-by: Ian Hou <[email protected]>
@iankhou iankhou removed this pull request from the merge queue due to a manual request Aug 26, 2025
@iankhou iankhou enabled auto-merge August 26, 2025 21:12
@iankhou iankhou added this pull request to the merge queue Aug 26, 2025
Merged via the queue into main with commit 5fc1b13 Aug 26, 2025
28 checks passed
@iankhou iankhou deleted the feat/local-template-support branch August 26, 2025 21:48
@iankhou iankhou self-assigned this Aug 26, 2025
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.

5 participants