Compare commits
101 Commits
Author | SHA1 | Date | |
---|---|---|---|
1152bb1138 | |||
9df7787450 | |||
3e81fdacad | |||
f74da6ff0b | |||
e9d976ad1e | |||
f6d314695a | |||
d35b34f4aa | |||
9fec5ce62e | |||
7577479368 | |||
dbcd5bbfc8 | |||
d91b6c8360 | |||
b9af186190 | |||
bdb7064394 | |||
f60deddadd | |||
df18aba4b5 | |||
a3699f2869 | |||
017c0789ca | |||
6e6d056617 | |||
3f7f38ee17 | |||
5bfc72a602 | |||
ca8882962e | |||
df6bf2c681 | |||
310a683e14 | |||
3f275ebc08 | |||
01d469960e | |||
2ed701040a | |||
ca3bb38205 | |||
891d727fd4 | |||
e1424ea0fb | |||
cf1b31d635 | |||
d5570311ee | |||
44b3ba1313 | |||
4721d8c9e6 | |||
c7336eedfb | |||
5477911b5e | |||
2f8d3f7625 | |||
b00d31b41a | |||
4031692f6f | |||
174beae65f | |||
c1144d3405 | |||
065d92e573 | |||
46878819df | |||
aa8df29bbb | |||
f5cb0843fc | |||
1d52d098fb | |||
eb7eb14415 | |||
670bf5b124 | |||
fab863c66c | |||
402e2b982f | |||
1d0a85e6ca | |||
7ded7b036e | |||
03020eacbc | |||
dc95885646 | |||
11cdaad226 | |||
a1ad463140 | |||
76c57451b3 | |||
5dca9a9460 | |||
d30fb551f9 | |||
7a60f30f0b | |||
9e175245ed | |||
4bc5617240 | |||
39c41a817e | |||
8823e2b01d | |||
24e96926e3 | |||
8a414b9a7d | |||
a347ded65a | |||
3ce4b200db | |||
cd6407f189 | |||
ca2afbd8c7 | |||
6640d5fb2f | |||
7a3aed275f | |||
19beb95e20 | |||
8944ae2462 | |||
b1eeb3563e | |||
1714f552ac | |||
454a999a42 | |||
1f3f2ae92f | |||
9014eec9f6 | |||
ee56b6f655 | |||
55ddbece13 | |||
130c4177a6 | |||
90c9f23c23 | |||
0d0ee67ca3 | |||
5fd11ec9c0 | |||
569cb311c9 | |||
44db37574c | |||
fb7f5c5e68 | |||
b6595ac1d3 | |||
3f3f9c68f1 | |||
48c20c081f | |||
72504d7ad7 | |||
370e714fe1 | |||
4179347f26 | |||
130e071a06 | |||
c4e2021a01 | |||
58ac5745a1 | |||
38d02a3ac2 | |||
e29f5d1633 | |||
f815773ba3 | |||
771539dae3 | |||
71c883609b |
6
.gitignore
vendored
6
.gitignore
vendored
@ -1,6 +1,4 @@
|
||||
.idea/
|
||||
coverage/
|
||||
ts/*.js
|
||||
ts/*.js.map
|
||||
ts/typings/
|
||||
node_modules
|
||||
pages/
|
||||
.nogit/
|
||||
|
142
.gitlab-ci.yml
Normal file
142
.gitlab-ci.yml
Normal file
@ -0,0 +1,142 @@
|
||||
# gitzone standard
|
||||
image: hosttoday/ht-docker-node:npmci
|
||||
|
||||
cache:
|
||||
paths:
|
||||
- .npmci_cache/
|
||||
key: "$CI_BUILD_STAGE"
|
||||
|
||||
stages:
|
||||
- security
|
||||
- test
|
||||
- release
|
||||
- metadata
|
||||
|
||||
# ====================
|
||||
# security stage
|
||||
# ====================
|
||||
mirror:
|
||||
stage: security
|
||||
script:
|
||||
- npmci git mirror
|
||||
tags:
|
||||
- docker
|
||||
- notpriv
|
||||
|
||||
snyk:
|
||||
stage: security
|
||||
script:
|
||||
- npmci command npm install -g snyk
|
||||
- npmci command npm install --ignore-scripts
|
||||
- npmci command snyk test
|
||||
tags:
|
||||
- docker
|
||||
- notpriv
|
||||
|
||||
# ====================
|
||||
# test stage
|
||||
# ====================
|
||||
testLEGACY:
|
||||
stage: test
|
||||
script:
|
||||
- npmci node install legacy
|
||||
- npmci npm install
|
||||
- npmci npm test
|
||||
coverage: /\d+.?\d+?\%\s*coverage/
|
||||
tags:
|
||||
- docker
|
||||
- notpriv
|
||||
allow_failure: true
|
||||
|
||||
testLTS:
|
||||
stage: test
|
||||
script:
|
||||
- npmci node install lts
|
||||
- npmci npm install
|
||||
- npmci npm test
|
||||
coverage: /\d+.?\d+?\%\s*coverage/
|
||||
tags:
|
||||
- docker
|
||||
- notpriv
|
||||
|
||||
testSTABLE:
|
||||
stage: test
|
||||
script:
|
||||
- npmci node install stable
|
||||
- npmci npm install
|
||||
- npmci npm test
|
||||
coverage: /\d+.?\d+?\%\s*coverage/
|
||||
tags:
|
||||
- docker
|
||||
- notpriv
|
||||
|
||||
release:
|
||||
stage: release
|
||||
script:
|
||||
- npmci node install stable
|
||||
- npmci npm publish
|
||||
only:
|
||||
- tags
|
||||
tags:
|
||||
- docker
|
||||
- notpriv
|
||||
|
||||
# ====================
|
||||
# metadata stage
|
||||
# ====================
|
||||
codequality:
|
||||
stage: metadata
|
||||
image: docker:stable
|
||||
allow_failure: true
|
||||
services:
|
||||
- docker:stable-dind
|
||||
script:
|
||||
- export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/')
|
||||
- docker run
|
||||
--env SOURCE_CODE="$PWD"
|
||||
--volume "$PWD":/code
|
||||
--volume /var/run/docker.sock:/var/run/docker.sock
|
||||
"registry.gitlab.com/gitlab-org/security-products/codequality:$SP_VERSION" /code
|
||||
artifacts:
|
||||
paths: [codeclimate.json]
|
||||
tags:
|
||||
- docker
|
||||
- priv
|
||||
|
||||
trigger:
|
||||
stage: metadata
|
||||
script:
|
||||
- npmci trigger
|
||||
only:
|
||||
- tags
|
||||
tags:
|
||||
- docker
|
||||
- notpriv
|
||||
|
||||
pages:
|
||||
image: hosttoday/ht-docker-node:npmci
|
||||
stage: metadata
|
||||
script:
|
||||
- npmci command npm install -g typedoc typescript
|
||||
- npmci npm install
|
||||
- npmci command typedoc --module "commonjs" --target "ES2016" --out public/ ts/
|
||||
tags:
|
||||
- docker
|
||||
- notpriv
|
||||
only:
|
||||
- tags
|
||||
artifacts:
|
||||
expire_in: 1 week
|
||||
paths:
|
||||
- public
|
||||
allow_failure: true
|
||||
|
||||
windowsCompatibility:
|
||||
image: stefanscherer/node-windows:10-build-tools
|
||||
stage: metadata
|
||||
script:
|
||||
- npm install & npm test
|
||||
coverage: /\d+.?\d+?\%\s*coverage/
|
||||
tags:
|
||||
- windows
|
||||
allow_failure: true
|
@ -0,0 +1,5 @@
|
||||
docs/
|
||||
coverage/
|
||||
ts/
|
||||
node_modules/
|
||||
pages/
|
||||
|
11
.travis.yml
11
.travis.yml
@ -1,11 +0,0 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- stable
|
||||
deploy:
|
||||
provider: npm
|
||||
email: npm@lossless.digital
|
||||
api_key:
|
||||
secure: NejErc2+ohEEH8DecYcx6/2oSdEQQBRzlOwTMxQBftHdIkvziwOcCerqCJtrXuzalqAofVCcVisunWIXZmxfIBGV6mJVauCIp5KzH4JUhYzLym33p9MSphjlPNfsI6nKkW0LAgOMjkJGuHLqU3oskvBqYyh8m3NuCna5mNwm8lo5WGckzHSwdsmhnb839WhlZbmQc6M6WW6Ir7bbxX9ZOmNUYUWH6VdXfPBxoXN3nO21pXKt7Zg8/nU7IkF+VEUVfYNlR3xUiocWemuBFxjtsfoliQ/y/oGL7ccQ7OeE4PxSu+xNUpYYVipkQcRtyWDKCwJp4R2DNTj/ikOHH+BEFOBDG8qYxwf37Ju0jFybzslAEJLy5gl4bFjiZNA8ldUXY5ubJb56iZTNSbMU0lmXw+qKvIoyVY/1JAE5lzFGVA6nDdiUGAEOg/ajzAC3gjFU2QS2Wvncz3dky0k/2INBVUwmmAvAMazl5XkvHtQ3Wzb+Fc8TXWflqBDF0okySoJzlY13pm/OtOHipiqEyUCnqaUUwJtLIb6tHOPzxZKlWLCem7y84cDlxQSbLVItbArOJFHdr66sp/U/FqYAtWeLdbkhjCENFwzR9kYtEyEl+QWLTckO1/lVF4xJLh6drfhQ66CwF5bfqr5xIS08mnKuYBfJOA4/wV4bQFPhtYm7Oi8=
|
||||
on:
|
||||
tags: true
|
||||
repo: pushrocks/taskbuffer
|
11
README.md
11
README.md
@ -1,11 +0,0 @@
|
||||
# taskbuffer
|
||||
Flexible task organization for gulp.
|
||||
|
||||
## Status
|
||||
[](https://coveralls.io/github/pushrocks/taskbuffer?branch=master)
|
||||
|
||||
## Install
|
||||
|
||||
```sh
|
||||
npm install taskbuffer --save
|
||||
```
|
9
dist/index.js
vendored
9
dist/index.js
vendored
@ -1,9 +0,0 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
var task = require("./taskbuffer.task");
|
||||
var taskbuffer = {
|
||||
task: task
|
||||
};
|
||||
module.exports = taskbuffer;
|
||||
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUdBLElBQU8sSUFBSSxXQUFXLG1CQUFtQixDQUFDLENBQUM7QUFHM0MsSUFBSSxVQUFVLEdBQUc7SUFDYixJQUFJLEVBQUUsSUFBSTtDQUNiLENBQUM7QUFFRixpQkFBUyxVQUFVLENBQUMiLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VzQ29udGVudCI6WyIvLy8gPHJlZmVyZW5jZSBwYXRoPVwiLi90eXBpbmdzL21haW4uZC50c1wiIC8+XG5pbXBvcnQgcGx1Z2lucyA9IHJlcXVpcmUoXCIuL3Rhc2tidWZmZXIucGx1Z2luc1wiKTtcbmltcG9ydCBjbGFzc2VzID0gcmVxdWlyZShcIi4vdGFza2J1ZmZlci5jbGFzc2VzXCIpO1xuaW1wb3J0IHRhc2sgPSByZXF1aXJlKFwiLi90YXNrYnVmZmVyLnRhc2tcIik7XG5pbXBvcnQgdGFza2NoYWluID0gcmVxdWlyZShcIi4vdGFza2J1ZmZlci50YXNrY2hhaW5cIik7XG5cbnZhciB0YXNrYnVmZmVyID0ge1xuICAgIHRhc2s6IHRhc2tcbn07XG5cbmV4cG9ydCA9IHRhc2tidWZmZXI7Il0sInNvdXJjZVJvb3QiOiIvc291cmNlLyJ9
|
52
dist/taskbuffer.classes.js
vendored
52
dist/taskbuffer.classes.js
vendored
@ -1,52 +0,0 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
var __extends = (this && this.__extends) || function (d, b) {
|
||||
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
/// <reference path="./typings/main.d.ts" />
|
||||
var plugins = require("./taskbuffer.plugins");
|
||||
var Task = (function () {
|
||||
function Task(taskArg, optionsArg) {
|
||||
this.task = taskArg;
|
||||
}
|
||||
Task.prototype.trigger = function () {
|
||||
this.preTask.task()
|
||||
.then(this.task)
|
||||
.then(this.afterTask.task);
|
||||
};
|
||||
;
|
||||
Task.prototype.triggerBuffered = function () {
|
||||
var done = plugins.Q.defer();
|
||||
};
|
||||
Object.defineProperty(Task.prototype, "state", {
|
||||
get: function () {
|
||||
return this._state;
|
||||
},
|
||||
set: function (stateArg) {
|
||||
if (stateArg == "locked") {
|
||||
this._state = "locked";
|
||||
}
|
||||
else {
|
||||
plugins.beautylog.error("state type");
|
||||
}
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
return Task;
|
||||
})();
|
||||
exports.Task = Task;
|
||||
var TaskChain = (function (_super) {
|
||||
__extends(TaskChain, _super);
|
||||
function TaskChain(taskArrayArg) {
|
||||
_super.call(this, {
|
||||
task: function () { }
|
||||
});
|
||||
}
|
||||
return TaskChain;
|
||||
})(Task);
|
||||
exports.TaskChain = TaskChain;
|
||||
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRhc2tidWZmZXIuY2xhc3Nlcy50cyJdLCJuYW1lcyI6WyJUYXNrIiwiVGFzay5jb25zdHJ1Y3RvciIsIlRhc2sudHJpZ2dlciIsIlRhc2sudHJpZ2dlckJ1ZmZlcmVkIiwiVGFzay5zdGF0ZSIsIlRhc2tDaGFpbiIsIlRhc2tDaGFpbi5jb25zdHJ1Y3RvciJdLCJtYXBwaW5ncyI6Ijs7Ozs7QUFBQSw0Q0FBNEM7QUFDNUMsSUFBTyxPQUFPLFdBQVcsc0JBQXNCLENBQUMsQ0FBQztBQUNqRDtJQVVJQSxjQUFZQSxPQUFPQSxFQUFDQSxVQUEyQ0E7UUFDM0RDLElBQUlBLENBQUNBLElBQUlBLEdBQUdBLE9BQU9BLENBQUNBO0lBQ3hCQSxDQUFDQTtJQUNERCxzQkFBT0EsR0FBUEE7UUFDSUUsSUFBSUEsQ0FBQ0EsT0FBT0EsQ0FBQ0EsSUFBSUEsRUFBRUE7YUFDZEEsSUFBSUEsQ0FBQ0EsSUFBSUEsQ0FBQ0EsSUFBSUEsQ0FBQ0E7YUFDZkEsSUFBSUEsQ0FBQ0EsSUFBSUEsQ0FBQ0EsU0FBU0EsQ0FBQ0EsSUFBSUEsQ0FBQ0EsQ0FBQ0E7SUFDbkNBLENBQUNBOztJQUNERiw4QkFBZUEsR0FBZkE7UUFDSUcsSUFBSUEsSUFBSUEsR0FBR0EsT0FBT0EsQ0FBQ0EsQ0FBQ0EsQ0FBQ0EsS0FBS0EsRUFBRUEsQ0FBQ0E7SUFDakNBLENBQUNBO0lBRURILHNCQUFJQSx1QkFBS0E7YUFBVEE7WUFDSUksTUFBTUEsQ0FBQ0EsSUFBSUEsQ0FBQ0EsTUFBTUEsQ0FBQ0E7UUFDdkJBLENBQUNBO2FBQ0RKLFVBQVVBLFFBQWVBO1lBQ3JCSSxFQUFFQSxDQUFDQSxDQUFDQSxRQUFRQSxJQUFJQSxRQUFRQSxDQUFDQSxDQUFBQSxDQUFDQTtnQkFDdEJBLElBQUlBLENBQUNBLE1BQU1BLEdBQUdBLFFBQVFBLENBQUNBO1lBQzNCQSxDQUFDQTtZQUFDQSxJQUFJQSxDQUFDQSxDQUFDQTtnQkFDSkEsT0FBT0EsQ0FBQ0EsU0FBU0EsQ0FBQ0EsS0FBS0EsQ0FBQ0EsWUFBWUEsQ0FBRUEsQ0FBQ0E7WUFDM0NBLENBQUNBO1FBQ0xBLENBQUNBOzs7T0FQQUo7SUFRTEEsV0FBQ0E7QUFBREEsQ0FoQ0EsQUFnQ0NBLElBQUE7QUFoQ1ksWUFBSSxPQWdDaEIsQ0FBQTtBQUVEO0lBQStCSyw2QkFBSUE7SUFDL0JBLG1CQUFZQSxZQUFtQkE7UUFDM0JDLGtCQUFNQTtZQUNGQSxJQUFJQSxFQUFDQSxjQUFXLENBQUM7U0FDcEJBLENBQUNBLENBQUNBO0lBQ1BBLENBQUNBO0lBQ0xELGdCQUFDQTtBQUFEQSxDQU5BLEFBTUNBLEVBTjhCLElBQUksRUFNbEM7QUFOWSxpQkFBUyxZQU1yQixDQUFBIiwiZmlsZSI6InRhc2tidWZmZXIuY2xhc3Nlcy5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8vLyA8cmVmZXJlbmNlIHBhdGg9XCIuL3R5cGluZ3MvbWFpbi5kLnRzXCIgLz5cbmltcG9ydCBwbHVnaW5zID0gcmVxdWlyZShcIi4vdGFza2J1ZmZlci5wbHVnaW5zXCIpO1xuZXhwb3J0IGNsYXNzIFRhc2sge1xuICAgIHRhc2s6YW55O1xuICAgIGlkbGU6Ym9vbGVhbjtcbiAgICBidWZmZXJlZDpib29sZWFuO1xuICAgIGJ1ZmZlcmVkRm9yY2VkOmJvb2xlYW47XG4gICAgcnVubmluZzpib29sZWFuO1xuICAgIHByaXZhdGUgX3N0YXRlOnN0cmluZztcbiAgICBwcmVUYXNrOlRhc2s7XG4gICAgYWZ0ZXJUYXNrOlRhc2s7XG5cbiAgICBjb25zdHJ1Y3Rvcih0YXNrQXJnLG9wdGlvbnNBcmc/OntwcmVUYXNrPzpUYXNrLGFmdGVyVGFzaz86VGFza30pe1xuICAgICAgICB0aGlzLnRhc2sgPSB0YXNrQXJnO1xuICAgIH1cbiAgICB0cmlnZ2VyKCl7XG4gICAgICAgIHRoaXMucHJlVGFzay50YXNrKClcbiAgICAgICAgICAgIC50aGVuKHRoaXMudGFzaylcbiAgICAgICAgICAgIC50aGVuKHRoaXMuYWZ0ZXJUYXNrLnRhc2spO1xuICAgIH07XG4gICAgdHJpZ2dlckJ1ZmZlcmVkKCl7XG4gICAgICAgIHZhciBkb25lID0gcGx1Z2lucy5RLmRlZmVyKCk7XG4gICAgfVxuXG4gICAgZ2V0IHN0YXRlKCk6c3RyaW5nIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuX3N0YXRlO1xuICAgIH1cbiAgICBzZXQgc3RhdGUoc3RhdGVBcmc6c3RyaW5nKXtcbiAgICAgICAgaWYgKHN0YXRlQXJnID09IFwibG9ja2VkXCIpe1xuICAgICAgICAgICAgdGhpcy5fc3RhdGUgPSBcImxvY2tlZFwiO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcGx1Z2lucy5iZWF1dHlsb2cuZXJyb3IoXCJzdGF0ZSB0eXBlXCIgKTtcbiAgICAgICAgfVxuICAgIH1cbn1cblxuZXhwb3J0IGNsYXNzIFRhc2tDaGFpbiBleHRlbmRzIFRhc2sge1xuICAgIGNvbnN0cnVjdG9yKHRhc2tBcnJheUFyZzpUYXNrW10pe1xuICAgICAgICBzdXBlcih7XG4gICAgICAgICAgICB0YXNrOmZ1bmN0aW9uKCl7fVxuICAgICAgICB9KTtcbiAgICB9XG59Il0sInNvdXJjZVJvb3QiOiIvc291cmNlLyJ9
|
10
dist/taskbuffer.plugins.js
vendored
10
dist/taskbuffer.plugins.js
vendored
@ -1,10 +0,0 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
/// <reference path="./typings/main.d.ts" />
|
||||
var plugins = {
|
||||
beautylog: require("beautylog"),
|
||||
Q: require("q")
|
||||
};
|
||||
module.exports = plugins;
|
||||
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRhc2tidWZmZXIucGx1Z2lucy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSw0Q0FBNEM7QUFDNUMsSUFBSSxPQUFPLEdBQUc7SUFDVixTQUFTLEVBQUUsT0FBTyxDQUFDLFdBQVcsQ0FBQztJQUMvQixDQUFDLEVBQUUsT0FBTyxDQUFDLEdBQUcsQ0FBQztDQUNsQixDQUFDO0FBQ0YsaUJBQVMsT0FBTyxDQUFDIiwiZmlsZSI6InRhc2tidWZmZXIucGx1Z2lucy5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8vLyA8cmVmZXJlbmNlIHBhdGg9XCIuL3R5cGluZ3MvbWFpbi5kLnRzXCIgLz5cbnZhciBwbHVnaW5zID0ge1xuICAgIGJlYXV0eWxvZzogcmVxdWlyZShcImJlYXV0eWxvZ1wiKSxcbiAgICBROiByZXF1aXJlKFwicVwiKVxufTtcbmV4cG9ydCA9IHBsdWdpbnM7XG4iXSwic291cmNlUm9vdCI6Ii9zb3VyY2UvIn0=
|
5
dist/taskbuffer.promisechain.js
vendored
5
dist/taskbuffer.promisechain.js
vendored
@ -1,5 +0,0 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
/// <reference path="./typings/main.d.ts" />
|
||||
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRhc2tidWZmZXIucHJvbWlzZWNoYWluLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLDRDQUE0QyIsImZpbGUiOiJ0YXNrYnVmZmVyLnByb21pc2VjaGFpbi5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8vLyA8cmVmZXJlbmNlIHBhdGg9XCIuL3R5cGluZ3MvbWFpbi5kLnRzXCIgLz4iXSwic291cmNlUm9vdCI6Ii9zb3VyY2UvIn0=
|
11
dist/taskbuffer.task.js
vendored
11
dist/taskbuffer.task.js
vendored
@ -1,11 +0,0 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
/// <reference path="./typings/main.d.ts" />
|
||||
var classes = require("./taskbuffer.classes");
|
||||
var task = function (taskArg, options) {
|
||||
var task = taskArg;
|
||||
return new classes.Task(task, options);
|
||||
};
|
||||
module.exports = task;
|
||||
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRhc2tidWZmZXIudGFzay50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSw0Q0FBNEM7QUFDNUMsSUFBTyxPQUFPLFdBQVcsc0JBQXNCLENBQUMsQ0FBQztBQUNqRCxJQUFJLElBQUksR0FBRyxVQUFTLE9BQU8sRUFBQyxPQUFRO0lBQ2hDLElBQUksSUFBSSxHQUFHLE9BQU8sQ0FBQTtJQUNsQixNQUFNLENBQUMsSUFBSSxPQUFPLENBQUMsSUFBSSxDQUFDLElBQUksRUFBQyxPQUFPLENBQUMsQ0FBQztBQUMxQyxDQUFDLENBQUM7QUFDRixpQkFBUyxJQUFJLENBQUMiLCJmaWxlIjoidGFza2J1ZmZlci50YXNrLmpzIiwic291cmNlc0NvbnRlbnQiOlsiLy8vIDxyZWZlcmVuY2UgcGF0aD1cIi4vdHlwaW5ncy9tYWluLmQudHNcIiAvPlxuaW1wb3J0IGNsYXNzZXMgPSByZXF1aXJlKFwiLi90YXNrYnVmZmVyLmNsYXNzZXNcIik7XG52YXIgdGFzayA9IGZ1bmN0aW9uKHRhc2tBcmcsb3B0aW9ucz8pe1xuICAgIHZhciB0YXNrID0gdGFza0FyZ1xuICAgIHJldHVybiBuZXcgY2xhc3Nlcy5UYXNrKHRhc2ssb3B0aW9ucyk7XG59O1xuZXhwb3J0ID0gdGFzazsiXSwic291cmNlUm9vdCI6Ii9zb3VyY2UvIn0=
|
10
dist/taskbuffer.taskchain.js
vendored
10
dist/taskbuffer.taskchain.js
vendored
@ -1,10 +0,0 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
/// <reference path="./typings/main.d.ts" />
|
||||
var classes = require("./taskbuffer.classes");
|
||||
var taskChain = function (taskArrayArg) {
|
||||
return new classes.TaskChain(taskArrayArg);
|
||||
};
|
||||
module.exports = taskChain;
|
||||
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRhc2tidWZmZXIudGFza2NoYWluLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLDRDQUE0QztBQUM1QyxJQUFPLE9BQU8sV0FBVyxzQkFBc0IsQ0FBQyxDQUFDO0FBQ2pELElBQUksU0FBUyxHQUFHLFVBQVMsWUFBMkI7SUFFaEQsTUFBTSxDQUFDLElBQUksT0FBTyxDQUFDLFNBQVMsQ0FBQyxZQUFZLENBQUMsQ0FBQztBQUMvQyxDQUFDLENBQUM7QUFDRixpQkFBUyxTQUFTLENBQUMiLCJmaWxlIjoidGFza2J1ZmZlci50YXNrY2hhaW4uanMiLCJzb3VyY2VzQ29udGVudCI6WyIvLy8gPHJlZmVyZW5jZSBwYXRoPVwiLi90eXBpbmdzL21haW4uZC50c1wiIC8+XG5pbXBvcnQgY2xhc3NlcyA9IHJlcXVpcmUoXCIuL3Rhc2tidWZmZXIuY2xhc3Nlc1wiKTtcbnZhciB0YXNrQ2hhaW4gPSBmdW5jdGlvbih0YXNrQXJyYXlBcmc6Y2xhc3Nlcy5UYXNrW10pe1xuXG4gICAgcmV0dXJuIG5ldyBjbGFzc2VzLlRhc2tDaGFpbih0YXNrQXJyYXlBcmcpO1xufTtcbmV4cG9ydCA9IHRhc2tDaGFpbjtcbiJdLCJzb3VyY2VSb290IjoiL3NvdXJjZS8ifQ==
|
12
npmextra.json
Normal file
12
npmextra.json
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"npmts":{
|
||||
"mode":"default",
|
||||
"testConfig": {
|
||||
"parallel": false
|
||||
}
|
||||
},
|
||||
"npmci": {
|
||||
"npmGlobalTools": [],
|
||||
"npmAccessLevel": "public"
|
||||
}
|
||||
}
|
@ -1,4 +0,0 @@
|
||||
{
|
||||
"mode":"default",
|
||||
"coveralls":true
|
||||
}
|
1114
package-lock.json
generated
Normal file
1114
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
39
package.json
39
package.json
@ -1,33 +1,44 @@
|
||||
{
|
||||
"name": "taskbuffer",
|
||||
"version": "0.0.1",
|
||||
"description": "manage triggers and execution of tasks with promises",
|
||||
"name": "@pushrocks/taskbuffer",
|
||||
"version": "2.0.5",
|
||||
"private": false,
|
||||
"description": "flexible task management. TypeScript ready!",
|
||||
"main": "dist/index.js",
|
||||
"typings": "dist/index.d.ts",
|
||||
"scripts": {
|
||||
"test": "(npmts)"
|
||||
"test": "(tstest test/)",
|
||||
"build": "(tsbuild)"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/pushrocks/taskbuffer.git"
|
||||
"url": "git+https://gitlab.com/pushrocks/taskbuffer.git"
|
||||
},
|
||||
"keywords": [
|
||||
"gulp",
|
||||
"tasks",
|
||||
"watch",
|
||||
"buffer"
|
||||
"task",
|
||||
"buffer",
|
||||
"TypeScript",
|
||||
"push.rocks"
|
||||
],
|
||||
"author": "Lossless GmbH",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/pushrocks/taskbuffer/issues"
|
||||
"url": "https://gitlab.com/pushrocks/taskbuffer/issues"
|
||||
},
|
||||
"homepage": "https://github.com/pushrocks/taskbuffer#readme",
|
||||
"homepage": "https://gitlab.com/pushrocks/taskbuffer#readme",
|
||||
"dependencies": {
|
||||
"beautylog": "^2.1.1",
|
||||
"npmts": "^3.0.2",
|
||||
"q": "^1.4.1"
|
||||
"@pushrocks/lik": "^3.0.1",
|
||||
"@pushrocks/smartdelay": "^2.0.1",
|
||||
"@pushrocks/smartlog": "^2.0.1",
|
||||
"@pushrocks/smartpromise": "^2.0.5",
|
||||
"@types/cron": "^1.3.0",
|
||||
"cron": "^1.3.0",
|
||||
"rxjs": "^6.2.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"should": "^8.2.2"
|
||||
"@gitzone/tsbuild": "^2.0.22",
|
||||
"@gitzone/tstest": "^1.0.11",
|
||||
"@pushrocks/tapbundle": "^3.0.1",
|
||||
"@types/node": "^10.5.6"
|
||||
}
|
||||
}
|
||||
|
87
readme.md
Normal file
87
readme.md
Normal file
@ -0,0 +1,87 @@
|
||||
# taskbuffer
|
||||
|
||||
flexible task management. TypeScript ready!
|
||||
|
||||
## Availabililty
|
||||
|
||||
[](https://www.npmjs.com/package/taskbuffer)
|
||||
[](https://GitLab.com/pushrocks/taskbuffer)
|
||||
[](https://github.com/pushrocks/taskbuffer)
|
||||
[](https://pushrocks.gitlab.io/taskbuffer/)
|
||||
|
||||
## Status for master
|
||||
|
||||
[](https://GitLab.com/pushrocks/taskbuffer/commits/master)
|
||||
[](https://GitLab.com/pushrocks/taskbuffer/commits/master)
|
||||
[](https://www.npmjs.com/package/taskbuffer)
|
||||
[](https://david-dm.org/pushrocks/taskbuffer)
|
||||
[](https://www.bithound.io/github/pushrocks/taskbuffer/master/dependencies/npm)
|
||||
[](https://www.bithound.io/github/pushrocks/taskbuffer)
|
||||
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
||||
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
||||
[](http://standardjs.com/)
|
||||
|
||||
## Install
|
||||
|
||||
```sh
|
||||
npm install taskbuffer --save
|
||||
```
|
||||
|
||||
## Concepts
|
||||
|
||||
### class `Task`
|
||||
|
||||
- A Task in its most simple form is a function that is executed when the task runs.
|
||||
- A Task can have a **preTask** and an **afterTask**
|
||||
(those are run before or after the main function whenever the task is called)
|
||||
- A Task can be buffered.
|
||||
That means it can be called multiple times in a very short time.
|
||||
However execution happens in line:
|
||||
meaning execution of the task's main function is on halt until the previous task call has finished.
|
||||
You can set bufferMax number, which is the max number of buffered task calls.
|
||||
Any additional calls will then be truncated
|
||||
- Task.trigger() and Task.triggerBuffered() always return a Promise
|
||||
which is fullfilled once the related task call has completed.
|
||||
- Task.triggered() is an Observable stream that emits events every time a task call is called and every time a call is completed.
|
||||
- Task is compatible to gulp streams.
|
||||
|
||||
### class `TaskChain`
|
||||
|
||||
- TaskChain extends Task.
|
||||
- Multiple Tasks can be combined in a bigger task using a TaskChain.
|
||||
- While the tasks are async in themselve, TaskChain **runs Tasks serialized** (one after the other)
|
||||
- that means that tasks can rely on each other and
|
||||
|
||||
### class `TaskParallel`
|
||||
|
||||
- TaskParallel extends Task.
|
||||
- like TaskChain, however **tasks run in parallel**
|
||||
- Tasks cannot rely on each other.
|
||||
|
||||
### Usage
|
||||
|
||||
We highly recommend TypeScript as this module supports **TypeScript intellisense**.
|
||||
|
||||
```javascript
|
||||
import * as taskbuffer from "taskbuffer";
|
||||
|
||||
myTask = new taskbuffer.Task({
|
||||
preTask: someOtherTask // optional, don't worry loops are prevented
|
||||
afterTask: someOtherTask // optional, don't worry loops are prevented
|
||||
name:"myTask1",
|
||||
buffered: true, // optional
|
||||
bufferMax: 3, // optional, call qeues greater than this are truncated
|
||||
execDelay: 1000, // optional, time in ms to wait before executing task call
|
||||
taskFunction:() => {
|
||||
// do some stuff and return promise
|
||||
// pass on any data through promise resolution
|
||||
// Use TypeScript for better understanding and code completion
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
For further information read the linked docs at the top of this README.
|
||||
|
||||
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
|
||||
|
||||
[](https://push.rocks)
|
118
test/test.1.task.ts
Normal file
118
test/test.1.task.ts
Normal file
@ -0,0 +1,118 @@
|
||||
import { expect, tap } from '@pushrocks/tapbundle';
|
||||
import taskbuffer = require('../ts/index');
|
||||
|
||||
import * as smartpromise from '@pushrocks/smartpromise';
|
||||
import * as smartdelay from '@pushrocks/smartdelay';
|
||||
|
||||
// setup some testData to work with
|
||||
let testTask: taskbuffer.Task;
|
||||
|
||||
let testPreTask = new taskbuffer.Task({
|
||||
taskFunction: function() {
|
||||
let done = smartpromise.defer();
|
||||
console.log('preTask executed');
|
||||
done.resolve();
|
||||
return done.promise;
|
||||
},
|
||||
preTask: testTask
|
||||
});
|
||||
|
||||
// some more tasks to test with
|
||||
let task1Counter = 0; // how often task 1 is being executed
|
||||
let task1 = new taskbuffer.Task({
|
||||
name: 'Task 1',
|
||||
taskFunction: () => {
|
||||
let done = smartpromise.defer();
|
||||
console.log('Task1 started');
|
||||
setTimeout(() => {
|
||||
task1Counter++;
|
||||
console.log('Task1 executed');
|
||||
done.resolve();
|
||||
}, 5000);
|
||||
return done.promise;
|
||||
}
|
||||
});
|
||||
|
||||
let task2 = new taskbuffer.Task({
|
||||
name: 'Task 1',
|
||||
taskFunction: () => {
|
||||
let done = smartpromise.defer();
|
||||
console.log('Task2 started');
|
||||
setTimeout(() => {
|
||||
console.log('Task2 executed');
|
||||
done.resolve();
|
||||
}, 5000);
|
||||
return done.promise;
|
||||
}
|
||||
});
|
||||
|
||||
let task3 = new taskbuffer.Task({
|
||||
name: 'Task 3',
|
||||
taskFunction: () => {
|
||||
let done = smartpromise.defer();
|
||||
console.log('Task3 started');
|
||||
setTimeout(() => {
|
||||
console.log('Task3 executed');
|
||||
done.resolve();
|
||||
}, 5000);
|
||||
return done.promise;
|
||||
}
|
||||
});
|
||||
|
||||
tap.test('new Task() should return a new task', async () => {
|
||||
testTask = new taskbuffer.Task({
|
||||
taskFunction: async () => {
|
||||
console.log('executed twice');
|
||||
},
|
||||
preTask: testPreTask
|
||||
});
|
||||
});
|
||||
|
||||
tap.test('expect testTask to be an instance of Task', async () => {
|
||||
expect(testTask).to.be.instanceof(taskbuffer.Task);
|
||||
});
|
||||
|
||||
tap.test('expect testTask.idle is true', async () => {
|
||||
if (!testTask.idle) {
|
||||
throw new Error('testTask.idle is not true');
|
||||
}
|
||||
});
|
||||
|
||||
tap.test('testTask.running should be of type boolean and initially false', async () => {
|
||||
expect(testTask.running).to.be.a('boolean');
|
||||
// tslint:disable-next-line:no-unused-expression
|
||||
expect(testTask.running).to.be.false;
|
||||
});
|
||||
|
||||
tap.test('testTask.trigger() should return Promise', async () => {
|
||||
expect(testTask.trigger()).to.be.instanceof(Promise);
|
||||
});
|
||||
|
||||
tap.test('testTask.trigger() returned Promise should be fullfilled', async () => {
|
||||
await testTask.trigger();
|
||||
});
|
||||
|
||||
tap.test('expect to run a task without pre and afterTask errorless', async () => {
|
||||
let localTestTask = new taskbuffer.Task({
|
||||
taskFunction: async () => {
|
||||
console.log('only once');
|
||||
}
|
||||
});
|
||||
await localTestTask.trigger();
|
||||
});
|
||||
|
||||
tap.test('expect task to run in buffered mode', async () => {
|
||||
let localTestTask = new taskbuffer.Task({
|
||||
taskFunction: async () => {
|
||||
await smartdelay.delayFor(3000);
|
||||
},
|
||||
buffered: true,
|
||||
bufferMax: 2
|
||||
});
|
||||
localTestTask.trigger();
|
||||
localTestTask.trigger();
|
||||
localTestTask.trigger();
|
||||
await localTestTask.trigger();
|
||||
});
|
||||
|
||||
tap.start();
|
48
test/test.2.taskchain.ts
Normal file
48
test/test.2.taskchain.ts
Normal file
@ -0,0 +1,48 @@
|
||||
import { expect, tap } from '@pushrocks/tapbundle';
|
||||
import taskbuffer = require('../ts/index');
|
||||
|
||||
import * as smartq from 'smartq';
|
||||
import * as smartdelay from '@pushrocks/smartdelay';
|
||||
|
||||
let task1Executed = false;
|
||||
let task1 = new taskbuffer.Task({
|
||||
taskFunction: async () => {
|
||||
await smartdelay.delayFor(2000);
|
||||
task1Executed = true;
|
||||
}
|
||||
});
|
||||
|
||||
let task2Executed = false;
|
||||
let task2 = new taskbuffer.Task({
|
||||
taskFunction: async () => {
|
||||
await smartdelay.delayFor(2000);
|
||||
task2Executed = true;
|
||||
}
|
||||
});
|
||||
|
||||
let task3Executed = false;
|
||||
let task3 = new taskbuffer.Task({
|
||||
taskFunction: async () => {
|
||||
await smartdelay.delayFor(2000);
|
||||
task3Executed = true;
|
||||
}
|
||||
});
|
||||
|
||||
tap.test('expect run tasks in sequence', async () => {
|
||||
let testTaskchain = new taskbuffer.Taskchain({
|
||||
name: 'Taskchain1',
|
||||
taskArray: [task1, task2, task3]
|
||||
});
|
||||
let testPromise = testTaskchain.trigger();
|
||||
await smartdelay.delayFor(2100);
|
||||
// tslint:disable-next-line:no-unused-expression
|
||||
expect(task1Executed).to.be.true;
|
||||
// tslint:disable-next-line:no-unused-expression
|
||||
expect(task2Executed).to.be.false;
|
||||
await smartdelay.delayFor(2100);
|
||||
// tslint:disable-next-line:no-unused-expression
|
||||
expect(task2Executed).to.be.true;
|
||||
await testPromise;
|
||||
});
|
||||
|
||||
tap.start();
|
38
test/test.3.taskparallel.ts
Normal file
38
test/test.3.taskparallel.ts
Normal file
@ -0,0 +1,38 @@
|
||||
import { expect, tap } from '@pushrocks/tapbundle';
|
||||
import taskbuffer = require('../ts/index');
|
||||
|
||||
import * as smartq from 'smartq';
|
||||
import * as smartdelay from '@pushrocks/smartdelay';
|
||||
|
||||
let task1Executed = false;
|
||||
let task1 = new taskbuffer.Task({
|
||||
taskFunction: async () => {
|
||||
await smartdelay.delayFor(2000);
|
||||
task1Executed = true;
|
||||
}
|
||||
});
|
||||
|
||||
let task2Executed = false;
|
||||
let task2 = new taskbuffer.Task({
|
||||
taskFunction: async () => {
|
||||
await smartdelay.delayFor(2000);
|
||||
task2Executed = true;
|
||||
}
|
||||
});
|
||||
|
||||
let task3Executed = false;
|
||||
let task3 = new taskbuffer.Task({
|
||||
taskFunction: async () => {
|
||||
await smartdelay.delayFor(2000);
|
||||
task3Executed = true;
|
||||
}
|
||||
});
|
||||
|
||||
tap.test('expect run in Parallel', async () => {
|
||||
let testTaskparallel = new taskbuffer.Taskparallel({
|
||||
taskArray: [task1, task2, task3]
|
||||
});
|
||||
await testTaskparallel.trigger();
|
||||
});
|
||||
|
||||
tap.start();
|
42
test/test.4.taskmanager.ts
Normal file
42
test/test.4.taskmanager.ts
Normal file
@ -0,0 +1,42 @@
|
||||
import { expect, tap } from '@pushrocks/tapbundle';
|
||||
import taskbuffer = require('../ts/index');
|
||||
|
||||
import * as smartpromise from '@pushrocks/smartpromise';
|
||||
import * as smartdelay from '@pushrocks/smartdelay';
|
||||
|
||||
let myTaskManager: taskbuffer.TaskManager;
|
||||
let taskRunCounter = 0;
|
||||
let taskDone = smartpromise.defer();
|
||||
|
||||
tap.test('should create an instance of TaskManager', async () => {
|
||||
myTaskManager = new taskbuffer.TaskManager();
|
||||
expect(myTaskManager).to.be.instanceof(taskbuffer.TaskManager);
|
||||
});
|
||||
|
||||
tap.test('should run the task as expected', async () => {
|
||||
let referenceBoolean = false;
|
||||
myTaskManager.addTask(
|
||||
new taskbuffer.Task({
|
||||
name: 'myTask',
|
||||
taskFunction: async () => {
|
||||
console.log('Task executed!');
|
||||
referenceBoolean = true;
|
||||
taskRunCounter++;
|
||||
if (taskRunCounter === 10) {
|
||||
taskDone.resolve();
|
||||
}
|
||||
}
|
||||
})
|
||||
);
|
||||
await myTaskManager.triggerTaskByName('myTask');
|
||||
// tslint:disable-next-line:no-unused-expression
|
||||
expect(referenceBoolean).to.be.true;
|
||||
});
|
||||
|
||||
tap.test('should schedule task', async () => {
|
||||
myTaskManager.scheduleTaskByName('myTask', '* * * * * *');
|
||||
await taskDone.promise;
|
||||
myTaskManager.descheduleTaskByName('myTask');
|
||||
});
|
||||
|
||||
tap.start();
|
64
test/test.5.task.paramflow.ts
Normal file
64
test/test.5.task.paramflow.ts
Normal file
@ -0,0 +1,64 @@
|
||||
import { expect, tap } from '@pushrocks/tapbundle';
|
||||
import taskbuffer = require('../ts/index');
|
||||
|
||||
import * as smartpromise from '@pushrocks/smartpromise';
|
||||
import * as smartdelay from '@pushrocks/smartdelay';
|
||||
|
||||
let flowTask1 = new taskbuffer.Task({
|
||||
taskFunction: (x: number) => {
|
||||
let done = smartpromise.defer();
|
||||
console.log('flowTask1');
|
||||
console.log(x);
|
||||
done.resolve(x);
|
||||
return done.promise;
|
||||
}
|
||||
});
|
||||
|
||||
let flowTaskBuffered = new taskbuffer.Task({
|
||||
taskFunction: (x: number) => {
|
||||
let done = smartpromise.defer();
|
||||
console.log('flowTask1');
|
||||
console.log(x);
|
||||
done.resolve(x);
|
||||
return done.promise;
|
||||
},
|
||||
buffered: true,
|
||||
bufferMax: 1
|
||||
});
|
||||
|
||||
let flowTask2 = new taskbuffer.Task({
|
||||
taskFunction: (x: number) => {
|
||||
let done = smartpromise.defer();
|
||||
console.log('flowTask2');
|
||||
console.log(x);
|
||||
done.resolve(x);
|
||||
return done.promise;
|
||||
},
|
||||
preTask: flowTask1
|
||||
});
|
||||
|
||||
let flowTask3 = new taskbuffer.Taskchain({
|
||||
taskArray: [flowTask1, flowTask2]
|
||||
});
|
||||
|
||||
tap.test('should let a value flow through a task', async () => {
|
||||
let result = await flowTask1.trigger(12);
|
||||
expect(result).to.equal(12);
|
||||
});
|
||||
|
||||
tap.test('expect values to flow between tasks', async () => {
|
||||
let result = await flowTask2.trigger(12);
|
||||
expect(result).to.equal(12);
|
||||
});
|
||||
|
||||
tap.test('expect values to flow between tasks when buffered', async () => {
|
||||
let result = await flowTaskBuffered.trigger(12);
|
||||
expect(result).to.equal(12);
|
||||
});
|
||||
|
||||
tap.test('expect values to flow between tasks in Taskchain', async () => {
|
||||
let result = await flowTask3.trigger(12);
|
||||
expect(result).to.equal(12);
|
||||
});
|
||||
|
||||
tap.start();
|
28
test/test.6.taskonce.ts
Normal file
28
test/test.6.taskonce.ts
Normal file
@ -0,0 +1,28 @@
|
||||
import { expect, tap } from '@pushrocks/tapbundle';
|
||||
|
||||
import * as taskbuffer from '../ts/index';
|
||||
|
||||
let myNumber = 0;
|
||||
let myTaskOnce: taskbuffer.TaskOnce;
|
||||
|
||||
tap.test('should create a valid instance of TaskOnce', async () => {
|
||||
myTaskOnce = new taskbuffer.TaskOnce({
|
||||
taskFunction: async () => {
|
||||
myNumber++;
|
||||
}
|
||||
});
|
||||
expect(myTaskOnce).to.be.instanceof(taskbuffer.TaskOnce);
|
||||
});
|
||||
|
||||
tap.test('myNumber should still be 0', async () => {
|
||||
expect(myNumber).to.equal(0);
|
||||
});
|
||||
|
||||
tap.test('myTaskOnce should trigger once', async () => {
|
||||
await myTaskOnce.trigger();
|
||||
await myTaskOnce.trigger();
|
||||
await myTaskOnce.trigger();
|
||||
expect(myNumber).to.equal(1);
|
||||
});
|
||||
|
||||
tap.start();
|
13
test/test.js
13
test/test.js
@ -1,13 +0,0 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
/// <reference path="../ts/typings/main.d.ts" />
|
||||
var taskbuffer = require("../dist/index.js");
|
||||
describe("taskbuffer.task", function () {
|
||||
describe(".task", function () {
|
||||
it("should return a new task", function () {
|
||||
var myTask = taskbuffer.task();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRlc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsZ0RBQWdEO0FBQ2hELElBQUksVUFBVSxHQUFHLE9BQU8sQ0FBQyxrQkFBa0IsQ0FBQyxDQUFDO0FBQzdDLFFBQVEsQ0FBQyxpQkFBaUIsRUFBQztJQUN2QixRQUFRLENBQUMsT0FBTyxFQUFDO1FBQ2IsRUFBRSxDQUFDLDBCQUEwQixFQUFDO1lBQzFCLElBQUksTUFBTSxHQUFHLFVBQVUsQ0FBQyxJQUFJLEVBQUUsQ0FBQztRQUNuQyxDQUFDLENBQUMsQ0FBQTtJQUNOLENBQUMsQ0FBQyxDQUFDO0FBQ1AsQ0FBQyxDQUFDLENBQUMiLCJmaWxlIjoidGVzdC5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8vLyA8cmVmZXJlbmNlIHBhdGg9XCIuLi90cy90eXBpbmdzL21haW4uZC50c1wiIC8+XG52YXIgdGFza2J1ZmZlciA9IHJlcXVpcmUoXCIuLi9kaXN0L2luZGV4LmpzXCIpO1xuZGVzY3JpYmUoXCJ0YXNrYnVmZmVyLnRhc2tcIixmdW5jdGlvbigpe1xuICAgIGRlc2NyaWJlKFwiLnRhc2tcIixmdW5jdGlvbigpe1xuICAgICAgICBpdChcInNob3VsZCByZXR1cm4gYSBuZXcgdGFza1wiLGZ1bmN0aW9uKCl7XG4gICAgICAgICAgICB2YXIgbXlUYXNrID0gdGFza2J1ZmZlci50YXNrKCk7XG4gICAgICAgIH0pXG4gICAgfSk7XG59KTsiXSwic291cmNlUm9vdCI6Ii9zb3VyY2UvIn0=
|
@ -1 +0,0 @@
|
||||
{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,IAAI,UAAU,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;AAC7C,QAAQ,CAAC,iBAAiB,EAAC;IACvB,QAAQ,CAAC,OAAO,EAAC;QACb,EAAE,CAAC,0BAA0B,EAAC;YAC1B,IAAI,MAAM,GAAG,UAAU,CAAC,IAAI,EAAE,CAAC;QACnC,CAAC,CAAC,CAAA;IACN,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
@ -1,9 +0,0 @@
|
||||
/// <reference path="../ts/typings/main.d.ts" />
|
||||
var taskbuffer = require("../dist/index.js");
|
||||
describe("taskbuffer.task",function(){
|
||||
describe(".task",function(){
|
||||
it("should return a new task",function(){
|
||||
var myTask = taskbuffer.task();
|
||||
})
|
||||
});
|
||||
});
|
17
ts/index.ts
17
ts/index.ts
@ -1,11 +1,8 @@
|
||||
/// <reference path="./typings/main.d.ts" />
|
||||
import plugins = require("./taskbuffer.plugins");
|
||||
import classes = require("./taskbuffer.classes");
|
||||
import task = require("./taskbuffer.task");
|
||||
import taskchain = require("./taskbuffer.taskchain");
|
||||
export { Task, ITaskFunction } from './taskbuffer.classes.task';
|
||||
export { Taskchain } from './taskbuffer.classes.taskchain';
|
||||
export { Taskparallel } from './taskbuffer.classes.taskparallel';
|
||||
export { TaskManager } from './taskbuffer.classes.taskmanager';
|
||||
export { TaskOnce } from './taskbuffer.classes.taskonce';
|
||||
|
||||
var taskbuffer = {
|
||||
task: task
|
||||
};
|
||||
|
||||
export = taskbuffer;
|
||||
// import for naming only
|
||||
import './taskbuffer.classes.helpers';
|
||||
|
160
ts/taskbuffer.classes.helpers.ts
Normal file
160
ts/taskbuffer.classes.helpers.ts
Normal file
@ -0,0 +1,160 @@
|
||||
import plugins = require('./taskbuffer.plugins');
|
||||
import { Task, ITaskFunction } from './taskbuffer.classes.task';
|
||||
|
||||
export let emptyTaskFunction: ITaskFunction = function(x) {
|
||||
let done = plugins.smartpromise.defer();
|
||||
done.resolve();
|
||||
return done.promise;
|
||||
};
|
||||
|
||||
export let isTask = function(taskArg: Task): boolean {
|
||||
if (taskArg instanceof Task && typeof taskArg.taskFunction === 'function') {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
export let isTaskTouched = (taskArg: Task, touchedTasksArray: Task[]): boolean => {
|
||||
let result = false;
|
||||
for (let keyArg in touchedTasksArray) {
|
||||
if (taskArg === touchedTasksArray[keyArg]) {
|
||||
result = true;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
export let runTask = async (taskArg: Task, optionsArg: { x?; touchedTasksArray?: Task[] }) => {
|
||||
let done = plugins.smartpromise.defer();
|
||||
|
||||
// pay respect to execDelay
|
||||
if (taskArg.execDelay) {
|
||||
await plugins.smartdelay.delayFor(taskArg.execDelay);
|
||||
}
|
||||
|
||||
// set running params
|
||||
taskArg.running = true;
|
||||
|
||||
done.promise.then(async () => {
|
||||
taskArg.running = false;
|
||||
});
|
||||
|
||||
// handle options
|
||||
let options = {
|
||||
...{ x: undefined, touchedTasksArray: [] },
|
||||
...optionsArg
|
||||
};
|
||||
let x = options.x;
|
||||
let touchedTasksArray: Task[] = options.touchedTasksArray;
|
||||
|
||||
touchedTasksArray.push(taskArg);
|
||||
|
||||
// run the task cascade
|
||||
let localDeferred = plugins.smartpromise.defer();
|
||||
localDeferred.promise
|
||||
.then(() => {
|
||||
if (taskArg.preTask && !isTaskTouched(taskArg.preTask, touchedTasksArray)) {
|
||||
return runTask(taskArg.preTask, { x: x, touchedTasksArray: touchedTasksArray });
|
||||
} else {
|
||||
let done2 = plugins.smartpromise.defer();
|
||||
done2.resolve(x);
|
||||
return done2.promise;
|
||||
}
|
||||
})
|
||||
.then(x => {
|
||||
return taskArg.taskFunction(x);
|
||||
})
|
||||
.then(x => {
|
||||
if (taskArg.afterTask && !isTaskTouched(taskArg.afterTask, touchedTasksArray)) {
|
||||
return runTask(taskArg.afterTask, { x: x, touchedTasksArray: touchedTasksArray });
|
||||
} else {
|
||||
let done2 = plugins.smartpromise.defer();
|
||||
done2.resolve(x);
|
||||
return done2.promise;
|
||||
}
|
||||
})
|
||||
.then(x => {
|
||||
done.resolve(x);
|
||||
})
|
||||
.catch(err => {
|
||||
console.log(err);
|
||||
});
|
||||
localDeferred.resolve();
|
||||
return await done.promise;
|
||||
};
|
||||
|
||||
export interface cycleObject {
|
||||
cycleCounter: number;
|
||||
deferred: plugins.smartpromise.Deferred<any>;
|
||||
}
|
||||
|
||||
export class CycleCounter {
|
||||
task: Task;
|
||||
cycleObjectArray: cycleObject[] = [];
|
||||
constructor(taskArg: Task) {
|
||||
this.task = taskArg;
|
||||
}
|
||||
getPromiseForCycle(cycleCountArg: number) {
|
||||
let done = plugins.smartpromise.defer();
|
||||
let cycleObject: cycleObject = {
|
||||
cycleCounter: cycleCountArg,
|
||||
deferred: done
|
||||
};
|
||||
this.cycleObjectArray.push(cycleObject);
|
||||
return done.promise;
|
||||
}
|
||||
informOfCycle(x) {
|
||||
let newCycleObjectArray: cycleObject[] = [];
|
||||
this.cycleObjectArray.forEach(cycleObjectArg => {
|
||||
cycleObjectArg.cycleCounter--;
|
||||
if (cycleObjectArg.cycleCounter <= 0) {
|
||||
cycleObjectArg.deferred.resolve(x);
|
||||
} else {
|
||||
newCycleObjectArray.push(cycleObjectArg);
|
||||
}
|
||||
});
|
||||
this.cycleObjectArray = newCycleObjectArray;
|
||||
}
|
||||
}
|
||||
|
||||
export class BufferRunner {
|
||||
task: Task;
|
||||
// initialze by default
|
||||
bufferCounter: number = 0;
|
||||
running: boolean = false;
|
||||
constructor(taskArg: Task) {
|
||||
this.task = taskArg;
|
||||
}
|
||||
|
||||
trigger(x): Promise<any> {
|
||||
if (!(this.bufferCounter >= this.task.bufferMax)) {
|
||||
this.bufferCounter++;
|
||||
}
|
||||
let returnPromise: Promise<any> = this.task.cycleCounter.getPromiseForCycle(
|
||||
this.bufferCounter + 1
|
||||
);
|
||||
if (!this.running) {
|
||||
this._run(x);
|
||||
}
|
||||
return returnPromise;
|
||||
}
|
||||
|
||||
private _run(x) {
|
||||
let recursiveBufferRunner = x => {
|
||||
if (this.bufferCounter >= 0) {
|
||||
this.running = true;
|
||||
this.task.running = true;
|
||||
runTask(this.task, { x: x }).then(x => {
|
||||
this.bufferCounter--;
|
||||
this.task.cycleCounter.informOfCycle(x);
|
||||
recursiveBufferRunner(x);
|
||||
});
|
||||
} else {
|
||||
this.running = false;
|
||||
this.task.running = false;
|
||||
}
|
||||
};
|
||||
recursiveBufferRunner(x);
|
||||
}
|
||||
}
|
106
ts/taskbuffer.classes.task.ts
Normal file
106
ts/taskbuffer.classes.task.ts
Normal file
@ -0,0 +1,106 @@
|
||||
import * as plugins from './taskbuffer.plugins';
|
||||
import * as helpers from './taskbuffer.classes.helpers';
|
||||
|
||||
export interface ITaskFunction {
|
||||
(x?: any): PromiseLike<any>;
|
||||
}
|
||||
|
||||
export class Task {
|
||||
// man datory properties
|
||||
name: string;
|
||||
taskFunction: ITaskFunction;
|
||||
buffered: boolean;
|
||||
|
||||
bufferMax: number;
|
||||
execDelay: number;
|
||||
|
||||
// tasks to run before and after
|
||||
preTask: Task;
|
||||
afterTask: Task;
|
||||
|
||||
// initialize by default
|
||||
running: boolean = false;
|
||||
bufferRunner = new helpers.BufferRunner(this);
|
||||
cycleCounter = new helpers.CycleCounter(this);
|
||||
|
||||
idle: boolean = true;
|
||||
private _state: string = 'ready';
|
||||
|
||||
constructor(optionsArg: {
|
||||
/**
|
||||
* the task function to run, must return promise
|
||||
*/
|
||||
taskFunction: ITaskFunction;
|
||||
/**
|
||||
* any other task to run before
|
||||
*/
|
||||
preTask?: Task;
|
||||
/**
|
||||
* any other task to run after
|
||||
*/
|
||||
afterTask?: Task;
|
||||
/**
|
||||
* wether this task should run buffered
|
||||
*/
|
||||
buffered?: boolean;
|
||||
/**
|
||||
* the maximum buffer
|
||||
*/
|
||||
bufferMax?: number;
|
||||
/**
|
||||
* the execution delay, before the task is executed
|
||||
* only makes sense when running in buffered mode
|
||||
*/
|
||||
execDelay?: number;
|
||||
/**
|
||||
* the name of the task
|
||||
*/
|
||||
name?: string;
|
||||
}) {
|
||||
this.taskFunction = optionsArg.taskFunction;
|
||||
this.preTask = optionsArg.preTask;
|
||||
this.afterTask = optionsArg.afterTask;
|
||||
this.idle = !this.running;
|
||||
this.buffered = optionsArg.buffered;
|
||||
this.bufferMax = optionsArg.bufferMax;
|
||||
this.execDelay = optionsArg.execDelay;
|
||||
this.name = optionsArg.name;
|
||||
}
|
||||
|
||||
/**
|
||||
* trigger the task. Will trigger buffered if this.buffered is true
|
||||
*/
|
||||
trigger(x?): Promise<any> {
|
||||
if (this.buffered) {
|
||||
return this.triggerBuffered(x);
|
||||
} else {
|
||||
return this.triggerUnBuffered(x);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* trigger task unbuffered.
|
||||
*/
|
||||
triggerUnBuffered(x?): Promise<any> {
|
||||
return helpers.runTask(this, { x: x });
|
||||
}
|
||||
|
||||
/**
|
||||
* trigger task buffered.
|
||||
*/
|
||||
triggerBuffered(x?): Promise<any> {
|
||||
return this.bufferRunner.trigger(x);
|
||||
}
|
||||
|
||||
get state(): string {
|
||||
return this._state;
|
||||
}
|
||||
|
||||
set state(stateArg: string) {
|
||||
if (stateArg === 'locked') {
|
||||
this._state = 'locked';
|
||||
} else {
|
||||
plugins.smartlog.defaultLogger.error('state type ' + stateArg + ' could not be set');
|
||||
}
|
||||
}
|
||||
}
|
58
ts/taskbuffer.classes.taskchain.ts
Normal file
58
ts/taskbuffer.classes.taskchain.ts
Normal file
@ -0,0 +1,58 @@
|
||||
// TaskChain chains tasks
|
||||
// and extends Task
|
||||
|
||||
import * as plugins from './taskbuffer.plugins';
|
||||
import { Task } from './taskbuffer.classes.task';
|
||||
import helpers = require('./taskbuffer.classes.helpers');
|
||||
|
||||
export class Taskchain extends Task {
|
||||
taskArray: Task[];
|
||||
constructor(optionsArg: {
|
||||
taskArray: Task[];
|
||||
name?: string;
|
||||
log?: boolean;
|
||||
buffered?: boolean;
|
||||
bufferMax?: number;
|
||||
}) {
|
||||
let options = {
|
||||
...{
|
||||
name: 'unnamed Taskchain',
|
||||
log: false
|
||||
},
|
||||
...optionsArg,
|
||||
...{
|
||||
taskFunction: (x: any) => {
|
||||
// this is the function that gets executed when TaskChain is triggered
|
||||
let done = plugins.smartpromise.defer(); // this is the starting Deferred object
|
||||
let taskCounter = 0; // counter for iterating async over the taskArray
|
||||
let iterateTasks = x => {
|
||||
if (typeof this.taskArray[taskCounter] !== 'undefined') {
|
||||
console.log(this.name + ' running: Task' + this.taskArray[taskCounter].name);
|
||||
this.taskArray[taskCounter].trigger(x).then(x => {
|
||||
plugins.smartlog.defaultLogger.info(this.taskArray[taskCounter].name);
|
||||
taskCounter++;
|
||||
iterateTasks(x);
|
||||
});
|
||||
} else {
|
||||
console.log('Taskchain "' + this.name + '" completed successfully');
|
||||
done.resolve(x);
|
||||
}
|
||||
};
|
||||
iterateTasks(x);
|
||||
return done.promise;
|
||||
}
|
||||
}
|
||||
};
|
||||
super(options);
|
||||
this.taskArray = optionsArg.taskArray;
|
||||
}
|
||||
addTask(taskArg: Task) {
|
||||
this.taskArray.push(taskArg);
|
||||
}
|
||||
removeTask(taskArg: Task) {
|
||||
// TODO:
|
||||
}
|
||||
shiftTask() {
|
||||
// TODO:
|
||||
}
|
||||
}
|
95
ts/taskbuffer.classes.taskmanager.ts
Normal file
95
ts/taskbuffer.classes.taskmanager.ts
Normal file
@ -0,0 +1,95 @@
|
||||
import * as plugins from './taskbuffer.plugins';
|
||||
import { Task } from './taskbuffer.classes.task';
|
||||
|
||||
// interfaces
|
||||
import { Objectmap } from '@pushrocks/lik';
|
||||
|
||||
export class TaskManager {
|
||||
taskMap = new plugins.lik.Objectmap<Task>();
|
||||
private cronJobMap = new plugins.lik.Objectmap<ICronJob>();
|
||||
constructor() {
|
||||
// nothing here
|
||||
}
|
||||
|
||||
/**
|
||||
* checks if a task is already present
|
||||
* @param taskNameArg
|
||||
*/
|
||||
getTaskByName(taskNameArg): Task {
|
||||
return this.taskMap.find(itemArg => {
|
||||
return itemArg.name === taskNameArg;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* adds a Task to the TaskManager
|
||||
* @param taskArg
|
||||
*/
|
||||
addTask(taskArg: Task): void {
|
||||
if (!taskArg.name) {
|
||||
throw new Error('taskArg needs a name to be added to taskManager');
|
||||
}
|
||||
this.taskMap.add(taskArg);
|
||||
}
|
||||
|
||||
/**
|
||||
* adds and schedules a task at once
|
||||
* @param taskArg
|
||||
* @param cronStringArg
|
||||
*/
|
||||
addAndScheduleTask(taskArg: Task, cronStringArg: string) {
|
||||
this.addTask(taskArg);
|
||||
let taskName = taskArg.name;
|
||||
this.scheduleTaskByName(taskName, cronStringArg);
|
||||
}
|
||||
|
||||
/**
|
||||
* triggers a task in the TaskManagerByName
|
||||
* @param taskNameArg
|
||||
*/
|
||||
triggerTaskByName(taskNameArg: string): Promise<any> {
|
||||
let taskToTrigger = this.getTaskByName(taskNameArg);
|
||||
if (!taskToTrigger) {
|
||||
throw new Error(`There is no task with the name of ${taskNameArg}`);
|
||||
}
|
||||
return taskToTrigger.trigger();
|
||||
}
|
||||
|
||||
/**
|
||||
* schedules the task by name
|
||||
* @param taskNameArg
|
||||
*/
|
||||
scheduleTaskByName(taskNameArg: string, cronStringArg: string) {
|
||||
let taskToSchedule = this.getTaskByName(taskNameArg);
|
||||
let job = new plugins.cron.CronJob({
|
||||
cronTime: cronStringArg,
|
||||
onTick: () => {
|
||||
this.triggerTaskByName(taskNameArg);
|
||||
},
|
||||
start: true
|
||||
});
|
||||
this.cronJobMap.add({
|
||||
taskNameArg: taskToSchedule.name,
|
||||
cronString: cronStringArg,
|
||||
job: job
|
||||
});
|
||||
}
|
||||
|
||||
descheduleTaskByName(taskNameArg: string) {
|
||||
let descheduledCron = this.cronJobMap.findOneAndRemove(itemArg => {
|
||||
return itemArg.taskNameArg === taskNameArg;
|
||||
});
|
||||
descheduledCron.job.stop();
|
||||
}
|
||||
/**
|
||||
* returns all schedules of a specific task
|
||||
* @param taskNameArg
|
||||
*/
|
||||
getSchedulesForTaskName(taskNameArg: string) {}
|
||||
}
|
||||
|
||||
export interface ICronJob {
|
||||
cronString: string;
|
||||
taskNameArg: string;
|
||||
job: any;
|
||||
}
|
21
ts/taskbuffer.classes.taskonce.ts
Normal file
21
ts/taskbuffer.classes.taskonce.ts
Normal file
@ -0,0 +1,21 @@
|
||||
import * as plugins from './taskbuffer.plugins';
|
||||
|
||||
import { Task, ITaskFunction } from './taskbuffer.classes.task';
|
||||
|
||||
/**
|
||||
* TaskOnce is run exactly once, no matter how often it is triggered
|
||||
*/
|
||||
export class TaskOnce extends Task {
|
||||
hasTriggered: boolean = false;
|
||||
constructor(optionsArg: { name?: string; taskFunction: ITaskFunction }) {
|
||||
super({
|
||||
name: optionsArg.name,
|
||||
taskFunction: async () => {
|
||||
if (!this.hasTriggered) {
|
||||
this.hasTriggered = true;
|
||||
await optionsArg.taskFunction();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
25
ts/taskbuffer.classes.taskparallel.ts
Normal file
25
ts/taskbuffer.classes.taskparallel.ts
Normal file
@ -0,0 +1,25 @@
|
||||
import * as plugins from './taskbuffer.plugins';
|
||||
import * as helpers from './taskbuffer.classes.helpers';
|
||||
import { Task } from './taskbuffer.classes.task';
|
||||
|
||||
export class Taskparallel extends Task {
|
||||
taskArray: Task[];
|
||||
constructor(optionsArg: { taskArray: Task[] }) {
|
||||
const options = {
|
||||
...optionsArg,
|
||||
...{
|
||||
taskFunction: () => {
|
||||
let done = plugins.smartpromise.defer();
|
||||
let promiseArray: Promise<any>[] = []; // stores promises of all tasks, since they run in parallel
|
||||
this.taskArray.forEach(function(taskArg) {
|
||||
promiseArray.push(taskArg.trigger());
|
||||
});
|
||||
Promise.all(promiseArray).then(done.resolve);
|
||||
return done.promise;
|
||||
}
|
||||
}
|
||||
};
|
||||
super(options);
|
||||
this.taskArray = optionsArg.taskArray;
|
||||
}
|
||||
}
|
@ -1,43 +0,0 @@
|
||||
/// <reference path="./typings/main.d.ts" />
|
||||
import plugins = require("./taskbuffer.plugins");
|
||||
export class Task {
|
||||
task:any;
|
||||
idle:boolean;
|
||||
buffered:boolean;
|
||||
bufferedForced:boolean;
|
||||
running:boolean;
|
||||
private _state:string;
|
||||
preTask:Task;
|
||||
afterTask:Task;
|
||||
|
||||
constructor(taskArg,optionsArg?:{preTask?:Task,afterTask?:Task}){
|
||||
this.task = taskArg;
|
||||
}
|
||||
trigger(){
|
||||
this.preTask.task()
|
||||
.then(this.task)
|
||||
.then(this.afterTask.task);
|
||||
};
|
||||
triggerBuffered(){
|
||||
var done = plugins.Q.defer();
|
||||
}
|
||||
|
||||
get state():string {
|
||||
return this._state;
|
||||
}
|
||||
set state(stateArg:string){
|
||||
if (stateArg == "locked"){
|
||||
this._state = "locked";
|
||||
} else {
|
||||
plugins.beautylog.error("state type" );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export class TaskChain extends Task {
|
||||
constructor(taskArrayArg:Task[]){
|
||||
super({
|
||||
task:function(){}
|
||||
});
|
||||
}
|
||||
}
|
@ -1,6 +1,8 @@
|
||||
/// <reference path="./typings/main.d.ts" />
|
||||
var plugins = {
|
||||
beautylog: require("beautylog"),
|
||||
Q: require("q")
|
||||
};
|
||||
export = plugins;
|
||||
import * as smartlog from '@pushrocks/smartlog';
|
||||
let cron = require('cron');
|
||||
import * as lik from '@pushrocks/lik';
|
||||
import * as rxjs from 'rxjs';
|
||||
import * as smartpromise from '@pushrocks/smartpromise';
|
||||
import * as smartdelay from '@pushrocks/smartdelay';
|
||||
|
||||
export { smartlog, cron, lik, rxjs, smartpromise, smartdelay };
|
||||
|
@ -1 +0,0 @@
|
||||
/// <reference path="./typings/main.d.ts" />
|
@ -1,7 +0,0 @@
|
||||
/// <reference path="./typings/main.d.ts" />
|
||||
import classes = require("./taskbuffer.classes");
|
||||
var task = function(taskArg,options?){
|
||||
var task = taskArg
|
||||
return new classes.Task(task,options);
|
||||
};
|
||||
export = task;
|
@ -1,7 +0,0 @@
|
||||
/// <reference path="./typings/main.d.ts" />
|
||||
import classes = require("./taskbuffer.classes");
|
||||
var taskChain = function(taskArrayArg:classes.Task[]){
|
||||
|
||||
return new classes.TaskChain(taskArrayArg);
|
||||
};
|
||||
export = taskChain;
|
@ -1,7 +0,0 @@
|
||||
{
|
||||
"ambientDependencies": {
|
||||
"node": "github:DefinitelyTyped/DefinitelyTyped/node/node.d.ts",
|
||||
"mocha": "github:Bartvds/tsd-deftools/typings/DefinitelyTyped/mocha/mocha.d.ts",
|
||||
"colors": "github:DefinitelyTyped/DefinitelyTyped/colors/colors.d.ts"
|
||||
}
|
||||
}
|
3
tslint.json
Normal file
3
tslint.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "tslint-config-standard"
|
||||
}
|
Reference in New Issue
Block a user