@kubb/core 2.0.0-beta.11 → 2.0.0-beta.13

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 (57) hide show
  1. package/dist/chunk-56YH3VX6.js +239 -0
  2. package/dist/chunk-56YH3VX6.js.map +1 -0
  3. package/dist/chunk-6N4JBFFS.js +79 -0
  4. package/dist/chunk-6N4JBFFS.js.map +1 -0
  5. package/dist/chunk-72O327DC.cjs +247 -0
  6. package/dist/chunk-72O327DC.cjs.map +1 -0
  7. package/dist/chunk-77QZQ377.cjs +155 -0
  8. package/dist/chunk-77QZQ377.cjs.map +1 -0
  9. package/dist/chunk-ABFPJZJL.cjs +131 -0
  10. package/dist/chunk-ABFPJZJL.cjs.map +1 -0
  11. package/dist/chunk-FOQFLMOC.js +2336 -0
  12. package/dist/chunk-FOQFLMOC.js.map +1 -0
  13. package/dist/chunk-I7UUR5MZ.cjs +91 -0
  14. package/dist/chunk-I7UUR5MZ.cjs.map +1 -0
  15. package/dist/chunk-L6F5QUH2.js +129 -0
  16. package/dist/chunk-L6F5QUH2.js.map +1 -0
  17. package/dist/chunk-PY7I7OEN.cjs +92 -0
  18. package/dist/chunk-PY7I7OEN.cjs.map +1 -0
  19. package/dist/chunk-SX2AYX5F.js +18 -0
  20. package/dist/chunk-SX2AYX5F.js.map +1 -0
  21. package/dist/chunk-WFDR7OMY.js +148 -0
  22. package/dist/chunk-WFDR7OMY.js.map +1 -0
  23. package/dist/chunk-Z7XZQBAK.cjs +2339 -0
  24. package/dist/chunk-Z7XZQBAK.cjs.map +1 -0
  25. package/dist/fs.cjs +19 -2372
  26. package/dist/fs.cjs.map +1 -1
  27. package/dist/fs.js +3 -2373
  28. package/dist/fs.js.map +1 -1
  29. package/dist/index.cjs +219 -3118
  30. package/dist/index.cjs.map +1 -1
  31. package/dist/index.d.cts +0 -1
  32. package/dist/index.d.ts +0 -1
  33. package/dist/index.js +55 -3245
  34. package/dist/index.js.map +1 -1
  35. package/dist/logger.cjs +16 -81
  36. package/dist/logger.cjs.map +1 -1
  37. package/dist/logger.d.cts +2 -3
  38. package/dist/logger.d.ts +2 -3
  39. package/dist/logger.js +2 -73
  40. package/dist/logger.js.map +1 -1
  41. package/dist/transformers.cjs +40 -138
  42. package/dist/transformers.cjs.map +1 -1
  43. package/dist/transformers.js +14 -126
  44. package/dist/transformers.js.map +1 -1
  45. package/dist/utils.cjs +29 -461
  46. package/dist/utils.cjs.map +1 -1
  47. package/dist/utils.js +10 -453
  48. package/dist/utils.js.map +1 -1
  49. package/package.json +7 -7
  50. package/src/BarrelManager.ts +3 -3
  51. package/src/FileManager.ts +6 -5
  52. package/src/build.ts +8 -8
  53. package/src/logger.ts +6 -8
  54. package/src/plugin.ts +1 -1
  55. package/src/transformers/casing.ts +3 -3
  56. package/src/utils/FunctionParams.ts +2 -2
  57. package/src/utils/URLPath.ts +5 -5
package/dist/index.cjs CHANGED
@@ -2,23 +2,23 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var pc2 = require('picocolors');
5
+ var chunkABFPJZJL_cjs = require('./chunk-ABFPJZJL.cjs');
6
+ var chunk72O327DC_cjs = require('./chunk-72O327DC.cjs');
7
+ require('./chunk-PY7I7OEN.cjs');
8
+ var chunk77QZQ377_cjs = require('./chunk-77QZQ377.cjs');
9
+ var chunkZ7XZQBAK_cjs = require('./chunk-Z7XZQBAK.cjs');
10
+ var chunkI7UUR5MZ_cjs = require('./chunk-I7UUR5MZ.cjs');
11
+ var crypto = require('crypto');
6
12
  var path4 = require('path');
7
- var jsRuntime = require('js-runtime');
8
- var changeCase = require('change-case');
9
- var crypto2 = require('crypto');
10
13
  var parser = require('@kubb/parser');
11
14
  var factory = require('@kubb/parser/factory');
12
15
  var naturalOrderby = require('natural-orderby');
13
16
  var dirTree = require('directory-tree');
14
- var seedrandom = require('seedrandom');
15
- var events = require('events');
16
- var perf_hooks = require('perf_hooks');
17
17
  var mod = require('module');
18
18
  var os = require('os');
19
19
  var url = require('url');
20
- var process2 = require('process');
21
- var fs3 = require('fs');
20
+ var process = require('process');
21
+ var fs = require('fs');
22
22
  var semver = require('semver');
23
23
 
24
24
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
@@ -41,2302 +41,19 @@ function _interopNamespace(e) {
41
41
  return Object.freeze(n);
42
42
  }
43
43
 
44
- var pc2__default = /*#__PURE__*/_interopDefault(pc2);
44
+ var crypto__default = /*#__PURE__*/_interopDefault(crypto);
45
45
  var path4__default = /*#__PURE__*/_interopDefault(path4);
46
- var crypto2__default = /*#__PURE__*/_interopDefault(crypto2);
47
46
  var factory__namespace = /*#__PURE__*/_interopNamespace(factory);
48
47
  var dirTree__default = /*#__PURE__*/_interopDefault(dirTree);
49
- var seedrandom__default = /*#__PURE__*/_interopDefault(seedrandom);
50
48
  var mod__default = /*#__PURE__*/_interopDefault(mod);
51
49
  var os__default = /*#__PURE__*/_interopDefault(os);
52
- var process2__default = /*#__PURE__*/_interopDefault(process2);
53
- var fs3__default = /*#__PURE__*/_interopDefault(fs3);
54
-
55
- var __create = Object.create;
56
- var __defProp = Object.defineProperty;
57
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
58
- var __getOwnPropNames = Object.getOwnPropertyNames;
59
- var __getProtoOf = Object.getPrototypeOf;
60
- var __hasOwnProp = Object.prototype.hasOwnProperty;
61
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
62
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
63
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
64
- }) : x)(function(x) {
65
- if (typeof require !== "undefined")
66
- return require.apply(this, arguments);
67
- throw Error('Dynamic require of "' + x + '" is not supported');
68
- });
69
- var __esm = (fn, res) => function __init() {
70
- return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
71
- };
72
- var __commonJS = (cb, mod2) => function __require2() {
73
- return mod2 || (0, cb[__getOwnPropNames(cb)[0]])((mod2 = { exports: {} }).exports, mod2), mod2.exports;
74
- };
75
- var __copyProps = (to, from, except, desc) => {
76
- if (from && typeof from === "object" || typeof from === "function") {
77
- for (let key of __getOwnPropNames(from))
78
- if (!__hasOwnProp.call(to, key) && key !== except)
79
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
80
- }
81
- return to;
82
- };
83
- var __toESM = (mod2, isNodeMode, target) => (target = mod2 != null ? __create(__getProtoOf(mod2)) : {}, __copyProps(
84
- // If the importer is in node compatibility mode or this is not an ESM
85
- // file that has been converted to a CommonJS file using a Babel-
86
- // compatible transform (i.e. "__esModule" has not been set), then set
87
- // "default" to the CommonJS "module.exports" for node compatibility.
88
- isNodeMode || !mod2 || !mod2.__esModule ? __defProp(target, "default", { value: mod2, enumerable: true }) : target,
89
- mod2
90
- ));
91
- var __publicField = (obj, key, value) => {
92
- __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
93
- return value;
94
- };
95
- var __accessCheck = (obj, member, msg) => {
96
- if (!member.has(obj))
97
- throw TypeError("Cannot " + msg);
98
- };
99
- var __privateGet = (obj, member, getter) => {
100
- __accessCheck(obj, member, "read from private field");
101
- return getter ? getter.call(obj) : member.get(obj);
102
- };
103
- var __privateAdd = (obj, member, value) => {
104
- if (member.has(obj))
105
- throw TypeError("Cannot add the same private member more than once");
106
- member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
107
- };
108
- var __privateSet = (obj, member, value, setter) => {
109
- __accessCheck(obj, member, "write to private field");
110
- setter ? setter.call(obj, value) : member.set(obj, value);
111
- return value;
112
- };
113
- var __privateWrapper = (obj, member, setter, getter) => ({
114
- set _(value) {
115
- __privateSet(obj, member, value, setter);
116
- },
117
- get _() {
118
- return __privateGet(obj, member, getter);
119
- }
120
- });
121
- var __privateMethod = (obj, member, method) => {
122
- __accessCheck(obj, member, "access private method");
123
- return method;
124
- };
125
-
126
- // ../../node_modules/.pnpm/tsup@8.0.1_@microsoft+api-extractor@7.38.3_ts-node@10.9.1_typescript@5.3.2/node_modules/tsup/assets/cjs_shims.js
127
- var init_cjs_shims = __esm({
128
- "../../node_modules/.pnpm/tsup@8.0.1_@microsoft+api-extractor@7.38.3_ts-node@10.9.1_typescript@5.3.2/node_modules/tsup/assets/cjs_shims.js"() {
129
- }
130
- });
131
-
132
- // ../../node_modules/.pnpm/universalify@2.0.1/node_modules/universalify/index.js
133
- var require_universalify = __commonJS({
134
- "../../node_modules/.pnpm/universalify@2.0.1/node_modules/universalify/index.js"(exports) {
135
- init_cjs_shims();
136
- exports.fromCallback = function(fn) {
137
- return Object.defineProperty(function(...args) {
138
- if (typeof args[args.length - 1] === "function")
139
- fn.apply(this, args);
140
- else {
141
- return new Promise((resolve3, reject) => {
142
- args.push((err, res) => err != null ? reject(err) : resolve3(res));
143
- fn.apply(this, args);
144
- });
145
- }
146
- }, "name", { value: fn.name });
147
- };
148
- exports.fromPromise = function(fn) {
149
- return Object.defineProperty(function(...args) {
150
- const cb = args[args.length - 1];
151
- if (typeof cb !== "function")
152
- return fn.apply(this, args);
153
- else {
154
- args.pop();
155
- fn.apply(this, args).then((r) => cb(null, r), cb);
156
- }
157
- }, "name", { value: fn.name });
158
- };
159
- }
160
- });
161
-
162
- // ../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/polyfills.js
163
- var require_polyfills = __commonJS({
164
- "../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/polyfills.js"(exports, module) {
165
- init_cjs_shims();
166
- var constants = __require("constants");
167
- var origCwd = process.cwd;
168
- var cwd = null;
169
- var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform;
170
- process.cwd = function() {
171
- if (!cwd)
172
- cwd = origCwd.call(process);
173
- return cwd;
174
- };
175
- try {
176
- process.cwd();
177
- } catch (er) {
178
- }
179
- if (typeof process.chdir === "function") {
180
- chdir = process.chdir;
181
- process.chdir = function(d) {
182
- cwd = null;
183
- chdir.call(process, d);
184
- };
185
- if (Object.setPrototypeOf)
186
- Object.setPrototypeOf(process.chdir, chdir);
187
- }
188
- var chdir;
189
- module.exports = patch;
190
- function patch(fs5) {
191
- if (constants.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) {
192
- patchLchmod(fs5);
193
- }
194
- if (!fs5.lutimes) {
195
- patchLutimes(fs5);
196
- }
197
- fs5.chown = chownFix(fs5.chown);
198
- fs5.fchown = chownFix(fs5.fchown);
199
- fs5.lchown = chownFix(fs5.lchown);
200
- fs5.chmod = chmodFix(fs5.chmod);
201
- fs5.fchmod = chmodFix(fs5.fchmod);
202
- fs5.lchmod = chmodFix(fs5.lchmod);
203
- fs5.chownSync = chownFixSync(fs5.chownSync);
204
- fs5.fchownSync = chownFixSync(fs5.fchownSync);
205
- fs5.lchownSync = chownFixSync(fs5.lchownSync);
206
- fs5.chmodSync = chmodFixSync(fs5.chmodSync);
207
- fs5.fchmodSync = chmodFixSync(fs5.fchmodSync);
208
- fs5.lchmodSync = chmodFixSync(fs5.lchmodSync);
209
- fs5.stat = statFix(fs5.stat);
210
- fs5.fstat = statFix(fs5.fstat);
211
- fs5.lstat = statFix(fs5.lstat);
212
- fs5.statSync = statFixSync(fs5.statSync);
213
- fs5.fstatSync = statFixSync(fs5.fstatSync);
214
- fs5.lstatSync = statFixSync(fs5.lstatSync);
215
- if (fs5.chmod && !fs5.lchmod) {
216
- fs5.lchmod = function(path5, mode, cb) {
217
- if (cb)
218
- process.nextTick(cb);
219
- };
220
- fs5.lchmodSync = function() {
221
- };
222
- }
223
- if (fs5.chown && !fs5.lchown) {
224
- fs5.lchown = function(path5, uid, gid, cb) {
225
- if (cb)
226
- process.nextTick(cb);
227
- };
228
- fs5.lchownSync = function() {
229
- };
230
- }
231
- if (platform === "win32") {
232
- fs5.rename = typeof fs5.rename !== "function" ? fs5.rename : function(fs$rename) {
233
- function rename(from, to, cb) {
234
- var start = Date.now();
235
- var backoff = 0;
236
- fs$rename(from, to, function CB(er) {
237
- if (er && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY") && Date.now() - start < 6e4) {
238
- setTimeout(function() {
239
- fs5.stat(to, function(stater, st) {
240
- if (stater && stater.code === "ENOENT")
241
- fs$rename(from, to, CB);
242
- else
243
- cb(er);
244
- });
245
- }, backoff);
246
- if (backoff < 100)
247
- backoff += 10;
248
- return;
249
- }
250
- if (cb)
251
- cb(er);
252
- });
253
- }
254
- if (Object.setPrototypeOf)
255
- Object.setPrototypeOf(rename, fs$rename);
256
- return rename;
257
- }(fs5.rename);
258
- }
259
- fs5.read = typeof fs5.read !== "function" ? fs5.read : function(fs$read) {
260
- function read2(fd, buffer, offset, length, position, callback_) {
261
- var callback;
262
- if (callback_ && typeof callback_ === "function") {
263
- var eagCounter = 0;
264
- callback = function(er, _, __) {
265
- if (er && er.code === "EAGAIN" && eagCounter < 10) {
266
- eagCounter++;
267
- return fs$read.call(fs5, fd, buffer, offset, length, position, callback);
268
- }
269
- callback_.apply(this, arguments);
270
- };
271
- }
272
- return fs$read.call(fs5, fd, buffer, offset, length, position, callback);
273
- }
274
- if (Object.setPrototypeOf)
275
- Object.setPrototypeOf(read2, fs$read);
276
- return read2;
277
- }(fs5.read);
278
- fs5.readSync = typeof fs5.readSync !== "function" ? fs5.readSync : /* @__PURE__ */ function(fs$readSync) {
279
- return function(fd, buffer, offset, length, position) {
280
- var eagCounter = 0;
281
- while (true) {
282
- try {
283
- return fs$readSync.call(fs5, fd, buffer, offset, length, position);
284
- } catch (er) {
285
- if (er.code === "EAGAIN" && eagCounter < 10) {
286
- eagCounter++;
287
- continue;
288
- }
289
- throw er;
290
- }
291
- }
292
- };
293
- }(fs5.readSync);
294
- function patchLchmod(fs6) {
295
- fs6.lchmod = function(path5, mode, callback) {
296
- fs6.open(
297
- path5,
298
- constants.O_WRONLY | constants.O_SYMLINK,
299
- mode,
300
- function(err, fd) {
301
- if (err) {
302
- if (callback)
303
- callback(err);
304
- return;
305
- }
306
- fs6.fchmod(fd, mode, function(err2) {
307
- fs6.close(fd, function(err22) {
308
- if (callback)
309
- callback(err2 || err22);
310
- });
311
- });
312
- }
313
- );
314
- };
315
- fs6.lchmodSync = function(path5, mode) {
316
- var fd = fs6.openSync(path5, constants.O_WRONLY | constants.O_SYMLINK, mode);
317
- var threw = true;
318
- var ret;
319
- try {
320
- ret = fs6.fchmodSync(fd, mode);
321
- threw = false;
322
- } finally {
323
- if (threw) {
324
- try {
325
- fs6.closeSync(fd);
326
- } catch (er) {
327
- }
328
- } else {
329
- fs6.closeSync(fd);
330
- }
331
- }
332
- return ret;
333
- };
334
- }
335
- function patchLutimes(fs6) {
336
- if (constants.hasOwnProperty("O_SYMLINK") && fs6.futimes) {
337
- fs6.lutimes = function(path5, at, mt, cb) {
338
- fs6.open(path5, constants.O_SYMLINK, function(er, fd) {
339
- if (er) {
340
- if (cb)
341
- cb(er);
342
- return;
343
- }
344
- fs6.futimes(fd, at, mt, function(er2) {
345
- fs6.close(fd, function(er22) {
346
- if (cb)
347
- cb(er2 || er22);
348
- });
349
- });
350
- });
351
- };
352
- fs6.lutimesSync = function(path5, at, mt) {
353
- var fd = fs6.openSync(path5, constants.O_SYMLINK);
354
- var ret;
355
- var threw = true;
356
- try {
357
- ret = fs6.futimesSync(fd, at, mt);
358
- threw = false;
359
- } finally {
360
- if (threw) {
361
- try {
362
- fs6.closeSync(fd);
363
- } catch (er) {
364
- }
365
- } else {
366
- fs6.closeSync(fd);
367
- }
368
- }
369
- return ret;
370
- };
371
- } else if (fs6.futimes) {
372
- fs6.lutimes = function(_a, _b, _c, cb) {
373
- if (cb)
374
- process.nextTick(cb);
375
- };
376
- fs6.lutimesSync = function() {
377
- };
378
- }
379
- }
380
- function chmodFix(orig) {
381
- if (!orig)
382
- return orig;
383
- return function(target, mode, cb) {
384
- return orig.call(fs5, target, mode, function(er) {
385
- if (chownErOk(er))
386
- er = null;
387
- if (cb)
388
- cb.apply(this, arguments);
389
- });
390
- };
391
- }
392
- function chmodFixSync(orig) {
393
- if (!orig)
394
- return orig;
395
- return function(target, mode) {
396
- try {
397
- return orig.call(fs5, target, mode);
398
- } catch (er) {
399
- if (!chownErOk(er))
400
- throw er;
401
- }
402
- };
403
- }
404
- function chownFix(orig) {
405
- if (!orig)
406
- return orig;
407
- return function(target, uid, gid, cb) {
408
- return orig.call(fs5, target, uid, gid, function(er) {
409
- if (chownErOk(er))
410
- er = null;
411
- if (cb)
412
- cb.apply(this, arguments);
413
- });
414
- };
415
- }
416
- function chownFixSync(orig) {
417
- if (!orig)
418
- return orig;
419
- return function(target, uid, gid) {
420
- try {
421
- return orig.call(fs5, target, uid, gid);
422
- } catch (er) {
423
- if (!chownErOk(er))
424
- throw er;
425
- }
426
- };
427
- }
428
- function statFix(orig) {
429
- if (!orig)
430
- return orig;
431
- return function(target, options, cb) {
432
- if (typeof options === "function") {
433
- cb = options;
434
- options = null;
435
- }
436
- function callback(er, stats) {
437
- if (stats) {
438
- if (stats.uid < 0)
439
- stats.uid += 4294967296;
440
- if (stats.gid < 0)
441
- stats.gid += 4294967296;
442
- }
443
- if (cb)
444
- cb.apply(this, arguments);
445
- }
446
- return options ? orig.call(fs5, target, options, callback) : orig.call(fs5, target, callback);
447
- };
448
- }
449
- function statFixSync(orig) {
450
- if (!orig)
451
- return orig;
452
- return function(target, options) {
453
- var stats = options ? orig.call(fs5, target, options) : orig.call(fs5, target);
454
- if (stats) {
455
- if (stats.uid < 0)
456
- stats.uid += 4294967296;
457
- if (stats.gid < 0)
458
- stats.gid += 4294967296;
459
- }
460
- return stats;
461
- };
462
- }
463
- function chownErOk(er) {
464
- if (!er)
465
- return true;
466
- if (er.code === "ENOSYS")
467
- return true;
468
- var nonroot = !process.getuid || process.getuid() !== 0;
469
- if (nonroot) {
470
- if (er.code === "EINVAL" || er.code === "EPERM")
471
- return true;
472
- }
473
- return false;
474
- }
475
- }
476
- }
477
- });
478
-
479
- // ../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/legacy-streams.js
480
- var require_legacy_streams = __commonJS({
481
- "../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/legacy-streams.js"(exports, module) {
482
- init_cjs_shims();
483
- var Stream = __require("stream").Stream;
484
- module.exports = legacy;
485
- function legacy(fs5) {
486
- return {
487
- ReadStream,
488
- WriteStream
489
- };
490
- function ReadStream(path5, options) {
491
- if (!(this instanceof ReadStream))
492
- return new ReadStream(path5, options);
493
- Stream.call(this);
494
- var self2 = this;
495
- this.path = path5;
496
- this.fd = null;
497
- this.readable = true;
498
- this.paused = false;
499
- this.flags = "r";
500
- this.mode = 438;
501
- this.bufferSize = 64 * 1024;
502
- options = options || {};
503
- var keys = Object.keys(options);
504
- for (var index = 0, length = keys.length; index < length; index++) {
505
- var key = keys[index];
506
- this[key] = options[key];
507
- }
508
- if (this.encoding)
509
- this.setEncoding(this.encoding);
510
- if (this.start !== void 0) {
511
- if ("number" !== typeof this.start) {
512
- throw TypeError("start must be a Number");
513
- }
514
- if (this.end === void 0) {
515
- this.end = Infinity;
516
- } else if ("number" !== typeof this.end) {
517
- throw TypeError("end must be a Number");
518
- }
519
- if (this.start > this.end) {
520
- throw new Error("start must be <= end");
521
- }
522
- this.pos = this.start;
523
- }
524
- if (this.fd !== null) {
525
- process.nextTick(function() {
526
- self2._read();
527
- });
528
- return;
529
- }
530
- fs5.open(this.path, this.flags, this.mode, function(err, fd) {
531
- if (err) {
532
- self2.emit("error", err);
533
- self2.readable = false;
534
- return;
535
- }
536
- self2.fd = fd;
537
- self2.emit("open", fd);
538
- self2._read();
539
- });
540
- }
541
- function WriteStream(path5, options) {
542
- if (!(this instanceof WriteStream))
543
- return new WriteStream(path5, options);
544
- Stream.call(this);
545
- this.path = path5;
546
- this.fd = null;
547
- this.writable = true;
548
- this.flags = "w";
549
- this.encoding = "binary";
550
- this.mode = 438;
551
- this.bytesWritten = 0;
552
- options = options || {};
553
- var keys = Object.keys(options);
554
- for (var index = 0, length = keys.length; index < length; index++) {
555
- var key = keys[index];
556
- this[key] = options[key];
557
- }
558
- if (this.start !== void 0) {
559
- if ("number" !== typeof this.start) {
560
- throw TypeError("start must be a Number");
561
- }
562
- if (this.start < 0) {
563
- throw new Error("start must be >= zero");
564
- }
565
- this.pos = this.start;
566
- }
567
- this.busy = false;
568
- this._queue = [];
569
- if (this.fd === null) {
570
- this._open = fs5.open;
571
- this._queue.push([this._open, this.path, this.flags, this.mode, void 0]);
572
- this.flush();
573
- }
574
- }
575
- }
576
- }
577
- });
578
-
579
- // ../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/clone.js
580
- var require_clone = __commonJS({
581
- "../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/clone.js"(exports, module) {
582
- init_cjs_shims();
583
- module.exports = clone;
584
- var getPrototypeOf = Object.getPrototypeOf || function(obj) {
585
- return obj.__proto__;
586
- };
587
- function clone(obj) {
588
- if (obj === null || typeof obj !== "object")
589
- return obj;
590
- if (obj instanceof Object)
591
- var copy = { __proto__: getPrototypeOf(obj) };
592
- else
593
- var copy = /* @__PURE__ */ Object.create(null);
594
- Object.getOwnPropertyNames(obj).forEach(function(key) {
595
- Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key));
596
- });
597
- return copy;
598
- }
599
- }
600
- });
601
-
602
- // ../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/graceful-fs.js
603
- var require_graceful_fs = __commonJS({
604
- "../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/graceful-fs.js"(exports, module) {
605
- init_cjs_shims();
606
- var fs5 = __require("fs");
607
- var polyfills = require_polyfills();
608
- var legacy = require_legacy_streams();
609
- var clone = require_clone();
610
- var util = __require("util");
611
- var gracefulQueue;
612
- var previousSymbol;
613
- if (typeof Symbol === "function" && typeof Symbol.for === "function") {
614
- gracefulQueue = Symbol.for("graceful-fs.queue");
615
- previousSymbol = Symbol.for("graceful-fs.previous");
616
- } else {
617
- gracefulQueue = "___graceful-fs.queue";
618
- previousSymbol = "___graceful-fs.previous";
619
- }
620
- function noop() {
621
- }
622
- function publishQueue(context, queue2) {
623
- Object.defineProperty(context, gracefulQueue, {
624
- get: function() {
625
- return queue2;
626
- }
627
- });
628
- }
629
- var debug = noop;
630
- if (util.debuglog)
631
- debug = util.debuglog("gfs4");
632
- else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || ""))
633
- debug = function() {
634
- var m = util.format.apply(util, arguments);
635
- m = "GFS4: " + m.split(/\n/).join("\nGFS4: ");
636
- console.error(m);
637
- };
638
- if (!fs5[gracefulQueue]) {
639
- queue = global[gracefulQueue] || [];
640
- publishQueue(fs5, queue);
641
- fs5.close = function(fs$close) {
642
- function close(fd, cb) {
643
- return fs$close.call(fs5, fd, function(err) {
644
- if (!err) {
645
- resetQueue();
646
- }
647
- if (typeof cb === "function")
648
- cb.apply(this, arguments);
649
- });
650
- }
651
- Object.defineProperty(close, previousSymbol, {
652
- value: fs$close
653
- });
654
- return close;
655
- }(fs5.close);
656
- fs5.closeSync = function(fs$closeSync) {
657
- function closeSync(fd) {
658
- fs$closeSync.apply(fs5, arguments);
659
- resetQueue();
660
- }
661
- Object.defineProperty(closeSync, previousSymbol, {
662
- value: fs$closeSync
663
- });
664
- return closeSync;
665
- }(fs5.closeSync);
666
- if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) {
667
- process.on("exit", function() {
668
- debug(fs5[gracefulQueue]);
669
- __require("assert").equal(fs5[gracefulQueue].length, 0);
670
- });
671
- }
672
- }
673
- var queue;
674
- if (!global[gracefulQueue]) {
675
- publishQueue(global, fs5[gracefulQueue]);
676
- }
677
- module.exports = patch(clone(fs5));
678
- if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs5.__patched) {
679
- module.exports = patch(fs5);
680
- fs5.__patched = true;
681
- }
682
- function patch(fs6) {
683
- polyfills(fs6);
684
- fs6.gracefulify = patch;
685
- fs6.createReadStream = createReadStream;
686
- fs6.createWriteStream = createWriteStream;
687
- var fs$readFile = fs6.readFile;
688
- fs6.readFile = readFile;
689
- function readFile(path5, options, cb) {
690
- if (typeof options === "function")
691
- cb = options, options = null;
692
- return go$readFile(path5, options, cb);
693
- function go$readFile(path6, options2, cb2, startTime) {
694
- return fs$readFile(path6, options2, function(err) {
695
- if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
696
- enqueue([go$readFile, [path6, options2, cb2], err, startTime || Date.now(), Date.now()]);
697
- else {
698
- if (typeof cb2 === "function")
699
- cb2.apply(this, arguments);
700
- }
701
- });
702
- }
703
- }
704
- var fs$writeFile = fs6.writeFile;
705
- fs6.writeFile = writeFile;
706
- function writeFile(path5, data, options, cb) {
707
- if (typeof options === "function")
708
- cb = options, options = null;
709
- return go$writeFile(path5, data, options, cb);
710
- function go$writeFile(path6, data2, options2, cb2, startTime) {
711
- return fs$writeFile(path6, data2, options2, function(err) {
712
- if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
713
- enqueue([go$writeFile, [path6, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
714
- else {
715
- if (typeof cb2 === "function")
716
- cb2.apply(this, arguments);
717
- }
718
- });
719
- }
720
- }
721
- var fs$appendFile = fs6.appendFile;
722
- if (fs$appendFile)
723
- fs6.appendFile = appendFile;
724
- function appendFile(path5, data, options, cb) {
725
- if (typeof options === "function")
726
- cb = options, options = null;
727
- return go$appendFile(path5, data, options, cb);
728
- function go$appendFile(path6, data2, options2, cb2, startTime) {
729
- return fs$appendFile(path6, data2, options2, function(err) {
730
- if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
731
- enqueue([go$appendFile, [path6, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
732
- else {
733
- if (typeof cb2 === "function")
734
- cb2.apply(this, arguments);
735
- }
736
- });
737
- }
738
- }
739
- var fs$copyFile = fs6.copyFile;
740
- if (fs$copyFile)
741
- fs6.copyFile = copyFile;
742
- function copyFile(src, dest, flags, cb) {
743
- if (typeof flags === "function") {
744
- cb = flags;
745
- flags = 0;
746
- }
747
- return go$copyFile(src, dest, flags, cb);
748
- function go$copyFile(src2, dest2, flags2, cb2, startTime) {
749
- return fs$copyFile(src2, dest2, flags2, function(err) {
750
- if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
751
- enqueue([go$copyFile, [src2, dest2, flags2, cb2], err, startTime || Date.now(), Date.now()]);
752
- else {
753
- if (typeof cb2 === "function")
754
- cb2.apply(this, arguments);
755
- }
756
- });
757
- }
758
- }
759
- var fs$readdir = fs6.readdir;
760
- fs6.readdir = readdir;
761
- var noReaddirOptionVersions = /^v[0-5]\./;
762
- function readdir(path5, options, cb) {
763
- if (typeof options === "function")
764
- cb = options, options = null;
765
- var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path6, options2, cb2, startTime) {
766
- return fs$readdir(path6, fs$readdirCallback(
767
- path6,
768
- options2,
769
- cb2,
770
- startTime
771
- ));
772
- } : function go$readdir2(path6, options2, cb2, startTime) {
773
- return fs$readdir(path6, options2, fs$readdirCallback(
774
- path6,
775
- options2,
776
- cb2,
777
- startTime
778
- ));
779
- };
780
- return go$readdir(path5, options, cb);
781
- function fs$readdirCallback(path6, options2, cb2, startTime) {
782
- return function(err, files) {
783
- if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
784
- enqueue([
785
- go$readdir,
786
- [path6, options2, cb2],
787
- err,
788
- startTime || Date.now(),
789
- Date.now()
790
- ]);
791
- else {
792
- if (files && files.sort)
793
- files.sort();
794
- if (typeof cb2 === "function")
795
- cb2.call(this, err, files);
796
- }
797
- };
798
- }
799
- }
800
- if (process.version.substr(0, 4) === "v0.8") {
801
- var legStreams = legacy(fs6);
802
- ReadStream = legStreams.ReadStream;
803
- WriteStream = legStreams.WriteStream;
804
- }
805
- var fs$ReadStream = fs6.ReadStream;
806
- if (fs$ReadStream) {
807
- ReadStream.prototype = Object.create(fs$ReadStream.prototype);
808
- ReadStream.prototype.open = ReadStream$open;
809
- }
810
- var fs$WriteStream = fs6.WriteStream;
811
- if (fs$WriteStream) {
812
- WriteStream.prototype = Object.create(fs$WriteStream.prototype);
813
- WriteStream.prototype.open = WriteStream$open;
814
- }
815
- Object.defineProperty(fs6, "ReadStream", {
816
- get: function() {
817
- return ReadStream;
818
- },
819
- set: function(val) {
820
- ReadStream = val;
821
- },
822
- enumerable: true,
823
- configurable: true
824
- });
825
- Object.defineProperty(fs6, "WriteStream", {
826
- get: function() {
827
- return WriteStream;
828
- },
829
- set: function(val) {
830
- WriteStream = val;
831
- },
832
- enumerable: true,
833
- configurable: true
834
- });
835
- var FileReadStream = ReadStream;
836
- Object.defineProperty(fs6, "FileReadStream", {
837
- get: function() {
838
- return FileReadStream;
839
- },
840
- set: function(val) {
841
- FileReadStream = val;
842
- },
843
- enumerable: true,
844
- configurable: true
845
- });
846
- var FileWriteStream = WriteStream;
847
- Object.defineProperty(fs6, "FileWriteStream", {
848
- get: function() {
849
- return FileWriteStream;
850
- },
851
- set: function(val) {
852
- FileWriteStream = val;
853
- },
854
- enumerable: true,
855
- configurable: true
856
- });
857
- function ReadStream(path5, options) {
858
- if (this instanceof ReadStream)
859
- return fs$ReadStream.apply(this, arguments), this;
860
- else
861
- return ReadStream.apply(Object.create(ReadStream.prototype), arguments);
862
- }
863
- function ReadStream$open() {
864
- var that = this;
865
- open(that.path, that.flags, that.mode, function(err, fd) {
866
- if (err) {
867
- if (that.autoClose)
868
- that.destroy();
869
- that.emit("error", err);
870
- } else {
871
- that.fd = fd;
872
- that.emit("open", fd);
873
- that.read();
874
- }
875
- });
876
- }
877
- function WriteStream(path5, options) {
878
- if (this instanceof WriteStream)
879
- return fs$WriteStream.apply(this, arguments), this;
880
- else
881
- return WriteStream.apply(Object.create(WriteStream.prototype), arguments);
882
- }
883
- function WriteStream$open() {
884
- var that = this;
885
- open(that.path, that.flags, that.mode, function(err, fd) {
886
- if (err) {
887
- that.destroy();
888
- that.emit("error", err);
889
- } else {
890
- that.fd = fd;
891
- that.emit("open", fd);
892
- }
893
- });
894
- }
895
- function createReadStream(path5, options) {
896
- return new fs6.ReadStream(path5, options);
897
- }
898
- function createWriteStream(path5, options) {
899
- return new fs6.WriteStream(path5, options);
900
- }
901
- var fs$open = fs6.open;
902
- fs6.open = open;
903
- function open(path5, flags, mode, cb) {
904
- if (typeof mode === "function")
905
- cb = mode, mode = null;
906
- return go$open(path5, flags, mode, cb);
907
- function go$open(path6, flags2, mode2, cb2, startTime) {
908
- return fs$open(path6, flags2, mode2, function(err, fd) {
909
- if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
910
- enqueue([go$open, [path6, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]);
911
- else {
912
- if (typeof cb2 === "function")
913
- cb2.apply(this, arguments);
914
- }
915
- });
916
- }
917
- }
918
- return fs6;
919
- }
920
- function enqueue(elem) {
921
- debug("ENQUEUE", elem[0].name, elem[1]);
922
- fs5[gracefulQueue].push(elem);
923
- retry();
924
- }
925
- var retryTimer;
926
- function resetQueue() {
927
- var now = Date.now();
928
- for (var i = 0; i < fs5[gracefulQueue].length; ++i) {
929
- if (fs5[gracefulQueue][i].length > 2) {
930
- fs5[gracefulQueue][i][3] = now;
931
- fs5[gracefulQueue][i][4] = now;
932
- }
933
- }
934
- retry();
935
- }
936
- function retry() {
937
- clearTimeout(retryTimer);
938
- retryTimer = void 0;
939
- if (fs5[gracefulQueue].length === 0)
940
- return;
941
- var elem = fs5[gracefulQueue].shift();
942
- var fn = elem[0];
943
- var args = elem[1];
944
- var err = elem[2];
945
- var startTime = elem[3];
946
- var lastTime = elem[4];
947
- if (startTime === void 0) {
948
- debug("RETRY", fn.name, args);
949
- fn.apply(null, args);
950
- } else if (Date.now() - startTime >= 6e4) {
951
- debug("TIMEOUT", fn.name, args);
952
- var cb = args.pop();
953
- if (typeof cb === "function")
954
- cb.call(null, err);
955
- } else {
956
- var sinceAttempt = Date.now() - lastTime;
957
- var sinceStart = Math.max(lastTime - startTime, 1);
958
- var desiredDelay = Math.min(sinceStart * 1.2, 100);
959
- if (sinceAttempt >= desiredDelay) {
960
- debug("RETRY", fn.name, args);
961
- fn.apply(null, args.concat([startTime]));
962
- } else {
963
- fs5[gracefulQueue].push(elem);
964
- }
965
- }
966
- if (retryTimer === void 0) {
967
- retryTimer = setTimeout(retry, 0);
968
- }
969
- }
970
- }
971
- });
972
-
973
- // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/fs/index.js
974
- var require_fs = __commonJS({
975
- "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/fs/index.js"(exports) {
976
- init_cjs_shims();
977
- var u = require_universalify().fromCallback;
978
- var fs5 = require_graceful_fs();
979
- var api = [
980
- "access",
981
- "appendFile",
982
- "chmod",
983
- "chown",
984
- "close",
985
- "copyFile",
986
- "fchmod",
987
- "fchown",
988
- "fdatasync",
989
- "fstat",
990
- "fsync",
991
- "ftruncate",
992
- "futimes",
993
- "lchmod",
994
- "lchown",
995
- "link",
996
- "lstat",
997
- "mkdir",
998
- "mkdtemp",
999
- "open",
1000
- "opendir",
1001
- "readdir",
1002
- "readFile",
1003
- "readlink",
1004
- "realpath",
1005
- "rename",
1006
- "rm",
1007
- "rmdir",
1008
- "stat",
1009
- "symlink",
1010
- "truncate",
1011
- "unlink",
1012
- "utimes",
1013
- "writeFile"
1014
- ].filter((key) => {
1015
- return typeof fs5[key] === "function";
1016
- });
1017
- Object.assign(exports, fs5);
1018
- api.forEach((method) => {
1019
- exports[method] = u(fs5[method]);
1020
- });
1021
- exports.exists = function(filename, callback) {
1022
- if (typeof callback === "function") {
1023
- return fs5.exists(filename, callback);
1024
- }
1025
- return new Promise((resolve3) => {
1026
- return fs5.exists(filename, resolve3);
1027
- });
1028
- };
1029
- exports.read = function(fd, buffer, offset, length, position, callback) {
1030
- if (typeof callback === "function") {
1031
- return fs5.read(fd, buffer, offset, length, position, callback);
1032
- }
1033
- return new Promise((resolve3, reject) => {
1034
- fs5.read(fd, buffer, offset, length, position, (err, bytesRead, buffer2) => {
1035
- if (err)
1036
- return reject(err);
1037
- resolve3({ bytesRead, buffer: buffer2 });
1038
- });
1039
- });
1040
- };
1041
- exports.write = function(fd, buffer, ...args) {
1042
- if (typeof args[args.length - 1] === "function") {
1043
- return fs5.write(fd, buffer, ...args);
1044
- }
1045
- return new Promise((resolve3, reject) => {
1046
- fs5.write(fd, buffer, ...args, (err, bytesWritten, buffer2) => {
1047
- if (err)
1048
- return reject(err);
1049
- resolve3({ bytesWritten, buffer: buffer2 });
1050
- });
1051
- });
1052
- };
1053
- exports.readv = function(fd, buffers, ...args) {
1054
- if (typeof args[args.length - 1] === "function") {
1055
- return fs5.readv(fd, buffers, ...args);
1056
- }
1057
- return new Promise((resolve3, reject) => {
1058
- fs5.readv(fd, buffers, ...args, (err, bytesRead, buffers2) => {
1059
- if (err)
1060
- return reject(err);
1061
- resolve3({ bytesRead, buffers: buffers2 });
1062
- });
1063
- });
1064
- };
1065
- exports.writev = function(fd, buffers, ...args) {
1066
- if (typeof args[args.length - 1] === "function") {
1067
- return fs5.writev(fd, buffers, ...args);
1068
- }
1069
- return new Promise((resolve3, reject) => {
1070
- fs5.writev(fd, buffers, ...args, (err, bytesWritten, buffers2) => {
1071
- if (err)
1072
- return reject(err);
1073
- resolve3({ bytesWritten, buffers: buffers2 });
1074
- });
1075
- });
1076
- };
1077
- if (typeof fs5.realpath.native === "function") {
1078
- exports.realpath.native = u(fs5.realpath.native);
1079
- } else {
1080
- process.emitWarning(
1081
- "fs.realpath.native is not a function. Is fs being monkey-patched?",
1082
- "Warning",
1083
- "fs-extra-WARN0003"
1084
- );
1085
- }
1086
- }
1087
- });
1088
-
1089
- // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/mkdirs/utils.js
1090
- var require_utils = __commonJS({
1091
- "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/mkdirs/utils.js"(exports, module) {
1092
- init_cjs_shims();
1093
- var path5 = __require("path");
1094
- module.exports.checkPath = function checkPath(pth) {
1095
- if (process.platform === "win32") {
1096
- const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path5.parse(pth).root, ""));
1097
- if (pathHasInvalidWinCharacters) {
1098
- const error = new Error(`Path contains invalid characters: ${pth}`);
1099
- error.code = "EINVAL";
1100
- throw error;
1101
- }
1102
- }
1103
- };
1104
- }
1105
- });
1106
-
1107
- // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/mkdirs/make-dir.js
1108
- var require_make_dir = __commonJS({
1109
- "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/mkdirs/make-dir.js"(exports, module) {
1110
- init_cjs_shims();
1111
- var fs5 = require_fs();
1112
- var { checkPath } = require_utils();
1113
- var getMode = (options) => {
1114
- const defaults = { mode: 511 };
1115
- if (typeof options === "number")
1116
- return options;
1117
- return { ...defaults, ...options }.mode;
1118
- };
1119
- module.exports.makeDir = async (dir, options) => {
1120
- checkPath(dir);
1121
- return fs5.mkdir(dir, {
1122
- mode: getMode(options),
1123
- recursive: true
1124
- });
1125
- };
1126
- module.exports.makeDirSync = (dir, options) => {
1127
- checkPath(dir);
1128
- return fs5.mkdirSync(dir, {
1129
- mode: getMode(options),
1130
- recursive: true
1131
- });
1132
- };
1133
- }
1134
- });
1135
-
1136
- // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/mkdirs/index.js
1137
- var require_mkdirs = __commonJS({
1138
- "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/mkdirs/index.js"(exports, module) {
1139
- init_cjs_shims();
1140
- var u = require_universalify().fromPromise;
1141
- var { makeDir: _makeDir, makeDirSync } = require_make_dir();
1142
- var makeDir = u(_makeDir);
1143
- module.exports = {
1144
- mkdirs: makeDir,
1145
- mkdirsSync: makeDirSync,
1146
- // alias
1147
- mkdirp: makeDir,
1148
- mkdirpSync: makeDirSync,
1149
- ensureDir: makeDir,
1150
- ensureDirSync: makeDirSync
1151
- };
1152
- }
1153
- });
1154
-
1155
- // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/path-exists/index.js
1156
- var require_path_exists = __commonJS({
1157
- "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/path-exists/index.js"(exports, module) {
1158
- init_cjs_shims();
1159
- var u = require_universalify().fromPromise;
1160
- var fs5 = require_fs();
1161
- function pathExists2(path5) {
1162
- return fs5.access(path5).then(() => true).catch(() => false);
1163
- }
1164
- module.exports = {
1165
- pathExists: u(pathExists2),
1166
- pathExistsSync: fs5.existsSync
1167
- };
1168
- }
1169
- });
1170
-
1171
- // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/util/utimes.js
1172
- var require_utimes = __commonJS({
1173
- "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/util/utimes.js"(exports, module) {
1174
- init_cjs_shims();
1175
- var fs5 = require_fs();
1176
- var u = require_universalify().fromPromise;
1177
- async function utimesMillis(path5, atime, mtime) {
1178
- const fd = await fs5.open(path5, "r+");
1179
- let closeErr = null;
1180
- try {
1181
- await fs5.futimes(fd, atime, mtime);
1182
- } finally {
1183
- try {
1184
- await fs5.close(fd);
1185
- } catch (e) {
1186
- closeErr = e;
1187
- }
1188
- }
1189
- if (closeErr) {
1190
- throw closeErr;
1191
- }
1192
- }
1193
- function utimesMillisSync(path5, atime, mtime) {
1194
- const fd = fs5.openSync(path5, "r+");
1195
- fs5.futimesSync(fd, atime, mtime);
1196
- return fs5.closeSync(fd);
1197
- }
1198
- module.exports = {
1199
- utimesMillis: u(utimesMillis),
1200
- utimesMillisSync
1201
- };
1202
- }
1203
- });
1204
-
1205
- // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/util/stat.js
1206
- var require_stat = __commonJS({
1207
- "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/util/stat.js"(exports, module) {
1208
- init_cjs_shims();
1209
- var fs5 = require_fs();
1210
- var path5 = __require("path");
1211
- var u = require_universalify().fromPromise;
1212
- function getStats(src, dest, opts) {
1213
- const statFunc = opts.dereference ? (file) => fs5.stat(file, { bigint: true }) : (file) => fs5.lstat(file, { bigint: true });
1214
- return Promise.all([
1215
- statFunc(src),
1216
- statFunc(dest).catch((err) => {
1217
- if (err.code === "ENOENT")
1218
- return null;
1219
- throw err;
1220
- })
1221
- ]).then(([srcStat, destStat]) => ({ srcStat, destStat }));
1222
- }
1223
- function getStatsSync(src, dest, opts) {
1224
- let destStat;
1225
- const statFunc = opts.dereference ? (file) => fs5.statSync(file, { bigint: true }) : (file) => fs5.lstatSync(file, { bigint: true });
1226
- const srcStat = statFunc(src);
1227
- try {
1228
- destStat = statFunc(dest);
1229
- } catch (err) {
1230
- if (err.code === "ENOENT")
1231
- return { srcStat, destStat: null };
1232
- throw err;
1233
- }
1234
- return { srcStat, destStat };
1235
- }
1236
- async function checkPaths(src, dest, funcName, opts) {
1237
- const { srcStat, destStat } = await getStats(src, dest, opts);
1238
- if (destStat) {
1239
- if (areIdentical(srcStat, destStat)) {
1240
- const srcBaseName = path5.basename(src);
1241
- const destBaseName = path5.basename(dest);
1242
- if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
1243
- return { srcStat, destStat, isChangingCase: true };
1244
- }
1245
- throw new Error("Source and destination must not be the same.");
1246
- }
1247
- if (srcStat.isDirectory() && !destStat.isDirectory()) {
1248
- throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`);
1249
- }
1250
- if (!srcStat.isDirectory() && destStat.isDirectory()) {
1251
- throw new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`);
1252
- }
1253
- }
1254
- if (srcStat.isDirectory() && isSrcSubdir(src, dest)) {
1255
- throw new Error(errMsg(src, dest, funcName));
1256
- }
1257
- return { srcStat, destStat };
1258
- }
1259
- function checkPathsSync(src, dest, funcName, opts) {
1260
- const { srcStat, destStat } = getStatsSync(src, dest, opts);
1261
- if (destStat) {
1262
- if (areIdentical(srcStat, destStat)) {
1263
- const srcBaseName = path5.basename(src);
1264
- const destBaseName = path5.basename(dest);
1265
- if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
1266
- return { srcStat, destStat, isChangingCase: true };
1267
- }
1268
- throw new Error("Source and destination must not be the same.");
1269
- }
1270
- if (srcStat.isDirectory() && !destStat.isDirectory()) {
1271
- throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`);
1272
- }
1273
- if (!srcStat.isDirectory() && destStat.isDirectory()) {
1274
- throw new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`);
1275
- }
1276
- }
1277
- if (srcStat.isDirectory() && isSrcSubdir(src, dest)) {
1278
- throw new Error(errMsg(src, dest, funcName));
1279
- }
1280
- return { srcStat, destStat };
1281
- }
1282
- async function checkParentPaths(src, srcStat, dest, funcName) {
1283
- const srcParent = path5.resolve(path5.dirname(src));
1284
- const destParent = path5.resolve(path5.dirname(dest));
1285
- if (destParent === srcParent || destParent === path5.parse(destParent).root)
1286
- return;
1287
- let destStat;
1288
- try {
1289
- destStat = await fs5.stat(destParent, { bigint: true });
1290
- } catch (err) {
1291
- if (err.code === "ENOENT")
1292
- return;
1293
- throw err;
1294
- }
1295
- if (areIdentical(srcStat, destStat)) {
1296
- throw new Error(errMsg(src, dest, funcName));
1297
- }
1298
- return checkParentPaths(src, srcStat, destParent, funcName);
1299
- }
1300
- function checkParentPathsSync(src, srcStat, dest, funcName) {
1301
- const srcParent = path5.resolve(path5.dirname(src));
1302
- const destParent = path5.resolve(path5.dirname(dest));
1303
- if (destParent === srcParent || destParent === path5.parse(destParent).root)
1304
- return;
1305
- let destStat;
1306
- try {
1307
- destStat = fs5.statSync(destParent, { bigint: true });
1308
- } catch (err) {
1309
- if (err.code === "ENOENT")
1310
- return;
1311
- throw err;
1312
- }
1313
- if (areIdentical(srcStat, destStat)) {
1314
- throw new Error(errMsg(src, dest, funcName));
1315
- }
1316
- return checkParentPathsSync(src, srcStat, destParent, funcName);
1317
- }
1318
- function areIdentical(srcStat, destStat) {
1319
- return destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev;
1320
- }
1321
- function isSrcSubdir(src, dest) {
1322
- const srcArr = path5.resolve(src).split(path5.sep).filter((i) => i);
1323
- const destArr = path5.resolve(dest).split(path5.sep).filter((i) => i);
1324
- return srcArr.every((cur, i) => destArr[i] === cur);
1325
- }
1326
- function errMsg(src, dest, funcName) {
1327
- return `Cannot ${funcName} '${src}' to a subdirectory of itself, '${dest}'.`;
1328
- }
1329
- module.exports = {
1330
- // checkPaths
1331
- checkPaths: u(checkPaths),
1332
- checkPathsSync,
1333
- // checkParent
1334
- checkParentPaths: u(checkParentPaths),
1335
- checkParentPathsSync,
1336
- // Misc
1337
- isSrcSubdir,
1338
- areIdentical
1339
- };
1340
- }
1341
- });
1342
-
1343
- // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/copy/copy.js
1344
- var require_copy = __commonJS({
1345
- "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/copy/copy.js"(exports, module) {
1346
- init_cjs_shims();
1347
- var fs5 = require_fs();
1348
- var path5 = __require("path");
1349
- var { mkdirs } = require_mkdirs();
1350
- var { pathExists: pathExists2 } = require_path_exists();
1351
- var { utimesMillis } = require_utimes();
1352
- var stat = require_stat();
1353
- async function copy(src, dest, opts = {}) {
1354
- if (typeof opts === "function") {
1355
- opts = { filter: opts };
1356
- }
1357
- opts.clobber = "clobber" in opts ? !!opts.clobber : true;
1358
- opts.overwrite = "overwrite" in opts ? !!opts.overwrite : opts.clobber;
1359
- if (opts.preserveTimestamps && process.arch === "ia32") {
1360
- process.emitWarning(
1361
- "Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269",
1362
- "Warning",
1363
- "fs-extra-WARN0001"
1364
- );
1365
- }
1366
- const { srcStat, destStat } = await stat.checkPaths(src, dest, "copy", opts);
1367
- await stat.checkParentPaths(src, srcStat, dest, "copy");
1368
- const include = await runFilter(src, dest, opts);
1369
- if (!include)
1370
- return;
1371
- const destParent = path5.dirname(dest);
1372
- const dirExists = await pathExists2(destParent);
1373
- if (!dirExists) {
1374
- await mkdirs(destParent);
1375
- }
1376
- await getStatsAndPerformCopy(destStat, src, dest, opts);
1377
- }
1378
- async function runFilter(src, dest, opts) {
1379
- if (!opts.filter)
1380
- return true;
1381
- return opts.filter(src, dest);
1382
- }
1383
- async function getStatsAndPerformCopy(destStat, src, dest, opts) {
1384
- const statFn = opts.dereference ? fs5.stat : fs5.lstat;
1385
- const srcStat = await statFn(src);
1386
- if (srcStat.isDirectory())
1387
- return onDir(srcStat, destStat, src, dest, opts);
1388
- if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice())
1389
- return onFile(srcStat, destStat, src, dest, opts);
1390
- if (srcStat.isSymbolicLink())
1391
- return onLink(destStat, src, dest, opts);
1392
- if (srcStat.isSocket())
1393
- throw new Error(`Cannot copy a socket file: ${src}`);
1394
- if (srcStat.isFIFO())
1395
- throw new Error(`Cannot copy a FIFO pipe: ${src}`);
1396
- throw new Error(`Unknown file: ${src}`);
1397
- }
1398
- async function onFile(srcStat, destStat, src, dest, opts) {
1399
- if (!destStat)
1400
- return copyFile(srcStat, src, dest, opts);
1401
- if (opts.overwrite) {
1402
- await fs5.unlink(dest);
1403
- return copyFile(srcStat, src, dest, opts);
1404
- }
1405
- if (opts.errorOnExist) {
1406
- throw new Error(`'${dest}' already exists`);
1407
- }
1408
- }
1409
- async function copyFile(srcStat, src, dest, opts) {
1410
- await fs5.copyFile(src, dest);
1411
- if (opts.preserveTimestamps) {
1412
- if (fileIsNotWritable(srcStat.mode)) {
1413
- await makeFileWritable(dest, srcStat.mode);
1414
- }
1415
- const updatedSrcStat = await fs5.stat(src);
1416
- await utimesMillis(dest, updatedSrcStat.atime, updatedSrcStat.mtime);
1417
- }
1418
- return fs5.chmod(dest, srcStat.mode);
1419
- }
1420
- function fileIsNotWritable(srcMode) {
1421
- return (srcMode & 128) === 0;
1422
- }
1423
- function makeFileWritable(dest, srcMode) {
1424
- return fs5.chmod(dest, srcMode | 128);
1425
- }
1426
- async function onDir(srcStat, destStat, src, dest, opts) {
1427
- if (!destStat) {
1428
- await fs5.mkdir(dest);
1429
- }
1430
- const items = await fs5.readdir(src);
1431
- await Promise.all(items.map(async (item) => {
1432
- const srcItem = path5.join(src, item);
1433
- const destItem = path5.join(dest, item);
1434
- const include = await runFilter(srcItem, destItem, opts);
1435
- if (!include)
1436
- return;
1437
- const { destStat: destStat2 } = await stat.checkPaths(srcItem, destItem, "copy", opts);
1438
- return getStatsAndPerformCopy(destStat2, srcItem, destItem, opts);
1439
- }));
1440
- if (!destStat) {
1441
- await fs5.chmod(dest, srcStat.mode);
1442
- }
1443
- }
1444
- async function onLink(destStat, src, dest, opts) {
1445
- let resolvedSrc = await fs5.readlink(src);
1446
- if (opts.dereference) {
1447
- resolvedSrc = path5.resolve(process.cwd(), resolvedSrc);
1448
- }
1449
- if (!destStat) {
1450
- return fs5.symlink(resolvedSrc, dest);
1451
- }
1452
- let resolvedDest = null;
1453
- try {
1454
- resolvedDest = await fs5.readlink(dest);
1455
- } catch (e) {
1456
- if (e.code === "EINVAL" || e.code === "UNKNOWN")
1457
- return fs5.symlink(resolvedSrc, dest);
1458
- throw e;
1459
- }
1460
- if (opts.dereference) {
1461
- resolvedDest = path5.resolve(process.cwd(), resolvedDest);
1462
- }
1463
- if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
1464
- throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`);
1465
- }
1466
- if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) {
1467
- throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`);
1468
- }
1469
- await fs5.unlink(dest);
1470
- return fs5.symlink(resolvedSrc, dest);
1471
- }
1472
- module.exports = copy;
1473
- }
1474
- });
1475
-
1476
- // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/copy/copy-sync.js
1477
- var require_copy_sync = __commonJS({
1478
- "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/copy/copy-sync.js"(exports, module) {
1479
- init_cjs_shims();
1480
- var fs5 = require_graceful_fs();
1481
- var path5 = __require("path");
1482
- var mkdirsSync = require_mkdirs().mkdirsSync;
1483
- var utimesMillisSync = require_utimes().utimesMillisSync;
1484
- var stat = require_stat();
1485
- function copySync(src, dest, opts) {
1486
- if (typeof opts === "function") {
1487
- opts = { filter: opts };
1488
- }
1489
- opts = opts || {};
1490
- opts.clobber = "clobber" in opts ? !!opts.clobber : true;
1491
- opts.overwrite = "overwrite" in opts ? !!opts.overwrite : opts.clobber;
1492
- if (opts.preserveTimestamps && process.arch === "ia32") {
1493
- process.emitWarning(
1494
- "Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269",
1495
- "Warning",
1496
- "fs-extra-WARN0002"
1497
- );
1498
- }
1499
- const { srcStat, destStat } = stat.checkPathsSync(src, dest, "copy", opts);
1500
- stat.checkParentPathsSync(src, srcStat, dest, "copy");
1501
- if (opts.filter && !opts.filter(src, dest))
1502
- return;
1503
- const destParent = path5.dirname(dest);
1504
- if (!fs5.existsSync(destParent))
1505
- mkdirsSync(destParent);
1506
- return getStats(destStat, src, dest, opts);
1507
- }
1508
- function getStats(destStat, src, dest, opts) {
1509
- const statSync = opts.dereference ? fs5.statSync : fs5.lstatSync;
1510
- const srcStat = statSync(src);
1511
- if (srcStat.isDirectory())
1512
- return onDir(srcStat, destStat, src, dest, opts);
1513
- else if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice())
1514
- return onFile(srcStat, destStat, src, dest, opts);
1515
- else if (srcStat.isSymbolicLink())
1516
- return onLink(destStat, src, dest, opts);
1517
- else if (srcStat.isSocket())
1518
- throw new Error(`Cannot copy a socket file: ${src}`);
1519
- else if (srcStat.isFIFO())
1520
- throw new Error(`Cannot copy a FIFO pipe: ${src}`);
1521
- throw new Error(`Unknown file: ${src}`);
1522
- }
1523
- function onFile(srcStat, destStat, src, dest, opts) {
1524
- if (!destStat)
1525
- return copyFile(srcStat, src, dest, opts);
1526
- return mayCopyFile(srcStat, src, dest, opts);
1527
- }
1528
- function mayCopyFile(srcStat, src, dest, opts) {
1529
- if (opts.overwrite) {
1530
- fs5.unlinkSync(dest);
1531
- return copyFile(srcStat, src, dest, opts);
1532
- } else if (opts.errorOnExist) {
1533
- throw new Error(`'${dest}' already exists`);
1534
- }
1535
- }
1536
- function copyFile(srcStat, src, dest, opts) {
1537
- fs5.copyFileSync(src, dest);
1538
- if (opts.preserveTimestamps)
1539
- handleTimestamps(srcStat.mode, src, dest);
1540
- return setDestMode(dest, srcStat.mode);
1541
- }
1542
- function handleTimestamps(srcMode, src, dest) {
1543
- if (fileIsNotWritable(srcMode))
1544
- makeFileWritable(dest, srcMode);
1545
- return setDestTimestamps(src, dest);
1546
- }
1547
- function fileIsNotWritable(srcMode) {
1548
- return (srcMode & 128) === 0;
1549
- }
1550
- function makeFileWritable(dest, srcMode) {
1551
- return setDestMode(dest, srcMode | 128);
1552
- }
1553
- function setDestMode(dest, srcMode) {
1554
- return fs5.chmodSync(dest, srcMode);
1555
- }
1556
- function setDestTimestamps(src, dest) {
1557
- const updatedSrcStat = fs5.statSync(src);
1558
- return utimesMillisSync(dest, updatedSrcStat.atime, updatedSrcStat.mtime);
1559
- }
1560
- function onDir(srcStat, destStat, src, dest, opts) {
1561
- if (!destStat)
1562
- return mkDirAndCopy(srcStat.mode, src, dest, opts);
1563
- return copyDir(src, dest, opts);
1564
- }
1565
- function mkDirAndCopy(srcMode, src, dest, opts) {
1566
- fs5.mkdirSync(dest);
1567
- copyDir(src, dest, opts);
1568
- return setDestMode(dest, srcMode);
1569
- }
1570
- function copyDir(src, dest, opts) {
1571
- fs5.readdirSync(src).forEach((item) => copyDirItem(item, src, dest, opts));
1572
- }
1573
- function copyDirItem(item, src, dest, opts) {
1574
- const srcItem = path5.join(src, item);
1575
- const destItem = path5.join(dest, item);
1576
- if (opts.filter && !opts.filter(srcItem, destItem))
1577
- return;
1578
- const { destStat } = stat.checkPathsSync(srcItem, destItem, "copy", opts);
1579
- return getStats(destStat, srcItem, destItem, opts);
1580
- }
1581
- function onLink(destStat, src, dest, opts) {
1582
- let resolvedSrc = fs5.readlinkSync(src);
1583
- if (opts.dereference) {
1584
- resolvedSrc = path5.resolve(process.cwd(), resolvedSrc);
1585
- }
1586
- if (!destStat) {
1587
- return fs5.symlinkSync(resolvedSrc, dest);
1588
- } else {
1589
- let resolvedDest;
1590
- try {
1591
- resolvedDest = fs5.readlinkSync(dest);
1592
- } catch (err) {
1593
- if (err.code === "EINVAL" || err.code === "UNKNOWN")
1594
- return fs5.symlinkSync(resolvedSrc, dest);
1595
- throw err;
1596
- }
1597
- if (opts.dereference) {
1598
- resolvedDest = path5.resolve(process.cwd(), resolvedDest);
1599
- }
1600
- if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
1601
- throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`);
1602
- }
1603
- if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) {
1604
- throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`);
1605
- }
1606
- return copyLink(resolvedSrc, dest);
1607
- }
1608
- }
1609
- function copyLink(resolvedSrc, dest) {
1610
- fs5.unlinkSync(dest);
1611
- return fs5.symlinkSync(resolvedSrc, dest);
1612
- }
1613
- module.exports = copySync;
1614
- }
1615
- });
1616
-
1617
- // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/copy/index.js
1618
- var require_copy2 = __commonJS({
1619
- "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/copy/index.js"(exports, module) {
1620
- init_cjs_shims();
1621
- var u = require_universalify().fromPromise;
1622
- module.exports = {
1623
- copy: u(require_copy()),
1624
- copySync: require_copy_sync()
1625
- };
1626
- }
1627
- });
1628
-
1629
- // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/remove/index.js
1630
- var require_remove = __commonJS({
1631
- "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/remove/index.js"(exports, module) {
1632
- init_cjs_shims();
1633
- var fs5 = require_graceful_fs();
1634
- var u = require_universalify().fromCallback;
1635
- function remove2(path5, callback) {
1636
- fs5.rm(path5, { recursive: true, force: true }, callback);
1637
- }
1638
- function removeSync(path5) {
1639
- fs5.rmSync(path5, { recursive: true, force: true });
1640
- }
1641
- module.exports = {
1642
- remove: u(remove2),
1643
- removeSync
1644
- };
1645
- }
1646
- });
1647
-
1648
- // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/empty/index.js
1649
- var require_empty = __commonJS({
1650
- "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/empty/index.js"(exports, module) {
1651
- init_cjs_shims();
1652
- var u = require_universalify().fromPromise;
1653
- var fs5 = require_fs();
1654
- var path5 = __require("path");
1655
- var mkdir = require_mkdirs();
1656
- var remove2 = require_remove();
1657
- var emptyDir = u(async function emptyDir2(dir) {
1658
- let items;
1659
- try {
1660
- items = await fs5.readdir(dir);
1661
- } catch {
1662
- return mkdir.mkdirs(dir);
1663
- }
1664
- return Promise.all(items.map((item) => remove2.remove(path5.join(dir, item))));
1665
- });
1666
- function emptyDirSync(dir) {
1667
- let items;
1668
- try {
1669
- items = fs5.readdirSync(dir);
1670
- } catch {
1671
- return mkdir.mkdirsSync(dir);
1672
- }
1673
- items.forEach((item) => {
1674
- item = path5.join(dir, item);
1675
- remove2.removeSync(item);
1676
- });
1677
- }
1678
- module.exports = {
1679
- emptyDirSync,
1680
- emptydirSync: emptyDirSync,
1681
- emptyDir,
1682
- emptydir: emptyDir
1683
- };
1684
- }
1685
- });
1686
-
1687
- // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/file.js
1688
- var require_file = __commonJS({
1689
- "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/file.js"(exports, module) {
1690
- init_cjs_shims();
1691
- var u = require_universalify().fromPromise;
1692
- var path5 = __require("path");
1693
- var fs5 = require_fs();
1694
- var mkdir = require_mkdirs();
1695
- async function createFile(file) {
1696
- let stats;
1697
- try {
1698
- stats = await fs5.stat(file);
1699
- } catch {
1700
- }
1701
- if (stats && stats.isFile())
1702
- return;
1703
- const dir = path5.dirname(file);
1704
- let dirStats = null;
1705
- try {
1706
- dirStats = await fs5.stat(dir);
1707
- } catch (err) {
1708
- if (err.code === "ENOENT") {
1709
- await mkdir.mkdirs(dir);
1710
- await fs5.writeFile(file, "");
1711
- return;
1712
- } else {
1713
- throw err;
1714
- }
1715
- }
1716
- if (dirStats.isDirectory()) {
1717
- await fs5.writeFile(file, "");
1718
- } else {
1719
- await fs5.readdir(dir);
1720
- }
1721
- }
1722
- function createFileSync(file) {
1723
- let stats;
1724
- try {
1725
- stats = fs5.statSync(file);
1726
- } catch {
1727
- }
1728
- if (stats && stats.isFile())
1729
- return;
1730
- const dir = path5.dirname(file);
1731
- try {
1732
- if (!fs5.statSync(dir).isDirectory()) {
1733
- fs5.readdirSync(dir);
1734
- }
1735
- } catch (err) {
1736
- if (err && err.code === "ENOENT")
1737
- mkdir.mkdirsSync(dir);
1738
- else
1739
- throw err;
1740
- }
1741
- fs5.writeFileSync(file, "");
1742
- }
1743
- module.exports = {
1744
- createFile: u(createFile),
1745
- createFileSync
1746
- };
1747
- }
1748
- });
1749
-
1750
- // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/link.js
1751
- var require_link = __commonJS({
1752
- "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/link.js"(exports, module) {
1753
- init_cjs_shims();
1754
- var u = require_universalify().fromPromise;
1755
- var path5 = __require("path");
1756
- var fs5 = require_fs();
1757
- var mkdir = require_mkdirs();
1758
- var { pathExists: pathExists2 } = require_path_exists();
1759
- var { areIdentical } = require_stat();
1760
- async function createLink(srcpath, dstpath) {
1761
- let dstStat;
1762
- try {
1763
- dstStat = await fs5.lstat(dstpath);
1764
- } catch {
1765
- }
1766
- let srcStat;
1767
- try {
1768
- srcStat = await fs5.lstat(srcpath);
1769
- } catch (err) {
1770
- err.message = err.message.replace("lstat", "ensureLink");
1771
- throw err;
1772
- }
1773
- if (dstStat && areIdentical(srcStat, dstStat))
1774
- return;
1775
- const dir = path5.dirname(dstpath);
1776
- const dirExists = await pathExists2(dir);
1777
- if (!dirExists) {
1778
- await mkdir.mkdirs(dir);
1779
- }
1780
- await fs5.link(srcpath, dstpath);
1781
- }
1782
- function createLinkSync(srcpath, dstpath) {
1783
- let dstStat;
1784
- try {
1785
- dstStat = fs5.lstatSync(dstpath);
1786
- } catch {
1787
- }
1788
- try {
1789
- const srcStat = fs5.lstatSync(srcpath);
1790
- if (dstStat && areIdentical(srcStat, dstStat))
1791
- return;
1792
- } catch (err) {
1793
- err.message = err.message.replace("lstat", "ensureLink");
1794
- throw err;
1795
- }
1796
- const dir = path5.dirname(dstpath);
1797
- const dirExists = fs5.existsSync(dir);
1798
- if (dirExists)
1799
- return fs5.linkSync(srcpath, dstpath);
1800
- mkdir.mkdirsSync(dir);
1801
- return fs5.linkSync(srcpath, dstpath);
1802
- }
1803
- module.exports = {
1804
- createLink: u(createLink),
1805
- createLinkSync
1806
- };
1807
- }
1808
- });
1809
-
1810
- // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/symlink-paths.js
1811
- var require_symlink_paths = __commonJS({
1812
- "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/symlink-paths.js"(exports, module) {
1813
- init_cjs_shims();
1814
- var path5 = __require("path");
1815
- var fs5 = require_fs();
1816
- var { pathExists: pathExists2 } = require_path_exists();
1817
- var u = require_universalify().fromPromise;
1818
- async function symlinkPaths(srcpath, dstpath) {
1819
- if (path5.isAbsolute(srcpath)) {
1820
- try {
1821
- await fs5.lstat(srcpath);
1822
- } catch (err) {
1823
- err.message = err.message.replace("lstat", "ensureSymlink");
1824
- throw err;
1825
- }
1826
- return {
1827
- toCwd: srcpath,
1828
- toDst: srcpath
1829
- };
1830
- }
1831
- const dstdir = path5.dirname(dstpath);
1832
- const relativeToDst = path5.join(dstdir, srcpath);
1833
- const exists = await pathExists2(relativeToDst);
1834
- if (exists) {
1835
- return {
1836
- toCwd: relativeToDst,
1837
- toDst: srcpath
1838
- };
1839
- }
1840
- try {
1841
- await fs5.lstat(srcpath);
1842
- } catch (err) {
1843
- err.message = err.message.replace("lstat", "ensureSymlink");
1844
- throw err;
1845
- }
1846
- return {
1847
- toCwd: srcpath,
1848
- toDst: path5.relative(dstdir, srcpath)
1849
- };
1850
- }
1851
- function symlinkPathsSync(srcpath, dstpath) {
1852
- if (path5.isAbsolute(srcpath)) {
1853
- const exists2 = fs5.existsSync(srcpath);
1854
- if (!exists2)
1855
- throw new Error("absolute srcpath does not exist");
1856
- return {
1857
- toCwd: srcpath,
1858
- toDst: srcpath
1859
- };
1860
- }
1861
- const dstdir = path5.dirname(dstpath);
1862
- const relativeToDst = path5.join(dstdir, srcpath);
1863
- const exists = fs5.existsSync(relativeToDst);
1864
- if (exists) {
1865
- return {
1866
- toCwd: relativeToDst,
1867
- toDst: srcpath
1868
- };
1869
- }
1870
- const srcExists = fs5.existsSync(srcpath);
1871
- if (!srcExists)
1872
- throw new Error("relative srcpath does not exist");
1873
- return {
1874
- toCwd: srcpath,
1875
- toDst: path5.relative(dstdir, srcpath)
1876
- };
1877
- }
1878
- module.exports = {
1879
- symlinkPaths: u(symlinkPaths),
1880
- symlinkPathsSync
1881
- };
1882
- }
1883
- });
1884
-
1885
- // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/symlink-type.js
1886
- var require_symlink_type = __commonJS({
1887
- "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/symlink-type.js"(exports, module) {
1888
- init_cjs_shims();
1889
- var fs5 = require_fs();
1890
- var u = require_universalify().fromPromise;
1891
- async function symlinkType(srcpath, type) {
1892
- if (type)
1893
- return type;
1894
- let stats;
1895
- try {
1896
- stats = await fs5.lstat(srcpath);
1897
- } catch {
1898
- return "file";
1899
- }
1900
- return stats && stats.isDirectory() ? "dir" : "file";
1901
- }
1902
- function symlinkTypeSync(srcpath, type) {
1903
- if (type)
1904
- return type;
1905
- let stats;
1906
- try {
1907
- stats = fs5.lstatSync(srcpath);
1908
- } catch {
1909
- return "file";
1910
- }
1911
- return stats && stats.isDirectory() ? "dir" : "file";
1912
- }
1913
- module.exports = {
1914
- symlinkType: u(symlinkType),
1915
- symlinkTypeSync
1916
- };
1917
- }
1918
- });
1919
-
1920
- // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/symlink.js
1921
- var require_symlink = __commonJS({
1922
- "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/symlink.js"(exports, module) {
1923
- init_cjs_shims();
1924
- var u = require_universalify().fromPromise;
1925
- var path5 = __require("path");
1926
- var fs5 = require_fs();
1927
- var { mkdirs, mkdirsSync } = require_mkdirs();
1928
- var { symlinkPaths, symlinkPathsSync } = require_symlink_paths();
1929
- var { symlinkType, symlinkTypeSync } = require_symlink_type();
1930
- var { pathExists: pathExists2 } = require_path_exists();
1931
- var { areIdentical } = require_stat();
1932
- async function createSymlink(srcpath, dstpath, type) {
1933
- let stats;
1934
- try {
1935
- stats = await fs5.lstat(dstpath);
1936
- } catch {
1937
- }
1938
- if (stats && stats.isSymbolicLink()) {
1939
- const [srcStat, dstStat] = await Promise.all([
1940
- fs5.stat(srcpath),
1941
- fs5.stat(dstpath)
1942
- ]);
1943
- if (areIdentical(srcStat, dstStat))
1944
- return;
1945
- }
1946
- const relative2 = await symlinkPaths(srcpath, dstpath);
1947
- srcpath = relative2.toDst;
1948
- const toType = await symlinkType(relative2.toCwd, type);
1949
- const dir = path5.dirname(dstpath);
1950
- if (!await pathExists2(dir)) {
1951
- await mkdirs(dir);
1952
- }
1953
- return fs5.symlink(srcpath, dstpath, toType);
1954
- }
1955
- function createSymlinkSync(srcpath, dstpath, type) {
1956
- let stats;
1957
- try {
1958
- stats = fs5.lstatSync(dstpath);
1959
- } catch {
1960
- }
1961
- if (stats && stats.isSymbolicLink()) {
1962
- const srcStat = fs5.statSync(srcpath);
1963
- const dstStat = fs5.statSync(dstpath);
1964
- if (areIdentical(srcStat, dstStat))
1965
- return;
1966
- }
1967
- const relative2 = symlinkPathsSync(srcpath, dstpath);
1968
- srcpath = relative2.toDst;
1969
- type = symlinkTypeSync(relative2.toCwd, type);
1970
- const dir = path5.dirname(dstpath);
1971
- const exists = fs5.existsSync(dir);
1972
- if (exists)
1973
- return fs5.symlinkSync(srcpath, dstpath, type);
1974
- mkdirsSync(dir);
1975
- return fs5.symlinkSync(srcpath, dstpath, type);
1976
- }
1977
- module.exports = {
1978
- createSymlink: u(createSymlink),
1979
- createSymlinkSync
1980
- };
1981
- }
1982
- });
1983
-
1984
- // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/index.js
1985
- var require_ensure = __commonJS({
1986
- "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/index.js"(exports, module) {
1987
- init_cjs_shims();
1988
- var { createFile, createFileSync } = require_file();
1989
- var { createLink, createLinkSync } = require_link();
1990
- var { createSymlink, createSymlinkSync } = require_symlink();
1991
- module.exports = {
1992
- // file
1993
- createFile,
1994
- createFileSync,
1995
- ensureFile: createFile,
1996
- ensureFileSync: createFileSync,
1997
- // link
1998
- createLink,
1999
- createLinkSync,
2000
- ensureLink: createLink,
2001
- ensureLinkSync: createLinkSync,
2002
- // symlink
2003
- createSymlink,
2004
- createSymlinkSync,
2005
- ensureSymlink: createSymlink,
2006
- ensureSymlinkSync: createSymlinkSync
2007
- };
2008
- }
2009
- });
2010
-
2011
- // ../../node_modules/.pnpm/jsonfile@6.1.0/node_modules/jsonfile/utils.js
2012
- var require_utils2 = __commonJS({
2013
- "../../node_modules/.pnpm/jsonfile@6.1.0/node_modules/jsonfile/utils.js"(exports, module) {
2014
- init_cjs_shims();
2015
- function stringify(obj, { EOL = "\n", finalEOL = true, replacer = null, spaces } = {}) {
2016
- const EOF = finalEOL ? EOL : "";
2017
- const str = JSON.stringify(obj, replacer, spaces);
2018
- return str.replace(/\n/g, EOL) + EOF;
2019
- }
2020
- function stripBom(content) {
2021
- if (Buffer.isBuffer(content))
2022
- content = content.toString("utf8");
2023
- return content.replace(/^\uFEFF/, "");
2024
- }
2025
- module.exports = { stringify, stripBom };
2026
- }
2027
- });
2028
-
2029
- // ../../node_modules/.pnpm/jsonfile@6.1.0/node_modules/jsonfile/index.js
2030
- var require_jsonfile = __commonJS({
2031
- "../../node_modules/.pnpm/jsonfile@6.1.0/node_modules/jsonfile/index.js"(exports, module) {
2032
- init_cjs_shims();
2033
- var _fs;
2034
- try {
2035
- _fs = require_graceful_fs();
2036
- } catch (_) {
2037
- _fs = __require("fs");
2038
- }
2039
- var universalify = require_universalify();
2040
- var { stringify, stripBom } = require_utils2();
2041
- async function _readFile(file, options = {}) {
2042
- if (typeof options === "string") {
2043
- options = { encoding: options };
2044
- }
2045
- const fs5 = options.fs || _fs;
2046
- const shouldThrow = "throws" in options ? options.throws : true;
2047
- let data = await universalify.fromCallback(fs5.readFile)(file, options);
2048
- data = stripBom(data);
2049
- let obj;
2050
- try {
2051
- obj = JSON.parse(data, options ? options.reviver : null);
2052
- } catch (err) {
2053
- if (shouldThrow) {
2054
- err.message = `${file}: ${err.message}`;
2055
- throw err;
2056
- } else {
2057
- return null;
2058
- }
2059
- }
2060
- return obj;
2061
- }
2062
- var readFile = universalify.fromPromise(_readFile);
2063
- function readFileSync(file, options = {}) {
2064
- if (typeof options === "string") {
2065
- options = { encoding: options };
2066
- }
2067
- const fs5 = options.fs || _fs;
2068
- const shouldThrow = "throws" in options ? options.throws : true;
2069
- try {
2070
- let content = fs5.readFileSync(file, options);
2071
- content = stripBom(content);
2072
- return JSON.parse(content, options.reviver);
2073
- } catch (err) {
2074
- if (shouldThrow) {
2075
- err.message = `${file}: ${err.message}`;
2076
- throw err;
2077
- } else {
2078
- return null;
2079
- }
2080
- }
2081
- }
2082
- async function _writeFile(file, obj, options = {}) {
2083
- const fs5 = options.fs || _fs;
2084
- const str = stringify(obj, options);
2085
- await universalify.fromCallback(fs5.writeFile)(file, str, options);
2086
- }
2087
- var writeFile = universalify.fromPromise(_writeFile);
2088
- function writeFileSync(file, obj, options = {}) {
2089
- const fs5 = options.fs || _fs;
2090
- const str = stringify(obj, options);
2091
- return fs5.writeFileSync(file, str, options);
2092
- }
2093
- var jsonfile = {
2094
- readFile,
2095
- readFileSync,
2096
- writeFile,
2097
- writeFileSync
2098
- };
2099
- module.exports = jsonfile;
2100
- }
2101
- });
2102
-
2103
- // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/json/jsonfile.js
2104
- var require_jsonfile2 = __commonJS({
2105
- "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/json/jsonfile.js"(exports, module) {
2106
- init_cjs_shims();
2107
- var jsonFile = require_jsonfile();
2108
- module.exports = {
2109
- // jsonfile exports
2110
- readJson: jsonFile.readFile,
2111
- readJsonSync: jsonFile.readFileSync,
2112
- writeJson: jsonFile.writeFile,
2113
- writeJsonSync: jsonFile.writeFileSync
2114
- };
2115
- }
2116
- });
2117
-
2118
- // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/output-file/index.js
2119
- var require_output_file = __commonJS({
2120
- "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/output-file/index.js"(exports, module) {
2121
- init_cjs_shims();
2122
- var u = require_universalify().fromPromise;
2123
- var fs5 = require_fs();
2124
- var path5 = __require("path");
2125
- var mkdir = require_mkdirs();
2126
- var pathExists2 = require_path_exists().pathExists;
2127
- async function outputFile(file, data, encoding = "utf-8") {
2128
- const dir = path5.dirname(file);
2129
- if (!await pathExists2(dir)) {
2130
- await mkdir.mkdirs(dir);
2131
- }
2132
- return fs5.writeFile(file, data, encoding);
2133
- }
2134
- function outputFileSync(file, ...args) {
2135
- const dir = path5.dirname(file);
2136
- if (!fs5.existsSync(dir)) {
2137
- mkdir.mkdirsSync(dir);
2138
- }
2139
- fs5.writeFileSync(file, ...args);
2140
- }
2141
- module.exports = {
2142
- outputFile: u(outputFile),
2143
- outputFileSync
2144
- };
2145
- }
2146
- });
2147
-
2148
- // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/json/output-json.js
2149
- var require_output_json = __commonJS({
2150
- "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/json/output-json.js"(exports, module) {
2151
- init_cjs_shims();
2152
- var { stringify } = require_utils2();
2153
- var { outputFile } = require_output_file();
2154
- async function outputJson(file, data, options = {}) {
2155
- const str = stringify(data, options);
2156
- await outputFile(file, str, options);
2157
- }
2158
- module.exports = outputJson;
2159
- }
2160
- });
2161
-
2162
- // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/json/output-json-sync.js
2163
- var require_output_json_sync = __commonJS({
2164
- "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/json/output-json-sync.js"(exports, module) {
2165
- init_cjs_shims();
2166
- var { stringify } = require_utils2();
2167
- var { outputFileSync } = require_output_file();
2168
- function outputJsonSync(file, data, options) {
2169
- const str = stringify(data, options);
2170
- outputFileSync(file, str, options);
2171
- }
2172
- module.exports = outputJsonSync;
2173
- }
2174
- });
2175
-
2176
- // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/json/index.js
2177
- var require_json = __commonJS({
2178
- "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/json/index.js"(exports, module) {
2179
- init_cjs_shims();
2180
- var u = require_universalify().fromPromise;
2181
- var jsonFile = require_jsonfile2();
2182
- jsonFile.outputJson = u(require_output_json());
2183
- jsonFile.outputJsonSync = require_output_json_sync();
2184
- jsonFile.outputJSON = jsonFile.outputJson;
2185
- jsonFile.outputJSONSync = jsonFile.outputJsonSync;
2186
- jsonFile.writeJSON = jsonFile.writeJson;
2187
- jsonFile.writeJSONSync = jsonFile.writeJsonSync;
2188
- jsonFile.readJSON = jsonFile.readJson;
2189
- jsonFile.readJSONSync = jsonFile.readJsonSync;
2190
- module.exports = jsonFile;
2191
- }
2192
- });
2193
-
2194
- // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/move/move.js
2195
- var require_move = __commonJS({
2196
- "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/move/move.js"(exports, module) {
2197
- init_cjs_shims();
2198
- var fs5 = require_fs();
2199
- var path5 = __require("path");
2200
- var { copy } = require_copy2();
2201
- var { remove: remove2 } = require_remove();
2202
- var { mkdirp } = require_mkdirs();
2203
- var { pathExists: pathExists2 } = require_path_exists();
2204
- var stat = require_stat();
2205
- async function move(src, dest, opts = {}) {
2206
- const overwrite = opts.overwrite || opts.clobber || false;
2207
- const { srcStat, isChangingCase = false } = await stat.checkPaths(src, dest, "move", opts);
2208
- await stat.checkParentPaths(src, srcStat, dest, "move");
2209
- const destParent = path5.dirname(dest);
2210
- const parsedParentPath = path5.parse(destParent);
2211
- if (parsedParentPath.root !== destParent) {
2212
- await mkdirp(destParent);
2213
- }
2214
- return doRename(src, dest, overwrite, isChangingCase);
2215
- }
2216
- async function doRename(src, dest, overwrite, isChangingCase) {
2217
- if (!isChangingCase) {
2218
- if (overwrite) {
2219
- await remove2(dest);
2220
- } else if (await pathExists2(dest)) {
2221
- throw new Error("dest already exists.");
2222
- }
2223
- }
2224
- try {
2225
- await fs5.rename(src, dest);
2226
- } catch (err) {
2227
- if (err.code !== "EXDEV") {
2228
- throw err;
2229
- }
2230
- await moveAcrossDevice(src, dest, overwrite);
2231
- }
2232
- }
2233
- async function moveAcrossDevice(src, dest, overwrite) {
2234
- const opts = {
2235
- overwrite,
2236
- errorOnExist: true,
2237
- preserveTimestamps: true
2238
- };
2239
- await copy(src, dest, opts);
2240
- return remove2(src);
2241
- }
2242
- module.exports = move;
2243
- }
2244
- });
2245
-
2246
- // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/move/move-sync.js
2247
- var require_move_sync = __commonJS({
2248
- "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/move/move-sync.js"(exports, module) {
2249
- init_cjs_shims();
2250
- var fs5 = require_graceful_fs();
2251
- var path5 = __require("path");
2252
- var copySync = require_copy2().copySync;
2253
- var removeSync = require_remove().removeSync;
2254
- var mkdirpSync = require_mkdirs().mkdirpSync;
2255
- var stat = require_stat();
2256
- function moveSync(src, dest, opts) {
2257
- opts = opts || {};
2258
- const overwrite = opts.overwrite || opts.clobber || false;
2259
- const { srcStat, isChangingCase = false } = stat.checkPathsSync(src, dest, "move", opts);
2260
- stat.checkParentPathsSync(src, srcStat, dest, "move");
2261
- if (!isParentRoot(dest))
2262
- mkdirpSync(path5.dirname(dest));
2263
- return doRename(src, dest, overwrite, isChangingCase);
2264
- }
2265
- function isParentRoot(dest) {
2266
- const parent = path5.dirname(dest);
2267
- const parsedPath = path5.parse(parent);
2268
- return parsedPath.root === parent;
2269
- }
2270
- function doRename(src, dest, overwrite, isChangingCase) {
2271
- if (isChangingCase)
2272
- return rename(src, dest, overwrite);
2273
- if (overwrite) {
2274
- removeSync(dest);
2275
- return rename(src, dest, overwrite);
2276
- }
2277
- if (fs5.existsSync(dest))
2278
- throw new Error("dest already exists.");
2279
- return rename(src, dest, overwrite);
2280
- }
2281
- function rename(src, dest, overwrite) {
2282
- try {
2283
- fs5.renameSync(src, dest);
2284
- } catch (err) {
2285
- if (err.code !== "EXDEV")
2286
- throw err;
2287
- return moveAcrossDevice(src, dest, overwrite);
2288
- }
2289
- }
2290
- function moveAcrossDevice(src, dest, overwrite) {
2291
- const opts = {
2292
- overwrite,
2293
- errorOnExist: true,
2294
- preserveTimestamps: true
2295
- };
2296
- copySync(src, dest, opts);
2297
- return removeSync(src);
2298
- }
2299
- module.exports = moveSync;
2300
- }
2301
- });
2302
-
2303
- // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/move/index.js
2304
- var require_move2 = __commonJS({
2305
- "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/move/index.js"(exports, module) {
2306
- init_cjs_shims();
2307
- var u = require_universalify().fromPromise;
2308
- module.exports = {
2309
- move: u(require_move()),
2310
- moveSync: require_move_sync()
2311
- };
2312
- }
2313
- });
2314
-
2315
- // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/index.js
2316
- var require_lib = __commonJS({
2317
- "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/index.js"(exports, module) {
2318
- init_cjs_shims();
2319
- module.exports = {
2320
- // Export promiseified graceful-fs:
2321
- ...require_fs(),
2322
- // Export extra methods:
2323
- ...require_copy2(),
2324
- ...require_empty(),
2325
- ...require_ensure(),
2326
- ...require_json(),
2327
- ...require_mkdirs(),
2328
- ...require_move2(),
2329
- ...require_output_file(),
2330
- ...require_path_exists(),
2331
- ...require_remove()
2332
- };
2333
- }
2334
- });
50
+ var process__default = /*#__PURE__*/_interopDefault(process);
51
+ var fs__default = /*#__PURE__*/_interopDefault(fs);
2335
52
 
2336
53
  // ../../node_modules/.pnpm/lodash.isequal@4.5.0/node_modules/lodash.isequal/index.js
2337
- var require_lodash = __commonJS({
54
+ var require_lodash = chunkI7UUR5MZ_cjs.__commonJS({
2338
55
  "../../node_modules/.pnpm/lodash.isequal@4.5.0/node_modules/lodash.isequal/index.js"(exports, module) {
2339
- init_cjs_shims();
56
+ chunkI7UUR5MZ_cjs.init_cjs_shims();
2340
57
  var LARGE_ARRAY_SIZE = 200;
2341
58
  var HASH_UNDEFINED = "__lodash_hash_undefined__";
2342
59
  var COMPARE_PARTIAL_FLAG = 1;
@@ -2470,14 +187,14 @@ var require_lodash = __commonJS({
2470
187
  var reIsNative = RegExp(
2471
188
  "^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
2472
189
  );
2473
- var Buffer2 = moduleExports ? root.Buffer : void 0;
190
+ var Buffer = moduleExports ? root.Buffer : void 0;
2474
191
  var Symbol2 = root.Symbol;
2475
- var Uint8Array2 = root.Uint8Array;
192
+ var Uint8Array = root.Uint8Array;
2476
193
  var propertyIsEnumerable = objectProto.propertyIsEnumerable;
2477
194
  var splice = arrayProto.splice;
2478
195
  var symToStringTag = Symbol2 ? Symbol2.toStringTag : void 0;
2479
196
  var nativeGetSymbols = Object.getOwnPropertySymbols;
2480
- var nativeIsBuffer = Buffer2 ? Buffer2.isBuffer : void 0;
197
+ var nativeIsBuffer = Buffer ? Buffer.isBuffer : void 0;
2481
198
  var nativeKeys = overArg(Object.keys, Object);
2482
199
  var DataView = getNative(root, "DataView");
2483
200
  var Map2 = getNative(root, "Map");
@@ -2820,7 +537,7 @@ var require_lodash = __commonJS({
2820
537
  object = object.buffer;
2821
538
  other = other.buffer;
2822
539
  case arrayBufferTag:
2823
- if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array2(object), new Uint8Array2(other))) {
540
+ if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
2824
541
  return false;
2825
542
  }
2826
543
  return true;
@@ -3036,381 +753,13 @@ var require_lodash = __commonJS({
3036
753
  });
3037
754
 
3038
755
  // src/index.ts
3039
- init_cjs_shims();
756
+ chunkI7UUR5MZ_cjs.init_cjs_shims();
3040
757
 
3041
758
  // src/build.ts
3042
- init_cjs_shims();
3043
-
3044
- // src/fs/clean.ts
3045
- init_cjs_shims();
3046
- var import_fs_extra = __toESM(require_lib(), 1);
3047
- async function clean(path5) {
3048
- return (0, import_fs_extra.remove)(path5);
3049
- }
3050
-
3051
- // src/fs/read.ts
3052
- init_cjs_shims();
3053
- var import_fs_extra2 = __toESM(require_lib(), 1);
3054
- function slash(path5, platform = "linux") {
3055
- const isWindowsPath = /^\\\\\?\\/.test(path5);
3056
- if (["linux", "mac"].includes(platform) && !isWindowsPath) {
3057
- return path5.replaceAll(/\\/g, "/").replace("../", "").trimEnd();
3058
- }
3059
- return path5.replaceAll(/\\/g, "/").replace("../", "").trimEnd();
3060
- }
3061
- function getRelativePath(rootDir, filePath, platform = "linux") {
3062
- if (!rootDir || !filePath) {
3063
- throw new Error(`Root and file should be filled in when retrieving the relativePath, ${rootDir || ""} ${filePath || ""}`);
3064
- }
3065
- const relativePath = path4.relative(rootDir, filePath);
3066
- const slashedPath = slash(relativePath, platform);
3067
- if (slashedPath.startsWith("../")) {
3068
- return slashedPath.replace(path4.basename(slashedPath), path4.basename(slashedPath, path4.extname(filePath)));
3069
- }
3070
- return `./${slashedPath.replace(path4.basename(slashedPath), path4.basename(slashedPath, path4.extname(filePath)))}`;
3071
- }
3072
- var reader = jsRuntime.switcher(
3073
- {
3074
- node: async (path5) => {
3075
- return import_fs_extra2.default.readFile(path5, { encoding: "utf8" });
3076
- },
3077
- bun: async (path5) => {
3078
- const file = Bun.file(path5);
3079
- return file.text();
3080
- }
3081
- },
3082
- "node"
3083
- );
3084
- jsRuntime.switcher(
3085
- {
3086
- node: (path5) => {
3087
- return import_fs_extra2.default.readFileSync(path5, { encoding: "utf8" });
3088
- },
3089
- bun: () => {
3090
- throw new Error("Bun cannot read sync");
3091
- }
3092
- },
3093
- "node"
3094
- );
3095
- async function read(path5) {
3096
- return reader(path5);
3097
- }
3098
-
3099
- // src/utils/URLPath.ts
3100
- init_cjs_shims();
3101
-
3102
- // src/transformers/index.ts
3103
- init_cjs_shims();
3104
-
3105
- // src/transformers/casing.ts
3106
- init_cjs_shims();
3107
- function camelCase(text) {
3108
- return changeCase.camelCase(text, { delimiter: "", stripRegexp: /[^A-Z0-9$]/gi, transform: changeCase.camelCaseTransformMerge });
3109
- }
3110
- function pascalCase(text) {
3111
- return changeCase.pascalCase(text, { delimiter: "", stripRegexp: /[^A-Z0-9$]/gi, transform: changeCase.pascalCaseTransformMerge });
3112
- }
3113
-
3114
- // src/transformers/combineCodes.ts
3115
- init_cjs_shims();
3116
- function combineCodes(codes) {
3117
- return codes.join("\n");
3118
- }
3119
-
3120
- // src/transformers/createJSDocBlockText.ts
3121
- init_cjs_shims();
3122
- function createJSDocBlockText({ comments }) {
3123
- const filteredComments = comments.filter(Boolean);
3124
- if (!filteredComments.length) {
3125
- return "";
3126
- }
3127
- return `/**
3128
- * ${filteredComments.join("\n * ")}
3129
- */`;
3130
- }
3131
-
3132
- // src/transformers/escape.ts
3133
- init_cjs_shims();
3134
- function escape(text) {
3135
- return text ? text.replaceAll("`", "\\`") : "";
3136
- }
3137
- function jsStringEscape(input) {
3138
- return `${input}`.replace(/["'\\\n\r\u2028\u2029]/g, (character) => {
3139
- switch (character) {
3140
- case '"':
3141
- case "'":
3142
- case "\\":
3143
- return "\\" + character;
3144
- case "\n":
3145
- return "\\n";
3146
- case "\r":
3147
- return "\\r";
3148
- case "\u2028":
3149
- return "\\u2028";
3150
- case "\u2029":
3151
- return "\\u2029";
3152
- default:
3153
- return "";
3154
- }
3155
- });
3156
- }
3157
-
3158
- // src/transformers/indent.ts
3159
- init_cjs_shims();
3160
- function createIndent(size) {
3161
- return Array.from({ length: size + 1 }).join(" ");
3162
- }
3163
-
3164
- // src/transformers/nameSorter.ts
3165
- init_cjs_shims();
3166
- function nameSorter(a, b) {
3167
- if (a.name < b.name) {
3168
- return -1;
3169
- }
3170
- if (a.name > b.name) {
3171
- return 1;
3172
- }
3173
- return 0;
3174
- }
3175
-
3176
- // src/transformers/searchAndReplace.ts
3177
- init_cjs_shims();
3178
- function searchAndReplace(options) {
3179
- const { text, replaceBy, prefix = "", key } = options;
3180
- const searchValues = options.searchValues?.(prefix, key) || [
3181
- `${prefix}["${key}"]`,
3182
- `${prefix}['${key}']`,
3183
- `${prefix}[\`${key}\`]`,
3184
- `${prefix}"${key}"`,
3185
- `${prefix}'${key}'`,
3186
- `${prefix}\`${key}\``,
3187
- new RegExp(`${prefix}${key}`, "g")
3188
- ];
3189
- return searchValues.reduce((prev, searchValue) => {
3190
- return prev.toString().replaceAll(searchValue, replaceBy);
3191
- }, text);
3192
- }
3193
-
3194
- // src/transformers/transformReservedWord.ts
3195
- init_cjs_shims();
3196
- var reservedWords = [
3197
- "abstract",
3198
- "arguments",
3199
- "boolean",
3200
- "break",
3201
- "byte",
3202
- "case",
3203
- "catch",
3204
- "char",
3205
- "class",
3206
- "const",
3207
- "continue",
3208
- "debugger",
3209
- "default",
3210
- "delete",
3211
- "do",
3212
- "double",
3213
- "else",
3214
- "enum",
3215
- "eval",
3216
- "export",
3217
- "extends",
3218
- "false",
3219
- "final",
3220
- "finally",
3221
- "float",
3222
- "for",
3223
- "function",
3224
- "goto",
3225
- "if",
3226
- "implements",
3227
- "import",
3228
- "in",
3229
- "instanceof",
3230
- "int",
3231
- "interface",
3232
- "let",
3233
- "long",
3234
- "native",
3235
- "new",
3236
- "null",
3237
- "package",
3238
- "private",
3239
- "protected",
3240
- "public",
3241
- "return",
3242
- "short",
3243
- "static",
3244
- "super",
3245
- "switch",
3246
- "synchronized",
3247
- "this",
3248
- "throw",
3249
- "throws",
3250
- "transient",
3251
- "true",
3252
- "try",
3253
- "typeof",
3254
- "var",
3255
- "void",
3256
- "volatile",
3257
- "while",
3258
- "with",
3259
- "yield",
3260
- "Array",
3261
- "Date",
3262
- "eval",
3263
- "function",
3264
- "hasOwnProperty",
3265
- "Infinity",
3266
- "isFinite",
3267
- "isNaN",
3268
- "isPrototypeOf",
3269
- "length",
3270
- "Math",
3271
- "name",
3272
- "NaN",
3273
- "Number",
3274
- "Object",
3275
- "prototype",
3276
- "String",
3277
- "toString",
3278
- "undefined",
3279
- "valueOf"
3280
- ];
3281
- function transformReservedWord(word) {
3282
- if (word && reservedWords.includes(word) || word?.match(/^\d/)) {
3283
- return `_${word}`;
3284
- }
3285
- return word;
3286
- }
3287
-
3288
- // src/transformers/trim.ts
3289
- init_cjs_shims();
3290
- function trim(text) {
3291
- return text.replaceAll(/\n/g, "").trim();
3292
- }
3293
- function trimExtName(text) {
3294
- return text.replace(/\.[^/.]+$/, "");
3295
- }
3296
-
3297
- // src/transformers/index.ts
3298
- var transformers_default = {
3299
- combineCodes,
3300
- escape,
3301
- jsStringEscape,
3302
- createIndent,
3303
- transformReservedWord,
3304
- nameSorter,
3305
- searchAndReplace,
3306
- trim,
3307
- trimExtName,
3308
- JSDoc: {
3309
- createJSDocBlockText
3310
- },
3311
- camelCase,
3312
- pascalCase
3313
- };
3314
-
3315
- // src/utils/URLPath.ts
3316
- var URLPath = class {
3317
- constructor(path5) {
3318
- this.path = path5;
3319
- return this;
3320
- }
3321
- /**
3322
- * Convert Swagger path to URLPath(syntax of Express)
3323
- * @example /pet/{petId} => /pet/:petId
3324
- */
3325
- get URL() {
3326
- return this.toURLPath();
3327
- }
3328
- get isURL() {
3329
- try {
3330
- const url = new URL(this.path);
3331
- if (url?.href) {
3332
- return true;
3333
- }
3334
- } catch (error) {
3335
- return false;
3336
- }
3337
- return false;
3338
- }
3339
- /**
3340
- * Convert Swagger path to template literals/ template strings(camelcase)
3341
- * @example /pet/{petId} => `/pet/${petId}`
3342
- * @example /account/monetary-accountID => `/account/${monetaryAccountId}`
3343
- * @example /account/userID => `/account/${userId}`
3344
- */
3345
- get template() {
3346
- return this.toTemplateString();
3347
- }
3348
- get object() {
3349
- return this.toObject();
3350
- }
3351
- get params() {
3352
- return this.getParams();
3353
- }
3354
- toObject({ type = "path", replacer, stringify } = {}) {
3355
- const object = {
3356
- url: type === "path" ? this.toURLPath() : this.toTemplateString(replacer),
3357
- params: this.getParams()
3358
- };
3359
- if (stringify) {
3360
- if (type === "template") {
3361
- return JSON.stringify(object).replaceAll("'", "").replaceAll(`"`, "");
3362
- }
3363
- if (object.params) {
3364
- return `{ url: '${object.url}', params: ${JSON.stringify(object.params).replaceAll("'", "").replaceAll(`"`, "")} }`;
3365
- }
3366
- return `{ url: '${object.url}' }`;
3367
- }
3368
- return object;
3369
- }
3370
- /**
3371
- * Convert Swagger path to template literals/ template strings(camelcase)
3372
- * @example /pet/{petId} => `/pet/${petId}`
3373
- * @example /account/monetary-accountID => `/account/${monetaryAccountId}`
3374
- * @example /account/userID => `/account/${userId}`
3375
- */
3376
- toTemplateString(replacer) {
3377
- const regex = /{(\w|-)*}/g;
3378
- const found = this.path.match(regex);
3379
- let newPath = this.path.replaceAll("{", "${");
3380
- if (found) {
3381
- newPath = found.reduce((prev, curr) => {
3382
- const pathParam = replacer ? replacer(transformers_default.camelCase(curr)) : transformers_default.camelCase(curr);
3383
- const replacement = `\${${pathParam}}`;
3384
- return prev.replace(curr, replacement);
3385
- }, this.path);
3386
- }
3387
- return `\`${newPath}\``;
3388
- }
3389
- getParams(replacer) {
3390
- const regex = /{(\w|-)*}/g;
3391
- const found = this.path.match(regex);
3392
- if (!found) {
3393
- return void 0;
3394
- }
3395
- const params = {};
3396
- found.forEach((item) => {
3397
- item = item.replaceAll("{", "").replaceAll("}", "");
3398
- const pathParam = replacer ? replacer(transformers_default.camelCase(item)) : transformers_default.camelCase(item);
3399
- params[pathParam] = pathParam;
3400
- }, this.path);
3401
- return params;
3402
- }
3403
- /**
3404
- * Convert Swagger path to URLPath(syntax of Express)
3405
- * @example /pet/{petId} => /pet/:petId
3406
- */
3407
- toURLPath() {
3408
- return this.path.replaceAll("{", ":").replaceAll("}", "");
3409
- }
3410
- };
759
+ chunkI7UUR5MZ_cjs.init_cjs_shims();
3411
760
 
3412
761
  // src/config.ts
3413
- init_cjs_shims();
762
+ chunkI7UUR5MZ_cjs.init_cjs_shims();
3414
763
  function defineConfig(options) {
3415
764
  return options;
3416
765
  }
@@ -3419,88 +768,14 @@ function isInputPath(result) {
3419
768
  }
3420
769
 
3421
770
  // src/FileManager.ts
3422
- init_cjs_shims();
3423
- var import_lodash = __toESM(require_lodash(), 1);
3424
-
3425
- // src/fs/write.ts
3426
- init_cjs_shims();
3427
- var import_fs_extra3 = __toESM(require_lib(), 1);
3428
- async function saveCreateDirectory(path5) {
3429
- const passedPath = path4.dirname(path4.resolve(path5));
3430
- await import_fs_extra3.default.mkdir(passedPath, { recursive: true });
3431
- }
3432
- var writer = jsRuntime.switcher(
3433
- {
3434
- node: async (path5, data) => {
3435
- try {
3436
- await import_fs_extra3.default.stat(path4.resolve(path5));
3437
- const oldContent = await import_fs_extra3.default.readFile(path4.resolve(path5), { encoding: "utf-8" });
3438
- if (oldContent?.toString() === data?.toString()) {
3439
- return;
3440
- }
3441
- } catch (_err) {
3442
- }
3443
- await saveCreateDirectory(path5);
3444
- await import_fs_extra3.default.writeFile(path4.resolve(path5), data, { encoding: "utf-8" });
3445
- const savedData = await import_fs_extra3.default.readFile(path4.resolve(path5), { encoding: "utf-8" });
3446
- if (savedData?.toString() !== data?.toString()) {
3447
- throw new Error(`Sanity check failed for ${path5}
3448
-
3449
- Data[${data.length}]:
3450
- ${data}
3451
-
3452
- Saved[${savedData.length}]:
3453
- ${savedData}
3454
- `);
3455
- }
3456
- return savedData;
3457
- },
3458
- bun: async (path5, data) => {
3459
- try {
3460
- await saveCreateDirectory(path5);
3461
- await Bun.write(path4.resolve(path5), data);
3462
- const file = Bun.file(path4.resolve(path5));
3463
- const savedData = await file.text();
3464
- if (savedData?.toString() !== data?.toString()) {
3465
- throw new Error(`Sanity check failed for ${path5}
3466
-
3467
- Data[${data.length}]:
3468
- ${data}
3469
-
3470
- Saved[${savedData.length}]:
3471
- ${savedData}
3472
- `);
3473
- }
3474
- return savedData;
3475
- } catch (e) {
3476
- console.log(e, path4.resolve(path5));
3477
- }
3478
- }
3479
- },
3480
- "node"
3481
- );
3482
- async function write(data, path5) {
3483
- if (data.trim() === "") {
3484
- return void 0;
3485
- }
3486
- return writer(path5, data.trim());
3487
- }
3488
-
3489
- // src/utils/timeout.ts
3490
- init_cjs_shims();
3491
- async function timeout(ms) {
3492
- return new Promise((resolve3) => {
3493
- setTimeout(() => {
3494
- resolve3(true);
3495
- }, ms);
3496
- });
3497
- }
771
+ chunkI7UUR5MZ_cjs.init_cjs_shims();
772
+ var import_lodash = chunkI7UUR5MZ_cjs.__toESM(require_lodash(), 1);
3498
773
 
3499
774
  // src/BarrelManager.ts
3500
- init_cjs_shims();
775
+ chunkI7UUR5MZ_cjs.init_cjs_shims();
3501
776
 
3502
777
  // src/utils/TreeNode.ts
3503
- init_cjs_shims();
778
+ chunkI7UUR5MZ_cjs.init_cjs_shims();
3504
779
  var TreeNode = class _TreeNode {
3505
780
  constructor(data, parent) {
3506
781
  this.children = [];
@@ -3591,12 +866,12 @@ var TreeNode = class _TreeNode {
3591
866
  var _options;
3592
867
  var BarrelManager = class {
3593
868
  constructor(options = {}) {
3594
- __privateAdd(this, _options, void 0);
3595
- __privateSet(this, _options, options);
869
+ chunkI7UUR5MZ_cjs.__privateAdd(this, _options, void 0);
870
+ chunkI7UUR5MZ_cjs.__privateSet(this, _options, options);
3596
871
  return this;
3597
872
  }
3598
873
  getIndexes(pathToBuild) {
3599
- const { treeNode = {}, isTypeOnly, extName } = __privateGet(this, _options);
874
+ const { treeNode = {}, isTypeOnly, extName } = chunkI7UUR5MZ_cjs.__privateGet(this, _options);
3600
875
  const tree = TreeNode.build(pathToBuild, treeNode);
3601
876
  if (!tree) {
3602
877
  return null;
@@ -3608,7 +883,7 @@ var BarrelManager = class {
3608
883
  if (treeNode2.children.length > 1) {
3609
884
  const indexPath = path4__default.default.resolve(treeNode2.data.path, "index.ts");
3610
885
  const exports = treeNode2.children.filter(Boolean).map((file) => {
3611
- const importPath = file.data.type === "directory" ? `./${file.data.name}/index` : `./${transformers_default.trimExtName(file.data.name)}`;
886
+ const importPath = file.data.type === "directory" ? `./${file.data.name}/index` : `./${chunkABFPJZJL_cjs.trimExtName(file.data.name)}`;
3612
887
  if (importPath.endsWith("index") && file.data.type === "file") {
3613
888
  return void 0;
3614
889
  }
@@ -3629,7 +904,7 @@ var BarrelManager = class {
3629
904
  } else if (treeNode2.children.length === 1) {
3630
905
  const [treeNodeChild] = treeNode2.children;
3631
906
  const indexPath = path4__default.default.resolve(treeNode2.data.path, "index.ts");
3632
- const importPath = treeNodeChild.data.type === "directory" ? `./${treeNodeChild.data.name}/index` : `./${transformers_default.trimExtName(treeNodeChild.data.name)}`;
907
+ const importPath = treeNodeChild.data.type === "directory" ? `./${treeNodeChild.data.name}/index` : `./${chunkABFPJZJL_cjs.trimExtName(treeNodeChild.data.name)}`;
3633
908
  const exports = [
3634
909
  {
3635
910
  path: extName ? `${importPath}${extName}` : importPath,
@@ -3663,40 +938,40 @@ exports.KubbFile = void 0;
3663
938
  var _cache, _task, _isWriting, _timeout, _queue, _validate, _add, add_fn, _addOrAppend, addOrAppend_fn;
3664
939
  var _FileManager = class _FileManager {
3665
940
  constructor(options) {
3666
- __privateAdd(this, _validate);
3667
- __privateAdd(this, _add);
3668
- __privateAdd(this, _addOrAppend);
3669
- __privateAdd(this, _cache, /* @__PURE__ */ new Map());
3670
- __privateAdd(this, _task, void 0);
3671
- __privateAdd(this, _isWriting, false);
941
+ chunkI7UUR5MZ_cjs.__privateAdd(this, _validate);
942
+ chunkI7UUR5MZ_cjs.__privateAdd(this, _add);
943
+ chunkI7UUR5MZ_cjs.__privateAdd(this, _addOrAppend);
944
+ chunkI7UUR5MZ_cjs.__privateAdd(this, _cache, /* @__PURE__ */ new Map());
945
+ chunkI7UUR5MZ_cjs.__privateAdd(this, _task, void 0);
946
+ chunkI7UUR5MZ_cjs.__privateAdd(this, _isWriting, false);
3672
947
  /**
3673
948
  * Timeout between writes
3674
949
  */
3675
- __privateAdd(this, _timeout, 0);
3676
- __privateAdd(this, _queue, void 0);
950
+ chunkI7UUR5MZ_cjs.__privateAdd(this, _timeout, 0);
951
+ chunkI7UUR5MZ_cjs.__privateAdd(this, _queue, void 0);
3677
952
  if (options) {
3678
- __privateSet(this, _task, options.task);
3679
- __privateSet(this, _queue, options.queue);
3680
- __privateSet(this, _timeout, options.timeout || 0);
953
+ chunkI7UUR5MZ_cjs.__privateSet(this, _task, options.task);
954
+ chunkI7UUR5MZ_cjs.__privateSet(this, _queue, options.queue);
955
+ chunkI7UUR5MZ_cjs.__privateSet(this, _timeout, options.timeout || 0);
3681
956
  }
3682
957
  return this;
3683
958
  }
3684
959
  get files() {
3685
960
  const files = [];
3686
- __privateGet(this, _cache).forEach((item) => {
961
+ chunkI7UUR5MZ_cjs.__privateGet(this, _cache).forEach((item) => {
3687
962
  files.push(...item.flat(1));
3688
963
  });
3689
964
  return files;
3690
965
  }
3691
966
  get isExecuting() {
3692
- return __privateGet(this, _queue)?.hasJobs ?? __privateGet(this, _isWriting) ?? false;
967
+ return chunkI7UUR5MZ_cjs.__privateGet(this, _queue)?.hasJobs ?? chunkI7UUR5MZ_cjs.__privateGet(this, _isWriting) ?? false;
3693
968
  }
3694
969
  async add(...files) {
3695
970
  const promises = files.map((file) => {
3696
971
  if (file.override) {
3697
- return __privateMethod(this, _add, add_fn).call(this, file);
972
+ return chunkI7UUR5MZ_cjs.__privateMethod(this, _add, add_fn).call(this, file);
3698
973
  }
3699
- return __privateMethod(this, _addOrAppend, addOrAppend_fn).call(this, file);
974
+ return chunkI7UUR5MZ_cjs.__privateMethod(this, _addOrAppend, addOrAppend_fn).call(this, file);
3700
975
  });
3701
976
  const resolvedFiles = await Promise.all(promises);
3702
977
  if (files.length > 1) {
@@ -3731,13 +1006,13 @@ var _FileManager = class _FileManager {
3731
1006
  }
3732
1007
  ]
3733
1008
  };
3734
- await __privateMethod(this, _addOrAppend, addOrAppend_fn).call(this, {
1009
+ await chunkI7UUR5MZ_cjs.__privateMethod(this, _addOrAppend, addOrAppend_fn).call(this, {
3735
1010
  ...rootFile,
3736
1011
  meta: meta ? meta : rootFile.meta
3737
1012
  });
3738
1013
  return await Promise.all(
3739
1014
  files.map((file) => {
3740
- return __privateMethod(this, _addOrAppend, addOrAppend_fn).call(this, {
1015
+ return chunkI7UUR5MZ_cjs.__privateMethod(this, _addOrAppend, addOrAppend_fn).call(this, {
3741
1016
  ...file,
3742
1017
  meta: meta ? meta : file.meta
3743
1018
  });
@@ -3746,33 +1021,33 @@ var _FileManager = class _FileManager {
3746
1021
  }
3747
1022
  getCacheByUUID(UUID) {
3748
1023
  let cache;
3749
- __privateGet(this, _cache).forEach((files) => {
1024
+ chunkI7UUR5MZ_cjs.__privateGet(this, _cache).forEach((files) => {
3750
1025
  cache = files.find((item) => item.id === UUID);
3751
1026
  });
3752
1027
  return cache;
3753
1028
  }
3754
1029
  get(path5) {
3755
- return __privateGet(this, _cache).get(path5);
1030
+ return chunkI7UUR5MZ_cjs.__privateGet(this, _cache).get(path5);
3756
1031
  }
3757
1032
  remove(path5) {
3758
1033
  const cacheItem = this.get(path5);
3759
1034
  if (!cacheItem) {
3760
1035
  return;
3761
1036
  }
3762
- __privateGet(this, _cache).delete(path5);
1037
+ chunkI7UUR5MZ_cjs.__privateGet(this, _cache).delete(path5);
3763
1038
  }
3764
1039
  async write(...params) {
3765
- if (!__privateGet(this, _isWriting)) {
3766
- __privateSet(this, _isWriting, true);
3767
- const text = await write(...params);
3768
- __privateSet(this, _isWriting, false);
1040
+ if (!chunkI7UUR5MZ_cjs.__privateGet(this, _isWriting)) {
1041
+ chunkI7UUR5MZ_cjs.__privateSet(this, _isWriting, true);
1042
+ const text = await chunkZ7XZQBAK_cjs.write(...params);
1043
+ chunkI7UUR5MZ_cjs.__privateSet(this, _isWriting, false);
3769
1044
  return text;
3770
1045
  }
3771
- await timeout(__privateGet(this, _timeout));
1046
+ await chunk72O327DC_cjs.timeout(chunkI7UUR5MZ_cjs.__privateGet(this, _timeout));
3772
1047
  return this.write(...params);
3773
1048
  }
3774
1049
  async read(...params) {
3775
- return read(...params);
1050
+ return chunkZ7XZQBAK_cjs.read(...params);
3776
1051
  }
3777
1052
  // statics
3778
1053
  static getSource(file) {
@@ -3800,13 +1075,13 @@ _validate = new WeakSet();
3800
1075
  _add = new WeakSet();
3801
1076
  add_fn = async function(file) {
3802
1077
  const controller = new AbortController();
3803
- const resolvedFile = { id: crypto2__default.default.randomUUID(), name: transformers_default.trimExtName(file.baseName), ...file };
3804
- __privateGet(this, _cache).set(resolvedFile.path, [{ cancel: () => controller.abort(), ...resolvedFile }]);
3805
- if (__privateGet(this, _queue)) {
3806
- await __privateGet(this, _queue).run(
1078
+ const resolvedFile = { id: crypto__default.default.randomUUID(), name: chunkABFPJZJL_cjs.trimExtName(file.baseName), ...file };
1079
+ chunkI7UUR5MZ_cjs.__privateGet(this, _cache).set(resolvedFile.path, [{ cancel: () => controller.abort(), ...resolvedFile }]);
1080
+ if (chunkI7UUR5MZ_cjs.__privateGet(this, _queue)) {
1081
+ await chunkI7UUR5MZ_cjs.__privateGet(this, _queue).run(
3807
1082
  async () => {
3808
1083
  var _a;
3809
- return (_a = __privateGet(this, _task)) == null ? void 0 : _a.call(this, resolvedFile);
1084
+ return (_a = chunkI7UUR5MZ_cjs.__privateGet(this, _task)) == null ? void 0 : _a.call(this, resolvedFile);
3810
1085
  },
3811
1086
  { controller }
3812
1087
  );
@@ -3815,11 +1090,11 @@ add_fn = async function(file) {
3815
1090
  };
3816
1091
  _addOrAppend = new WeakSet();
3817
1092
  addOrAppend_fn = async function(file) {
3818
- const previousCaches = __privateGet(this, _cache).get(file.path);
1093
+ const previousCaches = chunkI7UUR5MZ_cjs.__privateGet(this, _cache).get(file.path);
3819
1094
  const previousCache = previousCaches ? previousCaches.at(previousCaches.length - 1) : void 0;
3820
1095
  if (previousCache) {
3821
- __privateGet(this, _cache).delete(previousCache.path);
3822
- return __privateMethod(this, _add, add_fn).call(this, {
1096
+ chunkI7UUR5MZ_cjs.__privateGet(this, _cache).delete(previousCache.path);
1097
+ return chunkI7UUR5MZ_cjs.__privateMethod(this, _add, add_fn).call(this, {
3823
1098
  ...file,
3824
1099
  source: previousCache.source && file.source ? `${previousCache.source}
3825
1100
  ${file.source}` : "",
@@ -3828,7 +1103,7 @@ ${file.source}` : "",
3828
1103
  env: { ...previousCache.env || {}, ...file.env || {} }
3829
1104
  });
3830
1105
  }
3831
- return __privateMethod(this, _add, add_fn).call(this, file);
1106
+ return chunkI7UUR5MZ_cjs.__privateMethod(this, _add, add_fn).call(this, file);
3832
1107
  };
3833
1108
  var FileManager = _FileManager;
3834
1109
  function getSource(file) {
@@ -3838,11 +1113,11 @@ function getSource(file) {
3838
1113
  const exports = file.exports ? combineExports(file.exports) : [];
3839
1114
  const imports = file.imports ? combineImports(file.imports, exports, file.source) : [];
3840
1115
  const importNodes = imports.filter((item) => {
3841
- return item.path !== transformers_default.trimExtName(file.path);
1116
+ return item.path !== chunkABFPJZJL_cjs.trimExtName(file.path);
3842
1117
  }).map((item) => {
3843
1118
  return factory__namespace.createImportDeclaration({
3844
1119
  name: item.name,
3845
- path: item.root ? getRelativePath(item.root, item.path) : item.path,
1120
+ path: item.root ? chunkZ7XZQBAK_cjs.getRelativePath(item.root, item.path) : item.path,
3846
1121
  isTypeOnly: item.isTypeOnly
3847
1122
  });
3848
1123
  });
@@ -3944,198 +1219,19 @@ function getEnvSource(source, env) {
3944
1219
  throw new TypeError(`Environment should be in upperCase for ${key}`);
3945
1220
  }
3946
1221
  if (typeof replaceBy === "string") {
3947
- prev = transformers_default.searchAndReplace({ text: prev.replaceAll(`process.env.${key}`, replaceBy), replaceBy, prefix: "process.env", key });
3948
- prev = transformers_default.searchAndReplace({ text: prev.replaceAll(new RegExp(`(declare const).*
1222
+ prev = chunkABFPJZJL_cjs.searchAndReplace({ text: prev.replaceAll(`process.env.${key}`, replaceBy), replaceBy, prefix: "process.env", key });
1223
+ prev = chunkABFPJZJL_cjs.searchAndReplace({ text: prev.replaceAll(new RegExp(`(declare const).*
3949
1224
  `, "ig"), ""), replaceBy, key });
3950
1225
  }
3951
1226
  return prev;
3952
1227
  }, source);
3953
1228
  }
3954
1229
 
3955
- // src/logger.ts
3956
- init_cjs_shims();
3957
- var LogLevel = {
3958
- silent: "silent",
3959
- info: "info",
3960
- debug: "debug"
3961
- };
3962
- function createLogger({ logLevel, name, spinner }) {
3963
- const logs = [];
3964
- const log = (message) => {
3965
- if (message && spinner) {
3966
- spinner.text = message;
3967
- logs.push(message);
3968
- }
3969
- };
3970
- const error = (message) => {
3971
- if (message) {
3972
- throw new Error(message || "Something went wrong");
3973
- }
3974
- };
3975
- const warn = (message) => {
3976
- if (message && spinner) {
3977
- spinner.warn(pc2__default.default.yellow(message));
3978
- logs.push(message);
3979
- }
3980
- };
3981
- const info = (message) => {
3982
- if (message && spinner && logLevel !== LogLevel.silent) {
3983
- spinner.info(message);
3984
- logs.push(message);
3985
- }
3986
- };
3987
- const logger = {
3988
- name,
3989
- logLevel,
3990
- log,
3991
- error,
3992
- warn,
3993
- info,
3994
- spinner,
3995
- logs
3996
- };
3997
- return logger;
3998
- }
3999
- var defaultColours = ["black", "blue", "darkBlue", "cyan", "gray", "green", "darkGreen", "magenta", "red", "darkRed", "yellow", "darkYellow"];
4000
- function randomColour(text, colours = defaultColours) {
4001
- if (!text) {
4002
- return "white";
4003
- }
4004
- const random = seedrandom__default.default(text);
4005
- const colour = colours.at(Math.floor(random() * colours.length)) || "white";
4006
- return colour;
4007
- }
4008
- function randomPicoColour(text, colors = defaultColours) {
4009
- const colours = pc2__default.default.createColors(true);
4010
- if (!text) {
4011
- return colours.white(text);
4012
- }
4013
- const colour = randomColour(text, colors);
4014
- const isDark = colour.includes("dark");
4015
- const key = colour.replace("dark", "").toLowerCase();
4016
- const formatter = colours[key];
4017
- if (isDark) {
4018
- return pc2__default.default.bold(formatter(text));
4019
- }
4020
- if (typeof formatter !== "function") {
4021
- throw new Error("Formatter for picoColor is not of type function/Formatter");
4022
- }
4023
- return formatter(text);
4024
- }
4025
-
4026
1230
  // src/PluginManager.ts
4027
- init_cjs_shims();
4028
-
4029
- // src/utils/EventEmitter.ts
4030
- init_cjs_shims();
4031
- var _emitter;
4032
- var EventEmitter = class {
4033
- constructor() {
4034
- __privateAdd(this, _emitter, new events.EventEmitter());
4035
- __privateGet(this, _emitter).setMaxListeners(100);
4036
- }
4037
- emit(eventName, ...eventArg) {
4038
- __privateGet(this, _emitter).emit(eventName, ...eventArg);
4039
- }
4040
- on(eventName, handler) {
4041
- __privateGet(this, _emitter).on(eventName, handler);
4042
- }
4043
- off(eventName, handler) {
4044
- __privateGet(this, _emitter).off(eventName, handler);
4045
- }
4046
- removeAll() {
4047
- __privateGet(this, _emitter).removeAllListeners();
4048
- }
4049
- };
4050
- _emitter = new WeakMap();
4051
-
4052
- // src/utils/Queue.ts
4053
- init_cjs_shims();
4054
- var _queue2, _workerCount, _maxParallel, _debug, _work, work_fn;
4055
- var Queue = class {
4056
- constructor(maxParallel, debug = false) {
4057
- __privateAdd(this, _work);
4058
- __privateAdd(this, _queue2, []);
4059
- this.eventEmitter = new EventEmitter();
4060
- __privateAdd(this, _workerCount, 0);
4061
- __privateAdd(this, _maxParallel, void 0);
4062
- __privateAdd(this, _debug, false);
4063
- __privateSet(this, _maxParallel, maxParallel);
4064
- __privateSet(this, _debug, debug);
4065
- }
4066
- run(job, options = { controller: new AbortController(), name: crypto2__default.default.randomUUID(), description: "" }) {
4067
- return new Promise((resolve3, reject) => {
4068
- const item = { reject, resolve: resolve3, job, name: options.name, description: options.description || options.name };
4069
- options.controller?.signal.addEventListener("abort", () => {
4070
- __privateSet(this, _queue2, __privateGet(this, _queue2).filter((queueItem) => queueItem.name === item.name));
4071
- reject("Aborted");
4072
- });
4073
- __privateGet(this, _queue2).push(item);
4074
- __privateMethod(this, _work, work_fn).call(this);
4075
- });
4076
- }
4077
- runSync(job, options = { controller: new AbortController(), name: crypto2__default.default.randomUUID(), description: "" }) {
4078
- new Promise((resolve3, reject) => {
4079
- const item = { reject, resolve: resolve3, job, name: options.name, description: options.description || options.name };
4080
- options.controller?.signal.addEventListener("abort", () => {
4081
- __privateSet(this, _queue2, __privateGet(this, _queue2).filter((queueItem) => queueItem.name === item.name));
4082
- });
4083
- __privateGet(this, _queue2).push(item);
4084
- __privateMethod(this, _work, work_fn).call(this);
4085
- });
4086
- }
4087
- get hasJobs() {
4088
- return __privateGet(this, _workerCount) > 0 || __privateGet(this, _queue2).length > 0;
4089
- }
4090
- get count() {
4091
- return __privateGet(this, _workerCount);
4092
- }
4093
- };
4094
- _queue2 = new WeakMap();
4095
- _workerCount = new WeakMap();
4096
- _maxParallel = new WeakMap();
4097
- _debug = new WeakMap();
4098
- _work = new WeakSet();
4099
- work_fn = function() {
4100
- if (__privateGet(this, _workerCount) >= __privateGet(this, _maxParallel)) {
4101
- return;
4102
- }
4103
- __privateWrapper(this, _workerCount)._++;
4104
- let entry;
4105
- while (entry = __privateGet(this, _queue2).shift()) {
4106
- const { reject, resolve: resolve3, job, name, description } = entry;
4107
- if (__privateGet(this, _debug)) {
4108
- perf_hooks.performance.mark(name + "_start");
4109
- }
4110
- job().then((result) => {
4111
- this.eventEmitter.emit("jobDone", result);
4112
- resolve3(result);
4113
- if (__privateGet(this, _debug)) {
4114
- perf_hooks.performance.mark(name + "_stop");
4115
- perf_hooks.performance.measure(description, name + "_start", name + "_stop");
4116
- }
4117
- }).catch((err) => {
4118
- this.eventEmitter.emit("jobFailed", err);
4119
- reject(err);
4120
- });
4121
- }
4122
- __privateWrapper(this, _workerCount)._--;
4123
- };
4124
-
4125
- // src/utils/uniqueName.ts
4126
- init_cjs_shims();
4127
- function setUniqueName(originalName, data) {
4128
- let used = data[originalName] || 0;
4129
- if (used) {
4130
- data[originalName] = ++used;
4131
- return originalName;
4132
- }
4133
- data[originalName] = 1;
4134
- return originalName;
4135
- }
1231
+ chunkI7UUR5MZ_cjs.init_cjs_shims();
4136
1232
 
4137
1233
  // src/errors.ts
4138
- init_cjs_shims();
1234
+ chunkI7UUR5MZ_cjs.init_cjs_shims();
4139
1235
  var Warning = class extends Error {
4140
1236
  constructor(message, options) {
4141
1237
  super(message, { cause: options?.cause });
@@ -4146,10 +1242,10 @@ var ValidationPluginError = class extends Error {
4146
1242
  };
4147
1243
 
4148
1244
  // src/plugin.ts
4149
- init_cjs_shims();
1245
+ chunkI7UUR5MZ_cjs.init_cjs_shims();
4150
1246
 
4151
1247
  // src/utils/cache.ts
4152
- init_cjs_shims();
1248
+ chunkI7UUR5MZ_cjs.init_cjs_shims();
4153
1249
  function createPluginCache(Store = /* @__PURE__ */ Object.create(null)) {
4154
1250
  return {
4155
1251
  set(id, value) {
@@ -4227,10 +1323,10 @@ var definePlugin = createPlugin((options) => {
4227
1323
  });
4228
1324
 
4229
1325
  // src/PromiseManager.ts
4230
- init_cjs_shims();
1326
+ chunkI7UUR5MZ_cjs.init_cjs_shims();
4231
1327
 
4232
1328
  // src/utils/executeStrategies.ts
4233
- init_cjs_shims();
1329
+ chunkI7UUR5MZ_cjs.init_cjs_shims();
4234
1330
  function hookSeq(promises) {
4235
1331
  return promises.filter(Boolean).reduce(
4236
1332
  (promise, func) => {
@@ -4268,8 +1364,8 @@ function hookParallel(promises) {
4268
1364
  var _options2;
4269
1365
  var PromiseManager = class {
4270
1366
  constructor(options = {}) {
4271
- __privateAdd(this, _options2, {});
4272
- __privateSet(this, _options2, options);
1367
+ chunkI7UUR5MZ_cjs.__privateAdd(this, _options2, {});
1368
+ chunkI7UUR5MZ_cjs.__privateSet(this, _options2, options);
4273
1369
  return this;
4274
1370
  }
4275
1371
  run(strategy, promises) {
@@ -4277,7 +1373,7 @@ var PromiseManager = class {
4277
1373
  return hookSeq(promises);
4278
1374
  }
4279
1375
  if (strategy === "first") {
4280
- return hookFirst(promises, __privateGet(this, _options2).nullCheck);
1376
+ return hookFirst(promises, chunkI7UUR5MZ_cjs.__privateGet(this, _options2).nullCheck);
4281
1377
  }
4282
1378
  if (strategy === "parallel") {
4283
1379
  return hookParallel(promises);
@@ -4297,8 +1393,8 @@ function isPromiseRejectedResult(result) {
4297
1393
  var _core, _usedPluginNames, _promiseManager, _getSortedPlugins, getSortedPlugins_fn, _addExecutedToCallStack, addExecutedToCallStack_fn, _execute, execute_fn, _executeSync, executeSync_fn, _catcher, catcher_fn, _parse, parse_fn;
4298
1394
  var PluginManager = class {
4299
1395
  constructor(config, options) {
4300
- __privateAdd(this, _getSortedPlugins);
4301
- __privateAdd(this, _addExecutedToCallStack);
1396
+ chunkI7UUR5MZ_cjs.__privateAdd(this, _getSortedPlugins);
1397
+ chunkI7UUR5MZ_cjs.__privateAdd(this, _addExecutedToCallStack);
4302
1398
  /**
4303
1399
  * Run an async plugin hook and return the result.
4304
1400
  * @param hookName Name of the plugin hook. Must be either in `PluginHooks` or `OutputPluginValueHooks`.
@@ -4306,7 +1402,7 @@ var PluginManager = class {
4306
1402
  * @param plugin The actual pluginObject to run.
4307
1403
  */
4308
1404
  // Implementation signature
4309
- __privateAdd(this, _execute);
1405
+ chunkI7UUR5MZ_cjs.__privateAdd(this, _execute);
4310
1406
  /**
4311
1407
  * Run a sync plugin hook and return the result.
4312
1408
  * @param hookName Name of the plugin hook. Must be in `PluginHooks`.
@@ -4314,14 +1410,14 @@ var PluginManager = class {
4314
1410
  * @param plugin The acutal plugin
4315
1411
  * @param replaceContext When passed, the plugin context can be overridden.
4316
1412
  */
4317
- __privateAdd(this, _executeSync);
4318
- __privateAdd(this, _catcher);
4319
- __privateAdd(this, _parse);
4320
- this.events = new EventEmitter();
1413
+ chunkI7UUR5MZ_cjs.__privateAdd(this, _executeSync);
1414
+ chunkI7UUR5MZ_cjs.__privateAdd(this, _catcher);
1415
+ chunkI7UUR5MZ_cjs.__privateAdd(this, _parse);
1416
+ this.events = new chunk72O327DC_cjs.EventEmitter();
4321
1417
  this.executed = [];
4322
- __privateAdd(this, _core, void 0);
4323
- __privateAdd(this, _usedPluginNames, {});
4324
- __privateAdd(this, _promiseManager, void 0);
1418
+ chunkI7UUR5MZ_cjs.__privateAdd(this, _core, void 0);
1419
+ chunkI7UUR5MZ_cjs.__privateAdd(this, _usedPluginNames, {});
1420
+ chunkI7UUR5MZ_cjs.__privateAdd(this, _promiseManager, void 0);
4325
1421
  this.resolvePath = (params) => {
4326
1422
  if (params.pluginKey) {
4327
1423
  const paths = this.hookForPluginSync({
@@ -4329,7 +1425,7 @@ var PluginManager = class {
4329
1425
  hookName: "resolvePath",
4330
1426
  parameters: [params.baseName, params.directory, params.options]
4331
1427
  });
4332
- if (paths && paths?.length > 1 && this.logger.logLevel === LogLevel.debug) {
1428
+ if (paths && paths?.length > 1 && this.logger.logLevel === chunk77QZQ377_cjs.LogLevel.debug) {
4333
1429
  this.logger.warn(
4334
1430
  `Cannot return a path where the 'pluginKey' ${params.pluginKey ? JSON.stringify(params.pluginKey) : '"'} is not unique enough
4335
1431
 
@@ -4353,7 +1449,7 @@ Falling back on the first item.
4353
1449
  hookName: "resolveName",
4354
1450
  parameters: [params.name, params.type]
4355
1451
  });
4356
- if (names && names?.length > 1 && this.logger.logLevel === LogLevel.debug) {
1452
+ if (names && names?.length > 1 && this.logger.logLevel === chunk77QZQ377_cjs.LogLevel.debug) {
4357
1453
  this.logger.warn(
4358
1454
  `Cannot return a name where the 'pluginKey' ${params.pluginKey ? JSON.stringify(params.pluginKey) : '"'} is not unique enough
4359
1455
 
@@ -4363,19 +1459,19 @@ Falling back on the first item.
4363
1459
  `
4364
1460
  );
4365
1461
  }
4366
- return transformReservedWord(names?.at(0) || params.name);
1462
+ return chunkABFPJZJL_cjs.transformReservedWord(names?.at(0) || params.name);
4367
1463
  }
4368
1464
  const name = this.hookFirstSync({
4369
1465
  hookName: "resolveName",
4370
1466
  parameters: [params.name, params.type]
4371
1467
  }).result;
4372
- return transformReservedWord(name);
1468
+ return chunkABFPJZJL_cjs.transformReservedWord(name);
4373
1469
  };
4374
1470
  this.config = config;
4375
1471
  this.logger = options.logger;
4376
- this.queue = new Queue(100, this.logger.logLevel === LogLevel.debug);
1472
+ this.queue = new chunk72O327DC_cjs.Queue(100, this.logger.logLevel === chunk77QZQ377_cjs.LogLevel.debug);
4377
1473
  this.fileManager = new FileManager({ task: options.task, queue: this.queue, timeout: options.writeTimeout });
4378
- __privateSet(this, _promiseManager, new PromiseManager({ nullCheck: (state) => !!state?.result }));
1474
+ chunkI7UUR5MZ_cjs.__privateSet(this, _promiseManager, new PromiseManager({ nullCheck: (state) => !!state?.result }));
4379
1475
  const plugins = config.plugins || [];
4380
1476
  const core = definePlugin({
4381
1477
  config,
@@ -4384,11 +1480,11 @@ Falling back on the first item.
4384
1480
  fileManager: this.fileManager,
4385
1481
  resolvePath: this.resolvePath.bind(this),
4386
1482
  resolveName: this.resolveName.bind(this),
4387
- getPlugins: __privateMethod(this, _getSortedPlugins, getSortedPlugins_fn).bind(this)
1483
+ getPlugins: chunkI7UUR5MZ_cjs.__privateMethod(this, _getSortedPlugins, getSortedPlugins_fn).bind(this)
4388
1484
  });
4389
- __privateSet(this, _core, __privateMethod(this, _parse, parse_fn).call(this, core, this, core.api.call(null)));
4390
- this.plugins = [__privateGet(this, _core), ...plugins].map((plugin) => {
4391
- return __privateMethod(this, _parse, parse_fn).call(this, plugin, this, __privateGet(this, _core).api);
1485
+ chunkI7UUR5MZ_cjs.__privateSet(this, _core, chunkI7UUR5MZ_cjs.__privateMethod(this, _parse, parse_fn).call(this, core, this, core.api.call(null)));
1486
+ this.plugins = [chunkI7UUR5MZ_cjs.__privateGet(this, _core), ...plugins].map((plugin) => {
1487
+ return chunkI7UUR5MZ_cjs.__privateMethod(this, _parse, parse_fn).call(this, plugin, this, chunkI7UUR5MZ_cjs.__privateGet(this, _core).api);
4392
1488
  });
4393
1489
  return this;
4394
1490
  }
@@ -4408,7 +1504,7 @@ Falling back on the first item.
4408
1504
  }) {
4409
1505
  const plugins = this.getPluginsByKey(hookName, pluginKey);
4410
1506
  const promises = plugins.map((plugin) => {
4411
- return __privateMethod(this, _execute, execute_fn).call(this, {
1507
+ return chunkI7UUR5MZ_cjs.__privateMethod(this, _execute, execute_fn).call(this, {
4412
1508
  strategy: "hookFirst",
4413
1509
  hookName,
4414
1510
  parameters,
@@ -4427,7 +1523,7 @@ Falling back on the first item.
4427
1523
  }) {
4428
1524
  const plugins = this.getPluginsByKey(hookName, pluginKey);
4429
1525
  return plugins.map((plugin) => {
4430
- return __privateMethod(this, _executeSync, executeSync_fn).call(this, {
1526
+ return chunkI7UUR5MZ_cjs.__privateMethod(this, _executeSync, executeSync_fn).call(this, {
4431
1527
  strategy: "hookFirst",
4432
1528
  hookName,
4433
1529
  parameters,
@@ -4443,11 +1539,11 @@ Falling back on the first item.
4443
1539
  parameters,
4444
1540
  skipped
4445
1541
  }) {
4446
- const promises = __privateMethod(this, _getSortedPlugins, getSortedPlugins_fn).call(this).filter((plugin) => {
1542
+ const promises = chunkI7UUR5MZ_cjs.__privateMethod(this, _getSortedPlugins, getSortedPlugins_fn).call(this).filter((plugin) => {
4447
1543
  return skipped ? skipped.has(plugin) : true;
4448
1544
  }).map((plugin) => {
4449
1545
  return async () => {
4450
- const value = await __privateMethod(this, _execute, execute_fn).call(this, {
1546
+ const value = await chunkI7UUR5MZ_cjs.__privateMethod(this, _execute, execute_fn).call(this, {
4451
1547
  strategy: "hookFirst",
4452
1548
  hookName,
4453
1549
  parameters,
@@ -4461,7 +1557,7 @@ Falling back on the first item.
4461
1557
  );
4462
1558
  };
4463
1559
  });
4464
- return __privateGet(this, _promiseManager).run("first", promises);
1560
+ return chunkI7UUR5MZ_cjs.__privateGet(this, _promiseManager).run("first", promises);
4465
1561
  }
4466
1562
  /**
4467
1563
  * First non-null result stops and will return it's value.
@@ -4472,12 +1568,12 @@ Falling back on the first item.
4472
1568
  skipped
4473
1569
  }) {
4474
1570
  let parseResult = null;
4475
- for (const plugin of __privateMethod(this, _getSortedPlugins, getSortedPlugins_fn).call(this)) {
1571
+ for (const plugin of chunkI7UUR5MZ_cjs.__privateMethod(this, _getSortedPlugins, getSortedPlugins_fn).call(this)) {
4476
1572
  if (skipped && skipped.has(plugin)) {
4477
1573
  continue;
4478
1574
  }
4479
1575
  parseResult = {
4480
- result: __privateMethod(this, _executeSync, executeSync_fn).call(this, {
1576
+ result: chunkI7UUR5MZ_cjs.__privateMethod(this, _executeSync, executeSync_fn).call(this, {
4481
1577
  strategy: "hookFirst",
4482
1578
  hookName,
4483
1579
  parameters,
@@ -4498,14 +1594,14 @@ Falling back on the first item.
4498
1594
  hookName,
4499
1595
  parameters
4500
1596
  }) {
4501
- const promises = __privateMethod(this, _getSortedPlugins, getSortedPlugins_fn).call(this).map((plugin) => {
4502
- return () => __privateMethod(this, _execute, execute_fn).call(this, { strategy: "hookParallel", hookName, parameters, plugin });
1597
+ const promises = chunkI7UUR5MZ_cjs.__privateMethod(this, _getSortedPlugins, getSortedPlugins_fn).call(this).map((plugin) => {
1598
+ return () => chunkI7UUR5MZ_cjs.__privateMethod(this, _execute, execute_fn).call(this, { strategy: "hookParallel", hookName, parameters, plugin });
4503
1599
  });
4504
- const results = await __privateGet(this, _promiseManager).run("parallel", promises);
1600
+ const results = await chunkI7UUR5MZ_cjs.__privateGet(this, _promiseManager).run("parallel", promises);
4505
1601
  results.forEach((result, index) => {
4506
1602
  if (isPromiseRejectedResult(result)) {
4507
- const plugin = __privateMethod(this, _getSortedPlugins, getSortedPlugins_fn).call(this)[index];
4508
- __privateMethod(this, _catcher, catcher_fn).call(this, result.reason, plugin, hookName);
1603
+ const plugin = chunkI7UUR5MZ_cjs.__privateMethod(this, _getSortedPlugins, getSortedPlugins_fn).call(this)[index];
1604
+ chunkI7UUR5MZ_cjs.__privateMethod(this, _catcher, catcher_fn).call(this, result.reason, plugin, hookName);
4509
1605
  }
4510
1606
  });
4511
1607
  return results.filter((result) => result.status === "fulfilled").map((result) => result.value);
@@ -4520,16 +1616,16 @@ Falling back on the first item.
4520
1616
  }) {
4521
1617
  const [argument0, ...rest] = parameters;
4522
1618
  let promise = Promise.resolve(argument0);
4523
- for (const plugin of __privateMethod(this, _getSortedPlugins, getSortedPlugins_fn).call(this)) {
1619
+ for (const plugin of chunkI7UUR5MZ_cjs.__privateMethod(this, _getSortedPlugins, getSortedPlugins_fn).call(this)) {
4524
1620
  promise = promise.then((arg0) => {
4525
- const value = __privateMethod(this, _execute, execute_fn).call(this, {
1621
+ const value = chunkI7UUR5MZ_cjs.__privateMethod(this, _execute, execute_fn).call(this, {
4526
1622
  strategy: "hookReduceArg0",
4527
1623
  hookName,
4528
1624
  parameters: [arg0, ...rest],
4529
1625
  plugin
4530
1626
  });
4531
1627
  return value;
4532
- }).then((result) => reduce.call(__privateGet(this, _core).api, argument0, result, plugin));
1628
+ }).then((result) => reduce.call(chunkI7UUR5MZ_cjs.__privateGet(this, _core).api, argument0, result, plugin));
4533
1629
  }
4534
1630
  return promise;
4535
1631
  }
@@ -4537,15 +1633,15 @@ Falling back on the first item.
4537
1633
  * Chains plugins
4538
1634
  */
4539
1635
  async hookSeq({ hookName, parameters }) {
4540
- const promises = __privateMethod(this, _getSortedPlugins, getSortedPlugins_fn).call(this).map((plugin) => {
4541
- return () => __privateMethod(this, _execute, execute_fn).call(this, {
1636
+ const promises = chunkI7UUR5MZ_cjs.__privateMethod(this, _getSortedPlugins, getSortedPlugins_fn).call(this).map((plugin) => {
1637
+ return () => chunkI7UUR5MZ_cjs.__privateMethod(this, _execute, execute_fn).call(this, {
4542
1638
  strategy: "hookSeq",
4543
1639
  hookName,
4544
1640
  parameters,
4545
1641
  plugin
4546
1642
  });
4547
1643
  });
4548
- return __privateGet(this, _promiseManager).run("seq", promises);
1644
+ return chunkI7UUR5MZ_cjs.__privateGet(this, _promiseManager).run("seq", promises);
4549
1645
  }
4550
1646
  getPluginsByKey(hookName, pluginKey) {
4551
1647
  const plugins = [...this.plugins];
@@ -4561,7 +1657,7 @@ Falling back on the first item.
4561
1657
  });
4562
1658
  if (!pluginByPluginName?.length) {
4563
1659
  const corePlugin = plugins.find((plugin) => plugin.name === "core" && plugin[hookName]);
4564
- if (this.logger.logLevel === LogLevel.debug) {
1660
+ if (this.logger.logLevel === chunk77QZQ377_cjs.LogLevel.debug) {
4565
1661
  if (corePlugin) {
4566
1662
  this.logger.warn(`No hook '${hookName}' for pluginKey '${JSON.stringify(pluginKey)}' found, falling back on the '@kubb/core' plugin`);
4567
1663
  } else {
@@ -4599,7 +1695,7 @@ _getSortedPlugins = new WeakSet();
4599
1695
  getSortedPlugins_fn = function(hookName) {
4600
1696
  const plugins = [...this.plugins].filter((plugin) => plugin.name !== "core");
4601
1697
  if (hookName) {
4602
- if (this.logger.logLevel === LogLevel.info) {
1698
+ if (this.logger.logLevel === chunk77QZQ377_cjs.LogLevel.info) {
4603
1699
  const containsHookName = plugins.some((item) => item[hookName]);
4604
1700
  if (!containsHookName) {
4605
1701
  this.logger.warn(`No hook ${hookName} found`);
@@ -4647,7 +1743,7 @@ execute_fn = function({
4647
1743
  this.events.emit("execute", { strategy, hookName, parameters, plugin });
4648
1744
  const task = Promise.resolve().then(() => {
4649
1745
  if (typeof hook === "function") {
4650
- const possiblePromiseResult = hook.apply({ ...__privateGet(this, _core).api, plugin }, parameters);
1746
+ const possiblePromiseResult = hook.apply({ ...chunkI7UUR5MZ_cjs.__privateGet(this, _core).api, plugin }, parameters);
4651
1747
  if (isPromise(possiblePromiseResult)) {
4652
1748
  return Promise.resolve(possiblePromiseResult);
4653
1749
  }
@@ -4656,7 +1752,7 @@ execute_fn = function({
4656
1752
  return hook;
4657
1753
  }).then((result) => {
4658
1754
  output = result;
4659
- __privateMethod(this, _addExecutedToCallStack, addExecutedToCallStack_fn).call(this, {
1755
+ chunkI7UUR5MZ_cjs.__privateMethod(this, _addExecutedToCallStack, addExecutedToCallStack_fn).call(this, {
4660
1756
  parameters,
4661
1757
  output,
4662
1758
  strategy,
@@ -4665,7 +1761,7 @@ execute_fn = function({
4665
1761
  });
4666
1762
  return result;
4667
1763
  }).catch((e) => {
4668
- __privateMethod(this, _catcher, catcher_fn).call(this, e, plugin, hookName);
1764
+ chunkI7UUR5MZ_cjs.__privateMethod(this, _catcher, catcher_fn).call(this, e, plugin, hookName);
4669
1765
  return null;
4670
1766
  });
4671
1767
  return task;
@@ -4685,12 +1781,12 @@ executeSync_fn = function({
4685
1781
  this.events.emit("execute", { strategy, hookName, parameters, plugin });
4686
1782
  try {
4687
1783
  if (typeof hook === "function") {
4688
- const fn = hook.apply({ ...__privateGet(this, _core).api, plugin }, parameters);
1784
+ const fn = hook.apply({ ...chunkI7UUR5MZ_cjs.__privateGet(this, _core).api, plugin }, parameters);
4689
1785
  output = fn;
4690
1786
  return fn;
4691
1787
  }
4692
1788
  output = hook;
4693
- __privateMethod(this, _addExecutedToCallStack, addExecutedToCallStack_fn).call(this, {
1789
+ chunkI7UUR5MZ_cjs.__privateMethod(this, _addExecutedToCallStack, addExecutedToCallStack_fn).call(this, {
4694
1790
  parameters,
4695
1791
  output,
4696
1792
  strategy,
@@ -4699,7 +1795,7 @@ executeSync_fn = function({
4699
1795
  });
4700
1796
  return hook;
4701
1797
  } catch (e) {
4702
- __privateMethod(this, _catcher, catcher_fn).call(this, e, plugin, hookName);
1798
+ chunkI7UUR5MZ_cjs.__privateMethod(this, _catcher, catcher_fn).call(this, e, plugin, hookName);
4703
1799
  return null;
4704
1800
  }
4705
1801
  };
@@ -4712,8 +1808,8 @@ catcher_fn = function(e, plugin, hookName) {
4712
1808
  };
4713
1809
  _parse = new WeakSet();
4714
1810
  parse_fn = function(plugin, pluginManager, context) {
4715
- const usedPluginNames = __privateGet(pluginManager, _usedPluginNames);
4716
- setUniqueName(plugin.name, usedPluginNames);
1811
+ const usedPluginNames = chunkI7UUR5MZ_cjs.__privateGet(pluginManager, _usedPluginNames);
1812
+ chunk72O327DC_cjs.setUniqueName(plugin.name, usedPluginNames);
4717
1813
  const key = [plugin.name, usedPluginNames[plugin.name]].filter(Boolean);
4718
1814
  if (plugin.name !== "core" && usedPluginNames[plugin.name] >= 2) {
4719
1815
  pluginManager.logger.warn("Using multiple of the same plugin is an experimental feature");
@@ -4742,15 +1838,15 @@ async function transformReducer(_previousCode, result, _plugin) {
4742
1838
  return result;
4743
1839
  }
4744
1840
  async function setup(options) {
4745
- const { config, logger = createLogger({ logLevel: LogLevel.silent }) } = options;
1841
+ const { config, logger = chunk77QZQ377_cjs.createLogger({ logLevel: chunk77QZQ377_cjs.LogLevel.silent }) } = options;
4746
1842
  try {
4747
- if (isInputPath(config) && !new URLPath(config.input.path).isURL) {
4748
- await read(config.input.path);
1843
+ if (isInputPath(config) && !new chunk72O327DC_cjs.URLPath(config.input.path).isURL) {
1844
+ await chunkZ7XZQBAK_cjs.read(config.input.path);
4749
1845
  }
4750
1846
  } catch (e) {
4751
1847
  if (isInputPath(config)) {
4752
1848
  throw new Error(
4753
- "Cannot read file/URL defined in `input.path` or set with `kubb generate PATH` in the CLI of your Kubb config " + pc2__default.default.dim(config.input.path),
1849
+ "Cannot read file/URL defined in `input.path` or set with `kubb generate PATH` in the CLI of your Kubb config " + chunk77QZQ377_cjs.p.dim(config.input.path),
4754
1850
  {
4755
1851
  cause: e
4756
1852
  }
@@ -4758,7 +1854,7 @@ async function setup(options) {
4758
1854
  }
4759
1855
  }
4760
1856
  if (config.output.clean) {
4761
- await clean(config.output.path);
1857
+ await chunkZ7XZQBAK_cjs.clean(config.output.path);
4762
1858
  }
4763
1859
  const queueTask = async (file) => {
4764
1860
  const { path: path5 } = file;
@@ -4799,11 +1895,11 @@ async function setup(options) {
4799
1895
  const { hookName, parameters, plugin } = executer;
4800
1896
  if (hookName === "writeFile" && logger.spinner) {
4801
1897
  const [code] = parameters;
4802
- if (logger.logLevel === LogLevel.info) {
1898
+ if (logger.logLevel === chunk77QZQ377_cjs.LogLevel.info) {
4803
1899
  logger.spinner.start(`\u{1F4BE} Writing`);
4804
1900
  }
4805
- if (logger.logLevel === LogLevel.debug) {
4806
- logger.info(`PluginKey ${pc2__default.default.dim(JSON.stringify(plugin.key))}
1901
+ if (logger.logLevel === chunk77QZQ377_cjs.LogLevel.debug) {
1902
+ logger.info(`PluginKey ${chunk77QZQ377_cjs.p.dim(JSON.stringify(plugin.key))}
4807
1903
  with source
4808
1904
 
4809
1905
  ${code}`);
@@ -4812,21 +1908,21 @@ ${code}`);
4812
1908
  });
4813
1909
  pluginManager.on("executed", (executer) => {
4814
1910
  const { hookName, plugin, output, parameters } = executer;
4815
- const messsage = `${randomPicoColour(plugin.name)} Executing ${hookName}`;
4816
- if (logger.logLevel === LogLevel.info && logger.spinner) {
1911
+ const messsage = `${chunk77QZQ377_cjs.randomCliColour(plugin.name)} Executing ${hookName}`;
1912
+ if (logger.logLevel === chunk77QZQ377_cjs.LogLevel.info && logger.spinner) {
4817
1913
  if (hookName === "writeFile") {
4818
1914
  const [_code, path5] = parameters;
4819
- logger.spinner.suffixText = pc2__default.default.dim(path5);
1915
+ logger.spinner.suffixText = chunk77QZQ377_cjs.p.dim(path5);
4820
1916
  } else {
4821
1917
  logger.spinner.suffixText = messsage;
4822
1918
  }
4823
1919
  }
4824
- if (logger.logLevel === LogLevel.debug) {
1920
+ if (logger.logLevel === chunk77QZQ377_cjs.LogLevel.debug) {
4825
1921
  logger.info(messsage);
4826
1922
  const logs = [
4827
- parameters && `${pc2__default.default.bgWhite(`Parameters`)} ${randomPicoColour(plugin.name)} ${hookName}`,
1923
+ parameters && `${chunk77QZQ377_cjs.p.bgWhite(`Parameters`)} ${chunk77QZQ377_cjs.randomCliColour(plugin.name)} ${hookName}`,
4828
1924
  JSON.stringify(parameters, void 0, 2),
4829
- output && `${pc2__default.default.bgWhite("Output")} ${randomPicoColour(plugin.name)} ${hookName}`,
1925
+ output && `${chunk77QZQ377_cjs.p.bgWhite("Output")} ${chunk77QZQ377_cjs.randomCliColour(plugin.name)} ${hookName}`,
4830
1926
  output
4831
1927
  ].filter(Boolean);
4832
1928
  console.log(logs.join("\n"));
@@ -4868,95 +1964,95 @@ async function safeBuild(options) {
4868
1964
  }
4869
1965
 
4870
1966
  // src/Generator.ts
4871
- init_cjs_shims();
1967
+ chunkI7UUR5MZ_cjs.init_cjs_shims();
4872
1968
  var _options3, _context;
4873
1969
  var Generator = class {
4874
1970
  constructor(options, context) {
4875
- __privateAdd(this, _options3, {});
4876
- __privateAdd(this, _context, {});
1971
+ chunkI7UUR5MZ_cjs.__privateAdd(this, _options3, {});
1972
+ chunkI7UUR5MZ_cjs.__privateAdd(this, _context, {});
4877
1973
  if (context) {
4878
- __privateSet(this, _context, context);
1974
+ chunkI7UUR5MZ_cjs.__privateSet(this, _context, context);
4879
1975
  }
4880
1976
  if (options) {
4881
- __privateSet(this, _options3, options);
1977
+ chunkI7UUR5MZ_cjs.__privateSet(this, _options3, options);
4882
1978
  }
4883
1979
  return this;
4884
1980
  }
4885
1981
  get options() {
4886
- return __privateGet(this, _options3);
1982
+ return chunkI7UUR5MZ_cjs.__privateGet(this, _options3);
4887
1983
  }
4888
1984
  get context() {
4889
- return __privateGet(this, _context);
1985
+ return chunkI7UUR5MZ_cjs.__privateGet(this, _context);
4890
1986
  }
4891
1987
  set options(options) {
4892
- __privateSet(this, _options3, { ...__privateGet(this, _options3), ...options });
1988
+ chunkI7UUR5MZ_cjs.__privateSet(this, _options3, { ...chunkI7UUR5MZ_cjs.__privateGet(this, _options3), ...options });
4893
1989
  }
4894
1990
  };
4895
1991
  _options3 = new WeakMap();
4896
1992
  _context = new WeakMap();
4897
1993
 
4898
1994
  // src/PackageManager.ts
4899
- init_cjs_shims();
1995
+ chunkI7UUR5MZ_cjs.init_cjs_shims();
4900
1996
 
4901
- // ../../node_modules/.pnpm/find-up@6.3.0/node_modules/find-up/index.js
4902
- init_cjs_shims();
1997
+ // ../../node_modules/.pnpm/find-up@7.0.0/node_modules/find-up/index.js
1998
+ chunkI7UUR5MZ_cjs.init_cjs_shims();
4903
1999
 
4904
2000
  // ../../node_modules/.pnpm/locate-path@7.2.0/node_modules/locate-path/index.js
4905
- init_cjs_shims();
2001
+ chunkI7UUR5MZ_cjs.init_cjs_shims();
4906
2002
 
4907
2003
  // ../../node_modules/.pnpm/p-locate@6.0.0/node_modules/p-locate/index.js
4908
- init_cjs_shims();
2004
+ chunkI7UUR5MZ_cjs.init_cjs_shims();
4909
2005
 
4910
2006
  // ../../node_modules/.pnpm/p-limit@4.0.0/node_modules/p-limit/index.js
4911
- init_cjs_shims();
2007
+ chunkI7UUR5MZ_cjs.init_cjs_shims();
4912
2008
 
4913
2009
  // ../../node_modules/.pnpm/yocto-queue@1.0.0/node_modules/yocto-queue/index.js
4914
- init_cjs_shims();
2010
+ chunkI7UUR5MZ_cjs.init_cjs_shims();
4915
2011
  var Node = class {
4916
2012
  constructor(value) {
4917
- __publicField(this, "value");
4918
- __publicField(this, "next");
2013
+ chunkI7UUR5MZ_cjs.__publicField(this, "value");
2014
+ chunkI7UUR5MZ_cjs.__publicField(this, "next");
4919
2015
  this.value = value;
4920
2016
  }
4921
2017
  };
4922
2018
  var _head, _tail, _size;
4923
2019
  var Queue2 = class {
4924
2020
  constructor() {
4925
- __privateAdd(this, _head, void 0);
4926
- __privateAdd(this, _tail, void 0);
4927
- __privateAdd(this, _size, void 0);
2021
+ chunkI7UUR5MZ_cjs.__privateAdd(this, _head, void 0);
2022
+ chunkI7UUR5MZ_cjs.__privateAdd(this, _tail, void 0);
2023
+ chunkI7UUR5MZ_cjs.__privateAdd(this, _size, void 0);
4928
2024
  this.clear();
4929
2025
  }
4930
2026
  enqueue(value) {
4931
2027
  const node = new Node(value);
4932
- if (__privateGet(this, _head)) {
4933
- __privateGet(this, _tail).next = node;
4934
- __privateSet(this, _tail, node);
2028
+ if (chunkI7UUR5MZ_cjs.__privateGet(this, _head)) {
2029
+ chunkI7UUR5MZ_cjs.__privateGet(this, _tail).next = node;
2030
+ chunkI7UUR5MZ_cjs.__privateSet(this, _tail, node);
4935
2031
  } else {
4936
- __privateSet(this, _head, node);
4937
- __privateSet(this, _tail, node);
2032
+ chunkI7UUR5MZ_cjs.__privateSet(this, _head, node);
2033
+ chunkI7UUR5MZ_cjs.__privateSet(this, _tail, node);
4938
2034
  }
4939
- __privateWrapper(this, _size)._++;
2035
+ chunkI7UUR5MZ_cjs.__privateWrapper(this, _size)._++;
4940
2036
  }
4941
2037
  dequeue() {
4942
- const current = __privateGet(this, _head);
2038
+ const current = chunkI7UUR5MZ_cjs.__privateGet(this, _head);
4943
2039
  if (!current) {
4944
2040
  return;
4945
2041
  }
4946
- __privateSet(this, _head, __privateGet(this, _head).next);
4947
- __privateWrapper(this, _size)._--;
2042
+ chunkI7UUR5MZ_cjs.__privateSet(this, _head, chunkI7UUR5MZ_cjs.__privateGet(this, _head).next);
2043
+ chunkI7UUR5MZ_cjs.__privateWrapper(this, _size)._--;
4948
2044
  return current.value;
4949
2045
  }
4950
2046
  clear() {
4951
- __privateSet(this, _head, void 0);
4952
- __privateSet(this, _tail, void 0);
4953
- __privateSet(this, _size, 0);
2047
+ chunkI7UUR5MZ_cjs.__privateSet(this, _head, void 0);
2048
+ chunkI7UUR5MZ_cjs.__privateSet(this, _tail, void 0);
2049
+ chunkI7UUR5MZ_cjs.__privateSet(this, _size, 0);
4954
2050
  }
4955
2051
  get size() {
4956
- return __privateGet(this, _size);
2052
+ return chunkI7UUR5MZ_cjs.__privateGet(this, _size);
4957
2053
  }
4958
2054
  *[Symbol.iterator]() {
4959
- let current = __privateGet(this, _head);
2055
+ let current = chunkI7UUR5MZ_cjs.__privateGet(this, _head);
4960
2056
  while (current) {
4961
2057
  yield current.value;
4962
2058
  current = current.next;
@@ -4980,18 +2076,18 @@ function pLimit(concurrency) {
4980
2076
  queue.dequeue()();
4981
2077
  }
4982
2078
  };
4983
- const run = async (fn, resolve3, args) => {
2079
+ const run = async (fn, resolve2, args) => {
4984
2080
  activeCount++;
4985
2081
  const result = (async () => fn(...args))();
4986
- resolve3(result);
2082
+ resolve2(result);
4987
2083
  try {
4988
2084
  await result;
4989
2085
  } catch {
4990
2086
  }
4991
2087
  next();
4992
2088
  };
4993
- const enqueue = (fn, resolve3, args) => {
4994
- queue.enqueue(run.bind(void 0, fn, resolve3, args));
2089
+ const enqueue = (fn, resolve2, args) => {
2090
+ queue.enqueue(run.bind(void 0, fn, resolve2, args));
4995
2091
  (async () => {
4996
2092
  await Promise.resolve();
4997
2093
  if (activeCount < concurrency && queue.size > 0) {
@@ -4999,8 +2095,8 @@ function pLimit(concurrency) {
4999
2095
  }
5000
2096
  })();
5001
2097
  };
5002
- const generator = (fn, ...args) => new Promise((resolve3) => {
5003
- enqueue(fn, resolve3, args);
2098
+ const generator = (fn, ...args) => new Promise((resolve2) => {
2099
+ enqueue(fn, resolve2, args);
5004
2100
  });
5005
2101
  Object.defineProperties(generator, {
5006
2102
  activeCount: {
@@ -5064,7 +2160,7 @@ function checkType(type) {
5064
2160
  var matchType = (type, stat) => stat[typeMappings[type]]();
5065
2161
  var toPath = (urlOrPath) => urlOrPath instanceof URL ? url.fileURLToPath(urlOrPath) : urlOrPath;
5066
2162
  async function locatePath(paths, {
5067
- cwd = process2__default.default.cwd(),
2163
+ cwd = process__default.default.cwd(),
5068
2164
  type = "file",
5069
2165
  allowSymlinks = true,
5070
2166
  concurrency,
@@ -5072,7 +2168,7 @@ async function locatePath(paths, {
5072
2168
  } = {}) {
5073
2169
  checkType(type);
5074
2170
  cwd = toPath(cwd);
5075
- const statFunction = allowSymlinks ? fs3.promises.stat : fs3.promises.lstat;
2171
+ const statFunction = allowSymlinks ? fs.promises.stat : fs.promises.lstat;
5076
2172
  return pLocate(paths, async (path_) => {
5077
2173
  try {
5078
2174
  const stat = await statFunction(path4__default.default.resolve(cwd, path_));
@@ -5083,13 +2179,13 @@ async function locatePath(paths, {
5083
2179
  }, { concurrency, preserveOrder });
5084
2180
  }
5085
2181
  function locatePathSync(paths, {
5086
- cwd = process2__default.default.cwd(),
2182
+ cwd = process__default.default.cwd(),
5087
2183
  type = "file",
5088
2184
  allowSymlinks = true
5089
2185
  } = {}) {
5090
2186
  checkType(type);
5091
2187
  cwd = toPath(cwd);
5092
- const statFunction = allowSymlinks ? fs3__default.default.statSync : fs3__default.default.lstatSync;
2188
+ const statFunction = allowSymlinks ? fs__default.default.statSync : fs__default.default.lstatSync;
5093
2189
  for (const path_ of paths) {
5094
2190
  try {
5095
2191
  const stat = statFunction(path4__default.default.resolve(cwd, path_), {
@@ -5106,17 +2202,22 @@ function locatePathSync(paths, {
5106
2202
  }
5107
2203
  }
5108
2204
 
2205
+ // ../../node_modules/.pnpm/unicorn-magic@0.1.0/node_modules/unicorn-magic/node.js
2206
+ chunkI7UUR5MZ_cjs.init_cjs_shims();
2207
+ function toPath2(urlOrPath) {
2208
+ return urlOrPath instanceof URL ? url.fileURLToPath(urlOrPath) : urlOrPath;
2209
+ }
2210
+
5109
2211
  // ../../node_modules/.pnpm/path-exists@5.0.0/node_modules/path-exists/index.js
5110
- init_cjs_shims();
2212
+ chunkI7UUR5MZ_cjs.init_cjs_shims();
5111
2213
 
5112
- // ../../node_modules/.pnpm/find-up@6.3.0/node_modules/find-up/index.js
5113
- var toPath2 = (urlOrPath) => urlOrPath instanceof URL ? url.fileURLToPath(urlOrPath) : urlOrPath;
2214
+ // ../../node_modules/.pnpm/find-up@7.0.0/node_modules/find-up/index.js
5114
2215
  var findUpStop = Symbol("findUpStop");
5115
2216
  async function findUpMultiple(name, options = {}) {
5116
- let directory = path4__default.default.resolve(toPath2(options.cwd) || "");
2217
+ let directory = path4__default.default.resolve(toPath2(options.cwd) ?? "");
5117
2218
  const { root } = path4__default.default.parse(directory);
5118
- const stopAt = path4__default.default.resolve(directory, options.stopAt || root);
5119
- const limit = options.limit || Number.POSITIVE_INFINITY;
2219
+ const stopAt = path4__default.default.resolve(directory, toPath2(options.stopAt ?? root));
2220
+ const limit = options.limit ?? Number.POSITIVE_INFINITY;
5120
2221
  const paths = [name].flat();
5121
2222
  const runMatcher = async (locateOptions) => {
5122
2223
  if (typeof name !== "function") {
@@ -5145,10 +2246,10 @@ async function findUpMultiple(name, options = {}) {
5145
2246
  return matches;
5146
2247
  }
5147
2248
  function findUpMultipleSync(name, options = {}) {
5148
- let directory = path4__default.default.resolve(toPath2(options.cwd) || "");
2249
+ let directory = path4__default.default.resolve(toPath2(options.cwd) ?? "");
5149
2250
  const { root } = path4__default.default.parse(directory);
5150
- const stopAt = options.stopAt || root;
5151
- const limit = options.limit || Number.POSITIVE_INFINITY;
2251
+ const stopAt = path4__default.default.resolve(directory, toPath2(options.stopAt) ?? root);
2252
+ const limit = options.limit ?? Number.POSITIVE_INFINITY;
5152
2253
  const paths = [name].flat();
5153
2254
  const runMatcher = (locateOptions) => {
5154
2255
  if (typeof name !== "function") {
@@ -5187,30 +2288,30 @@ function findUpSync(name, options = {}) {
5187
2288
  var _cache2, _cwd, _SLASHES, _match, match_fn;
5188
2289
  var _PackageManager = class _PackageManager {
5189
2290
  constructor(workspace) {
5190
- __privateAdd(this, _match);
5191
- __privateAdd(this, _cwd, void 0);
5192
- __privateAdd(this, _SLASHES, /* @__PURE__ */ new Set(["/", "\\"]));
2291
+ chunkI7UUR5MZ_cjs.__privateAdd(this, _match);
2292
+ chunkI7UUR5MZ_cjs.__privateAdd(this, _cwd, void 0);
2293
+ chunkI7UUR5MZ_cjs.__privateAdd(this, _SLASHES, /* @__PURE__ */ new Set(["/", "\\"]));
5193
2294
  if (workspace) {
5194
- __privateSet(this, _cwd, workspace);
2295
+ chunkI7UUR5MZ_cjs.__privateSet(this, _cwd, workspace);
5195
2296
  }
5196
2297
  return this;
5197
2298
  }
5198
2299
  set workspace(workspace) {
5199
- __privateSet(this, _cwd, workspace);
2300
+ chunkI7UUR5MZ_cjs.__privateSet(this, _cwd, workspace);
5200
2301
  }
5201
2302
  get workspace() {
5202
- return __privateGet(this, _cwd);
2303
+ return chunkI7UUR5MZ_cjs.__privateGet(this, _cwd);
5203
2304
  }
5204
2305
  normalizeDirectory(directory) {
5205
- if (!__privateGet(this, _SLASHES).has(directory[directory.length - 1])) {
2306
+ if (!chunkI7UUR5MZ_cjs.__privateGet(this, _SLASHES).has(directory[directory.length - 1])) {
5206
2307
  return `${directory}/`;
5207
2308
  }
5208
2309
  return directory;
5209
2310
  }
5210
2311
  getLocation(path5) {
5211
2312
  let location = path5;
5212
- if (__privateGet(this, _cwd)) {
5213
- const require2 = mod__default.default.createRequire(this.normalizeDirectory(__privateGet(this, _cwd)));
2313
+ if (chunkI7UUR5MZ_cjs.__privateGet(this, _cwd)) {
2314
+ const require2 = mod__default.default.createRequire(this.normalizeDirectory(chunkI7UUR5MZ_cjs.__privateGet(this, _cwd)));
5214
2315
  location = require2.resolve(path5);
5215
2316
  }
5216
2317
  return location;
@@ -5230,44 +2331,44 @@ var _PackageManager = class _PackageManager {
5230
2331
  }
5231
2332
  async getPackageJSON() {
5232
2333
  const pkgPath = await findUp(["package.json"], {
5233
- cwd: __privateGet(this, _cwd)
2334
+ cwd: chunkI7UUR5MZ_cjs.__privateGet(this, _cwd)
5234
2335
  });
5235
2336
  if (!pkgPath) {
5236
2337
  return void 0;
5237
2338
  }
5238
- return __require(pkgPath);
2339
+ return chunkI7UUR5MZ_cjs.__require(pkgPath);
5239
2340
  }
5240
2341
  getPackageJSONSync() {
5241
2342
  const pkgPath = findUpSync(["package.json"], {
5242
- cwd: __privateGet(this, _cwd)
2343
+ cwd: chunkI7UUR5MZ_cjs.__privateGet(this, _cwd)
5243
2344
  });
5244
2345
  if (!pkgPath) {
5245
2346
  return void 0;
5246
2347
  }
5247
- return __require(pkgPath);
2348
+ return chunkI7UUR5MZ_cjs.__require(pkgPath);
5248
2349
  }
5249
2350
  static setVersion(dependency, version) {
5250
- __privateGet(_PackageManager, _cache2)[dependency] = version;
2351
+ chunkI7UUR5MZ_cjs.__privateGet(_PackageManager, _cache2)[dependency] = version;
5251
2352
  }
5252
2353
  async getVersion(dependency) {
5253
- if (typeof dependency === "string" && __privateGet(_PackageManager, _cache2)[dependency]) {
5254
- return __privateGet(_PackageManager, _cache2)[dependency];
2354
+ if (typeof dependency === "string" && chunkI7UUR5MZ_cjs.__privateGet(_PackageManager, _cache2)[dependency]) {
2355
+ return chunkI7UUR5MZ_cjs.__privateGet(_PackageManager, _cache2)[dependency];
5255
2356
  }
5256
2357
  const packageJSON = await this.getPackageJSON();
5257
2358
  if (!packageJSON) {
5258
2359
  return void 0;
5259
2360
  }
5260
- return __privateMethod(this, _match, match_fn).call(this, packageJSON, dependency);
2361
+ return chunkI7UUR5MZ_cjs.__privateMethod(this, _match, match_fn).call(this, packageJSON, dependency);
5261
2362
  }
5262
2363
  getVersionSync(dependency) {
5263
- if (typeof dependency === "string" && __privateGet(_PackageManager, _cache2)[dependency]) {
5264
- return __privateGet(_PackageManager, _cache2)[dependency];
2364
+ if (typeof dependency === "string" && chunkI7UUR5MZ_cjs.__privateGet(_PackageManager, _cache2)[dependency]) {
2365
+ return chunkI7UUR5MZ_cjs.__privateGet(_PackageManager, _cache2)[dependency];
5265
2366
  }
5266
2367
  const packageJSON = this.getPackageJSONSync();
5267
2368
  if (!packageJSON) {
5268
2369
  return void 0;
5269
2370
  }
5270
- return __privateMethod(this, _match, match_fn).call(this, packageJSON, dependency);
2371
+ return chunkI7UUR5MZ_cjs.__privateMethod(this, _match, match_fn).call(this, packageJSON, dependency);
5271
2372
  }
5272
2373
  async isValid(dependency, version) {
5273
2374
  const packageVersion = await this.getVersion(dependency);
@@ -5310,7 +2411,7 @@ match_fn = function(packageJSON, dependency) {
5310
2411
  const matchedDependency = Object.keys(dependencies).find((dep) => dep.match(dependency));
5311
2412
  return matchedDependency ? dependencies[matchedDependency] : void 0;
5312
2413
  };
5313
- __privateAdd(_PackageManager, _cache2, {});
2414
+ chunkI7UUR5MZ_cjs.__privateAdd(_PackageManager, _cache2, {});
5314
2415
  var PackageManager = _PackageManager;
5315
2416
 
5316
2417
  // src/index.ts