Import
import {
deriveTaskId,
discoverProjectTaskRuntime,
discoverTasks,
findProjectRuntimeTask,
findTaskById,
formatProjectRuntimeDiscoveryErrors,
} from "veryfront/task";
Examples
Define a task in tasks/sync-data.ts
import type { TaskContext } from "veryfront/task";
export default {
name: "Sync external data",
async run(ctx: TaskContext) {
return { synced: 42 };
},
};
Exports
Functions
| Name | Description | Source |
|---|---|---|
deriveTaskId | Derive task ID from file path (e.g., “tasks/sync-data.ts” -> “sync-data”). | source |
discoverProjectTaskRuntime | source | |
discoverTasks | Discover all tasks in a project with the legacy file-based path. | source |
findProjectRuntimeTask | source | |
findTaskById | Find a specific task by ID through the legacy file-based path. | source |
formatProjectRuntimeDiscoveryErrors | source | |
isTaskDefinition | Type guard: checks if a value looks like a TaskDefinition | source |
listProjectRuntimeTasks | source | |
runTask | Run a task with the given options | source |
Types
| Name | Description | Source |
|---|---|---|
DiscoveredTask | Discovered task info. | source |
ProjectTaskRuntimeOptions | source | |
RunnableTask | source | |
RunTaskOptions | Options for running a task | source |
TaskContext | Context passed to task run() function | source |
TaskDefinition | Task definition exported from a tasks/ file | source |
TaskDiscoveryOptions | Options for file-based task discovery. | source |
TaskDiscoveryResult | Result of file-based task discovery. | source |
TaskRunResult | Result of running a task | source |