diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2024-11-19 07:45:09 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-19 12:45:09 +0000 |
commit | 661aa22c03f829489e2d9289dee0a8292a95227a (patch) | |
tree | b16f4a37f2f221540f1b22f986f5c58eb19cc913 /tests/specs/task/dependencies/util.js | |
parent | 069bc15030225393f7d05521505316066464bdbd (diff) |
feat(task): dependencies (#26467)
This commit adds support for "dependencies" in `deno task` subcommand:
```jsonc
{
"tasks": {
"build": "deno run -RW build.ts",
"generate": "deno run -RW generate.ts",
"serve": {
"command": "deno run -RN server.ts",
"dependencies": ["build", "generate"]
}
}
}
```
Executing `deno task serve` will first execute `build` and `generate`
tasks (in parallel) and once both complete the `serve` task will be executed.
Number of tasks run in parallel is equal to the no of cores on the
machine, and respects `DENO_JOBS` env var if one is specified.
Part of https://github.com/denoland/deno/issues/26462
---------
Co-authored-by: Bartek IwaĆczuk <biwanczuk@gmail.com>
Co-authored-by: Marvin Hagemeister <marvin@deno.com>
Diffstat (limited to 'tests/specs/task/dependencies/util.js')
-rw-r--r-- | tests/specs/task/dependencies/util.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/specs/task/dependencies/util.js b/tests/specs/task/dependencies/util.js new file mode 100644 index 000000000..9579eb9c9 --- /dev/null +++ b/tests/specs/task/dependencies/util.js @@ -0,0 +1,4 @@ +export async function randomTimeout(min, max) { + const timeout = Math.floor(Math.random() * (max - min + 1) + min); + return new Promise((resolve) => setTimeout(resolve, timeout)); +} |