BuiltinTaskEntry import type {BuiltinTaskEntry} from '@fuzdev/gro/task_registry.js'; A builtin task with the summary gro lists it by.
inheritance
summary
type string
11 declarations
BuiltinTaskEntry import type {BuiltinTaskEntry} from '@fuzdev/gro/task_registry.js'; A builtin task with the summary gro lists it by.
summarytype string
(fs_paths: FsPaths): GenConfig import {gen_task_registry} from '@fuzdev/gro/task_registry.js'; Creates the genfile config that types a project's tasks for invoke_task.
Export it as gen from a genfile like src/gro_tasks.gen.ts,
export const gen = gen_task_registry(create_fs_paths(fs));,
which writes src/gro_tasks.ts augmenting ProjectTasks
with every task file under src/, keyed by its path relative to the project root.
In gro dev it regenerates when a task file is added or changed;
gro dev ignores deletes, so run gro gen after removing a task.
fs_pathssearches the project's src/, its project the root the tasks are keyed relative to
GenConfig ProjectTasks import type {ProjectTasks} from '@fuzdev/gro/task_registry.js'; The project's own tasks by normalized path, empty until augmented by a generated file.
Create a genfile like src/gro_tasks.gen.ts exporting gen_task_registry(create_fs_paths(fs))
as gen to type the project's task paths and args for invoke_task.
(fs_paths: FsPaths, dir: PathId, search_filters: PathFilter[], root?: PathId): Promise<TaskRegistryEntry[]> import {task_registry_find} from '@fuzdev/gro/task_registry.js'; Finds the task files under dir, named by their paths relative to root,
the names invoke_task and gro task give them, sorted by name.
fs_pathssearches dir
dirthe directory to search, absolute or relative to the project of fs_paths
PathIdsearch_filtersthe filters each file and directory must pass, given paths relative to root,
or to dir for the paths outside root
PathFilter[]root?the project root the names and filtered paths are relative to,
defaults to the project of fs_paths
PathIdfs_paths.project.pathPromise<TaskRegistryEntry[]>
(src_lib: FsReadDir): Promise<BuiltinTaskEntry[]> import {task_registry_find_builtins} from '@fuzdev/gro/task_registry.js'; Finds Gro's builtin tasks, the *.task.ts files directly in src_lib,
importing each to read its summary.
src_libGro's src/lib/
Promise<BuiltinTaskEntry[]>
(entries: BuiltinTaskEntry[], output_dir: PathId, origin_path: string): string import {task_registry_render_builtins} from '@fuzdev/gro/task_registry.js'; Renders the GroBuiltinTasks interface for Gro's own tasks and their summaries, so listing them imports no task module.
entriesBuiltinTaskEntry[]output_dirPathIdorigin_pathstringstring (entries: TaskRegistryEntry[], output_dir: PathId, origin_path: string): string import {task_registry_render_project} from '@fuzdev/gro/task_registry.js'; Renders the module augmentation of ProjectTasks written by gen_task_registry.
entriesTaskRegistryEntry[]output_dirPathIdorigin_pathstringstring TaskArgsInput<TName> type TaskRegistry[TName] extends { Args: infer TSchema extends AnySchema; } ? InferInput<TSchema> extends infer TInput ? TInput extends unknown ? [keyof TInput] extends [never] ? Record<string, never> : TInput : never : never : Args
import type {TaskArgsInput} from '@fuzdev/gro/task_registry.js'; The input type of the task's Args schema, so defaulted args are optional,
or loose Args for a task module without an Args export.
A member of the input with no keys becomes Record<string, never>,
so an arg-less task refuses every arg, and a union keeps each option's keys.
TaskArgsInput<TName extends TaskName>TNameTaskName type "run" | "build" | "changeset" | "check" | "clean" | "commit" | "deploy" | "dev" | "format" | "gen" | "lint" | "publish" | "reinstall" | "release" | "sync" | "test" | "typecheck" | "upgrade" | "fixture/clean.task.ts" | "fixture/no_args.task.ts" | "fixture/required_args.task.ts" | "fixture/union_args.task.ts"
import type {TaskName} from '@fuzdev/gro/task_registry.js'; A builtin name or project task path in TaskRegistry, the literals invoke_task checks.
TaskRegistry type GroBuiltinTasks & ProjectTasks
import type {TaskRegistry} from '@fuzdev/gro/task_registry.js'; Every task invoke_task types, mapped to its module's type:
Gro's builtins by name and the project's tasks by path relative to the project root.
Names never contain a / or end in a task suffix and paths always do, so nothing shadows.
buildtype typeof import("build.task.ts", { with: { "resolution-mode": "import" } })
changesettype typeof import("changeset.task.ts", { with: { "resolution-mode": "import" } })
checktype typeof import("check.task.ts", { with: { "resolution-mode": "import" } })
cleantype typeof import("clean.task.ts", { with: { "resolution-mode": "import" } })
committype typeof import("commit.task.ts", { with: { "resolution-mode": "import" } })
deploytype typeof import("deploy.task.ts", { with: { "resolution-mode": "import" } })
devtype typeof import("dev.task.ts", { with: { "resolution-mode": "import" } })
formattype typeof import("format.task.ts", { with: { "resolution-mode": "import" } })
gentype typeof import("gen.task.ts", { with: { "resolution-mode": "import" } })
linttype typeof import("lint.task.ts", { with: { "resolution-mode": "import" } })
publishtype typeof import("publish.task.ts", { with: { "resolution-mode": "import" } })
reinstalltype typeof import("reinstall.task.ts", { with: { "resolution-mode": "import" } })
releasetype typeof import("release.task.ts", { with: { "resolution-mode": "import" } })
runtype typeof import("run.task.ts", { with: { "resolution-mode": "import" } })
synctype typeof import("sync.task.ts", { with: { "resolution-mode": "import" } })
testtype typeof import("test.task.ts", { with: { "resolution-mode": "import" } })
typechecktype typeof import("typecheck.task.ts", { with: { "resolution-mode": "import" } })
upgradetype typeof import("upgrade.task.ts", { with: { "resolution-mode": "import" } })
fixture/clean.task.tstype typeof import("src/test/fixtures/task_registry/clean_override.task_fixture.ts", { with: { "resolution-mode": "import" } })
fixture/no_args.task.tstype typeof import("src/test/fixtures/task_registry/no_args.task_fixture.ts", { with: { "resolution-mode": "import" } })
fixture/required_args.task.tstype typeof import("src/test/fixtures/task_registry/required_args.task_fixture.ts", { with: { "resolution-mode": "import" } })
fixture/union_args.task.tstype typeof import("src/test/fixtures/task_registry/union_args.task_fixture.ts", { with: { "resolution-mode": "import" } })
TaskRegistryEntry import type {TaskRegistryEntry} from '@fuzdev/gro/task_registry.js'; nameThe builtin name, or the project task's path relative to the project root.
type string
idtype PathId