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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/dist/Queue-2-6pMcCx.d.cts +32 -0
  2. package/dist/Queue-2-6pMcCx.d.ts +32 -0
  3. package/dist/fs.cjs +2383 -0
  4. package/dist/fs.cjs.map +1 -0
  5. package/dist/fs.d.cts +5 -0
  6. package/dist/fs.d.ts +5 -0
  7. package/dist/fs.js +2380 -0
  8. package/dist/fs.js.map +1 -0
  9. package/dist/index.cjs +3336 -191
  10. package/dist/index.cjs.map +1 -1
  11. package/dist/index.d.cts +18 -69
  12. package/dist/index.d.ts +18 -69
  13. package/dist/index.js +3655 -226
  14. package/dist/index.js.map +1 -1
  15. package/dist/logger.cjs +148 -0
  16. package/dist/logger.cjs.map +1 -0
  17. package/dist/logger.d.cts +31 -0
  18. package/dist/logger.d.ts +31 -0
  19. package/dist/logger.js +140 -0
  20. package/dist/logger.js.map +1 -0
  21. package/dist/transformers.cjs +79 -9
  22. package/dist/transformers.cjs.map +1 -1
  23. package/dist/transformers.js +82 -8
  24. package/dist/transformers.js.map +1 -1
  25. package/dist/utils.cjs +86 -766
  26. package/dist/utils.cjs.map +1 -1
  27. package/dist/utils.d.cts +3 -595
  28. package/dist/utils.d.ts +3 -595
  29. package/dist/utils.js +87 -727
  30. package/dist/utils.js.map +1 -1
  31. package/dist/write-46ytbnu9.d.cts +7 -0
  32. package/dist/write-46ytbnu9.d.ts +7 -0
  33. package/package.json +21 -11
  34. package/src/FileManager.ts +34 -62
  35. package/src/PluginManager.ts +20 -15
  36. package/src/build.ts +11 -12
  37. package/src/fs/index.ts +3 -0
  38. package/src/index.ts +4 -4
  39. package/src/{utils/logger.ts → logger.ts} +38 -3
  40. package/src/plugin.ts +1 -1
  41. package/src/transformers/casing.ts +3 -3
  42. package/src/types.ts +1 -1
  43. package/src/utils/index.ts +10 -18
  44. package/src/utils/randomColour.ts +0 -39
  45. package/src/utils/throttle.ts +0 -30
  46. /package/src/{utils → fs}/clean.ts +0 -0
  47. /package/src/{utils → fs}/read.ts +0 -0
  48. /package/src/{utils → fs}/write.ts +0 -0
package/dist/index.js CHANGED
@@ -1,32 +1,63 @@
1
1
  import mod, { createRequire } from 'module';
2
- import pc3 from 'picocolors';
3
- import fs2, { remove } from 'fs-extra';
4
- import seedrandom from 'seedrandom';
5
- import path, { resolve, dirname, extname, relative, basename } from 'path';
2
+ import { isatty } from 'tty';
3
+ import path4, { resolve, dirname, extname, relative, basename } from 'path';
6
4
  import { switcher } from 'js-runtime';
7
- import { camelCase as camelCase$1, camelCaseTransformMerge, pascalCase as pascalCase$1, pascalCaseTransformMerge } from 'change-case';
8
5
  import crypto2 from 'crypto';
9
6
  import { print } from '@kubb/parser';
10
7
  import * as factory from '@kubb/parser/factory';
11
- import isEqual from 'lodash.isequal';
12
8
  import { orderBy } from 'natural-orderby';
13
9
  import dirTree from 'directory-tree';
10
+ import seedrandom from 'seedrandom';
14
11
  import { EventEmitter as EventEmitter$1 } from 'events';
15
12
  import { performance } from 'perf_hooks';
16
13
  import os from 'os';
17
- import { pathToFileURL } from 'url';
18
- import { findUp, findUpSync } from 'find-up';
14
+ import { pathToFileURL, fileURLToPath } from 'url';
15
+ import process2 from 'process';
16
+ import fs3, { promises } from 'fs';
19
17
  import { coerce, satisfies } from 'semver';
20
18
 
21
19
  const require = createRequire(import.meta.url);
22
20
 
23
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
24
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
25
- }) : x)(function(x) {
21
+ var __create = Object.create;
22
+ var __defProp = Object.defineProperty;
23
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
24
+ var __getOwnPropNames = Object.getOwnPropertyNames;
25
+ var __getProtoOf = Object.getPrototypeOf;
26
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
27
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
28
+ var __require = /* @__PURE__ */ ((x2) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x2, {
29
+ get: (a, b2) => (typeof require !== "undefined" ? require : a)[b2]
30
+ }) : x2)(function(x2) {
26
31
  if (typeof require !== "undefined")
27
32
  return require.apply(this, arguments);
28
- throw Error('Dynamic require of "' + x + '" is not supported');
33
+ throw Error('Dynamic require of "' + x2 + '" is not supported');
29
34
  });
35
+ var __esm = (fn, res) => function __init() {
36
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
37
+ };
38
+ var __commonJS = (cb, mod2) => function __require2() {
39
+ return mod2 || (0, cb[__getOwnPropNames(cb)[0]])((mod2 = { exports: {} }).exports, mod2), mod2.exports;
40
+ };
41
+ var __copyProps = (to, from, except, desc) => {
42
+ if (from && typeof from === "object" || typeof from === "function") {
43
+ for (let key of __getOwnPropNames(from))
44
+ if (!__hasOwnProp.call(to, key) && key !== except)
45
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
46
+ }
47
+ return to;
48
+ };
49
+ var __toESM = (mod2, isNodeMode, target) => (target = mod2 != null ? __create(__getProtoOf(mod2)) : {}, __copyProps(
50
+ // If the importer is in node compatibility mode or this is not an ESM
51
+ // file that has been converted to a CommonJS file using a Babel-
52
+ // compatible transform (i.e. "__esModule" has not been set), then set
53
+ // "default" to the CommonJS "module.exports" for node compatibility.
54
+ isNodeMode || !mod2 || !mod2.__esModule ? __defProp(target, "default", { value: mod2, enumerable: true }) : target,
55
+ mod2
56
+ ));
57
+ var __publicField = (obj, key, value) => {
58
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
59
+ return value;
60
+ };
30
61
  var __accessCheck = (obj, member, msg) => {
31
62
  if (!member.has(obj))
32
63
  throw TypeError("Cannot " + msg);
@@ -57,83 +88,3006 @@ var __privateMethod = (obj, member, method) => {
57
88
  __accessCheck(obj, member, "access private method");
58
89
  return method;
59
90
  };
60
- async function clean(path3) {
61
- return remove(path3);
62
- }
63
- var LogLevel = {
64
- silent: "silent",
65
- info: "info",
66
- debug: "debug"
67
- };
68
- function createLogger({ logLevel, name, spinner }) {
69
- const logs = [];
70
- const log = (message) => {
71
- if (message && spinner) {
72
- spinner.text = message;
73
- logs.push(message);
91
+
92
+ // ../../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/esm_shims.js
93
+ var init_esm_shims = __esm({
94
+ "../../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/esm_shims.js"() {
95
+ }
96
+ });
97
+
98
+ // ../../node_modules/.pnpm/universalify@2.0.1/node_modules/universalify/index.js
99
+ var require_universalify = __commonJS({
100
+ "../../node_modules/.pnpm/universalify@2.0.1/node_modules/universalify/index.js"(exports) {
101
+ init_esm_shims();
102
+ exports.fromCallback = function(fn) {
103
+ return Object.defineProperty(function(...args) {
104
+ if (typeof args[args.length - 1] === "function")
105
+ fn.apply(this, args);
106
+ else {
107
+ return new Promise((resolve3, reject) => {
108
+ args.push((err, res) => err != null ? reject(err) : resolve3(res));
109
+ fn.apply(this, args);
110
+ });
111
+ }
112
+ }, "name", { value: fn.name });
113
+ };
114
+ exports.fromPromise = function(fn) {
115
+ return Object.defineProperty(function(...args) {
116
+ const cb = args[args.length - 1];
117
+ if (typeof cb !== "function")
118
+ return fn.apply(this, args);
119
+ else {
120
+ args.pop();
121
+ fn.apply(this, args).then((r2) => cb(null, r2), cb);
122
+ }
123
+ }, "name", { value: fn.name });
124
+ };
125
+ }
126
+ });
127
+
128
+ // ../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/polyfills.js
129
+ var require_polyfills = __commonJS({
130
+ "../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/polyfills.js"(exports, module) {
131
+ init_esm_shims();
132
+ var constants = __require("constants");
133
+ var origCwd = process.cwd;
134
+ var cwd = null;
135
+ var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform;
136
+ process.cwd = function() {
137
+ if (!cwd)
138
+ cwd = origCwd.call(process);
139
+ return cwd;
140
+ };
141
+ try {
142
+ process.cwd();
143
+ } catch (er) {
74
144
  }
75
- };
76
- const error = (message) => {
77
- if (message) {
78
- throw new Error(message || "Something went wrong");
145
+ if (typeof process.chdir === "function") {
146
+ chdir = process.chdir;
147
+ process.chdir = function(d2) {
148
+ cwd = null;
149
+ chdir.call(process, d2);
150
+ };
151
+ if (Object.setPrototypeOf)
152
+ Object.setPrototypeOf(process.chdir, chdir);
79
153
  }
80
- };
81
- const warn = (message) => {
82
- if (message && spinner) {
83
- spinner.warn(pc3.yellow(message));
84
- logs.push(message);
154
+ var chdir;
155
+ module.exports = patch;
156
+ function patch(fs4) {
157
+ if (constants.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) {
158
+ patchLchmod(fs4);
159
+ }
160
+ if (!fs4.lutimes) {
161
+ patchLutimes(fs4);
162
+ }
163
+ fs4.chown = chownFix(fs4.chown);
164
+ fs4.fchown = chownFix(fs4.fchown);
165
+ fs4.lchown = chownFix(fs4.lchown);
166
+ fs4.chmod = chmodFix(fs4.chmod);
167
+ fs4.fchmod = chmodFix(fs4.fchmod);
168
+ fs4.lchmod = chmodFix(fs4.lchmod);
169
+ fs4.chownSync = chownFixSync(fs4.chownSync);
170
+ fs4.fchownSync = chownFixSync(fs4.fchownSync);
171
+ fs4.lchownSync = chownFixSync(fs4.lchownSync);
172
+ fs4.chmodSync = chmodFixSync(fs4.chmodSync);
173
+ fs4.fchmodSync = chmodFixSync(fs4.fchmodSync);
174
+ fs4.lchmodSync = chmodFixSync(fs4.lchmodSync);
175
+ fs4.stat = statFix(fs4.stat);
176
+ fs4.fstat = statFix(fs4.fstat);
177
+ fs4.lstat = statFix(fs4.lstat);
178
+ fs4.statSync = statFixSync(fs4.statSync);
179
+ fs4.fstatSync = statFixSync(fs4.fstatSync);
180
+ fs4.lstatSync = statFixSync(fs4.lstatSync);
181
+ if (fs4.chmod && !fs4.lchmod) {
182
+ fs4.lchmod = function(path5, mode, cb) {
183
+ if (cb)
184
+ process.nextTick(cb);
185
+ };
186
+ fs4.lchmodSync = function() {
187
+ };
188
+ }
189
+ if (fs4.chown && !fs4.lchown) {
190
+ fs4.lchown = function(path5, uid, gid, cb) {
191
+ if (cb)
192
+ process.nextTick(cb);
193
+ };
194
+ fs4.lchownSync = function() {
195
+ };
196
+ }
197
+ if (platform === "win32") {
198
+ fs4.rename = typeof fs4.rename !== "function" ? fs4.rename : function(fs$rename) {
199
+ function rename(from, to, cb) {
200
+ var start = Date.now();
201
+ var backoff = 0;
202
+ fs$rename(from, to, function CB(er) {
203
+ if (er && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY") && Date.now() - start < 6e4) {
204
+ setTimeout(function() {
205
+ fs4.stat(to, function(stater, st) {
206
+ if (stater && stater.code === "ENOENT")
207
+ fs$rename(from, to, CB);
208
+ else
209
+ cb(er);
210
+ });
211
+ }, backoff);
212
+ if (backoff < 100)
213
+ backoff += 10;
214
+ return;
215
+ }
216
+ if (cb)
217
+ cb(er);
218
+ });
219
+ }
220
+ if (Object.setPrototypeOf)
221
+ Object.setPrototypeOf(rename, fs$rename);
222
+ return rename;
223
+ }(fs4.rename);
224
+ }
225
+ fs4.read = typeof fs4.read !== "function" ? fs4.read : function(fs$read) {
226
+ function read2(fd, buffer, offset, length, position, callback_) {
227
+ var callback;
228
+ if (callback_ && typeof callback_ === "function") {
229
+ var eagCounter = 0;
230
+ callback = function(er, _, __) {
231
+ if (er && er.code === "EAGAIN" && eagCounter < 10) {
232
+ eagCounter++;
233
+ return fs$read.call(fs4, fd, buffer, offset, length, position, callback);
234
+ }
235
+ callback_.apply(this, arguments);
236
+ };
237
+ }
238
+ return fs$read.call(fs4, fd, buffer, offset, length, position, callback);
239
+ }
240
+ if (Object.setPrototypeOf)
241
+ Object.setPrototypeOf(read2, fs$read);
242
+ return read2;
243
+ }(fs4.read);
244
+ fs4.readSync = typeof fs4.readSync !== "function" ? fs4.readSync : /* @__PURE__ */ function(fs$readSync) {
245
+ return function(fd, buffer, offset, length, position) {
246
+ var eagCounter = 0;
247
+ while (true) {
248
+ try {
249
+ return fs$readSync.call(fs4, fd, buffer, offset, length, position);
250
+ } catch (er) {
251
+ if (er.code === "EAGAIN" && eagCounter < 10) {
252
+ eagCounter++;
253
+ continue;
254
+ }
255
+ throw er;
256
+ }
257
+ }
258
+ };
259
+ }(fs4.readSync);
260
+ function patchLchmod(fs5) {
261
+ fs5.lchmod = function(path5, mode, callback) {
262
+ fs5.open(
263
+ path5,
264
+ constants.O_WRONLY | constants.O_SYMLINK,
265
+ mode,
266
+ function(err, fd) {
267
+ if (err) {
268
+ if (callback)
269
+ callback(err);
270
+ return;
271
+ }
272
+ fs5.fchmod(fd, mode, function(err2) {
273
+ fs5.close(fd, function(err22) {
274
+ if (callback)
275
+ callback(err2 || err22);
276
+ });
277
+ });
278
+ }
279
+ );
280
+ };
281
+ fs5.lchmodSync = function(path5, mode) {
282
+ var fd = fs5.openSync(path5, constants.O_WRONLY | constants.O_SYMLINK, mode);
283
+ var threw = true;
284
+ var ret;
285
+ try {
286
+ ret = fs5.fchmodSync(fd, mode);
287
+ threw = false;
288
+ } finally {
289
+ if (threw) {
290
+ try {
291
+ fs5.closeSync(fd);
292
+ } catch (er) {
293
+ }
294
+ } else {
295
+ fs5.closeSync(fd);
296
+ }
297
+ }
298
+ return ret;
299
+ };
300
+ }
301
+ function patchLutimes(fs5) {
302
+ if (constants.hasOwnProperty("O_SYMLINK") && fs5.futimes) {
303
+ fs5.lutimes = function(path5, at, mt, cb) {
304
+ fs5.open(path5, constants.O_SYMLINK, function(er, fd) {
305
+ if (er) {
306
+ if (cb)
307
+ cb(er);
308
+ return;
309
+ }
310
+ fs5.futimes(fd, at, mt, function(er2) {
311
+ fs5.close(fd, function(er22) {
312
+ if (cb)
313
+ cb(er2 || er22);
314
+ });
315
+ });
316
+ });
317
+ };
318
+ fs5.lutimesSync = function(path5, at, mt) {
319
+ var fd = fs5.openSync(path5, constants.O_SYMLINK);
320
+ var ret;
321
+ var threw = true;
322
+ try {
323
+ ret = fs5.futimesSync(fd, at, mt);
324
+ threw = false;
325
+ } finally {
326
+ if (threw) {
327
+ try {
328
+ fs5.closeSync(fd);
329
+ } catch (er) {
330
+ }
331
+ } else {
332
+ fs5.closeSync(fd);
333
+ }
334
+ }
335
+ return ret;
336
+ };
337
+ } else if (fs5.futimes) {
338
+ fs5.lutimes = function(_a, _b, _c, cb) {
339
+ if (cb)
340
+ process.nextTick(cb);
341
+ };
342
+ fs5.lutimesSync = function() {
343
+ };
344
+ }
345
+ }
346
+ function chmodFix(orig) {
347
+ if (!orig)
348
+ return orig;
349
+ return function(target, mode, cb) {
350
+ return orig.call(fs4, target, mode, function(er) {
351
+ if (chownErOk(er))
352
+ er = null;
353
+ if (cb)
354
+ cb.apply(this, arguments);
355
+ });
356
+ };
357
+ }
358
+ function chmodFixSync(orig) {
359
+ if (!orig)
360
+ return orig;
361
+ return function(target, mode) {
362
+ try {
363
+ return orig.call(fs4, target, mode);
364
+ } catch (er) {
365
+ if (!chownErOk(er))
366
+ throw er;
367
+ }
368
+ };
369
+ }
370
+ function chownFix(orig) {
371
+ if (!orig)
372
+ return orig;
373
+ return function(target, uid, gid, cb) {
374
+ return orig.call(fs4, target, uid, gid, function(er) {
375
+ if (chownErOk(er))
376
+ er = null;
377
+ if (cb)
378
+ cb.apply(this, arguments);
379
+ });
380
+ };
381
+ }
382
+ function chownFixSync(orig) {
383
+ if (!orig)
384
+ return orig;
385
+ return function(target, uid, gid) {
386
+ try {
387
+ return orig.call(fs4, target, uid, gid);
388
+ } catch (er) {
389
+ if (!chownErOk(er))
390
+ throw er;
391
+ }
392
+ };
393
+ }
394
+ function statFix(orig) {
395
+ if (!orig)
396
+ return orig;
397
+ return function(target, options, cb) {
398
+ if (typeof options === "function") {
399
+ cb = options;
400
+ options = null;
401
+ }
402
+ function callback(er, stats) {
403
+ if (stats) {
404
+ if (stats.uid < 0)
405
+ stats.uid += 4294967296;
406
+ if (stats.gid < 0)
407
+ stats.gid += 4294967296;
408
+ }
409
+ if (cb)
410
+ cb.apply(this, arguments);
411
+ }
412
+ return options ? orig.call(fs4, target, options, callback) : orig.call(fs4, target, callback);
413
+ };
414
+ }
415
+ function statFixSync(orig) {
416
+ if (!orig)
417
+ return orig;
418
+ return function(target, options) {
419
+ var stats = options ? orig.call(fs4, target, options) : orig.call(fs4, target);
420
+ if (stats) {
421
+ if (stats.uid < 0)
422
+ stats.uid += 4294967296;
423
+ if (stats.gid < 0)
424
+ stats.gid += 4294967296;
425
+ }
426
+ return stats;
427
+ };
428
+ }
429
+ function chownErOk(er) {
430
+ if (!er)
431
+ return true;
432
+ if (er.code === "ENOSYS")
433
+ return true;
434
+ var nonroot = !process.getuid || process.getuid() !== 0;
435
+ if (nonroot) {
436
+ if (er.code === "EINVAL" || er.code === "EPERM")
437
+ return true;
438
+ }
439
+ return false;
440
+ }
85
441
  }
86
- };
87
- const info = (message) => {
88
- if (message && spinner && logLevel !== LogLevel.silent) {
89
- spinner.info(message);
90
- logs.push(message);
442
+ }
443
+ });
444
+
445
+ // ../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/legacy-streams.js
446
+ var require_legacy_streams = __commonJS({
447
+ "../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/legacy-streams.js"(exports, module) {
448
+ init_esm_shims();
449
+ var Stream = __require("stream").Stream;
450
+ module.exports = legacy;
451
+ function legacy(fs4) {
452
+ return {
453
+ ReadStream,
454
+ WriteStream
455
+ };
456
+ function ReadStream(path5, options) {
457
+ if (!(this instanceof ReadStream))
458
+ return new ReadStream(path5, options);
459
+ Stream.call(this);
460
+ var self2 = this;
461
+ this.path = path5;
462
+ this.fd = null;
463
+ this.readable = true;
464
+ this.paused = false;
465
+ this.flags = "r";
466
+ this.mode = 438;
467
+ this.bufferSize = 64 * 1024;
468
+ options = options || {};
469
+ var keys = Object.keys(options);
470
+ for (var index = 0, length = keys.length; index < length; index++) {
471
+ var key = keys[index];
472
+ this[key] = options[key];
473
+ }
474
+ if (this.encoding)
475
+ this.setEncoding(this.encoding);
476
+ if (this.start !== void 0) {
477
+ if ("number" !== typeof this.start) {
478
+ throw TypeError("start must be a Number");
479
+ }
480
+ if (this.end === void 0) {
481
+ this.end = Infinity;
482
+ } else if ("number" !== typeof this.end) {
483
+ throw TypeError("end must be a Number");
484
+ }
485
+ if (this.start > this.end) {
486
+ throw new Error("start must be <= end");
487
+ }
488
+ this.pos = this.start;
489
+ }
490
+ if (this.fd !== null) {
491
+ process.nextTick(function() {
492
+ self2._read();
493
+ });
494
+ return;
495
+ }
496
+ fs4.open(this.path, this.flags, this.mode, function(err, fd) {
497
+ if (err) {
498
+ self2.emit("error", err);
499
+ self2.readable = false;
500
+ return;
501
+ }
502
+ self2.fd = fd;
503
+ self2.emit("open", fd);
504
+ self2._read();
505
+ });
506
+ }
507
+ function WriteStream(path5, options) {
508
+ if (!(this instanceof WriteStream))
509
+ return new WriteStream(path5, options);
510
+ Stream.call(this);
511
+ this.path = path5;
512
+ this.fd = null;
513
+ this.writable = true;
514
+ this.flags = "w";
515
+ this.encoding = "binary";
516
+ this.mode = 438;
517
+ this.bytesWritten = 0;
518
+ options = options || {};
519
+ var keys = Object.keys(options);
520
+ for (var index = 0, length = keys.length; index < length; index++) {
521
+ var key = keys[index];
522
+ this[key] = options[key];
523
+ }
524
+ if (this.start !== void 0) {
525
+ if ("number" !== typeof this.start) {
526
+ throw TypeError("start must be a Number");
527
+ }
528
+ if (this.start < 0) {
529
+ throw new Error("start must be >= zero");
530
+ }
531
+ this.pos = this.start;
532
+ }
533
+ this.busy = false;
534
+ this._queue = [];
535
+ if (this.fd === null) {
536
+ this._open = fs4.open;
537
+ this._queue.push([this._open, this.path, this.flags, this.mode, void 0]);
538
+ this.flush();
539
+ }
540
+ }
91
541
  }
92
- };
93
- const logger = {
94
- name,
95
- logLevel,
96
- log,
97
- error,
98
- warn,
99
- info,
100
- spinner,
101
- logs
102
- };
103
- return logger;
104
- }
105
- var defaultColours = ["black", "blue", "darkBlue", "cyan", "gray", "green", "darkGreen", "magenta", "red", "darkRed", "yellow", "darkYellow"];
106
- function randomColour(text, colours = defaultColours) {
107
- if (!text) {
108
- return "white";
109
542
  }
110
- const random = seedrandom(text);
111
- const colour = colours.at(Math.floor(random() * colours.length)) || "white";
112
- return colour;
543
+ });
544
+
545
+ // ../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/clone.js
546
+ var require_clone = __commonJS({
547
+ "../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/clone.js"(exports, module) {
548
+ init_esm_shims();
549
+ module.exports = clone;
550
+ var getPrototypeOf = Object.getPrototypeOf || function(obj) {
551
+ return obj.__proto__;
552
+ };
553
+ function clone(obj) {
554
+ if (obj === null || typeof obj !== "object")
555
+ return obj;
556
+ if (obj instanceof Object)
557
+ var copy = { __proto__: getPrototypeOf(obj) };
558
+ else
559
+ var copy = /* @__PURE__ */ Object.create(null);
560
+ Object.getOwnPropertyNames(obj).forEach(function(key) {
561
+ Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key));
562
+ });
563
+ return copy;
564
+ }
565
+ }
566
+ });
567
+
568
+ // ../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/graceful-fs.js
569
+ var require_graceful_fs = __commonJS({
570
+ "../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/graceful-fs.js"(exports, module) {
571
+ init_esm_shims();
572
+ var fs4 = __require("fs");
573
+ var polyfills = require_polyfills();
574
+ var legacy = require_legacy_streams();
575
+ var clone = require_clone();
576
+ var util = __require("util");
577
+ var gracefulQueue;
578
+ var previousSymbol;
579
+ if (typeof Symbol === "function" && typeof Symbol.for === "function") {
580
+ gracefulQueue = Symbol.for("graceful-fs.queue");
581
+ previousSymbol = Symbol.for("graceful-fs.previous");
582
+ } else {
583
+ gracefulQueue = "___graceful-fs.queue";
584
+ previousSymbol = "___graceful-fs.previous";
585
+ }
586
+ function noop() {
587
+ }
588
+ function publishQueue(context, queue2) {
589
+ Object.defineProperty(context, gracefulQueue, {
590
+ get: function() {
591
+ return queue2;
592
+ }
593
+ });
594
+ }
595
+ var debug = noop;
596
+ if (util.debuglog)
597
+ debug = util.debuglog("gfs4");
598
+ else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || ""))
599
+ debug = function() {
600
+ var m = util.format.apply(util, arguments);
601
+ m = "GFS4: " + m.split(/\n/).join("\nGFS4: ");
602
+ console.error(m);
603
+ };
604
+ if (!fs4[gracefulQueue]) {
605
+ queue = global[gracefulQueue] || [];
606
+ publishQueue(fs4, queue);
607
+ fs4.close = function(fs$close) {
608
+ function close(fd, cb) {
609
+ return fs$close.call(fs4, fd, function(err) {
610
+ if (!err) {
611
+ resetQueue();
612
+ }
613
+ if (typeof cb === "function")
614
+ cb.apply(this, arguments);
615
+ });
616
+ }
617
+ Object.defineProperty(close, previousSymbol, {
618
+ value: fs$close
619
+ });
620
+ return close;
621
+ }(fs4.close);
622
+ fs4.closeSync = function(fs$closeSync) {
623
+ function closeSync(fd) {
624
+ fs$closeSync.apply(fs4, arguments);
625
+ resetQueue();
626
+ }
627
+ Object.defineProperty(closeSync, previousSymbol, {
628
+ value: fs$closeSync
629
+ });
630
+ return closeSync;
631
+ }(fs4.closeSync);
632
+ if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) {
633
+ process.on("exit", function() {
634
+ debug(fs4[gracefulQueue]);
635
+ __require("assert").equal(fs4[gracefulQueue].length, 0);
636
+ });
637
+ }
638
+ }
639
+ var queue;
640
+ if (!global[gracefulQueue]) {
641
+ publishQueue(global, fs4[gracefulQueue]);
642
+ }
643
+ module.exports = patch(clone(fs4));
644
+ if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs4.__patched) {
645
+ module.exports = patch(fs4);
646
+ fs4.__patched = true;
647
+ }
648
+ function patch(fs5) {
649
+ polyfills(fs5);
650
+ fs5.gracefulify = patch;
651
+ fs5.createReadStream = createReadStream;
652
+ fs5.createWriteStream = createWriteStream;
653
+ var fs$readFile = fs5.readFile;
654
+ fs5.readFile = readFile;
655
+ function readFile(path5, options, cb) {
656
+ if (typeof options === "function")
657
+ cb = options, options = null;
658
+ return go$readFile(path5, options, cb);
659
+ function go$readFile(path6, options2, cb2, startTime) {
660
+ return fs$readFile(path6, options2, function(err) {
661
+ if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
662
+ enqueue([go$readFile, [path6, options2, cb2], err, startTime || Date.now(), Date.now()]);
663
+ else {
664
+ if (typeof cb2 === "function")
665
+ cb2.apply(this, arguments);
666
+ }
667
+ });
668
+ }
669
+ }
670
+ var fs$writeFile = fs5.writeFile;
671
+ fs5.writeFile = writeFile;
672
+ function writeFile(path5, data, options, cb) {
673
+ if (typeof options === "function")
674
+ cb = options, options = null;
675
+ return go$writeFile(path5, data, options, cb);
676
+ function go$writeFile(path6, data2, options2, cb2, startTime) {
677
+ return fs$writeFile(path6, data2, options2, function(err) {
678
+ if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
679
+ enqueue([go$writeFile, [path6, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
680
+ else {
681
+ if (typeof cb2 === "function")
682
+ cb2.apply(this, arguments);
683
+ }
684
+ });
685
+ }
686
+ }
687
+ var fs$appendFile = fs5.appendFile;
688
+ if (fs$appendFile)
689
+ fs5.appendFile = appendFile;
690
+ function appendFile(path5, data, options, cb) {
691
+ if (typeof options === "function")
692
+ cb = options, options = null;
693
+ return go$appendFile(path5, data, options, cb);
694
+ function go$appendFile(path6, data2, options2, cb2, startTime) {
695
+ return fs$appendFile(path6, data2, options2, function(err) {
696
+ if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
697
+ enqueue([go$appendFile, [path6, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
698
+ else {
699
+ if (typeof cb2 === "function")
700
+ cb2.apply(this, arguments);
701
+ }
702
+ });
703
+ }
704
+ }
705
+ var fs$copyFile = fs5.copyFile;
706
+ if (fs$copyFile)
707
+ fs5.copyFile = copyFile;
708
+ function copyFile(src, dest, flags, cb) {
709
+ if (typeof flags === "function") {
710
+ cb = flags;
711
+ flags = 0;
712
+ }
713
+ return go$copyFile(src, dest, flags, cb);
714
+ function go$copyFile(src2, dest2, flags2, cb2, startTime) {
715
+ return fs$copyFile(src2, dest2, flags2, function(err) {
716
+ if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
717
+ enqueue([go$copyFile, [src2, dest2, flags2, cb2], err, startTime || Date.now(), Date.now()]);
718
+ else {
719
+ if (typeof cb2 === "function")
720
+ cb2.apply(this, arguments);
721
+ }
722
+ });
723
+ }
724
+ }
725
+ var fs$readdir = fs5.readdir;
726
+ fs5.readdir = readdir;
727
+ var noReaddirOptionVersions = /^v[0-5]\./;
728
+ function readdir(path5, options, cb) {
729
+ if (typeof options === "function")
730
+ cb = options, options = null;
731
+ var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path6, options2, cb2, startTime) {
732
+ return fs$readdir(path6, fs$readdirCallback(
733
+ path6,
734
+ options2,
735
+ cb2,
736
+ startTime
737
+ ));
738
+ } : function go$readdir2(path6, options2, cb2, startTime) {
739
+ return fs$readdir(path6, options2, fs$readdirCallback(
740
+ path6,
741
+ options2,
742
+ cb2,
743
+ startTime
744
+ ));
745
+ };
746
+ return go$readdir(path5, options, cb);
747
+ function fs$readdirCallback(path6, options2, cb2, startTime) {
748
+ return function(err, files) {
749
+ if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
750
+ enqueue([
751
+ go$readdir,
752
+ [path6, options2, cb2],
753
+ err,
754
+ startTime || Date.now(),
755
+ Date.now()
756
+ ]);
757
+ else {
758
+ if (files && files.sort)
759
+ files.sort();
760
+ if (typeof cb2 === "function")
761
+ cb2.call(this, err, files);
762
+ }
763
+ };
764
+ }
765
+ }
766
+ if (process.version.substr(0, 4) === "v0.8") {
767
+ var legStreams = legacy(fs5);
768
+ ReadStream = legStreams.ReadStream;
769
+ WriteStream = legStreams.WriteStream;
770
+ }
771
+ var fs$ReadStream = fs5.ReadStream;
772
+ if (fs$ReadStream) {
773
+ ReadStream.prototype = Object.create(fs$ReadStream.prototype);
774
+ ReadStream.prototype.open = ReadStream$open;
775
+ }
776
+ var fs$WriteStream = fs5.WriteStream;
777
+ if (fs$WriteStream) {
778
+ WriteStream.prototype = Object.create(fs$WriteStream.prototype);
779
+ WriteStream.prototype.open = WriteStream$open;
780
+ }
781
+ Object.defineProperty(fs5, "ReadStream", {
782
+ get: function() {
783
+ return ReadStream;
784
+ },
785
+ set: function(val) {
786
+ ReadStream = val;
787
+ },
788
+ enumerable: true,
789
+ configurable: true
790
+ });
791
+ Object.defineProperty(fs5, "WriteStream", {
792
+ get: function() {
793
+ return WriteStream;
794
+ },
795
+ set: function(val) {
796
+ WriteStream = val;
797
+ },
798
+ enumerable: true,
799
+ configurable: true
800
+ });
801
+ var FileReadStream = ReadStream;
802
+ Object.defineProperty(fs5, "FileReadStream", {
803
+ get: function() {
804
+ return FileReadStream;
805
+ },
806
+ set: function(val) {
807
+ FileReadStream = val;
808
+ },
809
+ enumerable: true,
810
+ configurable: true
811
+ });
812
+ var FileWriteStream = WriteStream;
813
+ Object.defineProperty(fs5, "FileWriteStream", {
814
+ get: function() {
815
+ return FileWriteStream;
816
+ },
817
+ set: function(val) {
818
+ FileWriteStream = val;
819
+ },
820
+ enumerable: true,
821
+ configurable: true
822
+ });
823
+ function ReadStream(path5, options) {
824
+ if (this instanceof ReadStream)
825
+ return fs$ReadStream.apply(this, arguments), this;
826
+ else
827
+ return ReadStream.apply(Object.create(ReadStream.prototype), arguments);
828
+ }
829
+ function ReadStream$open() {
830
+ var that = this;
831
+ open(that.path, that.flags, that.mode, function(err, fd) {
832
+ if (err) {
833
+ if (that.autoClose)
834
+ that.destroy();
835
+ that.emit("error", err);
836
+ } else {
837
+ that.fd = fd;
838
+ that.emit("open", fd);
839
+ that.read();
840
+ }
841
+ });
842
+ }
843
+ function WriteStream(path5, options) {
844
+ if (this instanceof WriteStream)
845
+ return fs$WriteStream.apply(this, arguments), this;
846
+ else
847
+ return WriteStream.apply(Object.create(WriteStream.prototype), arguments);
848
+ }
849
+ function WriteStream$open() {
850
+ var that = this;
851
+ open(that.path, that.flags, that.mode, function(err, fd) {
852
+ if (err) {
853
+ that.destroy();
854
+ that.emit("error", err);
855
+ } else {
856
+ that.fd = fd;
857
+ that.emit("open", fd);
858
+ }
859
+ });
860
+ }
861
+ function createReadStream(path5, options) {
862
+ return new fs5.ReadStream(path5, options);
863
+ }
864
+ function createWriteStream(path5, options) {
865
+ return new fs5.WriteStream(path5, options);
866
+ }
867
+ var fs$open = fs5.open;
868
+ fs5.open = open;
869
+ function open(path5, flags, mode, cb) {
870
+ if (typeof mode === "function")
871
+ cb = mode, mode = null;
872
+ return go$open(path5, flags, mode, cb);
873
+ function go$open(path6, flags2, mode2, cb2, startTime) {
874
+ return fs$open(path6, flags2, mode2, function(err, fd) {
875
+ if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
876
+ enqueue([go$open, [path6, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]);
877
+ else {
878
+ if (typeof cb2 === "function")
879
+ cb2.apply(this, arguments);
880
+ }
881
+ });
882
+ }
883
+ }
884
+ return fs5;
885
+ }
886
+ function enqueue(elem) {
887
+ debug("ENQUEUE", elem[0].name, elem[1]);
888
+ fs4[gracefulQueue].push(elem);
889
+ retry();
890
+ }
891
+ var retryTimer;
892
+ function resetQueue() {
893
+ var now = Date.now();
894
+ for (var i = 0; i < fs4[gracefulQueue].length; ++i) {
895
+ if (fs4[gracefulQueue][i].length > 2) {
896
+ fs4[gracefulQueue][i][3] = now;
897
+ fs4[gracefulQueue][i][4] = now;
898
+ }
899
+ }
900
+ retry();
901
+ }
902
+ function retry() {
903
+ clearTimeout(retryTimer);
904
+ retryTimer = void 0;
905
+ if (fs4[gracefulQueue].length === 0)
906
+ return;
907
+ var elem = fs4[gracefulQueue].shift();
908
+ var fn = elem[0];
909
+ var args = elem[1];
910
+ var err = elem[2];
911
+ var startTime = elem[3];
912
+ var lastTime = elem[4];
913
+ if (startTime === void 0) {
914
+ debug("RETRY", fn.name, args);
915
+ fn.apply(null, args);
916
+ } else if (Date.now() - startTime >= 6e4) {
917
+ debug("TIMEOUT", fn.name, args);
918
+ var cb = args.pop();
919
+ if (typeof cb === "function")
920
+ cb.call(null, err);
921
+ } else {
922
+ var sinceAttempt = Date.now() - lastTime;
923
+ var sinceStart = Math.max(lastTime - startTime, 1);
924
+ var desiredDelay = Math.min(sinceStart * 1.2, 100);
925
+ if (sinceAttempt >= desiredDelay) {
926
+ debug("RETRY", fn.name, args);
927
+ fn.apply(null, args.concat([startTime]));
928
+ } else {
929
+ fs4[gracefulQueue].push(elem);
930
+ }
931
+ }
932
+ if (retryTimer === void 0) {
933
+ retryTimer = setTimeout(retry, 0);
934
+ }
935
+ }
936
+ }
937
+ });
938
+
939
+ // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/fs/index.js
940
+ var require_fs = __commonJS({
941
+ "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/fs/index.js"(exports) {
942
+ init_esm_shims();
943
+ var u = require_universalify().fromCallback;
944
+ var fs4 = require_graceful_fs();
945
+ var api = [
946
+ "access",
947
+ "appendFile",
948
+ "chmod",
949
+ "chown",
950
+ "close",
951
+ "copyFile",
952
+ "fchmod",
953
+ "fchown",
954
+ "fdatasync",
955
+ "fstat",
956
+ "fsync",
957
+ "ftruncate",
958
+ "futimes",
959
+ "lchmod",
960
+ "lchown",
961
+ "link",
962
+ "lstat",
963
+ "mkdir",
964
+ "mkdtemp",
965
+ "open",
966
+ "opendir",
967
+ "readdir",
968
+ "readFile",
969
+ "readlink",
970
+ "realpath",
971
+ "rename",
972
+ "rm",
973
+ "rmdir",
974
+ "stat",
975
+ "symlink",
976
+ "truncate",
977
+ "unlink",
978
+ "utimes",
979
+ "writeFile"
980
+ ].filter((key) => {
981
+ return typeof fs4[key] === "function";
982
+ });
983
+ Object.assign(exports, fs4);
984
+ api.forEach((method) => {
985
+ exports[method] = u(fs4[method]);
986
+ });
987
+ exports.exists = function(filename, callback) {
988
+ if (typeof callback === "function") {
989
+ return fs4.exists(filename, callback);
990
+ }
991
+ return new Promise((resolve3) => {
992
+ return fs4.exists(filename, resolve3);
993
+ });
994
+ };
995
+ exports.read = function(fd, buffer, offset, length, position, callback) {
996
+ if (typeof callback === "function") {
997
+ return fs4.read(fd, buffer, offset, length, position, callback);
998
+ }
999
+ return new Promise((resolve3, reject) => {
1000
+ fs4.read(fd, buffer, offset, length, position, (err, bytesRead, buffer2) => {
1001
+ if (err)
1002
+ return reject(err);
1003
+ resolve3({ bytesRead, buffer: buffer2 });
1004
+ });
1005
+ });
1006
+ };
1007
+ exports.write = function(fd, buffer, ...args) {
1008
+ if (typeof args[args.length - 1] === "function") {
1009
+ return fs4.write(fd, buffer, ...args);
1010
+ }
1011
+ return new Promise((resolve3, reject) => {
1012
+ fs4.write(fd, buffer, ...args, (err, bytesWritten, buffer2) => {
1013
+ if (err)
1014
+ return reject(err);
1015
+ resolve3({ bytesWritten, buffer: buffer2 });
1016
+ });
1017
+ });
1018
+ };
1019
+ exports.readv = function(fd, buffers, ...args) {
1020
+ if (typeof args[args.length - 1] === "function") {
1021
+ return fs4.readv(fd, buffers, ...args);
1022
+ }
1023
+ return new Promise((resolve3, reject) => {
1024
+ fs4.readv(fd, buffers, ...args, (err, bytesRead, buffers2) => {
1025
+ if (err)
1026
+ return reject(err);
1027
+ resolve3({ bytesRead, buffers: buffers2 });
1028
+ });
1029
+ });
1030
+ };
1031
+ exports.writev = function(fd, buffers, ...args) {
1032
+ if (typeof args[args.length - 1] === "function") {
1033
+ return fs4.writev(fd, buffers, ...args);
1034
+ }
1035
+ return new Promise((resolve3, reject) => {
1036
+ fs4.writev(fd, buffers, ...args, (err, bytesWritten, buffers2) => {
1037
+ if (err)
1038
+ return reject(err);
1039
+ resolve3({ bytesWritten, buffers: buffers2 });
1040
+ });
1041
+ });
1042
+ };
1043
+ if (typeof fs4.realpath.native === "function") {
1044
+ exports.realpath.native = u(fs4.realpath.native);
1045
+ } else {
1046
+ process.emitWarning(
1047
+ "fs.realpath.native is not a function. Is fs being monkey-patched?",
1048
+ "Warning",
1049
+ "fs-extra-WARN0003"
1050
+ );
1051
+ }
1052
+ }
1053
+ });
1054
+
1055
+ // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/mkdirs/utils.js
1056
+ var require_utils = __commonJS({
1057
+ "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/mkdirs/utils.js"(exports, module) {
1058
+ init_esm_shims();
1059
+ var path5 = __require("path");
1060
+ module.exports.checkPath = function checkPath(pth) {
1061
+ if (process.platform === "win32") {
1062
+ const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path5.parse(pth).root, ""));
1063
+ if (pathHasInvalidWinCharacters) {
1064
+ const error = new Error(`Path contains invalid characters: ${pth}`);
1065
+ error.code = "EINVAL";
1066
+ throw error;
1067
+ }
1068
+ }
1069
+ };
1070
+ }
1071
+ });
1072
+
1073
+ // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/mkdirs/make-dir.js
1074
+ var require_make_dir = __commonJS({
1075
+ "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/mkdirs/make-dir.js"(exports, module) {
1076
+ init_esm_shims();
1077
+ var fs4 = require_fs();
1078
+ var { checkPath } = require_utils();
1079
+ var getMode = (options) => {
1080
+ const defaults = { mode: 511 };
1081
+ if (typeof options === "number")
1082
+ return options;
1083
+ return { ...defaults, ...options }.mode;
1084
+ };
1085
+ module.exports.makeDir = async (dir, options) => {
1086
+ checkPath(dir);
1087
+ return fs4.mkdir(dir, {
1088
+ mode: getMode(options),
1089
+ recursive: true
1090
+ });
1091
+ };
1092
+ module.exports.makeDirSync = (dir, options) => {
1093
+ checkPath(dir);
1094
+ return fs4.mkdirSync(dir, {
1095
+ mode: getMode(options),
1096
+ recursive: true
1097
+ });
1098
+ };
1099
+ }
1100
+ });
1101
+
1102
+ // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/mkdirs/index.js
1103
+ var require_mkdirs = __commonJS({
1104
+ "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/mkdirs/index.js"(exports, module) {
1105
+ init_esm_shims();
1106
+ var u = require_universalify().fromPromise;
1107
+ var { makeDir: _makeDir, makeDirSync } = require_make_dir();
1108
+ var makeDir = u(_makeDir);
1109
+ module.exports = {
1110
+ mkdirs: makeDir,
1111
+ mkdirsSync: makeDirSync,
1112
+ // alias
1113
+ mkdirp: makeDir,
1114
+ mkdirpSync: makeDirSync,
1115
+ ensureDir: makeDir,
1116
+ ensureDirSync: makeDirSync
1117
+ };
1118
+ }
1119
+ });
1120
+
1121
+ // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/path-exists/index.js
1122
+ var require_path_exists = __commonJS({
1123
+ "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/path-exists/index.js"(exports, module) {
1124
+ init_esm_shims();
1125
+ var u = require_universalify().fromPromise;
1126
+ var fs4 = require_fs();
1127
+ function pathExists2(path5) {
1128
+ return fs4.access(path5).then(() => true).catch(() => false);
1129
+ }
1130
+ module.exports = {
1131
+ pathExists: u(pathExists2),
1132
+ pathExistsSync: fs4.existsSync
1133
+ };
1134
+ }
1135
+ });
1136
+
1137
+ // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/util/utimes.js
1138
+ var require_utimes = __commonJS({
1139
+ "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/util/utimes.js"(exports, module) {
1140
+ init_esm_shims();
1141
+ var fs4 = require_fs();
1142
+ var u = require_universalify().fromPromise;
1143
+ async function utimesMillis(path5, atime, mtime) {
1144
+ const fd = await fs4.open(path5, "r+");
1145
+ let closeErr = null;
1146
+ try {
1147
+ await fs4.futimes(fd, atime, mtime);
1148
+ } finally {
1149
+ try {
1150
+ await fs4.close(fd);
1151
+ } catch (e) {
1152
+ closeErr = e;
1153
+ }
1154
+ }
1155
+ if (closeErr) {
1156
+ throw closeErr;
1157
+ }
1158
+ }
1159
+ function utimesMillisSync(path5, atime, mtime) {
1160
+ const fd = fs4.openSync(path5, "r+");
1161
+ fs4.futimesSync(fd, atime, mtime);
1162
+ return fs4.closeSync(fd);
1163
+ }
1164
+ module.exports = {
1165
+ utimesMillis: u(utimesMillis),
1166
+ utimesMillisSync
1167
+ };
1168
+ }
1169
+ });
1170
+
1171
+ // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/util/stat.js
1172
+ var require_stat = __commonJS({
1173
+ "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/util/stat.js"(exports, module) {
1174
+ init_esm_shims();
1175
+ var fs4 = require_fs();
1176
+ var path5 = __require("path");
1177
+ var u = require_universalify().fromPromise;
1178
+ function getStats(src, dest, opts) {
1179
+ const statFunc = opts.dereference ? (file) => fs4.stat(file, { bigint: true }) : (file) => fs4.lstat(file, { bigint: true });
1180
+ return Promise.all([
1181
+ statFunc(src),
1182
+ statFunc(dest).catch((err) => {
1183
+ if (err.code === "ENOENT")
1184
+ return null;
1185
+ throw err;
1186
+ })
1187
+ ]).then(([srcStat, destStat]) => ({ srcStat, destStat }));
1188
+ }
1189
+ function getStatsSync(src, dest, opts) {
1190
+ let destStat;
1191
+ const statFunc = opts.dereference ? (file) => fs4.statSync(file, { bigint: true }) : (file) => fs4.lstatSync(file, { bigint: true });
1192
+ const srcStat = statFunc(src);
1193
+ try {
1194
+ destStat = statFunc(dest);
1195
+ } catch (err) {
1196
+ if (err.code === "ENOENT")
1197
+ return { srcStat, destStat: null };
1198
+ throw err;
1199
+ }
1200
+ return { srcStat, destStat };
1201
+ }
1202
+ async function checkPaths(src, dest, funcName, opts) {
1203
+ const { srcStat, destStat } = await getStats(src, dest, opts);
1204
+ if (destStat) {
1205
+ if (areIdentical(srcStat, destStat)) {
1206
+ const srcBaseName = path5.basename(src);
1207
+ const destBaseName = path5.basename(dest);
1208
+ if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
1209
+ return { srcStat, destStat, isChangingCase: true };
1210
+ }
1211
+ throw new Error("Source and destination must not be the same.");
1212
+ }
1213
+ if (srcStat.isDirectory() && !destStat.isDirectory()) {
1214
+ throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`);
1215
+ }
1216
+ if (!srcStat.isDirectory() && destStat.isDirectory()) {
1217
+ throw new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`);
1218
+ }
1219
+ }
1220
+ if (srcStat.isDirectory() && isSrcSubdir(src, dest)) {
1221
+ throw new Error(errMsg(src, dest, funcName));
1222
+ }
1223
+ return { srcStat, destStat };
1224
+ }
1225
+ function checkPathsSync(src, dest, funcName, opts) {
1226
+ const { srcStat, destStat } = getStatsSync(src, dest, opts);
1227
+ if (destStat) {
1228
+ if (areIdentical(srcStat, destStat)) {
1229
+ const srcBaseName = path5.basename(src);
1230
+ const destBaseName = path5.basename(dest);
1231
+ if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
1232
+ return { srcStat, destStat, isChangingCase: true };
1233
+ }
1234
+ throw new Error("Source and destination must not be the same.");
1235
+ }
1236
+ if (srcStat.isDirectory() && !destStat.isDirectory()) {
1237
+ throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`);
1238
+ }
1239
+ if (!srcStat.isDirectory() && destStat.isDirectory()) {
1240
+ throw new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`);
1241
+ }
1242
+ }
1243
+ if (srcStat.isDirectory() && isSrcSubdir(src, dest)) {
1244
+ throw new Error(errMsg(src, dest, funcName));
1245
+ }
1246
+ return { srcStat, destStat };
1247
+ }
1248
+ async function checkParentPaths(src, srcStat, dest, funcName) {
1249
+ const srcParent = path5.resolve(path5.dirname(src));
1250
+ const destParent = path5.resolve(path5.dirname(dest));
1251
+ if (destParent === srcParent || destParent === path5.parse(destParent).root)
1252
+ return;
1253
+ let destStat;
1254
+ try {
1255
+ destStat = await fs4.stat(destParent, { bigint: true });
1256
+ } catch (err) {
1257
+ if (err.code === "ENOENT")
1258
+ return;
1259
+ throw err;
1260
+ }
1261
+ if (areIdentical(srcStat, destStat)) {
1262
+ throw new Error(errMsg(src, dest, funcName));
1263
+ }
1264
+ return checkParentPaths(src, srcStat, destParent, funcName);
1265
+ }
1266
+ function checkParentPathsSync(src, srcStat, dest, funcName) {
1267
+ const srcParent = path5.resolve(path5.dirname(src));
1268
+ const destParent = path5.resolve(path5.dirname(dest));
1269
+ if (destParent === srcParent || destParent === path5.parse(destParent).root)
1270
+ return;
1271
+ let destStat;
1272
+ try {
1273
+ destStat = fs4.statSync(destParent, { bigint: true });
1274
+ } catch (err) {
1275
+ if (err.code === "ENOENT")
1276
+ return;
1277
+ throw err;
1278
+ }
1279
+ if (areIdentical(srcStat, destStat)) {
1280
+ throw new Error(errMsg(src, dest, funcName));
1281
+ }
1282
+ return checkParentPathsSync(src, srcStat, destParent, funcName);
1283
+ }
1284
+ function areIdentical(srcStat, destStat) {
1285
+ return destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev;
1286
+ }
1287
+ function isSrcSubdir(src, dest) {
1288
+ const srcArr = path5.resolve(src).split(path5.sep).filter((i) => i);
1289
+ const destArr = path5.resolve(dest).split(path5.sep).filter((i) => i);
1290
+ return srcArr.every((cur, i) => destArr[i] === cur);
1291
+ }
1292
+ function errMsg(src, dest, funcName) {
1293
+ return `Cannot ${funcName} '${src}' to a subdirectory of itself, '${dest}'.`;
1294
+ }
1295
+ module.exports = {
1296
+ // checkPaths
1297
+ checkPaths: u(checkPaths),
1298
+ checkPathsSync,
1299
+ // checkParent
1300
+ checkParentPaths: u(checkParentPaths),
1301
+ checkParentPathsSync,
1302
+ // Misc
1303
+ isSrcSubdir,
1304
+ areIdentical
1305
+ };
1306
+ }
1307
+ });
1308
+
1309
+ // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/copy/copy.js
1310
+ var require_copy = __commonJS({
1311
+ "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/copy/copy.js"(exports, module) {
1312
+ init_esm_shims();
1313
+ var fs4 = require_fs();
1314
+ var path5 = __require("path");
1315
+ var { mkdirs } = require_mkdirs();
1316
+ var { pathExists: pathExists2 } = require_path_exists();
1317
+ var { utimesMillis } = require_utimes();
1318
+ var stat = require_stat();
1319
+ async function copy(src, dest, opts = {}) {
1320
+ if (typeof opts === "function") {
1321
+ opts = { filter: opts };
1322
+ }
1323
+ opts.clobber = "clobber" in opts ? !!opts.clobber : true;
1324
+ opts.overwrite = "overwrite" in opts ? !!opts.overwrite : opts.clobber;
1325
+ if (opts.preserveTimestamps && process.arch === "ia32") {
1326
+ process.emitWarning(
1327
+ "Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269",
1328
+ "Warning",
1329
+ "fs-extra-WARN0001"
1330
+ );
1331
+ }
1332
+ const { srcStat, destStat } = await stat.checkPaths(src, dest, "copy", opts);
1333
+ await stat.checkParentPaths(src, srcStat, dest, "copy");
1334
+ const include = await runFilter(src, dest, opts);
1335
+ if (!include)
1336
+ return;
1337
+ const destParent = path5.dirname(dest);
1338
+ const dirExists = await pathExists2(destParent);
1339
+ if (!dirExists) {
1340
+ await mkdirs(destParent);
1341
+ }
1342
+ await getStatsAndPerformCopy(destStat, src, dest, opts);
1343
+ }
1344
+ async function runFilter(src, dest, opts) {
1345
+ if (!opts.filter)
1346
+ return true;
1347
+ return opts.filter(src, dest);
1348
+ }
1349
+ async function getStatsAndPerformCopy(destStat, src, dest, opts) {
1350
+ const statFn = opts.dereference ? fs4.stat : fs4.lstat;
1351
+ const srcStat = await statFn(src);
1352
+ if (srcStat.isDirectory())
1353
+ return onDir(srcStat, destStat, src, dest, opts);
1354
+ if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice())
1355
+ return onFile(srcStat, destStat, src, dest, opts);
1356
+ if (srcStat.isSymbolicLink())
1357
+ return onLink(destStat, src, dest, opts);
1358
+ if (srcStat.isSocket())
1359
+ throw new Error(`Cannot copy a socket file: ${src}`);
1360
+ if (srcStat.isFIFO())
1361
+ throw new Error(`Cannot copy a FIFO pipe: ${src}`);
1362
+ throw new Error(`Unknown file: ${src}`);
1363
+ }
1364
+ async function onFile(srcStat, destStat, src, dest, opts) {
1365
+ if (!destStat)
1366
+ return copyFile(srcStat, src, dest, opts);
1367
+ if (opts.overwrite) {
1368
+ await fs4.unlink(dest);
1369
+ return copyFile(srcStat, src, dest, opts);
1370
+ }
1371
+ if (opts.errorOnExist) {
1372
+ throw new Error(`'${dest}' already exists`);
1373
+ }
1374
+ }
1375
+ async function copyFile(srcStat, src, dest, opts) {
1376
+ await fs4.copyFile(src, dest);
1377
+ if (opts.preserveTimestamps) {
1378
+ if (fileIsNotWritable(srcStat.mode)) {
1379
+ await makeFileWritable(dest, srcStat.mode);
1380
+ }
1381
+ const updatedSrcStat = await fs4.stat(src);
1382
+ await utimesMillis(dest, updatedSrcStat.atime, updatedSrcStat.mtime);
1383
+ }
1384
+ return fs4.chmod(dest, srcStat.mode);
1385
+ }
1386
+ function fileIsNotWritable(srcMode) {
1387
+ return (srcMode & 128) === 0;
1388
+ }
1389
+ function makeFileWritable(dest, srcMode) {
1390
+ return fs4.chmod(dest, srcMode | 128);
1391
+ }
1392
+ async function onDir(srcStat, destStat, src, dest, opts) {
1393
+ if (!destStat) {
1394
+ await fs4.mkdir(dest);
1395
+ }
1396
+ const items = await fs4.readdir(src);
1397
+ await Promise.all(items.map(async (item) => {
1398
+ const srcItem = path5.join(src, item);
1399
+ const destItem = path5.join(dest, item);
1400
+ const include = await runFilter(srcItem, destItem, opts);
1401
+ if (!include)
1402
+ return;
1403
+ const { destStat: destStat2 } = await stat.checkPaths(srcItem, destItem, "copy", opts);
1404
+ return getStatsAndPerformCopy(destStat2, srcItem, destItem, opts);
1405
+ }));
1406
+ if (!destStat) {
1407
+ await fs4.chmod(dest, srcStat.mode);
1408
+ }
1409
+ }
1410
+ async function onLink(destStat, src, dest, opts) {
1411
+ let resolvedSrc = await fs4.readlink(src);
1412
+ if (opts.dereference) {
1413
+ resolvedSrc = path5.resolve(process.cwd(), resolvedSrc);
1414
+ }
1415
+ if (!destStat) {
1416
+ return fs4.symlink(resolvedSrc, dest);
1417
+ }
1418
+ let resolvedDest = null;
1419
+ try {
1420
+ resolvedDest = await fs4.readlink(dest);
1421
+ } catch (e) {
1422
+ if (e.code === "EINVAL" || e.code === "UNKNOWN")
1423
+ return fs4.symlink(resolvedSrc, dest);
1424
+ throw e;
1425
+ }
1426
+ if (opts.dereference) {
1427
+ resolvedDest = path5.resolve(process.cwd(), resolvedDest);
1428
+ }
1429
+ if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
1430
+ throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`);
1431
+ }
1432
+ if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) {
1433
+ throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`);
1434
+ }
1435
+ await fs4.unlink(dest);
1436
+ return fs4.symlink(resolvedSrc, dest);
1437
+ }
1438
+ module.exports = copy;
1439
+ }
1440
+ });
1441
+
1442
+ // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/copy/copy-sync.js
1443
+ var require_copy_sync = __commonJS({
1444
+ "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/copy/copy-sync.js"(exports, module) {
1445
+ init_esm_shims();
1446
+ var fs4 = require_graceful_fs();
1447
+ var path5 = __require("path");
1448
+ var mkdirsSync = require_mkdirs().mkdirsSync;
1449
+ var utimesMillisSync = require_utimes().utimesMillisSync;
1450
+ var stat = require_stat();
1451
+ function copySync(src, dest, opts) {
1452
+ if (typeof opts === "function") {
1453
+ opts = { filter: opts };
1454
+ }
1455
+ opts = opts || {};
1456
+ opts.clobber = "clobber" in opts ? !!opts.clobber : true;
1457
+ opts.overwrite = "overwrite" in opts ? !!opts.overwrite : opts.clobber;
1458
+ if (opts.preserveTimestamps && process.arch === "ia32") {
1459
+ process.emitWarning(
1460
+ "Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269",
1461
+ "Warning",
1462
+ "fs-extra-WARN0002"
1463
+ );
1464
+ }
1465
+ const { srcStat, destStat } = stat.checkPathsSync(src, dest, "copy", opts);
1466
+ stat.checkParentPathsSync(src, srcStat, dest, "copy");
1467
+ if (opts.filter && !opts.filter(src, dest))
1468
+ return;
1469
+ const destParent = path5.dirname(dest);
1470
+ if (!fs4.existsSync(destParent))
1471
+ mkdirsSync(destParent);
1472
+ return getStats(destStat, src, dest, opts);
1473
+ }
1474
+ function getStats(destStat, src, dest, opts) {
1475
+ const statSync = opts.dereference ? fs4.statSync : fs4.lstatSync;
1476
+ const srcStat = statSync(src);
1477
+ if (srcStat.isDirectory())
1478
+ return onDir(srcStat, destStat, src, dest, opts);
1479
+ else if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice())
1480
+ return onFile(srcStat, destStat, src, dest, opts);
1481
+ else if (srcStat.isSymbolicLink())
1482
+ return onLink(destStat, src, dest, opts);
1483
+ else if (srcStat.isSocket())
1484
+ throw new Error(`Cannot copy a socket file: ${src}`);
1485
+ else if (srcStat.isFIFO())
1486
+ throw new Error(`Cannot copy a FIFO pipe: ${src}`);
1487
+ throw new Error(`Unknown file: ${src}`);
1488
+ }
1489
+ function onFile(srcStat, destStat, src, dest, opts) {
1490
+ if (!destStat)
1491
+ return copyFile(srcStat, src, dest, opts);
1492
+ return mayCopyFile(srcStat, src, dest, opts);
1493
+ }
1494
+ function mayCopyFile(srcStat, src, dest, opts) {
1495
+ if (opts.overwrite) {
1496
+ fs4.unlinkSync(dest);
1497
+ return copyFile(srcStat, src, dest, opts);
1498
+ } else if (opts.errorOnExist) {
1499
+ throw new Error(`'${dest}' already exists`);
1500
+ }
1501
+ }
1502
+ function copyFile(srcStat, src, dest, opts) {
1503
+ fs4.copyFileSync(src, dest);
1504
+ if (opts.preserveTimestamps)
1505
+ handleTimestamps(srcStat.mode, src, dest);
1506
+ return setDestMode(dest, srcStat.mode);
1507
+ }
1508
+ function handleTimestamps(srcMode, src, dest) {
1509
+ if (fileIsNotWritable(srcMode))
1510
+ makeFileWritable(dest, srcMode);
1511
+ return setDestTimestamps(src, dest);
1512
+ }
1513
+ function fileIsNotWritable(srcMode) {
1514
+ return (srcMode & 128) === 0;
1515
+ }
1516
+ function makeFileWritable(dest, srcMode) {
1517
+ return setDestMode(dest, srcMode | 128);
1518
+ }
1519
+ function setDestMode(dest, srcMode) {
1520
+ return fs4.chmodSync(dest, srcMode);
1521
+ }
1522
+ function setDestTimestamps(src, dest) {
1523
+ const updatedSrcStat = fs4.statSync(src);
1524
+ return utimesMillisSync(dest, updatedSrcStat.atime, updatedSrcStat.mtime);
1525
+ }
1526
+ function onDir(srcStat, destStat, src, dest, opts) {
1527
+ if (!destStat)
1528
+ return mkDirAndCopy(srcStat.mode, src, dest, opts);
1529
+ return copyDir(src, dest, opts);
1530
+ }
1531
+ function mkDirAndCopy(srcMode, src, dest, opts) {
1532
+ fs4.mkdirSync(dest);
1533
+ copyDir(src, dest, opts);
1534
+ return setDestMode(dest, srcMode);
1535
+ }
1536
+ function copyDir(src, dest, opts) {
1537
+ fs4.readdirSync(src).forEach((item) => copyDirItem(item, src, dest, opts));
1538
+ }
1539
+ function copyDirItem(item, src, dest, opts) {
1540
+ const srcItem = path5.join(src, item);
1541
+ const destItem = path5.join(dest, item);
1542
+ if (opts.filter && !opts.filter(srcItem, destItem))
1543
+ return;
1544
+ const { destStat } = stat.checkPathsSync(srcItem, destItem, "copy", opts);
1545
+ return getStats(destStat, srcItem, destItem, opts);
1546
+ }
1547
+ function onLink(destStat, src, dest, opts) {
1548
+ let resolvedSrc = fs4.readlinkSync(src);
1549
+ if (opts.dereference) {
1550
+ resolvedSrc = path5.resolve(process.cwd(), resolvedSrc);
1551
+ }
1552
+ if (!destStat) {
1553
+ return fs4.symlinkSync(resolvedSrc, dest);
1554
+ } else {
1555
+ let resolvedDest;
1556
+ try {
1557
+ resolvedDest = fs4.readlinkSync(dest);
1558
+ } catch (err) {
1559
+ if (err.code === "EINVAL" || err.code === "UNKNOWN")
1560
+ return fs4.symlinkSync(resolvedSrc, dest);
1561
+ throw err;
1562
+ }
1563
+ if (opts.dereference) {
1564
+ resolvedDest = path5.resolve(process.cwd(), resolvedDest);
1565
+ }
1566
+ if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
1567
+ throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`);
1568
+ }
1569
+ if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) {
1570
+ throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`);
1571
+ }
1572
+ return copyLink(resolvedSrc, dest);
1573
+ }
1574
+ }
1575
+ function copyLink(resolvedSrc, dest) {
1576
+ fs4.unlinkSync(dest);
1577
+ return fs4.symlinkSync(resolvedSrc, dest);
1578
+ }
1579
+ module.exports = copySync;
1580
+ }
1581
+ });
1582
+
1583
+ // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/copy/index.js
1584
+ var require_copy2 = __commonJS({
1585
+ "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/copy/index.js"(exports, module) {
1586
+ init_esm_shims();
1587
+ var u = require_universalify().fromPromise;
1588
+ module.exports = {
1589
+ copy: u(require_copy()),
1590
+ copySync: require_copy_sync()
1591
+ };
1592
+ }
1593
+ });
1594
+
1595
+ // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/remove/index.js
1596
+ var require_remove = __commonJS({
1597
+ "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/remove/index.js"(exports, module) {
1598
+ init_esm_shims();
1599
+ var fs4 = require_graceful_fs();
1600
+ var u = require_universalify().fromCallback;
1601
+ function remove2(path5, callback) {
1602
+ fs4.rm(path5, { recursive: true, force: true }, callback);
1603
+ }
1604
+ function removeSync(path5) {
1605
+ fs4.rmSync(path5, { recursive: true, force: true });
1606
+ }
1607
+ module.exports = {
1608
+ remove: u(remove2),
1609
+ removeSync
1610
+ };
1611
+ }
1612
+ });
1613
+
1614
+ // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/empty/index.js
1615
+ var require_empty = __commonJS({
1616
+ "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/empty/index.js"(exports, module) {
1617
+ init_esm_shims();
1618
+ var u = require_universalify().fromPromise;
1619
+ var fs4 = require_fs();
1620
+ var path5 = __require("path");
1621
+ var mkdir = require_mkdirs();
1622
+ var remove2 = require_remove();
1623
+ var emptyDir = u(async function emptyDir2(dir) {
1624
+ let items;
1625
+ try {
1626
+ items = await fs4.readdir(dir);
1627
+ } catch {
1628
+ return mkdir.mkdirs(dir);
1629
+ }
1630
+ return Promise.all(items.map((item) => remove2.remove(path5.join(dir, item))));
1631
+ });
1632
+ function emptyDirSync(dir) {
1633
+ let items;
1634
+ try {
1635
+ items = fs4.readdirSync(dir);
1636
+ } catch {
1637
+ return mkdir.mkdirsSync(dir);
1638
+ }
1639
+ items.forEach((item) => {
1640
+ item = path5.join(dir, item);
1641
+ remove2.removeSync(item);
1642
+ });
1643
+ }
1644
+ module.exports = {
1645
+ emptyDirSync,
1646
+ emptydirSync: emptyDirSync,
1647
+ emptyDir,
1648
+ emptydir: emptyDir
1649
+ };
1650
+ }
1651
+ });
1652
+
1653
+ // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/file.js
1654
+ var require_file = __commonJS({
1655
+ "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/file.js"(exports, module) {
1656
+ init_esm_shims();
1657
+ var u = require_universalify().fromPromise;
1658
+ var path5 = __require("path");
1659
+ var fs4 = require_fs();
1660
+ var mkdir = require_mkdirs();
1661
+ async function createFile(file) {
1662
+ let stats;
1663
+ try {
1664
+ stats = await fs4.stat(file);
1665
+ } catch {
1666
+ }
1667
+ if (stats && stats.isFile())
1668
+ return;
1669
+ const dir = path5.dirname(file);
1670
+ let dirStats = null;
1671
+ try {
1672
+ dirStats = await fs4.stat(dir);
1673
+ } catch (err) {
1674
+ if (err.code === "ENOENT") {
1675
+ await mkdir.mkdirs(dir);
1676
+ await fs4.writeFile(file, "");
1677
+ return;
1678
+ } else {
1679
+ throw err;
1680
+ }
1681
+ }
1682
+ if (dirStats.isDirectory()) {
1683
+ await fs4.writeFile(file, "");
1684
+ } else {
1685
+ await fs4.readdir(dir);
1686
+ }
1687
+ }
1688
+ function createFileSync(file) {
1689
+ let stats;
1690
+ try {
1691
+ stats = fs4.statSync(file);
1692
+ } catch {
1693
+ }
1694
+ if (stats && stats.isFile())
1695
+ return;
1696
+ const dir = path5.dirname(file);
1697
+ try {
1698
+ if (!fs4.statSync(dir).isDirectory()) {
1699
+ fs4.readdirSync(dir);
1700
+ }
1701
+ } catch (err) {
1702
+ if (err && err.code === "ENOENT")
1703
+ mkdir.mkdirsSync(dir);
1704
+ else
1705
+ throw err;
1706
+ }
1707
+ fs4.writeFileSync(file, "");
1708
+ }
1709
+ module.exports = {
1710
+ createFile: u(createFile),
1711
+ createFileSync
1712
+ };
1713
+ }
1714
+ });
1715
+
1716
+ // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/link.js
1717
+ var require_link = __commonJS({
1718
+ "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/link.js"(exports, module) {
1719
+ init_esm_shims();
1720
+ var u = require_universalify().fromPromise;
1721
+ var path5 = __require("path");
1722
+ var fs4 = require_fs();
1723
+ var mkdir = require_mkdirs();
1724
+ var { pathExists: pathExists2 } = require_path_exists();
1725
+ var { areIdentical } = require_stat();
1726
+ async function createLink(srcpath, dstpath) {
1727
+ let dstStat;
1728
+ try {
1729
+ dstStat = await fs4.lstat(dstpath);
1730
+ } catch {
1731
+ }
1732
+ let srcStat;
1733
+ try {
1734
+ srcStat = await fs4.lstat(srcpath);
1735
+ } catch (err) {
1736
+ err.message = err.message.replace("lstat", "ensureLink");
1737
+ throw err;
1738
+ }
1739
+ if (dstStat && areIdentical(srcStat, dstStat))
1740
+ return;
1741
+ const dir = path5.dirname(dstpath);
1742
+ const dirExists = await pathExists2(dir);
1743
+ if (!dirExists) {
1744
+ await mkdir.mkdirs(dir);
1745
+ }
1746
+ await fs4.link(srcpath, dstpath);
1747
+ }
1748
+ function createLinkSync(srcpath, dstpath) {
1749
+ let dstStat;
1750
+ try {
1751
+ dstStat = fs4.lstatSync(dstpath);
1752
+ } catch {
1753
+ }
1754
+ try {
1755
+ const srcStat = fs4.lstatSync(srcpath);
1756
+ if (dstStat && areIdentical(srcStat, dstStat))
1757
+ return;
1758
+ } catch (err) {
1759
+ err.message = err.message.replace("lstat", "ensureLink");
1760
+ throw err;
1761
+ }
1762
+ const dir = path5.dirname(dstpath);
1763
+ const dirExists = fs4.existsSync(dir);
1764
+ if (dirExists)
1765
+ return fs4.linkSync(srcpath, dstpath);
1766
+ mkdir.mkdirsSync(dir);
1767
+ return fs4.linkSync(srcpath, dstpath);
1768
+ }
1769
+ module.exports = {
1770
+ createLink: u(createLink),
1771
+ createLinkSync
1772
+ };
1773
+ }
1774
+ });
1775
+
1776
+ // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/symlink-paths.js
1777
+ var require_symlink_paths = __commonJS({
1778
+ "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/symlink-paths.js"(exports, module) {
1779
+ init_esm_shims();
1780
+ var path5 = __require("path");
1781
+ var fs4 = require_fs();
1782
+ var { pathExists: pathExists2 } = require_path_exists();
1783
+ var u = require_universalify().fromPromise;
1784
+ async function symlinkPaths(srcpath, dstpath) {
1785
+ if (path5.isAbsolute(srcpath)) {
1786
+ try {
1787
+ await fs4.lstat(srcpath);
1788
+ } catch (err) {
1789
+ err.message = err.message.replace("lstat", "ensureSymlink");
1790
+ throw err;
1791
+ }
1792
+ return {
1793
+ toCwd: srcpath,
1794
+ toDst: srcpath
1795
+ };
1796
+ }
1797
+ const dstdir = path5.dirname(dstpath);
1798
+ const relativeToDst = path5.join(dstdir, srcpath);
1799
+ const exists = await pathExists2(relativeToDst);
1800
+ if (exists) {
1801
+ return {
1802
+ toCwd: relativeToDst,
1803
+ toDst: srcpath
1804
+ };
1805
+ }
1806
+ try {
1807
+ await fs4.lstat(srcpath);
1808
+ } catch (err) {
1809
+ err.message = err.message.replace("lstat", "ensureSymlink");
1810
+ throw err;
1811
+ }
1812
+ return {
1813
+ toCwd: srcpath,
1814
+ toDst: path5.relative(dstdir, srcpath)
1815
+ };
1816
+ }
1817
+ function symlinkPathsSync(srcpath, dstpath) {
1818
+ if (path5.isAbsolute(srcpath)) {
1819
+ const exists2 = fs4.existsSync(srcpath);
1820
+ if (!exists2)
1821
+ throw new Error("absolute srcpath does not exist");
1822
+ return {
1823
+ toCwd: srcpath,
1824
+ toDst: srcpath
1825
+ };
1826
+ }
1827
+ const dstdir = path5.dirname(dstpath);
1828
+ const relativeToDst = path5.join(dstdir, srcpath);
1829
+ const exists = fs4.existsSync(relativeToDst);
1830
+ if (exists) {
1831
+ return {
1832
+ toCwd: relativeToDst,
1833
+ toDst: srcpath
1834
+ };
1835
+ }
1836
+ const srcExists = fs4.existsSync(srcpath);
1837
+ if (!srcExists)
1838
+ throw new Error("relative srcpath does not exist");
1839
+ return {
1840
+ toCwd: srcpath,
1841
+ toDst: path5.relative(dstdir, srcpath)
1842
+ };
1843
+ }
1844
+ module.exports = {
1845
+ symlinkPaths: u(symlinkPaths),
1846
+ symlinkPathsSync
1847
+ };
1848
+ }
1849
+ });
1850
+
1851
+ // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/symlink-type.js
1852
+ var require_symlink_type = __commonJS({
1853
+ "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/symlink-type.js"(exports, module) {
1854
+ init_esm_shims();
1855
+ var fs4 = require_fs();
1856
+ var u = require_universalify().fromPromise;
1857
+ async function symlinkType(srcpath, type) {
1858
+ if (type)
1859
+ return type;
1860
+ let stats;
1861
+ try {
1862
+ stats = await fs4.lstat(srcpath);
1863
+ } catch {
1864
+ return "file";
1865
+ }
1866
+ return stats && stats.isDirectory() ? "dir" : "file";
1867
+ }
1868
+ function symlinkTypeSync(srcpath, type) {
1869
+ if (type)
1870
+ return type;
1871
+ let stats;
1872
+ try {
1873
+ stats = fs4.lstatSync(srcpath);
1874
+ } catch {
1875
+ return "file";
1876
+ }
1877
+ return stats && stats.isDirectory() ? "dir" : "file";
1878
+ }
1879
+ module.exports = {
1880
+ symlinkType: u(symlinkType),
1881
+ symlinkTypeSync
1882
+ };
1883
+ }
1884
+ });
1885
+
1886
+ // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/symlink.js
1887
+ var require_symlink = __commonJS({
1888
+ "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/symlink.js"(exports, module) {
1889
+ init_esm_shims();
1890
+ var u = require_universalify().fromPromise;
1891
+ var path5 = __require("path");
1892
+ var fs4 = require_fs();
1893
+ var { mkdirs, mkdirsSync } = require_mkdirs();
1894
+ var { symlinkPaths, symlinkPathsSync } = require_symlink_paths();
1895
+ var { symlinkType, symlinkTypeSync } = require_symlink_type();
1896
+ var { pathExists: pathExists2 } = require_path_exists();
1897
+ var { areIdentical } = require_stat();
1898
+ async function createSymlink(srcpath, dstpath, type) {
1899
+ let stats;
1900
+ try {
1901
+ stats = await fs4.lstat(dstpath);
1902
+ } catch {
1903
+ }
1904
+ if (stats && stats.isSymbolicLink()) {
1905
+ const [srcStat, dstStat] = await Promise.all([
1906
+ fs4.stat(srcpath),
1907
+ fs4.stat(dstpath)
1908
+ ]);
1909
+ if (areIdentical(srcStat, dstStat))
1910
+ return;
1911
+ }
1912
+ const relative2 = await symlinkPaths(srcpath, dstpath);
1913
+ srcpath = relative2.toDst;
1914
+ const toType = await symlinkType(relative2.toCwd, type);
1915
+ const dir = path5.dirname(dstpath);
1916
+ if (!await pathExists2(dir)) {
1917
+ await mkdirs(dir);
1918
+ }
1919
+ return fs4.symlink(srcpath, dstpath, toType);
1920
+ }
1921
+ function createSymlinkSync(srcpath, dstpath, type) {
1922
+ let stats;
1923
+ try {
1924
+ stats = fs4.lstatSync(dstpath);
1925
+ } catch {
1926
+ }
1927
+ if (stats && stats.isSymbolicLink()) {
1928
+ const srcStat = fs4.statSync(srcpath);
1929
+ const dstStat = fs4.statSync(dstpath);
1930
+ if (areIdentical(srcStat, dstStat))
1931
+ return;
1932
+ }
1933
+ const relative2 = symlinkPathsSync(srcpath, dstpath);
1934
+ srcpath = relative2.toDst;
1935
+ type = symlinkTypeSync(relative2.toCwd, type);
1936
+ const dir = path5.dirname(dstpath);
1937
+ const exists = fs4.existsSync(dir);
1938
+ if (exists)
1939
+ return fs4.symlinkSync(srcpath, dstpath, type);
1940
+ mkdirsSync(dir);
1941
+ return fs4.symlinkSync(srcpath, dstpath, type);
1942
+ }
1943
+ module.exports = {
1944
+ createSymlink: u(createSymlink),
1945
+ createSymlinkSync
1946
+ };
1947
+ }
1948
+ });
1949
+
1950
+ // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/index.js
1951
+ var require_ensure = __commonJS({
1952
+ "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/index.js"(exports, module) {
1953
+ init_esm_shims();
1954
+ var { createFile, createFileSync } = require_file();
1955
+ var { createLink, createLinkSync } = require_link();
1956
+ var { createSymlink, createSymlinkSync } = require_symlink();
1957
+ module.exports = {
1958
+ // file
1959
+ createFile,
1960
+ createFileSync,
1961
+ ensureFile: createFile,
1962
+ ensureFileSync: createFileSync,
1963
+ // link
1964
+ createLink,
1965
+ createLinkSync,
1966
+ ensureLink: createLink,
1967
+ ensureLinkSync: createLinkSync,
1968
+ // symlink
1969
+ createSymlink,
1970
+ createSymlinkSync,
1971
+ ensureSymlink: createSymlink,
1972
+ ensureSymlinkSync: createSymlinkSync
1973
+ };
1974
+ }
1975
+ });
1976
+
1977
+ // ../../node_modules/.pnpm/jsonfile@6.1.0/node_modules/jsonfile/utils.js
1978
+ var require_utils2 = __commonJS({
1979
+ "../../node_modules/.pnpm/jsonfile@6.1.0/node_modules/jsonfile/utils.js"(exports, module) {
1980
+ init_esm_shims();
1981
+ function stringify(obj, { EOL = "\n", finalEOL = true, replacer = null, spaces } = {}) {
1982
+ const EOF = finalEOL ? EOL : "";
1983
+ const str = JSON.stringify(obj, replacer, spaces);
1984
+ return str.replace(/\n/g, EOL) + EOF;
1985
+ }
1986
+ function stripBom(content) {
1987
+ if (Buffer.isBuffer(content))
1988
+ content = content.toString("utf8");
1989
+ return content.replace(/^\uFEFF/, "");
1990
+ }
1991
+ module.exports = { stringify, stripBom };
1992
+ }
1993
+ });
1994
+
1995
+ // ../../node_modules/.pnpm/jsonfile@6.1.0/node_modules/jsonfile/index.js
1996
+ var require_jsonfile = __commonJS({
1997
+ "../../node_modules/.pnpm/jsonfile@6.1.0/node_modules/jsonfile/index.js"(exports, module) {
1998
+ init_esm_shims();
1999
+ var _fs;
2000
+ try {
2001
+ _fs = require_graceful_fs();
2002
+ } catch (_) {
2003
+ _fs = __require("fs");
2004
+ }
2005
+ var universalify = require_universalify();
2006
+ var { stringify, stripBom } = require_utils2();
2007
+ async function _readFile(file, options = {}) {
2008
+ if (typeof options === "string") {
2009
+ options = { encoding: options };
2010
+ }
2011
+ const fs4 = options.fs || _fs;
2012
+ const shouldThrow = "throws" in options ? options.throws : true;
2013
+ let data = await universalify.fromCallback(fs4.readFile)(file, options);
2014
+ data = stripBom(data);
2015
+ let obj;
2016
+ try {
2017
+ obj = JSON.parse(data, options ? options.reviver : null);
2018
+ } catch (err) {
2019
+ if (shouldThrow) {
2020
+ err.message = `${file}: ${err.message}`;
2021
+ throw err;
2022
+ } else {
2023
+ return null;
2024
+ }
2025
+ }
2026
+ return obj;
2027
+ }
2028
+ var readFile = universalify.fromPromise(_readFile);
2029
+ function readFileSync(file, options = {}) {
2030
+ if (typeof options === "string") {
2031
+ options = { encoding: options };
2032
+ }
2033
+ const fs4 = options.fs || _fs;
2034
+ const shouldThrow = "throws" in options ? options.throws : true;
2035
+ try {
2036
+ let content = fs4.readFileSync(file, options);
2037
+ content = stripBom(content);
2038
+ return JSON.parse(content, options.reviver);
2039
+ } catch (err) {
2040
+ if (shouldThrow) {
2041
+ err.message = `${file}: ${err.message}`;
2042
+ throw err;
2043
+ } else {
2044
+ return null;
2045
+ }
2046
+ }
2047
+ }
2048
+ async function _writeFile(file, obj, options = {}) {
2049
+ const fs4 = options.fs || _fs;
2050
+ const str = stringify(obj, options);
2051
+ await universalify.fromCallback(fs4.writeFile)(file, str, options);
2052
+ }
2053
+ var writeFile = universalify.fromPromise(_writeFile);
2054
+ function writeFileSync(file, obj, options = {}) {
2055
+ const fs4 = options.fs || _fs;
2056
+ const str = stringify(obj, options);
2057
+ return fs4.writeFileSync(file, str, options);
2058
+ }
2059
+ var jsonfile = {
2060
+ readFile,
2061
+ readFileSync,
2062
+ writeFile,
2063
+ writeFileSync
2064
+ };
2065
+ module.exports = jsonfile;
2066
+ }
2067
+ });
2068
+
2069
+ // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/json/jsonfile.js
2070
+ var require_jsonfile2 = __commonJS({
2071
+ "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/json/jsonfile.js"(exports, module) {
2072
+ init_esm_shims();
2073
+ var jsonFile = require_jsonfile();
2074
+ module.exports = {
2075
+ // jsonfile exports
2076
+ readJson: jsonFile.readFile,
2077
+ readJsonSync: jsonFile.readFileSync,
2078
+ writeJson: jsonFile.writeFile,
2079
+ writeJsonSync: jsonFile.writeFileSync
2080
+ };
2081
+ }
2082
+ });
2083
+
2084
+ // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/output-file/index.js
2085
+ var require_output_file = __commonJS({
2086
+ "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/output-file/index.js"(exports, module) {
2087
+ init_esm_shims();
2088
+ var u = require_universalify().fromPromise;
2089
+ var fs4 = require_fs();
2090
+ var path5 = __require("path");
2091
+ var mkdir = require_mkdirs();
2092
+ var pathExists2 = require_path_exists().pathExists;
2093
+ async function outputFile(file, data, encoding = "utf-8") {
2094
+ const dir = path5.dirname(file);
2095
+ if (!await pathExists2(dir)) {
2096
+ await mkdir.mkdirs(dir);
2097
+ }
2098
+ return fs4.writeFile(file, data, encoding);
2099
+ }
2100
+ function outputFileSync(file, ...args) {
2101
+ const dir = path5.dirname(file);
2102
+ if (!fs4.existsSync(dir)) {
2103
+ mkdir.mkdirsSync(dir);
2104
+ }
2105
+ fs4.writeFileSync(file, ...args);
2106
+ }
2107
+ module.exports = {
2108
+ outputFile: u(outputFile),
2109
+ outputFileSync
2110
+ };
2111
+ }
2112
+ });
2113
+
2114
+ // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/json/output-json.js
2115
+ var require_output_json = __commonJS({
2116
+ "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/json/output-json.js"(exports, module) {
2117
+ init_esm_shims();
2118
+ var { stringify } = require_utils2();
2119
+ var { outputFile } = require_output_file();
2120
+ async function outputJson(file, data, options = {}) {
2121
+ const str = stringify(data, options);
2122
+ await outputFile(file, str, options);
2123
+ }
2124
+ module.exports = outputJson;
2125
+ }
2126
+ });
2127
+
2128
+ // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/json/output-json-sync.js
2129
+ var require_output_json_sync = __commonJS({
2130
+ "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/json/output-json-sync.js"(exports, module) {
2131
+ init_esm_shims();
2132
+ var { stringify } = require_utils2();
2133
+ var { outputFileSync } = require_output_file();
2134
+ function outputJsonSync(file, data, options) {
2135
+ const str = stringify(data, options);
2136
+ outputFileSync(file, str, options);
2137
+ }
2138
+ module.exports = outputJsonSync;
2139
+ }
2140
+ });
2141
+
2142
+ // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/json/index.js
2143
+ var require_json = __commonJS({
2144
+ "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/json/index.js"(exports, module) {
2145
+ init_esm_shims();
2146
+ var u = require_universalify().fromPromise;
2147
+ var jsonFile = require_jsonfile2();
2148
+ jsonFile.outputJson = u(require_output_json());
2149
+ jsonFile.outputJsonSync = require_output_json_sync();
2150
+ jsonFile.outputJSON = jsonFile.outputJson;
2151
+ jsonFile.outputJSONSync = jsonFile.outputJsonSync;
2152
+ jsonFile.writeJSON = jsonFile.writeJson;
2153
+ jsonFile.writeJSONSync = jsonFile.writeJsonSync;
2154
+ jsonFile.readJSON = jsonFile.readJson;
2155
+ jsonFile.readJSONSync = jsonFile.readJsonSync;
2156
+ module.exports = jsonFile;
2157
+ }
2158
+ });
2159
+
2160
+ // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/move/move.js
2161
+ var require_move = __commonJS({
2162
+ "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/move/move.js"(exports, module) {
2163
+ init_esm_shims();
2164
+ var fs4 = require_fs();
2165
+ var path5 = __require("path");
2166
+ var { copy } = require_copy2();
2167
+ var { remove: remove2 } = require_remove();
2168
+ var { mkdirp } = require_mkdirs();
2169
+ var { pathExists: pathExists2 } = require_path_exists();
2170
+ var stat = require_stat();
2171
+ async function move(src, dest, opts = {}) {
2172
+ const overwrite = opts.overwrite || opts.clobber || false;
2173
+ const { srcStat, isChangingCase = false } = await stat.checkPaths(src, dest, "move", opts);
2174
+ await stat.checkParentPaths(src, srcStat, dest, "move");
2175
+ const destParent = path5.dirname(dest);
2176
+ const parsedParentPath = path5.parse(destParent);
2177
+ if (parsedParentPath.root !== destParent) {
2178
+ await mkdirp(destParent);
2179
+ }
2180
+ return doRename(src, dest, overwrite, isChangingCase);
2181
+ }
2182
+ async function doRename(src, dest, overwrite, isChangingCase) {
2183
+ if (!isChangingCase) {
2184
+ if (overwrite) {
2185
+ await remove2(dest);
2186
+ } else if (await pathExists2(dest)) {
2187
+ throw new Error("dest already exists.");
2188
+ }
2189
+ }
2190
+ try {
2191
+ await fs4.rename(src, dest);
2192
+ } catch (err) {
2193
+ if (err.code !== "EXDEV") {
2194
+ throw err;
2195
+ }
2196
+ await moveAcrossDevice(src, dest, overwrite);
2197
+ }
2198
+ }
2199
+ async function moveAcrossDevice(src, dest, overwrite) {
2200
+ const opts = {
2201
+ overwrite,
2202
+ errorOnExist: true,
2203
+ preserveTimestamps: true
2204
+ };
2205
+ await copy(src, dest, opts);
2206
+ return remove2(src);
2207
+ }
2208
+ module.exports = move;
2209
+ }
2210
+ });
2211
+
2212
+ // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/move/move-sync.js
2213
+ var require_move_sync = __commonJS({
2214
+ "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/move/move-sync.js"(exports, module) {
2215
+ init_esm_shims();
2216
+ var fs4 = require_graceful_fs();
2217
+ var path5 = __require("path");
2218
+ var copySync = require_copy2().copySync;
2219
+ var removeSync = require_remove().removeSync;
2220
+ var mkdirpSync = require_mkdirs().mkdirpSync;
2221
+ var stat = require_stat();
2222
+ function moveSync(src, dest, opts) {
2223
+ opts = opts || {};
2224
+ const overwrite = opts.overwrite || opts.clobber || false;
2225
+ const { srcStat, isChangingCase = false } = stat.checkPathsSync(src, dest, "move", opts);
2226
+ stat.checkParentPathsSync(src, srcStat, dest, "move");
2227
+ if (!isParentRoot(dest))
2228
+ mkdirpSync(path5.dirname(dest));
2229
+ return doRename(src, dest, overwrite, isChangingCase);
2230
+ }
2231
+ function isParentRoot(dest) {
2232
+ const parent = path5.dirname(dest);
2233
+ const parsedPath = path5.parse(parent);
2234
+ return parsedPath.root === parent;
2235
+ }
2236
+ function doRename(src, dest, overwrite, isChangingCase) {
2237
+ if (isChangingCase)
2238
+ return rename(src, dest, overwrite);
2239
+ if (overwrite) {
2240
+ removeSync(dest);
2241
+ return rename(src, dest, overwrite);
2242
+ }
2243
+ if (fs4.existsSync(dest))
2244
+ throw new Error("dest already exists.");
2245
+ return rename(src, dest, overwrite);
2246
+ }
2247
+ function rename(src, dest, overwrite) {
2248
+ try {
2249
+ fs4.renameSync(src, dest);
2250
+ } catch (err) {
2251
+ if (err.code !== "EXDEV")
2252
+ throw err;
2253
+ return moveAcrossDevice(src, dest, overwrite);
2254
+ }
2255
+ }
2256
+ function moveAcrossDevice(src, dest, overwrite) {
2257
+ const opts = {
2258
+ overwrite,
2259
+ errorOnExist: true,
2260
+ preserveTimestamps: true
2261
+ };
2262
+ copySync(src, dest, opts);
2263
+ return removeSync(src);
2264
+ }
2265
+ module.exports = moveSync;
2266
+ }
2267
+ });
2268
+
2269
+ // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/move/index.js
2270
+ var require_move2 = __commonJS({
2271
+ "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/move/index.js"(exports, module) {
2272
+ init_esm_shims();
2273
+ var u = require_universalify().fromPromise;
2274
+ module.exports = {
2275
+ move: u(require_move()),
2276
+ moveSync: require_move_sync()
2277
+ };
2278
+ }
2279
+ });
2280
+
2281
+ // ../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/index.js
2282
+ var require_lib = __commonJS({
2283
+ "../../node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/index.js"(exports, module) {
2284
+ init_esm_shims();
2285
+ module.exports = {
2286
+ // Export promiseified graceful-fs:
2287
+ ...require_fs(),
2288
+ // Export extra methods:
2289
+ ...require_copy2(),
2290
+ ...require_empty(),
2291
+ ...require_ensure(),
2292
+ ...require_json(),
2293
+ ...require_mkdirs(),
2294
+ ...require_move2(),
2295
+ ...require_output_file(),
2296
+ ...require_path_exists(),
2297
+ ...require_remove()
2298
+ };
2299
+ }
2300
+ });
2301
+
2302
+ // ../../node_modules/.pnpm/lodash.isequal@4.5.0/node_modules/lodash.isequal/index.js
2303
+ var require_lodash = __commonJS({
2304
+ "../../node_modules/.pnpm/lodash.isequal@4.5.0/node_modules/lodash.isequal/index.js"(exports, module) {
2305
+ init_esm_shims();
2306
+ var LARGE_ARRAY_SIZE = 200;
2307
+ var HASH_UNDEFINED = "__lodash_hash_undefined__";
2308
+ var COMPARE_PARTIAL_FLAG = 1;
2309
+ var COMPARE_UNORDERED_FLAG = 2;
2310
+ var MAX_SAFE_INTEGER = 9007199254740991;
2311
+ var argsTag = "[object Arguments]";
2312
+ var arrayTag = "[object Array]";
2313
+ var asyncTag = "[object AsyncFunction]";
2314
+ var boolTag = "[object Boolean]";
2315
+ var dateTag = "[object Date]";
2316
+ var errorTag = "[object Error]";
2317
+ var funcTag = "[object Function]";
2318
+ var genTag = "[object GeneratorFunction]";
2319
+ var mapTag = "[object Map]";
2320
+ var numberTag = "[object Number]";
2321
+ var nullTag = "[object Null]";
2322
+ var objectTag = "[object Object]";
2323
+ var promiseTag = "[object Promise]";
2324
+ var proxyTag = "[object Proxy]";
2325
+ var regexpTag = "[object RegExp]";
2326
+ var setTag = "[object Set]";
2327
+ var stringTag = "[object String]";
2328
+ var symbolTag = "[object Symbol]";
2329
+ var undefinedTag = "[object Undefined]";
2330
+ var weakMapTag = "[object WeakMap]";
2331
+ var arrayBufferTag = "[object ArrayBuffer]";
2332
+ var dataViewTag = "[object DataView]";
2333
+ var float32Tag = "[object Float32Array]";
2334
+ var float64Tag = "[object Float64Array]";
2335
+ var int8Tag = "[object Int8Array]";
2336
+ var int16Tag = "[object Int16Array]";
2337
+ var int32Tag = "[object Int32Array]";
2338
+ var uint8Tag = "[object Uint8Array]";
2339
+ var uint8ClampedTag = "[object Uint8ClampedArray]";
2340
+ var uint16Tag = "[object Uint16Array]";
2341
+ var uint32Tag = "[object Uint32Array]";
2342
+ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
2343
+ var reIsHostCtor = /^\[object .+?Constructor\]$/;
2344
+ var reIsUint = /^(?:0|[1-9]\d*)$/;
2345
+ var typedArrayTags = {};
2346
+ typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
2347
+ 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;
2348
+ var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
2349
+ var freeSelf = typeof self == "object" && self && self.Object === Object && self;
2350
+ var root = freeGlobal || freeSelf || Function("return this")();
2351
+ var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports;
2352
+ var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module;
2353
+ var moduleExports = freeModule && freeModule.exports === freeExports;
2354
+ var freeProcess = moduleExports && freeGlobal.process;
2355
+ var nodeUtil = function() {
2356
+ try {
2357
+ return freeProcess && freeProcess.binding && freeProcess.binding("util");
2358
+ } catch (e) {
2359
+ }
2360
+ }();
2361
+ var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
2362
+ function arrayFilter(array, predicate) {
2363
+ var index = -1, length = array == null ? 0 : array.length, resIndex = 0, result = [];
2364
+ while (++index < length) {
2365
+ var value = array[index];
2366
+ if (predicate(value, index, array)) {
2367
+ result[resIndex++] = value;
2368
+ }
2369
+ }
2370
+ return result;
2371
+ }
2372
+ function arrayPush(array, values) {
2373
+ var index = -1, length = values.length, offset = array.length;
2374
+ while (++index < length) {
2375
+ array[offset + index] = values[index];
2376
+ }
2377
+ return array;
2378
+ }
2379
+ function arraySome(array, predicate) {
2380
+ var index = -1, length = array == null ? 0 : array.length;
2381
+ while (++index < length) {
2382
+ if (predicate(array[index], index, array)) {
2383
+ return true;
2384
+ }
2385
+ }
2386
+ return false;
2387
+ }
2388
+ function baseTimes(n, iteratee) {
2389
+ var index = -1, result = Array(n);
2390
+ while (++index < n) {
2391
+ result[index] = iteratee(index);
2392
+ }
2393
+ return result;
2394
+ }
2395
+ function baseUnary(func) {
2396
+ return function(value) {
2397
+ return func(value);
2398
+ };
2399
+ }
2400
+ function cacheHas(cache, key) {
2401
+ return cache.has(key);
2402
+ }
2403
+ function getValue(object, key) {
2404
+ return object == null ? void 0 : object[key];
2405
+ }
2406
+ function mapToArray(map) {
2407
+ var index = -1, result = Array(map.size);
2408
+ map.forEach(function(value, key) {
2409
+ result[++index] = [key, value];
2410
+ });
2411
+ return result;
2412
+ }
2413
+ function overArg(func, transform) {
2414
+ return function(arg) {
2415
+ return func(transform(arg));
2416
+ };
2417
+ }
2418
+ function setToArray(set) {
2419
+ var index = -1, result = Array(set.size);
2420
+ set.forEach(function(value) {
2421
+ result[++index] = value;
2422
+ });
2423
+ return result;
2424
+ }
2425
+ var arrayProto = Array.prototype;
2426
+ var funcProto = Function.prototype;
2427
+ var objectProto = Object.prototype;
2428
+ var coreJsData = root["__core-js_shared__"];
2429
+ var funcToString = funcProto.toString;
2430
+ var hasOwnProperty = objectProto.hasOwnProperty;
2431
+ var maskSrcKey = function() {
2432
+ var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
2433
+ return uid ? "Symbol(src)_1." + uid : "";
2434
+ }();
2435
+ var nativeObjectToString = objectProto.toString;
2436
+ var reIsNative = RegExp(
2437
+ "^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
2438
+ );
2439
+ var Buffer2 = moduleExports ? root.Buffer : void 0;
2440
+ var Symbol2 = root.Symbol;
2441
+ var Uint8Array2 = root.Uint8Array;
2442
+ var propertyIsEnumerable = objectProto.propertyIsEnumerable;
2443
+ var splice = arrayProto.splice;
2444
+ var symToStringTag = Symbol2 ? Symbol2.toStringTag : void 0;
2445
+ var nativeGetSymbols = Object.getOwnPropertySymbols;
2446
+ var nativeIsBuffer = Buffer2 ? Buffer2.isBuffer : void 0;
2447
+ var nativeKeys = overArg(Object.keys, Object);
2448
+ var DataView = getNative(root, "DataView");
2449
+ var Map2 = getNative(root, "Map");
2450
+ var Promise2 = getNative(root, "Promise");
2451
+ var Set2 = getNative(root, "Set");
2452
+ var WeakMap2 = getNative(root, "WeakMap");
2453
+ var nativeCreate = getNative(Object, "create");
2454
+ var dataViewCtorString = toSource(DataView);
2455
+ var mapCtorString = toSource(Map2);
2456
+ var promiseCtorString = toSource(Promise2);
2457
+ var setCtorString = toSource(Set2);
2458
+ var weakMapCtorString = toSource(WeakMap2);
2459
+ var symbolProto = Symbol2 ? Symbol2.prototype : void 0;
2460
+ var symbolValueOf = symbolProto ? symbolProto.valueOf : void 0;
2461
+ function Hash(entries) {
2462
+ var index = -1, length = entries == null ? 0 : entries.length;
2463
+ this.clear();
2464
+ while (++index < length) {
2465
+ var entry = entries[index];
2466
+ this.set(entry[0], entry[1]);
2467
+ }
2468
+ }
2469
+ function hashClear() {
2470
+ this.__data__ = nativeCreate ? nativeCreate(null) : {};
2471
+ this.size = 0;
2472
+ }
2473
+ function hashDelete(key) {
2474
+ var result = this.has(key) && delete this.__data__[key];
2475
+ this.size -= result ? 1 : 0;
2476
+ return result;
2477
+ }
2478
+ function hashGet(key) {
2479
+ var data = this.__data__;
2480
+ if (nativeCreate) {
2481
+ var result = data[key];
2482
+ return result === HASH_UNDEFINED ? void 0 : result;
2483
+ }
2484
+ return hasOwnProperty.call(data, key) ? data[key] : void 0;
2485
+ }
2486
+ function hashHas(key) {
2487
+ var data = this.__data__;
2488
+ return nativeCreate ? data[key] !== void 0 : hasOwnProperty.call(data, key);
2489
+ }
2490
+ function hashSet(key, value) {
2491
+ var data = this.__data__;
2492
+ this.size += this.has(key) ? 0 : 1;
2493
+ data[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED : value;
2494
+ return this;
2495
+ }
2496
+ Hash.prototype.clear = hashClear;
2497
+ Hash.prototype["delete"] = hashDelete;
2498
+ Hash.prototype.get = hashGet;
2499
+ Hash.prototype.has = hashHas;
2500
+ Hash.prototype.set = hashSet;
2501
+ function ListCache(entries) {
2502
+ var index = -1, length = entries == null ? 0 : entries.length;
2503
+ this.clear();
2504
+ while (++index < length) {
2505
+ var entry = entries[index];
2506
+ this.set(entry[0], entry[1]);
2507
+ }
2508
+ }
2509
+ function listCacheClear() {
2510
+ this.__data__ = [];
2511
+ this.size = 0;
2512
+ }
2513
+ function listCacheDelete(key) {
2514
+ var data = this.__data__, index = assocIndexOf(data, key);
2515
+ if (index < 0) {
2516
+ return false;
2517
+ }
2518
+ var lastIndex = data.length - 1;
2519
+ if (index == lastIndex) {
2520
+ data.pop();
2521
+ } else {
2522
+ splice.call(data, index, 1);
2523
+ }
2524
+ --this.size;
2525
+ return true;
2526
+ }
2527
+ function listCacheGet(key) {
2528
+ var data = this.__data__, index = assocIndexOf(data, key);
2529
+ return index < 0 ? void 0 : data[index][1];
2530
+ }
2531
+ function listCacheHas(key) {
2532
+ return assocIndexOf(this.__data__, key) > -1;
2533
+ }
2534
+ function listCacheSet(key, value) {
2535
+ var data = this.__data__, index = assocIndexOf(data, key);
2536
+ if (index < 0) {
2537
+ ++this.size;
2538
+ data.push([key, value]);
2539
+ } else {
2540
+ data[index][1] = value;
2541
+ }
2542
+ return this;
2543
+ }
2544
+ ListCache.prototype.clear = listCacheClear;
2545
+ ListCache.prototype["delete"] = listCacheDelete;
2546
+ ListCache.prototype.get = listCacheGet;
2547
+ ListCache.prototype.has = listCacheHas;
2548
+ ListCache.prototype.set = listCacheSet;
2549
+ function MapCache(entries) {
2550
+ var index = -1, length = entries == null ? 0 : entries.length;
2551
+ this.clear();
2552
+ while (++index < length) {
2553
+ var entry = entries[index];
2554
+ this.set(entry[0], entry[1]);
2555
+ }
2556
+ }
2557
+ function mapCacheClear() {
2558
+ this.size = 0;
2559
+ this.__data__ = {
2560
+ "hash": new Hash(),
2561
+ "map": new (Map2 || ListCache)(),
2562
+ "string": new Hash()
2563
+ };
2564
+ }
2565
+ function mapCacheDelete(key) {
2566
+ var result = getMapData(this, key)["delete"](key);
2567
+ this.size -= result ? 1 : 0;
2568
+ return result;
2569
+ }
2570
+ function mapCacheGet(key) {
2571
+ return getMapData(this, key).get(key);
2572
+ }
2573
+ function mapCacheHas(key) {
2574
+ return getMapData(this, key).has(key);
2575
+ }
2576
+ function mapCacheSet(key, value) {
2577
+ var data = getMapData(this, key), size = data.size;
2578
+ data.set(key, value);
2579
+ this.size += data.size == size ? 0 : 1;
2580
+ return this;
2581
+ }
2582
+ MapCache.prototype.clear = mapCacheClear;
2583
+ MapCache.prototype["delete"] = mapCacheDelete;
2584
+ MapCache.prototype.get = mapCacheGet;
2585
+ MapCache.prototype.has = mapCacheHas;
2586
+ MapCache.prototype.set = mapCacheSet;
2587
+ function SetCache(values) {
2588
+ var index = -1, length = values == null ? 0 : values.length;
2589
+ this.__data__ = new MapCache();
2590
+ while (++index < length) {
2591
+ this.add(values[index]);
2592
+ }
2593
+ }
2594
+ function setCacheAdd(value) {
2595
+ this.__data__.set(value, HASH_UNDEFINED);
2596
+ return this;
2597
+ }
2598
+ function setCacheHas(value) {
2599
+ return this.__data__.has(value);
2600
+ }
2601
+ SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
2602
+ SetCache.prototype.has = setCacheHas;
2603
+ function Stack(entries) {
2604
+ var data = this.__data__ = new ListCache(entries);
2605
+ this.size = data.size;
2606
+ }
2607
+ function stackClear() {
2608
+ this.__data__ = new ListCache();
2609
+ this.size = 0;
2610
+ }
2611
+ function stackDelete(key) {
2612
+ var data = this.__data__, result = data["delete"](key);
2613
+ this.size = data.size;
2614
+ return result;
2615
+ }
2616
+ function stackGet(key) {
2617
+ return this.__data__.get(key);
2618
+ }
2619
+ function stackHas(key) {
2620
+ return this.__data__.has(key);
2621
+ }
2622
+ function stackSet(key, value) {
2623
+ var data = this.__data__;
2624
+ if (data instanceof ListCache) {
2625
+ var pairs = data.__data__;
2626
+ if (!Map2 || pairs.length < LARGE_ARRAY_SIZE - 1) {
2627
+ pairs.push([key, value]);
2628
+ this.size = ++data.size;
2629
+ return this;
2630
+ }
2631
+ data = this.__data__ = new MapCache(pairs);
2632
+ }
2633
+ data.set(key, value);
2634
+ this.size = data.size;
2635
+ return this;
2636
+ }
2637
+ Stack.prototype.clear = stackClear;
2638
+ Stack.prototype["delete"] = stackDelete;
2639
+ Stack.prototype.get = stackGet;
2640
+ Stack.prototype.has = stackHas;
2641
+ Stack.prototype.set = stackSet;
2642
+ function arrayLikeKeys(value, inherited) {
2643
+ 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;
2644
+ for (var key in value) {
2645
+ if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
2646
+ (key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
2647
+ isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
2648
+ isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties.
2649
+ isIndex(key, length)))) {
2650
+ result.push(key);
2651
+ }
2652
+ }
2653
+ return result;
2654
+ }
2655
+ function assocIndexOf(array, key) {
2656
+ var length = array.length;
2657
+ while (length--) {
2658
+ if (eq(array[length][0], key)) {
2659
+ return length;
2660
+ }
2661
+ }
2662
+ return -1;
2663
+ }
2664
+ function baseGetAllKeys(object, keysFunc, symbolsFunc) {
2665
+ var result = keysFunc(object);
2666
+ return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
2667
+ }
2668
+ function baseGetTag(value) {
2669
+ if (value == null) {
2670
+ return value === void 0 ? undefinedTag : nullTag;
2671
+ }
2672
+ return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
2673
+ }
2674
+ function baseIsArguments(value) {
2675
+ return isObjectLike(value) && baseGetTag(value) == argsTag;
2676
+ }
2677
+ function baseIsEqual(value, other, bitmask, customizer, stack) {
2678
+ if (value === other) {
2679
+ return true;
2680
+ }
2681
+ if (value == null || other == null || !isObjectLike(value) && !isObjectLike(other)) {
2682
+ return value !== value && other !== other;
2683
+ }
2684
+ return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
2685
+ }
2686
+ function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
2687
+ var objIsArr = isArray(object), othIsArr = isArray(other), objTag = objIsArr ? arrayTag : getTag(object), othTag = othIsArr ? arrayTag : getTag(other);
2688
+ objTag = objTag == argsTag ? objectTag : objTag;
2689
+ othTag = othTag == argsTag ? objectTag : othTag;
2690
+ var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag;
2691
+ if (isSameTag && isBuffer(object)) {
2692
+ if (!isBuffer(other)) {
2693
+ return false;
2694
+ }
2695
+ objIsArr = true;
2696
+ objIsObj = false;
2697
+ }
2698
+ if (isSameTag && !objIsObj) {
2699
+ stack || (stack = new Stack());
2700
+ return objIsArr || isTypedArray(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
2701
+ }
2702
+ if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
2703
+ var objIsWrapped = objIsObj && hasOwnProperty.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty.call(other, "__wrapped__");
2704
+ if (objIsWrapped || othIsWrapped) {
2705
+ var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other;
2706
+ stack || (stack = new Stack());
2707
+ return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
2708
+ }
2709
+ }
2710
+ if (!isSameTag) {
2711
+ return false;
2712
+ }
2713
+ stack || (stack = new Stack());
2714
+ return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
2715
+ }
2716
+ function baseIsNative(value) {
2717
+ if (!isObject(value) || isMasked(value)) {
2718
+ return false;
2719
+ }
2720
+ var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
2721
+ return pattern.test(toSource(value));
2722
+ }
2723
+ function baseIsTypedArray(value) {
2724
+ return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
2725
+ }
2726
+ function baseKeys(object) {
2727
+ if (!isPrototype(object)) {
2728
+ return nativeKeys(object);
2729
+ }
2730
+ var result = [];
2731
+ for (var key in Object(object)) {
2732
+ if (hasOwnProperty.call(object, key) && key != "constructor") {
2733
+ result.push(key);
2734
+ }
2735
+ }
2736
+ return result;
2737
+ }
2738
+ function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
2739
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG, arrLength = array.length, othLength = other.length;
2740
+ if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
2741
+ return false;
2742
+ }
2743
+ var stacked = stack.get(array);
2744
+ if (stacked && stack.get(other)) {
2745
+ return stacked == other;
2746
+ }
2747
+ var index = -1, result = true, seen = bitmask & COMPARE_UNORDERED_FLAG ? new SetCache() : void 0;
2748
+ stack.set(array, other);
2749
+ stack.set(other, array);
2750
+ while (++index < arrLength) {
2751
+ var arrValue = array[index], othValue = other[index];
2752
+ if (customizer) {
2753
+ var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack);
2754
+ }
2755
+ if (compared !== void 0) {
2756
+ if (compared) {
2757
+ continue;
2758
+ }
2759
+ result = false;
2760
+ break;
2761
+ }
2762
+ if (seen) {
2763
+ if (!arraySome(other, function(othValue2, othIndex) {
2764
+ if (!cacheHas(seen, othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, bitmask, customizer, stack))) {
2765
+ return seen.push(othIndex);
2766
+ }
2767
+ })) {
2768
+ result = false;
2769
+ break;
2770
+ }
2771
+ } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
2772
+ result = false;
2773
+ break;
2774
+ }
2775
+ }
2776
+ stack["delete"](array);
2777
+ stack["delete"](other);
2778
+ return result;
2779
+ }
2780
+ function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
2781
+ switch (tag) {
2782
+ case dataViewTag:
2783
+ if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) {
2784
+ return false;
2785
+ }
2786
+ object = object.buffer;
2787
+ other = other.buffer;
2788
+ case arrayBufferTag:
2789
+ if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array2(object), new Uint8Array2(other))) {
2790
+ return false;
2791
+ }
2792
+ return true;
2793
+ case boolTag:
2794
+ case dateTag:
2795
+ case numberTag:
2796
+ return eq(+object, +other);
2797
+ case errorTag:
2798
+ return object.name == other.name && object.message == other.message;
2799
+ case regexpTag:
2800
+ case stringTag:
2801
+ return object == other + "";
2802
+ case mapTag:
2803
+ var convert = mapToArray;
2804
+ case setTag:
2805
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
2806
+ convert || (convert = setToArray);
2807
+ if (object.size != other.size && !isPartial) {
2808
+ return false;
2809
+ }
2810
+ var stacked = stack.get(object);
2811
+ if (stacked) {
2812
+ return stacked == other;
2813
+ }
2814
+ bitmask |= COMPARE_UNORDERED_FLAG;
2815
+ stack.set(object, other);
2816
+ var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
2817
+ stack["delete"](object);
2818
+ return result;
2819
+ case symbolTag:
2820
+ if (symbolValueOf) {
2821
+ return symbolValueOf.call(object) == symbolValueOf.call(other);
2822
+ }
2823
+ }
2824
+ return false;
2825
+ }
2826
+ function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
2827
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG, objProps = getAllKeys(object), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length;
2828
+ if (objLength != othLength && !isPartial) {
2829
+ return false;
2830
+ }
2831
+ var index = objLength;
2832
+ while (index--) {
2833
+ var key = objProps[index];
2834
+ if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
2835
+ return false;
2836
+ }
2837
+ }
2838
+ var stacked = stack.get(object);
2839
+ if (stacked && stack.get(other)) {
2840
+ return stacked == other;
2841
+ }
2842
+ var result = true;
2843
+ stack.set(object, other);
2844
+ stack.set(other, object);
2845
+ var skipCtor = isPartial;
2846
+ while (++index < objLength) {
2847
+ key = objProps[index];
2848
+ var objValue = object[key], othValue = other[key];
2849
+ if (customizer) {
2850
+ var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack);
2851
+ }
2852
+ if (!(compared === void 0 ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) {
2853
+ result = false;
2854
+ break;
2855
+ }
2856
+ skipCtor || (skipCtor = key == "constructor");
2857
+ }
2858
+ if (result && !skipCtor) {
2859
+ var objCtor = object.constructor, othCtor = other.constructor;
2860
+ if (objCtor != othCtor && ("constructor" in object && "constructor" in other) && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) {
2861
+ result = false;
2862
+ }
2863
+ }
2864
+ stack["delete"](object);
2865
+ stack["delete"](other);
2866
+ return result;
2867
+ }
2868
+ function getAllKeys(object) {
2869
+ return baseGetAllKeys(object, keys, getSymbols);
2870
+ }
2871
+ function getMapData(map, key) {
2872
+ var data = map.__data__;
2873
+ return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
2874
+ }
2875
+ function getNative(object, key) {
2876
+ var value = getValue(object, key);
2877
+ return baseIsNative(value) ? value : void 0;
2878
+ }
2879
+ function getRawTag(value) {
2880
+ var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag];
2881
+ try {
2882
+ value[symToStringTag] = void 0;
2883
+ var unmasked = true;
2884
+ } catch (e) {
2885
+ }
2886
+ var result = nativeObjectToString.call(value);
2887
+ if (unmasked) {
2888
+ if (isOwn) {
2889
+ value[symToStringTag] = tag;
2890
+ } else {
2891
+ delete value[symToStringTag];
2892
+ }
2893
+ }
2894
+ return result;
2895
+ }
2896
+ var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
2897
+ if (object == null) {
2898
+ return [];
2899
+ }
2900
+ object = Object(object);
2901
+ return arrayFilter(nativeGetSymbols(object), function(symbol) {
2902
+ return propertyIsEnumerable.call(object, symbol);
2903
+ });
2904
+ };
2905
+ var getTag = baseGetTag;
2906
+ 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) {
2907
+ getTag = function(value) {
2908
+ var result = baseGetTag(value), Ctor = result == objectTag ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : "";
2909
+ if (ctorString) {
2910
+ switch (ctorString) {
2911
+ case dataViewCtorString:
2912
+ return dataViewTag;
2913
+ case mapCtorString:
2914
+ return mapTag;
2915
+ case promiseCtorString:
2916
+ return promiseTag;
2917
+ case setCtorString:
2918
+ return setTag;
2919
+ case weakMapCtorString:
2920
+ return weakMapTag;
2921
+ }
2922
+ }
2923
+ return result;
2924
+ };
2925
+ }
2926
+ function isIndex(value, length) {
2927
+ length = length == null ? MAX_SAFE_INTEGER : length;
2928
+ return !!length && (typeof value == "number" || reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
2929
+ }
2930
+ function isKeyable(value) {
2931
+ var type = typeof value;
2932
+ return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
2933
+ }
2934
+ function isMasked(func) {
2935
+ return !!maskSrcKey && maskSrcKey in func;
2936
+ }
2937
+ function isPrototype(value) {
2938
+ var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto;
2939
+ return value === proto;
2940
+ }
2941
+ function objectToString(value) {
2942
+ return nativeObjectToString.call(value);
2943
+ }
2944
+ function toSource(func) {
2945
+ if (func != null) {
2946
+ try {
2947
+ return funcToString.call(func);
2948
+ } catch (e) {
2949
+ }
2950
+ try {
2951
+ return func + "";
2952
+ } catch (e) {
2953
+ }
2954
+ }
2955
+ return "";
2956
+ }
2957
+ function eq(value, other) {
2958
+ return value === other || value !== value && other !== other;
2959
+ }
2960
+ var isArguments = baseIsArguments(/* @__PURE__ */ function() {
2961
+ return arguments;
2962
+ }()) ? baseIsArguments : function(value) {
2963
+ return isObjectLike(value) && hasOwnProperty.call(value, "callee") && !propertyIsEnumerable.call(value, "callee");
2964
+ };
2965
+ var isArray = Array.isArray;
2966
+ function isArrayLike(value) {
2967
+ return value != null && isLength(value.length) && !isFunction(value);
2968
+ }
2969
+ var isBuffer = nativeIsBuffer || stubFalse;
2970
+ function isEqual2(value, other) {
2971
+ return baseIsEqual(value, other);
2972
+ }
2973
+ function isFunction(value) {
2974
+ if (!isObject(value)) {
2975
+ return false;
2976
+ }
2977
+ var tag = baseGetTag(value);
2978
+ return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
2979
+ }
2980
+ function isLength(value) {
2981
+ return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
2982
+ }
2983
+ function isObject(value) {
2984
+ var type = typeof value;
2985
+ return value != null && (type == "object" || type == "function");
2986
+ }
2987
+ function isObjectLike(value) {
2988
+ return value != null && typeof value == "object";
2989
+ }
2990
+ var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
2991
+ function keys(object) {
2992
+ return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
2993
+ }
2994
+ function stubArray() {
2995
+ return [];
2996
+ }
2997
+ function stubFalse() {
2998
+ return false;
2999
+ }
3000
+ module.exports = isEqual2;
3001
+ }
3002
+ });
3003
+
3004
+ // src/index.ts
3005
+ init_esm_shims();
3006
+
3007
+ // src/build.ts
3008
+ init_esm_shims();
3009
+
3010
+ // ../../node_modules/.pnpm/tinyrainbow@1.1.1/node_modules/tinyrainbow/dist/node.js
3011
+ init_esm_shims();
3012
+
3013
+ // ../../node_modules/.pnpm/tinyrainbow@1.1.1/node_modules/tinyrainbow/dist/chunk-5WCZOS7T.js
3014
+ init_esm_shims();
3015
+ var b = {
3016
+ reset: [0, 0],
3017
+ bold: [1, 22, "\x1B[22m\x1B[1m"],
3018
+ dim: [2, 22, "\x1B[22m\x1B[2m"],
3019
+ italic: [3, 23],
3020
+ underline: [4, 24],
3021
+ inverse: [7, 27],
3022
+ hidden: [8, 28],
3023
+ strikethrough: [9, 29],
3024
+ black: [30, 39],
3025
+ red: [31, 39],
3026
+ green: [32, 39],
3027
+ yellow: [33, 39],
3028
+ blue: [34, 39],
3029
+ magenta: [35, 39],
3030
+ cyan: [36, 39],
3031
+ white: [37, 39],
3032
+ gray: [90, 39],
3033
+ bgBlack: [40, 49],
3034
+ bgRed: [41, 49],
3035
+ bgGreen: [42, 49],
3036
+ bgYellow: [43, 49],
3037
+ bgBlue: [44, 49],
3038
+ bgMagenta: [45, 49],
3039
+ bgCyan: [46, 49],
3040
+ bgWhite: [47, 49]
3041
+ };
3042
+ var C = Object.entries(b);
3043
+ function d(r2) {
3044
+ return String(r2);
113
3045
  }
114
- function randomPicoColour(text, colors = defaultColours) {
115
- const colours = pc3.createColors(true);
116
- if (!text) {
117
- return colours.white(text);
118
- }
119
- const colour = randomColour(text, colors);
120
- const isDark = colour.includes("dark");
121
- const key = colour.replace("dark", "").toLowerCase();
122
- const formatter = colours[key];
123
- if (isDark) {
124
- return pc3.bold(formatter(text));
125
- }
126
- if (typeof formatter !== "function") {
127
- throw new Error("Formatter for picoColor is not of type function/Formatter");
128
- }
129
- return formatter(text);
3046
+ d.open = "";
3047
+ d.close = "";
3048
+ function p(r2 = false) {
3049
+ let n = typeof process != "undefined" ? process : void 0, t = (n == null ? void 0 : n.env) || {}, a = (n == null ? void 0 : n.argv) || [];
3050
+ return !("NO_COLOR" in t || a.includes("--no-color")) && !("GITHUB_ACTIONS" in t) && ("FORCE_COLOR" in t || a.includes("--color") || (n == null ? void 0 : n.platform) === "win32" || r2 && t.TERM !== "dumb" || "CI" in t) || typeof window != "undefined" && !!window.chrome;
3051
+ }
3052
+ function w(r2 = false) {
3053
+ let n = p(r2), t = (e, o, c, i) => {
3054
+ let u = e.substring(0, i) + c, s = e.substring(i + o.length), l = s.indexOf(o);
3055
+ return ~l ? u + t(s, o, c, l) : u + s;
3056
+ }, a = (e, o, c = e) => {
3057
+ let i = (u) => {
3058
+ let s = String(u), l = s.indexOf(o, e.length);
3059
+ return ~l ? e + t(s, o, c, l) + o : e + s + o;
3060
+ };
3061
+ return i.open = e, i.close = o, i;
3062
+ }, g = {
3063
+ isColorSupported: n
3064
+ }, f = (e) => `\x1B[${e}m`;
3065
+ for (let [e, o] of C)
3066
+ g[e] = n ? a(
3067
+ f(o[0]),
3068
+ f(o[1]),
3069
+ o[2]
3070
+ ) : d;
3071
+ return g;
3072
+ }
3073
+ var p2 = w(isatty(1));
3074
+
3075
+ // src/fs/clean.ts
3076
+ init_esm_shims();
3077
+ var import_fs_extra = __toESM(require_lib(), 1);
3078
+ async function clean(path5) {
3079
+ return (0, import_fs_extra.remove)(path5);
130
3080
  }
131
- function slash(path3, platform = "linux") {
132
- const isWindowsPath = /^\\\\\?\\/.test(path3);
3081
+
3082
+ // src/fs/read.ts
3083
+ init_esm_shims();
3084
+ var import_fs_extra2 = __toESM(require_lib(), 1);
3085
+ function slash(path5, platform = "linux") {
3086
+ const isWindowsPath = /^\\\\\?\\/.test(path5);
133
3087
  if (["linux", "mac"].includes(platform) && !isWindowsPath) {
134
- return path3.replaceAll(/\\/g, "/").replace("../", "").trimEnd();
3088
+ return path5.replaceAll(/\\/g, "/").replace("../", "").trimEnd();
135
3089
  }
136
- return path3.replaceAll(/\\/g, "/").replace("../", "").trimEnd();
3090
+ return path5.replaceAll(/\\/g, "/").replace("../", "").trimEnd();
137
3091
  }
138
3092
  function getRelativePath(rootDir, filePath, platform = "linux") {
139
3093
  if (!rootDir || !filePath) {
@@ -148,11 +3102,11 @@ function getRelativePath(rootDir, filePath, platform = "linux") {
148
3102
  }
149
3103
  var reader = switcher(
150
3104
  {
151
- node: async (path3) => {
152
- return fs2.readFile(path3, { encoding: "utf8" });
3105
+ node: async (path5) => {
3106
+ return import_fs_extra2.default.readFile(path5, { encoding: "utf8" });
153
3107
  },
154
- bun: async (path3) => {
155
- const file = Bun.file(path3);
3108
+ bun: async (path5) => {
3109
+ const file = Bun.file(path5);
156
3110
  return file.text();
157
3111
  }
158
3112
  },
@@ -160,8 +3114,8 @@ var reader = switcher(
160
3114
  );
161
3115
  switcher(
162
3116
  {
163
- node: (path3) => {
164
- return fs2.readFileSync(path3, { encoding: "utf8" });
3117
+ node: (path5) => {
3118
+ return import_fs_extra2.default.readFileSync(path5, { encoding: "utf8" });
165
3119
  },
166
3120
  bun: () => {
167
3121
  throw new Error("Bun cannot read sync");
@@ -169,22 +3123,108 @@ switcher(
169
3123
  },
170
3124
  "node"
171
3125
  );
172
- async function read(path3) {
173
- return reader(path3);
3126
+ async function read(path5) {
3127
+ return reader(path5);
3128
+ }
3129
+
3130
+ // src/utils/URLPath.ts
3131
+ init_esm_shims();
3132
+
3133
+ // src/transformers/index.ts
3134
+ init_esm_shims();
3135
+
3136
+ // src/transformers/casing.ts
3137
+ init_esm_shims();
3138
+
3139
+ // ../../node_modules/.pnpm/change-case@5.2.0/node_modules/change-case/dist/index.js
3140
+ init_esm_shims();
3141
+ var SPLIT_LOWER_UPPER_RE = /([\p{Ll}\d])(\p{Lu})/gu;
3142
+ var SPLIT_UPPER_UPPER_RE = /(\p{Lu})([\p{Lu}][\p{Ll}])/gu;
3143
+ var SPLIT_NUMBER_LOWER_RE = /(\d)(\p{Ll})/gu;
3144
+ var SPLIT_LETTER_NUMBER_RE = /(\p{L})(\d)/gu;
3145
+ var DEFAULT_STRIP_REGEXP = /[^\p{L}\d]+/giu;
3146
+ var SPLIT_REPLACE_VALUE = "$1\0$2";
3147
+ var DEFAULT_PREFIX_CHARACTERS = "";
3148
+ function split(input, options) {
3149
+ let result = input.trim();
3150
+ result = result.replace(SPLIT_LOWER_UPPER_RE, SPLIT_REPLACE_VALUE).replace(SPLIT_UPPER_UPPER_RE, SPLIT_REPLACE_VALUE);
3151
+ if (options?.separateNumbers) {
3152
+ result = result.replace(SPLIT_NUMBER_LOWER_RE, SPLIT_REPLACE_VALUE).replace(SPLIT_LETTER_NUMBER_RE, SPLIT_REPLACE_VALUE);
3153
+ }
3154
+ result = result.replace(DEFAULT_STRIP_REGEXP, "\0");
3155
+ let start = 0;
3156
+ let end = result.length;
3157
+ while (result.charAt(start) === "\0")
3158
+ start++;
3159
+ if (start === end)
3160
+ return [];
3161
+ while (result.charAt(end - 1) === "\0")
3162
+ end--;
3163
+ return result.slice(start, end).split(/\0/g);
3164
+ }
3165
+ function camelCase(input, options) {
3166
+ const prefix = getPrefix(input, options?.prefixCharacters);
3167
+ const lower = lowerFactory(options?.locale);
3168
+ const upper = upperFactory(options?.locale);
3169
+ const transform = options?.mergeAmbiguousCharacters ? capitalCaseTransformFactory(lower, upper) : pascalCaseTransformFactory(lower, upper);
3170
+ return prefix + split(input, options).map((word, index) => {
3171
+ if (index === 0)
3172
+ return lower(word);
3173
+ return transform(word, index);
3174
+ }).join(options?.delimiter ?? "");
3175
+ }
3176
+ function pascalCase(input, options) {
3177
+ const prefix = getPrefix(input, options?.prefixCharacters);
3178
+ const lower = lowerFactory(options?.locale);
3179
+ const upper = upperFactory(options?.locale);
3180
+ const transform = options?.mergeAmbiguousCharacters ? capitalCaseTransformFactory(lower, upper) : pascalCaseTransformFactory(lower, upper);
3181
+ return prefix + split(input, options).map(transform).join(options?.delimiter ?? "");
3182
+ }
3183
+ function lowerFactory(locale) {
3184
+ return locale === false ? (input) => input.toLowerCase() : (input) => input.toLocaleLowerCase(locale);
3185
+ }
3186
+ function upperFactory(locale) {
3187
+ return locale === false ? (input) => input.toUpperCase() : (input) => input.toLocaleUpperCase(locale);
174
3188
  }
175
- function camelCase(text) {
176
- return camelCase$1(text, { delimiter: "", stripRegexp: /[^A-Z0-9$]/gi, transform: camelCaseTransformMerge });
3189
+ function capitalCaseTransformFactory(lower, upper) {
3190
+ return (word) => `${upper(word[0])}${lower(word.slice(1))}`;
177
3191
  }
178
- function pascalCase(text) {
179
- return pascalCase$1(text, { delimiter: "", stripRegexp: /[^A-Z0-9$]/gi, transform: pascalCaseTransformMerge });
3192
+ function pascalCaseTransformFactory(lower, upper) {
3193
+ return (word, index) => {
3194
+ const char0 = word[0];
3195
+ const initial = index > 0 && char0 >= "0" && char0 <= "9" ? "_" + char0 : upper(char0);
3196
+ return initial + lower(word.slice(1));
3197
+ };
3198
+ }
3199
+ function getPrefix(input, prefixCharacters = DEFAULT_PREFIX_CHARACTERS) {
3200
+ let prefix = "";
3201
+ for (let i = 0; i < input.length; i++) {
3202
+ const char = input.charAt(i);
3203
+ if (prefixCharacters.includes(char)) {
3204
+ prefix += char;
3205
+ } else {
3206
+ break;
3207
+ }
3208
+ }
3209
+ return prefix;
3210
+ }
3211
+
3212
+ // src/transformers/casing.ts
3213
+ function camelCase2(text) {
3214
+ return camelCase(text, { delimiter: "", mergeAmbiguousCharacters: true });
3215
+ }
3216
+ function pascalCase2(text) {
3217
+ return pascalCase(text, { delimiter: "", mergeAmbiguousCharacters: true });
180
3218
  }
181
3219
 
182
3220
  // src/transformers/combineCodes.ts
3221
+ init_esm_shims();
183
3222
  function combineCodes(codes) {
184
3223
  return codes.join("\n");
185
3224
  }
186
3225
 
187
3226
  // src/transformers/createJSDocBlockText.ts
3227
+ init_esm_shims();
188
3228
  function createJSDocBlockText({ comments }) {
189
3229
  const filteredComments = comments.filter(Boolean);
190
3230
  if (!filteredComments.length) {
@@ -196,6 +3236,7 @@ function createJSDocBlockText({ comments }) {
196
3236
  }
197
3237
 
198
3238
  // src/transformers/escape.ts
3239
+ init_esm_shims();
199
3240
  function escape(text) {
200
3241
  return text ? text.replaceAll("`", "\\`") : "";
201
3242
  }
@@ -221,22 +3262,25 @@ function jsStringEscape(input) {
221
3262
  }
222
3263
 
223
3264
  // src/transformers/indent.ts
3265
+ init_esm_shims();
224
3266
  function createIndent(size) {
225
3267
  return Array.from({ length: size + 1 }).join(" ");
226
3268
  }
227
3269
 
228
3270
  // src/transformers/nameSorter.ts
229
- function nameSorter(a, b) {
230
- if (a.name < b.name) {
3271
+ init_esm_shims();
3272
+ function nameSorter(a, b2) {
3273
+ if (a.name < b2.name) {
231
3274
  return -1;
232
3275
  }
233
- if (a.name > b.name) {
3276
+ if (a.name > b2.name) {
234
3277
  return 1;
235
3278
  }
236
3279
  return 0;
237
3280
  }
238
3281
 
239
3282
  // src/transformers/searchAndReplace.ts
3283
+ init_esm_shims();
240
3284
  function searchAndReplace(options) {
241
3285
  const { text, replaceBy, prefix = "", key } = options;
242
3286
  const searchValues = options.searchValues?.(prefix, key) || [
@@ -254,6 +3298,7 @@ function searchAndReplace(options) {
254
3298
  }
255
3299
 
256
3300
  // src/transformers/transformReservedWord.ts
3301
+ init_esm_shims();
257
3302
  var reservedWords = [
258
3303
  "abstract",
259
3304
  "arguments",
@@ -347,6 +3392,7 @@ function transformReservedWord(word) {
347
3392
  }
348
3393
 
349
3394
  // src/transformers/trim.ts
3395
+ init_esm_shims();
350
3396
  function trim(text) {
351
3397
  return text.replaceAll(/\n/g, "").trim();
352
3398
  }
@@ -368,14 +3414,14 @@ var transformers_default = {
368
3414
  JSDoc: {
369
3415
  createJSDocBlockText
370
3416
  },
371
- camelCase,
372
- pascalCase
3417
+ camelCase: camelCase2,
3418
+ pascalCase: pascalCase2
373
3419
  };
374
3420
 
375
3421
  // src/utils/URLPath.ts
376
3422
  var URLPath = class {
377
- constructor(path3) {
378
- this.path = path3;
3423
+ constructor(path5) {
3424
+ this.path = path5;
379
3425
  return this;
380
3426
  }
381
3427
  /**
@@ -470,6 +3516,7 @@ var URLPath = class {
470
3516
  };
471
3517
 
472
3518
  // src/config.ts
3519
+ init_esm_shims();
473
3520
  function defineConfig(options) {
474
3521
  return options;
475
3522
  }
@@ -477,34 +3524,33 @@ function isInputPath(result) {
477
3524
  return !!result && "path" in result;
478
3525
  }
479
3526
 
480
- // src/utils/timeout.ts
481
- async function timeout(ms) {
482
- return new Promise((resolve3) => {
483
- setTimeout(() => {
484
- resolve3(true);
485
- }, ms);
486
- });
487
- }
488
- async function saveCreateDirectory(path3) {
489
- const passedPath = dirname(resolve(path3));
490
- await fs2.mkdir(passedPath, { recursive: true });
3527
+ // src/FileManager.ts
3528
+ init_esm_shims();
3529
+ var import_lodash = __toESM(require_lodash(), 1);
3530
+
3531
+ // src/fs/write.ts
3532
+ init_esm_shims();
3533
+ var import_fs_extra3 = __toESM(require_lib(), 1);
3534
+ async function saveCreateDirectory(path5) {
3535
+ const passedPath = dirname(resolve(path5));
3536
+ await import_fs_extra3.default.mkdir(passedPath, { recursive: true });
491
3537
  }
492
3538
  var writer = switcher(
493
3539
  {
494
- node: async (path3, data) => {
3540
+ node: async (path5, data) => {
495
3541
  try {
496
- await fs2.stat(resolve(path3));
497
- const oldContent = await fs2.readFile(resolve(path3), { encoding: "utf-8" });
3542
+ await import_fs_extra3.default.stat(resolve(path5));
3543
+ const oldContent = await import_fs_extra3.default.readFile(resolve(path5), { encoding: "utf-8" });
498
3544
  if (oldContent?.toString() === data?.toString()) {
499
3545
  return;
500
3546
  }
501
3547
  } catch (_err) {
502
3548
  }
503
- await saveCreateDirectory(path3);
504
- await fs2.writeFile(resolve(path3), data, { encoding: "utf-8" });
505
- const savedData = await fs2.readFile(resolve(path3), { encoding: "utf-8" });
3549
+ await saveCreateDirectory(path5);
3550
+ await import_fs_extra3.default.writeFile(resolve(path5), data, { encoding: "utf-8" });
3551
+ const savedData = await import_fs_extra3.default.readFile(resolve(path5), { encoding: "utf-8" });
506
3552
  if (savedData?.toString() !== data?.toString()) {
507
- throw new Error(`Sanity check failed for ${path3}
3553
+ throw new Error(`Sanity check failed for ${path5}
508
3554
 
509
3555
  Data[${data.length}]:
510
3556
  ${data}
@@ -515,14 +3561,14 @@ ${savedData}
515
3561
  }
516
3562
  return savedData;
517
3563
  },
518
- bun: async (path3, data) => {
3564
+ bun: async (path5, data) => {
519
3565
  try {
520
- await saveCreateDirectory(path3);
521
- await Bun.write(resolve(path3), data);
522
- const file = Bun.file(resolve(path3));
3566
+ await saveCreateDirectory(path5);
3567
+ await Bun.write(resolve(path5), data);
3568
+ const file = Bun.file(resolve(path5));
523
3569
  const savedData = await file.text();
524
3570
  if (savedData?.toString() !== data?.toString()) {
525
- throw new Error(`Sanity check failed for ${path3}
3571
+ throw new Error(`Sanity check failed for ${path5}
526
3572
 
527
3573
  Data[${data.length}]:
528
3574
  ${data}
@@ -533,18 +3579,34 @@ ${savedData}
533
3579
  }
534
3580
  return savedData;
535
3581
  } catch (e) {
536
- console.log(e, resolve(path3));
3582
+ console.log(e, resolve(path5));
537
3583
  }
538
3584
  }
539
3585
  },
540
3586
  "node"
541
3587
  );
542
- async function write(data, path3) {
3588
+ async function write(data, path5) {
543
3589
  if (data.trim() === "") {
544
3590
  return void 0;
545
3591
  }
546
- return writer(path3, data.trim());
3592
+ return writer(path5, data.trim());
3593
+ }
3594
+
3595
+ // src/utils/timeout.ts
3596
+ init_esm_shims();
3597
+ async function timeout(ms) {
3598
+ return new Promise((resolve3) => {
3599
+ setTimeout(() => {
3600
+ resolve3(true);
3601
+ }, ms);
3602
+ });
547
3603
  }
3604
+
3605
+ // src/BarrelManager.ts
3606
+ init_esm_shims();
3607
+
3608
+ // src/utils/TreeNode.ts
3609
+ init_esm_shims();
548
3610
  var TreeNode = class _TreeNode {
549
3611
  constructor(data, parent) {
550
3612
  this.children = [];
@@ -607,10 +3669,10 @@ var TreeNode = class _TreeNode {
607
3669
  }
608
3670
  return this;
609
3671
  }
610
- static build(path3, options = {}) {
3672
+ static build(path5, options = {}) {
611
3673
  try {
612
3674
  const exclude = Array.isArray(options.exclude) ? options.exclude : [options.exclude].filter(Boolean);
613
- const filteredTree = dirTree(path3, { extensions: options.extensions, exclude: [/node_modules/, ...exclude] });
3675
+ const filteredTree = dirTree(path5, { extensions: options.extensions, exclude: [/node_modules/, ...exclude] });
614
3676
  if (!filteredTree) {
615
3677
  return null;
616
3678
  }
@@ -650,7 +3712,7 @@ var BarrelManager = class {
650
3712
  return [];
651
3713
  }
652
3714
  if (treeNode2.children.length > 1) {
653
- const indexPath = path.resolve(treeNode2.data.path, "index.ts");
3715
+ const indexPath = path4.resolve(treeNode2.data.path, "index.ts");
654
3716
  const exports = treeNode2.children.filter(Boolean).map((file) => {
655
3717
  const importPath = file.data.type === "directory" ? `./${file.data.name}/index` : `./${transformers_default.trimExtName(file.data.name)}`;
656
3718
  if (importPath.endsWith("index") && file.data.type === "file") {
@@ -672,7 +3734,7 @@ var BarrelManager = class {
672
3734
  });
673
3735
  } else if (treeNode2.children.length === 1) {
674
3736
  const [treeNodeChild] = treeNode2.children;
675
- const indexPath = path.resolve(treeNode2.data.path, "index.ts");
3737
+ const indexPath = path4.resolve(treeNode2.data.path, "index.ts");
676
3738
  const importPath = treeNodeChild.data.type === "directory" ? `./${treeNodeChild.data.name}/index` : `./${transformers_default.trimExtName(treeNodeChild.data.name)}`;
677
3739
  const exports = [
678
3740
  {
@@ -795,15 +3857,15 @@ var _FileManager = class _FileManager {
795
3857
  });
796
3858
  return cache;
797
3859
  }
798
- get(path3) {
799
- return __privateGet(this, _cache).get(path3);
3860
+ get(path5) {
3861
+ return __privateGet(this, _cache).get(path5);
800
3862
  }
801
- remove(path3) {
802
- const cacheItem = this.get(path3);
3863
+ remove(path5) {
3864
+ const cacheItem = this.get(path5);
803
3865
  if (!cacheItem) {
804
3866
  return;
805
3867
  }
806
- __privateGet(this, _cache).delete(path3);
3868
+ __privateGet(this, _cache).delete(path5);
807
3869
  }
808
3870
  async write(...params) {
809
3871
  if (!__privateGet(this, _isWriting)) {
@@ -820,63 +3882,13 @@ var _FileManager = class _FileManager {
820
3882
  }
821
3883
  // statics
822
3884
  static getSource(file) {
823
- if (!_FileManager.isExtensionAllowed(file.baseName)) {
824
- return file.source;
825
- }
826
- const exports = file.exports ? combineExports(file.exports) : [];
827
- const imports = file.imports ? combineImports(file.imports, exports, file.source) : [];
828
- const importNodes = imports.filter((item) => {
829
- return item.path !== transformers_default.trimExtName(file.path);
830
- }).map((item) => {
831
- return factory.createImportDeclaration({
832
- name: item.name,
833
- path: item.root ? getRelativePath(item.root, item.path) : item.path,
834
- isTypeOnly: item.isTypeOnly
835
- });
836
- });
837
- const exportNodes = exports.map(
838
- (item) => factory.createExportDeclaration({
839
- name: item.name,
840
- path: item.path,
841
- isTypeOnly: item.isTypeOnly,
842
- asAlias: item.asAlias
843
- })
844
- );
845
- return [print([...importNodes, ...exportNodes]), getEnvSource(file.source, file.env)].join("\n");
846
- }
847
- static combineFiles(files) {
848
- return files.filter(Boolean).reduce((acc, file) => {
849
- const prevIndex = acc.findIndex((item) => item.path === file.path);
850
- if (prevIndex === -1) {
851
- return [...acc, file];
852
- }
853
- const prev = acc[prevIndex];
854
- if (prev && file.override) {
855
- acc[prevIndex] = {
856
- imports: [],
857
- exports: [],
858
- ...file
859
- };
860
- return acc;
861
- }
862
- if (prev) {
863
- acc[prevIndex] = {
864
- ...file,
865
- source: prev.source && file.source ? `${prev.source}
866
- ${file.source}` : "",
867
- imports: [...prev.imports || [], ...file.imports || []],
868
- exports: [...prev.exports || [], ...file.exports || []],
869
- env: { ...prev.env || {}, ...file.env || {} }
870
- };
871
- }
872
- return acc;
873
- }, []);
3885
+ return getSource(file);
874
3886
  }
875
- static getMode(path3) {
876
- if (!path3) {
3887
+ static getMode(path5) {
3888
+ if (!path5) {
877
3889
  return "directory";
878
3890
  }
879
- return extname(path3) ? "file" : "directory";
3891
+ return extname(path5) ? "file" : "directory";
880
3892
  }
881
3893
  static get extensions() {
882
3894
  return [".js", ".ts", ".tsx"];
@@ -925,16 +3937,41 @@ ${file.source}` : "",
925
3937
  return __privateMethod(this, _add, add_fn).call(this, file);
926
3938
  };
927
3939
  var FileManager = _FileManager;
3940
+ function getSource(file) {
3941
+ if (!FileManager.isExtensionAllowed(file.baseName)) {
3942
+ return file.source;
3943
+ }
3944
+ const exports = file.exports ? combineExports(file.exports) : [];
3945
+ const imports = file.imports ? combineImports(file.imports, exports, file.source) : [];
3946
+ const importNodes = imports.filter((item) => {
3947
+ return item.path !== transformers_default.trimExtName(file.path);
3948
+ }).map((item) => {
3949
+ return factory.createImportDeclaration({
3950
+ name: item.name,
3951
+ path: item.root ? getRelativePath(item.root, item.path) : item.path,
3952
+ isTypeOnly: item.isTypeOnly
3953
+ });
3954
+ });
3955
+ const exportNodes = exports.map(
3956
+ (item) => factory.createExportDeclaration({
3957
+ name: item.name,
3958
+ path: item.path,
3959
+ isTypeOnly: item.isTypeOnly,
3960
+ asAlias: item.asAlias
3961
+ })
3962
+ );
3963
+ return [print([...importNodes, ...exportNodes]), getEnvSource(file.source, file.env)].join("\n");
3964
+ }
928
3965
  function combineExports(exports) {
929
3966
  const combinedExports = orderBy(exports, [(v) => !v.isTypeOnly], ["asc"]).reduce((prev, curr) => {
930
3967
  const name = curr.name;
931
3968
  const prevByPath = prev.findLast((imp) => imp.path === curr.path);
932
- const prevByPathAndIsTypeOnly = prev.findLast((imp) => imp.path === curr.path && isEqual(imp.name, name) && imp.isTypeOnly);
3969
+ const prevByPathAndIsTypeOnly = prev.findLast((imp) => imp.path === curr.path && (0, import_lodash.default)(imp.name, name) && imp.isTypeOnly);
933
3970
  if (prevByPathAndIsTypeOnly) {
934
3971
  return prev;
935
3972
  }
936
3973
  const uniquePrev = prev.findLast(
937
- (imp) => imp.path === curr.path && isEqual(imp.name, name) && imp.isTypeOnly === curr.isTypeOnly && imp.asAlias === curr.asAlias
3974
+ (imp) => imp.path === curr.path && (0, import_lodash.default)(imp.name, name) && imp.isTypeOnly === curr.isTypeOnly && imp.asAlias === curr.asAlias
938
3975
  );
939
3976
  if (uniquePrev || Array.isArray(name) && !name.length || prevByPath?.asAlias && !curr.asAlias) {
940
3977
  return prev;
@@ -970,8 +4007,8 @@ function combineImports(imports, exports, source) {
970
4007
  name = name.filter((item) => typeof item === "string" ? hasImportInSource(item) : hasImportInSource(item.propertyName));
971
4008
  }
972
4009
  const prevByPath = prev.findLast((imp) => imp.path === curr.path && imp.isTypeOnly === curr.isTypeOnly);
973
- const uniquePrev = prev.findLast((imp) => imp.path === curr.path && isEqual(imp.name, name) && imp.isTypeOnly === curr.isTypeOnly);
974
- const prevByPathNameAndIsTypeOnly = prev.findLast((imp) => imp.path === curr.path && isEqual(imp.name, name) && imp.isTypeOnly);
4010
+ const uniquePrev = prev.findLast((imp) => imp.path === curr.path && (0, import_lodash.default)(imp.name, name) && imp.isTypeOnly === curr.isTypeOnly);
4011
+ const prevByPathNameAndIsTypeOnly = prev.findLast((imp) => imp.path === curr.path && (0, import_lodash.default)(imp.name, name) && imp.isTypeOnly);
975
4012
  if (prevByPathNameAndIsTypeOnly) {
976
4013
  return prev;
977
4014
  }
@@ -1020,6 +4057,83 @@ function getEnvSource(source, env) {
1020
4057
  return prev;
1021
4058
  }, source);
1022
4059
  }
4060
+
4061
+ // src/logger.ts
4062
+ init_esm_shims();
4063
+ var LogLevel = {
4064
+ silent: "silent",
4065
+ info: "info",
4066
+ debug: "debug"
4067
+ };
4068
+ function createLogger({ logLevel, name, spinner }) {
4069
+ const logs = [];
4070
+ const log = (message) => {
4071
+ if (message && spinner) {
4072
+ spinner.text = message;
4073
+ logs.push(message);
4074
+ }
4075
+ };
4076
+ const error = (message) => {
4077
+ if (message) {
4078
+ throw new Error(message || "Something went wrong");
4079
+ }
4080
+ };
4081
+ const warn = (message) => {
4082
+ if (message && spinner) {
4083
+ spinner.warn(p2.yellow(message));
4084
+ logs.push(message);
4085
+ }
4086
+ };
4087
+ const info = (message) => {
4088
+ if (message && spinner && logLevel !== LogLevel.silent) {
4089
+ spinner.info(message);
4090
+ logs.push(message);
4091
+ }
4092
+ };
4093
+ const logger = {
4094
+ name,
4095
+ logLevel,
4096
+ log,
4097
+ error,
4098
+ warn,
4099
+ info,
4100
+ spinner,
4101
+ logs
4102
+ };
4103
+ return logger;
4104
+ }
4105
+ var defaultColours = ["black", "blue", "darkBlue", "cyan", "gray", "green", "darkGreen", "magenta", "red", "darkRed", "yellow", "darkYellow"];
4106
+ function randomColour(text, colours = defaultColours) {
4107
+ if (!text) {
4108
+ return "white";
4109
+ }
4110
+ const random = seedrandom(text);
4111
+ const colour = colours.at(Math.floor(random() * colours.length)) || "white";
4112
+ return colour;
4113
+ }
4114
+ function randomCliColour(text, colors = defaultColours) {
4115
+ const colours = w(true);
4116
+ if (!text) {
4117
+ return colours.white(text);
4118
+ }
4119
+ const colour = randomColour(text, colors);
4120
+ const isDark = colour.includes("dark");
4121
+ const key = colour.replace("dark", "").toLowerCase();
4122
+ const formatter = colours[key];
4123
+ if (isDark) {
4124
+ return p2.bold(formatter(text));
4125
+ }
4126
+ if (typeof formatter !== "function") {
4127
+ throw new Error("Formatter for picoColor is not of type function/Formatter");
4128
+ }
4129
+ return formatter(text);
4130
+ }
4131
+
4132
+ // src/PluginManager.ts
4133
+ init_esm_shims();
4134
+
4135
+ // src/utils/EventEmitter.ts
4136
+ init_esm_shims();
1023
4137
  var _emitter;
1024
4138
  var EventEmitter = class {
1025
4139
  constructor() {
@@ -1040,6 +4154,9 @@ var EventEmitter = class {
1040
4154
  }
1041
4155
  };
1042
4156
  _emitter = new WeakMap();
4157
+
4158
+ // src/utils/Queue.ts
4159
+ init_esm_shims();
1043
4160
  var _queue2, _workerCount, _maxParallel, _debug, _work, work_fn;
1044
4161
  var Queue = class {
1045
4162
  constructor(maxParallel, debug = false) {
@@ -1112,6 +4229,7 @@ work_fn = function() {
1112
4229
  };
1113
4230
 
1114
4231
  // src/utils/uniqueName.ts
4232
+ init_esm_shims();
1115
4233
  function setUniqueName(originalName, data) {
1116
4234
  let used = data[originalName] || 0;
1117
4235
  if (used) {
@@ -1123,6 +4241,7 @@ function setUniqueName(originalName, data) {
1123
4241
  }
1124
4242
 
1125
4243
  // src/errors.ts
4244
+ init_esm_shims();
1126
4245
  var Warning = class extends Error {
1127
4246
  constructor(message, options) {
1128
4247
  super(message, { cause: options?.cause });
@@ -1132,7 +4251,11 @@ var Warning = class extends Error {
1132
4251
  var ValidationPluginError = class extends Error {
1133
4252
  };
1134
4253
 
4254
+ // src/plugin.ts
4255
+ init_esm_shims();
4256
+
1135
4257
  // src/utils/cache.ts
4258
+ init_esm_shims();
1136
4259
  function createPluginCache(Store = /* @__PURE__ */ Object.create(null)) {
1137
4260
  return {
1138
4261
  set(id, value) {
@@ -1200,8 +4323,8 @@ var definePlugin = createPlugin((options) => {
1200
4323
  };
1201
4324
  },
1202
4325
  resolvePath(baseName) {
1203
- const root = path.resolve(this.config.root, this.config.output.path);
1204
- return path.resolve(root, baseName);
4326
+ const root = path4.resolve(this.config.root, this.config.output.path);
4327
+ return path4.resolve(root, baseName);
1205
4328
  },
1206
4329
  resolveName(name) {
1207
4330
  return name;
@@ -1209,7 +4332,11 @@ var definePlugin = createPlugin((options) => {
1209
4332
  };
1210
4333
  });
1211
4334
 
4335
+ // src/PromiseManager.ts
4336
+ init_esm_shims();
4337
+
1212
4338
  // src/utils/executeStrategies.ts
4339
+ init_esm_shims();
1213
4340
  function hookSeq(promises) {
1214
4341
  return promises.filter(Boolean).reduce(
1215
4342
  (promise, func) => {
@@ -1296,7 +4423,7 @@ var PluginManager = class {
1296
4423
  __privateAdd(this, _executeSync);
1297
4424
  __privateAdd(this, _catcher);
1298
4425
  __privateAdd(this, _parse);
1299
- this.eventEmitter = new EventEmitter();
4426
+ this.events = new EventEmitter();
1300
4427
  this.executed = [];
1301
4428
  __privateAdd(this, _core, void 0);
1302
4429
  __privateAdd(this, _usedPluginNames, {});
@@ -1371,11 +4498,14 @@ Falling back on the first item.
1371
4498
  });
1372
4499
  return this;
1373
4500
  }
4501
+ /**
4502
+ * Instead of calling `pluginManager.events.on` you can use `pluginManager.on`. This one also has better types.
4503
+ */
1374
4504
  on(eventName, handler) {
1375
- this.eventEmitter.on(eventName, handler);
4505
+ this.events.on(eventName, handler);
1376
4506
  }
1377
4507
  /**
1378
- * Run only hook for a specific plugin name
4508
+ * Run a specific hookName for plugin x.
1379
4509
  */
1380
4510
  hookForPlugin({
1381
4511
  pluginKey,
@@ -1393,6 +4523,9 @@ Falling back on the first item.
1393
4523
  }).filter(Boolean);
1394
4524
  return Promise.all(promises);
1395
4525
  }
4526
+ /**
4527
+ * Run a specific hookName for plugin x.
4528
+ */
1396
4529
  hookForPluginSync({
1397
4530
  pluginKey,
1398
4531
  hookName,
@@ -1409,7 +4542,7 @@ Falling back on the first item.
1409
4542
  }).filter(Boolean);
1410
4543
  }
1411
4544
  /**
1412
- * Chains, first non-null result stops and returns
4545
+ * First non-null result stops and will return it's value.
1413
4546
  */
1414
4547
  async hookFirst({
1415
4548
  hookName,
@@ -1437,7 +4570,7 @@ Falling back on the first item.
1437
4570
  return __privateGet(this, _promiseManager).run("first", promises);
1438
4571
  }
1439
4572
  /**
1440
- * Chains, first non-null result stops and returns
4573
+ * First non-null result stops and will return it's value.
1441
4574
  */
1442
4575
  hookFirstSync({
1443
4576
  hookName,
@@ -1465,7 +4598,7 @@ Falling back on the first item.
1465
4598
  return parseResult;
1466
4599
  }
1467
4600
  /**
1468
- * Parallel, runs all plugins
4601
+ * Run all plugins in parallel(order will be based on `this.plugin` and if `pre` or `post` is set).
1469
4602
  */
1470
4603
  async hookParallel({
1471
4604
  hookName,
@@ -1484,7 +4617,7 @@ Falling back on the first item.
1484
4617
  return results.filter((result) => result.status === "fulfilled").map((result) => result.value);
1485
4618
  }
1486
4619
  /**
1487
- * Chains, reduces returned value, handling the reduced value as the first hook argument
4620
+ * 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.
1488
4621
  */
1489
4622
  hookReduceArg0({
1490
4623
  hookName,
@@ -1588,11 +4721,11 @@ getSortedPlugins_fn = function(hookName) {
1588
4721
  }
1589
4722
  }
1590
4723
  return plugin;
1591
- }).sort((a, b) => {
1592
- if (b.pre?.includes(a.name)) {
4724
+ }).sort((a, b2) => {
4725
+ if (b2.pre?.includes(a.name)) {
1593
4726
  return 1;
1594
4727
  }
1595
- if (b.post?.includes(a.name)) {
4728
+ if (b2.post?.includes(a.name)) {
1596
4729
  return -1;
1597
4730
  }
1598
4731
  return 0;
@@ -1601,7 +4734,7 @@ getSortedPlugins_fn = function(hookName) {
1601
4734
  _addExecutedToCallStack = new WeakSet();
1602
4735
  addExecutedToCallStack_fn = function(executer) {
1603
4736
  if (executer) {
1604
- this.eventEmitter.emit("executed", executer);
4737
+ this.events.emit("executed", executer);
1605
4738
  this.executed.push(executer);
1606
4739
  }
1607
4740
  };
@@ -1617,7 +4750,7 @@ execute_fn = function({
1617
4750
  if (!hook) {
1618
4751
  return null;
1619
4752
  }
1620
- this.eventEmitter.emit("execute", { strategy, hookName, parameters, plugin });
4753
+ this.events.emit("execute", { strategy, hookName, parameters, plugin });
1621
4754
  const task = Promise.resolve().then(() => {
1622
4755
  if (typeof hook === "function") {
1623
4756
  const possiblePromiseResult = hook.apply({ ...__privateGet(this, _core).api, plugin }, parameters);
@@ -1655,7 +4788,7 @@ executeSync_fn = function({
1655
4788
  if (!hook) {
1656
4789
  return null;
1657
4790
  }
1658
- this.eventEmitter.emit("execute", { strategy, hookName, parameters, plugin });
4791
+ this.events.emit("execute", { strategy, hookName, parameters, plugin });
1659
4792
  try {
1660
4793
  if (typeof hook === "function") {
1661
4794
  const fn = hook.apply({ ...__privateGet(this, _core).api, plugin }, parameters);
@@ -1681,7 +4814,7 @@ catcher_fn = function(e, plugin, hookName) {
1681
4814
  const text = `${e.message} (plugin: ${plugin?.name || "unknown"}, hook: ${hookName || "unknown"})
1682
4815
  `;
1683
4816
  this.logger.error(text);
1684
- this.eventEmitter.emit("error", e);
4817
+ this.events.emit("error", e);
1685
4818
  };
1686
4819
  _parse = new WeakSet();
1687
4820
  parse_fn = function(plugin, pluginManager, context) {
@@ -1723,7 +4856,7 @@ async function setup(options) {
1723
4856
  } catch (e) {
1724
4857
  if (isInputPath(config)) {
1725
4858
  throw new Error(
1726
- "Cannot read file/URL defined in `input.path` or set with `kubb generate PATH` in the CLI of your Kubb config " + pc3.dim(config.input.path),
4859
+ "Cannot read file/URL defined in `input.path` or set with `kubb generate PATH` in the CLI of your Kubb config " + p2.dim(config.input.path),
1727
4860
  {
1728
4861
  cause: e
1729
4862
  }
@@ -1734,11 +4867,11 @@ async function setup(options) {
1734
4867
  await clean(config.output.path);
1735
4868
  }
1736
4869
  const queueTask = async (file) => {
1737
- const { path: path3 } = file;
4870
+ const { path: path5 } = file;
1738
4871
  let code = FileManager.getSource(file);
1739
4872
  const { result: loadedResult } = await pluginManager.hookFirst({
1740
4873
  hookName: "load",
1741
- parameters: [path3]
4874
+ parameters: [path5]
1742
4875
  });
1743
4876
  if (loadedResult && isPromise(loadedResult)) {
1744
4877
  code = await loadedResult;
@@ -1749,7 +4882,7 @@ async function setup(options) {
1749
4882
  if (code) {
1750
4883
  const transformedCode = await pluginManager.hookReduceArg0({
1751
4884
  hookName: "transform",
1752
- parameters: [code, path3],
4885
+ parameters: [code, path5],
1753
4886
  reduce: transformReducer
1754
4887
  });
1755
4888
  if (config.output.write || config.output.write === void 0) {
@@ -1757,12 +4890,12 @@ async function setup(options) {
1757
4890
  return pluginManager.hookForPlugin({
1758
4891
  pluginKey: file.meta?.pluginKey,
1759
4892
  hookName: "writeFile",
1760
- parameters: [transformedCode, path3]
4893
+ parameters: [transformedCode, path5]
1761
4894
  });
1762
4895
  }
1763
4896
  return pluginManager.hookFirst({
1764
4897
  hookName: "writeFile",
1765
- parameters: [transformedCode, path3]
4898
+ parameters: [transformedCode, path5]
1766
4899
  });
1767
4900
  }
1768
4901
  }
@@ -1776,7 +4909,7 @@ async function setup(options) {
1776
4909
  logger.spinner.start(`\u{1F4BE} Writing`);
1777
4910
  }
1778
4911
  if (logger.logLevel === LogLevel.debug) {
1779
- logger.info(`PluginKey ${pc3.dim(JSON.stringify(plugin.key))}
4912
+ logger.info(`PluginKey ${p2.dim(JSON.stringify(plugin.key))}
1780
4913
  with source
1781
4914
 
1782
4915
  ${code}`);
@@ -1785,11 +4918,11 @@ ${code}`);
1785
4918
  });
1786
4919
  pluginManager.on("executed", (executer) => {
1787
4920
  const { hookName, plugin, output, parameters } = executer;
1788
- const messsage = `${randomPicoColour(plugin.name)} Executing ${hookName}`;
4921
+ const messsage = `${randomCliColour(plugin.name)} Executing ${hookName}`;
1789
4922
  if (logger.logLevel === LogLevel.info && logger.spinner) {
1790
4923
  if (hookName === "writeFile") {
1791
- const [_code, path3] = parameters;
1792
- logger.spinner.suffixText = pc3.dim(path3);
4924
+ const [_code, path5] = parameters;
4925
+ logger.spinner.suffixText = p2.dim(path5);
1793
4926
  } else {
1794
4927
  logger.spinner.suffixText = messsage;
1795
4928
  }
@@ -1797,9 +4930,9 @@ ${code}`);
1797
4930
  if (logger.logLevel === LogLevel.debug) {
1798
4931
  logger.info(messsage);
1799
4932
  const logs = [
1800
- parameters && `${pc3.bgWhite(`Parameters`)} ${randomPicoColour(plugin.name)} ${hookName}`,
4933
+ parameters && `${p2.bgWhite(`Parameters`)} ${randomCliColour(plugin.name)} ${hookName}`,
1801
4934
  JSON.stringify(parameters, void 0, 2),
1802
- output && `${pc3.bgWhite("Output")} ${randomPicoColour(plugin.name)} ${hookName}`,
4935
+ output && `${p2.bgWhite("Output")} ${randomCliColour(plugin.name)} ${hookName}`,
1803
4936
  output
1804
4937
  ].filter(Boolean);
1805
4938
  console.log(logs.join("\n"));
@@ -1841,6 +4974,7 @@ async function safeBuild(options) {
1841
4974
  }
1842
4975
 
1843
4976
  // src/Generator.ts
4977
+ init_esm_shims();
1844
4978
  var _options3, _context;
1845
4979
  var Generator = class {
1846
4980
  constructor(options, context) {
@@ -1866,6 +5000,301 @@ var Generator = class {
1866
5000
  };
1867
5001
  _options3 = new WeakMap();
1868
5002
  _context = new WeakMap();
5003
+
5004
+ // src/PackageManager.ts
5005
+ init_esm_shims();
5006
+
5007
+ // ../../node_modules/.pnpm/find-up@7.0.0/node_modules/find-up/index.js
5008
+ init_esm_shims();
5009
+
5010
+ // ../../node_modules/.pnpm/locate-path@7.2.0/node_modules/locate-path/index.js
5011
+ init_esm_shims();
5012
+
5013
+ // ../../node_modules/.pnpm/p-locate@6.0.0/node_modules/p-locate/index.js
5014
+ init_esm_shims();
5015
+
5016
+ // ../../node_modules/.pnpm/p-limit@4.0.0/node_modules/p-limit/index.js
5017
+ init_esm_shims();
5018
+
5019
+ // ../../node_modules/.pnpm/yocto-queue@1.0.0/node_modules/yocto-queue/index.js
5020
+ init_esm_shims();
5021
+ var Node = class {
5022
+ constructor(value) {
5023
+ __publicField(this, "value");
5024
+ __publicField(this, "next");
5025
+ this.value = value;
5026
+ }
5027
+ };
5028
+ var _head, _tail, _size;
5029
+ var Queue2 = class {
5030
+ constructor() {
5031
+ __privateAdd(this, _head, void 0);
5032
+ __privateAdd(this, _tail, void 0);
5033
+ __privateAdd(this, _size, void 0);
5034
+ this.clear();
5035
+ }
5036
+ enqueue(value) {
5037
+ const node = new Node(value);
5038
+ if (__privateGet(this, _head)) {
5039
+ __privateGet(this, _tail).next = node;
5040
+ __privateSet(this, _tail, node);
5041
+ } else {
5042
+ __privateSet(this, _head, node);
5043
+ __privateSet(this, _tail, node);
5044
+ }
5045
+ __privateWrapper(this, _size)._++;
5046
+ }
5047
+ dequeue() {
5048
+ const current = __privateGet(this, _head);
5049
+ if (!current) {
5050
+ return;
5051
+ }
5052
+ __privateSet(this, _head, __privateGet(this, _head).next);
5053
+ __privateWrapper(this, _size)._--;
5054
+ return current.value;
5055
+ }
5056
+ clear() {
5057
+ __privateSet(this, _head, void 0);
5058
+ __privateSet(this, _tail, void 0);
5059
+ __privateSet(this, _size, 0);
5060
+ }
5061
+ get size() {
5062
+ return __privateGet(this, _size);
5063
+ }
5064
+ *[Symbol.iterator]() {
5065
+ let current = __privateGet(this, _head);
5066
+ while (current) {
5067
+ yield current.value;
5068
+ current = current.next;
5069
+ }
5070
+ }
5071
+ };
5072
+ _head = new WeakMap();
5073
+ _tail = new WeakMap();
5074
+ _size = new WeakMap();
5075
+
5076
+ // ../../node_modules/.pnpm/p-limit@4.0.0/node_modules/p-limit/index.js
5077
+ function pLimit(concurrency) {
5078
+ if (!((Number.isInteger(concurrency) || concurrency === Number.POSITIVE_INFINITY) && concurrency > 0)) {
5079
+ throw new TypeError("Expected `concurrency` to be a number from 1 and up");
5080
+ }
5081
+ const queue = new Queue2();
5082
+ let activeCount = 0;
5083
+ const next = () => {
5084
+ activeCount--;
5085
+ if (queue.size > 0) {
5086
+ queue.dequeue()();
5087
+ }
5088
+ };
5089
+ const run = async (fn, resolve3, args) => {
5090
+ activeCount++;
5091
+ const result = (async () => fn(...args))();
5092
+ resolve3(result);
5093
+ try {
5094
+ await result;
5095
+ } catch {
5096
+ }
5097
+ next();
5098
+ };
5099
+ const enqueue = (fn, resolve3, args) => {
5100
+ queue.enqueue(run.bind(void 0, fn, resolve3, args));
5101
+ (async () => {
5102
+ await Promise.resolve();
5103
+ if (activeCount < concurrency && queue.size > 0) {
5104
+ queue.dequeue()();
5105
+ }
5106
+ })();
5107
+ };
5108
+ const generator = (fn, ...args) => new Promise((resolve3) => {
5109
+ enqueue(fn, resolve3, args);
5110
+ });
5111
+ Object.defineProperties(generator, {
5112
+ activeCount: {
5113
+ get: () => activeCount
5114
+ },
5115
+ pendingCount: {
5116
+ get: () => queue.size
5117
+ },
5118
+ clearQueue: {
5119
+ value: () => {
5120
+ queue.clear();
5121
+ }
5122
+ }
5123
+ });
5124
+ return generator;
5125
+ }
5126
+
5127
+ // ../../node_modules/.pnpm/p-locate@6.0.0/node_modules/p-locate/index.js
5128
+ var EndError = class extends Error {
5129
+ constructor(value) {
5130
+ super();
5131
+ this.value = value;
5132
+ }
5133
+ };
5134
+ var testElement = async (element, tester) => tester(await element);
5135
+ var finder = async (element) => {
5136
+ const values = await Promise.all(element);
5137
+ if (values[1] === true) {
5138
+ throw new EndError(values[0]);
5139
+ }
5140
+ return false;
5141
+ };
5142
+ async function pLocate(iterable, tester, {
5143
+ concurrency = Number.POSITIVE_INFINITY,
5144
+ preserveOrder = true
5145
+ } = {}) {
5146
+ const limit = pLimit(concurrency);
5147
+ const items = [...iterable].map((element) => [element, limit(testElement, element, tester)]);
5148
+ const checkLimit = pLimit(preserveOrder ? 1 : Number.POSITIVE_INFINITY);
5149
+ try {
5150
+ await Promise.all(items.map((element) => checkLimit(finder, element)));
5151
+ } catch (error) {
5152
+ if (error instanceof EndError) {
5153
+ return error.value;
5154
+ }
5155
+ throw error;
5156
+ }
5157
+ }
5158
+
5159
+ // ../../node_modules/.pnpm/locate-path@7.2.0/node_modules/locate-path/index.js
5160
+ var typeMappings = {
5161
+ directory: "isDirectory",
5162
+ file: "isFile"
5163
+ };
5164
+ function checkType(type) {
5165
+ if (Object.hasOwnProperty.call(typeMappings, type)) {
5166
+ return;
5167
+ }
5168
+ throw new Error(`Invalid type specified: ${type}`);
5169
+ }
5170
+ var matchType = (type, stat) => stat[typeMappings[type]]();
5171
+ var toPath = (urlOrPath) => urlOrPath instanceof URL ? fileURLToPath(urlOrPath) : urlOrPath;
5172
+ async function locatePath(paths, {
5173
+ cwd = process2.cwd(),
5174
+ type = "file",
5175
+ allowSymlinks = true,
5176
+ concurrency,
5177
+ preserveOrder
5178
+ } = {}) {
5179
+ checkType(type);
5180
+ cwd = toPath(cwd);
5181
+ const statFunction = allowSymlinks ? promises.stat : promises.lstat;
5182
+ return pLocate(paths, async (path_) => {
5183
+ try {
5184
+ const stat = await statFunction(path4.resolve(cwd, path_));
5185
+ return matchType(type, stat);
5186
+ } catch {
5187
+ return false;
5188
+ }
5189
+ }, { concurrency, preserveOrder });
5190
+ }
5191
+ function locatePathSync(paths, {
5192
+ cwd = process2.cwd(),
5193
+ type = "file",
5194
+ allowSymlinks = true
5195
+ } = {}) {
5196
+ checkType(type);
5197
+ cwd = toPath(cwd);
5198
+ const statFunction = allowSymlinks ? fs3.statSync : fs3.lstatSync;
5199
+ for (const path_ of paths) {
5200
+ try {
5201
+ const stat = statFunction(path4.resolve(cwd, path_), {
5202
+ throwIfNoEntry: false
5203
+ });
5204
+ if (!stat) {
5205
+ continue;
5206
+ }
5207
+ if (matchType(type, stat)) {
5208
+ return path_;
5209
+ }
5210
+ } catch {
5211
+ }
5212
+ }
5213
+ }
5214
+
5215
+ // ../../node_modules/.pnpm/unicorn-magic@0.1.0/node_modules/unicorn-magic/node.js
5216
+ init_esm_shims();
5217
+ function toPath2(urlOrPath) {
5218
+ return urlOrPath instanceof URL ? fileURLToPath(urlOrPath) : urlOrPath;
5219
+ }
5220
+
5221
+ // ../../node_modules/.pnpm/path-exists@5.0.0/node_modules/path-exists/index.js
5222
+ init_esm_shims();
5223
+
5224
+ // ../../node_modules/.pnpm/find-up@7.0.0/node_modules/find-up/index.js
5225
+ var findUpStop = Symbol("findUpStop");
5226
+ async function findUpMultiple(name, options = {}) {
5227
+ let directory = path4.resolve(toPath2(options.cwd) ?? "");
5228
+ const { root } = path4.parse(directory);
5229
+ const stopAt = path4.resolve(directory, toPath2(options.stopAt ?? root));
5230
+ const limit = options.limit ?? Number.POSITIVE_INFINITY;
5231
+ const paths = [name].flat();
5232
+ const runMatcher = async (locateOptions) => {
5233
+ if (typeof name !== "function") {
5234
+ return locatePath(paths, locateOptions);
5235
+ }
5236
+ const foundPath = await name(locateOptions.cwd);
5237
+ if (typeof foundPath === "string") {
5238
+ return locatePath([foundPath], locateOptions);
5239
+ }
5240
+ return foundPath;
5241
+ };
5242
+ const matches = [];
5243
+ while (true) {
5244
+ const foundPath = await runMatcher({ ...options, cwd: directory });
5245
+ if (foundPath === findUpStop) {
5246
+ break;
5247
+ }
5248
+ if (foundPath) {
5249
+ matches.push(path4.resolve(directory, foundPath));
5250
+ }
5251
+ if (directory === stopAt || matches.length >= limit) {
5252
+ break;
5253
+ }
5254
+ directory = path4.dirname(directory);
5255
+ }
5256
+ return matches;
5257
+ }
5258
+ function findUpMultipleSync(name, options = {}) {
5259
+ let directory = path4.resolve(toPath2(options.cwd) ?? "");
5260
+ const { root } = path4.parse(directory);
5261
+ const stopAt = path4.resolve(directory, toPath2(options.stopAt) ?? root);
5262
+ const limit = options.limit ?? Number.POSITIVE_INFINITY;
5263
+ const paths = [name].flat();
5264
+ const runMatcher = (locateOptions) => {
5265
+ if (typeof name !== "function") {
5266
+ return locatePathSync(paths, locateOptions);
5267
+ }
5268
+ const foundPath = name(locateOptions.cwd);
5269
+ if (typeof foundPath === "string") {
5270
+ return locatePathSync([foundPath], locateOptions);
5271
+ }
5272
+ return foundPath;
5273
+ };
5274
+ const matches = [];
5275
+ while (true) {
5276
+ const foundPath = runMatcher({ ...options, cwd: directory });
5277
+ if (foundPath === findUpStop) {
5278
+ break;
5279
+ }
5280
+ if (foundPath) {
5281
+ matches.push(path4.resolve(directory, foundPath));
5282
+ }
5283
+ if (directory === stopAt || matches.length >= limit) {
5284
+ break;
5285
+ }
5286
+ directory = path4.dirname(directory);
5287
+ }
5288
+ return matches;
5289
+ }
5290
+ async function findUp(name, options = {}) {
5291
+ const matches = await findUpMultiple(name, { ...options, limit: 1 });
5292
+ return matches[0];
5293
+ }
5294
+ function findUpSync(name, options = {}) {
5295
+ const matches = findUpMultipleSync(name, { ...options, limit: 1 });
5296
+ return matches[0];
5297
+ }
1869
5298
  var _cache2, _cwd, _SLASHES, _match, match_fn;
1870
5299
  var _PackageManager = class _PackageManager {
1871
5300
  constructor(workspace) {
@@ -1889,17 +5318,17 @@ var _PackageManager = class _PackageManager {
1889
5318
  }
1890
5319
  return directory;
1891
5320
  }
1892
- getLocation(path3) {
1893
- let location = path3;
5321
+ getLocation(path5) {
5322
+ let location = path5;
1894
5323
  if (__privateGet(this, _cwd)) {
1895
5324
  const require2 = mod.createRequire(this.normalizeDirectory(__privateGet(this, _cwd)));
1896
- location = require2.resolve(path3);
5325
+ location = require2.resolve(path5);
1897
5326
  }
1898
5327
  return location;
1899
5328
  }
1900
- async import(path3) {
5329
+ async import(path5) {
1901
5330
  try {
1902
- let location = this.getLocation(path3);
5331
+ let location = this.getLocation(path5);
1903
5332
  if (os.platform() == "win32") {
1904
5333
  location = pathToFileURL(location).href;
1905
5334
  }
@@ -1998,6 +5427,6 @@ var PackageManager = _PackageManager;
1998
5427
  // src/index.ts
1999
5428
  var src_default = build;
2000
5429
 
2001
- export { FileManager, Generator, KubbFile, PackageManager, PluginManager, PromiseManager, ValidationPluginError, Warning, build, combineExports, combineImports, createPlugin, src_default as default, defineConfig, isInputPath, pluginName as name, pluginName, safeBuild };
5430
+ export { FileManager, Generator, KubbFile, PackageManager, PluginManager, PromiseManager, Warning, build, createPlugin, src_default as default, defineConfig, isInputPath, pluginName as name, pluginName, safeBuild };
2002
5431
  //# sourceMappingURL=out.js.map
2003
5432
  //# sourceMappingURL=index.js.map