-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
162 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,37 @@ | ||
export const tasks = { | ||
yarn: { | ||
input: "package.json", | ||
output: "node_modules", | ||
cmd: "yarn", | ||
import { Task } from "https://raw.githubusercontent.com/cdaringe/rad/master/src/mod.ts"; | ||
|
||
const meet: Task = `echo "hi friend."`; | ||
|
||
/** | ||
* example rad tasks | ||
*/ | ||
export const tasks: Tasks = { | ||
/** | ||
* make-style tasks! | ||
*/ | ||
install: { | ||
target: "node_modules", | ||
prereqs: ["package.json"], | ||
onMake: ({ sh }) => sh(`npm install && touch node_modules`), | ||
}, | ||
build: { | ||
input: "node_modules", | ||
output: "bundle.zip", | ||
dependsOn: ["yarn"], | ||
cmd: (opts) => | ||
` | ||
zip ${opts.task.output} \\ | ||
src \\ | ||
${opts.upstream.yarn.task.output} | ||
`, | ||
/** | ||
* command style tasks | ||
*/ | ||
build: `tsc`, | ||
format: `deno fmt`, | ||
meet, | ||
/** | ||
* function style tasks | ||
*/ | ||
greet: { | ||
dependsOn: [meet], | ||
fn: async (toolkit) => { | ||
const { fs, path, logger, Deno, sh, task } = toolkit; | ||
fs.mkdirp && fs.readFile && await fs.writeFile("/tmp/hello", "world!"); | ||
path.resolve && path.relative && path.isAbsolute; // etc | ||
logger.error("crikey!"); | ||
Deno.cwd() && Deno.pid; | ||
await sh(`caw, caw!, ${task.name}`); | ||
}, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
## manual | ||
|
||
your guide to `rad`! | ||
|
||
### understanding rad | ||
|
||
- `rad` is written in typescript and runs on [deno](https://deno.land/) | ||
- you write tasks, then ask `rad` to run them | ||
- `rad` reads your radfile (i.e. `rad.ts`), compiles & type checks it, then runs it through its task graph executor | ||
|
||
🤯 | ||
|
||
### setting up a radfile, rad.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
## toolkit | ||
|
||
https://github.com/cdaringe/rad/blob/ | ||
f27c5d5f7cd8c40b1cb94b1f659c1b3768c7dc00/src/Task.ts#L33-L42 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters