Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cdaringe/rad
general purpose build tool. statically typed, batteries included. command, function, and make-style tasks supported. improved npm scripts for deno.
https://github.com/cdaringe/rad
build-tool deno make npm-scripts polyglot rad task tasks
Last synced: 3 months ago
JSON representation
general purpose build tool. statically typed, batteries included. command, function, and make-style tasks supported. improved npm scripts for deno.
- Host: GitHub
- URL: https://github.com/cdaringe/rad
- Owner: cdaringe
- Created: 2018-02-15T05:51:45.000Z (almost 7 years ago)
- Default Branch: main
- Last Pushed: 2024-09-17T20:46:55.000Z (5 months ago)
- Last Synced: 2024-10-28T12:15:42.362Z (3 months ago)
- Topics: build-tool, deno, make, npm-scripts, polyglot, rad, task, tasks
- Language: TypeScript
- Homepage: https://cdaringe.github.io/rad
- Size: 631 KB
- Stars: 25
- Watchers: 3
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: readme.md
- Contributing: .github/contributing.md
Awesome Lists containing this project
README
# rad 💯
A general purpose build tool. Concise, statically typed, batteries included.
Command tasks, function tasks, and make-style tasks supported.Jump to:
1. [Documentation site](https://cdaringe.github.io/rad/)
2. [Usage](#usage)
3. [Install](#install)
4. [What](#what-is-it)
5. [Why not ``?](https://cdaringe.github.io/rad/#why-not-my-favorite-build-tool)
6. [Manual](https://cdaringe.github.io/rad/#manual)| branch | status |
| ------ | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| main | [![main](https://github.com/cdaringe/rad/workflows/main/badge.svg)](https://github.com/cdaringe/rad/actions?query=workflow%3Amain) |
| next | [![next](https://github.com/cdaringe/rad/workflows/next/badge.svg?branch=next)](https://github.com/cdaringe/rad/actions?query=workflow%3Anext) |## Usage
Rad is generally used as a CLI:
`$ rad [--help]`
For example, `$ rad build` or `$ rad --log-level=info test`!
It can be used as a library too :).
Rad always consumes a `rad.ts` file, such as the one shown here:
```ts
// rad.ts
import { Task, Tasks } from "https://deno.land/x/[email protected]/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,
};
```## Install
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](https://github.com/cdaringe/rad/releases).| usage | install-method | install-steps |
| ------- | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| cli | `deno` | `deno install -f -A -n rad https://raw.githubusercontent.com/cdaringe/rad/v6.11.0/src/bin.ts` |
| cli | `docker` | `docker pull cdaringe/rad` 1 |
| cli | `curl` |curl -fsSL https://raw.githubusercontent.com/cdaringe/rad/v6.11.0/assets/install.sh \| sh
(versioned)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/v6.11.0/mod.ts` |1For docker users, consider making a nice shell alias
```bash
# shell profile, e.g. .bash_profile
function rad() {
docker run --rm -v $PWD:/rad cdaringe/rad --log-level info "$@";
}
```## What is it
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:
- simple, **programmable** task interfaces
- **easy to understand**, declarative build steps
- **type-checked** tasks
- **no quirky DSLs** (`make`, `gradle`, and friends 😢). **your build is code**,
not an arbitrary language or stringly (read: bummerly) typed script runner.
- productive toolkit API for nuanced tasks that benefit from programming. see
[toolkit](#toolkit)
- bottom-up, `make`-style build targets
- fast builds, skip redundant work when inputs haven't changed
- cli mode, or library mode
- portability. build automation for _any_ language or project, in many
environments (\*limited to _Deno_ target architectures, for the time being.
long term, we may package this in `Rust`)
- great UX
- debug-ability. 🐛 inspect your data, tasks, or even _rad_ itself
- employs a real scripting language--**not** `bash/sh`! shell languages are
great for running other programs, not for plumbing dataSee
[why not ``?](https://cdaringe.github.io/rad/#why-not-my-favorite-build-tool)Read more on our [documentation site](https://cdaringe.github.io/rad/)