@storm-software/config-tools 1.144.13 → 1.145.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.
Files changed (159) hide show
  1. package/README.md +1 -1
  2. package/bin/config.cjs +260 -74597
  3. package/bin/config.js +224 -74588
  4. package/dist/chunk-2AVLCXLT.js +0 -0
  5. package/dist/chunk-3NWKPYIG.cjs +68 -0
  6. package/dist/{chunk-7TAUZNGG.cjs → chunk-5BKIG4XN.cjs} +5 -7
  7. package/dist/chunk-65SWKEHV.cjs +1 -0
  8. package/dist/{chunk-UHUKL2FF.js → chunk-6QCPF7DE.js} +3 -5
  9. package/dist/{chunk-TUH2WX5T.js → chunk-7FBGW2FI.js} +3 -5
  10. package/dist/{chunk-OMKDNOX6.cjs → chunk-7NSHGJWY.cjs} +2 -4
  11. package/dist/chunk-7PV6L7I7.cjs +1 -0
  12. package/dist/{chunk-I4SIJOYB.cjs → chunk-B6J2YUGO.cjs} +7 -9
  13. package/dist/{chunk-NCZG3KIJ.js → chunk-BHZFTVXN.js} +2 -4
  14. package/dist/{chunk-LHYMHJN7.js → chunk-CEEL5LLM.js} +8 -10
  15. package/dist/{chunk-WSHWZNKF.cjs → chunk-CRQ4EVX5.cjs} +4 -6
  16. package/dist/chunk-DD3HX2NX.cjs +1 -0
  17. package/dist/{chunk-VNWXMGH6.cjs → chunk-DXUUXBG3.cjs} +6 -8
  18. package/dist/{chunk-3HOVXAQZ.cjs → chunk-EOQEK2MM.cjs} +37 -39
  19. package/dist/chunk-EPBOQXUS.cjs +93 -0
  20. package/dist/{chunk-2F7SMIKE.js → chunk-FXFNC4WC.js} +4 -6
  21. package/dist/chunk-GFL2DSZK.js +44 -0
  22. package/dist/{chunk-V2H3W5RM.cjs → chunk-GMMTDKYU.cjs} +22 -24
  23. package/dist/{chunk-NMYOKDUE.cjs → chunk-HE7RJB2E.cjs} +30 -27
  24. package/dist/{chunk-L3RZVSYE.js → chunk-HI33NNPB.js} +3 -5
  25. package/dist/{chunk-5GWRMIQL.js → chunk-HSCCBYAV.js} +2 -4
  26. package/dist/{chunk-2BONUUVS.cjs → chunk-HSNM6VD2.cjs} +13 -12
  27. package/dist/{chunk-RXWR65M2.js → chunk-IKXDQ7DB.js} +5 -7
  28. package/dist/{chunk-DEWCXJEQ.cjs → chunk-IRCFHYKZ.cjs} +1 -6
  29. package/dist/{chunk-5CCF2WYC.js → chunk-IUT7Y2UY.js} +4 -6
  30. package/dist/chunk-IWD6YQKX.cjs +1 -0
  31. package/dist/chunk-JXLUUN7Z.cjs +179 -0
  32. package/dist/{chunk-XJSXW4P5.cjs → chunk-KRKGLKPD.cjs} +13 -15
  33. package/dist/chunk-L6UNTUC4.js +0 -0
  34. package/dist/{chunk-WBQEFUVW.js → chunk-LQJJD6FB.js} +2 -4
  35. package/dist/chunk-MXRRZKNO.js +77 -0
  36. package/dist/{chunk-MNA5ZBKU.js → chunk-MZ5BNE43.js} +12 -14
  37. package/dist/chunk-NJVL3GF4.js +0 -0
  38. package/dist/{chunk-WN4V6QSX.js → chunk-POXTJ6GF.js} +0 -5
  39. package/dist/{chunk-RR5DGQEI.js → chunk-PR7RQHRE.js} +2 -4
  40. package/dist/{chunk-A55N7CTJ.js → chunk-QBS3OCHH.js} +2 -4
  41. package/dist/{chunk-SJZ346G5.js → chunk-QGYINXXY.js} +3 -5
  42. package/dist/{chunk-M3QWTBKA.js → chunk-R4O6ILOD.js} +10 -7
  43. package/dist/chunk-RRKB32OH.js +0 -0
  44. package/dist/{chunk-E7VZQ7HY.cjs → chunk-RVM5N5ZI.cjs} +2 -4
  45. package/dist/chunk-SA4LVIO6.cjs +77 -0
  46. package/dist/chunk-SHUYVCID.js +6 -0
  47. package/dist/chunk-SLGVSUEV.cjs +36 -0
  48. package/dist/chunk-SPNVYBT4.cjs +44 -0
  49. package/dist/chunk-USNT2KNT.cjs +6 -0
  50. package/dist/chunk-WRGFZXJE.js +179 -0
  51. package/dist/{chunk-54PYJ6Z7.js → chunk-X7BEPYRX.js} +2 -4
  52. package/dist/{chunk-WJP36CPU.cjs → chunk-XAJB3BSF.cjs} +3 -5
  53. package/dist/{chunk-P26TW2V3.cjs → chunk-XDBACKKN.cjs} +3 -5
  54. package/dist/chunk-XY2LDOQ4.cjs +26 -0
  55. package/dist/{chunk-AXVHALK5.cjs → chunk-XYV3B7TT.cjs} +2 -4
  56. package/dist/{chunk-NKL6DBVO.js → chunk-YES7WAZK.js} +8 -7
  57. package/dist/chunk-ZA4IO7YJ.js +36 -0
  58. package/dist/config-file/get-config-file.cjs +20 -25
  59. package/dist/config-file/get-config-file.js +19 -24
  60. package/dist/config-file/index.cjs +21 -26
  61. package/dist/config-file/index.js +20 -25
  62. package/dist/create-storm-config.cjs +23 -28
  63. package/dist/create-storm-config.js +22 -27
  64. package/dist/env/get-env.cjs +7 -6
  65. package/dist/env/get-env.js +6 -5
  66. package/dist/env/index.cjs +9 -8
  67. package/dist/env/index.js +8 -7
  68. package/dist/env/set-env.cjs +6 -6
  69. package/dist/env/set-env.js +5 -5
  70. package/dist/get-config.cjs +24 -29
  71. package/dist/get-config.js +23 -28
  72. package/dist/index.cjs +28 -38
  73. package/dist/index.js +27 -37
  74. package/dist/logger/chalk.cjs +3 -3
  75. package/dist/logger/chalk.js +2 -2
  76. package/dist/logger/console-icons.cjs +5 -5
  77. package/dist/logger/console-icons.js +4 -4
  78. package/dist/logger/console.cjs +14 -13
  79. package/dist/logger/console.js +13 -12
  80. package/dist/logger/create-logger.cjs +15 -14
  81. package/dist/logger/create-logger.js +14 -13
  82. package/dist/logger/format-timestamp.cjs +3 -3
  83. package/dist/logger/format-timestamp.js +2 -2
  84. package/dist/logger/get-log-level.cjs +4 -4
  85. package/dist/logger/get-log-level.js +3 -3
  86. package/dist/logger/index.cjs +16 -15
  87. package/dist/logger/index.js +15 -14
  88. package/dist/logger/is-unicode-supported.cjs +3 -3
  89. package/dist/logger/is-unicode-supported.js +2 -2
  90. package/dist/types.cjs +3 -3
  91. package/dist/types.js +2 -2
  92. package/dist/utilities/apply-workspace-tokens.cjs +6 -6
  93. package/dist/utilities/apply-workspace-tokens.js +5 -5
  94. package/dist/utilities/correct-paths.cjs +3 -3
  95. package/dist/utilities/correct-paths.js +2 -2
  96. package/dist/utilities/file-path-utils.cjs +3 -3
  97. package/dist/utilities/file-path-utils.js +2 -2
  98. package/dist/utilities/find-up.cjs +3 -3
  99. package/dist/utilities/find-up.js +2 -2
  100. package/dist/utilities/find-workspace-root.cjs +5 -5
  101. package/dist/utilities/find-workspace-root.js +4 -4
  102. package/dist/utilities/get-default-config.cjs +7 -6
  103. package/dist/utilities/get-default-config.js +6 -5
  104. package/dist/utilities/index.cjs +19 -18
  105. package/dist/utilities/index.js +18 -17
  106. package/dist/utilities/process-handler.cjs +15 -14
  107. package/dist/utilities/process-handler.js +14 -13
  108. package/dist/utilities/run.cjs +3 -3
  109. package/dist/utilities/run.js +2 -2
  110. package/package.json +4 -5
  111. package/dist/chunk-2GPW5A4A.cjs +0 -50
  112. package/dist/chunk-3IVAD3CI.cjs +0 -510
  113. package/dist/chunk-52JTCGPV.cjs +0 -6
  114. package/dist/chunk-52Z3B7HG.js +0 -6
  115. package/dist/chunk-55BEED5V.cjs +0 -70
  116. package/dist/chunk-5LIAIS5V.js +0 -6
  117. package/dist/chunk-65NJ2BNV.js +0 -49
  118. package/dist/chunk-6SKUJC25.cjs +0 -451
  119. package/dist/chunk-7IOWYE4O.cjs +0 -34070
  120. package/dist/chunk-7LNAPF6J.js +0 -7601
  121. package/dist/chunk-BIBA7MGH.js +0 -84
  122. package/dist/chunk-BZ3KC4XF.cjs +0 -6
  123. package/dist/chunk-EVHBF7QV.cjs +0 -6
  124. package/dist/chunk-F5YSYO5J.js +0 -2645
  125. package/dist/chunk-FIQNSYAM.cjs +0 -1120
  126. package/dist/chunk-IIQMKNOS.cjs +0 -6
  127. package/dist/chunk-JT5CJFOS.cjs +0 -2645
  128. package/dist/chunk-KCNZC4ZI.js +0 -6
  129. package/dist/chunk-M3K4KT2L.cjs +0 -4054
  130. package/dist/chunk-MVPKPUE3.js +0 -1120
  131. package/dist/chunk-MZADO4BZ.cjs +0 -765
  132. package/dist/chunk-PRGAKNNV.js +0 -765
  133. package/dist/chunk-Q3AKY4XY.js +0 -4054
  134. package/dist/chunk-Q42ZDLPG.js +0 -510
  135. package/dist/chunk-QFCXJAOM.js +0 -50
  136. package/dist/chunk-QZAXYX3X.cjs +0 -7601
  137. package/dist/chunk-R6ZWDCX4.cjs +0 -28
  138. package/dist/chunk-RNYNEYJ5.js +0 -451
  139. package/dist/chunk-SCFUDB74.cjs +0 -49
  140. package/dist/chunk-YDVJJTKY.js +0 -34067
  141. package/dist/chunk-Z555MBWN.cjs +0 -84
  142. package/dist/chunk-ZIUQG4HD.js +0 -6
  143. package/dist/chunk-ZXAQ4Y3X.cjs +0 -95
  144. package/dist/dist-UYAH2J3L.js +0 -17570
  145. package/dist/dist-WP6JBNT4.cjs +0 -17571
  146. package/dist/esm-F37IKPYG.cjs +0 -1716
  147. package/dist/esm-SQV6ELTR.js +0 -1716
  148. package/dist/execa-4HBUJBFQ.js +0 -2424
  149. package/dist/execa-K2JB3BB4.cjs +0 -2424
  150. package/dist/json5-PPMIEYQR.cjs +0 -10
  151. package/dist/json5-WTSMELC2.js +0 -10
  152. package/dist/jsonc-B7SFZJW2.js +0 -15
  153. package/dist/jsonc-X7JKFW4T.cjs +0 -15
  154. package/dist/multipart-parser-JIRREWFU.cjs +0 -187
  155. package/dist/multipart-parser-TFNERLJV.js +0 -187
  156. package/dist/toml-MTE5VHET.js +0 -10
  157. package/dist/toml-N2WLYE3T.cjs +0 -10
  158. package/dist/yaml-D6PQ2AEL.js +0 -10
  159. package/dist/yaml-LR2Y4V3W.cjs +0 -10
@@ -1,2424 +0,0 @@
1
- import {
2
- __commonJS,
3
- __name,
4
- __require,
5
- __toESM,
6
- init_esm_shims
7
- } from "./chunk-65NJ2BNV.js";
8
-
9
- // ../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js
10
- var require_windows = __commonJS({
11
- "../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js"(exports, module) {
12
- init_esm_shims();
13
- module.exports = isexe;
14
- isexe.sync = sync;
15
- var fs = __require("fs");
16
- function checkPathExt(path3, options) {
17
- var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
18
- if (!pathext) {
19
- return true;
20
- }
21
- pathext = pathext.split(";");
22
- if (pathext.indexOf("") !== -1) {
23
- return true;
24
- }
25
- for (var i = 0; i < pathext.length; i++) {
26
- var p = pathext[i].toLowerCase();
27
- if (p && path3.substr(-p.length).toLowerCase() === p) {
28
- return true;
29
- }
30
- }
31
- return false;
32
- }
33
- __name(checkPathExt, "checkPathExt");
34
- function checkStat(stat, path3, options) {
35
- if (!stat.isSymbolicLink() && !stat.isFile()) {
36
- return false;
37
- }
38
- return checkPathExt(path3, options);
39
- }
40
- __name(checkStat, "checkStat");
41
- function isexe(path3, options, cb) {
42
- fs.stat(path3, function(er, stat) {
43
- cb(er, er ? false : checkStat(stat, path3, options));
44
- });
45
- }
46
- __name(isexe, "isexe");
47
- function sync(path3, options) {
48
- return checkStat(fs.statSync(path3), path3, options);
49
- }
50
- __name(sync, "sync");
51
- }
52
- });
53
-
54
- // ../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js
55
- var require_mode = __commonJS({
56
- "../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js"(exports, module) {
57
- init_esm_shims();
58
- module.exports = isexe;
59
- isexe.sync = sync;
60
- var fs = __require("fs");
61
- function isexe(path3, options, cb) {
62
- fs.stat(path3, function(er, stat) {
63
- cb(er, er ? false : checkStat(stat, options));
64
- });
65
- }
66
- __name(isexe, "isexe");
67
- function sync(path3, options) {
68
- return checkStat(fs.statSync(path3), options);
69
- }
70
- __name(sync, "sync");
71
- function checkStat(stat, options) {
72
- return stat.isFile() && checkMode(stat, options);
73
- }
74
- __name(checkStat, "checkStat");
75
- function checkMode(stat, options) {
76
- var mod = stat.mode;
77
- var uid = stat.uid;
78
- var gid = stat.gid;
79
- var myUid = options.uid !== void 0 ? options.uid : process.getuid && process.getuid();
80
- var myGid = options.gid !== void 0 ? options.gid : process.getgid && process.getgid();
81
- var u = parseInt("100", 8);
82
- var g = parseInt("010", 8);
83
- var o = parseInt("001", 8);
84
- var ug = u | g;
85
- var ret = mod & o || mod & g && gid === myGid || mod & u && uid === myUid || mod & ug && myUid === 0;
86
- return ret;
87
- }
88
- __name(checkMode, "checkMode");
89
- }
90
- });
91
-
92
- // ../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js
93
- var require_isexe = __commonJS({
94
- "../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js"(exports, module) {
95
- init_esm_shims();
96
- var fs = __require("fs");
97
- var core;
98
- if (process.platform === "win32" || global.TESTING_WINDOWS) {
99
- core = require_windows();
100
- } else {
101
- core = require_mode();
102
- }
103
- module.exports = isexe;
104
- isexe.sync = sync;
105
- function isexe(path3, options, cb) {
106
- if (typeof options === "function") {
107
- cb = options;
108
- options = {};
109
- }
110
- if (!cb) {
111
- if (typeof Promise !== "function") {
112
- throw new TypeError("callback not provided");
113
- }
114
- return new Promise(function(resolve, reject) {
115
- isexe(path3, options || {}, function(er, is) {
116
- if (er) {
117
- reject(er);
118
- } else {
119
- resolve(is);
120
- }
121
- });
122
- });
123
- }
124
- core(path3, options || {}, function(er, is) {
125
- if (er) {
126
- if (er.code === "EACCES" || options && options.ignoreErrors) {
127
- er = null;
128
- is = false;
129
- }
130
- }
131
- cb(er, is);
132
- });
133
- }
134
- __name(isexe, "isexe");
135
- function sync(path3, options) {
136
- try {
137
- return core.sync(path3, options || {});
138
- } catch (er) {
139
- if (options && options.ignoreErrors || er.code === "EACCES") {
140
- return false;
141
- } else {
142
- throw er;
143
- }
144
- }
145
- }
146
- __name(sync, "sync");
147
- }
148
- });
149
-
150
- // ../../node_modules/.pnpm/which@2.0.2/node_modules/which/which.js
151
- var require_which = __commonJS({
152
- "../../node_modules/.pnpm/which@2.0.2/node_modules/which/which.js"(exports, module) {
153
- init_esm_shims();
154
- var isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
155
- var path3 = __require("path");
156
- var COLON = isWindows ? ";" : ":";
157
- var isexe = require_isexe();
158
- var getNotFoundError = /* @__PURE__ */ __name((cmd) => Object.assign(new Error(`not found: ${cmd}`), {
159
- code: "ENOENT"
160
- }), "getNotFoundError");
161
- var getPathInfo = /* @__PURE__ */ __name((cmd, opt) => {
162
- const colon = opt.colon || COLON;
163
- const pathEnv = cmd.match(/\//) || isWindows && cmd.match(/\\/) ? [
164
- ""
165
- ] : [
166
- // windows always checks the cwd first
167
- ...isWindows ? [
168
- process.cwd()
169
- ] : [],
170
- ...(opt.path || process.env.PATH || /* istanbul ignore next: very unusual */
171
- "").split(colon)
172
- ];
173
- const pathExtExe = isWindows ? opt.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "";
174
- const pathExt = isWindows ? pathExtExe.split(colon) : [
175
- ""
176
- ];
177
- if (isWindows) {
178
- if (cmd.indexOf(".") !== -1 && pathExt[0] !== "") pathExt.unshift("");
179
- }
180
- return {
181
- pathEnv,
182
- pathExt,
183
- pathExtExe
184
- };
185
- }, "getPathInfo");
186
- var which = /* @__PURE__ */ __name((cmd, opt, cb) => {
187
- if (typeof opt === "function") {
188
- cb = opt;
189
- opt = {};
190
- }
191
- if (!opt) opt = {};
192
- const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
193
- const found = [];
194
- const step = /* @__PURE__ */ __name((i) => new Promise((resolve, reject) => {
195
- if (i === pathEnv.length) return opt.all && found.length ? resolve(found) : reject(getNotFoundError(cmd));
196
- const ppRaw = pathEnv[i];
197
- const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
198
- const pCmd = path3.join(pathPart, cmd);
199
- const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
200
- resolve(subStep(p, i, 0));
201
- }), "step");
202
- const subStep = /* @__PURE__ */ __name((p, i, ii) => new Promise((resolve, reject) => {
203
- if (ii === pathExt.length) return resolve(step(i + 1));
204
- const ext = pathExt[ii];
205
- isexe(p + ext, {
206
- pathExt: pathExtExe
207
- }, (er, is) => {
208
- if (!er && is) {
209
- if (opt.all) found.push(p + ext);
210
- else return resolve(p + ext);
211
- }
212
- return resolve(subStep(p, i, ii + 1));
213
- });
214
- }), "subStep");
215
- return cb ? step(0).then((res) => cb(null, res), cb) : step(0);
216
- }, "which");
217
- var whichSync = /* @__PURE__ */ __name((cmd, opt) => {
218
- opt = opt || {};
219
- const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
220
- const found = [];
221
- for (let i = 0; i < pathEnv.length; i++) {
222
- const ppRaw = pathEnv[i];
223
- const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
224
- const pCmd = path3.join(pathPart, cmd);
225
- const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
226
- for (let j = 0; j < pathExt.length; j++) {
227
- const cur = p + pathExt[j];
228
- try {
229
- const is = isexe.sync(cur, {
230
- pathExt: pathExtExe
231
- });
232
- if (is) {
233
- if (opt.all) found.push(cur);
234
- else return cur;
235
- }
236
- } catch (ex) {
237
- }
238
- }
239
- }
240
- if (opt.all && found.length) return found;
241
- if (opt.nothrow) return null;
242
- throw getNotFoundError(cmd);
243
- }, "whichSync");
244
- module.exports = which;
245
- which.sync = whichSync;
246
- }
247
- });
248
-
249
- // ../../node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js
250
- var require_path_key = __commonJS({
251
- "../../node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js"(exports, module) {
252
- "use strict";
253
- init_esm_shims();
254
- var pathKey2 = /* @__PURE__ */ __name((options = {}) => {
255
- const environment = options.env || process.env;
256
- const platform = options.platform || process.platform;
257
- if (platform !== "win32") {
258
- return "PATH";
259
- }
260
- return Object.keys(environment).reverse().find((key) => key.toUpperCase() === "PATH") || "Path";
261
- }, "pathKey");
262
- module.exports = pathKey2;
263
- module.exports.default = pathKey2;
264
- }
265
- });
266
-
267
- // ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js
268
- var require_resolveCommand = __commonJS({
269
- "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js"(exports, module) {
270
- "use strict";
271
- init_esm_shims();
272
- var path3 = __require("path");
273
- var which = require_which();
274
- var getPathKey = require_path_key();
275
- function resolveCommandAttempt(parsed, withoutPathExt) {
276
- const env = parsed.options.env || process.env;
277
- const cwd = process.cwd();
278
- const hasCustomCwd = parsed.options.cwd != null;
279
- const shouldSwitchCwd = hasCustomCwd && process.chdir !== void 0 && !process.chdir.disabled;
280
- if (shouldSwitchCwd) {
281
- try {
282
- process.chdir(parsed.options.cwd);
283
- } catch (err) {
284
- }
285
- }
286
- let resolved;
287
- try {
288
- resolved = which.sync(parsed.command, {
289
- path: env[getPathKey({
290
- env
291
- })],
292
- pathExt: withoutPathExt ? path3.delimiter : void 0
293
- });
294
- } catch (e) {
295
- } finally {
296
- if (shouldSwitchCwd) {
297
- process.chdir(cwd);
298
- }
299
- }
300
- if (resolved) {
301
- resolved = path3.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
302
- }
303
- return resolved;
304
- }
305
- __name(resolveCommandAttempt, "resolveCommandAttempt");
306
- function resolveCommand(parsed) {
307
- return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);
308
- }
309
- __name(resolveCommand, "resolveCommand");
310
- module.exports = resolveCommand;
311
- }
312
- });
313
-
314
- // ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/escape.js
315
- var require_escape = __commonJS({
316
- "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/escape.js"(exports, module) {
317
- "use strict";
318
- init_esm_shims();
319
- var metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
320
- function escapeCommand(arg) {
321
- arg = arg.replace(metaCharsRegExp, "^$1");
322
- return arg;
323
- }
324
- __name(escapeCommand, "escapeCommand");
325
- function escapeArgument(arg, doubleEscapeMetaChars) {
326
- arg = `${arg}`;
327
- arg = arg.replace(/(?=(\\+?)?)\1"/g, '$1$1\\"');
328
- arg = arg.replace(/(?=(\\+?)?)\1$/, "$1$1");
329
- arg = `"${arg}"`;
330
- arg = arg.replace(metaCharsRegExp, "^$1");
331
- if (doubleEscapeMetaChars) {
332
- arg = arg.replace(metaCharsRegExp, "^$1");
333
- }
334
- return arg;
335
- }
336
- __name(escapeArgument, "escapeArgument");
337
- module.exports.command = escapeCommand;
338
- module.exports.argument = escapeArgument;
339
- }
340
- });
341
-
342
- // ../../node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex/index.js
343
- var require_shebang_regex = __commonJS({
344
- "../../node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex/index.js"(exports, module) {
345
- "use strict";
346
- init_esm_shims();
347
- module.exports = /^#!(.*)/;
348
- }
349
- });
350
-
351
- // ../../node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.js
352
- var require_shebang_command = __commonJS({
353
- "../../node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.js"(exports, module) {
354
- "use strict";
355
- init_esm_shims();
356
- var shebangRegex = require_shebang_regex();
357
- module.exports = (string = "") => {
358
- const match = string.match(shebangRegex);
359
- if (!match) {
360
- return null;
361
- }
362
- const [path3, argument] = match[0].replace(/#! ?/, "").split(" ");
363
- const binary = path3.split("/").pop();
364
- if (binary === "env") {
365
- return argument;
366
- }
367
- return argument ? `${binary} ${argument}` : binary;
368
- };
369
- }
370
- });
371
-
372
- // ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js
373
- var require_readShebang = __commonJS({
374
- "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js"(exports, module) {
375
- "use strict";
376
- init_esm_shims();
377
- var fs = __require("fs");
378
- var shebangCommand = require_shebang_command();
379
- function readShebang(command) {
380
- const size = 150;
381
- const buffer = Buffer.alloc(size);
382
- let fd;
383
- try {
384
- fd = fs.openSync(command, "r");
385
- fs.readSync(fd, buffer, 0, size, 0);
386
- fs.closeSync(fd);
387
- } catch (e) {
388
- }
389
- return shebangCommand(buffer.toString());
390
- }
391
- __name(readShebang, "readShebang");
392
- module.exports = readShebang;
393
- }
394
- });
395
-
396
- // ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js
397
- var require_parse = __commonJS({
398
- "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js"(exports, module) {
399
- "use strict";
400
- init_esm_shims();
401
- var path3 = __require("path");
402
- var resolveCommand = require_resolveCommand();
403
- var escape = require_escape();
404
- var readShebang = require_readShebang();
405
- var isWin = process.platform === "win32";
406
- var isExecutableRegExp = /\.(?:com|exe)$/i;
407
- var isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
408
- function detectShebang(parsed) {
409
- parsed.file = resolveCommand(parsed);
410
- const shebang = parsed.file && readShebang(parsed.file);
411
- if (shebang) {
412
- parsed.args.unshift(parsed.file);
413
- parsed.command = shebang;
414
- return resolveCommand(parsed);
415
- }
416
- return parsed.file;
417
- }
418
- __name(detectShebang, "detectShebang");
419
- function parseNonShell(parsed) {
420
- if (!isWin) {
421
- return parsed;
422
- }
423
- const commandFile = detectShebang(parsed);
424
- const needsShell = !isExecutableRegExp.test(commandFile);
425
- if (parsed.options.forceShell || needsShell) {
426
- const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
427
- parsed.command = path3.normalize(parsed.command);
428
- parsed.command = escape.command(parsed.command);
429
- parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
430
- const shellCommand = [
431
- parsed.command
432
- ].concat(parsed.args).join(" ");
433
- parsed.args = [
434
- "/d",
435
- "/s",
436
- "/c",
437
- `"${shellCommand}"`
438
- ];
439
- parsed.command = process.env.comspec || "cmd.exe";
440
- parsed.options.windowsVerbatimArguments = true;
441
- }
442
- return parsed;
443
- }
444
- __name(parseNonShell, "parseNonShell");
445
- function parse(command, args, options) {
446
- if (args && !Array.isArray(args)) {
447
- options = args;
448
- args = null;
449
- }
450
- args = args ? args.slice(0) : [];
451
- options = Object.assign({}, options);
452
- const parsed = {
453
- command,
454
- args,
455
- options,
456
- file: void 0,
457
- original: {
458
- command,
459
- args
460
- }
461
- };
462
- return options.shell ? parsed : parseNonShell(parsed);
463
- }
464
- __name(parse, "parse");
465
- module.exports = parse;
466
- }
467
- });
468
-
469
- // ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/enoent.js
470
- var require_enoent = __commonJS({
471
- "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/enoent.js"(exports, module) {
472
- "use strict";
473
- init_esm_shims();
474
- var isWin = process.platform === "win32";
475
- function notFoundError(original, syscall) {
476
- return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), {
477
- code: "ENOENT",
478
- errno: "ENOENT",
479
- syscall: `${syscall} ${original.command}`,
480
- path: original.command,
481
- spawnargs: original.args
482
- });
483
- }
484
- __name(notFoundError, "notFoundError");
485
- function hookChildProcess(cp, parsed) {
486
- if (!isWin) {
487
- return;
488
- }
489
- const originalEmit = cp.emit;
490
- cp.emit = function(name, arg1) {
491
- if (name === "exit") {
492
- const err = verifyENOENT(arg1, parsed);
493
- if (err) {
494
- return originalEmit.call(cp, "error", err);
495
- }
496
- }
497
- return originalEmit.apply(cp, arguments);
498
- };
499
- }
500
- __name(hookChildProcess, "hookChildProcess");
501
- function verifyENOENT(status, parsed) {
502
- if (isWin && status === 1 && !parsed.file) {
503
- return notFoundError(parsed.original, "spawn");
504
- }
505
- return null;
506
- }
507
- __name(verifyENOENT, "verifyENOENT");
508
- function verifyENOENTSync(status, parsed) {
509
- if (isWin && status === 1 && !parsed.file) {
510
- return notFoundError(parsed.original, "spawnSync");
511
- }
512
- return null;
513
- }
514
- __name(verifyENOENTSync, "verifyENOENTSync");
515
- module.exports = {
516
- hookChildProcess,
517
- verifyENOENT,
518
- verifyENOENTSync,
519
- notFoundError
520
- };
521
- }
522
- });
523
-
524
- // ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js
525
- var require_cross_spawn = __commonJS({
526
- "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js"(exports, module) {
527
- "use strict";
528
- init_esm_shims();
529
- var cp = __require("child_process");
530
- var parse = require_parse();
531
- var enoent = require_enoent();
532
- function spawn(command, args, options) {
533
- const parsed = parse(command, args, options);
534
- const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);
535
- enoent.hookChildProcess(spawned, parsed);
536
- return spawned;
537
- }
538
- __name(spawn, "spawn");
539
- function spawnSync(command, args, options) {
540
- const parsed = parse(command, args, options);
541
- const result = cp.spawnSync(parsed.command, parsed.args, parsed.options);
542
- result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
543
- return result;
544
- }
545
- __name(spawnSync, "spawnSync");
546
- module.exports = spawn;
547
- module.exports.spawn = spawn;
548
- module.exports.sync = spawnSync;
549
- module.exports._parse = parse;
550
- module.exports._enoent = enoent;
551
- }
552
- });
553
-
554
- // ../../node_modules/.pnpm/merge-stream@2.0.0/node_modules/merge-stream/index.js
555
- var require_merge_stream = __commonJS({
556
- "../../node_modules/.pnpm/merge-stream@2.0.0/node_modules/merge-stream/index.js"(exports, module) {
557
- "use strict";
558
- init_esm_shims();
559
- var { PassThrough } = __require("stream");
560
- module.exports = function() {
561
- var sources = [];
562
- var output = new PassThrough({
563
- objectMode: true
564
- });
565
- output.setMaxListeners(0);
566
- output.add = add;
567
- output.isEmpty = isEmpty;
568
- output.on("unpipe", remove);
569
- Array.prototype.slice.call(arguments).forEach(add);
570
- return output;
571
- function add(source) {
572
- if (Array.isArray(source)) {
573
- source.forEach(add);
574
- return this;
575
- }
576
- sources.push(source);
577
- source.once("end", remove.bind(null, source));
578
- source.once("error", output.emit.bind(output, "error"));
579
- source.pipe(output, {
580
- end: false
581
- });
582
- return this;
583
- }
584
- __name(add, "add");
585
- function isEmpty() {
586
- return sources.length == 0;
587
- }
588
- __name(isEmpty, "isEmpty");
589
- function remove(source) {
590
- sources = sources.filter(function(it) {
591
- return it !== source;
592
- });
593
- if (!sources.length && output.readable) {
594
- output.end();
595
- }
596
- }
597
- __name(remove, "remove");
598
- };
599
- }
600
- });
601
-
602
- // ../../node_modules/.pnpm/execa@8.0.1/node_modules/execa/index.js
603
- init_esm_shims();
604
- var import_cross_spawn = __toESM(require_cross_spawn(), 1);
605
- import { Buffer as Buffer3 } from "node:buffer";
606
- import path2 from "node:path";
607
- import childProcess from "node:child_process";
608
- import process6 from "node:process";
609
-
610
- // ../../node_modules/.pnpm/strip-final-newline@3.0.0/node_modules/strip-final-newline/index.js
611
- init_esm_shims();
612
- function stripFinalNewline(input) {
613
- const LF = typeof input === "string" ? "\n" : "\n".charCodeAt();
614
- const CR = typeof input === "string" ? "\r" : "\r".charCodeAt();
615
- if (input[input.length - 1] === LF) {
616
- input = input.slice(0, -1);
617
- }
618
- if (input[input.length - 1] === CR) {
619
- input = input.slice(0, -1);
620
- }
621
- return input;
622
- }
623
- __name(stripFinalNewline, "stripFinalNewline");
624
-
625
- // ../../node_modules/.pnpm/npm-run-path@5.3.0/node_modules/npm-run-path/index.js
626
- init_esm_shims();
627
- import process2 from "node:process";
628
- import path from "node:path";
629
- import { fileURLToPath } from "node:url";
630
-
631
- // ../../node_modules/.pnpm/path-key@4.0.0/node_modules/path-key/index.js
632
- init_esm_shims();
633
- function pathKey(options = {}) {
634
- const { env = process.env, platform = process.platform } = options;
635
- if (platform !== "win32") {
636
- return "PATH";
637
- }
638
- return Object.keys(env).reverse().find((key) => key.toUpperCase() === "PATH") || "Path";
639
- }
640
- __name(pathKey, "pathKey");
641
-
642
- // ../../node_modules/.pnpm/npm-run-path@5.3.0/node_modules/npm-run-path/index.js
643
- var npmRunPath = /* @__PURE__ */ __name(({ cwd = process2.cwd(), path: pathOption = process2.env[pathKey()], preferLocal = true, execPath = process2.execPath, addExecPath = true } = {}) => {
644
- const cwdString = cwd instanceof URL ? fileURLToPath(cwd) : cwd;
645
- const cwdPath = path.resolve(cwdString);
646
- const result = [];
647
- if (preferLocal) {
648
- applyPreferLocal(result, cwdPath);
649
- }
650
- if (addExecPath) {
651
- applyExecPath(result, execPath, cwdPath);
652
- }
653
- return [
654
- ...result,
655
- pathOption
656
- ].join(path.delimiter);
657
- }, "npmRunPath");
658
- var applyPreferLocal = /* @__PURE__ */ __name((result, cwdPath) => {
659
- let previous;
660
- while (previous !== cwdPath) {
661
- result.push(path.join(cwdPath, "node_modules/.bin"));
662
- previous = cwdPath;
663
- cwdPath = path.resolve(cwdPath, "..");
664
- }
665
- }, "applyPreferLocal");
666
- var applyExecPath = /* @__PURE__ */ __name((result, execPath, cwdPath) => {
667
- const execPathString = execPath instanceof URL ? fileURLToPath(execPath) : execPath;
668
- result.push(path.resolve(cwdPath, execPathString, ".."));
669
- }, "applyExecPath");
670
- var npmRunPathEnv = /* @__PURE__ */ __name(({ env = process2.env, ...options } = {}) => {
671
- env = {
672
- ...env
673
- };
674
- const pathName = pathKey({
675
- env
676
- });
677
- options.path = env[pathName];
678
- env[pathName] = npmRunPath(options);
679
- return env;
680
- }, "npmRunPathEnv");
681
-
682
- // ../../node_modules/.pnpm/onetime@6.0.0/node_modules/onetime/index.js
683
- init_esm_shims();
684
-
685
- // ../../node_modules/.pnpm/mimic-fn@4.0.0/node_modules/mimic-fn/index.js
686
- init_esm_shims();
687
- var copyProperty = /* @__PURE__ */ __name((to, from, property, ignoreNonConfigurable) => {
688
- if (property === "length" || property === "prototype") {
689
- return;
690
- }
691
- if (property === "arguments" || property === "caller") {
692
- return;
693
- }
694
- const toDescriptor = Object.getOwnPropertyDescriptor(to, property);
695
- const fromDescriptor = Object.getOwnPropertyDescriptor(from, property);
696
- if (!canCopyProperty(toDescriptor, fromDescriptor) && ignoreNonConfigurable) {
697
- return;
698
- }
699
- Object.defineProperty(to, property, fromDescriptor);
700
- }, "copyProperty");
701
- var canCopyProperty = /* @__PURE__ */ __name(function(toDescriptor, fromDescriptor) {
702
- return toDescriptor === void 0 || toDescriptor.configurable || toDescriptor.writable === fromDescriptor.writable && toDescriptor.enumerable === fromDescriptor.enumerable && toDescriptor.configurable === fromDescriptor.configurable && (toDescriptor.writable || toDescriptor.value === fromDescriptor.value);
703
- }, "canCopyProperty");
704
- var changePrototype = /* @__PURE__ */ __name((to, from) => {
705
- const fromPrototype = Object.getPrototypeOf(from);
706
- if (fromPrototype === Object.getPrototypeOf(to)) {
707
- return;
708
- }
709
- Object.setPrototypeOf(to, fromPrototype);
710
- }, "changePrototype");
711
- var wrappedToString = /* @__PURE__ */ __name((withName, fromBody) => `/* Wrapped ${withName}*/
712
- ${fromBody}`, "wrappedToString");
713
- var toStringDescriptor = Object.getOwnPropertyDescriptor(Function.prototype, "toString");
714
- var toStringName = Object.getOwnPropertyDescriptor(Function.prototype.toString, "name");
715
- var changeToString = /* @__PURE__ */ __name((to, from, name) => {
716
- const withName = name === "" ? "" : `with ${name.trim()}() `;
717
- const newToString = wrappedToString.bind(null, withName, from.toString());
718
- Object.defineProperty(newToString, "name", toStringName);
719
- Object.defineProperty(to, "toString", {
720
- ...toStringDescriptor,
721
- value: newToString
722
- });
723
- }, "changeToString");
724
- function mimicFunction(to, from, { ignoreNonConfigurable = false } = {}) {
725
- const { name } = to;
726
- for (const property of Reflect.ownKeys(from)) {
727
- copyProperty(to, from, property, ignoreNonConfigurable);
728
- }
729
- changePrototype(to, from);
730
- changeToString(to, from, name);
731
- return to;
732
- }
733
- __name(mimicFunction, "mimicFunction");
734
-
735
- // ../../node_modules/.pnpm/onetime@6.0.0/node_modules/onetime/index.js
736
- var calledFunctions = /* @__PURE__ */ new WeakMap();
737
- var onetime = /* @__PURE__ */ __name((function_, options = {}) => {
738
- if (typeof function_ !== "function") {
739
- throw new TypeError("Expected a function");
740
- }
741
- let returnValue;
742
- let callCount = 0;
743
- const functionName = function_.displayName || function_.name || "<anonymous>";
744
- const onetime2 = /* @__PURE__ */ __name(function(...arguments_) {
745
- calledFunctions.set(onetime2, ++callCount);
746
- if (callCount === 1) {
747
- returnValue = function_.apply(this, arguments_);
748
- function_ = null;
749
- } else if (options.throw === true) {
750
- throw new Error(`Function \`${functionName}\` can only be called once`);
751
- }
752
- return returnValue;
753
- }, "onetime");
754
- mimicFunction(onetime2, function_);
755
- calledFunctions.set(onetime2, callCount);
756
- return onetime2;
757
- }, "onetime");
758
- onetime.callCount = (function_) => {
759
- if (!calledFunctions.has(function_)) {
760
- throw new Error(`The given function \`${function_.name}\` is not wrapped by the \`onetime\` package`);
761
- }
762
- return calledFunctions.get(function_);
763
- };
764
- var onetime_default = onetime;
765
-
766
- // ../../node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/error.js
767
- init_esm_shims();
768
- import process3 from "node:process";
769
-
770
- // ../../node_modules/.pnpm/human-signals@5.0.0/node_modules/human-signals/build/src/main.js
771
- init_esm_shims();
772
- import { constants as constants2 } from "node:os";
773
-
774
- // ../../node_modules/.pnpm/human-signals@5.0.0/node_modules/human-signals/build/src/realtime.js
775
- init_esm_shims();
776
- var getRealtimeSignals = /* @__PURE__ */ __name(() => {
777
- const length = SIGRTMAX - SIGRTMIN + 1;
778
- return Array.from({
779
- length
780
- }, getRealtimeSignal);
781
- }, "getRealtimeSignals");
782
- var getRealtimeSignal = /* @__PURE__ */ __name((value, index) => ({
783
- name: `SIGRT${index + 1}`,
784
- number: SIGRTMIN + index,
785
- action: "terminate",
786
- description: "Application-specific signal (realtime)",
787
- standard: "posix"
788
- }), "getRealtimeSignal");
789
- var SIGRTMIN = 34;
790
- var SIGRTMAX = 64;
791
-
792
- // ../../node_modules/.pnpm/human-signals@5.0.0/node_modules/human-signals/build/src/signals.js
793
- init_esm_shims();
794
- import { constants } from "node:os";
795
-
796
- // ../../node_modules/.pnpm/human-signals@5.0.0/node_modules/human-signals/build/src/core.js
797
- init_esm_shims();
798
- var SIGNALS = [
799
- {
800
- name: "SIGHUP",
801
- number: 1,
802
- action: "terminate",
803
- description: "Terminal closed",
804
- standard: "posix"
805
- },
806
- {
807
- name: "SIGINT",
808
- number: 2,
809
- action: "terminate",
810
- description: "User interruption with CTRL-C",
811
- standard: "ansi"
812
- },
813
- {
814
- name: "SIGQUIT",
815
- number: 3,
816
- action: "core",
817
- description: "User interruption with CTRL-\\",
818
- standard: "posix"
819
- },
820
- {
821
- name: "SIGILL",
822
- number: 4,
823
- action: "core",
824
- description: "Invalid machine instruction",
825
- standard: "ansi"
826
- },
827
- {
828
- name: "SIGTRAP",
829
- number: 5,
830
- action: "core",
831
- description: "Debugger breakpoint",
832
- standard: "posix"
833
- },
834
- {
835
- name: "SIGABRT",
836
- number: 6,
837
- action: "core",
838
- description: "Aborted",
839
- standard: "ansi"
840
- },
841
- {
842
- name: "SIGIOT",
843
- number: 6,
844
- action: "core",
845
- description: "Aborted",
846
- standard: "bsd"
847
- },
848
- {
849
- name: "SIGBUS",
850
- number: 7,
851
- action: "core",
852
- description: "Bus error due to misaligned, non-existing address or paging error",
853
- standard: "bsd"
854
- },
855
- {
856
- name: "SIGEMT",
857
- number: 7,
858
- action: "terminate",
859
- description: "Command should be emulated but is not implemented",
860
- standard: "other"
861
- },
862
- {
863
- name: "SIGFPE",
864
- number: 8,
865
- action: "core",
866
- description: "Floating point arithmetic error",
867
- standard: "ansi"
868
- },
869
- {
870
- name: "SIGKILL",
871
- number: 9,
872
- action: "terminate",
873
- description: "Forced termination",
874
- standard: "posix",
875
- forced: true
876
- },
877
- {
878
- name: "SIGUSR1",
879
- number: 10,
880
- action: "terminate",
881
- description: "Application-specific signal",
882
- standard: "posix"
883
- },
884
- {
885
- name: "SIGSEGV",
886
- number: 11,
887
- action: "core",
888
- description: "Segmentation fault",
889
- standard: "ansi"
890
- },
891
- {
892
- name: "SIGUSR2",
893
- number: 12,
894
- action: "terminate",
895
- description: "Application-specific signal",
896
- standard: "posix"
897
- },
898
- {
899
- name: "SIGPIPE",
900
- number: 13,
901
- action: "terminate",
902
- description: "Broken pipe or socket",
903
- standard: "posix"
904
- },
905
- {
906
- name: "SIGALRM",
907
- number: 14,
908
- action: "terminate",
909
- description: "Timeout or timer",
910
- standard: "posix"
911
- },
912
- {
913
- name: "SIGTERM",
914
- number: 15,
915
- action: "terminate",
916
- description: "Termination",
917
- standard: "ansi"
918
- },
919
- {
920
- name: "SIGSTKFLT",
921
- number: 16,
922
- action: "terminate",
923
- description: "Stack is empty or overflowed",
924
- standard: "other"
925
- },
926
- {
927
- name: "SIGCHLD",
928
- number: 17,
929
- action: "ignore",
930
- description: "Child process terminated, paused or unpaused",
931
- standard: "posix"
932
- },
933
- {
934
- name: "SIGCLD",
935
- number: 17,
936
- action: "ignore",
937
- description: "Child process terminated, paused or unpaused",
938
- standard: "other"
939
- },
940
- {
941
- name: "SIGCONT",
942
- number: 18,
943
- action: "unpause",
944
- description: "Unpaused",
945
- standard: "posix",
946
- forced: true
947
- },
948
- {
949
- name: "SIGSTOP",
950
- number: 19,
951
- action: "pause",
952
- description: "Paused",
953
- standard: "posix",
954
- forced: true
955
- },
956
- {
957
- name: "SIGTSTP",
958
- number: 20,
959
- action: "pause",
960
- description: 'Paused using CTRL-Z or "suspend"',
961
- standard: "posix"
962
- },
963
- {
964
- name: "SIGTTIN",
965
- number: 21,
966
- action: "pause",
967
- description: "Background process cannot read terminal input",
968
- standard: "posix"
969
- },
970
- {
971
- name: "SIGBREAK",
972
- number: 21,
973
- action: "terminate",
974
- description: "User interruption with CTRL-BREAK",
975
- standard: "other"
976
- },
977
- {
978
- name: "SIGTTOU",
979
- number: 22,
980
- action: "pause",
981
- description: "Background process cannot write to terminal output",
982
- standard: "posix"
983
- },
984
- {
985
- name: "SIGURG",
986
- number: 23,
987
- action: "ignore",
988
- description: "Socket received out-of-band data",
989
- standard: "bsd"
990
- },
991
- {
992
- name: "SIGXCPU",
993
- number: 24,
994
- action: "core",
995
- description: "Process timed out",
996
- standard: "bsd"
997
- },
998
- {
999
- name: "SIGXFSZ",
1000
- number: 25,
1001
- action: "core",
1002
- description: "File too big",
1003
- standard: "bsd"
1004
- },
1005
- {
1006
- name: "SIGVTALRM",
1007
- number: 26,
1008
- action: "terminate",
1009
- description: "Timeout or timer",
1010
- standard: "bsd"
1011
- },
1012
- {
1013
- name: "SIGPROF",
1014
- number: 27,
1015
- action: "terminate",
1016
- description: "Timeout or timer",
1017
- standard: "bsd"
1018
- },
1019
- {
1020
- name: "SIGWINCH",
1021
- number: 28,
1022
- action: "ignore",
1023
- description: "Terminal window size changed",
1024
- standard: "bsd"
1025
- },
1026
- {
1027
- name: "SIGIO",
1028
- number: 29,
1029
- action: "terminate",
1030
- description: "I/O is available",
1031
- standard: "other"
1032
- },
1033
- {
1034
- name: "SIGPOLL",
1035
- number: 29,
1036
- action: "terminate",
1037
- description: "Watched event",
1038
- standard: "other"
1039
- },
1040
- {
1041
- name: "SIGINFO",
1042
- number: 29,
1043
- action: "ignore",
1044
- description: "Request for process information",
1045
- standard: "other"
1046
- },
1047
- {
1048
- name: "SIGPWR",
1049
- number: 30,
1050
- action: "terminate",
1051
- description: "Device running out of power",
1052
- standard: "systemv"
1053
- },
1054
- {
1055
- name: "SIGSYS",
1056
- number: 31,
1057
- action: "core",
1058
- description: "Invalid system call",
1059
- standard: "other"
1060
- },
1061
- {
1062
- name: "SIGUNUSED",
1063
- number: 31,
1064
- action: "terminate",
1065
- description: "Invalid system call",
1066
- standard: "other"
1067
- }
1068
- ];
1069
-
1070
- // ../../node_modules/.pnpm/human-signals@5.0.0/node_modules/human-signals/build/src/signals.js
1071
- var getSignals = /* @__PURE__ */ __name(() => {
1072
- const realtimeSignals = getRealtimeSignals();
1073
- const signals2 = [
1074
- ...SIGNALS,
1075
- ...realtimeSignals
1076
- ].map(normalizeSignal);
1077
- return signals2;
1078
- }, "getSignals");
1079
- var normalizeSignal = /* @__PURE__ */ __name(({ name, number: defaultNumber, description, action, forced = false, standard }) => {
1080
- const { signals: { [name]: constantSignal } } = constants;
1081
- const supported = constantSignal !== void 0;
1082
- const number = supported ? constantSignal : defaultNumber;
1083
- return {
1084
- name,
1085
- number,
1086
- description,
1087
- supported,
1088
- action,
1089
- forced,
1090
- standard
1091
- };
1092
- }, "normalizeSignal");
1093
-
1094
- // ../../node_modules/.pnpm/human-signals@5.0.0/node_modules/human-signals/build/src/main.js
1095
- var getSignalsByName = /* @__PURE__ */ __name(() => {
1096
- const signals2 = getSignals();
1097
- return Object.fromEntries(signals2.map(getSignalByName));
1098
- }, "getSignalsByName");
1099
- var getSignalByName = /* @__PURE__ */ __name(({ name, number, description, supported, action, forced, standard }) => [
1100
- name,
1101
- {
1102
- name,
1103
- number,
1104
- description,
1105
- supported,
1106
- action,
1107
- forced,
1108
- standard
1109
- }
1110
- ], "getSignalByName");
1111
- var signalsByName = getSignalsByName();
1112
- var getSignalsByNumber = /* @__PURE__ */ __name(() => {
1113
- const signals2 = getSignals();
1114
- const length = SIGRTMAX + 1;
1115
- const signalsA = Array.from({
1116
- length
1117
- }, (value, number) => getSignalByNumber(number, signals2));
1118
- return Object.assign({}, ...signalsA);
1119
- }, "getSignalsByNumber");
1120
- var getSignalByNumber = /* @__PURE__ */ __name((number, signals2) => {
1121
- const signal = findSignalByNumber(number, signals2);
1122
- if (signal === void 0) {
1123
- return {};
1124
- }
1125
- const { name, description, supported, action, forced, standard } = signal;
1126
- return {
1127
- [number]: {
1128
- name,
1129
- number,
1130
- description,
1131
- supported,
1132
- action,
1133
- forced,
1134
- standard
1135
- }
1136
- };
1137
- }, "getSignalByNumber");
1138
- var findSignalByNumber = /* @__PURE__ */ __name((number, signals2) => {
1139
- const signal = signals2.find(({ name }) => constants2.signals[name] === number);
1140
- if (signal !== void 0) {
1141
- return signal;
1142
- }
1143
- return signals2.find((signalA) => signalA.number === number);
1144
- }, "findSignalByNumber");
1145
- var signalsByNumber = getSignalsByNumber();
1146
-
1147
- // ../../node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/error.js
1148
- var getErrorPrefix = /* @__PURE__ */ __name(({ timedOut, timeout, errorCode, signal, signalDescription, exitCode, isCanceled }) => {
1149
- if (timedOut) {
1150
- return `timed out after ${timeout} milliseconds`;
1151
- }
1152
- if (isCanceled) {
1153
- return "was canceled";
1154
- }
1155
- if (errorCode !== void 0) {
1156
- return `failed with ${errorCode}`;
1157
- }
1158
- if (signal !== void 0) {
1159
- return `was killed with ${signal} (${signalDescription})`;
1160
- }
1161
- if (exitCode !== void 0) {
1162
- return `failed with exit code ${exitCode}`;
1163
- }
1164
- return "failed";
1165
- }, "getErrorPrefix");
1166
- var makeError = /* @__PURE__ */ __name(({ stdout, stderr, all, error, signal, exitCode, command, escapedCommand, timedOut, isCanceled, killed, parsed: { options: { timeout, cwd = process3.cwd() } } }) => {
1167
- exitCode = exitCode === null ? void 0 : exitCode;
1168
- signal = signal === null ? void 0 : signal;
1169
- const signalDescription = signal === void 0 ? void 0 : signalsByName[signal].description;
1170
- const errorCode = error && error.code;
1171
- const prefix = getErrorPrefix({
1172
- timedOut,
1173
- timeout,
1174
- errorCode,
1175
- signal,
1176
- signalDescription,
1177
- exitCode,
1178
- isCanceled
1179
- });
1180
- const execaMessage = `Command ${prefix}: ${command}`;
1181
- const isError = Object.prototype.toString.call(error) === "[object Error]";
1182
- const shortMessage = isError ? `${execaMessage}
1183
- ${error.message}` : execaMessage;
1184
- const message = [
1185
- shortMessage,
1186
- stderr,
1187
- stdout
1188
- ].filter(Boolean).join("\n");
1189
- if (isError) {
1190
- error.originalMessage = error.message;
1191
- error.message = message;
1192
- } else {
1193
- error = new Error(message);
1194
- }
1195
- error.shortMessage = shortMessage;
1196
- error.command = command;
1197
- error.escapedCommand = escapedCommand;
1198
- error.exitCode = exitCode;
1199
- error.signal = signal;
1200
- error.signalDescription = signalDescription;
1201
- error.stdout = stdout;
1202
- error.stderr = stderr;
1203
- error.cwd = cwd;
1204
- if (all !== void 0) {
1205
- error.all = all;
1206
- }
1207
- if ("bufferedData" in error) {
1208
- delete error.bufferedData;
1209
- }
1210
- error.failed = true;
1211
- error.timedOut = Boolean(timedOut);
1212
- error.isCanceled = isCanceled;
1213
- error.killed = killed && !timedOut;
1214
- return error;
1215
- }, "makeError");
1216
-
1217
- // ../../node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/stdio.js
1218
- init_esm_shims();
1219
- var aliases = [
1220
- "stdin",
1221
- "stdout",
1222
- "stderr"
1223
- ];
1224
- var hasAlias = /* @__PURE__ */ __name((options) => aliases.some((alias) => options[alias] !== void 0), "hasAlias");
1225
- var normalizeStdio = /* @__PURE__ */ __name((options) => {
1226
- if (!options) {
1227
- return;
1228
- }
1229
- const { stdio } = options;
1230
- if (stdio === void 0) {
1231
- return aliases.map((alias) => options[alias]);
1232
- }
1233
- if (hasAlias(options)) {
1234
- throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${aliases.map((alias) => `\`${alias}\``).join(", ")}`);
1235
- }
1236
- if (typeof stdio === "string") {
1237
- return stdio;
1238
- }
1239
- if (!Array.isArray(stdio)) {
1240
- throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``);
1241
- }
1242
- const length = Math.max(stdio.length, aliases.length);
1243
- return Array.from({
1244
- length
1245
- }, (value, index) => stdio[index]);
1246
- }, "normalizeStdio");
1247
- var normalizeStdioNode = /* @__PURE__ */ __name((options) => {
1248
- const stdio = normalizeStdio(options);
1249
- if (stdio === "ipc") {
1250
- return "ipc";
1251
- }
1252
- if (stdio === void 0 || typeof stdio === "string") {
1253
- return [
1254
- stdio,
1255
- stdio,
1256
- stdio,
1257
- "ipc"
1258
- ];
1259
- }
1260
- if (stdio.includes("ipc")) {
1261
- return stdio;
1262
- }
1263
- return [
1264
- ...stdio,
1265
- "ipc"
1266
- ];
1267
- }, "normalizeStdioNode");
1268
-
1269
- // ../../node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/kill.js
1270
- init_esm_shims();
1271
- import os from "node:os";
1272
-
1273
- // ../../node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/index.js
1274
- init_esm_shims();
1275
-
1276
- // ../../node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/signals.js
1277
- init_esm_shims();
1278
- var signals = [];
1279
- signals.push("SIGHUP", "SIGINT", "SIGTERM");
1280
- if (process.platform !== "win32") {
1281
- signals.push("SIGALRM", "SIGABRT", "SIGVTALRM", "SIGXCPU", "SIGXFSZ", "SIGUSR2", "SIGTRAP", "SIGSYS", "SIGQUIT", "SIGIOT");
1282
- }
1283
- if (process.platform === "linux") {
1284
- signals.push("SIGIO", "SIGPOLL", "SIGPWR", "SIGSTKFLT");
1285
- }
1286
-
1287
- // ../../node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/index.js
1288
- var processOk = /* @__PURE__ */ __name((process7) => !!process7 && typeof process7 === "object" && typeof process7.removeListener === "function" && typeof process7.emit === "function" && typeof process7.reallyExit === "function" && typeof process7.listeners === "function" && typeof process7.kill === "function" && typeof process7.pid === "number" && typeof process7.on === "function", "processOk");
1289
- var kExitEmitter = Symbol.for("signal-exit emitter");
1290
- var global2 = globalThis;
1291
- var ObjectDefineProperty = Object.defineProperty.bind(Object);
1292
- var Emitter = class Emitter2 {
1293
- static {
1294
- __name(this, "Emitter");
1295
- }
1296
- emitted = {
1297
- afterExit: false,
1298
- exit: false
1299
- };
1300
- listeners = {
1301
- afterExit: [],
1302
- exit: []
1303
- };
1304
- count = 0;
1305
- id = Math.random();
1306
- constructor() {
1307
- if (global2[kExitEmitter]) {
1308
- return global2[kExitEmitter];
1309
- }
1310
- ObjectDefineProperty(global2, kExitEmitter, {
1311
- value: this,
1312
- writable: false,
1313
- enumerable: false,
1314
- configurable: false
1315
- });
1316
- }
1317
- on(ev, fn) {
1318
- this.listeners[ev].push(fn);
1319
- }
1320
- removeListener(ev, fn) {
1321
- const list = this.listeners[ev];
1322
- const i = list.indexOf(fn);
1323
- if (i === -1) {
1324
- return;
1325
- }
1326
- if (i === 0 && list.length === 1) {
1327
- list.length = 0;
1328
- } else {
1329
- list.splice(i, 1);
1330
- }
1331
- }
1332
- emit(ev, code, signal) {
1333
- if (this.emitted[ev]) {
1334
- return false;
1335
- }
1336
- this.emitted[ev] = true;
1337
- let ret = false;
1338
- for (const fn of this.listeners[ev]) {
1339
- ret = fn(code, signal) === true || ret;
1340
- }
1341
- if (ev === "exit") {
1342
- ret = this.emit("afterExit", code, signal) || ret;
1343
- }
1344
- return ret;
1345
- }
1346
- };
1347
- var SignalExitBase = class SignalExitBase2 {
1348
- static {
1349
- __name(this, "SignalExitBase");
1350
- }
1351
- };
1352
- var signalExitWrap = /* @__PURE__ */ __name((handler) => {
1353
- return {
1354
- onExit(cb, opts) {
1355
- return handler.onExit(cb, opts);
1356
- },
1357
- load() {
1358
- return handler.load();
1359
- },
1360
- unload() {
1361
- return handler.unload();
1362
- }
1363
- };
1364
- }, "signalExitWrap");
1365
- var SignalExitFallback = class SignalExitFallback2 extends SignalExitBase {
1366
- static {
1367
- __name(this, "SignalExitFallback");
1368
- }
1369
- onExit() {
1370
- return () => {
1371
- };
1372
- }
1373
- load() {
1374
- }
1375
- unload() {
1376
- }
1377
- };
1378
- var SignalExit = class SignalExit2 extends SignalExitBase {
1379
- static {
1380
- __name(this, "SignalExit");
1381
- }
1382
- // "SIGHUP" throws an `ENOSYS` error on Windows,
1383
- // so use a supported signal instead
1384
- /* c8 ignore start */
1385
- #hupSig = process4.platform === "win32" ? "SIGINT" : "SIGHUP";
1386
- /* c8 ignore stop */
1387
- #emitter = new Emitter();
1388
- #process;
1389
- #originalProcessEmit;
1390
- #originalProcessReallyExit;
1391
- #sigListeners = {};
1392
- #loaded = false;
1393
- constructor(process7) {
1394
- super();
1395
- this.#process = process7;
1396
- this.#sigListeners = {};
1397
- for (const sig of signals) {
1398
- this.#sigListeners[sig] = () => {
1399
- const listeners = this.#process.listeners(sig);
1400
- let { count } = this.#emitter;
1401
- const p = process7;
1402
- if (typeof p.__signal_exit_emitter__ === "object" && typeof p.__signal_exit_emitter__.count === "number") {
1403
- count += p.__signal_exit_emitter__.count;
1404
- }
1405
- if (listeners.length === count) {
1406
- this.unload();
1407
- const ret = this.#emitter.emit("exit", null, sig);
1408
- const s = sig === "SIGHUP" ? this.#hupSig : sig;
1409
- if (!ret) process7.kill(process7.pid, s);
1410
- }
1411
- };
1412
- }
1413
- this.#originalProcessReallyExit = process7.reallyExit;
1414
- this.#originalProcessEmit = process7.emit;
1415
- }
1416
- onExit(cb, opts) {
1417
- if (!processOk(this.#process)) {
1418
- return () => {
1419
- };
1420
- }
1421
- if (this.#loaded === false) {
1422
- this.load();
1423
- }
1424
- const ev = opts?.alwaysLast ? "afterExit" : "exit";
1425
- this.#emitter.on(ev, cb);
1426
- return () => {
1427
- this.#emitter.removeListener(ev, cb);
1428
- if (this.#emitter.listeners["exit"].length === 0 && this.#emitter.listeners["afterExit"].length === 0) {
1429
- this.unload();
1430
- }
1431
- };
1432
- }
1433
- load() {
1434
- if (this.#loaded) {
1435
- return;
1436
- }
1437
- this.#loaded = true;
1438
- this.#emitter.count += 1;
1439
- for (const sig of signals) {
1440
- try {
1441
- const fn = this.#sigListeners[sig];
1442
- if (fn) this.#process.on(sig, fn);
1443
- } catch (_) {
1444
- }
1445
- }
1446
- this.#process.emit = (ev, ...a) => {
1447
- return this.#processEmit(ev, ...a);
1448
- };
1449
- this.#process.reallyExit = (code) => {
1450
- return this.#processReallyExit(code);
1451
- };
1452
- }
1453
- unload() {
1454
- if (!this.#loaded) {
1455
- return;
1456
- }
1457
- this.#loaded = false;
1458
- signals.forEach((sig) => {
1459
- const listener = this.#sigListeners[sig];
1460
- if (!listener) {
1461
- throw new Error("Listener not defined for signal: " + sig);
1462
- }
1463
- try {
1464
- this.#process.removeListener(sig, listener);
1465
- } catch (_) {
1466
- }
1467
- });
1468
- this.#process.emit = this.#originalProcessEmit;
1469
- this.#process.reallyExit = this.#originalProcessReallyExit;
1470
- this.#emitter.count -= 1;
1471
- }
1472
- #processReallyExit(code) {
1473
- if (!processOk(this.#process)) {
1474
- return 0;
1475
- }
1476
- this.#process.exitCode = code || 0;
1477
- this.#emitter.emit("exit", this.#process.exitCode, null);
1478
- return this.#originalProcessReallyExit.call(this.#process, this.#process.exitCode);
1479
- }
1480
- #processEmit(ev, ...args) {
1481
- const og = this.#originalProcessEmit;
1482
- if (ev === "exit" && processOk(this.#process)) {
1483
- if (typeof args[0] === "number") {
1484
- this.#process.exitCode = args[0];
1485
- }
1486
- const ret = og.call(this.#process, ev, ...args);
1487
- this.#emitter.emit("exit", this.#process.exitCode, null);
1488
- return ret;
1489
- } else {
1490
- return og.call(this.#process, ev, ...args);
1491
- }
1492
- }
1493
- };
1494
- var process4 = globalThis.process;
1495
- var {
1496
- /**
1497
- * Called when the process is exiting, whether via signal, explicit
1498
- * exit, or running out of stuff to do.
1499
- *
1500
- * If the global process object is not suitable for instrumentation,
1501
- * then this will be a no-op.
1502
- *
1503
- * Returns a function that may be used to unload signal-exit.
1504
- */
1505
- onExit,
1506
- /**
1507
- * Load the listeners. Likely you never need to call this, unless
1508
- * doing a rather deep integration with signal-exit functionality.
1509
- * Mostly exposed for the benefit of testing.
1510
- *
1511
- * @internal
1512
- */
1513
- load,
1514
- /**
1515
- * Unload the listeners. Likely you never need to call this, unless
1516
- * doing a rather deep integration with signal-exit functionality.
1517
- * Mostly exposed for the benefit of testing.
1518
- *
1519
- * @internal
1520
- */
1521
- unload
1522
- } = signalExitWrap(processOk(process4) ? new SignalExit(process4) : new SignalExitFallback());
1523
-
1524
- // ../../node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/kill.js
1525
- var DEFAULT_FORCE_KILL_TIMEOUT = 1e3 * 5;
1526
- var spawnedKill = /* @__PURE__ */ __name((kill, signal = "SIGTERM", options = {}) => {
1527
- const killResult = kill(signal);
1528
- setKillTimeout(kill, signal, options, killResult);
1529
- return killResult;
1530
- }, "spawnedKill");
1531
- var setKillTimeout = /* @__PURE__ */ __name((kill, signal, options, killResult) => {
1532
- if (!shouldForceKill(signal, options, killResult)) {
1533
- return;
1534
- }
1535
- const timeout = getForceKillAfterTimeout(options);
1536
- const t = setTimeout(() => {
1537
- kill("SIGKILL");
1538
- }, timeout);
1539
- if (t.unref) {
1540
- t.unref();
1541
- }
1542
- }, "setKillTimeout");
1543
- var shouldForceKill = /* @__PURE__ */ __name((signal, { forceKillAfterTimeout }, killResult) => isSigterm(signal) && forceKillAfterTimeout !== false && killResult, "shouldForceKill");
1544
- var isSigterm = /* @__PURE__ */ __name((signal) => signal === os.constants.signals.SIGTERM || typeof signal === "string" && signal.toUpperCase() === "SIGTERM", "isSigterm");
1545
- var getForceKillAfterTimeout = /* @__PURE__ */ __name(({ forceKillAfterTimeout = true }) => {
1546
- if (forceKillAfterTimeout === true) {
1547
- return DEFAULT_FORCE_KILL_TIMEOUT;
1548
- }
1549
- if (!Number.isFinite(forceKillAfterTimeout) || forceKillAfterTimeout < 0) {
1550
- throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${forceKillAfterTimeout}\` (${typeof forceKillAfterTimeout})`);
1551
- }
1552
- return forceKillAfterTimeout;
1553
- }, "getForceKillAfterTimeout");
1554
- var spawnedCancel = /* @__PURE__ */ __name((spawned, context) => {
1555
- const killResult = spawned.kill();
1556
- if (killResult) {
1557
- context.isCanceled = true;
1558
- }
1559
- }, "spawnedCancel");
1560
- var timeoutKill = /* @__PURE__ */ __name((spawned, signal, reject) => {
1561
- spawned.kill(signal);
1562
- reject(Object.assign(new Error("Timed out"), {
1563
- timedOut: true,
1564
- signal
1565
- }));
1566
- }, "timeoutKill");
1567
- var setupTimeout = /* @__PURE__ */ __name((spawned, { timeout, killSignal = "SIGTERM" }, spawnedPromise) => {
1568
- if (timeout === 0 || timeout === void 0) {
1569
- return spawnedPromise;
1570
- }
1571
- let timeoutId;
1572
- const timeoutPromise = new Promise((resolve, reject) => {
1573
- timeoutId = setTimeout(() => {
1574
- timeoutKill(spawned, killSignal, reject);
1575
- }, timeout);
1576
- });
1577
- const safeSpawnedPromise = spawnedPromise.finally(() => {
1578
- clearTimeout(timeoutId);
1579
- });
1580
- return Promise.race([
1581
- timeoutPromise,
1582
- safeSpawnedPromise
1583
- ]);
1584
- }, "setupTimeout");
1585
- var validateTimeout = /* @__PURE__ */ __name(({ timeout }) => {
1586
- if (timeout !== void 0 && (!Number.isFinite(timeout) || timeout < 0)) {
1587
- throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${timeout}\` (${typeof timeout})`);
1588
- }
1589
- }, "validateTimeout");
1590
- var setExitHandler = /* @__PURE__ */ __name(async (spawned, { cleanup, detached }, timedPromise) => {
1591
- if (!cleanup || detached) {
1592
- return timedPromise;
1593
- }
1594
- const removeExitHandler = onExit(() => {
1595
- spawned.kill();
1596
- });
1597
- return timedPromise.finally(() => {
1598
- removeExitHandler();
1599
- });
1600
- }, "setExitHandler");
1601
-
1602
- // ../../node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/pipe.js
1603
- init_esm_shims();
1604
- import { createWriteStream } from "node:fs";
1605
- import { ChildProcess } from "node:child_process";
1606
-
1607
- // ../../node_modules/.pnpm/is-stream@3.0.0/node_modules/is-stream/index.js
1608
- init_esm_shims();
1609
- function isStream(stream) {
1610
- return stream !== null && typeof stream === "object" && typeof stream.pipe === "function";
1611
- }
1612
- __name(isStream, "isStream");
1613
- function isWritableStream(stream) {
1614
- return isStream(stream) && stream.writable !== false && typeof stream._write === "function" && typeof stream._writableState === "object";
1615
- }
1616
- __name(isWritableStream, "isWritableStream");
1617
-
1618
- // ../../node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/pipe.js
1619
- var isExecaChildProcess = /* @__PURE__ */ __name((target) => target instanceof ChildProcess && typeof target.then === "function", "isExecaChildProcess");
1620
- var pipeToTarget = /* @__PURE__ */ __name((spawned, streamName, target) => {
1621
- if (typeof target === "string") {
1622
- spawned[streamName].pipe(createWriteStream(target));
1623
- return spawned;
1624
- }
1625
- if (isWritableStream(target)) {
1626
- spawned[streamName].pipe(target);
1627
- return spawned;
1628
- }
1629
- if (!isExecaChildProcess(target)) {
1630
- throw new TypeError("The second argument must be a string, a stream or an Execa child process.");
1631
- }
1632
- if (!isWritableStream(target.stdin)) {
1633
- throw new TypeError("The target child process's stdin must be available.");
1634
- }
1635
- spawned[streamName].pipe(target.stdin);
1636
- return target;
1637
- }, "pipeToTarget");
1638
- var addPipeMethods = /* @__PURE__ */ __name((spawned) => {
1639
- if (spawned.stdout !== null) {
1640
- spawned.pipeStdout = pipeToTarget.bind(void 0, spawned, "stdout");
1641
- }
1642
- if (spawned.stderr !== null) {
1643
- spawned.pipeStderr = pipeToTarget.bind(void 0, spawned, "stderr");
1644
- }
1645
- if (spawned.all !== void 0) {
1646
- spawned.pipeAll = pipeToTarget.bind(void 0, spawned, "all");
1647
- }
1648
- }, "addPipeMethods");
1649
-
1650
- // ../../node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/stream.js
1651
- init_esm_shims();
1652
- import { createReadStream, readFileSync } from "node:fs";
1653
- import { setTimeout as setTimeout2 } from "node:timers/promises";
1654
-
1655
- // ../../node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/index.js
1656
- init_esm_shims();
1657
-
1658
- // ../../node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/array.js
1659
- init_esm_shims();
1660
-
1661
- // ../../node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/contents.js
1662
- init_esm_shims();
1663
- var getStreamContents = /* @__PURE__ */ __name(async (stream, { init, convertChunk, getSize, truncateChunk, addChunk, getFinalChunk, finalize }, { maxBuffer = Number.POSITIVE_INFINITY } = {}) => {
1664
- if (!isAsyncIterable(stream)) {
1665
- throw new Error("The first argument must be a Readable, a ReadableStream, or an async iterable.");
1666
- }
1667
- const state = init();
1668
- state.length = 0;
1669
- try {
1670
- for await (const chunk of stream) {
1671
- const chunkType = getChunkType(chunk);
1672
- const convertedChunk = convertChunk[chunkType](chunk, state);
1673
- appendChunk({
1674
- convertedChunk,
1675
- state,
1676
- getSize,
1677
- truncateChunk,
1678
- addChunk,
1679
- maxBuffer
1680
- });
1681
- }
1682
- appendFinalChunk({
1683
- state,
1684
- convertChunk,
1685
- getSize,
1686
- truncateChunk,
1687
- addChunk,
1688
- getFinalChunk,
1689
- maxBuffer
1690
- });
1691
- return finalize(state);
1692
- } catch (error) {
1693
- error.bufferedData = finalize(state);
1694
- throw error;
1695
- }
1696
- }, "getStreamContents");
1697
- var appendFinalChunk = /* @__PURE__ */ __name(({ state, getSize, truncateChunk, addChunk, getFinalChunk, maxBuffer }) => {
1698
- const convertedChunk = getFinalChunk(state);
1699
- if (convertedChunk !== void 0) {
1700
- appendChunk({
1701
- convertedChunk,
1702
- state,
1703
- getSize,
1704
- truncateChunk,
1705
- addChunk,
1706
- maxBuffer
1707
- });
1708
- }
1709
- }, "appendFinalChunk");
1710
- var appendChunk = /* @__PURE__ */ __name(({ convertedChunk, state, getSize, truncateChunk, addChunk, maxBuffer }) => {
1711
- const chunkSize = getSize(convertedChunk);
1712
- const newLength = state.length + chunkSize;
1713
- if (newLength <= maxBuffer) {
1714
- addNewChunk(convertedChunk, state, addChunk, newLength);
1715
- return;
1716
- }
1717
- const truncatedChunk = truncateChunk(convertedChunk, maxBuffer - state.length);
1718
- if (truncatedChunk !== void 0) {
1719
- addNewChunk(truncatedChunk, state, addChunk, maxBuffer);
1720
- }
1721
- throw new MaxBufferError();
1722
- }, "appendChunk");
1723
- var addNewChunk = /* @__PURE__ */ __name((convertedChunk, state, addChunk, newLength) => {
1724
- state.contents = addChunk(convertedChunk, state, newLength);
1725
- state.length = newLength;
1726
- }, "addNewChunk");
1727
- var isAsyncIterable = /* @__PURE__ */ __name((stream) => typeof stream === "object" && stream !== null && typeof stream[Symbol.asyncIterator] === "function", "isAsyncIterable");
1728
- var getChunkType = /* @__PURE__ */ __name((chunk) => {
1729
- const typeOfChunk = typeof chunk;
1730
- if (typeOfChunk === "string") {
1731
- return "string";
1732
- }
1733
- if (typeOfChunk !== "object" || chunk === null) {
1734
- return "others";
1735
- }
1736
- if (globalThis.Buffer?.isBuffer(chunk)) {
1737
- return "buffer";
1738
- }
1739
- const prototypeName = objectToString.call(chunk);
1740
- if (prototypeName === "[object ArrayBuffer]") {
1741
- return "arrayBuffer";
1742
- }
1743
- if (prototypeName === "[object DataView]") {
1744
- return "dataView";
1745
- }
1746
- if (Number.isInteger(chunk.byteLength) && Number.isInteger(chunk.byteOffset) && objectToString.call(chunk.buffer) === "[object ArrayBuffer]") {
1747
- return "typedArray";
1748
- }
1749
- return "others";
1750
- }, "getChunkType");
1751
- var { toString: objectToString } = Object.prototype;
1752
- var MaxBufferError = class extends Error {
1753
- static {
1754
- __name(this, "MaxBufferError");
1755
- }
1756
- name = "MaxBufferError";
1757
- constructor() {
1758
- super("maxBuffer exceeded");
1759
- }
1760
- };
1761
-
1762
- // ../../node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/utils.js
1763
- init_esm_shims();
1764
- var identity = /* @__PURE__ */ __name((value) => value, "identity");
1765
- var noop = /* @__PURE__ */ __name(() => void 0, "noop");
1766
- var getContentsProp = /* @__PURE__ */ __name(({ contents }) => contents, "getContentsProp");
1767
- var throwObjectStream = /* @__PURE__ */ __name((chunk) => {
1768
- throw new Error(`Streams in object mode are not supported: ${String(chunk)}`);
1769
- }, "throwObjectStream");
1770
- var getLengthProp = /* @__PURE__ */ __name((convertedChunk) => convertedChunk.length, "getLengthProp");
1771
-
1772
- // ../../node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/array-buffer.js
1773
- init_esm_shims();
1774
- async function getStreamAsArrayBuffer(stream, options) {
1775
- return getStreamContents(stream, arrayBufferMethods, options);
1776
- }
1777
- __name(getStreamAsArrayBuffer, "getStreamAsArrayBuffer");
1778
- var initArrayBuffer = /* @__PURE__ */ __name(() => ({
1779
- contents: new ArrayBuffer(0)
1780
- }), "initArrayBuffer");
1781
- var useTextEncoder = /* @__PURE__ */ __name((chunk) => textEncoder.encode(chunk), "useTextEncoder");
1782
- var textEncoder = new TextEncoder();
1783
- var useUint8Array = /* @__PURE__ */ __name((chunk) => new Uint8Array(chunk), "useUint8Array");
1784
- var useUint8ArrayWithOffset = /* @__PURE__ */ __name((chunk) => new Uint8Array(chunk.buffer, chunk.byteOffset, chunk.byteLength), "useUint8ArrayWithOffset");
1785
- var truncateArrayBufferChunk = /* @__PURE__ */ __name((convertedChunk, chunkSize) => convertedChunk.slice(0, chunkSize), "truncateArrayBufferChunk");
1786
- var addArrayBufferChunk = /* @__PURE__ */ __name((convertedChunk, { contents, length: previousLength }, length) => {
1787
- const newContents = hasArrayBufferResize() ? resizeArrayBuffer(contents, length) : resizeArrayBufferSlow(contents, length);
1788
- new Uint8Array(newContents).set(convertedChunk, previousLength);
1789
- return newContents;
1790
- }, "addArrayBufferChunk");
1791
- var resizeArrayBufferSlow = /* @__PURE__ */ __name((contents, length) => {
1792
- if (length <= contents.byteLength) {
1793
- return contents;
1794
- }
1795
- const arrayBuffer = new ArrayBuffer(getNewContentsLength(length));
1796
- new Uint8Array(arrayBuffer).set(new Uint8Array(contents), 0);
1797
- return arrayBuffer;
1798
- }, "resizeArrayBufferSlow");
1799
- var resizeArrayBuffer = /* @__PURE__ */ __name((contents, length) => {
1800
- if (length <= contents.maxByteLength) {
1801
- contents.resize(length);
1802
- return contents;
1803
- }
1804
- const arrayBuffer = new ArrayBuffer(length, {
1805
- maxByteLength: getNewContentsLength(length)
1806
- });
1807
- new Uint8Array(arrayBuffer).set(new Uint8Array(contents), 0);
1808
- return arrayBuffer;
1809
- }, "resizeArrayBuffer");
1810
- var getNewContentsLength = /* @__PURE__ */ __name((length) => SCALE_FACTOR ** Math.ceil(Math.log(length) / Math.log(SCALE_FACTOR)), "getNewContentsLength");
1811
- var SCALE_FACTOR = 2;
1812
- var finalizeArrayBuffer = /* @__PURE__ */ __name(({ contents, length }) => hasArrayBufferResize() ? contents : contents.slice(0, length), "finalizeArrayBuffer");
1813
- var hasArrayBufferResize = /* @__PURE__ */ __name(() => "resize" in ArrayBuffer.prototype, "hasArrayBufferResize");
1814
- var arrayBufferMethods = {
1815
- init: initArrayBuffer,
1816
- convertChunk: {
1817
- string: useTextEncoder,
1818
- buffer: useUint8Array,
1819
- arrayBuffer: useUint8Array,
1820
- dataView: useUint8ArrayWithOffset,
1821
- typedArray: useUint8ArrayWithOffset,
1822
- others: throwObjectStream
1823
- },
1824
- getSize: getLengthProp,
1825
- truncateChunk: truncateArrayBufferChunk,
1826
- addChunk: addArrayBufferChunk,
1827
- getFinalChunk: noop,
1828
- finalize: finalizeArrayBuffer
1829
- };
1830
-
1831
- // ../../node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/buffer.js
1832
- init_esm_shims();
1833
- async function getStreamAsBuffer(stream, options) {
1834
- if (!("Buffer" in globalThis)) {
1835
- throw new Error("getStreamAsBuffer() is only supported in Node.js");
1836
- }
1837
- try {
1838
- return arrayBufferToNodeBuffer(await getStreamAsArrayBuffer(stream, options));
1839
- } catch (error) {
1840
- if (error.bufferedData !== void 0) {
1841
- error.bufferedData = arrayBufferToNodeBuffer(error.bufferedData);
1842
- }
1843
- throw error;
1844
- }
1845
- }
1846
- __name(getStreamAsBuffer, "getStreamAsBuffer");
1847
- var arrayBufferToNodeBuffer = /* @__PURE__ */ __name((arrayBuffer) => globalThis.Buffer.from(arrayBuffer), "arrayBufferToNodeBuffer");
1848
-
1849
- // ../../node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/string.js
1850
- init_esm_shims();
1851
- async function getStreamAsString(stream, options) {
1852
- return getStreamContents(stream, stringMethods, options);
1853
- }
1854
- __name(getStreamAsString, "getStreamAsString");
1855
- var initString = /* @__PURE__ */ __name(() => ({
1856
- contents: "",
1857
- textDecoder: new TextDecoder()
1858
- }), "initString");
1859
- var useTextDecoder = /* @__PURE__ */ __name((chunk, { textDecoder }) => textDecoder.decode(chunk, {
1860
- stream: true
1861
- }), "useTextDecoder");
1862
- var addStringChunk = /* @__PURE__ */ __name((convertedChunk, { contents }) => contents + convertedChunk, "addStringChunk");
1863
- var truncateStringChunk = /* @__PURE__ */ __name((convertedChunk, chunkSize) => convertedChunk.slice(0, chunkSize), "truncateStringChunk");
1864
- var getFinalStringChunk = /* @__PURE__ */ __name(({ textDecoder }) => {
1865
- const finalChunk = textDecoder.decode();
1866
- return finalChunk === "" ? void 0 : finalChunk;
1867
- }, "getFinalStringChunk");
1868
- var stringMethods = {
1869
- init: initString,
1870
- convertChunk: {
1871
- string: identity,
1872
- buffer: useTextDecoder,
1873
- arrayBuffer: useTextDecoder,
1874
- dataView: useTextDecoder,
1875
- typedArray: useTextDecoder,
1876
- others: throwObjectStream
1877
- },
1878
- getSize: getLengthProp,
1879
- truncateChunk: truncateStringChunk,
1880
- addChunk: addStringChunk,
1881
- getFinalChunk: getFinalStringChunk,
1882
- finalize: getContentsProp
1883
- };
1884
-
1885
- // ../../node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/stream.js
1886
- var import_merge_stream = __toESM(require_merge_stream(), 1);
1887
- var validateInputOptions = /* @__PURE__ */ __name((input) => {
1888
- if (input !== void 0) {
1889
- throw new TypeError("The `input` and `inputFile` options cannot be both set.");
1890
- }
1891
- }, "validateInputOptions");
1892
- var getInputSync = /* @__PURE__ */ __name(({ input, inputFile }) => {
1893
- if (typeof inputFile !== "string") {
1894
- return input;
1895
- }
1896
- validateInputOptions(input);
1897
- return readFileSync(inputFile);
1898
- }, "getInputSync");
1899
- var handleInputSync = /* @__PURE__ */ __name((options) => {
1900
- const input = getInputSync(options);
1901
- if (isStream(input)) {
1902
- throw new TypeError("The `input` option cannot be a stream in sync mode");
1903
- }
1904
- return input;
1905
- }, "handleInputSync");
1906
- var getInput = /* @__PURE__ */ __name(({ input, inputFile }) => {
1907
- if (typeof inputFile !== "string") {
1908
- return input;
1909
- }
1910
- validateInputOptions(input);
1911
- return createReadStream(inputFile);
1912
- }, "getInput");
1913
- var handleInput = /* @__PURE__ */ __name((spawned, options) => {
1914
- const input = getInput(options);
1915
- if (input === void 0) {
1916
- return;
1917
- }
1918
- if (isStream(input)) {
1919
- input.pipe(spawned.stdin);
1920
- } else {
1921
- spawned.stdin.end(input);
1922
- }
1923
- }, "handleInput");
1924
- var makeAllStream = /* @__PURE__ */ __name((spawned, { all }) => {
1925
- if (!all || !spawned.stdout && !spawned.stderr) {
1926
- return;
1927
- }
1928
- const mixed = (0, import_merge_stream.default)();
1929
- if (spawned.stdout) {
1930
- mixed.add(spawned.stdout);
1931
- }
1932
- if (spawned.stderr) {
1933
- mixed.add(spawned.stderr);
1934
- }
1935
- return mixed;
1936
- }, "makeAllStream");
1937
- var getBufferedData = /* @__PURE__ */ __name(async (stream, streamPromise) => {
1938
- if (!stream || streamPromise === void 0) {
1939
- return;
1940
- }
1941
- await setTimeout2(0);
1942
- stream.destroy();
1943
- try {
1944
- return await streamPromise;
1945
- } catch (error) {
1946
- return error.bufferedData;
1947
- }
1948
- }, "getBufferedData");
1949
- var getStreamPromise = /* @__PURE__ */ __name((stream, { encoding, buffer, maxBuffer }) => {
1950
- if (!stream || !buffer) {
1951
- return;
1952
- }
1953
- if (encoding === "utf8" || encoding === "utf-8") {
1954
- return getStreamAsString(stream, {
1955
- maxBuffer
1956
- });
1957
- }
1958
- if (encoding === null || encoding === "buffer") {
1959
- return getStreamAsBuffer(stream, {
1960
- maxBuffer
1961
- });
1962
- }
1963
- return applyEncoding(stream, maxBuffer, encoding);
1964
- }, "getStreamPromise");
1965
- var applyEncoding = /* @__PURE__ */ __name(async (stream, maxBuffer, encoding) => {
1966
- const buffer = await getStreamAsBuffer(stream, {
1967
- maxBuffer
1968
- });
1969
- return buffer.toString(encoding);
1970
- }, "applyEncoding");
1971
- var getSpawnedResult = /* @__PURE__ */ __name(async ({ stdout, stderr, all }, { encoding, buffer, maxBuffer }, processDone) => {
1972
- const stdoutPromise = getStreamPromise(stdout, {
1973
- encoding,
1974
- buffer,
1975
- maxBuffer
1976
- });
1977
- const stderrPromise = getStreamPromise(stderr, {
1978
- encoding,
1979
- buffer,
1980
- maxBuffer
1981
- });
1982
- const allPromise = getStreamPromise(all, {
1983
- encoding,
1984
- buffer,
1985
- maxBuffer: maxBuffer * 2
1986
- });
1987
- try {
1988
- return await Promise.all([
1989
- processDone,
1990
- stdoutPromise,
1991
- stderrPromise,
1992
- allPromise
1993
- ]);
1994
- } catch (error) {
1995
- return Promise.all([
1996
- {
1997
- error,
1998
- signal: error.signal,
1999
- timedOut: error.timedOut
2000
- },
2001
- getBufferedData(stdout, stdoutPromise),
2002
- getBufferedData(stderr, stderrPromise),
2003
- getBufferedData(all, allPromise)
2004
- ]);
2005
- }
2006
- }, "getSpawnedResult");
2007
-
2008
- // ../../node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/promise.js
2009
- init_esm_shims();
2010
- var nativePromisePrototype = (async () => {
2011
- })().constructor.prototype;
2012
- var descriptors = [
2013
- "then",
2014
- "catch",
2015
- "finally"
2016
- ].map((property) => [
2017
- property,
2018
- Reflect.getOwnPropertyDescriptor(nativePromisePrototype, property)
2019
- ]);
2020
- var mergePromise = /* @__PURE__ */ __name((spawned, promise) => {
2021
- for (const [property, descriptor] of descriptors) {
2022
- const value = typeof promise === "function" ? (...args) => Reflect.apply(descriptor.value, promise(), args) : descriptor.value.bind(promise);
2023
- Reflect.defineProperty(spawned, property, {
2024
- ...descriptor,
2025
- value
2026
- });
2027
- }
2028
- }, "mergePromise");
2029
- var getSpawnedPromise = /* @__PURE__ */ __name((spawned) => new Promise((resolve, reject) => {
2030
- spawned.on("exit", (exitCode, signal) => {
2031
- resolve({
2032
- exitCode,
2033
- signal
2034
- });
2035
- });
2036
- spawned.on("error", (error) => {
2037
- reject(error);
2038
- });
2039
- if (spawned.stdin) {
2040
- spawned.stdin.on("error", (error) => {
2041
- reject(error);
2042
- });
2043
- }
2044
- }), "getSpawnedPromise");
2045
-
2046
- // ../../node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/command.js
2047
- init_esm_shims();
2048
- import { Buffer as Buffer2 } from "node:buffer";
2049
- import { ChildProcess as ChildProcess2 } from "node:child_process";
2050
- var normalizeArgs = /* @__PURE__ */ __name((file, args = []) => {
2051
- if (!Array.isArray(args)) {
2052
- return [
2053
- file
2054
- ];
2055
- }
2056
- return [
2057
- file,
2058
- ...args
2059
- ];
2060
- }, "normalizeArgs");
2061
- var NO_ESCAPE_REGEXP = /^[\w.-]+$/;
2062
- var escapeArg = /* @__PURE__ */ __name((arg) => {
2063
- if (typeof arg !== "string" || NO_ESCAPE_REGEXP.test(arg)) {
2064
- return arg;
2065
- }
2066
- return `"${arg.replaceAll('"', '\\"')}"`;
2067
- }, "escapeArg");
2068
- var joinCommand = /* @__PURE__ */ __name((file, args) => normalizeArgs(file, args).join(" "), "joinCommand");
2069
- var getEscapedCommand = /* @__PURE__ */ __name((file, args) => normalizeArgs(file, args).map((arg) => escapeArg(arg)).join(" "), "getEscapedCommand");
2070
- var SPACES_REGEXP = / +/g;
2071
- var parseCommand = /* @__PURE__ */ __name((command) => {
2072
- const tokens = [];
2073
- for (const token of command.trim().split(SPACES_REGEXP)) {
2074
- const previousToken = tokens.at(-1);
2075
- if (previousToken && previousToken.endsWith("\\")) {
2076
- tokens[tokens.length - 1] = `${previousToken.slice(0, -1)} ${token}`;
2077
- } else {
2078
- tokens.push(token);
2079
- }
2080
- }
2081
- return tokens;
2082
- }, "parseCommand");
2083
- var parseExpression = /* @__PURE__ */ __name((expression) => {
2084
- const typeOfExpression = typeof expression;
2085
- if (typeOfExpression === "string") {
2086
- return expression;
2087
- }
2088
- if (typeOfExpression === "number") {
2089
- return String(expression);
2090
- }
2091
- if (typeOfExpression === "object" && expression !== null && !(expression instanceof ChildProcess2) && "stdout" in expression) {
2092
- const typeOfStdout = typeof expression.stdout;
2093
- if (typeOfStdout === "string") {
2094
- return expression.stdout;
2095
- }
2096
- if (Buffer2.isBuffer(expression.stdout)) {
2097
- return expression.stdout.toString();
2098
- }
2099
- throw new TypeError(`Unexpected "${typeOfStdout}" stdout in template expression`);
2100
- }
2101
- throw new TypeError(`Unexpected "${typeOfExpression}" in template expression`);
2102
- }, "parseExpression");
2103
- var concatTokens = /* @__PURE__ */ __name((tokens, nextTokens, isNew) => isNew || tokens.length === 0 || nextTokens.length === 0 ? [
2104
- ...tokens,
2105
- ...nextTokens
2106
- ] : [
2107
- ...tokens.slice(0, -1),
2108
- `${tokens.at(-1)}${nextTokens[0]}`,
2109
- ...nextTokens.slice(1)
2110
- ], "concatTokens");
2111
- var parseTemplate = /* @__PURE__ */ __name(({ templates, expressions, tokens, index, template }) => {
2112
- const templateString = template ?? templates.raw[index];
2113
- const templateTokens = templateString.split(SPACES_REGEXP).filter(Boolean);
2114
- const newTokens = concatTokens(tokens, templateTokens, templateString.startsWith(" "));
2115
- if (index === expressions.length) {
2116
- return newTokens;
2117
- }
2118
- const expression = expressions[index];
2119
- const expressionTokens = Array.isArray(expression) ? expression.map((expression2) => parseExpression(expression2)) : [
2120
- parseExpression(expression)
2121
- ];
2122
- return concatTokens(newTokens, expressionTokens, templateString.endsWith(" "));
2123
- }, "parseTemplate");
2124
- var parseTemplates = /* @__PURE__ */ __name((templates, expressions) => {
2125
- let tokens = [];
2126
- for (const [index, template] of templates.entries()) {
2127
- tokens = parseTemplate({
2128
- templates,
2129
- expressions,
2130
- tokens,
2131
- index,
2132
- template
2133
- });
2134
- }
2135
- return tokens;
2136
- }, "parseTemplates");
2137
-
2138
- // ../../node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/verbose.js
2139
- init_esm_shims();
2140
- import { debuglog } from "node:util";
2141
- import process5 from "node:process";
2142
- var verboseDefault = debuglog("execa").enabled;
2143
- var padField = /* @__PURE__ */ __name((field, padding) => String(field).padStart(padding, "0"), "padField");
2144
- var getTimestamp = /* @__PURE__ */ __name(() => {
2145
- const date = /* @__PURE__ */ new Date();
2146
- return `${padField(date.getHours(), 2)}:${padField(date.getMinutes(), 2)}:${padField(date.getSeconds(), 2)}.${padField(date.getMilliseconds(), 3)}`;
2147
- }, "getTimestamp");
2148
- var logCommand = /* @__PURE__ */ __name((escapedCommand, { verbose }) => {
2149
- if (!verbose) {
2150
- return;
2151
- }
2152
- process5.stderr.write(`[${getTimestamp()}] ${escapedCommand}
2153
- `);
2154
- }, "logCommand");
2155
-
2156
- // ../../node_modules/.pnpm/execa@8.0.1/node_modules/execa/index.js
2157
- var DEFAULT_MAX_BUFFER = 1e3 * 1e3 * 100;
2158
- var getEnv = /* @__PURE__ */ __name(({ env: envOption, extendEnv, preferLocal, localDir, execPath }) => {
2159
- const env = extendEnv ? {
2160
- ...process6.env,
2161
- ...envOption
2162
- } : envOption;
2163
- if (preferLocal) {
2164
- return npmRunPathEnv({
2165
- env,
2166
- cwd: localDir,
2167
- execPath
2168
- });
2169
- }
2170
- return env;
2171
- }, "getEnv");
2172
- var handleArguments = /* @__PURE__ */ __name((file, args, options = {}) => {
2173
- const parsed = import_cross_spawn.default._parse(file, args, options);
2174
- file = parsed.command;
2175
- args = parsed.args;
2176
- options = parsed.options;
2177
- options = {
2178
- maxBuffer: DEFAULT_MAX_BUFFER,
2179
- buffer: true,
2180
- stripFinalNewline: true,
2181
- extendEnv: true,
2182
- preferLocal: false,
2183
- localDir: options.cwd || process6.cwd(),
2184
- execPath: process6.execPath,
2185
- encoding: "utf8",
2186
- reject: true,
2187
- cleanup: true,
2188
- all: false,
2189
- windowsHide: true,
2190
- verbose: verboseDefault,
2191
- ...options
2192
- };
2193
- options.env = getEnv(options);
2194
- options.stdio = normalizeStdio(options);
2195
- if (process6.platform === "win32" && path2.basename(file, ".exe") === "cmd") {
2196
- args.unshift("/q");
2197
- }
2198
- return {
2199
- file,
2200
- args,
2201
- options,
2202
- parsed
2203
- };
2204
- }, "handleArguments");
2205
- var handleOutput = /* @__PURE__ */ __name((options, value, error) => {
2206
- if (typeof value !== "string" && !Buffer3.isBuffer(value)) {
2207
- return error === void 0 ? void 0 : "";
2208
- }
2209
- if (options.stripFinalNewline) {
2210
- return stripFinalNewline(value);
2211
- }
2212
- return value;
2213
- }, "handleOutput");
2214
- function execa(file, args, options) {
2215
- const parsed = handleArguments(file, args, options);
2216
- const command = joinCommand(file, args);
2217
- const escapedCommand = getEscapedCommand(file, args);
2218
- logCommand(escapedCommand, parsed.options);
2219
- validateTimeout(parsed.options);
2220
- let spawned;
2221
- try {
2222
- spawned = childProcess.spawn(parsed.file, parsed.args, parsed.options);
2223
- } catch (error) {
2224
- const dummySpawned = new childProcess.ChildProcess();
2225
- const errorPromise = Promise.reject(makeError({
2226
- error,
2227
- stdout: "",
2228
- stderr: "",
2229
- all: "",
2230
- command,
2231
- escapedCommand,
2232
- parsed,
2233
- timedOut: false,
2234
- isCanceled: false,
2235
- killed: false
2236
- }));
2237
- mergePromise(dummySpawned, errorPromise);
2238
- return dummySpawned;
2239
- }
2240
- const spawnedPromise = getSpawnedPromise(spawned);
2241
- const timedPromise = setupTimeout(spawned, parsed.options, spawnedPromise);
2242
- const processDone = setExitHandler(spawned, parsed.options, timedPromise);
2243
- const context = {
2244
- isCanceled: false
2245
- };
2246
- spawned.kill = spawnedKill.bind(null, spawned.kill.bind(spawned));
2247
- spawned.cancel = spawnedCancel.bind(null, spawned, context);
2248
- const handlePromise = /* @__PURE__ */ __name(async () => {
2249
- const [{ error, exitCode, signal, timedOut }, stdoutResult, stderrResult, allResult] = await getSpawnedResult(spawned, parsed.options, processDone);
2250
- const stdout = handleOutput(parsed.options, stdoutResult);
2251
- const stderr = handleOutput(parsed.options, stderrResult);
2252
- const all = handleOutput(parsed.options, allResult);
2253
- if (error || exitCode !== 0 || signal !== null) {
2254
- const returnedError = makeError({
2255
- error,
2256
- exitCode,
2257
- signal,
2258
- stdout,
2259
- stderr,
2260
- all,
2261
- command,
2262
- escapedCommand,
2263
- parsed,
2264
- timedOut,
2265
- isCanceled: context.isCanceled || (parsed.options.signal ? parsed.options.signal.aborted : false),
2266
- killed: spawned.killed
2267
- });
2268
- if (!parsed.options.reject) {
2269
- return returnedError;
2270
- }
2271
- throw returnedError;
2272
- }
2273
- return {
2274
- command,
2275
- escapedCommand,
2276
- exitCode: 0,
2277
- stdout,
2278
- stderr,
2279
- all,
2280
- failed: false,
2281
- timedOut: false,
2282
- isCanceled: false,
2283
- killed: false
2284
- };
2285
- }, "handlePromise");
2286
- const handlePromiseOnce = onetime_default(handlePromise);
2287
- handleInput(spawned, parsed.options);
2288
- spawned.all = makeAllStream(spawned, parsed.options);
2289
- addPipeMethods(spawned);
2290
- mergePromise(spawned, handlePromiseOnce);
2291
- return spawned;
2292
- }
2293
- __name(execa, "execa");
2294
- function execaSync(file, args, options) {
2295
- const parsed = handleArguments(file, args, options);
2296
- const command = joinCommand(file, args);
2297
- const escapedCommand = getEscapedCommand(file, args);
2298
- logCommand(escapedCommand, parsed.options);
2299
- const input = handleInputSync(parsed.options);
2300
- let result;
2301
- try {
2302
- result = childProcess.spawnSync(parsed.file, parsed.args, {
2303
- ...parsed.options,
2304
- input
2305
- });
2306
- } catch (error) {
2307
- throw makeError({
2308
- error,
2309
- stdout: "",
2310
- stderr: "",
2311
- all: "",
2312
- command,
2313
- escapedCommand,
2314
- parsed,
2315
- timedOut: false,
2316
- isCanceled: false,
2317
- killed: false
2318
- });
2319
- }
2320
- const stdout = handleOutput(parsed.options, result.stdout, result.error);
2321
- const stderr = handleOutput(parsed.options, result.stderr, result.error);
2322
- if (result.error || result.status !== 0 || result.signal !== null) {
2323
- const error = makeError({
2324
- stdout,
2325
- stderr,
2326
- error: result.error,
2327
- signal: result.signal,
2328
- exitCode: result.status,
2329
- command,
2330
- escapedCommand,
2331
- parsed,
2332
- timedOut: result.error && result.error.code === "ETIMEDOUT",
2333
- isCanceled: false,
2334
- killed: result.signal !== null
2335
- });
2336
- if (!parsed.options.reject) {
2337
- return error;
2338
- }
2339
- throw error;
2340
- }
2341
- return {
2342
- command,
2343
- escapedCommand,
2344
- exitCode: 0,
2345
- stdout,
2346
- stderr,
2347
- failed: false,
2348
- timedOut: false,
2349
- isCanceled: false,
2350
- killed: false
2351
- };
2352
- }
2353
- __name(execaSync, "execaSync");
2354
- var normalizeScriptStdin = /* @__PURE__ */ __name(({ input, inputFile, stdio }) => input === void 0 && inputFile === void 0 && stdio === void 0 ? {
2355
- stdin: "inherit"
2356
- } : {}, "normalizeScriptStdin");
2357
- var normalizeScriptOptions = /* @__PURE__ */ __name((options = {}) => ({
2358
- preferLocal: true,
2359
- ...normalizeScriptStdin(options),
2360
- ...options
2361
- }), "normalizeScriptOptions");
2362
- function create$(options) {
2363
- function $2(templatesOrOptions, ...expressions) {
2364
- if (!Array.isArray(templatesOrOptions)) {
2365
- return create$({
2366
- ...options,
2367
- ...templatesOrOptions
2368
- });
2369
- }
2370
- const [file, ...args] = parseTemplates(templatesOrOptions, expressions);
2371
- return execa(file, args, normalizeScriptOptions(options));
2372
- }
2373
- __name($2, "$");
2374
- $2.sync = (templates, ...expressions) => {
2375
- if (!Array.isArray(templates)) {
2376
- throw new TypeError("Please use $(options).sync`command` instead of $.sync(options)`command`.");
2377
- }
2378
- const [file, ...args] = parseTemplates(templates, expressions);
2379
- return execaSync(file, args, normalizeScriptOptions(options));
2380
- };
2381
- return $2;
2382
- }
2383
- __name(create$, "create$");
2384
- var $ = create$();
2385
- function execaCommand(command, options) {
2386
- const [file, ...args] = parseCommand(command);
2387
- return execa(file, args, options);
2388
- }
2389
- __name(execaCommand, "execaCommand");
2390
- function execaCommandSync(command, options) {
2391
- const [file, ...args] = parseCommand(command);
2392
- return execaSync(file, args, options);
2393
- }
2394
- __name(execaCommandSync, "execaCommandSync");
2395
- function execaNode(scriptPath, args, options = {}) {
2396
- if (args && !Array.isArray(args) && typeof args === "object") {
2397
- options = args;
2398
- args = [];
2399
- }
2400
- const stdio = normalizeStdioNode(options);
2401
- const defaultExecArgv = process6.execArgv.filter((arg) => !arg.startsWith("--inspect"));
2402
- const { nodePath = process6.execPath, nodeOptions = defaultExecArgv } = options;
2403
- return execa(nodePath, [
2404
- ...nodeOptions,
2405
- scriptPath,
2406
- ...Array.isArray(args) ? args : []
2407
- ], {
2408
- ...options,
2409
- stdin: void 0,
2410
- stdout: void 0,
2411
- stderr: void 0,
2412
- stdio,
2413
- shell: false
2414
- });
2415
- }
2416
- __name(execaNode, "execaNode");
2417
- export {
2418
- $,
2419
- execa,
2420
- execaCommand,
2421
- execaCommandSync,
2422
- execaNode,
2423
- execaSync
2424
- };