🍳🦕 deno make
deno make integrates seemlessly within your deno.jsonc
configuration file to provide an extended set of features to
the deno task runner.
You can assign default permissions and flags to deno subcommands, environment variables, assign descriptions and more.
💭 Why ?
While the default deno task runner is great, it is not always suitable for long scripts as it's not possible to split them into multiple lines, and passing flags to deno subcommands is often tedious.
deno make solves these issues by computing dynamically deno commands flags before calling the default deno task runner, in addition to providing a few extra features.
📚 Usage
deno.jsonc
1. Register deno make in // deno.jsonc
{
"tasks": {
"make": "deno run --allow-env --allow-read --allow-write=.deno-make.json --allow-run=deno https://deno.land/x/make/mod.ts $0"
}
}
"deno-make"
tasks in deno.jsonc
2. Configure // deno.jsonc
{
"+tasks": {
"start": {
"description": "🍱 Start application",
"task": "deno run mod.ts",
"deno": {
"run": { // For "deno run" subcommand
"unstable": true, // ➡️ --unstable
"permissions": {
"prompt": false, // ➡️ --no-prompt
"read": true, // ➡️ --allow-read
"run": false, // ➡️ --deny-run
"net": [ // ➡️ --allow-net=https://deno.land,https://example.com
"https://deno.land",
"https://example.com"
],
"write": { // ➡️ --allow-write=/tmp --deny-write=/root
"allow": [
"/tmp"
],
"deny": [
"/root"
]
}
}
}
},
// Configure environment variables
"env": {
"FOO": true, // ➡️ Inherit FOO environment variable
"BAR": "bar" // ➡️ Set BAR environment variable to "bar"
}
},
// Write "multi-line" tasks using arrays (they will be joined with "\n")
"test": {
"description": "🧪 Run tests and print collected coverage",
"task": [
"rm -rf .coverage &&",
"deno test &&",
"deno coverage .coverage"
],
"deno": {
"test": { // For "deno test" subcommand
"unstable": true, // ➡️ --unstable
"permissions": { // ➡️ --allow-all
"all": true
},
"coverage": ".coverage", // ➡️ --coverage=.coverage
"parallel": true // ➡️ --parallel
},
"coverage": { // For "deno coverage" subcommand
"quiet": true // ➡️ --quiet
}
}
}
}
}
deno task make
instead
3. Run tasks with deno task make run
Print all available deno make tasks
deno task make