char/avril

(wip) why'd you have to go and make things so complicaaaaated?

git clone https://git.t4t.associates/char/avril

Charlotte Somextract avril-task crate + add avril:task module7f4058a

main
904 B31 linesraw
1import { runTasks, type TaskReport } from "avril:task";
2
3const report: TaskReport = await runTasks({
4  page: {
5    command: ["avril", "run", "render.ts", "a b.md"],
6    files: "content/**",
7    output: ["dist/a.html"],
8  },
9  feed: {
10    run: async (ctx) => {
11      const root: string = ctx.root;
12      void root;
13    },
14    dependencies: ["page"],
15  },
16  all: { dependencies: ["page", "feed"], parallel: true },
17}, { target: "all", watch: false });
18
19const ok: boolean = report.ok;
20const code: number = report.code;
21const checked: void = report.throwIfFailed();
22void ok;
23void code;
24void checked;
25
26// @ts-expect-error run must be a function.
27await runTasks({ bad: { run: "true" } });
28// @ts-expect-error Task definitions are objects, not strings.
29await runTasks({ bad: "true" });
30// @ts-expect-error files is a string or string array, not a number.
31await runTasks({ bad: { command: "true", files: 3 } });