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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -2,24 +2,22 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var pc3 = require('picocolors');
6
- var fs2 = require('fs-extra');
7
- var seedrandom = require('seedrandom');
5
+ var pc2 = require('picocolors');
8
6
  var path4 = require('path');
9
7
  var jsRuntime = require('js-runtime');
10
8
  var changeCase = require('change-case');
11
9
  var crypto2 = require('crypto');
12
10
  var parser = require('@kubb/parser');
13
11
  var factory = require('@kubb/parser/factory');
14
- var isEqual = require('lodash.isequal');
15
12
  var naturalOrderby = require('natural-orderby');
16
13
  var dirTree = require('directory-tree');
14
+ var seedrandom = require('seedrandom');
17
15
  var events = require('events');
18
16
  var perf_hooks = require('perf_hooks');
19
17
  var mod = require('module');
20
18
  var os = require('os');
21
19
  var url = require('url');
22
- var process = require('process');
20
+ var process2 = require('process');
23
21
  var fs3 = require('fs');
24
22
  var semver = require('semver');
25
23
 
@@ -43,20 +41,23 @@ function _interopNamespace(e) {
43
41
  return Object.freeze(n);
44
42
  }
45
43
 
46
- var pc3__default = /*#__PURE__*/_interopDefault(pc3);
47
- var fs2__default = /*#__PURE__*/_interopDefault(fs2);
48
- var seedrandom__default = /*#__PURE__*/_interopDefault(seedrandom);
44
+ var pc2__default = /*#__PURE__*/_interopDefault(pc2);
49
45
  var path4__default = /*#__PURE__*/_interopDefault(path4);
50
46
  var crypto2__default = /*#__PURE__*/_interopDefault(crypto2);
51
47
  var factory__namespace = /*#__PURE__*/_interopNamespace(factory);
52
- var isEqual__default = /*#__PURE__*/_interopDefault(isEqual);
53
48
  var dirTree__default = /*#__PURE__*/_interopDefault(dirTree);
49
+ var seedrandom__default = /*#__PURE__*/_interopDefault(seedrandom);
54
50
  var mod__default = /*#__PURE__*/_interopDefault(mod);
55
51
  var os__default = /*#__PURE__*/_interopDefault(os);
56
- var process__default = /*#__PURE__*/_interopDefault(process);
52
+ var process2__default = /*#__PURE__*/_interopDefault(process2);
57
53
  var fs3__default = /*#__PURE__*/_interopDefault(fs3);
58
54
 
55
+ var __create = Object.create;
59
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;
60
61
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
61
62
  var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
62
63
  get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
@@ -65,6 +66,28 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
65
66
  return require.apply(this, arguments);
66
67
  throw Error('Dynamic require of "' + x + '" is not supported');
67
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
+ ));
68
91
  var __publicField = (obj, key, value) => {
69
92
  __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
70
93
  return value;
@@ -99,77 +122,2935 @@ var __privateMethod = (obj, member, method) => {
99
122
  __accessCheck(obj, member, "access private method");
100
123
  return method;
101
124
  };
102
- async function clean(path5) {
103
- return fs2.remove(path5);
104
- }
105
- var LogLevel = {
106
- silent: "silent",
107
- info: "info",
108
- debug: "debug"
109
- };
110
- function createLogger({ logLevel, name, spinner }) {
111
- const logs = [];
112
- const log = (message) => {
113
- if (message && spinner) {
114
- spinner.text = message;
115
- logs.push(message);
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
+ });
2335
+
2336
+ // ../../node_modules/.pnpm/lodash.isequal@4.5.0/node_modules/lodash.isequal/index.js
2337
+ var require_lodash = __commonJS({
2338
+ "../../node_modules/.pnpm/lodash.isequal@4.5.0/node_modules/lodash.isequal/index.js"(exports, module) {
2339
+ init_cjs_shims();
2340
+ var LARGE_ARRAY_SIZE = 200;
2341
+ var HASH_UNDEFINED = "__lodash_hash_undefined__";
2342
+ var COMPARE_PARTIAL_FLAG = 1;
2343
+ var COMPARE_UNORDERED_FLAG = 2;
2344
+ var MAX_SAFE_INTEGER = 9007199254740991;
2345
+ var argsTag = "[object Arguments]";
2346
+ var arrayTag = "[object Array]";
2347
+ var asyncTag = "[object AsyncFunction]";
2348
+ var boolTag = "[object Boolean]";
2349
+ var dateTag = "[object Date]";
2350
+ var errorTag = "[object Error]";
2351
+ var funcTag = "[object Function]";
2352
+ var genTag = "[object GeneratorFunction]";
2353
+ var mapTag = "[object Map]";
2354
+ var numberTag = "[object Number]";
2355
+ var nullTag = "[object Null]";
2356
+ var objectTag = "[object Object]";
2357
+ var promiseTag = "[object Promise]";
2358
+ var proxyTag = "[object Proxy]";
2359
+ var regexpTag = "[object RegExp]";
2360
+ var setTag = "[object Set]";
2361
+ var stringTag = "[object String]";
2362
+ var symbolTag = "[object Symbol]";
2363
+ var undefinedTag = "[object Undefined]";
2364
+ var weakMapTag = "[object WeakMap]";
2365
+ var arrayBufferTag = "[object ArrayBuffer]";
2366
+ var dataViewTag = "[object DataView]";
2367
+ var float32Tag = "[object Float32Array]";
2368
+ var float64Tag = "[object Float64Array]";
2369
+ var int8Tag = "[object Int8Array]";
2370
+ var int16Tag = "[object Int16Array]";
2371
+ var int32Tag = "[object Int32Array]";
2372
+ var uint8Tag = "[object Uint8Array]";
2373
+ var uint8ClampedTag = "[object Uint8ClampedArray]";
2374
+ var uint16Tag = "[object Uint16Array]";
2375
+ var uint32Tag = "[object Uint32Array]";
2376
+ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
2377
+ var reIsHostCtor = /^\[object .+?Constructor\]$/;
2378
+ var reIsUint = /^(?:0|[1-9]\d*)$/;
2379
+ var typedArrayTags = {};
2380
+ typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
2381
+ typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
2382
+ var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
2383
+ var freeSelf = typeof self == "object" && self && self.Object === Object && self;
2384
+ var root = freeGlobal || freeSelf || Function("return this")();
2385
+ var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports;
2386
+ var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module;
2387
+ var moduleExports = freeModule && freeModule.exports === freeExports;
2388
+ var freeProcess = moduleExports && freeGlobal.process;
2389
+ var nodeUtil = function() {
2390
+ try {
2391
+ return freeProcess && freeProcess.binding && freeProcess.binding("util");
2392
+ } catch (e) {
2393
+ }
2394
+ }();
2395
+ var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
2396
+ function arrayFilter(array, predicate) {
2397
+ var index = -1, length = array == null ? 0 : array.length, resIndex = 0, result = [];
2398
+ while (++index < length) {
2399
+ var value = array[index];
2400
+ if (predicate(value, index, array)) {
2401
+ result[resIndex++] = value;
2402
+ }
2403
+ }
2404
+ return result;
2405
+ }
2406
+ function arrayPush(array, values) {
2407
+ var index = -1, length = values.length, offset = array.length;
2408
+ while (++index < length) {
2409
+ array[offset + index] = values[index];
2410
+ }
2411
+ return array;
2412
+ }
2413
+ function arraySome(array, predicate) {
2414
+ var index = -1, length = array == null ? 0 : array.length;
2415
+ while (++index < length) {
2416
+ if (predicate(array[index], index, array)) {
2417
+ return true;
2418
+ }
2419
+ }
2420
+ return false;
2421
+ }
2422
+ function baseTimes(n, iteratee) {
2423
+ var index = -1, result = Array(n);
2424
+ while (++index < n) {
2425
+ result[index] = iteratee(index);
2426
+ }
2427
+ return result;
2428
+ }
2429
+ function baseUnary(func) {
2430
+ return function(value) {
2431
+ return func(value);
2432
+ };
2433
+ }
2434
+ function cacheHas(cache, key) {
2435
+ return cache.has(key);
2436
+ }
2437
+ function getValue(object, key) {
2438
+ return object == null ? void 0 : object[key];
2439
+ }
2440
+ function mapToArray(map) {
2441
+ var index = -1, result = Array(map.size);
2442
+ map.forEach(function(value, key) {
2443
+ result[++index] = [key, value];
2444
+ });
2445
+ return result;
2446
+ }
2447
+ function overArg(func, transform) {
2448
+ return function(arg) {
2449
+ return func(transform(arg));
2450
+ };
2451
+ }
2452
+ function setToArray(set) {
2453
+ var index = -1, result = Array(set.size);
2454
+ set.forEach(function(value) {
2455
+ result[++index] = value;
2456
+ });
2457
+ return result;
2458
+ }
2459
+ var arrayProto = Array.prototype;
2460
+ var funcProto = Function.prototype;
2461
+ var objectProto = Object.prototype;
2462
+ var coreJsData = root["__core-js_shared__"];
2463
+ var funcToString = funcProto.toString;
2464
+ var hasOwnProperty = objectProto.hasOwnProperty;
2465
+ var maskSrcKey = function() {
2466
+ var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
2467
+ return uid ? "Symbol(src)_1." + uid : "";
2468
+ }();
2469
+ var nativeObjectToString = objectProto.toString;
2470
+ var reIsNative = RegExp(
2471
+ "^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
2472
+ );
2473
+ var Buffer2 = moduleExports ? root.Buffer : void 0;
2474
+ var Symbol2 = root.Symbol;
2475
+ var Uint8Array2 = root.Uint8Array;
2476
+ var propertyIsEnumerable = objectProto.propertyIsEnumerable;
2477
+ var splice = arrayProto.splice;
2478
+ var symToStringTag = Symbol2 ? Symbol2.toStringTag : void 0;
2479
+ var nativeGetSymbols = Object.getOwnPropertySymbols;
2480
+ var nativeIsBuffer = Buffer2 ? Buffer2.isBuffer : void 0;
2481
+ var nativeKeys = overArg(Object.keys, Object);
2482
+ var DataView = getNative(root, "DataView");
2483
+ var Map2 = getNative(root, "Map");
2484
+ var Promise2 = getNative(root, "Promise");
2485
+ var Set2 = getNative(root, "Set");
2486
+ var WeakMap2 = getNative(root, "WeakMap");
2487
+ var nativeCreate = getNative(Object, "create");
2488
+ var dataViewCtorString = toSource(DataView);
2489
+ var mapCtorString = toSource(Map2);
2490
+ var promiseCtorString = toSource(Promise2);
2491
+ var setCtorString = toSource(Set2);
2492
+ var weakMapCtorString = toSource(WeakMap2);
2493
+ var symbolProto = Symbol2 ? Symbol2.prototype : void 0;
2494
+ var symbolValueOf = symbolProto ? symbolProto.valueOf : void 0;
2495
+ function Hash(entries) {
2496
+ var index = -1, length = entries == null ? 0 : entries.length;
2497
+ this.clear();
2498
+ while (++index < length) {
2499
+ var entry = entries[index];
2500
+ this.set(entry[0], entry[1]);
2501
+ }
2502
+ }
2503
+ function hashClear() {
2504
+ this.__data__ = nativeCreate ? nativeCreate(null) : {};
2505
+ this.size = 0;
2506
+ }
2507
+ function hashDelete(key) {
2508
+ var result = this.has(key) && delete this.__data__[key];
2509
+ this.size -= result ? 1 : 0;
2510
+ return result;
2511
+ }
2512
+ function hashGet(key) {
2513
+ var data = this.__data__;
2514
+ if (nativeCreate) {
2515
+ var result = data[key];
2516
+ return result === HASH_UNDEFINED ? void 0 : result;
2517
+ }
2518
+ return hasOwnProperty.call(data, key) ? data[key] : void 0;
2519
+ }
2520
+ function hashHas(key) {
2521
+ var data = this.__data__;
2522
+ return nativeCreate ? data[key] !== void 0 : hasOwnProperty.call(data, key);
2523
+ }
2524
+ function hashSet(key, value) {
2525
+ var data = this.__data__;
2526
+ this.size += this.has(key) ? 0 : 1;
2527
+ data[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED : value;
2528
+ return this;
2529
+ }
2530
+ Hash.prototype.clear = hashClear;
2531
+ Hash.prototype["delete"] = hashDelete;
2532
+ Hash.prototype.get = hashGet;
2533
+ Hash.prototype.has = hashHas;
2534
+ Hash.prototype.set = hashSet;
2535
+ function ListCache(entries) {
2536
+ var index = -1, length = entries == null ? 0 : entries.length;
2537
+ this.clear();
2538
+ while (++index < length) {
2539
+ var entry = entries[index];
2540
+ this.set(entry[0], entry[1]);
2541
+ }
2542
+ }
2543
+ function listCacheClear() {
2544
+ this.__data__ = [];
2545
+ this.size = 0;
2546
+ }
2547
+ function listCacheDelete(key) {
2548
+ var data = this.__data__, index = assocIndexOf(data, key);
2549
+ if (index < 0) {
2550
+ return false;
2551
+ }
2552
+ var lastIndex = data.length - 1;
2553
+ if (index == lastIndex) {
2554
+ data.pop();
2555
+ } else {
2556
+ splice.call(data, index, 1);
2557
+ }
2558
+ --this.size;
2559
+ return true;
2560
+ }
2561
+ function listCacheGet(key) {
2562
+ var data = this.__data__, index = assocIndexOf(data, key);
2563
+ return index < 0 ? void 0 : data[index][1];
2564
+ }
2565
+ function listCacheHas(key) {
2566
+ return assocIndexOf(this.__data__, key) > -1;
2567
+ }
2568
+ function listCacheSet(key, value) {
2569
+ var data = this.__data__, index = assocIndexOf(data, key);
2570
+ if (index < 0) {
2571
+ ++this.size;
2572
+ data.push([key, value]);
2573
+ } else {
2574
+ data[index][1] = value;
2575
+ }
2576
+ return this;
2577
+ }
2578
+ ListCache.prototype.clear = listCacheClear;
2579
+ ListCache.prototype["delete"] = listCacheDelete;
2580
+ ListCache.prototype.get = listCacheGet;
2581
+ ListCache.prototype.has = listCacheHas;
2582
+ ListCache.prototype.set = listCacheSet;
2583
+ function MapCache(entries) {
2584
+ var index = -1, length = entries == null ? 0 : entries.length;
2585
+ this.clear();
2586
+ while (++index < length) {
2587
+ var entry = entries[index];
2588
+ this.set(entry[0], entry[1]);
2589
+ }
2590
+ }
2591
+ function mapCacheClear() {
2592
+ this.size = 0;
2593
+ this.__data__ = {
2594
+ "hash": new Hash(),
2595
+ "map": new (Map2 || ListCache)(),
2596
+ "string": new Hash()
2597
+ };
2598
+ }
2599
+ function mapCacheDelete(key) {
2600
+ var result = getMapData(this, key)["delete"](key);
2601
+ this.size -= result ? 1 : 0;
2602
+ return result;
2603
+ }
2604
+ function mapCacheGet(key) {
2605
+ return getMapData(this, key).get(key);
2606
+ }
2607
+ function mapCacheHas(key) {
2608
+ return getMapData(this, key).has(key);
2609
+ }
2610
+ function mapCacheSet(key, value) {
2611
+ var data = getMapData(this, key), size = data.size;
2612
+ data.set(key, value);
2613
+ this.size += data.size == size ? 0 : 1;
2614
+ return this;
2615
+ }
2616
+ MapCache.prototype.clear = mapCacheClear;
2617
+ MapCache.prototype["delete"] = mapCacheDelete;
2618
+ MapCache.prototype.get = mapCacheGet;
2619
+ MapCache.prototype.has = mapCacheHas;
2620
+ MapCache.prototype.set = mapCacheSet;
2621
+ function SetCache(values) {
2622
+ var index = -1, length = values == null ? 0 : values.length;
2623
+ this.__data__ = new MapCache();
2624
+ while (++index < length) {
2625
+ this.add(values[index]);
2626
+ }
2627
+ }
2628
+ function setCacheAdd(value) {
2629
+ this.__data__.set(value, HASH_UNDEFINED);
2630
+ return this;
2631
+ }
2632
+ function setCacheHas(value) {
2633
+ return this.__data__.has(value);
2634
+ }
2635
+ SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
2636
+ SetCache.prototype.has = setCacheHas;
2637
+ function Stack(entries) {
2638
+ var data = this.__data__ = new ListCache(entries);
2639
+ this.size = data.size;
2640
+ }
2641
+ function stackClear() {
2642
+ this.__data__ = new ListCache();
2643
+ this.size = 0;
2644
+ }
2645
+ function stackDelete(key) {
2646
+ var data = this.__data__, result = data["delete"](key);
2647
+ this.size = data.size;
2648
+ return result;
2649
+ }
2650
+ function stackGet(key) {
2651
+ return this.__data__.get(key);
2652
+ }
2653
+ function stackHas(key) {
2654
+ return this.__data__.has(key);
2655
+ }
2656
+ function stackSet(key, value) {
2657
+ var data = this.__data__;
2658
+ if (data instanceof ListCache) {
2659
+ var pairs = data.__data__;
2660
+ if (!Map2 || pairs.length < LARGE_ARRAY_SIZE - 1) {
2661
+ pairs.push([key, value]);
2662
+ this.size = ++data.size;
2663
+ return this;
2664
+ }
2665
+ data = this.__data__ = new MapCache(pairs);
2666
+ }
2667
+ data.set(key, value);
2668
+ this.size = data.size;
2669
+ return this;
2670
+ }
2671
+ Stack.prototype.clear = stackClear;
2672
+ Stack.prototype["delete"] = stackDelete;
2673
+ Stack.prototype.get = stackGet;
2674
+ Stack.prototype.has = stackHas;
2675
+ Stack.prototype.set = stackSet;
2676
+ function arrayLikeKeys(value, inherited) {
2677
+ var isArr = isArray(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length;
2678
+ for (var key in value) {
2679
+ if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
2680
+ (key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
2681
+ isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
2682
+ isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties.
2683
+ isIndex(key, length)))) {
2684
+ result.push(key);
2685
+ }
2686
+ }
2687
+ return result;
2688
+ }
2689
+ function assocIndexOf(array, key) {
2690
+ var length = array.length;
2691
+ while (length--) {
2692
+ if (eq(array[length][0], key)) {
2693
+ return length;
2694
+ }
2695
+ }
2696
+ return -1;
2697
+ }
2698
+ function baseGetAllKeys(object, keysFunc, symbolsFunc) {
2699
+ var result = keysFunc(object);
2700
+ return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
2701
+ }
2702
+ function baseGetTag(value) {
2703
+ if (value == null) {
2704
+ return value === void 0 ? undefinedTag : nullTag;
2705
+ }
2706
+ return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
2707
+ }
2708
+ function baseIsArguments(value) {
2709
+ return isObjectLike(value) && baseGetTag(value) == argsTag;
2710
+ }
2711
+ function baseIsEqual(value, other, bitmask, customizer, stack) {
2712
+ if (value === other) {
2713
+ return true;
2714
+ }
2715
+ if (value == null || other == null || !isObjectLike(value) && !isObjectLike(other)) {
2716
+ return value !== value && other !== other;
2717
+ }
2718
+ return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
2719
+ }
2720
+ function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
2721
+ var objIsArr = isArray(object), othIsArr = isArray(other), objTag = objIsArr ? arrayTag : getTag(object), othTag = othIsArr ? arrayTag : getTag(other);
2722
+ objTag = objTag == argsTag ? objectTag : objTag;
2723
+ othTag = othTag == argsTag ? objectTag : othTag;
2724
+ var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag;
2725
+ if (isSameTag && isBuffer(object)) {
2726
+ if (!isBuffer(other)) {
2727
+ return false;
2728
+ }
2729
+ objIsArr = true;
2730
+ objIsObj = false;
2731
+ }
2732
+ if (isSameTag && !objIsObj) {
2733
+ stack || (stack = new Stack());
2734
+ return objIsArr || isTypedArray(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
2735
+ }
2736
+ if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
2737
+ var objIsWrapped = objIsObj && hasOwnProperty.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty.call(other, "__wrapped__");
2738
+ if (objIsWrapped || othIsWrapped) {
2739
+ var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other;
2740
+ stack || (stack = new Stack());
2741
+ return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
2742
+ }
2743
+ }
2744
+ if (!isSameTag) {
2745
+ return false;
2746
+ }
2747
+ stack || (stack = new Stack());
2748
+ return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
2749
+ }
2750
+ function baseIsNative(value) {
2751
+ if (!isObject(value) || isMasked(value)) {
2752
+ return false;
2753
+ }
2754
+ var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
2755
+ return pattern.test(toSource(value));
2756
+ }
2757
+ function baseIsTypedArray(value) {
2758
+ return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
2759
+ }
2760
+ function baseKeys(object) {
2761
+ if (!isPrototype(object)) {
2762
+ return nativeKeys(object);
2763
+ }
2764
+ var result = [];
2765
+ for (var key in Object(object)) {
2766
+ if (hasOwnProperty.call(object, key) && key != "constructor") {
2767
+ result.push(key);
2768
+ }
2769
+ }
2770
+ return result;
116
2771
  }
117
- };
118
- const error = (message) => {
119
- if (message) {
120
- throw new Error(message || "Something went wrong");
2772
+ function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
2773
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG, arrLength = array.length, othLength = other.length;
2774
+ if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
2775
+ return false;
2776
+ }
2777
+ var stacked = stack.get(array);
2778
+ if (stacked && stack.get(other)) {
2779
+ return stacked == other;
2780
+ }
2781
+ var index = -1, result = true, seen = bitmask & COMPARE_UNORDERED_FLAG ? new SetCache() : void 0;
2782
+ stack.set(array, other);
2783
+ stack.set(other, array);
2784
+ while (++index < arrLength) {
2785
+ var arrValue = array[index], othValue = other[index];
2786
+ if (customizer) {
2787
+ var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack);
2788
+ }
2789
+ if (compared !== void 0) {
2790
+ if (compared) {
2791
+ continue;
2792
+ }
2793
+ result = false;
2794
+ break;
2795
+ }
2796
+ if (seen) {
2797
+ if (!arraySome(other, function(othValue2, othIndex) {
2798
+ if (!cacheHas(seen, othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, bitmask, customizer, stack))) {
2799
+ return seen.push(othIndex);
2800
+ }
2801
+ })) {
2802
+ result = false;
2803
+ break;
2804
+ }
2805
+ } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
2806
+ result = false;
2807
+ break;
2808
+ }
2809
+ }
2810
+ stack["delete"](array);
2811
+ stack["delete"](other);
2812
+ return result;
121
2813
  }
122
- };
123
- const warn = (message) => {
124
- if (message && spinner) {
125
- spinner.warn(pc3__default.default.yellow(message));
126
- logs.push(message);
2814
+ function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
2815
+ switch (tag) {
2816
+ case dataViewTag:
2817
+ if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) {
2818
+ return false;
2819
+ }
2820
+ object = object.buffer;
2821
+ other = other.buffer;
2822
+ case arrayBufferTag:
2823
+ if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array2(object), new Uint8Array2(other))) {
2824
+ return false;
2825
+ }
2826
+ return true;
2827
+ case boolTag:
2828
+ case dateTag:
2829
+ case numberTag:
2830
+ return eq(+object, +other);
2831
+ case errorTag:
2832
+ return object.name == other.name && object.message == other.message;
2833
+ case regexpTag:
2834
+ case stringTag:
2835
+ return object == other + "";
2836
+ case mapTag:
2837
+ var convert = mapToArray;
2838
+ case setTag:
2839
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
2840
+ convert || (convert = setToArray);
2841
+ if (object.size != other.size && !isPartial) {
2842
+ return false;
2843
+ }
2844
+ var stacked = stack.get(object);
2845
+ if (stacked) {
2846
+ return stacked == other;
2847
+ }
2848
+ bitmask |= COMPARE_UNORDERED_FLAG;
2849
+ stack.set(object, other);
2850
+ var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
2851
+ stack["delete"](object);
2852
+ return result;
2853
+ case symbolTag:
2854
+ if (symbolValueOf) {
2855
+ return symbolValueOf.call(object) == symbolValueOf.call(other);
2856
+ }
2857
+ }
2858
+ return false;
127
2859
  }
128
- };
129
- const info = (message) => {
130
- if (message && spinner && logLevel !== LogLevel.silent) {
131
- spinner.info(message);
132
- logs.push(message);
2860
+ function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
2861
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG, objProps = getAllKeys(object), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length;
2862
+ if (objLength != othLength && !isPartial) {
2863
+ return false;
2864
+ }
2865
+ var index = objLength;
2866
+ while (index--) {
2867
+ var key = objProps[index];
2868
+ if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
2869
+ return false;
2870
+ }
2871
+ }
2872
+ var stacked = stack.get(object);
2873
+ if (stacked && stack.get(other)) {
2874
+ return stacked == other;
2875
+ }
2876
+ var result = true;
2877
+ stack.set(object, other);
2878
+ stack.set(other, object);
2879
+ var skipCtor = isPartial;
2880
+ while (++index < objLength) {
2881
+ key = objProps[index];
2882
+ var objValue = object[key], othValue = other[key];
2883
+ if (customizer) {
2884
+ var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack);
2885
+ }
2886
+ if (!(compared === void 0 ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) {
2887
+ result = false;
2888
+ break;
2889
+ }
2890
+ skipCtor || (skipCtor = key == "constructor");
2891
+ }
2892
+ if (result && !skipCtor) {
2893
+ var objCtor = object.constructor, othCtor = other.constructor;
2894
+ if (objCtor != othCtor && ("constructor" in object && "constructor" in other) && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) {
2895
+ result = false;
2896
+ }
2897
+ }
2898
+ stack["delete"](object);
2899
+ stack["delete"](other);
2900
+ return result;
133
2901
  }
134
- };
135
- const logger = {
136
- name,
137
- logLevel,
138
- log,
139
- error,
140
- warn,
141
- info,
142
- spinner,
143
- logs
144
- };
145
- return logger;
146
- }
147
- var defaultColours = ["black", "blue", "darkBlue", "cyan", "gray", "green", "darkGreen", "magenta", "red", "darkRed", "yellow", "darkYellow"];
148
- function randomColour(text, colours = defaultColours) {
149
- if (!text) {
150
- return "white";
151
- }
152
- const random = seedrandom__default.default(text);
153
- const colour = colours.at(Math.floor(random() * colours.length)) || "white";
154
- return colour;
155
- }
156
- function randomPicoColour(text, colors = defaultColours) {
157
- const colours = pc3__default.default.createColors(true);
158
- if (!text) {
159
- return colours.white(text);
160
- }
161
- const colour = randomColour(text, colors);
162
- const isDark = colour.includes("dark");
163
- const key = colour.replace("dark", "").toLowerCase();
164
- const formatter = colours[key];
165
- if (isDark) {
166
- return pc3__default.default.bold(formatter(text));
167
- }
168
- if (typeof formatter !== "function") {
169
- throw new Error("Formatter for picoColor is not of type function/Formatter");
2902
+ function getAllKeys(object) {
2903
+ return baseGetAllKeys(object, keys, getSymbols);
2904
+ }
2905
+ function getMapData(map, key) {
2906
+ var data = map.__data__;
2907
+ return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
2908
+ }
2909
+ function getNative(object, key) {
2910
+ var value = getValue(object, key);
2911
+ return baseIsNative(value) ? value : void 0;
2912
+ }
2913
+ function getRawTag(value) {
2914
+ var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag];
2915
+ try {
2916
+ value[symToStringTag] = void 0;
2917
+ var unmasked = true;
2918
+ } catch (e) {
2919
+ }
2920
+ var result = nativeObjectToString.call(value);
2921
+ if (unmasked) {
2922
+ if (isOwn) {
2923
+ value[symToStringTag] = tag;
2924
+ } else {
2925
+ delete value[symToStringTag];
2926
+ }
2927
+ }
2928
+ return result;
2929
+ }
2930
+ var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
2931
+ if (object == null) {
2932
+ return [];
2933
+ }
2934
+ object = Object(object);
2935
+ return arrayFilter(nativeGetSymbols(object), function(symbol) {
2936
+ return propertyIsEnumerable.call(object, symbol);
2937
+ });
2938
+ };
2939
+ var getTag = baseGetTag;
2940
+ if (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag || Map2 && getTag(new Map2()) != mapTag || Promise2 && getTag(Promise2.resolve()) != promiseTag || Set2 && getTag(new Set2()) != setTag || WeakMap2 && getTag(new WeakMap2()) != weakMapTag) {
2941
+ getTag = function(value) {
2942
+ var result = baseGetTag(value), Ctor = result == objectTag ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : "";
2943
+ if (ctorString) {
2944
+ switch (ctorString) {
2945
+ case dataViewCtorString:
2946
+ return dataViewTag;
2947
+ case mapCtorString:
2948
+ return mapTag;
2949
+ case promiseCtorString:
2950
+ return promiseTag;
2951
+ case setCtorString:
2952
+ return setTag;
2953
+ case weakMapCtorString:
2954
+ return weakMapTag;
2955
+ }
2956
+ }
2957
+ return result;
2958
+ };
2959
+ }
2960
+ function isIndex(value, length) {
2961
+ length = length == null ? MAX_SAFE_INTEGER : length;
2962
+ return !!length && (typeof value == "number" || reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
2963
+ }
2964
+ function isKeyable(value) {
2965
+ var type = typeof value;
2966
+ return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
2967
+ }
2968
+ function isMasked(func) {
2969
+ return !!maskSrcKey && maskSrcKey in func;
2970
+ }
2971
+ function isPrototype(value) {
2972
+ var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto;
2973
+ return value === proto;
2974
+ }
2975
+ function objectToString(value) {
2976
+ return nativeObjectToString.call(value);
2977
+ }
2978
+ function toSource(func) {
2979
+ if (func != null) {
2980
+ try {
2981
+ return funcToString.call(func);
2982
+ } catch (e) {
2983
+ }
2984
+ try {
2985
+ return func + "";
2986
+ } catch (e) {
2987
+ }
2988
+ }
2989
+ return "";
2990
+ }
2991
+ function eq(value, other) {
2992
+ return value === other || value !== value && other !== other;
2993
+ }
2994
+ var isArguments = baseIsArguments(/* @__PURE__ */ function() {
2995
+ return arguments;
2996
+ }()) ? baseIsArguments : function(value) {
2997
+ return isObjectLike(value) && hasOwnProperty.call(value, "callee") && !propertyIsEnumerable.call(value, "callee");
2998
+ };
2999
+ var isArray = Array.isArray;
3000
+ function isArrayLike(value) {
3001
+ return value != null && isLength(value.length) && !isFunction(value);
3002
+ }
3003
+ var isBuffer = nativeIsBuffer || stubFalse;
3004
+ function isEqual2(value, other) {
3005
+ return baseIsEqual(value, other);
3006
+ }
3007
+ function isFunction(value) {
3008
+ if (!isObject(value)) {
3009
+ return false;
3010
+ }
3011
+ var tag = baseGetTag(value);
3012
+ return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
3013
+ }
3014
+ function isLength(value) {
3015
+ return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
3016
+ }
3017
+ function isObject(value) {
3018
+ var type = typeof value;
3019
+ return value != null && (type == "object" || type == "function");
3020
+ }
3021
+ function isObjectLike(value) {
3022
+ return value != null && typeof value == "object";
3023
+ }
3024
+ var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
3025
+ function keys(object) {
3026
+ return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
3027
+ }
3028
+ function stubArray() {
3029
+ return [];
3030
+ }
3031
+ function stubFalse() {
3032
+ return false;
3033
+ }
3034
+ module.exports = isEqual2;
170
3035
  }
171
- return formatter(text);
3036
+ });
3037
+
3038
+ // src/index.ts
3039
+ init_cjs_shims();
3040
+
3041
+ // 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);
172
3049
  }
3050
+
3051
+ // src/fs/read.ts
3052
+ init_cjs_shims();
3053
+ var import_fs_extra2 = __toESM(require_lib(), 1);
173
3054
  function slash(path5, platform = "linux") {
174
3055
  const isWindowsPath = /^\\\\\?\\/.test(path5);
175
3056
  if (["linux", "mac"].includes(platform) && !isWindowsPath) {
@@ -191,7 +3072,7 @@ function getRelativePath(rootDir, filePath, platform = "linux") {
191
3072
  var reader = jsRuntime.switcher(
192
3073
  {
193
3074
  node: async (path5) => {
194
- return fs2__default.default.readFile(path5, { encoding: "utf8" });
3075
+ return import_fs_extra2.default.readFile(path5, { encoding: "utf8" });
195
3076
  },
196
3077
  bun: async (path5) => {
197
3078
  const file = Bun.file(path5);
@@ -203,7 +3084,7 @@ var reader = jsRuntime.switcher(
203
3084
  jsRuntime.switcher(
204
3085
  {
205
3086
  node: (path5) => {
206
- return fs2__default.default.readFileSync(path5, { encoding: "utf8" });
3087
+ return import_fs_extra2.default.readFileSync(path5, { encoding: "utf8" });
207
3088
  },
208
3089
  bun: () => {
209
3090
  throw new Error("Bun cannot read sync");
@@ -214,6 +3095,15 @@ jsRuntime.switcher(
214
3095
  async function read(path5) {
215
3096
  return reader(path5);
216
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();
217
3107
  function camelCase(text) {
218
3108
  return changeCase.camelCase(text, { delimiter: "", stripRegexp: /[^A-Z0-9$]/gi, transform: changeCase.camelCaseTransformMerge });
219
3109
  }
@@ -222,11 +3112,13 @@ function pascalCase(text) {
222
3112
  }
223
3113
 
224
3114
  // src/transformers/combineCodes.ts
3115
+ init_cjs_shims();
225
3116
  function combineCodes(codes) {
226
3117
  return codes.join("\n");
227
3118
  }
228
3119
 
229
3120
  // src/transformers/createJSDocBlockText.ts
3121
+ init_cjs_shims();
230
3122
  function createJSDocBlockText({ comments }) {
231
3123
  const filteredComments = comments.filter(Boolean);
232
3124
  if (!filteredComments.length) {
@@ -238,6 +3130,7 @@ function createJSDocBlockText({ comments }) {
238
3130
  }
239
3131
 
240
3132
  // src/transformers/escape.ts
3133
+ init_cjs_shims();
241
3134
  function escape(text) {
242
3135
  return text ? text.replaceAll("`", "\\`") : "";
243
3136
  }
@@ -263,11 +3156,13 @@ function jsStringEscape(input) {
263
3156
  }
264
3157
 
265
3158
  // src/transformers/indent.ts
3159
+ init_cjs_shims();
266
3160
  function createIndent(size) {
267
3161
  return Array.from({ length: size + 1 }).join(" ");
268
3162
  }
269
3163
 
270
3164
  // src/transformers/nameSorter.ts
3165
+ init_cjs_shims();
271
3166
  function nameSorter(a, b) {
272
3167
  if (a.name < b.name) {
273
3168
  return -1;
@@ -279,6 +3174,7 @@ function nameSorter(a, b) {
279
3174
  }
280
3175
 
281
3176
  // src/transformers/searchAndReplace.ts
3177
+ init_cjs_shims();
282
3178
  function searchAndReplace(options) {
283
3179
  const { text, replaceBy, prefix = "", key } = options;
284
3180
  const searchValues = options.searchValues?.(prefix, key) || [
@@ -296,6 +3192,7 @@ function searchAndReplace(options) {
296
3192
  }
297
3193
 
298
3194
  // src/transformers/transformReservedWord.ts
3195
+ init_cjs_shims();
299
3196
  var reservedWords = [
300
3197
  "abstract",
301
3198
  "arguments",
@@ -389,6 +3286,7 @@ function transformReservedWord(word) {
389
3286
  }
390
3287
 
391
3288
  // src/transformers/trim.ts
3289
+ init_cjs_shims();
392
3290
  function trim(text) {
393
3291
  return text.replaceAll(/\n/g, "").trim();
394
3292
  }
@@ -512,6 +3410,7 @@ var URLPath = class {
512
3410
  };
513
3411
 
514
3412
  // src/config.ts
3413
+ init_cjs_shims();
515
3414
  function defineConfig(options) {
516
3415
  return options;
517
3416
  }
@@ -519,32 +3418,31 @@ function isInputPath(result) {
519
3418
  return !!result && "path" in result;
520
3419
  }
521
3420
 
522
- // src/utils/timeout.ts
523
- async function timeout(ms) {
524
- return new Promise((resolve3) => {
525
- setTimeout(() => {
526
- resolve3(true);
527
- }, ms);
528
- });
529
- }
3421
+ // 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);
530
3428
  async function saveCreateDirectory(path5) {
531
3429
  const passedPath = path4.dirname(path4.resolve(path5));
532
- await fs2__default.default.mkdir(passedPath, { recursive: true });
3430
+ await import_fs_extra3.default.mkdir(passedPath, { recursive: true });
533
3431
  }
534
3432
  var writer = jsRuntime.switcher(
535
3433
  {
536
3434
  node: async (path5, data) => {
537
3435
  try {
538
- await fs2__default.default.stat(path4.resolve(path5));
539
- const oldContent = await fs2__default.default.readFile(path4.resolve(path5), { encoding: "utf-8" });
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" });
540
3438
  if (oldContent?.toString() === data?.toString()) {
541
3439
  return;
542
3440
  }
543
3441
  } catch (_err) {
544
3442
  }
545
3443
  await saveCreateDirectory(path5);
546
- await fs2__default.default.writeFile(path4.resolve(path5), data, { encoding: "utf-8" });
547
- const savedData = await fs2__default.default.readFile(path4.resolve(path5), { encoding: "utf-8" });
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" });
548
3446
  if (savedData?.toString() !== data?.toString()) {
549
3447
  throw new Error(`Sanity check failed for ${path5}
550
3448
 
@@ -587,6 +3485,22 @@ async function write(data, path5) {
587
3485
  }
588
3486
  return writer(path5, data.trim());
589
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
+ }
3498
+
3499
+ // src/BarrelManager.ts
3500
+ init_cjs_shims();
3501
+
3502
+ // src/utils/TreeNode.ts
3503
+ init_cjs_shims();
590
3504
  var TreeNode = class _TreeNode {
591
3505
  constructor(data, parent) {
592
3506
  this.children = [];
@@ -862,57 +3776,7 @@ var _FileManager = class _FileManager {
862
3776
  }
863
3777
  // statics
864
3778
  static getSource(file) {
865
- if (!_FileManager.isExtensionAllowed(file.baseName)) {
866
- return file.source;
867
- }
868
- const exports = file.exports ? combineExports(file.exports) : [];
869
- const imports = file.imports ? combineImports(file.imports, exports, file.source) : [];
870
- const importNodes = imports.filter((item) => {
871
- return item.path !== transformers_default.trimExtName(file.path);
872
- }).map((item) => {
873
- return factory__namespace.createImportDeclaration({
874
- name: item.name,
875
- path: item.root ? getRelativePath(item.root, item.path) : item.path,
876
- isTypeOnly: item.isTypeOnly
877
- });
878
- });
879
- const exportNodes = exports.map(
880
- (item) => factory__namespace.createExportDeclaration({
881
- name: item.name,
882
- path: item.path,
883
- isTypeOnly: item.isTypeOnly,
884
- asAlias: item.asAlias
885
- })
886
- );
887
- return [parser.print([...importNodes, ...exportNodes]), getEnvSource(file.source, file.env)].join("\n");
888
- }
889
- static combineFiles(files) {
890
- return files.filter(Boolean).reduce((acc, file) => {
891
- const prevIndex = acc.findIndex((item) => item.path === file.path);
892
- if (prevIndex === -1) {
893
- return [...acc, file];
894
- }
895
- const prev = acc[prevIndex];
896
- if (prev && file.override) {
897
- acc[prevIndex] = {
898
- imports: [],
899
- exports: [],
900
- ...file
901
- };
902
- return acc;
903
- }
904
- if (prev) {
905
- acc[prevIndex] = {
906
- ...file,
907
- source: prev.source && file.source ? `${prev.source}
908
- ${file.source}` : "",
909
- imports: [...prev.imports || [], ...file.imports || []],
910
- exports: [...prev.exports || [], ...file.exports || []],
911
- env: { ...prev.env || {}, ...file.env || {} }
912
- };
913
- }
914
- return acc;
915
- }, []);
3779
+ return getSource(file);
916
3780
  }
917
3781
  static getMode(path5) {
918
3782
  if (!path5) {
@@ -967,16 +3831,41 @@ ${file.source}` : "",
967
3831
  return __privateMethod(this, _add, add_fn).call(this, file);
968
3832
  };
969
3833
  var FileManager = _FileManager;
3834
+ function getSource(file) {
3835
+ if (!FileManager.isExtensionAllowed(file.baseName)) {
3836
+ return file.source;
3837
+ }
3838
+ const exports = file.exports ? combineExports(file.exports) : [];
3839
+ const imports = file.imports ? combineImports(file.imports, exports, file.source) : [];
3840
+ const importNodes = imports.filter((item) => {
3841
+ return item.path !== transformers_default.trimExtName(file.path);
3842
+ }).map((item) => {
3843
+ return factory__namespace.createImportDeclaration({
3844
+ name: item.name,
3845
+ path: item.root ? getRelativePath(item.root, item.path) : item.path,
3846
+ isTypeOnly: item.isTypeOnly
3847
+ });
3848
+ });
3849
+ const exportNodes = exports.map(
3850
+ (item) => factory__namespace.createExportDeclaration({
3851
+ name: item.name,
3852
+ path: item.path,
3853
+ isTypeOnly: item.isTypeOnly,
3854
+ asAlias: item.asAlias
3855
+ })
3856
+ );
3857
+ return [parser.print([...importNodes, ...exportNodes]), getEnvSource(file.source, file.env)].join("\n");
3858
+ }
970
3859
  function combineExports(exports) {
971
3860
  const combinedExports = naturalOrderby.orderBy(exports, [(v) => !v.isTypeOnly], ["asc"]).reduce((prev, curr) => {
972
3861
  const name = curr.name;
973
3862
  const prevByPath = prev.findLast((imp) => imp.path === curr.path);
974
- const prevByPathAndIsTypeOnly = prev.findLast((imp) => imp.path === curr.path && isEqual__default.default(imp.name, name) && imp.isTypeOnly);
3863
+ const prevByPathAndIsTypeOnly = prev.findLast((imp) => imp.path === curr.path && (0, import_lodash.default)(imp.name, name) && imp.isTypeOnly);
975
3864
  if (prevByPathAndIsTypeOnly) {
976
3865
  return prev;
977
3866
  }
978
3867
  const uniquePrev = prev.findLast(
979
- (imp) => imp.path === curr.path && isEqual__default.default(imp.name, name) && imp.isTypeOnly === curr.isTypeOnly && imp.asAlias === curr.asAlias
3868
+ (imp) => imp.path === curr.path && (0, import_lodash.default)(imp.name, name) && imp.isTypeOnly === curr.isTypeOnly && imp.asAlias === curr.asAlias
980
3869
  );
981
3870
  if (uniquePrev || Array.isArray(name) && !name.length || prevByPath?.asAlias && !curr.asAlias) {
982
3871
  return prev;
@@ -1012,8 +3901,8 @@ function combineImports(imports, exports, source) {
1012
3901
  name = name.filter((item) => typeof item === "string" ? hasImportInSource(item) : hasImportInSource(item.propertyName));
1013
3902
  }
1014
3903
  const prevByPath = prev.findLast((imp) => imp.path === curr.path && imp.isTypeOnly === curr.isTypeOnly);
1015
- const uniquePrev = prev.findLast((imp) => imp.path === curr.path && isEqual__default.default(imp.name, name) && imp.isTypeOnly === curr.isTypeOnly);
1016
- const prevByPathNameAndIsTypeOnly = prev.findLast((imp) => imp.path === curr.path && isEqual__default.default(imp.name, name) && imp.isTypeOnly);
3904
+ const uniquePrev = prev.findLast((imp) => imp.path === curr.path && (0, import_lodash.default)(imp.name, name) && imp.isTypeOnly === curr.isTypeOnly);
3905
+ const prevByPathNameAndIsTypeOnly = prev.findLast((imp) => imp.path === curr.path && (0, import_lodash.default)(imp.name, name) && imp.isTypeOnly);
1017
3906
  if (prevByPathNameAndIsTypeOnly) {
1018
3907
  return prev;
1019
3908
  }
@@ -1062,6 +3951,83 @@ function getEnvSource(source, env) {
1062
3951
  return prev;
1063
3952
  }, source);
1064
3953
  }
3954
+
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
+ // src/PluginManager.ts
4027
+ init_cjs_shims();
4028
+
4029
+ // src/utils/EventEmitter.ts
4030
+ init_cjs_shims();
1065
4031
  var _emitter;
1066
4032
  var EventEmitter = class {
1067
4033
  constructor() {
@@ -1082,6 +4048,9 @@ var EventEmitter = class {
1082
4048
  }
1083
4049
  };
1084
4050
  _emitter = new WeakMap();
4051
+
4052
+ // src/utils/Queue.ts
4053
+ init_cjs_shims();
1085
4054
  var _queue2, _workerCount, _maxParallel, _debug, _work, work_fn;
1086
4055
  var Queue = class {
1087
4056
  constructor(maxParallel, debug = false) {
@@ -1154,6 +4123,7 @@ work_fn = function() {
1154
4123
  };
1155
4124
 
1156
4125
  // src/utils/uniqueName.ts
4126
+ init_cjs_shims();
1157
4127
  function setUniqueName(originalName, data) {
1158
4128
  let used = data[originalName] || 0;
1159
4129
  if (used) {
@@ -1165,6 +4135,7 @@ function setUniqueName(originalName, data) {
1165
4135
  }
1166
4136
 
1167
4137
  // src/errors.ts
4138
+ init_cjs_shims();
1168
4139
  var Warning = class extends Error {
1169
4140
  constructor(message, options) {
1170
4141
  super(message, { cause: options?.cause });
@@ -1174,7 +4145,11 @@ var Warning = class extends Error {
1174
4145
  var ValidationPluginError = class extends Error {
1175
4146
  };
1176
4147
 
4148
+ // src/plugin.ts
4149
+ init_cjs_shims();
4150
+
1177
4151
  // src/utils/cache.ts
4152
+ init_cjs_shims();
1178
4153
  function createPluginCache(Store = /* @__PURE__ */ Object.create(null)) {
1179
4154
  return {
1180
4155
  set(id, value) {
@@ -1251,7 +4226,11 @@ var definePlugin = createPlugin((options) => {
1251
4226
  };
1252
4227
  });
1253
4228
 
4229
+ // src/PromiseManager.ts
4230
+ init_cjs_shims();
4231
+
1254
4232
  // src/utils/executeStrategies.ts
4233
+ init_cjs_shims();
1255
4234
  function hookSeq(promises) {
1256
4235
  return promises.filter(Boolean).reduce(
1257
4236
  (promise, func) => {
@@ -1338,7 +4317,7 @@ var PluginManager = class {
1338
4317
  __privateAdd(this, _executeSync);
1339
4318
  __privateAdd(this, _catcher);
1340
4319
  __privateAdd(this, _parse);
1341
- this.eventEmitter = new EventEmitter();
4320
+ this.events = new EventEmitter();
1342
4321
  this.executed = [];
1343
4322
  __privateAdd(this, _core, void 0);
1344
4323
  __privateAdd(this, _usedPluginNames, {});
@@ -1413,11 +4392,14 @@ Falling back on the first item.
1413
4392
  });
1414
4393
  return this;
1415
4394
  }
4395
+ /**
4396
+ * Instead of calling `pluginManager.events.on` you can use `pluginManager.on`. This one also has better types.
4397
+ */
1416
4398
  on(eventName, handler) {
1417
- this.eventEmitter.on(eventName, handler);
4399
+ this.events.on(eventName, handler);
1418
4400
  }
1419
4401
  /**
1420
- * Run only hook for a specific plugin name
4402
+ * Run a specific hookName for plugin x.
1421
4403
  */
1422
4404
  hookForPlugin({
1423
4405
  pluginKey,
@@ -1435,6 +4417,9 @@ Falling back on the first item.
1435
4417
  }).filter(Boolean);
1436
4418
  return Promise.all(promises);
1437
4419
  }
4420
+ /**
4421
+ * Run a specific hookName for plugin x.
4422
+ */
1438
4423
  hookForPluginSync({
1439
4424
  pluginKey,
1440
4425
  hookName,
@@ -1451,7 +4436,7 @@ Falling back on the first item.
1451
4436
  }).filter(Boolean);
1452
4437
  }
1453
4438
  /**
1454
- * Chains, first non-null result stops and returns
4439
+ * First non-null result stops and will return it's value.
1455
4440
  */
1456
4441
  async hookFirst({
1457
4442
  hookName,
@@ -1479,7 +4464,7 @@ Falling back on the first item.
1479
4464
  return __privateGet(this, _promiseManager).run("first", promises);
1480
4465
  }
1481
4466
  /**
1482
- * Chains, first non-null result stops and returns
4467
+ * First non-null result stops and will return it's value.
1483
4468
  */
1484
4469
  hookFirstSync({
1485
4470
  hookName,
@@ -1507,7 +4492,7 @@ Falling back on the first item.
1507
4492
  return parseResult;
1508
4493
  }
1509
4494
  /**
1510
- * Parallel, runs all plugins
4495
+ * Run all plugins in parallel(order will be based on `this.plugin` and if `pre` or `post` is set).
1511
4496
  */
1512
4497
  async hookParallel({
1513
4498
  hookName,
@@ -1526,7 +4511,7 @@ Falling back on the first item.
1526
4511
  return results.filter((result) => result.status === "fulfilled").map((result) => result.value);
1527
4512
  }
1528
4513
  /**
1529
- * Chains, reduces returned value, handling the reduced value as the first hook argument
4514
+ * Chain all plugins, `reduce` can be passed through to handle every returned value. The return value of the first plugin will be used as the first parameter for the plugin after that.
1530
4515
  */
1531
4516
  hookReduceArg0({
1532
4517
  hookName,
@@ -1643,7 +4628,7 @@ getSortedPlugins_fn = function(hookName) {
1643
4628
  _addExecutedToCallStack = new WeakSet();
1644
4629
  addExecutedToCallStack_fn = function(executer) {
1645
4630
  if (executer) {
1646
- this.eventEmitter.emit("executed", executer);
4631
+ this.events.emit("executed", executer);
1647
4632
  this.executed.push(executer);
1648
4633
  }
1649
4634
  };
@@ -1659,7 +4644,7 @@ execute_fn = function({
1659
4644
  if (!hook) {
1660
4645
  return null;
1661
4646
  }
1662
- this.eventEmitter.emit("execute", { strategy, hookName, parameters, plugin });
4647
+ this.events.emit("execute", { strategy, hookName, parameters, plugin });
1663
4648
  const task = Promise.resolve().then(() => {
1664
4649
  if (typeof hook === "function") {
1665
4650
  const possiblePromiseResult = hook.apply({ ...__privateGet(this, _core).api, plugin }, parameters);
@@ -1697,7 +4682,7 @@ executeSync_fn = function({
1697
4682
  if (!hook) {
1698
4683
  return null;
1699
4684
  }
1700
- this.eventEmitter.emit("execute", { strategy, hookName, parameters, plugin });
4685
+ this.events.emit("execute", { strategy, hookName, parameters, plugin });
1701
4686
  try {
1702
4687
  if (typeof hook === "function") {
1703
4688
  const fn = hook.apply({ ...__privateGet(this, _core).api, plugin }, parameters);
@@ -1723,7 +4708,7 @@ catcher_fn = function(e, plugin, hookName) {
1723
4708
  const text = `${e.message} (plugin: ${plugin?.name || "unknown"}, hook: ${hookName || "unknown"})
1724
4709
  `;
1725
4710
  this.logger.error(text);
1726
- this.eventEmitter.emit("error", e);
4711
+ this.events.emit("error", e);
1727
4712
  };
1728
4713
  _parse = new WeakSet();
1729
4714
  parse_fn = function(plugin, pluginManager, context) {
@@ -1765,7 +4750,7 @@ async function setup(options) {
1765
4750
  } catch (e) {
1766
4751
  if (isInputPath(config)) {
1767
4752
  throw new Error(
1768
- "Cannot read file/URL defined in `input.path` or set with `kubb generate PATH` in the CLI of your Kubb config " + pc3__default.default.dim(config.input.path),
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),
1769
4754
  {
1770
4755
  cause: e
1771
4756
  }
@@ -1818,7 +4803,7 @@ async function setup(options) {
1818
4803
  logger.spinner.start(`\u{1F4BE} Writing`);
1819
4804
  }
1820
4805
  if (logger.logLevel === LogLevel.debug) {
1821
- logger.info(`PluginKey ${pc3__default.default.dim(JSON.stringify(plugin.key))}
4806
+ logger.info(`PluginKey ${pc2__default.default.dim(JSON.stringify(plugin.key))}
1822
4807
  with source
1823
4808
 
1824
4809
  ${code}`);
@@ -1831,7 +4816,7 @@ ${code}`);
1831
4816
  if (logger.logLevel === LogLevel.info && logger.spinner) {
1832
4817
  if (hookName === "writeFile") {
1833
4818
  const [_code, path5] = parameters;
1834
- logger.spinner.suffixText = pc3__default.default.dim(path5);
4819
+ logger.spinner.suffixText = pc2__default.default.dim(path5);
1835
4820
  } else {
1836
4821
  logger.spinner.suffixText = messsage;
1837
4822
  }
@@ -1839,9 +4824,9 @@ ${code}`);
1839
4824
  if (logger.logLevel === LogLevel.debug) {
1840
4825
  logger.info(messsage);
1841
4826
  const logs = [
1842
- parameters && `${pc3__default.default.bgWhite(`Parameters`)} ${randomPicoColour(plugin.name)} ${hookName}`,
4827
+ parameters && `${pc2__default.default.bgWhite(`Parameters`)} ${randomPicoColour(plugin.name)} ${hookName}`,
1843
4828
  JSON.stringify(parameters, void 0, 2),
1844
- output && `${pc3__default.default.bgWhite("Output")} ${randomPicoColour(plugin.name)} ${hookName}`,
4829
+ output && `${pc2__default.default.bgWhite("Output")} ${randomPicoColour(plugin.name)} ${hookName}`,
1845
4830
  output
1846
4831
  ].filter(Boolean);
1847
4832
  console.log(logs.join("\n"));
@@ -1883,6 +4868,7 @@ async function safeBuild(options) {
1883
4868
  }
1884
4869
 
1885
4870
  // src/Generator.ts
4871
+ init_cjs_shims();
1886
4872
  var _options3, _context;
1887
4873
  var Generator = class {
1888
4874
  constructor(options, context) {
@@ -1909,7 +4895,23 @@ var Generator = class {
1909
4895
  _options3 = new WeakMap();
1910
4896
  _context = new WeakMap();
1911
4897
 
4898
+ // src/PackageManager.ts
4899
+ init_cjs_shims();
4900
+
4901
+ // ../../node_modules/.pnpm/find-up@6.3.0/node_modules/find-up/index.js
4902
+ init_cjs_shims();
4903
+
4904
+ // ../../node_modules/.pnpm/locate-path@7.2.0/node_modules/locate-path/index.js
4905
+ init_cjs_shims();
4906
+
4907
+ // ../../node_modules/.pnpm/p-locate@6.0.0/node_modules/p-locate/index.js
4908
+ init_cjs_shims();
4909
+
4910
+ // ../../node_modules/.pnpm/p-limit@4.0.0/node_modules/p-limit/index.js
4911
+ init_cjs_shims();
4912
+
1912
4913
  // ../../node_modules/.pnpm/yocto-queue@1.0.0/node_modules/yocto-queue/index.js
4914
+ init_cjs_shims();
1913
4915
  var Node = class {
1914
4916
  constructor(value) {
1915
4917
  __publicField(this, "value");
@@ -2062,7 +5064,7 @@ function checkType(type) {
2062
5064
  var matchType = (type, stat) => stat[typeMappings[type]]();
2063
5065
  var toPath = (urlOrPath) => urlOrPath instanceof URL ? url.fileURLToPath(urlOrPath) : urlOrPath;
2064
5066
  async function locatePath(paths, {
2065
- cwd = process__default.default.cwd(),
5067
+ cwd = process2__default.default.cwd(),
2066
5068
  type = "file",
2067
5069
  allowSymlinks = true,
2068
5070
  concurrency,
@@ -2081,7 +5083,7 @@ async function locatePath(paths, {
2081
5083
  }, { concurrency, preserveOrder });
2082
5084
  }
2083
5085
  function locatePathSync(paths, {
2084
- cwd = process__default.default.cwd(),
5086
+ cwd = process2__default.default.cwd(),
2085
5087
  type = "file",
2086
5088
  allowSymlinks = true
2087
5089
  } = {}) {
@@ -2104,6 +5106,9 @@ function locatePathSync(paths, {
2104
5106
  }
2105
5107
  }
2106
5108
 
5109
+ // ../../node_modules/.pnpm/path-exists@5.0.0/node_modules/path-exists/index.js
5110
+ init_cjs_shims();
5111
+
2107
5112
  // ../../node_modules/.pnpm/find-up@6.3.0/node_modules/find-up/index.js
2108
5113
  var toPath2 = (urlOrPath) => urlOrPath instanceof URL ? url.fileURLToPath(urlOrPath) : urlOrPath;
2109
5114
  var findUpStop = Symbol("findUpStop");
@@ -2316,11 +5321,8 @@ exports.Generator = Generator;
2316
5321
  exports.PackageManager = PackageManager;
2317
5322
  exports.PluginManager = PluginManager;
2318
5323
  exports.PromiseManager = PromiseManager;
2319
- exports.ValidationPluginError = ValidationPluginError;
2320
5324
  exports.Warning = Warning;
2321
5325
  exports.build = build;
2322
- exports.combineExports = combineExports;
2323
- exports.combineImports = combineImports;
2324
5326
  exports.createPlugin = createPlugin;
2325
5327
  exports.default = src_default;
2326
5328
  exports.defineConfig = defineConfig;