@acot/connection
Advanced tools
Comparing version 0.0.2-canary.0 to 0.0.2-canary.1
@@ -6,2 +6,8 @@ # Change Log | ||
## [0.0.2-canary.1](https://github.com/acot-a11y/acot/compare/@acot/connection@0.0.2-canary.0...@acot/connection@0.0.2-canary.1) (2020-11-03) | ||
### Bug Fixes | ||
- Minor bug fixes that occur during Audit ([0ec7b94](https://github.com/acot-a11y/acot/commit/0ec7b94e8f885cb45aae351d0279033367b8d94c)) | ||
## [0.0.2-canary.0](https://github.com/acot-a11y/acot/compare/@acot/connection@0.0.1...@acot/connection@0.0.2-canary.0) (2020-11-02) | ||
@@ -8,0 +14,0 @@ |
@@ -14,3 +14,3 @@ export declare type ConnectionConfig = { | ||
connect(): Promise<void>; | ||
disconnect(): Promise<void>; | ||
disconnect(): void; | ||
} |
@@ -7,20 +7,5 @@ "use strict"; | ||
exports.Connection = void 0; | ||
const child_process_1 = __importDefault(require("child_process")); | ||
const execa_1 = __importDefault(require("execa")); | ||
const wait_on_1 = __importDefault(require("wait-on")); | ||
const debug = require('debug')('acot:connection'); | ||
const spawn = (command) => { | ||
const [cmd, ...args] = command.split(/\s+/); | ||
const proc = child_process_1.default.spawn(cmd, args, { | ||
shell: true, | ||
}); | ||
proc.stdout.setEncoding('utf8'); | ||
proc.stderr.setEncoding('utf8'); | ||
proc.stdout.on('data', (d) => { | ||
debug(d.toString().trim()); | ||
}); | ||
proc.stderr.on('data', (d) => { | ||
debug(d.toString().trim()); | ||
}); | ||
return proc; | ||
}; | ||
const waitForServer = (url, timeout) => new Promise((resolve, reject) => { | ||
@@ -58,3 +43,9 @@ if (!url.startsWith('http')) { | ||
debug('server process creating... (execute: "%s")', command); | ||
this._proc = spawn(command); | ||
this._proc = execa_1.default.command(command); | ||
this._proc.stdout.on('data', (d) => debug(d.toString())); | ||
this._proc.stderr.on('data', (d) => debug(d.toString())); | ||
process.on('SIGINT', () => { | ||
var _a; | ||
(_a = this._proc) === null || _a === void 0 ? void 0 : _a.kill(); | ||
}); | ||
debug('server process created!'); | ||
@@ -72,18 +63,15 @@ } | ||
} | ||
async disconnect() { | ||
disconnect() { | ||
if (this._status === 'DISCONNECTED') { | ||
return; | ||
} | ||
if (this._proc == null) { | ||
debug('disconnect server connection'); | ||
return; | ||
} | ||
try { | ||
debug('disconnect server connection... (pid: "%f")', this._proc.pid); | ||
const result = this._proc.kill('SIGKILL'); | ||
debug('kill=%s', result); | ||
} | ||
catch (e) { | ||
debug(e); | ||
} | ||
debug('disconnect server connection... (pid: "%f")', this._proc.pid); | ||
this._proc.kill(); | ||
this._proc = null; | ||
this._status = 'DISCONNECTED'; | ||
} | ||
} | ||
exports.Connection = Connection; |
{ | ||
"name": "@acot/connection", | ||
"version": "0.0.2-canary.0", | ||
"version": "0.0.2-canary.1", | ||
"description": "Manage the connection to the server.", | ||
@@ -26,2 +26,3 @@ "homepage": "https://github.com/acot-a11y/acot/tree/master/packages/connection", | ||
"debug": "^4.2.0", | ||
"execa": "^4.1.0", | ||
"wait-on": "^5.2.0" | ||
@@ -36,3 +37,3 @@ }, | ||
}, | ||
"gitHead": "61cca80b5953b0ee87f2b3de4b7764ada4d057fb" | ||
"gitHead": "f90c6232a759ad603c81f9f9e7d1383f337a46e3" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
5654
0
3
89
+ Addedexeca@^4.1.0
+ Addedcross-spawn@7.0.3(transitive)
+ Addedend-of-stream@1.4.4(transitive)
+ Addedexeca@4.1.0(transitive)
+ Addedget-stream@5.2.0(transitive)
+ Addedhuman-signals@1.1.1(transitive)
+ Addedis-stream@2.0.1(transitive)
+ Addedisexe@2.0.0(transitive)
+ Addedmerge-stream@2.0.0(transitive)
+ Addedmimic-fn@2.1.0(transitive)
+ Addednpm-run-path@4.0.1(transitive)
+ Addedonce@1.4.0(transitive)
+ Addedonetime@5.1.2(transitive)
+ Addedpath-key@3.1.1(transitive)
+ Addedpump@3.0.2(transitive)
+ Addedshebang-command@2.0.0(transitive)
+ Addedshebang-regex@3.0.0(transitive)
+ Addedsignal-exit@3.0.7(transitive)
+ Addedstrip-final-newline@2.0.0(transitive)
+ Addedwhich@2.0.2(transitive)
+ Addedwrappy@1.0.2(transitive)