I do something weird here! In general, I find dealing with tasks.json
cumbersome. So, I have just a single global tasks, that runs ./make.ts
file in the root of the repository:
{
"version": "2.0.0",
"tasks": [
{
"label": "make.ts",
"type": "shell",
"command": "${workspaceFolder}/make.ts",
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared",
"showReuseMessage": false,
"clear": true
},
"group": "build",
"problemMatcher": {
"owner": "make.ts",
"fileLocation": [
"autoDetect",
"${workspaceFolder}"
],
"pattern": {
"regexp": "^(ok\\.)?(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
"file": 2,
"line": 3,
"column": 4,
"severity": 5,
"message": 6
}
}
}
]
}
And then in the root of my repo I have make.ts
which looks like this:
#!/usr/bin/env -S deno run --allow-all
// @ts-nocheck
import $ from "jsr:@david/dax";
await $`./zig/zig build vopr -- 18257197606457810748`;
So, if I need to run something specific, I just go and edit make.ts
to spawn the commands I need.
I use deno
and the dax
library as that’s my preferred way to script things, but are more reasonable person would probably stick to just make.sh
. Alternatively, replacing deno
with bun
would also be reasonable: bun is Zig, it starts up a bit faster, and it has $
built-in.