spawn-rx 5.1.2 → 6.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/src/index.js DELETED
@@ -1,388 +0,0 @@
1
- "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- var __rest = (this && this.__rest) || function (s, e) {
14
- var t = {};
15
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
16
- t[p] = s[p];
17
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
18
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
19
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
20
- t[p[i]] = s[p[i]];
21
- }
22
- return t;
23
- };
24
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
25
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
26
- if (ar || !(i in from)) {
27
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
28
- ar[i] = from[i];
29
- }
30
- }
31
- return to.concat(ar || Array.prototype.slice.call(from));
32
- };
33
- Object.defineProperty(exports, "__esModule", { value: true });
34
- exports.findActualExecutable = findActualExecutable;
35
- exports.spawnDetached = spawnDetached;
36
- exports.spawn = spawn;
37
- exports.spawnDetachedPromise = spawnDetachedPromise;
38
- exports.spawnPromise = spawnPromise;
39
- /* eslint-disable @typescript-eslint/no-explicit-any */
40
- var path = require("path");
41
- var net = require("net");
42
- var sfs = require("fs");
43
- var rxjs_1 = require("rxjs");
44
- var operators_1 = require("rxjs/operators");
45
- var child_process_1 = require("child_process");
46
- var debug_1 = require("debug");
47
- var isWindows = process.platform === "win32";
48
- var d = (0, debug_1.default)("spawn-rx"); // tslint:disable-line:no-var-requires
49
- /**
50
- * stat a file but don't throw if it doesn't exist
51
- *
52
- * @param {string} file The path to a file
53
- * @return {Stats} The stats structure
54
- *
55
- * @private
56
- */
57
- function statSyncNoException(file) {
58
- try {
59
- return sfs.statSync(file);
60
- }
61
- catch (_a) {
62
- return null;
63
- }
64
- }
65
- /**
66
- * Search PATH to see if a file exists in any of the path folders.
67
- *
68
- * @param {string} exe The file to search for
69
- * @return {string} A fully qualified path, or the original path if nothing
70
- * is found
71
- *
72
- * @private
73
- */
74
- function runDownPath(exe) {
75
- // NB: Windows won't search PATH looking for executables in spawn like
76
- // Posix does
77
- // Files with any directory path don't get this applied
78
- if (exe.match(/[\\/]/)) {
79
- d("Path has slash in directory, bailing");
80
- return exe;
81
- }
82
- var target = path.join(".", exe);
83
- if (statSyncNoException(target)) {
84
- d("Found executable in currect directory: ".concat(target));
85
- // XXX: Some very Odd programs decide to use args[0] as a parameter
86
- // to determine what to do, and also symlink themselves, so we can't
87
- // use realpathSync here like we used to
88
- return target;
89
- }
90
- var haystack = process.env.PATH.split(isWindows ? ";" : ":");
91
- for (var _i = 0, haystack_1 = haystack; _i < haystack_1.length; _i++) {
92
- var p = haystack_1[_i];
93
- var needle = path.join(p, exe);
94
- if (statSyncNoException(needle)) {
95
- // NB: Same deal as above
96
- return needle;
97
- }
98
- }
99
- d("Failed to find executable anywhere in path");
100
- return exe;
101
- }
102
- /**
103
- * Finds the actual executable and parameters to run on Windows. This method
104
- * mimics the POSIX behavior of being able to run scripts as executables by
105
- * replacing the passed-in executable with the script runner, for PowerShell,
106
- * CMD, and node scripts.
107
- *
108
- * This method also does the work of running down PATH, which spawn on Windows
109
- * also doesn't do, unlike on POSIX.
110
- *
111
- * @param {string} exe The executable to run
112
- * @param {string[]} args The arguments to run
113
- *
114
- * @return {Object} The cmd and args to run
115
- * @property {string} cmd The command to pass to spawn
116
- * @property {string[]} args The arguments to pass to spawn
117
- */
118
- function findActualExecutable(exe, args) {
119
- // POSIX can just execute scripts directly, no need for silly goosery
120
- if (process.platform !== "win32") {
121
- return { cmd: runDownPath(exe), args: args };
122
- }
123
- if (!sfs.existsSync(exe)) {
124
- // NB: When you write something like `surf-client ... -- surf-build` on Windows,
125
- // a shell would normally convert that to surf-build.cmd, but since it's passed
126
- // in as an argument, it doesn't happen
127
- var possibleExts = [".exe", ".bat", ".cmd", ".ps1"];
128
- for (var _i = 0, possibleExts_1 = possibleExts; _i < possibleExts_1.length; _i++) {
129
- var ext = possibleExts_1[_i];
130
- var possibleFullPath = runDownPath("".concat(exe).concat(ext));
131
- if (sfs.existsSync(possibleFullPath)) {
132
- return findActualExecutable(possibleFullPath, args);
133
- }
134
- }
135
- }
136
- if (exe.match(/\.ps1$/i)) {
137
- var cmd = path.join(process.env.SYSTEMROOT, "System32", "WindowsPowerShell", "v1.0", "PowerShell.exe");
138
- var psargs = [
139
- "-ExecutionPolicy",
140
- "Unrestricted",
141
- "-NoLogo",
142
- "-NonInteractive",
143
- "-File",
144
- exe,
145
- ];
146
- return { cmd: cmd, args: psargs.concat(args) };
147
- }
148
- if (exe.match(/\.(bat|cmd)$/i)) {
149
- var cmd = path.join(process.env.SYSTEMROOT, "System32", "cmd.exe");
150
- var cmdArgs = __spreadArray(["/C", exe], args, true);
151
- return { cmd: cmd, args: cmdArgs };
152
- }
153
- if (exe.match(/\.(js)$/i)) {
154
- var cmd = process.execPath;
155
- var nodeArgs = [exe];
156
- return { cmd: cmd, args: nodeArgs.concat(args) };
157
- }
158
- // Dunno lol
159
- return { cmd: exe, args: args };
160
- }
161
- /**
162
- * Spawns a process but detached from the current process. The process is put
163
- * into its own Process Group that can be killed by unsubscribing from the
164
- * return Observable.
165
- *
166
- * @param {string} exe The executable to run
167
- * @param {string[]} params The parameters to pass to the child
168
- * @param {SpawnOptions & SpawnRxExtras} opts Options to pass to spawn.
169
- *
170
- * @return {Observable<string>} Returns an Observable that when subscribed
171
- * to, will create a detached process. The
172
- * process output will be streamed to this
173
- * Observable, and if unsubscribed from, the
174
- * process will be terminated early. If the
175
- * process terminates with a non-zero value,
176
- * the Observable will terminate with onError.
177
- */
178
- function spawnDetached(exe, params, opts) {
179
- var _a = findActualExecutable(exe, params !== null && params !== void 0 ? params : []), cmd = _a.cmd, args = _a.args;
180
- if (!isWindows) {
181
- return spawn(cmd, args, Object.assign({}, opts || {}, { detached: true }));
182
- }
183
- var newParams = [cmd].concat(args);
184
- var target = path.join(__dirname, "..", "..", "vendor", "jobber", "Jobber.exe");
185
- var options = __assign(__assign({}, (opts !== null && opts !== void 0 ? opts : {})), { detached: true, jobber: true });
186
- d("spawnDetached: ".concat(target, ", ").concat(newParams));
187
- return spawn(target, newParams, options);
188
- }
189
- /**
190
- * Spawns a process attached as a child of the current process.
191
- *
192
- * @param {string} exe The executable to run
193
- * @param {string[]} params The parameters to pass to the child
194
- * @param {SpawnOptions & SpawnRxExtras} opts Options to pass to spawn.
195
- *
196
- * @return {Observable<string>} Returns an Observable that when subscribed
197
- * to, will create a child process. The
198
- * process output will be streamed to this
199
- * Observable, and if unsubscribed from, the
200
- * process will be terminated early. If the
201
- * process terminates with a non-zero value,
202
- * the Observable will terminate with onError.
203
- */
204
- function spawn(exe, params, opts) {
205
- opts = opts !== null && opts !== void 0 ? opts : {};
206
- var spawnObs = new rxjs_1.Observable(function (subj) {
207
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
208
- var stdin = opts.stdin, jobber = opts.jobber, split = opts.split, encoding = opts.encoding, spawnOpts = __rest(opts, ["stdin", "jobber", "split", "encoding"]);
209
- var _a = findActualExecutable(exe, params), cmd = _a.cmd, args = _a.args;
210
- d("spawning process: ".concat(cmd, " ").concat(args.join(), ", ").concat(JSON.stringify(spawnOpts)));
211
- var proc = (0, child_process_1.spawn)(cmd, args, spawnOpts);
212
- var bufHandler = function (source) { return function (b) {
213
- if (b.length < 1) {
214
- return;
215
- }
216
- if (opts.echoOutput) {
217
- (source === "stdout" ? process.stdout : process.stderr).write(b);
218
- }
219
- var chunk = "<< String sent back was too long >>";
220
- try {
221
- if (typeof b === "string") {
222
- chunk = b.toString();
223
- }
224
- else {
225
- chunk = b.toString(encoding || "utf8");
226
- }
227
- }
228
- catch (_a) {
229
- chunk = "<< Lost chunk of process output for ".concat(exe, " - length was ").concat(b.length, ">>");
230
- }
231
- subj.next({ source: source, text: chunk });
232
- }; };
233
- var ret = new rxjs_1.Subscription();
234
- if (opts.stdin) {
235
- if (proc.stdin) {
236
- ret.add(opts.stdin.subscribe({
237
- next: function (x) { return proc.stdin.write(x); },
238
- error: subj.error.bind(subj),
239
- complete: function () { return proc.stdin.end(); },
240
- }));
241
- }
242
- else {
243
- subj.error(new Error("opts.stdio conflicts with provided spawn opts.stdin observable, 'pipe' is required"));
244
- }
245
- }
246
- var stderrCompleted = null;
247
- var stdoutCompleted = null;
248
- var noClose = false;
249
- if (proc.stdout) {
250
- stdoutCompleted = new rxjs_1.AsyncSubject();
251
- proc.stdout.on("data", bufHandler("stdout"));
252
- proc.stdout.on("close", function () {
253
- stdoutCompleted.next(true);
254
- stdoutCompleted.complete();
255
- });
256
- }
257
- else {
258
- stdoutCompleted = (0, rxjs_1.of)(true);
259
- }
260
- if (proc.stderr) {
261
- stderrCompleted = new rxjs_1.AsyncSubject();
262
- proc.stderr.on("data", bufHandler("stderr"));
263
- proc.stderr.on("close", function () {
264
- stderrCompleted.next(true);
265
- stderrCompleted.complete();
266
- });
267
- }
268
- else {
269
- stderrCompleted = (0, rxjs_1.of)(true);
270
- }
271
- proc.on("error", function (e) {
272
- noClose = true;
273
- subj.error(e);
274
- });
275
- proc.on("close", function (code) {
276
- noClose = true;
277
- var pipesClosed = (0, rxjs_1.merge)(stdoutCompleted, stderrCompleted).pipe((0, operators_1.reduce)(function (acc) { return acc; }, true));
278
- if (code === 0) {
279
- pipesClosed.subscribe(function () { return subj.complete(); });
280
- }
281
- else {
282
- pipesClosed.subscribe(function () {
283
- var e = new Error("Failed with exit code: ".concat(code));
284
- e.exitCode = code;
285
- e.code = code;
286
- subj.error(e);
287
- });
288
- }
289
- });
290
- ret.add(new rxjs_1.Subscription(function () {
291
- if (noClose) {
292
- return;
293
- }
294
- d("Killing process: ".concat(cmd, " ").concat(args.join()));
295
- if (opts.jobber) {
296
- // NB: Connecting to Jobber's named pipe will kill it
297
- net.connect("\\\\.\\pipe\\jobber-".concat(proc.pid));
298
- setTimeout(function () { return proc.kill(); }, 5 * 1000);
299
- }
300
- else {
301
- proc.kill();
302
- }
303
- }));
304
- return ret;
305
- });
306
- return opts.split ? spawnObs : spawnObs.pipe((0, operators_1.map)(function (x) { return x === null || x === void 0 ? void 0 : x.text; }));
307
- }
308
- function wrapObservableInPromise(obs) {
309
- return new Promise(function (res, rej) {
310
- var out = "";
311
- obs.subscribe({
312
- next: function (x) { return (out += x); },
313
- error: function (e) {
314
- var err = new Error("".concat(out, "\n").concat(e.message));
315
- if ("exitCode" in e) {
316
- err.exitCode = e.exitCode;
317
- err.code = e.exitCode;
318
- }
319
- rej(err);
320
- },
321
- complete: function () { return res(out); },
322
- });
323
- });
324
- }
325
- function wrapObservableInSplitPromise(obs) {
326
- return new Promise(function (res, rej) {
327
- var out = "";
328
- var err = "";
329
- obs.subscribe({
330
- next: function (x) { return (x.source === "stdout" ? (out += x.text) : (err += x.text)); },
331
- error: function (e) {
332
- var error = new Error("".concat(out, "\n").concat(e.message));
333
- if ("exitCode" in e) {
334
- error.exitCode = e.exitCode;
335
- error.code = e.exitCode;
336
- error.stdout = out;
337
- error.stderr = err;
338
- }
339
- rej(error);
340
- },
341
- complete: function () { return res([out, err]); },
342
- });
343
- });
344
- }
345
- /**
346
- * Spawns a process but detached from the current process. The process is put
347
- * into its own Process Group.
348
- *
349
- * @param {string} exe The executable to run
350
- * @param {string[]} params The parameters to pass to the child
351
- * @param {Object} opts Options to pass to spawn.
352
- *
353
- * @return {Promise<string>} Returns an Promise that represents a detached
354
- * process. The value returned is the process
355
- * output. If the process terminates with a
356
- * non-zero value, the Promise will resolve with
357
- * an Error.
358
- */
359
- function spawnDetachedPromise(exe, params, opts) {
360
- if (opts === null || opts === void 0 ? void 0 : opts.split) {
361
- return wrapObservableInSplitPromise(spawnDetached(exe, params, __assign(__assign({}, (opts !== null && opts !== void 0 ? opts : {})), { split: true })));
362
- }
363
- else {
364
- return wrapObservableInPromise(spawnDetached(exe, params, __assign(__assign({}, (opts !== null && opts !== void 0 ? opts : {})), { split: false })));
365
- }
366
- }
367
- /**
368
- * Spawns a process as a child process.
369
- *
370
- * @param {string} exe The executable to run
371
- * @param {string[]} params The parameters to pass to the child
372
- * @param {Object} opts Options to pass to spawn.
373
- *
374
- * @return {Promise<string>} Returns an Promise that represents a child
375
- * process. The value returned is the process
376
- * output. If the process terminates with a
377
- * non-zero value, the Promise will resolve with
378
- * an Error.
379
- */
380
- function spawnPromise(exe, params, opts) {
381
- if (opts === null || opts === void 0 ? void 0 : opts.split) {
382
- return wrapObservableInSplitPromise(spawn(exe, params, __assign(__assign({}, (opts !== null && opts !== void 0 ? opts : {})), { split: true })));
383
- }
384
- else {
385
- return wrapObservableInPromise(spawn(exe, params, __assign(__assign({}, (opts !== null && opts !== void 0 ? opts : {})), { split: false })));
386
- }
387
- }
388
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyFA,oDA8DC;AA8ED,sCAiCC;AA2DD,sBAqIC;AAkGD,oDAcC;AAqDD,oCAcC;AAznBD,uDAAuD;AACvD,2BAA6B;AAC7B,yBAA2B;AAC3B,wBAA0B;AAG1B,6BAAyE;AACzE,4CAA6C;AAC7C,+CAA+D;AAC/D,+BAA0B;AAE1B,IAAM,SAAS,GAAG,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC;AAE/C,IAAM,CAAC,GAAG,IAAA,eAAK,EAAC,UAAU,CAAC,CAAC,CAAC,s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SAAgB,YAAY,CAC1B,GAAW,EACX,MAAgB,EAChB,IAAmC;IAEnC,IAAI,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,KAAK,EAAE,CAAC;QAChB,OAAO,4BAA4B,CACjC,KAAK,CAAC,GAAG,EAAE,MAAM,wBAAO,CAAC,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,EAAE,CAAC,KAAE,KAAK,EAAE,IAAI,IAAG,CACrD,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,OAAO,uBAAuB,CAC5B,KAAK,CAAC,GAAG,EAAE,MAAM,wBAAO,CAAC,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,EAAE,CAAC,KAAE,KAAK,EAAE,KAAK,IAAG,CACtD,CAAC;IACJ,CAAC;AACH,CAAC"}
package/src/ambient.d.ts DELETED
@@ -1 +0,0 @@
1
- declare module "lodash.assign";
package/test/support.ts DELETED
@@ -1,15 +0,0 @@
1
- /* eslint-disable @typescript-eslint/no-explicit-any */
2
- import * as chai from "chai";
3
- import * as chaiAsPromised from "chai-as-promised";
4
-
5
- declare const global: any;
6
-
7
- chai.should();
8
- chai.use(chaiAsPromised);
9
-
10
- global.chai = chai;
11
- global.chaiAsPromised = chaiAsPromised;
12
- global.expect = chai.expect;
13
- global.AssertionError = chai.AssertionError;
14
- global.assert = chai.assert;
15
- global.Assertion = (chai as any).Assertion; // 'Assertion' is not existing?
Binary file