task_registry.ts

view source

Declarations
#

9 declarations

gen_task_registry
#

task_registry.ts view source

GenConfig import {gen_task_registry} from '@fuzdev/gro/task_registry.js';

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, which writes src/gro_tasks.ts augmenting ProjectTasks. 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.

ProjectTasks
#

task_registry.ts view source

ProjectTasks import type {ProjectTasks} from '@fuzdev/gro/task_registry.js';

The project's own tasks by name, empty until augmented by a generated file. Create a genfile like src/gro_tasks.gen.ts exporting gen_task_registry as gen to type the project's task names and args for invoke_task.

task_registry_find
#

task_registry.ts view source

(task_root_dirs: PathId[], search_filters: PathFilter[]): Promise<TaskRegistryEntry[]> import {task_registry_find} from '@fuzdev/gro/task_registry.js';

Finds the tasks in task_root_dirs with the names runtime resolution gives them, skipping Gro's builtins, which GroBuiltinTasks types. A file or name found under an earlier root dir shadows later ones, like resolution.

task_root_dirs

type PathId[]

search_filters

type PathFilter[]

returns

Promise<TaskRegistryEntry[]>

task_registry_render_builtins
#

task_registry.ts view source

(entries: TaskRegistryEntry[], 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.

entries

output_dir

type PathId

origin_path

type string

returns

string

task_registry_render_project
#

TaskArgsInput
#

task_registry.ts view source

TaskArgsInput<TName>

type TaskRegistry[TName] extends { Args: infer TSchema extends ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>; } ? input<TSchema> : 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.

generics

TaskArgsInput<TName extends TaskName>
TName
constraint TaskName

TaskName
#

task_registry.ts view source

TaskName

type "clean" | "fixture/no_args" | "fixture/required_args" | "build" | "changeset" | "check" | "commit" | "deploy" | "dev" | "format" | "gen" | "lint" | "publish" | "reinstall" | "release" | "resolve" | "run" | "sync" | "test" | "typecheck" | "upgrade" | "gro/clean" | "gro/build" | "gro/changeset" | "gro/check" | "gro/commit" | "gro/deploy" | "gro/dev" | "gro/format" | "gro/gen" | "gro/lint" | "gro/publish" | "gro/reinstall" | "gro/release" | "gro/resolve" | "gro/run" | "gro/sync" | "gro/test" | "gro/typecheck" | "gro/upgrade"

import type {TaskName} from '@fuzdev/gro/task_registry.js';

TaskRegistry
#

task_registry.ts view source

TaskRegistry

type Omit<GroBuiltinTasks, "clean" | "fixture/no_args" | "fixture/required_args"> & ProjectTasks & { "gro/build": typeof import("build.task.ts", { with: { "resolution-mode": "import" } }); "gro/changeset": typeof import("changeset.task.ts", { with: { "resolution-mode": "import" } }); "gro/check": typeof import("check.task.ts", { with: { "reso...

import type {TaskRegistry} from '@fuzdev/gro/task_registry.js';

Every task name invoke_task accepts as a literal, mapped to its module's type. Mirrors runtime resolution: a project task shadows the builtin with the same name, and gro/-prefixed names always reach the builtin.

build

type typeof import("build.task.ts", { with: { "resolution-mode": "import" } })

changeset

type typeof import("changeset.task.ts", { with: { "resolution-mode": "import" } })

check

type typeof import("check.task.ts", { with: { "resolution-mode": "import" } })

commit

type typeof import("commit.task.ts", { with: { "resolution-mode": "import" } })

deploy

type typeof import("deploy.task.ts", { with: { "resolution-mode": "import" } })

dev

type typeof import("dev.task.ts", { with: { "resolution-mode": "import" } })

format

type typeof import("format.task.ts", { with: { "resolution-mode": "import" } })

gen

type typeof import("gen.task.ts", { with: { "resolution-mode": "import" } })

lint

type typeof import("lint.task.ts", { with: { "resolution-mode": "import" } })

publish

type typeof import("publish.task.ts", { with: { "resolution-mode": "import" } })

reinstall

type typeof import("reinstall.task.ts", { with: { "resolution-mode": "import" } })

release

type typeof import("release.task.ts", { with: { "resolution-mode": "import" } })

resolve

type typeof import("resolve.task.ts", { with: { "resolution-mode": "import" } })

run

type typeof import("run.task.ts", { with: { "resolution-mode": "import" } })

sync

type typeof import("sync.task.ts", { with: { "resolution-mode": "import" } })

test

type typeof import("test.task.ts", { with: { "resolution-mode": "import" } })

typecheck

type typeof import("typecheck.task.ts", { with: { "resolution-mode": "import" } })

upgrade

type typeof import("upgrade.task.ts", { with: { "resolution-mode": "import" } })

clean

type typeof import("src/test/fixtures/task_registry/clean_override.task_fixture.ts", { with: { "resolution-mode": "import" } })

fixture/no_args

type typeof import("src/test/fixtures/task_registry/no_args.task_fixture.ts", { with: { "resolution-mode": "import" } })

fixture/required_args

type typeof import("src/test/fixtures/task_registry/required_args.task_fixture.ts", { with: { "resolution-mode": "import" } })

gro/build

type typeof import("build.task.ts", { with: { "resolution-mode": "import" } })

gro/changeset

type typeof import("changeset.task.ts", { with: { "resolution-mode": "import" } })

gro/check

type typeof import("check.task.ts", { with: { "resolution-mode": "import" } })

gro/clean

type typeof import("clean.task.ts", { with: { "resolution-mode": "import" } })

gro/commit

type typeof import("commit.task.ts", { with: { "resolution-mode": "import" } })

gro/deploy

type typeof import("deploy.task.ts", { with: { "resolution-mode": "import" } })

gro/dev

type typeof import("dev.task.ts", { with: { "resolution-mode": "import" } })

gro/format

type typeof import("format.task.ts", { with: { "resolution-mode": "import" } })

gro/gen

type typeof import("gen.task.ts", { with: { "resolution-mode": "import" } })

gro/lint

type typeof import("lint.task.ts", { with: { "resolution-mode": "import" } })

gro/publish

type typeof import("publish.task.ts", { with: { "resolution-mode": "import" } })

gro/reinstall

type typeof import("reinstall.task.ts", { with: { "resolution-mode": "import" } })

gro/release

type typeof import("release.task.ts", { with: { "resolution-mode": "import" } })

gro/resolve

type typeof import("resolve.task.ts", { with: { "resolution-mode": "import" } })

gro/run

type typeof import("run.task.ts", { with: { "resolution-mode": "import" } })

gro/sync

type typeof import("sync.task.ts", { with: { "resolution-mode": "import" } })

gro/test

type typeof import("test.task.ts", { with: { "resolution-mode": "import" } })

gro/typecheck

type typeof import("typecheck.task.ts", { with: { "resolution-mode": "import" } })

gro/upgrade

type typeof import("upgrade.task.ts", { with: { "resolution-mode": "import" } })

TaskRegistryEntry
#

task_registry.ts view source

TaskRegistryEntry import type {TaskRegistryEntry} from '@fuzdev/gro/task_registry.js';

name

type string

id

type PathId

Depends on
#

Imported by
#