guybedford / chomp

'JS Make' - parallel task runner for the frontend ecosystem with a JS extension system.
https://chompbuild.com
Apache License 2.0
138 stars 7 forks source link

Directory targets should invalidate subtargets #76

Closed guybedford closed 2 years ago

guybedford commented 2 years ago

When a target is a directory, and that target completes, any subtargets of that target should have their mtimes updated based on the task that created the directory. As a result this should effectively stop the subtargets from applying if they've been defined by the directory target.

The use case here is npm installs where there is the npm install operation and an npm install pkg@v operation, where the npm install target is node_modules and package-lock.json and the npm install pkg@v target is package-lock.json and node_modules/pkg. If the npm install is running and the npm install pkg@v depends on it, then the npm install pkg@v should be able to be preemptively stopped by the npm install task.

Another way to implement this might be to simply lazily compute mtimes after dependencies have finished processing.

guybedford commented 2 years ago

This is a bit too complex for now, instead one or the other applies in the npm extension.