-
Notifications
You must be signed in to change notification settings - Fork 1.1k
refactor commands handling #12237
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
refactor commands handling #12237
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.
create-cloudflare
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-pool-workers
@cloudflare/workers-editor-shared
@cloudflare/workers-utils
wrangler
commit: |
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.
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.
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.
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.
petebacondarwin
left a comment
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.
LGTM with a few nits
| properties.sanitizedCommand === "docs" | ||
| ) { | ||
| if (cmdBehaviour?.printMetricsBanner === true) { | ||
| // printMetricsBanner can throw |
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.
Is this comment needed? There are plenty of function calls throughout the codebase that can throw and we don't call that out.
If this comment is particularly relevant then we should say why it could throw and why we need to know that here.
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.
I think it is.
My initial version move printMetricsBanner outside of the try/catch because why would printing throw?
we should say why it could throw
Good point and why I added JSDoc on that function ;)
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.
Also #12237 (comment)
1265ddb to
ee6e114
Compare
Fixes #12029
3 commits in this PR:
printBannerNote about the third commit: we should probably only be sending ms but I don't want this PR to change the current behavior. I'll follow up with another PR.
/cc @MattieTK
A picture of a cute animal (not mandatory, but encouraged)