From 250ebcf16f1932a4b45b7c0e4f1c7910ec0cea0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Thu, 21 May 2026 12:44:15 +0200 Subject: [PATCH] docs: use colons as task name separators in examples MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Updates task naming examples to use colons (e.g. `build:client`, `dev:server`) instead of hyphens, following the convention used in the npm ecosystem and the rest of the Deno docs. Adds a short note recommending the colon separator, and fixes an existing typo ("sever" → "server") in the dev-server example. Ref #2989 --- runtime/reference/cli/task.md | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/runtime/reference/cli/task.md b/runtime/reference/cli/task.md index f686a6770..76f724761 100644 --- a/runtime/reference/cli/task.md +++ b/runtime/reference/cli/task.md @@ -88,18 +88,22 @@ pattern. A wildcard pattern is specified with the `*` character. ```json title="deno.json" { "tasks": { - "build-client": "deno run -RW client/build.ts", - "build-server": "deno run -RW server/build.ts" + "build:client": "deno run -RW client/build.ts", + "build:server": "deno run -RW server/build.ts" } } ``` -Running `deno task "build-*"` will run both `build-client` and `build-server` +Running `deno task "build:*"` will run both `build:client` and `build:server` tasks. +For multi-word task names, we recommend using `:` as the separator (e.g. +`build:client`, `test:unit`, `lint:fix`) to match the convention used in the +npm ecosystem and to group related tasks for wildcard matching. + :::note -**When using a wildcard** make sure to quote the task name (eg. `"build-*"`), +**When using a wildcard** make sure to quote the task name (eg. `"build:*"`), otherwise your shell might try to expand the wildcard character, leading to surprising errors. @@ -210,16 +214,16 @@ useful to logically group several tasks together: ```json title="deno.json" { "tasks": { - "dev-client": "deno run --watch client/mod.ts", - "dev-server": "deno run --watch sever/mod.ts", + "dev:client": "deno run --watch client/mod.ts", + "dev:server": "deno run --watch server/mod.ts", "dev": { - "dependencies": ["dev-client", "dev-server"] + "dependencies": ["dev:client", "dev:server"] } } } ``` -Running `deno task dev` will run both `dev-client` and `dev-server` in parallel. +Running `deno task dev` will run both `dev:client` and `dev:server` in parallel. ## Node and npx binary support