116 lines
2.8 KiB
JSON
116 lines
2.8 KiB
JSON
{
|
|
"tasks": {
|
|
"make": "deno run --allow-env --allow-read --allow-write=.deno-make.json --allow-run=deno ./mod.ts $0",
|
|
"test": "deno task make test",
|
|
"code": "deno task make code",
|
|
"check": "deno task make check",
|
|
"cache": "deno task make cache",
|
|
"ci": "deno task make ci"
|
|
},
|
|
"+tasks": {
|
|
"test": {
|
|
"description": "🧪 Run tests and benchmarks. Print collected coverage",
|
|
"task": [
|
|
// Setup test environment
|
|
"mkdir -p .coverage &&",
|
|
"rm -rf .coverage &&",
|
|
"(echo '' > tests/.env) &&",
|
|
"(echo '{}' > tests/.imports.json) &&",
|
|
// Run tests and print coverage
|
|
"deno test &&",
|
|
"deno coverage .coverage &&",
|
|
// Cleanup test environment
|
|
"rm -rf .coverage tests/.[!.]*"
|
|
],
|
|
"deno": {
|
|
"test": {
|
|
"coverage": ".coverage",
|
|
"doc": true,
|
|
"traceOps": true,
|
|
"permissions": {
|
|
"read": true,
|
|
"env": ["TEST_INHERIT"],
|
|
"write": [".deno-make.json"],
|
|
"run": ["deno"]
|
|
}
|
|
}
|
|
},
|
|
"env": {
|
|
"DINOSAUR": "🦕"
|
|
}
|
|
},
|
|
"code": {
|
|
"description": "🧼 Lint and format code",
|
|
"task": "deno lint && deno fmt"
|
|
},
|
|
"check": {
|
|
"description": "🫧 Lint and check code fomatting",
|
|
"task": "deno lint && deno fmt",
|
|
"deno": {
|
|
"fmt": {
|
|
"check": true
|
|
}
|
|
}
|
|
},
|
|
"cache": {
|
|
"description": "📦 Cache dependencies",
|
|
"task": "deno cache *.ts",
|
|
"deno": {
|
|
"cache": {
|
|
"modules": {
|
|
"reload": true,
|
|
"check": "all"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"demo:flags": {
|
|
"description": "🎬 Demo: flags",
|
|
"task": [
|
|
"echo '0: $<0>' &&",
|
|
"echo '1: $<1>' &&",
|
|
"echo 'foo: $<foo>' &&",
|
|
"echo 'bar: $<bar>'"
|
|
],
|
|
"args": [
|
|
{
|
|
"alias": "0",
|
|
"required": true,
|
|
"description": "Example of required argument"
|
|
},
|
|
{
|
|
"alias": "1",
|
|
"default": true,
|
|
"description": "Example of optional argument"
|
|
}
|
|
],
|
|
"flags": {
|
|
"foo": {
|
|
"alias": "f",
|
|
"description": "Example of a standard flag"
|
|
},
|
|
"bar": {
|
|
"alias": "b",
|
|
"default": "bar",
|
|
"description": "Example of a defaulted flag"
|
|
},
|
|
"baz": {
|
|
"description": "Example of a non-aliased flag"
|
|
}
|
|
}
|
|
},
|
|
"ci": {
|
|
"description": "🤖 CI checks",
|
|
"task": [
|
|
"deno task make check &&",
|
|
"deno task make test"
|
|
]
|
|
}
|
|
},
|
|
"fmt": {
|
|
"lineWidth": 120,
|
|
"semiColons": false,
|
|
"exclude": [".coverage", ".deno-make.json"]
|
|
}
|
|
}
|