sitegen/framework/lib/testing.ts
chloe caruso 66da129036 rewrite incremental.ts (#21)
the problems with the original implementation was mostly around error
handling. sources had to be tracked manually and provided to each
incremental output. the `hasArtifact` check was frequently forgotten.
this has been re-abstracted through `incr.work()`, which is given an
`io` object. all fs reads and module loads go through this interface,
which allows the sources to be properly tracked, even if it throws.

closes #12
2025-08-02 20:56:36 -04:00

11 lines
306 B
TypeScript

export function tmpFile(basename: string) {
const file = path.join(import.meta.dirname, '../../.clover/testing', basename);
return {
path: file,
read: fs.readFile.bind(fs, file),
write: fs.writeMkdir.bind(fs, file),
};
}
import * as path from 'node:path';
import * as fs from './fs.ts';