Skip to content

Commit 250ebcf

Browse files
committed
docs: use colons as task name separators in examples
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
1 parent 2fed5bc commit 250ebcf

1 file changed

Lines changed: 12 additions & 8 deletions

File tree

runtime/reference/cli/task.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -88,18 +88,22 @@ pattern. A wildcard pattern is specified with the `*` character.
8888
```json title="deno.json"
8989
{
9090
"tasks": {
91-
"build-client": "deno run -RW client/build.ts",
92-
"build-server": "deno run -RW server/build.ts"
91+
"build:client": "deno run -RW client/build.ts",
92+
"build:server": "deno run -RW server/build.ts"
9393
}
9494
}
9595
```
9696

97-
Running `deno task "build-*"` will run both `build-client` and `build-server`
97+
Running `deno task "build:*"` will run both `build:client` and `build:server`
9898
tasks.
9999

100+
For multi-word task names, we recommend using `:` as the separator (e.g.
101+
`build:client`, `test:unit`, `lint:fix`) to match the convention used in the
102+
npm ecosystem and to group related tasks for wildcard matching.
103+
100104
:::note
101105

102-
**When using a wildcard** make sure to quote the task name (eg. `"build-*"`),
106+
**When using a wildcard** make sure to quote the task name (eg. `"build:*"`),
103107
otherwise your shell might try to expand the wildcard character, leading to
104108
surprising errors.
105109

@@ -210,16 +214,16 @@ useful to logically group several tasks together:
210214
```json title="deno.json"
211215
{
212216
"tasks": {
213-
"dev-client": "deno run --watch client/mod.ts",
214-
"dev-server": "deno run --watch sever/mod.ts",
217+
"dev:client": "deno run --watch client/mod.ts",
218+
"dev:server": "deno run --watch server/mod.ts",
215219
"dev": {
216-
"dependencies": ["dev-client", "dev-server"]
220+
"dependencies": ["dev:client", "dev:server"]
217221
}
218222
}
219223
}
220224
```
221225

222-
Running `deno task dev` will run both `dev-client` and `dev-server` in parallel.
226+
Running `deno task dev` will run both `dev:client` and `dev:server` in parallel.
223227

224228
## Node and npx binary support
225229

0 commit comments

Comments
 (0)