-
Notifications
You must be signed in to change notification settings - Fork 52
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
CLI - codegen command now supports the --watch
option
#1584
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 a great feature! Very cool stuff. 😁
const execute = async (): Promise<boolean> => { | ||
let result = false; | ||
|
||
try { |
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 is already a try-catch block within codeGenerator.generate()
that catches and logs any errors, so the try-catch block in codegen.ts
will log the errors a second time.
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.
Hmmm, this try/catch logic is also in the build command. Honestly I think it's alright to log more than once, and it might be best to remove the try/catch from within the lib
layer. Thoughts?
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.
Yeah, either way is good. I prefer removing the try-catch from the lib layer if there are no side effects from doing that, but I'd also be happy merging this as-is.
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.
Looks great! Waiting for @krisbitney's approval regarding logging practices.
Resolves #1459
You can now run
npx polywrap codegen --watch
which will automatically watch files within your project directory and re-run codegen whenever changes are detected.