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
11 lines
306 B
TypeScript
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';
|