@kubb/agent 4.28.0 → 4.29.0
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/.output/nitro.json +1 -1
- package/.output/server/chunks/nitro/nitro.mjs +382 -642
- package/.output/server/chunks/nitro/nitro.mjs.map +1 -1
- package/.output/server/chunks/routes/api/health.get.mjs +4 -6
- package/.output/server/chunks/routes/api/health.get.mjs.map +1 -1
- package/.output/server/index.mjs +4 -6
- package/.output/server/index.mjs.map +1 -1
- package/.output/server/node_modules/@kubb/fabric-core/dist/{defaultParser-BD_N68Bo.js → defaultParser-C1atU7yU.js} +2 -3
- package/.output/server/node_modules/@kubb/fabric-core/dist/{getRelativePath-C4Au07ON.js → getRelativePath-BcieQL5M.js} +1 -2
- package/.output/server/node_modules/@kubb/fabric-core/dist/index.js +8 -9
- package/.output/server/node_modules/@kubb/fabric-core/dist/{Root-BQX3eHqb.js → onProcessExit-CF200hsz.js} +109 -190
- package/.output/server/node_modules/@kubb/fabric-core/dist/parsers/typescript.js +3 -4
- package/.output/server/node_modules/@kubb/fabric-core/dist/parsers.js +2 -3
- package/.output/server/node_modules/@kubb/fabric-core/dist/plugins.js +58 -298
- package/.output/server/node_modules/@kubb/fabric-core/package.json +8 -18
- package/.output/server/node_modules/@kubb/react-fabric/dist/{chunk-DbZtQ4qb.js → chunk-Cnw5r_-A.js} +1 -5
- package/.output/server/node_modules/@kubb/react-fabric/dist/index.js +39 -41
- package/.output/server/node_modules/@kubb/react-fabric/dist/{jsx-runtime-CQFBnRKx.js → jsx-runtime-Dm7PKVbc.js} +6 -24
- package/.output/server/node_modules/@kubb/react-fabric/dist/jsx-runtime.js +5 -4
- package/.output/server/node_modules/@kubb/react-fabric/dist/plugins.js +3 -3
- package/.output/server/node_modules/@kubb/react-fabric/dist/{react--draJ5Pm.js → react-D652OKii.js} +31 -91
- package/.output/server/node_modules/@kubb/react-fabric/dist/{reactPlugin-DqJsInTf.js → reactPlugin-BkDkx1cs.js} +410 -1650
- package/.output/server/node_modules/@kubb/react-fabric/package.json +8 -11
- package/.output/server/node_modules/empathic/access.js +39 -0
- package/.output/server/node_modules/empathic/access.mjs +34 -0
- package/.output/server/node_modules/empathic/find.js +81 -0
- package/.output/server/node_modules/empathic/find.mjs +76 -0
- package/.output/server/node_modules/empathic/package.json +49 -0
- package/.output/server/node_modules/empathic/package.mjs +52 -0
- package/.output/server/node_modules/empathic/resolve.js +31 -0
- package/.output/server/node_modules/empathic/resolve.mjs +27 -0
- package/.output/server/node_modules/empathic/walk.js +22 -0
- package/.output/server/node_modules/empathic/walk.mjs +20 -0
- package/.output/server/node_modules/tinyexec/dist/main.js +633 -0
- package/.output/server/node_modules/tinyexec/package.json +61 -0
- package/.output/server/package.json +6 -44
- package/package.json +19 -21
- package/.output/server/node_modules/.nitro/path-key@3.1.1/index.js +0 -16
- package/.output/server/node_modules/.nitro/path-key@3.1.1/package.json +0 -39
- package/.output/server/node_modules/.nitro/path-key@4.0.0/index.js +0 -12
- package/.output/server/node_modules/.nitro/path-key@4.0.0/package.json +0 -41
- package/.output/server/node_modules/.nitro/path-to-regexp@3.3.0/index.js +0 -421
- package/.output/server/node_modules/.nitro/path-to-regexp@3.3.0/package.json +0 -46
- package/.output/server/node_modules/@kubb/fabric-core/dist/chunk-BVHe6Par.js +0 -22
- package/.output/server/node_modules/@sec-ant/readable-stream/dist/ponyfill/asyncIterator.js +0 -89
- package/.output/server/node_modules/@sec-ant/readable-stream/dist/ponyfill/fromAnyIterable.js +0 -34
- package/.output/server/node_modules/@sec-ant/readable-stream/dist/ponyfill/index.js +0 -6
- package/.output/server/node_modules/@sec-ant/readable-stream/package.json +0 -98
- package/.output/server/node_modules/@sindresorhus/merge-streams/index.js +0 -265
- package/.output/server/node_modules/@sindresorhus/merge-streams/package.json +0 -49
- package/.output/server/node_modules/balanced-match/index.js +0 -62
- package/.output/server/node_modules/balanced-match/package.json +0 -48
- package/.output/server/node_modules/brace-expansion/index.js +0 -201
- package/.output/server/node_modules/brace-expansion/package.json +0 -50
- package/.output/server/node_modules/bytes/index.js +0 -159
- package/.output/server/node_modules/bytes/package.json +0 -39
- package/.output/server/node_modules/concat-map/index.js +0 -13
- package/.output/server/node_modules/concat-map/package.json +0 -59
- package/.output/server/node_modules/content-disposition/index.js +0 -445
- package/.output/server/node_modules/content-disposition/package.json +0 -39
- package/.output/server/node_modules/cross-spawn/index.js +0 -39
- package/.output/server/node_modules/cross-spawn/lib/enoent.js +0 -59
- package/.output/server/node_modules/cross-spawn/lib/parse.js +0 -91
- package/.output/server/node_modules/cross-spawn/lib/util/escape.js +0 -47
- package/.output/server/node_modules/cross-spawn/lib/util/readShebang.js +0 -23
- package/.output/server/node_modules/cross-spawn/lib/util/resolveCommand.js +0 -52
- package/.output/server/node_modules/cross-spawn/package.json +0 -73
- package/.output/server/node_modules/execa/index.js +0 -28
- package/.output/server/node_modules/execa/lib/arguments/command.js +0 -20
- package/.output/server/node_modules/execa/lib/arguments/cwd.js +0 -39
- package/.output/server/node_modules/execa/lib/arguments/encoding-option.js +0 -50
- package/.output/server/node_modules/execa/lib/arguments/escape.js +0 -88
- package/.output/server/node_modules/execa/lib/arguments/fd-options.js +0 -108
- package/.output/server/node_modules/execa/lib/arguments/file-url.js +0 -25
- package/.output/server/node_modules/execa/lib/arguments/options.js +0 -96
- package/.output/server/node_modules/execa/lib/arguments/shell.js +0 -11
- package/.output/server/node_modules/execa/lib/arguments/specific.js +0 -111
- package/.output/server/node_modules/execa/lib/convert/add.js +0 -15
- package/.output/server/node_modules/execa/lib/convert/concurrent.js +0 -33
- package/.output/server/node_modules/execa/lib/convert/duplex.js +0 -69
- package/.output/server/node_modules/execa/lib/convert/iterable.js +0 -34
- package/.output/server/node_modules/execa/lib/convert/readable.js +0 -113
- package/.output/server/node_modules/execa/lib/convert/shared.js +0 -46
- package/.output/server/node_modules/execa/lib/convert/writable.js +0 -90
- package/.output/server/node_modules/execa/lib/io/contents.js +0 -116
- package/.output/server/node_modules/execa/lib/io/input-sync.js +0 -44
- package/.output/server/node_modules/execa/lib/io/iterate.js +0 -110
- package/.output/server/node_modules/execa/lib/io/max-buffer.js +0 -89
- package/.output/server/node_modules/execa/lib/io/output-async.js +0 -80
- package/.output/server/node_modules/execa/lib/io/output-sync.js +0 -135
- package/.output/server/node_modules/execa/lib/io/pipeline.js +0 -48
- package/.output/server/node_modules/execa/lib/io/strip-newline.js +0 -12
- package/.output/server/node_modules/execa/lib/ipc/array.js +0 -4
- package/.output/server/node_modules/execa/lib/ipc/buffer-messages.js +0 -47
- package/.output/server/node_modules/execa/lib/ipc/forward.js +0 -56
- package/.output/server/node_modules/execa/lib/ipc/get-each.js +0 -89
- package/.output/server/node_modules/execa/lib/ipc/get-one.js +0 -69
- package/.output/server/node_modules/execa/lib/ipc/graceful.js +0 -72
- package/.output/server/node_modules/execa/lib/ipc/incoming.js +0 -79
- package/.output/server/node_modules/execa/lib/ipc/ipc-input.js +0 -44
- package/.output/server/node_modules/execa/lib/ipc/methods.js +0 -49
- package/.output/server/node_modules/execa/lib/ipc/outgoing.js +0 -47
- package/.output/server/node_modules/execa/lib/ipc/reference.js +0 -44
- package/.output/server/node_modules/execa/lib/ipc/send.js +0 -91
- package/.output/server/node_modules/execa/lib/ipc/strict.js +0 -113
- package/.output/server/node_modules/execa/lib/ipc/validation.js +0 -111
- package/.output/server/node_modules/execa/lib/methods/bind.js +0 -23
- package/.output/server/node_modules/execa/lib/methods/command.js +0 -43
- package/.output/server/node_modules/execa/lib/methods/create.js +0 -65
- package/.output/server/node_modules/execa/lib/methods/main-async.js +0 -194
- package/.output/server/node_modules/execa/lib/methods/main-sync.js +0 -163
- package/.output/server/node_modules/execa/lib/methods/node.js +0 -51
- package/.output/server/node_modules/execa/lib/methods/parameters.js +0 -31
- package/.output/server/node_modules/execa/lib/methods/promise.js +0 -15
- package/.output/server/node_modules/execa/lib/methods/script.js +0 -22
- package/.output/server/node_modules/execa/lib/methods/template.js +0 -153
- package/.output/server/node_modules/execa/lib/pipe/abort.js +0 -20
- package/.output/server/node_modules/execa/lib/pipe/pipe-arguments.js +0 -91
- package/.output/server/node_modules/execa/lib/pipe/sequence.js +0 -24
- package/.output/server/node_modules/execa/lib/pipe/setup.js +0 -72
- package/.output/server/node_modules/execa/lib/pipe/streaming.js +0 -51
- package/.output/server/node_modules/execa/lib/pipe/throw.js +0 -58
- package/.output/server/node_modules/execa/lib/resolve/all-async.js +0 -46
- package/.output/server/node_modules/execa/lib/resolve/all-sync.js +0 -33
- package/.output/server/node_modules/execa/lib/resolve/exit-async.js +0 -54
- package/.output/server/node_modules/execa/lib/resolve/exit-sync.js +0 -25
- package/.output/server/node_modules/execa/lib/resolve/stdio.js +0 -47
- package/.output/server/node_modules/execa/lib/resolve/wait-stream.js +0 -96
- package/.output/server/node_modules/execa/lib/resolve/wait-subprocess.js +0 -146
- package/.output/server/node_modules/execa/lib/return/duration.js +0 -8
- package/.output/server/node_modules/execa/lib/return/early-error.js +0 -60
- package/.output/server/node_modules/execa/lib/return/final-error.js +0 -40
- package/.output/server/node_modules/execa/lib/return/message.js +0 -157
- package/.output/server/node_modules/execa/lib/return/reject.js +0 -13
- package/.output/server/node_modules/execa/lib/return/result.js +0 -186
- package/.output/server/node_modules/execa/lib/stdio/direction.js +0 -76
- package/.output/server/node_modules/execa/lib/stdio/duplicate.js +0 -116
- package/.output/server/node_modules/execa/lib/stdio/handle-async.js +0 -52
- package/.output/server/node_modules/execa/lib/stdio/handle-sync.js +0 -57
- package/.output/server/node_modules/execa/lib/stdio/handle.js +0 -214
- package/.output/server/node_modules/execa/lib/stdio/input-option.js +0 -50
- package/.output/server/node_modules/execa/lib/stdio/native.js +0 -106
- package/.output/server/node_modules/execa/lib/stdio/stdio-option.js +0 -60
- package/.output/server/node_modules/execa/lib/stdio/type.js +0 -173
- package/.output/server/node_modules/execa/lib/terminate/cancel.js +0 -20
- package/.output/server/node_modules/execa/lib/terminate/cleanup.js +0 -16
- package/.output/server/node_modules/execa/lib/terminate/graceful.js +0 -71
- package/.output/server/node_modules/execa/lib/terminate/kill.js +0 -93
- package/.output/server/node_modules/execa/lib/terminate/signal.js +0 -70
- package/.output/server/node_modules/execa/lib/terminate/timeout.js +0 -21
- package/.output/server/node_modules/execa/lib/transform/encoding-transform.js +0 -51
- package/.output/server/node_modules/execa/lib/transform/generator.js +0 -107
- package/.output/server/node_modules/execa/lib/transform/normalize.js +0 -111
- package/.output/server/node_modules/execa/lib/transform/object-mode.js +0 -41
- package/.output/server/node_modules/execa/lib/transform/run-async.js +0 -60
- package/.output/server/node_modules/execa/lib/transform/run-sync.js +0 -50
- package/.output/server/node_modules/execa/lib/transform/split.js +0 -110
- package/.output/server/node_modules/execa/lib/transform/validate.js +0 -43
- package/.output/server/node_modules/execa/lib/utils/abort-signal.js +0 -8
- package/.output/server/node_modules/execa/lib/utils/deferred.js +0 -7
- package/.output/server/node_modules/execa/lib/utils/max-listeners.js +0 -14
- package/.output/server/node_modules/execa/lib/utils/standard-stream.js +0 -6
- package/.output/server/node_modules/execa/lib/utils/uint-array.js +0 -69
- package/.output/server/node_modules/execa/lib/verbose/complete.js +0 -24
- package/.output/server/node_modules/execa/lib/verbose/custom.js +0 -26
- package/.output/server/node_modules/execa/lib/verbose/default.js +0 -54
- package/.output/server/node_modules/execa/lib/verbose/error.js +0 -13
- package/.output/server/node_modules/execa/lib/verbose/info.js +0 -39
- package/.output/server/node_modules/execa/lib/verbose/ipc.js +0 -15
- package/.output/server/node_modules/execa/lib/verbose/log.js +0 -54
- package/.output/server/node_modules/execa/lib/verbose/output.js +0 -60
- package/.output/server/node_modules/execa/lib/verbose/start.js +0 -15
- package/.output/server/node_modules/execa/lib/verbose/values.js +0 -33
- package/.output/server/node_modules/execa/package.json +0 -105
- package/.output/server/node_modules/figures/index.js +0 -292
- package/.output/server/node_modules/figures/package.json +0 -49
- package/.output/server/node_modules/fs-extra/lib/copy/copy-sync.js +0 -176
- package/.output/server/node_modules/fs-extra/lib/copy/copy.js +0 -180
- package/.output/server/node_modules/fs-extra/lib/copy/index.js +0 -7
- package/.output/server/node_modules/fs-extra/lib/empty/index.js +0 -39
- package/.output/server/node_modules/fs-extra/lib/ensure/file.js +0 -66
- package/.output/server/node_modules/fs-extra/lib/ensure/index.js +0 -23
- package/.output/server/node_modules/fs-extra/lib/ensure/link.js +0 -64
- package/.output/server/node_modules/fs-extra/lib/ensure/symlink-paths.js +0 -101
- package/.output/server/node_modules/fs-extra/lib/ensure/symlink-type.js +0 -34
- package/.output/server/node_modules/fs-extra/lib/ensure/symlink.js +0 -67
- package/.output/server/node_modules/fs-extra/lib/fs/index.js +0 -146
- package/.output/server/node_modules/fs-extra/lib/index.js +0 -16
- package/.output/server/node_modules/fs-extra/lib/json/index.js +0 -16
- package/.output/server/node_modules/fs-extra/lib/json/jsonfile.js +0 -11
- package/.output/server/node_modules/fs-extra/lib/json/output-json-sync.js +0 -12
- package/.output/server/node_modules/fs-extra/lib/json/output-json.js +0 -12
- package/.output/server/node_modules/fs-extra/lib/mkdirs/index.js +0 -14
- package/.output/server/node_modules/fs-extra/lib/mkdirs/make-dir.js +0 -27
- package/.output/server/node_modules/fs-extra/lib/mkdirs/utils.js +0 -21
- package/.output/server/node_modules/fs-extra/lib/move/index.js +0 -7
- package/.output/server/node_modules/fs-extra/lib/move/move-sync.js +0 -55
- package/.output/server/node_modules/fs-extra/lib/move/move.js +0 -59
- package/.output/server/node_modules/fs-extra/lib/output-file/index.js +0 -31
- package/.output/server/node_modules/fs-extra/lib/path-exists/index.js +0 -12
- package/.output/server/node_modules/fs-extra/lib/remove/index.js +0 -17
- package/.output/server/node_modules/fs-extra/lib/util/async.js +0 -29
- package/.output/server/node_modules/fs-extra/lib/util/stat.js +0 -159
- package/.output/server/node_modules/fs-extra/lib/util/utimes.js +0 -36
- package/.output/server/node_modules/fs-extra/package.json +0 -71
- package/.output/server/node_modules/get-stream/package.json +0 -60
- package/.output/server/node_modules/get-stream/source/array-buffer.js +0 -84
- package/.output/server/node_modules/get-stream/source/array.js +0 -32
- package/.output/server/node_modules/get-stream/source/buffer.js +0 -19
- package/.output/server/node_modules/get-stream/source/contents.js +0 -121
- package/.output/server/node_modules/get-stream/source/exports.js +0 -5
- package/.output/server/node_modules/get-stream/source/index.js +0 -13
- package/.output/server/node_modules/get-stream/source/stream.js +0 -65
- package/.output/server/node_modules/get-stream/source/string.js +0 -41
- package/.output/server/node_modules/get-stream/source/utils.js +0 -11
- package/.output/server/node_modules/graceful-fs/clone.js +0 -23
- package/.output/server/node_modules/graceful-fs/graceful-fs.js +0 -448
- package/.output/server/node_modules/graceful-fs/legacy-streams.js +0 -118
- package/.output/server/node_modules/graceful-fs/package.json +0 -53
- package/.output/server/node_modules/graceful-fs/polyfills.js +0 -355
- package/.output/server/node_modules/human-signals/build/src/core.js +0 -273
- package/.output/server/node_modules/human-signals/build/src/main.js +0 -70
- package/.output/server/node_modules/human-signals/build/src/realtime.js +0 -16
- package/.output/server/node_modules/human-signals/build/src/signals.js +0 -34
- package/.output/server/node_modules/human-signals/package.json +0 -66
- package/.output/server/node_modules/is-plain-obj/index.js +0 -8
- package/.output/server/node_modules/is-plain-obj/package.json +0 -41
- package/.output/server/node_modules/is-stream/index.js +0 -37
- package/.output/server/node_modules/is-stream/package.json +0 -48
- package/.output/server/node_modules/is-unicode-supported/index.js +0 -21
- package/.output/server/node_modules/is-unicode-supported/package.json +0 -47
- package/.output/server/node_modules/isexe/index.js +0 -57
- package/.output/server/node_modules/isexe/mode.js +0 -41
- package/.output/server/node_modules/isexe/package.json +0 -31
- package/.output/server/node_modules/isexe/windows.js +0 -42
- package/.output/server/node_modules/js-runtime/dist/index.js +0 -5
- package/.output/server/node_modules/js-runtime/package.json +0 -72
- package/.output/server/node_modules/jsonfile/index.js +0 -88
- package/.output/server/node_modules/jsonfile/package.json +0 -40
- package/.output/server/node_modules/jsonfile/utils.js +0 -14
- package/.output/server/node_modules/mime-db/db.json +0 -7088
- package/.output/server/node_modules/mime-db/index.js +0 -11
- package/.output/server/node_modules/mime-db/package.json +0 -57
- package/.output/server/node_modules/mime-types/index.js +0 -188
- package/.output/server/node_modules/mime-types/package.json +0 -43
- package/.output/server/node_modules/minimatch/minimatch.js +0 -947
- package/.output/server/node_modules/minimatch/package.json +0 -33
- package/.output/server/node_modules/natural-orderby/dist/main.js +0 -19
- package/.output/server/node_modules/natural-orderby/dist/umd/natural-orderby.development.js +0 -420
- package/.output/server/node_modules/natural-orderby/dist/umd/natural-orderby.production.min.js +0 -11
- package/.output/server/node_modules/natural-orderby/package.json +0 -119
- package/.output/server/node_modules/npm-run-path/index.js +0 -55
- package/.output/server/node_modules/npm-run-path/package.json +0 -52
- package/.output/server/node_modules/parse-ms/index.js +0 -45
- package/.output/server/node_modules/parse-ms/package.json +0 -47
- package/.output/server/node_modules/path-is-inside/lib/path-is-inside.js +0 -28
- package/.output/server/node_modules/path-is-inside/package.json +0 -27
- package/.output/server/node_modules/pretty-ms/index.js +0 -149
- package/.output/server/node_modules/pretty-ms/package.json +0 -55
- package/.output/server/node_modules/range-parser/index.js +0 -158
- package/.output/server/node_modules/range-parser/package.json +0 -40
- package/.output/server/node_modules/serve-handler/package.json +0 -68
- package/.output/server/node_modules/serve-handler/src/directory.js +0 -16
- package/.output/server/node_modules/serve-handler/src/error.js +0 -10
- package/.output/server/node_modules/serve-handler/src/glob-slash.js +0 -9
- package/.output/server/node_modules/serve-handler/src/index.js +0 -769
- package/.output/server/node_modules/shebang-command/index.js +0 -19
- package/.output/server/node_modules/shebang-command/package.json +0 -34
- package/.output/server/node_modules/shebang-regex/index.js +0 -2
- package/.output/server/node_modules/shebang-regex/package.json +0 -35
- package/.output/server/node_modules/signal-exit/dist/mjs/index.js +0 -275
- package/.output/server/node_modules/signal-exit/dist/mjs/package.json +0 -3
- package/.output/server/node_modules/signal-exit/dist/mjs/signals.js +0 -39
- package/.output/server/node_modules/signal-exit/package.json +0 -106
- package/.output/server/node_modules/string-argv/index.js +0 -41
- package/.output/server/node_modules/string-argv/package.json +0 -51
- package/.output/server/node_modules/strip-final-newline/index.js +0 -26
- package/.output/server/node_modules/strip-final-newline/package.json +0 -49
- package/.output/server/node_modules/unicorn-magic/default.js +0 -14
- package/.output/server/node_modules/unicorn-magic/node.js +0 -49
- package/.output/server/node_modules/unicorn-magic/package.json +0 -62
- package/.output/server/node_modules/universalify/index.js +0 -24
- package/.output/server/node_modules/universalify/package.json +0 -34
- package/.output/server/node_modules/which/package.json +0 -43
- package/.output/server/node_modules/which/which.js +0 -125
- package/.output/server/node_modules/yoctocolors/base.js +0 -94
- package/.output/server/node_modules/yoctocolors/index.js +0 -2
- package/.output/server/node_modules/yoctocolors/package.json +0 -69
- /package/.output/server/node_modules/{.nitro/path-to-regexp@8.3.0 → path-to-regexp}/dist/index.js +0 -0
- /package/.output/server/node_modules/{.nitro/path-to-regexp@8.3.0 → path-to-regexp}/package.json +0 -0
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import {getStreamOutput} from '../io/contents.js';
|
|
2
|
-
import {waitForStream, isInputFileDescriptor} from './wait-stream.js';
|
|
3
|
-
|
|
4
|
-
// Read the contents of `subprocess.std*` and|or wait for its completion
|
|
5
|
-
export const waitForStdioStreams = ({subprocess, encoding, buffer, maxBuffer, lines, stripFinalNewline, verboseInfo, streamInfo}) => subprocess.stdio.map((stream, fdNumber) => waitForSubprocessStream({
|
|
6
|
-
stream,
|
|
7
|
-
fdNumber,
|
|
8
|
-
encoding,
|
|
9
|
-
buffer: buffer[fdNumber],
|
|
10
|
-
maxBuffer: maxBuffer[fdNumber],
|
|
11
|
-
lines: lines[fdNumber],
|
|
12
|
-
allMixed: false,
|
|
13
|
-
stripFinalNewline,
|
|
14
|
-
verboseInfo,
|
|
15
|
-
streamInfo,
|
|
16
|
-
}));
|
|
17
|
-
|
|
18
|
-
// Read the contents of `subprocess.std*` or `subprocess.all` and|or wait for its completion
|
|
19
|
-
export const waitForSubprocessStream = async ({stream, fdNumber, encoding, buffer, maxBuffer, lines, allMixed, stripFinalNewline, verboseInfo, streamInfo}) => {
|
|
20
|
-
if (!stream) {
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const onStreamEnd = waitForStream(stream, fdNumber, streamInfo);
|
|
25
|
-
if (isInputFileDescriptor(streamInfo, fdNumber)) {
|
|
26
|
-
await onStreamEnd;
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
const [output] = await Promise.all([
|
|
31
|
-
getStreamOutput({
|
|
32
|
-
stream,
|
|
33
|
-
onStreamEnd,
|
|
34
|
-
fdNumber,
|
|
35
|
-
encoding,
|
|
36
|
-
buffer,
|
|
37
|
-
maxBuffer,
|
|
38
|
-
lines,
|
|
39
|
-
allMixed,
|
|
40
|
-
stripFinalNewline,
|
|
41
|
-
verboseInfo,
|
|
42
|
-
streamInfo,
|
|
43
|
-
}),
|
|
44
|
-
onStreamEnd,
|
|
45
|
-
]);
|
|
46
|
-
return output;
|
|
47
|
-
};
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import {finished} from 'node:stream/promises';
|
|
2
|
-
|
|
3
|
-
// Wraps `finished(stream)` to handle the following case:
|
|
4
|
-
// - When the subprocess exits, Node.js automatically calls `subprocess.stdin.destroy()`, which we need to ignore.
|
|
5
|
-
// - However, we still need to throw if `subprocess.stdin.destroy()` is called before subprocess exit.
|
|
6
|
-
export const waitForStream = async (stream, fdNumber, streamInfo, {isSameDirection, stopOnExit = false} = {}) => {
|
|
7
|
-
const state = handleStdinDestroy(stream, streamInfo);
|
|
8
|
-
const abortController = new AbortController();
|
|
9
|
-
try {
|
|
10
|
-
await Promise.race([
|
|
11
|
-
...(stopOnExit ? [streamInfo.exitPromise] : []),
|
|
12
|
-
finished(stream, {cleanup: true, signal: abortController.signal}),
|
|
13
|
-
]);
|
|
14
|
-
} catch (error) {
|
|
15
|
-
if (!state.stdinCleanedUp) {
|
|
16
|
-
handleStreamError(error, fdNumber, streamInfo, isSameDirection);
|
|
17
|
-
}
|
|
18
|
-
} finally {
|
|
19
|
-
abortController.abort();
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
// If `subprocess.stdin` is destroyed before being fully written to, it is considered aborted and should throw an error.
|
|
24
|
-
// This can happen for example when user called `subprocess.stdin.destroy()` before `subprocess.stdin.end()`.
|
|
25
|
-
// However, Node.js calls `subprocess.stdin.destroy()` on exit for cleanup purposes.
|
|
26
|
-
// https://github.com/nodejs/node/blob/0b4cdb4b42956cbd7019058e409e06700a199e11/lib/internal/child_process.js#L278
|
|
27
|
-
// This is normal and should not throw an error.
|
|
28
|
-
// Therefore, we need to differentiate between both situations to know whether to throw an error.
|
|
29
|
-
// Unfortunately, events (`close`, `error`, `end`, `exit`) cannot be used because `.destroy()` can take an arbitrary amount of time.
|
|
30
|
-
// For example, `stdin: 'pipe'` is implemented as a TCP socket, and its `.destroy()` method waits for TCP disconnection.
|
|
31
|
-
// Therefore `.destroy()` might end before or after subprocess exit, based on OS speed and load.
|
|
32
|
-
// The only way to detect this is to spy on `subprocess.stdin._destroy()` by wrapping it.
|
|
33
|
-
// If `subprocess.exitCode` or `subprocess.signalCode` is set, it means `.destroy()` is being called by Node.js itself.
|
|
34
|
-
const handleStdinDestroy = (stream, {originalStreams: [originalStdin], subprocess}) => {
|
|
35
|
-
const state = {stdinCleanedUp: false};
|
|
36
|
-
if (stream === originalStdin) {
|
|
37
|
-
spyOnStdinDestroy(stream, subprocess, state);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
return state;
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
const spyOnStdinDestroy = (subprocessStdin, subprocess, state) => {
|
|
44
|
-
const {_destroy} = subprocessStdin;
|
|
45
|
-
subprocessStdin._destroy = (...destroyArguments) => {
|
|
46
|
-
setStdinCleanedUp(subprocess, state);
|
|
47
|
-
_destroy.call(subprocessStdin, ...destroyArguments);
|
|
48
|
-
};
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
const setStdinCleanedUp = ({exitCode, signalCode}, state) => {
|
|
52
|
-
if (exitCode !== null || signalCode !== null) {
|
|
53
|
-
state.stdinCleanedUp = true;
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
// We ignore EPIPEs on writable streams and aborts on readable streams since those can happen normally.
|
|
58
|
-
// When one stream errors, the error is propagated to the other streams on the same file descriptor.
|
|
59
|
-
// Those other streams might have a different direction due to the above.
|
|
60
|
-
// When this happens, the direction of both the initial stream and the others should then be taken into account.
|
|
61
|
-
// Therefore, we keep track of whether a stream error is currently propagating.
|
|
62
|
-
const handleStreamError = (error, fdNumber, streamInfo, isSameDirection) => {
|
|
63
|
-
if (!shouldIgnoreStreamError(error, fdNumber, streamInfo, isSameDirection)) {
|
|
64
|
-
throw error;
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
const shouldIgnoreStreamError = (error, fdNumber, streamInfo, isSameDirection = true) => {
|
|
69
|
-
if (streamInfo.propagating) {
|
|
70
|
-
return isStreamEpipe(error) || isStreamAbort(error);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
streamInfo.propagating = true;
|
|
74
|
-
return isInputFileDescriptor(streamInfo, fdNumber) === isSameDirection
|
|
75
|
-
? isStreamEpipe(error)
|
|
76
|
-
: isStreamAbort(error);
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
// Unfortunately, we cannot use the stream's class or properties to know whether it is readable or writable.
|
|
80
|
-
// For example, `subprocess.stdin` is technically a Duplex, but can only be used as a writable.
|
|
81
|
-
// Therefore, we need to use the file descriptor's direction (`stdin` is input, `stdout` is output, etc.).
|
|
82
|
-
// However, while `subprocess.std*` and transforms follow that direction, any stream passed the `std*` option has the opposite direction.
|
|
83
|
-
// For example, `subprocess.stdin` is a writable, but the `stdin` option is a readable.
|
|
84
|
-
export const isInputFileDescriptor = ({fileDescriptors}, fdNumber) => fdNumber !== 'all' && fileDescriptors[fdNumber].direction === 'input';
|
|
85
|
-
|
|
86
|
-
// When `stream.destroy()` is called without an `error` argument, stream is aborted.
|
|
87
|
-
// This is the only way to abort a readable stream, which can be useful in some instances.
|
|
88
|
-
// Therefore, we ignore this error on readable streams.
|
|
89
|
-
export const isStreamAbort = error => error?.code === 'ERR_STREAM_PREMATURE_CLOSE';
|
|
90
|
-
|
|
91
|
-
// When `stream.write()` is called but the underlying source has been closed, `EPIPE` is emitted.
|
|
92
|
-
// When piping subprocesses, the source subprocess usually decides when to stop piping.
|
|
93
|
-
// However, there are some instances when the destination does instead, such as `... | head -n1`.
|
|
94
|
-
// It notifies the source by using `EPIPE`.
|
|
95
|
-
// Therefore, we ignore this error on writable streams.
|
|
96
|
-
const isStreamEpipe = error => error?.code === 'EPIPE';
|
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
import {once} from 'node:events';
|
|
2
|
-
import {isStream as isNodeStream} from 'is-stream';
|
|
3
|
-
import {throwOnTimeout} from '../terminate/timeout.js';
|
|
4
|
-
import {throwOnCancel} from '../terminate/cancel.js';
|
|
5
|
-
import {throwOnGracefulCancel} from '../terminate/graceful.js';
|
|
6
|
-
import {isStandardStream} from '../utils/standard-stream.js';
|
|
7
|
-
import {TRANSFORM_TYPES} from '../stdio/type.js';
|
|
8
|
-
import {getBufferedData} from '../io/contents.js';
|
|
9
|
-
import {waitForIpcOutput, getBufferedIpcOutput} from '../ipc/buffer-messages.js';
|
|
10
|
-
import {sendIpcInput} from '../ipc/ipc-input.js';
|
|
11
|
-
import {waitForAllStream} from './all-async.js';
|
|
12
|
-
import {waitForStdioStreams} from './stdio.js';
|
|
13
|
-
import {waitForExit, waitForSuccessfulExit} from './exit-async.js';
|
|
14
|
-
import {waitForStream} from './wait-stream.js';
|
|
15
|
-
|
|
16
|
-
// Retrieve result of subprocess: exit code, signal, error, streams (stdout/stderr/all)
|
|
17
|
-
export const waitForSubprocessResult = async ({
|
|
18
|
-
subprocess,
|
|
19
|
-
options: {
|
|
20
|
-
encoding,
|
|
21
|
-
buffer,
|
|
22
|
-
maxBuffer,
|
|
23
|
-
lines,
|
|
24
|
-
timeoutDuration: timeout,
|
|
25
|
-
cancelSignal,
|
|
26
|
-
gracefulCancel,
|
|
27
|
-
forceKillAfterDelay,
|
|
28
|
-
stripFinalNewline,
|
|
29
|
-
ipc,
|
|
30
|
-
ipcInput,
|
|
31
|
-
},
|
|
32
|
-
context,
|
|
33
|
-
verboseInfo,
|
|
34
|
-
fileDescriptors,
|
|
35
|
-
originalStreams,
|
|
36
|
-
onInternalError,
|
|
37
|
-
controller,
|
|
38
|
-
}) => {
|
|
39
|
-
const exitPromise = waitForExit(subprocess, context);
|
|
40
|
-
const streamInfo = {
|
|
41
|
-
originalStreams,
|
|
42
|
-
fileDescriptors,
|
|
43
|
-
subprocess,
|
|
44
|
-
exitPromise,
|
|
45
|
-
propagating: false,
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
const stdioPromises = waitForStdioStreams({
|
|
49
|
-
subprocess,
|
|
50
|
-
encoding,
|
|
51
|
-
buffer,
|
|
52
|
-
maxBuffer,
|
|
53
|
-
lines,
|
|
54
|
-
stripFinalNewline,
|
|
55
|
-
verboseInfo,
|
|
56
|
-
streamInfo,
|
|
57
|
-
});
|
|
58
|
-
const allPromise = waitForAllStream({
|
|
59
|
-
subprocess,
|
|
60
|
-
encoding,
|
|
61
|
-
buffer,
|
|
62
|
-
maxBuffer,
|
|
63
|
-
lines,
|
|
64
|
-
stripFinalNewline,
|
|
65
|
-
verboseInfo,
|
|
66
|
-
streamInfo,
|
|
67
|
-
});
|
|
68
|
-
const ipcOutput = [];
|
|
69
|
-
const ipcOutputPromise = waitForIpcOutput({
|
|
70
|
-
subprocess,
|
|
71
|
-
buffer,
|
|
72
|
-
maxBuffer,
|
|
73
|
-
ipc,
|
|
74
|
-
ipcOutput,
|
|
75
|
-
verboseInfo,
|
|
76
|
-
});
|
|
77
|
-
const originalPromises = waitForOriginalStreams(originalStreams, subprocess, streamInfo);
|
|
78
|
-
const customStreamsEndPromises = waitForCustomStreamsEnd(fileDescriptors, streamInfo);
|
|
79
|
-
|
|
80
|
-
try {
|
|
81
|
-
return await Promise.race([
|
|
82
|
-
Promise.all([
|
|
83
|
-
{},
|
|
84
|
-
waitForSuccessfulExit(exitPromise),
|
|
85
|
-
Promise.all(stdioPromises),
|
|
86
|
-
allPromise,
|
|
87
|
-
ipcOutputPromise,
|
|
88
|
-
sendIpcInput(subprocess, ipcInput),
|
|
89
|
-
...originalPromises,
|
|
90
|
-
...customStreamsEndPromises,
|
|
91
|
-
]),
|
|
92
|
-
onInternalError,
|
|
93
|
-
throwOnSubprocessError(subprocess, controller),
|
|
94
|
-
...throwOnTimeout(subprocess, timeout, context, controller),
|
|
95
|
-
...throwOnCancel({
|
|
96
|
-
subprocess,
|
|
97
|
-
cancelSignal,
|
|
98
|
-
gracefulCancel,
|
|
99
|
-
context,
|
|
100
|
-
controller,
|
|
101
|
-
}),
|
|
102
|
-
...throwOnGracefulCancel({
|
|
103
|
-
subprocess,
|
|
104
|
-
cancelSignal,
|
|
105
|
-
gracefulCancel,
|
|
106
|
-
forceKillAfterDelay,
|
|
107
|
-
context,
|
|
108
|
-
controller,
|
|
109
|
-
}),
|
|
110
|
-
]);
|
|
111
|
-
} catch (error) {
|
|
112
|
-
context.terminationReason ??= 'other';
|
|
113
|
-
return Promise.all([
|
|
114
|
-
{error},
|
|
115
|
-
exitPromise,
|
|
116
|
-
Promise.all(stdioPromises.map(stdioPromise => getBufferedData(stdioPromise))),
|
|
117
|
-
getBufferedData(allPromise),
|
|
118
|
-
getBufferedIpcOutput(ipcOutputPromise, ipcOutput),
|
|
119
|
-
Promise.allSettled(originalPromises),
|
|
120
|
-
Promise.allSettled(customStreamsEndPromises),
|
|
121
|
-
]);
|
|
122
|
-
}
|
|
123
|
-
};
|
|
124
|
-
|
|
125
|
-
// Transforms replace `subprocess.std*`, which means they are not exposed to users.
|
|
126
|
-
// However, we still want to wait for their completion.
|
|
127
|
-
const waitForOriginalStreams = (originalStreams, subprocess, streamInfo) =>
|
|
128
|
-
originalStreams.map((stream, fdNumber) => stream === subprocess.stdio[fdNumber]
|
|
129
|
-
? undefined
|
|
130
|
-
: waitForStream(stream, fdNumber, streamInfo));
|
|
131
|
-
|
|
132
|
-
// Some `stdin`/`stdout`/`stderr` options create a stream, e.g. when passing a file path.
|
|
133
|
-
// The `.pipe()` method automatically ends that stream when `subprocess` ends.
|
|
134
|
-
// This makes sure we wait for the completion of those streams, in order to catch any error.
|
|
135
|
-
const waitForCustomStreamsEnd = (fileDescriptors, streamInfo) => fileDescriptors.flatMap(({stdioItems}, fdNumber) => stdioItems
|
|
136
|
-
.filter(({value, stream = value}) => isNodeStream(stream, {checkOpen: false}) && !isStandardStream(stream))
|
|
137
|
-
.map(({type, value, stream = value}) => waitForStream(stream, fdNumber, streamInfo, {
|
|
138
|
-
isSameDirection: TRANSFORM_TYPES.has(type),
|
|
139
|
-
stopOnExit: type === 'native',
|
|
140
|
-
})));
|
|
141
|
-
|
|
142
|
-
// Fails when the subprocess emits an `error` event
|
|
143
|
-
const throwOnSubprocessError = async (subprocess, {signal}) => {
|
|
144
|
-
const [error] = await once(subprocess, 'error', {signal});
|
|
145
|
-
throw error;
|
|
146
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import {hrtime} from 'node:process';
|
|
2
|
-
|
|
3
|
-
// Start counting time before spawning the subprocess
|
|
4
|
-
export const getStartTime = () => hrtime.bigint();
|
|
5
|
-
|
|
6
|
-
// Compute duration after the subprocess ended.
|
|
7
|
-
// Printed by the `verbose` option.
|
|
8
|
-
export const getDurationMs = startTime => Number(hrtime.bigint() - startTime) / 1e6;
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import {ChildProcess} from 'node:child_process';
|
|
2
|
-
import {
|
|
3
|
-
PassThrough,
|
|
4
|
-
Readable,
|
|
5
|
-
Writable,
|
|
6
|
-
Duplex,
|
|
7
|
-
} from 'node:stream';
|
|
8
|
-
import {cleanupCustomStreams} from '../stdio/handle.js';
|
|
9
|
-
import {makeEarlyError} from './result.js';
|
|
10
|
-
import {handleResult} from './reject.js';
|
|
11
|
-
|
|
12
|
-
// When the subprocess fails to spawn.
|
|
13
|
-
// We ensure the returned error is always both a promise and a subprocess.
|
|
14
|
-
export const handleEarlyError = ({error, command, escapedCommand, fileDescriptors, options, startTime, verboseInfo}) => {
|
|
15
|
-
cleanupCustomStreams(fileDescriptors);
|
|
16
|
-
|
|
17
|
-
const subprocess = new ChildProcess();
|
|
18
|
-
createDummyStreams(subprocess, fileDescriptors);
|
|
19
|
-
Object.assign(subprocess, {readable, writable, duplex});
|
|
20
|
-
|
|
21
|
-
const earlyError = makeEarlyError({
|
|
22
|
-
error,
|
|
23
|
-
command,
|
|
24
|
-
escapedCommand,
|
|
25
|
-
fileDescriptors,
|
|
26
|
-
options,
|
|
27
|
-
startTime,
|
|
28
|
-
isSync: false,
|
|
29
|
-
});
|
|
30
|
-
const promise = handleDummyPromise(earlyError, verboseInfo, options);
|
|
31
|
-
return {subprocess, promise};
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
const createDummyStreams = (subprocess, fileDescriptors) => {
|
|
35
|
-
const stdin = createDummyStream();
|
|
36
|
-
const stdout = createDummyStream();
|
|
37
|
-
const stderr = createDummyStream();
|
|
38
|
-
const extraStdio = Array.from({length: fileDescriptors.length - 3}, createDummyStream);
|
|
39
|
-
const all = createDummyStream();
|
|
40
|
-
const stdio = [stdin, stdout, stderr, ...extraStdio];
|
|
41
|
-
Object.assign(subprocess, {
|
|
42
|
-
stdin,
|
|
43
|
-
stdout,
|
|
44
|
-
stderr,
|
|
45
|
-
all,
|
|
46
|
-
stdio,
|
|
47
|
-
});
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
const createDummyStream = () => {
|
|
51
|
-
const stream = new PassThrough();
|
|
52
|
-
stream.end();
|
|
53
|
-
return stream;
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
const readable = () => new Readable({read() {}});
|
|
57
|
-
const writable = () => new Writable({write() {}});
|
|
58
|
-
const duplex = () => new Duplex({read() {}, write() {}});
|
|
59
|
-
|
|
60
|
-
const handleDummyPromise = async (error, verboseInfo, options) => handleResult(error, verboseInfo, options);
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
// When the subprocess fails, this is the error instance being returned.
|
|
2
|
-
// If another error instance is being thrown, it is kept as `error.cause`.
|
|
3
|
-
export const getFinalError = (originalError, message, isSync) => {
|
|
4
|
-
const ErrorClass = isSync ? ExecaSyncError : ExecaError;
|
|
5
|
-
const options = originalError instanceof DiscardedError ? {} : {cause: originalError};
|
|
6
|
-
return new ErrorClass(message, options);
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
// Indicates that the error is used only to interrupt control flow, but not in the return value
|
|
10
|
-
export class DiscardedError extends Error {}
|
|
11
|
-
|
|
12
|
-
// Proper way to set `error.name`: it should be inherited and non-enumerable
|
|
13
|
-
const setErrorName = (ErrorClass, value) => {
|
|
14
|
-
Object.defineProperty(ErrorClass.prototype, 'name', {
|
|
15
|
-
value,
|
|
16
|
-
writable: true,
|
|
17
|
-
enumerable: false,
|
|
18
|
-
configurable: true,
|
|
19
|
-
});
|
|
20
|
-
Object.defineProperty(ErrorClass.prototype, execaErrorSymbol, {
|
|
21
|
-
value: true,
|
|
22
|
-
writable: false,
|
|
23
|
-
enumerable: false,
|
|
24
|
-
configurable: false,
|
|
25
|
-
});
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
// Unlike `instanceof`, this works across realms
|
|
29
|
-
export const isExecaError = error => isErrorInstance(error) && execaErrorSymbol in error;
|
|
30
|
-
|
|
31
|
-
const execaErrorSymbol = Symbol('isExecaError');
|
|
32
|
-
|
|
33
|
-
export const isErrorInstance = value => Object.prototype.toString.call(value) === '[object Error]';
|
|
34
|
-
|
|
35
|
-
// We use two different Error classes for async/sync methods since they have slightly different shape and types
|
|
36
|
-
export class ExecaError extends Error {}
|
|
37
|
-
setErrorName(ExecaError, ExecaError.name);
|
|
38
|
-
|
|
39
|
-
export class ExecaSyncError extends Error {}
|
|
40
|
-
setErrorName(ExecaSyncError, ExecaSyncError.name);
|
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
import {inspect} from 'node:util';
|
|
2
|
-
import stripFinalNewline from 'strip-final-newline';
|
|
3
|
-
import {isUint8Array, uint8ArrayToString} from '../utils/uint-array.js';
|
|
4
|
-
import {fixCwdError} from '../arguments/cwd.js';
|
|
5
|
-
import {escapeLines} from '../arguments/escape.js';
|
|
6
|
-
import {getMaxBufferMessage} from '../io/max-buffer.js';
|
|
7
|
-
import {getSignalDescription} from '../terminate/signal.js';
|
|
8
|
-
import {DiscardedError, isExecaError} from './final-error.js';
|
|
9
|
-
|
|
10
|
-
// Computes `error.message`, `error.shortMessage` and `error.originalMessage`
|
|
11
|
-
export const createMessages = ({
|
|
12
|
-
stdio,
|
|
13
|
-
all,
|
|
14
|
-
ipcOutput,
|
|
15
|
-
originalError,
|
|
16
|
-
signal,
|
|
17
|
-
signalDescription,
|
|
18
|
-
exitCode,
|
|
19
|
-
escapedCommand,
|
|
20
|
-
timedOut,
|
|
21
|
-
isCanceled,
|
|
22
|
-
isGracefullyCanceled,
|
|
23
|
-
isMaxBuffer,
|
|
24
|
-
isForcefullyTerminated,
|
|
25
|
-
forceKillAfterDelay,
|
|
26
|
-
killSignal,
|
|
27
|
-
maxBuffer,
|
|
28
|
-
timeout,
|
|
29
|
-
cwd,
|
|
30
|
-
}) => {
|
|
31
|
-
const errorCode = originalError?.code;
|
|
32
|
-
const prefix = getErrorPrefix({
|
|
33
|
-
originalError,
|
|
34
|
-
timedOut,
|
|
35
|
-
timeout,
|
|
36
|
-
isMaxBuffer,
|
|
37
|
-
maxBuffer,
|
|
38
|
-
errorCode,
|
|
39
|
-
signal,
|
|
40
|
-
signalDescription,
|
|
41
|
-
exitCode,
|
|
42
|
-
isCanceled,
|
|
43
|
-
isGracefullyCanceled,
|
|
44
|
-
isForcefullyTerminated,
|
|
45
|
-
forceKillAfterDelay,
|
|
46
|
-
killSignal,
|
|
47
|
-
});
|
|
48
|
-
const originalMessage = getOriginalMessage(originalError, cwd);
|
|
49
|
-
const suffix = originalMessage === undefined ? '' : `\n${originalMessage}`;
|
|
50
|
-
const shortMessage = `${prefix}: ${escapedCommand}${suffix}`;
|
|
51
|
-
const messageStdio = all === undefined ? [stdio[2], stdio[1]] : [all];
|
|
52
|
-
const message = [
|
|
53
|
-
shortMessage,
|
|
54
|
-
...messageStdio,
|
|
55
|
-
...stdio.slice(3),
|
|
56
|
-
ipcOutput.map(ipcMessage => serializeIpcMessage(ipcMessage)).join('\n'),
|
|
57
|
-
]
|
|
58
|
-
.map(messagePart => escapeLines(stripFinalNewline(serializeMessagePart(messagePart))))
|
|
59
|
-
.filter(Boolean)
|
|
60
|
-
.join('\n\n');
|
|
61
|
-
return {originalMessage, shortMessage, message};
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
const getErrorPrefix = ({
|
|
65
|
-
originalError,
|
|
66
|
-
timedOut,
|
|
67
|
-
timeout,
|
|
68
|
-
isMaxBuffer,
|
|
69
|
-
maxBuffer,
|
|
70
|
-
errorCode,
|
|
71
|
-
signal,
|
|
72
|
-
signalDescription,
|
|
73
|
-
exitCode,
|
|
74
|
-
isCanceled,
|
|
75
|
-
isGracefullyCanceled,
|
|
76
|
-
isForcefullyTerminated,
|
|
77
|
-
forceKillAfterDelay,
|
|
78
|
-
killSignal,
|
|
79
|
-
}) => {
|
|
80
|
-
const forcefulSuffix = getForcefulSuffix(isForcefullyTerminated, forceKillAfterDelay);
|
|
81
|
-
|
|
82
|
-
if (timedOut) {
|
|
83
|
-
return `Command timed out after ${timeout} milliseconds${forcefulSuffix}`;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
if (isGracefullyCanceled) {
|
|
87
|
-
if (signal === undefined) {
|
|
88
|
-
return `Command was gracefully canceled with exit code ${exitCode}`;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
return isForcefullyTerminated
|
|
92
|
-
? `Command was gracefully canceled${forcefulSuffix}`
|
|
93
|
-
: `Command was gracefully canceled with ${signal} (${signalDescription})`;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
if (isCanceled) {
|
|
97
|
-
return `Command was canceled${forcefulSuffix}`;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
if (isMaxBuffer) {
|
|
101
|
-
return `${getMaxBufferMessage(originalError, maxBuffer)}${forcefulSuffix}`;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
if (errorCode !== undefined) {
|
|
105
|
-
return `Command failed with ${errorCode}${forcefulSuffix}`;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
if (isForcefullyTerminated) {
|
|
109
|
-
return `Command was killed with ${killSignal} (${getSignalDescription(killSignal)})${forcefulSuffix}`;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
if (signal !== undefined) {
|
|
113
|
-
return `Command was killed with ${signal} (${signalDescription})`;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
if (exitCode !== undefined) {
|
|
117
|
-
return `Command failed with exit code ${exitCode}`;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
return 'Command failed';
|
|
121
|
-
};
|
|
122
|
-
|
|
123
|
-
const getForcefulSuffix = (isForcefullyTerminated, forceKillAfterDelay) => isForcefullyTerminated
|
|
124
|
-
? ` and was forcefully terminated after ${forceKillAfterDelay} milliseconds`
|
|
125
|
-
: '';
|
|
126
|
-
|
|
127
|
-
const getOriginalMessage = (originalError, cwd) => {
|
|
128
|
-
if (originalError instanceof DiscardedError) {
|
|
129
|
-
return;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
const originalMessage = isExecaError(originalError)
|
|
133
|
-
? originalError.originalMessage
|
|
134
|
-
: String(originalError?.message ?? originalError);
|
|
135
|
-
const escapedOriginalMessage = escapeLines(fixCwdError(originalMessage, cwd));
|
|
136
|
-
return escapedOriginalMessage === '' ? undefined : escapedOriginalMessage;
|
|
137
|
-
};
|
|
138
|
-
|
|
139
|
-
const serializeIpcMessage = ipcMessage => typeof ipcMessage === 'string'
|
|
140
|
-
? ipcMessage
|
|
141
|
-
: inspect(ipcMessage);
|
|
142
|
-
|
|
143
|
-
const serializeMessagePart = messagePart => Array.isArray(messagePart)
|
|
144
|
-
? messagePart.map(messageItem => stripFinalNewline(serializeMessageItem(messageItem))).filter(Boolean).join('\n')
|
|
145
|
-
: serializeMessageItem(messagePart);
|
|
146
|
-
|
|
147
|
-
const serializeMessageItem = messageItem => {
|
|
148
|
-
if (typeof messageItem === 'string') {
|
|
149
|
-
return messageItem;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
if (isUint8Array(messageItem)) {
|
|
153
|
-
return uint8ArrayToString(messageItem);
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
return '';
|
|
157
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import {logResult} from '../verbose/complete.js';
|
|
2
|
-
|
|
3
|
-
// Applies the `reject` option.
|
|
4
|
-
// Also print the final log line with `verbose`.
|
|
5
|
-
export const handleResult = (result, verboseInfo, {reject}) => {
|
|
6
|
-
logResult(result, verboseInfo);
|
|
7
|
-
|
|
8
|
-
if (result.failed && reject) {
|
|
9
|
-
throw result;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
return result;
|
|
13
|
-
};
|