Compare commits

...

49 Commits

Author SHA1 Message Date
d5d347721a 2.0.11 2018-11-26 17:55:16 +01:00
6a047d6333 fix(core): update 2018-11-26 17:55:15 +01:00
6e7b4dd18e 2.0.10 2018-11-26 17:46:32 +01:00
debc5f1524 fix(core): update 2018-11-26 17:46:31 +01:00
8d03561762 2.0.9 2018-11-26 17:45:59 +01:00
f516a6e753 fix(core): update 2018-11-26 17:45:58 +01:00
1c4f6a8bf9 2.0.8 2018-10-28 19:18:42 +01:00
4fe3775904 fix(child processes): now run detached 2018-10-28 19:18:42 +01:00
dcee2d6233 2.0.7 2018-10-28 19:12:16 +01:00
39d457382f fix(exec): processes now run detached 2018-10-28 19:12:15 +01:00
e6ed457501 2.0.6 2018-08-05 23:27:38 +02:00
0a6484762c fix(ci): update testing framework 2018-08-05 23:27:37 +02:00
baa3e4e6e9 2.0.5 2018-08-04 16:43:02 +02:00
0d68361381 fix(PATH): add proper PATH handling for child processes 2018-08-04 16:43:02 +02:00
286d80328c 2.0.4 2018-07-30 16:34:45 +02:00
2a71f00ab0 2.0.3 2018-07-30 16:19:38 +02:00
80a44a43cb fix(ci): update build step to be faster 2018-07-30 16:19:38 +02:00
5ea780acda 2.0.2 2018-07-30 16:08:14 +02:00
7c9cf6e70d fix(structure): clean up 2018-07-30 16:08:14 +02:00
697f789b55 2.0.1 2018-07-30 16:06:43 +02:00
f452964779 fix(test): add test for environment 2018-07-30 16:06:43 +02:00
f2db8dc41f 2.0.0 2018-07-30 16:03:48 +02:00
2ca593297c BREAKING CHANGE(update the API): update 2018-07-30 16:03:48 +02:00
a63ae38437 1.0.21 2018-07-18 21:15:43 +02:00
03d442bf60 fix(ci): update npm access level 2018-07-18 21:15:43 +02:00
901348dfe9 1.0.20 2018-07-18 20:58:12 +02:00
2e94eb5467 fix(dependencies): remove shelljs and go node native 2018-07-18 20:58:12 +02:00
f2f048a40b 1.0.19 2017-10-30 20:46:12 +01:00
db506a6eb1 update to latest tools 2017-10-30 20:46:08 +01:00
66cdc7632e 1.0.18 2017-09-10 16:38:54 +02:00
604fa228f7 add docs 2017-09-10 16:38:52 +02:00
e0e8e9f29a 1.0.17 2017-09-09 14:46:54 +02:00
aa54912346 add docs 2017-09-09 14:46:50 +02:00
5457dcfc8d 1.0.16 2017-09-09 13:28:22 +02:00
5c7b0fafea update npmextra.json 2017-09-09 13:28:20 +02:00
4470250091 1.0.15 2017-09-09 13:21:07 +02:00
5f17ca3d63 update ci 2017-09-09 13:21:03 +02:00
226a518369 1.0.14 2017-09-09 13:20:26 +02:00
9709920a72 fix StdErr 2017-09-09 13:20:24 +02:00
b6589d0850 1.0.13 2017-07-19 14:56:37 +02:00
0f2d68cf5f implement execSilent and execStrict 2017-07-19 14:56:33 +02:00
01e6411c29 1.0.12 2017-07-18 15:24:10 +02:00
b356bcbaed update ci 2017-07-18 15:24:05 +02:00
35b81dc6d9 1.0.11 2017-07-18 15:22:24 +02:00
47321b02b8 fix tests 2017-07-18 15:22:19 +02:00
7c0af2b0bc 1.0.10 2017-07-18 15:17:08 +02:00
ced0ce7b53 now working in child processes 2017-07-18 15:17:05 +02:00
a745a435db 1.0.9 2017-07-16 16:19:51 +02:00
6aeb0c1558 update 2017-07-16 16:19:48 +02:00
22 changed files with 1471 additions and 794 deletions

View File

@ -3,66 +3,123 @@ image: hosttoday/ht-docker-node:npmci
cache:
paths:
- .yarn/
- .npmci_cache/
key: "$CI_BUILD_STAGE"
stages:
- security
- test
- release
- trigger
- pages
- metadata
testLEGACY:
stage: test
# ====================
# security stage
# ====================
mirror:
stage: security
script:
- npmci test legacy
coverage: /\d+.?\d+?\%\s*coverage/
- npmci git mirror
tags:
- docker
allow_failure: true
- docker
- notpriv
snyk:
stage: security
script:
- npmci npm prepare
- npmci command npm install -g snyk
- npmci command npm install --ignore-scripts
- npmci command snyk test
tags:
- docker
- notpriv
# ====================
# test stage
# ====================
testLTS:
stage: test
script:
- npmci test lts
- npmci npm prepare
- npmci node install lts
- npmci npm install
- npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
- docker
- notpriv
testSTABLE:
stage: test
script:
- npmci test stable
- npmci npm prepare
- npmci node install stable
- npmci npm install
- npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
- docker
- notpriv
release:
stage: release
script:
- npmci publish
- npmci node install stable
- npmci npm publish
only:
- tags
- tags
tags:
- docker
- 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: trigger
stage: metadata
script:
- npmci trigger
- npmci trigger
only:
- tags
- tags
tags:
- docker
- docker
- notpriv
pages:
image: hosttoday/ht-docker-node:npmpage
stage: pages
image: hosttoday/ht-docker-node:npmci
stage: metadata
script:
- npmci command npmpage --publish gitlab
- npmci command npm install -g typedoc typescript
- npmci npm prepare
- 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

View File

@ -1,13 +1,16 @@
# smartshell
shell actions designed as promises
## Availabililty
[![npm](https://pushrocks.gitlab.io/assets/repo-button-npm.svg)](https://www.npmjs.com/package/smartshell)
[![git](https://pushrocks.gitlab.io/assets/repo-button-git.svg)](https://GitLab.com/pushrocks/smartshell)
[![git](https://pushrocks.gitlab.io/assets/repo-button-mirror.svg)](https://github.com/pushrocks/smartshell)
[![docs](https://pushrocks.gitlab.io/assets/repo-button-docs.svg)](https://pushrocks.gitlab.io/smartshell/)
## Status for master
[![build status](https://GitLab.com/pushrocks/smartshell/badges/master/build.svg)](https://GitLab.com/pushrocks/smartshell/commits/master)
[![coverage report](https://GitLab.com/pushrocks/smartshell/badges/master/coverage.svg)](https://GitLab.com/pushrocks/smartshell/commits/master)
[![npm downloads per month](https://img.shields.io/npm/dm/smartshell.svg)](https://www.npmjs.com/package/smartshell)
@ -19,6 +22,7 @@ shell actions designed as promises
[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)
## Usage
Use TypeScript for best in class instellisense.
For further information read the linked docs at the top of this README.

2
dist/index.d.ts vendored
View File

@ -1,2 +0,0 @@
export * from './smartshell.wrap';
export * from './smartshell.classes.smartshell';

8
dist/index.js vendored
View File

@ -1,8 +0,0 @@
"use strict";
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
__export(require("./smartshell.wrap"));
__export(require("./smartshell.classes.smartshell"));
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztBQUFBLHVDQUFpQztBQUNqQyxxREFBK0MifQ==

View File

@ -1,28 +0,0 @@
import * as smartshellWrap from './smartshell.wrap';
export declare type TExecutor = 'sh' | 'bash';
export interface ISmartshellContructorOptions {
executor: TExecutor;
sourceFilePaths: string[];
}
export declare class Smartshell {
executor: TExecutor;
sourceFileArray: string[];
constructor(optionsArg: ISmartshellContructorOptions);
addSourceFiles(sourceFilePathsArray: string[]): void;
cleanSourceFiles(): void;
/**
* executes silently and returns IExecResult
* @param commandArg
*/
execSilent(commandArg: string): Promise<smartshellWrap.IExecResult>;
/**
* executes and returns IExecResult
* @param commandArg
*/
exec(commandArg: string): Promise<smartshellWrap.IExecResult>;
/**
* creates the final sourcing string
* @param commandArg
*/
private createExecString(commandArg);
}

View File

@ -1,66 +0,0 @@
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
const smartshellWrap = require("./smartshell.wrap");
class Smartshell {
constructor(optionsArg) {
this.sourceFileArray = [];
this.executor = optionsArg.executor;
for (let sourceFilePath of optionsArg.sourceFilePaths) {
this.sourceFileArray.push(sourceFilePath);
}
}
addSourceFiles(sourceFilePathsArray) {
for (let sourceFilePath of sourceFilePathsArray) {
this.sourceFileArray.push(sourceFilePath);
}
}
cleanSourceFiles() {
this.sourceFileArray = [];
}
/**
* executes silently and returns IExecResult
* @param commandArg
*/
execSilent(commandArg) {
return __awaiter(this, void 0, void 0, function* () {
let execCommand = this.createExecString(commandArg);
return yield smartshellWrap.execSilent(execCommand);
});
}
/**
* executes and returns IExecResult
* @param commandArg
*/
exec(commandArg) {
return __awaiter(this, void 0, void 0, function* () {
let execCommand = this.createExecString(commandArg);
return yield smartshellWrap.exec(execCommand);
});
}
/**
* creates the final sourcing string
* @param commandArg
*/
createExecString(commandArg) {
if (this.executor === 'bash') {
let sourceString = '';
for (let sourceFilePath of this.sourceFileArray) {
sourceString = sourceString + `source ${sourceFilePath} && `;
}
return `bash -c '${sourceString} ${commandArg}'`;
}
else {
return commandArg;
}
}
}
exports.Smartshell = Smartshell;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRzaGVsbC5jbGFzc2VzLnNtYXJ0c2hlbGwuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9zbWFydHNoZWxsLmNsYXNzZXMuc21hcnRzaGVsbC50cy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BQUMsV0FBVyxDQUFDLENBQUE7UUFDL0MsQ0FBQztLQUFBO0lBRUQ7OztPQUdHO0lBQ0ssZ0JBQWdCLENBQUUsVUFBVTtRQUNsQyxFQUFFLENBQUMsQ0FBQyxJQUFJLENBQUMsUUFBUSxLQUFLLE1BQU0sQ0FBQyxDQUFDLENBQUM7WUFDN0IsSUFBSSxZQUFZLEdBQUcsRUFBRSxDQUFBO1lBQ3JCLEdBQUcsQ0FBQyxDQUFDLElBQUksY0FBYyxJQUFJLElBQUksQ0FBQyxlQUFlLENBQUMsQ0FBQyxDQUFDO2dCQUNoRCxZQUFZLEdBQUcsWUFBWSxHQUFHLFVBQVUsY0FBYyxNQUFNLENBQUE7WUFDOUQsQ0FBQztZQUNELE1BQU0sQ0FBQyxZQUFZLFlBQVksSUFBSSxVQUFVLEdBQUcsQ0FBQTtRQUNsRCxDQUFDO1FBQUMsSUFBSSxDQUFDLENBQUM7WUFDTixNQUFNLENBQUMsVUFBVSxDQUFBO1FBQ25CLENBQUM7SUFDSCxDQUFDO0NBQ0Y7QUFyREQsZ0NBcURDIn0=

View File

@ -1,4 +0,0 @@
import * as shelljs from 'shelljs';
import * as smartq from 'smartq';
import * as which from 'which';
export { shelljs, smartq, which };

View File

@ -1,9 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const shelljs = require("shelljs");
exports.shelljs = shelljs;
const smartq = require("smartq");
exports.smartq = smartq;
const which = require("which");
exports.which = which;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRzaGVsbC5wbHVnaW5zLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvc21hcnRzaGVsbC5wbHVnaW5zLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsbUNBQWtDO0FBS2hDLDBCQUFPO0FBSlQsaUNBQWdDO0FBSzlCLHdCQUFNO0FBSlIsK0JBQThCO0FBSzVCLHNCQUFLIn0=

View File

@ -1,48 +0,0 @@
/// <reference types="node" />
import { ChildProcess } from 'child_process';
/**
* interface for ExecResult
*/
export interface IExecResult {
exitCode: number;
stdout: string;
}
/**
* interface for streaming ExecResult
*/
export interface IExecResultStreaming {
childProcess: ChildProcess;
finalPromise: Promise<IExecResult>;
}
/**
* executes a given command async
* @param commandStringArg
*/
export declare let exec: (commandStringArg: string) => Promise<IExecResult>;
/**
* executes a given command async and silent
* @param commandStringArg
*/
export declare let execSilent: (commandStringArg: string) => Promise<IExecResult>;
/**
* executes a command and allws you to stream output
*/
export declare let execStreaming: (commandStringArg: string, silentArg?: boolean) => {
childProcess: ChildProcess;
finalPromise: Promise<IExecResult>;
};
export declare let execStreamingSilent: (commandStringArg: string) => {
childProcess: ChildProcess;
finalPromise: Promise<IExecResult>;
};
/**
* executes a command and returns promise that will be fullfilled once an putput line matches RegexArg
* @param commandStringArg
* @param regexArg
*/
export declare let execAndWaitForLine: (commandStringArg: string, regexArg: RegExp, silentArg?: boolean) => Promise<{}>;
export declare let execAndWaitForLineSilent: (commandStringArg: string, regexArg: RegExp) => void;
/**
* get a path
*/
export declare let which: (cmd: string) => Promise<string>;

View File

@ -1,82 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const plugins = require("./smartshell.plugins");
/**
* executes a given command async
* @param commandStringArg
*/
exports.exec = (commandStringArg) => {
let done = plugins.smartq.defer();
plugins.shelljs.exec(commandStringArg, { async: true }, (code, stdout, stderr) => {
done.resolve({
exitCode: code,
stdout: stdout
});
});
return done.promise;
};
/**
* executes a given command async and silent
* @param commandStringArg
*/
exports.execSilent = (commandStringArg) => {
let done = plugins.smartq.defer();
plugins.shelljs.exec(commandStringArg, { async: true, silent: true }, (code, stdout, stderr) => {
done.resolve({
exitCode: code,
stdout: stdout
});
});
return done.promise;
};
/**
* executes a command and allws you to stream output
*/
exports.execStreaming = (commandStringArg, silentArg = false) => {
let childProcessEnded = plugins.smartq.defer();
let execChildProcess = plugins.shelljs.exec(commandStringArg, { async: true, silent: silentArg }, (code, stdout, stderr) => {
childProcessEnded.resolve({
exitCode: code,
stdout: stdout
});
});
return {
childProcess: execChildProcess,
finalPromise: childProcessEnded.promise
};
};
exports.execStreamingSilent = (commandStringArg) => {
return exports.execStreaming(commandStringArg, true);
};
/**
* executes a command and returns promise that will be fullfilled once an putput line matches RegexArg
* @param commandStringArg
* @param regexArg
*/
exports.execAndWaitForLine = (commandStringArg, regexArg, silentArg = false) => {
let done = plugins.smartq.defer();
let execStreamingResult = exports.execStreaming(commandStringArg, silentArg);
execStreamingResult.childProcess.stdout.on('data', (stdOutChunk) => {
if (regexArg.test(stdOutChunk)) {
done.resolve();
}
});
return done.promise;
};
exports.execAndWaitForLineSilent = (commandStringArg, regexArg) => {
exports.execAndWaitForLine(commandStringArg, regexArg, true);
};
/**
* get a path
*/
exports.which = (cmd) => {
let done = plugins.smartq.defer();
plugins.which(cmd, (err, path) => {
if (err) {
done.reject(err);
}
done.resolve(path);
});
return done.promise;
};
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRzaGVsbC53cmFwLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvc21hcnRzaGVsbC53cmFwLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsZ0RBQStDO0FBc0IvQzs7O0dBR0c7QUFDUSxRQUFBLElBQUksR0FBRyxDQUFDLGdCQUF3QjtJQUN6QyxJQUFJLElBQUksR0FBRyxPQUFPLENBQUMsTUFBTSxDQUFDLEtBQUssRUFBZSxDQUFBO0lBQzlDLE9BQU8sQ0FBQyxPQUFPLENBQUMsSUFBSSxDQUFDLGdCQUFnQixFQUFFLEVBQUUsS0FBSyxFQUFFLElBQUksRUFBRSxFQUFFLENBQUMsSUFBSSxFQUFFLE1BQU0sRUFBRSxNQUFNO1FBQzNFLElBQUksQ0FBQyxPQUFPLENBQUM7WUFDWCxRQUF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wwQkFBa0IsQ0FBQyxnQkFBZ0IsRUFBRSxRQUFRLEVBQUUsSUFBSSxDQUFDLENBQUE7QUFDdEQsQ0FBQyxDQUFBO0FBRUQ7O0dBRUc7QUFDUSxRQUFBLEtBQUssR0FBRyxDQUFDLEdBQVc7SUFDN0IsSUFBSSxJQUFJLEdBQUcsT0FBTyxDQUFDLE1BQU0sQ0FBQyxLQUFLLEVBQUUsQ0FBQTtJQUNqQyxPQUFPLENBQUMsS0FBSyxDQUFDLEdBQUcsRUFBRSxDQUFDLEdBQUcsRUFBRSxJQUFZO1FBQ25DLEVBQUUsQ0FBQyxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUM7WUFDUixJQUFJLENBQUMsTUFBTSxDQUFDLEdBQUcsQ0FBQyxDQUFBO1FBQ2xCLENBQUM7UUFDRCxJQUFJLENBQUMsT0FBTyxDQUFDLElBQUksQ0FBQyxDQUFBO0lBQ3BCLENBQUMsQ0FBQyxDQUFBO0lBQ0YsTUFBTSxDQUFDLElBQUksQ0FBQyxPQUFPLENBQUE7QUFDckIsQ0FBQyxDQUFBIn0=

View File

@ -1,8 +1,6 @@
{
"npmci": {
"globalNpmTools": [
"npmts",
"ts-node"
]
"npmGlobalTools": [],
"npmAccessLevel": "public"
}
}

1052
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,11 +1,13 @@
{
"name": "smartshell",
"version": "1.0.8",
"name": "@pushrocks/smartshell",
"private": false,
"version": "2.0.11",
"description": "shell actions designed as promises",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"scripts": {
"test": "(npmts --notest && ts-node --compilerOptions '{\"target\":\"es6\"}' test/test.ts)"
"test": "(tstest test/)",
"build": "(tsbuild)"
},
"repository": {
"type": "git",
@ -22,14 +24,17 @@
},
"homepage": "https://gitlab.com/pushrocks/smartshell#README",
"devDependencies": {
"tapbundle": "^1.0.14"
"@gitzone/tsbuild": "^2.0.22",
"@gitzone/tsrun": "^1.1.13",
"@gitzone/tstest": "^1.0.15",
"@pushrocks/tapbundle": "^3.0.7",
"@types/node": "^10.12.10",
"tslint": "^5.11.0",
"tslint-config-prettier": "^1.16.0"
},
"dependencies": {
"@types/shelljs": "^0.7.2",
"@types/which": "^1.0.28",
"shelljs": "^0.7.8",
"smartq": "^1.1.1",
"typings-global": "^1.0.19",
"which": "^1.2.14"
"@pushrocks/smartpromise": "^2.0.5",
"@types/which": "^1.3.1",
"which": "^1.3.1"
}
}

View File

@ -1,49 +1,53 @@
import { expect, tap } from 'tapbundle'
import { expect, tap } from '@pushrocks/tapbundle';
import * as smartshell from '../dist/index'
import * as smartq from 'smartq'
import * as smartshell from '../ts';
import * as smartpromise from '@pushrocks/smartpromise';
let testSmartshell: smartshell.Smartshell
tap.test('smartshell should run async', async () => {
let execResult = await smartshell.exec('npm -v')
expect(execResult.stdout).to.match(/[0-9\.]*/)
})
tap.test('smartshell should run async and silent', async () => {
let execResult = await smartshell.execSilent('npm -v')
expect(execResult.stdout).to.match(/[0-9\.]*/)
})
tap.test('smartshell should stream a shell execution', async () => {
let done = smartq.defer()
let execStreamingResponse = smartshell.execStreaming('npm -v')
execStreamingResponse.childProcess.stdout.on('data', data => {
done.resolve(data)
})
let data = await done.promise
expect(data).to.equal('5.0.3\n')
await execStreamingResponse.finalPromise
})
tap.test('it should execute and wait for a line in the output', async () => {
await smartshell.execAndWaitForLine('npm -v', /5.0.3/)
})
// Smartshell class
let testSmartshell: smartshell.Smartshell;
tap.test('smartshell should create a Smartshell instance', async () => {
testSmartshell = new smartshell.Smartshell({
executor: 'bash',
sourceFilePaths: []
})
expect(testSmartshell).to.be.instanceof(smartshell.Smartshell)
})
});
expect(testSmartshell).to.be.instanceof(smartshell.Smartshell);
});
tap.test('smartshell should run async', async () => {
return testSmartshell.execSilent('sleep 1 && npm -v').then(async (execResult) => {
console.log(execResult.stdout)
})
})
let execResult = await testSmartshell.exec('npm -v');
expect(execResult.stdout).to.match(/[0-9\.]*/);
});
tap.start()
tap.test('smartshell should run async and silent', async () => {
let execResult = await testSmartshell.execSilent('npm -v');
expect(execResult.stdout).to.match(/[0-9\.]*/);
});
tap.test('smartshell should stream a shell execution', async () => {
let done = smartpromise.defer();
let execStreamingResponse = await testSmartshell.execStreaming('npm -v');
execStreamingResponse.childProcess.stdout.on('data', data => {
done.resolve(data);
});
let data = await done.promise;
expect(data).to.match(/[0-9\.]*/);
await execStreamingResponse.finalPromise;
});
tap.test('it should execute and wait for a line in the output', async () => {
await testSmartshell.execAndWaitForLine('echo "5.0.4"', /5.0.4/);
});
tap.test('smartshell should run async', async () => {
return testSmartshell.execSilent('sleep 1 && npm -v').then(async execResult => {
console.log(execResult.stdout);
});
});
tap.test('should be able to find git', async () => {
testSmartshell.exec('git --version');
});
tap.start({
throwOnError: true
});

View File

@ -1,2 +1 @@
export * from './smartshell.wrap'
export * from './smartshell.classes.smartshell'
export * from './smartshell.classes.smartshell';

View File

@ -0,0 +1,73 @@
export type TExecutor = 'sh' | 'bash';
export interface IShellEnvContructorOptions {
executor: TExecutor;
sourceFilePaths?: string[];
pathDirectories?: string[];
}
export class ShellEnv {
executor: TExecutor;
sourceFileArray: string[] = [];
pathDirArray: string[] = [];
/**
* constructor for the shellenv
*/
constructor(optionsArg: IShellEnvContructorOptions) {
this.executor = optionsArg.executor;
// add sourcefiles
if (optionsArg.sourceFilePaths) {
this.sourceFileArray = this.sourceFileArray.concat(optionsArg.sourceFilePaths);
}
// add pathDirectories
if (optionsArg.pathDirectories) {
this.pathDirArray = this.pathDirArray.concat(optionsArg.pathDirectories);
}
}
/**
* imports path into the shell from env if available and returns it with
*/
private _setPath(commandStringArg): string {
let commandResult = commandStringArg;
let commandPath = process.env.PATH;
if (process.env.SMARTSHELL_PATH) {
commandPath = `${commandPath}:${process.env.SMARTSHELL_PATH}`;
}
commandResult = `PATH=${commandPath} && ${commandStringArg}`;
return commandResult;
}
/**
* add files that are going to be sourced when running a command
* @param sourceFilePathsArray
*/
addSourceFiles(sourceFilePathsArray: string[]) {
for (let sourceFilePath of sourceFilePathsArray) {
this.sourceFileArray.push(sourceFilePath);
}
}
/**
* cleans the source files array
*/
cleanSourceFiles() {
this.sourceFileArray = [];
}
createEnvExecString(commandArg): string {
let commandResult = '';
if (this.executor === 'bash') {
let sourceString = '';
for (let sourceFilePath of this.sourceFileArray) {
sourceString = sourceString + `source ${sourceFilePath} && `;
}
commandResult = `bash -c '${sourceString} ${commandArg}'`;
}
commandResult = this._setPath(commandResult);
return commandResult;
}
}

View File

@ -0,0 +1,44 @@
import * as plugins from './smartshell.plugins';
/**
* a log handler for spawned logs
* making sure the process doesn't run out of memory
*/
export class ShellLog {
logStore = Buffer.from('');
/**
* log data to console
* @param dataArg
*/
logToConsole(dataArg: string | Buffer): void {
// make sure we have the data as string
const dataString: string = (() => {
if (Buffer.isBuffer(dataArg)) {
return dataArg.toString();
}
return dataArg;
})();
process.stdout.write(dataString);
}
/**
* add data to Buffer for later consumption
* @param dataArg
*/
addToBuffer(dataArg: string | Buffer): void {
// make sure we have the data as Buffer
const dataBuffer: Buffer = (() => {
if (!Buffer.isBuffer(dataArg)) {
return Buffer.from(dataArg);
}
return dataArg;
})();
this.logStore = Buffer.concat([this.logStore, dataBuffer]);
}
logAndAdd(dataArg: string | Buffer): void {
this.logToConsole(dataArg);
this.addToBuffer(dataArg);
}
}

View File

@ -1,65 +1,154 @@
import * as plugins from './smartshell.plugins'
import * as smartshellWrap from './smartshell.wrap'
// -- imports --
import * as plugins from './smartshell.plugins';
import { ShellEnv, IShellEnvContructorOptions, TExecutor } from './smartshell.classes.shellenv';
import { ShellLog } from './smartshell.classes.shelllog';
export type TExecutor = 'sh' | 'bash'
export interface ISmartshellContructorOptions {
executor: TExecutor
sourceFilePaths: string[]
import * as cp from 'child_process';
import { Deferred } from '@pushrocks/smartpromise';
// -- interfaces --
/**
* interface for ExecResult
*/
export interface IExecResult {
exitCode: number;
stdout: string;
}
/**
* interface for streaming ExecResult
*/
export interface IExecResultStreaming {
childProcess: cp.ChildProcess;
finalPromise: Promise<IExecResult>;
kill: () => void;
}
// -- SmartShell --
export class Smartshell {
executor: TExecutor
sourceFileArray: string[] = []
constructor (optionsArg: ISmartshellContructorOptions) {
this.executor = optionsArg.executor
for (let sourceFilePath of optionsArg.sourceFilePaths) {
this.sourceFileArray.push(sourceFilePath)
}
}
shellEnv: ShellEnv;
addSourceFiles (sourceFilePathsArray: string[]) {
for (let sourceFilePath of sourceFilePathsArray) {
this.sourceFileArray.push(sourceFilePath)
}
}
cleanSourceFiles () {
this.sourceFileArray = []
constructor(optionsArg: IShellEnvContructorOptions) {
this.shellEnv = new ShellEnv(optionsArg);
}
/**
* executes silently and returns IExecResult
* @param commandArg
* executes a given command async
* @param commandStringArg
*/
async execSilent (commandArg: string) {
let execCommand = this.createExecString(commandArg)
return await smartshellWrap.execSilent(execCommand)
}
private async _exec(
commandStringArg: string,
silentArg: boolean = false,
strictArg = false,
streamingArg = false
): Promise<IExecResult | IExecResultStreaming> {
// flow control promises
const done = plugins.smartpromise.defer<IExecResult | IExecResultStreaming>();
const childProcessEnded = plugins.smartpromise.defer<IExecResult>();
// build commandToExecute
let commandToExecute = commandStringArg;
commandToExecute = this.shellEnv.createEnvExecString(commandStringArg);
const spawnlogInstance = new ShellLog();
const execChildProcess = cp.spawn(commandToExecute, [], {
shell: true,
env: process.env,
detached: true
});
/**
* executes and returns IExecResult
* @param commandArg
*/
async exec (commandArg: string) {
let execCommand = this.createExecString(commandArg)
return await smartshellWrap.exec(execCommand)
}
/**
* creates the final sourcing string
* @param commandArg
*/
private createExecString (commandArg): string {
if (this.executor === 'bash') {
let sourceString = ''
for (let sourceFilePath of this.sourceFileArray) {
sourceString = sourceString + `source ${sourceFilePath} && `
execChildProcess.stdout.on('data', data => {
if (!silentArg) {
spawnlogInstance.logToConsole(data);
}
return `bash -c '${sourceString} ${commandArg}'`
} else {
return commandArg
spawnlogInstance.addToBuffer(data);
});
execChildProcess.stderr.on('data', data => {
if (!silentArg) {
spawnlogInstance.logToConsole(data);
}
spawnlogInstance.addToBuffer(data);
});
if (streamingArg) {
done.resolve({
childProcess: execChildProcess,
finalPromise: childProcessEnded.promise,
kill: () => {
// this notation with the - kills the whole process group
process.kill(-execChildProcess.pid);
}
});
}
execChildProcess.on('exit', (code, signal) => {
if (strictArg && code === 1) {
done.reject();
}
const execResult = {
exitCode: code,
stdout: spawnlogInstance.logStore.toString()
};
if (!streamingArg) {
done.resolve(execResult);
}
childProcessEnded.resolve(execResult);
});
const result = await done.promise;
return result;
}
async exec(commandStringArg: string): Promise<IExecResult> {
return (await this._exec(commandStringArg, false)) as IExecResult;
}
/**
* executes a given command async and silent
* @param commandStringArg
*/
async execSilent(commandStringArg: string): Promise<IExecResult> {
return (await this._exec(commandStringArg, true)) as IExecResult;
}
/**
* executes a command async and strict, meaning it rejects the promise if something happens
*/
async execStrict(commandStringArg: string): Promise<IExecResult> {
return (await this._exec(commandStringArg, true, true)) as IExecResult;
}
/**
* executes a command and allows you to stream output
*/
async execStreaming(
commandStringArg: string,
silentArg: boolean = false
): Promise<IExecResultStreaming> {
return (await this._exec(commandStringArg, silentArg, false, true)) as IExecResultStreaming;
}
async execStreamingSilent(commandStringArg: string) {
return (await this.execStreaming(commandStringArg, true)) as IExecResultStreaming;
}
/**
* executes a command and returns promise that will be fullfilled once an putput line matches RegexArg
* @param commandStringArg
* @param regexArg
*/
async execAndWaitForLine(commandStringArg: string, regexArg: RegExp, silentArg: boolean = false) {
let done = plugins.smartpromise.defer();
let execStreamingResult = await this.execStreaming(commandStringArg, silentArg);
execStreamingResult.childProcess.stdout.on('data', (stdOutChunk: string) => {
if (regexArg.test(stdOutChunk)) {
done.resolve();
}
});
return done.promise;
}
async execAndWaitForLineSilent(commandStringArg: string, regexArg: RegExp) {
this.execAndWaitForLine(commandStringArg, regexArg, true);
}
}

View File

@ -1,9 +1,4 @@
import * as shelljs from 'shelljs'
import * as smartq from 'smartq'
import * as which from 'which'
import * as smartpromise from '@pushrocks/smartpromise';
import * as which from 'which';
export {
shelljs,
smartq,
which
}
export { smartpromise, which };

View File

@ -1,106 +0,0 @@
import * as plugins from './smartshell.plugins'
// interfaces
import { ChildProcess } from 'child_process'
import { Deferred } from 'smartq'
/**
* interface for ExecResult
*/
export interface IExecResult {
exitCode: number,
stdout: string
}
/**
* interface for streaming ExecResult
*/
export interface IExecResultStreaming {
childProcess: ChildProcess,
finalPromise: Promise<IExecResult>
}
/**
* executes a given command async
* @param commandStringArg
*/
export let exec = (commandStringArg: string): Promise<IExecResult> => {
let done = plugins.smartq.defer<IExecResult>()
plugins.shelljs.exec(commandStringArg, { async: true }, (code, stdout, stderr) => {
done.resolve({
exitCode: code,
stdout: stdout
})
})
return done.promise
}
/**
* executes a given command async and silent
* @param commandStringArg
*/
export let execSilent = (commandStringArg: string) => {
let done = plugins.smartq.defer<IExecResult>()
plugins.shelljs.exec(commandStringArg, { async: true, silent: true }, (code, stdout, stderr) => {
done.resolve({
exitCode: code,
stdout: stdout
})
})
return done.promise
}
/**
* executes a command and allws you to stream output
*/
export let execStreaming = (commandStringArg: string, silentArg: boolean = false) => {
let childProcessEnded = plugins.smartq.defer<IExecResult>()
let execChildProcess = plugins.shelljs.exec(commandStringArg, {async: true, silent: silentArg}, (code, stdout, stderr) => {
childProcessEnded.resolve({
exitCode: code,
stdout: stdout
})
})
return {
childProcess: execChildProcess,
finalPromise: childProcessEnded.promise
}
}
export let execStreamingSilent = (commandStringArg: string) => {
return execStreaming(commandStringArg, true)
}
/**
* executes a command and returns promise that will be fullfilled once an putput line matches RegexArg
* @param commandStringArg
* @param regexArg
*/
export let execAndWaitForLine = (commandStringArg: string, regexArg: RegExp, silentArg: boolean = false) => {
let done = plugins.smartq.defer()
let execStreamingResult = execStreaming(commandStringArg, silentArg)
execStreamingResult.childProcess.stdout.on('data', (stdOutChunk: string) => {
if (regexArg.test(stdOutChunk)) {
done.resolve()
}
})
return done.promise
}
export let execAndWaitForLineSilent = (commandStringArg: string, regexArg: RegExp) => {
execAndWaitForLine(commandStringArg, regexArg, true)
}
/**
* get a path
*/
export let which = (cmd: string): Promise<string> => {
let done = plugins.smartq.defer()
plugins.which(cmd, (err, path: string) => {
if (err) {
done.reject(err)
}
done.resolve(path)
})
return done.promise
}

View File

@ -1,3 +1,17 @@
{
"extends": "tslint-config-standard"
"extends": ["tslint:latest", "tslint-config-prettier"],
"rules": {
"semicolon": [true, "always"],
"no-console": false,
"ordered-imports": false,
"object-literal-sort-keys": false,
"member-ordering": {
"options":{
"order": [
"static-method"
]
}
}
},
"defaultSeverity": "warning"
}

304
yarn.lock
View File

@ -1,304 +0,0 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
"@types/chai-as-promised@0.0.29":
version "0.0.29"
resolved "https://registry.yarnpkg.com/@types/chai-as-promised/-/chai-as-promised-0.0.29.tgz#43d52892aa998e185a3de3e2477edb8573be1d77"
dependencies:
"@types/chai" "*"
"@types/promises-a-plus" "*"
"@types/chai-string@^1.1.30":
version "1.1.30"
resolved "https://registry.yarnpkg.com/@types/chai-string/-/chai-string-1.1.30.tgz#4d8744b31a5a2295fc01c981ed1e2d4c8a070f0a"
dependencies:
"@types/chai" "*"
"@types/chai@*", "@types/chai@^3.4.35":
version "3.5.2"
resolved "https://registry.yarnpkg.com/@types/chai/-/chai-3.5.2.tgz#c11cd2817d3a401b7ba0f5a420f35c56139b1c1e"
"@types/node@*":
version "8.0.1"
resolved "https://registry.yarnpkg.com/@types/node/-/node-8.0.1.tgz#89c271e0c3b9ebb6a3756dd601336970b6228b77"
"@types/promises-a-plus@*":
version "0.0.27"
resolved "https://registry.yarnpkg.com/@types/promises-a-plus/-/promises-a-plus-0.0.27.tgz#c64651134614c84b8f5d7114ce8901d36a609780"
"@types/shelljs@^0.6.0":
version "0.6.0"
resolved "https://registry.yarnpkg.com/@types/shelljs/-/shelljs-0.6.0.tgz#090b705c102ce7fc5c0c5ea9b524418ff15840df"
dependencies:
"@types/node" "*"
"@types/shelljs@^0.7.2":
version "0.7.2"
resolved "https://registry.yarnpkg.com/@types/shelljs/-/shelljs-0.7.2.tgz#c2bdb3fe80cd7a3da08750ca898ae44c589671f3"
dependencies:
"@types/node" "*"
"@types/which@^1.0.28":
version "1.0.28"
resolved "https://registry.yarnpkg.com/@types/which/-/which-1.0.28.tgz#016e387629b8817bed653fe32eab5d11279c8df6"
ansi-256-colors@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/ansi-256-colors/-/ansi-256-colors-1.1.0.tgz#910de50efcc7c09e3d82f2f87abd6b700c18818a"
assertion-error@^1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/assertion-error/-/assertion-error-1.0.2.tgz#13ca515d86206da0bac66e834dd397d87581094c"
balanced-match@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767"
beautycolor@^1.0.7:
version "1.0.7"
resolved "https://registry.yarnpkg.com/beautycolor/-/beautycolor-1.0.7.tgz#a4715738ac4c8221371e9cbeb5a6cc6d11ecbf7c"
dependencies:
ansi-256-colors "^1.1.0"
typings-global "^1.0.14"
bindings@^1.2.1:
version "1.2.1"
resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.2.1.tgz#14ad6113812d2d37d72e67b4cacb4bb726505f11"
brace-expansion@^1.1.7:
version "1.1.8"
resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.8.tgz#c07b211c7c952ec1f8efd51a77ef0d1d3990a292"
dependencies:
balanced-match "^1.0.0"
concat-map "0.0.1"
chai-as-promised@^6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/chai-as-promised/-/chai-as-promised-6.0.0.tgz#1a02a433a6f24dafac63b9c96fa1684db1aa8da6"
dependencies:
check-error "^1.0.2"
chai-string@^1.3.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/chai-string/-/chai-string-1.4.0.tgz#359140c051d36a4e4b1a5fc6b910152f438a8d49"
chai@^3.5.0:
version "3.5.0"
resolved "https://registry.yarnpkg.com/chai/-/chai-3.5.0.tgz#4d02637b067fe958bdbfdd3a40ec56fef7373247"
dependencies:
assertion-error "^1.0.1"
deep-eql "^0.1.3"
type-detect "^1.0.0"
check-error@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/check-error/-/check-error-1.0.2.tgz#574d312edd88bb5dd8912e9286dd6c0aed4aac82"
concat-map@0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
deep-eql@^0.1.3:
version "0.1.3"
resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-0.1.3.tgz#ef558acab8de25206cd713906d74e56930eb69f2"
dependencies:
type-detect "0.1.1"
early@^2.1.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/early/-/early-2.1.1.tgz#841e23254ea5dc54d8afaeee82f5ab65c00ee23c"
dependencies:
beautycolor "^1.0.7"
smartq "^1.1.1"
typings-global "^1.0.16"
es6-error@^4.0.2:
version "4.0.2"
resolved "https://registry.yarnpkg.com/es6-error/-/es6-error-4.0.2.tgz#eec5c726eacef51b7f6b73c20db6e1b13b069c98"
fs.realpath@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
glob@^7.0.0:
version "7.1.2"
resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15"
dependencies:
fs.realpath "^1.0.0"
inflight "^1.0.4"
inherits "2"
minimatch "^3.0.4"
once "^1.3.0"
path-is-absolute "^1.0.0"
inflight@^1.0.4:
version "1.0.6"
resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9"
dependencies:
once "^1.3.0"
wrappy "1"
inherits@2:
version "2.0.3"
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de"
interpret@^1.0.0:
version "1.0.3"
resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.0.3.tgz#cbc35c62eeee73f19ab7b10a801511401afc0f90"
isexe@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10"
leakage@^0.3.0:
version "0.3.0"
resolved "https://registry.yarnpkg.com/leakage/-/leakage-0.3.0.tgz#15d698abdc76bbc6439601f4f3020e77e2d50c39"
dependencies:
es6-error "^4.0.2"
left-pad "^1.1.3"
memwatch-next "^0.3.0"
minimist "^1.2.0"
pretty-bytes "^4.0.2"
left-pad@^1.1.3:
version "1.1.3"
resolved "https://registry.yarnpkg.com/left-pad/-/left-pad-1.1.3.tgz#612f61c033f3a9e08e939f1caebeea41b6f3199a"
memwatch-next@^0.3.0:
version "0.3.0"
resolved "https://registry.yarnpkg.com/memwatch-next/-/memwatch-next-0.3.0.tgz#2111050f9a906e0aa2d72a4ec0f0089c78726f8f"
dependencies:
bindings "^1.2.1"
nan "^2.3.2"
minimatch@^3.0.4:
version "3.0.4"
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083"
dependencies:
brace-expansion "^1.1.7"
minimist@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284"
nan@^2.3.2:
version "2.6.2"
resolved "https://registry.yarnpkg.com/nan/-/nan-2.6.2.tgz#e4ff34e6c95fdfb5aecc08de6596f43605a7db45"
once@^1.3.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
dependencies:
wrappy "1"
path-is-absolute@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"
path-parse@^1.0.5:
version "1.0.5"
resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1"
pretty-bytes@^4.0.2:
version "4.0.2"
resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-4.0.2.tgz#b2bf82e7350d65c6c33aa95aaa5a4f6327f61cd9"
rechoir@^0.6.2:
version "0.6.2"
resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384"
dependencies:
resolve "^1.1.6"
resolve@^1.1.6:
version "1.3.3"
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.3.3.tgz#655907c3469a8680dc2de3a275a8fdd69691f0e5"
dependencies:
path-parse "^1.0.5"
semver@^5.3.0:
version "5.3.0"
resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f"
shelljs@^0.7.6, shelljs@^0.7.8:
version "0.7.8"
resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.7.8.tgz#decbcf874b0d1e5fb72e14b164a9683048e9acb3"
dependencies:
glob "^7.0.0"
interpret "^1.0.0"
rechoir "^0.6.2"
smartchai@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/smartchai/-/smartchai-1.0.3.tgz#de6d010bb8b5aef24cb70b31a5f5334e8c41b72f"
dependencies:
"@types/chai" "^3.4.35"
"@types/chai-as-promised" "0.0.29"
"@types/chai-string" "^1.1.30"
chai "^3.5.0"
chai-as-promised "^6.0.0"
chai-string "^1.3.0"
smartdelay@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/smartdelay/-/smartdelay-1.0.3.tgz#5fd44dad77262d110702f0293efa80c072cfb579"
dependencies:
smartq "^1.1.1"
typings-global "^1.0.16"
smartq@^1.1.0, smartq@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/smartq/-/smartq-1.1.1.tgz#efb358705260d41ae18aef7ffd815f7b6fe17dd3"
dependencies:
typed-promisify "^0.3.0"
typings-global "^1.0.14"
smartshell@^1.0.6:
version "1.0.6"
resolved "https://registry.yarnpkg.com/smartshell/-/smartshell-1.0.6.tgz#27b1c79029784abe72ac7e91fe698b7ebecc6629"
dependencies:
"@types/shelljs" "^0.6.0"
"@types/which" "^1.0.28"
shelljs "^0.7.6"
smartq "^1.1.0"
which "^1.2.12"
tapbundle@^1.0.14:
version "1.0.14"
resolved "https://registry.yarnpkg.com/tapbundle/-/tapbundle-1.0.14.tgz#75827e335fcb02216f0267a26a26d702ddc02e3c"
dependencies:
early "^2.1.1"
leakage "^0.3.0"
smartchai "^1.0.3"
smartdelay "^1.0.3"
smartq "^1.1.1"
typings-global "^1.0.16"
type-detect@0.1.1:
version "0.1.1"
resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-0.1.1.tgz#0ba5ec2a885640e470ea4e8505971900dac58822"
type-detect@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-1.0.0.tgz#762217cc06db258ec48908a1298e8b95121e8ea2"
typed-promisify@^0.3.0:
version "0.3.0"
resolved "https://registry.yarnpkg.com/typed-promisify/-/typed-promisify-0.3.0.tgz#1ba0af5e444c87d8047406f18ce49092a1191853"
typings-global@^1.0.14, typings-global@^1.0.16, typings-global@^1.0.19:
version "1.0.19"
resolved "https://registry.yarnpkg.com/typings-global/-/typings-global-1.0.19.tgz#3376a72d4de1e5541bf5702248ff64c3e6ea316c"
dependencies:
semver "^5.3.0"
smartshell "^1.0.6"
which@^1.2.12, which@^1.2.14:
version "1.2.14"
resolved "https://registry.yarnpkg.com/which/-/which-1.2.14.tgz#9a87c4378f03e827cecaf1acdf56c736c01c14e5"
dependencies:
isexe "^2.0.0"
wrappy@1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"