A general purpose build tool. Terse, statically typed, batteries included. Command tasks, function tasks, and make-style tasks supported.
Jump to:
branch | status |
---|---|
main | |
next |
rad@3.x
now supports Deno@1.3.x+
!
Rad is generally used as a CLI:
$ rad <task-name> [--help]
It can be used as a library too :).
Rad always consumes a rad.ts
file, such as the one shown here:
// rad.ts
import { Task, Tasks } from "https://deno.land/x/rad/src/mod.ts";
// command/shell tasks
const format = `prettier --write`
const test = `deno test`
// function tasks
const compile: Task = {
dependsOn: [format],
fn: ({ sh, ...toolkit }) => sh('tsc')
}
const greet = {
fn: () => Deno.writeTextFile("/tmp/hello", "world")
}
// make-style tasks
const transpile: Task = {
target: "phony",
prereqs: ["prereq1", "prereq2"],
async onMake({ logger }, { changedPrereqs /*, prereqs */}) {
for await (const req of changedPrereqs) {
logger.info(`req: ${req.path} ${req.isFile}`);
}
},
}
export const tasks: Tasks = {
compile,
format,
greet,
test,
}
There are a few formal ways to use rad
. Regardless of the route you choose, know that all strategies support using pinned versions, adherent to semver. See the releases page.
usage | install-method | install-steps |
---|---|---|
cli | deno |
deno install --unstable -A -n rad https://raw.githubusercontent.com/cdaringe/rad/main/src/bin.ts |
deno install -A -n rad https://raw.githubusercontent.com/cdaringe/rad/next/src/bin.ts |
||
cli | docker |
docker pull cdaringe/rad 1 |
cli | curl |
`curl -fsSL https://github.com/cdaringe/rad/releases/download/v1.2.0/install.sh |
`curl -fsSL https://raw.githubusercontent.com/cdaringe/rad/main/assets/install.sh | sh` (latest) | |
library | deno |
import * as rad from https://github.com/cdaringe/rad/blob/main/src/mod.ts |
1For docker users, consider making a nice shell alias
# shell profile, e.g. .bash_profile
function rad() {
docker run --unstable --rm -v $PWD:/rad cdaringe/rad --log-level info "$@";
}
A build tool! It competes with make, npm-scripts, velociraptor, bazel, gradle, ant, gulp, or any of the other many tools out there! On various metrics, rad
is subjectively better than some of the outstanding tools out there, and in some cases, not-so-much. We invite you to understand some of its core characteristics and interfaces.
rad
offers:
make
, gradle
, and friends 😢). your build is code, not an arbitrary language or stringly (read: bummerly) typed script runner.make
-style build targets
Rust
)bash/sh
! shell languages are great for running other programs, not for plumbing dataSee why not <my-favorite-build-tool>
?
Read more on our documentation site
Author: cdaringe
Demo: https://cdaringe.github.io/rad/
Source Code: https://github.com/cdaringe/rad
#deno #nodejs #node #javascript