-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
feat(toolkit): show when new version is available #2484
Conversation
Switching version.ts from generated to version controlled so that it can be expanded with more functions.
Check, once a day, if a newer CDK version available in npm and announce it's availability at the end of a significant command. TESTING: * New unit tests for version.ts * Downgraded version number in package.json and verified that the expected message is printed. * Verified that the file cache throttles the check to run only once per day. closes #297
Could you give us some more context on what the change is and why you would like to apply it? |
@rix0rrr - (I've copied over the details on the commit message to the PR description as well) I wanted to be notified when new CDK versions are available in npm directly through the CLI. Useful to check what the new release contains and upgrade if there fixes or features relevant to my app. I saw that there already was an issue open for this - #297 |
packages/aws-cdk/lib/version.ts
Outdated
|
||
// Export for unit testing only. | ||
// Don't use directly, use displayVersionMessage() instead. | ||
export async function latestVersionIfHigher(currentVersion: string, cacheFile: CacheFile): Promise<string | null> { |
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.
Don't export it if you don't want it to be used.
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.
Any suggestions on how else I can (unit) test the logic here? Or would you rather not export and have no test?
* Dropped recommending the command for upgrade. * Switch to use aws-cdk instead of cdk for npm package name. * Closed leaking fd. * Renamed CacheFile to TimestampFile. * Dropped printing of stack trace in a 'warn' message.
Banner formatting to support variable sized string and recognizes colors support. This allows for the banner to work correctly when the message size changes.
Check, once a day, if a newer CDK version available in npm and announce it's availability at the end of a significant command. TESTING: * New unit tests for version.ts * Downgraded version number in package.json and verified that the expected message is printed. * Verified that the file cache throttles the check to run only once per day. Closes aws#297
Check, once a day, if a newer CDK version available in npm and announce
it's availability at the end of a significant command.
TESTING:
expected message is printed.
day.
MANUAL VERIFICATION:
closes #297
Pull Request Checklist
design
folderBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license.