task.ts

Declarations
#

22 declarations

view source

find_tasks
#

task.ts view source

(input_paths: InputPath[], task_root_dirs: PathId[], config: GroConfig, timings?: Timings | undefined): Promise<FindTasksResult>

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

input_paths

type InputPath[]

task_root_dirs

type PathId[]

config

timings?

type Timings | undefined
optional

returns

Promise<FindTasksResult>

FindModulesFailure
#

FindTasksResult
#

FoundTask
#

FoundTasks
#

task.ts view source

FoundTasks

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
#

is_task_path
#

load_tasks
#

task.ts view source

(found_tasks: FoundTasks, root_path?: PathId): Promise<LoadTasksResult>

found_tasks

root_path

type PathId
default process.cwd()

returns

Promise<LoadTasksResult>

LoadedTasks
#

LoadTasksFailure
#

LoadTasksResult
#

SilentError
#

task.ts view source

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>

generics

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
#

TaskError
#

task.ts view source

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

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

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

mod

type Record<string, any>

returns

boolean

Depends on
#

Imported by
#