Overview of MaybeArray namespace
MaybeArray namespace provides utility functions for handling types that may be arrays. It includes the toArray function.website·Indexed 30 days ago
https://nadle.devDocumentation for Nadle, featuring a task-based system with support for defining tasks via defineTask and plugins via definePlugin. The API includes built-in task types such as ExecTask, CopyTask, DeleteTask, DownloadTask, and ZipTask, as well as configuration options for Node, Npx, and Pnpm execution.
MaybeArray namespace provides utility functions for handling types that may be arrays. It includes the toArray function.Nadle is a modern, type-safe, Gradle-inspired task runner for Node.js built with TypeScript. It allows developers to define and orchestrate project workflows using a declarative nadle.config.ts file. Key capabilities include:
b for build).pnpm-workspace.yaml), npm, or yarn (package.json workspaces). It treats each workspace as a distinct unit with its own configuration. Tasks can be referenced by workspace ID, relative path, or alias using the <workspace>:<task> format. If a task is not found in the current workspace, Nadle falls back to the root workspace.# Run a task in all workspaces
nadle build
# Run a task in a specific workspace
nadle workspace-a:deploy
# Exclude a task in a specific workspace
nadle build --exclude workspace-b:build
# Run multiple tasks in parallel
nadle eslint prettier spell-check --parallelNadle is a type-safe, Gradle-inspired task runner for Node.js designed to replace string-based scripts with a programmable and declarative approach. Its core design principles include:
Outputs namespace provides utilities for declaring file and directory output patterns used for caching. These utilities are aliases of Inputs.files and Inputs.dirs and include the files and dirs variables.Plugins are distributable units of behavior that must be explicitly opted into. A plugin can contribute:
deploy).--reporter <name> CLI flag.TaskExecutionError class is thrown when a task fails during its execution. It extends NadleError and provides additional context about which task caused the failure via the task property.// Constructor signature
new TaskExecutionError(message: string, options?: TaskExecutionErrorOptions): TaskExecutionErrorTaskHookContext<Options> interface is passed to beforeTask and afterTask hooks. It provides metadata about the task execution, logging capabilities, and plugin configuration.interface TaskHookContext<Options> {
readonly task: RegisteredTask;
readonly logger: Logger;
readonly pluginOptions: Options;
readonly threadId?: number; // Present in beforeTask (worker thread id)
readonly result?: 'up-to-date' | 'from-cache' | 'skipped' | 'failed' | 'canceled' | 'done'; // Present only in afterTask
readonly error?: unknown; // Present only in afterTask when result is 'failed'
}# Mistyped 'backend:build' as 'backe:biuld'
nadle backe:biuld
# Nadle will resolve to 'backend:build'Inputs namespace provides utility functions for declaring file and directory input patterns used for caching. Available functions include dirs() for directory patterns and files() for file patterns.completion command generates the necessary script. Append this output to your shell profile to enable TAB completion for option flags and live task names (including task descriptions in supported shells).nadle completion >> ~/.zshrc # or ~/.bashrc, or fish configlanguages.toml to include the nadle server for TypeScript files.npm install -g @nadle/language-server[language-server.nadle]
command = "nadle-language-server"
[[language]]
name = "typescript"
language-servers = ["typescript-language-server", "nadle"]