Skip to content

🍳 Extends deno task runner with multiline commands, flags descriptors, descriptions and even more!

License

Notifications You must be signed in to change notification settings

lowlighter/deno_make

Repository files navigation

🍳🦕 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

Advanced task configuration

List available tasks

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

1️⃣ Register deno make in deno.jsonc

// 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"
  }
}

2️⃣ Configure deno_make tasks in deno.jsonc

// 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> to deno 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

About

🍳 Extends deno task runner with multiline commands, flags descriptors, descriptions and even more!

Resources

License

Stars

Watchers

Forks