@plugjs/plug
Version:
PlugJS Build System ===================
25 lines • 1.22 kB
JavaScript
import { $gry, $und, $ylw } from "../logging.js";
import { install } from "../pipe.js";
/* ========================================================================== *
* INSTALLATION / IMPLEMENTATION *
* ========================================================================== */
/** Writes some info about the current {@link Files} being passed around. */
install('debug', class Debug {
_title;
constructor(...args) {
const [title = 'Debugging'] = args;
this._title = title;
}
async pipe(files, context) {
context.log.notice(this._title, `${$gry('(')}${$ylw(files.length)} ${$gry('files)')}`);
context.log.notice('- build file dir:', $gry($und(context.resolve('@'))));
context.log.notice('- current dir:', $gry($und(context.resolve('.'))));
context.log.notice('- files dir:', $gry($und(files.directory)));
const paths = [...files];
const path = paths.shift();
context.log.notice('- relative paths:', $und($gry(path)));
paths.forEach((p) => context.log.notice('- :', $und($gry(p))));
return files;
}
});
//# sourceMappingURL=debug.js.map