Function: scope()
scope(
children):object
Defined in: builders/scope.ts:28
Creates a logical grouping of tasks or nested scopes. This helps organize your ICE configuration into namespaces.
Parameters
| Parameter | Type | Description |
|---|---|---|
children | TaskTree | A record mapping names to Task or Scope objects. |
Returns
object
A Scope object containing the children.
| Name | Type | Default value | Defined in |
|---|---|---|---|
_tag | "scope" | - | builders/scope.ts:30 |
children | TaskTree | - | builders/scope.ts:35 |
description | string | "Scope" | builders/scope.ts:33 |
id | symbol | - | builders/scope.ts:31 |
tags | never[] | [] | builders/scope.ts:32 |
Example
typescript
import { scope, task } from "@ice.ts/runner"
const reset = task().run(() => console.log("reset")).make()
const seed = task().run(() => console.log("seed")).make()
export const db = scope({
reset,
seed
})
// Usage: ice run db:reset