Skip to content

ssg-test-202604171655: fix(*): prevent logger from polluting build output with node_modules

Choose a tag to compare

@Aquaticat Aquaticat released this 17 Apr 20:55
· 2522 commits to main since this release
The file sink wrote logs to `node_modules/.monochromatic/` relative to
`process.cwd()`. When a script ran with cwd inside a build output tree
(e.g. `dist/`), it created a stray `node_modules/` there that subsequent
archive/compress steps packaged up.

- module-es: walk up from cwd to the nearest ancestor `node_modules/`
  instead of anchoring to cwd. When no ancestor exists, mark the sink
  unavailable and emit a warning rather than creating one in place.
- module-es: memoize the in-flight verification promise so concurrent
  callers share a single result; the previous `verified = true` flag
  flipped synchronously at entry and caused late callers to observe
  the initial `available = false` before the async work settled.
- module-es: add tests covering find-up hit/miss and the concurrent-
  verify regression.
- ssg-test: add a `build:clean` task that wipes `dist/` before rebuild
  so any stray artifacts from one session cannot survive into the next
  build's compressed output.