Giter VIP home page Giter VIP logo

drake's People

Contributors

srackham avatar steelalloy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

drake's Issues

Provide results of parent tasks when action is run

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.

Example not working [v1.0.0-rc1]

Versions

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";

Issue

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)

Solutions?

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

Global `drake` command

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

Drake crashes when listing tasks with no description

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.

Error after upgrade to deno v1.2.0

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.

Using drake in CI

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

Customizing target log | GitHub Actions output

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 logs
target 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::

Request

Add a way to customize logging of target names.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.