nx-remotecache-custom
nx-remotecache-custom copied to clipboard
Console output not appending succesful tasks
This is a follow-up on a bug report for the package @pellegrims/nx-remotecache-s3, which is depending on this awesome library.
The issue is about the console output with the custom task runner not appending succesful job results to previous results as is the case for the default task runner in nx > v14.
I was wondering if you encounter the same issue on other packages depending on nx-remotecache-custom? Any clue what causes this behavior?
Well I guess it's because the plugin is directly writing to the console, while Nx itself is using line replacement for keeping the progress up to date. As an intermediate fix you can turn on silent
to disable any output from the plugin. For a longterm fix, I'll have to check different ways of displaying whether it was a cache-hit, or not.
Also great to see that there are other nx-remotecache
packages, which are using this package! I didn't know about this s3
implementation until now 🚀 👍
Also great to see that there are other
nx-remotecache
packages, which are using this package! I didn't know about thiss3
implementation until now rocket +1
I recently found out even Vercel is using it: https://github.com/vercel/remote-cache/tree/main/packages/remote-nx :partying_face:
I find myself manually patching node_modules/nx-remotecache-custom/log.js
, to replace
const log = console.log
with
const log = () => {}
to have cleaner log output. I'd be happy to contribute a silent mode, if you tell me how you'd like it to look like (configuration? environment variable?)
@cuddlecake at the bottom of the readme there is the silent option displayed:
// nx.json
"tasksRunnerOptions": {
"default": {
"options": {
"name": "My Storage",
"silent": true
}
}
}
I tried it with silent, but the output still looks like this:
Whereas I would have hoped for just one chunk like this, that continuously updates.
I get this only when I replace the log
with a noop function.
Got it, I'll check it 👍
+1 it would be nice to get the original output formatting with this awesome library
+1 would love to have a non-polluted dev console but still capture the critical info. I've peeked into how to accomplish this to little success...it is possible to hook into the nx output by using:
const nxOutput = require("nx/src/utils/output");
Much like Lerna does. But even given that, I'm not totally sure how that would be useful since it's trying to produce logs whereas Lerna is just hack overriding stuff.
A viable approach might be to accumulate the cache status in a singleton, and then output it by overriding one of the methods so that you could add info...but still a little wonky