-
Notifications
You must be signed in to change notification settings - Fork 2
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
CPP-782 Add nodemon plugin #176
Conversation
b810d65
to
a1326fc
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.
Very excited for this to release, thanks!
I haven't done an in-depth review but, while I was investigating how you got this working, I spotted a few potential issues/improvements. Please don't consider the nitpick to be blocking, as tbh it could come down to tool kit code style which I'm not familiar with.
}) | ||
const nodemonLogger = this.logger.child({ process: 'nodemon' }) | ||
nodemon.on('log', (msg) => { | ||
function nodemonToWinstonLogLevel(level: string): string { |
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.
nitpick: I don't think this will have a particularly negative impact if it's not addressed, but this function is redefined each time nodemon
logs. It's maybe a bit of a micro-optimisation to move it out of here though so happy if you want to ignore.
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 have a habit of embedding throwaway functions like this right next to the code that uses it so that you don't have to jump around too much when reading the code. It's the kind of thing that I'd hope V8 will optimise away at runtime though, especially when it's not even using any closure state! Maybe that's too optimistic haha I have no idea about the engine's internals
a1326fc
to
3eb2d96
Compare
d060a41
to
daf908d
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.
it looks good to @leannecornish-ft and I, we have a couple of non blocking nitpicks but this is good to merge
This plugin provides a task that can be used in place of the Node plugin and will restart the running process if there are file changes in the directory or if the process exits unexpectedly. Will respect the configuration specified in a nodemon.json in $CWD or $HOME.
Allow users to override the location of the nodemon config from its default location in either the $PWD or $HOME directory.
daf908d
to
f56a8ba
Compare
This plugin provides a task that can be used in place of the Node plugin and will restart the running process if there are file changes in the directory or if the process exits unexpectedly. Will respect the configuration specified in a
nodemon.json
in$CWD
,$HOME
, or the location specified by theconfigPath
option.I figured there was big enough difference in code to justify splitting this out into a new module rather than just being an option you could toggle in a
.toolkitrc.yml
. Splitting the plugins also means that we do not force consumers to install thenodemon
package when they just want to install the Node plugin.