-
Notifications
You must be signed in to change notification settings - Fork 60
refactor(cli): re-organize files #265
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the only larger code change in this PR
| */ | ||
| async function loadInitVersions(): Promise<Versions> { | ||
| const initVersionFile = path.join(__dirname, './init-templates/.init-version.json'); | ||
| const initVersionFile = path.join(cliRootDir(), 'lib', 'init-templates', '.init-version.json'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was incorrect before and would have broken the toolkit-lib and cli-lib-alpha and integ-runner and cdk-cli-wrapper if they were supporting init command.
Because the code is bundled, we need to address the init-templates from the project root location. This is already done elsewhere in this file, just was missed for .init-version.json and .recommended-feature-flags.json
| */ | ||
| export async function currentlyRecommendedAwsCdkLibFlags() { | ||
| const recommendedFlagsFile = path.join(__dirname, './init-templates/.recommended-feature-flags.json'); | ||
| const recommendedFlagsFile = path.join(cliRootDir(), 'lib', 'init-templates', '.recommended-feature-flags.json'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was incorrect before and would have broken the toolkit-lib and cli-lib-alpha and integ-runner and cdk-cli-wrapper if they were supporting init command.
Because the code is bundled, we need to address the init-templates from the project root location. This is already done elsewhere in this file, just was missed for .init-version.json and .recommended-feature-flags.json
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These fixes surfaced because the file moved to a subdirectory.
3f7b8a3 to
fdb96d8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we now import directly from the shared library
fdb96d8 to
cd52c09
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #265 +/- ##
==========================================
+ Coverage 84.89% 85.32% +0.43%
==========================================
Files 218 219 +1
Lines 36585 36577 -8
Branches 4550 4599 +49
==========================================
+ Hits 31058 31211 +153
+ Misses 5380 5224 -156
+ Partials 147 142 -5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
cd52c09 to
546f384
Compare
6c644b2 to
49518cf
Compare
Pull request was closed
Hopefully the final big code re-org in the CLI before we move code into the shared package.
This move focuses on moving top-level files into
commandsandclirespectively, to indicate they will stay within the CLI package.Also removes the
toolkit/error.tsre-export, which causes many of the import changes.Includes a non-consequential bug fix, to the init command and how it's finding the new
.init-version.jsonand.recommended-feature-flags.jsonfiles. This was incorrect before and would happened to work becauseinit.tswas in the same directory asindex.ts. However because the code is bundled, we need to address theinit-templates(and the new files) from the project root location. This is already done for the templates themselves, but was missed for.init-version.jsonand.recommended-feature-flags.json.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license