DEX (Deno EXecute) is a tool to help you script the building process of your projects with typescript through deno
- install deno if you haven't already
- alias the cli's script execution in your shell rc
alias dex="deno run -A https://raw.githubusercontent.com/MajorBarnulf/dex/master/src/cli/main.ts"
create a config file named dex.ts
at the root of a project
// import the default Dex instance, alternatively you can import the Dex class and instantiate it yourself
import { dex } from "https://raw.githubusercontent.com/MajorBarnulf/dex/master/src/lib/mod.ts";
dex
// add a target for the project
.add_target({
// specify the target name
name: "target",
// set the execution function
exec: (ctx) => {
console.log("building 'main' ...");
},
// list the target dependencies
deps: ["dep"],
})
// add as many targets as you need
.add_target({
name: "dep",
exec: (ctx) => {
console.log("building 'dep1 ...");
},
});
// export the dex modified dex instance
export { dex };
you will be able to execute any target by running the following command from anywhere in your project:
dex target