đŗđĻ deno make
deno make integrates seemlessly with your existing deno.jsonc
configuration file to provide an extended set of
features to the deno task runner.
đ Features
- Seamless integration with your existing
deno.jsonc
configuration file - Set flags per deno subcommands in a descriptive way
- Set or inherit environment variables
- Write long tasks using arrays to improve readability
- Add descriptions to your tasks
- List and preview available tasks
- Replace positional and arguments easily
Learn more about the syntax in demo/deno.jsonc
!
đ But why ?
The default deno task runner is great, but long tasks can quickly become hard to read and maintain. This small script aims to solve this issue by providing a few extra features for convenience.
đ Usage
deno.jsonc
1ī¸âŖ Register deno make in // deno.jsonc
{
"tasks": {
// đ§ Alias deno_make to `deno task make` to make it easier
"make": "deno run --allow-env --allow-read --allow-write=.deno-make.json --allow-run=deno https://deno.land/x/make/mod.ts $0"
}
}
deno.jsonc
2ī¸âŖ Configure deno_make tasks in // deno.jsonc
{
// đŗ deno_make configuration
"+tasks": {
"start": { // âļī¸ `deno task make start`
"description": "đą Start application",
"task": "deno run mod.ts",
"deno": { // ⨠Configure deno flags in a descriptive way
"run": { // âī¸ `deno run`
"unstable": ["kv"], // âĄī¸ --unstable-kv
"permissions": {
"read": true, // âĄī¸ --allow-read
"run": false, // âĄī¸ --deny-run
"net": [ // âĄī¸ --allow-net=https://deno.land,https://example.com
"https://deno.land",
"https://example.com"
],
"prompt": false // âĄī¸ --no-prompt
}
}
},
"env": { // ⨠Configure environment variables directly
"FOO": true, // âĄī¸ Inherit current FOO environment variable
"BAR": "bar" // âĄī¸ Set BAR environment variable to "bar"
}
}
}
}
âšī¸ It is even possible to alias
deno task make <+task>
todeno task <+task>
!// deno.jsonc { "tasks": { "start": "deno task make start", "test": "deno task make test" } }
3ī¸âŖ Run tasks with deno_make
deno task make <+task>
âšī¸ If deno_make was aliased back to
deno task
, just use the following instead:deno task start
To print the list of available tasks with their configuration, run deno_make without arguments:
deno task make
đ License
MIT License
Copyright (c) 2023 Simon Lecoq