srackham / drake Goto Github PK
View Code? Open in Web Editor NEWDrake is a make-like task runner for Deno.
License: MIT License
Drake is a make-like task runner for Deno.
License: MIT License
It would be nice to support the following:
task("namer", [], function() {
return "world!";
});
task("greet", ["namer"], function(named: any) {
console.log("Hello,", named);
});
So, the return value of a parent task is provided to the task.action()
function, in the order it appears in the deps array.
Currently, sh
function behavior depends on shell interpreter the OS uses, making its behavior inconsistent.
Yarn uses an NPM package called @yarnpkg/parsers
to parse bash-like syntax, a Deno library should be able to use it via Pika CDN (https://cdn.pika.dev/@yarnpkg/parsers/2.0.0-rc.10).
Drake always logs target names before executing the targets. It would be cool if those targets is collapsible/expandible in GitHub Actions, like so:
target 1
target 1 logstarget 2
target 2 logs
This can be achieved by printing the following to stdout:
::group::target 1
target 1 logs
::endgroup::
::group::target 2
target 2 logs
::endgroup::
Add a way to customize logging of target names.
Drake file:
#!/usr/bin/env deno run --allow-read --allow-write --allow-env --allow-net --allow-run
import { desc, run, task, sh } from "https://deno.land/x/[email protected]/mod.ts";
task("hello", [], () => {});
run();
Running this with -l
produces:
error: Uncaught (in promise) TypeError: Reduce of empty array with no initial value
const maxLen = keys.reduce(function (a, b) {
^
at Array.reduce (<anonymous>)
at TaskRegistry.list (https://deno.land/x/[email protected]/lib/tasks.ts:275:25)
at run (https://deno.land/x/[email protected]/lib/registry.ts:45:18)
If desc
is called prior to task
, then there is no error when listing tasks.
Expected: drake -l should be able to list defined tasks which do not have descriptions.
Hi ๐
I plan to use drake in the next versions of eggs (nest.land)
But I find it difficult to use it in CI because of several errors:
run: started
test: started
drake error: cannot locate shell: missing SHELL environment variable
(This is on the ubuntu workflow, the others OS are not setup properly)
https://github.com/nestdotland/eggs/runs/1146637077
Timestamp-only file task dependency checking is fraught with problems, see mtime comparison
considered harmful.
This is further complicated by the fact that Deno.utime
and Deno.utimeSync
APIs have been marked
"unstable" in Deno 1.0.0-rc1 and they have resolution limitations.
Drake's file task dependency check mechanism should not rely on target and prerequisite file
timestamp comparisions.
deno 1.0.0-rc1
v8 8.2.308
typescript 3.8.3
import Drake from "https://raw.github.com/srackham/drake/v1.0.0-rc1/mod.ts";
When running the hello world example we receive the following error
deno run -A Drakefile.ts hello
on the Drakefile:
import {
desc,
run,
task,
} from "https://raw.github.com/srackham/drake/master/mod.ts";
desc("Minimal Drake task");
task("hello", [], function () {
console.log("Hello World!");
});
run();
causes the error:
error: Uncaught Error: Import 'https://deno.land/[email protected]/path/mod.ts' failed: 404 Not Found
at unwrapResponse ($deno$/ops/dispatch_json.ts:43:11)
at Object.sendAsync ($deno$/ops/dispatch_json.ts:98:10)
at async processImports ($deno$/compiler/imports.ts:117:23)
at async processImports ($deno$/compiler/imports.ts:125:7)
at async Object.processImports ($deno$/compiler/imports.ts:125:7)
at async compile (file:///Users/runner/runners/2.169.1/work/deno/deno/cli/js/compiler.ts:144:31)
at async tsCompilerOnMessage (file:///Users/runner/runners/2.169.1/work/deno/deno/cli/js/compiler.ts:359:22)
at async workerMessageRecvCallback ($deno$/runtime_worker.ts:73:9)
Have tried locking version to v1.0.0-rc1 and also using master. Its strange as just before running the command the dependancies are downloaded:
Download https://deno.land/[email protected]/fs/mod.ts
Download https://deno.land/[email protected]/path/mod.ts
Download https://raw.githubusercontent.com/srackham/drake/v1.0.0-rc1/lib/help.ts
Download https://raw.githubusercontent.com/srackham/drake/v1.0.0-rc1/lib/tasks.ts
Hi, i am receiving error after upgrade to deno v1.2.0
I think is related to the typescript version deno v1.2.0 is using.
In some functions of std Deno changed return new URL(url).pathname to return new URL(String(url)).pathname
I think the problem will be solved if drake change its std references from 0.59.0 to 0.61.0.
The detailed error is as follows:
Check file:///home/user/deno-api/Drakefile.ts
error: TS2345 [ERROR]: Argument of type 'string | URL' is not assignable to parameter of type 'string'.
Type 'URL' is not assignable to type 'string'.
return new URL(url).pathname
~~~
at https://deno.land/[email protected]/path/win32.ts:917:18
TS2345 [ERROR]: Argument of type 'string | URL' is not assignable to parameter of type 'string'.
Type 'URL' is not assignable to type 'string'.
return new URL(url).pathname;
~~~
at https://deno.land/[email protected]/path/posix.ts:438:18
Found 2 errors.
These APIs read and manipulate file timestamps and are problematic. See issue #4
Using the drake alias isn't ideal when used with multiple projects
alias drake="deno run -A Drakefile.ts"
If we could have a drake
command to execute the script in cwd that would be very nice.
It would search for Drakefile.ts
.
Something like :
$ drake --help # would run Drakefile.ts
$ drake task1
I use docker to deploy deno app, I use Drake for automation some task I want to run when deploy, But when I use sh to run command line, I always saw my docker container throw error: "drake error: illegal option: -A", but when I run it to manually, everything fine.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.