@shopify/cli 3.68.1 → 3.69.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. package/dist/assets/graphiql/style.css +58 -0
  2. package/dist/assets/hydrogen/starter/CHANGELOG.md +19 -0
  3. package/dist/assets/hydrogen/starter/app/components/Aside.tsx +24 -1
  4. package/dist/assets/hydrogen/starter/app/components/Header.tsx +13 -6
  5. package/dist/assets/hydrogen/starter/app/components/PageLayout.tsx +5 -3
  6. package/dist/assets/hydrogen/starter/app/components/SearchResultsPredictive.tsx +10 -25
  7. package/dist/assets/hydrogen/starter/app/routes/account.orders.$id.tsx +3 -1
  8. package/dist/assets/hydrogen/starter/package.json +4 -4
  9. package/dist/{chokidar-4TKDAB27.js → chokidar-OESTCX4H.js} +571 -8
  10. package/dist/{chunk-BFQFJ7IZ.js → chunk-27ILOE3X.js} +93 -5
  11. package/dist/{chunk-X4VIZNM7.js → chunk-4P6VDKXH.js} +2 -2
  12. package/dist/{chunk-6RT7XCLB.js → chunk-4UO6LFBD.js} +5 -5
  13. package/dist/{chunk-SFSTMK3J.js → chunk-5W3WRWHE.js} +3 -3
  14. package/dist/{chunk-MS2XBA2O.js → chunk-7SCNBKRX.js} +7 -7
  15. package/dist/{chunk-LAPJDMM4.js → chunk-A3JXD7N7.js} +2 -2
  16. package/dist/{chunk-N2B5M33U.js → chunk-CH6PR2VT.js} +3 -3
  17. package/dist/{chunk-SARPUMOJ.js → chunk-DQISYPN6.js} +4 -4
  18. package/dist/{chunk-3Q52FLVU.js → chunk-DYVC757D.js} +3 -3
  19. package/dist/{chunk-EPBXQ43B.js → chunk-E4FPHMGU.js} +8 -8
  20. package/dist/{chunk-JEUAVIWO.js → chunk-EFRDEP5S.js} +76 -77
  21. package/dist/{chunk-QNE3KDXA.js → chunk-EL4JXI6O.js} +2 -2
  22. package/dist/{chunk-CLB5CEKJ.js → chunk-ERVB6ERU.js} +3 -3
  23. package/dist/{chunk-NPVFC3AI.js → chunk-ITNHP733.js} +4 -4
  24. package/dist/{chunk-O2TXYCMU.js → chunk-JECUABVU.js} +3 -3
  25. package/dist/{chunk-S3KCQ67R.js → chunk-K55EL7HQ.js} +11 -11
  26. package/dist/{chunk-6H3CV7RL.js → chunk-KIVJKHH4.js} +3 -3
  27. package/dist/{chunk-V54N7BU5.js → chunk-KOQHK34U.js} +3 -3
  28. package/dist/{chunk-6MAEOVS3.js → chunk-KWVMII6E.js} +3 -3
  29. package/dist/{chunk-XPDRDFSD.js → chunk-KXCAVMHA.js} +3 -3
  30. package/dist/{chunk-6ZDQFSSJ.js → chunk-LQ7IL4AX.js} +142 -860
  31. package/dist/{chunk-M7RWRKXK.js → chunk-LSXK7YFC.js} +4 -4
  32. package/dist/{chunk-YESRKQ2L.js → chunk-LXEX6UNB.js} +2 -2
  33. package/dist/{chunk-F27QYMO7.js → chunk-MX4RJDBM.js} +591 -20
  34. package/dist/{chunk-ZFVK6EQX.js → chunk-NB4NLOEJ.js} +142 -703
  35. package/dist/{chunk-RUY5HVC5.js → chunk-OA6RDR4W.js} +2 -2
  36. package/dist/{chunk-QAP5YFY6.js → chunk-OFSGLPHJ.js} +2 -2
  37. package/dist/{chunk-NZDBLGNM.js → chunk-P7JUHQKL.js} +1 -2
  38. package/dist/{chunk-3M35CLHM.js → chunk-PZSU4QTH.js} +2 -2
  39. package/dist/{chunk-GLV27A4V.js → chunk-SS3JYL5S.js} +2 -2
  40. package/dist/{chunk-HWFFJANJ.js → chunk-SSVHNTMB.js} +3 -3
  41. package/dist/{chunk-7MDO7W7X.js → chunk-TM426SS3.js} +3 -3
  42. package/dist/{chunk-NOB736ZC.js → chunk-TODOEE5F.js} +3 -3
  43. package/dist/{chunk-7S76TS4X.js → chunk-TRFLZOJU.js} +5 -5
  44. package/dist/{chunk-72AFLINH.js → chunk-VSXWSKVK.js} +4 -4
  45. package/dist/{chunk-YGWIVVUL.js → chunk-VUQJSBXL.js} +161 -39
  46. package/dist/{chunk-GKSNOFYA.js → chunk-WOBGT6C6.js} +2 -2
  47. package/dist/{chunk-BZ2F2UZZ.js → chunk-YEITDZ7O.js} +4 -4
  48. package/dist/{chunk-JF3XJON5.js → chunk-YV6SWFDE.js} +5 -5
  49. package/dist/{chunk-43SYBNY3.js → chunk-ZKXBLV2V.js} +4 -4
  50. package/dist/cli/commands/auth/logout.js +15 -17
  51. package/dist/cli/commands/auth/logout.test.js +16 -18
  52. package/dist/cli/commands/debug/command-flags.js +14 -16
  53. package/dist/cli/commands/demo/catalog.js +15 -17
  54. package/dist/cli/commands/demo/generate-file.js +15 -17
  55. package/dist/cli/commands/demo/index.js +15 -17
  56. package/dist/cli/commands/demo/print-ai-prompt.js +15 -17
  57. package/dist/cli/commands/docs/generate.js +14 -16
  58. package/dist/cli/commands/docs/generate.test.js +14 -16
  59. package/dist/cli/commands/help.js +14 -16
  60. package/dist/cli/commands/kitchen-sink/async.js +15 -17
  61. package/dist/cli/commands/kitchen-sink/async.test.js +15 -17
  62. package/dist/cli/commands/kitchen-sink/index.js +17 -19
  63. package/dist/cli/commands/kitchen-sink/index.test.js +17 -19
  64. package/dist/cli/commands/kitchen-sink/prompts.js +15 -17
  65. package/dist/cli/commands/kitchen-sink/prompts.test.js +15 -17
  66. package/dist/cli/commands/kitchen-sink/static.js +15 -17
  67. package/dist/cli/commands/kitchen-sink/static.test.js +15 -17
  68. package/dist/cli/commands/search.js +15 -17
  69. package/dist/cli/commands/upgrade.js +15 -17
  70. package/dist/cli/commands/version.js +15 -17
  71. package/dist/cli/commands/version.test.js +15 -17
  72. package/dist/cli/services/commands/search.js +7 -9
  73. package/dist/cli/services/commands/search.test.js +7 -9
  74. package/dist/cli/services/commands/version.js +8 -10
  75. package/dist/cli/services/commands/version.test.js +9 -11
  76. package/dist/cli/services/demo.js +7 -9
  77. package/dist/cli/services/demo.test.js +7 -9
  78. package/dist/cli/services/kitchen-sink/async.js +7 -9
  79. package/dist/cli/services/kitchen-sink/prompts.js +7 -9
  80. package/dist/cli/services/kitchen-sink/static.js +7 -9
  81. package/dist/cli/services/upgrade.js +8 -10
  82. package/dist/cli/services/upgrade.test.js +10 -12
  83. package/dist/{constants-TR6ABVLJ.js → constants-T7JXE5K7.js} +2 -2
  84. package/dist/{custom-oclif-loader-KLQXTO4F.js → custom-oclif-loader-ETQSAFQG.js} +9 -11
  85. package/dist/{del-EL3PLWCY.js → del-7ZS2Z64N.js} +4 -4
  86. package/dist/{error-handler-5FD7IHCB.js → error-handler-ITARI4R7.js} +13 -15
  87. package/dist/hooks/postrun.js +14 -15
  88. package/dist/hooks/prerun.js +12 -14
  89. package/dist/index.js +4496 -3687
  90. package/dist/{lib-4WCTNKJK.js → lib-JHUCJTHS.js} +5 -6
  91. package/dist/{local-LNHYBD2A.js → local-JOQLVNNB.js} +7 -11
  92. package/dist/{morph-WDFBUXWF.js → morph-QZYXTRWT.js} +11 -11
  93. package/dist/{node-Y6VIULWD.js → node-XBEXHDBO.js} +18 -20
  94. package/dist/{node-package-manager-6CQ6226U.js → node-package-manager-EQM2DXHD.js} +8 -10
  95. package/dist/out-ZDSLKX4N.js +7 -0
  96. package/dist/{system-LDMV4BPS.js → system-VHEQK233.js} +7 -9
  97. package/dist/tsconfig.tsbuildinfo +1 -1
  98. package/dist/{ui-PA5ER7II.js → ui-SWA4K4YR.js} +7 -9
  99. package/dist/{workerd-APENUASI.js → workerd-QAI4NP7E.js} +17 -19
  100. package/oclif.manifest.json +30 -49
  101. package/package.json +19 -8
  102. package/dist/assets/auth-error.html +0 -23
  103. package/dist/assets/empty-url.html +0 -23
  104. package/dist/assets/favicon.svg +0 -26
  105. package/dist/assets/missing-code.html +0 -23
  106. package/dist/assets/missing-state.html +0 -23
  107. package/dist/assets/style.css +0 -58
  108. package/dist/assets/success.html +0 -20
  109. package/dist/chunk-2AW6NZQ5.js +0 -101
  110. package/dist/chunk-QETDXAFX.js +0 -106
  111. package/dist/lib-H3ZZGS7I.js +0 -1322
  112. package/dist/out-66YUO4CT.js +0 -7
  113. package/dist/templates/theme-extension/assets/thumbs-up.png +0 -0
  114. package/dist/templates/theme-extension/blocks/star_rating.liquid.raw +0 -21
  115. package/dist/templates/theme-extension/locales/en.default.json +0 -10
  116. package/dist/templates/theme-extension/shopify.extension.toml.liquid +0 -3
  117. package/dist/templates/theme-extension/snippets/stars.liquid.raw +0 -10
  118. package/dist/templates/ui-extensions/projects/product_subscription/package.json.liquid +0 -25
  119. package/dist/templates/ui-extensions/projects/product_subscription/shopify.extension.toml.liquid +0 -3
  120. package/dist/templates/ui-extensions/projects/product_subscription/src/index.liquid +0 -46
  121. package/dist/templates/ui-extensions/projects/web_pixel_extension/README.md +0 -23
  122. package/dist/templates/ui-extensions/projects/web_pixel_extension/package.json.liquid +0 -9
  123. package/dist/templates/ui-extensions/projects/web_pixel_extension/shopify.extension.toml.liquid +0 -16
  124. package/dist/templates/ui-extensions/projects/web_pixel_extension/src/index.liquid +0 -10
@@ -1,1322 +0,0 @@
1
- import {
2
- require_signal_exit
3
- } from "./chunk-QETDXAFX.js";
4
- import {
5
- require_isexe
6
- } from "./chunk-2AW6NZQ5.js";
7
- import {
8
- __commonJS,
9
- __require,
10
- init_cjs_shims
11
- } from "./chunk-POZ5MGPT.js";
12
-
13
- // ../../node_modules/.pnpm/kill-port-process@3.1.0/node_modules/kill-port-process/dist/lib/helpers.js
14
- var require_helpers = __commonJS({
15
- "../../node_modules/.pnpm/kill-port-process@3.1.0/node_modules/kill-port-process/dist/lib/helpers.js"(exports) {
16
- "use strict";
17
- init_cjs_shims();
18
- Object.defineProperty(exports, "__esModule", { value: !0 });
19
- exports.mergeOptions = exports.arrayifyInput = exports.isNullOrUndefined = void 0;
20
- function isNullOrUndefined(input) {
21
- return input == null;
22
- }
23
- exports.isNullOrUndefined = isNullOrUndefined;
24
- function arrayifyInput(input) {
25
- return Array.isArray(input) ? input : [input];
26
- }
27
- exports.arrayifyInput = arrayifyInput;
28
- function mergeOptions(options) {
29
- return Object.assign(Object.assign({}, {
30
- signal: "SIGKILL"
31
- }), options);
32
- }
33
- exports.mergeOptions = mergeOptions;
34
- }
35
- });
36
-
37
- // ../../node_modules/.pnpm/which@1.3.1/node_modules/which/which.js
38
- var require_which = __commonJS({
39
- "../../node_modules/.pnpm/which@1.3.1/node_modules/which/which.js"(exports, module) {
40
- init_cjs_shims();
41
- module.exports = which;
42
- which.sync = whichSync;
43
- var isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys", path = __require("path"), COLON = isWindows ? ";" : ":", isexe = require_isexe();
44
- function getNotFoundError(cmd) {
45
- var er = new Error("not found: " + cmd);
46
- return er.code = "ENOENT", er;
47
- }
48
- function getPathInfo(cmd, opt) {
49
- var colon = opt.colon || COLON, pathEnv = opt.path || process.env.PATH || "", pathExt = [""];
50
- pathEnv = pathEnv.split(colon);
51
- var pathExtExe = "";
52
- return isWindows && (pathEnv.unshift(process.cwd()), pathExtExe = opt.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM", pathExt = pathExtExe.split(colon), cmd.indexOf(".") !== -1 && pathExt[0] !== "" && pathExt.unshift("")), (cmd.match(/\//) || isWindows && cmd.match(/\\/)) && (pathEnv = [""]), {
53
- env: pathEnv,
54
- ext: pathExt,
55
- extExe: pathExtExe
56
- };
57
- }
58
- function which(cmd, opt, cb) {
59
- typeof opt == "function" && (cb = opt, opt = {});
60
- var info = getPathInfo(cmd, opt), pathEnv = info.env, pathExt = info.ext, pathExtExe = info.extExe, found = [];
61
- (function F(i, l) {
62
- if (i === l)
63
- return opt.all && found.length ? cb(null, found) : cb(getNotFoundError(cmd));
64
- var pathPart = pathEnv[i];
65
- pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"' && (pathPart = pathPart.slice(1, -1));
66
- var p = path.join(pathPart, cmd);
67
- !pathPart && /^\.[\\\/]/.test(cmd) && (p = cmd.slice(0, 2) + p), function E(ii, ll) {
68
- if (ii === ll)
69
- return F(i + 1, l);
70
- var ext = pathExt[ii];
71
- isexe(p + ext, { pathExt: pathExtExe }, function(er, is) {
72
- if (!er && is)
73
- if (opt.all)
74
- found.push(p + ext);
75
- else
76
- return cb(null, p + ext);
77
- return E(ii + 1, ll);
78
- });
79
- }(0, pathExt.length);
80
- })(0, pathEnv.length);
81
- }
82
- function whichSync(cmd, opt) {
83
- opt = opt || {};
84
- for (var info = getPathInfo(cmd, opt), pathEnv = info.env, pathExt = info.ext, pathExtExe = info.extExe, found = [], i = 0, l = pathEnv.length; i < l; i++) {
85
- var pathPart = pathEnv[i];
86
- pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"' && (pathPart = pathPart.slice(1, -1));
87
- var p = path.join(pathPart, cmd);
88
- !pathPart && /^\.[\\\/]/.test(cmd) && (p = cmd.slice(0, 2) + p);
89
- for (var j = 0, ll = pathExt.length; j < ll; j++) {
90
- var cur = p + pathExt[j], is;
91
- try {
92
- if (is = isexe.sync(cur, { pathExt: pathExtExe }), is)
93
- if (opt.all)
94
- found.push(cur);
95
- else
96
- return cur;
97
- } catch {
98
- }
99
- }
100
- }
101
- if (opt.all && found.length)
102
- return found;
103
- if (opt.nothrow)
104
- return null;
105
- throw getNotFoundError(cmd);
106
- }
107
- }
108
- });
109
-
110
- // ../../node_modules/.pnpm/pseudomap@1.0.2/node_modules/pseudomap/pseudomap.js
111
- var require_pseudomap = __commonJS({
112
- "../../node_modules/.pnpm/pseudomap@1.0.2/node_modules/pseudomap/pseudomap.js"(exports, module) {
113
- init_cjs_shims();
114
- var hasOwnProperty = Object.prototype.hasOwnProperty;
115
- module.exports = PseudoMap;
116
- function PseudoMap(set2) {
117
- if (!(this instanceof PseudoMap))
118
- throw new TypeError("Constructor PseudoMap requires 'new'");
119
- if (this.clear(), set2)
120
- if (set2 instanceof PseudoMap || typeof Map == "function" && set2 instanceof Map)
121
- set2.forEach(function(value, key) {
122
- this.set(key, value);
123
- }, this);
124
- else if (Array.isArray(set2))
125
- set2.forEach(function(kv) {
126
- this.set(kv[0], kv[1]);
127
- }, this);
128
- else
129
- throw new TypeError("invalid argument");
130
- }
131
- PseudoMap.prototype.forEach = function(fn, thisp) {
132
- thisp = thisp || this, Object.keys(this._data).forEach(function(k) {
133
- k !== "size" && fn.call(thisp, this._data[k].value, this._data[k].key);
134
- }, this);
135
- };
136
- PseudoMap.prototype.has = function(k) {
137
- return !!find(this._data, k);
138
- };
139
- PseudoMap.prototype.get = function(k) {
140
- var res = find(this._data, k);
141
- return res && res.value;
142
- };
143
- PseudoMap.prototype.set = function(k, v) {
144
- set(this._data, k, v);
145
- };
146
- PseudoMap.prototype.delete = function(k) {
147
- var res = find(this._data, k);
148
- res && (delete this._data[res._index], this._data.size--);
149
- };
150
- PseudoMap.prototype.clear = function() {
151
- var data = /* @__PURE__ */ Object.create(null);
152
- data.size = 0, Object.defineProperty(this, "_data", {
153
- value: data,
154
- enumerable: !1,
155
- configurable: !0,
156
- writable: !1
157
- });
158
- };
159
- Object.defineProperty(PseudoMap.prototype, "size", {
160
- get: function() {
161
- return this._data.size;
162
- },
163
- set: function(n) {
164
- },
165
- enumerable: !0,
166
- configurable: !0
167
- });
168
- PseudoMap.prototype.values = PseudoMap.prototype.keys = PseudoMap.prototype.entries = function() {
169
- throw new Error("iterators are not implemented in this version");
170
- };
171
- function same(a, b) {
172
- return a === b || a !== a && b !== b;
173
- }
174
- function Entry(k, v, i) {
175
- this.key = k, this.value = v, this._index = i;
176
- }
177
- function find(data, k) {
178
- for (var i = 0, s = "_" + k, key = s; hasOwnProperty.call(data, key); key = s + i++)
179
- if (same(data[key].key, k))
180
- return data[key];
181
- }
182
- function set(data, k, v) {
183
- for (var i = 0, s = "_" + k, key = s; hasOwnProperty.call(data, key); key = s + i++)
184
- if (same(data[key].key, k)) {
185
- data[key].value = v;
186
- return;
187
- }
188
- data.size++, data[key] = new Entry(k, v, key);
189
- }
190
- }
191
- });
192
-
193
- // ../../node_modules/.pnpm/pseudomap@1.0.2/node_modules/pseudomap/map.js
194
- var require_map = __commonJS({
195
- "../../node_modules/.pnpm/pseudomap@1.0.2/node_modules/pseudomap/map.js"(exports, module) {
196
- init_cjs_shims();
197
- process.env.npm_package_name === "pseudomap" && process.env.npm_lifecycle_script === "test" && (process.env.TEST_PSEUDOMAP = "true");
198
- typeof Map == "function" && !process.env.TEST_PSEUDOMAP ? module.exports = Map : module.exports = require_pseudomap();
199
- }
200
- });
201
-
202
- // ../../node_modules/.pnpm/yallist@2.1.2/node_modules/yallist/yallist.js
203
- var require_yallist = __commonJS({
204
- "../../node_modules/.pnpm/yallist@2.1.2/node_modules/yallist/yallist.js"(exports, module) {
205
- init_cjs_shims();
206
- module.exports = Yallist;
207
- Yallist.Node = Node;
208
- Yallist.create = Yallist;
209
- function Yallist(list) {
210
- var self = this;
211
- if (self instanceof Yallist || (self = new Yallist()), self.tail = null, self.head = null, self.length = 0, list && typeof list.forEach == "function")
212
- list.forEach(function(item) {
213
- self.push(item);
214
- });
215
- else if (arguments.length > 0)
216
- for (var i = 0, l = arguments.length; i < l; i++)
217
- self.push(arguments[i]);
218
- return self;
219
- }
220
- Yallist.prototype.removeNode = function(node) {
221
- if (node.list !== this)
222
- throw new Error("removing node which does not belong to this list");
223
- var next = node.next, prev = node.prev;
224
- next && (next.prev = prev), prev && (prev.next = next), node === this.head && (this.head = next), node === this.tail && (this.tail = prev), node.list.length--, node.next = null, node.prev = null, node.list = null;
225
- };
226
- Yallist.prototype.unshiftNode = function(node) {
227
- if (node !== this.head) {
228
- node.list && node.list.removeNode(node);
229
- var head = this.head;
230
- node.list = this, node.next = head, head && (head.prev = node), this.head = node, this.tail || (this.tail = node), this.length++;
231
- }
232
- };
233
- Yallist.prototype.pushNode = function(node) {
234
- if (node !== this.tail) {
235
- node.list && node.list.removeNode(node);
236
- var tail = this.tail;
237
- node.list = this, node.prev = tail, tail && (tail.next = node), this.tail = node, this.head || (this.head = node), this.length++;
238
- }
239
- };
240
- Yallist.prototype.push = function() {
241
- for (var i = 0, l = arguments.length; i < l; i++)
242
- push(this, arguments[i]);
243
- return this.length;
244
- };
245
- Yallist.prototype.unshift = function() {
246
- for (var i = 0, l = arguments.length; i < l; i++)
247
- unshift(this, arguments[i]);
248
- return this.length;
249
- };
250
- Yallist.prototype.pop = function() {
251
- if (this.tail) {
252
- var res = this.tail.value;
253
- return this.tail = this.tail.prev, this.tail ? this.tail.next = null : this.head = null, this.length--, res;
254
- }
255
- };
256
- Yallist.prototype.shift = function() {
257
- if (this.head) {
258
- var res = this.head.value;
259
- return this.head = this.head.next, this.head ? this.head.prev = null : this.tail = null, this.length--, res;
260
- }
261
- };
262
- Yallist.prototype.forEach = function(fn, thisp) {
263
- thisp = thisp || this;
264
- for (var walker = this.head, i = 0; walker !== null; i++)
265
- fn.call(thisp, walker.value, i, this), walker = walker.next;
266
- };
267
- Yallist.prototype.forEachReverse = function(fn, thisp) {
268
- thisp = thisp || this;
269
- for (var walker = this.tail, i = this.length - 1; walker !== null; i--)
270
- fn.call(thisp, walker.value, i, this), walker = walker.prev;
271
- };
272
- Yallist.prototype.get = function(n) {
273
- for (var i = 0, walker = this.head; walker !== null && i < n; i++)
274
- walker = walker.next;
275
- if (i === n && walker !== null)
276
- return walker.value;
277
- };
278
- Yallist.prototype.getReverse = function(n) {
279
- for (var i = 0, walker = this.tail; walker !== null && i < n; i++)
280
- walker = walker.prev;
281
- if (i === n && walker !== null)
282
- return walker.value;
283
- };
284
- Yallist.prototype.map = function(fn, thisp) {
285
- thisp = thisp || this;
286
- for (var res = new Yallist(), walker = this.head; walker !== null; )
287
- res.push(fn.call(thisp, walker.value, this)), walker = walker.next;
288
- return res;
289
- };
290
- Yallist.prototype.mapReverse = function(fn, thisp) {
291
- thisp = thisp || this;
292
- for (var res = new Yallist(), walker = this.tail; walker !== null; )
293
- res.push(fn.call(thisp, walker.value, this)), walker = walker.prev;
294
- return res;
295
- };
296
- Yallist.prototype.reduce = function(fn, initial) {
297
- var acc, walker = this.head;
298
- if (arguments.length > 1)
299
- acc = initial;
300
- else if (this.head)
301
- walker = this.head.next, acc = this.head.value;
302
- else
303
- throw new TypeError("Reduce of empty list with no initial value");
304
- for (var i = 0; walker !== null; i++)
305
- acc = fn(acc, walker.value, i), walker = walker.next;
306
- return acc;
307
- };
308
- Yallist.prototype.reduceReverse = function(fn, initial) {
309
- var acc, walker = this.tail;
310
- if (arguments.length > 1)
311
- acc = initial;
312
- else if (this.tail)
313
- walker = this.tail.prev, acc = this.tail.value;
314
- else
315
- throw new TypeError("Reduce of empty list with no initial value");
316
- for (var i = this.length - 1; walker !== null; i--)
317
- acc = fn(acc, walker.value, i), walker = walker.prev;
318
- return acc;
319
- };
320
- Yallist.prototype.toArray = function() {
321
- for (var arr = new Array(this.length), i = 0, walker = this.head; walker !== null; i++)
322
- arr[i] = walker.value, walker = walker.next;
323
- return arr;
324
- };
325
- Yallist.prototype.toArrayReverse = function() {
326
- for (var arr = new Array(this.length), i = 0, walker = this.tail; walker !== null; i++)
327
- arr[i] = walker.value, walker = walker.prev;
328
- return arr;
329
- };
330
- Yallist.prototype.slice = function(from, to) {
331
- to = to || this.length, to < 0 && (to += this.length), from = from || 0, from < 0 && (from += this.length);
332
- var ret = new Yallist();
333
- if (to < from || to < 0)
334
- return ret;
335
- from < 0 && (from = 0), to > this.length && (to = this.length);
336
- for (var i = 0, walker = this.head; walker !== null && i < from; i++)
337
- walker = walker.next;
338
- for (; walker !== null && i < to; i++, walker = walker.next)
339
- ret.push(walker.value);
340
- return ret;
341
- };
342
- Yallist.prototype.sliceReverse = function(from, to) {
343
- to = to || this.length, to < 0 && (to += this.length), from = from || 0, from < 0 && (from += this.length);
344
- var ret = new Yallist();
345
- if (to < from || to < 0)
346
- return ret;
347
- from < 0 && (from = 0), to > this.length && (to = this.length);
348
- for (var i = this.length, walker = this.tail; walker !== null && i > to; i--)
349
- walker = walker.prev;
350
- for (; walker !== null && i > from; i--, walker = walker.prev)
351
- ret.push(walker.value);
352
- return ret;
353
- };
354
- Yallist.prototype.reverse = function() {
355
- for (var head = this.head, tail = this.tail, walker = head; walker !== null; walker = walker.prev) {
356
- var p = walker.prev;
357
- walker.prev = walker.next, walker.next = p;
358
- }
359
- return this.head = tail, this.tail = head, this;
360
- };
361
- function push(self, item) {
362
- self.tail = new Node(item, self.tail, null, self), self.head || (self.head = self.tail), self.length++;
363
- }
364
- function unshift(self, item) {
365
- self.head = new Node(item, null, self.head, self), self.tail || (self.tail = self.head), self.length++;
366
- }
367
- function Node(value, prev, next, list) {
368
- if (!(this instanceof Node))
369
- return new Node(value, prev, next, list);
370
- this.list = list, this.value = value, prev ? (prev.next = this, this.prev = prev) : this.prev = null, next ? (next.prev = this, this.next = next) : this.next = null;
371
- }
372
- }
373
- });
374
-
375
- // ../../node_modules/.pnpm/lru-cache@4.1.5/node_modules/lru-cache/index.js
376
- var require_lru_cache = __commonJS({
377
- "../../node_modules/.pnpm/lru-cache@4.1.5/node_modules/lru-cache/index.js"(exports, module) {
378
- "use strict";
379
- init_cjs_shims();
380
- module.exports = LRUCache;
381
- var Map2 = require_map(), util = __require("util"), Yallist = require_yallist(), hasSymbol = typeof Symbol == "function" && process.env._nodeLRUCacheForceNoSymbol !== "1", makeSymbol;
382
- hasSymbol ? makeSymbol = function(key) {
383
- return Symbol(key);
384
- } : makeSymbol = function(key) {
385
- return "_" + key;
386
- };
387
- var MAX = makeSymbol("max"), LENGTH = makeSymbol("length"), LENGTH_CALCULATOR = makeSymbol("lengthCalculator"), ALLOW_STALE = makeSymbol("allowStale"), MAX_AGE = makeSymbol("maxAge"), DISPOSE = makeSymbol("dispose"), NO_DISPOSE_ON_SET = makeSymbol("noDisposeOnSet"), LRU_LIST = makeSymbol("lruList"), CACHE = makeSymbol("cache");
388
- function naiveLength() {
389
- return 1;
390
- }
391
- function LRUCache(options) {
392
- if (!(this instanceof LRUCache))
393
- return new LRUCache(options);
394
- typeof options == "number" && (options = { max: options }), options || (options = {});
395
- var max = this[MAX] = options.max;
396
- (!max || typeof max != "number" || max <= 0) && (this[MAX] = 1 / 0);
397
- var lc = options.length || naiveLength;
398
- typeof lc != "function" && (lc = naiveLength), this[LENGTH_CALCULATOR] = lc, this[ALLOW_STALE] = options.stale || !1, this[MAX_AGE] = options.maxAge || 0, this[DISPOSE] = options.dispose, this[NO_DISPOSE_ON_SET] = options.noDisposeOnSet || !1, this.reset();
399
- }
400
- Object.defineProperty(LRUCache.prototype, "max", {
401
- set: function(mL) {
402
- (!mL || typeof mL != "number" || mL <= 0) && (mL = 1 / 0), this[MAX] = mL, trim(this);
403
- },
404
- get: function() {
405
- return this[MAX];
406
- },
407
- enumerable: !0
408
- });
409
- Object.defineProperty(LRUCache.prototype, "allowStale", {
410
- set: function(allowStale) {
411
- this[ALLOW_STALE] = !!allowStale;
412
- },
413
- get: function() {
414
- return this[ALLOW_STALE];
415
- },
416
- enumerable: !0
417
- });
418
- Object.defineProperty(LRUCache.prototype, "maxAge", {
419
- set: function(mA) {
420
- (!mA || typeof mA != "number" || mA < 0) && (mA = 0), this[MAX_AGE] = mA, trim(this);
421
- },
422
- get: function() {
423
- return this[MAX_AGE];
424
- },
425
- enumerable: !0
426
- });
427
- Object.defineProperty(LRUCache.prototype, "lengthCalculator", {
428
- set: function(lC) {
429
- typeof lC != "function" && (lC = naiveLength), lC !== this[LENGTH_CALCULATOR] && (this[LENGTH_CALCULATOR] = lC, this[LENGTH] = 0, this[LRU_LIST].forEach(function(hit) {
430
- hit.length = this[LENGTH_CALCULATOR](hit.value, hit.key), this[LENGTH] += hit.length;
431
- }, this)), trim(this);
432
- },
433
- get: function() {
434
- return this[LENGTH_CALCULATOR];
435
- },
436
- enumerable: !0
437
- });
438
- Object.defineProperty(LRUCache.prototype, "length", {
439
- get: function() {
440
- return this[LENGTH];
441
- },
442
- enumerable: !0
443
- });
444
- Object.defineProperty(LRUCache.prototype, "itemCount", {
445
- get: function() {
446
- return this[LRU_LIST].length;
447
- },
448
- enumerable: !0
449
- });
450
- LRUCache.prototype.rforEach = function(fn, thisp) {
451
- thisp = thisp || this;
452
- for (var walker = this[LRU_LIST].tail; walker !== null; ) {
453
- var prev = walker.prev;
454
- forEachStep(this, fn, walker, thisp), walker = prev;
455
- }
456
- };
457
- function forEachStep(self, fn, node, thisp) {
458
- var hit = node.value;
459
- isStale(self, hit) && (del(self, node), self[ALLOW_STALE] || (hit = void 0)), hit && fn.call(thisp, hit.value, hit.key, self);
460
- }
461
- LRUCache.prototype.forEach = function(fn, thisp) {
462
- thisp = thisp || this;
463
- for (var walker = this[LRU_LIST].head; walker !== null; ) {
464
- var next = walker.next;
465
- forEachStep(this, fn, walker, thisp), walker = next;
466
- }
467
- };
468
- LRUCache.prototype.keys = function() {
469
- return this[LRU_LIST].toArray().map(function(k) {
470
- return k.key;
471
- }, this);
472
- };
473
- LRUCache.prototype.values = function() {
474
- return this[LRU_LIST].toArray().map(function(k) {
475
- return k.value;
476
- }, this);
477
- };
478
- LRUCache.prototype.reset = function() {
479
- this[DISPOSE] && this[LRU_LIST] && this[LRU_LIST].length && this[LRU_LIST].forEach(function(hit) {
480
- this[DISPOSE](hit.key, hit.value);
481
- }, this), this[CACHE] = new Map2(), this[LRU_LIST] = new Yallist(), this[LENGTH] = 0;
482
- };
483
- LRUCache.prototype.dump = function() {
484
- return this[LRU_LIST].map(function(hit) {
485
- if (!isStale(this, hit))
486
- return {
487
- k: hit.key,
488
- v: hit.value,
489
- e: hit.now + (hit.maxAge || 0)
490
- };
491
- }, this).toArray().filter(function(h) {
492
- return h;
493
- });
494
- };
495
- LRUCache.prototype.dumpLru = function() {
496
- return this[LRU_LIST];
497
- };
498
- LRUCache.prototype.inspect = function(n, opts) {
499
- var str = "LRUCache {", extras = !1, as = this[ALLOW_STALE];
500
- as && (str += `
501
- allowStale: true`, extras = !0);
502
- var max = this[MAX];
503
- max && max !== 1 / 0 && (extras && (str += ","), str += `
504
- max: ` + util.inspect(max, opts), extras = !0);
505
- var maxAge = this[MAX_AGE];
506
- maxAge && (extras && (str += ","), str += `
507
- maxAge: ` + util.inspect(maxAge, opts), extras = !0);
508
- var lc = this[LENGTH_CALCULATOR];
509
- lc && lc !== naiveLength && (extras && (str += ","), str += `
510
- length: ` + util.inspect(this[LENGTH], opts), extras = !0);
511
- var didFirst = !1;
512
- return this[LRU_LIST].forEach(function(item) {
513
- didFirst ? str += `,
514
- ` : (extras && (str += `,
515
- `), didFirst = !0, str += `
516
- `);
517
- var key = util.inspect(item.key).split(`
518
- `).join(`
519
- `), val = { value: item.value };
520
- item.maxAge !== maxAge && (val.maxAge = item.maxAge), lc !== naiveLength && (val.length = item.length), isStale(this, item) && (val.stale = !0), val = util.inspect(val, opts).split(`
521
- `).join(`
522
- `), str += key + " => " + val;
523
- }), (didFirst || extras) && (str += `
524
- `), str += "}", str;
525
- };
526
- LRUCache.prototype.set = function(key, value, maxAge) {
527
- maxAge = maxAge || this[MAX_AGE];
528
- var now = maxAge ? Date.now() : 0, len = this[LENGTH_CALCULATOR](value, key);
529
- if (this[CACHE].has(key)) {
530
- if (len > this[MAX])
531
- return del(this, this[CACHE].get(key)), !1;
532
- var node = this[CACHE].get(key), item = node.value;
533
- return this[DISPOSE] && (this[NO_DISPOSE_ON_SET] || this[DISPOSE](key, item.value)), item.now = now, item.maxAge = maxAge, item.value = value, this[LENGTH] += len - item.length, item.length = len, this.get(key), trim(this), !0;
534
- }
535
- var hit = new Entry(key, value, len, now, maxAge);
536
- return hit.length > this[MAX] ? (this[DISPOSE] && this[DISPOSE](key, value), !1) : (this[LENGTH] += hit.length, this[LRU_LIST].unshift(hit), this[CACHE].set(key, this[LRU_LIST].head), trim(this), !0);
537
- };
538
- LRUCache.prototype.has = function(key) {
539
- if (!this[CACHE].has(key))
540
- return !1;
541
- var hit = this[CACHE].get(key).value;
542
- return !isStale(this, hit);
543
- };
544
- LRUCache.prototype.get = function(key) {
545
- return get(this, key, !0);
546
- };
547
- LRUCache.prototype.peek = function(key) {
548
- return get(this, key, !1);
549
- };
550
- LRUCache.prototype.pop = function() {
551
- var node = this[LRU_LIST].tail;
552
- return node ? (del(this, node), node.value) : null;
553
- };
554
- LRUCache.prototype.del = function(key) {
555
- del(this, this[CACHE].get(key));
556
- };
557
- LRUCache.prototype.load = function(arr) {
558
- this.reset();
559
- for (var now = Date.now(), l = arr.length - 1; l >= 0; l--) {
560
- var hit = arr[l], expiresAt = hit.e || 0;
561
- if (expiresAt === 0)
562
- this.set(hit.k, hit.v);
563
- else {
564
- var maxAge = expiresAt - now;
565
- maxAge > 0 && this.set(hit.k, hit.v, maxAge);
566
- }
567
- }
568
- };
569
- LRUCache.prototype.prune = function() {
570
- var self = this;
571
- this[CACHE].forEach(function(value, key) {
572
- get(self, key, !1);
573
- });
574
- };
575
- function get(self, key, doUse) {
576
- var node = self[CACHE].get(key);
577
- if (node) {
578
- var hit = node.value;
579
- isStale(self, hit) ? (del(self, node), self[ALLOW_STALE] || (hit = void 0)) : doUse && self[LRU_LIST].unshiftNode(node), hit && (hit = hit.value);
580
- }
581
- return hit;
582
- }
583
- function isStale(self, hit) {
584
- if (!hit || !hit.maxAge && !self[MAX_AGE])
585
- return !1;
586
- var stale = !1, diff = Date.now() - hit.now;
587
- return hit.maxAge ? stale = diff > hit.maxAge : stale = self[MAX_AGE] && diff > self[MAX_AGE], stale;
588
- }
589
- function trim(self) {
590
- if (self[LENGTH] > self[MAX])
591
- for (var walker = self[LRU_LIST].tail; self[LENGTH] > self[MAX] && walker !== null; ) {
592
- var prev = walker.prev;
593
- del(self, walker), walker = prev;
594
- }
595
- }
596
- function del(self, node) {
597
- if (node) {
598
- var hit = node.value;
599
- self[DISPOSE] && self[DISPOSE](hit.key, hit.value), self[LENGTH] -= hit.length, self[CACHE].delete(hit.key), self[LRU_LIST].removeNode(node);
600
- }
601
- }
602
- function Entry(key, value, length, now, maxAge) {
603
- this.key = key, this.value = value, this.length = length, this.now = now, this.maxAge = maxAge || 0;
604
- }
605
- }
606
- });
607
-
608
- // ../../node_modules/.pnpm/cross-spawn@5.1.0/node_modules/cross-spawn/lib/util/resolveCommand.js
609
- var require_resolveCommand = __commonJS({
610
- "../../node_modules/.pnpm/cross-spawn@5.1.0/node_modules/cross-spawn/lib/util/resolveCommand.js"(exports, module) {
611
- "use strict";
612
- init_cjs_shims();
613
- var path = __require("path"), which = require_which(), LRU = require_lru_cache(), commandCache = new LRU({ max: 50, maxAge: 30 * 1e3 });
614
- function resolveCommand(command, noExtension) {
615
- var resolved;
616
- if (noExtension = !!noExtension, resolved = commandCache.get(command + "!" + noExtension), commandCache.has(command))
617
- return commandCache.get(command);
618
- try {
619
- resolved = noExtension ? which.sync(command, { pathExt: path.delimiter + (process.env.PATHEXT || "") }) : which.sync(command);
620
- } catch {
621
- }
622
- return commandCache.set(command + "!" + noExtension, resolved), resolved;
623
- }
624
- module.exports = resolveCommand;
625
- }
626
- });
627
-
628
- // ../../node_modules/.pnpm/cross-spawn@5.1.0/node_modules/cross-spawn/lib/util/hasEmptyArgumentBug.js
629
- var require_hasEmptyArgumentBug = __commonJS({
630
- "../../node_modules/.pnpm/cross-spawn@5.1.0/node_modules/cross-spawn/lib/util/hasEmptyArgumentBug.js"(exports, module) {
631
- "use strict";
632
- init_cjs_shims();
633
- function hasEmptyArgumentBug() {
634
- var nodeVer;
635
- return process.platform !== "win32" ? !1 : (nodeVer = process.version.substr(1).split(".").map(function(num) {
636
- return parseInt(num, 10);
637
- }), nodeVer[0] === 0 && nodeVer[1] < 12);
638
- }
639
- module.exports = hasEmptyArgumentBug();
640
- }
641
- });
642
-
643
- // ../../node_modules/.pnpm/cross-spawn@5.1.0/node_modules/cross-spawn/lib/util/escapeArgument.js
644
- var require_escapeArgument = __commonJS({
645
- "../../node_modules/.pnpm/cross-spawn@5.1.0/node_modules/cross-spawn/lib/util/escapeArgument.js"(exports, module) {
646
- "use strict";
647
- init_cjs_shims();
648
- function escapeArgument(arg, quote) {
649
- return arg = "" + arg, quote ? (arg = arg.replace(/(\\*)"/g, '$1$1\\"'), arg = arg.replace(/(\\*)$/, "$1$1"), arg = '"' + arg + '"') : arg = arg.replace(/([()%!^<>&|;,"'\s])/g, "^$1"), arg;
650
- }
651
- module.exports = escapeArgument;
652
- }
653
- });
654
-
655
- // ../../node_modules/.pnpm/cross-spawn@5.1.0/node_modules/cross-spawn/lib/util/escapeCommand.js
656
- var require_escapeCommand = __commonJS({
657
- "../../node_modules/.pnpm/cross-spawn@5.1.0/node_modules/cross-spawn/lib/util/escapeCommand.js"(exports, module) {
658
- "use strict";
659
- init_cjs_shims();
660
- var escapeArgument = require_escapeArgument();
661
- function escapeCommand(command) {
662
- return /^[a-z0-9_-]+$/i.test(command) ? command : escapeArgument(command, !0);
663
- }
664
- module.exports = escapeCommand;
665
- }
666
- });
667
-
668
- // ../../node_modules/.pnpm/shebang-regex@1.0.0/node_modules/shebang-regex/index.js
669
- var require_shebang_regex = __commonJS({
670
- "../../node_modules/.pnpm/shebang-regex@1.0.0/node_modules/shebang-regex/index.js"(exports, module) {
671
- "use strict";
672
- init_cjs_shims();
673
- module.exports = /^#!.*/;
674
- }
675
- });
676
-
677
- // ../../node_modules/.pnpm/shebang-command@1.2.0/node_modules/shebang-command/index.js
678
- var require_shebang_command = __commonJS({
679
- "../../node_modules/.pnpm/shebang-command@1.2.0/node_modules/shebang-command/index.js"(exports, module) {
680
- "use strict";
681
- init_cjs_shims();
682
- var shebangRegex = require_shebang_regex();
683
- module.exports = function(str) {
684
- var match = str.match(shebangRegex);
685
- if (!match)
686
- return null;
687
- var arr = match[0].replace(/#! ?/, "").split(" "), bin = arr[0].split("/").pop(), arg = arr[1];
688
- return bin === "env" ? arg : bin + (arg ? " " + arg : "");
689
- };
690
- }
691
- });
692
-
693
- // ../../node_modules/.pnpm/cross-spawn@5.1.0/node_modules/cross-spawn/lib/util/readShebang.js
694
- var require_readShebang = __commonJS({
695
- "../../node_modules/.pnpm/cross-spawn@5.1.0/node_modules/cross-spawn/lib/util/readShebang.js"(exports, module) {
696
- "use strict";
697
- init_cjs_shims();
698
- var fs = __require("fs"), LRU = require_lru_cache(), shebangCommand = require_shebang_command(), shebangCache = new LRU({ max: 50, maxAge: 30 * 1e3 });
699
- function readShebang(command) {
700
- var buffer, fd, shebang;
701
- if (shebangCache.has(command))
702
- return shebangCache.get(command);
703
- buffer = new Buffer(150);
704
- try {
705
- fd = fs.openSync(command, "r"), fs.readSync(fd, buffer, 0, 150, 0), fs.closeSync(fd);
706
- } catch {
707
- }
708
- return shebang = shebangCommand(buffer.toString()), shebangCache.set(command, shebang), shebang;
709
- }
710
- module.exports = readShebang;
711
- }
712
- });
713
-
714
- // ../../node_modules/.pnpm/cross-spawn@5.1.0/node_modules/cross-spawn/lib/parse.js
715
- var require_parse = __commonJS({
716
- "../../node_modules/.pnpm/cross-spawn@5.1.0/node_modules/cross-spawn/lib/parse.js"(exports, module) {
717
- "use strict";
718
- init_cjs_shims();
719
- var resolveCommand = require_resolveCommand(), hasEmptyArgumentBug = require_hasEmptyArgumentBug(), escapeArgument = require_escapeArgument(), escapeCommand = require_escapeCommand(), readShebang = require_readShebang(), isWin = process.platform === "win32", skipShellRegExp = /\.(?:com|exe)$/i, supportsShellOption = parseInt(process.version.substr(1).split(".")[0], 10) >= 6 || parseInt(process.version.substr(1).split(".")[0], 10) === 4 && parseInt(process.version.substr(1).split(".")[1], 10) >= 8;
720
- function parseNonShell(parsed) {
721
- var shebang, needsShell, applyQuotes;
722
- return isWin && (parsed.file = resolveCommand(parsed.command), parsed.file = parsed.file || resolveCommand(parsed.command, !0), shebang = parsed.file && readShebang(parsed.file), shebang ? (parsed.args.unshift(parsed.file), parsed.command = shebang, needsShell = hasEmptyArgumentBug || !skipShellRegExp.test(resolveCommand(shebang) || resolveCommand(shebang, !0))) : needsShell = hasEmptyArgumentBug || !skipShellRegExp.test(parsed.file), needsShell && (applyQuotes = parsed.command !== "echo", parsed.command = escapeCommand(parsed.command), parsed.args = parsed.args.map(function(arg) {
723
- return escapeArgument(arg, applyQuotes);
724
- }), parsed.args = ["/d", "/s", "/c", '"' + parsed.command + (parsed.args.length ? " " + parsed.args.join(" ") : "") + '"'], parsed.command = process.env.comspec || "cmd.exe", parsed.options.windowsVerbatimArguments = !0)), parsed;
725
- }
726
- function parseShell(parsed) {
727
- var shellCommand;
728
- return supportsShellOption || (shellCommand = [parsed.command].concat(parsed.args).join(" "), isWin ? (parsed.command = typeof parsed.options.shell == "string" ? parsed.options.shell : process.env.comspec || "cmd.exe", parsed.args = ["/d", "/s", "/c", '"' + shellCommand + '"'], parsed.options.windowsVerbatimArguments = !0) : (typeof parsed.options.shell == "string" ? parsed.command = parsed.options.shell : process.platform === "android" ? parsed.command = "/system/bin/sh" : parsed.command = "/bin/sh", parsed.args = ["-c", shellCommand])), parsed;
729
- }
730
- function parse(command, args, options) {
731
- var parsed;
732
- return args && !Array.isArray(args) && (options = args, args = null), args = args ? args.slice(0) : [], options = options || {}, parsed = {
733
- command,
734
- args,
735
- options,
736
- file: void 0,
737
- original: command
738
- }, options.shell ? parseShell(parsed) : parseNonShell(parsed);
739
- }
740
- module.exports = parse;
741
- }
742
- });
743
-
744
- // ../../node_modules/.pnpm/cross-spawn@5.1.0/node_modules/cross-spawn/lib/enoent.js
745
- var require_enoent = __commonJS({
746
- "../../node_modules/.pnpm/cross-spawn@5.1.0/node_modules/cross-spawn/lib/enoent.js"(exports, module) {
747
- "use strict";
748
- init_cjs_shims();
749
- var isWin = process.platform === "win32", resolveCommand = require_resolveCommand(), isNode10 = process.version.indexOf("v0.10.") === 0;
750
- function notFoundError(command, syscall) {
751
- var err;
752
- return err = new Error(syscall + " " + command + " ENOENT"), err.code = err.errno = "ENOENT", err.syscall = syscall + " " + command, err;
753
- }
754
- function hookChildProcess(cp, parsed) {
755
- var originalEmit;
756
- isWin && (originalEmit = cp.emit, cp.emit = function(name, arg1) {
757
- var err;
758
- return name === "exit" && (err = verifyENOENT(arg1, parsed, "spawn"), err) ? originalEmit.call(cp, "error", err) : originalEmit.apply(cp, arguments);
759
- });
760
- }
761
- function verifyENOENT(status, parsed) {
762
- return isWin && status === 1 && !parsed.file ? notFoundError(parsed.original, "spawn") : null;
763
- }
764
- function verifyENOENTSync(status, parsed) {
765
- return isWin && status === 1 && !parsed.file || isNode10 && status === -1 && (parsed.file = isWin ? parsed.file : resolveCommand(parsed.original), !parsed.file) ? notFoundError(parsed.original, "spawnSync") : null;
766
- }
767
- module.exports.hookChildProcess = hookChildProcess;
768
- module.exports.verifyENOENT = verifyENOENT;
769
- module.exports.verifyENOENTSync = verifyENOENTSync;
770
- module.exports.notFoundError = notFoundError;
771
- }
772
- });
773
-
774
- // ../../node_modules/.pnpm/cross-spawn@5.1.0/node_modules/cross-spawn/index.js
775
- var require_cross_spawn = __commonJS({
776
- "../../node_modules/.pnpm/cross-spawn@5.1.0/node_modules/cross-spawn/index.js"(exports, module) {
777
- "use strict";
778
- init_cjs_shims();
779
- var cp = __require("child_process"), parse = require_parse(), enoent = require_enoent(), cpSpawnSync = cp.spawnSync;
780
- function spawn(command, args, options) {
781
- var parsed, spawned;
782
- return parsed = parse(command, args, options), spawned = cp.spawn(parsed.command, parsed.args, parsed.options), enoent.hookChildProcess(spawned, parsed), spawned;
783
- }
784
- function spawnSync(command, args, options) {
785
- var parsed, result;
786
- if (!cpSpawnSync)
787
- try {
788
- cpSpawnSync = __require("spawn-sync");
789
- } catch {
790
- throw new Error(
791
- `In order to use spawnSync on node 0.10 or older, you must install spawn-sync:
792
-
793
- npm install spawn-sync --save`
794
- );
795
- }
796
- return parsed = parse(command, args, options), result = cpSpawnSync(parsed.command, parsed.args, parsed.options), result.error = result.error || enoent.verifyENOENTSync(result.status, parsed), result;
797
- }
798
- module.exports = spawn;
799
- module.exports.spawn = spawn;
800
- module.exports.sync = spawnSync;
801
- module.exports._parse = parse;
802
- module.exports._enoent = enoent;
803
- }
804
- });
805
-
806
- // ../../node_modules/.pnpm/strip-eof@1.0.0/node_modules/strip-eof/index.js
807
- var require_strip_eof = __commonJS({
808
- "../../node_modules/.pnpm/strip-eof@1.0.0/node_modules/strip-eof/index.js"(exports, module) {
809
- "use strict";
810
- init_cjs_shims();
811
- module.exports = function(x) {
812
- var lf = typeof x == "string" ? `
813
- ` : 10, cr = typeof x == "string" ? "\r" : 13;
814
- return x[x.length - 1] === lf && (x = x.slice(0, x.length - 1)), x[x.length - 1] === cr && (x = x.slice(0, x.length - 1)), x;
815
- };
816
- }
817
- });
818
-
819
- // ../../node_modules/.pnpm/path-key@2.0.1/node_modules/path-key/index.js
820
- var require_path_key = __commonJS({
821
- "../../node_modules/.pnpm/path-key@2.0.1/node_modules/path-key/index.js"(exports, module) {
822
- "use strict";
823
- init_cjs_shims();
824
- module.exports = (opts) => {
825
- opts = opts || {};
826
- let env = opts.env || process.env;
827
- return (opts.platform || process.platform) !== "win32" ? "PATH" : Object.keys(env).find((x) => x.toUpperCase() === "PATH") || "Path";
828
- };
829
- }
830
- });
831
-
832
- // ../../node_modules/.pnpm/npm-run-path@2.0.2/node_modules/npm-run-path/index.js
833
- var require_npm_run_path = __commonJS({
834
- "../../node_modules/.pnpm/npm-run-path@2.0.2/node_modules/npm-run-path/index.js"(exports, module) {
835
- "use strict";
836
- init_cjs_shims();
837
- var path = __require("path"), pathKey = require_path_key();
838
- module.exports = (opts) => {
839
- opts = Object.assign({
840
- cwd: process.cwd(),
841
- path: process.env[pathKey()]
842
- }, opts);
843
- let prev, pth = path.resolve(opts.cwd), ret = [];
844
- for (; prev !== pth; )
845
- ret.push(path.join(pth, "node_modules/.bin")), prev = pth, pth = path.resolve(pth, "..");
846
- return ret.push(path.dirname(process.execPath)), ret.concat(opts.path).join(path.delimiter);
847
- };
848
- module.exports.env = (opts) => {
849
- opts = Object.assign({
850
- env: process.env
851
- }, opts);
852
- let env = Object.assign({}, opts.env), path2 = pathKey({ env });
853
- return opts.path = env[path2], env[path2] = module.exports(opts), env;
854
- };
855
- }
856
- });
857
-
858
- // ../../node_modules/.pnpm/is-stream@1.1.0/node_modules/is-stream/index.js
859
- var require_is_stream = __commonJS({
860
- "../../node_modules/.pnpm/is-stream@1.1.0/node_modules/is-stream/index.js"(exports, module) {
861
- "use strict";
862
- init_cjs_shims();
863
- var isStream = module.exports = function(stream) {
864
- return stream !== null && typeof stream == "object" && typeof stream.pipe == "function";
865
- };
866
- isStream.writable = function(stream) {
867
- return isStream(stream) && stream.writable !== !1 && typeof stream._write == "function" && typeof stream._writableState == "object";
868
- };
869
- isStream.readable = function(stream) {
870
- return isStream(stream) && stream.readable !== !1 && typeof stream._read == "function" && typeof stream._readableState == "object";
871
- };
872
- isStream.duplex = function(stream) {
873
- return isStream.writable(stream) && isStream.readable(stream);
874
- };
875
- isStream.transform = function(stream) {
876
- return isStream.duplex(stream) && typeof stream._transform == "function" && typeof stream._transformState == "object";
877
- };
878
- }
879
- });
880
-
881
- // ../../node_modules/.pnpm/get-stream@3.0.0/node_modules/get-stream/buffer-stream.js
882
- var require_buffer_stream = __commonJS({
883
- "../../node_modules/.pnpm/get-stream@3.0.0/node_modules/get-stream/buffer-stream.js"(exports, module) {
884
- "use strict";
885
- init_cjs_shims();
886
- var PassThrough = __require("stream").PassThrough;
887
- module.exports = (opts) => {
888
- opts = Object.assign({}, opts);
889
- let array = opts.array, encoding = opts.encoding, buffer = encoding === "buffer", objectMode = !1;
890
- array ? objectMode = !(encoding || buffer) : encoding = encoding || "utf8", buffer && (encoding = null);
891
- let len = 0, ret = [], stream = new PassThrough({ objectMode });
892
- return encoding && stream.setEncoding(encoding), stream.on("data", (chunk) => {
893
- ret.push(chunk), objectMode ? len = ret.length : len += chunk.length;
894
- }), stream.getBufferedValue = () => array ? ret : buffer ? Buffer.concat(ret, len) : ret.join(""), stream.getBufferedLength = () => len, stream;
895
- };
896
- }
897
- });
898
-
899
- // ../../node_modules/.pnpm/get-stream@3.0.0/node_modules/get-stream/index.js
900
- var require_get_stream = __commonJS({
901
- "../../node_modules/.pnpm/get-stream@3.0.0/node_modules/get-stream/index.js"(exports, module) {
902
- "use strict";
903
- init_cjs_shims();
904
- var bufferStream = require_buffer_stream();
905
- function getStream(inputStream, opts) {
906
- if (!inputStream)
907
- return Promise.reject(new Error("Expected a stream"));
908
- opts = Object.assign({ maxBuffer: 1 / 0 }, opts);
909
- let maxBuffer = opts.maxBuffer, stream, clean, p = new Promise((resolve, reject) => {
910
- let error = (err) => {
911
- err && (err.bufferedData = stream.getBufferedValue()), reject(err);
912
- };
913
- stream = bufferStream(opts), inputStream.once("error", error), inputStream.pipe(stream), stream.on("data", () => {
914
- stream.getBufferedLength() > maxBuffer && reject(new Error("maxBuffer exceeded"));
915
- }), stream.once("error", error), stream.on("end", resolve), clean = () => {
916
- inputStream.unpipe && inputStream.unpipe(stream);
917
- };
918
- });
919
- return p.then(clean, clean), p.then(() => stream.getBufferedValue());
920
- }
921
- module.exports = getStream;
922
- module.exports.buffer = (stream, opts) => getStream(stream, Object.assign({}, opts, { encoding: "buffer" }));
923
- module.exports.array = (stream, opts) => getStream(stream, Object.assign({}, opts, { array: !0 }));
924
- }
925
- });
926
-
927
- // ../../node_modules/.pnpm/p-finally@1.0.0/node_modules/p-finally/index.js
928
- var require_p_finally = __commonJS({
929
- "../../node_modules/.pnpm/p-finally@1.0.0/node_modules/p-finally/index.js"(exports, module) {
930
- "use strict";
931
- init_cjs_shims();
932
- module.exports = (promise, onFinally) => (onFinally = onFinally || (() => {
933
- }), promise.then(
934
- (val) => new Promise((resolve) => {
935
- resolve(onFinally());
936
- }).then(() => val),
937
- (err) => new Promise((resolve) => {
938
- resolve(onFinally());
939
- }).then(() => {
940
- throw err;
941
- })
942
- ));
943
- }
944
- });
945
-
946
- // ../../node_modules/.pnpm/execa@0.9.0/node_modules/execa/lib/errname.js
947
- var require_errname = __commonJS({
948
- "../../node_modules/.pnpm/execa@0.9.0/node_modules/execa/lib/errname.js"(exports, module) {
949
- "use strict";
950
- init_cjs_shims();
951
- var uv;
952
- try {
953
- if (uv = process.binding("uv"), typeof uv.errname != "function")
954
- throw new TypeError("uv.errname is not a function");
955
- } catch (err) {
956
- console.error("execa/lib/errname: unable to establish process.binding('uv')", err), uv = null;
957
- }
958
- function errname(uv2, code) {
959
- if (uv2)
960
- return uv2.errname(code);
961
- if (!(code < 0))
962
- throw new Error("err >= 0");
963
- return `Unknown system error ${code}`;
964
- }
965
- module.exports = (code) => errname(uv, code);
966
- module.exports.__test__ = errname;
967
- }
968
- });
969
-
970
- // ../../node_modules/.pnpm/execa@0.9.0/node_modules/execa/lib/stdio.js
971
- var require_stdio = __commonJS({
972
- "../../node_modules/.pnpm/execa@0.9.0/node_modules/execa/lib/stdio.js"(exports, module) {
973
- "use strict";
974
- init_cjs_shims();
975
- var alias = ["stdin", "stdout", "stderr"], hasAlias = (opts) => alias.some((x) => !!opts[x]);
976
- module.exports = (opts) => {
977
- if (!opts)
978
- return null;
979
- if (opts.stdio && hasAlias(opts))
980
- throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${alias.map((x) => `\`${x}\``).join(", ")}`);
981
- if (typeof opts.stdio == "string")
982
- return opts.stdio;
983
- let stdio = opts.stdio || [];
984
- if (!Array.isArray(stdio))
985
- throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``);
986
- let result = [], len = Math.max(stdio.length, alias.length);
987
- for (let i = 0; i < len; i++) {
988
- let value = null;
989
- stdio[i] !== void 0 ? value = stdio[i] : opts[alias[i]] !== void 0 && (value = opts[alias[i]]), result[i] = value;
990
- }
991
- return result;
992
- };
993
- }
994
- });
995
-
996
- // ../../node_modules/.pnpm/execa@0.9.0/node_modules/execa/index.js
997
- var require_execa = __commonJS({
998
- "../../node_modules/.pnpm/execa@0.9.0/node_modules/execa/index.js"(exports, module) {
999
- "use strict";
1000
- init_cjs_shims();
1001
- var path = __require("path"), childProcess = __require("child_process"), util = __require("util"), crossSpawn = require_cross_spawn(), stripEof = require_strip_eof(), npmRunPath = require_npm_run_path(), isStream = require_is_stream(), _getStream = require_get_stream(), pFinally = require_p_finally(), onExit = require_signal_exit(), errname = require_errname(), stdio = require_stdio(), TEN_MEGABYTES = 1e3 * 1e3 * 10;
1002
- function handleArgs(cmd, args, opts) {
1003
- let parsed;
1004
- return opts = Object.assign({
1005
- extendEnv: !0,
1006
- env: {}
1007
- }, opts), opts.extendEnv && (opts.env = Object.assign({}, process.env, opts.env)), opts.__winShell === !0 ? (delete opts.__winShell, parsed = {
1008
- command: cmd,
1009
- args,
1010
- options: opts,
1011
- file: cmd,
1012
- original: cmd
1013
- }) : parsed = crossSpawn._parse(cmd, args, opts), opts = Object.assign({
1014
- maxBuffer: TEN_MEGABYTES,
1015
- stripEof: !0,
1016
- preferLocal: !0,
1017
- localDir: parsed.options.cwd || process.cwd(),
1018
- encoding: "utf8",
1019
- reject: !0,
1020
- cleanup: !0
1021
- }, parsed.options), opts.stdio = stdio(opts), opts.preferLocal && (opts.env = npmRunPath.env(Object.assign({}, opts, { cwd: opts.localDir }))), opts.detached && (opts.cleanup = !1), process.platform === "win32" && path.basename(parsed.command) === "cmd.exe" && parsed.args.unshift("/q"), {
1022
- cmd: parsed.command,
1023
- args: parsed.args,
1024
- opts,
1025
- parsed
1026
- };
1027
- }
1028
- function handleInput(spawned, opts) {
1029
- let input = opts.input;
1030
- input != null && (isStream(input) ? input.pipe(spawned.stdin) : spawned.stdin.end(input));
1031
- }
1032
- function handleOutput(opts, val) {
1033
- return val && opts.stripEof && (val = stripEof(val)), val;
1034
- }
1035
- function handleShell(fn, cmd, opts) {
1036
- let file = "/bin/sh", args = ["-c", cmd];
1037
- return opts = Object.assign({}, opts), process.platform === "win32" && (opts.__winShell = !0, file = process.env.comspec || "cmd.exe", args = ["/s", "/c", `"${cmd}"`], opts.windowsVerbatimArguments = !0), opts.shell && (file = opts.shell, delete opts.shell), fn(file, args, opts);
1038
- }
1039
- function getStream(process2, stream, encoding, maxBuffer) {
1040
- if (!process2[stream])
1041
- return null;
1042
- let ret;
1043
- return encoding ? ret = _getStream(process2[stream], {
1044
- encoding,
1045
- maxBuffer
1046
- }) : ret = _getStream.buffer(process2[stream], { maxBuffer }), ret.catch((err) => {
1047
- throw err.stream = stream, err.message = `${stream} ${err.message}`, err;
1048
- });
1049
- }
1050
- function makeError(result, options) {
1051
- let stdout = result.stdout, stderr = result.stderr, err = result.error, code = result.code, signal = result.signal, parsed = options.parsed, joinedCmd = options.joinedCmd, timedOut = options.timedOut || !1;
1052
- if (!err) {
1053
- let output = "";
1054
- Array.isArray(parsed.opts.stdio) ? (parsed.opts.stdio[2] !== "inherit" && (output += output.length > 0 ? stderr : `
1055
- ${stderr}`), parsed.opts.stdio[1] !== "inherit" && (output += `
1056
- ${stdout}`)) : parsed.opts.stdio !== "inherit" && (output = `
1057
- ${stderr}${stdout}`), err = new Error(`Command failed: ${joinedCmd}${output}`), err.code = code < 0 ? errname(code) : code;
1058
- }
1059
- return err.stdout = stdout, err.stderr = stderr, err.failed = !0, err.signal = signal || null, err.cmd = joinedCmd, err.timedOut = timedOut, err;
1060
- }
1061
- function joinCmd(cmd, args) {
1062
- let joinedCmd = cmd;
1063
- return Array.isArray(args) && args.length > 0 && (joinedCmd += " " + args.join(" ")), joinedCmd;
1064
- }
1065
- module.exports = (cmd, args, opts) => {
1066
- let parsed = handleArgs(cmd, args, opts), encoding = parsed.opts.encoding, maxBuffer = parsed.opts.maxBuffer, joinedCmd = joinCmd(cmd, args), spawned;
1067
- try {
1068
- spawned = childProcess.spawn(parsed.cmd, parsed.args, parsed.opts);
1069
- } catch (err) {
1070
- return Promise.reject(err);
1071
- }
1072
- let removeExitHandler;
1073
- parsed.opts.cleanup && (removeExitHandler = onExit(() => {
1074
- spawned.kill();
1075
- }));
1076
- let timeoutId = null, timedOut = !1, cleanupTimeout = () => {
1077
- timeoutId && (clearTimeout(timeoutId), timeoutId = null);
1078
- };
1079
- parsed.opts.timeout > 0 && (timeoutId = setTimeout(() => {
1080
- timeoutId = null, timedOut = !0, spawned.kill(parsed.opts.killSignal);
1081
- }, parsed.opts.timeout));
1082
- let processDone = new Promise((resolve) => {
1083
- spawned.on("exit", (code, signal) => {
1084
- cleanupTimeout(), resolve({ code, signal });
1085
- }), spawned.on("error", (err) => {
1086
- cleanupTimeout(), resolve({ error: err });
1087
- }), spawned.stdin && spawned.stdin.on("error", (err) => {
1088
- cleanupTimeout(), resolve({ error: err });
1089
- });
1090
- });
1091
- function destroy() {
1092
- spawned.stdout && spawned.stdout.destroy(), spawned.stderr && spawned.stderr.destroy();
1093
- }
1094
- let handlePromise = () => pFinally(Promise.all([
1095
- processDone,
1096
- getStream(spawned, "stdout", encoding, maxBuffer),
1097
- getStream(spawned, "stderr", encoding, maxBuffer)
1098
- ]).then((arr) => {
1099
- let result = arr[0];
1100
- if (result.stdout = arr[1], result.stderr = arr[2], removeExitHandler && removeExitHandler(), result.error || result.code !== 0 || result.signal !== null) {
1101
- let err = makeError(result, {
1102
- joinedCmd,
1103
- parsed,
1104
- timedOut
1105
- });
1106
- if (err.killed = err.killed || spawned.killed, !parsed.opts.reject)
1107
- return err;
1108
- throw err;
1109
- }
1110
- return {
1111
- stdout: handleOutput(parsed.opts, result.stdout),
1112
- stderr: handleOutput(parsed.opts, result.stderr),
1113
- code: 0,
1114
- failed: !1,
1115
- killed: !1,
1116
- signal: null,
1117
- cmd: joinedCmd,
1118
- timedOut: !1
1119
- };
1120
- }), destroy);
1121
- return crossSpawn._enoent.hookChildProcess(spawned, parsed.parsed), handleInput(spawned, parsed.opts), spawned.then = (onfulfilled, onrejected) => handlePromise().then(onfulfilled, onrejected), spawned.catch = (onrejected) => handlePromise().catch(onrejected), spawned;
1122
- };
1123
- module.exports.stdout = function() {
1124
- return module.exports.apply(null, arguments).then((x) => x.stdout);
1125
- };
1126
- module.exports.stderr = function() {
1127
- return module.exports.apply(null, arguments).then((x) => x.stderr);
1128
- };
1129
- module.exports.shell = (cmd, opts) => handleShell(module.exports, cmd, opts);
1130
- module.exports.sync = (cmd, args, opts) => {
1131
- let parsed = handleArgs(cmd, args, opts), joinedCmd = joinCmd(cmd, args);
1132
- if (isStream(parsed.opts.input))
1133
- throw new TypeError("The `input` option cannot be a stream in sync mode");
1134
- let result = childProcess.spawnSync(parsed.cmd, parsed.args, parsed.opts);
1135
- if (result.code = result.status, result.error || result.status !== 0 || result.signal !== null) {
1136
- let err = makeError(result, {
1137
- joinedCmd,
1138
- parsed
1139
- });
1140
- if (!parsed.opts.reject)
1141
- return err;
1142
- throw err;
1143
- }
1144
- return {
1145
- stdout: handleOutput(parsed.opts, result.stdout),
1146
- stderr: handleOutput(parsed.opts, result.stderr),
1147
- code: 0,
1148
- failed: !1,
1149
- signal: null,
1150
- cmd: joinedCmd,
1151
- timedOut: !1
1152
- };
1153
- };
1154
- module.exports.shellSync = (cmd, opts) => handleShell(module.exports.sync, cmd, opts);
1155
- module.exports.spawn = util.deprecate(module.exports, "execa.spawn() is deprecated. Use execa() instead.");
1156
- }
1157
- });
1158
-
1159
- // ../../node_modules/.pnpm/pid-from-port@1.1.3/node_modules/pid-from-port/index.js
1160
- var require_pid_from_port = __commonJS({
1161
- "../../node_modules/.pnpm/pid-from-port@1.1.3/node_modules/pid-from-port/index.js"(exports, module) {
1162
- "use strict";
1163
- init_cjs_shims();
1164
- var execa = require_execa(), macos = () => execa.stdout("netstat", ["-anv", "-p", "tcp"]).then((data) => Promise.all([data, execa.stdout("netstat", ["-anv", "-p", "udp"])])).then((data) => data.join(`
1165
- `)), linux = () => execa.stdout("ss", ["-tunlp"]), win32 = () => execa.stdout("netstat", ["-ano"]), getListFn = process.platform === "darwin" ? macos : process.platform === "linux" ? linux : win32, cols = process.platform === "darwin" ? [3, 8] : process.platform === "linux" ? [4, 6] : [1, 4], isProtocol = (x) => /^\s*(tcp|udp)/i.test(x), parsePid = (input) => {
1166
- if (typeof input != "string")
1167
- return null;
1168
- let match = input.match(/(?:^|",|",pid=)(\d+)/);
1169
- return match ? parseInt(match[1], 10) : null;
1170
- }, getPort = (input, list) => {
1171
- let regex = new RegExp(`[.:]${input}$`), port = list.find((x) => regex.test(x[cols[0]]));
1172
- if (!port)
1173
- throw new Error(`Couldn't find a process with port \`${input}\``);
1174
- return parsePid(port[cols[1]]);
1175
- }, getList = () => getListFn().then(
1176
- (list) => list.split(`
1177
- `).reduce((result, x) => (isProtocol(x) && result.push(x.match(/\S+/g) || []), result), [])
1178
- );
1179
- module.exports = (input) => typeof input != "number" ? Promise.reject(new TypeError(`Expected a number, got ${typeof input}`)) : getList().then((list) => getPort(input, list));
1180
- module.exports.all = (input) => Array.isArray(input) ? getList().then((list) => Promise.all(input.map((x) => [x, getPort(x, list)]))).then((list) => new Map(list)) : Promise.reject(new TypeError(`Expected an array, got ${typeof input}`));
1181
- module.exports.list = () => getList().then((list) => {
1182
- let ret = /* @__PURE__ */ new Map();
1183
- for (let x of list) {
1184
- let match = x[cols[0]].match(/[^]*[.:](\d+)$/);
1185
- match && ret.set(parseInt(match[1], 10), parsePid(x[cols[1]]));
1186
- }
1187
- return ret;
1188
- });
1189
- }
1190
- });
1191
-
1192
- // ../../node_modules/.pnpm/kill-port-process@3.1.0/node_modules/kill-port-process/dist/lib/killer.js
1193
- var require_killer = __commonJS({
1194
- "../../node_modules/.pnpm/kill-port-process@3.1.0/node_modules/kill-port-process/dist/lib/killer.js"(exports) {
1195
- "use strict";
1196
- init_cjs_shims();
1197
- var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
1198
- function adopt(value) {
1199
- return value instanceof P ? value : new P(function(resolve) {
1200
- resolve(value);
1201
- });
1202
- }
1203
- return new (P || (P = Promise))(function(resolve, reject) {
1204
- function fulfilled(value) {
1205
- try {
1206
- step(generator.next(value));
1207
- } catch (e) {
1208
- reject(e);
1209
- }
1210
- }
1211
- function rejected(value) {
1212
- try {
1213
- step(generator.throw(value));
1214
- } catch (e) {
1215
- reject(e);
1216
- }
1217
- }
1218
- function step(result) {
1219
- result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
1220
- }
1221
- step((generator = generator.apply(thisArg, _arguments || [])).next());
1222
- });
1223
- };
1224
- Object.defineProperty(exports, "__esModule", { value: !0 });
1225
- exports.Killer = void 0;
1226
- var child_process_1 = __require("child_process"), os_1 = __require("os"), pidFromPort = require_pid_from_port(), Killer = class {
1227
- constructor(ports) {
1228
- this.ports = ports;
1229
- }
1230
- kill(options) {
1231
- return __awaiter(this, void 0, void 0, function* () {
1232
- let killFunc = os_1.platform() === "win32" ? this.win32Kill : this.unixKill, promises = this.ports.map((port) => killFunc(port, options.signal));
1233
- return Promise.all(promises);
1234
- });
1235
- }
1236
- win32Kill(port, signal) {
1237
- return __awaiter(this, void 0, void 0, function* () {
1238
- let pid = yield pidFromPort(port).catch((error) => console.error("Failed to get pid of port", port, error));
1239
- if (pid)
1240
- return new Promise((resolve, reject) => {
1241
- let taskkill = child_process_1.spawn("TASKKILL", ["/f", "/t", "/pid", pid.toString()]);
1242
- taskkill.stdout.on("data", (data) => console.log(data.toString())), taskkill.stderr.on("data", (data) => console.error(data.toString())), taskkill.on("close", (code, signal2) => {
1243
- if (code !== 0)
1244
- return reject(`taskkill process exited with code ${code} and signal ${signal2}`);
1245
- resolve(void 0);
1246
- }), taskkill.on("error", (err) => reject(err));
1247
- });
1248
- });
1249
- }
1250
- unixKill(port, signal) {
1251
- return __awaiter(this, void 0, void 0, function* () {
1252
- let killCommand = {
1253
- SIGKILL: "-9",
1254
- SIGTERM: "-15"
1255
- }[signal];
1256
- return new Promise((resolve, reject) => {
1257
- let lsof = child_process_1.spawn("lsof", ["-i", `tcp:${port}`]), grep = child_process_1.spawn("grep", ["LISTEN"]), awk = child_process_1.spawn("awk", ["{print $2}"]), xargs = child_process_1.spawn("xargs", ["kill", killCommand]);
1258
- lsof.stdout.pipe(grep.stdin), lsof.stderr.on("data", logStderrData("lsof")), grep.stdout.pipe(awk.stdin), grep.stderr.on("data", logStderrData("grep")), awk.stdout.pipe(xargs.stdin), awk.stderr.on("data", logStderrData("awk")), xargs.stdout.pipe(process.stdin), xargs.stderr.on("data", logStderrData("xargs")), xargs.on("close", (code) => {
1259
- if (code !== 0)
1260
- return reject();
1261
- resolve(void 0);
1262
- });
1263
- function logStderrData(command) {
1264
- return (data) => console.error(`${command} - ${data.toString()}`);
1265
- }
1266
- });
1267
- });
1268
- }
1269
- };
1270
- exports.Killer = Killer;
1271
- }
1272
- });
1273
-
1274
- // ../../node_modules/.pnpm/kill-port-process@3.1.0/node_modules/kill-port-process/dist/lib/index.js
1275
- var require_lib = __commonJS({
1276
- "../../node_modules/.pnpm/kill-port-process@3.1.0/node_modules/kill-port-process/dist/lib/index.js"(exports) {
1277
- init_cjs_shims();
1278
- var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
1279
- function adopt(value) {
1280
- return value instanceof P ? value : new P(function(resolve) {
1281
- resolve(value);
1282
- });
1283
- }
1284
- return new (P || (P = Promise))(function(resolve, reject) {
1285
- function fulfilled(value) {
1286
- try {
1287
- step(generator.next(value));
1288
- } catch (e) {
1289
- reject(e);
1290
- }
1291
- }
1292
- function rejected(value) {
1293
- try {
1294
- step(generator.throw(value));
1295
- } catch (e) {
1296
- reject(e);
1297
- }
1298
- }
1299
- function step(result) {
1300
- result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
1301
- }
1302
- step((generator = generator.apply(thisArg, _arguments || [])).next());
1303
- });
1304
- };
1305
- Object.defineProperty(exports, "__esModule", { value: !0 });
1306
- exports.killPortProcess = void 0;
1307
- var helpers_1 = require_helpers(), killer_1 = require_killer();
1308
- function killPortProcess(inputPorts, inputOptions = {}) {
1309
- return __awaiter(this, void 0, void 0, function* () {
1310
- if (helpers_1.isNullOrUndefined(inputPorts))
1311
- throw new Error("No ports found in input");
1312
- let options = helpers_1.mergeOptions(inputOptions), toNumber = (value) => Number(value), ports = helpers_1.arrayifyInput(inputPorts).map(toNumber);
1313
- yield new killer_1.Killer(ports).kill({
1314
- signal: options.signal
1315
- });
1316
- });
1317
- }
1318
- exports.killPortProcess = killPortProcess;
1319
- }
1320
- });
1321
- export default require_lib();
1322
- //# sourceMappingURL=lib-H3ZZGS7I.js.map