task.ts

view source

Declarations
#

22 declarations

find_tasks
#

task.ts view source

(input_paths: InputPath[], task_root_dirs: PathId[], config: GroConfig, timings?: Timings | undefined): Promise<FindTasksResult> import {find_tasks} from '@fuzdev/gro/task.js';

Finds modules from input paths. (see input_path.ts for more)

input_paths

type InputPath[]

task_root_dirs

type PathId[]

config

timings?

type Timings | undefined
optional

returns

Promise<FindTasksResult>

FindModulesFailure
#

task.ts view source

FindModulesFailure import type {FindModulesFailure} from '@fuzdev/gro/task.js';

FindTasksResult
#

task.ts view source

FindTasksResult import type {FindTasksResult} from '@fuzdev/gro/task.js';

FoundTask
#

task.ts view source

FoundTask import type {FoundTask} from '@fuzdev/gro/task.js';

input_path

type InputPath

id

type PathId

task_root_dir

type PathId

FoundTasks
#

task.ts view source

FoundTasks import type {FoundTasks} from '@fuzdev/gro/task.js';

resolved_input_files

type Array<ResolvedInputFile>

resolved_input_files_by_root_dir

type Map<PathId, Array<ResolvedInputFile>>

resolved_input_paths

type Array<ResolvedInputPath>

input_paths

type Array<InputPath>

task_root_dirs

type Array<PathId>

InvokeTask
#

task.ts view source

InvokeTask import type {InvokeTask} from '@fuzdev/gro/task.js';

(call)

type (task_name: string, args?: Args | undefined, config?: GroConfig | undefined): Promise<void>

task_name

type string

args?

type Args | undefined
optional

config?

type GroConfig | undefined
optional
returns Promise<void>

is_task_path
#

task.ts view source

(path: string): boolean import {is_task_path} from '@fuzdev/gro/task.js';

path

type string

returns

boolean

load_tasks
#

task.ts view source

(found_tasks: FoundTasks, root_path?: PathId): Promise<LoadTasksResult> import {load_tasks} from '@fuzdev/gro/task.js';

found_tasks

root_path

type PathId
default process.cwd()

returns

Promise<LoadTasksResult>

LoadedTasks
#

task.ts view source

LoadedTasks import type {LoadedTasks} from '@fuzdev/gro/task.js';

modules

type Array<TaskModuleMeta>

found_tasks

type FoundTasks

LoadTasksFailure
#

task.ts view source

LoadTasksFailure import type {LoadTasksFailure} from '@fuzdev/gro/task.js';

LoadTasksResult
#

task.ts view source

LoadTasksResult import type {LoadTasksResult} from '@fuzdev/gro/task.js';

SilentError
#

task.ts view source

import {SilentError} from '@fuzdev/gro/task.js';

This is used to tell Gro to exit silently, usually still with with a non-zero exit code. Using it means error logging is handled by the code that threw it.

inheritance

extends: Error

Task
#

task.ts view source

Task<TArgs, TArgsSchema, TReturn> import type {Task} from '@fuzdev/gro/task.js';

generics

Task<TArgs = Args, TArgsSchema extends z.ZodType<Args, Args> = z.ZodType<Args, Args>, TReturn = unknown>
TArgs
default Args
TArgsSchema
constraint z.ZodType<Args, Args>
default z.ZodType<Args, Args>
TReturn
default unknown

run

type (ctx: TaskContext<TArgs>) => TReturn | Promise<TReturn>

summary?

type string

Args?

type TArgsSchema

TASK_FILE_SUFFIX_JS
#

TASK_FILE_SUFFIX_TS
#

TASK_FILE_SUFFIXES
#

TaskContext
#

task.ts view source

TaskContext<TArgs> import type {TaskContext} from '@fuzdev/gro/task.js';

generics

TaskContext<TArgs = object>
TArgs
default object

args

type TArgs

config

type GroConfig

svelte_config

type ParsedSvelteConfig

filer

type Filer

log

type Logger

timings

type Timings

invoke_task

type InvokeTask

TaskError
#

task.ts view source

import {TaskError} from '@fuzdev/gro/task.js';

This is used by tasks to signal a known failure. It's useful for cleaning up logging because we usually don't need their stack trace.

inheritance

extends: Error

TaskModule
#

TaskModuleMeta
#

task.ts view source

TaskModuleMeta import type {TaskModuleMeta} from '@fuzdev/gro/task.js';

inheritance

extends: ModuleMeta<TaskModule>

name

type string

to_task_name
#

task.ts view source

(id: PathId, task_root_dir: PathId, input_path: InputPath, root_path: PathId): string import {to_task_name} from '@fuzdev/gro/task.js';

id

type PathId

task_root_dir

type PathId

input_path

root_path

type PathId

returns

string

validate_task_module
#

task.ts view source

(mod: Record<string, any>): mod is TaskModule import {validate_task_module} from '@fuzdev/gro/task.js';

mod

type Record<string, any>

returns

boolean

Depends on
#

Imported by
#