Skip to content

feat: deno task dependencies should allow passing additional arguments #27870

@BlackAsLight

Description

@BlackAsLight

A few versions ago we were allowed to change our tasks in deno.json from just a string of concatenated commands to an object that lists dependencies to be ran before the command. At the moment though these dependant tasks can only be executed as is. It would be nice if we could pass additional flags to it while still keeping that parallelism this change enabled.

Example

In this below example, deno task cov shows what I'm asking. Where both coverage and clean flags are passed to it. Allowing them to only be generated if viewing the coverage is desired.

{
  "tasks": {
    "cov": {
      "command": "deno coverage --html .coverage/",
      "dependencies": ["test --coverage='.coverage/' --clean"]
    },
    "cov:mac": {
      "command": "open .coverage/html/index.html",
      "dependencies": ["cov"]
    },
    "cov:lin": {
      "command": "xdg-open .coverage/html/index.html",
      "dependencies": ["cov"]
    },
    "cov:win": {
      "command": "start .coverage/html/index.html",
      "dependencies": ["cov"]
    },
    "test": "deno test -R='.output/' -W='.output/' --parallel --trace-leaks --reporter=dot",
    "lint": "deno lint",
    "fmt": "deno fmt",
    "ok": { "command": "deno task test --doc", "dependencies": ["fmt", "lint"] }
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions