Conversation
| stdoutLastIndex = Math.max(stdoutLastIndex, re.lastIndex); | ||
| } else if (re.test(this._stderr)) { | ||
| stderrLastIndex = Math.max(stderrLastIndex, re.lastIndex); | ||
| deferred.resolve(); |
There was a problem hiding this comment.
make the order of these two lines match above?
| for (const {re, deferred} of this._logMatchers) { | ||
| if (re.test(this._stdout)) { | ||
| deferred.resolve(); | ||
| stdoutLastIndex = Math.max(stdoutLastIndex, re.lastIndex); |
There was a problem hiding this comment.
Do you ever reset re.lastIndex? Since the RE's with /g or /y flags are stateful, you can get bad behavior if you reuse a regex. Or will you recommend not using those flags in docs?
There was a problem hiding this comment.
Hm yeah. Actually using lastIndex was completely wrong anyway, because it's only set when the g or s flags are on.
Switched to using exec (so that we always get one match even if the g flag was used), and checking the index + length, instead of lastIndex.
I also noticed we weren't removing matchers after they matched. We don't care about lastIndex now because it can only match once.
| const result = await this.getExecution(this._rootConfig).execute(); | ||
| // Wait for services to shut down. | ||
| // TODO(aomarks) In watch mode, directly-invoked scripts (and the services | ||
| // they depend on) should not block here, since they should continue |
There was a problem hiding this comment.
Is this always the case? Should some services restart in watch mode depending onhow they use their dependencies and files?
There was a problem hiding this comment.
In watch mode, the directly invoked services will get passed off to the next iteration's execution, which will decide whether to shut down or preserve the child processes.
More incremental progress on services:
Also:
Part of #33