@pnpm/exe 11.0.0-alpha.9 → 11.0.0-beta.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/dist/node_modules/@gar/promise-retry/lib/index.js +28 -0
- package/dist/node_modules/@gar/promise-retry/package.json +48 -0
- package/dist/node_modules/@npmcli/agent/package.json +7 -7
- package/dist/node_modules/@npmcli/fs/package.json +4 -4
- package/dist/node_modules/abbrev/package.json +11 -15
- package/dist/node_modules/balanced-match/package.json +4 -7
- package/dist/node_modules/brace-expansion/dist/commonjs/index.js +1 -1
- package/dist/node_modules/brace-expansion/dist/esm/index.js +1 -1
- package/dist/node_modules/brace-expansion/package.json +3 -3
- package/dist/node_modules/cacache/package.json +10 -11
- package/dist/node_modules/glob/dist/commonjs/glob.js +2 -1
- package/dist/node_modules/glob/dist/commonjs/index.min.js +4 -0
- package/dist/node_modules/glob/dist/commonjs/pattern.js +4 -0
- package/dist/node_modules/glob/dist/esm/glob.js +2 -1
- package/dist/node_modules/glob/dist/esm/index.min.js +4 -0
- package/dist/node_modules/glob/dist/esm/pattern.js +4 -0
- package/dist/node_modules/glob/package.json +38 -37
- package/dist/node_modules/iconv-lite/encodings/dbcs-codec.js +460 -525
- package/dist/node_modules/iconv-lite/encodings/dbcs-data.js +179 -182
- package/dist/node_modules/iconv-lite/encodings/index.js +15 -15
- package/dist/node_modules/iconv-lite/encodings/internal.js +168 -148
- package/dist/node_modules/iconv-lite/encodings/sbcs-codec.js +55 -52
- package/dist/node_modules/iconv-lite/encodings/sbcs-data.js +174 -175
- package/dist/node_modules/iconv-lite/encodings/utf16.js +121 -131
- package/dist/node_modules/iconv-lite/encodings/utf32.js +226 -238
- package/dist/node_modules/iconv-lite/encodings/utf7.js +208 -215
- package/dist/node_modules/iconv-lite/lib/bom-handling.js +30 -34
- package/dist/node_modules/iconv-lite/lib/helpers/merge-exports.js +13 -0
- package/dist/node_modules/iconv-lite/lib/index.js +125 -123
- package/dist/node_modules/iconv-lite/lib/streams.js +92 -96
- package/dist/node_modules/iconv-lite/package.json +34 -8
- package/dist/node_modules/isexe/package.json +65 -18
- package/dist/node_modules/lru-cache/dist/commonjs/index.js +134 -85
- package/dist/node_modules/lru-cache/dist/commonjs/index.min.js +1 -1
- package/dist/node_modules/lru-cache/dist/esm/index.js +134 -85
- package/dist/node_modules/lru-cache/dist/esm/index.min.js +1 -1
- package/dist/node_modules/lru-cache/package.json +18 -41
- package/dist/node_modules/make-fetch-happen/lib/remote.js +1 -1
- package/dist/node_modules/make-fetch-happen/package.json +10 -10
- package/dist/node_modules/minimatch/dist/commonjs/ast.js +266 -21
- package/dist/node_modules/minimatch/dist/commonjs/index.js +178 -92
- package/dist/node_modules/minimatch/dist/esm/ast.js +266 -21
- package/dist/node_modules/minimatch/dist/esm/index.js +178 -92
- package/dist/node_modules/minimatch/package.json +4 -4
- package/dist/node_modules/minipass/dist/commonjs/index.js +13 -3
- package/dist/node_modules/minipass/dist/esm/index.js +3 -1
- package/dist/node_modules/minipass/package.json +9 -14
- package/dist/node_modules/minipass-fetch/lib/body.js +25 -15
- package/dist/node_modules/minipass-fetch/package.json +7 -7
- package/dist/node_modules/minipass-sized/dist/commonjs/index.js +69 -0
- package/dist/node_modules/minipass-sized/dist/esm/index.js +64 -0
- package/dist/node_modules/minipass-sized/package.json +39 -9
- package/dist/node_modules/node-gyp/.release-please-manifest.json +1 -1
- package/dist/node_modules/node-gyp/bin/node-gyp.js +7 -0
- package/dist/node_modules/node-gyp/gyp/.release-please-manifest.json +1 -1
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/MSVSNew.py +3 -3
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.py +26 -1
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py +1 -1
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py +3 -4
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py +1 -1
- package/dist/node_modules/node-gyp/gyp/pyproject.toml +1 -1
- package/dist/node_modules/node-gyp/lib/build.js +2 -2
- package/dist/node_modules/node-gyp/lib/find-python.js +2 -8
- package/dist/node_modules/node-gyp/lib/find-visualstudio.js +11 -5
- package/dist/node_modules/node-gyp/lib/install.js +1 -1
- package/dist/node_modules/node-gyp/lib/process-release.js +3 -3
- package/dist/node_modules/node-gyp/package.json +13 -13
- package/dist/node_modules/nopt/package.json +5 -5
- package/dist/node_modules/path-scurry/package.json +8 -24
- package/dist/node_modules/proc-log/lib/index.js +10 -5
- package/dist/node_modules/proc-log/package.json +5 -5
- package/dist/node_modules/retry/lib/retry.js +2 -2
- package/dist/node_modules/retry/lib/retry_operation.js +10 -6
- package/dist/node_modules/retry/package.json +6 -2
- package/dist/node_modules/ssri/lib/index.js +33 -63
- package/dist/node_modules/ssri/package.json +17 -17
- package/dist/node_modules/tar/dist/commonjs/index.min.js +2 -2
- package/dist/node_modules/tar/dist/commonjs/unpack.js +4 -4
- package/dist/node_modules/tar/dist/esm/index.min.js +2 -2
- package/dist/node_modules/tar/dist/esm/unpack.js +4 -4
- package/dist/node_modules/tar/package.json +6 -6
- package/dist/node_modules/unique-filename/package.json +5 -5
- package/dist/node_modules/unique-slug/package.json +4 -4
- package/dist/node_modules/which/package.json +29 -20
- package/dist/pnpm.mjs +225713 -208017
- package/dist/worker.js +4838 -5926
- package/package.json +10 -10
- package/setup.js +12 -14
- package/dist/node_modules/@isaacs/cliui/dist/commonjs/ansi-regex/index.js +0 -16
- package/dist/node_modules/@isaacs/cliui/dist/commonjs/ansi-styles/index.js +0 -170
- package/dist/node_modules/@isaacs/cliui/dist/commonjs/eastasianwidth/index.js +0 -307
- package/dist/node_modules/@isaacs/cliui/dist/commonjs/emoji-regex/index.js +0 -7
- package/dist/node_modules/@isaacs/cliui/dist/commonjs/index.js +0 -322
- package/dist/node_modules/@isaacs/cliui/dist/commonjs/index.min.js +0 -12
- package/dist/node_modules/@isaacs/cliui/dist/commonjs/string-width/index.js +0 -49
- package/dist/node_modules/@isaacs/cliui/dist/commonjs/strip-ansi/index.js +0 -8
- package/dist/node_modules/@isaacs/cliui/dist/commonjs/wrap-ansi/index.js +0 -176
- package/dist/node_modules/@isaacs/cliui/dist/esm/ansi-regex/index.js +0 -12
- package/dist/node_modules/@isaacs/cliui/dist/esm/ansi-styles/index.js +0 -167
- package/dist/node_modules/@isaacs/cliui/dist/esm/eastasianwidth/index.js +0 -299
- package/dist/node_modules/@isaacs/cliui/dist/esm/emoji-regex/index.js +0 -3
- package/dist/node_modules/@isaacs/cliui/dist/esm/index.js +0 -317
- package/dist/node_modules/@isaacs/cliui/dist/esm/index.min.js +0 -12
- package/dist/node_modules/@isaacs/cliui/dist/esm/string-width/index.js +0 -46
- package/dist/node_modules/@isaacs/cliui/dist/esm/strip-ansi/index.js +0 -4
- package/dist/node_modules/@isaacs/cliui/dist/esm/wrap-ansi/index.js +0 -172
- package/dist/node_modules/@isaacs/cliui/package.json +0 -163
- package/dist/node_modules/cross-spawn/LICENSE +0 -21
- package/dist/node_modules/cross-spawn/index.js +0 -39
- package/dist/node_modules/cross-spawn/lib/enoent.js +0 -59
- package/dist/node_modules/cross-spawn/lib/parse.js +0 -91
- package/dist/node_modules/cross-spawn/lib/util/escape.js +0 -47
- package/dist/node_modules/cross-spawn/lib/util/readShebang.js +0 -23
- package/dist/node_modules/cross-spawn/lib/util/resolveCommand.js +0 -52
- package/dist/node_modules/cross-spawn/package.json +0 -73
- package/dist/node_modules/encoding/.prettierrc.js +0 -8
- package/dist/node_modules/encoding/LICENSE +0 -16
- package/dist/node_modules/encoding/lib/encoding.js +0 -83
- package/dist/node_modules/encoding/package.json +0 -18
- package/dist/node_modules/err-code/.eslintrc.json +0 -7
- package/dist/node_modules/err-code/bower.json +0 -30
- package/dist/node_modules/err-code/index.js +0 -47
- package/dist/node_modules/err-code/index.umd.js +0 -51
- package/dist/node_modules/err-code/package.json +0 -34
- package/dist/node_modules/foreground-child/LICENSE +0 -15
- package/dist/node_modules/foreground-child/dist/commonjs/all-signals.js +0 -58
- package/dist/node_modules/foreground-child/dist/commonjs/index.js +0 -123
- package/dist/node_modules/foreground-child/dist/commonjs/proxy-signals.js +0 -38
- package/dist/node_modules/foreground-child/dist/commonjs/watchdog.js +0 -50
- package/dist/node_modules/foreground-child/dist/esm/all-signals.js +0 -52
- package/dist/node_modules/foreground-child/dist/esm/index.js +0 -115
- package/dist/node_modules/foreground-child/dist/esm/proxy-signals.js +0 -34
- package/dist/node_modules/foreground-child/dist/esm/watchdog.js +0 -46
- package/dist/node_modules/foreground-child/package.json +0 -106
- package/dist/node_modules/glob/dist/esm/bin.d.mts +0 -3
- package/dist/node_modules/glob/dist/esm/bin.mjs +0 -346
- package/dist/node_modules/iconv-lite/.github/dependabot.yml +0 -11
- package/dist/node_modules/iconv-lite/.idea/codeStyles/Project.xml +0 -47
- package/dist/node_modules/iconv-lite/.idea/codeStyles/codeStyleConfig.xml +0 -5
- package/dist/node_modules/iconv-lite/.idea/iconv-lite.iml +0 -12
- package/dist/node_modules/iconv-lite/.idea/inspectionProfiles/Project_Default.xml +0 -6
- package/dist/node_modules/iconv-lite/.idea/modules.xml +0 -8
- package/dist/node_modules/iconv-lite/.idea/vcs.xml +0 -6
- package/dist/node_modules/isexe/LICENSE +0 -15
- package/dist/node_modules/isexe/index.js +0 -57
- package/dist/node_modules/isexe/mode.js +0 -41
- package/dist/node_modules/isexe/windows.js +0 -42
- package/dist/node_modules/jackspeak/dist/commonjs/index.js +0 -944
- package/dist/node_modules/jackspeak/dist/commonjs/index.min.js +0 -33
- package/dist/node_modules/jackspeak/dist/commonjs/package.json +0 -3
- package/dist/node_modules/jackspeak/dist/esm/index.js +0 -936
- package/dist/node_modules/jackspeak/dist/esm/index.min.js +0 -33
- package/dist/node_modules/jackspeak/dist/esm/package.json +0 -3
- package/dist/node_modules/jackspeak/package.json +0 -115
- package/dist/node_modules/lru-cache/LICENSE +0 -15
- package/dist/node_modules/minipass/LICENSE +0 -15
- package/dist/node_modules/minipass-sized/index.js +0 -67
- package/dist/node_modules/minipass-sized/node_modules/minipass/LICENSE +0 -15
- package/dist/node_modules/minipass-sized/node_modules/minipass/index.js +0 -649
- package/dist/node_modules/minipass-sized/node_modules/minipass/package.json +0 -56
- package/dist/node_modules/minipass-sized/package-lock.json +0 -3464
- package/dist/node_modules/node-gyp/node_modules/isexe/dist/commonjs/package.json +0 -3
- package/dist/node_modules/node-gyp/node_modules/isexe/dist/esm/package.json +0 -3
- package/dist/node_modules/node-gyp/node_modules/isexe/package.json +0 -78
- package/dist/node_modules/node-gyp/node_modules/which/LICENSE +0 -15
- package/dist/node_modules/node-gyp/node_modules/which/package.json +0 -52
- package/dist/node_modules/package-json-from-dist/dist/commonjs/index.js +0 -134
- package/dist/node_modules/package-json-from-dist/dist/commonjs/package.json +0 -3
- package/dist/node_modules/package-json-from-dist/dist/esm/index.js +0 -129
- package/dist/node_modules/package-json-from-dist/dist/esm/package.json +0 -3
- package/dist/node_modules/package-json-from-dist/package.json +0 -68
- package/dist/node_modules/path-key/index.js +0 -16
- package/dist/node_modules/path-key/license +0 -9
- package/dist/node_modules/path-key/package.json +0 -39
- package/dist/node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/index.js +0 -1589
- package/dist/node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/index.min.js +0 -2
- package/dist/node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/package.json +0 -3
- package/dist/node_modules/path-scurry/node_modules/lru-cache/dist/esm/index.js +0 -1585
- package/dist/node_modules/path-scurry/node_modules/lru-cache/dist/esm/index.min.js +0 -2
- package/dist/node_modules/path-scurry/node_modules/lru-cache/dist/esm/package.json +0 -3
- package/dist/node_modules/path-scurry/node_modules/lru-cache/package.json +0 -101
- package/dist/node_modules/promise-retry/index.js +0 -52
- package/dist/node_modules/promise-retry/package.json +0 -37
- package/dist/node_modules/retry/equation.gif +0 -0
- package/dist/node_modules/shebang-command/index.js +0 -19
- package/dist/node_modules/shebang-command/license +0 -9
- package/dist/node_modules/shebang-command/package.json +0 -34
- package/dist/node_modules/shebang-regex/index.js +0 -2
- package/dist/node_modules/shebang-regex/license +0 -9
- package/dist/node_modules/shebang-regex/package.json +0 -35
- package/dist/node_modules/signal-exit/LICENSE.txt +0 -16
- package/dist/node_modules/signal-exit/dist/cjs/browser.js +0 -10
- package/dist/node_modules/signal-exit/dist/cjs/index.js +0 -279
- package/dist/node_modules/signal-exit/dist/cjs/package.json +0 -3
- package/dist/node_modules/signal-exit/dist/cjs/signals.js +0 -42
- package/dist/node_modules/signal-exit/dist/mjs/browser.js +0 -4
- package/dist/node_modules/signal-exit/dist/mjs/index.js +0 -275
- package/dist/node_modules/signal-exit/dist/mjs/package.json +0 -3
- package/dist/node_modules/signal-exit/dist/mjs/signals.js +0 -39
- package/dist/node_modules/signal-exit/package.json +0 -106
- package/dist/node_modules/which/bin/node-which +0 -52
- package/dist/node_modules/which/which.js +0 -125
- /package/dist/node_modules/{promise-retry → @gar/promise-retry}/LICENSE +0 -0
- /package/dist/node_modules/{node-gyp/node_modules/isexe → isexe}/dist/commonjs/index.js +0 -0
- /package/dist/node_modules/{node-gyp/node_modules/isexe → isexe}/dist/commonjs/index.min.js +0 -0
- /package/dist/node_modules/{node-gyp/node_modules/isexe → isexe}/dist/commonjs/options.js +0 -0
- /package/dist/node_modules/{@isaacs/cliui → isexe}/dist/commonjs/package.json +0 -0
- /package/dist/node_modules/{node-gyp/node_modules/isexe → isexe}/dist/commonjs/posix.js +0 -0
- /package/dist/node_modules/{node-gyp/node_modules/isexe → isexe}/dist/commonjs/win32.js +0 -0
- /package/dist/node_modules/{node-gyp/node_modules/isexe → isexe}/dist/esm/index.js +0 -0
- /package/dist/node_modules/{node-gyp/node_modules/isexe → isexe}/dist/esm/index.min.js +0 -0
- /package/dist/node_modules/{node-gyp/node_modules/isexe → isexe}/dist/esm/options.js +0 -0
- /package/dist/node_modules/{@isaacs/cliui → isexe}/dist/esm/package.json +0 -0
- /package/dist/node_modules/{node-gyp/node_modules/isexe → isexe}/dist/esm/posix.js +0 -0
- /package/dist/node_modules/{node-gyp/node_modules/isexe → isexe}/dist/esm/win32.js +0 -0
- /package/dist/node_modules/{foreground-child → minipass-sized}/dist/commonjs/package.json +0 -0
- /package/dist/node_modules/{foreground-child → minipass-sized}/dist/esm/package.json +0 -0
- /package/dist/node_modules/{node-gyp/node_modules/which → which}/bin/which.js +0 -0
- /package/dist/node_modules/{node-gyp/node_modules/which → which}/lib/index.js +0 -0
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "encoding",
|
|
3
|
-
"version": "0.1.13",
|
|
4
|
-
"description": "Convert encodings, uses iconv-lite",
|
|
5
|
-
"main": "lib/encoding.js",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"test": "nodeunit test"
|
|
8
|
-
},
|
|
9
|
-
"repository": "https://github.com/andris9/encoding.git",
|
|
10
|
-
"author": "Andris Reinman",
|
|
11
|
-
"license": "MIT",
|
|
12
|
-
"dependencies": {
|
|
13
|
-
"iconv-lite": "^0.6.2"
|
|
14
|
-
},
|
|
15
|
-
"devDependencies": {
|
|
16
|
-
"nodeunit": "0.11.3"
|
|
17
|
-
}
|
|
18
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "err-code",
|
|
3
|
-
"version": "1.1.1",
|
|
4
|
-
"description": "Create new error instances with a code and additional properties",
|
|
5
|
-
"main": "index.umd.js",
|
|
6
|
-
"homepage": "https://github.com/IndigoUnited/js-err-code",
|
|
7
|
-
"authors": [
|
|
8
|
-
"IndigoUnited <hello@indigounited.com> (http://indigounited.com)"
|
|
9
|
-
],
|
|
10
|
-
"moduleType": [
|
|
11
|
-
"amd",
|
|
12
|
-
"globals",
|
|
13
|
-
"node"
|
|
14
|
-
],
|
|
15
|
-
"keywords": [
|
|
16
|
-
"error",
|
|
17
|
-
"err",
|
|
18
|
-
"code",
|
|
19
|
-
"properties",
|
|
20
|
-
"property"
|
|
21
|
-
],
|
|
22
|
-
"license": "MIT",
|
|
23
|
-
"ignore": [
|
|
24
|
-
"**/.*",
|
|
25
|
-
"node_modules",
|
|
26
|
-
"bower_components",
|
|
27
|
-
"test",
|
|
28
|
-
"tests"
|
|
29
|
-
]
|
|
30
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
function assign(obj, props) {
|
|
4
|
-
for (const key in props) {
|
|
5
|
-
Object.defineProperty(obj, key, {
|
|
6
|
-
value: props[key],
|
|
7
|
-
enumerable: true,
|
|
8
|
-
configurable: true,
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
return obj;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
function createError(err, code, props) {
|
|
16
|
-
if (!err || typeof err === 'string') {
|
|
17
|
-
throw new TypeError('Please pass an Error to err-code');
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
if (!props) {
|
|
21
|
-
props = {};
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
if (typeof code === 'object') {
|
|
25
|
-
props = code;
|
|
26
|
-
code = undefined;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
if (code != null) {
|
|
30
|
-
props.code = code;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
try {
|
|
34
|
-
return assign(err, props);
|
|
35
|
-
} catch (_) {
|
|
36
|
-
props.message = err.message;
|
|
37
|
-
props.stack = err.stack;
|
|
38
|
-
|
|
39
|
-
const ErrClass = function () {};
|
|
40
|
-
|
|
41
|
-
ErrClass.prototype = Object.create(Object.getPrototypeOf(err));
|
|
42
|
-
|
|
43
|
-
return assign(new ErrClass(), props);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
module.exports = createError;
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.errCode = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
|
|
2
|
-
'use strict';
|
|
3
|
-
|
|
4
|
-
function assign(obj, props) {
|
|
5
|
-
for (const key in props) {
|
|
6
|
-
Object.defineProperty(obj, key, {
|
|
7
|
-
value: props[key],
|
|
8
|
-
enumerable: true,
|
|
9
|
-
configurable: true,
|
|
10
|
-
});
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
return obj;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
function createError(err, code, props) {
|
|
17
|
-
if (!err || typeof err === 'string') {
|
|
18
|
-
throw new TypeError('Please pass an Error to err-code');
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
if (!props) {
|
|
22
|
-
props = {};
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
if (typeof code === 'object') {
|
|
26
|
-
props = code;
|
|
27
|
-
code = undefined;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
if (code != null) {
|
|
31
|
-
props.code = code;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
try {
|
|
35
|
-
return assign(err, props);
|
|
36
|
-
} catch (_) {
|
|
37
|
-
props.message = err.message;
|
|
38
|
-
props.stack = err.stack;
|
|
39
|
-
|
|
40
|
-
const ErrClass = function () {};
|
|
41
|
-
|
|
42
|
-
ErrClass.prototype = Object.create(Object.getPrototypeOf(err));
|
|
43
|
-
|
|
44
|
-
return assign(new ErrClass(), props);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
module.exports = createError;
|
|
49
|
-
|
|
50
|
-
},{}]},{},[1])(1)
|
|
51
|
-
});
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "err-code",
|
|
3
|
-
"version": "2.0.3",
|
|
4
|
-
"description": "Create an error with a code",
|
|
5
|
-
"main": "index.js",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"lint": "eslint '{*.js,test/**/*.js}' --ignore-pattern *.umd.js",
|
|
8
|
-
"test": "mocha --bail",
|
|
9
|
-
"browserify": "browserify -s err-code index.js > index.umd.js"
|
|
10
|
-
},
|
|
11
|
-
"bugs": {
|
|
12
|
-
"url": "https://github.com/IndigoUnited/js-err-code/issues/"
|
|
13
|
-
},
|
|
14
|
-
"repository": {
|
|
15
|
-
"type": "git",
|
|
16
|
-
"url": "git://github.com/IndigoUnited/js-err-code.git"
|
|
17
|
-
},
|
|
18
|
-
"keywords": [
|
|
19
|
-
"error",
|
|
20
|
-
"err",
|
|
21
|
-
"code",
|
|
22
|
-
"properties",
|
|
23
|
-
"property"
|
|
24
|
-
],
|
|
25
|
-
"author": "IndigoUnited <hello@indigounited.com> (http://indigounited.com)",
|
|
26
|
-
"license": "MIT",
|
|
27
|
-
"devDependencies": {
|
|
28
|
-
"@satazor/eslint-config": "^3.0.0",
|
|
29
|
-
"browserify": "^16.5.1",
|
|
30
|
-
"eslint": "^7.2.0",
|
|
31
|
-
"expect.js": "^0.3.1",
|
|
32
|
-
"mocha": "^8.0.1"
|
|
33
|
-
}
|
|
34
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
The ISC License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2015-2023 Isaac Z. Schlueter and Contributors
|
|
4
|
-
|
|
5
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
-
purpose with or without fee is hereby granted, provided that the above
|
|
7
|
-
copyright notice and this permission notice appear in all copies.
|
|
8
|
-
|
|
9
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
10
|
-
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
11
|
-
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
12
|
-
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
13
|
-
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
14
|
-
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
|
15
|
-
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.allSignals = void 0;
|
|
7
|
-
const node_constants_1 = __importDefault(require("node:constants"));
|
|
8
|
-
exports.allSignals =
|
|
9
|
-
// this is the full list of signals that Node will let us do anything with
|
|
10
|
-
Object.keys(node_constants_1.default).filter(k => k.startsWith('SIG') &&
|
|
11
|
-
// https://github.com/tapjs/signal-exit/issues/21
|
|
12
|
-
k !== 'SIGPROF' &&
|
|
13
|
-
// no sense trying to listen for SIGKILL, it's impossible
|
|
14
|
-
k !== 'SIGKILL');
|
|
15
|
-
// These are some obscure signals that are reported by kill -l
|
|
16
|
-
// on macOS, Linux, or Windows, but which don't have any mapping
|
|
17
|
-
// in Node.js. No sense trying if they're just going to throw
|
|
18
|
-
// every time on every platform.
|
|
19
|
-
//
|
|
20
|
-
// 'SIGEMT',
|
|
21
|
-
// 'SIGLOST',
|
|
22
|
-
// 'SIGPOLL',
|
|
23
|
-
// 'SIGRTMAX',
|
|
24
|
-
// 'SIGRTMAX-1',
|
|
25
|
-
// 'SIGRTMAX-10',
|
|
26
|
-
// 'SIGRTMAX-11',
|
|
27
|
-
// 'SIGRTMAX-12',
|
|
28
|
-
// 'SIGRTMAX-13',
|
|
29
|
-
// 'SIGRTMAX-14',
|
|
30
|
-
// 'SIGRTMAX-15',
|
|
31
|
-
// 'SIGRTMAX-2',
|
|
32
|
-
// 'SIGRTMAX-3',
|
|
33
|
-
// 'SIGRTMAX-4',
|
|
34
|
-
// 'SIGRTMAX-5',
|
|
35
|
-
// 'SIGRTMAX-6',
|
|
36
|
-
// 'SIGRTMAX-7',
|
|
37
|
-
// 'SIGRTMAX-8',
|
|
38
|
-
// 'SIGRTMAX-9',
|
|
39
|
-
// 'SIGRTMIN',
|
|
40
|
-
// 'SIGRTMIN+1',
|
|
41
|
-
// 'SIGRTMIN+10',
|
|
42
|
-
// 'SIGRTMIN+11',
|
|
43
|
-
// 'SIGRTMIN+12',
|
|
44
|
-
// 'SIGRTMIN+13',
|
|
45
|
-
// 'SIGRTMIN+14',
|
|
46
|
-
// 'SIGRTMIN+15',
|
|
47
|
-
// 'SIGRTMIN+16',
|
|
48
|
-
// 'SIGRTMIN+2',
|
|
49
|
-
// 'SIGRTMIN+3',
|
|
50
|
-
// 'SIGRTMIN+4',
|
|
51
|
-
// 'SIGRTMIN+5',
|
|
52
|
-
// 'SIGRTMIN+6',
|
|
53
|
-
// 'SIGRTMIN+7',
|
|
54
|
-
// 'SIGRTMIN+8',
|
|
55
|
-
// 'SIGRTMIN+9',
|
|
56
|
-
// 'SIGSTKFLT',
|
|
57
|
-
// 'SIGUNUSED',
|
|
58
|
-
//# sourceMappingURL=all-signals.js.map
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.normalizeFgArgs = void 0;
|
|
7
|
-
exports.foregroundChild = foregroundChild;
|
|
8
|
-
const child_process_1 = require("child_process");
|
|
9
|
-
const cross_spawn_1 = __importDefault(require("cross-spawn"));
|
|
10
|
-
const signal_exit_1 = require("signal-exit");
|
|
11
|
-
const proxy_signals_js_1 = require("./proxy-signals.js");
|
|
12
|
-
const watchdog_js_1 = require("./watchdog.js");
|
|
13
|
-
/* c8 ignore start */
|
|
14
|
-
const spawn = process?.platform === 'win32' ? cross_spawn_1.default : child_process_1.spawn;
|
|
15
|
-
/**
|
|
16
|
-
* Normalizes the arguments passed to `foregroundChild`.
|
|
17
|
-
*
|
|
18
|
-
* Exposed for testing.
|
|
19
|
-
*
|
|
20
|
-
* @internal
|
|
21
|
-
*/
|
|
22
|
-
const normalizeFgArgs = (fgArgs) => {
|
|
23
|
-
let [program, args = [], spawnOpts = {}, cleanup = () => { }] = fgArgs;
|
|
24
|
-
if (typeof args === 'function') {
|
|
25
|
-
cleanup = args;
|
|
26
|
-
spawnOpts = {};
|
|
27
|
-
args = [];
|
|
28
|
-
}
|
|
29
|
-
else if (!!args && typeof args === 'object' && !Array.isArray(args)) {
|
|
30
|
-
if (typeof spawnOpts === 'function')
|
|
31
|
-
cleanup = spawnOpts;
|
|
32
|
-
spawnOpts = args;
|
|
33
|
-
args = [];
|
|
34
|
-
}
|
|
35
|
-
else if (typeof spawnOpts === 'function') {
|
|
36
|
-
cleanup = spawnOpts;
|
|
37
|
-
spawnOpts = {};
|
|
38
|
-
}
|
|
39
|
-
if (Array.isArray(program)) {
|
|
40
|
-
const [pp, ...pa] = program;
|
|
41
|
-
program = pp;
|
|
42
|
-
args = pa;
|
|
43
|
-
}
|
|
44
|
-
return [program, args, { ...spawnOpts }, cleanup];
|
|
45
|
-
};
|
|
46
|
-
exports.normalizeFgArgs = normalizeFgArgs;
|
|
47
|
-
function foregroundChild(...fgArgs) {
|
|
48
|
-
const [program, args, spawnOpts, cleanup] = (0, exports.normalizeFgArgs)(fgArgs);
|
|
49
|
-
spawnOpts.stdio = [0, 1, 2];
|
|
50
|
-
if (process.send) {
|
|
51
|
-
spawnOpts.stdio.push('ipc');
|
|
52
|
-
}
|
|
53
|
-
const child = spawn(program, args, spawnOpts);
|
|
54
|
-
const childHangup = () => {
|
|
55
|
-
try {
|
|
56
|
-
child.kill('SIGHUP');
|
|
57
|
-
/* c8 ignore start */
|
|
58
|
-
}
|
|
59
|
-
catch (_) {
|
|
60
|
-
// SIGHUP is weird on windows
|
|
61
|
-
child.kill('SIGTERM');
|
|
62
|
-
}
|
|
63
|
-
/* c8 ignore stop */
|
|
64
|
-
};
|
|
65
|
-
const removeOnExit = (0, signal_exit_1.onExit)(childHangup);
|
|
66
|
-
(0, proxy_signals_js_1.proxySignals)(child);
|
|
67
|
-
const dog = (0, watchdog_js_1.watchdog)(child);
|
|
68
|
-
let done = false;
|
|
69
|
-
child.on('close', async (code, signal) => {
|
|
70
|
-
/* c8 ignore start */
|
|
71
|
-
if (done)
|
|
72
|
-
return;
|
|
73
|
-
/* c8 ignore stop */
|
|
74
|
-
done = true;
|
|
75
|
-
const result = cleanup(code, signal, {
|
|
76
|
-
watchdogPid: dog.pid,
|
|
77
|
-
});
|
|
78
|
-
const res = isPromise(result) ? await result : result;
|
|
79
|
-
removeOnExit();
|
|
80
|
-
if (res === false)
|
|
81
|
-
return;
|
|
82
|
-
else if (typeof res === 'string') {
|
|
83
|
-
signal = res;
|
|
84
|
-
code = null;
|
|
85
|
-
}
|
|
86
|
-
else if (typeof res === 'number') {
|
|
87
|
-
code = res;
|
|
88
|
-
signal = null;
|
|
89
|
-
}
|
|
90
|
-
if (signal) {
|
|
91
|
-
// If there is nothing else keeping the event loop alive,
|
|
92
|
-
// then there's a race between a graceful exit and getting
|
|
93
|
-
// the signal to this process. Put this timeout here to
|
|
94
|
-
// make sure we're still alive to get the signal, and thus
|
|
95
|
-
// exit with the intended signal code.
|
|
96
|
-
/* istanbul ignore next */
|
|
97
|
-
setTimeout(() => { }, 2000);
|
|
98
|
-
try {
|
|
99
|
-
process.kill(process.pid, signal);
|
|
100
|
-
/* c8 ignore start */
|
|
101
|
-
}
|
|
102
|
-
catch (_) {
|
|
103
|
-
process.kill(process.pid, 'SIGTERM');
|
|
104
|
-
}
|
|
105
|
-
/* c8 ignore stop */
|
|
106
|
-
}
|
|
107
|
-
else {
|
|
108
|
-
process.exit(code || 0);
|
|
109
|
-
}
|
|
110
|
-
});
|
|
111
|
-
if (process.send) {
|
|
112
|
-
process.removeAllListeners('message');
|
|
113
|
-
child.on('message', (message, sendHandle) => {
|
|
114
|
-
process.send?.(message, sendHandle);
|
|
115
|
-
});
|
|
116
|
-
process.on('message', (message, sendHandle) => {
|
|
117
|
-
child.send(message, sendHandle);
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
return child;
|
|
121
|
-
}
|
|
122
|
-
const isPromise = (o) => !!o && typeof o === 'object' && typeof o.then === 'function';
|
|
123
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.proxySignals = void 0;
|
|
4
|
-
const all_signals_js_1 = require("./all-signals.js");
|
|
5
|
-
/**
|
|
6
|
-
* Starts forwarding signals to `child` through `parent`.
|
|
7
|
-
*/
|
|
8
|
-
const proxySignals = (child) => {
|
|
9
|
-
const listeners = new Map();
|
|
10
|
-
for (const sig of all_signals_js_1.allSignals) {
|
|
11
|
-
const listener = () => {
|
|
12
|
-
// some signals can only be received, not sent
|
|
13
|
-
try {
|
|
14
|
-
child.kill(sig);
|
|
15
|
-
/* c8 ignore start */
|
|
16
|
-
}
|
|
17
|
-
catch (_) { }
|
|
18
|
-
/* c8 ignore stop */
|
|
19
|
-
};
|
|
20
|
-
try {
|
|
21
|
-
// if it's a signal this system doesn't recognize, skip it
|
|
22
|
-
process.on(sig, listener);
|
|
23
|
-
listeners.set(sig, listener);
|
|
24
|
-
/* c8 ignore start */
|
|
25
|
-
}
|
|
26
|
-
catch (_) { }
|
|
27
|
-
/* c8 ignore stop */
|
|
28
|
-
}
|
|
29
|
-
const unproxy = () => {
|
|
30
|
-
for (const [sig, listener] of listeners) {
|
|
31
|
-
process.removeListener(sig, listener);
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
child.on('exit', unproxy);
|
|
35
|
-
return unproxy;
|
|
36
|
-
};
|
|
37
|
-
exports.proxySignals = proxySignals;
|
|
38
|
-
//# sourceMappingURL=proxy-signals.js.map
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// this spawns a child process that listens for SIGHUP when the
|
|
3
|
-
// parent process exits, and after 200ms, sends a SIGKILL to the
|
|
4
|
-
// child, in case it did not terminate.
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.watchdog = void 0;
|
|
7
|
-
const child_process_1 = require("child_process");
|
|
8
|
-
const watchdogCode = String.raw `
|
|
9
|
-
const pid = parseInt(process.argv[1], 10)
|
|
10
|
-
process.title = 'node (foreground-child watchdog pid=' + pid + ')'
|
|
11
|
-
if (!isNaN(pid)) {
|
|
12
|
-
let barked = false
|
|
13
|
-
// keepalive
|
|
14
|
-
const interval = setInterval(() => {}, 60000)
|
|
15
|
-
const bark = () => {
|
|
16
|
-
clearInterval(interval)
|
|
17
|
-
if (barked) return
|
|
18
|
-
barked = true
|
|
19
|
-
process.removeListener('SIGHUP', bark)
|
|
20
|
-
setTimeout(() => {
|
|
21
|
-
try {
|
|
22
|
-
process.kill(pid, 'SIGKILL')
|
|
23
|
-
setTimeout(() => process.exit(), 200)
|
|
24
|
-
} catch (_) {}
|
|
25
|
-
}, 500)
|
|
26
|
-
})
|
|
27
|
-
process.on('SIGHUP', bark)
|
|
28
|
-
}
|
|
29
|
-
`;
|
|
30
|
-
/**
|
|
31
|
-
* Pass in a ChildProcess, and this will spawn a watchdog process that
|
|
32
|
-
* will make sure it exits if the parent does, thus preventing any
|
|
33
|
-
* dangling detached zombie processes.
|
|
34
|
-
*
|
|
35
|
-
* If the child ends before the parent, then the watchdog will terminate.
|
|
36
|
-
*/
|
|
37
|
-
const watchdog = (child) => {
|
|
38
|
-
let dogExited = false;
|
|
39
|
-
const dog = (0, child_process_1.spawn)(process.execPath, ['-e', watchdogCode, String(child.pid)], {
|
|
40
|
-
stdio: 'ignore',
|
|
41
|
-
});
|
|
42
|
-
dog.on('exit', () => (dogExited = true));
|
|
43
|
-
child.on('exit', () => {
|
|
44
|
-
if (!dogExited)
|
|
45
|
-
dog.kill('SIGKILL');
|
|
46
|
-
});
|
|
47
|
-
return dog;
|
|
48
|
-
};
|
|
49
|
-
exports.watchdog = watchdog;
|
|
50
|
-
//# sourceMappingURL=watchdog.js.map
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import constants from 'node:constants';
|
|
2
|
-
export const allSignals =
|
|
3
|
-
// this is the full list of signals that Node will let us do anything with
|
|
4
|
-
Object.keys(constants).filter(k => k.startsWith('SIG') &&
|
|
5
|
-
// https://github.com/tapjs/signal-exit/issues/21
|
|
6
|
-
k !== 'SIGPROF' &&
|
|
7
|
-
// no sense trying to listen for SIGKILL, it's impossible
|
|
8
|
-
k !== 'SIGKILL');
|
|
9
|
-
// These are some obscure signals that are reported by kill -l
|
|
10
|
-
// on macOS, Linux, or Windows, but which don't have any mapping
|
|
11
|
-
// in Node.js. No sense trying if they're just going to throw
|
|
12
|
-
// every time on every platform.
|
|
13
|
-
//
|
|
14
|
-
// 'SIGEMT',
|
|
15
|
-
// 'SIGLOST',
|
|
16
|
-
// 'SIGPOLL',
|
|
17
|
-
// 'SIGRTMAX',
|
|
18
|
-
// 'SIGRTMAX-1',
|
|
19
|
-
// 'SIGRTMAX-10',
|
|
20
|
-
// 'SIGRTMAX-11',
|
|
21
|
-
// 'SIGRTMAX-12',
|
|
22
|
-
// 'SIGRTMAX-13',
|
|
23
|
-
// 'SIGRTMAX-14',
|
|
24
|
-
// 'SIGRTMAX-15',
|
|
25
|
-
// 'SIGRTMAX-2',
|
|
26
|
-
// 'SIGRTMAX-3',
|
|
27
|
-
// 'SIGRTMAX-4',
|
|
28
|
-
// 'SIGRTMAX-5',
|
|
29
|
-
// 'SIGRTMAX-6',
|
|
30
|
-
// 'SIGRTMAX-7',
|
|
31
|
-
// 'SIGRTMAX-8',
|
|
32
|
-
// 'SIGRTMAX-9',
|
|
33
|
-
// 'SIGRTMIN',
|
|
34
|
-
// 'SIGRTMIN+1',
|
|
35
|
-
// 'SIGRTMIN+10',
|
|
36
|
-
// 'SIGRTMIN+11',
|
|
37
|
-
// 'SIGRTMIN+12',
|
|
38
|
-
// 'SIGRTMIN+13',
|
|
39
|
-
// 'SIGRTMIN+14',
|
|
40
|
-
// 'SIGRTMIN+15',
|
|
41
|
-
// 'SIGRTMIN+16',
|
|
42
|
-
// 'SIGRTMIN+2',
|
|
43
|
-
// 'SIGRTMIN+3',
|
|
44
|
-
// 'SIGRTMIN+4',
|
|
45
|
-
// 'SIGRTMIN+5',
|
|
46
|
-
// 'SIGRTMIN+6',
|
|
47
|
-
// 'SIGRTMIN+7',
|
|
48
|
-
// 'SIGRTMIN+8',
|
|
49
|
-
// 'SIGRTMIN+9',
|
|
50
|
-
// 'SIGSTKFLT',
|
|
51
|
-
// 'SIGUNUSED',
|
|
52
|
-
//# sourceMappingURL=all-signals.js.map
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import { spawn as nodeSpawn, } from 'child_process';
|
|
2
|
-
import crossSpawn from 'cross-spawn';
|
|
3
|
-
import { onExit } from 'signal-exit';
|
|
4
|
-
import { proxySignals } from './proxy-signals.js';
|
|
5
|
-
import { watchdog } from './watchdog.js';
|
|
6
|
-
/* c8 ignore start */
|
|
7
|
-
const spawn = process?.platform === 'win32' ? crossSpawn : nodeSpawn;
|
|
8
|
-
/**
|
|
9
|
-
* Normalizes the arguments passed to `foregroundChild`.
|
|
10
|
-
*
|
|
11
|
-
* Exposed for testing.
|
|
12
|
-
*
|
|
13
|
-
* @internal
|
|
14
|
-
*/
|
|
15
|
-
export const normalizeFgArgs = (fgArgs) => {
|
|
16
|
-
let [program, args = [], spawnOpts = {}, cleanup = () => { }] = fgArgs;
|
|
17
|
-
if (typeof args === 'function') {
|
|
18
|
-
cleanup = args;
|
|
19
|
-
spawnOpts = {};
|
|
20
|
-
args = [];
|
|
21
|
-
}
|
|
22
|
-
else if (!!args && typeof args === 'object' && !Array.isArray(args)) {
|
|
23
|
-
if (typeof spawnOpts === 'function')
|
|
24
|
-
cleanup = spawnOpts;
|
|
25
|
-
spawnOpts = args;
|
|
26
|
-
args = [];
|
|
27
|
-
}
|
|
28
|
-
else if (typeof spawnOpts === 'function') {
|
|
29
|
-
cleanup = spawnOpts;
|
|
30
|
-
spawnOpts = {};
|
|
31
|
-
}
|
|
32
|
-
if (Array.isArray(program)) {
|
|
33
|
-
const [pp, ...pa] = program;
|
|
34
|
-
program = pp;
|
|
35
|
-
args = pa;
|
|
36
|
-
}
|
|
37
|
-
return [program, args, { ...spawnOpts }, cleanup];
|
|
38
|
-
};
|
|
39
|
-
export function foregroundChild(...fgArgs) {
|
|
40
|
-
const [program, args, spawnOpts, cleanup] = normalizeFgArgs(fgArgs);
|
|
41
|
-
spawnOpts.stdio = [0, 1, 2];
|
|
42
|
-
if (process.send) {
|
|
43
|
-
spawnOpts.stdio.push('ipc');
|
|
44
|
-
}
|
|
45
|
-
const child = spawn(program, args, spawnOpts);
|
|
46
|
-
const childHangup = () => {
|
|
47
|
-
try {
|
|
48
|
-
child.kill('SIGHUP');
|
|
49
|
-
/* c8 ignore start */
|
|
50
|
-
}
|
|
51
|
-
catch (_) {
|
|
52
|
-
// SIGHUP is weird on windows
|
|
53
|
-
child.kill('SIGTERM');
|
|
54
|
-
}
|
|
55
|
-
/* c8 ignore stop */
|
|
56
|
-
};
|
|
57
|
-
const removeOnExit = onExit(childHangup);
|
|
58
|
-
proxySignals(child);
|
|
59
|
-
const dog = watchdog(child);
|
|
60
|
-
let done = false;
|
|
61
|
-
child.on('close', async (code, signal) => {
|
|
62
|
-
/* c8 ignore start */
|
|
63
|
-
if (done)
|
|
64
|
-
return;
|
|
65
|
-
/* c8 ignore stop */
|
|
66
|
-
done = true;
|
|
67
|
-
const result = cleanup(code, signal, {
|
|
68
|
-
watchdogPid: dog.pid,
|
|
69
|
-
});
|
|
70
|
-
const res = isPromise(result) ? await result : result;
|
|
71
|
-
removeOnExit();
|
|
72
|
-
if (res === false)
|
|
73
|
-
return;
|
|
74
|
-
else if (typeof res === 'string') {
|
|
75
|
-
signal = res;
|
|
76
|
-
code = null;
|
|
77
|
-
}
|
|
78
|
-
else if (typeof res === 'number') {
|
|
79
|
-
code = res;
|
|
80
|
-
signal = null;
|
|
81
|
-
}
|
|
82
|
-
if (signal) {
|
|
83
|
-
// If there is nothing else keeping the event loop alive,
|
|
84
|
-
// then there's a race between a graceful exit and getting
|
|
85
|
-
// the signal to this process. Put this timeout here to
|
|
86
|
-
// make sure we're still alive to get the signal, and thus
|
|
87
|
-
// exit with the intended signal code.
|
|
88
|
-
/* istanbul ignore next */
|
|
89
|
-
setTimeout(() => { }, 2000);
|
|
90
|
-
try {
|
|
91
|
-
process.kill(process.pid, signal);
|
|
92
|
-
/* c8 ignore start */
|
|
93
|
-
}
|
|
94
|
-
catch (_) {
|
|
95
|
-
process.kill(process.pid, 'SIGTERM');
|
|
96
|
-
}
|
|
97
|
-
/* c8 ignore stop */
|
|
98
|
-
}
|
|
99
|
-
else {
|
|
100
|
-
process.exit(code || 0);
|
|
101
|
-
}
|
|
102
|
-
});
|
|
103
|
-
if (process.send) {
|
|
104
|
-
process.removeAllListeners('message');
|
|
105
|
-
child.on('message', (message, sendHandle) => {
|
|
106
|
-
process.send?.(message, sendHandle);
|
|
107
|
-
});
|
|
108
|
-
process.on('message', (message, sendHandle) => {
|
|
109
|
-
child.send(message, sendHandle);
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
return child;
|
|
113
|
-
}
|
|
114
|
-
const isPromise = (o) => !!o && typeof o === 'object' && typeof o.then === 'function';
|
|
115
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { allSignals } from './all-signals.js';
|
|
2
|
-
/**
|
|
3
|
-
* Starts forwarding signals to `child` through `parent`.
|
|
4
|
-
*/
|
|
5
|
-
export const proxySignals = (child) => {
|
|
6
|
-
const listeners = new Map();
|
|
7
|
-
for (const sig of allSignals) {
|
|
8
|
-
const listener = () => {
|
|
9
|
-
// some signals can only be received, not sent
|
|
10
|
-
try {
|
|
11
|
-
child.kill(sig);
|
|
12
|
-
/* c8 ignore start */
|
|
13
|
-
}
|
|
14
|
-
catch (_) { }
|
|
15
|
-
/* c8 ignore stop */
|
|
16
|
-
};
|
|
17
|
-
try {
|
|
18
|
-
// if it's a signal this system doesn't recognize, skip it
|
|
19
|
-
process.on(sig, listener);
|
|
20
|
-
listeners.set(sig, listener);
|
|
21
|
-
/* c8 ignore start */
|
|
22
|
-
}
|
|
23
|
-
catch (_) { }
|
|
24
|
-
/* c8 ignore stop */
|
|
25
|
-
}
|
|
26
|
-
const unproxy = () => {
|
|
27
|
-
for (const [sig, listener] of listeners) {
|
|
28
|
-
process.removeListener(sig, listener);
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
child.on('exit', unproxy);
|
|
32
|
-
return unproxy;
|
|
33
|
-
};
|
|
34
|
-
//# sourceMappingURL=proxy-signals.js.map
|